htmlIsBooleanAttr:
  362|  15.9k|{
  363|  15.9k|    const char *str = NULL;
  364|       |
  365|  15.9k|    if (name == NULL)
  ------------------
  |  Branch (365:9): [True: 0, False: 15.9k]
  ------------------
  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|  15.9k|    switch (name[0] | 0x20) {
  ------------------
  |  Branch (388:13): [True: 8.79k, False: 7.11k]
  ------------------
  389|  2.44k|        case 'c':
  ------------------
  |  Branch (389:9): [True: 2.44k, False: 13.4k]
  ------------------
  390|  2.44k|            name += 1;
  391|  2.44k|            switch (name[0] | 0x20) {
  ------------------
  |  Branch (391:21): [True: 287, False: 2.16k]
  ------------------
  392|     97|                case 'h': str = "ecked"; break;
  ------------------
  |  Branch (392:17): [True: 97, False: 2.35k]
  ------------------
  393|    190|                case 'o': str = "mpact"; break;
  ------------------
  |  Branch (393:17): [True: 190, False: 2.25k]
  ------------------
  394|  2.44k|            }
  395|  2.44k|            break;
  396|  3.00k|        case 'd':
  ------------------
  |  Branch (396:9): [True: 3.00k, False: 12.9k]
  ------------------
  397|  3.00k|            name += 1;
  398|  3.00k|            switch (name[0] | 0x20) {
  ------------------
  |  Branch (398:21): [True: 642, False: 2.35k]
  ------------------
  399|    420|                case 'e':
  ------------------
  |  Branch (399:17): [True: 420, False: 2.58k]
  ------------------
  400|    420|                    name += 1;
  401|    420|                    switch (name[0] | 0x20) {
  ------------------
  |  Branch (401:29): [True: 191, False: 229]
  ------------------
  402|     98|                        case 'c': str = "lare"; break;
  ------------------
  |  Branch (402:25): [True: 98, False: 322]
  ------------------
  403|     93|                        case 'f': str = "er"; break;
  ------------------
  |  Branch (403:25): [True: 93, False: 327]
  ------------------
  404|    420|                    }
  405|    420|                    break;
  406|    420|                case 'i': str = "sabled"; break;
  ------------------
  |  Branch (406:17): [True: 222, False: 2.77k]
  ------------------
  407|  3.00k|            }
  408|  3.00k|            break;
  409|  3.00k|        case 'i':
  ------------------
  |  Branch (409:9): [True: 394, False: 15.5k]
  ------------------
  410|    394|            str = "smap";
  411|    394|            break;
  412|    207|        case 'm':
  ------------------
  |  Branch (412:9): [True: 207, False: 15.7k]
  ------------------
  413|    207|            str = "ultiple";
  414|    207|            break;
  415|  2.27k|        case 'n':
  ------------------
  |  Branch (415:9): [True: 2.27k, False: 13.6k]
  ------------------
  416|  2.27k|            name += 1;
  417|  2.27k|            if ((name[0] | 0x20) != 'o')
  ------------------
  |  Branch (417:17): [True: 1.05k, False: 1.21k]
  ------------------
  418|  1.05k|                break;
  419|  1.21k|            name += 1;
  420|  1.21k|            switch (name[0] | 0x20) {
  ------------------
  |  Branch (420:21): [True: 1.03k, False: 184]
  ------------------
  421|    173|                case 'h': str = "ref"; break;
  ------------------
  |  Branch (421:17): [True: 173, False: 1.04k]
  ------------------
  422|    691|                case 'r': str = "esize"; break;
  ------------------
  |  Branch (422:17): [True: 691, False: 526]
  ------------------
  423|     94|                case 's': str = "hade"; break;
  ------------------
  |  Branch (423:17): [True: 94, False: 1.12k]
  ------------------
  424|     75|                case 'w': str = "rap"; break;
  ------------------
  |  Branch (424:17): [True: 75, False: 1.14k]
  ------------------
  425|  1.21k|            }
  426|  1.21k|            break;
  427|  1.21k|        case 'r':
  ------------------
  |  Branch (427:9): [True: 202, False: 15.7k]
  ------------------
  428|    202|            str = "eadonly";
  429|    202|            break;
  430|    272|        case 's':
  ------------------
  |  Branch (430:9): [True: 272, False: 15.6k]
  ------------------
  431|    272|            str = "elected";
  432|    272|            break;
  433|  15.9k|    }
  434|       |
  435|  15.9k|    if (str == NULL)
  ------------------
  |  Branch (435:9): [True: 13.1k, False: 2.80k]
  ------------------
  436|  13.1k|        return(0);
  437|       |
  438|  2.80k|    return(xmlStrcasecmp(name + 1, BAD_CAST str) == 0);
  ------------------
  |  |   34|  2.80k|#define BAD_CAST (xmlChar *)
  ------------------
  439|  15.9k|}

xmlSAX2InternalSubset:
  242|  16.0k|{
  243|  16.0k|    xmlParserCtxtPtr ctxt = (xmlParserCtxtPtr) ctx;
  244|  16.0k|    xmlDtdPtr dtd;
  245|  16.0k|    if (ctx == NULL) return;
  ------------------
  |  Branch (245:9): [True: 0, False: 16.0k]
  ------------------
  246|       |
  247|  16.0k|    if (ctxt->myDoc == NULL)
  ------------------
  |  Branch (247:9): [True: 0, False: 16.0k]
  ------------------
  248|      0|	return;
  249|  16.0k|    if ((ctxt->html) && (ctxt->instate != XML_PARSER_MISC))
  ------------------
  |  Branch (249:9): [True: 0, False: 16.0k]
  |  Branch (249:25): [True: 0, False: 0]
  ------------------
  250|      0|        return;
  251|  16.0k|    dtd = xmlGetIntSubset(ctxt->myDoc);
  252|  16.0k|    if (dtd != NULL) {
  ------------------
  |  Branch (252:9): [True: 0, False: 16.0k]
  ------------------
  253|      0|	xmlUnlinkNode((xmlNodePtr) dtd);
  254|      0|	xmlFreeDtd(dtd);
  255|      0|	ctxt->myDoc->intSubset = NULL;
  256|      0|    }
  257|  16.0k|    ctxt->myDoc->intSubset =
  258|  16.0k|	xmlCreateIntSubset(ctxt->myDoc, name, publicId, systemId);
  259|  16.0k|    if (ctxt->myDoc->intSubset == NULL)
  ------------------
  |  Branch (259:9): [True: 9, False: 16.0k]
  ------------------
  260|      9|        xmlSAX2ErrMemory(ctxt);
  261|  16.0k|}
xmlSAX2ExternalSubset:
  274|  13.9k|{
  275|  13.9k|    xmlParserCtxtPtr ctxt = (xmlParserCtxtPtr) ctx;
  276|  13.9k|    if (ctx == NULL) return;
  ------------------
  |  Branch (276:9): [True: 0, False: 13.9k]
  ------------------
  277|  13.9k|    if ((systemId != NULL) &&
  ------------------
  |  Branch (277:9): [True: 2.30k, False: 11.6k]
  ------------------
  278|  2.30k|        ((ctxt->options & XML_PARSE_NO_XXE) == 0) &&
  ------------------
  |  Branch (278:9): [True: 2.07k, False: 228]
  ------------------
  279|  2.07k|        (((ctxt->validate) || (ctxt->loadsubset & ~XML_SKIP_IDS)) &&
  ------------------
  |  |  210|    800|#define XML_SKIP_IDS		8
  ------------------
  |  Branch (279:11): [True: 1.27k, False: 800]
  |  Branch (279:31): [True: 634, False: 166]
  ------------------
  280|  1.90k|	 (ctxt->wellFormed && ctxt->myDoc))) {
  ------------------
  |  Branch (280:4): [True: 1.85k, False: 53]
  |  Branch (280:24): [True: 1.85k, False: 0]
  ------------------
  281|       |	/*
  282|       |	 * Try to fetch and parse the external subset.
  283|       |	 */
  284|  1.85k|	xmlParserInputPtr oldinput;
  285|  1.85k|	int oldinputNr;
  286|  1.85k|	int oldinputMax;
  287|  1.85k|	xmlParserInputPtr *oldinputTab;
  288|  1.85k|	xmlParserInputPtr input = NULL;
  289|  1.85k|	xmlChar *oldencoding;
  290|  1.85k|        unsigned long consumed;
  291|  1.85k|        size_t buffered;
  292|  1.85k|#ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
  293|  1.85k|        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|  1.85k|	if ((ctxt->sax != NULL) && (ctxt->sax->resolveEntity != NULL))
  ------------------
  |  Branch (301:6): [True: 1.85k, False: 0]
  |  Branch (301:29): [True: 1.85k, False: 0]
  ------------------
  302|  1.85k|	    input = ctxt->sax->resolveEntity(ctxt->userData, publicId,
  303|  1.85k|	                                     systemId);
  304|  1.85k|	if (input == NULL) {
  ------------------
  |  Branch (304:6): [True: 657, False: 1.19k]
  ------------------
  305|    657|	    return;
  306|    657|	}
  307|       |
  308|  1.19k|	if (xmlNewDtd(ctxt->myDoc, name, publicId, systemId) == NULL) {
  ------------------
  |  Branch (308:6): [True: 3, False: 1.19k]
  ------------------
  309|      3|            xmlSAX2ErrMemory(ctxt);
  310|      3|            xmlFreeInputStream(input);
  311|      3|            return;
  312|      3|        }
  313|       |
  314|       |	/*
  315|       |	 * make sure we won't destroy the main document context
  316|       |	 */
  317|  1.19k|	oldinput = ctxt->input;
  318|  1.19k|	oldinputNr = ctxt->inputNr;
  319|  1.19k|	oldinputMax = ctxt->inputMax;
  320|  1.19k|	oldinputTab = ctxt->inputTab;
  321|  1.19k|	oldencoding = ctxt->encoding;
  322|  1.19k|	ctxt->encoding = NULL;
  323|       |
  324|  1.19k|	ctxt->inputTab = xmlMalloc(inputMax * sizeof(xmlParserInputPtr));
  325|  1.19k|	if (ctxt->inputTab == NULL) {
  ------------------
  |  Branch (325:6): [True: 1, False: 1.19k]
  ------------------
  326|      1|	    xmlSAX2ErrMemory(ctxt);
  327|      1|            goto error;
  328|      1|	}
  329|  1.19k|	ctxt->inputNr = 0;
  330|  1.19k|	ctxt->inputMax = inputMax;
  331|  1.19k|	ctxt->input = NULL;
  332|  1.19k|	if (xmlCtxtPushInput(ctxt, input) < 0)
  ------------------
  |  Branch (332:6): [True: 2, False: 1.19k]
  ------------------
  333|      2|            goto error;
  334|       |
  335|  1.19k|	if (input->filename == NULL)
  ------------------
  |  Branch (335:6): [True: 0, False: 1.19k]
  ------------------
  336|      0|	    input->filename = (char *) xmlCanonicPath(systemId);
  337|  1.19k|	input->line = 1;
  338|  1.19k|	input->col = 1;
  339|  1.19k|	input->base = ctxt->input->cur;
  340|  1.19k|	input->cur = ctxt->input->cur;
  341|  1.19k|	input->free = NULL;
  342|       |
  343|       |	/*
  344|       |	 * let's parse that entity knowing it's an external subset.
  345|       |	 */
  346|  1.19k|	xmlParseExternalSubset(ctxt, publicId, systemId);
  347|       |
  348|       |        /*
  349|       |	 * Free up the external entities
  350|       |	 */
  351|       |
  352|  1.24k|	while (ctxt->inputNr > 1)
  ------------------
  |  Branch (352:9): [True: 58, False: 1.19k]
  ------------------
  353|     58|	    xmlFreeInputStream(xmlCtxtPopInput(ctxt));
  354|       |
  355|  1.19k|        consumed = ctxt->input->consumed;
  356|  1.19k|        buffered = ctxt->input->cur - ctxt->input->base;
  357|  1.19k|        if (buffered > ULONG_MAX - consumed)
  ------------------
  |  Branch (357:13): [True: 0, False: 1.19k]
  ------------------
  358|      0|            consumed = ULONG_MAX;
  359|  1.19k|        else
  360|  1.19k|            consumed += buffered;
  361|  1.19k|        if (consumed > ULONG_MAX - ctxt->sizeentities)
  ------------------
  |  Branch (361:13): [True: 0, False: 1.19k]
  ------------------
  362|      0|            ctxt->sizeentities = ULONG_MAX;
  363|  1.19k|        else
  364|  1.19k|            ctxt->sizeentities += consumed;
  365|       |
  366|  1.19k|error:
  367|  1.19k|	xmlFreeInputStream(input);
  368|  1.19k|        xmlFree(ctxt->inputTab);
  369|       |
  370|       |	/*
  371|       |	 * Restore the parsing context of the main entity
  372|       |	 */
  373|  1.19k|	ctxt->input = oldinput;
  374|  1.19k|	ctxt->inputNr = oldinputNr;
  375|  1.19k|	ctxt->inputMax = oldinputMax;
  376|  1.19k|	ctxt->inputTab = oldinputTab;
  377|  1.19k|	if (ctxt->encoding != NULL)
  ------------------
  |  Branch (377:6): [True: 49, False: 1.14k]
  ------------------
  378|     49|	    xmlFree(ctxt->encoding);
  379|  1.19k|	ctxt->encoding = oldencoding;
  380|       |	/* ctxt->wellFormed = oldwellFormed; */
  381|  1.19k|    }
  382|  13.9k|}
xmlSAX2ResolveEntity:
  396|  1.85k|{
  397|  1.85k|    xmlParserCtxtPtr ctxt = (xmlParserCtxtPtr) ctx;
  398|  1.85k|    xmlParserInputPtr ret = NULL;
  399|  1.85k|    xmlChar *URI = NULL;
  400|       |
  401|  1.85k|    if (ctx == NULL) return(NULL);
  ------------------
  |  Branch (401:9): [True: 0, False: 1.85k]
  ------------------
  402|       |
  403|  1.85k|    if (systemId != NULL) {
  ------------------
  |  Branch (403:9): [True: 1.85k, False: 0]
  ------------------
  404|  1.85k|        const xmlChar *base = NULL;
  405|  1.85k|        int res;
  406|       |
  407|  1.85k|        if (ctxt->input != NULL)
  ------------------
  |  Branch (407:13): [True: 1.85k, False: 0]
  ------------------
  408|  1.85k|            base = BAD_CAST ctxt->input->filename;
  ------------------
  |  |   34|  1.85k|#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|  1.85k|        if (base == NULL)
  ------------------
  |  Branch (414:13): [True: 1.63k, False: 222]
  ------------------
  415|  1.63k|            base = BAD_CAST ctxt->directory;
  ------------------
  |  |   34|  1.63k|#define BAD_CAST (xmlChar *)
  ------------------
  416|       |
  417|  1.85k|        if ((xmlStrlen(systemId) > XML_MAX_URI_LENGTH) ||
  ------------------
  |  |   11|  1.85k|#define XML_MAX_URI_LENGTH 2000
  ------------------
  |  Branch (417:13): [True: 1, False: 1.85k]
  ------------------
  418|  1.85k|            (xmlStrlen(base) > XML_MAX_URI_LENGTH)) {
  ------------------
  |  |   11|  1.85k|#define XML_MAX_URI_LENGTH 2000
  ------------------
  |  Branch (418:13): [True: 0, False: 1.85k]
  ------------------
  419|      1|            xmlFatalErr(ctxt, XML_ERR_RESOURCE_LIMIT, "URI too long");
  420|      1|            return(NULL);
  421|      1|        }
  422|  1.85k|        res = xmlBuildURISafe(systemId, base, &URI);
  423|  1.85k|        if (URI == NULL) {
  ------------------
  |  Branch (423:13): [True: 8, False: 1.84k]
  ------------------
  424|      8|            if (res < 0)
  ------------------
  |  Branch (424:17): [True: 2, False: 6]
  ------------------
  425|      2|                xmlSAX2ErrMemory(ctxt);
  426|      6|            else
  427|      6|                xmlWarnMsg(ctxt, XML_ERR_INVALID_URI,
  428|      6|                           "Can't resolve URI: %s\n", systemId);
  429|      8|            return(NULL);
  430|      8|        }
  431|  1.84k|        if (xmlStrlen(URI) > XML_MAX_URI_LENGTH) {
  ------------------
  |  |   11|  1.84k|#define XML_MAX_URI_LENGTH 2000
  ------------------
  |  Branch (431:13): [True: 0, False: 1.84k]
  ------------------
  432|      0|            xmlFatalErr(ctxt, XML_ERR_RESOURCE_LIMIT, "URI too long");
  433|      0|            xmlFree(URI);
  434|      0|            return(NULL);
  435|      0|        }
  436|  1.84k|    }
  437|       |
  438|  1.84k|    ret = xmlLoadResource(ctxt, (const char *) URI,
  439|  1.84k|                          (const char *) publicId, XML_RESOURCE_DTD);
  440|       |
  441|  1.84k|    xmlFree(URI);
  442|  1.84k|    return(ret);
  443|  1.85k|}
xmlSAX2GetEntity:
  454|  2.19M|{
  455|  2.19M|    xmlParserCtxtPtr ctxt = (xmlParserCtxtPtr) ctx;
  456|  2.19M|    xmlEntityPtr ret = NULL;
  457|       |
  458|  2.19M|    if (ctx == NULL) return(NULL);
  ------------------
  |  Branch (458:9): [True: 0, False: 2.19M]
  ------------------
  459|       |
  460|  2.19M|    if (ctxt->inSubset == 0) {
  ------------------
  |  Branch (460:9): [True: 1.78M, False: 407k]
  ------------------
  461|  1.78M|	ret = xmlGetPredefinedEntity(name);
  462|  1.78M|	if (ret != NULL)
  ------------------
  |  Branch (462:6): [True: 432k, False: 1.35M]
  ------------------
  463|   432k|	    return(ret);
  464|  1.78M|    }
  465|  1.75M|    if ((ctxt->myDoc != NULL) && (ctxt->myDoc->standalone == 1)) {
  ------------------
  |  Branch (465:9): [True: 1.75M, False: 208]
  |  Branch (465:34): [True: 1.50k, False: 1.75M]
  ------------------
  466|  1.50k|	if (ctxt->inSubset == 2) {
  ------------------
  |  Branch (466:6): [True: 227, False: 1.27k]
  ------------------
  467|    227|	    ctxt->myDoc->standalone = 0;
  468|    227|	    ret = xmlGetDocEntity(ctxt->myDoc, name);
  469|    227|	    ctxt->myDoc->standalone = 1;
  470|  1.27k|	} else {
  471|  1.27k|	    ret = xmlGetDocEntity(ctxt->myDoc, name);
  472|  1.27k|	    if (ret == NULL) {
  ------------------
  |  Branch (472:10): [True: 977, False: 296]
  ------------------
  473|    977|		ctxt->myDoc->standalone = 0;
  474|    977|		ret = xmlGetDocEntity(ctxt->myDoc, name);
  475|    977|		if (ret != NULL) {
  ------------------
  |  Branch (475:7): [True: 376, False: 601]
  ------------------
  476|    376|		    xmlFatalErrMsg(ctxt, XML_ERR_NOT_STANDALONE,
  477|    376|	 "Entity(%s) document marked standalone but requires external subset\n",
  478|    376|				   name, NULL);
  479|    376|		}
  480|    977|		ctxt->myDoc->standalone = 1;
  481|    977|	    }
  482|  1.27k|	}
  483|  1.75M|    } else {
  484|  1.75M|	ret = xmlGetDocEntity(ctxt->myDoc, name);
  485|  1.75M|    }
  486|  1.75M|    return(ret);
  487|  2.19M|}
xmlSAX2GetParameterEntity:
  498|   377k|{
  499|   377k|    xmlParserCtxtPtr ctxt = (xmlParserCtxtPtr) ctx;
  500|   377k|    xmlEntityPtr ret;
  501|       |
  502|   377k|    if (ctx == NULL) return(NULL);
  ------------------
  |  Branch (502:9): [True: 0, False: 377k]
  ------------------
  503|       |
  504|   377k|    ret = xmlGetParameterEntity(ctxt->myDoc, name);
  505|   377k|    return(ret);
  506|   377k|}
xmlSAX2EntityDecl:
  522|   113k|{
  523|   113k|    xmlEntityPtr ent;
  524|   113k|    xmlParserCtxtPtr ctxt = (xmlParserCtxtPtr) ctx;
  525|   113k|    int extSubset;
  526|   113k|    int res;
  527|       |
  528|   113k|    if ((ctxt == NULL) || (ctxt->myDoc == NULL))
  ------------------
  |  Branch (528:9): [True: 0, False: 113k]
  |  Branch (528:27): [True: 0, False: 113k]
  ------------------
  529|      0|        return;
  530|       |
  531|   113k|    extSubset = ctxt->inSubset == 2;
  532|   113k|    res = xmlAddEntity(ctxt->myDoc, extSubset, name, type, publicId, systemId,
  533|   113k|                       content, &ent);
  534|   113k|    switch (res) {
  535|  17.1k|        case XML_ERR_OK:
  ------------------
  |  Branch (535:9): [True: 17.1k, False: 96.5k]
  ------------------
  536|  17.1k|            break;
  537|     21|        case XML_ERR_NO_MEMORY:
  ------------------
  |  Branch (537:9): [True: 21, False: 113k]
  ------------------
  538|     21|            xmlSAX2ErrMemory(ctxt);
  539|     21|            return;
  540|  94.1k|        case XML_WAR_ENTITY_REDEFINED:
  ------------------
  |  Branch (540:9): [True: 94.1k, False: 19.4k]
  ------------------
  541|  94.1k|            if (ctxt->pedantic) {
  ------------------
  |  Branch (541:17): [True: 5.54k, False: 88.6k]
  ------------------
  542|  5.54k|                if (extSubset)
  ------------------
  |  Branch (542:21): [True: 623, False: 4.92k]
  ------------------
  543|    623|                    xmlWarnMsg(ctxt, res, "Entity(%s) already defined in the"
  544|    623|                               " external subset\n", name);
  545|  4.92k|                else
  546|  4.92k|                    xmlWarnMsg(ctxt, res, "Entity(%s) already defined in the"
  547|  4.92k|                               " internal subset\n", name);
  548|  5.54k|            }
  549|  94.1k|            return;
  550|  2.35k|        case XML_ERR_REDECL_PREDEF_ENTITY:
  ------------------
  |  Branch (550:9): [True: 2.35k, False: 111k]
  ------------------
  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|  2.35k|            xmlWarnMsg(ctxt, res, "Invalid redeclaration of predefined"
  556|  2.35k|                       " entity '%s'", name);
  557|  2.35k|            return;
  558|      0|        default:
  ------------------
  |  Branch (558:9): [True: 0, False: 113k]
  ------------------
  559|      0|            xmlFatalErrMsg(ctxt, XML_ERR_INTERNAL_ERROR,
  560|      0|                           "Unexpected error code from xmlAddEntity\n",
  561|      0|                           NULL, NULL);
  562|      0|            return;
  563|   113k|    }
  564|       |
  565|  17.1k|    if ((ent->URI == NULL) && (systemId != NULL)) {
  ------------------
  |  Branch (565:9): [True: 17.1k, False: 0]
  |  Branch (565:31): [True: 6.47k, False: 10.6k]
  ------------------
  566|  6.47k|        xmlChar *URI;
  567|  6.47k|        const char *base = NULL;
  568|  6.47k|        int i;
  569|       |
  570|  12.4k|        for (i = ctxt->inputNr - 1; i >= 0; i--) {
  ------------------
  |  Branch (570:37): [True: 6.54k, False: 5.92k]
  ------------------
  571|  6.54k|            if (ctxt->inputTab[i]->filename != NULL) {
  ------------------
  |  Branch (571:17): [True: 547, False: 5.99k]
  ------------------
  572|    547|                base = ctxt->inputTab[i]->filename;
  573|    547|                break;
  574|    547|            }
  575|  6.54k|        }
  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|  6.47k|        if (base == NULL)
  ------------------
  |  Branch (581:13): [True: 5.92k, False: 547]
  ------------------
  582|  5.92k|            base = ctxt->directory;
  583|       |
  584|  6.47k|        res = xmlBuildURISafe(systemId, (const xmlChar *) base, &URI);
  585|       |
  586|  6.47k|        if (URI == NULL) {
  ------------------
  |  Branch (586:13): [True: 84, False: 6.39k]
  ------------------
  587|     84|            if (res < 0) {
  ------------------
  |  Branch (587:17): [True: 1, False: 83]
  ------------------
  588|      1|                xmlSAX2ErrMemory(ctxt);
  589|     83|            } else {
  590|     83|                xmlWarnMsg(ctxt, XML_ERR_INVALID_URI,
  591|     83|                           "Can't resolve URI: %s\n", systemId);
  592|     83|            }
  593|  6.39k|        } else if (xmlStrlen(URI) > XML_MAX_URI_LENGTH) {
  ------------------
  |  |   11|  6.39k|#define XML_MAX_URI_LENGTH 2000
  ------------------
  |  Branch (593:20): [True: 2, False: 6.39k]
  ------------------
  594|      2|            xmlFatalErr(ctxt, XML_ERR_RESOURCE_LIMIT, "URI too long");
  595|      2|            xmlFree(URI);
  596|  6.39k|        } else {
  597|  6.39k|            ent->URI = URI;
  598|  6.39k|        }
  599|  6.47k|    }
  600|  17.1k|}
xmlSAX2AttributeDecl:
  617|  43.4k|{
  618|  43.4k|    xmlParserCtxtPtr ctxt = (xmlParserCtxtPtr) ctx;
  619|  43.4k|    xmlAttributePtr attr;
  620|  43.4k|    const xmlChar *name = NULL;
  621|  43.4k|    xmlChar *prefix = NULL;
  622|       |
  623|       |    /* Avoid unused variable warning if features are disabled. */
  624|  43.4k|    (void) attr;
  625|       |
  626|  43.4k|    if ((ctxt == NULL) || (ctxt->myDoc == NULL))
  ------------------
  |  Branch (626:9): [True: 0, False: 43.4k]
  |  Branch (626:27): [True: 0, False: 43.4k]
  ------------------
  627|      0|        return;
  628|       |
  629|  43.4k|    if ((xmlStrEqual(fullname, BAD_CAST "xml:id")) &&
  ------------------
  |  |   34|  43.4k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (629:9): [True: 575, False: 42.8k]
  ------------------
  630|    575|        (type != XML_ATTRIBUTE_ID)) {
  ------------------
  |  Branch (630:9): [True: 302, False: 273]
  ------------------
  631|    302|	xmlErrId(ctxt, XML_DTD_XMLID_TYPE,
  632|    302|	      "xml:id : attribute type should be ID\n", NULL);
  633|    302|    }
  634|  43.4k|    name = xmlSplitQName4(fullname, &prefix);
  635|  43.4k|    if (name == NULL)
  ------------------
  |  Branch (635:9): [True: 8, False: 43.4k]
  ------------------
  636|      8|        xmlSAX2ErrMemory(ctxt);
  637|  43.4k|    ctxt->vctxt.valid = 1;
  638|  43.4k|    if (ctxt->inSubset == 1)
  ------------------
  |  Branch (638:9): [True: 32.1k, False: 11.2k]
  ------------------
  639|  32.1k|	attr = xmlAddAttributeDecl(&ctxt->vctxt, ctxt->myDoc->intSubset, elem,
  640|  32.1k|	       name, prefix, (xmlAttributeType) type,
  641|  32.1k|	       (xmlAttributeDefault) def, defaultValue, tree);
  642|  11.2k|    else if (ctxt->inSubset == 2)
  ------------------
  |  Branch (642:14): [True: 11.2k, False: 0]
  ------------------
  643|  11.2k|	attr = xmlAddAttributeDecl(&ctxt->vctxt, ctxt->myDoc->extSubset, elem,
  644|  11.2k|	   name, prefix, (xmlAttributeType) type,
  645|  11.2k|	   (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|  43.4k|#ifdef LIBXML_VALID_ENABLED
  655|  43.4k|    if (ctxt->vctxt.valid == 0)
  ------------------
  |  Branch (655:9): [True: 7.61k, False: 35.8k]
  ------------------
  656|  7.61k|	ctxt->valid = 0;
  657|  43.4k|    if ((attr != NULL) && (ctxt->validate) && (ctxt->wellFormed) &&
  ------------------
  |  Branch (657:9): [True: 22.6k, False: 20.7k]
  |  Branch (657:27): [True: 16.8k, False: 5.77k]
  |  Branch (657:47): [True: 13.4k, False: 3.37k]
  ------------------
  658|  13.4k|        (ctxt->myDoc->intSubset != NULL))
  ------------------
  |  Branch (658:9): [True: 13.4k, False: 0]
  ------------------
  659|  13.4k|	ctxt->valid &= xmlValidateAttributeDecl(&ctxt->vctxt, ctxt->myDoc,
  660|  13.4k|	                                        attr);
  661|  43.4k|#endif /* LIBXML_VALID_ENABLED */
  662|  43.4k|    if (prefix != NULL)
  ------------------
  |  Branch (662:9): [True: 4.96k, False: 38.4k]
  ------------------
  663|  4.96k|	xmlFree(prefix);
  664|  43.4k|}
xmlSAX2ElementDecl:
  677|  13.6k|{
  678|  13.6k|    xmlParserCtxtPtr ctxt = (xmlParserCtxtPtr) ctx;
  679|  13.6k|    xmlElementPtr elem = NULL;
  680|       |
  681|       |    /* Avoid unused variable warning if features are disabled. */
  682|  13.6k|    (void) elem;
  683|       |
  684|  13.6k|    if ((ctxt == NULL) || (ctxt->myDoc == NULL))
  ------------------
  |  Branch (684:9): [True: 0, False: 13.6k]
  |  Branch (684:27): [True: 0, False: 13.6k]
  ------------------
  685|      0|        return;
  686|       |
  687|  13.6k|    if (ctxt->inSubset == 1)
  ------------------
  |  Branch (687:9): [True: 10.2k, False: 3.37k]
  ------------------
  688|  10.2k|        elem = xmlAddElementDecl(&ctxt->vctxt, ctxt->myDoc->intSubset,
  689|  10.2k|                                 name, (xmlElementTypeVal) type, content);
  690|  3.37k|    else if (ctxt->inSubset == 2)
  ------------------
  |  Branch (690:14): [True: 3.37k, False: 0]
  ------------------
  691|  3.37k|        elem = xmlAddElementDecl(&ctxt->vctxt, ctxt->myDoc->extSubset,
  692|  3.37k|                                 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|  13.6k|#ifdef LIBXML_VALID_ENABLED
  700|  13.6k|    if (elem == NULL)
  ------------------
  |  Branch (700:9): [True: 4.71k, False: 8.92k]
  ------------------
  701|  4.71k|        ctxt->valid = 0;
  702|  13.6k|    if (ctxt->validate && ctxt->wellFormed &&
  ------------------
  |  Branch (702:9): [True: 10.2k, False: 3.42k]
  |  Branch (702:27): [True: 6.90k, False: 3.30k]
  ------------------
  703|  6.90k|        ctxt->myDoc && ctxt->myDoc->intSubset)
  ------------------
  |  Branch (703:9): [True: 6.90k, False: 0]
  |  Branch (703:24): [True: 6.90k, False: 0]
  ------------------
  704|  6.90k|        ctxt->valid &=
  705|  6.90k|            xmlValidateElementDecl(&ctxt->vctxt, ctxt->myDoc, elem);
  706|  13.6k|#endif /* LIBXML_VALID_ENABLED */
  707|  13.6k|}
xmlSAX2NotationDecl:
  720|  2.06k|{
  721|  2.06k|    xmlParserCtxtPtr ctxt = (xmlParserCtxtPtr) ctx;
  722|  2.06k|    xmlNotationPtr nota = NULL;
  723|       |
  724|       |    /* Avoid unused variable warning if features are disabled. */
  725|  2.06k|    (void) nota;
  726|       |
  727|  2.06k|    if ((ctxt == NULL) || (ctxt->myDoc == NULL))
  ------------------
  |  Branch (727:9): [True: 0, False: 2.06k]
  |  Branch (727:27): [True: 0, False: 2.06k]
  ------------------
  728|      0|        return;
  729|       |
  730|  2.06k|    if ((publicId == NULL) && (systemId == NULL)) {
  ------------------
  |  Branch (730:9): [True: 972, False: 1.09k]
  |  Branch (730:31): [True: 251, False: 721]
  ------------------
  731|    251|	xmlFatalErrMsg(ctxt, XML_ERR_NOTATION_PROCESSING,
  732|    251|	     "SAX.xmlSAX2NotationDecl(%s) externalID or PublicID missing\n",
  733|    251|	               name, NULL);
  734|    251|	return;
  735|  1.81k|    } else if (ctxt->inSubset == 1)
  ------------------
  |  Branch (735:16): [True: 1.39k, False: 422]
  ------------------
  736|  1.39k|	nota = xmlAddNotationDecl(&ctxt->vctxt, ctxt->myDoc->intSubset, name,
  737|  1.39k|                              publicId, systemId);
  738|    422|    else if (ctxt->inSubset == 2)
  ------------------
  |  Branch (738:14): [True: 422, False: 0]
  ------------------
  739|    422|	nota = xmlAddNotationDecl(&ctxt->vctxt, ctxt->myDoc->extSubset, name,
  740|    422|                              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.81k|#ifdef LIBXML_VALID_ENABLED
  748|  1.81k|    if (nota == NULL) ctxt->valid = 0;
  ------------------
  |  Branch (748:9): [True: 1.56k, False: 248]
  ------------------
  749|  1.81k|    if ((ctxt->validate) && (ctxt->wellFormed) &&
  ------------------
  |  Branch (749:9): [True: 1.19k, False: 617]
  |  Branch (749:29): [True: 486, False: 709]
  ------------------
  750|    486|        (ctxt->myDoc->intSubset != NULL))
  ------------------
  |  Branch (750:9): [True: 486, False: 0]
  ------------------
  751|    486|	ctxt->valid &= xmlValidateNotationDecl(&ctxt->vctxt, ctxt->myDoc,
  752|    486|	                                       nota);
  753|  1.81k|#endif /* LIBXML_VALID_ENABLED */
  754|  1.81k|}
xmlSAX2UnparsedEntityDecl:
  769|    505|{
  770|    505|    xmlSAX2EntityDecl(ctx, name, XML_EXTERNAL_GENERAL_UNPARSED_ENTITY,
  771|    505|                      publicId, systemId, (xmlChar *) notationName);
  772|    505|}
xmlSAX2SetDocumentLocator:
  783|  37.7k|{
  784|  37.7k|}
xmlSAX2StartDocument:
  793|  37.4k|{
  794|  37.4k|    xmlParserCtxtPtr ctxt = (xmlParserCtxtPtr) ctx;
  795|  37.4k|    xmlDocPtr doc;
  796|       |
  797|  37.4k|    if (ctx == NULL) return;
  ------------------
  |  Branch (797:9): [True: 0, False: 37.4k]
  ------------------
  798|       |
  799|  37.4k|#ifdef LIBXML_HTML_ENABLED
  800|  37.4k|    if (ctxt->html) {
  ------------------
  |  Branch (800:9): [True: 0, False: 37.4k]
  ------------------
  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|  37.4k|#endif
  811|  37.4k|    {
  812|  37.4k|	doc = ctxt->myDoc = xmlNewDoc(ctxt->version);
  813|  37.4k|	if (doc != NULL) {
  ------------------
  |  Branch (813:6): [True: 37.4k, False: 16]
  ------------------
  814|  37.4k|	    doc->properties = 0;
  815|  37.4k|	    if (ctxt->options & XML_PARSE_OLD10)
  ------------------
  |  Branch (815:10): [True: 14.3k, False: 23.0k]
  ------------------
  816|  14.3k|	        doc->properties |= XML_DOC_OLD10;
  817|  37.4k|	    doc->parseFlags = ctxt->options;
  818|  37.4k|	    doc->standalone = ctxt->standalone;
  819|  37.4k|	} else {
  820|     16|	    xmlSAX2ErrMemory(ctxt);
  821|     16|	    return;
  822|     16|	}
  823|  37.4k|	if ((ctxt->dictNames) && (doc != NULL)) {
  ------------------
  |  Branch (823:6): [True: 21.2k, False: 16.1k]
  |  Branch (823:27): [True: 21.2k, False: 0]
  ------------------
  824|  21.2k|	    doc->dict = ctxt->dict;
  825|  21.2k|	    xmlDictReference(doc->dict);
  826|  21.2k|	}
  827|  37.4k|    }
  828|  37.4k|    if ((ctxt->myDoc != NULL) && (ctxt->myDoc->URL == NULL) &&
  ------------------
  |  Branch (828:9): [True: 37.4k, False: 0]
  |  Branch (828:34): [True: 37.4k, False: 0]
  ------------------
  829|  37.4k|	(ctxt->input != NULL) && (ctxt->input->filename != NULL)) {
  ------------------
  |  Branch (829:2): [True: 37.4k, False: 0]
  |  Branch (829:27): [True: 6.66k, False: 30.7k]
  ------------------
  830|  6.66k|	ctxt->myDoc->URL = xmlPathToURI((const xmlChar *)ctxt->input->filename);
  831|  6.66k|	if (ctxt->myDoc->URL == NULL)
  ------------------
  |  Branch (831:6): [True: 8, False: 6.65k]
  ------------------
  832|      8|	    xmlSAX2ErrMemory(ctxt);
  833|  6.66k|    }
  834|  37.4k|}
xmlSAX2EndDocument:
  843|  20.5k|{
  844|  20.5k|    xmlParserCtxtPtr ctxt = (xmlParserCtxtPtr) ctx;
  845|  20.5k|    xmlDocPtr doc;
  846|       |
  847|  20.5k|    if (ctx == NULL) return;
  ------------------
  |  Branch (847:9): [True: 0, False: 20.5k]
  ------------------
  848|  20.5k|#ifdef LIBXML_VALID_ENABLED
  849|  20.5k|    if (ctxt->validate && ctxt->wellFormed &&
  ------------------
  |  Branch (849:9): [True: 3.49k, False: 17.0k]
  |  Branch (849:27): [True: 452, False: 3.04k]
  ------------------
  850|    452|        ctxt->myDoc && ctxt->myDoc->intSubset)
  ------------------
  |  Branch (850:9): [True: 452, False: 0]
  |  Branch (850:24): [True: 452, False: 0]
  ------------------
  851|    452|	ctxt->valid &= xmlValidateDocumentFinal(&ctxt->vctxt, ctxt->myDoc);
  852|  20.5k|#endif /* LIBXML_VALID_ENABLED */
  853|       |
  854|  20.5k|    doc = ctxt->myDoc;
  855|  20.5k|    if (doc == NULL)
  ------------------
  |  Branch (855:9): [True: 55, False: 20.4k]
  ------------------
  856|     55|        return;
  857|       |
  858|  20.4k|    if (doc->encoding == NULL) {
  ------------------
  |  Branch (858:9): [True: 20.4k, False: 0]
  ------------------
  859|  20.4k|        const xmlChar *encoding = xmlGetActualEncoding(ctxt);
  860|       |
  861|  20.4k|        if (encoding != NULL) {
  ------------------
  |  Branch (861:13): [True: 281, False: 20.2k]
  ------------------
  862|    281|            doc->encoding = xmlStrdup(encoding);
  863|    281|            if (doc->encoding == NULL)
  ------------------
  |  Branch (863:17): [True: 2, False: 279]
  ------------------
  864|      2|                xmlSAX2ErrMemory(ctxt);
  865|    281|        }
  866|  20.4k|    }
  867|       |
  868|  20.4k|#ifdef LIBXML_HTML_ENABLED
  869|  20.4k|    if (ctxt->html) {
  ------------------
  |  Branch (869:9): [True: 0, False: 20.4k]
  ------------------
  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|  20.4k|#endif /* LIBXML_HTML_ENABLED */
  880|  20.4k|    {
  881|  20.4k|        if (ctxt->wellFormed) {
  ------------------
  |  Branch (881:13): [True: 9.67k, False: 10.8k]
  ------------------
  882|  9.67k|            doc->properties |= XML_DOC_WELLFORMED;
  883|  9.67k|            if (ctxt->valid)
  ------------------
  |  Branch (883:17): [True: 5.52k, False: 4.15k]
  ------------------
  884|  5.52k|                doc->properties |= XML_DOC_DTDVALID;
  885|  9.67k|            if (ctxt->nsWellFormed)
  ------------------
  |  Branch (885:17): [True: 7.67k, False: 2.00k]
  ------------------
  886|  7.67k|                doc->properties |= XML_DOC_NSVALID;
  887|  9.67k|        }
  888|       |
  889|  20.4k|        if (ctxt->options & XML_PARSE_OLD10)
  ------------------
  |  Branch (889:13): [True: 8.30k, False: 12.1k]
  ------------------
  890|  8.30k|            doc->properties |= XML_DOC_OLD10;
  891|  20.4k|    }
  892|  20.4k|}
xmlSAX2StartElement:
 1713|   228k|xmlSAX2StartElement(void *ctx, const xmlChar *fullname, const xmlChar **atts) {
 1714|   228k|    xmlParserCtxtPtr ctxt = (xmlParserCtxtPtr) ctx;
 1715|       |
 1716|   228k|    (void) atts;
 1717|       |
 1718|   228k|    if ((ctxt == NULL) || (fullname == NULL) || (ctxt->myDoc == NULL))
  ------------------
  |  Branch (1718:9): [True: 0, False: 228k]
  |  Branch (1718:27): [True: 0, False: 228k]
  |  Branch (1718:49): [True: 0, False: 228k]
  ------------------
 1719|      0|        return;
 1720|       |
 1721|   228k|#ifdef LIBXML_SAX1_ENABLED
 1722|   228k|    if (!ctxt->html) {
  ------------------
  |  Branch (1722:9): [True: 228k, False: 0]
  ------------------
 1723|   228k|        xmlSAX1StartElement(ctxt, fullname, atts);
 1724|   228k|        return;
 1725|   228k|    }
 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|   127k|{
 1749|   127k|    xmlParserCtxtPtr ctxt = (xmlParserCtxtPtr) ctx;
 1750|       |
 1751|   127k|    if (ctxt == NULL)
  ------------------
  |  Branch (1751:9): [True: 0, False: 127k]
  ------------------
 1752|      0|        return;
 1753|       |
 1754|   127k|#if defined(LIBXML_SAX1_ENABLED) && defined(LIBXML_VALID_ENABLED)
 1755|   127k|    if (!ctxt->html && ctxt->validate && ctxt->wellFormed &&
  ------------------
  |  Branch (1755:9): [True: 127k, False: 0]
  |  Branch (1755:24): [True: 26.3k, False: 100k]
  |  Branch (1755:42): [True: 14.7k, False: 11.5k]
  ------------------
 1756|  14.7k|        ctxt->myDoc && ctxt->myDoc->intSubset)
  ------------------
  |  Branch (1756:9): [True: 14.7k, False: 0]
  |  Branch (1756:24): [True: 14.7k, False: 0]
  ------------------
 1757|  14.7k|        ctxt->valid &= xmlValidateOneElement(&ctxt->vctxt, ctxt->myDoc,
 1758|  14.7k|					     ctxt->node);
 1759|   127k|#endif /* LIBXML_VALID_ENABLED */
 1760|       |
 1761|   127k|#if defined(LIBXML_SAX1_ENABLED) || defined(LIBXML_HTML_ENABLED)
 1762|   127k|    ctxt->nodemem = -1;
 1763|       |
 1764|       |    /*
 1765|       |     * end of parsing of this node.
 1766|       |     */
 1767|   127k|    nodePop(ctxt);
 1768|   127k|#endif
 1769|   127k|}
xmlSAX2StartElementNs:
 2155|   420k|{
 2156|   420k|    xmlParserCtxtPtr ctxt = (xmlParserCtxtPtr) ctx;
 2157|   420k|    xmlNodePtr ret;
 2158|   420k|    xmlNsPtr last = NULL, ns;
 2159|   420k|    const xmlChar *uri, *pref;
 2160|   420k|    xmlChar *lname = NULL;
 2161|   420k|    int i, j;
 2162|       |
 2163|   420k|    if (ctx == NULL) return;
  ------------------
  |  Branch (2163:9): [True: 0, False: 420k]
  ------------------
 2164|       |
 2165|   420k|#ifdef LIBXML_VALID_ENABLED
 2166|       |    /*
 2167|       |     * First check on validity:
 2168|       |     */
 2169|   420k|    if (ctxt->validate &&
  ------------------
  |  Branch (2169:9): [True: 138k, False: 281k]
  ------------------
 2170|   138k|        ((ctxt->myDoc == NULL) ||
  ------------------
  |  Branch (2170:10): [True: 0, False: 138k]
  ------------------
 2171|   138k|         ((ctxt->myDoc->extSubset == NULL) &&
  ------------------
  |  Branch (2171:11): [True: 134k, False: 4.22k]
  ------------------
 2172|   134k|          ((ctxt->myDoc->intSubset == NULL) ||
  ------------------
  |  Branch (2172:12): [True: 3.92k, False: 130k]
  ------------------
 2173|   130k|	   ((ctxt->myDoc->intSubset->notations == NULL) &&
  ------------------
  |  Branch (2173:6): [True: 129k, False: 516]
  ------------------
 2174|   129k|	    (ctxt->myDoc->intSubset->elements == NULL) &&
  ------------------
  |  Branch (2174:6): [True: 13.4k, False: 116k]
  ------------------
 2175|  13.4k|	    (ctxt->myDoc->intSubset->attributes == NULL) &&
  ------------------
  |  Branch (2175:6): [True: 13.4k, False: 0]
  ------------------
 2176|  13.4k|	    (ctxt->myDoc->intSubset->entities == NULL)))))) {
  ------------------
  |  Branch (2176:6): [True: 611, False: 12.8k]
  ------------------
 2177|  4.53k|	xmlErrValid(ctxt, XML_DTD_NO_DTD,
 2178|  4.53k|	  "Validation failed: no DTD found !", NULL, NULL);
 2179|  4.53k|	ctxt->validate = 0;
 2180|  4.53k|    }
 2181|   420k|#endif /* LIBXML_VALID_ENABLED */
 2182|       |
 2183|       |    /*
 2184|       |     * Take care of the rare case of an undefined namespace prefix
 2185|       |     */
 2186|   420k|    if ((prefix != NULL) && (URI == NULL)) {
  ------------------
  |  Branch (2186:9): [True: 50.8k, False: 369k]
  |  Branch (2186:29): [True: 30.3k, False: 20.5k]
  ------------------
 2187|  30.3k|        if (ctxt->dictNames) {
  ------------------
  |  Branch (2187:13): [True: 13.7k, False: 16.5k]
  ------------------
 2188|  13.7k|	    const xmlChar *fullname;
 2189|       |
 2190|  13.7k|	    fullname = xmlDictQLookup(ctxt->dict, prefix, localname);
 2191|  13.7k|	    if (fullname == NULL) {
  ------------------
  |  Branch (2191:10): [True: 2, False: 13.7k]
  ------------------
 2192|      2|                xmlSAX2ErrMemory(ctxt);
 2193|      2|                return;
 2194|      2|            }
 2195|  13.7k|	    localname = fullname;
 2196|  16.5k|	} else {
 2197|  16.5k|	    lname = xmlBuildQName(localname, prefix, NULL, 0);
 2198|  16.5k|            if (lname == NULL) {
  ------------------
  |  Branch (2198:17): [True: 0, False: 16.5k]
  ------------------
 2199|      0|                xmlSAX2ErrMemory(ctxt);
 2200|      0|                return;
 2201|      0|            }
 2202|  16.5k|	}
 2203|  30.3k|    }
 2204|       |    /*
 2205|       |     * allocate the node
 2206|       |     */
 2207|   420k|    if (ctxt->freeElems != NULL) {
  ------------------
  |  Branch (2207:9): [True: 2.30k, False: 417k]
  ------------------
 2208|  2.30k|        ret = ctxt->freeElems;
 2209|  2.30k|	ctxt->freeElems = ret->next;
 2210|  2.30k|	ctxt->freeElemsNr--;
 2211|  2.30k|	memset(ret, 0, sizeof(xmlNode));
 2212|  2.30k|        ret->doc = ctxt->myDoc;
 2213|  2.30k|	ret->type = XML_ELEMENT_NODE;
 2214|       |
 2215|  2.30k|	if (ctxt->dictNames)
  ------------------
  |  Branch (2215:6): [True: 1.08k, False: 1.21k]
  ------------------
 2216|  1.08k|	    ret->name = localname;
 2217|  1.21k|	else {
 2218|  1.21k|	    if (lname == NULL)
  ------------------
  |  Branch (2218:10): [True: 1.04k, False: 170]
  ------------------
 2219|  1.04k|		ret->name = xmlStrdup(localname);
 2220|    170|	    else
 2221|    170|	        ret->name = lname;
 2222|  1.21k|	    if (ret->name == NULL) {
  ------------------
  |  Branch (2222:10): [True: 4, False: 1.21k]
  ------------------
 2223|      4|	        xmlSAX2ErrMemory(ctxt);
 2224|      4|                xmlFree(ret);
 2225|      4|		return;
 2226|      4|	    }
 2227|  1.21k|	}
 2228|  2.30k|	if ((xmlRegisterCallbacks) && (xmlRegisterNodeDefaultValue))
  ------------------
  |  |  932|      0|    (*__xmlRegisterNodeDefaultValue())
  ------------------
  |  Branch (2228:6): [True: 0, False: 2.30k]
  |  Branch (2228:32): [True: 0, False: 0]
  ------------------
 2229|      0|	    xmlRegisterNodeDefaultValue(ret);
  ------------------
  |  |  932|      0|    (*__xmlRegisterNodeDefaultValue())
  ------------------
 2230|   417k|    } else {
 2231|   417k|	if (ctxt->dictNames)
  ------------------
  |  Branch (2231:6): [True: 201k, False: 215k]
  ------------------
 2232|   201k|	    ret = xmlNewDocNodeEatName(ctxt->myDoc, NULL,
 2233|   201k|	                               (xmlChar *) localname, NULL);
 2234|   215k|	else if (lname == NULL)
  ------------------
  |  Branch (2234:11): [True: 199k, False: 16.3k]
  ------------------
 2235|   199k|	    ret = xmlNewDocNode(ctxt->myDoc, NULL, localname, NULL);
 2236|  16.3k|	else
 2237|  16.3k|	    ret = xmlNewDocNodeEatName(ctxt->myDoc, NULL, lname, NULL);
 2238|   417k|	if (ret == NULL) {
  ------------------
  |  Branch (2238:6): [True: 49, False: 417k]
  ------------------
 2239|     49|	    xmlSAX2ErrMemory(ctxt);
 2240|     49|	    return;
 2241|     49|	}
 2242|   417k|    }
 2243|       |
 2244|       |    /*
 2245|       |     * Build the namespace list
 2246|       |     */
 2247|   562k|    for (i = 0,j = 0;j < nb_namespaces;j++) {
  ------------------
  |  Branch (2247:22): [True: 141k, False: 420k]
  ------------------
 2248|   141k|        pref = namespaces[i++];
 2249|   141k|	uri = namespaces[i++];
 2250|   141k|	ns = xmlNewNs(NULL, uri, pref);
 2251|   141k|	if (ns != NULL) {
  ------------------
  |  Branch (2251:6): [True: 141k, False: 53]
  ------------------
 2252|   141k|	    if (last == NULL) {
  ------------------
  |  Branch (2252:10): [True: 49.6k, False: 92.2k]
  ------------------
 2253|  49.6k|	        ret->nsDef = last = ns;
 2254|  92.2k|	    } else {
 2255|  92.2k|	        last->next = ns;
 2256|  92.2k|		last = ns;
 2257|  92.2k|	    }
 2258|   141k|	    if ((URI != NULL) && (prefix == pref))
  ------------------
  |  Branch (2258:10): [True: 104k, False: 37.5k]
  |  Branch (2258:27): [True: 27.9k, False: 76.4k]
  ------------------
 2259|  27.9k|		ret->ns = ns;
 2260|   141k|	} else {
 2261|     53|            xmlSAX2ErrMemory(ctxt);
 2262|     53|	    continue;
 2263|     53|	}
 2264|       |
 2265|   141k|        xmlParserNsUpdateSax(ctxt, pref, ns);
 2266|       |
 2267|   141k|#ifdef LIBXML_VALID_ENABLED
 2268|   141k|	if ((!ctxt->html) && ctxt->validate && ctxt->wellFormed &&
  ------------------
  |  Branch (2268:6): [True: 141k, False: 0]
  |  Branch (2268:23): [True: 65.7k, False: 76.1k]
  |  Branch (2268:41): [True: 4.91k, False: 60.8k]
  ------------------
 2269|  4.91k|	    ctxt->myDoc && ctxt->myDoc->intSubset) {
  ------------------
  |  Branch (2269:6): [True: 4.91k, False: 0]
  |  Branch (2269:21): [True: 4.91k, False: 0]
  ------------------
 2270|  4.91k|	    ctxt->valid &= xmlValidateOneNamespace(&ctxt->vctxt, ctxt->myDoc,
 2271|  4.91k|	                                           ret, prefix, ns, uri);
 2272|  4.91k|	}
 2273|   141k|#endif /* LIBXML_VALID_ENABLED */
 2274|   141k|    }
 2275|   420k|    ctxt->nodemem = -1;
 2276|       |
 2277|       |    /*
 2278|       |     * Link the child element
 2279|       |     */
 2280|   420k|    xmlSAX2AppendChild(ctxt, ret);
 2281|       |
 2282|       |    /*
 2283|       |     * We are parsing a new node.
 2284|       |     */
 2285|   420k|    if (nodePush(ctxt, ret) < 0) {
  ------------------
  |  Branch (2285:9): [True: 35, False: 420k]
  ------------------
 2286|     35|        xmlUnlinkNode(ret);
 2287|     35|        xmlFreeNode(ret);
 2288|     35|        return;
 2289|     35|    }
 2290|       |
 2291|       |    /*
 2292|       |     * Insert the defaulted attributes from the DTD only if requested:
 2293|       |     */
 2294|   420k|    if ((nb_defaulted != 0) &&
  ------------------
  |  Branch (2294:9): [True: 53.8k, False: 366k]
  ------------------
 2295|  53.8k|        ((ctxt->loadsubset & XML_COMPLETE_ATTRS) == 0))
  ------------------
  |  |  209|  53.8k|#define XML_COMPLETE_ATTRS	4
  ------------------
  |  Branch (2295:9): [True: 13.6k, False: 40.2k]
  ------------------
 2296|  13.6k|	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|   420k|    if ((URI != NULL) && (ret->ns == NULL)) {
  ------------------
  |  Branch (2302:9): [True: 52.3k, False: 367k]
  |  Branch (2302:26): [True: 24.3k, False: 27.9k]
  ------------------
 2303|  24.3k|        ret->ns = xmlParserNsLookupSax(ctxt, prefix);
 2304|  24.3k|	if ((ret->ns == NULL) && (xmlStrEqual(prefix, BAD_CAST "xml"))) {
  ------------------
  |  |   34|    392|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (2304:6): [True: 392, False: 23.9k]
  |  Branch (2304:27): [True: 368, False: 24]
  ------------------
 2305|    368|            int res;
 2306|       |
 2307|    368|	    res = xmlSearchNsSafe(ret, prefix, &ret->ns);
 2308|    368|            if (res < 0)
  ------------------
  |  Branch (2308:17): [True: 3, False: 365]
  ------------------
 2309|      3|                xmlSAX2ErrMemory(ctxt);
 2310|    368|	}
 2311|  24.3k|	if (ret->ns == NULL) {
  ------------------
  |  Branch (2311:6): [True: 27, False: 24.3k]
  ------------------
 2312|     27|	    ns = xmlNewNs(ret, NULL, prefix);
 2313|     27|	    if (ns == NULL) {
  ------------------
  |  Branch (2313:10): [True: 0, False: 27]
  ------------------
 2314|       |
 2315|      0|	        xmlSAX2ErrMemory(ctxt);
 2316|      0|		return;
 2317|      0|	    }
 2318|     27|            if (prefix != NULL)
  ------------------
  |  Branch (2318:17): [True: 9, False: 18]
  ------------------
 2319|      9|                xmlNsWarnMsg(ctxt, XML_NS_ERR_UNDEFINED_NAMESPACE,
 2320|      9|                             "Namespace prefix %s was not found\n",
 2321|      9|                             prefix, NULL);
 2322|     18|            else
 2323|     18|                xmlNsWarnMsg(ctxt, XML_NS_ERR_UNDEFINED_NAMESPACE,
 2324|     18|                             "Namespace default prefix was not found\n",
 2325|     18|                             NULL, NULL);
 2326|     27|	}
 2327|  24.3k|    }
 2328|       |
 2329|       |    /*
 2330|       |     * process all the other attributes
 2331|       |     */
 2332|   420k|    if (nb_attributes > 0) {
  ------------------
  |  Branch (2332:9): [True: 73.2k, False: 346k]
  ------------------
 2333|  73.2k|        xmlAttrPtr prev = NULL;
 2334|       |
 2335|   279k|        for (j = 0,i = 0;i < nb_attributes;i++,j+=5) {
  ------------------
  |  Branch (2335:26): [True: 206k, False: 73.2k]
  ------------------
 2336|   206k|            xmlAttrPtr attr = NULL;
 2337|       |
 2338|       |	    /*
 2339|       |	     * Handle the rare case of an undefined attribute prefix
 2340|       |	     */
 2341|   206k|	    if ((attributes[j+1] != NULL) && (attributes[j+2] == NULL)) {
  ------------------
  |  Branch (2341:10): [True: 104k, False: 101k]
  |  Branch (2341:39): [True: 40.1k, False: 64.8k]
  ------------------
 2342|  40.1k|		if (ctxt->dictNames) {
  ------------------
  |  Branch (2342:7): [True: 16.2k, False: 23.8k]
  ------------------
 2343|  16.2k|		    const xmlChar *fullname;
 2344|       |
 2345|  16.2k|		    fullname = xmlDictQLookup(ctxt->dict, attributes[j+1],
 2346|  16.2k|		                              attributes[j]);
 2347|  16.2k|		    if (fullname == NULL) {
  ------------------
  |  Branch (2347:11): [True: 1, False: 16.2k]
  ------------------
 2348|      1|                        xmlSAX2ErrMemory(ctxt);
 2349|      1|                        return;
 2350|      1|                    }
 2351|  16.2k|                    attr = xmlSAX2AttributeNs(ctxt, fullname, NULL,
 2352|  16.2k|                                              attributes[j+3],
 2353|  16.2k|                                              attributes[j+4]);
 2354|  16.2k|                    goto have_attr;
 2355|  23.8k|		} else {
 2356|  23.8k|		    lname = xmlBuildQName(attributes[j], attributes[j+1],
 2357|  23.8k|		                          NULL, 0);
 2358|  23.8k|		    if (lname == NULL) {
  ------------------
  |  Branch (2358:11): [True: 2, False: 23.8k]
  ------------------
 2359|      2|                        xmlSAX2ErrMemory(ctxt);
 2360|      2|                        return;
 2361|      2|                    }
 2362|  23.8k|                    attr = xmlSAX2AttributeNs(ctxt, lname, NULL,
 2363|  23.8k|                                              attributes[j+3],
 2364|  23.8k|                                              attributes[j+4]);
 2365|  23.8k|                    xmlFree(lname);
 2366|  23.8k|                    goto have_attr;
 2367|  23.8k|		}
 2368|  40.1k|	    }
 2369|   165k|            attr = xmlSAX2AttributeNs(ctxt, attributes[j], attributes[j+1],
 2370|   165k|                                      attributes[j+3], attributes[j+4]);
 2371|   206k|have_attr:
 2372|   206k|            if (attr == NULL)
  ------------------
  |  Branch (2372:17): [True: 9, False: 206k]
  ------------------
 2373|      9|                continue;
 2374|       |
 2375|       |            /* link at the end to preserve order */
 2376|   206k|            if (prev == NULL) {
  ------------------
  |  Branch (2376:17): [True: 73.2k, False: 132k]
  ------------------
 2377|  73.2k|                ctxt->node->properties = attr;
 2378|   132k|            } else {
 2379|   132k|                prev->next = attr;
 2380|   132k|                attr->prev = prev;
 2381|   132k|            }
 2382|       |
 2383|   206k|            prev = attr;
 2384|   206k|	}
 2385|  73.2k|    }
 2386|       |
 2387|   420k|#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|   420k|    if ((ctxt->validate) &&
  ------------------
  |  Branch (2392:9): [True: 133k, False: 286k]
  ------------------
 2393|   133k|        ((ctxt->vctxt.flags & XML_VCTXT_DTD_VALIDATED) == 0)) {
  ------------------
  |  |   16|   133k|#define XML_VCTXT_DTD_VALIDATED (1u << 0)
  ------------------
  |  Branch (2393:9): [True: 3.09k, False: 130k]
  ------------------
 2394|  3.09k|	int chk;
 2395|       |
 2396|  3.09k|	chk = xmlValidateDtdFinal(&ctxt->vctxt, ctxt->myDoc);
 2397|  3.09k|	if (chk <= 0)
  ------------------
  |  Branch (2397:6): [True: 47, False: 3.04k]
  ------------------
 2398|     47|	    ctxt->valid = 0;
 2399|  3.09k|	if (chk < 0)
  ------------------
  |  Branch (2399:6): [True: 0, False: 3.09k]
  ------------------
 2400|      0|	    ctxt->wellFormed = 0;
 2401|  3.09k|	ctxt->valid &= xmlValidateRoot(&ctxt->vctxt, ctxt->myDoc);
 2402|  3.09k|	ctxt->vctxt.flags |= XML_VCTXT_DTD_VALIDATED;
  ------------------
  |  |   16|  3.09k|#define XML_VCTXT_DTD_VALIDATED (1u << 0)
  ------------------
 2403|  3.09k|    }
 2404|   420k|#endif /* LIBXML_VALID_ENABLED */
 2405|   420k|}
xmlSAX2EndElementNs:
 2421|   270k|{
 2422|   270k|    xmlParserCtxtPtr ctxt = (xmlParserCtxtPtr) ctx;
 2423|       |
 2424|   270k|    if (ctx == NULL) return;
  ------------------
  |  Branch (2424:9): [True: 0, False: 270k]
  ------------------
 2425|   270k|    ctxt->nodemem = -1;
 2426|       |
 2427|   270k|#ifdef LIBXML_VALID_ENABLED
 2428|   270k|    if (ctxt->validate && ctxt->wellFormed &&
  ------------------
  |  Branch (2428:9): [True: 76.6k, False: 193k]
  |  Branch (2428:27): [True: 55.8k, False: 20.7k]
  ------------------
 2429|  55.8k|        ctxt->myDoc && ctxt->myDoc->intSubset)
  ------------------
  |  Branch (2429:9): [True: 55.8k, False: 0]
  |  Branch (2429:24): [True: 55.8k, False: 0]
  ------------------
 2430|  55.8k|        ctxt->valid &= xmlValidateOneElement(&ctxt->vctxt, ctxt->myDoc,
 2431|  55.8k|                                             ctxt->node);
 2432|   270k|#endif /* LIBXML_VALID_ENABLED */
 2433|       |
 2434|       |    /*
 2435|       |     * end of parsing of this node.
 2436|       |     */
 2437|   270k|    nodePop(ctxt);
 2438|   270k|}
xmlSAX2Reference:
 2448|  39.3k|{
 2449|  39.3k|    xmlParserCtxtPtr ctxt = (xmlParserCtxtPtr) ctx;
 2450|  39.3k|    xmlNodePtr ret;
 2451|       |
 2452|  39.3k|    if (ctx == NULL) return;
  ------------------
  |  Branch (2452:9): [True: 0, False: 39.3k]
  ------------------
 2453|  39.3k|    ret = xmlNewReference(ctxt->myDoc, name);
 2454|  39.3k|    if (ret == NULL) {
  ------------------
  |  Branch (2454:9): [True: 6, False: 39.3k]
  ------------------
 2455|      6|        xmlSAX2ErrMemory(ctxt);
 2456|      6|        return;
 2457|      6|    }
 2458|       |
 2459|  39.3k|    xmlSAX2AppendChild(ctxt, ret);
 2460|  39.3k|}
xmlSAX2Characters:
 2606|   623k|{
 2607|   623k|    xmlSAX2Text((xmlParserCtxtPtr) ctx, ch, len, XML_TEXT_NODE);
 2608|   623k|}
xmlSAX2ProcessingInstruction:
 2633|  77.5k|{
 2634|  77.5k|    xmlParserCtxtPtr ctxt = (xmlParserCtxtPtr) ctx;
 2635|  77.5k|    xmlNodePtr ret;
 2636|       |
 2637|  77.5k|    if (ctx == NULL) return;
  ------------------
  |  Branch (2637:9): [True: 0, False: 77.5k]
  ------------------
 2638|       |
 2639|  77.5k|    ret = xmlNewDocPI(ctxt->myDoc, target, data);
 2640|  77.5k|    if (ret == NULL) {
  ------------------
  |  Branch (2640:9): [True: 9, False: 77.5k]
  ------------------
 2641|      9|        xmlSAX2ErrMemory(ctxt);
 2642|      9|        return;
 2643|      9|    }
 2644|       |
 2645|  77.5k|    xmlSAX2AppendChild(ctxt, ret);
 2646|  77.5k|}
xmlSAX2Comment:
 2656|   382k|{
 2657|   382k|    xmlParserCtxtPtr ctxt = (xmlParserCtxtPtr) ctx;
 2658|   382k|    xmlNodePtr ret;
 2659|       |
 2660|   382k|    if (ctx == NULL) return;
  ------------------
  |  Branch (2660:9): [True: 0, False: 382k]
  ------------------
 2661|       |
 2662|   382k|    ret = xmlNewDocComment(ctxt->myDoc, value);
 2663|   382k|    if (ret == NULL) {
  ------------------
  |  Branch (2663:9): [True: 8, False: 382k]
  ------------------
 2664|      8|        xmlSAX2ErrMemory(ctxt);
 2665|      8|        return;
 2666|      8|    }
 2667|       |
 2668|   382k|    xmlSAX2AppendChild(ctxt, ret);
 2669|   382k|}
xmlSAX2CDataBlock:
 2680|  26.2k|{
 2681|  26.2k|    xmlSAX2Text((xmlParserCtxtPtr) ctx, value, len, XML_CDATA_SECTION_NODE);
 2682|  26.2k|}
xmlSAXVersion:
 2711|  70.6k|{
 2712|  70.6k|    if (hdlr == NULL) return(-1);
  ------------------
  |  Branch (2712:9): [True: 0, False: 70.6k]
  ------------------
 2713|  70.6k|    if (version == 2) {
  ------------------
  |  Branch (2713:9): [True: 70.6k, False: 0]
  ------------------
 2714|  70.6k|	hdlr->startElementNs = xmlSAX2StartElementNs;
 2715|  70.6k|	hdlr->endElementNs = xmlSAX2EndElementNs;
 2716|  70.6k|	hdlr->serror = NULL;
 2717|  70.6k|	hdlr->initialized = XML_SAX2_MAGIC;
  ------------------
  |  |  953|  70.6k|#define XML_SAX2_MAGIC 0xDEEDBEAF
  ------------------
 2718|  70.6k|#ifdef LIBXML_SAX1_ENABLED
 2719|  70.6k|    } 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|  70.6k|#ifdef LIBXML_SAX1_ENABLED
 2725|  70.6k|    hdlr->startElement = xmlSAX2StartElement;
 2726|  70.6k|    hdlr->endElement = xmlSAX2EndElement;
 2727|       |#else
 2728|       |    hdlr->startElement = NULL;
 2729|       |    hdlr->endElement = NULL;
 2730|       |#endif /* LIBXML_SAX1_ENABLED */
 2731|  70.6k|    hdlr->internalSubset = xmlSAX2InternalSubset;
 2732|  70.6k|    hdlr->externalSubset = xmlSAX2ExternalSubset;
 2733|  70.6k|    hdlr->isStandalone = xmlSAX2IsStandalone;
 2734|  70.6k|    hdlr->hasInternalSubset = xmlSAX2HasInternalSubset;
 2735|  70.6k|    hdlr->hasExternalSubset = xmlSAX2HasExternalSubset;
 2736|  70.6k|    hdlr->resolveEntity = xmlSAX2ResolveEntity;
 2737|  70.6k|    hdlr->getEntity = xmlSAX2GetEntity;
 2738|  70.6k|    hdlr->getParameterEntity = xmlSAX2GetParameterEntity;
 2739|  70.6k|    hdlr->entityDecl = xmlSAX2EntityDecl;
 2740|  70.6k|    hdlr->attributeDecl = xmlSAX2AttributeDecl;
 2741|  70.6k|    hdlr->elementDecl = xmlSAX2ElementDecl;
 2742|  70.6k|    hdlr->notationDecl = xmlSAX2NotationDecl;
 2743|  70.6k|    hdlr->unparsedEntityDecl = xmlSAX2UnparsedEntityDecl;
 2744|  70.6k|    hdlr->setDocumentLocator = xmlSAX2SetDocumentLocator;
 2745|  70.6k|    hdlr->startDocument = xmlSAX2StartDocument;
 2746|  70.6k|    hdlr->endDocument = xmlSAX2EndDocument;
 2747|  70.6k|    hdlr->reference = xmlSAX2Reference;
 2748|  70.6k|    hdlr->characters = xmlSAX2Characters;
 2749|  70.6k|    hdlr->cdataBlock = xmlSAX2CDataBlock;
 2750|  70.6k|    hdlr->ignorableWhitespace = xmlSAX2Characters;
 2751|  70.6k|    hdlr->processingInstruction = xmlSAX2ProcessingInstruction;
 2752|  70.6k|    hdlr->comment = xmlSAX2Comment;
 2753|  70.6k|    hdlr->warning = xmlParserWarning;
 2754|  70.6k|    hdlr->error = xmlParserError;
 2755|  70.6k|    hdlr->fatalError = xmlParserError;
 2756|       |
 2757|  70.6k|    return(0);
 2758|  70.6k|}
SAX2.c:xmlSAX2ErrMemory:
   42|    657|xmlSAX2ErrMemory(xmlParserCtxtPtr ctxt) {
   43|    657|    xmlCtxtErrMemory(ctxt);
   44|    657|}
SAX2.c:xmlWarnMsg:
  111|  7.99k|{
  112|  7.99k|    xmlCtxtErr(ctxt, NULL, XML_FROM_PARSER, error, XML_ERR_WARNING,
  113|  7.99k|               str1, NULL, NULL, 0, msg, str1);
  114|  7.99k|}
SAX2.c:xmlFatalErrMsg:
   79|    627|{
   80|    627|    xmlCtxtErr(ctxt, NULL, XML_FROM_PARSER, error, XML_ERR_FATAL,
   81|       |               str1, str2, NULL, 0, msg, str1, str2);
   82|    627|}
SAX2.c:xmlErrId:
   95|  2.04k|{
   96|  2.04k|    xmlCtxtErr(ctxt, NULL, XML_FROM_PARSER, error, XML_ERR_ERROR,
   97|  2.04k|               str1, NULL, NULL, 0, msg, str1);
   98|  2.04k|}
SAX2.c:xmlSAX1StartElement:
 1422|   228k|{
 1423|   228k|    xmlParserCtxtPtr ctxt = (xmlParserCtxtPtr) ctx;
 1424|   228k|    xmlNodePtr ret;
 1425|   228k|    xmlNodePtr parent;
 1426|   228k|    xmlNsPtr ns;
 1427|   228k|    const xmlChar *name;
 1428|   228k|    xmlChar *prefix;
 1429|   228k|    const xmlChar *att;
 1430|   228k|    const xmlChar *value;
 1431|   228k|    int i, res;
 1432|       |
 1433|   228k|    if ((ctx == NULL) || (fullname == NULL) || (ctxt->myDoc == NULL)) return;
  ------------------
  |  Branch (1433:9): [True: 0, False: 228k]
  |  Branch (1433:26): [True: 0, False: 228k]
  |  Branch (1433:48): [True: 0, False: 228k]
  ------------------
 1434|       |
 1435|   228k|#ifdef LIBXML_VALID_ENABLED
 1436|       |    /*
 1437|       |     * First check on validity:
 1438|       |     */
 1439|   228k|    if (ctxt->validate && (ctxt->myDoc->extSubset == NULL) &&
  ------------------
  |  Branch (1439:9): [True: 79.3k, False: 149k]
  |  Branch (1439:27): [True: 72.4k, False: 6.82k]
  ------------------
 1440|  72.4k|        ((ctxt->myDoc->intSubset == NULL) ||
  ------------------
  |  Branch (1440:10): [True: 3.64k, False: 68.8k]
  ------------------
 1441|  68.8k|	 ((ctxt->myDoc->intSubset->notations == NULL) &&
  ------------------
  |  Branch (1441:4): [True: 68.3k, False: 519]
  ------------------
 1442|  68.3k|	  (ctxt->myDoc->intSubset->elements == NULL) &&
  ------------------
  |  Branch (1442:4): [True: 9.71k, False: 58.6k]
  ------------------
 1443|  9.71k|	  (ctxt->myDoc->intSubset->attributes == NULL) &&
  ------------------
  |  Branch (1443:4): [True: 9.71k, False: 0]
  ------------------
 1444|  9.71k|	  (ctxt->myDoc->intSubset->entities == NULL)))) {
  ------------------
  |  Branch (1444:4): [True: 787, False: 8.93k]
  ------------------
 1445|  4.43k|	xmlErrValid(ctxt, XML_ERR_NO_DTD,
 1446|  4.43k|	  "Validation failed: no DTD found !", NULL, NULL);
 1447|  4.43k|	ctxt->validate = 0;
 1448|  4.43k|    }
 1449|   228k|#endif
 1450|       |
 1451|       |    /*
 1452|       |     * Split the full name into a namespace prefix and the tag name
 1453|       |     */
 1454|   228k|    name = xmlSplitQName4(fullname, &prefix);
 1455|   228k|    if (name == NULL) {
  ------------------
  |  Branch (1455:9): [True: 3, False: 228k]
  ------------------
 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|   228k|    ret = xmlNewDocNode(ctxt->myDoc, NULL, name, NULL);
 1466|   228k|    if (ret == NULL) {
  ------------------
  |  Branch (1466:9): [True: 42, False: 228k]
  ------------------
 1467|     42|	xmlFree(prefix);
 1468|     42|	xmlSAX2ErrMemory(ctxt);
 1469|     42|        return;
 1470|     42|    }
 1471|   228k|    ctxt->nodemem = -1;
 1472|       |
 1473|       |    /* Initialize parent before pushing node */
 1474|   228k|    parent = ctxt->node;
 1475|   228k|    if (parent == NULL)
  ------------------
  |  Branch (1475:9): [True: 13.5k, False: 214k]
  ------------------
 1476|  13.5k|        parent = (xmlNodePtr) ctxt->myDoc;
 1477|       |
 1478|       |    /*
 1479|       |     * Link the child element
 1480|       |     */
 1481|   228k|    xmlSAX2AppendChild(ctxt, ret);
 1482|       |
 1483|       |    /*
 1484|       |     * We are parsing a new node.
 1485|       |     */
 1486|   228k|    if (nodePush(ctxt, ret) < 0) {
  ------------------
  |  Branch (1486:9): [True: 25, False: 228k]
  ------------------
 1487|     25|        xmlUnlinkNode(ret);
 1488|     25|        xmlFreeNode(ret);
 1489|     25|        if (prefix != NULL)
  ------------------
  |  Branch (1489:13): [True: 4, False: 21]
  ------------------
 1490|      4|            xmlFree(prefix);
 1491|     25|        return;
 1492|     25|    }
 1493|       |
 1494|       |    /*
 1495|       |     * Insert all the defaulted attributes from the DTD especially
 1496|       |     * namespaces
 1497|       |     */
 1498|   228k|    if ((ctxt->myDoc->intSubset != NULL) ||
  ------------------
  |  Branch (1498:9): [True: 116k, False: 112k]
  ------------------
 1499|   116k|        (ctxt->myDoc->extSubset != NULL)) {
  ------------------
  |  Branch (1499:9): [True: 0, False: 112k]
  ------------------
 1500|   116k|        xmlCheckDefaultedAttributes(ctxt, name, prefix, atts);
 1501|   116k|    }
 1502|       |
 1503|       |    /*
 1504|       |     * process all the attributes whose name start with "xmlns"
 1505|       |     */
 1506|   228k|    if (atts != NULL) {
  ------------------
  |  Branch (1506:9): [True: 52.0k, False: 176k]
  ------------------
 1507|  52.0k|        i = 0;
 1508|  52.0k|        att = atts[i++];
 1509|  52.0k|        value = atts[i++];
 1510|   120k|        while ((att != NULL) && (value != NULL)) {
  ------------------
  |  Branch (1510:16): [True: 67.9k, False: 52.0k]
  |  Branch (1510:33): [True: 67.9k, False: 0]
  ------------------
 1511|  67.9k|            if ((att[0] == 'x') && (att[1] == 'm') && (att[2] == 'l') &&
  ------------------
  |  Branch (1511:17): [True: 47.8k, False: 20.1k]
  |  Branch (1511:36): [True: 41.3k, False: 6.51k]
  |  Branch (1511:55): [True: 40.1k, False: 1.13k]
  ------------------
 1512|  40.1k|                (att[3] == 'n') && (att[4] == 's'))
  ------------------
  |  Branch (1512:17): [True: 32.9k, False: 7.27k]
  |  Branch (1512:36): [True: 32.5k, False: 362]
  ------------------
 1513|  32.5k|                xmlSAX1Attribute(ctxt, att, value, prefix);
 1514|       |
 1515|  67.9k|            att = atts[i++];
 1516|  67.9k|            value = atts[i++];
 1517|  67.9k|        }
 1518|  52.0k|    }
 1519|       |
 1520|       |    /*
 1521|       |     * Search the namespace, note that since the attributes have been
 1522|       |     * processed, the local namespaces are available.
 1523|       |     */
 1524|   228k|    res = xmlSearchNsSafe(ret, prefix, &ns);
 1525|   228k|    if (res < 0)
  ------------------
  |  Branch (1525:9): [True: 3, False: 228k]
  ------------------
 1526|      3|        xmlSAX2ErrMemory(ctxt);
 1527|   228k|    if ((ns == NULL) && (parent != NULL)) {
  ------------------
  |  Branch (1527:9): [True: 173k, False: 55.2k]
  |  Branch (1527:25): [True: 173k, False: 0]
  ------------------
 1528|   173k|        res = xmlSearchNsSafe(parent, prefix, &ns);
 1529|   173k|        if (res < 0)
  ------------------
  |  Branch (1529:13): [True: 0, False: 173k]
  ------------------
 1530|      0|            xmlSAX2ErrMemory(ctxt);
 1531|   173k|    }
 1532|   228k|    if ((prefix != NULL) && (ns == NULL)) {
  ------------------
  |  Branch (1532:9): [True: 40.2k, False: 188k]
  |  Branch (1532:29): [True: 10.6k, False: 29.5k]
  ------------------
 1533|  10.6k|        xmlNsWarnMsg(ctxt, XML_NS_ERR_UNDEFINED_NAMESPACE,
 1534|  10.6k|                     "Namespace prefix %s is not defined\n",
 1535|  10.6k|                     prefix, NULL);
 1536|  10.6k|        ns = xmlNewNs(ret, NULL, prefix);
 1537|  10.6k|        if (ns == NULL)
  ------------------
  |  Branch (1537:13): [True: 6, False: 10.6k]
  ------------------
 1538|      6|            xmlSAX2ErrMemory(ctxt);
 1539|  10.6k|    }
 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|   228k|    if ((ns != NULL) && (ns->href != NULL) &&
  ------------------
  |  Branch (1545:9): [True: 65.8k, False: 162k]
  |  Branch (1545:25): [True: 55.2k, False: 10.6k]
  ------------------
 1546|  55.2k|        ((ns->href[0] != 0) || (ns->prefix != NULL)))
  ------------------
  |  Branch (1546:10): [True: 51.4k, False: 3.82k]
  |  Branch (1546:32): [True: 265, False: 3.55k]
  ------------------
 1547|  51.6k|        xmlSetNs(ret, ns);
 1548|       |
 1549|       |    /*
 1550|       |     * process all the other attributes
 1551|       |     */
 1552|   228k|    if (atts != NULL) {
  ------------------
  |  Branch (1552:9): [True: 52.0k, False: 176k]
  ------------------
 1553|  52.0k|        i = 0;
 1554|  52.0k|	att = atts[i++];
 1555|  52.0k|	value = atts[i++];
 1556|   120k|        while ((att != NULL) && (value != NULL)) {
  ------------------
  |  Branch (1556:16): [True: 67.9k, False: 52.0k]
  |  Branch (1556:33): [True: 67.9k, False: 0]
  ------------------
 1557|  67.9k|            if ((att[0] != 'x') || (att[1] != 'm') || (att[2] != 'l') ||
  ------------------
  |  Branch (1557:17): [True: 20.1k, False: 47.8k]
  |  Branch (1557:36): [True: 6.51k, False: 41.3k]
  |  Branch (1557:55): [True: 1.13k, False: 40.1k]
  ------------------
 1558|  40.1k|                (att[3] != 'n') || (att[4] != 's'))
  ------------------
  |  Branch (1558:17): [True: 7.27k, False: 32.9k]
  |  Branch (1558:36): [True: 362, False: 32.5k]
  ------------------
 1559|  35.4k|                xmlSAX1Attribute(ctxt, att, value, NULL);
 1560|       |
 1561|       |            /*
 1562|       |             * Next ones
 1563|       |             */
 1564|  67.9k|            att = atts[i++];
 1565|  67.9k|            value = atts[i++];
 1566|  67.9k|        }
 1567|  52.0k|    }
 1568|       |
 1569|   228k|#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|   228k|    if ((ctxt->validate) &&
  ------------------
  |  Branch (1574:9): [True: 74.8k, False: 153k]
  ------------------
 1575|  74.8k|        ((ctxt->vctxt.flags & XML_VCTXT_DTD_VALIDATED) == 0)) {
  ------------------
  |  |   16|  74.8k|#define XML_VCTXT_DTD_VALIDATED (1u << 0)
  ------------------
  |  Branch (1575:9): [True: 2.05k, False: 72.8k]
  ------------------
 1576|  2.05k|	int chk;
 1577|       |
 1578|  2.05k|	chk = xmlValidateDtdFinal(&ctxt->vctxt, ctxt->myDoc);
 1579|  2.05k|	if (chk <= 0)
  ------------------
  |  Branch (1579:6): [True: 38, False: 2.01k]
  ------------------
 1580|     38|	    ctxt->valid = 0;
 1581|  2.05k|	if (chk < 0)
  ------------------
  |  Branch (1581:6): [True: 0, False: 2.05k]
  ------------------
 1582|      0|	    ctxt->wellFormed = 0;
 1583|  2.05k|	ctxt->valid &= xmlValidateRoot(&ctxt->vctxt, ctxt->myDoc);
 1584|  2.05k|	ctxt->vctxt.flags |= XML_VCTXT_DTD_VALIDATED;
  ------------------
  |  |   16|  2.05k|#define XML_VCTXT_DTD_VALIDATED (1u << 0)
  ------------------
 1585|  2.05k|    }
 1586|   228k|#endif /* LIBXML_VALID_ENABLED */
 1587|       |
 1588|   228k|    if (prefix != NULL)
  ------------------
  |  Branch (1588:9): [True: 40.2k, False: 188k]
  ------------------
 1589|  40.2k|	xmlFree(prefix);
 1590|       |
 1591|   228k|}
SAX2.c:xmlCheckDefaultedAttributes:
 1257|   116k|	const xmlChar *prefix, const xmlChar **atts) {
 1258|   116k|    xmlElementPtr elemDecl;
 1259|   116k|    const xmlChar *att;
 1260|   116k|    int internal = 1;
 1261|   116k|    int i;
 1262|       |
 1263|   116k|    elemDecl = xmlGetDtdQElementDesc(ctxt->myDoc->intSubset, name, prefix);
 1264|   116k|    if (elemDecl == NULL) {
  ------------------
  |  Branch (1264:9): [True: 64.3k, False: 51.7k]
  ------------------
 1265|  64.3k|	elemDecl = xmlGetDtdQElementDesc(ctxt->myDoc->extSubset, name, prefix);
 1266|  64.3k|	internal = 0;
 1267|  64.3k|    }
 1268|       |
 1269|   167k|process_external_subset:
 1270|       |
 1271|   167k|    if (elemDecl != NULL) {
  ------------------
  |  Branch (1271:9): [True: 54.4k, False: 113k]
  ------------------
 1272|  54.4k|	xmlAttributePtr attr = elemDecl->attributes;
 1273|       |
 1274|  54.4k|#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|  54.4k|	if ((ctxt->myDoc->standalone == 1) &&
  ------------------
  |  Branch (1282:6): [True: 1.32k, False: 53.1k]
  ------------------
 1283|  1.32k|	    (ctxt->myDoc->extSubset != NULL) &&
  ------------------
  |  Branch (1283:6): [True: 1.10k, False: 219]
  ------------------
 1284|  1.10k|	    (ctxt->validate)) {
  ------------------
  |  Branch (1284:6): [True: 900, False: 202]
  ------------------
 1285|  1.94k|	    while (attr != NULL) {
  ------------------
  |  Branch (1285:13): [True: 1.05k, False: 897]
  ------------------
 1286|  1.05k|		if ((attr->defaultValue != NULL) &&
  ------------------
  |  Branch (1286:7): [True: 736, False: 314]
  ------------------
 1287|    736|		    (xmlGetDtdQAttrDesc(ctxt->myDoc->extSubset,
  ------------------
  |  Branch (1287:7): [True: 635, False: 101]
  ------------------
 1288|    736|					attr->elem, attr->name,
 1289|    736|					attr->prefix) == attr) &&
 1290|    635|		    (xmlGetDtdQAttrDesc(ctxt->myDoc->intSubset,
  ------------------
  |  Branch (1290:7): [True: 635, False: 0]
  ------------------
 1291|    635|					attr->elem, attr->name,
 1292|    635|					attr->prefix) == NULL)) {
 1293|    635|		    xmlChar *fulln;
 1294|       |
 1295|    635|		    if (attr->prefix != NULL) {
  ------------------
  |  Branch (1295:11): [True: 54, False: 581]
  ------------------
 1296|     54|			fulln = xmlStrdup(attr->prefix);
 1297|     54|                        if (fulln != NULL)
  ------------------
  |  Branch (1297:29): [True: 53, False: 1]
  ------------------
 1298|     53|			    fulln = xmlStrcat(fulln, BAD_CAST ":");
  ------------------
  |  |   34|     53|#define BAD_CAST (xmlChar *)
  ------------------
 1299|     54|                        if (fulln != NULL)
  ------------------
  |  Branch (1299:29): [True: 53, False: 1]
  ------------------
 1300|     53|			    fulln = xmlStrcat(fulln, attr->name);
 1301|    581|		    } else {
 1302|    581|			fulln = xmlStrdup(attr->name);
 1303|    581|		    }
 1304|    635|                    if (fulln == NULL) {
  ------------------
  |  Branch (1304:25): [True: 3, False: 632]
  ------------------
 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|    632|		    att = NULL;
 1314|    632|		    if (atts != NULL) {
  ------------------
  |  Branch (1314:11): [True: 174, False: 458]
  ------------------
 1315|    174|			i = 0;
 1316|    174|			att = atts[i];
 1317|    317|			while (att != NULL) {
  ------------------
  |  Branch (1317:11): [True: 208, False: 109]
  ------------------
 1318|    208|			    if (xmlStrEqual(att, fulln))
  ------------------
  |  Branch (1318:12): [True: 65, False: 143]
  ------------------
 1319|     65|				break;
 1320|    143|			    i += 2;
 1321|    143|			    att = atts[i];
 1322|    143|			}
 1323|    174|		    }
 1324|    632|		    if (att == NULL) {
  ------------------
  |  Branch (1324:11): [True: 567, False: 65]
  ------------------
 1325|    567|		        xmlErrValid(ctxt, XML_DTD_STANDALONE_DEFAULTED,
 1326|    567|      "standalone: attribute %s on %s defaulted from external subset\n",
 1327|    567|				    fulln,
 1328|    567|				    attr->elem);
 1329|    567|		    }
 1330|    632|                    xmlFree(fulln);
 1331|    632|		}
 1332|  1.04k|		attr = attr->nexth;
 1333|  1.04k|	    }
 1334|    900|	}
 1335|  54.4k|#endif
 1336|       |
 1337|       |	/*
 1338|       |	 * Actually insert defaulted values when needed
 1339|       |	 */
 1340|  54.4k|	attr = elemDecl->attributes;
 1341|   137k|	while (attr != NULL) {
  ------------------
  |  Branch (1341:9): [True: 82.8k, False: 54.4k]
  ------------------
 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|  82.8k|	    if (attr->defaultValue != NULL) {
  ------------------
  |  Branch (1347:10): [True: 77.6k, False: 5.15k]
  ------------------
 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|  77.6k|		if (((attr->prefix != NULL) &&
  ------------------
  |  Branch (1356:8): [True: 21.1k, False: 56.5k]
  ------------------
 1357|  21.1k|		     (xmlStrEqual(attr->prefix, BAD_CAST "xmlns"))) ||
  ------------------
  |  |   34|  21.1k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (1357:8): [True: 8.24k, False: 12.8k]
  ------------------
 1358|  69.4k|		    ((attr->prefix == NULL) &&
  ------------------
  |  Branch (1358:8): [True: 56.5k, False: 12.8k]
  ------------------
 1359|  56.5k|		     (xmlStrEqual(attr->name, BAD_CAST "xmlns"))) ||
  ------------------
  |  |   34|  56.5k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (1359:8): [True: 2.89k, False: 53.6k]
  ------------------
 1360|  66.5k|		    (ctxt->loadsubset & XML_COMPLETE_ATTRS)) {
  ------------------
  |  |  209|  66.5k|#define XML_COMPLETE_ATTRS	4
  ------------------
  |  Branch (1360:7): [True: 30.2k, False: 36.3k]
  ------------------
 1361|  41.3k|		    xmlAttributePtr tst;
 1362|       |
 1363|  41.3k|		    tst = xmlGetDtdQAttrDesc(ctxt->myDoc->intSubset,
 1364|  41.3k|					     attr->elem, attr->name,
 1365|  41.3k|					     attr->prefix);
 1366|  41.3k|		    if ((tst == attr) || (tst == NULL)) {
  ------------------
  |  Branch (1366:11): [True: 39.4k, False: 1.94k]
  |  Branch (1366:28): [True: 1.94k, False: 0]
  ------------------
 1367|  41.3k|		        xmlChar fn[50];
 1368|  41.3k|			xmlChar *fulln;
 1369|       |
 1370|  41.3k|                        fulln = xmlBuildQName(attr->name, attr->prefix, fn, 50);
 1371|  41.3k|			if (fulln == NULL) {
  ------------------
  |  Branch (1371:8): [True: 6, False: 41.3k]
  ------------------
 1372|      6|			    xmlSAX2ErrMemory(ctxt);
 1373|      6|			    return;
 1374|      6|			}
 1375|       |
 1376|       |			/*
 1377|       |			 * Check that the attribute is not declared in the
 1378|       |			 * serialization
 1379|       |			 */
 1380|  41.3k|			att = NULL;
 1381|  41.3k|			if (atts != NULL) {
  ------------------
  |  Branch (1381:8): [True: 3.00k, False: 38.3k]
  ------------------
 1382|  3.00k|			    i = 0;
 1383|  3.00k|			    att = atts[i];
 1384|  5.73k|			    while (att != NULL) {
  ------------------
  |  Branch (1384:15): [True: 3.75k, False: 1.97k]
  ------------------
 1385|  3.75k|				if (xmlStrEqual(att, fulln))
  ------------------
  |  Branch (1385:9): [True: 1.03k, False: 2.72k]
  ------------------
 1386|  1.03k|				    break;
 1387|  2.72k|				i += 2;
 1388|  2.72k|				att = atts[i];
 1389|  2.72k|			    }
 1390|  3.00k|			}
 1391|  41.3k|			if (att == NULL) {
  ------------------
  |  Branch (1391:8): [True: 40.3k, False: 1.03k]
  ------------------
 1392|  40.3k|			    xmlSAX1Attribute(ctxt, fulln,
 1393|  40.3k|					     attr->defaultValue, prefix);
 1394|  40.3k|			}
 1395|  41.3k|			if ((fulln != fn) && (fulln != attr->name))
  ------------------
  |  Branch (1395:8): [True: 39.3k, False: 2.04k]
  |  Branch (1395:25): [True: 13.1k, False: 26.1k]
  ------------------
 1396|  13.1k|			    xmlFree(fulln);
 1397|  41.3k|		    }
 1398|  41.3k|		}
 1399|  77.6k|	    }
 1400|  82.7k|	    attr = attr->nexth;
 1401|  82.7k|	}
 1402|  54.4k|	if (internal == 1) {
  ------------------
  |  Branch (1402:6): [True: 51.7k, False: 2.76k]
  ------------------
 1403|  51.7k|	    elemDecl = xmlGetDtdQElementDesc(ctxt->myDoc->extSubset,
 1404|  51.7k|		                             name, prefix);
 1405|  51.7k|	    internal = 0;
 1406|  51.7k|	    goto process_external_subset;
 1407|  51.7k|	}
 1408|  54.4k|    }
 1409|   167k|}
SAX2.c:xmlSAX1Attribute:
  960|   108k|{
  961|   108k|    xmlAttrPtr ret;
  962|   108k|    const xmlChar *name;
  963|   108k|    xmlChar *ns;
  964|   108k|    xmlNsPtr namespace;
  965|       |
  966|       |    /*
  967|       |     * Split the full name into a namespace prefix and the tag name
  968|       |     */
  969|   108k|    name = xmlSplitQName4(fullname, &ns);
  970|   108k|    if (name == NULL) {
  ------------------
  |  Branch (970:9): [True: 5, False: 108k]
  ------------------
  971|      5|        xmlSAX2ErrMemory(ctxt);
  972|      5|        return;
  973|      5|    }
  974|       |
  975|       |    /*
  976|       |     * Check whether it's a namespace definition
  977|       |     */
  978|   108k|    if ((ns == NULL) &&
  ------------------
  |  Branch (978:9): [True: 55.2k, False: 53.0k]
  ------------------
  979|  55.2k|        (name[0] == 'x') && (name[1] == 'm') && (name[2] == 'l') &&
  ------------------
  |  Branch (979:9): [True: 18.6k, False: 36.5k]
  |  Branch (979:29): [True: 11.3k, False: 7.33k]
  |  Branch (979:49): [True: 10.7k, False: 601]
  ------------------
  980|  10.7k|        (name[3] == 'n') && (name[4] == 's') && (name[5] == 0)) {
  ------------------
  |  Branch (980:9): [True: 9.82k, False: 879]
  |  Branch (980:29): [True: 9.62k, False: 204]
  |  Branch (980:49): [True: 9.03k, False: 588]
  ------------------
  981|  9.03k|	xmlNsPtr nsret;
  982|  9.03k|	xmlChar *val;
  983|       |
  984|       |        /* Avoid unused variable warning if features are disabled. */
  985|  9.03k|        (void) nsret;
  986|       |
  987|  9.03k|        if (!ctxt->replaceEntities) {
  ------------------
  |  Branch (987:13): [True: 5.50k, False: 3.52k]
  ------------------
  988|       |            /* TODO: normalize if needed */
  989|  5.50k|	    val = xmlExpandEntitiesInAttValue(ctxt, value, /* normalize */ 0);
  990|  5.50k|	    if (val == NULL) {
  ------------------
  |  Branch (990:10): [True: 8, False: 5.50k]
  ------------------
  991|      8|	        xmlSAX2ErrMemory(ctxt);
  992|      8|		return;
  993|      8|	    }
  994|  5.50k|	} else {
  995|  3.52k|	    val = (xmlChar *) value;
  996|  3.52k|	}
  997|       |
  998|  9.02k|	if (val[0] != 0) {
  ------------------
  |  Branch (998:6): [True: 6.25k, False: 2.77k]
  ------------------
  999|  6.25k|	    xmlURIPtr uri;
 1000|       |
 1001|  6.25k|	    if (xmlParseURISafe((const char *)val, &uri) < 0)
  ------------------
  |  Branch (1001:10): [True: 11, False: 6.24k]
  ------------------
 1002|     11|                xmlSAX2ErrMemory(ctxt);
 1003|  6.25k|	    if (uri == NULL) {
  ------------------
  |  Branch (1003:10): [True: 1.71k, False: 4.54k]
  ------------------
 1004|  1.71k|                xmlNsWarnMsg(ctxt, XML_WAR_NS_URI,
 1005|  1.71k|                             "xmlns:%s: %s not a valid URI\n", name, value);
 1006|  4.54k|	    } else {
 1007|  4.54k|		if (uri->scheme == NULL) {
  ------------------
  |  Branch (1007:7): [True: 3.93k, False: 603]
  ------------------
 1008|  3.93k|                    xmlNsWarnMsg(ctxt, XML_WAR_NS_URI_RELATIVE,
 1009|  3.93k|                                 "xmlns:%s: URI %s is not absolute\n",
 1010|  3.93k|                                 name, value);
 1011|  3.93k|		}
 1012|  4.54k|		xmlFreeURI(uri);
 1013|  4.54k|	    }
 1014|  6.25k|	}
 1015|       |
 1016|       |	/* a default namespace definition */
 1017|  9.02k|	nsret = xmlNewNs(ctxt->node, val, NULL);
 1018|  9.02k|        if (nsret == NULL) {
  ------------------
  |  Branch (1018:13): [True: 7, False: 9.02k]
  ------------------
 1019|      7|            xmlSAX2ErrMemory(ctxt);
 1020|      7|        }
 1021|  9.02k|#ifdef LIBXML_VALID_ENABLED
 1022|       |	/*
 1023|       |	 * Validate also for namespace decls, they are attributes from
 1024|       |	 * an XML-1.0 perspective
 1025|       |	 */
 1026|  9.02k|        else if (ctxt->validate && ctxt->wellFormed &&
  ------------------
  |  Branch (1026:18): [True: 2.25k, False: 6.76k]
  |  Branch (1026:36): [True: 1.50k, False: 754]
  ------------------
 1027|  1.50k|                 ctxt->myDoc && ctxt->myDoc->intSubset) {
  ------------------
  |  Branch (1027:18): [True: 1.50k, False: 0]
  |  Branch (1027:33): [True: 1.50k, False: 0]
  ------------------
 1028|  1.50k|	    ctxt->valid &= xmlValidateOneNamespace(&ctxt->vctxt, ctxt->myDoc,
 1029|  1.50k|					   ctxt->node, prefix, nsret, val);
 1030|  1.50k|        }
 1031|  9.02k|#endif /* LIBXML_VALID_ENABLED */
 1032|  9.02k|	if (val != value)
  ------------------
  |  Branch (1032:6): [True: 5.50k, False: 3.52k]
  ------------------
 1033|  5.50k|	    xmlFree(val);
 1034|  9.02k|	return;
 1035|  9.03k|    }
 1036|  99.2k|    if ((ns != NULL) && (ns[0] == 'x') && (ns[1] == 'm') && (ns[2] == 'l') &&
  ------------------
  |  Branch (1036:9): [True: 53.0k, False: 46.1k]
  |  Branch (1036:25): [True: 46.7k, False: 6.36k]
  |  Branch (1036:43): [True: 45.9k, False: 764]
  |  Branch (1036:61): [True: 44.7k, False: 1.24k]
  ------------------
 1037|  44.7k|        (ns[3] == 'n') && (ns[4] == 's') && (ns[5] == 0)) {
  ------------------
  |  Branch (1037:9): [True: 35.9k, False: 8.78k]
  |  Branch (1037:27): [True: 35.3k, False: 569]
  |  Branch (1037:45): [True: 34.5k, False: 833]
  ------------------
 1038|  34.5k|	xmlNsPtr nsret;
 1039|  34.5k|	xmlChar *val;
 1040|       |
 1041|       |        /* Avoid unused variable warning if features are disabled. */
 1042|  34.5k|        (void) nsret;
 1043|       |
 1044|  34.5k|        if (!ctxt->replaceEntities) {
  ------------------
  |  Branch (1044:13): [True: 9.02k, False: 25.4k]
  ------------------
 1045|       |            /* TODO: normalize if needed */
 1046|  9.02k|	    val = xmlExpandEntitiesInAttValue(ctxt, value, /* normalize */ 0);
 1047|  9.02k|	    if (val == NULL) {
  ------------------
  |  Branch (1047:10): [True: 3, False: 9.02k]
  ------------------
 1048|      3|	        xmlSAX2ErrMemory(ctxt);
 1049|      3|	        xmlFree(ns);
 1050|      3|		return;
 1051|      3|	    }
 1052|  25.4k|	} else {
 1053|  25.4k|	    val = (xmlChar *) value;
 1054|  25.4k|	}
 1055|       |
 1056|  34.5k|	if (val[0] == 0) {
  ------------------
  |  Branch (1056:6): [True: 362, False: 34.1k]
  ------------------
 1057|    362|	    xmlNsErrMsg(ctxt, XML_NS_ERR_EMPTY,
 1058|    362|		        "Empty namespace name for prefix %s\n", name, NULL);
 1059|    362|	}
 1060|  34.5k|	if ((ctxt->pedantic != 0) && (val[0] != 0)) {
  ------------------
  |  Branch (1060:6): [True: 21.4k, False: 13.0k]
  |  Branch (1060:31): [True: 21.1k, False: 265]
  ------------------
 1061|  21.1k|	    xmlURIPtr uri;
 1062|       |
 1063|  21.1k|	    if (xmlParseURISafe((const char *)val, &uri) < 0)
  ------------------
  |  Branch (1063:10): [True: 6, False: 21.1k]
  ------------------
 1064|      6|                xmlSAX2ErrMemory(ctxt);
 1065|  21.1k|	    if (uri == NULL) {
  ------------------
  |  Branch (1065:10): [True: 1.61k, False: 19.5k]
  ------------------
 1066|  1.61k|	        xmlNsWarnMsg(ctxt, XML_WAR_NS_URI,
 1067|  1.61k|			 "xmlns:%s: %s not a valid URI\n", name, value);
 1068|  19.5k|	    } else {
 1069|  19.5k|		if (uri->scheme == NULL) {
  ------------------
  |  Branch (1069:7): [True: 17.7k, False: 1.84k]
  ------------------
 1070|  17.7k|		    xmlNsWarnMsg(ctxt, XML_WAR_NS_URI_RELATIVE,
 1071|  17.7k|			   "xmlns:%s: URI %s is not absolute\n", name, value);
 1072|  17.7k|		}
 1073|  19.5k|		xmlFreeURI(uri);
 1074|  19.5k|	    }
 1075|  21.1k|	}
 1076|       |
 1077|       |	/* a standard namespace definition */
 1078|  34.5k|	nsret = xmlNewNs(ctxt->node, val, name);
 1079|  34.5k|	xmlFree(ns);
 1080|       |
 1081|  34.5k|        if (nsret == NULL) {
  ------------------
  |  Branch (1081:13): [True: 4, False: 34.5k]
  ------------------
 1082|      4|            xmlSAX2ErrMemory(ctxt);
 1083|      4|        }
 1084|  34.5k|#ifdef LIBXML_VALID_ENABLED
 1085|       |	/*
 1086|       |	 * Validate also for namespace decls, they are attributes from
 1087|       |	 * an XML-1.0 perspective
 1088|       |	 */
 1089|  34.5k|        else if (ctxt->validate && ctxt->wellFormed &&
  ------------------
  |  Branch (1089:18): [True: 5.18k, False: 29.3k]
  |  Branch (1089:36): [True: 2.74k, False: 2.43k]
  ------------------
 1090|  2.74k|	         ctxt->myDoc && ctxt->myDoc->intSubset) {
  ------------------
  |  Branch (1090:11): [True: 2.74k, False: 0]
  |  Branch (1090:26): [True: 2.74k, False: 0]
  ------------------
 1091|  2.74k|	    ctxt->valid &= xmlValidateOneNamespace(&ctxt->vctxt, ctxt->myDoc,
 1092|  2.74k|					   ctxt->node, prefix, nsret, value);
 1093|  2.74k|        }
 1094|  34.5k|#endif /* LIBXML_VALID_ENABLED */
 1095|  34.5k|	if (val != value)
  ------------------
  |  Branch (1095:6): [True: 9.02k, False: 25.4k]
  ------------------
 1096|  9.02k|	    xmlFree(val);
 1097|  34.5k|	return;
 1098|  34.5k|    }
 1099|       |
 1100|  64.7k|    if (ns != NULL) {
  ------------------
  |  Branch (1100:9): [True: 18.5k, False: 46.1k]
  ------------------
 1101|  18.5k|        int res;
 1102|       |
 1103|  18.5k|	res = xmlSearchNsSafe(ctxt->node, ns, &namespace);
 1104|  18.5k|        if (res < 0)
  ------------------
  |  Branch (1104:13): [True: 6, False: 18.5k]
  ------------------
 1105|      6|            xmlSAX2ErrMemory(ctxt);
 1106|       |
 1107|  18.5k|	if (namespace == NULL) {
  ------------------
  |  Branch (1107:6): [True: 7.47k, False: 11.0k]
  ------------------
 1108|  7.47k|	    xmlNsErrMsg(ctxt, XML_NS_ERR_UNDEFINED_NAMESPACE,
 1109|  7.47k|		    "Namespace prefix %s of attribute %s is not defined\n",
 1110|  7.47k|		             ns, name);
 1111|  11.0k|	} else {
 1112|  11.0k|            xmlAttrPtr prop;
 1113|       |
 1114|  11.0k|            prop = ctxt->node->properties;
 1115|  41.4k|            while (prop != NULL) {
  ------------------
  |  Branch (1115:20): [True: 30.5k, False: 10.9k]
  ------------------
 1116|  30.5k|                if (prop->ns != NULL) {
  ------------------
  |  Branch (1116:21): [True: 14.5k, False: 15.9k]
  ------------------
 1117|  14.5k|                    if ((xmlStrEqual(name, prop->name)) &&
  ------------------
  |  Branch (1117:25): [True: 260, False: 14.3k]
  ------------------
 1118|    260|                        ((namespace == prop->ns) ||
  ------------------
  |  Branch (1118:26): [True: 0, False: 260]
  ------------------
 1119|    260|                         (xmlStrEqual(namespace->href, prop->ns->href)))) {
  ------------------
  |  Branch (1119:26): [True: 168, False: 92]
  ------------------
 1120|    168|                        xmlCtxtErr(ctxt, NULL, XML_FROM_PARSER,
 1121|    168|                                   XML_ERR_ATTRIBUTE_REDEFINED, XML_ERR_FATAL,
 1122|    168|                                   name, NULL, NULL, 0,
 1123|    168|                                   "Attribute %s in %s redefined\n",
 1124|    168|                                   name, namespace->href);
 1125|    168|                        goto error;
 1126|    168|                    }
 1127|  14.5k|                }
 1128|  30.3k|                prop = prop->next;
 1129|  30.3k|            }
 1130|  11.0k|        }
 1131|  46.1k|    } else {
 1132|  46.1k|	namespace = NULL;
 1133|  46.1k|    }
 1134|       |
 1135|       |    /* !!!!!! <a toto:arg="" xmlns:toto="http://toto.com"> */
 1136|  64.5k|    ret = xmlNewNsProp(ctxt->node, namespace, name, NULL);
 1137|  64.5k|    if (ret == NULL) {
  ------------------
  |  Branch (1137:9): [True: 32, False: 64.5k]
  ------------------
 1138|     32|        xmlSAX2ErrMemory(ctxt);
 1139|     32|        goto error;
 1140|     32|    }
 1141|       |
 1142|  64.5k|    if (ctxt->replaceEntities == 0) {
  ------------------
  |  Branch (1142:9): [True: 33.3k, False: 31.1k]
  ------------------
 1143|  33.3k|        if (xmlNodeParseAttValue(ret->doc, ret, value, SIZE_MAX, NULL) < 0)
  ------------------
  |  Branch (1143:13): [True: 40, False: 33.3k]
  ------------------
 1144|     40|            xmlSAX2ErrMemory(ctxt);
 1145|  33.3k|    } else if (value != NULL) {
  ------------------
  |  Branch (1145:16): [True: 31.1k, False: 0]
  ------------------
 1146|  31.1k|        ret->children = xmlNewDocText(ctxt->myDoc, value);
 1147|  31.1k|        if (ret->children == NULL) {
  ------------------
  |  Branch (1147:13): [True: 19, False: 31.1k]
  ------------------
 1148|     19|            xmlSAX2ErrMemory(ctxt);
 1149|  31.1k|        } else {
 1150|  31.1k|            ret->last = ret->children;
 1151|  31.1k|            ret->children->parent = (xmlNodePtr) ret;
 1152|  31.1k|        }
 1153|  31.1k|    }
 1154|       |
 1155|  64.5k|#ifdef LIBXML_VALID_ENABLED
 1156|  64.5k|    if (ctxt->validate && ctxt->wellFormed &&
  ------------------
  |  Branch (1156:9): [True: 26.3k, False: 38.1k]
  |  Branch (1156:27): [True: 8.34k, False: 17.9k]
  ------------------
 1157|  8.34k|        ctxt->myDoc && ctxt->myDoc->intSubset) {
  ------------------
  |  Branch (1157:9): [True: 8.34k, False: 0]
  |  Branch (1157:24): [True: 8.34k, False: 0]
  ------------------
 1158|       |
 1159|       |	/*
 1160|       |	 * If we don't substitute entities, the validation should be
 1161|       |	 * done on a value with replaced entities anyway.
 1162|       |	 */
 1163|  8.34k|        if (!ctxt->replaceEntities) {
  ------------------
  |  Branch (1163:13): [True: 3.33k, False: 5.01k]
  ------------------
 1164|  3.33k|	    xmlChar *val;
 1165|       |
 1166|       |            /* TODO: normalize if needed */
 1167|  3.33k|	    val = xmlExpandEntitiesInAttValue(ctxt, value, /* normalize */ 0);
 1168|       |
 1169|  3.33k|	    if (val == NULL)
  ------------------
  |  Branch (1169:10): [True: 1, False: 3.32k]
  ------------------
 1170|      1|		ctxt->valid &= xmlValidateOneAttribute(&ctxt->vctxt,
 1171|      1|				ctxt->myDoc, ctxt->node, ret, value);
 1172|  3.32k|	    else {
 1173|  3.32k|		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.32k|                nvalnorm = xmlValidCtxtNormalizeAttributeValue(
 1181|  3.32k|                                 &ctxt->vctxt, ctxt->myDoc,
 1182|  3.32k|                                 ctxt->node, fullname, val);
 1183|  3.32k|		if (nvalnorm != NULL) {
  ------------------
  |  Branch (1183:7): [True: 1.49k, False: 1.83k]
  ------------------
 1184|  1.49k|		    xmlFree(val);
 1185|  1.49k|		    val = nvalnorm;
 1186|  1.49k|		}
 1187|       |
 1188|  3.32k|		ctxt->valid &= xmlValidateOneAttribute(&ctxt->vctxt,
 1189|  3.32k|			        ctxt->myDoc, ctxt->node, ret, val);
 1190|  3.32k|                xmlFree(val);
 1191|  3.32k|	    }
 1192|  5.01k|	} 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|  5.01k|            if (ctxt->input->entity != NULL)
  ------------------
  |  Branch (1199:17): [True: 682, False: 4.33k]
  ------------------
 1200|    682|                ctxt->vctxt.flags |= XML_VCTXT_IN_ENTITY;
  ------------------
  |  |   28|    682|#define XML_VCTXT_IN_ENTITY (1u << 3)
  ------------------
 1201|       |
 1202|  5.01k|	    ctxt->valid &= xmlValidateOneAttribute(&ctxt->vctxt, ctxt->myDoc,
 1203|  5.01k|					       ctxt->node, ret, value);
 1204|       |
 1205|  5.01k|            ctxt->vctxt.flags &= ~XML_VCTXT_IN_ENTITY;
  ------------------
  |  |   28|  5.01k|#define XML_VCTXT_IN_ENTITY (1u << 3)
  ------------------
 1206|  5.01k|	}
 1207|  8.34k|    } else
 1208|  56.1k|#endif /* LIBXML_VALID_ENABLED */
 1209|  56.1k|           if (((ctxt->loadsubset & XML_SKIP_IDS) == 0) &&
  ------------------
  |  |  210|  56.1k|#define XML_SKIP_IDS		8
  ------------------
  |  Branch (1209:16): [True: 37.5k, False: 18.6k]
  ------------------
 1210|  37.5k|               (ctxt->input->entity == NULL) &&
  ------------------
  |  Branch (1210:16): [True: 36.6k, False: 923]
  ------------------
 1211|       |               /* Don't create IDs containing entity references */
 1212|  36.6k|               (ret->children != NULL) &&
  ------------------
  |  Branch (1212:16): [True: 34.2k, False: 2.38k]
  ------------------
 1213|  34.2k|               (ret->children->type == XML_TEXT_NODE) &&
  ------------------
  |  Branch (1213:16): [True: 33.9k, False: 296]
  ------------------
 1214|  33.9k|               (ret->children->next == NULL)) {
  ------------------
  |  Branch (1214:16): [True: 33.8k, False: 102]
  ------------------
 1215|  33.8k|        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|  33.8k|	if (xmlStrEqual(fullname, BAD_CAST "xml:id")) {
  ------------------
  |  |   34|  33.8k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (1220:6): [True: 1.30k, False: 32.5k]
  ------------------
 1221|       |	    /*
 1222|       |	     * Add the xml:id value
 1223|       |	     *
 1224|       |	     * Open issue: normalization of the value.
 1225|       |	     */
 1226|  1.30k|	    if (xmlValidateNCName(content, 1) != 0) {
  ------------------
  |  Branch (1226:10): [True: 976, False: 324]
  ------------------
 1227|    976|	        xmlErrId(ctxt, XML_DTD_XMLID_VALUE,
 1228|    976|		         "xml:id : attribute value %s is not an NCName\n",
 1229|    976|		         content);
 1230|    976|	    }
 1231|  1.30k|	    xmlAddID(&ctxt->vctxt, ctxt->myDoc, content, ret);
 1232|  32.5k|	} else {
 1233|  32.5k|            int res = xmlIsID(ctxt->myDoc, ctxt->node, ret);
 1234|       |
 1235|  32.5k|            if (res < 0)
  ------------------
  |  Branch (1235:17): [True: 1, False: 32.5k]
  ------------------
 1236|      1|                xmlCtxtErrMemory(ctxt);
 1237|  32.5k|            else if (res > 0)
  ------------------
  |  Branch (1237:22): [True: 2.07k, False: 30.4k]
  ------------------
 1238|  2.07k|                xmlAddID(&ctxt->vctxt, ctxt->myDoc, content, ret);
 1239|  30.4k|            else if (xmlIsRef(ctxt->myDoc, ctxt->node, ret))
  ------------------
  |  Branch (1239:22): [True: 14.0k, False: 16.3k]
  ------------------
 1240|  14.0k|                xmlAddRef(&ctxt->vctxt, ctxt->myDoc, content, ret);
 1241|  32.5k|        }
 1242|  33.8k|    }
 1243|       |
 1244|  64.7k|error:
 1245|  64.7k|    if (ns != NULL)
  ------------------
  |  Branch (1245:9): [True: 18.5k, False: 46.1k]
  ------------------
 1246|  18.5k|	xmlFree(ns);
 1247|  64.7k|}
SAX2.c:xmlNsErrMsg:
  942|  7.83k|{
  943|  7.83k|    xmlCtxtErr(ctxt, NULL, XML_FROM_NAMESPACE, error, XML_ERR_ERROR,
  944|       |               str1, str2, NULL, 0, msg, str1, str2);
  945|  7.83k|}
SAX2.c:xmlErrValid:
   59|  9.53k|{
   60|  9.53k|    xmlCtxtErr(ctxt, NULL, XML_FROM_DTD, error, XML_ERR_ERROR,
   61|  9.53k|               str1, str2, NULL, 0, msg, str1, str2);
   62|  9.53k|    if (ctxt != NULL)
  ------------------
  |  Branch (62:9): [True: 9.53k, False: 0]
  ------------------
   63|  9.53k|	ctxt->valid = 0;
   64|  9.53k|}
SAX2.c:xmlSAX2AppendChild:
  895|  1.46M|xmlSAX2AppendChild(xmlParserCtxtPtr ctxt, xmlNodePtr node) {
  896|  1.46M|    xmlNodePtr parent;
  897|  1.46M|    xmlNodePtr last;
  898|       |
  899|  1.46M|    if (ctxt->inSubset == 1) {
  ------------------
  |  Branch (899:9): [True: 140k, False: 1.32M]
  ------------------
  900|   140k|	parent = (xmlNodePtr) ctxt->myDoc->intSubset;
  901|  1.32M|    } else if (ctxt->inSubset == 2) {
  ------------------
  |  Branch (901:16): [True: 141k, False: 1.18M]
  ------------------
  902|   141k|	parent = (xmlNodePtr) ctxt->myDoc->extSubset;
  903|  1.18M|    } else {
  904|  1.18M|        parent = ctxt->node;
  905|  1.18M|        if (parent == NULL)
  ------------------
  |  Branch (905:13): [True: 103k, False: 1.08M]
  ------------------
  906|   103k|            parent = (xmlNodePtr) ctxt->myDoc;
  907|  1.18M|    }
  908|       |
  909|  1.46M|    last = parent->last;
  910|  1.46M|    if (last == NULL) {
  ------------------
  |  Branch (910:9): [True: 283k, False: 1.18M]
  ------------------
  911|   283k|        parent->children = node;
  912|  1.18M|    } else {
  913|  1.18M|        last->next = node;
  914|  1.18M|        node->prev = last;
  915|  1.18M|    }
  916|       |
  917|  1.46M|    parent->last = node;
  918|  1.46M|    node->parent = parent;
  919|       |
  920|  1.46M|    if ((node->type != XML_TEXT_NODE) &&
  ------------------
  |  Branch (920:9): [True: 1.17M, False: 295k]
  ------------------
  921|  1.17M|	(ctxt->input != NULL)) {
  ------------------
  |  Branch (921:2): [True: 1.17M, False: 0]
  ------------------
  922|  1.17M|        if ((unsigned) ctxt->input->line < (unsigned) USHRT_MAX)
  ------------------
  |  Branch (922:13): [True: 1.09M, False: 74.0k]
  ------------------
  923|  1.09M|            node->line = ctxt->input->line;
  924|  74.0k|        else
  925|  74.0k|            node->line = USHRT_MAX;
  926|  1.17M|    }
  927|  1.46M|}
SAX2.c:xmlNsWarnMsg:
  128|  35.6k|{
  129|  35.6k|    xmlCtxtErr(ctxt, NULL, XML_FROM_NAMESPACE, error, XML_ERR_WARNING,
  130|       |               str1, str2, NULL, 0, msg, str1, str2);
  131|  35.6k|}
SAX2.c:xmlSAX2AttributeNs:
 1908|   206k|{
 1909|   206k|    xmlAttrPtr ret;
 1910|   206k|    xmlNsPtr namespace = NULL;
 1911|   206k|    xmlChar *dup = NULL;
 1912|       |
 1913|       |    /*
 1914|       |     * Note: if prefix == NULL, the attribute is not in the default namespace
 1915|       |     */
 1916|   206k|    if (prefix != NULL) {
  ------------------
  |  Branch (1916:9): [True: 64.8k, False: 141k]
  ------------------
 1917|  64.8k|	namespace = xmlParserNsLookupSax(ctxt, prefix);
 1918|  64.8k|	if ((namespace == NULL) && (xmlStrEqual(prefix, BAD_CAST "xml"))) {
  ------------------
  |  |   34|  52.2k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (1918:6): [True: 52.2k, False: 12.6k]
  |  Branch (1918:29): [True: 52.1k, False: 59]
  ------------------
 1919|  52.1k|            int res;
 1920|       |
 1921|  52.1k|	    res = xmlSearchNsSafe(ctxt->node, prefix, &namespace);
 1922|  52.1k|            if (res < 0)
  ------------------
  |  Branch (1922:17): [True: 8, False: 52.1k]
  ------------------
 1923|      8|                xmlSAX2ErrMemory(ctxt);
 1924|  52.1k|	}
 1925|  64.8k|    }
 1926|       |
 1927|       |    /*
 1928|       |     * allocate the node
 1929|       |     */
 1930|   206k|    if (ctxt->freeAttrs != NULL) {
  ------------------
  |  Branch (1930:9): [True: 1.24k, False: 204k]
  ------------------
 1931|  1.24k|        ret = ctxt->freeAttrs;
 1932|  1.24k|	ctxt->freeAttrs = ret->next;
 1933|  1.24k|	ctxt->freeAttrsNr--;
 1934|   204k|    } else {
 1935|   204k|        ret = xmlMalloc(sizeof(*ret));
 1936|   204k|        if (ret == NULL) {
  ------------------
  |  Branch (1936:13): [True: 9, False: 204k]
  ------------------
 1937|      9|            xmlSAX2ErrMemory(ctxt);
 1938|      9|            return(NULL);
 1939|      9|        }
 1940|   204k|    }
 1941|       |
 1942|   206k|    memset(ret, 0, sizeof(xmlAttr));
 1943|   206k|    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|   206k|    ret->parent = ctxt->node;
 1955|   206k|    ret->doc = ctxt->node->doc;
 1956|   206k|    ret->ns = namespace;
 1957|       |
 1958|   206k|    if (ctxt->dictNames) {
  ------------------
  |  Branch (1958:9): [True: 126k, False: 79.9k]
  ------------------
 1959|   126k|        ret->name = localname;
 1960|   126k|    } else {
 1961|  79.9k|        ret->name = xmlStrdup(localname);
 1962|  79.9k|        if (ret->name == NULL)
  ------------------
  |  Branch (1962:13): [True: 45, False: 79.8k]
  ------------------
 1963|     45|            xmlSAX2ErrMemory(ctxt);
 1964|  79.9k|    }
 1965|       |
 1966|   206k|    if ((xmlRegisterCallbacks) && (xmlRegisterNodeDefaultValue))
  ------------------
  |  |  932|      0|    (*__xmlRegisterNodeDefaultValue())
  ------------------
  |  Branch (1966:9): [True: 0, False: 206k]
  |  Branch (1966:35): [True: 0, False: 0]
  ------------------
 1967|      0|        xmlRegisterNodeDefaultValue((xmlNodePtr)ret);
  ------------------
  |  |  932|      0|    (*__xmlRegisterNodeDefaultValue())
  ------------------
 1968|       |
 1969|   206k|    if ((ctxt->replaceEntities == 0) && (!ctxt->html)) {
  ------------------
  |  Branch (1969:9): [True: 61.0k, False: 144k]
  |  Branch (1969:41): [True: 61.0k, False: 0]
  ------------------
 1970|  61.0k|	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|  61.0k|	if (*valueend != 0) {
  ------------------
  |  Branch (1977:6): [True: 25.6k, False: 35.4k]
  ------------------
 1978|  25.6k|	    tmp = xmlSAX2TextNode(ctxt, ret->doc, value, valueend - value);
 1979|  25.6k|	    ret->children = tmp;
 1980|  25.6k|	    ret->last = tmp;
 1981|  25.6k|	    if (tmp != NULL) {
  ------------------
  |  Branch (1981:10): [True: 25.6k, False: 14]
  ------------------
 1982|  25.6k|		tmp->parent = (xmlNodePtr) ret;
 1983|  25.6k|	    }
 1984|  35.4k|	} else if (valueend > value) {
  ------------------
  |  Branch (1984:13): [True: 34.8k, False: 555]
  ------------------
 1985|  34.8k|            if (xmlNodeParseAttValue(ret->doc, ret, value, valueend - value,
  ------------------
  |  Branch (1985:17): [True: 27, False: 34.8k]
  ------------------
 1986|  34.8k|                                     NULL) < 0)
 1987|     27|                xmlSAX2ErrMemory(ctxt);
 1988|  34.8k|	}
 1989|   144k|    } else if (value != NULL) {
  ------------------
  |  Branch (1989:16): [True: 144k, False: 0]
  ------------------
 1990|   144k|	xmlNodePtr tmp;
 1991|       |
 1992|   144k|	tmp = xmlSAX2TextNode(ctxt, ret->doc, value, valueend - value);
 1993|   144k|	ret->children = tmp;
 1994|   144k|	ret->last = tmp;
 1995|   144k|	if (tmp != NULL) {
  ------------------
  |  Branch (1995:6): [True: 144k, False: 14]
  ------------------
 1996|   144k|	    tmp->parent = (xmlNodePtr) ret;
 1997|   144k|	}
 1998|   144k|    }
 1999|       |
 2000|   206k|#ifdef LIBXML_VALID_ENABLED
 2001|   206k|    if ((!ctxt->html) && ctxt->validate && ctxt->wellFormed &&
  ------------------
  |  Branch (2001:9): [True: 206k, False: 0]
  |  Branch (2001:26): [True: 106k, False: 99.3k]
  |  Branch (2001:44): [True: 44.0k, False: 62.7k]
  ------------------
 2002|  44.0k|        ctxt->myDoc && ctxt->myDoc->intSubset) {
  ------------------
  |  Branch (2002:9): [True: 44.0k, False: 0]
  |  Branch (2002:24): [True: 44.0k, 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|  44.0k|        if (!ctxt->replaceEntities) {
  ------------------
  |  Branch (2007:13): [True: 5.72k, False: 38.3k]
  ------------------
 2008|  5.72k|	    dup = xmlSAX2DecodeAttrEntities(ctxt, value, valueend);
 2009|  5.72k|	    if (dup == NULL) {
  ------------------
  |  Branch (2009:10): [True: 3.70k, False: 2.01k]
  ------------------
 2010|  3.70k|	        if (*valueend == 0) {
  ------------------
  |  Branch (2010:14): [True: 3.01k, False: 694]
  ------------------
 2011|  3.01k|		    ctxt->valid &= xmlValidateOneAttribute(&ctxt->vctxt,
 2012|  3.01k|				    ctxt->myDoc, ctxt->node, ret, value);
 2013|  3.01k|		} 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|    694|		    dup = xmlStrndup(value, valueend - value);
 2020|    694|                    if (dup == NULL)
  ------------------
  |  Branch (2020:25): [True: 2, False: 692]
  ------------------
 2021|      2|                        xmlSAX2ErrMemory(ctxt);
 2022|       |
 2023|    694|		    ctxt->valid &= xmlValidateOneAttribute(&ctxt->vctxt,
 2024|    694|				    ctxt->myDoc, ctxt->node, ret, dup);
 2025|    694|		}
 2026|  3.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.01k|		if (ctxt->attsSpecial != NULL) {
  ------------------
  |  Branch (2034:7): [True: 1.73k, False: 278]
  ------------------
 2035|  1.73k|		    xmlChar *nvalnorm;
 2036|  1.73k|		    xmlChar fn[50];
 2037|  1.73k|		    xmlChar *fullname;
 2038|       |
 2039|  1.73k|		    fullname = xmlBuildQName(localname, prefix, fn, 50);
 2040|  1.73k|                    if (fullname == NULL) {
  ------------------
  |  Branch (2040:25): [True: 1, False: 1.73k]
  ------------------
 2041|      1|                        xmlSAX2ErrMemory(ctxt);
 2042|  1.73k|                    } else {
 2043|  1.73k|			ctxt->vctxt.valid = 1;
 2044|  1.73k|		        nvalnorm = xmlValidCtxtNormalizeAttributeValue(
 2045|  1.73k|			                 &ctxt->vctxt, ctxt->myDoc,
 2046|  1.73k|					 ctxt->node, fullname, dup);
 2047|  1.73k|			if (ctxt->vctxt.valid != 1)
  ------------------
  |  Branch (2047:8): [True: 21, False: 1.71k]
  ------------------
 2048|     21|			    ctxt->valid = 0;
 2049|       |
 2050|  1.73k|			if ((fullname != fn) && (fullname != localname))
  ------------------
  |  Branch (2050:8): [True: 1.67k, False: 66]
  |  Branch (2050:28): [True: 624, False: 1.04k]
  ------------------
 2051|    624|			    xmlFree(fullname);
 2052|  1.73k|			if (nvalnorm != NULL) {
  ------------------
  |  Branch (2052:8): [True: 1.66k, False: 74]
  ------------------
 2053|  1.66k|			    xmlFree(dup);
 2054|  1.66k|			    dup = nvalnorm;
 2055|  1.66k|			}
 2056|  1.73k|		    }
 2057|  1.73k|		}
 2058|       |
 2059|  2.01k|		ctxt->valid &= xmlValidateOneAttribute(&ctxt->vctxt,
 2060|  2.01k|			        ctxt->myDoc, ctxt->node, ret, dup);
 2061|  2.01k|	    }
 2062|  38.3k|	} else {
 2063|       |	    /*
 2064|       |	     * if entities already have been substituted, then
 2065|       |	     * the attribute as passed is already normalized
 2066|       |	     */
 2067|  38.3k|	    dup = xmlStrndup(value, valueend - value);
 2068|  38.3k|            if (dup == NULL)
  ------------------
  |  Branch (2068:17): [True: 10, False: 38.3k]
  ------------------
 2069|     10|                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|  38.3k|            if (ctxt->input->entity != NULL)
  ------------------
  |  Branch (2077:17): [True: 521, False: 37.8k]
  ------------------
 2078|    521|                ctxt->vctxt.flags |= XML_VCTXT_IN_ENTITY;
  ------------------
  |  |   28|    521|#define XML_VCTXT_IN_ENTITY (1u << 3)
  ------------------
 2079|       |
 2080|  38.3k|	    ctxt->valid &= xmlValidateOneAttribute(&ctxt->vctxt,
 2081|  38.3k|	                             ctxt->myDoc, ctxt->node, ret, dup);
 2082|       |
 2083|  38.3k|            ctxt->vctxt.flags &= ~XML_VCTXT_IN_ENTITY;
  ------------------
  |  |   28|  38.3k|#define XML_VCTXT_IN_ENTITY (1u << 3)
  ------------------
 2084|  38.3k|	}
 2085|  44.0k|    } else
 2086|   162k|#endif /* LIBXML_VALID_ENABLED */
 2087|   162k|           if (((ctxt->loadsubset & XML_SKIP_IDS) == 0) &&
  ------------------
  |  |  210|   162k|#define XML_SKIP_IDS		8
  ------------------
  |  Branch (2087:16): [True: 90.7k, False: 71.2k]
  ------------------
 2088|  90.7k|               (ctxt->input->entity == NULL) &&
  ------------------
  |  Branch (2088:16): [True: 86.6k, False: 4.16k]
  ------------------
 2089|       |               /* Don't create IDs containing entity references */
 2090|  86.6k|               (ret->children != NULL) &&
  ------------------
  |  Branch (2090:16): [True: 86.3k, False: 211]
  ------------------
 2091|  86.3k|               (ret->children->type == XML_TEXT_NODE) &&
  ------------------
  |  Branch (2091:16): [True: 85.7k, False: 631]
  ------------------
 2092|  85.7k|               (ret->children->next == NULL)) {
  ------------------
  |  Branch (2092:16): [True: 85.5k, False: 172]
  ------------------
 2093|  85.5k|        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|  85.5k|        if ((prefix == ctxt->str_xml) &&
  ------------------
  |  Branch (2098:13): [True: 18.6k, False: 66.9k]
  ------------------
 2099|  18.6k|	           (localname[0] == 'i') && (localname[1] == 'd') &&
  ------------------
  |  Branch (2099:13): [True: 1.64k, False: 17.0k]
  |  Branch (2099:38): [True: 1.37k, False: 271]
  ------------------
 2100|  1.37k|		   (localname[2] == 0)) {
  ------------------
  |  Branch (2100:6): [True: 1.11k, False: 260]
  ------------------
 2101|       |	    /*
 2102|       |	     * Add the xml:id value
 2103|       |	     *
 2104|       |	     * Open issue: normalization of the value.
 2105|       |	     */
 2106|  1.11k|	    if (xmlValidateNCName(content, 1) != 0) {
  ------------------
  |  Branch (2106:10): [True: 771, False: 339]
  ------------------
 2107|    771|	        xmlErrId(ctxt, XML_DTD_XMLID_VALUE,
 2108|    771|                         "xml:id : attribute value %s is not an NCName\n",
 2109|    771|                         content);
 2110|    771|	    }
 2111|  1.11k|	    xmlAddID(&ctxt->vctxt, ctxt->myDoc, content, ret);
 2112|  84.4k|	} else {
 2113|  84.4k|            int res = xmlIsID(ctxt->myDoc, ctxt->node, ret);
 2114|       |
 2115|  84.4k|            if (res < 0)
  ------------------
  |  Branch (2115:17): [True: 3, False: 84.4k]
  ------------------
 2116|      3|                xmlCtxtErrMemory(ctxt);
 2117|  84.4k|            else if (res > 0)
  ------------------
  |  Branch (2117:22): [True: 1.91k, False: 82.5k]
  ------------------
 2118|  1.91k|                xmlAddID(&ctxt->vctxt, ctxt->myDoc, content, ret);
 2119|  82.5k|            else if (xmlIsRef(ctxt->myDoc, ctxt->node, ret))
  ------------------
  |  Branch (2119:22): [True: 15.6k, False: 66.9k]
  ------------------
 2120|  15.6k|                xmlAddRef(&ctxt->vctxt, ctxt->myDoc, content, ret);
 2121|  84.4k|	}
 2122|  85.5k|    }
 2123|   206k|    if (dup != NULL)
  ------------------
  |  Branch (2123:9): [True: 41.0k, False: 165k]
  ------------------
 2124|  41.0k|	xmlFree(dup);
 2125|       |
 2126|   206k|    return(ret);
 2127|   206k|}
SAX2.c:xmlSAX2TextNode:
 1783|   589k|                int len) {
 1784|   589k|    xmlNodePtr ret;
 1785|   589k|    const xmlChar *intern = NULL;
 1786|       |
 1787|       |    /*
 1788|       |     * Allocate
 1789|       |     */
 1790|   589k|    if (ctxt->freeElems != NULL) {
  ------------------
  |  Branch (1790:9): [True: 1.44k, False: 587k]
  ------------------
 1791|  1.44k|	ret = ctxt->freeElems;
 1792|  1.44k|	ctxt->freeElems = ret->next;
 1793|  1.44k|	ctxt->freeElemsNr--;
 1794|   587k|    } else {
 1795|   587k|	ret = (xmlNodePtr) xmlMalloc(sizeof(xmlNode));
 1796|   587k|    }
 1797|   589k|    if (ret == NULL) {
  ------------------
  |  Branch (1797:9): [True: 74, False: 588k]
  ------------------
 1798|     74|        xmlCtxtErrMemory(ctxt);
 1799|     74|	return(NULL);
 1800|     74|    }
 1801|   588k|    memset(ret, 0, sizeof(xmlNode));
 1802|       |    /*
 1803|       |     * intern the formatting blanks found between tags, or the
 1804|       |     * very short strings
 1805|       |     */
 1806|   588k|    if ((!ctxt->html) && (ctxt->dictNames)) {
  ------------------
  |  Branch (1806:9): [True: 588k, False: 0]
  |  Branch (1806:26): [True: 287k, False: 300k]
  ------------------
 1807|   287k|        xmlChar cur = str[len];
 1808|       |
 1809|   287k|	if ((len < (int) (2 * sizeof(void *))) &&
  ------------------
  |  Branch (1809:6): [True: 241k, False: 46.3k]
  ------------------
 1810|   241k|	    (ctxt->options & XML_PARSE_COMPACT)) {
  ------------------
  |  Branch (1810:6): [True: 241k, False: 0]
  ------------------
 1811|       |	    /* store the string in the node overriding properties and nsDef */
 1812|   241k|	    xmlChar *tmp = (xmlChar *) &(ret->properties);
 1813|   241k|	    memcpy(tmp, str, len);
 1814|   241k|	    tmp[len] = 0;
 1815|   241k|	    intern = tmp;
 1816|   241k|	} else if ((len <= 3) && ((cur == '"') || (cur == '\'') ||
  ------------------
  |  Branch (1816:13): [True: 0, False: 46.3k]
  |  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|  46.3k|	} else if (IS_BLANK_CH(*str) && (len < 60) && (cur == '<') &&
  ------------------
  |  |  137|  46.3k|#define IS_BLANK_CH(c)  xmlIsBlank_ch(c)
  |  |  ------------------
  |  |  |  |   90|  92.7k|#define xmlIsBlank_ch(c)	(((c) == 0x20) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (90:27): [True: 3.70k, False: 42.6k]
  |  |  |  |  ------------------
  |  |  |  |   91|  46.3k|				 ((0x9 <= (c)) && ((c) <= 0xa)) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (91:7): [True: 42.5k, False: 69]
  |  |  |  |  |  Branch (91:23): [True: 3.71k, False: 38.8k]
  |  |  |  |  ------------------
  |  |  |  |   92|  92.7k|				 ((c) == 0xd))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (92:6): [True: 297, False: 38.6k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (1824:34): [True: 6.21k, False: 1.50k]
  |  Branch (1824:48): [True: 5.28k, False: 930]
  ------------------
 1825|  5.28k|	           (str[len + 1] != '!')) {
  ------------------
  |  Branch (1825:13): [True: 4.17k, False: 1.10k]
  ------------------
 1826|  4.17k|	    int i;
 1827|       |
 1828|  52.7k|	    for (i = 1;i < len;i++) {
  ------------------
  |  Branch (1828:17): [True: 50.8k, False: 1.90k]
  ------------------
 1829|  50.8k|		if (!IS_BLANK_CH(str[i])) goto skip;
  ------------------
  |  |  137|  50.8k|#define IS_BLANK_CH(c)  xmlIsBlank_ch(c)
  |  |  ------------------
  |  |  |  |   90|  50.8k|#define xmlIsBlank_ch(c)	(((c) == 0x20) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (90:27): [True: 31.4k, False: 19.3k]
  |  |  |  |  ------------------
  |  |  |  |   91|  50.8k|				 ((0x9 <= (c)) && ((c) <= 0xa)) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (91:7): [True: 19.3k, False: 0]
  |  |  |  |  |  Branch (91:23): [True: 17.0k, False: 2.26k]
  |  |  |  |  ------------------
  |  |  |  |   92|  50.8k|				 ((c) == 0xd))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (92:6): [True: 0, False: 2.26k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1830|  50.8k|	    }
 1831|  1.90k|	    intern = xmlDictLookup(ctxt->dict, str, len);
 1832|  1.90k|            if (intern == NULL) {
  ------------------
  |  Branch (1832:17): [True: 1, False: 1.90k]
  ------------------
 1833|      1|                xmlSAX2ErrMemory(ctxt);
 1834|      1|                xmlFree(ret);
 1835|      1|                return(NULL);
 1836|      1|            }
 1837|  1.90k|	}
 1838|   287k|    }
 1839|   588k|skip:
 1840|   588k|    ret->type = XML_TEXT_NODE;
 1841|   588k|    ret->doc = doc;
 1842|       |
 1843|   588k|    ret->name = xmlStringText;
 1844|   588k|    if (intern == NULL) {
  ------------------
  |  Branch (1844:9): [True: 345k, False: 243k]
  ------------------
 1845|   345k|	ret->content = xmlStrndup(str, len);
 1846|   345k|	if (ret->content == NULL) {
  ------------------
  |  Branch (1846:6): [True: 34, False: 345k]
  ------------------
 1847|     34|	    xmlSAX2ErrMemory(ctxt);
 1848|     34|	    xmlFree(ret);
 1849|     34|	    return(NULL);
 1850|     34|	}
 1851|   345k|    } else
 1852|   243k|	ret->content = (xmlChar *) intern;
 1853|       |
 1854|   588k|    if ((xmlRegisterCallbacks) && (xmlRegisterNodeDefaultValue))
  ------------------
  |  |  932|      0|    (*__xmlRegisterNodeDefaultValue())
  ------------------
  |  Branch (1854:9): [True: 0, False: 588k]
  |  Branch (1854:35): [True: 0, False: 0]
  ------------------
 1855|      0|	xmlRegisterNodeDefaultValue(ret);
  ------------------
  |  |  932|      0|    (*__xmlRegisterNodeDefaultValue())
  ------------------
 1856|   588k|    return(ret);
 1857|   588k|}
SAX2.c:xmlSAX2DecodeAttrEntities:
 1871|  5.72k|                          const xmlChar *end) {
 1872|  5.72k|    const xmlChar *in;
 1873|       |
 1874|  5.72k|    in = str;
 1875|  35.1k|    while (in < end)
  ------------------
  |  Branch (1875:12): [True: 31.3k, False: 3.70k]
  ------------------
 1876|  31.3k|        if (*in++ == '&')
  ------------------
  |  Branch (1876:13): [True: 2.01k, False: 29.3k]
  ------------------
 1877|  2.01k|	    goto decode;
 1878|  3.70k|    return(NULL);
 1879|  2.01k|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.01k|    return(xmlExpandEntitiesInAttValue(ctxt, str, /* normalize */ 0));
 1886|  5.72k|}
SAX2.c:xmlSAX2Text:
 2473|   650k|{
 2474|   650k|    xmlNodePtr lastChild;
 2475|   650k|    xmlNodePtr parent;
 2476|       |
 2477|   650k|    if (ctxt == NULL)
  ------------------
  |  Branch (2477:9): [True: 0, False: 650k]
  ------------------
 2478|      0|        return;
 2479|       |
 2480|   650k|    parent = ctxt->node;
 2481|   650k|    if (parent == NULL)
  ------------------
  |  Branch (2481:9): [True: 0, False: 650k]
  ------------------
 2482|      0|        return;
 2483|   650k|    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|   650k|    if ((lastChild == NULL) ||
  ------------------
  |  Branch (2492:9): [True: 123k, False: 526k]
  ------------------
 2493|   526k|        (lastChild->type != type) ||
  ------------------
  |  Branch (2493:9): [True: 320k, False: 206k]
  ------------------
 2494|   444k|        ((!ctxt->html) && (type != XML_TEXT_NODE))) {
  ------------------
  |  Branch (2494:10): [True: 206k, False: 0]
  |  Branch (2494:27): [True: 477, False: 205k]
  ------------------
 2495|   444k|        xmlNode *node;
 2496|       |
 2497|   444k|        if (type == XML_TEXT_NODE)
  ------------------
  |  Branch (2497:13): [True: 418k, False: 26.2k]
  ------------------
 2498|   418k|            node = xmlSAX2TextNode(ctxt, parent->doc, ch, len);
 2499|  26.2k|        else
 2500|  26.2k|            node = xmlNewCDataBlock(parent->doc, ch, len);
 2501|   444k|	if (node == NULL) {
  ------------------
  |  Branch (2501:6): [True: 86, False: 444k]
  ------------------
 2502|     86|	    xmlSAX2ErrMemory(ctxt);
 2503|     86|	    return;
 2504|     86|	}
 2505|       |
 2506|   444k|        if (lastChild == NULL) {
  ------------------
  |  Branch (2506:13): [True: 123k, False: 321k]
  ------------------
 2507|   123k|            parent->children = node;
 2508|   123k|            parent->last = node;
 2509|   123k|            node->parent = parent;
 2510|   321k|        } else {
 2511|   321k|            xmlSAX2AppendChild(ctxt, node);
 2512|   321k|        }
 2513|       |
 2514|   444k|        ctxt->nodelen = len;
 2515|   444k|        ctxt->nodemem = len + 1;
 2516|   444k|        lastChild = node;
 2517|   444k|    } else {
 2518|   205k|        xmlChar *content;
 2519|   205k|        int oldSize, newSize, capacity;
 2520|   205k|        int maxSize = (ctxt->options & XML_PARSE_HUGE) ?
  ------------------
  |  Branch (2520:23): [True: 111k, False: 94.5k]
  ------------------
 2521|   111k|                      XML_MAX_HUGE_LENGTH :
  ------------------
  |  |   55|   111k|#define XML_MAX_HUGE_LENGTH 1000000000
  ------------------
 2522|   205k|                      XML_MAX_TEXT_LENGTH;
  ------------------
  |  |   50|  94.5k|#define XML_MAX_TEXT_LENGTH 10000000
  ------------------
 2523|       |
 2524|   205k|        content = lastChild->content;
 2525|   205k|        oldSize = ctxt->nodelen;
 2526|   205k|        capacity = ctxt->nodemem;
 2527|       |
 2528|       |        /* Shouldn't happen */
 2529|   205k|        if ((content == NULL) || (capacity <= 0)) {
  ------------------
  |  Branch (2529:13): [True: 0, False: 205k]
  |  Branch (2529:34): [True: 0, False: 205k]
  ------------------
 2530|      0|            xmlFatalErr(ctxt, XML_ERR_INTERNAL_ERROR,
 2531|      0|                        "xmlSAX2Text: no content");
 2532|      0|            return;
 2533|      0|        }
 2534|       |
 2535|   205k|        if ((len > maxSize) || (oldSize > maxSize - len)) {
  ------------------
  |  Branch (2535:13): [True: 0, False: 205k]
  |  Branch (2535:32): [True: 0, False: 205k]
  ------------------
 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|   205k|        newSize = oldSize + len;
 2542|       |
 2543|   205k|        if (newSize >= capacity) {
  ------------------
  |  Branch (2543:13): [True: 73.4k, False: 132k]
  ------------------
 2544|  73.4k|            if (newSize <= 20)
  ------------------
  |  Branch (2544:17): [True: 41.6k, False: 31.7k]
  ------------------
 2545|  41.6k|                capacity = 40;
 2546|  31.7k|            else
 2547|  31.7k|                capacity = newSize > INT_MAX / 2 ? INT_MAX : newSize * 2;
  ------------------
  |  Branch (2547:28): [True: 0, False: 31.7k]
  ------------------
 2548|       |
 2549|       |            /*
 2550|       |             * If the content was stored in properties or in
 2551|       |             * the dictionary, don't realloc.
 2552|       |             */
 2553|  73.4k|            if ((content == (xmlChar *) &lastChild->properties) ||
  ------------------
  |  Branch (2553:17): [True: 24.3k, False: 49.0k]
  ------------------
 2554|  49.0k|                ((ctxt->nodemem == oldSize + 1) &&
  ------------------
  |  Branch (2554:18): [True: 35.1k, False: 13.9k]
  ------------------
 2555|  35.1k|                 (xmlDictOwns(ctxt->dict, content)))) {
  ------------------
  |  Branch (2555:18): [True: 531, False: 34.5k]
  ------------------
 2556|  24.9k|                xmlChar *newContent;
 2557|       |
 2558|  24.9k|                newContent = xmlMalloc(capacity);
 2559|  24.9k|                if (newContent == NULL) {
  ------------------
  |  Branch (2559:21): [True: 12, False: 24.8k]
  ------------------
 2560|     12|                    xmlSAX2ErrMemory(ctxt);
 2561|     12|                    return;
 2562|     12|                }
 2563|       |
 2564|  24.8k|                memcpy(newContent, content, oldSize);
 2565|  24.8k|                lastChild->properties = NULL;
 2566|  24.8k|                content = newContent;
 2567|  48.5k|            } else {
 2568|  48.5k|                content = xmlRealloc(content, capacity);
 2569|  48.5k|                if (content == NULL) {
  ------------------
  |  Branch (2569:21): [True: 10, False: 48.5k]
  ------------------
 2570|     10|                    xmlSAX2ErrMemory(ctxt);
 2571|     10|                    return;
 2572|     10|                }
 2573|  48.5k|            }
 2574|       |
 2575|  73.4k|            ctxt->nodemem = capacity;
 2576|  73.4k|            lastChild->content = content;
 2577|  73.4k|        }
 2578|       |
 2579|   205k|        memcpy(&content[oldSize], ch, len);
 2580|   205k|        content[newSize] = 0;
 2581|   205k|        ctxt->nodelen = newSize;
 2582|   205k|    }
 2583|       |
 2584|   650k|    if ((lastChild != NULL) &&
  ------------------
  |  Branch (2584:9): [True: 650k, False: 0]
  ------------------
 2585|   650k|        (type == XML_TEXT_NODE) &&
  ------------------
  |  Branch (2585:9): [True: 623k, False: 26.2k]
  ------------------
 2586|   623k|        (ctxt->input != NULL)) {
  ------------------
  |  Branch (2586:9): [True: 623k, False: 0]
  ------------------
 2587|   623k|        if ((unsigned) ctxt->input->line < (unsigned) USHRT_MAX)
  ------------------
  |  Branch (2587:13): [True: 570k, False: 53.1k]
  ------------------
 2588|   570k|            lastChild->line = ctxt->input->line;
 2589|  53.1k|        else {
 2590|  53.1k|            lastChild->line = USHRT_MAX;
 2591|  53.1k|            if (ctxt->options & XML_PARSE_BIG_LINES)
  ------------------
  |  Branch (2591:17): [True: 17.4k, False: 35.6k]
  ------------------
 2592|  17.4k|                lastChild->psvi = XML_INT_TO_PTR(ctxt->input->line);
  ------------------
  |  |   59|  17.4k|#define XML_INT_TO_PTR(i) ((void *) (XML_INTPTR_T) (i))
  ------------------
 2593|  53.1k|        }
 2594|   623k|    }
 2595|   650k|}

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

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|   235k|xmlCatalogGetDefaults(void) {
 3587|   235k|    return(xmlCatalogDefaultAllow);
 3588|   235k|}
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|  1.82M|xmlCharInRange (unsigned int val, const xmlChRangeGroup *rptr) {
   33|  1.82M|    int low, high, mid;
   34|  1.82M|    const xmlChSRange *sptr;
   35|  1.82M|    const xmlChLRange *lptr;
   36|       |
   37|  1.82M|    if (rptr == NULL) return(0);
  ------------------
  |  Branch (37:9): [True: 0, False: 1.82M]
  ------------------
   38|  1.82M|    if (val < 0x10000) {	/* is val in 'short' or 'long'  array? */
  ------------------
  |  Branch (38:9): [True: 1.78M, False: 42.7k]
  ------------------
   39|  1.78M|	if (rptr->nbShortRange == 0)
  ------------------
  |  Branch (39:6): [True: 0, False: 1.78M]
  ------------------
   40|      0|	    return 0;
   41|  1.78M|	low = 0;
   42|  1.78M|	high = rptr->nbShortRange - 1;
   43|  1.78M|	sptr = rptr->shortRange;
   44|  12.5M|	while (low <= high) {
  ------------------
  |  Branch (44:9): [True: 12.5M, False: 12.5k]
  ------------------
   45|  12.5M|	    mid = (low + high) / 2;
   46|  12.5M|	    if ((unsigned short) val < sptr[mid].low) {
  ------------------
  |  Branch (46:10): [True: 10.3M, False: 2.18M]
  ------------------
   47|  10.3M|		high = mid - 1;
   48|  10.3M|	    } else {
   49|  2.18M|		if ((unsigned short) val > sptr[mid].high) {
  ------------------
  |  Branch (49:7): [True: 412k, False: 1.76M]
  ------------------
   50|   412k|		    low = mid + 1;
   51|  1.76M|		} else {
   52|  1.76M|		    return 1;
   53|  1.76M|		}
   54|  2.18M|	    }
   55|  12.5M|	}
   56|  1.78M|    } else {
   57|  42.7k|	if (rptr->nbLongRange == 0) {
  ------------------
  |  Branch (57:6): [True: 42.7k, False: 0]
  ------------------
   58|  42.7k|	    return 0;
   59|  42.7k|	}
   60|      0|	low = 0;
   61|      0|	high = rptr->nbLongRange - 1;
   62|      0|	lptr = rptr->longRange;
   63|      0|	while (low <= high) {
  ------------------
  |  Branch (63:9): [True: 0, False: 0]
  ------------------
   64|      0|	    mid = (low + high) / 2;
   65|      0|	    if (val < lptr[mid].low) {
  ------------------
  |  Branch (65:10): [True: 0, False: 0]
  ------------------
   66|      0|		high = mid - 1;
   67|      0|	    } else {
   68|      0|		if (val > lptr[mid].high) {
  ------------------
  |  Branch (68:7): [True: 0, False: 0]
  ------------------
   69|      0|		    low = mid + 1;
   70|      0|		} else {
   71|      0|		    return 1;
   72|      0|		}
   73|      0|	    }
   74|      0|	}
   75|      0|    }
   76|  12.5k|    return 0;
   77|  1.82M|}

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

xmlGetEncodingAlias:
  473|  9.95k|xmlGetEncodingAlias(const char *alias) {
  474|  9.95k|    int i;
  475|  9.95k|    char upper[100];
  476|       |
  477|  9.95k|    if (alias == NULL)
  ------------------
  |  Branch (477:9): [True: 0, False: 9.95k]
  ------------------
  478|      0|	return(NULL);
  479|       |
  480|  9.95k|    if (xmlCharEncodingAliases == NULL)
  ------------------
  |  Branch (480:9): [True: 9.95k, False: 0]
  ------------------
  481|  9.95k|	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|  7.30k|                           xmlCharEncodingHandler **out) {
  771|  7.30k|    xmlCharEncodingHandler *handler;
  772|       |
  773|  7.30k|    if (out == NULL)
  ------------------
  |  Branch (773:9): [True: 0, False: 7.30k]
  ------------------
  774|      0|        return(XML_ERR_ARGUMENT);
  775|       |
  776|  7.30k|    handler = xmlMalloc(sizeof(*handler));
  777|  7.30k|    if (handler == NULL)
  ------------------
  |  Branch (777:9): [True: 9, False: 7.29k]
  ------------------
  778|      9|        goto error;
  779|  7.29k|    memset(handler, 0, sizeof(*handler));
  780|       |
  781|  7.29k|    if (name != NULL) {
  ------------------
  |  Branch (781:9): [True: 7.29k, False: 0]
  ------------------
  782|  7.29k|        handler->name = xmlMemStrdup(name);
  783|  7.29k|        if (handler->name == NULL)
  ------------------
  |  Branch (783:13): [True: 6, False: 7.29k]
  ------------------
  784|      6|            goto error;
  785|  7.29k|    }
  786|       |
  787|  7.29k|    handler->input.func = input;
  788|  7.29k|    handler->output.func = output;
  789|  7.29k|    handler->ctxtDtor = ctxtDtor;
  790|  7.29k|    handler->inputCtxt = inputCtxt;
  791|  7.29k|    handler->outputCtxt = outputCtxt;
  792|       |
  793|  7.29k|    *out = handler;
  794|  7.29k|    return(XML_ERR_OK);
  795|       |
  796|     15|error:
  797|     15|    xmlFree(handler);
  798|       |
  799|     15|    if (ctxtDtor != NULL) {
  ------------------
  |  Branch (799:9): [True: 15, False: 0]
  ------------------
  800|     15|        if (inputCtxt != NULL)
  ------------------
  |  Branch (800:13): [True: 15, False: 0]
  ------------------
  801|     15|            ctxtDtor(inputCtxt);
  802|     15|        if (outputCtxt != NULL)
  ------------------
  |  Branch (802:13): [True: 2, False: 13]
  ------------------
  803|      2|            ctxtDtor(outputCtxt);
  804|     15|    }
  805|       |
  806|     15|    return(XML_ERR_NO_MEMORY);
  807|  7.29k|}
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|  5.68k|                             xmlCharEncodingHandler **out) {
  987|  5.68k|    const xmlCharEncodingHandler *handler;
  988|       |
  989|  5.68k|    if (out == NULL)
  ------------------
  |  Branch (989:9): [True: 0, False: 5.68k]
  ------------------
  990|      0|        return(XML_ERR_ARGUMENT);
  991|  5.68k|    *out = NULL;
  992|       |
  993|  5.68k|    if ((enc <= 0) || ((size_t) enc >= NUM_DEFAULT_HANDLERS))
  ------------------
  |  |  355|  5.68k|    (sizeof(defaultHandlers) / sizeof(defaultHandlers[0]))
  ------------------
  |  Branch (993:9): [True: 0, False: 5.68k]
  |  Branch (993:23): [True: 0, False: 5.68k]
  ------------------
  994|      0|        return(XML_ERR_UNSUPPORTED_ENCODING);
  995|       |
  996|       |    /* Return NULL handler for UTF-8 */
  997|  5.68k|    if ((enc == XML_CHAR_ENCODING_UTF8) ||
  ------------------
  |  Branch (997:9): [True: 47, False: 5.63k]
  ------------------
  998|  5.63k|        (enc == XML_CHAR_ENCODING_NONE))
  ------------------
  |  Branch (998:9): [True: 0, False: 5.63k]
  ------------------
  999|     47|        return(XML_ERR_OK);
 1000|       |
 1001|  5.63k|    handler = &defaultHandlers[enc];
 1002|  5.63k|    if ((handler->input.func != NULL) || (handler->output.func != NULL)) {
  ------------------
  |  Branch (1002:9): [True: 4.73k, False: 894]
  |  Branch (1002:42): [True: 0, False: 894]
  ------------------
 1003|  4.73k|        *out = (xmlCharEncodingHandler *) handler;
 1004|  4.73k|        return(XML_ERR_OK);
 1005|  4.73k|    }
 1006|       |
 1007|    894|    if (handler->name != NULL) {
  ------------------
  |  Branch (1007:9): [True: 894, False: 0]
  ------------------
 1008|    894|        xmlCharEncFlags flags = XML_ENC_INPUT;
 1009|       |
 1010|    894|#ifdef LIBXML_OUTPUT_ENABLED
 1011|    894|        flags |= XML_ENC_OUTPUT;
 1012|    894|#endif
 1013|    894|        return(xmlFindExtraHandler(handler->name, handler->name, flags,
 1014|    894|                                   NULL, NULL, out));
 1015|    894|    }
 1016|       |
 1017|      0|    return(XML_ERR_UNSUPPORTED_ENCODING);
 1018|    894|}
xmlCreateCharEncodingHandler:
 1066|  9.95k|                             xmlCharEncodingHandler **out) {
 1067|  9.95k|    const xmlCharEncodingHandler *handler;
 1068|  9.95k|    const char *norig, *nalias;
 1069|  9.95k|    xmlCharEncoding enc;
 1070|       |
 1071|  9.95k|    if (out == NULL)
  ------------------
  |  Branch (1071:9): [True: 0, False: 9.95k]
  ------------------
 1072|      0|        return(XML_ERR_ARGUMENT);
 1073|  9.95k|    *out = NULL;
 1074|       |
 1075|  9.95k|    if ((name == NULL) || (flags == 0))
  ------------------
  |  Branch (1075:9): [True: 0, False: 9.95k]
  |  Branch (1075:27): [True: 0, False: 9.95k]
  ------------------
 1076|      0|        return(XML_ERR_ARGUMENT);
 1077|       |
 1078|  9.95k|    norig = name;
 1079|  9.95k|    nalias = xmlGetEncodingAlias(name);
 1080|  9.95k|    if (nalias != NULL)
  ------------------
  |  Branch (1080:9): [True: 0, False: 9.95k]
  ------------------
 1081|      0|	name = nalias;
 1082|       |
 1083|  9.95k|    enc = xmlParseCharEncodingInternal(name);
 1084|       |
 1085|       |    /* Return NULL handler for UTF-8 */
 1086|  9.95k|    if (enc == XML_CHAR_ENCODING_UTF8)
  ------------------
  |  Branch (1086:9): [True: 184, False: 9.76k]
  ------------------
 1087|    184|        return(XML_ERR_OK);
 1088|       |
 1089|  9.76k|    if ((enc > 0) && ((size_t) enc < NUM_DEFAULT_HANDLERS)) {
  ------------------
  |  |  355|  3.10k|    (sizeof(defaultHandlers) / sizeof(defaultHandlers[0]))
  ------------------
  |  Branch (1089:9): [True: 3.10k, False: 6.66k]
  |  Branch (1089:22): [True: 3.10k, False: 0]
  ------------------
 1090|  3.10k|        if (flags & XML_ENC_HTML) {
  ------------------
  |  Branch (1090:13): [True: 0, False: 3.10k]
  ------------------
 1091|       |            /*
 1092|       |             * TODO: HTML5 only allows a fixed set of charset
 1093|       |             * labels. We should add an option to enable or
 1094|       |             * disable this restriction.
 1095|       |             *
 1096|       |             * TODO: Map ISO-8859-9 to windows-1254.
 1097|       |             */
 1098|      0|            switch (enc) {
 1099|      0|                case XML_CHAR_ENCODING_ASCII:
  ------------------
  |  Branch (1099:17): [True: 0, False: 0]
  ------------------
 1100|      0|                case XML_CHAR_ENCODING_8859_1:
  ------------------
  |  Branch (1100:17): [True: 0, False: 0]
  ------------------
 1101|      0|                    enc = XML_CHAR_ENCODING_WINDOWS_1252;
 1102|      0|                    break;
 1103|      0|                case XML_CHAR_ENCODING_UCS2:
  ------------------
  |  Branch (1103:17): [True: 0, False: 0]
  ------------------
 1104|      0|                case XML_CHAR_ENCODING_UTF16:
  ------------------
  |  Branch (1104:17): [True: 0, False: 0]
  ------------------
 1105|      0|                    enc = XML_CHAR_ENCODING_UTF16LE;
 1106|      0|                    break;
 1107|      0|                default:
  ------------------
  |  Branch (1107:17): [True: 0, False: 0]
  ------------------
 1108|      0|                    break;
 1109|      0|            }
 1110|      0|        }
 1111|       |
 1112|  3.10k|        handler = &defaultHandlers[enc];
 1113|  3.10k|        if ((((flags & XML_ENC_INPUT) == 0) || (handler->input.func)) &&
  ------------------
  |  Branch (1113:14): [True: 0, False: 3.10k]
  |  Branch (1113:48): [True: 2.72k, False: 386]
  ------------------
 1114|  2.72k|            (((flags & XML_ENC_OUTPUT) == 0) || (handler->output.func))) {
  ------------------
  |  Branch (1114:14): [True: 2.72k, False: 0]
  |  Branch (1114:49): [True: 0, False: 0]
  ------------------
 1115|  2.72k|            xmlCharEncodingHandler *ret;
 1116|       |
 1117|       |            /*
 1118|       |             * Return a copy of the handler with the original name.
 1119|       |             */
 1120|       |
 1121|  2.72k|            ret = xmlMalloc(sizeof(*ret));
 1122|  2.72k|            if (ret == NULL)
  ------------------
  |  Branch (1122:17): [True: 2, False: 2.71k]
  ------------------
 1123|      2|                return(XML_ERR_NO_MEMORY);
 1124|  2.71k|            memset(ret, 0, sizeof(*ret));
 1125|       |
 1126|  2.71k|            ret->name = xmlMemStrdup(norig);
 1127|  2.71k|            if (ret->name == NULL) {
  ------------------
  |  Branch (1127:17): [True: 2, False: 2.71k]
  ------------------
 1128|      2|                xmlFree(ret);
 1129|      2|                return(XML_ERR_NO_MEMORY);
 1130|      2|            }
 1131|  2.71k|            ret->input = handler->input;
 1132|  2.71k|            ret->output = handler->output;
 1133|  2.71k|            ret->inputCtxt = handler->inputCtxt;
 1134|  2.71k|            ret->outputCtxt = handler->outputCtxt;
 1135|  2.71k|            ret->ctxtDtor = handler->ctxtDtor;
 1136|       |
 1137|  2.71k|            *out = ret;
 1138|  2.71k|            return(XML_ERR_OK);
 1139|  2.71k|        }
 1140|  3.10k|    }
 1141|       |
 1142|  7.04k|    return(xmlFindExtraHandler(norig, name, flags, impl, implCtxt, out));
 1143|  9.76k|}
xmlOpenCharEncodingHandler:
 1169|     27|                           xmlCharEncodingHandler **out) {
 1170|     27|    xmlCharEncFlags flags = output ? XML_ENC_OUTPUT : XML_ENC_INPUT;
  ------------------
  |  Branch (1170:29): [True: 0, False: 27]
  ------------------
 1171|       |
 1172|     27|    return(xmlCreateCharEncodingHandler(name, flags, NULL, NULL, out));
 1173|     27|}
xmlEncInputChunk:
 1685|   142k|                 int flush) {
 1686|   142k|    xmlCharEncError ret;
 1687|       |
 1688|   142k|    if (handler->flags & XML_HANDLER_LEGACY) {
  ------------------
  |  |   54|   142k|#define XML_HANDLER_LEGACY (1 << 1)
  ------------------
  |  Branch (1688:9): [True: 0, False: 142k]
  ------------------
 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|   142k|    } else {
 1699|   142k|        xmlCharEncConvFunc func = handler->input.func;
 1700|   142k|        int oldInlen;
 1701|       |
 1702|   142k|        if (func == NULL) {
  ------------------
  |  Branch (1702:13): [True: 0, False: 142k]
  ------------------
 1703|      0|            *outlen = 0;
 1704|      0|            *inlen = 0;
 1705|      0|            return(XML_ENC_ERR_INTERNAL);
 1706|      0|        }
 1707|       |
 1708|   142k|        oldInlen = *inlen;
 1709|   142k|        ret = func(handler->inputCtxt, out, outlen, in, inlen, flush);
 1710|       |
 1711|       |        /*
 1712|       |         * Check for truncated multi-byte sequence.
 1713|       |         */
 1714|   142k|        if ((flush) && (ret == XML_ENC_ERR_SUCCESS) && (*inlen != oldInlen))
  ------------------
  |  Branch (1714:13): [True: 12, False: 142k]
  |  Branch (1714:24): [True: 12, False: 0]
  |  Branch (1714:56): [True: 0, False: 12]
  ------------------
 1715|      0|            ret = XML_ENC_ERR_INPUT;
 1716|   142k|    }
 1717|       |
 1718|   142k|    if (ret > 0)
  ------------------
  |  Branch (1718:9): [True: 22.1k, False: 120k]
  ------------------
 1719|  22.1k|        ret = XML_ENC_ERR_SUCCESS;
 1720|       |
 1721|   142k|    return(ret);
 1722|   142k|}
xmlCharEncInput:
 1795|   309k|{
 1796|   309k|    xmlBufPtr out, in;
 1797|   309k|    const xmlChar *dataIn;
 1798|   309k|    size_t availIn;
 1799|   309k|    size_t maxOut;
 1800|   309k|    size_t totalIn, totalOut;
 1801|   309k|    xmlCharEncError ret;
 1802|       |
 1803|   309k|    out = input->buffer;
 1804|   309k|    in = input->raw;
 1805|       |
 1806|   309k|    maxOut = *sizeOut;
 1807|   309k|    totalOut = 0;
 1808|       |
 1809|   309k|    *sizeOut = 0;
 1810|       |
 1811|   309k|    availIn = xmlBufUse(in);
 1812|   309k|    if ((availIn == 0) && (!flush))
  ------------------
  |  Branch (1812:9): [True: 172k, False: 136k]
  |  Branch (1812:27): [True: 172k, False: 12]
  ------------------
 1813|   172k|        return(0);
 1814|   136k|    dataIn = xmlBufContent(in);
 1815|   136k|    totalIn = 0;
 1816|       |
 1817|   139k|    while (1) {
  ------------------
  |  Branch (1817:12): [True: 139k, Folded]
  ------------------
 1818|   139k|        size_t availOut;
 1819|   139k|        int completeOut, completeIn;
 1820|   139k|        int c_out, c_in;
 1821|       |
 1822|   139k|        availOut = xmlBufAvail(out);
 1823|   139k|        if (availOut > INT_MAX / 2)
  ------------------
  |  Branch (1823:13): [True: 0, False: 139k]
  ------------------
 1824|      0|            availOut = INT_MAX / 2;
 1825|       |
 1826|   139k|        if (availOut < maxOut) {
  ------------------
  |  Branch (1826:13): [True: 101k, False: 37.7k]
  ------------------
 1827|   101k|            c_out = availOut;
 1828|   101k|            completeOut = 0;
 1829|   101k|        } else {
 1830|  37.7k|            c_out = maxOut;
 1831|  37.7k|            completeOut = 1;
 1832|  37.7k|        }
 1833|       |
 1834|   139k|        if (availIn > INT_MAX / 2) {
  ------------------
  |  Branch (1834:13): [True: 0, False: 139k]
  ------------------
 1835|      0|            c_in = INT_MAX / 2;
 1836|      0|            completeIn = 0;
 1837|   139k|        } else {
 1838|   139k|            c_in = availIn;
 1839|   139k|            completeIn = 1;
 1840|   139k|        }
 1841|       |
 1842|   139k|        ret = xmlEncInputChunk(input->encoder, xmlBufEnd(out), &c_out,
 1843|   139k|                               dataIn, &c_in, flush && completeIn);
  ------------------
  |  Branch (1843:47): [True: 12, False: 139k]
  |  Branch (1843:56): [True: 12, False: 0]
  ------------------
 1844|       |
 1845|   139k|        totalIn += c_in;
 1846|   139k|        dataIn += c_in;
 1847|   139k|        availIn -= c_in;
 1848|       |
 1849|   139k|        totalOut += c_out;
 1850|   139k|        maxOut -= c_out;
 1851|   139k|        xmlBufAddLen(out, c_out);
 1852|       |
 1853|   139k|        if ((ret != XML_ENC_ERR_SUCCESS) && (ret != XML_ENC_ERR_SPACE)) {
  ------------------
  |  Branch (1853:13): [True: 25.1k, False: 114k]
  |  Branch (1853:45): [True: 2.72k, False: 22.4k]
  ------------------
 1854|  2.72k|            input->error = xmlEncConvertError(ret);
 1855|  2.72k|            return(ret);
 1856|  2.72k|        }
 1857|       |
 1858|   136k|        if ((completeOut) && (completeIn))
  ------------------
  |  Branch (1858:13): [True: 35.6k, False: 101k]
  |  Branch (1858:30): [True: 35.6k, False: 0]
  ------------------
 1859|  35.6k|            break;
 1860|   101k|        if ((completeOut) && (ret == XML_ENC_ERR_SPACE))
  ------------------
  |  Branch (1860:13): [True: 0, False: 101k]
  |  Branch (1860:30): [True: 0, False: 0]
  ------------------
 1861|      0|            break;
 1862|   101k|        if ((completeIn) && (ret == XML_ENC_ERR_SUCCESS))
  ------------------
  |  Branch (1862:13): [True: 101k, False: 0]
  |  Branch (1862:29): [True: 98.3k, False: 2.79k]
  ------------------
 1863|  98.3k|            break;
 1864|       |
 1865|  2.79k|        if (ret == XML_ENC_ERR_SPACE) {
  ------------------
  |  Branch (1865:13): [True: 2.79k, False: 0]
  ------------------
 1866|  2.79k|            if (xmlBufGrow(out, 4096) < 0) {
  ------------------
  |  Branch (1866:17): [True: 8, False: 2.79k]
  ------------------
 1867|      8|                input->error = XML_ERR_NO_MEMORY;
 1868|      8|                return(XML_ENC_ERR_MEMORY);
 1869|      8|            }
 1870|  2.79k|        }
 1871|  2.79k|    }
 1872|       |
 1873|   133k|    xmlBufShrink(in, totalIn);
 1874|       |
 1875|   133k|    if (input->rawconsumed > ULONG_MAX - (unsigned long) totalIn)
  ------------------
  |  Branch (1875:9): [True: 0, False: 133k]
  ------------------
 1876|      0|        input->rawconsumed = ULONG_MAX;
 1877|   133k|    else
 1878|   133k|        input->rawconsumed += totalIn;
 1879|       |
 1880|   133k|    *sizeOut = totalOut;
 1881|   133k|    return(XML_ENC_ERR_SUCCESS);
 1882|   136k|}
xmlCharEncCloseFunc:
 2192|  14.8k|xmlCharEncCloseFunc(xmlCharEncodingHandler *handler) {
 2193|  14.8k|    if (handler == NULL)
  ------------------
  |  Branch (2193:9): [True: 140, False: 14.7k]
  ------------------
 2194|    140|        return(0);
 2195|       |
 2196|  14.7k|    if (handler->flags & XML_HANDLER_STATIC)
  ------------------
  |  |   53|  14.7k|#define XML_HANDLER_STATIC (1 << 0)
  ------------------
  |  Branch (2196:9): [True: 4.73k, False: 10.0k]
  ------------------
 2197|  4.73k|        return(0);
 2198|       |
 2199|  10.0k|    xmlFree(handler->name);
 2200|  10.0k|    if (handler->ctxtDtor != NULL) {
  ------------------
  |  Branch (2200:9): [True: 7.29k, False: 2.71k]
  ------------------
 2201|  7.29k|        handler->ctxtDtor(handler->inputCtxt);
 2202|  7.29k|        handler->ctxtDtor(handler->outputCtxt);
 2203|  7.29k|    }
 2204|  10.0k|    xmlFree(handler);
 2205|  10.0k|    return(0);
 2206|  14.7k|}
encoding.c:xmlParseCharEncodingInternal:
  618|  9.95k|{
  619|  9.95k|    const xmlEncTableEntry *entry;
  620|       |
  621|  9.95k|    if (name == NULL)
  ------------------
  |  Branch (621:9): [True: 0, False: 9.95k]
  ------------------
  622|      0|       return(XML_CHAR_ENCODING_NONE);
  623|       |
  624|  9.95k|    entry = bsearch(name, xmlEncTable,
  625|  9.95k|                    sizeof(xmlEncTable) / sizeof(xmlEncTable[0]),
  626|  9.95k|                    sizeof(xmlEncTable[0]), xmlCompareEncTableEntries);
  627|  9.95k|    if (entry != NULL)
  ------------------
  |  Branch (627:9): [True: 3.29k, False: 6.66k]
  ------------------
  628|  3.29k|        return(entry->enc);
  629|       |
  630|  6.66k|    return(XML_CHAR_ENCODING_ERROR);
  631|  9.95k|}
encoding.c:xmlCompareEncTableEntries:
  609|  59.3k|xmlCompareEncTableEntries(const void *vkey, const void *ventry) {
  610|  59.3k|    const char *key = vkey;
  611|  59.3k|    const xmlEncTableEntry *entry = ventry;
  612|       |
  613|  59.3k|    return(xmlStrcasecmp(BAD_CAST key, BAD_CAST entry->name));
  ------------------
  |  |   34|  59.3k|#define BAD_CAST (xmlChar *)
  ------------------
                  return(xmlStrcasecmp(BAD_CAST key, BAD_CAST entry->name));
  ------------------
  |  |   34|  59.3k|#define BAD_CAST (xmlChar *)
  ------------------
  614|  59.3k|}
encoding.c:UTF16LEToUTF8:
 2492|  70.5k|              int flush ATTRIBUTE_UNUSED) {
 2493|  70.5k|    const unsigned char *instart = in;
 2494|  70.5k|    const unsigned char *inend = in + (*inlen & ~1);
 2495|  70.5k|    unsigned char *outstart = out;
 2496|  70.5k|    unsigned char *outend = out + *outlen;
 2497|  70.5k|    unsigned c, d;
 2498|  70.5k|    int ret = XML_ENC_ERR_SPACE;
 2499|       |
 2500|  2.33M|    while (in < inend) {
  ------------------
  |  Branch (2500:12): [True: 2.27M, False: 67.8k]
  ------------------
 2501|  2.27M|        c = in[0] | (in[1] << 8);
 2502|       |
 2503|  2.27M|        if (c < 0x80) {
  ------------------
  |  Branch (2503:13): [True: 8.75k, False: 2.26M]
  ------------------
 2504|  8.75k|            if (out >= outend)
  ------------------
  |  Branch (2504:17): [True: 215, False: 8.53k]
  ------------------
 2505|    215|                goto done;
 2506|  8.53k|            out[0] = c;
 2507|  8.53k|            in += 2;
 2508|  8.53k|            out += 1;
 2509|  2.26M|        } else if (c < 0x800) {
  ------------------
  |  Branch (2509:20): [True: 6.78k, False: 2.25M]
  ------------------
 2510|  6.78k|            if (outend - out < 2)
  ------------------
  |  Branch (2510:17): [True: 246, False: 6.53k]
  ------------------
 2511|    246|                goto done;
 2512|  6.53k|            out[0] = (c >> 6)   | 0xC0;
 2513|  6.53k|            out[1] = (c & 0x3F) | 0x80;
 2514|  6.53k|            in += 2;
 2515|  6.53k|            out += 2;
 2516|  2.25M|        } else if ((c & 0xF800) != 0xD800) {
  ------------------
  |  Branch (2516:20): [True: 2.25M, False: 1.84k]
  ------------------
 2517|  2.25M|            if (outend - out < 3)
  ------------------
  |  Branch (2517:17): [True: 907, False: 2.25M]
  ------------------
 2518|    907|                goto done;
 2519|  2.25M|            out[0] =  (c >> 12)         | 0xE0;
 2520|  2.25M|            out[1] = ((c >>  6) & 0x3F) | 0x80;
 2521|  2.25M|            out[2] =  (c        & 0x3F) | 0x80;
 2522|  2.25M|            in += 2;
 2523|  2.25M|            out += 3;
 2524|  2.25M|        } else {
 2525|       |            /* Surrogate pair */
 2526|  1.84k|            if ((c & 0xFC00) != 0xD800) {
  ------------------
  |  Branch (2526:17): [True: 401, False: 1.44k]
  ------------------
 2527|    401|                ret = XML_ENC_ERR_INPUT;
 2528|    401|                goto done;
 2529|    401|            }
 2530|  1.44k|	    if (inend - in < 4)
  ------------------
  |  Branch (2530:10): [True: 244, False: 1.20k]
  ------------------
 2531|    244|		break;
 2532|  1.20k|            d = in[2] | (in[3] << 8);
 2533|  1.20k|            if ((d & 0xFC00) != 0xDC00) {
  ------------------
  |  Branch (2533:17): [True: 545, False: 659]
  ------------------
 2534|    545|                ret = XML_ENC_ERR_INPUT;
 2535|    545|                goto done;
 2536|    545|            }
 2537|    659|	    if (outend - out < 4)
  ------------------
  |  Branch (2537:10): [True: 156, False: 503]
  ------------------
 2538|    156|		goto done;
 2539|    503|            c = (c << 10) + d - ((0xD800 << 10) + 0xDC00 - 0x10000);
 2540|    503|            out[0] =  (c >> 18)         | 0xF0;
 2541|    503|            out[1] = ((c >> 12) & 0x3F) | 0x80;
 2542|    503|            out[2] = ((c >>  6) & 0x3F) | 0x80;
 2543|    503|            out[3] =  (c        & 0x3F) | 0x80;
 2544|    503|            in += 4;
 2545|    503|            out += 4;
 2546|    503|        }
 2547|  2.27M|    }
 2548|       |
 2549|  68.0k|    ret = out - outstart;
 2550|       |
 2551|  70.5k|done:
 2552|  70.5k|    *outlen = out - outstart;
 2553|  70.5k|    *inlen = in - instart;
 2554|  70.5k|    return(ret);
 2555|  68.0k|}
encoding.c:UTF16BEToUTF8:
 2689|  20.4k|              int flush ATTRIBUTE_UNUSED) {
 2690|  20.4k|    const unsigned char *instart = in;
 2691|  20.4k|    const unsigned char *inend = in + (*inlen & ~1);
 2692|  20.4k|    unsigned char *outstart = out;
 2693|  20.4k|    unsigned char *outend = out + *outlen;
 2694|  20.4k|    unsigned c, d;
 2695|  20.4k|    int ret = XML_ENC_ERR_SPACE;
 2696|       |
 2697|  12.8M|    while (in < inend) {
  ------------------
  |  Branch (2697:12): [True: 12.8M, False: 10.4k]
  ------------------
 2698|  12.8M|        c = (in[0] << 8) | in[1];
 2699|       |
 2700|  12.8M|        if (c < 0x80) {
  ------------------
  |  Branch (2700:13): [True: 21.6k, False: 12.8M]
  ------------------
 2701|  21.6k|            if (out >= outend)
  ------------------
  |  Branch (2701:17): [True: 247, False: 21.3k]
  ------------------
 2702|    247|                goto done;
 2703|  21.3k|            out[0] = c;
 2704|  21.3k|            in += 2;
 2705|  21.3k|            out += 1;
 2706|  12.8M|        } else if (c < 0x800) {
  ------------------
  |  Branch (2706:20): [True: 16.6k, False: 12.7M]
  ------------------
 2707|  16.6k|            if (outend - out < 2)
  ------------------
  |  Branch (2707:17): [True: 228, False: 16.4k]
  ------------------
 2708|    228|                goto done;
 2709|  16.4k|            out[0] = (c >> 6)   | 0xC0;
 2710|  16.4k|            out[1] = (c & 0x3F) | 0x80;
 2711|  16.4k|            in += 2;
 2712|  16.4k|            out += 2;
 2713|  12.7M|        } else if ((c & 0xF800) != 0xD800) {
  ------------------
  |  Branch (2713:20): [True: 12.7M, False: 1.64k]
  ------------------
 2714|  12.7M|            if (outend - out < 3)
  ------------------
  |  Branch (2714:17): [True: 8.42k, False: 12.7M]
  ------------------
 2715|  8.42k|                goto done;
 2716|  12.7M|            out[0] =  (c >> 12)         | 0xE0;
 2717|  12.7M|            out[1] = ((c >>  6) & 0x3F) | 0x80;
 2718|  12.7M|            out[2] =  (c        & 0x3F) | 0x80;
 2719|  12.7M|            in += 2;
 2720|  12.7M|            out += 3;
 2721|  12.7M|        } else {
 2722|       |            /* Surrogate pair */
 2723|  1.64k|            if ((c & 0xFC00) != 0xD800) {
  ------------------
  |  Branch (2723:17): [True: 566, False: 1.08k]
  ------------------
 2724|    566|                ret = XML_ENC_ERR_INPUT;
 2725|    566|                goto done;
 2726|    566|            }
 2727|  1.08k|	    if (inend - in < 4)
  ------------------
  |  Branch (2727:10): [True: 220, False: 861]
  ------------------
 2728|    220|		break;
 2729|    861|            d = (in[2] << 8) | in[3];
 2730|    861|            if ((d & 0xFC00) != 0xDC00) {
  ------------------
  |  Branch (2730:17): [True: 182, False: 679]
  ------------------
 2731|    182|                ret = XML_ENC_ERR_INPUT;
 2732|    182|                goto done;
 2733|    182|            }
 2734|    679|	    if (outend - out < 4)
  ------------------
  |  Branch (2734:10): [True: 114, False: 565]
  ------------------
 2735|    114|		goto done;
 2736|    565|            c = (c << 10) + d - ((0xD800 << 10) + 0xDC00 - 0x10000);
 2737|    565|            out[0] =  (c >> 18)         | 0xF0;
 2738|    565|            out[1] = ((c >> 12) & 0x3F) | 0x80;
 2739|    565|            out[2] = ((c >>  6) & 0x3F) | 0x80;
 2740|    565|            out[3] =  (c        & 0x3F) | 0x80;
 2741|    565|            in += 4;
 2742|    565|            out += 4;
 2743|    565|        }
 2744|  12.8M|    }
 2745|       |
 2746|  10.7k|    ret = out - outstart;
 2747|       |
 2748|  20.4k|done:
 2749|  20.4k|    *outlen = out - outstart;
 2750|  20.4k|    *inlen = in - instart;
 2751|  20.4k|    return(ret);
 2752|  10.7k|}
encoding.c:asciiToAscii:
 2278|    871|             int flush ATTRIBUTE_UNUSED) {
 2279|    871|    const unsigned char *inend;
 2280|    871|    const unsigned char *instart = in;
 2281|    871|    int inlen, outlen, ret;
 2282|       |
 2283|    871|    if (in == NULL) {
  ------------------
  |  Branch (2283:9): [True: 0, False: 871]
  ------------------
 2284|      0|        *pinlen = 0;
 2285|      0|        *poutlen = 0;
 2286|      0|        return(XML_ENC_ERR_SUCCESS);
 2287|      0|    }
 2288|       |
 2289|    871|    inlen = *pinlen;
 2290|    871|    outlen = *poutlen;
 2291|       |
 2292|    871|    if (outlen < inlen) {
  ------------------
  |  Branch (2292:9): [True: 103, False: 768]
  ------------------
 2293|    103|        inlen = outlen;
 2294|    103|        ret = XML_ENC_ERR_SPACE;
 2295|    768|    } else {
 2296|    768|        ret = inlen;
 2297|    768|    }
 2298|       |
 2299|    871|    inend = in + inlen;
 2300|    871|    *poutlen = inlen;
 2301|    871|    *pinlen = inlen;
 2302|       |
 2303|  49.5k|    while (in < inend) {
  ------------------
  |  Branch (2303:12): [True: 49.2k, False: 281]
  ------------------
 2304|  49.2k|	unsigned c = *in;
 2305|       |
 2306|  49.2k|        if (c >= 0x80) {
  ------------------
  |  Branch (2306:13): [True: 590, False: 48.6k]
  ------------------
 2307|    590|	    *poutlen = in - instart;
 2308|    590|	    *pinlen = in - instart;
 2309|    590|	    return(XML_ENC_ERR_INPUT);
 2310|    590|	}
 2311|       |
 2312|  48.6k|        in++;
 2313|  48.6k|	*out++ = c;
 2314|  48.6k|    }
 2315|       |
 2316|    281|    return(ret);
 2317|    871|}
encoding.c:xmlFindExtraHandler:
  908|  7.94k|                    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|  7.94k|    if (impl != NULL)
  ------------------
  |  Branch (915:9): [True: 0, False: 7.94k]
  ------------------
  916|      0|        return(impl(implCtxt, norig, flags, out));
  917|       |
  918|       |    /*
  919|       |     * Deprecated
  920|       |     */
  921|  7.94k|    if (globalHandlers != NULL) {
  ------------------
  |  Branch (921:9): [True: 0, False: 7.94k]
  ------------------
  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|  7.94k|#ifdef LIBXML_ICONV_ENABLED
  939|  7.94k|    {
  940|  7.94k|        int ret = xmlCharEncIconv(name, flags, out);
  941|       |
  942|  7.94k|        if (ret == XML_ERR_OK)
  ------------------
  |  Branch (942:13): [True: 7.29k, False: 648]
  ------------------
  943|  7.29k|            return(XML_ERR_OK);
  944|    648|        if (ret != XML_ERR_UNSUPPORTED_ENCODING)
  ------------------
  |  Branch (944:13): [True: 20, False: 628]
  ------------------
  945|     20|            return(ret);
  946|    648|    }
  947|    628|#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|    628|    return(XML_ERR_UNSUPPORTED_ENCODING);
  961|    648|}
encoding.c:xmlCharEncIconv:
 1319|  7.94k|                xmlCharEncodingHandler **out) {
 1320|  7.94k|    xmlCharEncConvFunc inFunc = NULL, outFunc = NULL;
 1321|  7.94k|    xmlIconvCtxt *inputCtxt = NULL, *outputCtxt = NULL;
 1322|  7.94k|    iconv_t icv_in;
 1323|  7.94k|    iconv_t icv_out;
 1324|  7.94k|    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|  7.94k|    if (strstr(name, "//") != NULL) {
  ------------------
  |  Branch (1353:9): [True: 6, False: 7.93k]
  ------------------
 1354|      6|        ret = XML_ERR_UNSUPPORTED_ENCODING;
 1355|      6|        goto error;
 1356|      6|    }
 1357|       |
 1358|  7.93k|#if defined(FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION) && \
 1359|  7.93k|    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|  7.93k|    if ((xmlEncodingMatch(name, "TSCII")) ||
  ------------------
  |  Branch (1366:9): [True: 223, False: 7.71k]
  ------------------
 1367|  7.71k|        (xmlEncodingMatch(name, "BIG5-HKSCS"))) {
  ------------------
  |  Branch (1367:9): [True: 0, False: 7.71k]
  ------------------
 1368|    223|        ret = XML_ERR_UNSUPPORTED_ENCODING;
 1369|    223|        goto error;
 1370|    223|    }
 1371|  7.71k|#endif
 1372|       |
 1373|  7.71k|    if (flags & XML_ENC_INPUT) {
  ------------------
  |  Branch (1373:9): [True: 7.71k, False: 0]
  ------------------
 1374|  7.71k|        inputCtxt = xmlMalloc(sizeof(xmlIconvCtxt));
 1375|  7.71k|        if (inputCtxt == NULL) {
  ------------------
  |  Branch (1375:13): [True: 4, False: 7.70k]
  ------------------
 1376|      4|            ret = XML_ERR_NO_MEMORY;
 1377|      4|            goto error;
 1378|      4|        }
 1379|  7.70k|        inputCtxt->cd = (iconv_t) -1;
 1380|       |
 1381|  7.70k|        icv_in = iconv_open("UTF-8", name);
 1382|  7.70k|        if (icv_in == (iconv_t) -1) {
  ------------------
  |  Branch (1382:13): [True: 399, False: 7.30k]
  ------------------
 1383|    399|            if (errno == EINVAL)
  ------------------
  |  Branch (1383:17): [True: 399, False: 0]
  ------------------
 1384|    399|                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|    399|            goto error;
 1390|    399|        }
 1391|  7.30k|        inputCtxt->cd = icv_in;
 1392|       |
 1393|  7.30k|        inFunc = xmlIconvConvert;
 1394|  7.30k|    }
 1395|       |
 1396|  7.30k|    if (flags & XML_ENC_OUTPUT) {
  ------------------
  |  Branch (1396:9): [True: 894, False: 6.41k]
  ------------------
 1397|    894|        outputCtxt = xmlMalloc(sizeof(xmlIconvCtxt));
 1398|    894|        if (outputCtxt == NULL) {
  ------------------
  |  Branch (1398:13): [True: 1, False: 893]
  ------------------
 1399|      1|            ret = XML_ERR_NO_MEMORY;
 1400|      1|            goto error;
 1401|      1|        }
 1402|    893|        outputCtxt->cd = (iconv_t) -1;
 1403|       |
 1404|    893|        icv_out = iconv_open(name, "UTF-8");
 1405|    893|        if (icv_out == (iconv_t) -1) {
  ------------------
  |  Branch (1405:13): [True: 0, False: 893]
  ------------------
 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|    893|        outputCtxt->cd = icv_out;
 1415|       |
 1416|    893|        outFunc = xmlIconvConvert;
 1417|    893|    }
 1418|       |
 1419|  7.30k|    return(xmlCharEncNewCustomHandler(name, inFunc, outFunc, xmlIconvFree,
 1420|  7.30k|                                      inputCtxt, outputCtxt, out));
 1421|       |
 1422|    633|error:
 1423|    633|    if (inputCtxt != NULL)
  ------------------
  |  Branch (1423:9): [True: 400, False: 233]
  ------------------
 1424|    400|        xmlIconvFree(inputCtxt);
 1425|    633|    if (outputCtxt != NULL)
  ------------------
  |  Branch (1425:9): [True: 0, False: 633]
  ------------------
 1426|      0|        xmlIconvFree(outputCtxt);
 1427|    633|    return(ret);
 1428|  7.30k|}
encoding.c:xmlEncodingMatch:
 1295|  15.6k|xmlEncodingMatch(const char *name1, const char *name2) {
 1296|       |    /*
 1297|       |     * Fuzzy match for encoding names
 1298|       |     */
 1299|  16.8k|    while (1) {
  ------------------
  |  Branch (1299:12): [True: 16.8k, Folded]
  ------------------
 1300|  18.1k|        while ((*name1 != 0) && (!IS_ASCII_LETTER(*name1)))
  ------------------
  |  |  222|  17.8k|#define IS_ASCII_LETTER(c)	((0x61 <= ((c) | 0x20)) && \
  |  |  ------------------
  |  |  |  Branch (222:29): [True: 17.2k, False: 633]
  |  |  ------------------
  |  |  223|  17.8k|                                 (((c) | 0x20) <= 0x7a))
  |  |  ------------------
  |  |  |  Branch (223:34): [True: 16.5k, False: 650]
  |  |  ------------------
  ------------------
  |  Branch (1300:16): [True: 17.8k, False: 303]
  ------------------
 1301|  1.28k|            name1 += 1;
 1302|  16.8k|        while ((*name2 != 0) && (!IS_ASCII_LETTER(*name2)))
  ------------------
  |  |  222|  16.6k|#define IS_ASCII_LETTER(c)	((0x61 <= ((c) | 0x20)) && \
  |  |  ------------------
  |  |  |  Branch (222:29): [True: 16.6k, False: 0]
  |  |  ------------------
  |  |  223|  16.6k|                                 (((c) | 0x20) <= 0x7a))
  |  |  ------------------
  |  |  |  Branch (223:34): [True: 16.6k, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (1302:16): [True: 16.6k, False: 223]
  ------------------
 1303|      0|            name2 += 1;
 1304|  16.8k|        if ((*name1 == 0) || (*name2 == 0))
  ------------------
  |  Branch (1304:13): [True: 303, False: 16.5k]
  |  Branch (1304:30): [True: 205, False: 16.3k]
  ------------------
 1305|    508|            break;
 1306|  16.3k|        if ((*name1 | 0x20) != (*name2 | 0x20))
  ------------------
  |  Branch (1306:13): [True: 15.1k, False: 1.22k]
  ------------------
 1307|  15.1k|            return(0);
 1308|  1.22k|        name1 += 1;
 1309|  1.22k|        name2 += 1;
 1310|  1.22k|    }
 1311|       |
 1312|       |    /* Only check whether name1 starts with name2 */
 1313|    508|    return(*name2 == 0);
 1314|  15.6k|}
encoding.c:xmlIconvConvert:
 1234|  30.8k|                int flush ATTRIBUTE_UNUSED) {
 1235|  30.8k|    xmlIconvCtxt *ctxt = vctxt;
 1236|  30.8k|    size_t icv_inlen, icv_outlen;
 1237|  30.8k|    const char *icv_in = (const char *) in;
 1238|  30.8k|    char *icv_out = (char *) out;
 1239|  30.8k|    size_t ret;
 1240|       |
 1241|  30.8k|    if ((out == NULL) || (outlen == NULL) || (inlen == NULL) || (in == NULL)) {
  ------------------
  |  Branch (1241:9): [True: 0, False: 30.8k]
  |  Branch (1241:26): [True: 0, False: 30.8k]
  |  Branch (1241:46): [True: 0, False: 30.8k]
  |  Branch (1241:65): [True: 0, False: 30.8k]
  ------------------
 1242|      0|        if (outlen != NULL) *outlen = 0;
  ------------------
  |  Branch (1242:13): [True: 0, False: 0]
  ------------------
 1243|      0|        return(XML_ENC_ERR_INTERNAL);
 1244|      0|    }
 1245|  30.8k|    icv_inlen = *inlen;
 1246|  30.8k|    icv_outlen = *outlen;
 1247|       |    /*
 1248|       |     * Some versions take const, other versions take non-const input.
 1249|       |     */
 1250|  30.8k|    ret = iconv(ctxt->cd, (void *) &icv_in, &icv_inlen, &icv_out, &icv_outlen);
 1251|  30.8k|    *inlen -= icv_inlen;
 1252|  30.8k|    *outlen -= icv_outlen;
 1253|  30.8k|    if (ret == (size_t) -1) {
  ------------------
  |  Branch (1253:9): [True: 10.2k, False: 20.6k]
  ------------------
 1254|  10.2k|        if (errno == EILSEQ)
  ------------------
  |  Branch (1254:13): [True: 444, False: 9.76k]
  ------------------
 1255|    444|            return(XML_ENC_ERR_INPUT);
 1256|  9.76k|        if (errno == E2BIG)
  ------------------
  |  Branch (1256:13): [True: 7.17k, False: 2.58k]
  ------------------
 1257|  7.17k|            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.58k|        if (errno == EINVAL)
  ------------------
  |  Branch (1262:13): [True: 2.58k, False: 0]
  ------------------
 1263|  2.58k|            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.58k|    }
 1274|  20.6k|    return(XML_ENC_ERR_SUCCESS);
 1275|  30.8k|}
encoding.c:xmlIconvFree:
 1278|  15.0k|xmlIconvFree(void *vctxt) {
 1279|  15.0k|    xmlIconvCtxt *ctxt = vctxt;
 1280|       |
 1281|  15.0k|    if (ctxt == NULL)
  ------------------
  |  Branch (1281:9): [True: 6.40k, False: 8.60k]
  ------------------
 1282|  6.40k|        return;
 1283|       |
 1284|  8.60k|    if (ctxt->cd != (iconv_t) -1)
  ------------------
  |  Branch (1284:9): [True: 8.20k, False: 399]
  ------------------
 1285|  8.20k|        iconv_close(ctxt->cd);
 1286|       |
 1287|  8.60k|    xmlFree(ctxt);
 1288|  8.60k|}
encoding.c:xmlEncConvertError:
 1649|  2.72k|xmlEncConvertError(xmlCharEncError code) {
 1650|  2.72k|    xmlParserErrors ret;
 1651|       |
 1652|  2.72k|    switch (code) {
 1653|      0|        case XML_ENC_ERR_SUCCESS:
  ------------------
  |  Branch (1653:9): [True: 0, False: 2.72k]
  ------------------
 1654|      0|            ret = XML_ERR_OK;
 1655|      0|            break;
 1656|  2.72k|        case XML_ENC_ERR_INPUT:
  ------------------
  |  Branch (1656:9): [True: 2.72k, False: 0]
  ------------------
 1657|  2.72k|            ret = XML_ERR_INVALID_ENCODING;
 1658|  2.72k|            break;
 1659|      0|        case XML_ENC_ERR_MEMORY:
  ------------------
  |  Branch (1659:9): [True: 0, False: 2.72k]
  ------------------
 1660|      0|            ret = XML_ERR_NO_MEMORY;
 1661|      0|            break;
 1662|      0|        default:
  ------------------
  |  Branch (1662:9): [True: 0, False: 2.72k]
  ------------------
 1663|      0|            ret = XML_ERR_INTERNAL_ERROR;
 1664|      0|            break;
 1665|  2.72k|    }
 1666|       |
 1667|  2.72k|    return(ret);
 1668|  2.72k|}
encoding.c:latin1ToUTF8:
 2323|  19.8k|             int flush ATTRIBUTE_UNUSED) {
 2324|  19.8k|    unsigned char* outstart = out;
 2325|  19.8k|    const unsigned char* instart = in;
 2326|  19.8k|    unsigned char* outend;
 2327|  19.8k|    const unsigned char* inend;
 2328|  19.8k|    int ret = XML_ENC_ERR_SPACE;
 2329|       |
 2330|  19.8k|    if ((out == NULL) || (in == NULL) || (outlen == NULL) || (inlen == NULL))
  ------------------
  |  Branch (2330:9): [True: 0, False: 19.8k]
  |  Branch (2330:26): [True: 0, False: 19.8k]
  |  Branch (2330:42): [True: 0, False: 19.8k]
  |  Branch (2330:62): [True: 0, False: 19.8k]
  ------------------
 2331|      0|	return(XML_ENC_ERR_INTERNAL);
 2332|       |
 2333|  19.8k|    outend = out + *outlen;
 2334|  19.8k|    inend = in + *inlen;
 2335|       |
 2336|  17.4M|    while (in < inend) {
  ------------------
  |  Branch (2336:12): [True: 17.4M, False: 14.6k]
  ------------------
 2337|  17.4M|        unsigned c = *in;
 2338|       |
 2339|  17.4M|	if (c < 0x80) {
  ------------------
  |  Branch (2339:6): [True: 6.03M, False: 11.3M]
  ------------------
 2340|  6.03M|            if (out >= outend)
  ------------------
  |  Branch (2340:17): [True: 2.09k, False: 6.03M]
  ------------------
 2341|  2.09k|                goto done;
 2342|  6.03M|            *out++ = c;
 2343|  11.3M|	} else {
 2344|  11.3M|            if (outend - out < 2)
  ------------------
  |  Branch (2344:17): [True: 3.15k, False: 11.3M]
  ------------------
 2345|  3.15k|                goto done;
 2346|  11.3M|	    *out++ = (c >> 6) | 0xC0;
 2347|  11.3M|            *out++ = (c & 0x3F) | 0x80;
 2348|  11.3M|        }
 2349|       |
 2350|  17.3M|        in++;
 2351|  17.3M|    }
 2352|       |
 2353|  14.6k|    ret = out - outstart;
 2354|       |
 2355|  19.8k|done:
 2356|  19.8k|    *outlen = out - outstart;
 2357|  19.8k|    *inlen = in - instart;
 2358|  19.8k|    return(ret);
 2359|  14.6k|}

xmlFreeEntity:
   85|   114k|{
   86|   114k|    xmlDictPtr dict = NULL;
   87|       |
   88|   114k|    if (entity == NULL)
  ------------------
  |  Branch (88:9): [True: 0, False: 114k]
  ------------------
   89|      0|        return;
   90|       |
   91|   114k|    if (entity->doc != NULL)
  ------------------
  |  Branch (91:9): [True: 111k, False: 2.71k]
  ------------------
   92|   111k|        dict = entity->doc->dict;
   93|       |
   94|       |
   95|   114k|    if ((entity->children) &&
  ------------------
  |  Branch (95:9): [True: 2.99k, False: 111k]
  ------------------
   96|  2.99k|        (entity == (xmlEntityPtr) entity->children->parent))
  ------------------
  |  Branch (96:9): [True: 2.99k, False: 0]
  ------------------
   97|  2.99k|        xmlFreeNodeList(entity->children);
   98|   114k|    if ((entity->name != NULL) &&
  ------------------
  |  Branch (98:9): [True: 114k, False: 9]
  ------------------
   99|   114k|        ((dict == NULL) || (!xmlDictOwns(dict, entity->name))))
  ------------------
  |  Branch (99:10): [True: 89.5k, False: 24.6k]
  |  Branch (99:28): [True: 0, False: 24.6k]
  ------------------
  100|  89.5k|        xmlFree((char *) entity->name);
  101|   114k|    if (entity->ExternalID != NULL)
  ------------------
  |  Branch (101:9): [True: 3.91k, False: 110k]
  ------------------
  102|  3.91k|        xmlFree((char *) entity->ExternalID);
  103|   114k|    if (entity->SystemID != NULL)
  ------------------
  |  Branch (103:9): [True: 12.7k, False: 101k]
  ------------------
  104|  12.7k|        xmlFree((char *) entity->SystemID);
  105|   114k|    if (entity->URI != NULL)
  ------------------
  |  Branch (105:9): [True: 7.43k, False: 106k]
  ------------------
  106|  7.43k|        xmlFree((char *) entity->URI);
  107|   114k|    if (entity->content != NULL)
  ------------------
  |  Branch (107:9): [True: 98.4k, False: 15.7k]
  ------------------
  108|  98.4k|        xmlFree((char *) entity->content);
  109|   114k|    if (entity->orig != NULL)
  ------------------
  |  Branch (109:9): [True: 12.4k, False: 101k]
  ------------------
  110|  12.4k|        xmlFree((char *) entity->orig);
  111|   114k|    xmlFree(entity);
  112|   114k|}
xmlAddEntity:
  188|   113k|	  const xmlChar *content, xmlEntity **out) {
  189|   113k|    xmlDtdPtr dtd;
  190|   113k|    xmlDictPtr dict = NULL;
  191|   113k|    xmlEntitiesTablePtr table = NULL;
  192|   113k|    xmlEntityPtr ret, predef;
  193|   113k|    int res;
  194|       |
  195|   113k|    if (out != NULL)
  ------------------
  |  Branch (195:9): [True: 113k, False: 0]
  ------------------
  196|   113k|        *out = NULL;
  197|   113k|    if ((doc == NULL) || (name == NULL))
  ------------------
  |  Branch (197:9): [True: 0, False: 113k]
  |  Branch (197:26): [True: 0, False: 113k]
  ------------------
  198|      0|	return(XML_ERR_ARGUMENT);
  199|   113k|    dict = doc->dict;
  200|       |
  201|   113k|    if (extSubset)
  ------------------
  |  Branch (201:9): [True: 8.03k, False: 105k]
  ------------------
  202|  8.03k|        dtd = doc->extSubset;
  203|   105k|    else
  204|   105k|        dtd = doc->intSubset;
  205|   113k|    if (dtd == NULL)
  ------------------
  |  Branch (205:9): [True: 0, False: 113k]
  ------------------
  206|      0|        return(XML_DTD_NO_DTD);
  207|       |
  208|   113k|    switch (type) {
  209|  49.2k|        case XML_INTERNAL_GENERAL_ENTITY:
  ------------------
  |  Branch (209:9): [True: 49.2k, False: 64.5k]
  ------------------
  210|  58.7k|        case XML_EXTERNAL_GENERAL_PARSED_ENTITY:
  ------------------
  |  Branch (210:9): [True: 9.49k, False: 104k]
  ------------------
  211|  59.2k|        case XML_EXTERNAL_GENERAL_UNPARSED_ENTITY:
  ------------------
  |  Branch (211:9): [True: 505, False: 113k]
  ------------------
  212|  59.2k|            predef = xmlGetPredefinedEntity(name);
  213|  59.2k|            if (predef != NULL) {
  ------------------
  |  Branch (213:17): [True: 2.99k, False: 56.2k]
  ------------------
  214|  2.99k|                int valid = 0;
  215|       |
  216|       |                /* 4.6 Predefined Entities */
  217|  2.99k|                if ((type == XML_INTERNAL_GENERAL_ENTITY) &&
  ------------------
  |  Branch (217:21): [True: 2.50k, False: 490]
  ------------------
  218|  2.50k|                    (content != NULL)) {
  ------------------
  |  Branch (218:21): [True: 1.89k, False: 610]
  ------------------
  219|  1.89k|                    int c = predef->content[0];
  220|       |
  221|  1.89k|                    if (((content[0] == c) && (content[1] == 0)) &&
  ------------------
  |  Branch (221:26): [True: 988, False: 907]
  |  Branch (221:47): [True: 523, False: 465]
  ------------------
  222|    523|                        ((c == '>') || (c == '\'') || (c == '"'))) {
  ------------------
  |  Branch (222:26): [True: 182, False: 341]
  |  Branch (222:40): [True: 118, False: 223]
  |  Branch (222:55): [True: 84, False: 139]
  ------------------
  223|    384|                        valid = 1;
  224|  1.51k|                    } else if ((content[0] == '&') && (content[1] == '#')) {
  ------------------
  |  Branch (224:32): [True: 795, False: 716]
  |  Branch (224:55): [True: 644, False: 151]
  ------------------
  225|    644|                        if (content[2] == 'x') {
  ------------------
  |  Branch (225:29): [True: 86, False: 558]
  ------------------
  226|     86|                            xmlChar *hex = BAD_CAST "0123456789ABCDEF";
  ------------------
  |  |   34|     86|#define BAD_CAST (xmlChar *)
  ------------------
  227|     86|                            xmlChar ref[] = "00;";
  228|       |
  229|     86|                            ref[0] = hex[c / 16 % 16];
  230|     86|                            ref[1] = hex[c % 16];
  231|     86|                            if (xmlStrcasecmp(&content[3], ref) == 0)
  ------------------
  |  Branch (231:33): [True: 11, False: 75]
  ------------------
  232|     11|                                valid = 1;
  233|    558|                        } else {
  234|    558|                            xmlChar ref[] = "00;";
  235|       |
  236|    558|                            ref[0] = '0' + c / 10 % 10;
  237|    558|                            ref[1] = '0' + c % 10;
  238|    558|                            if (xmlStrEqual(&content[2], ref))
  ------------------
  |  Branch (238:33): [True: 245, False: 313]
  ------------------
  239|    245|                                valid = 1;
  240|    558|                        }
  241|    644|                    }
  242|  1.89k|                }
  243|  2.99k|                if (!valid)
  ------------------
  |  Branch (243:21): [True: 2.35k, False: 640]
  ------------------
  244|  2.35k|                    return(XML_ERR_REDECL_PREDEF_ENTITY);
  245|  2.99k|            }
  246|  56.8k|	    if (dtd->entities == NULL) {
  ------------------
  |  Branch (246:10): [True: 4.06k, False: 52.8k]
  ------------------
  247|  4.06k|		dtd->entities = xmlHashCreateDict(0, dict);
  248|  4.06k|                if (dtd->entities == NULL)
  ------------------
  |  Branch (248:21): [True: 1, False: 4.06k]
  ------------------
  249|      1|                    return(XML_ERR_NO_MEMORY);
  250|  4.06k|            }
  251|  56.8k|	    table = dtd->entities;
  252|  56.8k|	    break;
  253|  49.1k|        case XML_INTERNAL_PARAMETER_ENTITY:
  ------------------
  |  Branch (253:9): [True: 49.1k, False: 64.6k]
  ------------------
  254|  54.5k|        case XML_EXTERNAL_PARAMETER_ENTITY:
  ------------------
  |  Branch (254:9): [True: 5.40k, False: 108k]
  ------------------
  255|  54.5k|	    if (dtd->pentities == NULL) {
  ------------------
  |  Branch (255:10): [True: 2.80k, False: 51.7k]
  ------------------
  256|  2.80k|		dtd->pentities = xmlHashCreateDict(0, dict);
  257|  2.80k|                if (dtd->pentities == NULL)
  ------------------
  |  Branch (257:21): [True: 1, False: 2.80k]
  ------------------
  258|      1|                    return(XML_ERR_NO_MEMORY);
  259|  2.80k|            }
  260|  54.5k|	    table = dtd->pentities;
  261|  54.5k|	    break;
  262|      0|        default:
  ------------------
  |  Branch (262:9): [True: 0, False: 113k]
  ------------------
  263|      0|	    return(XML_ERR_ARGUMENT);
  264|   113k|    }
  265|   111k|    ret = xmlCreateEntity(dtd->doc, name, type, publicId, systemId, content);
  266|   111k|    if (ret == NULL)
  ------------------
  |  Branch (266:9): [True: 15, False: 111k]
  ------------------
  267|     15|        return(XML_ERR_NO_MEMORY);
  268|       |
  269|   111k|    res = xmlHashAdd(table, name, ret);
  270|   111k|    if (res < 0) {
  ------------------
  |  Branch (270:9): [True: 5, False: 111k]
  ------------------
  271|      5|        xmlFreeEntity(ret);
  272|      5|        return(XML_ERR_NO_MEMORY);
  273|   111k|    } else if (res == 0) {
  ------------------
  |  Branch (273:16): [True: 94.1k, False: 17.2k]
  ------------------
  274|       |	/*
  275|       |	 * entity was already defined at another level.
  276|       |	 */
  277|  94.1k|        xmlFreeEntity(ret);
  278|  94.1k|	return(XML_WAR_ENTITY_REDEFINED);
  279|  94.1k|    }
  280|       |
  281|       |    /*
  282|       |     * Link it to the DTD
  283|       |     */
  284|  17.2k|    ret->parent = dtd;
  285|  17.2k|    ret->doc = dtd->doc;
  286|  17.2k|    if (dtd->last == NULL) {
  ------------------
  |  Branch (286:9): [True: 4.62k, False: 12.6k]
  ------------------
  287|  4.62k|	dtd->children = dtd->last = (xmlNodePtr) ret;
  288|  12.6k|    } else {
  289|  12.6k|	dtd->last->next = (xmlNodePtr) ret;
  290|  12.6k|	ret->prev = dtd->last;
  291|  12.6k|	dtd->last = (xmlNodePtr) ret;
  292|  12.6k|    }
  293|       |
  294|  17.2k|    if (out != NULL)
  ------------------
  |  Branch (294:9): [True: 17.2k, False: 0]
  ------------------
  295|  17.2k|        *out = ret;
  296|  17.2k|    return(0);
  297|   111k|}
xmlGetPredefinedEntity:
  306|  3.59M|xmlGetPredefinedEntity(const xmlChar *name) {
  307|  3.59M|    if (name == NULL) return(NULL);
  ------------------
  |  Branch (307:9): [True: 3, False: 3.59M]
  ------------------
  308|  3.59M|    switch (name[0]) {
  309|   236k|        case 'l':
  ------------------
  |  Branch (309:9): [True: 236k, False: 3.35M]
  ------------------
  310|   236k|	    if (xmlStrEqual(name, BAD_CAST "lt"))
  ------------------
  |  |   34|   236k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (310:10): [True: 10.5k, False: 225k]
  ------------------
  311|  10.5k|	        return(&xmlEntityLt);
  312|   225k|	    break;
  313|   942k|        case 'g':
  ------------------
  |  Branch (313:9): [True: 942k, False: 2.64M]
  ------------------
  314|   942k|	    if (xmlStrEqual(name, BAD_CAST "gt"))
  ------------------
  |  |   34|   942k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (314:10): [True: 925k, False: 16.8k]
  ------------------
  315|   925k|	        return(&xmlEntityGt);
  316|  16.8k|	    break;
  317|  86.6k|        case 'a':
  ------------------
  |  Branch (317:9): [True: 86.6k, False: 3.50M]
  ------------------
  318|  86.6k|	    if (xmlStrEqual(name, BAD_CAST "amp"))
  ------------------
  |  |   34|  86.6k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (318:10): [True: 6.21k, False: 80.4k]
  ------------------
  319|  6.21k|	        return(&xmlEntityAmp);
  320|  80.4k|	    if (xmlStrEqual(name, BAD_CAST "apos"))
  ------------------
  |  |   34|  80.4k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (320:10): [True: 6.23k, False: 74.1k]
  ------------------
  321|  6.23k|	        return(&xmlEntityApos);
  322|  74.1k|	    break;
  323|  74.1k|        case 'q':
  ------------------
  |  Branch (323:9): [True: 64.8k, False: 3.52M]
  ------------------
  324|  64.8k|	    if (xmlStrEqual(name, BAD_CAST "quot"))
  ------------------
  |  |   34|  64.8k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (324:10): [True: 64.2k, False: 586]
  ------------------
  325|  64.2k|	        return(&xmlEntityQuot);
  326|    586|	    break;
  327|  2.26M|	default:
  ------------------
  |  Branch (327:2): [True: 2.26M, False: 1.32M]
  ------------------
  328|  2.26M|	    break;
  329|  3.59M|    }
  330|  2.57M|    return(NULL);
  331|  3.59M|}
xmlAddDocEntity:
  372|    121|	        const xmlChar *content) {
  373|    121|    xmlEntityPtr ret;
  374|       |
  375|    121|    xmlAddEntity(doc, 0, name, type, publicId, systemId, content, &ret);
  376|    121|    return(ret);
  377|    121|}
xmlGetParameterEntity:
  428|   377k|xmlGetParameterEntity(xmlDoc *doc, const xmlChar *name) {
  429|   377k|    xmlEntitiesTablePtr table;
  430|   377k|    xmlEntityPtr ret;
  431|       |
  432|   377k|    if (doc == NULL)
  ------------------
  |  Branch (432:9): [True: 35, False: 377k]
  ------------------
  433|     35|	return(NULL);
  434|   377k|    if ((doc->intSubset != NULL) && (doc->intSubset->pentities != NULL)) {
  ------------------
  |  Branch (434:9): [True: 377k, False: 22]
  |  Branch (434:37): [True: 366k, False: 11.1k]
  ------------------
  435|   366k|	table = (xmlEntitiesTablePtr) doc->intSubset->pentities;
  436|   366k|	ret = xmlGetEntityFromTable(table, name);
  437|   366k|	if (ret != NULL)
  ------------------
  |  Branch (437:6): [True: 278k, False: 87.6k]
  ------------------
  438|   278k|	    return(ret);
  439|   366k|    }
  440|  98.8k|    if ((doc->extSubset != NULL) && (doc->extSubset->pentities != NULL)) {
  ------------------
  |  Branch (440:9): [True: 11.4k, False: 87.3k]
  |  Branch (440:37): [True: 11.1k, False: 281]
  ------------------
  441|  11.1k|	table = (xmlEntitiesTablePtr) doc->extSubset->pentities;
  442|  11.1k|	return(xmlGetEntityFromTable(table, name));
  443|  11.1k|    }
  444|  87.6k|    return(NULL);
  445|  98.8k|}
xmlGetDocEntity:
  476|  1.82M|xmlGetDocEntity(const xmlDoc *doc, const xmlChar *name) {
  477|  1.82M|    xmlEntityPtr cur;
  478|  1.82M|    xmlEntitiesTablePtr table;
  479|       |
  480|  1.82M|    if (doc != NULL) {
  ------------------
  |  Branch (480:9): [True: 1.82M, False: 762]
  ------------------
  481|  1.82M|	if ((doc->intSubset != NULL) && (doc->intSubset->entities != NULL)) {
  ------------------
  |  Branch (481:6): [True: 1.80M, False: 18.7k]
  |  Branch (481:34): [True: 1.72M, False: 85.6k]
  ------------------
  482|  1.72M|	    table = (xmlEntitiesTablePtr) doc->intSubset->entities;
  483|  1.72M|	    cur = xmlGetEntityFromTable(table, name);
  484|  1.72M|	    if (cur != NULL)
  ------------------
  |  Branch (484:10): [True: 1.38M, False: 342k]
  ------------------
  485|  1.38M|		return(cur);
  486|  1.72M|	}
  487|   446k|	if (doc->standalone != 1) {
  ------------------
  |  Branch (487:6): [True: 445k, False: 1.02k]
  ------------------
  488|   445k|	    if ((doc->extSubset != NULL) &&
  ------------------
  |  Branch (488:10): [True: 6.97k, False: 438k]
  ------------------
  489|  6.97k|		(doc->extSubset->entities != NULL)) {
  ------------------
  |  Branch (489:3): [True: 5.63k, False: 1.33k]
  ------------------
  490|  5.63k|		table = (xmlEntitiesTablePtr) doc->extSubset->entities;
  491|  5.63k|		cur = xmlGetEntityFromTable(table, name);
  492|  5.63k|		if (cur != NULL)
  ------------------
  |  Branch (492:7): [True: 4.51k, False: 1.11k]
  ------------------
  493|  4.51k|		    return(cur);
  494|  5.63k|	    }
  495|   445k|	}
  496|   446k|    }
  497|   443k|    return(xmlGetPredefinedEntity(name));
  498|  1.82M|}
xmlFreeEntitiesTable:
  588|  8.80k|xmlFreeEntitiesTable(xmlEntitiesTable *table) {
  589|  8.80k|    xmlHashFree(table, xmlFreeEntityWrapper);
  590|  8.80k|}
xmlCopyEntitiesTable:
  665|  1.96k|xmlCopyEntitiesTable(xmlEntitiesTable *table) {
  666|  1.96k|    return(xmlHashCopySafe(table, xmlCopyEntity, xmlFreeEntityWrapper));
  667|  1.96k|}
entities.c:xmlCreateEntity:
  120|   111k|	        const xmlChar *content) {
  121|   111k|    xmlEntityPtr ret;
  122|       |
  123|   111k|    ret = (xmlEntityPtr) xmlMalloc(sizeof(xmlEntity));
  124|   111k|    if (ret == NULL)
  ------------------
  |  Branch (124:9): [True: 5, False: 111k]
  ------------------
  125|      5|	return(NULL);
  126|   111k|    memset(ret, 0, sizeof(xmlEntity));
  127|   111k|    ret->doc = doc;
  128|   111k|    ret->type = XML_ENTITY_DECL;
  129|       |
  130|       |    /*
  131|       |     * fill the structure.
  132|       |     */
  133|   111k|    ret->etype = (xmlEntityType) type;
  134|   111k|    if ((doc == NULL) || (doc->dict == NULL))
  ------------------
  |  Branch (134:9): [True: 0, False: 111k]
  |  Branch (134:26): [True: 86.7k, False: 24.6k]
  ------------------
  135|  86.7k|	ret->name = xmlStrdup(name);
  136|  24.6k|    else
  137|  24.6k|        ret->name = xmlDictLookup(doc->dict, name, -1);
  138|   111k|    if (ret->name == NULL)
  ------------------
  |  Branch (138:9): [True: 3, False: 111k]
  ------------------
  139|      3|        goto error;
  140|   111k|    if (publicId != NULL) {
  ------------------
  |  Branch (140:9): [True: 3.75k, False: 107k]
  ------------------
  141|  3.75k|        ret->ExternalID = xmlStrdup(publicId);
  142|  3.75k|        if (ret->ExternalID == NULL)
  ------------------
  |  Branch (142:13): [True: 2, False: 3.75k]
  ------------------
  143|      2|            goto error;
  144|  3.75k|    }
  145|   111k|    if (systemId != NULL) {
  ------------------
  |  Branch (145:9): [True: 11.8k, False: 99.6k]
  ------------------
  146|  11.8k|        ret->SystemID = xmlStrdup(systemId);
  147|  11.8k|        if (ret->SystemID == NULL)
  ------------------
  |  Branch (147:13): [True: 1, False: 11.8k]
  ------------------
  148|      1|            goto error;
  149|  11.8k|    }
  150|   111k|    if (content != NULL) {
  ------------------
  |  Branch (150:9): [True: 96.3k, False: 15.0k]
  ------------------
  151|  96.3k|        ret->length = xmlStrlen(content);
  152|  96.3k|	ret->content = xmlStrndup(content, ret->length);
  153|  96.3k|        if (ret->content == NULL)
  ------------------
  |  Branch (153:13): [True: 4, False: 96.3k]
  ------------------
  154|      4|            goto error;
  155|  96.3k|     } else {
  156|  15.0k|        ret->length = 0;
  157|  15.0k|        ret->content = NULL;
  158|  15.0k|    }
  159|   111k|    ret->URI = NULL; /* to be computed by the layer knowing
  160|       |			the defining entity */
  161|   111k|    ret->orig = NULL;
  162|       |
  163|   111k|    return(ret);
  164|       |
  165|     10|error:
  166|     10|    xmlFreeEntity(ret);
  167|       |    return(NULL);
  168|   111k|}
entities.c:xmlGetEntityFromTable:
  415|  2.10M|xmlGetEntityFromTable(xmlEntitiesTablePtr table, const xmlChar *name) {
  416|  2.10M|    return((xmlEntityPtr) xmlHashLookup(table, name));
  417|  2.10M|}
entities.c:xmlFreeEntityWrapper:
  575|  19.9k|xmlFreeEntityWrapper(void *entity, const xmlChar *name ATTRIBUTE_UNUSED) {
  576|  19.9k|    if (entity != NULL)
  ------------------
  |  Branch (576:9): [True: 19.9k, False: 0]
  ------------------
  577|  19.9k|	xmlFreeEntity((xmlEntityPtr) entity);
  578|  19.9k|}
entities.c:xmlCopyEntity:
  600|  2.72k|xmlCopyEntity(void *payload, const xmlChar *name ATTRIBUTE_UNUSED) {
  601|  2.72k|    xmlEntityPtr ent = (xmlEntityPtr) payload;
  602|  2.72k|    xmlEntityPtr cur;
  603|       |
  604|  2.72k|    cur = (xmlEntityPtr) xmlMalloc(sizeof(xmlEntity));
  605|  2.72k|    if (cur == NULL)
  ------------------
  |  Branch (605:9): [True: 7, False: 2.71k]
  ------------------
  606|      7|	return(NULL);
  607|  2.71k|    memset(cur, 0, sizeof(xmlEntity));
  608|  2.71k|    cur->type = XML_ENTITY_DECL;
  609|       |
  610|  2.71k|    cur->etype = ent->etype;
  611|  2.71k|    if (ent->name != NULL) {
  ------------------
  |  Branch (611:9): [True: 2.71k, False: 0]
  ------------------
  612|  2.71k|	cur->name = xmlStrdup(ent->name);
  613|  2.71k|        if (cur->name == NULL)
  ------------------
  |  Branch (613:13): [True: 6, False: 2.70k]
  ------------------
  614|      6|            goto error;
  615|  2.71k|    }
  616|  2.70k|    if (ent->ExternalID != NULL) {
  ------------------
  |  Branch (616:9): [True: 163, False: 2.54k]
  ------------------
  617|    163|	cur->ExternalID = xmlStrdup(ent->ExternalID);
  618|    163|        if (cur->ExternalID == NULL)
  ------------------
  |  Branch (618:13): [True: 1, False: 162]
  ------------------
  619|      1|            goto error;
  620|    163|    }
  621|  2.70k|    if (ent->SystemID != NULL) {
  ------------------
  |  Branch (621:9): [True: 980, False: 1.72k]
  ------------------
  622|    980|	cur->SystemID = xmlStrdup(ent->SystemID);
  623|    980|        if (cur->SystemID == NULL)
  ------------------
  |  Branch (623:13): [True: 2, False: 978]
  ------------------
  624|      2|            goto error;
  625|    980|    }
  626|  2.70k|    if (ent->content != NULL) {
  ------------------
  |  Branch (626:9): [True: 1.90k, False: 801]
  ------------------
  627|  1.90k|	cur->content = xmlStrdup(ent->content);
  628|  1.90k|        if (cur->content == NULL)
  ------------------
  |  Branch (628:13): [True: 2, False: 1.90k]
  ------------------
  629|      2|            goto error;
  630|  1.90k|    }
  631|  2.70k|    if (ent->orig != NULL) {
  ------------------
  |  Branch (631:9): [True: 2.00k, False: 699]
  ------------------
  632|  2.00k|	cur->orig = xmlStrdup(ent->orig);
  633|  2.00k|        if (cur->orig == NULL)
  ------------------
  |  Branch (633:13): [True: 5, False: 1.99k]
  ------------------
  634|      5|            goto error;
  635|  2.00k|    }
  636|  2.69k|    if (ent->URI != NULL) {
  ------------------
  |  Branch (636:9): [True: 977, False: 1.72k]
  ------------------
  637|    977|	cur->URI = xmlStrdup(ent->URI);
  638|    977|        if (cur->URI == NULL)
  ------------------
  |  Branch (638:13): [True: 1, False: 976]
  ------------------
  639|      1|            goto error;
  640|    977|    }
  641|       |    /* Handle XML_TEXT_NODE children for XML_ENTITY_DECL */
  642|  2.69k|    if (ent->children != NULL) {
  ------------------
  |  Branch (642:9): [True: 528, False: 2.16k]
  ------------------
  643|    528|        cur->children = xmlStaticCopyNodeList(ent->children, cur->doc, (xmlNodePtr)cur);
  644|       |        /* Update last pointers */
  645|    528|        cur->last = cur->children;
  646|  1.80k|        while (cur->last && cur->last->next) cur->last = cur->last->next;
  ------------------
  |  Branch (646:16): [True: 1.79k, False: 8]
  |  Branch (646:29): [True: 1.27k, False: 520]
  ------------------
  647|    528|    }
  648|       |
  649|  2.69k|    return(cur);
  650|       |
  651|     17|error:
  652|     17|    xmlFreeEntity(cur);
  653|       |    return(NULL);
  654|  2.69k|}

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

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

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|  31.7k|LLVMFuzzerTestOneInput(const char *data, size_t size) {
  105|  31.7k|    xmlTextReaderPtr reader;
  106|  31.7k|    xmlDocPtr doc = NULL;
  107|  31.7k|    const xmlError *error;
  108|  31.7k|    const char *docBuffer;
  109|  31.7k|    const unsigned char *program;
  110|  31.7k|    size_t failurePos, docSize, programSize, i;
  111|  31.7k|    size_t totalStringSize = 0;
  112|  31.7k|    int opts;
  113|  31.7k|    int oomReport = 0;
  114|       |
  115|  31.7k|    xmlFuzzDataInit(data, size);
  116|  31.7k|    opts = (int) xmlFuzzReadInt(4);
  117|  31.7k|    failurePos = xmlFuzzReadInt(4) % (size + 100);
  118|       |
  119|  31.7k|    program = (const unsigned char *) xmlFuzzReadString(&programSize);
  120|  31.7k|    if (programSize > 1000)
  ------------------
  |  Branch (120:9): [True: 43, False: 31.7k]
  ------------------
  121|     43|        programSize = 1000;
  122|       |
  123|  31.7k|    xmlFuzzReadEntities();
  124|  31.7k|    docBuffer = xmlFuzzMainEntity(&docSize);
  125|  31.7k|    if (docBuffer == NULL)
  ------------------
  |  Branch (125:9): [True: 100, False: 31.6k]
  ------------------
  126|    100|        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|  31.6k|    xmlFuzzInjectFailure(failurePos);
  142|  31.6k|    reader = xmlReaderForMemory(docBuffer, docSize, NULL, NULL, opts);
  143|  31.6k|    if (reader == NULL)
  ------------------
  |  Branch (143:9): [True: 48, False: 31.5k]
  ------------------
  144|     48|        goto exit;
  145|       |
  146|  31.5k|    xmlTextReaderSetStructuredErrorHandler(reader, xmlFuzzSErrorFunc, NULL);
  147|  31.5k|    xmlTextReaderSetResourceLoader(reader, xmlFuzzResourceLoader, NULL);
  148|       |
  149|  31.5k|    i = 0;
  150|   719k|    while (i < programSize) {
  ------------------
  |  Branch (150:12): [True: 688k, False: 30.5k]
  ------------------
  151|   688k|        int op = program[i++];
  152|       |
  153|   688k|#define READ_BYTE() (i < programSize ? program[i++] : 0)
  154|   688k|#define FREE_STRING(str) \
  155|   688k|    do { \
  156|   688k|        if (str != NULL) { \
  157|   688k|            totalStringSize += strlen((char *) str); \
  158|   688k|            xmlFree(str); \
  159|   688k|        } \
  160|   688k|    } while (0)
  161|       |
  162|   688k|        switch (op & 0x3F) {
  163|  43.5k|            case OP_READ:
  ------------------
  |  Branch (163:13): [True: 43.5k, False: 645k]
  ------------------
  164|   227k|            default:
  ------------------
  |  Branch (164:13): [True: 183k, False: 505k]
  ------------------
  165|   227k|                startOp("Read");
  166|   227k|                xmlTextReaderRead(reader);
  167|   227k|                break;
  168|       |
  169|  12.5k|            case OP_READ_INNER_XML: {
  ------------------
  |  Branch (169:13): [True: 12.5k, False: 676k]
  ------------------
  170|  12.5k|                xmlChar *result;
  171|       |
  172|  12.5k|                startOp("ReadInnerXml");
  173|  12.5k|                result = xmlTextReaderReadInnerXml(reader);
  174|  12.5k|                FREE_STRING(result);
  ------------------
  |  |  155|  12.5k|    do { \
  |  |  156|  12.5k|        if (str != NULL) { \
  |  |  ------------------
  |  |  |  Branch (156:13): [True: 7.42k, False: 5.16k]
  |  |  ------------------
  |  |  157|  7.42k|            totalStringSize += strlen((char *) str); \
  |  |  158|  7.42k|            xmlFree(str); \
  |  |  159|  7.42k|        } \
  |  |  160|  12.5k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (160:14): [Folded, False: 12.5k]
  |  |  ------------------
  ------------------
  175|  12.5k|                break;
  176|  43.5k|            }
  177|       |
  178|  31.3k|            case OP_READ_OUTER_XML: {
  ------------------
  |  Branch (178:13): [True: 31.3k, False: 657k]
  ------------------
  179|  31.3k|                xmlChar *result;
  180|       |
  181|  31.3k|                startOp("ReadOuterXml");
  182|  31.3k|                result = xmlTextReaderReadOuterXml(reader);
  183|  31.3k|                FREE_STRING(result);
  ------------------
  |  |  155|  31.3k|    do { \
  |  |  156|  31.3k|        if (str != NULL) { \
  |  |  ------------------
  |  |  |  Branch (156:13): [True: 21.6k, False: 9.75k]
  |  |  ------------------
  |  |  157|  21.6k|            totalStringSize += strlen((char *) str); \
  |  |  158|  21.6k|            xmlFree(str); \
  |  |  159|  21.6k|        } \
  |  |  160|  31.3k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (160:14): [Folded, False: 31.3k]
  |  |  ------------------
  ------------------
  184|  31.3k|                break;
  185|  43.5k|            }
  186|       |
  187|  8.38k|            case OP_READ_STRING: {
  ------------------
  |  Branch (187:13): [True: 8.38k, False: 680k]
  ------------------
  188|  8.38k|                xmlChar *result;
  189|       |
  190|  8.38k|                startOp("ReadString");
  191|  8.38k|                result = xmlTextReaderReadString(reader);
  192|  8.38k|                FREE_STRING(result);
  ------------------
  |  |  155|  8.38k|    do { \
  |  |  156|  8.38k|        if (str != NULL) { \
  |  |  ------------------
  |  |  |  Branch (156:13): [True: 2.24k, False: 6.14k]
  |  |  ------------------
  |  |  157|  2.24k|            totalStringSize += strlen((char *) str); \
  |  |  158|  2.24k|            xmlFree(str); \
  |  |  159|  2.24k|        } \
  |  |  160|  8.38k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (160:14): [Folded, False: 8.38k]
  |  |  ------------------
  ------------------
  193|  8.38k|                break;
  194|  43.5k|            }
  195|       |
  196|  9.09k|            case OP_READ_ATTRIBUTE_VALUE:
  ------------------
  |  Branch (196:13): [True: 9.09k, False: 679k]
  ------------------
  197|  9.09k|                startOp("ReadAttributeValue");
  198|  9.09k|                xmlTextReaderReadAttributeValue(reader);
  199|  9.09k|                break;
  200|       |
  201|  8.25k|            case OP_ATTRIBUTE_COUNT:
  ------------------
  |  Branch (201:13): [True: 8.25k, False: 680k]
  ------------------
  202|  8.25k|                startOp("AttributeCount");
  203|  8.25k|                xmlTextReaderAttributeCount(reader);
  204|  8.25k|                break;
  205|       |
  206|  3.18k|            case OP_DEPTH:
  ------------------
  |  Branch (206:13): [True: 3.18k, False: 685k]
  ------------------
  207|  3.18k|                startOp("Depth");
  208|  3.18k|                xmlTextReaderDepth(reader);
  209|  3.18k|                break;
  210|       |
  211|  3.15k|            case OP_HAS_ATTRIBUTES:
  ------------------
  |  Branch (211:13): [True: 3.15k, False: 685k]
  ------------------
  212|  3.15k|                startOp("HasAttributes");
  213|  3.15k|                xmlTextReaderHasAttributes(reader);
  214|  3.15k|                break;
  215|       |
  216|  11.1k|            case OP_HAS_VALUE:
  ------------------
  |  Branch (216:13): [True: 11.1k, False: 677k]
  ------------------
  217|  11.1k|                startOp("HasValue");
  218|  11.1k|                xmlTextReaderHasValue(reader);
  219|  11.1k|                break;
  220|       |
  221|  5.54k|            case OP_IS_DEFAULT:
  ------------------
  |  Branch (221:13): [True: 5.54k, False: 683k]
  ------------------
  222|  5.54k|                startOp("IsDefault");
  223|  5.54k|                xmlTextReaderIsDefault(reader);
  224|  5.54k|                break;
  225|       |
  226|  8.72k|            case OP_IS_EMPTY_ELEMENT:
  ------------------
  |  Branch (226:13): [True: 8.72k, False: 680k]
  ------------------
  227|  8.72k|                startOp("IsEmptyElement");
  228|  8.72k|                xmlTextReaderIsEmptyElement(reader);
  229|  8.72k|                break;
  230|       |
  231|  10.0k|            case OP_NODE_TYPE:
  ------------------
  |  Branch (231:13): [True: 10.0k, False: 678k]
  ------------------
  232|  10.0k|                startOp("NodeType");
  233|  10.0k|                xmlTextReaderNodeType(reader);
  234|  10.0k|                break;
  235|       |
  236|  3.03k|            case OP_QUOTE_CHAR:
  ------------------
  |  Branch (236:13): [True: 3.03k, False: 685k]
  ------------------
  237|  3.03k|                startOp("QuoteChar");
  238|  3.03k|                xmlTextReaderQuoteChar(reader);
  239|  3.03k|                break;
  240|       |
  241|  5.17k|            case OP_READ_STATE:
  ------------------
  |  Branch (241:13): [True: 5.17k, False: 683k]
  ------------------
  242|  5.17k|                startOp("ReadState");
  243|  5.17k|                xmlTextReaderReadState(reader);
  244|  5.17k|                break;
  245|       |
  246|  3.89k|            case OP_IS_NAMESPACE_DECL:
  ------------------
  |  Branch (246:13): [True: 3.89k, False: 684k]
  ------------------
  247|  3.89k|                startOp("IsNamespaceDecl");
  248|  3.89k|                xmlTextReaderIsNamespaceDecl(reader);
  249|  3.89k|                break;
  250|       |
  251|  40.3k|            case OP_CONST_BASE_URI:
  ------------------
  |  Branch (251:13): [True: 40.3k, False: 648k]
  ------------------
  252|  40.3k|                startOp("ConstBaseUri");
  253|  40.3k|                xmlTextReaderConstBaseUri(reader);
  254|  40.3k|                break;
  255|       |
  256|  2.01k|            case OP_CONST_LOCAL_NAME:
  ------------------
  |  Branch (256:13): [True: 2.01k, False: 686k]
  ------------------
  257|  2.01k|                startOp("ConstLocalName");
  258|  2.01k|                xmlTextReaderConstLocalName(reader);
  259|  2.01k|                break;
  260|       |
  261|  7.55k|            case OP_CONST_NAME:
  ------------------
  |  Branch (261:13): [True: 7.55k, False: 681k]
  ------------------
  262|  7.55k|                startOp("ConstName");
  263|  7.55k|                xmlTextReaderConstName(reader);
  264|  7.55k|                break;
  265|       |
  266|  5.29k|            case OP_CONST_NAMESPACE_URI:
  ------------------
  |  Branch (266:13): [True: 5.29k, False: 683k]
  ------------------
  267|  5.29k|                startOp("ConstNamespaceUri");
  268|  5.29k|                xmlTextReaderConstNamespaceUri(reader);
  269|  5.29k|                break;
  270|       |
  271|  11.8k|            case OP_CONST_PREFIX:
  ------------------
  |  Branch (271:13): [True: 11.8k, False: 677k]
  ------------------
  272|  11.8k|                startOp("ConstPrefix");
  273|  11.8k|                xmlTextReaderConstPrefix(reader);
  274|  11.8k|                break;
  275|       |
  276|  6.25k|            case OP_CONST_XML_LANG:
  ------------------
  |  Branch (276:13): [True: 6.25k, False: 682k]
  ------------------
  277|  6.25k|                startOp("ConstXmlLang");
  278|  6.25k|                xmlTextReaderConstXmlLang(reader);
  279|  6.25k|                oomReport = -1;
  280|  6.25k|                break;
  281|       |
  282|  5.93k|            case OP_CONST_VALUE:
  ------------------
  |  Branch (282:13): [True: 5.93k, False: 682k]
  ------------------
  283|  5.93k|                startOp("ConstValue");
  284|  5.93k|                xmlTextReaderConstValue(reader);
  285|  5.93k|                break;
  286|       |
  287|  7.81k|            case OP_BASE_URI: {
  ------------------
  |  Branch (287:13): [True: 7.81k, False: 681k]
  ------------------
  288|  7.81k|                xmlChar *result;
  289|       |
  290|  7.81k|                startOp("BaseUri");
  291|  7.81k|                result = xmlTextReaderBaseUri(reader);
  292|  7.81k|                FREE_STRING(result);
  ------------------
  |  |  155|  7.81k|    do { \
  |  |  156|  7.81k|        if (str != NULL) { \
  |  |  ------------------
  |  |  |  Branch (156:13): [True: 2.02k, False: 5.79k]
  |  |  ------------------
  |  |  157|  2.02k|            totalStringSize += strlen((char *) str); \
  |  |  158|  2.02k|            xmlFree(str); \
  |  |  159|  2.02k|        } \
  |  |  160|  7.81k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (160:14): [Folded, False: 7.81k]
  |  |  ------------------
  ------------------
  293|  7.81k|                break;
  294|  43.5k|            }
  295|       |
  296|  5.20k|            case OP_LOCAL_NAME: {
  ------------------
  |  Branch (296:13): [True: 5.20k, False: 683k]
  ------------------
  297|  5.20k|                xmlChar *result;
  298|       |
  299|  5.20k|                startOp("LocalName");
  300|  5.20k|                result = xmlTextReaderLocalName(reader);
  301|  5.20k|                FREE_STRING(result);
  ------------------
  |  |  155|  5.20k|    do { \
  |  |  156|  5.20k|        if (str != NULL) { \
  |  |  ------------------
  |  |  |  Branch (156:13): [True: 3.50k, False: 1.69k]
  |  |  ------------------
  |  |  157|  3.50k|            totalStringSize += strlen((char *) str); \
  |  |  158|  3.50k|            xmlFree(str); \
  |  |  159|  3.50k|        } \
  |  |  160|  5.20k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (160:14): [Folded, False: 5.20k]
  |  |  ------------------
  ------------------
  302|  5.20k|                break;
  303|  43.5k|            }
  304|       |
  305|  5.60k|            case OP_NAME: {
  ------------------
  |  Branch (305:13): [True: 5.60k, False: 683k]
  ------------------
  306|  5.60k|                xmlChar *result;
  307|       |
  308|  5.60k|                startOp("Name");
  309|  5.60k|                result = xmlTextReaderName(reader);
  310|  5.60k|                FREE_STRING(result);
  ------------------
  |  |  155|  5.60k|    do { \
  |  |  156|  5.60k|        if (str != NULL) { \
  |  |  ------------------
  |  |  |  Branch (156:13): [True: 3.58k, False: 2.01k]
  |  |  ------------------
  |  |  157|  3.58k|            totalStringSize += strlen((char *) str); \
  |  |  158|  3.58k|            xmlFree(str); \
  |  |  159|  3.58k|        } \
  |  |  160|  5.60k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (160:14): [Folded, False: 5.60k]
  |  |  ------------------
  ------------------
  311|  5.60k|                break;
  312|  43.5k|            }
  313|       |
  314|  3.44k|            case OP_NAMESPACE_URI: {
  ------------------
  |  Branch (314:13): [True: 3.44k, False: 685k]
  ------------------
  315|  3.44k|                xmlChar *result;
  316|       |
  317|  3.44k|                startOp("NamespaceUri");
  318|  3.44k|                result = xmlTextReaderNamespaceUri(reader);
  319|  3.44k|                FREE_STRING(result);
  ------------------
  |  |  155|  3.44k|    do { \
  |  |  156|  3.44k|        if (str != NULL) { \
  |  |  ------------------
  |  |  |  Branch (156:13): [True: 421, False: 3.01k]
  |  |  ------------------
  |  |  157|    421|            totalStringSize += strlen((char *) str); \
  |  |  158|    421|            xmlFree(str); \
  |  |  159|    421|        } \
  |  |  160|  3.44k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (160:14): [Folded, False: 3.44k]
  |  |  ------------------
  ------------------
  320|  3.44k|                break;
  321|  43.5k|            }
  322|       |
  323|  4.26k|            case OP_PREFIX: {
  ------------------
  |  Branch (323:13): [True: 4.26k, False: 684k]
  ------------------
  324|  4.26k|                xmlChar *result;
  325|       |
  326|  4.26k|                startOp("Prefix");
  327|  4.26k|                result = xmlTextReaderPrefix(reader);
  328|  4.26k|                FREE_STRING(result);
  ------------------
  |  |  155|  4.26k|    do { \
  |  |  156|  4.26k|        if (str != NULL) { \
  |  |  ------------------
  |  |  |  Branch (156:13): [True: 624, False: 3.63k]
  |  |  ------------------
  |  |  157|    624|            totalStringSize += strlen((char *) str); \
  |  |  158|    624|            xmlFree(str); \
  |  |  159|    624|        } \
  |  |  160|  4.26k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (160:14): [Folded, False: 4.26k]
  |  |  ------------------
  ------------------
  329|  4.26k|                break;
  330|  43.5k|            }
  331|       |
  332|  2.97k|            case OP_XML_LANG: {
  ------------------
  |  Branch (332:13): [True: 2.97k, False: 685k]
  ------------------
  333|  2.97k|                xmlChar *result;
  334|       |
  335|  2.97k|                startOp("XmlLang");
  336|  2.97k|                result = xmlTextReaderXmlLang(reader);
  337|  2.97k|                oomReport = -1;
  338|  2.97k|                FREE_STRING(result);
  ------------------
  |  |  155|  2.97k|    do { \
  |  |  156|  2.97k|        if (str != NULL) { \
  |  |  ------------------
  |  |  |  Branch (156:13): [True: 58, False: 2.92k]
  |  |  ------------------
  |  |  157|     58|            totalStringSize += strlen((char *) str); \
  |  |  158|     58|            xmlFree(str); \
  |  |  159|     58|        } \
  |  |  160|  2.97k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (160:14): [Folded, False: 2.97k]
  |  |  ------------------
  ------------------
  339|  2.97k|                break;
  340|  43.5k|            }
  341|       |
  342|  9.59k|            case OP_VALUE: {
  ------------------
  |  Branch (342:13): [True: 9.59k, False: 679k]
  ------------------
  343|  9.59k|                xmlChar *result;
  344|       |
  345|  9.59k|                startOp("Value");
  346|  9.59k|                result = xmlTextReaderValue(reader);
  347|  9.59k|                FREE_STRING(result);
  ------------------
  |  |  155|  9.59k|    do { \
  |  |  156|  9.59k|        if (str != NULL) { \
  |  |  ------------------
  |  |  |  Branch (156:13): [True: 2.68k, False: 6.91k]
  |  |  ------------------
  |  |  157|  2.68k|            totalStringSize += strlen((char *) str); \
  |  |  158|  2.68k|            xmlFree(str); \
  |  |  159|  2.68k|        } \
  |  |  160|  9.59k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (160:14): [Folded, False: 9.59k]
  |  |  ------------------
  ------------------
  348|  9.59k|                break;
  349|  43.5k|            }
  350|       |
  351|  1.65k|            case OP_CLOSE:
  ------------------
  |  Branch (351:13): [True: 1.65k, False: 687k]
  ------------------
  352|  1.65k|                startOp("Close");
  353|  1.65k|                if (doc == NULL)
  ------------------
  |  Branch (353:21): [True: 524, False: 1.13k]
  ------------------
  354|    524|                    doc = xmlTextReaderCurrentDoc(reader);
  355|  1.65k|                xmlTextReaderClose(reader);
  356|  1.65k|                break;
  357|       |
  358|  4.97k|            case OP_GET_ATTRIBUTE_NO: {
  ------------------
  |  Branch (358:13): [True: 4.97k, False: 683k]
  ------------------
  359|  4.97k|                xmlChar *result;
  360|  4.97k|                int no = READ_BYTE();
  ------------------
  |  |  153|  4.97k|#define READ_BYTE() (i < programSize ? program[i++] : 0)
  |  |  ------------------
  |  |  |  Branch (153:22): [True: 4.90k, False: 73]
  |  |  ------------------
  ------------------
  361|       |
  362|  4.97k|                startOp("GetAttributeNo");
  363|  4.97k|                result = xmlTextReaderGetAttributeNo(reader, no);
  364|  4.97k|                FREE_STRING(result);
  ------------------
  |  |  155|  4.97k|    do { \
  |  |  156|  4.97k|        if (str != NULL) { \
  |  |  ------------------
  |  |  |  Branch (156:13): [True: 403, False: 4.57k]
  |  |  ------------------
  |  |  157|    403|            totalStringSize += strlen((char *) str); \
  |  |  158|    403|            xmlFree(str); \
  |  |  159|    403|        } \
  |  |  160|  4.97k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (160:14): [Folded, False: 4.97k]
  |  |  ------------------
  ------------------
  365|  4.97k|                break;
  366|  43.5k|            }
  367|       |
  368|  26.2k|            case OP_GET_ATTRIBUTE: {
  ------------------
  |  Branch (368:13): [True: 26.2k, False: 662k]
  ------------------
  369|  26.2k|                const xmlChar *name = xmlTextReaderConstName(reader);
  370|  26.2k|                xmlChar *result;
  371|       |
  372|  26.2k|                startOp("GetAttribute");
  373|  26.2k|                result = xmlTextReaderGetAttribute(reader, name);
  374|  26.2k|                FREE_STRING(result);
  ------------------
  |  |  155|  26.2k|    do { \
  |  |  156|  26.2k|        if (str != NULL) { \
  |  |  ------------------
  |  |  |  Branch (156:13): [True: 855, False: 25.3k]
  |  |  ------------------
  |  |  157|    855|            totalStringSize += strlen((char *) str); \
  |  |  158|    855|            xmlFree(str); \
  |  |  159|    855|        } \
  |  |  160|  26.2k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (160:14): [Folded, False: 26.2k]
  |  |  ------------------
  ------------------
  375|  26.2k|                break;
  376|  43.5k|            }
  377|       |
  378|  23.7k|            case OP_GET_ATTRIBUTE_NS: {
  ------------------
  |  Branch (378:13): [True: 23.7k, False: 665k]
  ------------------
  379|  23.7k|                const xmlChar *localName, *namespaceUri;
  380|  23.7k|                xmlChar *result;
  381|       |
  382|  23.7k|                startOp("GetAttributeNs");
  383|  23.7k|                localName = xmlTextReaderConstLocalName(reader);
  384|  23.7k|                namespaceUri = xmlTextReaderConstNamespaceUri(reader);
  385|  23.7k|                result = xmlTextReaderGetAttributeNs(reader, localName,
  386|  23.7k|                                                     namespaceUri);
  387|  23.7k|                FREE_STRING(result);
  ------------------
  |  |  155|  23.7k|    do { \
  |  |  156|  23.7k|        if (str != NULL) { \
  |  |  ------------------
  |  |  |  Branch (156:13): [True: 831, False: 22.8k]
  |  |  ------------------
  |  |  157|    831|            totalStringSize += strlen((char *) str); \
  |  |  158|    831|            xmlFree(str); \
  |  |  159|    831|        } \
  |  |  160|  23.7k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (160:14): [Folded, False: 23.7k]
  |  |  ------------------
  ------------------
  388|  23.7k|                break;
  389|  43.5k|            }
  390|       |
  391|  3.55k|            case OP_GET_REMAINDER:
  ------------------
  |  Branch (391:13): [True: 3.55k, False: 685k]
  ------------------
  392|  3.55k|                startOp("GetRemainder");
  393|  3.55k|                if (doc == NULL)
  ------------------
  |  Branch (393:21): [True: 1.61k, False: 1.93k]
  ------------------
  394|  1.61k|                    doc = xmlTextReaderCurrentDoc(reader);
  395|  3.55k|                xmlFreeParserInputBuffer(xmlTextReaderGetRemainder(reader));
  396|  3.55k|                break;
  397|       |
  398|  8.12k|            case OP_LOOKUP_NAMESPACE: {
  ------------------
  |  Branch (398:13): [True: 8.12k, False: 680k]
  ------------------
  399|  8.12k|                const xmlChar *prefix = xmlTextReaderConstPrefix(reader);
  400|  8.12k|                xmlChar *result;
  401|       |
  402|  8.12k|                startOp("LookupNamespace");
  403|  8.12k|                result = xmlTextReaderLookupNamespace(reader, prefix);
  404|  8.12k|                FREE_STRING(result);
  ------------------
  |  |  155|  8.12k|    do { \
  |  |  156|  8.12k|        if (str != NULL) { \
  |  |  ------------------
  |  |  |  Branch (156:13): [True: 1.21k, False: 6.91k]
  |  |  ------------------
  |  |  157|  1.21k|            totalStringSize += strlen((char *) str); \
  |  |  158|  1.21k|            xmlFree(str); \
  |  |  159|  1.21k|        } \
  |  |  160|  8.12k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (160:14): [Folded, False: 8.12k]
  |  |  ------------------
  ------------------
  405|  8.12k|                break;
  406|  43.5k|            }
  407|       |
  408|  6.60k|            case OP_MOVE_TO_ATTRIBUTE_NO: {
  ------------------
  |  Branch (408:13): [True: 6.60k, False: 682k]
  ------------------
  409|  6.60k|                int no = READ_BYTE();
  ------------------
  |  |  153|  6.60k|#define READ_BYTE() (i < programSize ? program[i++] : 0)
  |  |  ------------------
  |  |  |  Branch (153:22): [True: 6.54k, False: 65]
  |  |  ------------------
  ------------------
  410|       |
  411|  6.60k|                startOp("MoveToAttributeNo");
  412|  6.60k|                xmlTextReaderMoveToAttributeNo(reader, no);
  413|  6.60k|                break;
  414|  43.5k|            }
  415|       |
  416|  12.0k|            case OP_MOVE_TO_ATTRIBUTE: {
  ------------------
  |  Branch (416:13): [True: 12.0k, False: 676k]
  ------------------
  417|  12.0k|                const xmlChar *name = xmlTextReaderConstName(reader);
  418|       |
  419|  12.0k|                startOp("MoveToAttribute");
  420|  12.0k|                xmlTextReaderMoveToAttribute(reader, name);
  421|  12.0k|                break;
  422|  43.5k|            }
  423|       |
  424|  8.38k|            case OP_MOVE_TO_ATTRIBUTE_NS: {
  ------------------
  |  Branch (424:13): [True: 8.38k, False: 680k]
  ------------------
  425|  8.38k|                const xmlChar *localName, *namespaceUri;
  426|       |
  427|  8.38k|                startOp("MoveToAttributeNs");
  428|  8.38k|                localName = xmlTextReaderConstLocalName(reader);
  429|  8.38k|                namespaceUri = xmlTextReaderConstNamespaceUri(reader);
  430|  8.38k|                xmlTextReaderMoveToAttributeNs(reader, localName,
  431|  8.38k|                                               namespaceUri);
  432|  8.38k|                break;
  433|  43.5k|            }
  434|       |
  435|  10.8k|            case OP_MOVE_TO_FIRST_ATTRIBUTE:
  ------------------
  |  Branch (435:13): [True: 10.8k, False: 678k]
  ------------------
  436|  10.8k|                startOp("MoveToFirstAttribute");
  437|  10.8k|                xmlTextReaderMoveToFirstAttribute(reader);
  438|  10.8k|                break;
  439|       |
  440|  6.89k|            case OP_MOVE_TO_NEXT_ATTRIBUTE:
  ------------------
  |  Branch (440:13): [True: 6.89k, False: 681k]
  ------------------
  441|  6.89k|                startOp("MoveToNextAttribute");
  442|  6.89k|                xmlTextReaderMoveToNextAttribute(reader);
  443|  6.89k|                break;
  444|       |
  445|  5.38k|            case OP_MOVE_TO_ELEMENT:
  ------------------
  |  Branch (445:13): [True: 5.38k, False: 683k]
  ------------------
  446|  5.38k|                startOp("MoveToElement");
  447|  5.38k|                xmlTextReaderMoveToElement(reader);
  448|  5.38k|                break;
  449|       |
  450|  2.71k|            case OP_NORMALIZATION:
  ------------------
  |  Branch (450:13): [True: 2.71k, False: 686k]
  ------------------
  451|  2.71k|                startOp("Normalization");
  452|  2.71k|                xmlTextReaderNormalization(reader);
  453|  2.71k|                break;
  454|       |
  455|  3.74k|            case OP_CONST_ENCODING:
  ------------------
  |  Branch (455:13): [True: 3.74k, False: 685k]
  ------------------
  456|  3.74k|                startOp("ConstEncoding");
  457|  3.74k|                xmlTextReaderConstEncoding(reader);
  458|  3.74k|                break;
  459|       |
  460|  7.03k|            case OP_GET_PARSER_PROP: {
  ------------------
  |  Branch (460:13): [True: 7.03k, False: 681k]
  ------------------
  461|  7.03k|                int prop = READ_BYTE();
  ------------------
  |  |  153|  7.03k|#define READ_BYTE() (i < programSize ? program[i++] : 0)
  |  |  ------------------
  |  |  |  Branch (153:22): [True: 6.84k, False: 189]
  |  |  ------------------
  ------------------
  462|       |
  463|  7.03k|                startOp("GetParserProp");
  464|  7.03k|                xmlTextReaderGetParserProp(reader, prop);
  465|  7.03k|                break;
  466|  43.5k|            }
  467|       |
  468|  11.7k|            case OP_CURRENT_NODE:
  ------------------
  |  Branch (468:13): [True: 11.7k, False: 677k]
  ------------------
  469|  11.7k|                startOp("CurrentNode");
  470|  11.7k|                xmlTextReaderCurrentNode(reader);
  471|  11.7k|                break;
  472|       |
  473|  5.12k|            case OP_GET_PARSER_LINE_NUMBER:
  ------------------
  |  Branch (473:13): [True: 5.12k, False: 683k]
  ------------------
  474|  5.12k|                startOp("GetParserLineNumber");
  475|  5.12k|                xmlTextReaderGetParserLineNumber(reader);
  476|  5.12k|                break;
  477|       |
  478|  8.82k|            case OP_GET_PARSER_COLUMN_NUMBER:
  ------------------
  |  Branch (478:13): [True: 8.82k, False: 680k]
  ------------------
  479|  8.82k|                startOp("GetParserColumnNumber");
  480|  8.82k|                xmlTextReaderGetParserColumnNumber(reader);
  481|  8.82k|                break;
  482|       |
  483|  7.39k|            case OP_PRESERVE:
  ------------------
  |  Branch (483:13): [True: 7.39k, False: 681k]
  ------------------
  484|  7.39k|                startOp("Preserve");
  485|  7.39k|                xmlTextReaderPreserve(reader);
  486|  7.39k|                break;
  487|       |
  488|  5.96k|            case OP_CURRENT_DOC: {
  ------------------
  |  Branch (488:13): [True: 5.96k, False: 682k]
  ------------------
  489|  5.96k|                xmlDocPtr result;
  490|       |
  491|  5.96k|                startOp("CurrentDoc");
  492|  5.96k|                result = xmlTextReaderCurrentDoc(reader);
  493|  5.96k|                if (doc == NULL)
  ------------------
  |  Branch (493:21): [True: 2.46k, False: 3.50k]
  ------------------
  494|  2.46k|                    doc = result;
  495|  5.96k|                break;
  496|  43.5k|            }
  497|       |
  498|  7.77k|            case OP_EXPAND:
  ------------------
  |  Branch (498:13): [True: 7.77k, False: 681k]
  ------------------
  499|  7.77k|                startOp("Expand");
  500|  7.77k|                xmlTextReaderExpand(reader);
  501|  7.77k|                break;
  502|       |
  503|  17.9k|            case OP_NEXT:
  ------------------
  |  Branch (503:13): [True: 17.9k, False: 670k]
  ------------------
  504|  17.9k|                startOp("Next");
  505|  17.9k|                xmlTextReaderNext(reader);
  506|  17.9k|                break;
  507|       |
  508|  7.11k|            case OP_NEXT_SIBLING:
  ------------------
  |  Branch (508:13): [True: 7.11k, False: 681k]
  ------------------
  509|  7.11k|                startOp("NextSibling");
  510|  7.11k|                xmlTextReaderNextSibling(reader);
  511|  7.11k|                break;
  512|       |
  513|  3.31k|            case OP_IS_VALID:
  ------------------
  |  Branch (513:13): [True: 3.31k, False: 685k]
  ------------------
  514|  3.31k|                startOp("IsValid");
  515|  3.31k|                xmlTextReaderIsValid(reader);
  516|  3.31k|                break;
  517|       |
  518|  3.77k|            case OP_CONST_XML_VERSION:
  ------------------
  |  Branch (518:13): [True: 3.77k, False: 685k]
  ------------------
  519|  3.77k|                startOp("ConstXmlVersion");
  520|  3.77k|                xmlTextReaderConstXmlVersion(reader);
  521|  3.77k|                break;
  522|       |
  523|  3.58k|            case OP_STANDALONE:
  ------------------
  |  Branch (523:13): [True: 3.58k, False: 685k]
  ------------------
  524|  3.58k|                startOp("Standalone");
  525|  3.58k|                xmlTextReaderStandalone(reader);
  526|  3.58k|                break;
  527|       |
  528|  5.37k|            case OP_BYTE_CONSUMED:
  ------------------
  |  Branch (528:13): [True: 5.37k, False: 683k]
  ------------------
  529|  5.37k|                startOp("ByteConsumed");
  530|  5.37k|                xmlTextReaderByteConsumed(reader);
  531|  5.37k|                oomReport = -1;
  532|  5.37k|                break;
  533|   688k|        }
  534|       |
  535|   688k|        if (totalStringSize > docSize * 2)
  ------------------
  |  Branch (535:13): [True: 1.09k, False: 687k]
  ------------------
  536|  1.09k|            break;
  537|   688k|    }
  538|       |
  539|  31.5k|    error = xmlTextReaderGetLastError(reader);
  540|  31.5k|    if (error->code == XML_ERR_NO_MEMORY)
  ------------------
  |  Branch (540:9): [True: 7.80k, False: 23.7k]
  ------------------
  541|  7.80k|        oomReport = 1;
  542|  31.5k|    xmlFuzzCheckFailureReport("reader", oomReport, error->code == XML_IO_EIO);
  543|       |
  544|  31.5k|    xmlFreeTextReader(reader);
  545|       |
  546|  31.5k|    if (doc != NULL)
  ------------------
  |  Branch (546:9): [True: 3.22k, False: 28.3k]
  ------------------
  547|  3.22k|        xmlFreeDoc(doc);
  548|       |
  549|  31.7k|exit:
  550|  31.7k|    xmlFuzzInjectFailure(0);
  551|  31.7k|    xmlFuzzDataCleanup();
  552|  31.7k|    xmlResetLastError();
  553|  31.7k|    return(0);
  554|  31.5k|}
reader.c:startOp:
   83|   688k|startOp(const char *name) {
   84|   688k|    (void) name;
   85|       |#ifdef DEBUG
   86|       |    fprintf(stderr, "%s\n", name);
   87|       |#endif
   88|   688k|}

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|  39.0k|__xmlDoValidityCheckingDefaultValue(void) {
  634|  39.0k|    return(&xmlGetThreadLocalStorage(0)->doValidityCheckingDefaultValue);
  635|  39.0k|}
__xmlGetWarningsDefaultValue:
  638|   599k|__xmlGetWarningsDefaultValue(void) {
  639|   599k|    return(&xmlGetThreadLocalStorage(0)->getWarningsDefaultValue);
  640|   599k|}
__xmlKeepBlanksDefaultValue:
  643|  39.0k|__xmlKeepBlanksDefaultValue(void) {
  644|  39.0k|    return(&xmlGetThreadLocalStorage(0)->keepBlanksDefaultValue);
  645|  39.0k|}
__xmlLoadExtDtdDefaultValue:
  653|  39.0k|__xmlLoadExtDtdDefaultValue(void) {
  654|  39.0k|    return(&xmlGetThreadLocalStorage(0)->loadExtDtdDefaultValue);
  655|  39.0k|}
__xmlPedanticParserDefaultValue:
  658|  39.0k|__xmlPedanticParserDefaultValue(void) {
  659|  39.0k|    return(&xmlGetThreadLocalStorage(0)->pedanticParserDefaultValue);
  660|  39.0k|}
__xmlSubstituteEntitiesDefaultValue:
  663|  39.0k|__xmlSubstituteEntitiesDefaultValue(void) {
  664|  39.0k|    return(&xmlGetThreadLocalStorage(0)->substituteEntitiesDefaultValue);
  665|  39.0k|}
__xmlTreeIndentString:
  674|  29.4k|__xmlTreeIndentString(void) {
  675|  29.4k|    return(&xmlGetThreadLocalStorage(0)->treeIndentString);
  676|  29.4k|}
__xmlSaveNoEmptyTags:
  679|  29.4k|__xmlSaveNoEmptyTags(void) {
  680|  29.4k|    return(&xmlGetThreadLocalStorage(0)->saveNoEmptyTags);
  681|  29.4k|}
__xmlStructuredError:
  695|   350k|__xmlStructuredError(void) {
  696|   350k|    return(&xmlGetThreadLocalStorage(0)->structuredError);
  697|   350k|}
xmlGetLocalRngState:
  755|   105k|xmlGetLocalRngState(void) {
  756|   105k|    return(xmlGetThreadLocalStorage(0)->localRngState);
  757|   105k|}
xmlGetLastErrorInternal:
  785|   623k|xmlGetLastErrorInternal(void) {
  786|   623k|    return(&xmlGetThreadLocalStorage(0)->lastError);
  787|   623k|}
globals.c:xmlPosixStrdup:
  200|   418k|xmlPosixStrdup(const char *cur) {
  201|   418k|    return((char*) xmlCharStrdup(cur));
  202|   418k|}
globals.c:xmlGetThreadLocalStorage:
  525|  1.93M|xmlGetThreadLocalStorage(int allowFailure) {
  526|  1.93M|    xmlGlobalState *gs;
  527|       |
  528|  1.93M|    (void) allowFailure;
  529|       |
  530|  1.93M|    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|  1.93M|    if (gs == NULL)
  ------------------
  |  Branch (538:9): [True: 1, False: 1.93M]
  ------------------
  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|  1.93M|    return(gs);
  549|  1.93M|}
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|  66.3k|xmlHashCreate(int size) {
  159|  66.3k|    xmlHashTablePtr hash;
  160|       |
  161|  66.3k|    xmlInitParser();
  162|       |
  163|  66.3k|    hash = xmlMalloc(sizeof(*hash));
  164|  66.3k|    if (hash == NULL)
  ------------------
  |  Branch (164:9): [True: 32, False: 66.2k]
  ------------------
  165|     32|        return(NULL);
  166|  66.2k|    hash->dict = NULL;
  167|  66.2k|    hash->size = 0;
  168|  66.2k|    hash->table = NULL;
  169|  66.2k|    hash->nbElems = 0;
  170|  66.2k|    hash->randomSeed = xmlRandom();
  171|  66.2k|#ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
  172|  66.2k|    hash->randomSeed = 0;
  173|  66.2k|#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|  66.2k|    if (size > MIN_HASH_SIZE) {
  ------------------
  |  |   30|  66.2k|#define MIN_HASH_SIZE 8
  ------------------
  |  Branch (180:9): [True: 5.45k, False: 60.8k]
  ------------------
  181|  5.45k|        unsigned newSize = MIN_HASH_SIZE * 2;
  ------------------
  |  |   30|  5.45k|#define MIN_HASH_SIZE 8
  ------------------
  182|       |
  183|  5.48k|        while ((newSize < (unsigned) size) && (newSize < MAX_HASH_SIZE))
  ------------------
  |  |   31|     34|#define MAX_HASH_SIZE (1u << 31)
  ------------------
  |  Branch (183:16): [True: 34, False: 5.45k]
  |  Branch (183:47): [True: 34, False: 0]
  ------------------
  184|     34|            newSize *= 2;
  185|       |
  186|  5.45k|        if (xmlHashGrow(hash, newSize) != 0) {
  ------------------
  |  Branch (186:13): [True: 6, False: 5.44k]
  ------------------
  187|      6|            xmlFree(hash);
  188|      6|            return(NULL);
  189|      6|        }
  190|  5.45k|    }
  191|       |
  192|  66.2k|    return(hash);
  193|  66.2k|}
xmlHashCreateDict:
  205|  22.9k|xmlHashCreateDict(int size, xmlDict *dict) {
  206|  22.9k|    xmlHashTablePtr hash;
  207|       |
  208|  22.9k|    hash = xmlHashCreate(size);
  209|  22.9k|    if (hash != NULL) {
  ------------------
  |  Branch (209:9): [True: 22.9k, False: 12]
  ------------------
  210|  22.9k|        hash->dict = dict;
  211|  22.9k|        xmlDictReference(dict);
  212|  22.9k|    }
  213|  22.9k|    return(hash);
  214|  22.9k|}
xmlHashFree:
  224|  82.4k|xmlHashFree(xmlHashTable *hash, xmlHashDeallocator dealloc) {
  225|  82.4k|    if (hash == NULL)
  ------------------
  |  Branch (225:9): [True: 16.1k, False: 66.2k]
  ------------------
  226|  16.1k|        return;
  227|       |
  228|  66.2k|    if (hash->table) {
  ------------------
  |  Branch (228:9): [True: 65.9k, False: 291]
  ------------------
  229|  65.9k|        const xmlHashEntry *end = &hash->table[hash->size];
  230|  65.9k|        const xmlHashEntry *entry;
  231|       |
  232|   701k|        for (entry = hash->table; entry < end; entry++) {
  ------------------
  |  Branch (232:35): [True: 635k, False: 65.9k]
  ------------------
  233|   635k|            if (entry->hashValue == 0)
  ------------------
  |  Branch (233:17): [True: 500k, False: 134k]
  ------------------
  234|   500k|                continue;
  235|   134k|            if ((dealloc != NULL) && (entry->payload != NULL))
  ------------------
  |  Branch (235:17): [True: 117k, False: 16.6k]
  |  Branch (235:38): [True: 117k, False: 0]
  ------------------
  236|   117k|                dealloc(entry->payload, entry->key);
  237|   134k|            if (hash->dict == NULL) {
  ------------------
  |  Branch (237:17): [True: 82.9k, False: 51.2k]
  ------------------
  238|  82.9k|                if (entry->key)
  ------------------
  |  Branch (238:21): [True: 82.9k, False: 0]
  ------------------
  239|  82.9k|                    xmlFree(entry->key);
  240|  82.9k|                if (entry->key2)
  ------------------
  |  Branch (240:21): [True: 5.78k, False: 77.2k]
  ------------------
  241|  5.78k|                    xmlFree(entry->key2);
  242|  82.9k|                if (entry->key3)
  ------------------
  |  Branch (242:21): [True: 15.6k, False: 67.3k]
  ------------------
  243|  15.6k|                    xmlFree(entry->key3);
  244|  82.9k|            }
  245|   134k|        }
  246|       |
  247|  65.9k|        xmlFree(hash->table);
  248|  65.9k|    }
  249|       |
  250|  66.2k|    if (hash->dict)
  ------------------
  |  Branch (250:9): [True: 15.3k, False: 50.9k]
  ------------------
  251|  15.3k|        xmlDictFree(hash->dict);
  252|       |
  253|  66.2k|    xmlFree(hash);
  254|  66.2k|}
xmlHashDefaultDeallocator:
  592|  46.0k|xmlHashDefaultDeallocator(void *entry, const xmlChar *key ATTRIBUTE_UNUSED) {
  593|  46.0k|    xmlFree(entry);
  594|  46.0k|}
xmlHashAdd:
  610|   113k|xmlHashAdd(xmlHashTable *hash, const xmlChar *key, void *payload) {
  611|   113k|    return(xmlHashUpdateInternal(hash, key, NULL, NULL, payload, NULL, 0));
  612|   113k|}
xmlHashAdd2:
  629|  46.6k|                 const xmlChar *key2, void *payload) {
  630|  46.6k|    return(xmlHashUpdateInternal(hash, key, key2, NULL, payload, NULL, 0));
  631|  46.6k|}
xmlHashAdd3:
  650|  59.4k|                 void *payload) {
  651|       |    return(xmlHashUpdateInternal(hash, key, key2, key3, payload, NULL, 0));
  652|  59.4k|}
xmlHashAddEntry:
  669|  45.5k|xmlHashAddEntry(xmlHashTable *hash, const xmlChar *key, void *payload) {
  670|  45.5k|    int res = xmlHashUpdateInternal(hash, key, NULL, NULL, payload, NULL, 0);
  671|       |
  672|  45.5k|    if (res == 0)
  ------------------
  |  Branch (672:9): [True: 0, False: 45.5k]
  ------------------
  673|      0|        res = -1;
  674|  45.5k|    else if (res == 1)
  ------------------
  |  Branch (674:14): [True: 45.5k, False: 4]
  ------------------
  675|  45.5k|        res = 0;
  676|       |
  677|  45.5k|    return(res);
  678|  45.5k|}
xmlHashUpdateEntry:
  742|    369|                   void *payload, xmlHashDeallocator dealloc) {
  743|    369|    int res = xmlHashUpdateInternal(hash, key, NULL, NULL, payload,
  744|    369|                                    dealloc, 1);
  745|       |
  746|    369|    if (res == 1)
  ------------------
  |  Branch (746:9): [True: 33, False: 336]
  ------------------
  747|     33|        res = 0;
  748|       |
  749|    369|    return(res);
  750|    369|}
xmlHashUpdateEntry2:
  767|  3.18k|                   xmlHashDeallocator dealloc) {
  768|  3.18k|    int res = xmlHashUpdateInternal(hash, key, key2, NULL, payload,
  769|  3.18k|                                    dealloc, 1);
  770|       |
  771|  3.18k|    if (res == 1)
  ------------------
  |  Branch (771:9): [True: 2.58k, False: 598]
  ------------------
  772|  2.58k|        res = 0;
  773|       |
  774|  3.18k|    return(res);
  775|  3.18k|}
xmlHashLookup:
  811|  2.43M|xmlHashLookup(xmlHashTable *hash, const xmlChar *key) {
  812|  2.43M|    return(xmlHashLookup3(hash, key, NULL, NULL));
  813|  2.43M|}
xmlHashLookup2:
  825|   807k|              const xmlChar *key2) {
  826|       |    return(xmlHashLookup3(hash, key, key2, NULL));
  827|   807k|}
xmlHashQLookup2:
  856|  25.6k|                const xmlChar *name2) {
  857|  25.6k|    return(xmlHashQLookup3(hash, prefix, name, prefix2, name2, NULL, NULL));
  858|  25.6k|}
xmlHashLookup3:
  871|  3.59M|               const xmlChar *key2, const xmlChar *key3) {
  872|  3.59M|    const xmlHashEntry *entry;
  873|  3.59M|    unsigned hashValue;
  874|  3.59M|    int found;
  875|       |
  876|  3.59M|    if ((hash == NULL) || (hash->size == 0) || (key == NULL))
  ------------------
  |  Branch (876:9): [True: 10.9k, False: 3.58M]
  |  Branch (876:27): [True: 41.9k, False: 3.54M]
  |  Branch (876:48): [True: 9, False: 3.54M]
  ------------------
  877|  52.8k|        return(NULL);
  878|  3.54M|    hashValue = xmlHashValue(hash->randomSeed, key, key2, key3, NULL);
  879|  3.54M|    entry = xmlHashFindEntry(hash, key, key2, key3, hashValue, &found);
  880|  3.54M|    if (found)
  ------------------
  |  Branch (880:9): [True: 2.73M, False: 808k]
  ------------------
  881|  2.73M|        return(entry->payload);
  882|   808k|    return(NULL);
  883|  3.54M|}
xmlHashQLookup3:
  902|  25.6k|                const xmlChar *prefix3, const xmlChar *name3) {
  903|  25.6k|    const xmlHashEntry *entry;
  904|  25.6k|    unsigned hashValue, mask, pos, displ;
  905|       |
  906|  25.6k|    if ((hash == NULL) || (hash->size == 0) || (name == NULL))
  ------------------
  |  Branch (906:9): [True: 0, False: 25.6k]
  |  Branch (906:27): [True: 0, False: 25.6k]
  |  Branch (906:48): [True: 0, False: 25.6k]
  ------------------
  907|      0|        return(NULL);
  908|       |
  909|  25.6k|    hashValue = xmlHashQNameValue(hash->randomSeed, prefix, name, prefix2,
  910|  25.6k|                                  name2, prefix3, name3);
  911|  25.6k|    mask = hash->size - 1;
  912|  25.6k|    pos = hashValue & mask;
  913|  25.6k|    entry = &hash->table[pos];
  914|       |
  915|  25.6k|    if (entry->hashValue != 0) {
  ------------------
  |  Branch (915:9): [True: 6.00k, False: 19.6k]
  ------------------
  916|  6.00k|        displ = 0;
  917|  6.00k|        hashValue |= MAX_HASH_SIZE;
  ------------------
  |  |   31|  6.00k|#define MAX_HASH_SIZE (1u << 31)
  ------------------
  918|       |
  919|  6.81k|        do {
  920|  6.81k|            if ((hashValue == entry->hashValue) &&
  ------------------
  |  Branch (920:17): [True: 3.17k, False: 3.64k]
  ------------------
  921|  3.17k|                (xmlStrQEqual(prefix, name, entry->key)) &&
  ------------------
  |  Branch (921:17): [True: 3.17k, False: 0]
  ------------------
  922|  3.17k|                (xmlStrQEqual(prefix2, name2, entry->key2)) &&
  ------------------
  |  Branch (922:17): [True: 3.17k, False: 0]
  ------------------
  923|  3.17k|                (xmlStrQEqual(prefix3, name3, entry->key3)))
  ------------------
  |  Branch (923:17): [True: 3.17k, False: 0]
  ------------------
  924|  3.17k|                return(entry->payload);
  925|       |
  926|  3.64k|            displ++;
  927|  3.64k|            pos++;
  928|  3.64k|            entry++;
  929|  3.64k|            if ((pos & mask) == 0)
  ------------------
  |  Branch (929:17): [True: 538, False: 3.10k]
  ------------------
  930|    538|                entry = hash->table;
  931|  3.64k|        } while ((entry->hashValue != 0) &&
  ------------------
  |  Branch (931:18): [True: 1.52k, False: 2.12k]
  ------------------
  932|  1.52k|                 (((pos - entry->hashValue) & mask) >= displ));
  ------------------
  |  Branch (932:18): [True: 812, False: 713]
  ------------------
  933|  6.00k|    }
  934|       |
  935|  22.5k|    return(NULL);
  936|  25.6k|}
xmlHashScan:
  959|  6.22k|xmlHashScan(xmlHashTable *hash, xmlHashScanner scan, void *data) {
  960|  6.22k|    stubData sdata;
  961|  6.22k|    sdata.data = data;
  962|  6.22k|    sdata.scan = scan;
  963|  6.22k|    xmlHashScanFull(hash, stubHashScannerFull, &sdata);
  964|  6.22k|}
xmlHashScanFull:
  974|  8.99k|xmlHashScanFull(xmlHashTable *hash, xmlHashScannerFull scan, void *data) {
  975|  8.99k|    const xmlHashEntry *entry, *end;
  976|  8.99k|    xmlHashEntry old;
  977|  8.99k|    unsigned i;
  978|       |
  979|  8.99k|    if ((hash == NULL) || (hash->size == 0) || (scan == NULL))
  ------------------
  |  Branch (979:9): [True: 311, False: 8.67k]
  |  Branch (979:27): [True: 0, False: 8.67k]
  |  Branch (979:48): [True: 0, False: 8.67k]
  ------------------
  980|    311|        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|  8.67k|    entry = hash->table;
  990|  8.67k|    end = &hash->table[hash->size];
  991|  11.3k|    while (entry->hashValue != 0) {
  ------------------
  |  Branch (991:12): [True: 2.64k, False: 8.67k]
  ------------------
  992|  2.64k|        if (++entry >= end)
  ------------------
  |  Branch (992:13): [True: 0, False: 2.64k]
  ------------------
  993|      0|            entry = hash->table;
  994|  2.64k|    }
  995|       |
  996|   132k|    for (i = 0; i < hash->size; i++) {
  ------------------
  |  Branch (996:17): [True: 124k, False: 8.67k]
  ------------------
  997|   124k|        if ((entry->hashValue != 0) && (entry->payload != NULL)) {
  ------------------
  |  Branch (997:13): [True: 32.5k, False: 91.5k]
  |  Branch (997:40): [True: 32.5k, False: 0]
  ------------------
  998|       |            /*
  999|       |             * Make sure to rescan after a possible deletion.
 1000|       |             */
 1001|  33.0k|            do {
 1002|  33.0k|                old = *entry;
 1003|  33.0k|                scan(entry->payload, data, entry->key, entry->key2, entry->key3);
 1004|  33.0k|            } while ((entry->hashValue != 0) &&
  ------------------
  |  Branch (1004:22): [True: 31.8k, False: 1.17k]
  ------------------
 1005|  31.8k|                     (entry->payload != NULL) &&
  ------------------
  |  Branch (1005:22): [True: 31.8k, False: 0]
  ------------------
 1006|  31.8k|                     ((entry->key != old.key) ||
  ------------------
  |  Branch (1006:23): [True: 473, False: 31.4k]
  ------------------
 1007|  31.4k|                      (entry->key2 != old.key2) ||
  ------------------
  |  Branch (1007:23): [True: 53, False: 31.3k]
  ------------------
 1008|  31.3k|                      (entry->key3 != old.key3)));
  ------------------
  |  Branch (1008:23): [True: 0, False: 31.3k]
  ------------------
 1009|  32.5k|        }
 1010|   124k|        if (++entry >= end)
  ------------------
  |  Branch (1010:13): [True: 8.67k, False: 115k]
  ------------------
 1011|  8.67k|            entry = hash->table;
 1012|   124k|    }
 1013|  8.67k|}
xmlHashScan3:
 1030|    548|             xmlHashScanner scan, void *data) {
 1031|    548|    stubData sdata;
 1032|    548|    sdata.data = data;
 1033|    548|    sdata.scan = scan;
 1034|    548|    xmlHashScanFull3(hash, key, key2, key3, stubHashScannerFull, &sdata);
 1035|    548|}
xmlHashScanFull3:
 1052|    548|                 xmlHashScannerFull scan, void *data) {
 1053|    548|    const xmlHashEntry *entry, *end;
 1054|    548|    xmlHashEntry old;
 1055|    548|    unsigned i;
 1056|       |
 1057|    548|    if ((hash == NULL) || (hash->size == 0) || (scan == NULL))
  ------------------
  |  Branch (1057:9): [True: 131, False: 417]
  |  Branch (1057:27): [True: 0, False: 417]
  |  Branch (1057:48): [True: 0, False: 417]
  ------------------
 1058|    131|        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|    417|    entry = hash->table;
 1068|    417|    end = &hash->table[hash->size];
 1069|    622|    while (entry->hashValue != 0) {
  ------------------
  |  Branch (1069:12): [True: 205, False: 417]
  ------------------
 1070|    205|        if (++entry >= end)
  ------------------
  |  Branch (1070:13): [True: 0, False: 205]
  ------------------
 1071|      0|            entry = hash->table;
 1072|    205|    }
 1073|       |
 1074|   218k|    for (i = 0; i < hash->size; i++) {
  ------------------
  |  Branch (1074:17): [True: 218k, False: 417]
  ------------------
 1075|   218k|        if ((entry->hashValue != 0) && (entry->payload != NULL)) {
  ------------------
  |  Branch (1075:13): [True: 110k, False: 107k]
  |  Branch (1075:40): [True: 110k, False: 0]
  ------------------
 1076|       |            /*
 1077|       |             * Make sure to rescan after a possible deletion.
 1078|       |             */
 1079|   110k|            do {
 1080|   110k|                if (((key != NULL) && (strcmp((const char *) key,
  ------------------
  |  Branch (1080:22): [True: 0, False: 110k]
  |  Branch (1080:39): [True: 0, False: 0]
  ------------------
 1081|      0|                                              (const char *) entry->key) != 0)) ||
 1082|   110k|                    ((key2 != NULL) && (!xmlFastStrEqual(key2, entry->key2))) ||
  ------------------
  |  Branch (1082:22): [True: 0, False: 110k]
  |  Branch (1082:40): [True: 0, False: 0]
  ------------------
 1083|   110k|                    ((key3 != NULL) && (!xmlFastStrEqual(key3, entry->key3))))
  ------------------
  |  Branch (1083:22): [True: 110k, False: 0]
  |  Branch (1083:40): [True: 110k, False: 32]
  ------------------
 1084|   110k|                    break;
 1085|     32|                old = *entry;
 1086|     32|                scan(entry->payload, data, entry->key, entry->key2, entry->key3);
 1087|     32|            } while ((entry->hashValue != 0) &&
  ------------------
  |  Branch (1087:22): [True: 32, False: 0]
  ------------------
 1088|     32|                     (entry->payload != NULL) &&
  ------------------
  |  Branch (1088:22): [True: 32, False: 0]
  ------------------
 1089|     32|                     ((entry->key != old.key) ||
  ------------------
  |  Branch (1089:23): [True: 0, False: 32]
  ------------------
 1090|     32|                      (entry->key2 != old.key2) ||
  ------------------
  |  Branch (1090:23): [True: 0, False: 32]
  ------------------
 1091|     32|                      (entry->key3 != old.key3)));
  ------------------
  |  Branch (1091:23): [True: 0, False: 32]
  ------------------
 1092|   110k|        }
 1093|   218k|        if (++entry >= end)
  ------------------
  |  Branch (1093:13): [True: 417, False: 217k]
  ------------------
 1094|    417|            entry = hash->table;
 1095|   218k|    }
 1096|    417|}
xmlHashCopySafe:
 1111|  10.4k|                xmlHashDeallocator deallocFunc) {
 1112|  10.4k|    const xmlHashEntry *entry, *end;
 1113|  10.4k|    xmlHashTablePtr ret;
 1114|       |
 1115|  10.4k|    if ((hash == NULL) || (copyFunc == NULL))
  ------------------
  |  Branch (1115:9): [True: 0, False: 10.4k]
  |  Branch (1115:27): [True: 0, False: 10.4k]
  ------------------
 1116|      0|        return(NULL);
 1117|       |
 1118|  10.4k|    ret = xmlHashCreate(hash->size);
 1119|  10.4k|    if (ret == NULL)
  ------------------
  |  Branch (1119:9): [True: 20, False: 10.4k]
  ------------------
 1120|     20|        return(NULL);
 1121|       |
 1122|  10.4k|    if (hash->size == 0)
  ------------------
  |  Branch (1122:9): [True: 0, False: 10.4k]
  ------------------
 1123|      0|        return(ret);
 1124|       |
 1125|  10.4k|    end = &hash->table[hash->size];
 1126|       |
 1127|  96.8k|    for (entry = hash->table; entry < end; entry++) {
  ------------------
  |  Branch (1127:31): [True: 86.6k, False: 10.2k]
  ------------------
 1128|  86.6k|        if (entry->hashValue != 0) {
  ------------------
  |  Branch (1128:13): [True: 17.4k, False: 69.1k]
  ------------------
 1129|  17.4k|            void *copy;
 1130|       |
 1131|  17.4k|            copy = copyFunc(entry->payload, entry->key);
 1132|  17.4k|            if (copy == NULL)
  ------------------
  |  Branch (1132:17): [True: 140, False: 17.3k]
  ------------------
 1133|    140|                goto error;
 1134|  17.3k|            if (xmlHashAdd3(ret, entry->key, entry->key2, entry->key3,
  ------------------
  |  Branch (1134:17): [True: 46, False: 17.3k]
  ------------------
 1135|  17.3k|                            copy) <= 0) {
 1136|     46|                if (deallocFunc != NULL)
  ------------------
  |  Branch (1136:21): [True: 46, False: 0]
  ------------------
 1137|     46|                    deallocFunc(copy, entry->key);
 1138|     46|                goto error;
 1139|     46|            }
 1140|  17.3k|        }
 1141|  86.6k|    }
 1142|       |
 1143|  10.2k|    return(ret);
 1144|       |
 1145|    186|error:
 1146|    186|    xmlHashFree(ret, deallocFunc);
 1147|       |    return(NULL);
 1148|  10.4k|}
xmlHashSize:
 1173|  2.77k|xmlHashSize(xmlHashTable *hash) {
 1174|  2.77k|    if (hash == NULL)
  ------------------
  |  Branch (1174:9): [True: 0, False: 2.77k]
  ------------------
 1175|      0|        return(-1);
 1176|  2.77k|    return(hash->nbElems);
 1177|  2.77k|}
xmlHashRemoveEntry:
 1189|  1.46k|                       xmlHashDeallocator dealloc) {
 1190|  1.46k|    return(xmlHashRemoveEntry3(hash, key, NULL, NULL, dealloc));
 1191|  1.46k|}
xmlHashRemoveEntry2:
 1206|  1.86k|                    const xmlChar *key2, xmlHashDeallocator dealloc) {
 1207|       |    return(xmlHashRemoveEntry3(hash, key, key2, NULL, dealloc));
 1208|  1.86k|}
xmlHashRemoveEntry3:
 1226|  3.32k|                    xmlHashDeallocator dealloc) {
 1227|  3.32k|    xmlHashEntry *entry, *cur, *next;
 1228|  3.32k|    unsigned hashValue, mask, pos, nextpos;
 1229|  3.32k|    int found;
 1230|       |
 1231|  3.32k|    if ((hash == NULL) || (hash->size == 0) || (key == NULL))
  ------------------
  |  Branch (1231:9): [True: 0, False: 3.32k]
  |  Branch (1231:27): [True: 0, False: 3.32k]
  |  Branch (1231:48): [True: 0, False: 3.32k]
  ------------------
 1232|      0|        return(-1);
 1233|       |
 1234|  3.32k|    hashValue = xmlHashValue(hash->randomSeed, key, key2, key3, NULL);
 1235|  3.32k|    entry = xmlHashFindEntry(hash, key, key2, key3, hashValue, &found);
 1236|  3.32k|    if (!found)
  ------------------
  |  Branch (1236:9): [True: 0, False: 3.32k]
  ------------------
 1237|      0|        return(-1);
 1238|       |
 1239|  3.32k|    if ((dealloc != NULL) && (entry->payload != NULL))
  ------------------
  |  Branch (1239:9): [True: 1.46k, False: 1.86k]
  |  Branch (1239:30): [True: 1.46k, False: 0]
  ------------------
 1240|  1.46k|        dealloc(entry->payload, entry->key);
 1241|  3.32k|    if (hash->dict == NULL) {
  ------------------
  |  Branch (1241:9): [True: 1.53k, False: 1.79k]
  ------------------
 1242|  1.53k|        if (entry->key)
  ------------------
  |  Branch (1242:13): [True: 1.53k, False: 0]
  ------------------
 1243|  1.53k|            xmlFree(entry->key);
 1244|  1.53k|        if (entry->key2)
  ------------------
  |  Branch (1244:13): [True: 7, False: 1.53k]
  ------------------
 1245|      7|            xmlFree(entry->key2);
 1246|  1.53k|        if (entry->key3)
  ------------------
  |  Branch (1246:13): [True: 0, False: 1.53k]
  ------------------
 1247|      0|            xmlFree(entry->key3);
 1248|  1.53k|    }
 1249|       |
 1250|       |    /*
 1251|       |     * Find end of probe sequence. Entries at their initial probe
 1252|       |     * position start a new sequence.
 1253|       |     */
 1254|  3.32k|    mask = hash->size - 1;
 1255|  3.32k|    pos = entry - hash->table;
 1256|  3.32k|    cur = entry;
 1257|       |
 1258|  6.25k|    while (1) {
  ------------------
  |  Branch (1258:12): [True: 6.25k, Folded]
  ------------------
 1259|  6.25k|        nextpos = pos + 1;
 1260|  6.25k|        next = cur + 1;
 1261|  6.25k|        if ((nextpos & mask) == 0)
  ------------------
  |  Branch (1261:13): [True: 527, False: 5.72k]
  ------------------
 1262|    527|            next = hash->table;
 1263|       |
 1264|  6.25k|        if ((next->hashValue == 0) ||
  ------------------
  |  Branch (1264:13): [True: 2.31k, False: 3.94k]
  ------------------
 1265|  3.94k|            (((next->hashValue - nextpos) & mask) == 0))
  ------------------
  |  Branch (1265:13): [True: 1.01k, False: 2.92k]
  ------------------
 1266|  3.32k|            break;
 1267|       |
 1268|  2.92k|        cur = next;
 1269|  2.92k|        pos = nextpos;
 1270|  2.92k|    }
 1271|       |
 1272|       |    /*
 1273|       |     * Backward shift
 1274|       |     */
 1275|  3.32k|    next = entry + 1;
 1276|       |
 1277|  3.32k|    if (cur < entry) {
  ------------------
  |  Branch (1277:9): [True: 250, False: 3.07k]
  ------------------
 1278|    250|        xmlHashEntry *end = &hash->table[hash->size];
 1279|       |
 1280|    250|        memmove(entry, next, (char *) end - (char *) next);
 1281|    250|        entry = hash->table;
 1282|    250|        end[-1] = *entry;
 1283|    250|        next = entry + 1;
 1284|    250|    }
 1285|       |
 1286|  3.32k|    memmove(entry, next, (char *) cur - (char *) entry);
 1287|       |
 1288|       |    /*
 1289|       |     * Update entry
 1290|       |     */
 1291|  3.32k|    cur->hashValue = 0;
 1292|       |
 1293|  3.32k|    hash->nbElems--;
 1294|       |
 1295|  3.32k|    return(0);
 1296|  3.32k|}
hash.c:xmlHashGrow:
  345|  67.8k|xmlHashGrow(xmlHashTablePtr hash, unsigned size) {
  346|  67.8k|    const xmlHashEntry *oldentry, *oldend, *end;
  347|  67.8k|    xmlHashEntry *table;
  348|  67.8k|    unsigned oldsize, i;
  349|       |
  350|       |    /* Add 0 to avoid spurious -Wtype-limits warning on 64-bit GCC */
  351|  67.8k|    if ((size_t) size + 0 > SIZE_MAX / sizeof(table[0]))
  ------------------
  |  Branch (351:9): [True: 0, False: 67.8k]
  ------------------
  352|      0|        return(-1);
  353|  67.8k|    table = xmlMalloc(size * sizeof(table[0]));
  354|  67.8k|    if (table == NULL)
  ------------------
  |  Branch (354:9): [True: 28, False: 67.8k]
  ------------------
  355|     28|        return(-1);
  356|  67.8k|    memset(table, 0, size * sizeof(table[0]));
  357|       |
  358|  67.8k|    oldsize = hash->size;
  359|  67.8k|    if (oldsize == 0)
  ------------------
  |  Branch (359:9): [True: 65.9k, False: 1.86k]
  ------------------
  360|  65.9k|        goto done;
  361|       |
  362|  1.86k|    oldend = &hash->table[oldsize];
  363|  1.86k|    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|  1.86k|    oldentry = hash->table;
  373|  12.0k|    while (oldentry->hashValue != 0) {
  ------------------
  |  Branch (373:12): [True: 10.2k, False: 1.86k]
  ------------------
  374|  10.2k|        if (++oldentry >= oldend)
  ------------------
  |  Branch (374:13): [True: 0, False: 10.2k]
  ------------------
  375|      0|            oldentry = hash->table;
  376|  10.2k|    }
  377|       |
  378|  65.0k|    for (i = 0; i < oldsize; i++) {
  ------------------
  |  Branch (378:17): [True: 63.1k, False: 1.86k]
  ------------------
  379|  63.1k|        if (oldentry->hashValue != 0) {
  ------------------
  |  Branch (379:13): [True: 55.2k, False: 7.89k]
  ------------------
  380|  55.2k|            xmlHashEntry *entry = &table[oldentry->hashValue & (size - 1)];
  381|       |
  382|  75.4k|            while (entry->hashValue != 0) {
  ------------------
  |  Branch (382:20): [True: 20.1k, False: 55.2k]
  ------------------
  383|  20.1k|                if (++entry >= end)
  ------------------
  |  Branch (383:21): [True: 272, False: 19.8k]
  ------------------
  384|    272|                    entry = table;
  385|  20.1k|            }
  386|  55.2k|            *entry = *oldentry;
  387|  55.2k|        }
  388|       |
  389|  63.1k|        if (++oldentry >= oldend)
  ------------------
  |  Branch (389:13): [True: 1.86k, False: 61.2k]
  ------------------
  390|  1.86k|            oldentry = hash->table;
  391|  63.1k|    }
  392|       |
  393|  1.86k|    xmlFree(hash->table);
  394|       |
  395|  67.8k|done:
  396|  67.8k|    hash->table = table;
  397|  67.8k|    hash->size = size;
  398|       |
  399|  67.8k|    return(0);
  400|  1.86k|}
hash.c:xmlHashUpdateInternal:
  417|   269k|                      void *payload, xmlHashDeallocator dealloc, int update) {
  418|   269k|    xmlChar *copy, *copy2, *copy3;
  419|   269k|    xmlHashEntry *entry = NULL;
  420|   269k|    size_t lengths[3] = {0, 0, 0};
  421|   269k|    unsigned hashValue, newSize;
  422|       |
  423|   269k|    if ((hash == NULL) || (key == NULL))
  ------------------
  |  Branch (423:9): [True: 0, False: 269k]
  |  Branch (423:27): [True: 0, False: 269k]
  ------------------
  424|      0|        return(-1);
  425|       |
  426|   269k|    hashValue = xmlHashValue(hash->randomSeed, key, key2, key3, lengths);
  427|       |
  428|       |    /*
  429|       |     * Check for an existing entry
  430|       |     */
  431|   269k|    if (hash->size == 0) {
  ------------------
  |  Branch (431:9): [True: 60.5k, False: 208k]
  ------------------
  432|  60.5k|        newSize = MIN_HASH_SIZE;
  ------------------
  |  |   30|  60.5k|#define MIN_HASH_SIZE 8
  ------------------
  433|   208k|    } else {
  434|   208k|        int found = 0;
  435|       |
  436|   208k|        entry = xmlHashFindEntry(hash, key, key2, key3, hashValue, &found);
  437|       |
  438|   208k|        if (found) {
  ------------------
  |  Branch (438:13): [True: 131k, False: 77.0k]
  ------------------
  439|   131k|            if (update) {
  ------------------
  |  Branch (439:17): [True: 933, False: 130k]
  ------------------
  440|    933|                if (dealloc)
  ------------------
  |  Branch (440:21): [True: 335, False: 598]
  ------------------
  441|    335|                    dealloc(entry->payload, entry->key);
  442|    933|                entry->payload = payload;
  443|    933|            }
  444|       |
  445|   131k|            return(0);
  446|   131k|        }
  447|       |
  448|  77.0k|        if (hash->nbElems + 1 > hash->size / MAX_FILL_DENOM * MAX_FILL_NUM) {
  ------------------
  |  |   29|  77.0k|#define MAX_FILL_DENOM 8
  ------------------
                      if (hash->nbElems + 1 > hash->size / MAX_FILL_DENOM * MAX_FILL_NUM) {
  ------------------
  |  |   28|  77.0k|#define MAX_FILL_NUM 7
  ------------------
  |  Branch (448:13): [True: 1.86k, False: 75.1k]
  ------------------
  449|       |            /* This guarantees that nbElems < INT_MAX */
  450|  1.86k|            if (hash->size >= MAX_HASH_SIZE)
  ------------------
  |  |   31|  1.86k|#define MAX_HASH_SIZE (1u << 31)
  ------------------
  |  Branch (450:17): [True: 0, False: 1.86k]
  ------------------
  451|      0|                return(-1);
  452|  1.86k|            newSize = hash->size * 2;
  453|  75.1k|        } else {
  454|  75.1k|            newSize = 0;
  455|  75.1k|        }
  456|  77.0k|    }
  457|       |
  458|       |    /*
  459|       |     * Grow the hash table if needed
  460|       |     */
  461|   137k|    if (newSize > 0) {
  ------------------
  |  Branch (461:9): [True: 62.4k, False: 75.1k]
  ------------------
  462|  62.4k|        unsigned mask, displ, pos;
  463|       |
  464|  62.4k|        if (xmlHashGrow(hash, newSize) != 0)
  ------------------
  |  Branch (464:13): [True: 22, False: 62.4k]
  ------------------
  465|     22|            return(-1);
  466|       |
  467|       |        /*
  468|       |         * Find new entry
  469|       |         */
  470|  62.4k|        mask = hash->size - 1;
  471|  62.4k|        displ = 0;
  472|  62.4k|        pos = hashValue & mask;
  473|  62.4k|        entry = &hash->table[pos];
  474|       |
  475|  62.4k|        if (entry->hashValue != 0) {
  ------------------
  |  Branch (475:13): [True: 816, False: 61.5k]
  ------------------
  476|  1.12k|            do {
  477|  1.12k|                displ++;
  478|  1.12k|                pos++;
  479|  1.12k|                entry++;
  480|  1.12k|                if ((pos & mask) == 0)
  ------------------
  |  Branch (480:21): [True: 59, False: 1.07k]
  ------------------
  481|     59|                    entry = hash->table;
  482|  1.12k|            } while ((entry->hashValue != 0) &&
  ------------------
  |  Branch (482:22): [True: 636, False: 493]
  ------------------
  483|    636|                     ((pos - entry->hashValue) & mask) >= displ);
  ------------------
  |  Branch (483:22): [True: 313, False: 323]
  ------------------
  484|    816|        }
  485|  62.4k|    }
  486|       |
  487|       |    /*
  488|       |     * Copy keys
  489|       |     */
  490|   137k|    if (hash->dict != NULL) {
  ------------------
  |  Branch (490:9): [True: 53.0k, False: 84.5k]
  ------------------
  491|  53.0k|        if (xmlDictOwns(hash->dict, key)) {
  ------------------
  |  Branch (491:13): [True: 53.0k, False: 0]
  ------------------
  492|  53.0k|            copy = (xmlChar *) key;
  493|  53.0k|        } 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|  53.0k|        if ((key2 == NULL) || (xmlDictOwns(hash->dict, key2))) {
  ------------------
  |  Branch (499:13): [True: 32.0k, False: 20.9k]
  |  Branch (499:31): [True: 20.4k, False: 497]
  ------------------
  500|  52.5k|            copy2 = (xmlChar *) key2;
  501|  52.5k|        } else {
  502|    497|            copy2 = (xmlChar *) xmlDictLookup(hash->dict, key2, -1);
  503|    497|            if (copy2 == NULL)
  ------------------
  |  Branch (503:17): [True: 1, False: 496]
  ------------------
  504|      1|                return(-1);
  505|    497|        }
  506|  53.0k|        if ((key3 == NULL) || (xmlDictOwns(hash->dict, key3))) {
  ------------------
  |  Branch (506:13): [True: 39.7k, False: 13.2k]
  |  Branch (506:31): [True: 13.2k, False: 0]
  ------------------
  507|  53.0k|            copy3 = (xmlChar *) key3;
  508|  53.0k|        } 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|  84.5k|    } else {
  514|  84.5k|        copy = xmlMalloc(lengths[0] + 1);
  515|  84.5k|        if (copy == NULL)
  ------------------
  |  Branch (515:13): [True: 30, False: 84.5k]
  ------------------
  516|     30|            return(-1);
  517|  84.5k|        memcpy(copy, key, lengths[0] + 1);
  518|       |
  519|  84.5k|        if (key2 != NULL) {
  ------------------
  |  Branch (519:13): [True: 5.79k, False: 78.7k]
  ------------------
  520|  5.79k|            copy2 = xmlMalloc(lengths[1] + 1);
  521|  5.79k|            if (copy2 == NULL) {
  ------------------
  |  Branch (521:17): [True: 5, False: 5.79k]
  ------------------
  522|      5|                xmlFree(copy);
  523|      5|                return(-1);
  524|      5|            }
  525|  5.79k|            memcpy(copy2, key2, lengths[1] + 1);
  526|  78.7k|        } else {
  527|  78.7k|            copy2 = NULL;
  528|  78.7k|        }
  529|       |
  530|  84.5k|        if (key3 != NULL) {
  ------------------
  |  Branch (530:13): [True: 15.6k, False: 68.8k]
  ------------------
  531|  15.6k|            copy3 = xmlMalloc(lengths[2] + 1);
  532|  15.6k|            if (copy3 == NULL) {
  ------------------
  |  Branch (532:17): [True: 15, False: 15.6k]
  ------------------
  533|     15|                xmlFree(copy);
  534|     15|                xmlFree(copy2);
  535|     15|                return(-1);
  536|     15|            }
  537|  15.6k|            memcpy(copy3, key3, lengths[2] + 1);
  538|  68.8k|        } else {
  539|  68.8k|            copy3 = NULL;
  540|  68.8k|        }
  541|  84.5k|    }
  542|       |
  543|       |    /*
  544|       |     * Shift the remainder of the probe sequence to the right
  545|       |     */
  546|   137k|    if (entry->hashValue != 0) {
  ------------------
  |  Branch (546:9): [True: 15.3k, False: 122k]
  ------------------
  547|  15.3k|        const xmlHashEntry *end = &hash->table[hash->size];
  548|  15.3k|        const xmlHashEntry *cur = entry;
  549|       |
  550|  74.2k|        do {
  551|  74.2k|            cur++;
  552|  74.2k|            if (cur >= end)
  ------------------
  |  Branch (552:17): [True: 1.89k, False: 72.3k]
  ------------------
  553|  1.89k|                cur = hash->table;
  554|  74.2k|        } while (cur->hashValue != 0);
  ------------------
  |  Branch (554:18): [True: 58.8k, False: 15.3k]
  ------------------
  555|       |
  556|  15.3k|        if (cur < entry) {
  ------------------
  |  Branch (556:13): [True: 1.89k, False: 13.4k]
  ------------------
  557|       |            /*
  558|       |             * If we traversed the end of the buffer, handle the part
  559|       |             * at the start of the buffer.
  560|       |             */
  561|  1.89k|            memmove(&hash->table[1], hash->table,
  562|  1.89k|                    (char *) cur - (char *) hash->table);
  563|  1.89k|            cur = end - 1;
  564|  1.89k|            hash->table[0] = *cur;
  565|  1.89k|        }
  566|       |
  567|  15.3k|        memmove(&entry[1], entry, (char *) cur - (char *) entry);
  568|  15.3k|    }
  569|       |
  570|       |    /*
  571|       |     * Populate entry
  572|       |     */
  573|   137k|    entry->key = copy;
  574|   137k|    entry->key2 = copy2;
  575|   137k|    entry->key3 = copy3;
  576|   137k|    entry->payload = payload;
  577|       |    /* OR with MAX_HASH_SIZE to make sure that the value is non-zero */
  578|   137k|    entry->hashValue = hashValue | MAX_HASH_SIZE;
  ------------------
  |  |   31|   137k|#define MAX_HASH_SIZE (1u << 31)
  ------------------
  579|       |
  580|   137k|    hash->nbElems++;
  581|       |
  582|   137k|    return(1);
  583|   137k|}
hash.c:xmlHashValue:
   62|  3.81M|             const xmlChar *key3, size_t *lengths) {
   63|  3.81M|    unsigned h1, h2;
   64|  3.81M|    size_t i;
   65|       |
   66|  3.81M|    HASH_INIT(h1, h2, seed);
  ------------------
  |  |   23|  3.81M|    do { \
  |  |   24|  3.81M|        h1 = seed ^ 0x3b00; \
  |  |   25|  3.81M|        h2 = HASH_ROL(seed, 15); \
  |  |  ------------------
  |  |  |  |   12|  3.81M|#define HASH_ROL(x,n) ((x) << (n) | ((x) & 0xFFFFFFFF) >> (32 - (n)))
  |  |  ------------------
  |  |   26|  3.81M|    } while (0)
  |  |  ------------------
  |  |  |  Branch (26:14): [Folded, False: 3.81M]
  |  |  ------------------
  ------------------
   67|       |
   68|  28.7M|    for (i = 0; key[i] != 0; i++) {
  ------------------
  |  Branch (68:17): [True: 24.9M, False: 3.81M]
  ------------------
   69|  24.9M|        HASH_UPDATE(h1, h2, key[i]);
  ------------------
  |  |   29|  24.9M|    do { \
  |  |   30|  24.9M|        h1 += ch; \
  |  |   31|  24.9M|        h1 += h1 << 3; \
  |  |   32|  24.9M|        h2 += h1; \
  |  |   33|  24.9M|        h2 = HASH_ROL(h2, 7); \
  |  |  ------------------
  |  |  |  |   12|  24.9M|#define HASH_ROL(x,n) ((x) << (n) | ((x) & 0xFFFFFFFF) >> (32 - (n)))
  |  |  ------------------
  |  |   34|  24.9M|        h2 += h2 << 2; \
  |  |   35|  24.9M|    } while (0)
  |  |  ------------------
  |  |  |  Branch (35:14): [Folded, False: 24.9M]
  |  |  ------------------
  ------------------
   70|  24.9M|    }
   71|  3.81M|    if (lengths)
  ------------------
  |  Branch (71:9): [True: 269k, False: 3.54M]
  ------------------
   72|   269k|        lengths[0] = i;
   73|       |
   74|  3.81M|    HASH_UPDATE(h1, h2, 0);
  ------------------
  |  |   29|  3.81M|    do { \
  |  |   30|  3.81M|        h1 += ch; \
  |  |   31|  3.81M|        h1 += h1 << 3; \
  |  |   32|  3.81M|        h2 += h1; \
  |  |   33|  3.81M|        h2 = HASH_ROL(h2, 7); \
  |  |  ------------------
  |  |  |  |   12|  3.81M|#define HASH_ROL(x,n) ((x) << (n) | ((x) & 0xFFFFFFFF) >> (32 - (n)))
  |  |  ------------------
  |  |   34|  3.81M|        h2 += h2 << 2; \
  |  |   35|  3.81M|    } while (0)
  |  |  ------------------
  |  |  |  Branch (35:14): [Folded, False: 3.81M]
  |  |  ------------------
  ------------------
   75|       |
   76|  3.81M|    if (key2 != NULL) {
  ------------------
  |  Branch (76:9): [True: 183k, False: 3.62M]
  ------------------
   77|   851k|        for (i = 0; key2[i] != 0; i++) {
  ------------------
  |  Branch (77:21): [True: 667k, False: 183k]
  ------------------
   78|   667k|            HASH_UPDATE(h1, h2, key2[i]);
  ------------------
  |  |   29|   667k|    do { \
  |  |   30|   667k|        h1 += ch; \
  |  |   31|   667k|        h1 += h1 << 3; \
  |  |   32|   667k|        h2 += h1; \
  |  |   33|   667k|        h2 = HASH_ROL(h2, 7); \
  |  |  ------------------
  |  |  |  |   12|   667k|#define HASH_ROL(x,n) ((x) << (n) | ((x) & 0xFFFFFFFF) >> (32 - (n)))
  |  |  ------------------
  |  |   34|   667k|        h2 += h2 << 2; \
  |  |   35|   667k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (35:14): [Folded, False: 667k]
  |  |  ------------------
  ------------------
   79|   667k|        }
   80|   183k|        if (lengths)
  ------------------
  |  Branch (80:13): [True: 43.2k, False: 140k]
  ------------------
   81|  43.2k|            lengths[1] = i;
   82|   183k|    }
   83|       |
   84|  3.81M|    HASH_UPDATE(h1, h2, 0);
  ------------------
  |  |   29|  3.81M|    do { \
  |  |   30|  3.81M|        h1 += ch; \
  |  |   31|  3.81M|        h1 += h1 << 3; \
  |  |   32|  3.81M|        h2 += h1; \
  |  |   33|  3.81M|        h2 = HASH_ROL(h2, 7); \
  |  |  ------------------
  |  |  |  |   12|  3.81M|#define HASH_ROL(x,n) ((x) << (n) | ((x) & 0xFFFFFFFF) >> (32 - (n)))
  |  |  ------------------
  |  |   34|  3.81M|        h2 += h2 << 2; \
  |  |   35|  3.81M|    } while (0)
  |  |  ------------------
  |  |  |  Branch (35:14): [Folded, False: 3.81M]
  |  |  ------------------
  ------------------
   85|       |
   86|  3.81M|    if (key3 != NULL) {
  ------------------
  |  Branch (86:9): [True: 394k, False: 3.41M]
  ------------------
   87|  1.37M|        for (i = 0; key3[i] != 0; i++) {
  ------------------
  |  Branch (87:21): [True: 984k, False: 394k]
  ------------------
   88|   984k|            HASH_UPDATE(h1, h2, key3[i]);
  ------------------
  |  |   29|   984k|    do { \
  |  |   30|   984k|        h1 += ch; \
  |  |   31|   984k|        h1 += h1 << 3; \
  |  |   32|   984k|        h2 += h1; \
  |  |   33|   984k|        h2 = HASH_ROL(h2, 7); \
  |  |  ------------------
  |  |  |  |   12|   984k|#define HASH_ROL(x,n) ((x) << (n) | ((x) & 0xFFFFFFFF) >> (32 - (n)))
  |  |  ------------------
  |  |   34|   984k|        h2 += h2 << 2; \
  |  |   35|   984k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (35:14): [Folded, False: 984k]
  |  |  ------------------
  ------------------
   89|   984k|        }
   90|   394k|        if (lengths)
  ------------------
  |  Branch (90:13): [True: 48.4k, False: 345k]
  ------------------
   91|  48.4k|            lengths[2] = i;
   92|   394k|    }
   93|       |
   94|  3.81M|    HASH_FINISH(h1, h2);
  ------------------
  |  |   39|  3.81M|    do { \
  |  |   40|  3.81M|        h1 ^= h2; \
  |  |   41|  3.81M|        h1 += HASH_ROL(h2, 14); \
  |  |  ------------------
  |  |  |  |   12|  3.81M|#define HASH_ROL(x,n) ((x) << (n) | ((x) & 0xFFFFFFFF) >> (32 - (n)))
  |  |  ------------------
  |  |   42|  3.81M|        h2 ^= h1; h2 += HASH_ROR(h1, 6); \
  |  |  ------------------
  |  |  |  |   13|  3.81M|#define HASH_ROR(x,n) (((x) & 0xFFFFFFFF) >> (n) | (x) << (32 - (n)))
  |  |  ------------------
  |  |   43|  3.81M|        h1 ^= h2; h1 += HASH_ROL(h2, 5); \
  |  |  ------------------
  |  |  |  |   12|  3.81M|#define HASH_ROL(x,n) ((x) << (n) | ((x) & 0xFFFFFFFF) >> (32 - (n)))
  |  |  ------------------
  |  |   44|  3.81M|        h2 ^= h1; h2 += HASH_ROR(h1, 8); \
  |  |  ------------------
  |  |  |  |   13|  3.81M|#define HASH_ROR(x,n) (((x) & 0xFFFFFFFF) >> (n) | (x) << (32 - (n)))
  |  |  ------------------
  |  |   45|  3.81M|        h2 &= 0xFFFFFFFF; \
  |  |   46|  3.81M|    } while (0)
  |  |  ------------------
  |  |  |  Branch (46:14): [Folded, False: 3.81M]
  |  |  ------------------
  ------------------
   95|       |
   96|  3.81M|    return(h2);
   97|  3.81M|}
hash.c:xmlHashFindEntry:
  287|  3.75M|                 unsigned hashValue, int *pfound) {
  288|  3.75M|    xmlHashEntry *entry;
  289|  3.75M|    unsigned mask, pos, displ;
  290|  3.75M|    int found = 0;
  291|       |
  292|  3.75M|    mask = hash->size - 1;
  293|  3.75M|    pos = hashValue & mask;
  294|  3.75M|    entry = &hash->table[pos];
  295|       |
  296|  3.75M|    if (entry->hashValue != 0) {
  ------------------
  |  Branch (296:9): [True: 3.20M, False: 545k]
  ------------------
  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|  3.20M|        displ = 0;
  303|  3.20M|        hashValue |= MAX_HASH_SIZE;
  ------------------
  |  |   31|  3.20M|#define MAX_HASH_SIZE (1u << 31)
  ------------------
  304|       |
  305|  3.63M|        do {
  306|  3.63M|            if (entry->hashValue == hashValue) {
  ------------------
  |  Branch (306:17): [True: 2.86M, False: 765k]
  ------------------
  307|  2.86M|                if (hash->dict) {
  ------------------
  |  Branch (307:21): [True: 1.36M, False: 1.50M]
  ------------------
  308|  1.36M|                    if ((entry->key == key) &&
  ------------------
  |  Branch (308:25): [True: 871k, False: 494k]
  ------------------
  309|   871k|                        (entry->key2 == key2) &&
  ------------------
  |  Branch (309:25): [True: 859k, False: 11.8k]
  ------------------
  310|   859k|                        (entry->key3 == key3)) {
  ------------------
  |  Branch (310:25): [True: 858k, False: 1.14k]
  ------------------
  311|   858k|                        found = 1;
  312|   858k|                        break;
  313|   858k|                    }
  314|  1.36M|                }
  315|  2.00M|                if ((strcmp((const char *) entry->key,
  ------------------
  |  Branch (315:21): [True: 2.00M, False: 240]
  ------------------
  316|  2.00M|                            (const char *) key) == 0) &&
  317|  2.00M|                    (xmlFastStrEqual(entry->key2, key2)) &&
  ------------------
  |  Branch (317:21): [True: 2.00M, False: 0]
  ------------------
  318|  2.00M|                    (xmlFastStrEqual(entry->key3, key3))) {
  ------------------
  |  Branch (318:21): [True: 2.00M, False: 0]
  ------------------
  319|  2.00M|                    found = 1;
  320|  2.00M|                    break;
  321|  2.00M|                }
  322|  2.00M|            }
  323|       |
  324|   765k|            displ++;
  325|   765k|            pos++;
  326|   765k|            entry++;
  327|   765k|            if ((pos & mask) == 0)
  ------------------
  |  Branch (327:17): [True: 28.6k, False: 736k]
  ------------------
  328|  28.6k|                entry = hash->table;
  329|   765k|        } while ((entry->hashValue != 0) &&
  ------------------
  |  Branch (329:18): [True: 525k, False: 239k]
  ------------------
  330|   525k|                 (((pos - entry->hashValue) & mask) >= displ));
  ------------------
  |  Branch (330:18): [True: 424k, False: 100k]
  ------------------
  331|  3.20M|    }
  332|       |
  333|  3.75M|    *pfound = found;
  334|  3.75M|    return(entry);
  335|  3.75M|}
hash.c:xmlHashQNameValue:
  104|  25.6k|                  const xmlChar *prefix3, const xmlChar *name3) {
  105|  25.6k|    unsigned h1, h2, ch;
  106|       |
  107|  25.6k|    HASH_INIT(h1, h2, seed);
  ------------------
  |  |   23|  25.6k|    do { \
  |  |   24|  25.6k|        h1 = seed ^ 0x3b00; \
  |  |   25|  25.6k|        h2 = HASH_ROL(seed, 15); \
  |  |  ------------------
  |  |  |  |   12|  25.6k|#define HASH_ROL(x,n) ((x) << (n) | ((x) & 0xFFFFFFFF) >> (32 - (n)))
  |  |  ------------------
  |  |   26|  25.6k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (26:14): [Folded, False: 25.6k]
  |  |  ------------------
  ------------------
  108|       |
  109|  25.6k|    if (prefix != NULL) {
  ------------------
  |  Branch (109:9): [True: 6.07k, False: 19.6k]
  ------------------
  110|  35.8k|        while ((ch = *prefix++) != 0) {
  ------------------
  |  Branch (110:16): [True: 29.7k, False: 6.07k]
  ------------------
  111|  29.7k|            HASH_UPDATE(h1, h2, ch);
  ------------------
  |  |   29|  29.7k|    do { \
  |  |   30|  29.7k|        h1 += ch; \
  |  |   31|  29.7k|        h1 += h1 << 3; \
  |  |   32|  29.7k|        h2 += h1; \
  |  |   33|  29.7k|        h2 = HASH_ROL(h2, 7); \
  |  |  ------------------
  |  |  |  |   12|  29.7k|#define HASH_ROL(x,n) ((x) << (n) | ((x) & 0xFFFFFFFF) >> (32 - (n)))
  |  |  ------------------
  |  |   34|  29.7k|        h2 += h2 << 2; \
  |  |   35|  29.7k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (35:14): [Folded, False: 29.7k]
  |  |  ------------------
  ------------------
  112|  29.7k|        }
  113|  6.07k|        HASH_UPDATE(h1, h2, ':');
  ------------------
  |  |   29|  6.07k|    do { \
  |  |   30|  6.07k|        h1 += ch; \
  |  |   31|  6.07k|        h1 += h1 << 3; \
  |  |   32|  6.07k|        h2 += h1; \
  |  |   33|  6.07k|        h2 = HASH_ROL(h2, 7); \
  |  |  ------------------
  |  |  |  |   12|  6.07k|#define HASH_ROL(x,n) ((x) << (n) | ((x) & 0xFFFFFFFF) >> (32 - (n)))
  |  |  ------------------
  |  |   34|  6.07k|        h2 += h2 << 2; \
  |  |   35|  6.07k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (35:14): [Folded, False: 6.07k]
  |  |  ------------------
  ------------------
  114|  6.07k|    }
  115|  25.6k|    if (name != NULL) {
  ------------------
  |  Branch (115:9): [True: 25.6k, False: 0]
  ------------------
  116|  4.46M|        while ((ch = *name++) != 0) {
  ------------------
  |  Branch (116:16): [True: 4.43M, False: 25.6k]
  ------------------
  117|  4.43M|            HASH_UPDATE(h1, h2, ch);
  ------------------
  |  |   29|  4.43M|    do { \
  |  |   30|  4.43M|        h1 += ch; \
  |  |   31|  4.43M|        h1 += h1 << 3; \
  |  |   32|  4.43M|        h2 += h1; \
  |  |   33|  4.43M|        h2 = HASH_ROL(h2, 7); \
  |  |  ------------------
  |  |  |  |   12|  4.43M|#define HASH_ROL(x,n) ((x) << (n) | ((x) & 0xFFFFFFFF) >> (32 - (n)))
  |  |  ------------------
  |  |   34|  4.43M|        h2 += h2 << 2; \
  |  |   35|  4.43M|    } while (0)
  |  |  ------------------
  |  |  |  Branch (35:14): [Folded, False: 4.43M]
  |  |  ------------------
  ------------------
  118|  4.43M|        }
  119|  25.6k|    }
  120|  25.6k|    HASH_UPDATE(h1, h2, 0);
  ------------------
  |  |   29|  25.6k|    do { \
  |  |   30|  25.6k|        h1 += ch; \
  |  |   31|  25.6k|        h1 += h1 << 3; \
  |  |   32|  25.6k|        h2 += h1; \
  |  |   33|  25.6k|        h2 = HASH_ROL(h2, 7); \
  |  |  ------------------
  |  |  |  |   12|  25.6k|#define HASH_ROL(x,n) ((x) << (n) | ((x) & 0xFFFFFFFF) >> (32 - (n)))
  |  |  ------------------
  |  |   34|  25.6k|        h2 += h2 << 2; \
  |  |   35|  25.6k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (35:14): [Folded, False: 25.6k]
  |  |  ------------------
  ------------------
  121|  25.6k|    if (prefix2 != NULL) {
  ------------------
  |  Branch (121:9): [True: 8.38k, False: 17.3k]
  ------------------
  122|  47.2k|        while ((ch = *prefix2++) != 0) {
  ------------------
  |  Branch (122:16): [True: 38.8k, False: 8.38k]
  ------------------
  123|  38.8k|            HASH_UPDATE(h1, h2, ch);
  ------------------
  |  |   29|  38.8k|    do { \
  |  |   30|  38.8k|        h1 += ch; \
  |  |   31|  38.8k|        h1 += h1 << 3; \
  |  |   32|  38.8k|        h2 += h1; \
  |  |   33|  38.8k|        h2 = HASH_ROL(h2, 7); \
  |  |  ------------------
  |  |  |  |   12|  38.8k|#define HASH_ROL(x,n) ((x) << (n) | ((x) & 0xFFFFFFFF) >> (32 - (n)))
  |  |  ------------------
  |  |   34|  38.8k|        h2 += h2 << 2; \
  |  |   35|  38.8k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (35:14): [Folded, False: 38.8k]
  |  |  ------------------
  ------------------
  124|  38.8k|        }
  125|  8.38k|        HASH_UPDATE(h1, h2, ':');
  ------------------
  |  |   29|  8.38k|    do { \
  |  |   30|  8.38k|        h1 += ch; \
  |  |   31|  8.38k|        h1 += h1 << 3; \
  |  |   32|  8.38k|        h2 += h1; \
  |  |   33|  8.38k|        h2 = HASH_ROL(h2, 7); \
  |  |  ------------------
  |  |  |  |   12|  8.38k|#define HASH_ROL(x,n) ((x) << (n) | ((x) & 0xFFFFFFFF) >> (32 - (n)))
  |  |  ------------------
  |  |   34|  8.38k|        h2 += h2 << 2; \
  |  |   35|  8.38k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (35:14): [Folded, False: 8.38k]
  |  |  ------------------
  ------------------
  126|  8.38k|    }
  127|  25.6k|    if (name2 != NULL) {
  ------------------
  |  Branch (127:9): [True: 25.6k, False: 0]
  ------------------
  128|   800k|        while ((ch = *name2++) != 0) {
  ------------------
  |  Branch (128:16): [True: 774k, False: 25.6k]
  ------------------
  129|   774k|            HASH_UPDATE(h1, h2, ch);
  ------------------
  |  |   29|   774k|    do { \
  |  |   30|   774k|        h1 += ch; \
  |  |   31|   774k|        h1 += h1 << 3; \
  |  |   32|   774k|        h2 += h1; \
  |  |   33|   774k|        h2 = HASH_ROL(h2, 7); \
  |  |  ------------------
  |  |  |  |   12|   774k|#define HASH_ROL(x,n) ((x) << (n) | ((x) & 0xFFFFFFFF) >> (32 - (n)))
  |  |  ------------------
  |  |   34|   774k|        h2 += h2 << 2; \
  |  |   35|   774k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (35:14): [Folded, False: 774k]
  |  |  ------------------
  ------------------
  130|   774k|        }
  131|  25.6k|    }
  132|  25.6k|    HASH_UPDATE(h1, h2, 0);
  ------------------
  |  |   29|  25.6k|    do { \
  |  |   30|  25.6k|        h1 += ch; \
  |  |   31|  25.6k|        h1 += h1 << 3; \
  |  |   32|  25.6k|        h2 += h1; \
  |  |   33|  25.6k|        h2 = HASH_ROL(h2, 7); \
  |  |  ------------------
  |  |  |  |   12|  25.6k|#define HASH_ROL(x,n) ((x) << (n) | ((x) & 0xFFFFFFFF) >> (32 - (n)))
  |  |  ------------------
  |  |   34|  25.6k|        h2 += h2 << 2; \
  |  |   35|  25.6k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (35:14): [Folded, False: 25.6k]
  |  |  ------------------
  ------------------
  133|  25.6k|    if (prefix3 != NULL) {
  ------------------
  |  Branch (133:9): [True: 0, False: 25.6k]
  ------------------
  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|  25.6k|    if (name3 != NULL) {
  ------------------
  |  Branch (139:9): [True: 0, False: 25.6k]
  ------------------
  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|  25.6k|    HASH_FINISH(h1, h2);
  ------------------
  |  |   39|  25.6k|    do { \
  |  |   40|  25.6k|        h1 ^= h2; \
  |  |   41|  25.6k|        h1 += HASH_ROL(h2, 14); \
  |  |  ------------------
  |  |  |  |   12|  25.6k|#define HASH_ROL(x,n) ((x) << (n) | ((x) & 0xFFFFFFFF) >> (32 - (n)))
  |  |  ------------------
  |  |   42|  25.6k|        h2 ^= h1; h2 += HASH_ROR(h1, 6); \
  |  |  ------------------
  |  |  |  |   13|  25.6k|#define HASH_ROR(x,n) (((x) & 0xFFFFFFFF) >> (n) | (x) << (32 - (n)))
  |  |  ------------------
  |  |   43|  25.6k|        h1 ^= h2; h1 += HASH_ROL(h2, 5); \
  |  |  ------------------
  |  |  |  |   12|  25.6k|#define HASH_ROL(x,n) ((x) << (n) | ((x) & 0xFFFFFFFF) >> (32 - (n)))
  |  |  ------------------
  |  |   44|  25.6k|        h2 ^= h1; h2 += HASH_ROR(h1, 8); \
  |  |  ------------------
  |  |  |  |   13|  25.6k|#define HASH_ROR(x,n) (((x) & 0xFFFFFFFF) >> (n) | (x) << (32 - (n)))
  |  |  ------------------
  |  |   45|  25.6k|        h2 &= 0xFFFFFFFF; \
  |  |   46|  25.6k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (46:14): [Folded, False: 25.6k]
  |  |  ------------------
  ------------------
  146|       |
  147|  25.6k|    return(h2);
  148|  25.6k|}
hash.c:stubHashScannerFull:
  946|  14.7k|                    const xmlChar *key3 ATTRIBUTE_UNUSED) {
  947|  14.7k|    stubData *sdata = (stubData *) data;
  948|  14.7k|    sdata->scan(payload, sdata->data, key);
  949|  14.7k|}
hash.c:xmlFastStrEqual:
  263|  4.12M|xmlFastStrEqual(const xmlChar *s1, const xmlChar *s2) {
  264|  4.12M|    if (s1 == NULL)
  ------------------
  |  Branch (264:9): [True: 3.79M, False: 336k]
  ------------------
  265|  3.79M|        return(s2 == NULL);
  266|   336k|    else
  267|   336k|        return((s2 != NULL) &&
  ------------------
  |  Branch (267:16): [True: 336k, False: 0]
  ------------------
  268|   336k|               (strcmp((const char *) s1, (const char *) s2) == 0));
  ------------------
  |  Branch (268:16): [True: 226k, False: 110k]
  ------------------
  269|  4.12M|}

tree.c:xmlGrowCapacity:
   32|  15.1k|xmlGrowCapacity(int capacity, size_t elemSize, int min, int max) {
   33|  15.1k|    int extra;
   34|       |
   35|  15.1k|    if (capacity <= 0) {
  ------------------
  |  Branch (35:9): [True: 15.0k, False: 126]
  ------------------
   36|  15.0k|#ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
   37|  15.0k|        (void) min;
   38|  15.0k|        return(1);
   39|       |#else
   40|       |        return(min);
   41|       |#endif
   42|  15.0k|    }
   43|       |
   44|    126|    if ((capacity >= max) ||
  ------------------
  |  Branch (44:9): [True: 0, False: 126]
  ------------------
   45|    126|        ((size_t) capacity > SIZE_MAX / 2 / elemSize))
  ------------------
  |  Branch (45:9): [True: 0, False: 126]
  ------------------
   46|      0|        return(-1);
   47|       |
   48|       |    /* Grow by 50% */
   49|    126|    extra = (capacity + 1) / 2;
   50|       |
   51|    126|    if (capacity > max - extra)
  ------------------
  |  Branch (51:9): [True: 0, False: 126]
  ------------------
   52|      0|        return(max);
   53|       |
   54|    126|    return(capacity + extra);
   55|    126|}
uri.c:xmlGrowCapacity:
   32|  8.73k|xmlGrowCapacity(int capacity, size_t elemSize, int min, int max) {
   33|  8.73k|    int extra;
   34|       |
   35|  8.73k|    if (capacity <= 0) {
  ------------------
  |  Branch (35:9): [True: 0, False: 8.73k]
  ------------------
   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|  8.73k|    if ((capacity >= max) ||
  ------------------
  |  Branch (44:9): [True: 26, False: 8.71k]
  ------------------
   45|  8.71k|        ((size_t) capacity > SIZE_MAX / 2 / elemSize))
  ------------------
  |  Branch (45:9): [True: 0, False: 8.71k]
  ------------------
   46|     26|        return(-1);
   47|       |
   48|       |    /* Grow by 50% */
   49|  8.71k|    extra = (capacity + 1) / 2;
   50|       |
   51|  8.71k|    if (capacity > max - extra)
  ------------------
  |  Branch (51:9): [True: 39, False: 8.67k]
  ------------------
   52|     39|        return(max);
   53|       |
   54|  8.67k|    return(capacity + extra);
   55|  8.71k|}
valid.c:xmlGrowCapacity:
   32|  6.87k|xmlGrowCapacity(int capacity, size_t elemSize, int min, int max) {
   33|  6.87k|    int extra;
   34|       |
   35|  6.87k|    if (capacity <= 0) {
  ------------------
  |  Branch (35:9): [True: 2.56k, False: 4.31k]
  ------------------
   36|  2.56k|#ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
   37|  2.56k|        (void) min;
   38|  2.56k|        return(1);
   39|       |#else
   40|       |        return(min);
   41|       |#endif
   42|  2.56k|    }
   43|       |
   44|  4.31k|    if ((capacity >= max) ||
  ------------------
  |  Branch (44:9): [True: 0, False: 4.31k]
  ------------------
   45|  4.31k|        ((size_t) capacity > SIZE_MAX / 2 / elemSize))
  ------------------
  |  Branch (45:9): [True: 0, False: 4.31k]
  ------------------
   46|      0|        return(-1);
   47|       |
   48|       |    /* Grow by 50% */
   49|  4.31k|    extra = (capacity + 1) / 2;
   50|       |
   51|  4.31k|    if (capacity > max - extra)
  ------------------
  |  Branch (51:9): [True: 0, False: 4.31k]
  ------------------
   52|      0|        return(max);
   53|       |
   54|  4.31k|    return(capacity + extra);
   55|  4.31k|}
xmlreader.c:xmlGrowCapacity:
   32|    377|xmlGrowCapacity(int capacity, size_t elemSize, int min, int max) {
   33|    377|    int extra;
   34|       |
   35|    377|    if (capacity <= 0) {
  ------------------
  |  Branch (35:9): [True: 175, False: 202]
  ------------------
   36|    175|#ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
   37|    175|        (void) min;
   38|    175|        return(1);
   39|       |#else
   40|       |        return(min);
   41|       |#endif
   42|    175|    }
   43|       |
   44|    202|    if ((capacity >= max) ||
  ------------------
  |  Branch (44:9): [True: 0, False: 202]
  ------------------
   45|    202|        ((size_t) capacity > SIZE_MAX / 2 / elemSize))
  ------------------
  |  Branch (45:9): [True: 0, False: 202]
  ------------------
   46|      0|        return(-1);
   47|       |
   48|       |    /* Grow by 50% */
   49|    202|    extra = (capacity + 1) / 2;
   50|       |
   51|    202|    if (capacity > max - extra)
  ------------------
  |  Branch (51:9): [True: 0, False: 202]
  ------------------
   52|      0|        return(max);
   53|       |
   54|    202|    return(capacity + extra);
   55|    202|}
xmlregexp.c:xmlGrowCapacity:
   32|  1.16M|xmlGrowCapacity(int capacity, size_t elemSize, int min, int max) {
   33|  1.16M|    int extra;
   34|       |
   35|  1.16M|    if (capacity <= 0) {
  ------------------
  |  Branch (35:9): [True: 541k, False: 622k]
  ------------------
   36|   541k|#ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
   37|   541k|        (void) min;
   38|   541k|        return(1);
   39|       |#else
   40|       |        return(min);
   41|       |#endif
   42|   541k|    }
   43|       |
   44|   622k|    if ((capacity >= max) ||
  ------------------
  |  Branch (44:9): [True: 0, False: 622k]
  ------------------
   45|   622k|        ((size_t) capacity > SIZE_MAX / 2 / elemSize))
  ------------------
  |  Branch (45:9): [True: 0, False: 622k]
  ------------------
   46|      0|        return(-1);
   47|       |
   48|       |    /* Grow by 50% */
   49|   622k|    extra = (capacity + 1) / 2;
   50|       |
   51|   622k|    if (capacity > max - extra)
  ------------------
  |  Branch (51:9): [True: 0, False: 622k]
  ------------------
   52|      0|        return(max);
   53|       |
   54|   622k|    return(capacity + extra);
   55|   622k|}
xinclude.c:xmlGrowCapacity:
   32|  17.5k|xmlGrowCapacity(int capacity, size_t elemSize, int min, int max) {
   33|  17.5k|    int extra;
   34|       |
   35|  17.5k|    if (capacity <= 0) {
  ------------------
  |  Branch (35:9): [True: 15.9k, False: 1.64k]
  ------------------
   36|  15.9k|#ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
   37|  15.9k|        (void) min;
   38|  15.9k|        return(1);
   39|       |#else
   40|       |        return(min);
   41|       |#endif
   42|  15.9k|    }
   43|       |
   44|  1.64k|    if ((capacity >= max) ||
  ------------------
  |  Branch (44:9): [True: 0, False: 1.64k]
  ------------------
   45|  1.64k|        ((size_t) capacity > SIZE_MAX / 2 / elemSize))
  ------------------
  |  Branch (45:9): [True: 0, False: 1.64k]
  ------------------
   46|      0|        return(-1);
   47|       |
   48|       |    /* Grow by 50% */
   49|  1.64k|    extra = (capacity + 1) / 2;
   50|       |
   51|  1.64k|    if (capacity > max - extra)
  ------------------
  |  Branch (51:9): [True: 0, False: 1.64k]
  ------------------
   52|      0|        return(max);
   53|       |
   54|  1.64k|    return(capacity + extra);
   55|  1.64k|}
xpath.c:xmlGrowCapacity:
   32|  1.22M|xmlGrowCapacity(int capacity, size_t elemSize, int min, int max) {
   33|  1.22M|    int extra;
   34|       |
   35|  1.22M|    if (capacity <= 0) {
  ------------------
  |  Branch (35:9): [True: 323k, False: 899k]
  ------------------
   36|   323k|#ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
   37|   323k|        (void) min;
   38|   323k|        return(1);
   39|       |#else
   40|       |        return(min);
   41|       |#endif
   42|   323k|    }
   43|       |
   44|   899k|    if ((capacity >= max) ||
  ------------------
  |  Branch (44:9): [True: 0, False: 899k]
  ------------------
   45|   899k|        ((size_t) capacity > SIZE_MAX / 2 / elemSize))
  ------------------
  |  Branch (45:9): [True: 0, False: 899k]
  ------------------
   46|      0|        return(-1);
   47|       |
   48|       |    /* Grow by 50% */
   49|   899k|    extra = (capacity + 1) / 2;
   50|       |
   51|   899k|    if (capacity > max - extra)
  ------------------
  |  Branch (51:9): [True: 2, False: 899k]
  ------------------
   52|      2|        return(max);
   53|       |
   54|   899k|    return(capacity + extra);
   55|   899k|}
parser.c:xmlGrowCapacity:
   32|   284k|xmlGrowCapacity(int capacity, size_t elemSize, int min, int max) {
   33|   284k|    int extra;
   34|       |
   35|   284k|    if (capacity <= 0) {
  ------------------
  |  Branch (35:9): [True: 28.3k, False: 256k]
  ------------------
   36|  28.3k|#ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
   37|  28.3k|        (void) min;
   38|  28.3k|        return(1);
   39|       |#else
   40|       |        return(min);
   41|       |#endif
   42|  28.3k|    }
   43|       |
   44|   256k|    if ((capacity >= max) ||
  ------------------
  |  Branch (44:9): [True: 239, False: 255k]
  ------------------
   45|   255k|        ((size_t) capacity > SIZE_MAX / 2 / elemSize))
  ------------------
  |  Branch (45:9): [True: 0, False: 255k]
  ------------------
   46|    239|        return(-1);
   47|       |
   48|       |    /* Grow by 50% */
   49|   255k|    extra = (capacity + 1) / 2;
   50|       |
   51|   255k|    if (capacity > max - extra)
  ------------------
  |  Branch (51:9): [True: 422, False: 255k]
  ------------------
   52|    422|        return(max);
   53|       |
   54|   255k|    return(capacity + extra);
   55|   255k|}

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

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

xmlWarningMsg:
  276|  38.3k|{
  277|  38.3k|    xmlCtxtErr(ctxt, NULL, XML_FROM_PARSER, error, XML_ERR_WARNING,
  278|       |               str1, str2, NULL, 0, msg, str1, str2);
  279|  38.3k|}
xmlCheckLanguageID:
 1267|  40.7k|{
 1268|  40.7k|    const xmlChar *cur = lang, *nxt;
 1269|       |
 1270|  40.7k|    if (cur == NULL)
  ------------------
  |  Branch (1270:9): [True: 258, False: 40.4k]
  ------------------
 1271|    258|        return (0);
 1272|  40.4k|    if (((cur[0] == 'i') && (cur[1] == '-')) ||
  ------------------
  |  Branch (1272:10): [True: 548, False: 39.9k]
  |  Branch (1272:29): [True: 251, False: 297]
  ------------------
 1273|  40.2k|        ((cur[0] == 'I') && (cur[1] == '-')) ||
  ------------------
  |  Branch (1273:10): [True: 21.9k, False: 18.2k]
  |  Branch (1273:29): [True: 1.21k, False: 20.7k]
  ------------------
 1274|  38.9k|        ((cur[0] == 'x') && (cur[1] == '-')) ||
  ------------------
  |  Branch (1274:10): [True: 548, False: 38.4k]
  |  Branch (1274:29): [True: 47, False: 501]
  ------------------
 1275|  38.9k|        ((cur[0] == 'X') && (cur[1] == '-'))) {
  ------------------
  |  Branch (1275:10): [True: 111, False: 38.8k]
  |  Branch (1275:29): [True: 40, False: 71]
  ------------------
 1276|       |        /*
 1277|       |         * Still allow IANA code and user code which were coming
 1278|       |         * from the previous version of the XML-1.0 specification
 1279|       |         * it's deprecated but we should not fail
 1280|       |         */
 1281|  1.54k|        cur += 2;
 1282|  3.74k|        while (((cur[0] >= 'A') && (cur[0] <= 'Z')) ||
  ------------------
  |  Branch (1282:17): [True: 2.27k, False: 1.47k]
  |  Branch (1282:36): [True: 1.98k, False: 288]
  ------------------
 1283|  1.76k|               ((cur[0] >= 'a') && (cur[0] <= 'z')))
  ------------------
  |  Branch (1283:17): [True: 288, False: 1.47k]
  |  Branch (1283:36): [True: 214, False: 74]
  ------------------
 1284|  2.20k|            cur++;
 1285|  1.54k|        return(cur[0] == 0);
 1286|  1.54k|    }
 1287|  38.9k|    nxt = cur;
 1288|   189k|    while (((nxt[0] >= 'A') && (nxt[0] <= 'Z')) ||
  ------------------
  |  Branch (1288:13): [True: 151k, False: 37.5k]
  |  Branch (1288:32): [True: 136k, False: 15.1k]
  ------------------
 1289|  52.7k|           ((nxt[0] >= 'a') && (nxt[0] <= 'z')))
  ------------------
  |  Branch (1289:13): [True: 15.1k, False: 37.5k]
  |  Branch (1289:32): [True: 13.8k, False: 1.31k]
  ------------------
 1290|   150k|           nxt++;
 1291|  38.9k|    if (nxt - cur >= 4) {
  ------------------
  |  Branch (1291:9): [True: 2.16k, False: 36.7k]
  ------------------
 1292|       |        /*
 1293|       |         * Reserved
 1294|       |         */
 1295|  2.16k|        if ((nxt - cur > 8) || (nxt[0] != 0))
  ------------------
  |  Branch (1295:13): [True: 1.08k, False: 1.07k]
  |  Branch (1295:32): [True: 507, False: 569]
  ------------------
 1296|  1.59k|            return(0);
 1297|    569|        return(1);
 1298|  2.16k|    }
 1299|  36.7k|    if (nxt - cur < 2)
  ------------------
  |  Branch (1299:9): [True: 1.99k, False: 34.7k]
  ------------------
 1300|  1.99k|        return(0);
 1301|       |    /* we got an ISO 639 code */
 1302|  34.7k|    if (nxt[0] == 0)
  ------------------
  |  Branch (1302:9): [True: 1.92k, False: 32.8k]
  ------------------
 1303|  1.92k|        return(1);
 1304|  32.8k|    if (nxt[0] != '-')
  ------------------
  |  Branch (1304:9): [True: 2.50k, False: 30.3k]
  ------------------
 1305|  2.50k|        return(0);
 1306|       |
 1307|  30.3k|    nxt++;
 1308|  30.3k|    cur = nxt;
 1309|       |    /* now we can have extlang or script or region or variant */
 1310|  30.3k|    if ((nxt[0] >= '0') && (nxt[0] <= '9'))
  ------------------
  |  Branch (1310:9): [True: 28.4k, False: 1.86k]
  |  Branch (1310:28): [True: 7.70k, False: 20.7k]
  ------------------
 1311|  7.70k|        goto region_m49;
 1312|       |
 1313|  84.6k|    while (((nxt[0] >= 'A') && (nxt[0] <= 'Z')) ||
  ------------------
  |  Branch (1313:13): [True: 63.0k, False: 21.6k]
  |  Branch (1313:32): [True: 59.1k, False: 3.89k]
  ------------------
 1314|  25.5k|           ((nxt[0] >= 'a') && (nxt[0] <= 'z')))
  ------------------
  |  Branch (1314:13): [True: 3.71k, False: 21.8k]
  |  Branch (1314:32): [True: 2.90k, False: 813]
  ------------------
 1315|  62.0k|           nxt++;
 1316|  22.6k|    if (nxt - cur == 4)
  ------------------
  |  Branch (1316:9): [True: 1.03k, False: 21.5k]
  ------------------
 1317|  1.03k|        goto script;
 1318|  21.5k|    if (nxt - cur == 2)
  ------------------
  |  Branch (1318:9): [True: 1.65k, False: 19.9k]
  ------------------
 1319|  1.65k|        goto region;
 1320|  19.9k|    if ((nxt - cur >= 5) && (nxt - cur <= 8))
  ------------------
  |  Branch (1320:9): [True: 456, False: 19.4k]
  |  Branch (1320:29): [True: 355, False: 101]
  ------------------
 1321|    355|        goto variant;
 1322|  19.5k|    if (nxt - cur != 3)
  ------------------
  |  Branch (1322:9): [True: 2.75k, False: 16.8k]
  ------------------
 1323|  2.75k|        return(0);
 1324|       |    /* we parsed an extlang */
 1325|  16.8k|    if (nxt[0] == 0)
  ------------------
  |  Branch (1325:9): [True: 107, False: 16.7k]
  ------------------
 1326|    107|        return(1);
 1327|  16.7k|    if (nxt[0] != '-')
  ------------------
  |  Branch (1327:9): [True: 5.54k, False: 11.1k]
  ------------------
 1328|  5.54k|        return(0);
 1329|       |
 1330|  11.1k|    nxt++;
 1331|  11.1k|    cur = nxt;
 1332|       |    /* now we can have script or region or variant */
 1333|  11.1k|    if ((nxt[0] >= '0') && (nxt[0] <= '9'))
  ------------------
  |  Branch (1333:9): [True: 10.7k, False: 419]
  |  Branch (1333:28): [True: 741, False: 10.0k]
  ------------------
 1334|    741|        goto region_m49;
 1335|       |
 1336|  42.5k|    while (((nxt[0] >= 'A') && (nxt[0] <= 'Z')) ||
  ------------------
  |  Branch (1336:13): [True: 32.9k, False: 9.60k]
  |  Branch (1336:32): [True: 27.8k, False: 5.07k]
  ------------------
 1337|  14.6k|           ((nxt[0] >= 'a') && (nxt[0] <= 'z')))
  ------------------
  |  Branch (1337:13): [True: 5.06k, False: 9.61k]
  |  Branch (1337:32): [True: 4.25k, False: 811]
  ------------------
 1338|  32.0k|           nxt++;
 1339|  10.4k|    if (nxt - cur == 2)
  ------------------
  |  Branch (1339:9): [True: 6.57k, False: 3.84k]
  ------------------
 1340|  6.57k|        goto region;
 1341|  3.84k|    if ((nxt - cur >= 5) && (nxt - cur <= 8))
  ------------------
  |  Branch (1341:9): [True: 1.20k, False: 2.64k]
  |  Branch (1341:29): [True: 907, False: 296]
  ------------------
 1342|    907|        goto variant;
 1343|  2.94k|    if (nxt - cur != 4)
  ------------------
  |  Branch (1343:9): [True: 901, False: 2.04k]
  ------------------
 1344|    901|        return(0);
 1345|       |    /* we parsed a script */
 1346|  3.07k|script:
 1347|  3.07k|    if (nxt[0] == 0)
  ------------------
  |  Branch (1347:9): [True: 1.52k, False: 1.55k]
  ------------------
 1348|  1.52k|        return(1);
 1349|  1.55k|    if (nxt[0] != '-')
  ------------------
  |  Branch (1349:9): [True: 375, False: 1.17k]
  ------------------
 1350|    375|        return(0);
 1351|       |
 1352|  1.17k|    nxt++;
 1353|  1.17k|    cur = nxt;
 1354|       |    /* now we can have region or variant */
 1355|  1.17k|    if ((nxt[0] >= '0') && (nxt[0] <= '9'))
  ------------------
  |  Branch (1355:9): [True: 949, False: 226]
  |  Branch (1355:28): [True: 223, False: 726]
  ------------------
 1356|    223|        goto region_m49;
 1357|       |
 1358|  7.69k|    while (((nxt[0] >= 'A') && (nxt[0] <= 'Z')) ||
  ------------------
  |  Branch (1358:13): [True: 6.94k, False: 751]
  |  Branch (1358:32): [True: 6.00k, False: 933]
  ------------------
 1359|  1.68k|           ((nxt[0] >= 'a') && (nxt[0] <= 'z')))
  ------------------
  |  Branch (1359:13): [True: 913, False: 771]
  |  Branch (1359:32): [True: 732, False: 181]
  ------------------
 1360|  6.74k|           nxt++;
 1361|       |
 1362|    952|    if ((nxt - cur >= 5) && (nxt - cur <= 8))
  ------------------
  |  Branch (1362:9): [True: 142, False: 810]
  |  Branch (1362:29): [True: 59, False: 83]
  ------------------
 1363|     59|        goto variant;
 1364|    893|    if (nxt - cur != 2)
  ------------------
  |  Branch (1364:9): [True: 512, False: 381]
  ------------------
 1365|    512|        return(0);
 1366|       |    /* we parsed a region */
 1367|  8.83k|region:
 1368|  8.83k|    if (nxt[0] == 0)
  ------------------
  |  Branch (1368:9): [True: 597, False: 8.24k]
  ------------------
 1369|    597|        return(1);
 1370|  8.24k|    if (nxt[0] != '-')
  ------------------
  |  Branch (1370:9): [True: 6.79k, False: 1.44k]
  ------------------
 1371|  6.79k|        return(0);
 1372|       |
 1373|  1.44k|    nxt++;
 1374|  1.44k|    cur = nxt;
 1375|       |    /* now we can just have a variant */
 1376|  9.39k|    while (((nxt[0] >= 'A') && (nxt[0] <= 'Z')) ||
  ------------------
  |  Branch (1376:13): [True: 8.06k, False: 1.33k]
  |  Branch (1376:32): [True: 3.27k, False: 4.79k]
  ------------------
 1377|  6.12k|           ((nxt[0] >= 'a') && (nxt[0] <= 'z')))
  ------------------
  |  Branch (1377:13): [True: 4.79k, False: 1.33k]
  |  Branch (1377:32): [True: 4.67k, False: 116]
  ------------------
 1378|  7.94k|           nxt++;
 1379|       |
 1380|  1.44k|    if ((nxt - cur < 5) || (nxt - cur > 8))
  ------------------
  |  Branch (1380:9): [True: 735, False: 713]
  |  Branch (1380:28): [True: 306, False: 407]
  ------------------
 1381|  1.04k|        return(0);
 1382|       |
 1383|       |    /* we parsed a variant */
 1384|  1.72k|variant:
 1385|  1.72k|    if (nxt[0] == 0)
  ------------------
  |  Branch (1385:9): [True: 362, False: 1.36k]
  ------------------
 1386|    362|        return(1);
 1387|  1.36k|    if (nxt[0] != '-')
  ------------------
  |  Branch (1387:9): [True: 798, False: 568]
  ------------------
 1388|    798|        return(0);
 1389|       |    /* extensions and private use subtags not checked */
 1390|    568|    return (1);
 1391|       |
 1392|  8.67k|region_m49:
 1393|  8.67k|    if (((nxt[1] >= '0') && (nxt[1] <= '9')) &&
  ------------------
  |  Branch (1393:10): [True: 7.64k, False: 1.02k]
  |  Branch (1393:29): [True: 6.15k, False: 1.48k]
  ------------------
 1394|  6.15k|        ((nxt[2] >= '0') && (nxt[2] <= '9'))) {
  ------------------
  |  Branch (1394:10): [True: 4.28k, False: 1.87k]
  |  Branch (1394:29): [True: 234, False: 4.04k]
  ------------------
 1395|    234|        nxt += 3;
 1396|    234|        goto region;
 1397|    234|    }
 1398|  8.43k|    return(0);
 1399|  8.67k|}
xmlParserNsCreate:
 1416|  39.0k|xmlParserNsCreate(void) {
 1417|  39.0k|    xmlParserNsData *nsdb = xmlMalloc(sizeof(*nsdb));
 1418|       |
 1419|  39.0k|    if (nsdb == NULL)
  ------------------
  |  Branch (1419:9): [True: 3, False: 39.0k]
  ------------------
 1420|      3|        return(NULL);
 1421|  39.0k|    memset(nsdb, 0, sizeof(*nsdb));
 1422|  39.0k|    nsdb->defaultNsIndex = INT_MAX;
 1423|       |
 1424|  39.0k|    return(nsdb);
 1425|  39.0k|}
xmlParserNsFree:
 1433|  39.0k|xmlParserNsFree(xmlParserNsData *nsdb) {
 1434|  39.0k|    if (nsdb == NULL)
  ------------------
  |  Branch (1434:9): [True: 0, False: 39.0k]
  ------------------
 1435|      0|        return;
 1436|       |
 1437|  39.0k|    xmlFree(nsdb->extra);
 1438|  39.0k|    xmlFree(nsdb->hash);
 1439|  39.0k|    xmlFree(nsdb);
 1440|  39.0k|}
xmlParserNsLookupSax:
 1566|  89.2k|xmlParserNsLookupSax(xmlParserCtxt *ctxt, const xmlChar *prefix) {
 1567|  89.2k|    xmlHashedString hprefix;
 1568|  89.2k|    int nsIndex;
 1569|       |
 1570|  89.2k|    if (prefix == ctxt->str_xml)
  ------------------
  |  Branch (1570:9): [True: 52.5k, False: 36.6k]
  ------------------
 1571|  52.5k|        return(NULL);
 1572|       |
 1573|  36.6k|    hprefix.name = prefix;
 1574|  36.6k|    if (prefix != NULL)
  ------------------
  |  Branch (1574:9): [True: 25.1k, False: 11.5k]
  ------------------
 1575|  25.1k|        hprefix.hashValue = xmlDictComputeHash(ctxt->dict, prefix);
 1576|  11.5k|    else
 1577|  11.5k|        hprefix.hashValue = 0;
 1578|  36.6k|    nsIndex = xmlParserNsLookup(ctxt, &hprefix, NULL);
 1579|  36.6k|    if ((nsIndex == INT_MAX) || (nsIndex < ctxt->nsdb->minNsIndex))
  ------------------
  |  Branch (1579:9): [True: 0, False: 36.6k]
  |  Branch (1579:33): [True: 0, False: 36.6k]
  ------------------
 1580|      0|        return(NULL);
 1581|       |
 1582|  36.6k|    return(ctxt->nsdb->extra[nsIndex].saxData);
 1583|  36.6k|}
xmlParserNsUpdateSax:
 1597|   141k|                     void *saxData) {
 1598|   141k|    xmlHashedString hprefix;
 1599|   141k|    int nsIndex;
 1600|       |
 1601|   141k|    if (prefix == ctxt->str_xml)
  ------------------
  |  Branch (1601:9): [True: 0, False: 141k]
  ------------------
 1602|      0|        return(-1);
 1603|       |
 1604|   141k|    hprefix.name = prefix;
 1605|   141k|    if (prefix != NULL)
  ------------------
  |  Branch (1605:9): [True: 115k, False: 26.8k]
  ------------------
 1606|   115k|        hprefix.hashValue = xmlDictComputeHash(ctxt->dict, prefix);
 1607|  26.8k|    else
 1608|  26.8k|        hprefix.hashValue = 0;
 1609|   141k|    nsIndex = xmlParserNsLookup(ctxt, &hprefix, NULL);
 1610|   141k|    if ((nsIndex == INT_MAX) || (nsIndex < ctxt->nsdb->minNsIndex))
  ------------------
  |  Branch (1610:9): [True: 0, False: 141k]
  |  Branch (1610:33): [True: 0, False: 141k]
  ------------------
 1611|      0|        return(-1);
 1612|       |
 1613|   141k|    ctxt->nsdb->extra[nsIndex].saxData = saxData;
 1614|   141k|    return(0);
 1615|   141k|}
xmlCtxtPushInput:
 1892|   274k|{
 1893|   274k|    char *directory = NULL;
 1894|   274k|    int maxDepth;
 1895|       |
 1896|   274k|    if ((ctxt == NULL) || (value == NULL))
  ------------------
  |  Branch (1896:9): [True: 0, False: 274k]
  |  Branch (1896:27): [True: 1.91k, False: 272k]
  ------------------
 1897|  1.91k|        return(-1);
 1898|       |
 1899|   272k|    maxDepth = (ctxt->options & XML_PARSE_HUGE) ? 40 : 20;
  ------------------
  |  Branch (1899:16): [True: 77.5k, False: 194k]
  ------------------
 1900|       |
 1901|   272k|    if (ctxt->inputNr >= ctxt->inputMax) {
  ------------------
  |  Branch (1901:9): [True: 6.36k, False: 265k]
  ------------------
 1902|  6.36k|        xmlParserInputPtr *tmp;
 1903|  6.36k|        int newSize;
 1904|       |
 1905|  6.36k|        newSize = xmlGrowCapacity(ctxt->inputMax, sizeof(tmp[0]),
 1906|  6.36k|                                  5, maxDepth);
 1907|  6.36k|        if (newSize < 0) {
  ------------------
  |  Branch (1907:13): [True: 1, False: 6.36k]
  ------------------
 1908|      1|            xmlFatalErrMsg(ctxt, XML_ERR_RESOURCE_LIMIT,
 1909|      1|                           "Maximum entity nesting depth exceeded");
 1910|      1|            return(-1);
 1911|      1|        }
 1912|  6.36k|        tmp = xmlRealloc(ctxt->inputTab, newSize * sizeof(tmp[0]));
 1913|  6.36k|        if (tmp == NULL) {
  ------------------
  |  Branch (1913:13): [True: 1, False: 6.35k]
  ------------------
 1914|      1|            xmlErrMemory(ctxt);
 1915|      1|            return(-1);
 1916|      1|        }
 1917|  6.35k|        ctxt->inputTab = tmp;
 1918|  6.35k|        ctxt->inputMax = newSize;
 1919|  6.35k|    }
 1920|       |
 1921|   272k|    if ((ctxt->inputNr == 0) && (value->filename != NULL)) {
  ------------------
  |  Branch (1921:9): [True: 171k, False: 100k]
  |  Branch (1921:33): [True: 140k, False: 31.5k]
  ------------------
 1922|   140k|        directory = xmlParserGetDirectory(value->filename);
 1923|   140k|        if (directory == NULL) {
  ------------------
  |  Branch (1923:13): [True: 11, False: 140k]
  ------------------
 1924|     11|            xmlErrMemory(ctxt);
 1925|     11|            return(-1);
 1926|     11|        }
 1927|   140k|    }
 1928|       |
 1929|   272k|    if (ctxt->input_id >= INT_MAX) {
  ------------------
  |  Branch (1929:9): [True: 0, False: 272k]
  ------------------
 1930|      0|        xmlFatalErrMsg(ctxt, XML_ERR_RESOURCE_LIMIT, "Input ID overflow\n");
 1931|      0|        return(-1);
 1932|      0|    }
 1933|       |
 1934|   272k|    ctxt->inputTab[ctxt->inputNr] = value;
 1935|   272k|    ctxt->input = value;
 1936|       |
 1937|   272k|    if (ctxt->inputNr == 0) {
  ------------------
  |  Branch (1937:9): [True: 171k, False: 100k]
  ------------------
 1938|   171k|        xmlFree(ctxt->directory);
 1939|   171k|        ctxt->directory = directory;
 1940|   171k|    }
 1941|       |
 1942|       |    /*
 1943|       |     * The input ID is unused internally, but there are entity
 1944|       |     * loaders in downstream code that detect the main document
 1945|       |     * by checking for "input_id == 1".
 1946|       |     */
 1947|   272k|    value->id = ctxt->input_id++;
 1948|       |
 1949|   272k|    return(ctxt->inputNr++);
 1950|   272k|}
xmlCtxtPopInput:
 1960|   349k|{
 1961|   349k|    xmlParserInputPtr ret;
 1962|       |
 1963|   349k|    if (ctxt == NULL)
  ------------------
  |  Branch (1963:9): [True: 0, False: 349k]
  ------------------
 1964|      0|        return(NULL);
 1965|   349k|    if (ctxt->inputNr <= 0)
  ------------------
  |  Branch (1965:9): [True: 78.1k, False: 271k]
  ------------------
 1966|  78.1k|        return (NULL);
 1967|   271k|    ctxt->inputNr--;
 1968|   271k|    if (ctxt->inputNr > 0)
  ------------------
  |  Branch (1968:9): [True: 100k, False: 170k]
  ------------------
 1969|   100k|        ctxt->input = ctxt->inputTab[ctxt->inputNr - 1];
 1970|   170k|    else
 1971|   170k|        ctxt->input = NULL;
 1972|   271k|    ret = ctxt->inputTab[ctxt->inputNr];
 1973|       |    ctxt->inputTab[ctxt->inputNr] = NULL;
 1974|   271k|    return (ret);
 1975|   349k|}
nodePush:
 1988|   653k|{
 1989|   653k|    if (ctxt == NULL)
  ------------------
  |  Branch (1989:9): [True: 0, False: 653k]
  ------------------
 1990|      0|        return(0);
 1991|       |
 1992|   653k|    if (ctxt->nodeNr >= ctxt->nodeMax) {
  ------------------
  |  Branch (1992:9): [True: 41.9k, False: 611k]
  ------------------
 1993|  41.9k|        int maxDepth = (ctxt->options & XML_PARSE_HUGE) ? 2048 : 256;
  ------------------
  |  Branch (1993:24): [True: 21.0k, False: 20.8k]
  ------------------
 1994|  41.9k|        xmlNodePtr *tmp;
 1995|  41.9k|        int newSize;
 1996|       |
 1997|  41.9k|        newSize = xmlGrowCapacity(ctxt->nodeMax, sizeof(tmp[0]),
 1998|  41.9k|                                  10, maxDepth);
 1999|  41.9k|        if (newSize < 0) {
  ------------------
  |  Branch (1999:13): [True: 46, False: 41.8k]
  ------------------
 2000|     46|            xmlFatalErrMsgInt(ctxt, XML_ERR_RESOURCE_LIMIT,
 2001|     46|                    "Excessive depth in document: %d,"
 2002|     46|                    " use XML_PARSE_HUGE option\n",
 2003|     46|                    ctxt->nodeNr);
 2004|     46|            return(-1);
 2005|     46|        }
 2006|       |
 2007|  41.8k|	tmp = xmlRealloc(ctxt->nodeTab, newSize * sizeof(tmp[0]));
 2008|  41.8k|        if (tmp == NULL) {
  ------------------
  |  Branch (2008:13): [True: 14, False: 41.8k]
  ------------------
 2009|     14|            xmlErrMemory(ctxt);
 2010|     14|            return (-1);
 2011|     14|        }
 2012|  41.8k|        ctxt->nodeTab = tmp;
 2013|  41.8k|	ctxt->nodeMax = newSize;
 2014|  41.8k|    }
 2015|       |
 2016|   653k|    ctxt->nodeTab[ctxt->nodeNr] = value;
 2017|   653k|    ctxt->node = value;
 2018|   653k|    return (ctxt->nodeNr++);
 2019|   653k|}
nodePop:
 2031|   609k|{
 2032|   609k|    xmlNodePtr ret;
 2033|       |
 2034|   609k|    if (ctxt == NULL) return(NULL);
  ------------------
  |  Branch (2034:9): [True: 0, False: 609k]
  ------------------
 2035|   609k|    if (ctxt->nodeNr <= 0)
  ------------------
  |  Branch (2035:9): [True: 70.9k, False: 538k]
  ------------------
 2036|  70.9k|        return (NULL);
 2037|   538k|    ctxt->nodeNr--;
 2038|   538k|    if (ctxt->nodeNr > 0)
  ------------------
  |  Branch (2038:9): [True: 525k, False: 13.2k]
  ------------------
 2039|   525k|        ctxt->node = ctxt->nodeTab[ctxt->nodeNr - 1];
 2040|  13.2k|    else
 2041|  13.2k|        ctxt->node = NULL;
 2042|   538k|    ret = ctxt->nodeTab[ctxt->nodeNr];
 2043|       |    ctxt->nodeTab[ctxt->nodeNr] = NULL;
 2044|   538k|    return (ret);
 2045|   609k|}
xmlSkipBlankChars:
 2318|  4.03M|xmlSkipBlankChars(xmlParserCtxt *ctxt) {
 2319|  4.03M|    const xmlChar *cur;
 2320|  4.03M|    int res = 0;
 2321|       |
 2322|  4.03M|    cur = ctxt->input->cur;
 2323|  4.03M|    while (IS_BLANK_CH(*cur)) {
 2324|  1.64M|        if (*cur == '\n') {
  ------------------
  |  Branch (2324:13): [True: 598k, False: 1.04M]
  ------------------
 2325|   598k|            ctxt->input->line++; ctxt->input->col = 1;
 2326|  1.04M|        } else {
 2327|  1.04M|            ctxt->input->col++;
 2328|  1.04M|        }
 2329|  1.64M|        cur++;
 2330|  1.64M|        if (res < INT_MAX)
  ------------------
  |  Branch (2330:13): [True: 1.64M, False: 0]
  ------------------
 2331|  1.64M|            res++;
 2332|  1.64M|        if (*cur == 0) {
  ------------------
  |  Branch (2332:13): [True: 23.0k, False: 1.61M]
  ------------------
 2333|  23.0k|            ctxt->input->cur = cur;
 2334|  23.0k|            xmlParserGrow(ctxt);
 2335|  23.0k|            cur = ctxt->input->cur;
 2336|  23.0k|        }
 2337|  1.64M|    }
 2338|  4.03M|    ctxt->input->cur = cur;
 2339|       |
 2340|  4.03M|    if (res > 4)
  ------------------
  |  Branch (2340:9): [True: 38.5k, False: 3.99M]
  ------------------
 2341|  38.5k|        GROW;
  ------------------
  |  | 2271|  38.5k|    if ((!PARSER_PROGRESSIVE(ctxt)) && \
  |  |  ------------------
  |  |  |  |   47|  38.5k|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|  38.5k|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2271:9): [True: 36.5k, False: 2.03k]
  |  |  ------------------
  |  | 2272|  38.5k|        (ctxt->input->end - ctxt->input->cur < INPUT_CHUNK)) \
  |  |  ------------------
  |  |  |  |   63|  36.5k|#define INPUT_CHUNK	250
  |  |  ------------------
  |  |  |  Branch (2272:9): [True: 2.37k, False: 34.1k]
  |  |  ------------------
  |  | 2273|  38.5k|	xmlParserGrow(ctxt);
  ------------------
 2342|       |
 2343|  4.03M|    return(res);
 2344|  4.03M|}
xmlParseCharRef:
 2529|  63.2k|xmlParseCharRef(xmlParserCtxt *ctxt) {
 2530|  63.2k|    int val = 0;
 2531|  63.2k|    int count = 0;
 2532|       |
 2533|       |    /*
 2534|       |     * Using RAW/CUR/NEXT is okay since we are working on ASCII range here
 2535|       |     */
 2536|  63.2k|    if ((RAW == '&') && (NXT(1) == '#') &&
  ------------------
  |  | 2224|  63.2k|#define RAW (*ctxt->input->cur)
  ------------------
                  if ((RAW == '&') && (NXT(1) == '#') &&
  ------------------
  |  | 2226|  63.2k|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
  |  Branch (2536:9): [True: 63.2k, False: 0]
  |  Branch (2536:25): [True: 63.2k, False: 0]
  ------------------
 2537|  63.2k|        (NXT(2) == 'x')) {
  ------------------
  |  | 2226|  63.2k|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
  |  Branch (2537:9): [True: 22.8k, False: 40.4k]
  ------------------
 2538|  22.8k|	SKIP(3);
  ------------------
  |  | 2248|  22.8k|#define SKIP(val) do {							\
  |  | 2249|  22.8k|    ctxt->input->cur += (val),ctxt->input->col+=(val);			\
  |  | 2250|  22.8k|    if (*ctxt->input->cur == 0)						\
  |  |  ------------------
  |  |  |  Branch (2250:9): [True: 234, False: 22.5k]
  |  |  ------------------
  |  | 2251|  22.8k|        xmlParserGrow(ctxt);						\
  |  | 2252|  22.8k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2252:12): [Folded, False: 22.8k]
  |  |  ------------------
  ------------------
 2539|  22.8k|	GROW;
  ------------------
  |  | 2271|  22.8k|    if ((!PARSER_PROGRESSIVE(ctxt)) && \
  |  |  ------------------
  |  |  |  |   47|  22.8k|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|  22.8k|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2271:9): [True: 14.7k, False: 8.07k]
  |  |  ------------------
  |  | 2272|  22.8k|        (ctxt->input->end - ctxt->input->cur < INPUT_CHUNK)) \
  |  |  ------------------
  |  |  |  |   63|  14.7k|#define INPUT_CHUNK	250
  |  |  ------------------
  |  |  |  Branch (2272:9): [True: 1.33k, False: 13.4k]
  |  |  ------------------
  |  | 2273|  22.8k|	xmlParserGrow(ctxt);
  ------------------
 2540|  89.0k|	while ((RAW != ';') && (PARSER_STOPPED(ctxt) == 0)) {
  ------------------
  |  | 2224|  89.0k|#define RAW (*ctxt->input->cur)
  ------------------
              	while ((RAW != ';') && (PARSER_STOPPED(ctxt) == 0)) {
  ------------------
  |  |   44|  68.4k|#define PARSER_STOPPED(ctxt) ((ctxt)->disableSAX > 1)
  ------------------
  |  Branch (2540:9): [True: 68.4k, False: 20.6k]
  |  Branch (2540:25): [True: 68.4k, False: 0]
  ------------------
 2541|  68.4k|	    if (count++ > 20) {
  ------------------
  |  Branch (2541:10): [True: 1.62k, False: 66.8k]
  ------------------
 2542|  1.62k|		count = 0;
 2543|  1.62k|		GROW;
  ------------------
  |  | 2271|  1.62k|    if ((!PARSER_PROGRESSIVE(ctxt)) && \
  |  |  ------------------
  |  |  |  |   47|  1.62k|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|  1.62k|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2271:9): [True: 1.28k, False: 343]
  |  |  ------------------
  |  | 2272|  1.62k|        (ctxt->input->end - ctxt->input->cur < INPUT_CHUNK)) \
  |  |  ------------------
  |  |  |  |   63|  1.28k|#define INPUT_CHUNK	250
  |  |  ------------------
  |  |  |  Branch (2272:9): [True: 294, False: 986]
  |  |  ------------------
  |  | 2273|  1.62k|	xmlParserGrow(ctxt);
  ------------------
 2544|  1.62k|	    }
 2545|  68.4k|	    if ((RAW >= '0') && (RAW <= '9'))
  ------------------
  |  | 2224|  68.4k|#define RAW (*ctxt->input->cur)
  ------------------
              	    if ((RAW >= '0') && (RAW <= '9'))
  ------------------
  |  | 2224|  67.8k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (2545:10): [True: 67.8k, False: 618]
  |  Branch (2545:26): [True: 44.2k, False: 23.6k]
  ------------------
 2546|  44.2k|	        val = val * 16 + (CUR - '0');
  ------------------
  |  | 2225|  44.2k|#define CUR (*ctxt->input->cur)
  ------------------
 2547|  24.2k|	    else if ((RAW >= 'a') && (RAW <= 'f') && (count < 20))
  ------------------
  |  | 2224|  24.2k|#define RAW (*ctxt->input->cur)
  ------------------
              	    else if ((RAW >= 'a') && (RAW <= 'f') && (count < 20))
  ------------------
  |  | 2224|  17.5k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (2547:15): [True: 17.5k, False: 6.65k]
  |  Branch (2547:31): [True: 16.6k, False: 960]
  |  Branch (2547:47): [True: 16.4k, False: 203]
  ------------------
 2548|  16.4k|	        val = val * 16 + (CUR - 'a') + 10;
  ------------------
  |  | 2225|  16.4k|#define CUR (*ctxt->input->cur)
  ------------------
 2549|  7.81k|	    else if ((RAW >= 'A') && (RAW <= 'F') && (count < 20))
  ------------------
  |  | 2224|  7.81k|#define RAW (*ctxt->input->cur)
  ------------------
              	    else if ((RAW >= 'A') && (RAW <= 'F') && (count < 20))
  ------------------
  |  | 2224|  7.05k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (2549:15): [True: 7.05k, False: 760]
  |  Branch (2549:31): [True: 5.83k, False: 1.22k]
  |  Branch (2549:47): [True: 5.62k, False: 216]
  ------------------
 2550|  5.62k|	        val = val * 16 + (CUR - 'A') + 10;
  ------------------
  |  | 2225|  5.62k|#define CUR (*ctxt->input->cur)
  ------------------
 2551|  2.19k|	    else {
 2552|  2.19k|		xmlFatalErr(ctxt, XML_ERR_INVALID_HEX_CHARREF, NULL);
 2553|  2.19k|		val = 0;
 2554|  2.19k|		break;
 2555|  2.19k|	    }
 2556|  66.2k|	    if (val > 0x110000)
  ------------------
  |  Branch (2556:10): [True: 18.0k, False: 48.2k]
  ------------------
 2557|  18.0k|	        val = 0x110000;
 2558|       |
 2559|  66.2k|	    NEXT;
  ------------------
  |  | 2279|  66.2k|#define NEXT xmlNextChar(ctxt)
  ------------------
 2560|  66.2k|	    count++;
 2561|  66.2k|	}
 2562|  22.8k|	if (RAW == ';') {
  ------------------
  |  | 2224|  22.8k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (2562:6): [True: 20.6k, False: 2.19k]
  ------------------
 2563|       |	    /* on purpose to avoid reentrancy problems with NEXT and SKIP */
 2564|  20.6k|	    ctxt->input->col++;
 2565|  20.6k|	    ctxt->input->cur++;
 2566|  20.6k|	}
 2567|  40.4k|    } else if  ((RAW == '&') && (NXT(1) == '#')) {
  ------------------
  |  | 2224|  40.4k|#define RAW (*ctxt->input->cur)
  ------------------
                  } else if  ((RAW == '&') && (NXT(1) == '#')) {
  ------------------
  |  | 2226|  40.4k|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
  |  Branch (2567:17): [True: 40.4k, False: 0]
  |  Branch (2567:33): [True: 40.4k, False: 0]
  ------------------
 2568|  40.4k|	SKIP(2);
  ------------------
  |  | 2248|  40.4k|#define SKIP(val) do {							\
  |  | 2249|  40.4k|    ctxt->input->cur += (val),ctxt->input->col+=(val);			\
  |  | 2250|  40.4k|    if (*ctxt->input->cur == 0)						\
  |  |  ------------------
  |  |  |  Branch (2250:9): [True: 371, False: 40.0k]
  |  |  ------------------
  |  | 2251|  40.4k|        xmlParserGrow(ctxt);						\
  |  | 2252|  40.4k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2252:12): [Folded, False: 40.4k]
  |  |  ------------------
  ------------------
 2569|  40.4k|	GROW;
  ------------------
  |  | 2271|  40.4k|    if ((!PARSER_PROGRESSIVE(ctxt)) && \
  |  |  ------------------
  |  |  |  |   47|  40.4k|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|  40.4k|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2271:9): [True: 25.6k, False: 14.8k]
  |  |  ------------------
  |  | 2272|  40.4k|        (ctxt->input->end - ctxt->input->cur < INPUT_CHUNK)) \
  |  |  ------------------
  |  |  |  |   63|  25.6k|#define INPUT_CHUNK	250
  |  |  ------------------
  |  |  |  Branch (2272:9): [True: 7.42k, False: 18.1k]
  |  |  ------------------
  |  | 2273|  40.4k|	xmlParserGrow(ctxt);
  ------------------
 2570|   146k|	while (RAW != ';') { /* loop blocked by count */
  ------------------
  |  | 2224|   146k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (2570:9): [True: 109k, False: 37.2k]
  ------------------
 2571|   109k|	    if (count++ > 20) {
  ------------------
  |  Branch (2571:10): [True: 2.45k, False: 106k]
  ------------------
 2572|  2.45k|		count = 0;
 2573|  2.45k|		GROW;
  ------------------
  |  | 2271|  2.45k|    if ((!PARSER_PROGRESSIVE(ctxt)) && \
  |  |  ------------------
  |  |  |  |   47|  2.45k|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|  2.45k|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2271:9): [True: 2.23k, False: 216]
  |  |  ------------------
  |  | 2272|  2.45k|        (ctxt->input->end - ctxt->input->cur < INPUT_CHUNK)) \
  |  |  ------------------
  |  |  |  |   63|  2.23k|#define INPUT_CHUNK	250
  |  |  ------------------
  |  |  |  Branch (2272:9): [True: 623, False: 1.61k]
  |  |  ------------------
  |  | 2273|  2.45k|	xmlParserGrow(ctxt);
  ------------------
 2574|  2.45k|	    }
 2575|   109k|	    if ((RAW >= '0') && (RAW <= '9'))
  ------------------
  |  | 2224|   109k|#define RAW (*ctxt->input->cur)
  ------------------
              	    if ((RAW >= '0') && (RAW <= '9'))
  ------------------
  |  | 2224|   107k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (2575:10): [True: 107k, False: 1.26k]
  |  Branch (2575:26): [True: 105k, False: 1.94k]
  ------------------
 2576|   105k|	        val = val * 10 + (CUR - '0');
  ------------------
  |  | 2225|   105k|#define CUR (*ctxt->input->cur)
  ------------------
 2577|  3.20k|	    else {
 2578|  3.20k|		xmlFatalErr(ctxt, XML_ERR_INVALID_DEC_CHARREF, NULL);
 2579|  3.20k|		val = 0;
 2580|  3.20k|		break;
 2581|  3.20k|	    }
 2582|   105k|	    if (val > 0x110000)
  ------------------
  |  Branch (2582:10): [True: 21.9k, False: 83.9k]
  ------------------
 2583|  21.9k|	        val = 0x110000;
 2584|       |
 2585|   105k|	    NEXT;
  ------------------
  |  | 2279|   105k|#define NEXT xmlNextChar(ctxt)
  ------------------
 2586|   105k|	    count++;
 2587|   105k|	}
 2588|  40.4k|	if (RAW == ';') {
  ------------------
  |  | 2224|  40.4k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (2588:6): [True: 37.2k, False: 3.20k]
  ------------------
 2589|       |	    /* on purpose to avoid reentrancy problems with NEXT and SKIP */
 2590|  37.2k|	    ctxt->input->col++;
 2591|  37.2k|	    ctxt->input->cur++;
 2592|  37.2k|	}
 2593|  40.4k|    } else {
 2594|      0|        if (RAW == '&')
  ------------------
  |  | 2224|      0|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (2594:13): [True: 0, False: 0]
  ------------------
 2595|      0|            SKIP(1);
  ------------------
  |  | 2248|      0|#define SKIP(val) do {							\
  |  | 2249|      0|    ctxt->input->cur += (val),ctxt->input->col+=(val);			\
  |  | 2250|      0|    if (*ctxt->input->cur == 0)						\
  |  |  ------------------
  |  |  |  Branch (2250:9): [True: 0, False: 0]
  |  |  ------------------
  |  | 2251|      0|        xmlParserGrow(ctxt);						\
  |  | 2252|      0|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2252:12): [Folded, False: 0]
  |  |  ------------------
  ------------------
 2596|      0|        xmlFatalErr(ctxt, XML_ERR_INVALID_CHARREF, NULL);
 2597|      0|    }
 2598|       |
 2599|       |    /*
 2600|       |     * [ WFC: Legal Character ]
 2601|       |     * Characters referred to using character references must match the
 2602|       |     * production for Char.
 2603|       |     */
 2604|  63.2k|    if (val >= 0x110000) {
  ------------------
  |  Branch (2604:9): [True: 485, False: 62.7k]
  ------------------
 2605|    485|        xmlFatalErrMsgInt(ctxt, XML_ERR_INVALID_CHAR,
 2606|    485|                "xmlParseCharRef: character reference out of bounds\n",
 2607|    485|	        val);
 2608|    485|        val = 0xFFFD;
 2609|  62.7k|    } else if (!IS_CHAR(val)) {
  ------------------
  |  |  115|  62.7k|#define IS_CHAR(c)   xmlIsCharQ(c)
  |  |  ------------------
  |  |  |  |  117|  62.7k|#define xmlIsCharQ(c)		(((c) < 0x100) ? \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (117:25): [True: 60.1k, False: 2.58k]
  |  |  |  |  ------------------
  |  |  |  |  118|  62.7k|				 xmlIsChar_ch((c)) :\
  |  |  |  |  ------------------
  |  |  |  |  |  |  108|  60.1k|#define xmlIsChar_ch(c)		(((0x9 <= (c)) && ((c) <= 0xa)) || \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (108:28): [True: 53.9k, False: 6.26k]
  |  |  |  |  |  |  |  Branch (108:44): [True: 14.7k, False: 39.1k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  109|  60.1k|				 ((c) == 0xd) || \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (109:6): [True: 7.17k, False: 38.2k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  110|  60.1k|				  (0x20 <= (c)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (110:7): [True: 31.3k, False: 6.92k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  119|  62.7k|				(((0x100 <= (c)) && ((c) <= 0xd7ff)) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (119:7): [True: 2.58k, False: 0]
  |  |  |  |  |  Branch (119:25): [True: 1.79k, False: 785]
  |  |  |  |  ------------------
  |  |  |  |  120|  2.58k|				 ((0xe000 <= (c)) && ((c) <= 0xfffd)) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (120:7): [True: 713, False: 72]
  |  |  |  |  |  Branch (120:26): [True: 287, False: 426]
  |  |  |  |  ------------------
  |  |  |  |  121|  2.58k|				 ((0x10000 <= (c)) && ((c) <= 0x10ffff))))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (121:7): [True: 385, False: 113]
  |  |  |  |  |  Branch (121:27): [True: 385, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (2609:16): [True: 7.03k, False: 55.7k]
  ------------------
 2610|  7.03k|        xmlFatalErrMsgInt(ctxt, XML_ERR_INVALID_CHAR,
 2611|  7.03k|                          "xmlParseCharRef: invalid xmlChar value %d\n",
 2612|  7.03k|	                  val);
 2613|  7.03k|    }
 2614|  63.2k|    return(val);
 2615|  63.2k|}
xmlScanName:
 3051|  2.39M|xmlScanName(const xmlChar *ptr, size_t maxSize, int flags) {
 3052|  2.39M|    int stop = flags & XML_SCAN_NC ? ':' : 0;
  ------------------
  |  |   69|  2.39M|#define XML_SCAN_NC         1
  ------------------
  |  Branch (3052:16): [True: 99.1k, False: 2.29M]
  ------------------
 3053|  2.39M|    int old10 = flags & XML_SCAN_OLD10 ? 1 : 0;
  ------------------
  |  |   71|  2.39M|#define XML_SCAN_OLD10      4
  ------------------
  |  Branch (3053:17): [True: 726k, False: 1.66M]
  ------------------
 3054|       |
 3055|  10.0M|    while (1) {
  ------------------
  |  Branch (3055:12): [True: 10.0M, Folded]
  ------------------
 3056|  10.0M|        int c, len;
 3057|       |
 3058|  10.0M|        c = *ptr;
 3059|  10.0M|        if (c < 0x80) {
  ------------------
  |  Branch (3059:13): [True: 8.19M, False: 1.87M]
  ------------------
 3060|  8.19M|            if (c == stop)
  ------------------
  |  Branch (3060:17): [True: 56.5k, False: 8.14M]
  ------------------
 3061|  56.5k|                break;
 3062|  8.14M|            len = 1;
 3063|  8.14M|        } else {
 3064|  1.87M|            len = 4;
 3065|  1.87M|            c = xmlGetUTF8Char(ptr, &len);
 3066|  1.87M|            if (c < 0)
  ------------------
  |  Branch (3066:17): [True: 2.06k, False: 1.87M]
  ------------------
 3067|  2.06k|                break;
 3068|  1.87M|        }
 3069|       |
 3070|  10.0M|        if (flags & XML_SCAN_NMTOKEN ?
  ------------------
  |  |   70|  10.0M|#define XML_SCAN_NMTOKEN    2
  ------------------
  |  Branch (3070:13): [True: 7.67M, False: 2.34M]
  |  Branch (3070:13): [True: 2.33M, False: 7.68M]
  ------------------
 3071|  7.67M|                !xmlIsNameChar(c, old10) :
 3072|  10.0M|                !xmlIsNameStartChar(c, old10))
 3073|  2.33M|            break;
 3074|       |
 3075|  7.68M|        if ((size_t) len > maxSize)
  ------------------
  |  Branch (3075:13): [True: 59, False: 7.68M]
  ------------------
 3076|     59|            return(NULL);
 3077|  7.68M|        ptr += len;
 3078|  7.68M|        maxSize -= len;
 3079|  7.68M|        flags |= XML_SCAN_NMTOKEN;
  ------------------
  |  |   70|  7.68M|#define XML_SCAN_NMTOKEN    2
  ------------------
 3080|  7.68M|    }
 3081|       |
 3082|  2.39M|    return(ptr);
 3083|  2.39M|}
xmlParseName:
 3150|  2.13M|xmlParseName(xmlParserCtxt *ctxt) {
 3151|  2.13M|    const xmlChar *in;
 3152|  2.13M|    const xmlChar *ret;
 3153|  2.13M|    size_t count = 0;
 3154|  2.13M|    size_t maxLength = (ctxt->options & XML_PARSE_HUGE) ?
  ------------------
  |  Branch (3154:24): [True: 918k, False: 1.21M]
  ------------------
 3155|   918k|                       XML_MAX_TEXT_LENGTH :
  ------------------
  |  |   50|   918k|#define XML_MAX_TEXT_LENGTH 10000000
  ------------------
 3156|  2.13M|                       XML_MAX_NAME_LENGTH;
  ------------------
  |  |   65|  3.34M|#define XML_MAX_NAME_LENGTH 50000
  ------------------
 3157|       |
 3158|  2.13M|    GROW;
  ------------------
  |  | 2271|  2.13M|    if ((!PARSER_PROGRESSIVE(ctxt)) && \
  |  |  ------------------
  |  |  |  |   47|  2.13M|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|  2.13M|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2271:9): [True: 1.31M, False: 814k]
  |  |  ------------------
  |  | 2272|  2.13M|        (ctxt->input->end - ctxt->input->cur < INPUT_CHUNK)) \
  |  |  ------------------
  |  |  |  |   63|  1.31M|#define INPUT_CHUNK	250
  |  |  ------------------
  |  |  |  Branch (2272:9): [True: 521k, False: 798k]
  |  |  ------------------
  |  | 2273|  2.13M|	xmlParserGrow(ctxt);
  ------------------
 3159|       |
 3160|       |    /*
 3161|       |     * Accelerator for simple ASCII names
 3162|       |     */
 3163|  2.13M|    in = ctxt->input->cur;
 3164|  2.13M|    if (((*in >= 0x61) && (*in <= 0x7A)) ||
  ------------------
  |  Branch (3164:10): [True: 1.90M, False: 229k]
  |  Branch (3164:27): [True: 1.87M, False: 30.3k]
  ------------------
 3165|   260k|	((*in >= 0x41) && (*in <= 0x5A)) ||
  ------------------
  |  Branch (3165:3): [True: 112k, False: 147k]
  |  Branch (3165:20): [True: 77.8k, False: 34.4k]
  ------------------
 3166|  1.95M|	(*in == '_') || (*in == ':')) {
  ------------------
  |  Branch (3166:2): [True: 2.10k, False: 180k]
  |  Branch (3166:18): [True: 5.14k, False: 174k]
  ------------------
 3167|  1.95M|	in++;
 3168|  15.5M|	while (((*in >= 0x61) && (*in <= 0x7A)) ||
  ------------------
  |  Branch (3168:10): [True: 3.34M, False: 12.2M]
  |  Branch (3168:27): [True: 3.29M, False: 45.7k]
  ------------------
 3169|  12.2M|	       ((*in >= 0x41) && (*in <= 0x5A)) ||
  ------------------
  |  Branch (3169:10): [True: 7.36M, False: 4.89M]
  |  Branch (3169:27): [True: 7.30M, False: 62.5k]
  ------------------
 3170|  4.95M|	       ((*in >= 0x30) && (*in <= 0x39)) ||
  ------------------
  |  Branch (3170:10): [True: 4.21M, False: 740k]
  |  Branch (3170:27): [True: 2.77M, False: 1.43M]
  ------------------
 3171|  2.17M|	       (*in == '_') || (*in == '-') ||
  ------------------
  |  Branch (3171:9): [True: 7.63k, False: 2.16M]
  |  Branch (3171:25): [True: 78.1k, False: 2.09M]
  ------------------
 3172|  2.09M|	       (*in == ':') || (*in == '.'))
  ------------------
  |  Branch (3172:9): [True: 121k, False: 1.97M]
  |  Branch (3172:25): [True: 12.0k, False: 1.95M]
  ------------------
 3173|  13.5M|	    in++;
 3174|  1.95M|	if ((*in > 0) && (*in < 0x80)) {
  ------------------
  |  Branch (3174:6): [True: 1.92M, False: 32.6k]
  |  Branch (3174:19): [True: 1.90M, False: 16.2k]
  ------------------
 3175|  1.90M|	    count = in - ctxt->input->cur;
 3176|  1.90M|            if (count > maxLength) {
  ------------------
  |  Branch (3176:17): [True: 72, False: 1.90M]
  ------------------
 3177|     72|                xmlFatalErr(ctxt, XML_ERR_NAME_TOO_LONG, "Name");
 3178|     72|                return(NULL);
 3179|     72|            }
 3180|  1.90M|	    ret = xmlDictLookup(ctxt->dict, ctxt->input->cur, count);
 3181|  1.90M|	    ctxt->input->cur = in;
 3182|  1.90M|	    ctxt->input->col += count;
 3183|  1.90M|	    if (ret == NULL)
  ------------------
  |  Branch (3183:10): [True: 2, False: 1.90M]
  ------------------
 3184|      2|	        xmlErrMemory(ctxt);
 3185|  1.90M|	    return(ret);
 3186|  1.90M|	}
 3187|  1.95M|    }
 3188|       |    /* accelerator for special cases */
 3189|   223k|    return(xmlParseNameComplex(ctxt));
 3190|  2.13M|}
xmlParseNmtoken:
 3380|  33.3k|xmlParseNmtoken(xmlParserCtxt *ctxt) {
 3381|  33.3k|    xmlChar buf[XML_MAX_NAMELEN + 5];
 3382|  33.3k|    xmlChar *ret;
 3383|  33.3k|    int len = 0, l;
 3384|  33.3k|    int c;
 3385|  33.3k|    int maxLength = (ctxt->options & XML_PARSE_HUGE) ?
  ------------------
  |  Branch (3385:21): [True: 14.3k, False: 18.9k]
  ------------------
 3386|  14.3k|                    XML_MAX_TEXT_LENGTH :
  ------------------
  |  |   50|  14.3k|#define XML_MAX_TEXT_LENGTH 10000000
  ------------------
 3387|  33.3k|                    XML_MAX_NAME_LENGTH;
  ------------------
  |  |   65|  18.9k|#define XML_MAX_NAME_LENGTH 50000
  ------------------
 3388|  33.3k|    int old10 = (ctxt->options & XML_PARSE_OLD10) ? 1 : 0;
  ------------------
  |  Branch (3388:17): [True: 11.8k, False: 21.5k]
  ------------------
 3389|       |
 3390|  33.3k|    c = xmlCurrentChar(ctxt, &l);
 3391|       |
 3392|   154k|    while (xmlIsNameChar(c, old10)) {
  ------------------
  |  Branch (3392:12): [True: 121k, False: 32.4k]
  ------------------
 3393|   121k|	COPY_BUF(buf, len, c);
  ------------------
  |  | 2296|   121k|    if (v < 0x80) b[i++] = v;						\
  |  |  ------------------
  |  |  |  Branch (2296:9): [True: 90.3k, False: 31.2k]
  |  |  ------------------
  |  | 2297|   121k|    else i += xmlCopyCharMultiByte(&b[i],v)
  ------------------
 3394|   121k|	NEXTL(l);
  ------------------
  |  | 2288|   121k|#define NEXTL(l) do {							\
  |  | 2289|   121k|    if (*(ctxt->input->cur) == '\n') {					\
  |  |  ------------------
  |  |  |  Branch (2289:9): [True: 0, False: 121k]
  |  |  ------------------
  |  | 2290|      0|	ctxt->input->line++; ctxt->input->col = 1;			\
  |  | 2291|   121k|    } else ctxt->input->col++;						\
  |  | 2292|   121k|    ctxt->input->cur += l;				\
  |  | 2293|   121k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2293:12): [Folded, False: 121k]
  |  |  ------------------
  ------------------
 3395|   121k|	c = xmlCurrentChar(ctxt, &l);
 3396|   121k|	if (len >= XML_MAX_NAMELEN) {
  ------------------
  |  |   87|   121k|#define XML_MAX_NAMELEN 100
  ------------------
  |  Branch (3396:6): [True: 890, False: 120k]
  ------------------
 3397|       |	    /*
 3398|       |	     * Okay someone managed to make a huge token, so he's ready to pay
 3399|       |	     * for the processing speed.
 3400|       |	     */
 3401|    890|	    xmlChar *buffer;
 3402|    890|	    int max = len * 2;
 3403|       |
 3404|    890|	    buffer = xmlMalloc(max);
 3405|    890|	    if (buffer == NULL) {
  ------------------
  |  Branch (3405:10): [True: 0, False: 890]
  ------------------
 3406|      0|	        xmlErrMemory(ctxt);
 3407|      0|		return(NULL);
 3408|      0|	    }
 3409|    890|	    memcpy(buffer, buf, len);
 3410|  4.07M|	    while (xmlIsNameChar(c, old10)) {
  ------------------
  |  Branch (3410:13): [True: 4.07M, False: 801]
  ------------------
 3411|  4.07M|		if (len + 10 > max) {
  ------------------
  |  Branch (3411:7): [True: 3.07k, False: 4.07M]
  ------------------
 3412|  3.07k|		    xmlChar *tmp;
 3413|  3.07k|                    int newSize;
 3414|       |
 3415|  3.07k|                    newSize = xmlGrowCapacity(max, 1, 1, maxLength);
 3416|  3.07k|                    if (newSize < 0) {
  ------------------
  |  Branch (3416:25): [True: 87, False: 2.98k]
  ------------------
 3417|     87|                        xmlFatalErr(ctxt, XML_ERR_NAME_TOO_LONG, "NmToken");
 3418|     87|                        xmlFree(buffer);
 3419|     87|                        return(NULL);
 3420|     87|                    }
 3421|  2.98k|		    tmp = xmlRealloc(buffer, newSize);
 3422|  2.98k|		    if (tmp == NULL) {
  ------------------
  |  Branch (3422:11): [True: 2, False: 2.98k]
  ------------------
 3423|      2|			xmlErrMemory(ctxt);
 3424|      2|			xmlFree(buffer);
 3425|      2|			return(NULL);
 3426|      2|		    }
 3427|  2.98k|		    buffer = tmp;
 3428|  2.98k|                    max = newSize;
 3429|  2.98k|		}
 3430|  4.07M|		COPY_BUF(buffer, len, c);
  ------------------
  |  | 2296|  4.07M|    if (v < 0x80) b[i++] = v;						\
  |  |  ------------------
  |  |  |  Branch (2296:9): [True: 1.30M, False: 2.77M]
  |  |  ------------------
  |  | 2297|  4.07M|    else i += xmlCopyCharMultiByte(&b[i],v)
  ------------------
 3431|  4.07M|		NEXTL(l);
  ------------------
  |  | 2288|  4.07M|#define NEXTL(l) do {							\
  |  | 2289|  4.07M|    if (*(ctxt->input->cur) == '\n') {					\
  |  |  ------------------
  |  |  |  Branch (2289:9): [True: 0, False: 4.07M]
  |  |  ------------------
  |  | 2290|      0|	ctxt->input->line++; ctxt->input->col = 1;			\
  |  | 2291|  4.07M|    } else ctxt->input->col++;						\
  |  | 2292|  4.07M|    ctxt->input->cur += l;				\
  |  | 2293|  4.07M|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2293:12): [Folded, False: 4.07M]
  |  |  ------------------
  ------------------
 3432|  4.07M|		c = xmlCurrentChar(ctxt, &l);
 3433|  4.07M|	    }
 3434|    801|	    buffer[len] = 0;
 3435|    801|	    return(buffer);
 3436|    890|	}
 3437|   121k|    }
 3438|  32.4k|    if (len == 0)
  ------------------
  |  Branch (3438:9): [True: 7.42k, False: 25.0k]
  ------------------
 3439|  7.42k|        return(NULL);
 3440|  25.0k|    if (len > maxLength) {
  ------------------
  |  Branch (3440:9): [True: 0, False: 25.0k]
  ------------------
 3441|      0|        xmlFatalErr(ctxt, XML_ERR_NAME_TOO_LONG, "NmToken");
 3442|      0|        return(NULL);
 3443|      0|    }
 3444|  25.0k|    ret = xmlStrndup(buf, len);
 3445|  25.0k|    if (ret == NULL)
  ------------------
  |  Branch (3445:9): [True: 4, False: 25.0k]
  ------------------
 3446|      4|        xmlErrMemory(ctxt);
 3447|  25.0k|    return(ret);
 3448|  25.0k|}
xmlParseEntityValue:
 3610|   103k|xmlParseEntityValue(xmlParserCtxt *ctxt, xmlChar **orig) {
 3611|   103k|    unsigned maxLength = (ctxt->options & XML_PARSE_HUGE) ?
  ------------------
  |  Branch (3611:26): [True: 24.9k, False: 78.2k]
  ------------------
 3612|  24.9k|                         XML_MAX_HUGE_LENGTH :
  ------------------
  |  |   55|  24.9k|#define XML_MAX_HUGE_LENGTH 1000000000
  ------------------
 3613|   103k|                         XML_MAX_TEXT_LENGTH;
  ------------------
  |  |   50|   181k|#define XML_MAX_TEXT_LENGTH 10000000
  ------------------
 3614|   103k|    xmlSBuf buf;
 3615|   103k|    const xmlChar *start;
 3616|   103k|    int quote, length;
 3617|       |
 3618|   103k|    xmlSBufInit(&buf, maxLength);
 3619|       |
 3620|   103k|    GROW;
  ------------------
  |  | 2271|   103k|    if ((!PARSER_PROGRESSIVE(ctxt)) && \
  |  |  ------------------
  |  |  |  |   47|   103k|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|   103k|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2271:9): [True: 94.6k, False: 8.59k]
  |  |  ------------------
  |  | 2272|   103k|        (ctxt->input->end - ctxt->input->cur < INPUT_CHUNK)) \
  |  |  ------------------
  |  |  |  |   63|  94.6k|#define INPUT_CHUNK	250
  |  |  ------------------
  |  |  |  Branch (2272:9): [True: 20.6k, False: 74.0k]
  |  |  ------------------
  |  | 2273|   103k|	xmlParserGrow(ctxt);
  ------------------
 3621|       |
 3622|   103k|    quote = CUR;
  ------------------
  |  | 2225|   103k|#define CUR (*ctxt->input->cur)
  ------------------
 3623|   103k|    if ((quote != '"') && (quote != '\'')) {
  ------------------
  |  Branch (3623:9): [True: 4.04k, False: 99.2k]
  |  Branch (3623:27): [True: 0, False: 4.04k]
  ------------------
 3624|      0|	xmlFatalErr(ctxt, XML_ERR_ATTRIBUTE_NOT_STARTED, NULL);
 3625|      0|	return(NULL);
 3626|      0|    }
 3627|   103k|    CUR_PTR++;
  ------------------
  |  | 2227|   103k|#define CUR_PTR ctxt->input->cur
  ------------------
 3628|       |
 3629|   103k|    length = 0;
 3630|       |
 3631|       |    /*
 3632|       |     * Copy raw content of the entity into a buffer
 3633|       |     */
 3634|  43.0M|    while (1) {
  ------------------
  |  Branch (3634:12): [True: 43.0M, Folded]
  ------------------
 3635|  43.0M|        int c;
 3636|       |
 3637|  43.0M|        if (PARSER_STOPPED(ctxt))
  ------------------
  |  |   44|  43.0M|#define PARSER_STOPPED(ctxt) ((ctxt)->disableSAX > 1)
  |  |  ------------------
  |  |  |  Branch (44:30): [True: 3, False: 43.0M]
  |  |  ------------------
  ------------------
 3638|      3|            goto error;
 3639|       |
 3640|  43.0M|        if (CUR_PTR >= ctxt->input->end) {
  ------------------
  |  | 2227|  43.0M|#define CUR_PTR ctxt->input->cur
  ------------------
  |  Branch (3640:13): [True: 1.78k, False: 43.0M]
  ------------------
 3641|  1.78k|            xmlFatalErrMsg(ctxt, XML_ERR_ENTITY_NOT_FINISHED, NULL);
 3642|  1.78k|            goto error;
 3643|  1.78k|        }
 3644|       |
 3645|  43.0M|        c = CUR;
  ------------------
  |  | 2225|  43.0M|#define CUR (*ctxt->input->cur)
  ------------------
 3646|       |
 3647|  43.0M|        if (c == 0) {
  ------------------
  |  Branch (3647:13): [True: 289, False: 43.0M]
  ------------------
 3648|    289|            xmlFatalErrMsg(ctxt, XML_ERR_INVALID_CHAR,
 3649|    289|                    "invalid character in entity value\n");
 3650|    289|            goto error;
 3651|    289|        }
 3652|  43.0M|        if (c == quote)
  ------------------
  |  Branch (3652:13): [True: 101k, False: 42.9M]
  ------------------
 3653|   101k|            break;
 3654|  42.9M|        NEXTL(1);
  ------------------
  |  | 2288|  42.9M|#define NEXTL(l) do {							\
  |  | 2289|  42.9M|    if (*(ctxt->input->cur) == '\n') {					\
  |  |  ------------------
  |  |  |  Branch (2289:9): [True: 1.52M, False: 41.4M]
  |  |  ------------------
  |  | 2290|  1.52M|	ctxt->input->line++; ctxt->input->col = 1;			\
  |  | 2291|  41.4M|    } else ctxt->input->col++;						\
  |  | 2292|  42.9M|    ctxt->input->cur += l;				\
  |  | 2293|  42.9M|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2293:12): [Folded, False: 42.9M]
  |  |  ------------------
  ------------------
 3655|  42.9M|        length += 1;
 3656|       |
 3657|       |        /*
 3658|       |         * TODO: Check growth threshold
 3659|       |         */
 3660|  42.9M|        if (ctxt->input->end - CUR_PTR < 10)
  ------------------
  |  | 2227|  42.9M|#define CUR_PTR ctxt->input->cur
  ------------------
  |  Branch (3660:13): [True: 46.6k, False: 42.8M]
  ------------------
 3661|  46.6k|            GROW;
  ------------------
  |  | 2271|  46.6k|    if ((!PARSER_PROGRESSIVE(ctxt)) && \
  |  |  ------------------
  |  |  |  |   47|  46.6k|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|  46.6k|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2271:9): [True: 44.5k, False: 2.04k]
  |  |  ------------------
  |  | 2272|  46.6k|        (ctxt->input->end - ctxt->input->cur < INPUT_CHUNK)) \
  |  |  ------------------
  |  |  |  |   63|  44.5k|#define INPUT_CHUNK	250
  |  |  ------------------
  |  |  |  Branch (2272:9): [True: 44.5k, False: 0]
  |  |  ------------------
  |  | 2273|  46.6k|	xmlParserGrow(ctxt);
  ------------------
 3662|  42.9M|    }
 3663|       |
 3664|   101k|    start = CUR_PTR - length;
  ------------------
  |  | 2227|   101k|#define CUR_PTR ctxt->input->cur
  ------------------
 3665|       |
 3666|   101k|    if (orig != NULL) {
  ------------------
  |  Branch (3666:9): [True: 101k, False: 0]
  ------------------
 3667|   101k|        *orig = xmlStrndup(start, length);
 3668|   101k|        if (*orig == NULL)
  ------------------
  |  Branch (3668:13): [True: 5, False: 101k]
  ------------------
 3669|      5|            xmlErrMemory(ctxt);
 3670|   101k|    }
 3671|       |
 3672|   101k|    xmlExpandPEsInEntityValue(ctxt, &buf, start, length, ctxt->inputNr);
 3673|       |
 3674|   101k|    NEXTL(1);
  ------------------
  |  | 2288|   101k|#define NEXTL(l) do {							\
  |  | 2289|   101k|    if (*(ctxt->input->cur) == '\n') {					\
  |  |  ------------------
  |  |  |  Branch (2289:9): [True: 0, False: 101k]
  |  |  ------------------
  |  | 2290|      0|	ctxt->input->line++; ctxt->input->col = 1;			\
  |  | 2291|   101k|    } else ctxt->input->col++;						\
  |  | 2292|   101k|    ctxt->input->cur += l;				\
  |  | 2293|   101k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2293:12): [Folded, False: 101k]
  |  |  ------------------
  ------------------
 3675|       |
 3676|   101k|    return(xmlSBufFinish(&buf, NULL, ctxt, "entity length too long"));
 3677|       |
 3678|  2.07k|error:
 3679|  2.07k|    xmlSBufCleanup(&buf, ctxt, "entity length too long");
 3680|       |    return(NULL);
 3681|   103k|}
xmlExpandEntitiesInAttValue:
 3963|  19.8k|                            int normalize) {
 3964|  19.8k|    unsigned maxLength = (ctxt->options & XML_PARSE_HUGE) ?
  ------------------
  |  Branch (3964:26): [True: 11.6k, False: 8.25k]
  ------------------
 3965|  11.6k|                         XML_MAX_HUGE_LENGTH :
  ------------------
  |  |   55|  11.6k|#define XML_MAX_HUGE_LENGTH 1000000000
  ------------------
 3966|  19.8k|                         XML_MAX_TEXT_LENGTH;
  ------------------
  |  |   50|  28.1k|#define XML_MAX_TEXT_LENGTH 10000000
  ------------------
 3967|  19.8k|    xmlSBuf buf;
 3968|  19.8k|    int inSpace = 1;
 3969|       |
 3970|  19.8k|    xmlSBufInit(&buf, maxLength);
 3971|       |
 3972|  19.8k|    xmlExpandEntityInAttValue(ctxt, &buf, str, NULL, normalize, &inSpace,
 3973|  19.8k|                              ctxt->inputNr, /* check */ 0);
 3974|       |
 3975|  19.8k|    if ((normalize) && (inSpace) && (buf.size > 0))
  ------------------
  |  Branch (3975:9): [True: 0, False: 19.8k]
  |  Branch (3975:24): [True: 0, False: 0]
  |  Branch (3975:37): [True: 0, False: 0]
  ------------------
 3976|      0|        buf.size--;
 3977|       |
 3978|       |    return(xmlSBufFinish(&buf, NULL, ctxt, "AttValue length too long"));
 3979|  19.8k|}
xmlParseAttValue:
 4296|   157k|xmlParseAttValue(xmlParserCtxt *ctxt) {
 4297|   157k|    if ((ctxt == NULL) || (ctxt->input == NULL)) return(NULL);
  ------------------
  |  Branch (4297:9): [True: 0, False: 157k]
  |  Branch (4297:27): [True: 0, False: 157k]
  ------------------
 4298|   157k|    return(xmlParseAttValueInternal(ctxt, NULL, NULL, 0, 0));
 4299|   157k|}
xmlParseSystemLiteral:
 4313|  18.3k|xmlParseSystemLiteral(xmlParserCtxt *ctxt) {
 4314|  18.3k|    xmlChar *buf = NULL;
 4315|  18.3k|    int len = 0;
 4316|  18.3k|    int size = XML_PARSER_BUFFER_SIZE;
  ------------------
  |  |  172|  18.3k|#define XML_PARSER_BUFFER_SIZE 100
  ------------------
 4317|  18.3k|    int cur, l;
 4318|  18.3k|    int maxLength = (ctxt->options & XML_PARSE_HUGE) ?
  ------------------
  |  Branch (4318:21): [True: 7.79k, False: 10.5k]
  ------------------
 4319|  7.79k|                    XML_MAX_TEXT_LENGTH :
  ------------------
  |  |   50|  7.79k|#define XML_MAX_TEXT_LENGTH 10000000
  ------------------
 4320|  18.3k|                    XML_MAX_NAME_LENGTH;
  ------------------
  |  |   65|  10.5k|#define XML_MAX_NAME_LENGTH 50000
  ------------------
 4321|  18.3k|    xmlChar stop;
 4322|       |
 4323|  18.3k|    if (RAW == '"') {
  ------------------
  |  | 2224|  18.3k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (4323:9): [True: 9.37k, False: 9.02k]
  ------------------
 4324|  9.37k|        NEXT;
  ------------------
  |  | 2279|  9.37k|#define NEXT xmlNextChar(ctxt)
  ------------------
 4325|  9.37k|	stop = '"';
 4326|  9.37k|    } else if (RAW == '\'') {
  ------------------
  |  | 2224|  9.02k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (4326:16): [True: 6.71k, False: 2.30k]
  ------------------
 4327|  6.71k|        NEXT;
  ------------------
  |  | 2279|  6.71k|#define NEXT xmlNextChar(ctxt)
  ------------------
 4328|  6.71k|	stop = '\'';
 4329|  6.71k|    } else {
 4330|  2.30k|	xmlFatalErr(ctxt, XML_ERR_LITERAL_NOT_STARTED, NULL);
 4331|  2.30k|	return(NULL);
 4332|  2.30k|    }
 4333|       |
 4334|  16.0k|    buf = xmlMalloc(size);
 4335|  16.0k|    if (buf == NULL) {
  ------------------
  |  Branch (4335:9): [True: 2, False: 16.0k]
  ------------------
 4336|      2|        xmlErrMemory(ctxt);
 4337|      2|	return(NULL);
 4338|      2|    }
 4339|  16.0k|    cur = xmlCurrentCharRecover(ctxt, &l);
 4340|  4.92M|    while ((IS_CHAR(cur)) && (cur != stop)) { /* checked */
  ------------------
  |  |  115|  4.92M|#define IS_CHAR(c)   xmlIsCharQ(c)
  |  |  ------------------
  |  |  |  |  117|  4.92M|#define xmlIsCharQ(c)		(((c) < 0x100) ? \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (117:25): [True: 1.11M, False: 3.80M]
  |  |  |  |  ------------------
  |  |  |  |  118|  4.92M|				 xmlIsChar_ch((c)) :\
  |  |  |  |  ------------------
  |  |  |  |  |  |  108|  1.11M|#define xmlIsChar_ch(c)		(((0x9 <= (c)) && ((c) <= 0xa)) || \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (108:28): [True: 1.11M, False: 1.51k]
  |  |  |  |  |  |  |  Branch (108:44): [True: 2.26k, False: 1.10M]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  109|  1.11M|				 ((c) == 0xd) || \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (109:6): [True: 0, False: 1.11M]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  110|  1.11M|				  (0x20 <= (c)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (110:7): [True: 1.10M, False: 1.52k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  119|  4.92M|				(((0x100 <= (c)) && ((c) <= 0xd7ff)) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (119:7): [True: 3.80M, False: 0]
  |  |  |  |  |  Branch (119:25): [True: 6.04k, False: 3.80M]
  |  |  |  |  ------------------
  |  |  |  |  120|  3.80M|				 ((0xe000 <= (c)) && ((c) <= 0xfffd)) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (120:7): [True: 3.80M, False: 0]
  |  |  |  |  |  Branch (120:26): [True: 3.80M, False: 1.05k]
  |  |  |  |  ------------------
  |  |  |  |  121|  3.80M|				 ((0x10000 <= (c)) && ((c) <= 0x10ffff))))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (121:7): [True: 1.05k, False: 1]
  |  |  |  |  |  Branch (121:27): [True: 1.05k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (4340:12): [True: 4.92M, False: 1.52k]
  |  Branch (4340:30): [True: 4.90M, False: 14.4k]
  ------------------
 4341|  4.90M|	if (len + 5 >= size) {
  ------------------
  |  Branch (4341:6): [True: 5.71k, False: 4.90M]
  ------------------
 4342|  5.71k|	    xmlChar *tmp;
 4343|  5.71k|            int newSize;
 4344|       |
 4345|  5.71k|            newSize = xmlGrowCapacity(size, 1, 1, maxLength);
 4346|  5.71k|            if (newSize < 0) {
  ------------------
  |  Branch (4346:17): [True: 102, False: 5.61k]
  ------------------
 4347|    102|                xmlFatalErr(ctxt, XML_ERR_NAME_TOO_LONG, "SystemLiteral");
 4348|    102|                xmlFree(buf);
 4349|    102|                return(NULL);
 4350|    102|            }
 4351|  5.61k|	    tmp = xmlRealloc(buf, newSize);
 4352|  5.61k|	    if (tmp == NULL) {
  ------------------
  |  Branch (4352:10): [True: 3, False: 5.61k]
  ------------------
 4353|      3|	        xmlFree(buf);
 4354|      3|		xmlErrMemory(ctxt);
 4355|      3|		return(NULL);
 4356|      3|	    }
 4357|  5.61k|	    buf = tmp;
 4358|  5.61k|            size = newSize;
 4359|  5.61k|	}
 4360|  4.90M|	COPY_BUF(buf, len, cur);
  ------------------
  |  | 2296|  4.90M|    if (v < 0x80) b[i++] = v;						\
  |  |  ------------------
  |  |  |  Branch (2296:9): [True: 131k, False: 4.77M]
  |  |  ------------------
  |  | 2297|  4.90M|    else i += xmlCopyCharMultiByte(&b[i],v)
  ------------------
 4361|  4.90M|	NEXTL(l);
  ------------------
  |  | 2288|  4.90M|#define NEXTL(l) do {							\
  |  | 2289|  4.90M|    if (*(ctxt->input->cur) == '\n') {					\
  |  |  ------------------
  |  |  |  Branch (2289:9): [True: 1.68k, False: 4.90M]
  |  |  ------------------
  |  | 2290|  1.68k|	ctxt->input->line++; ctxt->input->col = 1;			\
  |  | 2291|  4.90M|    } else ctxt->input->col++;						\
  |  | 2292|  4.90M|    ctxt->input->cur += l;				\
  |  | 2293|  4.90M|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2293:12): [Folded, False: 4.90M]
  |  |  ------------------
  ------------------
 4362|  4.90M|	cur = xmlCurrentCharRecover(ctxt, &l);
 4363|  4.90M|    }
 4364|  15.9k|    buf[len] = 0;
 4365|  15.9k|    if (!IS_CHAR(cur)) {
  ------------------
  |  |  115|  15.9k|#define IS_CHAR(c)   xmlIsCharQ(c)
  |  |  ------------------
  |  |  |  |  117|  15.9k|#define xmlIsCharQ(c)		(((c) < 0x100) ? \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (117:25): [True: 15.9k, False: 1]
  |  |  |  |  ------------------
  |  |  |  |  118|  15.9k|				 xmlIsChar_ch((c)) :\
  |  |  |  |  ------------------
  |  |  |  |  |  |  108|  15.9k|#define xmlIsChar_ch(c)		(((0x9 <= (c)) && ((c) <= 0xa)) || \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (108:28): [True: 14.4k, False: 1.51k]
  |  |  |  |  |  |  |  Branch (108:44): [True: 0, False: 14.4k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  109|  15.9k|				 ((c) == 0xd) || \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (109:6): [True: 0, False: 15.9k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  110|  15.9k|				  (0x20 <= (c)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (110:7): [True: 14.4k, False: 1.52k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  119|  15.9k|				(((0x100 <= (c)) && ((c) <= 0xd7ff)) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (119:7): [True: 1, False: 0]
  |  |  |  |  |  Branch (119:25): [True: 0, False: 1]
  |  |  |  |  ------------------
  |  |  |  |  120|      1|				 ((0xe000 <= (c)) && ((c) <= 0xfffd)) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (120:7): [True: 1, False: 0]
  |  |  |  |  |  Branch (120:26): [True: 0, False: 1]
  |  |  |  |  ------------------
  |  |  |  |  121|      1|				 ((0x10000 <= (c)) && ((c) <= 0x10ffff))))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (121:7): [True: 0, False: 1]
  |  |  |  |  |  Branch (121:27): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (4365:9): [True: 1.52k, False: 14.4k]
  ------------------
 4366|  1.52k|	xmlFatalErr(ctxt, XML_ERR_LITERAL_NOT_FINISHED, NULL);
 4367|  14.4k|    } else {
 4368|  14.4k|	NEXT;
  ------------------
  |  | 2279|  14.4k|#define NEXT xmlNextChar(ctxt)
  ------------------
 4369|  14.4k|    }
 4370|  15.9k|    return(buf);
 4371|  16.0k|}
xmlParsePubidLiteral:
 4385|  8.17k|xmlParsePubidLiteral(xmlParserCtxt *ctxt) {
 4386|  8.17k|    xmlChar *buf = NULL;
 4387|  8.17k|    int len = 0;
 4388|  8.17k|    int size = XML_PARSER_BUFFER_SIZE;
  ------------------
  |  |  172|  8.17k|#define XML_PARSER_BUFFER_SIZE 100
  ------------------
 4389|  8.17k|    int maxLength = (ctxt->options & XML_PARSE_HUGE) ?
  ------------------
  |  Branch (4389:21): [True: 2.81k, False: 5.36k]
  ------------------
 4390|  2.81k|                    XML_MAX_TEXT_LENGTH :
  ------------------
  |  |   50|  2.81k|#define XML_MAX_TEXT_LENGTH 10000000
  ------------------
 4391|  8.17k|                    XML_MAX_NAME_LENGTH;
  ------------------
  |  |   65|  5.36k|#define XML_MAX_NAME_LENGTH 50000
  ------------------
 4392|  8.17k|    xmlChar cur;
 4393|  8.17k|    xmlChar stop;
 4394|       |
 4395|  8.17k|    if (RAW == '"') {
  ------------------
  |  | 2224|  8.17k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (4395:9): [True: 817, False: 7.35k]
  ------------------
 4396|    817|        NEXT;
  ------------------
  |  | 2279|    817|#define NEXT xmlNextChar(ctxt)
  ------------------
 4397|    817|	stop = '"';
 4398|  7.35k|    } else if (RAW == '\'') {
  ------------------
  |  | 2224|  7.35k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (4398:16): [True: 5.79k, False: 1.56k]
  ------------------
 4399|  5.79k|        NEXT;
  ------------------
  |  | 2279|  5.79k|#define NEXT xmlNextChar(ctxt)
  ------------------
 4400|  5.79k|	stop = '\'';
 4401|  5.79k|    } else {
 4402|  1.56k|	xmlFatalErr(ctxt, XML_ERR_LITERAL_NOT_STARTED, NULL);
 4403|  1.56k|	return(NULL);
 4404|  1.56k|    }
 4405|  6.61k|    buf = xmlMalloc(size);
 4406|  6.61k|    if (buf == NULL) {
  ------------------
  |  Branch (4406:9): [True: 1, False: 6.61k]
  ------------------
 4407|      1|	xmlErrMemory(ctxt);
 4408|      1|	return(NULL);
 4409|      1|    }
 4410|  6.61k|    cur = CUR;
  ------------------
  |  | 2225|  6.61k|#define CUR (*ctxt->input->cur)
  ------------------
 4411|   464k|    while ((IS_PUBIDCHAR_CH(cur)) && (cur != stop) &&
  ------------------
  |  |  246|   464k|#define IS_PUBIDCHAR_CH(c) xmlIsPubidChar_ch(c)
  |  |  ------------------
  |  |  |  |  180|   464k|#define xmlIsPubidChar_ch(c)	(xmlIsPubidChar_tab[(c)])
  |  |  ------------------
  ------------------
  |  Branch (4411:12): [True: 463k, False: 1.01k]
  |  Branch (4411:38): [True: 457k, False: 5.59k]
  ------------------
 4412|   457k|           (PARSER_STOPPED(ctxt) == 0)) { /* checked */
  ------------------
  |  |   44|   457k|#define PARSER_STOPPED(ctxt) ((ctxt)->disableSAX > 1)
  ------------------
  |  Branch (4412:12): [True: 457k, False: 1]
  ------------------
 4413|   457k|	if (len + 1 >= size) {
  ------------------
  |  Branch (4413:6): [True: 205, False: 457k]
  ------------------
 4414|    205|	    xmlChar *tmp;
 4415|    205|            int newSize;
 4416|       |
 4417|    205|	    newSize = xmlGrowCapacity(size, 1, 1, maxLength);
 4418|    205|            if (newSize < 0) {
  ------------------
  |  Branch (4418:17): [True: 1, False: 204]
  ------------------
 4419|      1|                xmlFatalErr(ctxt, XML_ERR_NAME_TOO_LONG, "Public ID");
 4420|      1|                xmlFree(buf);
 4421|      1|                return(NULL);
 4422|      1|            }
 4423|    204|	    tmp = xmlRealloc(buf, newSize);
 4424|    204|	    if (tmp == NULL) {
  ------------------
  |  Branch (4424:10): [True: 1, False: 203]
  ------------------
 4425|      1|		xmlErrMemory(ctxt);
 4426|      1|		xmlFree(buf);
 4427|      1|		return(NULL);
 4428|      1|	    }
 4429|    203|	    buf = tmp;
 4430|    203|            size = newSize;
 4431|    203|	}
 4432|   457k|	buf[len++] = cur;
 4433|   457k|	NEXT;
  ------------------
  |  | 2279|   457k|#define NEXT xmlNextChar(ctxt)
  ------------------
 4434|   457k|	cur = CUR;
  ------------------
  |  | 2225|   457k|#define CUR (*ctxt->input->cur)
  ------------------
 4435|   457k|    }
 4436|  6.61k|    buf[len] = 0;
 4437|  6.61k|    if (cur != stop) {
  ------------------
  |  Branch (4437:9): [True: 424, False: 6.18k]
  ------------------
 4438|    424|	xmlFatalErr(ctxt, XML_ERR_LITERAL_NOT_FINISHED, NULL);
 4439|  6.18k|    } else {
 4440|  6.18k|	NEXTL(1);
  ------------------
  |  | 2288|  6.18k|#define NEXTL(l) do {							\
  |  | 2289|  6.18k|    if (*(ctxt->input->cur) == '\n') {					\
  |  |  ------------------
  |  |  |  Branch (2289:9): [True: 0, False: 6.18k]
  |  |  ------------------
  |  | 2290|      0|	ctxt->input->line++; ctxt->input->col = 1;			\
  |  | 2291|  6.18k|    } else ctxt->input->col++;						\
  |  | 2292|  6.18k|    ctxt->input->cur += l;				\
  |  | 2293|  6.18k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2293:12): [Folded, False: 6.18k]
  |  |  ------------------
  ------------------
 4441|  6.18k|    }
 4442|  6.61k|    return(buf);
 4443|  6.61k|}
xmlParseExternalID:
 4755|  36.8k|xmlParseExternalID(xmlParserCtxt *ctxt, xmlChar **publicId, int strict) {
 4756|  36.8k|    xmlChar *URI = NULL;
 4757|       |
 4758|  36.8k|    *publicId = NULL;
 4759|  36.8k|    if (CMP6(CUR_PTR, 'S', 'Y', 'S', 'T', 'E', 'M')) {
  ------------------
  |  | 2236|  36.8k|  ( CMP5( s, c1, c2, c3, c4, c5 ) && ((unsigned char *) s)[ 5 ] == c6 )
  |  |  ------------------
  |  |  |  | 2234|  73.7k|  ( CMP4( s, c1, c2, c3, c4 ) && ((unsigned char *) s)[ 4 ] == c5 )
  |  |  |  |  ------------------
  |  |  |  |  |  | 2231|  73.7k|  ( ((unsigned char *) s)[ 0 ] == c1 && ((unsigned char *) s)[ 1 ] == c2 && \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (2231:5): [True: 12.3k, False: 24.5k]
  |  |  |  |  |  |  |  Branch (2231:41): [True: 12.3k, False: 4]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 2232|  36.8k|    ((unsigned char *) s)[ 2 ] == c3 && ((unsigned char *) s)[ 3 ] == c4 )
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (2232:5): [True: 12.3k, False: 2]
  |  |  |  |  |  |  |  Branch (2232:41): [True: 12.3k, False: 6]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2234:34): [True: 12.3k, False: 6]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2236:38): [True: 12.3k, False: 7]
  |  |  ------------------
  ------------------
 4760|  12.3k|        SKIP(6);
  ------------------
  |  | 2248|  12.3k|#define SKIP(val) do {							\
  |  | 2249|  12.3k|    ctxt->input->cur += (val),ctxt->input->col+=(val);			\
  |  | 2250|  12.3k|    if (*ctxt->input->cur == 0)						\
  |  |  ------------------
  |  |  |  Branch (2250:9): [True: 284, False: 12.0k]
  |  |  ------------------
  |  | 2251|  12.3k|        xmlParserGrow(ctxt);						\
  |  | 2252|  12.3k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2252:12): [Folded, False: 12.3k]
  |  |  ------------------
  ------------------
 4761|  12.3k|	if (SKIP_BLANKS == 0) {
  ------------------
  |  | 2275|  12.3k|#define SKIP_BLANKS xmlSkipBlankChars(ctxt)
  ------------------
  |  Branch (4761:6): [True: 564, False: 11.7k]
  ------------------
 4762|    564|	    xmlFatalErrMsg(ctxt, XML_ERR_SPACE_REQUIRED,
 4763|    564|	                   "Space required after 'SYSTEM'\n");
 4764|    564|	}
 4765|  12.3k|	URI = xmlParseSystemLiteral(ctxt);
 4766|  12.3k|	if (URI == NULL) {
  ------------------
  |  Branch (4766:6): [True: 797, False: 11.5k]
  ------------------
 4767|    797|	    xmlFatalErr(ctxt, XML_ERR_URI_REQUIRED, NULL);
 4768|    797|        }
 4769|  24.5k|    } else if (CMP6(CUR_PTR, 'P', 'U', 'B', 'L', 'I', 'C')) {
  ------------------
  |  | 2236|  24.5k|  ( CMP5( s, c1, c2, c3, c4, c5 ) && ((unsigned char *) s)[ 5 ] == c6 )
  |  |  ------------------
  |  |  |  | 2234|  49.0k|  ( CMP4( s, c1, c2, c3, c4 ) && ((unsigned char *) s)[ 4 ] == c5 )
  |  |  |  |  ------------------
  |  |  |  |  |  | 2231|  49.0k|  ( ((unsigned char *) s)[ 0 ] == c1 && ((unsigned char *) s)[ 1 ] == c2 && \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (2231:5): [True: 8.20k, False: 16.3k]
  |  |  |  |  |  |  |  Branch (2231:41): [True: 8.19k, False: 9]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 2232|  24.5k|    ((unsigned char *) s)[ 2 ] == c3 && ((unsigned char *) s)[ 3 ] == c4 )
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (2232:5): [True: 8.19k, False: 1]
  |  |  |  |  |  |  |  Branch (2232:41): [True: 8.18k, False: 3]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2234:34): [True: 8.17k, False: 8]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2236:38): [True: 8.17k, False: 3]
  |  |  ------------------
  ------------------
 4770|  8.17k|        SKIP(6);
  ------------------
  |  | 2248|  8.17k|#define SKIP(val) do {							\
  |  | 2249|  8.17k|    ctxt->input->cur += (val),ctxt->input->col+=(val);			\
  |  | 2250|  8.17k|    if (*ctxt->input->cur == 0)						\
  |  |  ------------------
  |  |  |  Branch (2250:9): [True: 156, False: 8.02k]
  |  |  ------------------
  |  | 2251|  8.17k|        xmlParserGrow(ctxt);						\
  |  | 2252|  8.17k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2252:12): [Folded, False: 8.17k]
  |  |  ------------------
  ------------------
 4771|  8.17k|	if (SKIP_BLANKS == 0) {
  ------------------
  |  | 2275|  8.17k|#define SKIP_BLANKS xmlSkipBlankChars(ctxt)
  ------------------
  |  Branch (4771:6): [True: 1.83k, False: 6.34k]
  ------------------
 4772|  1.83k|	    xmlFatalErrMsg(ctxt, XML_ERR_SPACE_REQUIRED,
 4773|  1.83k|		    "Space required after 'PUBLIC'\n");
 4774|  1.83k|	}
 4775|  8.17k|	*publicId = xmlParsePubidLiteral(ctxt);
 4776|  8.17k|	if (*publicId == NULL) {
  ------------------
  |  Branch (4776:6): [True: 1.56k, False: 6.61k]
  ------------------
 4777|  1.56k|	    xmlFatalErr(ctxt, XML_ERR_PUBID_REQUIRED, NULL);
 4778|  1.56k|	}
 4779|  8.17k|	if (strict) {
  ------------------
  |  Branch (4779:6): [True: 6.01k, False: 2.16k]
  ------------------
 4780|       |	    /*
 4781|       |	     * We don't handle [83] so "S SystemLiteral" is required.
 4782|       |	     */
 4783|  6.01k|	    if (SKIP_BLANKS == 0) {
  ------------------
  |  | 2275|  6.01k|#define SKIP_BLANKS xmlSkipBlankChars(ctxt)
  ------------------
  |  Branch (4783:10): [True: 2.33k, False: 3.68k]
  ------------------
 4784|  2.33k|		xmlFatalErrMsg(ctxt, XML_ERR_SPACE_REQUIRED,
 4785|  2.33k|			"Space required after the Public Identifier\n");
 4786|  2.33k|	    }
 4787|  6.01k|	} else {
 4788|       |	    /*
 4789|       |	     * We handle [83] so we return immediately, if
 4790|       |	     * "S SystemLiteral" is not detected. We skip blanks if no
 4791|       |             * system literal was found, but this is harmless since we must
 4792|       |             * be at the end of a NotationDecl.
 4793|       |	     */
 4794|  2.16k|	    if (SKIP_BLANKS == 0) return(NULL);
  ------------------
  |  | 2275|  2.16k|#define SKIP_BLANKS xmlSkipBlankChars(ctxt)
  ------------------
  |  Branch (4794:10): [True: 1.57k, False: 590]
  ------------------
 4795|    590|	    if ((CUR != '\'') && (CUR != '"')) return(NULL);
  ------------------
  |  | 2225|    590|#define CUR (*ctxt->input->cur)
  ------------------
              	    if ((CUR != '\'') && (CUR != '"')) return(NULL);
  ------------------
  |  | 2225|    543|#define CUR (*ctxt->input->cur)
  ------------------
  |  Branch (4795:10): [True: 543, False: 47]
  |  Branch (4795:27): [True: 533, False: 10]
  ------------------
 4796|    590|	}
 4797|  6.07k|	URI = xmlParseSystemLiteral(ctxt);
 4798|  6.07k|	if (URI == NULL) {
  ------------------
  |  Branch (4798:6): [True: 1.61k, False: 4.45k]
  ------------------
 4799|  1.61k|	    xmlFatalErr(ctxt, XML_ERR_URI_REQUIRED, NULL);
 4800|  1.61k|        }
 4801|  6.07k|    }
 4802|  34.7k|    return(URI);
 4803|  36.8k|}
xmlParseComment:
 4932|   406k|xmlParseComment(xmlParserCtxt *ctxt) {
 4933|   406k|    xmlChar *buf = NULL;
 4934|   406k|    size_t size = XML_PARSER_BUFFER_SIZE;
  ------------------
  |  |  172|   406k|#define XML_PARSER_BUFFER_SIZE 100
  ------------------
 4935|   406k|    size_t len = 0;
 4936|   406k|    size_t maxLength = (ctxt->options & XML_PARSE_HUGE) ?
  ------------------
  |  Branch (4936:24): [True: 113k, False: 293k]
  ------------------
 4937|   113k|                       XML_MAX_HUGE_LENGTH :
  ------------------
  |  |   55|   113k|#define XML_MAX_HUGE_LENGTH 1000000000
  ------------------
 4938|   406k|                       XML_MAX_TEXT_LENGTH;
  ------------------
  |  |   50|   699k|#define XML_MAX_TEXT_LENGTH 10000000
  ------------------
 4939|   406k|    const xmlChar *in;
 4940|   406k|    size_t nbchar = 0;
 4941|   406k|    int ccol;
 4942|       |
 4943|       |    /*
 4944|       |     * Check that there is a comment right here.
 4945|       |     */
 4946|   406k|    if ((RAW != '<') || (NXT(1) != '!'))
  ------------------
  |  | 2224|   406k|#define RAW (*ctxt->input->cur)
  ------------------
                  if ((RAW != '<') || (NXT(1) != '!'))
  ------------------
  |  | 2226|   406k|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
  |  Branch (4946:9): [True: 0, False: 406k]
  |  Branch (4946:25): [True: 0, False: 406k]
  ------------------
 4947|      0|        return;
 4948|   406k|    SKIP(2);
  ------------------
  |  | 2248|   406k|#define SKIP(val) do {							\
  |  | 2249|   406k|    ctxt->input->cur += (val),ctxt->input->col+=(val);			\
  |  | 2250|   406k|    if (*ctxt->input->cur == 0)						\
  |  |  ------------------
  |  |  |  Branch (2250:9): [True: 0, False: 406k]
  |  |  ------------------
  |  | 2251|   406k|        xmlParserGrow(ctxt);						\
  |  | 2252|   406k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2252:12): [Folded, False: 406k]
  |  |  ------------------
  ------------------
 4949|   406k|    if ((RAW != '-') || (NXT(1) != '-'))
  ------------------
  |  | 2224|   406k|#define RAW (*ctxt->input->cur)
  ------------------
                  if ((RAW != '-') || (NXT(1) != '-'))
  ------------------
  |  | 2226|   406k|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
  |  Branch (4949:9): [True: 0, False: 406k]
  |  Branch (4949:25): [True: 7, False: 406k]
  ------------------
 4950|      7|        return;
 4951|   406k|    SKIP(2);
  ------------------
  |  | 2248|   406k|#define SKIP(val) do {							\
  |  | 2249|   406k|    ctxt->input->cur += (val),ctxt->input->col+=(val);			\
  |  | 2250|   406k|    if (*ctxt->input->cur == 0)						\
  |  |  ------------------
  |  |  |  Branch (2250:9): [True: 224, False: 406k]
  |  |  ------------------
  |  | 2251|   406k|        xmlParserGrow(ctxt);						\
  |  | 2252|   406k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2252:12): [Folded, False: 406k]
  |  |  ------------------
  ------------------
 4952|   406k|    GROW;
  ------------------
  |  | 2271|   406k|    if ((!PARSER_PROGRESSIVE(ctxt)) && \
  |  |  ------------------
  |  |  |  |   47|   406k|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|   406k|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2271:9): [True: 295k, False: 111k]
  |  |  ------------------
  |  | 2272|   406k|        (ctxt->input->end - ctxt->input->cur < INPUT_CHUNK)) \
  |  |  ------------------
  |  |  |  |   63|   295k|#define INPUT_CHUNK	250
  |  |  ------------------
  |  |  |  Branch (2272:9): [True: 130k, False: 165k]
  |  |  ------------------
  |  | 2273|   406k|	xmlParserGrow(ctxt);
  ------------------
 4953|       |
 4954|       |    /*
 4955|       |     * Accelerated common case where input don't need to be
 4956|       |     * modified before passing it to the handler.
 4957|       |     */
 4958|   406k|    in = ctxt->input->cur;
 4959|   406k|    do {
 4960|   406k|	if (*in == 0xA) {
  ------------------
  |  Branch (4960:6): [True: 493, False: 406k]
  ------------------
 4961|  3.80k|	    do {
 4962|  3.80k|		ctxt->input->line++; ctxt->input->col = 1;
 4963|  3.80k|		in++;
 4964|  3.80k|	    } while (*in == 0xA);
  ------------------
  |  Branch (4964:15): [True: 3.31k, False: 493]
  ------------------
 4965|    493|	}
 4966|   786k|get_more:
 4967|   786k|        ccol = ctxt->input->col;
 4968|  5.44M|	while (((*in > '-') && (*in <= 0x7F)) ||
  ------------------
  |  Branch (4968:10): [True: 3.83M, False: 1.60M]
  |  Branch (4968:25): [True: 3.78M, False: 49.6k]
  ------------------
 4969|  1.65M|	       ((*in >= 0x20) && (*in < '-')) ||
  ------------------
  |  Branch (4969:10): [True: 1.54M, False: 113k]
  |  Branch (4969:27): [True: 862k, False: 680k]
  ------------------
 4970|  4.65M|	       (*in == 0x09)) {
  ------------------
  |  Branch (4970:9): [True: 7.17k, False: 786k]
  ------------------
 4971|  4.65M|		    in++;
 4972|  4.65M|		    ccol++;
 4973|  4.65M|	}
 4974|   786k|	ctxt->input->col = ccol;
 4975|   786k|	if (*in == 0xA) {
  ------------------
  |  Branch (4975:6): [True: 26.5k, False: 760k]
  ------------------
 4976|   243k|	    do {
 4977|   243k|		ctxt->input->line++; ctxt->input->col = 1;
 4978|   243k|		in++;
 4979|   243k|	    } while (*in == 0xA);
  ------------------
  |  Branch (4979:15): [True: 216k, False: 26.5k]
  ------------------
 4980|  26.5k|	    goto get_more;
 4981|  26.5k|	}
 4982|   760k|	nbchar = in - ctxt->input->cur;
 4983|       |	/*
 4984|       |	 * save current set of data
 4985|       |	 */
 4986|   760k|	if (nbchar > 0) {
  ------------------
  |  Branch (4986:6): [True: 472k, False: 287k]
  ------------------
 4987|   472k|            if (nbchar > maxLength - len) {
  ------------------
  |  Branch (4987:17): [True: 0, False: 472k]
  ------------------
 4988|      0|                xmlFatalErrMsgStr(ctxt, XML_ERR_COMMENT_NOT_FINISHED,
 4989|      0|                                  "Comment too big found", NULL);
 4990|      0|                xmlFree(buf);
 4991|      0|                return;
 4992|      0|            }
 4993|   472k|            if (buf == NULL) {
  ------------------
  |  Branch (4993:17): [True: 152k, False: 320k]
  ------------------
 4994|   152k|                if ((*in == '-') && (in[1] == '-'))
  ------------------
  |  Branch (4994:21): [True: 82.0k, False: 70.5k]
  |  Branch (4994:37): [True: 52.0k, False: 29.9k]
  ------------------
 4995|  52.0k|                    size = nbchar + 1;
 4996|   100k|                else
 4997|   100k|                    size = XML_PARSER_BUFFER_SIZE + nbchar;
  ------------------
  |  |  172|   100k|#define XML_PARSER_BUFFER_SIZE 100
  ------------------
 4998|   152k|                buf = xmlMalloc(size);
 4999|   152k|                if (buf == NULL) {
  ------------------
  |  Branch (4999:21): [True: 6, False: 152k]
  ------------------
 5000|      6|                    xmlErrMemory(ctxt);
 5001|      6|                    return;
 5002|      6|                }
 5003|   152k|                len = 0;
 5004|   320k|            } else if (len + nbchar + 1 >= size) {
  ------------------
  |  Branch (5004:24): [True: 10.0k, False: 310k]
  ------------------
 5005|  10.0k|                xmlChar *new_buf;
 5006|  10.0k|                size += len + nbchar + XML_PARSER_BUFFER_SIZE;
  ------------------
  |  |  172|  10.0k|#define XML_PARSER_BUFFER_SIZE 100
  ------------------
 5007|  10.0k|                new_buf = xmlRealloc(buf, size);
 5008|  10.0k|                if (new_buf == NULL) {
  ------------------
  |  Branch (5008:21): [True: 1, False: 10.0k]
  ------------------
 5009|      1|                    xmlErrMemory(ctxt);
 5010|      1|                    xmlFree(buf);
 5011|      1|                    return;
 5012|      1|                }
 5013|  10.0k|                buf = new_buf;
 5014|  10.0k|            }
 5015|   472k|            memcpy(&buf[len], ctxt->input->cur, nbchar);
 5016|   472k|            len += nbchar;
 5017|   472k|            buf[len] = 0;
 5018|   472k|	}
 5019|   760k|	ctxt->input->cur = in;
 5020|   760k|	if (*in == 0xA) {
  ------------------
  |  Branch (5020:6): [True: 0, False: 760k]
  ------------------
 5021|      0|	    in++;
 5022|      0|	    ctxt->input->line++; ctxt->input->col = 1;
 5023|      0|	}
 5024|   760k|	if (*in == 0xD) {
  ------------------
  |  Branch (5024:6): [True: 77.9k, False: 682k]
  ------------------
 5025|  77.9k|	    in++;
 5026|  77.9k|	    if (*in == 0xA) {
  ------------------
  |  Branch (5026:10): [True: 12.2k, False: 65.7k]
  ------------------
 5027|  12.2k|		ctxt->input->cur = in;
 5028|  12.2k|		in++;
 5029|  12.2k|		ctxt->input->line++; ctxt->input->col = 1;
 5030|  12.2k|		goto get_more;
 5031|  12.2k|	    }
 5032|  65.7k|	    in--;
 5033|  65.7k|	}
 5034|   747k|	SHRINK;
  ------------------
  |  | 2267|   747k|    if (!PARSER_PROGRESSIVE(ctxt)) \
  |  |  ------------------
  |  |  |  |   47|   747k|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|   747k|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2267:9): [True: 625k, False: 122k]
  |  |  ------------------
  |  | 2268|   747k|	xmlParserShrink(ctxt);
  ------------------
 5035|   747k|	GROW;
  ------------------
  |  | 2271|   747k|    if ((!PARSER_PROGRESSIVE(ctxt)) && \
  |  |  ------------------
  |  |  |  |   47|   747k|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|   747k|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2271:9): [True: 625k, False: 122k]
  |  |  ------------------
  |  | 2272|   747k|        (ctxt->input->end - ctxt->input->cur < INPUT_CHUNK)) \
  |  |  ------------------
  |  |  |  |   63|   625k|#define INPUT_CHUNK	250
  |  |  ------------------
  |  |  |  Branch (2272:9): [True: 140k, False: 485k]
  |  |  ------------------
  |  | 2273|   747k|	xmlParserGrow(ctxt);
  ------------------
 5036|   747k|	in = ctxt->input->cur;
 5037|   747k|	if (*in == '-') {
  ------------------
  |  Branch (5037:6): [True: 630k, False: 117k]
  ------------------
 5038|   630k|	    if (in[1] == '-') {
  ------------------
  |  Branch (5038:10): [True: 464k, False: 166k]
  ------------------
 5039|   464k|	        if (in[2] == '>') {
  ------------------
  |  Branch (5039:14): [True: 289k, False: 174k]
  ------------------
 5040|   289k|		    SKIP(3);
  ------------------
  |  | 2248|   289k|#define SKIP(val) do {							\
  |  | 2249|   289k|    ctxt->input->cur += (val),ctxt->input->col+=(val);			\
  |  | 2250|   289k|    if (*ctxt->input->cur == 0)						\
  |  |  ------------------
  |  |  |  Branch (2250:9): [True: 516, False: 288k]
  |  |  ------------------
  |  | 2251|   289k|        xmlParserGrow(ctxt);						\
  |  | 2252|   289k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2252:12): [Folded, False: 289k]
  |  |  ------------------
  ------------------
 5041|   289k|		    if ((ctxt->sax != NULL) && (ctxt->sax->comment != NULL) &&
  ------------------
  |  Branch (5041:11): [True: 289k, False: 0]
  |  Branch (5041:34): [True: 289k, False: 0]
  ------------------
 5042|   289k|		        (!ctxt->disableSAX)) {
  ------------------
  |  Branch (5042:11): [True: 280k, False: 8.93k]
  ------------------
 5043|   280k|			if (buf != NULL)
  ------------------
  |  Branch (5043:8): [True: 46.6k, False: 233k]
  ------------------
 5044|  46.6k|			    ctxt->sax->comment(ctxt->userData, buf);
 5045|   233k|			else
 5046|   233k|			    ctxt->sax->comment(ctxt->userData, BAD_CAST "");
  ------------------
  |  |   34|   233k|#define BAD_CAST (xmlChar *)
  ------------------
 5047|   280k|		    }
 5048|   289k|		    if (buf != NULL)
  ------------------
  |  Branch (5048:11): [True: 51.8k, False: 237k]
  ------------------
 5049|  51.8k|		        xmlFree(buf);
 5050|   289k|		    return;
 5051|   289k|		}
 5052|   174k|		if (buf != NULL) {
  ------------------
  |  Branch (5052:7): [True: 145k, False: 28.9k]
  ------------------
 5053|   145k|		    xmlFatalErrMsgStr(ctxt, XML_ERR_HYPHEN_IN_COMMENT,
 5054|   145k|		                      "Double hyphen within comment: "
 5055|   145k|                                      "<!--%.50s\n",
 5056|   145k|				      buf);
 5057|   145k|		} else
 5058|  28.9k|		    xmlFatalErrMsgStr(ctxt, XML_ERR_HYPHEN_IN_COMMENT,
 5059|  28.9k|		                      "Double hyphen within comment\n", NULL);
 5060|   174k|		in++;
 5061|   174k|		ctxt->input->col++;
 5062|   174k|	    }
 5063|   341k|	    in++;
 5064|   341k|	    ctxt->input->col++;
 5065|   341k|	    goto get_more;
 5066|   630k|	}
 5067|   747k|    } while (((*in >= 0x20) && (*in <= 0x7F)) || (*in == 0x09) || (*in == 0x0a));
  ------------------
  |  Branch (5067:15): [True: 49.9k, False: 67.4k]
  |  Branch (5067:32): [True: 297, False: 49.6k]
  |  Branch (5067:50): [True: 95, False: 116k]
  |  Branch (5067:67): [True: 0, False: 116k]
  ------------------
 5068|   116k|    xmlParseCommentComplex(ctxt, buf, len, size);
 5069|   116k|}
xmlParsePITarget:
 5084|  92.4k|xmlParsePITarget(xmlParserCtxt *ctxt) {
 5085|  92.4k|    const xmlChar *name;
 5086|       |
 5087|  92.4k|    name = xmlParseName(ctxt);
 5088|  92.4k|    if ((name != NULL) &&
  ------------------
  |  Branch (5088:9): [True: 87.3k, False: 5.11k]
  ------------------
 5089|  87.3k|        ((name[0] == 'x') || (name[0] == 'X')) &&
  ------------------
  |  Branch (5089:10): [True: 22.1k, False: 65.1k]
  |  Branch (5089:30): [True: 355, False: 64.8k]
  ------------------
 5090|  22.5k|        ((name[1] == 'm') || (name[1] == 'M')) &&
  ------------------
  |  Branch (5090:10): [True: 20.2k, False: 2.34k]
  |  Branch (5090:30): [True: 505, False: 1.84k]
  ------------------
 5091|  20.7k|        ((name[2] == 'l') || (name[2] == 'L'))) {
  ------------------
  |  Branch (5091:10): [True: 16.2k, False: 4.50k]
  |  Branch (5091:30): [True: 215, False: 4.28k]
  ------------------
 5092|  16.4k|	int i;
 5093|  16.4k|	if ((name[0] == 'x') && (name[1] == 'm') &&
  ------------------
  |  Branch (5093:6): [True: 16.1k, False: 258]
  |  Branch (5093:26): [True: 15.9k, False: 250]
  ------------------
 5094|  15.9k|	    (name[2] == 'l') && (name[3] == 0)) {
  ------------------
  |  Branch (5094:6): [True: 15.7k, False: 199]
  |  Branch (5094:26): [True: 15.0k, False: 622]
  ------------------
 5095|  15.0k|	    xmlFatalErrMsg(ctxt, XML_ERR_RESERVED_XML_NAME,
 5096|  15.0k|		 "XML declaration allowed only at the start of the document\n");
 5097|  15.0k|	    return(name);
 5098|  15.0k|	} else if (name[3] == 0) {
  ------------------
  |  Branch (5098:13): [True: 504, False: 825]
  ------------------
 5099|    504|	    xmlFatalErr(ctxt, XML_ERR_RESERVED_XML_NAME, NULL);
 5100|    504|	    return(name);
 5101|    504|	}
 5102|  2.37k|	for (i = 0;;i++) {
 5103|  2.37k|	    if (xmlW3CPIs[i] == NULL) break;
  ------------------
  |  Branch (5103:10): [True: 743, False: 1.63k]
  ------------------
 5104|  1.63k|	    if (xmlStrEqual(name, (const xmlChar *)xmlW3CPIs[i]))
  ------------------
  |  Branch (5104:10): [True: 82, False: 1.54k]
  ------------------
 5105|     82|	        return(name);
 5106|  1.63k|	}
 5107|    743|	xmlWarningMsg(ctxt, XML_ERR_RESERVED_XML_NAME,
 5108|    743|		      "xmlParsePITarget: invalid name prefix 'xml'\n",
 5109|    743|		      NULL, NULL);
 5110|    743|    }
 5111|  76.8k|    if ((name != NULL) && (xmlStrchr(name, ':') != NULL)) {
  ------------------
  |  Branch (5111:9): [True: 71.7k, False: 5.11k]
  |  Branch (5111:27): [True: 249, False: 71.4k]
  ------------------
 5112|    249|	xmlNsErr(ctxt, XML_NS_ERR_COLON,
 5113|    249|		 "colons are forbidden from PI names '%s'\n", name, NULL, NULL);
 5114|    249|    }
 5115|  76.8k|    return(name);
 5116|  92.4k|}
xmlParsePI:
 5198|  92.4k|xmlParsePI(xmlParserCtxt *ctxt) {
 5199|  92.4k|    xmlChar *buf = NULL;
 5200|  92.4k|    size_t len = 0;
 5201|  92.4k|    size_t size = XML_PARSER_BUFFER_SIZE;
  ------------------
  |  |  172|  92.4k|#define XML_PARSER_BUFFER_SIZE 100
  ------------------
 5202|  92.4k|    size_t maxLength = (ctxt->options & XML_PARSE_HUGE) ?
  ------------------
  |  Branch (5202:24): [True: 42.4k, False: 50.0k]
  ------------------
 5203|  42.4k|                       XML_MAX_HUGE_LENGTH :
  ------------------
  |  |   55|  42.4k|#define XML_MAX_HUGE_LENGTH 1000000000
  ------------------
 5204|  92.4k|                       XML_MAX_TEXT_LENGTH;
  ------------------
  |  |   50|   142k|#define XML_MAX_TEXT_LENGTH 10000000
  ------------------
 5205|  92.4k|    int cur, l;
 5206|  92.4k|    const xmlChar *target;
 5207|       |
 5208|  92.4k|    if ((RAW == '<') && (NXT(1) == '?')) {
  ------------------
  |  | 2224|  92.4k|#define RAW (*ctxt->input->cur)
  ------------------
                  if ((RAW == '<') && (NXT(1) == '?')) {
  ------------------
  |  | 2226|  92.4k|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
  |  Branch (5208:9): [True: 92.4k, False: 0]
  |  Branch (5208:25): [True: 92.4k, False: 0]
  ------------------
 5209|       |	/*
 5210|       |	 * this is a Processing Instruction.
 5211|       |	 */
 5212|  92.4k|	SKIP(2);
  ------------------
  |  | 2248|  92.4k|#define SKIP(val) do {							\
  |  | 2249|  92.4k|    ctxt->input->cur += (val),ctxt->input->col+=(val);			\
  |  | 2250|  92.4k|    if (*ctxt->input->cur == 0)						\
  |  |  ------------------
  |  |  |  Branch (2250:9): [True: 785, False: 91.7k]
  |  |  ------------------
  |  | 2251|  92.4k|        xmlParserGrow(ctxt);						\
  |  | 2252|  92.4k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2252:12): [Folded, False: 92.4k]
  |  |  ------------------
  ------------------
 5213|       |
 5214|       |	/*
 5215|       |	 * Parse the target name and check for special support like
 5216|       |	 * namespace.
 5217|       |	 */
 5218|  92.4k|        target = xmlParsePITarget(ctxt);
 5219|  92.4k|	if (target != NULL) {
  ------------------
  |  Branch (5219:6): [True: 87.3k, False: 5.11k]
  ------------------
 5220|  87.3k|	    if ((RAW == '?') && (NXT(1) == '>')) {
  ------------------
  |  | 2224|  87.3k|#define RAW (*ctxt->input->cur)
  ------------------
              	    if ((RAW == '?') && (NXT(1) == '>')) {
  ------------------
  |  | 2226|  60.1k|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
  |  Branch (5220:10): [True: 60.1k, False: 27.2k]
  |  Branch (5220:26): [True: 59.5k, False: 572]
  ------------------
 5221|  59.5k|		SKIP(2);
  ------------------
  |  | 2248|  59.5k|#define SKIP(val) do {							\
  |  | 2249|  59.5k|    ctxt->input->cur += (val),ctxt->input->col+=(val);			\
  |  | 2250|  59.5k|    if (*ctxt->input->cur == 0)						\
  |  |  ------------------
  |  |  |  Branch (2250:9): [True: 502, False: 59.0k]
  |  |  ------------------
  |  | 2251|  59.5k|        xmlParserGrow(ctxt);						\
  |  | 2252|  59.5k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2252:12): [Folded, False: 59.5k]
  |  |  ------------------
  ------------------
 5222|       |
 5223|       |		/*
 5224|       |		 * SAX: PI detected.
 5225|       |		 */
 5226|  59.5k|		if ((ctxt->sax) && (!ctxt->disableSAX) &&
  ------------------
  |  Branch (5226:7): [True: 59.5k, False: 0]
  |  Branch (5226:22): [True: 59.0k, False: 554]
  ------------------
 5227|  59.0k|		    (ctxt->sax->processingInstruction != NULL))
  ------------------
  |  Branch (5227:7): [True: 59.0k, False: 0]
  ------------------
 5228|  59.0k|		    ctxt->sax->processingInstruction(ctxt->userData,
 5229|  59.0k|		                                     target, NULL);
 5230|  59.5k|		return;
 5231|  59.5k|	    }
 5232|  27.8k|	    buf = xmlMalloc(size);
 5233|  27.8k|	    if (buf == NULL) {
  ------------------
  |  Branch (5233:10): [True: 4, False: 27.8k]
  ------------------
 5234|      4|		xmlErrMemory(ctxt);
 5235|      4|		return;
 5236|      4|	    }
 5237|  27.8k|	    if (SKIP_BLANKS == 0) {
  ------------------
  |  | 2275|  27.8k|#define SKIP_BLANKS xmlSkipBlankChars(ctxt)
  ------------------
  |  Branch (5237:10): [True: 6.45k, False: 21.3k]
  ------------------
 5238|  6.45k|		xmlFatalErrMsgStr(ctxt, XML_ERR_SPACE_REQUIRED,
 5239|  6.45k|			  "ParsePI: PI %s space expected\n", target);
 5240|  6.45k|	    }
 5241|  27.8k|	    cur = xmlCurrentCharRecover(ctxt, &l);
 5242|  3.85M|	    while (IS_CHAR(cur) && /* checked */
  ------------------
  |  |  115|  3.85M|#define IS_CHAR(c)   xmlIsCharQ(c)
  |  |  ------------------
  |  |  |  |  117|  7.70M|#define xmlIsCharQ(c)		(((c) < 0x100) ? \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (117:24): [True: 3.84M, False: 8.10k]
  |  |  |  |  |  Branch (117:25): [True: 1.34M, False: 2.51M]
  |  |  |  |  ------------------
  |  |  |  |  118|  7.70M|				 xmlIsChar_ch((c)) :\
  |  |  |  |  ------------------
  |  |  |  |  |  |  108|  1.34M|#define xmlIsChar_ch(c)		(((0x9 <= (c)) && ((c) <= 0xa)) || \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (108:28): [True: 1.33M, False: 7.79k]
  |  |  |  |  |  |  |  Branch (108:44): [True: 152k, False: 1.18M]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  109|  1.34M|				 ((c) == 0xd) || \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (109:6): [True: 0, False: 1.18M]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  110|  1.34M|				  (0x20 <= (c)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (110:7): [True: 1.18M, False: 7.91k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  119|  7.70M|				(((0x100 <= (c)) && ((c) <= 0xd7ff)) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (119:7): [True: 2.51M, False: 0]
  |  |  |  |  |  Branch (119:25): [True: 1.76M, False: 742k]
  |  |  |  |  ------------------
  |  |  |  |  120|  2.51M|				 ((0xe000 <= (c)) && ((c) <= 0xfffd)) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (120:7): [True: 742k, False: 0]
  |  |  |  |  |  Branch (120:26): [True: 742k, False: 814]
  |  |  |  |  ------------------
  |  |  |  |  121|  2.51M|				 ((0x10000 <= (c)) && ((c) <= 0x10ffff))))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (121:7): [True: 622, False: 192]
  |  |  |  |  |  Branch (121:27): [True: 622, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 5243|  3.84M|		   ((cur != '?') || (NXT(1) != '>'))) {
  ------------------
  |  | 2226|  28.8k|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
  |  Branch (5243:7): [True: 3.81M, False: 28.8k]
  |  Branch (5243:23): [True: 9.14k, False: 19.6k]
  ------------------
 5244|  3.82M|		if (len + 5 >= size) {
  ------------------
  |  Branch (5244:7): [True: 15.2k, False: 3.81M]
  ------------------
 5245|  15.2k|		    xmlChar *tmp;
 5246|  15.2k|                    int newSize;
 5247|       |
 5248|  15.2k|                    newSize = xmlGrowCapacity(size, 1, 1, maxLength);
 5249|  15.2k|                    if (newSize < 0) {
  ------------------
  |  Branch (5249:25): [True: 0, False: 15.2k]
  ------------------
 5250|      0|                        xmlFatalErrMsgStr(ctxt, XML_ERR_PI_NOT_FINISHED,
 5251|      0|                                          "PI %s too big found", target);
 5252|      0|                        xmlFree(buf);
 5253|      0|                        return;
 5254|      0|                    }
 5255|  15.2k|		    tmp = xmlRealloc(buf, newSize);
 5256|  15.2k|		    if (tmp == NULL) {
  ------------------
  |  Branch (5256:11): [True: 7, False: 15.2k]
  ------------------
 5257|      7|			xmlErrMemory(ctxt);
 5258|      7|			xmlFree(buf);
 5259|      7|			return;
 5260|      7|		    }
 5261|  15.2k|		    buf = tmp;
 5262|  15.2k|                    size = newSize;
 5263|  15.2k|		}
 5264|  3.82M|		COPY_BUF(buf, len, cur);
  ------------------
  |  | 2296|  3.82M|    if (v < 0x80) b[i++] = v;						\
  |  |  ------------------
  |  |  |  Branch (2296:9): [True: 1.30M, False: 2.52M]
  |  |  ------------------
  |  | 2297|  3.82M|    else i += xmlCopyCharMultiByte(&b[i],v)
  ------------------
 5265|  3.82M|		NEXTL(l);
  ------------------
  |  | 2288|  3.82M|#define NEXTL(l) do {							\
  |  | 2289|  3.82M|    if (*(ctxt->input->cur) == '\n') {					\
  |  |  ------------------
  |  |  |  Branch (2289:9): [True: 149k, False: 3.67M]
  |  |  ------------------
  |  | 2290|   149k|	ctxt->input->line++; ctxt->input->col = 1;			\
  |  | 2291|  3.67M|    } else ctxt->input->col++;						\
  |  | 2292|  3.82M|    ctxt->input->cur += l;				\
  |  | 2293|  3.82M|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2293:12): [Folded, False: 3.82M]
  |  |  ------------------
  ------------------
 5266|  3.82M|		cur = xmlCurrentCharRecover(ctxt, &l);
 5267|  3.82M|	    }
 5268|  27.8k|	    buf[len] = 0;
 5269|  27.8k|	    if (cur != '?') {
  ------------------
  |  Branch (5269:10): [True: 8.10k, False: 19.6k]
  ------------------
 5270|  8.10k|		xmlFatalErrMsgStr(ctxt, XML_ERR_PI_NOT_FINISHED,
 5271|  8.10k|		      "ParsePI: PI %s never end ...\n", target);
 5272|  19.6k|	    } else {
 5273|  19.6k|		SKIP(2);
  ------------------
  |  | 2248|  19.6k|#define SKIP(val) do {							\
  |  | 2249|  19.6k|    ctxt->input->cur += (val),ctxt->input->col+=(val);			\
  |  | 2250|  19.6k|    if (*ctxt->input->cur == 0)						\
  |  |  ------------------
  |  |  |  Branch (2250:9): [True: 271, False: 19.4k]
  |  |  ------------------
  |  | 2251|  19.6k|        xmlParserGrow(ctxt);						\
  |  | 2252|  19.6k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2252:12): [Folded, False: 19.6k]
  |  |  ------------------
  ------------------
 5274|       |
 5275|  19.6k|#ifdef LIBXML_CATALOG_ENABLED
 5276|  19.6k|		if ((ctxt->inSubset == 0) &&
  ------------------
  |  Branch (5276:7): [True: 7.82k, False: 11.8k]
  ------------------
 5277|  7.82k|		    (xmlStrEqual(target, XML_CATALOG_PI))) {
  ------------------
  |  |   44|  7.82k|    (const xmlChar *) "oasis-xml-catalog"
  ------------------
  |  Branch (5277:7): [True: 236, False: 7.59k]
  ------------------
 5278|    236|		    xmlCatalogAllow allow = xmlCatalogGetDefaults();
 5279|       |
 5280|    236|		    if ((ctxt->options & XML_PARSE_CATALOG_PI) &&
  ------------------
  |  Branch (5280:11): [True: 42, False: 194]
  ------------------
 5281|     42|                        ((allow == XML_CATA_ALLOW_DOCUMENT) ||
  ------------------
  |  Branch (5281:26): [True: 0, False: 42]
  ------------------
 5282|     42|			 (allow == XML_CATA_ALLOW_ALL)))
  ------------------
  |  Branch (5282:5): [True: 0, False: 42]
  ------------------
 5283|      0|			xmlParseCatalogPI(ctxt, buf);
 5284|    236|		}
 5285|  19.6k|#endif
 5286|       |
 5287|       |		/*
 5288|       |		 * SAX: PI detected.
 5289|       |		 */
 5290|  19.6k|		if ((ctxt->sax) && (!ctxt->disableSAX) &&
  ------------------
  |  Branch (5290:7): [True: 19.6k, False: 0]
  |  Branch (5290:22): [True: 18.5k, False: 1.15k]
  ------------------
 5291|  18.5k|		    (ctxt->sax->processingInstruction != NULL))
  ------------------
  |  Branch (5291:7): [True: 18.5k, False: 0]
  ------------------
 5292|  18.5k|		    ctxt->sax->processingInstruction(ctxt->userData,
 5293|  18.5k|		                                     target, buf);
 5294|  19.6k|	    }
 5295|  27.8k|	    xmlFree(buf);
 5296|  27.8k|	} else {
 5297|       |	    xmlFatalErr(ctxt, XML_ERR_PI_NOT_STARTED, NULL);
 5298|  5.11k|	}
 5299|  92.4k|    }
 5300|  92.4k|}
xmlParseNotationDecl:
 5322|  4.14k|xmlParseNotationDecl(xmlParserCtxt *ctxt) {
 5323|  4.14k|    const xmlChar *name;
 5324|  4.14k|    xmlChar *Pubid;
 5325|  4.14k|    xmlChar *Systemid;
 5326|       |
 5327|  4.14k|    if ((CUR != '<') || (NXT(1) != '!'))
  ------------------
  |  | 2225|  4.14k|#define CUR (*ctxt->input->cur)
  ------------------
                  if ((CUR != '<') || (NXT(1) != '!'))
  ------------------
  |  | 2226|  4.14k|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
  |  Branch (5327:9): [True: 0, False: 4.14k]
  |  Branch (5327:25): [True: 0, False: 4.14k]
  ------------------
 5328|      0|        return;
 5329|  4.14k|    SKIP(2);
  ------------------
  |  | 2248|  4.14k|#define SKIP(val) do {							\
  |  | 2249|  4.14k|    ctxt->input->cur += (val),ctxt->input->col+=(val);			\
  |  | 2250|  4.14k|    if (*ctxt->input->cur == 0)						\
  |  |  ------------------
  |  |  |  Branch (2250:9): [True: 0, False: 4.14k]
  |  |  ------------------
  |  | 2251|  4.14k|        xmlParserGrow(ctxt);						\
  |  | 2252|  4.14k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2252:12): [Folded, False: 4.14k]
  |  |  ------------------
  ------------------
 5330|       |
 5331|  4.14k|    if (CMP8(CUR_PTR, 'N', 'O', 'T', 'A', 'T', 'I', 'O', 'N')) {
  ------------------
  |  | 2240|  4.14k|  ( CMP7( s, c1, c2, c3, c4, c5, c6, c7 ) && ((unsigned char *) s)[ 7 ] == c8 )
  |  |  ------------------
  |  |  |  | 2238|  8.29k|  ( CMP6( s, c1, c2, c3, c4, c5, c6 ) && ((unsigned char *) s)[ 6 ] == c7 )
  |  |  |  |  ------------------
  |  |  |  |  |  | 2236|  8.29k|  ( CMP5( s, c1, c2, c3, c4, c5 ) && ((unsigned char *) s)[ 5 ] == c6 )
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  | 2234|  8.29k|  ( CMP4( s, c1, c2, c3, c4 ) && ((unsigned char *) s)[ 4 ] == c5 )
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  | 2231|  8.29k|  ( ((unsigned char *) s)[ 0 ] == c1 && ((unsigned char *) s)[ 1 ] == c2 && \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (2231:5): [True: 4.14k, False: 0]
  |  |  |  |  |  |  |  |  |  |  |  Branch (2231:41): [True: 4.14k, False: 5]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  | 2232|  4.14k|    ((unsigned char *) s)[ 2 ] == c3 && ((unsigned char *) s)[ 3 ] == c4 )
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (2232:5): [True: 4.13k, False: 4]
  |  |  |  |  |  |  |  |  |  |  |  Branch (2232:41): [True: 4.13k, False: 6]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (2234:34): [True: 4.13k, False: 1]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (2236:38): [True: 4.12k, False: 4]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2238:42): [True: 4.12k, False: 1]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2240:46): [True: 4.12k, False: 2]
  |  |  ------------------
  ------------------
 5332|  4.12k|#ifdef LIBXML_VALID_ENABLED
 5333|  4.12k|	int oldInputNr = ctxt->inputNr;
 5334|  4.12k|#endif
 5335|       |
 5336|  4.12k|	SKIP(8);
  ------------------
  |  | 2248|  4.12k|#define SKIP(val) do {							\
  |  | 2249|  4.12k|    ctxt->input->cur += (val),ctxt->input->col+=(val);			\
  |  | 2250|  4.12k|    if (*ctxt->input->cur == 0)						\
  |  |  ------------------
  |  |  |  Branch (2250:9): [True: 54, False: 4.07k]
  |  |  ------------------
  |  | 2251|  4.12k|        xmlParserGrow(ctxt);						\
  |  | 2252|  4.12k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2252:12): [Folded, False: 4.12k]
  |  |  ------------------
  ------------------
 5337|  4.12k|	if (SKIP_BLANKS_PE == 0) {
  ------------------
  |  | 2277|  4.12k|#define SKIP_BLANKS_PE xmlSkipBlankCharsPE(ctxt)
  ------------------
  |  Branch (5337:6): [True: 494, False: 3.63k]
  ------------------
 5338|    494|	    xmlFatalErrMsg(ctxt, XML_ERR_SPACE_REQUIRED,
 5339|    494|			   "Space required after '<!NOTATION'\n");
 5340|    494|	    return;
 5341|    494|	}
 5342|       |
 5343|  3.63k|        name = xmlParseName(ctxt);
 5344|  3.63k|	if (name == NULL) {
  ------------------
  |  Branch (5344:6): [True: 275, False: 3.35k]
  ------------------
 5345|    275|	    xmlFatalErr(ctxt, XML_ERR_NOTATION_NOT_STARTED, NULL);
 5346|    275|	    return;
 5347|    275|	}
 5348|  3.35k|	if (xmlStrchr(name, ':') != NULL) {
  ------------------
  |  Branch (5348:6): [True: 160, False: 3.19k]
  ------------------
 5349|    160|	    xmlNsErr(ctxt, XML_NS_ERR_COLON,
 5350|    160|		     "colons are forbidden from notation names '%s'\n",
 5351|    160|		     name, NULL, NULL);
 5352|    160|	}
 5353|  3.35k|	if (SKIP_BLANKS_PE == 0) {
  ------------------
  |  | 2277|  3.35k|#define SKIP_BLANKS_PE xmlSkipBlankCharsPE(ctxt)
  ------------------
  |  Branch (5353:6): [True: 104, False: 3.25k]
  ------------------
 5354|    104|	    xmlFatalErrMsg(ctxt, XML_ERR_SPACE_REQUIRED,
 5355|    104|		     "Space required after the NOTATION name'\n");
 5356|    104|	    return;
 5357|    104|	}
 5358|       |
 5359|       |	/*
 5360|       |	 * Parse the IDs.
 5361|       |	 */
 5362|  3.25k|	Systemid = xmlParseExternalID(ctxt, &Pubid, 0);
 5363|  3.25k|	SKIP_BLANKS_PE;
  ------------------
  |  | 2277|  3.25k|#define SKIP_BLANKS_PE xmlSkipBlankCharsPE(ctxt)
  ------------------
 5364|       |
 5365|  3.25k|	if (RAW == '>') {
  ------------------
  |  | 2224|  3.25k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (5365:6): [True: 2.88k, False: 365]
  ------------------
 5366|  2.88k|#ifdef LIBXML_VALID_ENABLED
 5367|  2.88k|	    if ((ctxt->validate) && (ctxt->inputNr > oldInputNr)) {
  ------------------
  |  Branch (5367:10): [True: 1.54k, False: 1.34k]
  |  Branch (5367:30): [True: 6, False: 1.53k]
  ------------------
 5368|      6|		xmlValidityError(ctxt, XML_ERR_ENTITY_BOUNDARY,
 5369|      6|	                         "Notation declaration doesn't start and stop"
 5370|      6|                                 " in the same entity\n",
 5371|      6|                                 NULL, NULL);
 5372|      6|	    }
 5373|  2.88k|#endif
 5374|  2.88k|	    NEXT;
  ------------------
  |  | 2279|  2.88k|#define NEXT xmlNextChar(ctxt)
  ------------------
 5375|  2.88k|	    if ((ctxt->sax != NULL) && (!ctxt->disableSAX) &&
  ------------------
  |  Branch (5375:10): [True: 2.88k, False: 0]
  |  Branch (5375:33): [True: 2.06k, False: 823]
  ------------------
 5376|  2.06k|		(ctxt->sax->notationDecl != NULL))
  ------------------
  |  Branch (5376:3): [True: 2.06k, False: 0]
  ------------------
 5377|  2.06k|		ctxt->sax->notationDecl(ctxt->userData, name, Pubid, Systemid);
 5378|  2.88k|	} else {
 5379|    365|	    xmlFatalErr(ctxt, XML_ERR_NOTATION_NOT_FINISHED, NULL);
 5380|    365|	}
 5381|  3.25k|	if (Systemid != NULL) xmlFree(Systemid);
  ------------------
  |  Branch (5381:6): [True: 1.03k, False: 2.21k]
  ------------------
 5382|  3.25k|	if (Pubid != NULL) xmlFree(Pubid);
  ------------------
  |  Branch (5382:6): [True: 1.89k, False: 1.35k]
  ------------------
 5383|  3.25k|    }
 5384|  4.14k|}
xmlParseEntityDecl:
 5410|   149k|xmlParseEntityDecl(xmlParserCtxt *ctxt) {
 5411|   149k|    const xmlChar *name = NULL;
 5412|   149k|    xmlChar *value = NULL;
 5413|   149k|    xmlChar *URI = NULL, *literal = NULL;
 5414|   149k|    const xmlChar *ndata = NULL;
 5415|   149k|    int isParameter = 0;
 5416|   149k|    xmlChar *orig = NULL;
 5417|       |
 5418|   149k|    if ((CUR != '<') || (NXT(1) != '!'))
  ------------------
  |  | 2225|   149k|#define CUR (*ctxt->input->cur)
  ------------------
                  if ((CUR != '<') || (NXT(1) != '!'))
  ------------------
  |  | 2226|   149k|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
  |  Branch (5418:9): [True: 0, False: 149k]
  |  Branch (5418:25): [True: 0, False: 149k]
  ------------------
 5419|      0|        return;
 5420|   149k|    SKIP(2);
  ------------------
  |  | 2248|   149k|#define SKIP(val) do {							\
  |  | 2249|   149k|    ctxt->input->cur += (val),ctxt->input->col+=(val);			\
  |  | 2250|   149k|    if (*ctxt->input->cur == 0)						\
  |  |  ------------------
  |  |  |  Branch (2250:9): [True: 0, False: 149k]
  |  |  ------------------
  |  | 2251|   149k|        xmlParserGrow(ctxt);						\
  |  | 2252|   149k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2252:12): [Folded, False: 149k]
  |  |  ------------------
  ------------------
 5421|       |
 5422|       |    /* GROW; done in the caller */
 5423|   149k|    if (CMP6(CUR_PTR, 'E', 'N', 'T', 'I', 'T', 'Y')) {
  ------------------
  |  | 2236|   149k|  ( CMP5( s, c1, c2, c3, c4, c5 ) && ((unsigned char *) s)[ 5 ] == c6 )
  |  |  ------------------
  |  |  |  | 2234|   299k|  ( CMP4( s, c1, c2, c3, c4 ) && ((unsigned char *) s)[ 4 ] == c5 )
  |  |  |  |  ------------------
  |  |  |  |  |  | 2231|   299k|  ( ((unsigned char *) s)[ 0 ] == c1 && ((unsigned char *) s)[ 1 ] == c2 && \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (2231:5): [True: 149k, False: 0]
  |  |  |  |  |  |  |  Branch (2231:41): [True: 149k, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 2232|   149k|    ((unsigned char *) s)[ 2 ] == c3 && ((unsigned char *) s)[ 3 ] == c4 )
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (2232:5): [True: 149k, False: 17]
  |  |  |  |  |  |  |  Branch (2232:41): [True: 149k, False: 8]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2234:34): [True: 149k, False: 8]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2236:38): [True: 149k, False: 4]
  |  |  ------------------
  ------------------
 5424|   149k|#ifdef LIBXML_VALID_ENABLED
 5425|   149k|	int oldInputNr = ctxt->inputNr;
 5426|   149k|#endif
 5427|       |
 5428|   149k|	SKIP(6);
  ------------------
  |  | 2248|   149k|#define SKIP(val) do {							\
  |  | 2249|   149k|    ctxt->input->cur += (val),ctxt->input->col+=(val);			\
  |  | 2250|   149k|    if (*ctxt->input->cur == 0)						\
  |  |  ------------------
  |  |  |  Branch (2250:9): [True: 234, False: 149k]
  |  |  ------------------
  |  | 2251|   149k|        xmlParserGrow(ctxt);						\
  |  | 2252|   149k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2252:12): [Folded, False: 149k]
  |  |  ------------------
  ------------------
 5429|   149k|	if (SKIP_BLANKS_PE == 0) {
  ------------------
  |  | 2277|   149k|#define SKIP_BLANKS_PE xmlSkipBlankCharsPE(ctxt)
  ------------------
  |  Branch (5429:6): [True: 2.28k, False: 147k]
  ------------------
 5430|  2.28k|	    xmlFatalErrMsg(ctxt, XML_ERR_SPACE_REQUIRED,
 5431|  2.28k|			   "Space required after '<!ENTITY'\n");
 5432|  2.28k|	}
 5433|       |
 5434|   149k|	if (RAW == '%') {
  ------------------
  |  | 2224|   149k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (5434:6): [True: 60.1k, False: 89.5k]
  ------------------
 5435|  60.1k|	    NEXT;
  ------------------
  |  | 2279|  60.1k|#define NEXT xmlNextChar(ctxt)
  ------------------
 5436|  60.1k|	    if (SKIP_BLANKS_PE == 0) {
  ------------------
  |  | 2277|  60.1k|#define SKIP_BLANKS_PE xmlSkipBlankCharsPE(ctxt)
  ------------------
  |  Branch (5436:10): [True: 157, False: 60.0k]
  ------------------
 5437|    157|		xmlFatalErrMsg(ctxt, XML_ERR_SPACE_REQUIRED,
 5438|    157|			       "Space required after '%%'\n");
 5439|    157|	    }
 5440|  60.1k|	    isParameter = 1;
 5441|  60.1k|	}
 5442|       |
 5443|   149k|        name = xmlParseName(ctxt);
 5444|   149k|	if (name == NULL) {
  ------------------
  |  Branch (5444:6): [True: 29.0k, False: 120k]
  ------------------
 5445|  29.0k|	    xmlFatalErrMsg(ctxt, XML_ERR_NAME_REQUIRED,
 5446|  29.0k|	                   "xmlParseEntityDecl: no name\n");
 5447|  29.0k|            return;
 5448|  29.0k|	}
 5449|   120k|	if (xmlStrchr(name, ':') != NULL) {
  ------------------
  |  Branch (5449:6): [True: 1.43k, False: 119k]
  ------------------
 5450|  1.43k|	    xmlNsErr(ctxt, XML_NS_ERR_COLON,
 5451|  1.43k|		     "colons are forbidden from entities names '%s'\n",
 5452|  1.43k|		     name, NULL, NULL);
 5453|  1.43k|	}
 5454|   120k|	if (SKIP_BLANKS_PE == 0) {
  ------------------
  |  | 2277|   120k|#define SKIP_BLANKS_PE xmlSkipBlankCharsPE(ctxt)
  ------------------
  |  Branch (5454:6): [True: 2.55k, False: 118k]
  ------------------
 5455|  2.55k|	    xmlFatalErrMsg(ctxt, XML_ERR_SPACE_REQUIRED,
 5456|  2.55k|			   "Space required after the entity name\n");
 5457|  2.55k|	}
 5458|       |
 5459|       |	/*
 5460|       |	 * handle the various case of definitions...
 5461|       |	 */
 5462|   120k|	if (isParameter) {
  ------------------
  |  Branch (5462:6): [True: 59.6k, False: 61.0k]
  ------------------
 5463|  59.6k|	    if ((RAW == '"') || (RAW == '\'')) {
  ------------------
  |  | 2224|  59.6k|#define RAW (*ctxt->input->cur)
  ------------------
              	    if ((RAW == '"') || (RAW == '\'')) {
  ------------------
  |  | 2224|  7.84k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (5463:10): [True: 51.8k, False: 7.84k]
  |  Branch (5463:26): [True: 1.02k, False: 6.81k]
  ------------------
 5464|  52.8k|	        value = xmlParseEntityValue(ctxt, &orig);
 5465|  52.8k|		if (value) {
  ------------------
  |  Branch (5465:7): [True: 51.9k, False: 842]
  ------------------
 5466|  51.9k|		    if ((ctxt->sax != NULL) &&
  ------------------
  |  Branch (5466:11): [True: 51.9k, False: 0]
  ------------------
 5467|  51.9k|			(!ctxt->disableSAX) && (ctxt->sax->entityDecl != NULL))
  ------------------
  |  Branch (5467:4): [True: 49.1k, False: 2.82k]
  |  Branch (5467:27): [True: 49.1k, False: 0]
  ------------------
 5468|  49.1k|			ctxt->sax->entityDecl(ctxt->userData, name,
 5469|  49.1k|		                    XML_INTERNAL_PARAMETER_ENTITY,
 5470|  49.1k|				    NULL, NULL, value);
 5471|  51.9k|		}
 5472|  52.8k|	    } else {
 5473|  6.81k|	        URI = xmlParseExternalID(ctxt, &literal, 1);
 5474|  6.81k|		if ((URI == NULL) && (literal == NULL)) {
  ------------------
  |  Branch (5474:7): [True: 812, False: 6.00k]
  |  Branch (5474:24): [True: 687, False: 125]
  ------------------
 5475|    687|		    xmlFatalErr(ctxt, XML_ERR_VALUE_REQUIRED, NULL);
 5476|    687|		}
 5477|  6.81k|		if (URI) {
  ------------------
  |  Branch (5477:7): [True: 6.00k, False: 812]
  ------------------
 5478|  6.00k|                    if (xmlStrchr(URI, '#')) {
  ------------------
  |  Branch (5478:25): [True: 444, False: 5.55k]
  ------------------
 5479|    444|                        xmlFatalErr(ctxt, XML_ERR_URI_FRAGMENT, NULL);
 5480|  5.55k|                    } else {
 5481|  5.55k|                        if ((ctxt->sax != NULL) &&
  ------------------
  |  Branch (5481:29): [True: 5.55k, False: 0]
  ------------------
 5482|  5.55k|                            (!ctxt->disableSAX) &&
  ------------------
  |  Branch (5482:29): [True: 5.40k, False: 150]
  ------------------
 5483|  5.40k|                            (ctxt->sax->entityDecl != NULL))
  ------------------
  |  Branch (5483:29): [True: 5.40k, False: 0]
  ------------------
 5484|  5.40k|                            ctxt->sax->entityDecl(ctxt->userData, name,
 5485|  5.40k|                                        XML_EXTERNAL_PARAMETER_ENTITY,
 5486|  5.40k|                                        literal, URI, NULL);
 5487|  5.55k|                    }
 5488|  6.00k|		}
 5489|  6.81k|	    }
 5490|  61.0k|	} else {
 5491|  61.0k|	    if ((RAW == '"') || (RAW == '\'')) {
  ------------------
  |  | 2224|  61.0k|#define RAW (*ctxt->input->cur)
  ------------------
              	    if ((RAW == '"') || (RAW == '\'')) {
  ------------------
  |  | 2224|  13.6k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (5491:10): [True: 47.4k, False: 13.6k]
  |  Branch (5491:26): [True: 3.01k, False: 10.6k]
  ------------------
 5492|  50.4k|	        value = xmlParseEntityValue(ctxt, &orig);
 5493|  50.4k|		if ((ctxt->sax != NULL) &&
  ------------------
  |  Branch (5493:7): [True: 50.4k, False: 0]
  ------------------
 5494|  50.4k|		    (!ctxt->disableSAX) && (ctxt->sax->entityDecl != NULL))
  ------------------
  |  Branch (5494:7): [True: 49.1k, False: 1.28k]
  |  Branch (5494:30): [True: 49.1k, False: 0]
  ------------------
 5495|  49.1k|		    ctxt->sax->entityDecl(ctxt->userData, name,
 5496|  49.1k|				XML_INTERNAL_GENERAL_ENTITY,
 5497|  49.1k|				NULL, NULL, value);
 5498|       |		/*
 5499|       |		 * For expat compatibility in SAX mode.
 5500|       |		 */
 5501|  50.4k|		if ((ctxt->myDoc == NULL) ||
  ------------------
  |  Branch (5501:7): [True: 9, False: 50.4k]
  ------------------
 5502|  50.4k|		    (xmlStrEqual(ctxt->myDoc->version, SAX_COMPAT_MODE))) {
  ------------------
  |  |  173|  50.4k|#define SAX_COMPAT_MODE BAD_CAST "SAX compatibility mode document"
  |  |  ------------------
  |  |  |  |   34|  50.4k|#define BAD_CAST (xmlChar *)
  |  |  ------------------
  ------------------
  |  Branch (5502:7): [True: 62, False: 50.3k]
  ------------------
 5503|     71|		    if (ctxt->myDoc == NULL) {
  ------------------
  |  Branch (5503:11): [True: 9, False: 62]
  ------------------
 5504|      9|			ctxt->myDoc = xmlNewDoc(SAX_COMPAT_MODE);
  ------------------
  |  |  173|      9|#define SAX_COMPAT_MODE BAD_CAST "SAX compatibility mode document"
  |  |  ------------------
  |  |  |  |   34|      9|#define BAD_CAST (xmlChar *)
  |  |  ------------------
  ------------------
 5505|      9|			if (ctxt->myDoc == NULL) {
  ------------------
  |  Branch (5505:8): [True: 1, False: 8]
  ------------------
 5506|      1|			    xmlErrMemory(ctxt);
 5507|      1|			    goto done;
 5508|      1|			}
 5509|      8|			ctxt->myDoc->properties = XML_DOC_INTERNAL;
 5510|      8|		    }
 5511|     70|		    if (ctxt->myDoc->intSubset == NULL) {
  ------------------
  |  Branch (5511:11): [True: 8, False: 62]
  ------------------
 5512|      8|			ctxt->myDoc->intSubset = xmlNewDtd(ctxt->myDoc,
 5513|      8|					    BAD_CAST "fake", NULL, NULL);
  ------------------
  |  |   34|      8|#define BAD_CAST (xmlChar *)
  ------------------
 5514|      8|                        if (ctxt->myDoc->intSubset == NULL) {
  ------------------
  |  Branch (5514:29): [True: 1, False: 7]
  ------------------
 5515|      1|                            xmlErrMemory(ctxt);
 5516|      1|                            goto done;
 5517|      1|                        }
 5518|      8|                    }
 5519|       |
 5520|     69|		    xmlSAX2EntityDecl(ctxt, name, XML_INTERNAL_GENERAL_ENTITY,
 5521|     69|			              NULL, NULL, value);
 5522|     69|		}
 5523|  50.4k|	    } else {
 5524|  10.6k|	        URI = xmlParseExternalID(ctxt, &literal, 1);
 5525|  10.6k|		if ((URI == NULL) && (literal == NULL)) {
  ------------------
  |  Branch (5525:7): [True: 4.05k, False: 6.57k]
  |  Branch (5525:24): [True: 3.87k, False: 175]
  ------------------
 5526|  3.87k|		    xmlFatalErr(ctxt, XML_ERR_VALUE_REQUIRED, NULL);
 5527|  3.87k|		}
 5528|  10.6k|		if (URI) {
  ------------------
  |  Branch (5528:7): [True: 6.57k, False: 4.05k]
  ------------------
 5529|  6.57k|                    if (xmlStrchr(URI, '#')) {
  ------------------
  |  Branch (5529:25): [True: 337, False: 6.23k]
  ------------------
 5530|    337|                        xmlFatalErr(ctxt, XML_ERR_URI_FRAGMENT, NULL);
 5531|    337|                    }
 5532|  6.57k|		}
 5533|  10.6k|		if ((RAW != '>') && (SKIP_BLANKS_PE == 0)) {
  ------------------
  |  | 2224|  10.6k|#define RAW (*ctxt->input->cur)
  ------------------
              		if ((RAW != '>') && (SKIP_BLANKS_PE == 0)) {
  ------------------
  |  | 2277|  5.20k|#define SKIP_BLANKS_PE xmlSkipBlankCharsPE(ctxt)
  ------------------
  |  Branch (5533:7): [True: 5.20k, False: 5.41k]
  |  Branch (5533:23): [True: 3.57k, False: 1.63k]
  ------------------
 5534|  3.57k|		    xmlFatalErrMsg(ctxt, XML_ERR_SPACE_REQUIRED,
 5535|  3.57k|				   "Space required before 'NDATA'\n");
 5536|  3.57k|		}
 5537|  10.6k|		if (CMP5(CUR_PTR, 'N', 'D', 'A', 'T', 'A')) {
  ------------------
  |  | 2234|  10.6k|  ( CMP4( s, c1, c2, c3, c4 ) && ((unsigned char *) s)[ 4 ] == c5 )
  |  |  ------------------
  |  |  |  | 2231|  21.2k|  ( ((unsigned char *) s)[ 0 ] == c1 && ((unsigned char *) s)[ 1 ] == c2 && \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2231:5): [True: 642, False: 9.98k]
  |  |  |  |  |  Branch (2231:41): [True: 640, False: 2]
  |  |  |  |  ------------------
  |  |  |  | 2232|  10.6k|    ((unsigned char *) s)[ 2 ] == c3 && ((unsigned char *) s)[ 3 ] == c4 )
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2232:5): [True: 633, False: 7]
  |  |  |  |  |  Branch (2232:41): [True: 632, False: 1]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2234:34): [True: 631, False: 1]
  |  |  ------------------
  ------------------
 5538|    631|		    SKIP(5);
  ------------------
  |  | 2248|    631|#define SKIP(val) do {							\
  |  | 2249|    631|    ctxt->input->cur += (val),ctxt->input->col+=(val);			\
  |  | 2250|    631|    if (*ctxt->input->cur == 0)						\
  |  |  ------------------
  |  |  |  Branch (2250:9): [True: 50, False: 581]
  |  |  ------------------
  |  | 2251|    631|        xmlParserGrow(ctxt);						\
  |  | 2252|    631|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2252:12): [Folded, False: 631]
  |  |  ------------------
  ------------------
 5539|    631|		    if (SKIP_BLANKS_PE == 0) {
  ------------------
  |  | 2277|    631|#define SKIP_BLANKS_PE xmlSkipBlankCharsPE(ctxt)
  ------------------
  |  Branch (5539:11): [True: 332, False: 299]
  ------------------
 5540|    332|			xmlFatalErrMsg(ctxt, XML_ERR_SPACE_REQUIRED,
 5541|    332|				       "Space required after 'NDATA'\n");
 5542|    332|		    }
 5543|    631|		    ndata = xmlParseName(ctxt);
 5544|    631|		    if ((ctxt->sax != NULL) && (!ctxt->disableSAX) &&
  ------------------
  |  Branch (5544:11): [True: 631, False: 0]
  |  Branch (5544:34): [True: 505, False: 126]
  ------------------
 5545|    505|		        (ctxt->sax->unparsedEntityDecl != NULL))
  ------------------
  |  Branch (5545:11): [True: 505, False: 0]
  ------------------
 5546|    505|			ctxt->sax->unparsedEntityDecl(ctxt->userData, name,
 5547|    505|				    literal, URI, ndata);
 5548|  9.99k|		} else {
 5549|  9.99k|		    if ((ctxt->sax != NULL) &&
  ------------------
  |  Branch (5549:11): [True: 9.99k, False: 0]
  ------------------
 5550|  9.99k|		        (!ctxt->disableSAX) && (ctxt->sax->entityDecl != NULL))
  ------------------
  |  Branch (5550:11): [True: 9.16k, False: 823]
  |  Branch (5550:34): [True: 9.16k, False: 0]
  ------------------
 5551|  9.16k|			ctxt->sax->entityDecl(ctxt->userData, name,
 5552|  9.16k|				    XML_EXTERNAL_GENERAL_PARSED_ENTITY,
 5553|  9.16k|				    literal, URI, NULL);
 5554|       |		    /*
 5555|       |		     * For expat compatibility in SAX mode.
 5556|       |		     * assuming the entity replacement was asked for
 5557|       |		     */
 5558|  9.99k|		    if ((ctxt->replaceEntities != 0) &&
  ------------------
  |  Branch (5558:11): [True: 3.77k, False: 6.21k]
  ------------------
 5559|  3.77k|			((ctxt->myDoc == NULL) ||
  ------------------
  |  Branch (5559:5): [True: 9, False: 3.76k]
  ------------------
 5560|  3.76k|			(xmlStrEqual(ctxt->myDoc->version, SAX_COMPAT_MODE)))) {
  ------------------
  |  |  173|  3.76k|#define SAX_COMPAT_MODE BAD_CAST "SAX compatibility mode document"
  |  |  ------------------
  |  |  |  |   34|  3.76k|#define BAD_CAST (xmlChar *)
  |  |  ------------------
  ------------------
  |  Branch (5560:4): [True: 217, False: 3.55k]
  ------------------
 5561|    226|			if (ctxt->myDoc == NULL) {
  ------------------
  |  Branch (5561:8): [True: 9, False: 217]
  ------------------
 5562|      9|			    ctxt->myDoc = xmlNewDoc(SAX_COMPAT_MODE);
  ------------------
  |  |  173|      9|#define SAX_COMPAT_MODE BAD_CAST "SAX compatibility mode document"
  |  |  ------------------
  |  |  |  |   34|      9|#define BAD_CAST (xmlChar *)
  |  |  ------------------
  ------------------
 5563|      9|			    if (ctxt->myDoc == NULL) {
  ------------------
  |  Branch (5563:12): [True: 1, False: 8]
  ------------------
 5564|      1|			        xmlErrMemory(ctxt);
 5565|      1|				goto done;
 5566|      1|			    }
 5567|      8|			    ctxt->myDoc->properties = XML_DOC_INTERNAL;
 5568|      8|			}
 5569|       |
 5570|    225|			if (ctxt->myDoc->intSubset == NULL) {
  ------------------
  |  Branch (5570:8): [True: 8, False: 217]
  ------------------
 5571|      8|			    ctxt->myDoc->intSubset = xmlNewDtd(ctxt->myDoc,
 5572|      8|						BAD_CAST "fake", NULL, NULL);
  ------------------
  |  |   34|      8|#define BAD_CAST (xmlChar *)
  ------------------
 5573|      8|                            if (ctxt->myDoc->intSubset == NULL) {
  ------------------
  |  Branch (5573:33): [True: 0, False: 8]
  ------------------
 5574|      0|                                xmlErrMemory(ctxt);
 5575|      0|                                goto done;
 5576|      0|                            }
 5577|      8|                        }
 5578|    225|			xmlSAX2EntityDecl(ctxt, name,
 5579|    225|				          XML_EXTERNAL_GENERAL_PARSED_ENTITY,
 5580|    225|				          literal, URI, NULL);
 5581|    225|		    }
 5582|  9.99k|		}
 5583|  10.6k|	    }
 5584|  61.0k|	}
 5585|   120k|	SKIP_BLANKS_PE;
  ------------------
  |  | 2277|   120k|#define SKIP_BLANKS_PE xmlSkipBlankCharsPE(ctxt)
  ------------------
 5586|   120k|	if (RAW != '>') {
  ------------------
  |  | 2224|   120k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (5586:6): [True: 8.61k, False: 112k]
  ------------------
 5587|  8.61k|	    xmlFatalErrMsgStr(ctxt, XML_ERR_ENTITY_NOT_FINISHED,
 5588|  8.61k|	            "xmlParseEntityDecl: entity %s not terminated\n", name);
 5589|   112k|	} else {
 5590|   112k|#ifdef LIBXML_VALID_ENABLED
 5591|   112k|	    if ((ctxt->validate) && (ctxt->inputNr > oldInputNr)) {
  ------------------
  |  Branch (5591:10): [True: 83.3k, False: 28.7k]
  |  Branch (5591:30): [True: 6, False: 83.3k]
  ------------------
 5592|      6|		xmlValidityError(ctxt, XML_ERR_ENTITY_BOUNDARY,
 5593|      6|	                         "Entity declaration doesn't start and stop in"
 5594|      6|                                 " the same entity\n",
 5595|      6|                                 NULL, NULL);
 5596|      6|	    }
 5597|   112k|#endif
 5598|   112k|	    NEXT;
  ------------------
  |  | 2279|   112k|#define NEXT xmlNextChar(ctxt)
  ------------------
 5599|   112k|	}
 5600|   120k|	if (orig != NULL) {
  ------------------
  |  Branch (5600:6): [True: 101k, False: 19.5k]
  ------------------
 5601|       |	    /*
 5602|       |	     * Ugly mechanism to save the raw entity value.
 5603|       |	     */
 5604|   101k|	    xmlEntityPtr cur = NULL;
 5605|       |
 5606|   101k|	    if (isParameter) {
  ------------------
  |  Branch (5606:10): [True: 51.9k, False: 49.1k]
  ------------------
 5607|  51.9k|	        if ((ctxt->sax != NULL) &&
  ------------------
  |  Branch (5607:14): [True: 51.9k, False: 0]
  ------------------
 5608|  51.9k|		    (ctxt->sax->getParameterEntity != NULL))
  ------------------
  |  Branch (5608:7): [True: 51.9k, False: 0]
  ------------------
 5609|  51.9k|		    cur = ctxt->sax->getParameterEntity(ctxt->userData, name);
 5610|  51.9k|	    } else {
 5611|  49.1k|	        if ((ctxt->sax != NULL) &&
  ------------------
  |  Branch (5611:14): [True: 49.1k, False: 0]
  ------------------
 5612|  49.1k|		    (ctxt->sax->getEntity != NULL))
  ------------------
  |  Branch (5612:7): [True: 49.1k, False: 0]
  ------------------
 5613|  49.1k|		    cur = ctxt->sax->getEntity(ctxt->userData, name);
 5614|  49.1k|		if ((cur == NULL) && (ctxt->userData==ctxt)) {
  ------------------
  |  Branch (5614:7): [True: 1.08k, False: 48.0k]
  |  Branch (5614:24): [True: 1.08k, False: 0]
  ------------------
 5615|  1.08k|		    cur = xmlSAX2GetEntity(ctxt, name);
 5616|  1.08k|		}
 5617|  49.1k|	    }
 5618|   101k|            if ((cur != NULL) && (cur->orig == NULL)) {
  ------------------
  |  Branch (5618:17): [True: 97.5k, False: 3.58k]
  |  Branch (5618:34): [True: 10.4k, False: 87.1k]
  ------------------
 5619|  10.4k|		cur->orig = orig;
 5620|  10.4k|                orig = NULL;
 5621|  10.4k|	    }
 5622|   101k|	}
 5623|       |
 5624|   120k|done:
 5625|   120k|	if (value != NULL) xmlFree(value);
  ------------------
  |  Branch (5625:6): [True: 101k, False: 19.5k]
  ------------------
 5626|   120k|	if (URI != NULL) xmlFree(URI);
  ------------------
  |  Branch (5626:6): [True: 12.5k, False: 108k]
  ------------------
 5627|   120k|	if (literal != NULL) xmlFree(literal);
  ------------------
  |  Branch (5627:6): [True: 4.04k, False: 116k]
  ------------------
 5628|   120k|        if (orig != NULL) xmlFree(orig);
  ------------------
  |  Branch (5628:13): [True: 90.7k, False: 29.9k]
  ------------------
 5629|   120k|    }
 5630|   149k|}
xmlParseDefaultDecl:
 5662|  82.6k|xmlParseDefaultDecl(xmlParserCtxt *ctxt, xmlChar **value) {
 5663|  82.6k|    int val;
 5664|  82.6k|    xmlChar *ret;
 5665|       |
 5666|  82.6k|    *value = NULL;
 5667|  82.6k|    if (CMP9(CUR_PTR, '#', 'R', 'E', 'Q', 'U', 'I', 'R', 'E', 'D')) {
  ------------------
  |  | 2242|  82.6k|  ( CMP8( s, c1, c2, c3, c4, c5, c6, c7, c8 ) && \
  |  |  ------------------
  |  |  |  | 2240|   165k|  ( CMP7( s, c1, c2, c3, c4, c5, c6, c7 ) && ((unsigned char *) s)[ 7 ] == c8 )
  |  |  |  |  ------------------
  |  |  |  |  |  | 2238|   165k|  ( CMP6( s, c1, c2, c3, c4, c5, c6 ) && ((unsigned char *) s)[ 6 ] == c7 )
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  | 2236|   165k|  ( CMP5( s, c1, c2, c3, c4, c5 ) && ((unsigned char *) s)[ 5 ] == c6 )
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  | 2234|   165k|  ( CMP4( s, c1, c2, c3, c4 ) && ((unsigned char *) s)[ 4 ] == c5 )
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  | 2231|   165k|  ( ((unsigned char *) s)[ 0 ] == c1 && ((unsigned char *) s)[ 1 ] == c2 && \
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  Branch (2231:5): [True: 28.0k, False: 54.5k]
  |  |  |  |  |  |  |  |  |  |  |  |  |  Branch (2231:41): [True: 4.67k, False: 23.3k]
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  | 2232|  82.6k|    ((unsigned char *) s)[ 2 ] == c3 && ((unsigned char *) s)[ 3 ] == c4 )
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  Branch (2232:5): [True: 4.67k, False: 1]
  |  |  |  |  |  |  |  |  |  |  |  |  |  Branch (2232:41): [True: 4.66k, False: 3]
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (2234:34): [True: 4.66k, False: 7]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (2236:38): [True: 4.66k, False: 1]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (2238:42): [True: 4.66k, False: 1]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2240:46): [True: 4.65k, False: 3]
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 2243|  82.6k|    ((unsigned char *) s)[ 8 ] == c9 )
  |  |  ------------------
  |  |  |  Branch (2243:5): [True: 4.65k, False: 1]
  |  |  ------------------
  ------------------
 5668|  4.65k|	SKIP(9);
  ------------------
  |  | 2248|  4.65k|#define SKIP(val) do {							\
  |  | 2249|  4.65k|    ctxt->input->cur += (val),ctxt->input->col+=(val);			\
  |  | 2250|  4.65k|    if (*ctxt->input->cur == 0)						\
  |  |  ------------------
  |  |  |  Branch (2250:9): [True: 69, False: 4.58k]
  |  |  ------------------
  |  | 2251|  4.65k|        xmlParserGrow(ctxt);						\
  |  | 2252|  4.65k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2252:12): [Folded, False: 4.65k]
  |  |  ------------------
  ------------------
 5669|  4.65k|	return(XML_ATTRIBUTE_REQUIRED);
 5670|  4.65k|    }
 5671|  77.9k|    if (CMP8(CUR_PTR, '#', 'I', 'M', 'P', 'L', 'I', 'E', 'D')) {
  ------------------
  |  | 2240|  77.9k|  ( CMP7( s, c1, c2, c3, c4, c5, c6, c7 ) && ((unsigned char *) s)[ 7 ] == c8 )
  |  |  ------------------
  |  |  |  | 2238|   155k|  ( CMP6( s, c1, c2, c3, c4, c5, c6 ) && ((unsigned char *) s)[ 6 ] == c7 )
  |  |  |  |  ------------------
  |  |  |  |  |  | 2236|   155k|  ( CMP5( s, c1, c2, c3, c4, c5 ) && ((unsigned char *) s)[ 5 ] == c6 )
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  | 2234|   155k|  ( CMP4( s, c1, c2, c3, c4 ) && ((unsigned char *) s)[ 4 ] == c5 )
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  | 2231|   155k|  ( ((unsigned char *) s)[ 0 ] == c1 && ((unsigned char *) s)[ 1 ] == c2 && \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (2231:5): [True: 23.3k, False: 54.5k]
  |  |  |  |  |  |  |  |  |  |  |  Branch (2231:41): [True: 15.6k, False: 7.75k]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  | 2232|  77.9k|    ((unsigned char *) s)[ 2 ] == c3 && ((unsigned char *) s)[ 3 ] == c4 )
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (2232:5): [True: 15.6k, False: 8]
  |  |  |  |  |  |  |  |  |  |  |  Branch (2232:41): [True: 15.6k, False: 3]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (2234:34): [True: 15.6k, False: 1]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (2236:38): [True: 15.6k, False: 1]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2238:42): [True: 15.5k, False: 3]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2240:46): [True: 15.5k, False: 2]
  |  |  ------------------
  ------------------
 5672|  15.5k|	SKIP(8);
  ------------------
  |  | 2248|  15.5k|#define SKIP(val) do {							\
  |  | 2249|  15.5k|    ctxt->input->cur += (val),ctxt->input->col+=(val);			\
  |  | 2250|  15.5k|    if (*ctxt->input->cur == 0)						\
  |  |  ------------------
  |  |  |  Branch (2250:9): [True: 643, False: 14.9k]
  |  |  ------------------
  |  | 2251|  15.5k|        xmlParserGrow(ctxt);						\
  |  | 2252|  15.5k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2252:12): [Folded, False: 15.5k]
  |  |  ------------------
  ------------------
 5673|  15.5k|	return(XML_ATTRIBUTE_IMPLIED);
 5674|  15.5k|    }
 5675|  62.3k|    val = XML_ATTRIBUTE_NONE;
 5676|  62.3k|    if (CMP6(CUR_PTR, '#', 'F', 'I', 'X', 'E', 'D')) {
  ------------------
  |  | 2236|  62.3k|  ( CMP5( s, c1, c2, c3, c4, c5 ) && ((unsigned char *) s)[ 5 ] == c6 )
  |  |  ------------------
  |  |  |  | 2234|   124k|  ( CMP4( s, c1, c2, c3, c4 ) && ((unsigned char *) s)[ 4 ] == c5 )
  |  |  |  |  ------------------
  |  |  |  |  |  | 2231|   124k|  ( ((unsigned char *) s)[ 0 ] == c1 && ((unsigned char *) s)[ 1 ] == c2 && \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (2231:5): [True: 7.77k, False: 54.5k]
  |  |  |  |  |  |  |  Branch (2231:41): [True: 7.72k, False: 45]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 2232|  62.3k|    ((unsigned char *) s)[ 2 ] == c3 && ((unsigned char *) s)[ 3 ] == c4 )
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (2232:5): [True: 7.72k, False: 2]
  |  |  |  |  |  |  |  Branch (2232:41): [True: 7.71k, False: 6]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2234:34): [True: 7.71k, False: 1]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2236:38): [True: 7.71k, False: 1]
  |  |  ------------------
  ------------------
 5677|  7.71k|	SKIP(6);
  ------------------
  |  | 2248|  7.71k|#define SKIP(val) do {							\
  |  | 2249|  7.71k|    ctxt->input->cur += (val),ctxt->input->col+=(val);			\
  |  | 2250|  7.71k|    if (*ctxt->input->cur == 0)						\
  |  |  ------------------
  |  |  |  Branch (2250:9): [True: 69, False: 7.64k]
  |  |  ------------------
  |  | 2251|  7.71k|        xmlParserGrow(ctxt);						\
  |  | 2252|  7.71k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2252:12): [Folded, False: 7.71k]
  |  |  ------------------
  ------------------
 5678|  7.71k|	val = XML_ATTRIBUTE_FIXED;
 5679|  7.71k|	if (SKIP_BLANKS_PE == 0) {
  ------------------
  |  | 2277|  7.71k|#define SKIP_BLANKS_PE xmlSkipBlankCharsPE(ctxt)
  ------------------
  |  Branch (5679:6): [True: 435, False: 7.28k]
  ------------------
 5680|    435|	    xmlFatalErrMsg(ctxt, XML_ERR_SPACE_REQUIRED,
 5681|    435|			   "Space required after '#FIXED'\n");
 5682|    435|	}
 5683|  7.71k|    }
 5684|  62.3k|    ret = xmlParseAttValue(ctxt);
 5685|  62.3k|    if (ret == NULL) {
  ------------------
  |  Branch (5685:9): [True: 37.0k, False: 25.3k]
  ------------------
 5686|  37.0k|	xmlFatalErrMsg(ctxt, (xmlParserErrors)ctxt->errNo,
 5687|  37.0k|		       "Attribute default value declaration error\n");
 5688|  37.0k|    } else
 5689|  25.3k|        *value = ret;
 5690|  62.3k|    return(val);
 5691|  77.9k|}
xmlParseNotationType:
 5711|  3.19k|xmlParseNotationType(xmlParserCtxt *ctxt) {
 5712|  3.19k|    const xmlChar *name;
 5713|  3.19k|    xmlEnumerationPtr ret = NULL, last = NULL, cur, tmp;
 5714|       |
 5715|  3.19k|    if (RAW != '(') {
  ------------------
  |  | 2224|  3.19k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (5715:9): [True: 343, False: 2.84k]
  ------------------
 5716|    343|	xmlFatalErr(ctxt, XML_ERR_NOTATION_NOT_STARTED, NULL);
 5717|    343|	return(NULL);
 5718|    343|    }
 5719|  3.52k|    do {
 5720|  3.52k|        NEXT;
  ------------------
  |  | 2279|  3.52k|#define NEXT xmlNextChar(ctxt)
  ------------------
 5721|  3.52k|	SKIP_BLANKS_PE;
  ------------------
  |  | 2277|  3.52k|#define SKIP_BLANKS_PE xmlSkipBlankCharsPE(ctxt)
  ------------------
 5722|  3.52k|        name = xmlParseName(ctxt);
 5723|  3.52k|	if (name == NULL) {
  ------------------
  |  Branch (5723:6): [True: 289, False: 3.23k]
  ------------------
 5724|    289|	    xmlFatalErrMsg(ctxt, XML_ERR_NAME_REQUIRED,
 5725|    289|			   "Name expected in NOTATION declaration\n");
 5726|    289|            xmlFreeEnumeration(ret);
 5727|    289|	    return(NULL);
 5728|    289|	}
 5729|  3.23k|        tmp = NULL;
 5730|  3.23k|#ifdef LIBXML_VALID_ENABLED
 5731|  3.23k|        if (ctxt->validate) {
  ------------------
  |  Branch (5731:13): [True: 1.93k, False: 1.30k]
  ------------------
 5732|  1.93k|            tmp = ret;
 5733|  3.54k|            while (tmp != NULL) {
  ------------------
  |  Branch (5733:20): [True: 1.74k, False: 1.80k]
  ------------------
 5734|  1.74k|                if (xmlStrEqual(name, tmp->name)) {
  ------------------
  |  Branch (5734:21): [True: 133, False: 1.61k]
  ------------------
 5735|    133|                    xmlValidityError(ctxt, XML_DTD_DUP_TOKEN,
 5736|    133|              "standalone: attribute notation value token %s duplicated\n",
 5737|    133|                                     name, NULL);
 5738|    133|                    if (!xmlDictOwns(ctxt->dict, name))
  ------------------
  |  Branch (5738:25): [True: 0, False: 133]
  ------------------
 5739|      0|                        xmlFree((xmlChar *) name);
 5740|    133|                    break;
 5741|    133|                }
 5742|  1.61k|                tmp = tmp->next;
 5743|  1.61k|            }
 5744|  1.93k|        }
 5745|  3.23k|#endif /* LIBXML_VALID_ENABLED */
 5746|  3.23k|	if (tmp == NULL) {
  ------------------
  |  Branch (5746:6): [True: 3.10k, False: 133]
  ------------------
 5747|  3.10k|	    cur = xmlCreateEnumeration(name);
 5748|  3.10k|	    if (cur == NULL) {
  ------------------
  |  Branch (5748:10): [True: 2, False: 3.10k]
  ------------------
 5749|      2|                xmlErrMemory(ctxt);
 5750|      2|                xmlFreeEnumeration(ret);
 5751|      2|                return(NULL);
 5752|      2|            }
 5753|  3.10k|	    if (last == NULL) ret = last = cur;
  ------------------
  |  Branch (5753:10): [True: 2.56k, False: 540]
  ------------------
 5754|    540|	    else {
 5755|    540|		last->next = cur;
 5756|    540|		last = cur;
 5757|    540|	    }
 5758|  3.10k|	}
 5759|  3.23k|	SKIP_BLANKS_PE;
  ------------------
  |  | 2277|  3.23k|#define SKIP_BLANKS_PE xmlSkipBlankCharsPE(ctxt)
  ------------------
 5760|  3.23k|    } while (RAW == '|');
  ------------------
  |  | 2224|  3.23k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (5760:14): [True: 677, False: 2.55k]
  ------------------
 5761|  2.55k|    if (RAW != ')') {
  ------------------
  |  | 2224|  2.55k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (5761:9): [True: 997, False: 1.55k]
  ------------------
 5762|    997|	xmlFatalErr(ctxt, XML_ERR_NOTATION_NOT_FINISHED, NULL);
 5763|    997|        xmlFreeEnumeration(ret);
 5764|    997|	return(NULL);
 5765|    997|    }
 5766|  1.55k|    NEXT;
  ------------------
  |  | 2279|  1.55k|#define NEXT xmlNextChar(ctxt)
  ------------------
 5767|  1.55k|    return(ret);
 5768|  2.55k|}
xmlParseEnumerationType:
 5786|  16.6k|xmlParseEnumerationType(xmlParserCtxt *ctxt) {
 5787|  16.6k|    xmlChar *name;
 5788|  16.6k|    xmlEnumerationPtr ret = NULL, last = NULL, cur, tmp;
 5789|       |
 5790|  16.6k|    if (RAW != '(') {
  ------------------
  |  | 2224|  16.6k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (5790:9): [True: 3.06k, False: 13.6k]
  ------------------
 5791|  3.06k|	xmlFatalErr(ctxt, XML_ERR_ATTLIST_NOT_STARTED, NULL);
 5792|  3.06k|	return(NULL);
 5793|  3.06k|    }
 5794|  19.6k|    do {
 5795|  19.6k|        NEXT;
  ------------------
  |  | 2279|  19.6k|#define NEXT xmlNextChar(ctxt)
  ------------------
 5796|  19.6k|	SKIP_BLANKS_PE;
  ------------------
  |  | 2277|  19.6k|#define SKIP_BLANKS_PE xmlSkipBlankCharsPE(ctxt)
  ------------------
 5797|  19.6k|        name = xmlParseNmtoken(ctxt);
 5798|  19.6k|	if (name == NULL) {
  ------------------
  |  Branch (5798:6): [True: 243, False: 19.4k]
  ------------------
 5799|    243|	    xmlFatalErr(ctxt, XML_ERR_NMTOKEN_REQUIRED, NULL);
 5800|    243|	    return(ret);
 5801|    243|	}
 5802|  19.4k|        tmp = NULL;
 5803|  19.4k|#ifdef LIBXML_VALID_ENABLED
 5804|  19.4k|        if (ctxt->validate) {
  ------------------
  |  Branch (5804:13): [True: 12.8k, False: 6.64k]
  ------------------
 5805|  12.8k|            tmp = ret;
 5806|  29.6k|            while (tmp != NULL) {
  ------------------
  |  Branch (5806:20): [True: 17.4k, False: 12.2k]
  ------------------
 5807|  17.4k|                if (xmlStrEqual(name, tmp->name)) {
  ------------------
  |  Branch (5807:21): [True: 560, False: 16.8k]
  ------------------
 5808|    560|                    xmlValidityError(ctxt, XML_DTD_DUP_TOKEN,
 5809|    560|              "standalone: attribute enumeration value token %s duplicated\n",
 5810|    560|                                     name, NULL);
 5811|    560|                    if (!xmlDictOwns(ctxt->dict, name))
  ------------------
  |  Branch (5811:25): [True: 560, False: 0]
  ------------------
 5812|    560|                        xmlFree(name);
 5813|    560|                    break;
 5814|    560|                }
 5815|  16.8k|                tmp = tmp->next;
 5816|  16.8k|            }
 5817|  12.8k|        }
 5818|  19.4k|#endif /* LIBXML_VALID_ENABLED */
 5819|  19.4k|	if (tmp == NULL) {
  ------------------
  |  Branch (5819:6): [True: 18.8k, False: 560]
  ------------------
 5820|  18.8k|	    cur = xmlCreateEnumeration(name);
 5821|  18.8k|	    if (!xmlDictOwns(ctxt->dict, name))
  ------------------
  |  Branch (5821:10): [True: 18.8k, False: 0]
  ------------------
 5822|  18.8k|		xmlFree(name);
 5823|  18.8k|	    if (cur == NULL) {
  ------------------
  |  Branch (5823:10): [True: 6, False: 18.8k]
  ------------------
 5824|      6|                xmlErrMemory(ctxt);
 5825|      6|                xmlFreeEnumeration(ret);
 5826|      6|                return(NULL);
 5827|      6|            }
 5828|  18.8k|	    if (last == NULL) ret = last = cur;
  ------------------
  |  Branch (5828:10): [True: 13.4k, False: 5.47k]
  ------------------
 5829|  5.47k|	    else {
 5830|  5.47k|		last->next = cur;
 5831|  5.47k|		last = cur;
 5832|  5.47k|	    }
 5833|  18.8k|	}
 5834|  19.4k|	SKIP_BLANKS_PE;
  ------------------
  |  | 2277|  19.4k|#define SKIP_BLANKS_PE xmlSkipBlankCharsPE(ctxt)
  ------------------
 5835|  19.4k|    } while (RAW == '|');
  ------------------
  |  | 2224|  19.4k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (5835:14): [True: 6.06k, False: 13.3k]
  ------------------
 5836|  13.3k|    if (RAW != ')') {
  ------------------
  |  | 2224|  13.3k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (5836:9): [True: 642, False: 12.7k]
  ------------------
 5837|    642|	xmlFatalErr(ctxt, XML_ERR_ATTLIST_NOT_FINISHED, NULL);
 5838|    642|	return(ret);
 5839|    642|    }
 5840|  12.7k|    NEXT;
  ------------------
  |  | 2279|  12.7k|#define NEXT xmlNextChar(ctxt)
  ------------------
 5841|  12.7k|    return(ret);
 5842|  13.3k|}
xmlParseEnumeratedType:
 5859|  20.1k|xmlParseEnumeratedType(xmlParserCtxt *ctxt, xmlEnumeration **tree) {
 5860|  20.1k|    if (CMP8(CUR_PTR, 'N', 'O', 'T', 'A', 'T', 'I', 'O', 'N')) {
  ------------------
  |  | 2240|  20.1k|  ( CMP7( s, c1, c2, c3, c4, c5, c6, c7 ) && ((unsigned char *) s)[ 7 ] == c8 )
  |  |  ------------------
  |  |  |  | 2238|  40.2k|  ( CMP6( s, c1, c2, c3, c4, c5, c6 ) && ((unsigned char *) s)[ 6 ] == c7 )
  |  |  |  |  ------------------
  |  |  |  |  |  | 2236|  40.2k|  ( CMP5( s, c1, c2, c3, c4, c5 ) && ((unsigned char *) s)[ 5 ] == c6 )
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  | 2234|  40.2k|  ( CMP4( s, c1, c2, c3, c4 ) && ((unsigned char *) s)[ 4 ] == c5 )
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  | 2231|  40.2k|  ( ((unsigned char *) s)[ 0 ] == c1 && ((unsigned char *) s)[ 1 ] == c2 && \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (2231:5): [True: 3.47k, False: 16.6k]
  |  |  |  |  |  |  |  |  |  |  |  Branch (2231:41): [True: 3.46k, False: 13]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  | 2232|  20.1k|    ((unsigned char *) s)[ 2 ] == c3 && ((unsigned char *) s)[ 3 ] == c4 )
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (2232:5): [True: 3.46k, False: 4]
  |  |  |  |  |  |  |  |  |  |  |  Branch (2232:41): [True: 3.45k, False: 3]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (2234:34): [True: 3.45k, False: 4]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (2236:38): [True: 3.45k, False: 2]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2238:42): [True: 3.45k, False: 1]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2240:46): [True: 3.45k, False: 1]
  |  |  ------------------
  ------------------
 5861|  3.45k|	SKIP(8);
  ------------------
  |  | 2248|  3.45k|#define SKIP(val) do {							\
  |  | 2249|  3.45k|    ctxt->input->cur += (val),ctxt->input->col+=(val);			\
  |  | 2250|  3.45k|    if (*ctxt->input->cur == 0)						\
  |  |  ------------------
  |  |  |  Branch (2250:9): [True: 235, False: 3.21k]
  |  |  ------------------
  |  | 2251|  3.45k|        xmlParserGrow(ctxt);						\
  |  | 2252|  3.45k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2252:12): [Folded, False: 3.45k]
  |  |  ------------------
  ------------------
 5862|  3.45k|	if (SKIP_BLANKS_PE == 0) {
  ------------------
  |  | 2277|  3.45k|#define SKIP_BLANKS_PE xmlSkipBlankCharsPE(ctxt)
  ------------------
  |  Branch (5862:6): [True: 260, False: 3.19k]
  ------------------
 5863|    260|	    xmlFatalErrMsg(ctxt, XML_ERR_SPACE_REQUIRED,
 5864|    260|			   "Space required after 'NOTATION'\n");
 5865|    260|	    return(0);
 5866|    260|	}
 5867|  3.19k|	*tree = xmlParseNotationType(ctxt);
 5868|  3.19k|	if (*tree == NULL) return(0);
  ------------------
  |  Branch (5868:6): [True: 1.63k, False: 1.55k]
  ------------------
 5869|  1.55k|	return(XML_ATTRIBUTE_NOTATION);
 5870|  3.19k|    }
 5871|  16.6k|    *tree = xmlParseEnumerationType(ctxt);
 5872|  16.6k|    if (*tree == NULL) return(0);
  ------------------
  |  Branch (5872:9): [True: 3.28k, False: 13.4k]
  ------------------
 5873|  13.4k|    return(XML_ATTRIBUTE_ENUMERATION);
 5874|  16.6k|}
xmlParseAttributeType:
 5922|  89.6k|xmlParseAttributeType(xmlParserCtxt *ctxt, xmlEnumeration **tree) {
 5923|  89.6k|    if (CMP5(CUR_PTR, 'C', 'D', 'A', 'T', 'A')) {
  ------------------
  |  | 2234|  89.6k|  ( CMP4( s, c1, c2, c3, c4 ) && ((unsigned char *) s)[ 4 ] == c5 )
  |  |  ------------------
  |  |  |  | 2231|   179k|  ( ((unsigned char *) s)[ 0 ] == c1 && ((unsigned char *) s)[ 1 ] == c2 && \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2231:5): [True: 11.1k, False: 78.5k]
  |  |  |  |  |  Branch (2231:41): [True: 11.1k, False: 4]
  |  |  |  |  ------------------
  |  |  |  | 2232|  89.6k|    ((unsigned char *) s)[ 2 ] == c3 && ((unsigned char *) s)[ 3 ] == c4 )
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2232:5): [True: 11.1k, False: 2]
  |  |  |  |  |  Branch (2232:41): [True: 11.1k, False: 1]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2234:34): [True: 11.1k, False: 1]
  |  |  ------------------
  ------------------
 5924|  11.1k|	SKIP(5);
  ------------------
  |  | 2248|  11.1k|#define SKIP(val) do {							\
  |  | 2249|  11.1k|    ctxt->input->cur += (val),ctxt->input->col+=(val);			\
  |  | 2250|  11.1k|    if (*ctxt->input->cur == 0)						\
  |  |  ------------------
  |  |  |  Branch (2250:9): [True: 224, False: 10.8k]
  |  |  ------------------
  |  | 2251|  11.1k|        xmlParserGrow(ctxt);						\
  |  | 2252|  11.1k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2252:12): [Folded, False: 11.1k]
  |  |  ------------------
  ------------------
 5925|  11.1k|	return(XML_ATTRIBUTE_CDATA);
 5926|  78.5k|     } else if (CMP6(CUR_PTR, 'I', 'D', 'R', 'E', 'F', 'S')) {
  ------------------
  |  | 2236|  78.5k|  ( CMP5( s, c1, c2, c3, c4, c5 ) && ((unsigned char *) s)[ 5 ] == c6 )
  |  |  ------------------
  |  |  |  | 2234|   157k|  ( CMP4( s, c1, c2, c3, c4 ) && ((unsigned char *) s)[ 4 ] == c5 )
  |  |  |  |  ------------------
  |  |  |  |  |  | 2231|   157k|  ( ((unsigned char *) s)[ 0 ] == c1 && ((unsigned char *) s)[ 1 ] == c2 && \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (2231:5): [True: 13.0k, False: 65.5k]
  |  |  |  |  |  |  |  Branch (2231:41): [True: 13.0k, False: 5]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 2232|  78.5k|    ((unsigned char *) s)[ 2 ] == c3 && ((unsigned char *) s)[ 3 ] == c4 )
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (2232:5): [True: 3.53k, False: 9.47k]
  |  |  |  |  |  |  |  Branch (2232:41): [True: 3.53k, False: 2]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2234:34): [True: 3.53k, False: 2]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2236:38): [True: 1.72k, False: 1.80k]
  |  |  ------------------
  ------------------
 5927|  1.72k|	SKIP(6);
  ------------------
  |  | 2248|  1.72k|#define SKIP(val) do {							\
  |  | 2249|  1.72k|    ctxt->input->cur += (val),ctxt->input->col+=(val);			\
  |  | 2250|  1.72k|    if (*ctxt->input->cur == 0)						\
  |  |  ------------------
  |  |  |  Branch (2250:9): [True: 50, False: 1.67k]
  |  |  ------------------
  |  | 2251|  1.72k|        xmlParserGrow(ctxt);						\
  |  | 2252|  1.72k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2252:12): [Folded, False: 1.72k]
  |  |  ------------------
  ------------------
 5928|  1.72k|	return(XML_ATTRIBUTE_IDREFS);
 5929|  76.8k|     } else if (CMP5(CUR_PTR, 'I', 'D', 'R', 'E', 'F')) {
  ------------------
  |  | 2234|  76.8k|  ( CMP4( s, c1, c2, c3, c4 ) && ((unsigned char *) s)[ 4 ] == c5 )
  |  |  ------------------
  |  |  |  | 2231|   153k|  ( ((unsigned char *) s)[ 0 ] == c1 && ((unsigned char *) s)[ 1 ] == c2 && \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2231:5): [True: 11.2k, False: 65.5k]
  |  |  |  |  |  Branch (2231:41): [True: 11.2k, False: 5]
  |  |  |  |  ------------------
  |  |  |  | 2232|  76.8k|    ((unsigned char *) s)[ 2 ] == c3 && ((unsigned char *) s)[ 3 ] == c4 )
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2232:5): [True: 1.81k, False: 9.47k]
  |  |  |  |  |  Branch (2232:41): [True: 1.81k, False: 2]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2234:34): [True: 1.80k, False: 2]
  |  |  ------------------
  ------------------
 5930|  1.80k|	SKIP(5);
  ------------------
  |  | 2248|  1.80k|#define SKIP(val) do {							\
  |  | 2249|  1.80k|    ctxt->input->cur += (val),ctxt->input->col+=(val);			\
  |  | 2250|  1.80k|    if (*ctxt->input->cur == 0)						\
  |  |  ------------------
  |  |  |  Branch (2250:9): [True: 244, False: 1.56k]
  |  |  ------------------
  |  | 2251|  1.80k|        xmlParserGrow(ctxt);						\
  |  | 2252|  1.80k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2252:12): [Folded, False: 1.80k]
  |  |  ------------------
  ------------------
 5931|  1.80k|	return(XML_ATTRIBUTE_IDREF);
 5932|  75.0k|     } else if ((RAW == 'I') && (NXT(1) == 'D')) {
  ------------------
  |  | 2224|  75.0k|#define RAW (*ctxt->input->cur)
  ------------------
                   } else if ((RAW == 'I') && (NXT(1) == 'D')) {
  ------------------
  |  | 2226|  9.48k|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
  |  Branch (5932:17): [True: 9.48k, False: 65.5k]
  |  Branch (5932:33): [True: 9.47k, False: 5]
  ------------------
 5933|  9.47k|        SKIP(2);
  ------------------
  |  | 2248|  9.47k|#define SKIP(val) do {							\
  |  | 2249|  9.47k|    ctxt->input->cur += (val),ctxt->input->col+=(val);			\
  |  | 2250|  9.47k|    if (*ctxt->input->cur == 0)						\
  |  |  ------------------
  |  |  |  Branch (2250:9): [True: 215, False: 9.26k]
  |  |  ------------------
  |  | 2251|  9.47k|        xmlParserGrow(ctxt);						\
  |  | 2252|  9.47k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2252:12): [Folded, False: 9.47k]
  |  |  ------------------
  ------------------
 5934|  9.47k|	return(XML_ATTRIBUTE_ID);
 5935|  65.5k|     } else if (CMP6(CUR_PTR, 'E', 'N', 'T', 'I', 'T', 'Y')) {
  ------------------
  |  | 2236|  65.5k|  ( CMP5( s, c1, c2, c3, c4, c5 ) && ((unsigned char *) s)[ 5 ] == c6 )
  |  |  ------------------
  |  |  |  | 2234|   131k|  ( CMP4( s, c1, c2, c3, c4 ) && ((unsigned char *) s)[ 4 ] == c5 )
  |  |  |  |  ------------------
  |  |  |  |  |  | 2231|   131k|  ( ((unsigned char *) s)[ 0 ] == c1 && ((unsigned char *) s)[ 1 ] == c2 && \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (2231:5): [True: 7.05k, False: 58.4k]
  |  |  |  |  |  |  |  Branch (2231:41): [True: 7.05k, False: 2]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 2232|  65.5k|    ((unsigned char *) s)[ 2 ] == c3 && ((unsigned char *) s)[ 3 ] == c4 )
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (2232:5): [True: 7.05k, False: 1]
  |  |  |  |  |  |  |  Branch (2232:41): [True: 7.04k, False: 3]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2234:34): [True: 7.04k, False: 3]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2236:38): [True: 6.14k, False: 899]
  |  |  ------------------
  ------------------
 5936|  6.14k|	SKIP(6);
  ------------------
  |  | 2248|  6.14k|#define SKIP(val) do {							\
  |  | 2249|  6.14k|    ctxt->input->cur += (val),ctxt->input->col+=(val);			\
  |  | 2250|  6.14k|    if (*ctxt->input->cur == 0)						\
  |  |  ------------------
  |  |  |  Branch (2250:9): [True: 32, False: 6.11k]
  |  |  ------------------
  |  | 2251|  6.14k|        xmlParserGrow(ctxt);						\
  |  | 2252|  6.14k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2252:12): [Folded, False: 6.14k]
  |  |  ------------------
  ------------------
 5937|  6.14k|	return(XML_ATTRIBUTE_ENTITY);
 5938|  59.3k|     } else if (CMP8(CUR_PTR, 'E', 'N', 'T', 'I', 'T', 'I', 'E', 'S')) {
  ------------------
  |  | 2240|  59.3k|  ( CMP7( s, c1, c2, c3, c4, c5, c6, c7 ) && ((unsigned char *) s)[ 7 ] == c8 )
  |  |  ------------------
  |  |  |  | 2238|   118k|  ( CMP6( s, c1, c2, c3, c4, c5, c6 ) && ((unsigned char *) s)[ 6 ] == c7 )
  |  |  |  |  ------------------
  |  |  |  |  |  | 2236|   118k|  ( CMP5( s, c1, c2, c3, c4, c5 ) && ((unsigned char *) s)[ 5 ] == c6 )
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  | 2234|   118k|  ( CMP4( s, c1, c2, c3, c4 ) && ((unsigned char *) s)[ 4 ] == c5 )
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  | 2231|   118k|  ( ((unsigned char *) s)[ 0 ] == c1 && ((unsigned char *) s)[ 1 ] == c2 && \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (2231:5): [True: 908, False: 58.4k]
  |  |  |  |  |  |  |  |  |  |  |  Branch (2231:41): [True: 906, False: 2]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  | 2232|  59.3k|    ((unsigned char *) s)[ 2 ] == c3 && ((unsigned char *) s)[ 3 ] == c4 )
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (2232:5): [True: 905, False: 1]
  |  |  |  |  |  |  |  |  |  |  |  Branch (2232:41): [True: 902, False: 3]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (2234:34): [True: 899, False: 3]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (2236:38): [True: 896, False: 3]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2238:42): [True: 895, False: 1]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2240:46): [True: 892, False: 3]
  |  |  ------------------
  ------------------
 5939|    892|	SKIP(8);
  ------------------
  |  | 2248|    892|#define SKIP(val) do {							\
  |  | 2249|    892|    ctxt->input->cur += (val),ctxt->input->col+=(val);			\
  |  | 2250|    892|    if (*ctxt->input->cur == 0)						\
  |  |  ------------------
  |  |  |  Branch (2250:9): [True: 56, False: 836]
  |  |  ------------------
  |  | 2251|    892|        xmlParserGrow(ctxt);						\
  |  | 2252|    892|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2252:12): [Folded, False: 892]
  |  |  ------------------
  ------------------
 5940|    892|	return(XML_ATTRIBUTE_ENTITIES);
 5941|  58.4k|     } else if (CMP8(CUR_PTR, 'N', 'M', 'T', 'O', 'K', 'E', 'N', 'S')) {
  ------------------
  |  | 2240|  58.4k|  ( CMP7( s, c1, c2, c3, c4, c5, c6, c7 ) && ((unsigned char *) s)[ 7 ] == c8 )
  |  |  ------------------
  |  |  |  | 2238|   116k|  ( CMP6( s, c1, c2, c3, c4, c5, c6 ) && ((unsigned char *) s)[ 6 ] == c7 )
  |  |  |  |  ------------------
  |  |  |  |  |  | 2236|   116k|  ( CMP5( s, c1, c2, c3, c4, c5 ) && ((unsigned char *) s)[ 5 ] == c6 )
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  | 2234|   116k|  ( CMP4( s, c1, c2, c3, c4 ) && ((unsigned char *) s)[ 4 ] == c5 )
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  | 2231|   116k|  ( ((unsigned char *) s)[ 0 ] == c1 && ((unsigned char *) s)[ 1 ] == c2 && \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (2231:5): [True: 41.8k, False: 16.6k]
  |  |  |  |  |  |  |  |  |  |  |  Branch (2231:41): [True: 38.3k, False: 3.46k]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  | 2232|  58.4k|    ((unsigned char *) s)[ 2 ] == c3 && ((unsigned char *) s)[ 3 ] == c4 )
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (2232:5): [True: 38.3k, False: 4]
  |  |  |  |  |  |  |  |  |  |  |  Branch (2232:41): [True: 38.3k, False: 1]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (2234:34): [True: 38.3k, False: 3]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (2236:38): [True: 38.3k, False: 2]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2238:42): [True: 38.3k, False: 1]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2240:46): [True: 31.5k, False: 6.75k]
  |  |  ------------------
  ------------------
 5942|  31.5k|	SKIP(8);
  ------------------
  |  | 2248|  31.5k|#define SKIP(val) do {							\
  |  | 2249|  31.5k|    ctxt->input->cur += (val),ctxt->input->col+=(val);			\
  |  | 2250|  31.5k|    if (*ctxt->input->cur == 0)						\
  |  |  ------------------
  |  |  |  Branch (2250:9): [True: 174, False: 31.4k]
  |  |  ------------------
  |  | 2251|  31.5k|        xmlParserGrow(ctxt);						\
  |  | 2252|  31.5k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2252:12): [Folded, False: 31.5k]
  |  |  ------------------
  ------------------
 5943|  31.5k|	return(XML_ATTRIBUTE_NMTOKENS);
 5944|  31.5k|     } else if (CMP7(CUR_PTR, 'N', 'M', 'T', 'O', 'K', 'E', 'N')) {
  ------------------
  |  | 2238|  26.9k|  ( CMP6( s, c1, c2, c3, c4, c5, c6 ) && ((unsigned char *) s)[ 6 ] == c7 )
  |  |  ------------------
  |  |  |  | 2236|  53.8k|  ( CMP5( s, c1, c2, c3, c4, c5 ) && ((unsigned char *) s)[ 5 ] == c6 )
  |  |  |  |  ------------------
  |  |  |  |  |  | 2234|  53.8k|  ( CMP4( s, c1, c2, c3, c4 ) && ((unsigned char *) s)[ 4 ] == c5 )
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  | 2231|  53.8k|  ( ((unsigned char *) s)[ 0 ] == c1 && ((unsigned char *) s)[ 1 ] == c2 && \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (2231:5): [True: 10.2k, False: 16.6k]
  |  |  |  |  |  |  |  |  |  Branch (2231:41): [True: 6.76k, False: 3.46k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  | 2232|  26.9k|    ((unsigned char *) s)[ 2 ] == c3 && ((unsigned char *) s)[ 3 ] == c4 )
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (2232:5): [True: 6.76k, False: 4]
  |  |  |  |  |  |  |  |  |  Branch (2232:41): [True: 6.76k, False: 1]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (2234:34): [True: 6.75k, False: 3]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2236:38): [True: 6.75k, False: 2]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2238:42): [True: 6.75k, False: 1]
  |  |  ------------------
  ------------------
 5945|  6.75k|	SKIP(7);
  ------------------
  |  | 2248|  6.75k|#define SKIP(val) do {							\
  |  | 2249|  6.75k|    ctxt->input->cur += (val),ctxt->input->col+=(val);			\
  |  | 2250|  6.75k|    if (*ctxt->input->cur == 0)						\
  |  |  ------------------
  |  |  |  Branch (2250:9): [True: 43, False: 6.71k]
  |  |  ------------------
  |  | 2251|  6.75k|        xmlParserGrow(ctxt);						\
  |  | 2252|  6.75k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2252:12): [Folded, False: 6.75k]
  |  |  ------------------
  ------------------
 5946|  6.75k|	return(XML_ATTRIBUTE_NMTOKEN);
 5947|  6.75k|     }
 5948|  20.1k|     return(xmlParseEnumeratedType(ctxt, tree));
 5949|  89.6k|}
xmlParseAttributeListDecl:
 5962|  75.4k|xmlParseAttributeListDecl(xmlParserCtxt *ctxt) {
 5963|  75.4k|    const xmlChar *elemName;
 5964|  75.4k|    const xmlChar *attrName;
 5965|  75.4k|    xmlEnumerationPtr tree;
 5966|       |
 5967|  75.4k|    if ((CUR != '<') || (NXT(1) != '!'))
  ------------------
  |  | 2225|  75.4k|#define CUR (*ctxt->input->cur)
  ------------------
                  if ((CUR != '<') || (NXT(1) != '!'))
  ------------------
  |  | 2226|  75.4k|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
  |  Branch (5967:9): [True: 0, False: 75.4k]
  |  Branch (5967:25): [True: 0, False: 75.4k]
  ------------------
 5968|      0|        return;
 5969|  75.4k|    SKIP(2);
  ------------------
  |  | 2248|  75.4k|#define SKIP(val) do {							\
  |  | 2249|  75.4k|    ctxt->input->cur += (val),ctxt->input->col+=(val);			\
  |  | 2250|  75.4k|    if (*ctxt->input->cur == 0)						\
  |  |  ------------------
  |  |  |  Branch (2250:9): [True: 0, False: 75.4k]
  |  |  ------------------
  |  | 2251|  75.4k|        xmlParserGrow(ctxt);						\
  |  | 2252|  75.4k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2252:12): [Folded, False: 75.4k]
  |  |  ------------------
  ------------------
 5970|       |
 5971|  75.4k|    if (CMP7(CUR_PTR, 'A', 'T', 'T', 'L', 'I', 'S', 'T')) {
  ------------------
  |  | 2238|  75.4k|  ( CMP6( s, c1, c2, c3, c4, c5, c6 ) && ((unsigned char *) s)[ 6 ] == c7 )
  |  |  ------------------
  |  |  |  | 2236|   150k|  ( CMP5( s, c1, c2, c3, c4, c5 ) && ((unsigned char *) s)[ 5 ] == c6 )
  |  |  |  |  ------------------
  |  |  |  |  |  | 2234|   150k|  ( CMP4( s, c1, c2, c3, c4 ) && ((unsigned char *) s)[ 4 ] == c5 )
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  | 2231|   150k|  ( ((unsigned char *) s)[ 0 ] == c1 && ((unsigned char *) s)[ 1 ] == c2 && \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (2231:5): [True: 75.4k, False: 0]
  |  |  |  |  |  |  |  |  |  Branch (2231:41): [True: 75.4k, False: 13]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  | 2232|  75.4k|    ((unsigned char *) s)[ 2 ] == c3 && ((unsigned char *) s)[ 3 ] == c4 )
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (2232:5): [True: 75.3k, False: 13]
  |  |  |  |  |  |  |  |  |  Branch (2232:41): [True: 75.3k, False: 7]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (2234:34): [True: 75.3k, False: 3]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2236:38): [True: 75.3k, False: 2]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2238:42): [True: 75.3k, False: 12]
  |  |  ------------------
  ------------------
 5972|  75.3k|#ifdef LIBXML_VALID_ENABLED
 5973|  75.3k|	int oldInputNr = ctxt->inputNr;
 5974|  75.3k|#endif
 5975|       |
 5976|  75.3k|	SKIP(7);
  ------------------
  |  | 2248|  75.3k|#define SKIP(val) do {							\
  |  | 2249|  75.3k|    ctxt->input->cur += (val),ctxt->input->col+=(val);			\
  |  | 2250|  75.3k|    if (*ctxt->input->cur == 0)						\
  |  |  ------------------
  |  |  |  Branch (2250:9): [True: 165, False: 75.1k]
  |  |  ------------------
  |  | 2251|  75.3k|        xmlParserGrow(ctxt);						\
  |  | 2252|  75.3k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2252:12): [Folded, False: 75.3k]
  |  |  ------------------
  ------------------
 5977|  75.3k|	if (SKIP_BLANKS_PE == 0) {
  ------------------
  |  | 2277|  75.3k|#define SKIP_BLANKS_PE xmlSkipBlankCharsPE(ctxt)
  ------------------
  |  Branch (5977:6): [True: 2.02k, False: 73.3k]
  ------------------
 5978|  2.02k|	    xmlFatalErrMsg(ctxt, XML_ERR_SPACE_REQUIRED,
 5979|  2.02k|		                 "Space required after '<!ATTLIST'\n");
 5980|  2.02k|	}
 5981|  75.3k|        elemName = xmlParseName(ctxt);
 5982|  75.3k|	if (elemName == NULL) {
  ------------------
  |  Branch (5982:6): [True: 1.64k, False: 73.7k]
  ------------------
 5983|  1.64k|	    xmlFatalErrMsg(ctxt, XML_ERR_NAME_REQUIRED,
 5984|  1.64k|			   "ATTLIST: no name for Element\n");
 5985|  1.64k|	    return;
 5986|  1.64k|	}
 5987|  73.7k|	SKIP_BLANKS_PE;
  ------------------
  |  | 2277|  73.7k|#define SKIP_BLANKS_PE xmlSkipBlankCharsPE(ctxt)
  ------------------
 5988|  73.7k|	GROW;
  ------------------
  |  | 2271|  73.7k|    if ((!PARSER_PROGRESSIVE(ctxt)) && \
  |  |  ------------------
  |  |  |  |   47|  73.7k|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|  73.7k|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2271:9): [True: 68.8k, False: 4.87k]
  |  |  ------------------
  |  | 2272|  73.7k|        (ctxt->input->end - ctxt->input->cur < INPUT_CHUNK)) \
  |  |  ------------------
  |  |  |  |   63|  68.8k|#define INPUT_CHUNK	250
  |  |  ------------------
  |  |  |  Branch (2272:9): [True: 36.7k, False: 32.0k]
  |  |  ------------------
  |  | 2273|  73.7k|	xmlParserGrow(ctxt);
  ------------------
 5989|   120k|	while ((RAW != '>') && (PARSER_STOPPED(ctxt) == 0)) {
  ------------------
  |  | 2224|   120k|#define RAW (*ctxt->input->cur)
  ------------------
              	while ((RAW != '>') && (PARSER_STOPPED(ctxt) == 0)) {
  ------------------
  |  |   44|  96.4k|#define PARSER_STOPPED(ctxt) ((ctxt)->disableSAX > 1)
  ------------------
  |  Branch (5989:9): [True: 96.4k, False: 23.7k]
  |  Branch (5989:25): [True: 96.4k, False: 26]
  ------------------
 5990|  96.4k|	    int type;
 5991|  96.4k|	    int def;
 5992|  96.4k|	    xmlChar *defaultValue = NULL;
 5993|       |
 5994|  96.4k|	    GROW;
  ------------------
  |  | 2271|  96.4k|    if ((!PARSER_PROGRESSIVE(ctxt)) && \
  |  |  ------------------
  |  |  |  |   47|  96.4k|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|  96.4k|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2271:9): [True: 85.1k, False: 11.2k]
  |  |  ------------------
  |  | 2272|  96.4k|        (ctxt->input->end - ctxt->input->cur < INPUT_CHUNK)) \
  |  |  ------------------
  |  |  |  |   63|  85.1k|#define INPUT_CHUNK	250
  |  |  ------------------
  |  |  |  Branch (2272:9): [True: 45.4k, False: 39.7k]
  |  |  ------------------
  |  | 2273|  96.4k|	xmlParserGrow(ctxt);
  ------------------
 5995|  96.4k|            tree = NULL;
 5996|  96.4k|	    attrName = xmlParseName(ctxt);
 5997|  96.4k|	    if (attrName == NULL) {
  ------------------
  |  Branch (5997:10): [True: 4.21k, False: 92.2k]
  ------------------
 5998|  4.21k|		xmlFatalErrMsg(ctxt, XML_ERR_NAME_REQUIRED,
 5999|  4.21k|			       "ATTLIST: no name for Attribute\n");
 6000|  4.21k|		break;
 6001|  4.21k|	    }
 6002|  92.2k|	    GROW;
  ------------------
  |  | 2271|  92.2k|    if ((!PARSER_PROGRESSIVE(ctxt)) && \
  |  |  ------------------
  |  |  |  |   47|  92.2k|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|  92.2k|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2271:9): [True: 81.0k, False: 11.1k]
  |  |  ------------------
  |  | 2272|  92.2k|        (ctxt->input->end - ctxt->input->cur < INPUT_CHUNK)) \
  |  |  ------------------
  |  |  |  |   63|  81.0k|#define INPUT_CHUNK	250
  |  |  ------------------
  |  |  |  Branch (2272:9): [True: 43.8k, False: 37.2k]
  |  |  ------------------
  |  | 2273|  92.2k|	xmlParserGrow(ctxt);
  ------------------
 6003|  92.2k|	    if (SKIP_BLANKS_PE == 0) {
  ------------------
  |  | 2277|  92.2k|#define SKIP_BLANKS_PE xmlSkipBlankCharsPE(ctxt)
  ------------------
  |  Branch (6003:10): [True: 2.59k, False: 89.6k]
  ------------------
 6004|  2.59k|		xmlFatalErrMsg(ctxt, XML_ERR_SPACE_REQUIRED,
 6005|  2.59k|		        "Space required after the attribute name\n");
 6006|  2.59k|		break;
 6007|  2.59k|	    }
 6008|       |
 6009|  89.6k|	    type = xmlParseAttributeType(ctxt, &tree);
 6010|  89.6k|	    if (type <= 0) {
  ------------------
  |  Branch (6010:10): [True: 5.17k, False: 84.4k]
  ------------------
 6011|  5.17k|	        break;
 6012|  5.17k|	    }
 6013|       |
 6014|  84.4k|	    GROW;
  ------------------
  |  | 2271|  84.4k|    if ((!PARSER_PROGRESSIVE(ctxt)) && \
  |  |  ------------------
  |  |  |  |   47|  84.4k|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|  84.4k|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2271:9): [True: 73.6k, False: 10.8k]
  |  |  ------------------
  |  | 2272|  84.4k|        (ctxt->input->end - ctxt->input->cur < INPUT_CHUNK)) \
  |  |  ------------------
  |  |  |  |   63|  73.6k|#define INPUT_CHUNK	250
  |  |  ------------------
  |  |  |  Branch (2272:9): [True: 38.3k, False: 35.2k]
  |  |  ------------------
  |  | 2273|  84.4k|	xmlParserGrow(ctxt);
  ------------------
 6015|  84.4k|	    if (SKIP_BLANKS_PE == 0) {
  ------------------
  |  | 2277|  84.4k|#define SKIP_BLANKS_PE xmlSkipBlankCharsPE(ctxt)
  ------------------
  |  Branch (6015:10): [True: 1.85k, False: 82.6k]
  ------------------
 6016|  1.85k|		xmlFatalErrMsg(ctxt, XML_ERR_SPACE_REQUIRED,
 6017|  1.85k|			       "Space required after the attribute type\n");
 6018|  1.85k|	        if (tree != NULL)
  ------------------
  |  Branch (6018:14): [True: 768, False: 1.08k]
  ------------------
 6019|    768|		    xmlFreeEnumeration(tree);
 6020|  1.85k|		break;
 6021|  1.85k|	    }
 6022|       |
 6023|  82.6k|	    def = xmlParseDefaultDecl(ctxt, &defaultValue);
 6024|  82.6k|	    if (def <= 0) {
  ------------------
  |  Branch (6024:10): [True: 0, False: 82.6k]
  ------------------
 6025|      0|                if (defaultValue != NULL)
  ------------------
  |  Branch (6025:21): [True: 0, False: 0]
  ------------------
 6026|      0|		    xmlFree(defaultValue);
 6027|      0|	        if (tree != NULL)
  ------------------
  |  Branch (6027:14): [True: 0, False: 0]
  ------------------
 6028|      0|		    xmlFreeEnumeration(tree);
 6029|      0|	        break;
 6030|      0|	    }
 6031|  82.6k|	    if ((type != XML_ATTRIBUTE_CDATA) && (defaultValue != NULL))
  ------------------
  |  Branch (6031:10): [True: 71.7k, False: 10.8k]
  |  Branch (6031:43): [True: 22.8k, False: 48.8k]
  ------------------
 6032|  22.8k|	        xmlAttrNormalizeSpace(defaultValue, defaultValue);
 6033|       |
 6034|  82.6k|	    GROW;
  ------------------
  |  | 2271|  82.6k|    if ((!PARSER_PROGRESSIVE(ctxt)) && \
  |  |  ------------------
  |  |  |  |   47|  82.6k|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|  82.6k|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2271:9): [True: 71.8k, False: 10.7k]
  |  |  ------------------
  |  | 2272|  82.6k|        (ctxt->input->end - ctxt->input->cur < INPUT_CHUNK)) \
  |  |  ------------------
  |  |  |  |   63|  71.8k|#define INPUT_CHUNK	250
  |  |  ------------------
  |  |  |  Branch (2272:9): [True: 55.3k, False: 16.5k]
  |  |  ------------------
  |  | 2273|  82.6k|	xmlParserGrow(ctxt);
  ------------------
 6035|  82.6k|            if (RAW != '>') {
  ------------------
  |  | 2224|  82.6k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (6035:17): [True: 63.7k, False: 18.8k]
  ------------------
 6036|  63.7k|		if (SKIP_BLANKS_PE == 0) {
  ------------------
  |  | 2277|  63.7k|#define SKIP_BLANKS_PE xmlSkipBlankCharsPE(ctxt)
  ------------------
  |  Branch (6036:7): [True: 36.0k, False: 27.7k]
  ------------------
 6037|  36.0k|		    xmlFatalErrMsg(ctxt, XML_ERR_SPACE_REQUIRED,
 6038|  36.0k|			"Space required after the attribute default value\n");
 6039|  36.0k|		    if (defaultValue != NULL)
  ------------------
  |  Branch (6039:11): [True: 374, False: 35.6k]
  ------------------
 6040|    374|			xmlFree(defaultValue);
 6041|  36.0k|		    if (tree != NULL)
  ------------------
  |  Branch (6041:11): [True: 1.49k, False: 34.5k]
  ------------------
 6042|  1.49k|			xmlFreeEnumeration(tree);
 6043|  36.0k|		    break;
 6044|  36.0k|		}
 6045|  63.7k|	    }
 6046|  46.5k|	    if ((ctxt->sax != NULL) && (!ctxt->disableSAX) &&
  ------------------
  |  Branch (6046:10): [True: 46.5k, False: 0]
  |  Branch (6046:33): [True: 43.4k, False: 3.13k]
  ------------------
 6047|  43.4k|		(ctxt->sax->attributeDecl != NULL))
  ------------------
  |  Branch (6047:3): [True: 43.4k, False: 0]
  ------------------
 6048|  43.4k|		ctxt->sax->attributeDecl(ctxt->userData, elemName, attrName,
 6049|  43.4k|	                        type, def, defaultValue, tree);
 6050|  3.13k|	    else if (tree != NULL)
  ------------------
  |  Branch (6050:15): [True: 861, False: 2.27k]
  ------------------
 6051|    861|		xmlFreeEnumeration(tree);
 6052|       |
 6053|  46.5k|	    if ((ctxt->sax2) && (defaultValue != NULL) &&
  ------------------
  |  Branch (6053:10): [True: 33.6k, False: 12.9k]
  |  Branch (6053:26): [True: 17.7k, False: 15.8k]
  ------------------
 6054|  17.7k|	        (def != XML_ATTRIBUTE_IMPLIED) &&
  ------------------
  |  Branch (6054:10): [True: 17.7k, False: 0]
  ------------------
 6055|  17.7k|		(def != XML_ATTRIBUTE_REQUIRED)) {
  ------------------
  |  Branch (6055:3): [True: 17.7k, False: 0]
  ------------------
 6056|  17.7k|		xmlAddDefAttrs(ctxt, elemName, attrName, defaultValue);
 6057|  17.7k|	    }
 6058|  46.5k|	    if (ctxt->sax2) {
  ------------------
  |  Branch (6058:10): [True: 33.6k, False: 12.9k]
  ------------------
 6059|  33.6k|		xmlAddSpecialAttr(ctxt, elemName, attrName, type);
 6060|  33.6k|	    }
 6061|  46.5k|	    if (defaultValue != NULL)
  ------------------
  |  Branch (6061:10): [True: 24.9k, False: 21.5k]
  ------------------
 6062|  24.9k|	        xmlFree(defaultValue);
 6063|  46.5k|	    GROW;
  ------------------
  |  | 2271|  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 (2271:9): [True: 36.1k, False: 10.4k]
  |  |  ------------------
  |  | 2272|  46.5k|        (ctxt->input->end - ctxt->input->cur < INPUT_CHUNK)) \
  |  |  ------------------
  |  |  |  |   63|  36.1k|#define INPUT_CHUNK	250
  |  |  ------------------
  |  |  |  Branch (2272:9): [True: 17.4k, False: 18.6k]
  |  |  ------------------
  |  | 2273|  46.5k|	xmlParserGrow(ctxt);
  ------------------
 6064|  46.5k|	}
 6065|  73.7k|	if (RAW == '>') {
  ------------------
  |  | 2224|  73.7k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (6065:6): [True: 24.6k, False: 49.0k]
  ------------------
 6066|  24.6k|#ifdef LIBXML_VALID_ENABLED
 6067|  24.6k|	    if ((ctxt->validate) && (ctxt->inputNr > oldInputNr)) {
  ------------------
  |  Branch (6067:10): [True: 18.1k, False: 6.54k]
  |  Branch (6067:30): [True: 135, False: 17.9k]
  ------------------
 6068|    135|		xmlValidityError(ctxt, XML_ERR_ENTITY_BOUNDARY,
 6069|    135|                                 "Attribute list declaration doesn't start and"
 6070|    135|                                 " stop in the same entity\n",
 6071|    135|                                 NULL, NULL);
 6072|    135|	    }
 6073|  24.6k|#endif
 6074|  24.6k|	    NEXT;
  ------------------
  |  | 2279|  24.6k|#define NEXT xmlNextChar(ctxt)
  ------------------
 6075|  24.6k|	}
 6076|  73.7k|    }
 6077|  75.4k|}
xmlParseElementMixedContentDecl:
 6142|  6.23k|xmlParseElementMixedContentDecl(xmlParserCtxt *ctxt, int openInputNr) {
 6143|  6.23k|    xmlElementContentPtr ret = NULL, cur = NULL, n;
 6144|  6.23k|    const xmlChar *elem = NULL;
 6145|       |
 6146|  6.23k|    GROW;
  ------------------
  |  | 2271|  6.23k|    if ((!PARSER_PROGRESSIVE(ctxt)) && \
  |  |  ------------------
  |  |  |  |   47|  6.23k|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|  6.23k|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2271:9): [True: 4.57k, False: 1.66k]
  |  |  ------------------
  |  | 2272|  6.23k|        (ctxt->input->end - ctxt->input->cur < INPUT_CHUNK)) \
  |  |  ------------------
  |  |  |  |   63|  4.57k|#define INPUT_CHUNK	250
  |  |  ------------------
  |  |  |  Branch (2272:9): [True: 2.05k, False: 2.52k]
  |  |  ------------------
  |  | 2273|  6.23k|	xmlParserGrow(ctxt);
  ------------------
 6147|  6.23k|    if (CMP7(CUR_PTR, '#', 'P', 'C', 'D', 'A', 'T', 'A')) {
  ------------------
  |  | 2238|  6.23k|  ( CMP6( s, c1, c2, c3, c4, c5, c6 ) && ((unsigned char *) s)[ 6 ] == c7 )
  |  |  ------------------
  |  |  |  | 2236|  12.4k|  ( CMP5( s, c1, c2, c3, c4, c5 ) && ((unsigned char *) s)[ 5 ] == c6 )
  |  |  |  |  ------------------
  |  |  |  |  |  | 2234|  12.4k|  ( CMP4( s, c1, c2, c3, c4 ) && ((unsigned char *) s)[ 4 ] == c5 )
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  | 2231|  12.4k|  ( ((unsigned char *) s)[ 0 ] == c1 && ((unsigned char *) s)[ 1 ] == c2 && \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (2231:5): [True: 6.23k, False: 0]
  |  |  |  |  |  |  |  |  |  Branch (2231:41): [True: 6.23k, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  | 2232|  6.23k|    ((unsigned char *) s)[ 2 ] == c3 && ((unsigned char *) s)[ 3 ] == c4 )
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (2232:5): [True: 6.23k, False: 0]
  |  |  |  |  |  |  |  |  |  Branch (2232:41): [True: 6.23k, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (2234:34): [True: 6.23k, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2236:38): [True: 6.23k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2238:42): [True: 6.23k, False: 0]
  |  |  ------------------
  ------------------
 6148|  6.23k|	SKIP(7);
  ------------------
  |  | 2248|  6.23k|#define SKIP(val) do {							\
  |  | 2249|  6.23k|    ctxt->input->cur += (val),ctxt->input->col+=(val);			\
  |  | 2250|  6.23k|    if (*ctxt->input->cur == 0)						\
  |  |  ------------------
  |  |  |  Branch (2250:9): [True: 202, False: 6.03k]
  |  |  ------------------
  |  | 2251|  6.23k|        xmlParserGrow(ctxt);						\
  |  | 2252|  6.23k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2252:12): [Folded, False: 6.23k]
  |  |  ------------------
  ------------------
 6149|  6.23k|        xmlSkipBlankCharsPEBalanced(ctxt, openInputNr);
 6150|  6.23k|	if (RAW == ')') {
  ------------------
  |  | 2224|  6.23k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (6150:6): [True: 2.62k, False: 3.61k]
  ------------------
 6151|  2.62k|#ifdef LIBXML_VALID_ENABLED
 6152|  2.62k|	    if ((ctxt->validate) && (ctxt->inputNr > openInputNr)) {
  ------------------
  |  Branch (6152:10): [True: 1.82k, False: 806]
  |  Branch (6152:30): [True: 6, False: 1.81k]
  ------------------
 6153|      6|		xmlValidityError(ctxt, XML_ERR_ENTITY_BOUNDARY,
 6154|      6|                                 "Element content declaration doesn't start "
 6155|      6|                                 "and stop in the same entity\n",
 6156|      6|                                 NULL, NULL);
 6157|      6|	    }
 6158|  2.62k|#endif
 6159|  2.62k|	    NEXT;
  ------------------
  |  | 2279|  2.62k|#define NEXT xmlNextChar(ctxt)
  ------------------
 6160|  2.62k|	    ret = xmlNewDocElementContent(ctxt->myDoc, NULL, XML_ELEMENT_CONTENT_PCDATA);
 6161|  2.62k|	    if (ret == NULL)
  ------------------
  |  Branch (6161:10): [True: 1, False: 2.62k]
  ------------------
 6162|      1|                goto mem_error;
 6163|  2.62k|	    if (RAW == '*') {
  ------------------
  |  | 2224|  2.62k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (6163:10): [True: 127, False: 2.49k]
  ------------------
 6164|    127|		ret->ocur = XML_ELEMENT_CONTENT_MULT;
 6165|    127|		NEXT;
  ------------------
  |  | 2279|    127|#define NEXT xmlNextChar(ctxt)
  ------------------
 6166|    127|	    }
 6167|  2.62k|	    return(ret);
 6168|  2.62k|	}
 6169|  3.61k|	if ((RAW == '(') || (RAW == '|')) {
  ------------------
  |  | 2224|  3.61k|#define RAW (*ctxt->input->cur)
  ------------------
              	if ((RAW == '(') || (RAW == '|')) {
  ------------------
  |  | 2224|  3.61k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (6169:6): [True: 1, False: 3.61k]
  |  Branch (6169:22): [True: 2.44k, False: 1.16k]
  ------------------
 6170|  2.44k|	    ret = cur = xmlNewDocElementContent(ctxt->myDoc, NULL, XML_ELEMENT_CONTENT_PCDATA);
 6171|  2.44k|	    if (ret == NULL)
  ------------------
  |  Branch (6171:10): [True: 2, False: 2.44k]
  ------------------
 6172|      2|                goto mem_error;
 6173|  2.44k|	}
 6174|  18.7k|	while ((RAW == '|') && (PARSER_STOPPED(ctxt) == 0)) {
  ------------------
  |  | 2224|  18.7k|#define RAW (*ctxt->input->cur)
  ------------------
              	while ((RAW == '|') && (PARSER_STOPPED(ctxt) == 0)) {
  ------------------
  |  |   44|  15.1k|#define PARSER_STOPPED(ctxt) ((ctxt)->disableSAX > 1)
  ------------------
  |  Branch (6174:9): [True: 15.1k, False: 3.52k]
  |  Branch (6174:25): [True: 15.1k, False: 0]
  ------------------
 6175|  15.1k|	    NEXT;
  ------------------
  |  | 2279|  15.1k|#define NEXT xmlNextChar(ctxt)
  ------------------
 6176|  15.1k|            n = xmlNewDocElementContent(ctxt->myDoc, NULL, XML_ELEMENT_CONTENT_OR);
 6177|  15.1k|            if (n == NULL)
  ------------------
  |  Branch (6177:17): [True: 2, False: 15.1k]
  ------------------
 6178|      2|                goto mem_error;
 6179|  15.1k|	    if (elem == NULL) {
  ------------------
  |  Branch (6179:10): [True: 2.43k, False: 12.7k]
  ------------------
 6180|  2.43k|		n->c1 = cur;
 6181|  2.43k|		if (cur != NULL)
  ------------------
  |  Branch (6181:7): [True: 2.43k, False: 0]
  ------------------
 6182|  2.43k|		    cur->parent = n;
 6183|  2.43k|		ret = cur = n;
 6184|  12.7k|	    } else {
 6185|  12.7k|	        cur->c2 = n;
 6186|  12.7k|		n->parent = cur;
 6187|  12.7k|		n->c1 = xmlNewDocElementContent(ctxt->myDoc, elem, XML_ELEMENT_CONTENT_ELEMENT);
 6188|  12.7k|                if (n->c1 == NULL)
  ------------------
  |  Branch (6188:21): [True: 1, False: 12.7k]
  ------------------
 6189|      1|                    goto mem_error;
 6190|  12.7k|		n->c1->parent = n;
 6191|  12.7k|		cur = n;
 6192|  12.7k|	    }
 6193|  15.1k|            xmlSkipBlankCharsPEBalanced(ctxt, openInputNr);
 6194|  15.1k|	    elem = xmlParseName(ctxt);
 6195|  15.1k|	    if (elem == NULL) {
  ------------------
  |  Branch (6195:10): [True: 81, False: 15.0k]
  ------------------
 6196|     81|		xmlFatalErrMsg(ctxt, XML_ERR_NAME_REQUIRED,
 6197|     81|			"xmlParseElementMixedContentDecl : Name expected\n");
 6198|     81|		xmlFreeDocElementContent(ctxt->myDoc, ret);
 6199|     81|		return(NULL);
 6200|     81|	    }
 6201|  15.0k|            xmlSkipBlankCharsPEBalanced(ctxt, openInputNr);
 6202|  15.0k|	}
 6203|  3.52k|	if ((RAW == ')') && (NXT(1) == '*')) {
  ------------------
  |  | 2224|  3.52k|#define RAW (*ctxt->input->cur)
  ------------------
              	if ((RAW == ')') && (NXT(1) == '*')) {
  ------------------
  |  | 2226|  2.17k|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
  |  Branch (6203:6): [True: 2.17k, False: 1.34k]
  |  Branch (6203:22): [True: 2.17k, False: 6]
  ------------------
 6204|  2.17k|	    if (elem != NULL) {
  ------------------
  |  Branch (6204:10): [True: 2.17k, False: 0]
  ------------------
 6205|  2.17k|		cur->c2 = xmlNewDocElementContent(ctxt->myDoc, elem,
 6206|  2.17k|		                               XML_ELEMENT_CONTENT_ELEMENT);
 6207|  2.17k|		if (cur->c2 == NULL)
  ------------------
  |  Branch (6207:7): [True: 1, False: 2.17k]
  ------------------
 6208|      1|                    goto mem_error;
 6209|  2.17k|		cur->c2->parent = cur;
 6210|  2.17k|            }
 6211|  2.17k|            if (ret != NULL)
  ------------------
  |  Branch (6211:17): [True: 2.17k, False: 0]
  ------------------
 6212|  2.17k|                ret->ocur = XML_ELEMENT_CONTENT_MULT;
 6213|  2.17k|#ifdef LIBXML_VALID_ENABLED
 6214|  2.17k|	    if ((ctxt->validate) && (ctxt->inputNr > openInputNr)) {
  ------------------
  |  Branch (6214:10): [True: 1.74k, False: 430]
  |  Branch (6214:30): [True: 1, False: 1.74k]
  ------------------
 6215|      1|		xmlValidityError(ctxt, XML_ERR_ENTITY_BOUNDARY,
 6216|      1|                                 "Element content declaration doesn't start "
 6217|      1|                                 "and stop in the same entity\n",
 6218|      1|                                 NULL, NULL);
 6219|      1|	    }
 6220|  2.17k|#endif
 6221|  2.17k|	    SKIP(2);
  ------------------
  |  | 2248|  2.17k|#define SKIP(val) do {							\
  |  | 2249|  2.17k|    ctxt->input->cur += (val),ctxt->input->col+=(val);			\
  |  | 2250|  2.17k|    if (*ctxt->input->cur == 0)						\
  |  |  ------------------
  |  |  |  Branch (2250:9): [True: 203, False: 1.96k]
  |  |  ------------------
  |  | 2251|  2.17k|        xmlParserGrow(ctxt);						\
  |  | 2252|  2.17k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2252:12): [Folded, False: 2.17k]
  |  |  ------------------
  ------------------
 6222|  2.17k|	} else {
 6223|  1.35k|	    xmlFreeDocElementContent(ctxt->myDoc, ret);
 6224|  1.35k|	    xmlFatalErr(ctxt, XML_ERR_MIXED_NOT_STARTED, NULL);
 6225|  1.35k|	    return(NULL);
 6226|  1.35k|	}
 6227|       |
 6228|  3.52k|    } else {
 6229|      0|	xmlFatalErr(ctxt, XML_ERR_PCDATA_REQUIRED, NULL);
 6230|      0|    }
 6231|  2.17k|    return(ret);
 6232|       |
 6233|      7|mem_error:
 6234|      7|    xmlErrMemory(ctxt);
 6235|      7|    xmlFreeDocElementContent(ctxt->myDoc, ret);
 6236|       |    return(NULL);
 6237|  6.23k|}
xmlParseElementContentDecl:
 6592|  14.0k|                           xmlElementContent **result) {
 6593|       |
 6594|  14.0k|    xmlElementContentPtr tree = NULL;
 6595|  14.0k|    int openInputNr = ctxt->inputNr;
 6596|  14.0k|    int res;
 6597|       |
 6598|  14.0k|    *result = NULL;
 6599|       |
 6600|  14.0k|    if (RAW != '(') {
  ------------------
  |  | 2224|  14.0k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (6600:9): [True: 0, False: 14.0k]
  ------------------
 6601|      0|	xmlFatalErrMsgStr(ctxt, XML_ERR_ELEMCONTENT_NOT_STARTED,
 6602|      0|		"xmlParseElementContentDecl : %s '(' expected\n", name);
 6603|      0|	return(-1);
 6604|      0|    }
 6605|  14.0k|    NEXT;
  ------------------
  |  | 2279|  14.0k|#define NEXT xmlNextChar(ctxt)
  ------------------
 6606|  14.0k|    xmlSkipBlankCharsPEBalanced(ctxt, openInputNr);
 6607|  14.0k|    if (CMP7(CUR_PTR, '#', 'P', 'C', 'D', 'A', 'T', 'A')) {
  ------------------
  |  | 2238|  14.0k|  ( CMP6( s, c1, c2, c3, c4, c5, c6 ) && ((unsigned char *) s)[ 6 ] == c7 )
  |  |  ------------------
  |  |  |  | 2236|  28.0k|  ( CMP5( s, c1, c2, c3, c4, c5 ) && ((unsigned char *) s)[ 5 ] == c6 )
  |  |  |  |  ------------------
  |  |  |  |  |  | 2234|  28.0k|  ( CMP4( s, c1, c2, c3, c4 ) && ((unsigned char *) s)[ 4 ] == c5 )
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  | 2231|  28.0k|  ( ((unsigned char *) s)[ 0 ] == c1 && ((unsigned char *) s)[ 1 ] == c2 && \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (2231:5): [True: 6.25k, False: 7.75k]
  |  |  |  |  |  |  |  |  |  Branch (2231:41): [True: 6.24k, False: 3]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  | 2232|  14.0k|    ((unsigned char *) s)[ 2 ] == c3 && ((unsigned char *) s)[ 3 ] == c4 )
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (2232:5): [True: 6.24k, False: 1]
  |  |  |  |  |  |  |  |  |  Branch (2232:41): [True: 6.24k, False: 1]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (2234:34): [True: 6.24k, False: 4]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2236:38): [True: 6.24k, False: 1]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2238:42): [True: 6.23k, False: 1]
  |  |  ------------------
  ------------------
 6608|  6.23k|        tree = xmlParseElementMixedContentDecl(ctxt, openInputNr);
 6609|  6.23k|	res = XML_ELEMENT_TYPE_MIXED;
 6610|  7.76k|    } else {
 6611|  7.76k|        tree = xmlParseElementChildrenContentDeclPriv(ctxt, openInputNr, 1);
 6612|  7.76k|	res = XML_ELEMENT_TYPE_ELEMENT;
 6613|  7.76k|    }
 6614|  14.0k|    if (tree == NULL)
  ------------------
  |  Branch (6614:9): [True: 3.42k, False: 10.5k]
  ------------------
 6615|  3.42k|        return(-1);
 6616|  10.5k|    SKIP_BLANKS_PE;
  ------------------
  |  | 2277|  10.5k|#define SKIP_BLANKS_PE xmlSkipBlankCharsPE(ctxt)
  ------------------
 6617|  10.5k|    *result = tree;
 6618|  10.5k|    return(res);
 6619|  14.0k|}
xmlParseElementDecl:
 6635|  20.3k|xmlParseElementDecl(xmlParserCtxt *ctxt) {
 6636|  20.3k|    const xmlChar *name;
 6637|  20.3k|    int ret = -1;
 6638|  20.3k|    xmlElementContentPtr content  = NULL;
 6639|       |
 6640|  20.3k|    if ((CUR != '<') || (NXT(1) != '!'))
  ------------------
  |  | 2225|  20.3k|#define CUR (*ctxt->input->cur)
  ------------------
                  if ((CUR != '<') || (NXT(1) != '!'))
  ------------------
  |  | 2226|  20.3k|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
  |  Branch (6640:9): [True: 0, False: 20.3k]
  |  Branch (6640:25): [True: 0, False: 20.3k]
  ------------------
 6641|      0|        return(ret);
 6642|  20.3k|    SKIP(2);
  ------------------
  |  | 2248|  20.3k|#define SKIP(val) do {							\
  |  | 2249|  20.3k|    ctxt->input->cur += (val),ctxt->input->col+=(val);			\
  |  | 2250|  20.3k|    if (*ctxt->input->cur == 0)						\
  |  |  ------------------
  |  |  |  Branch (2250:9): [True: 0, False: 20.3k]
  |  |  ------------------
  |  | 2251|  20.3k|        xmlParserGrow(ctxt);						\
  |  | 2252|  20.3k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2252:12): [Folded, False: 20.3k]
  |  |  ------------------
  ------------------
 6643|       |
 6644|       |    /* GROW; done in the caller */
 6645|  20.3k|    if (CMP7(CUR_PTR, 'E', 'L', 'E', 'M', 'E', 'N', 'T')) {
  ------------------
  |  | 2238|  20.3k|  ( CMP6( s, c1, c2, c3, c4, c5, c6 ) && ((unsigned char *) s)[ 6 ] == c7 )
  |  |  ------------------
  |  |  |  | 2236|  40.6k|  ( CMP5( s, c1, c2, c3, c4, c5 ) && ((unsigned char *) s)[ 5 ] == c6 )
  |  |  |  |  ------------------
  |  |  |  |  |  | 2234|  40.6k|  ( CMP4( s, c1, c2, c3, c4 ) && ((unsigned char *) s)[ 4 ] == c5 )
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  | 2231|  40.6k|  ( ((unsigned char *) s)[ 0 ] == c1 && ((unsigned char *) s)[ 1 ] == c2 && \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (2231:5): [True: 20.3k, False: 0]
  |  |  |  |  |  |  |  |  |  Branch (2231:41): [True: 20.3k, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  | 2232|  20.3k|    ((unsigned char *) s)[ 2 ] == c3 && ((unsigned char *) s)[ 3 ] == c4 )
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (2232:5): [True: 20.3k, False: 13]
  |  |  |  |  |  |  |  |  |  Branch (2232:41): [True: 20.3k, False: 7]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (2234:34): [True: 20.2k, False: 4]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2236:38): [True: 20.2k, False: 2]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2238:42): [True: 20.2k, False: 3]
  |  |  ------------------
  ------------------
 6646|  20.2k|#ifdef LIBXML_VALID_ENABLED
 6647|  20.2k|	int oldInputNr = ctxt->inputNr;
 6648|  20.2k|#endif
 6649|       |
 6650|  20.2k|	SKIP(7);
  ------------------
  |  | 2248|  20.2k|#define SKIP(val) do {							\
  |  | 2249|  20.2k|    ctxt->input->cur += (val),ctxt->input->col+=(val);			\
  |  | 2250|  20.2k|    if (*ctxt->input->cur == 0)						\
  |  |  ------------------
  |  |  |  Branch (2250:9): [True: 78, False: 20.2k]
  |  |  ------------------
  |  | 2251|  20.2k|        xmlParserGrow(ctxt);						\
  |  | 2252|  20.2k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2252:12): [Folded, False: 20.2k]
  |  |  ------------------
  ------------------
 6651|  20.2k|	if (SKIP_BLANKS_PE == 0) {
  ------------------
  |  | 2277|  20.2k|#define SKIP_BLANKS_PE xmlSkipBlankCharsPE(ctxt)
  ------------------
  |  Branch (6651:6): [True: 133, False: 20.1k]
  ------------------
 6652|    133|	    xmlFatalErrMsg(ctxt, XML_ERR_SPACE_REQUIRED,
 6653|    133|		           "Space required after 'ELEMENT'\n");
 6654|    133|	    return(-1);
 6655|    133|	}
 6656|  20.1k|        name = xmlParseName(ctxt);
 6657|  20.1k|	if (name == NULL) {
  ------------------
  |  Branch (6657:6): [True: 370, False: 19.7k]
  ------------------
 6658|    370|	    xmlFatalErrMsg(ctxt, XML_ERR_NAME_REQUIRED,
 6659|    370|			   "xmlParseElementDecl: no name for Element\n");
 6660|    370|	    return(-1);
 6661|    370|	}
 6662|  19.7k|	if (SKIP_BLANKS_PE == 0) {
  ------------------
  |  | 2277|  19.7k|#define SKIP_BLANKS_PE xmlSkipBlankCharsPE(ctxt)
  ------------------
  |  Branch (6662:6): [True: 1.02k, False: 18.7k]
  ------------------
 6663|  1.02k|	    xmlFatalErrMsg(ctxt, XML_ERR_SPACE_REQUIRED,
 6664|  1.02k|			   "Space required after the element name\n");
 6665|  1.02k|	}
 6666|  19.7k|	if (CMP5(CUR_PTR, 'E', 'M', 'P', 'T', 'Y')) {
  ------------------
  |  | 2234|  19.7k|  ( CMP4( s, c1, c2, c3, c4 ) && ((unsigned char *) s)[ 4 ] == c5 )
  |  |  ------------------
  |  |  |  | 2231|  39.5k|  ( ((unsigned char *) s)[ 0 ] == c1 && ((unsigned char *) s)[ 1 ] == c2 && \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2231:5): [True: 3.87k, False: 15.9k]
  |  |  |  |  |  Branch (2231:41): [True: 3.87k, False: 3]
  |  |  |  |  ------------------
  |  |  |  | 2232|  19.7k|    ((unsigned char *) s)[ 2 ] == c3 && ((unsigned char *) s)[ 3 ] == c4 )
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2232:5): [True: 3.87k, False: 2]
  |  |  |  |  |  Branch (2232:41): [True: 3.87k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2234:34): [True: 3.87k, False: 2]
  |  |  ------------------
  ------------------
 6667|  3.87k|	    SKIP(5);
  ------------------
  |  | 2248|  3.87k|#define SKIP(val) do {							\
  |  | 2249|  3.87k|    ctxt->input->cur += (val),ctxt->input->col+=(val);			\
  |  | 2250|  3.87k|    if (*ctxt->input->cur == 0)						\
  |  |  ------------------
  |  |  |  Branch (2250:9): [True: 49, False: 3.82k]
  |  |  ------------------
  |  | 2251|  3.87k|        xmlParserGrow(ctxt);						\
  |  | 2252|  3.87k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2252:12): [Folded, False: 3.87k]
  |  |  ------------------
  ------------------
 6668|       |	    /*
 6669|       |	     * Element must always be empty.
 6670|       |	     */
 6671|  3.87k|	    ret = XML_ELEMENT_TYPE_EMPTY;
 6672|  15.9k|	} else if ((RAW == 'A') && (NXT(1) == 'N') &&
  ------------------
  |  | 2224|  15.9k|#define RAW (*ctxt->input->cur)
  ------------------
              	} else if ((RAW == 'A') && (NXT(1) == 'N') &&
  ------------------
  |  | 2226|  1.15k|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
  |  Branch (6672:13): [True: 1.15k, False: 14.7k]
  |  Branch (6672:29): [True: 1.15k, False: 1]
  ------------------
 6673|  1.15k|	           (NXT(2) == 'Y')) {
  ------------------
  |  | 2226|  1.15k|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
  |  Branch (6673:13): [True: 1.15k, False: 1]
  ------------------
 6674|  1.15k|	    SKIP(3);
  ------------------
  |  | 2248|  1.15k|#define SKIP(val) do {							\
  |  | 2249|  1.15k|    ctxt->input->cur += (val),ctxt->input->col+=(val);			\
  |  | 2250|  1.15k|    if (*ctxt->input->cur == 0)						\
  |  |  ------------------
  |  |  |  Branch (2250:9): [True: 257, False: 895]
  |  |  ------------------
  |  | 2251|  1.15k|        xmlParserGrow(ctxt);						\
  |  | 2252|  1.15k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2252:12): [Folded, False: 1.15k]
  |  |  ------------------
  ------------------
 6675|       |	    /*
 6676|       |	     * Element is a generic container.
 6677|       |	     */
 6678|  1.15k|	    ret = XML_ELEMENT_TYPE_ANY;
 6679|  14.7k|	} else if (RAW == '(') {
  ------------------
  |  | 2224|  14.7k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (6679:13): [True: 14.0k, False: 760]
  ------------------
 6680|  14.0k|	    ret = xmlParseElementContentDecl(ctxt, name, &content);
 6681|  14.0k|            if (ret <= 0)
  ------------------
  |  Branch (6681:17): [True: 3.42k, False: 10.5k]
  ------------------
 6682|  3.42k|                return(-1);
 6683|  14.0k|	} else {
 6684|       |	    /*
 6685|       |	     * [ WFC: PEs in Internal Subset ] error handling.
 6686|       |	     */
 6687|    760|            xmlFatalErrMsg(ctxt, XML_ERR_ELEMCONTENT_NOT_STARTED,
 6688|    760|                  "xmlParseElementDecl: 'EMPTY', 'ANY' or '(' expected\n");
 6689|    760|	    return(-1);
 6690|    760|	}
 6691|       |
 6692|  15.6k|	SKIP_BLANKS_PE;
  ------------------
  |  | 2277|  15.6k|#define SKIP_BLANKS_PE xmlSkipBlankCharsPE(ctxt)
  ------------------
 6693|       |
 6694|  15.6k|	if (RAW != '>') {
  ------------------
  |  | 2224|  15.6k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (6694:6): [True: 980, False: 14.6k]
  ------------------
 6695|    980|	    xmlFatalErr(ctxt, XML_ERR_GT_REQUIRED, NULL);
 6696|    980|	    if (content != NULL) {
  ------------------
  |  Branch (6696:10): [True: 602, False: 378]
  ------------------
 6697|    602|		xmlFreeDocElementContent(ctxt->myDoc, content);
 6698|    602|	    }
 6699|  14.6k|	} else {
 6700|  14.6k|#ifdef LIBXML_VALID_ENABLED
 6701|  14.6k|	    if ((ctxt->validate) && (ctxt->inputNr > oldInputNr)) {
  ------------------
  |  Branch (6701:10): [True: 10.4k, False: 4.14k]
  |  Branch (6701:30): [True: 49, False: 10.4k]
  ------------------
 6702|     49|		xmlValidityError(ctxt, XML_ERR_ENTITY_BOUNDARY,
 6703|     49|                                 "Element declaration doesn't start and stop in"
 6704|     49|                                 " the same entity\n",
 6705|     49|                                 NULL, NULL);
 6706|     49|	    }
 6707|  14.6k|#endif
 6708|       |
 6709|  14.6k|	    NEXT;
  ------------------
  |  | 2279|  14.6k|#define NEXT xmlNextChar(ctxt)
  ------------------
 6710|  14.6k|	    if ((ctxt->sax != NULL) && (!ctxt->disableSAX) &&
  ------------------
  |  Branch (6710:10): [True: 14.6k, False: 0]
  |  Branch (6710:33): [True: 13.6k, False: 979]
  ------------------
 6711|  13.6k|		(ctxt->sax->elementDecl != NULL)) {
  ------------------
  |  Branch (6711:3): [True: 13.6k, False: 0]
  ------------------
 6712|  13.6k|		if (content != NULL)
  ------------------
  |  Branch (6712:7): [True: 9.36k, False: 4.27k]
  ------------------
 6713|  9.36k|		    content->parent = NULL;
 6714|  13.6k|	        ctxt->sax->elementDecl(ctxt->userData, name, ret,
 6715|  13.6k|		                       content);
 6716|  13.6k|		if ((content != NULL) && (content->parent == NULL)) {
  ------------------
  |  Branch (6716:7): [True: 9.36k, False: 4.27k]
  |  Branch (6716:28): [True: 2.76k, False: 6.60k]
  ------------------
 6717|       |		    /*
 6718|       |		     * this is a trick: if xmlAddElementDecl is called,
 6719|       |		     * instead of copying the full tree it is plugged directly
 6720|       |		     * if called from the parser. Avoid duplicating the
 6721|       |		     * interfaces or change the API/ABI
 6722|       |		     */
 6723|  2.76k|		    xmlFreeDocElementContent(ctxt->myDoc, content);
 6724|  2.76k|		}
 6725|  13.6k|	    } else if (content != NULL) {
  ------------------
  |  Branch (6725:17): [True: 612, False: 367]
  ------------------
 6726|    612|		xmlFreeDocElementContent(ctxt->myDoc, content);
 6727|    612|	    }
 6728|  14.6k|	}
 6729|  15.6k|    }
 6730|  15.6k|    return(ret);
 6731|  20.3k|}
xmlParseMarkupDecl:
 6906|   557k|xmlParseMarkupDecl(xmlParserCtxt *ctxt) {
 6907|   557k|    GROW;
  ------------------
  |  | 2271|   557k|    if ((!PARSER_PROGRESSIVE(ctxt)) && \
  |  |  ------------------
  |  |  |  |   47|   557k|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|   557k|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2271:9): [True: 530k, False: 27.3k]
  |  |  ------------------
  |  | 2272|   557k|        (ctxt->input->end - ctxt->input->cur < INPUT_CHUNK)) \
  |  |  ------------------
  |  |  |  |   63|   530k|#define INPUT_CHUNK	250
  |  |  ------------------
  |  |  |  Branch (2272:9): [True: 223k, False: 306k]
  |  |  ------------------
  |  | 2273|   557k|	xmlParserGrow(ctxt);
  ------------------
 6908|   557k|    if (CUR == '<') {
  ------------------
  |  | 2225|   557k|#define CUR (*ctxt->input->cur)
  ------------------
  |  Branch (6908:9): [True: 557k, False: 0]
  ------------------
 6909|   557k|        if (NXT(1) == '!') {
  ------------------
  |  | 2226|   557k|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
  |  Branch (6909:13): [True: 536k, False: 21.1k]
  ------------------
 6910|   536k|	    switch (NXT(2)) {
  ------------------
  |  | 2226|   536k|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
 6911|   170k|	        case 'E':
  ------------------
  |  Branch (6911:10): [True: 170k, False: 366k]
  ------------------
 6912|   170k|		    if (NXT(3) == 'L')
  ------------------
  |  | 2226|   170k|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
  |  Branch (6912:11): [True: 20.3k, False: 149k]
  ------------------
 6913|  20.3k|			xmlParseElementDecl(ctxt);
 6914|   149k|		    else if (NXT(3) == 'N')
  ------------------
  |  | 2226|   149k|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
  |  Branch (6914:16): [True: 149k, False: 24]
  ------------------
 6915|   149k|			xmlParseEntityDecl(ctxt);
 6916|     24|                    else
 6917|     24|                        SKIP(2);
  ------------------
  |  | 2248|     24|#define SKIP(val) do {							\
  |  | 2249|     24|    ctxt->input->cur += (val),ctxt->input->col+=(val);			\
  |  | 2250|     24|    if (*ctxt->input->cur == 0)						\
  |  |  ------------------
  |  |  |  Branch (2250:9): [True: 0, False: 24]
  |  |  ------------------
  |  | 2251|     24|        xmlParserGrow(ctxt);						\
  |  | 2252|     24|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2252:12): [Folded, False: 24]
  |  |  ------------------
  ------------------
 6918|   170k|		    break;
 6919|  75.4k|	        case 'A':
  ------------------
  |  Branch (6919:10): [True: 75.4k, False: 461k]
  ------------------
 6920|  75.4k|		    xmlParseAttributeListDecl(ctxt);
 6921|  75.4k|		    break;
 6922|  4.14k|	        case 'N':
  ------------------
  |  Branch (6922:10): [True: 4.14k, False: 532k]
  ------------------
 6923|  4.14k|		    xmlParseNotationDecl(ctxt);
 6924|  4.14k|		    break;
 6925|   277k|	        case '-':
  ------------------
  |  Branch (6925:10): [True: 277k, False: 258k]
  ------------------
 6926|   277k|		    xmlParseComment(ctxt);
 6927|   277k|		    break;
 6928|  8.91k|		default:
  ------------------
  |  Branch (6928:3): [True: 8.91k, False: 527k]
  ------------------
 6929|  8.91k|                    xmlFatalErr(ctxt,
 6930|  8.91k|                                ctxt->inSubset == 2 ?
  ------------------
  |  Branch (6930:33): [True: 697, False: 8.22k]
  ------------------
 6931|    697|                                    XML_ERR_EXT_SUBSET_NOT_FINISHED :
 6932|  8.91k|                                    XML_ERR_INT_SUBSET_NOT_FINISHED,
 6933|  8.91k|                                NULL);
 6934|  8.91k|                    SKIP(2);
  ------------------
  |  | 2248|  8.91k|#define SKIP(val) do {							\
  |  | 2249|  8.91k|    ctxt->input->cur += (val),ctxt->input->col+=(val);			\
  |  | 2250|  8.91k|    if (*ctxt->input->cur == 0)						\
  |  |  ------------------
  |  |  |  Branch (2250:9): [True: 254, False: 8.66k]
  |  |  ------------------
  |  | 2251|  8.91k|        xmlParserGrow(ctxt);						\
  |  | 2252|  8.91k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2252:12): [Folded, False: 8.91k]
  |  |  ------------------
  ------------------
 6935|  8.91k|		    break;
 6936|   536k|	    }
 6937|   536k|	} else if (NXT(1) == '?') {
  ------------------
  |  | 2226|  21.1k|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
  |  Branch (6937:13): [True: 21.1k, False: 0]
  ------------------
 6938|  21.1k|	    xmlParsePI(ctxt);
 6939|  21.1k|	}
 6940|   557k|    }
 6941|   557k|}
xmlParseTextDecl:
 6953|   165k|xmlParseTextDecl(xmlParserCtxt *ctxt) {
 6954|   165k|    xmlChar *version;
 6955|       |
 6956|       |    /*
 6957|       |     * We know that '<?xml' is here.
 6958|       |     */
 6959|   165k|    if ((CMP5(CUR_PTR, '<', '?', 'x', 'm', 'l')) && (IS_BLANK_CH(NXT(5)))) {
  ------------------
  |  | 2234|   165k|  ( CMP4( s, c1, c2, c3, c4 ) && ((unsigned char *) s)[ 4 ] == c5 )
  |  |  ------------------
  |  |  |  | 2231|   330k|  ( ((unsigned char *) s)[ 0 ] == c1 && ((unsigned char *) s)[ 1 ] == c2 && \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2231:5): [True: 165k, False: 0]
  |  |  |  |  |  Branch (2231:41): [True: 165k, False: 0]
  |  |  |  |  ------------------
  |  |  |  | 2232|   165k|    ((unsigned char *) s)[ 2 ] == c3 && ((unsigned char *) s)[ 3 ] == c4 )
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2232:5): [True: 165k, False: 0]
  |  |  |  |  |  Branch (2232:41): [True: 165k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2234:34): [True: 165k, False: 0]
  |  |  ------------------
  ------------------
                  if ((CMP5(CUR_PTR, '<', '?', 'x', 'm', 'l')) && (IS_BLANK_CH(NXT(5)))) {
  ------------------
  |  |  137|   165k|#define IS_BLANK_CH(c)  xmlIsBlank_ch(c)
  |  |  ------------------
  |  |  |  |   90|   165k|#define xmlIsBlank_ch(c)	(((c) == 0x20) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (90:27): [True: 162k, False: 2.50k]
  |  |  |  |  ------------------
  |  |  |  |   91|   165k|				 ((0x9 <= (c)) && ((c) <= 0xa)) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (91:7): [True: 2.50k, False: 1]
  |  |  |  |  |  Branch (91:23): [True: 859, False: 1.64k]
  |  |  |  |  ------------------
  |  |  |  |   92|   165k|				 ((c) == 0xd))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (92:6): [True: 1.64k, False: 4]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 6960|   165k|	SKIP(5);
  ------------------
  |  | 2248|   165k|#define SKIP(val) do {							\
  |  | 2249|   165k|    ctxt->input->cur += (val),ctxt->input->col+=(val);			\
  |  | 2250|   165k|    if (*ctxt->input->cur == 0)						\
  |  |  ------------------
  |  |  |  Branch (2250:9): [True: 0, False: 165k]
  |  |  ------------------
  |  | 2251|   165k|        xmlParserGrow(ctxt);						\
  |  | 2252|   165k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2252:12): [Folded, False: 165k]
  |  |  ------------------
  ------------------
 6961|   165k|    } else {
 6962|      4|	xmlFatalErr(ctxt, XML_ERR_XMLDECL_NOT_STARTED, NULL);
 6963|      4|	return;
 6964|      4|    }
 6965|       |
 6966|   165k|    if (SKIP_BLANKS == 0) {
  ------------------
  |  | 2275|   165k|#define SKIP_BLANKS xmlSkipBlankChars(ctxt)
  ------------------
  |  Branch (6966:9): [True: 0, False: 165k]
  ------------------
 6967|      0|	xmlFatalErrMsg(ctxt, XML_ERR_SPACE_REQUIRED,
 6968|      0|		       "Space needed after '<?xml'\n");
 6969|      0|    }
 6970|       |
 6971|       |    /*
 6972|       |     * We may have the VersionInfo here.
 6973|       |     */
 6974|   165k|    version = xmlParseVersionInfo(ctxt);
 6975|   165k|    if (version == NULL) {
  ------------------
  |  Branch (6975:9): [True: 159k, False: 5.57k]
  ------------------
 6976|   159k|	version = xmlCharStrdup(XML_DEFAULT_VERSION);
  ------------------
  |  |   42|   159k|#define XML_DEFAULT_VERSION	"1.0"
  ------------------
 6977|   159k|        if (version == NULL) {
  ------------------
  |  Branch (6977:13): [True: 5, False: 159k]
  ------------------
 6978|      5|            xmlErrMemory(ctxt);
 6979|      5|            return;
 6980|      5|        }
 6981|   159k|    } else {
 6982|  5.57k|	if (SKIP_BLANKS == 0) {
  ------------------
  |  | 2275|  5.57k|#define SKIP_BLANKS xmlSkipBlankChars(ctxt)
  ------------------
  |  Branch (6982:6): [True: 447, False: 5.12k]
  ------------------
 6983|    447|	    xmlFatalErrMsg(ctxt, XML_ERR_SPACE_REQUIRED,
 6984|    447|		           "Space needed here\n");
 6985|    447|	}
 6986|  5.57k|    }
 6987|   165k|    ctxt->input->version = version;
 6988|       |
 6989|       |    /*
 6990|       |     * We must have the encoding declaration
 6991|       |     */
 6992|   165k|    xmlParseEncodingDecl(ctxt);
 6993|       |
 6994|   165k|    SKIP_BLANKS;
  ------------------
  |  | 2275|   165k|#define SKIP_BLANKS xmlSkipBlankChars(ctxt)
  ------------------
 6995|   165k|    if ((RAW == '?') && (NXT(1) == '>')) {
  ------------------
  |  | 2224|   165k|#define RAW (*ctxt->input->cur)
  ------------------
                  if ((RAW == '?') && (NXT(1) == '>')) {
  ------------------
  |  | 2226|  2.69k|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
  |  Branch (6995:9): [True: 2.69k, False: 162k]
  |  Branch (6995:25): [True: 2.07k, False: 624]
  ------------------
 6996|  2.07k|        SKIP(2);
  ------------------
  |  | 2248|  2.07k|#define SKIP(val) do {							\
  |  | 2249|  2.07k|    ctxt->input->cur += (val),ctxt->input->col+=(val);			\
  |  | 2250|  2.07k|    if (*ctxt->input->cur == 0)						\
  |  |  ------------------
  |  |  |  Branch (2250:9): [True: 506, False: 1.56k]
  |  |  ------------------
  |  | 2251|  2.07k|        xmlParserGrow(ctxt);						\
  |  | 2252|  2.07k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2252:12): [Folded, False: 2.07k]
  |  |  ------------------
  ------------------
 6997|   162k|    } else if (RAW == '>') {
  ------------------
  |  | 2224|   162k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (6997:16): [True: 254, False: 162k]
  ------------------
 6998|       |        /* Deprecated old WD ... */
 6999|    254|	xmlFatalErr(ctxt, XML_ERR_XMLDECL_NOT_FINISHED, NULL);
 7000|    254|	NEXT;
  ------------------
  |  | 2279|    254|#define NEXT xmlNextChar(ctxt)
  ------------------
 7001|   162k|    } else {
 7002|   162k|        int c;
 7003|       |
 7004|   162k|	xmlFatalErr(ctxt, XML_ERR_XMLDECL_NOT_FINISHED, NULL);
 7005|   261M|        while ((PARSER_STOPPED(ctxt) == 0) && ((c = CUR) != 0)) {
  ------------------
  |  |   44|   261M|#define PARSER_STOPPED(ctxt) ((ctxt)->disableSAX > 1)
  ------------------
                      while ((PARSER_STOPPED(ctxt) == 0) && ((c = CUR) != 0)) {
  ------------------
  |  | 2225|   261M|#define CUR (*ctxt->input->cur)
  ------------------
  |  Branch (7005:16): [True: 261M, False: 38]
  |  Branch (7005:47): [True: 261M, False: 7.67k]
  ------------------
 7006|   261M|            NEXT;
  ------------------
  |  | 2279|   261M|#define NEXT xmlNextChar(ctxt)
  ------------------
 7007|   261M|            if (c == '>')
  ------------------
  |  Branch (7007:17): [True: 154k, False: 261M]
  ------------------
 7008|   154k|                break;
 7009|   261M|        }
 7010|   162k|    }
 7011|   165k|}
xmlParseExternalSubset:
 7028|  1.19k|                       const xmlChar *systemId) {
 7029|  1.19k|    int oldInputNr;
 7030|       |
 7031|  1.19k|    xmlCtxtInitializeLate(ctxt);
 7032|       |
 7033|  1.19k|    xmlDetectEncoding(ctxt);
 7034|       |
 7035|  1.19k|    if (CMP5(CUR_PTR, '<', '?', 'x', 'm', 'l')) {
  ------------------
  |  | 2234|  1.19k|  ( CMP4( s, c1, c2, c3, c4 ) && ((unsigned char *) s)[ 4 ] == c5 )
  |  |  ------------------
  |  |  |  | 2231|  2.38k|  ( ((unsigned char *) s)[ 0 ] == c1 && ((unsigned char *) s)[ 1 ] == c2 && \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2231:5): [True: 1.11k, False: 78]
  |  |  |  |  |  Branch (2231:41): [True: 115, False: 997]
  |  |  |  |  ------------------
  |  |  |  | 2232|  1.19k|    ((unsigned char *) s)[ 2 ] == c3 && ((unsigned char *) s)[ 3 ] == c4 )
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2232:5): [True: 85, False: 30]
  |  |  |  |  |  Branch (2232:41): [True: 82, False: 3]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2234:34): [True: 75, False: 7]
  |  |  ------------------
  ------------------
 7036|     75|	xmlParseTextDecl(ctxt);
 7037|     75|    }
 7038|  1.19k|    if (ctxt->myDoc == NULL) {
  ------------------
  |  Branch (7038:9): [True: 0, False: 1.19k]
  ------------------
 7039|      0|        ctxt->myDoc = xmlNewDoc(BAD_CAST "1.0");
  ------------------
  |  |   34|      0|#define BAD_CAST (xmlChar *)
  ------------------
 7040|      0|	if (ctxt->myDoc == NULL) {
  ------------------
  |  Branch (7040:6): [True: 0, False: 0]
  ------------------
 7041|      0|	    xmlErrMemory(ctxt);
 7042|      0|	    return;
 7043|      0|	}
 7044|      0|	ctxt->myDoc->properties = XML_DOC_INTERNAL;
 7045|      0|    }
 7046|  1.19k|    if ((ctxt->myDoc->intSubset == NULL) &&
  ------------------
  |  Branch (7046:9): [True: 0, False: 1.19k]
  ------------------
 7047|      0|        (xmlCreateIntSubset(ctxt->myDoc, NULL, publicId, systemId) == NULL)) {
  ------------------
  |  Branch (7047:9): [True: 0, False: 0]
  ------------------
 7048|      0|        xmlErrMemory(ctxt);
 7049|      0|    }
 7050|       |
 7051|  1.19k|    ctxt->inSubset = 2;
 7052|  1.19k|    oldInputNr = ctxt->inputNr;
 7053|       |
 7054|  1.19k|    SKIP_BLANKS;
  ------------------
  |  | 2275|  1.19k|#define SKIP_BLANKS xmlSkipBlankChars(ctxt)
  ------------------
 7055|   176k|    while (!PARSER_STOPPED(ctxt)) {
  ------------------
  |  |   44|   176k|#define PARSER_STOPPED(ctxt) ((ctxt)->disableSAX > 1)
  ------------------
  |  Branch (7055:12): [True: 176k, False: 115]
  ------------------
 7056|   176k|        if (ctxt->input->cur >= ctxt->input->end) {
  ------------------
  |  Branch (7056:13): [True: 1.38k, False: 175k]
  ------------------
 7057|  1.38k|            if (ctxt->inputNr <= oldInputNr) {
  ------------------
  |  Branch (7057:17): [True: 548, False: 840]
  ------------------
 7058|    548|                xmlParserCheckEOF(ctxt, XML_ERR_EXT_SUBSET_NOT_FINISHED);
 7059|    548|                break;
 7060|    548|            }
 7061|       |
 7062|    840|            xmlPopPE(ctxt);
 7063|   175k|        } else if ((RAW == '<') && (NXT(1) == '!') && (NXT(2) == '[')) {
  ------------------
  |  | 2224|   175k|#define RAW (*ctxt->input->cur)
  ------------------
                      } else if ((RAW == '<') && (NXT(1) == '!') && (NXT(2) == '[')) {
  ------------------
  |  | 2226|   172k|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
                      } else if ((RAW == '<') && (NXT(1) == '!') && (NXT(2) == '[')) {
  ------------------
  |  | 2226|   159k|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
  |  Branch (7063:20): [True: 172k, False: 2.61k]
  |  Branch (7063:36): [True: 159k, False: 13.0k]
  |  Branch (7063:55): [True: 899, False: 158k]
  ------------------
 7064|    899|            xmlParseConditionalSections(ctxt);
 7065|   174k|        } else if ((RAW == '<') && ((NXT(1) == '!') || (NXT(1) == '?'))) {
  ------------------
  |  | 2224|   174k|#define RAW (*ctxt->input->cur)
  ------------------
                      } else if ((RAW == '<') && ((NXT(1) == '!') || (NXT(1) == '?'))) {
  ------------------
  |  | 2226|   171k|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
                      } else if ((RAW == '<') && ((NXT(1) == '!') || (NXT(1) == '?'))) {
  ------------------
  |  | 2226|  13.0k|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
  |  Branch (7065:20): [True: 171k, False: 2.61k]
  |  Branch (7065:37): [True: 158k, False: 13.0k]
  |  Branch (7065:56): [True: 12.9k, False: 51]
  ------------------
 7066|   171k|            xmlParseMarkupDecl(ctxt);
 7067|   171k|        } else if (RAW == '%') {
  ------------------
  |  | 2224|  2.66k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (7067:20): [True: 2.13k, False: 527]
  ------------------
 7068|  2.13k|            xmlParsePERefInternal(ctxt, 1);
 7069|  2.13k|        } else {
 7070|    527|            xmlFatalErr(ctxt, XML_ERR_EXT_SUBSET_NOT_FINISHED, NULL);
 7071|       |
 7072|    633|            while (ctxt->inputNr > oldInputNr)
  ------------------
  |  Branch (7072:20): [True: 106, False: 527]
  ------------------
 7073|    106|                xmlPopPE(ctxt);
 7074|    527|            break;
 7075|    527|        }
 7076|   175k|        SKIP_BLANKS;
  ------------------
  |  | 2275|   175k|#define SKIP_BLANKS xmlSkipBlankChars(ctxt)
  ------------------
 7077|   175k|        SHRINK;
  ------------------
  |  | 2267|   175k|    if (!PARSER_PROGRESSIVE(ctxt)) \
  |  |  ------------------
  |  |  |  |   47|   175k|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|   175k|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2267:9): [True: 175k, False: 0]
  |  |  ------------------
  |  | 2268|   175k|	xmlParserShrink(ctxt);
  ------------------
 7078|   175k|        GROW;
  ------------------
  |  | 2271|   175k|    if ((!PARSER_PROGRESSIVE(ctxt)) && \
  |  |  ------------------
  |  |  |  |   47|   175k|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|   175k|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2271:9): [True: 175k, False: 0]
  |  |  ------------------
  |  | 2272|   175k|        (ctxt->input->end - ctxt->input->cur < INPUT_CHUNK)) \
  |  |  ------------------
  |  |  |  |   63|   175k|#define INPUT_CHUNK	250
  |  |  ------------------
  |  |  |  Branch (2272:9): [True: 8.43k, False: 167k]
  |  |  ------------------
  |  | 2273|   175k|	xmlParserGrow(ctxt);
  ------------------
 7079|   175k|    }
 7080|  1.19k|}
xmlParseReference:
 7096|   109k|xmlParseReference(xmlParserCtxt *ctxt) {
 7097|   109k|    xmlEntityPtr ent = NULL;
 7098|   109k|    const xmlChar *name;
 7099|   109k|    xmlChar *val;
 7100|       |
 7101|   109k|    if (RAW != '&')
  ------------------
  |  | 2224|   109k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (7101:9): [True: 0, False: 109k]
  ------------------
 7102|      0|        return;
 7103|       |
 7104|       |    /*
 7105|       |     * Simple case of a CharRef
 7106|       |     */
 7107|   109k|    if (NXT(1) == '#') {
  ------------------
  |  | 2226|   109k|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
  |  Branch (7107:9): [True: 17.4k, False: 92.2k]
  ------------------
 7108|  17.4k|	int i = 0;
 7109|  17.4k|	xmlChar out[16];
 7110|  17.4k|	int value = xmlParseCharRef(ctxt);
 7111|       |
 7112|  17.4k|	if (value == 0)
  ------------------
  |  Branch (7112:6): [True: 4.57k, False: 12.8k]
  ------------------
 7113|  4.57k|	    return;
 7114|       |
 7115|       |        /*
 7116|       |         * Just encode the value in UTF-8
 7117|       |         */
 7118|  12.8k|        COPY_BUF(out, i, value);
  ------------------
  |  | 2296|  12.8k|    if (v < 0x80) b[i++] = v;						\
  |  |  ------------------
  |  |  |  Branch (2296:9): [True: 12.4k, False: 428]
  |  |  ------------------
  |  | 2297|  12.8k|    else i += xmlCopyCharMultiByte(&b[i],v)
  ------------------
 7119|  12.8k|        out[i] = 0;
 7120|  12.8k|        if ((ctxt->sax != NULL) && (ctxt->sax->characters != NULL) &&
  ------------------
  |  Branch (7120:13): [True: 12.8k, False: 0]
  |  Branch (7120:36): [True: 12.8k, False: 0]
  ------------------
 7121|  12.8k|            (!ctxt->disableSAX))
  ------------------
  |  Branch (7121:13): [True: 7.35k, False: 5.48k]
  ------------------
 7122|  7.35k|            ctxt->sax->characters(ctxt->userData, out, i);
 7123|  12.8k|	return;
 7124|  17.4k|    }
 7125|       |
 7126|       |    /*
 7127|       |     * We are seeing an entity reference
 7128|       |     */
 7129|  92.2k|    name = xmlParseEntityRefInternal(ctxt);
 7130|  92.2k|    if (name == NULL)
  ------------------
  |  Branch (7130:9): [True: 17.6k, False: 74.5k]
  ------------------
 7131|  17.6k|        return;
 7132|  74.5k|    ent = xmlLookupGeneralEntity(ctxt, name, /* isAttr */ 0);
 7133|  74.5k|    if (ent == NULL) {
  ------------------
  |  Branch (7133:9): [True: 50.4k, False: 24.0k]
  ------------------
 7134|       |        /*
 7135|       |         * Create a reference for undeclared entities.
 7136|       |         */
 7137|  50.4k|        if ((ctxt->replaceEntities == 0) &&
  ------------------
  |  Branch (7137:13): [True: 44.8k, False: 5.60k]
  ------------------
 7138|  44.8k|            (ctxt->sax != NULL) &&
  ------------------
  |  Branch (7138:13): [True: 44.8k, False: 0]
  ------------------
 7139|  44.8k|            (ctxt->disableSAX == 0) &&
  ------------------
  |  Branch (7139:13): [True: 34.3k, False: 10.5k]
  ------------------
 7140|  34.3k|            (ctxt->sax->reference != NULL)) {
  ------------------
  |  Branch (7140:13): [True: 34.3k, False: 0]
  ------------------
 7141|  34.3k|            ctxt->sax->reference(ctxt->userData, name);
 7142|  34.3k|        }
 7143|  50.4k|        return;
 7144|  50.4k|    }
 7145|  24.0k|    if (!ctxt->wellFormed)
  ------------------
  |  Branch (7145:9): [True: 7.90k, False: 16.1k]
  ------------------
 7146|  7.90k|	return;
 7147|       |
 7148|       |    /* special case of predefined entities */
 7149|  16.1k|    if ((ent->name == NULL) ||
  ------------------
  |  Branch (7149:9): [True: 0, False: 16.1k]
  ------------------
 7150|  16.1k|        (ent->etype == XML_INTERNAL_PREDEFINED_ENTITY)) {
  ------------------
  |  Branch (7150:9): [True: 1.34k, False: 14.8k]
  ------------------
 7151|  1.34k|	val = ent->content;
 7152|  1.34k|	if (val == NULL) return;
  ------------------
  |  Branch (7152:6): [True: 0, False: 1.34k]
  ------------------
 7153|       |	/*
 7154|       |	 * inline the entity.
 7155|       |	 */
 7156|  1.34k|	if ((ctxt->sax != NULL) && (ctxt->sax->characters != NULL) &&
  ------------------
  |  Branch (7156:6): [True: 1.34k, False: 0]
  |  Branch (7156:29): [True: 1.34k, False: 0]
  ------------------
 7157|  1.34k|	    (!ctxt->disableSAX))
  ------------------
  |  Branch (7157:6): [True: 1.34k, False: 0]
  ------------------
 7158|  1.34k|	    ctxt->sax->characters(ctxt->userData, val, xmlStrlen(val));
 7159|  1.34k|	return;
 7160|  1.34k|    }
 7161|       |
 7162|       |    /*
 7163|       |     * Some users try to parse entities on their own and used to set
 7164|       |     * the renamed "checked" member. Fix the flags to cover this
 7165|       |     * case.
 7166|       |     */
 7167|  14.8k|    if (((ent->flags & XML_ENT_PARSED) == 0) && (ent->children != NULL))
  ------------------
  |  |   19|  14.8k|#define XML_ENT_PARSED      (1u << 0)
  ------------------
  |  Branch (7167:9): [True: 3.64k, False: 11.1k]
  |  Branch (7167:49): [True: 0, False: 3.64k]
  ------------------
 7168|      0|        ent->flags |= XML_ENT_PARSED;
  ------------------
  |  |   19|      0|#define XML_ENT_PARSED      (1u << 0)
  ------------------
 7169|       |
 7170|       |    /*
 7171|       |     * The first reference to the entity trigger a parsing phase
 7172|       |     * where the ent->children is filled with the result from
 7173|       |     * the parsing.
 7174|       |     * Note: external parsed entities will not be loaded, it is not
 7175|       |     * required for a non-validating parser, unless the parsing option
 7176|       |     * of validating, or substituting entities were given. Doing so is
 7177|       |     * far more secure as the parser will only process data coming from
 7178|       |     * the document entity by default.
 7179|       |     *
 7180|       |     * FIXME: This doesn't work correctly since entities can be
 7181|       |     * expanded with different namespace declarations in scope.
 7182|       |     * For example:
 7183|       |     *
 7184|       |     * <!DOCTYPE doc [
 7185|       |     *   <!ENTITY ent "<ns:elem/>">
 7186|       |     * ]>
 7187|       |     * <doc>
 7188|       |     *   <decl1 xmlns:ns="urn:ns1">
 7189|       |     *     &ent;
 7190|       |     *   </decl1>
 7191|       |     *   <decl2 xmlns:ns="urn:ns2">
 7192|       |     *     &ent;
 7193|       |     *   </decl2>
 7194|       |     * </doc>
 7195|       |     *
 7196|       |     * Proposed fix:
 7197|       |     *
 7198|       |     * - Ignore current namespace declarations when parsing the
 7199|       |     *   entity. If a prefix can't be resolved, don't report an error
 7200|       |     *   but mark it as unresolved.
 7201|       |     * - Try to resolve these prefixes when expanding the entity.
 7202|       |     *   This will require a specialized version of xmlStaticCopyNode
 7203|       |     *   which can also make use of the namespace hash table to avoid
 7204|       |     *   quadratic behavior.
 7205|       |     *
 7206|       |     * Alternatively, we could simply reparse the entity on each
 7207|       |     * expansion like we already do with custom SAX callbacks.
 7208|       |     * External entity content should be cached in this case.
 7209|       |     */
 7210|  14.8k|    if ((ent->etype == XML_INTERNAL_GENERAL_ENTITY) ||
  ------------------
  |  Branch (7210:9): [True: 7.43k, False: 7.40k]
  ------------------
 7211|  7.40k|        (((ctxt->options & XML_PARSE_NO_XXE) == 0) &&
  ------------------
  |  Branch (7211:10): [True: 7.16k, False: 235]
  ------------------
 7212|  7.16k|         ((ctxt->replaceEntities) ||
  ------------------
  |  Branch (7212:11): [True: 5.28k, False: 1.88k]
  ------------------
 7213|  14.2k|          (ctxt->validate)))) {
  ------------------
  |  Branch (7213:11): [True: 1.47k, False: 403]
  ------------------
 7214|  14.2k|        if ((ent->flags & XML_ENT_PARSED) == 0) {
  ------------------
  |  |   19|  14.2k|#define XML_ENT_PARSED      (1u << 0)
  ------------------
  |  Branch (7214:13): [True: 3.00k, False: 11.1k]
  ------------------
 7215|  3.00k|            xmlCtxtParseEntity(ctxt, ent);
 7216|  11.1k|        } else if (ent->children == NULL) {
  ------------------
  |  Branch (7216:20): [True: 3.22k, False: 7.97k]
  ------------------
 7217|       |            /*
 7218|       |             * Probably running in SAX mode and the callbacks don't
 7219|       |             * build the entity content. Parse the entity again.
 7220|       |             *
 7221|       |             * This will also be triggered in normal tree builder mode
 7222|       |             * if an entity happens to be empty, causing unnecessary
 7223|       |             * reloads. It's hard to come up with a reliable check in
 7224|       |             * which mode we're running.
 7225|       |             */
 7226|  3.22k|            xmlCtxtParseEntity(ctxt, ent);
 7227|  3.22k|        }
 7228|  14.2k|    }
 7229|       |
 7230|       |    /*
 7231|       |     * We also check for amplification if entities aren't substituted.
 7232|       |     * They might be expanded later.
 7233|       |     */
 7234|  14.8k|    if (xmlParserEntityCheck(ctxt, ent->expandedSize))
  ------------------
  |  Branch (7234:9): [True: 34, False: 14.8k]
  ------------------
 7235|     34|        return;
 7236|       |
 7237|  14.8k|    if ((ctxt->sax == NULL) || (ctxt->disableSAX))
  ------------------
  |  Branch (7237:9): [True: 0, False: 14.8k]
  |  Branch (7237:32): [True: 741, False: 14.0k]
  ------------------
 7238|    741|        return;
 7239|       |
 7240|  14.0k|    if (ctxt->replaceEntities == 0) {
  ------------------
  |  Branch (7240:9): [True: 4.98k, False: 9.07k]
  ------------------
 7241|       |	/*
 7242|       |	 * Create a reference
 7243|       |	 */
 7244|  4.98k|        if (ctxt->sax->reference != NULL)
  ------------------
  |  Branch (7244:13): [True: 4.98k, False: 0]
  ------------------
 7245|  4.98k|	    ctxt->sax->reference(ctxt->userData, ent->name);
 7246|  9.07k|    } else if ((ent->children != NULL) && (ctxt->node != NULL)) {
  ------------------
  |  Branch (7246:16): [True: 5.86k, False: 3.21k]
  |  Branch (7246:43): [True: 5.86k, False: 0]
  ------------------
 7247|  5.86k|        xmlNodePtr copy, cur;
 7248|       |
 7249|       |        /*
 7250|       |         * Seems we are generating the DOM content, copy the tree
 7251|       |	 */
 7252|  5.86k|        cur = ent->children;
 7253|       |
 7254|       |        /*
 7255|       |         * Handle first text node with SAX to coalesce text efficiently
 7256|       |         */
 7257|  5.86k|        if ((cur->type == XML_TEXT_NODE) ||
  ------------------
  |  Branch (7257:13): [True: 4.65k, False: 1.21k]
  ------------------
 7258|  4.78k|            (cur->type == XML_CDATA_SECTION_NODE)) {
  ------------------
  |  Branch (7258:13): [True: 139, False: 1.07k]
  ------------------
 7259|  4.78k|            int len = xmlStrlen(cur->content);
 7260|       |
 7261|  4.78k|            if ((cur->type == XML_TEXT_NODE) ||
  ------------------
  |  Branch (7261:17): [True: 4.65k, False: 139]
  ------------------
 7262|  4.65k|                (ctxt->options & XML_PARSE_NOCDATA)) {
  ------------------
  |  Branch (7262:17): [True: 0, False: 139]
  ------------------
 7263|  4.65k|                if (ctxt->sax->characters != NULL)
  ------------------
  |  Branch (7263:21): [True: 4.65k, False: 0]
  ------------------
 7264|  4.65k|                    ctxt->sax->characters(ctxt->userData, cur->content, len);
 7265|  4.65k|            } else {
 7266|    139|                if (ctxt->sax->cdataBlock != NULL)
  ------------------
  |  Branch (7266:21): [True: 139, False: 0]
  ------------------
 7267|    139|                    ctxt->sax->cdataBlock(ctxt->userData, cur->content, len);
 7268|    139|            }
 7269|       |
 7270|  4.78k|            cur = cur->next;
 7271|  4.78k|        }
 7272|       |
 7273|  35.8k|        while (cur != NULL) {
  ------------------
  |  Branch (7273:16): [True: 31.3k, False: 4.49k]
  ------------------
 7274|  31.3k|            xmlNodePtr last;
 7275|       |
 7276|       |            /*
 7277|       |             * Handle last text node with SAX to coalesce text efficiently
 7278|       |             */
 7279|  31.3k|            if ((cur->next == NULL) &&
  ------------------
  |  Branch (7279:17): [True: 2.90k, False: 28.4k]
  ------------------
 7280|  2.90k|                ((cur->type == XML_TEXT_NODE) ||
  ------------------
  |  Branch (7280:18): [True: 1.19k, False: 1.71k]
  ------------------
 7281|  1.71k|                 (cur->type == XML_CDATA_SECTION_NODE))) {
  ------------------
  |  Branch (7281:18): [True: 139, False: 1.57k]
  ------------------
 7282|  1.33k|                int len = xmlStrlen(cur->content);
 7283|       |
 7284|  1.33k|                if ((cur->type == XML_TEXT_NODE) ||
  ------------------
  |  Branch (7284:21): [True: 1.19k, False: 139]
  ------------------
 7285|  1.19k|                    (ctxt->options & XML_PARSE_NOCDATA)) {
  ------------------
  |  Branch (7285:21): [True: 0, False: 139]
  ------------------
 7286|  1.19k|                    if (ctxt->sax->characters != NULL)
  ------------------
  |  Branch (7286:25): [True: 1.19k, False: 0]
  ------------------
 7287|  1.19k|                        ctxt->sax->characters(ctxt->userData, cur->content,
 7288|  1.19k|                                              len);
 7289|  1.19k|                } else {
 7290|    139|                    if (ctxt->sax->cdataBlock != NULL)
  ------------------
  |  Branch (7290:25): [True: 139, False: 0]
  ------------------
 7291|    139|                        ctxt->sax->cdataBlock(ctxt->userData, cur->content,
 7292|    139|                                              len);
 7293|    139|                }
 7294|       |
 7295|  1.33k|                break;
 7296|  1.33k|            }
 7297|       |
 7298|       |            /*
 7299|       |             * Reset coalesce buffer stats only for non-text nodes.
 7300|       |             */
 7301|  30.0k|            ctxt->nodemem = 0;
 7302|  30.0k|            ctxt->nodelen = 0;
 7303|       |
 7304|  30.0k|            copy = xmlDocCopyNode(cur, ctxt->myDoc, 1);
 7305|       |
 7306|  30.0k|            if (copy == NULL) {
  ------------------
  |  Branch (7306:17): [True: 36, False: 29.9k]
  ------------------
 7307|     36|                xmlErrMemory(ctxt);
 7308|     36|                break;
 7309|     36|            }
 7310|       |
 7311|  29.9k|            if (ctxt->parseMode == XML_PARSE_READER) {
  ------------------
  |  Branch (7311:17): [True: 29.3k, False: 633]
  ------------------
 7312|       |                /* Needed for reader */
 7313|  29.3k|                copy->extra = cur->extra;
 7314|       |                /* Maybe needed for reader */
 7315|  29.3k|                copy->_private = cur->_private;
 7316|  29.3k|            }
 7317|       |
 7318|  29.9k|            copy->parent = ctxt->node;
 7319|  29.9k|            last = ctxt->node->last;
 7320|  29.9k|            if (last == NULL) {
  ------------------
  |  Branch (7320:17): [True: 318, False: 29.6k]
  ------------------
 7321|    318|                ctxt->node->children = copy;
 7322|  29.6k|            } else {
 7323|  29.6k|                last->next = copy;
 7324|  29.6k|                copy->prev = last;
 7325|  29.6k|            }
 7326|  29.9k|            ctxt->node->last = copy;
 7327|       |
 7328|  29.9k|            cur = cur->next;
 7329|  29.9k|        }
 7330|  5.86k|    }
 7331|  14.0k|}
xmlParseDocTypeDecl:
 7934|  16.1k|xmlParseDocTypeDecl(xmlParserCtxt *ctxt) {
 7935|  16.1k|    const xmlChar *name = NULL;
 7936|  16.1k|    xmlChar *publicId = NULL;
 7937|  16.1k|    xmlChar *URI = NULL;
 7938|       |
 7939|       |    /*
 7940|       |     * We know that '<!DOCTYPE' has been detected.
 7941|       |     */
 7942|  16.1k|    SKIP(9);
  ------------------
  |  | 2248|  16.1k|#define SKIP(val) do {							\
  |  | 2249|  16.1k|    ctxt->input->cur += (val),ctxt->input->col+=(val);			\
  |  | 2250|  16.1k|    if (*ctxt->input->cur == 0)						\
  |  |  ------------------
  |  |  |  Branch (2250:9): [True: 5, False: 16.1k]
  |  |  ------------------
  |  | 2251|  16.1k|        xmlParserGrow(ctxt);						\
  |  | 2252|  16.1k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2252:12): [Folded, False: 16.1k]
  |  |  ------------------
  ------------------
 7943|       |
 7944|  16.1k|    if (SKIP_BLANKS == 0) {
  ------------------
  |  | 2275|  16.1k|#define SKIP_BLANKS xmlSkipBlankChars(ctxt)
  ------------------
  |  Branch (7944:9): [True: 930, False: 15.2k]
  ------------------
 7945|    930|        xmlFatalErrMsg(ctxt, XML_ERR_SPACE_REQUIRED,
 7946|    930|                       "Space required after 'DOCTYPE'\n");
 7947|    930|    }
 7948|       |
 7949|       |    /*
 7950|       |     * Parse the DOCTYPE name.
 7951|       |     */
 7952|  16.1k|    name = xmlParseName(ctxt);
 7953|  16.1k|    if (name == NULL) {
  ------------------
  |  Branch (7953:9): [True: 758, False: 15.4k]
  ------------------
 7954|    758|	xmlFatalErrMsg(ctxt, XML_ERR_NAME_REQUIRED,
 7955|    758|		       "xmlParseDocTypeDecl : no DOCTYPE name !\n");
 7956|    758|    }
 7957|  16.1k|    ctxt->intSubName = name;
 7958|       |
 7959|  16.1k|    SKIP_BLANKS;
  ------------------
  |  | 2275|  16.1k|#define SKIP_BLANKS xmlSkipBlankChars(ctxt)
  ------------------
 7960|       |
 7961|       |    /*
 7962|       |     * Check for public and system identifier (URI)
 7963|       |     */
 7964|  16.1k|    URI = xmlParseExternalID(ctxt, &publicId, 1);
 7965|       |
 7966|  16.1k|    if ((URI != NULL) || (publicId != NULL)) {
  ------------------
  |  Branch (7966:9): [True: 2.37k, False: 13.7k]
  |  Branch (7966:26): [True: 15, False: 13.7k]
  ------------------
 7967|  2.39k|        ctxt->hasExternalSubset = 1;
 7968|  2.39k|    }
 7969|  16.1k|    ctxt->extSubURI = URI;
 7970|  16.1k|    ctxt->extSubSystem = publicId;
 7971|       |
 7972|  16.1k|    SKIP_BLANKS;
  ------------------
  |  | 2275|  16.1k|#define SKIP_BLANKS xmlSkipBlankChars(ctxt)
  ------------------
 7973|       |
 7974|       |    /*
 7975|       |     * Create and update the internal subset.
 7976|       |     */
 7977|  16.1k|    if ((ctxt->sax != NULL) && (ctxt->sax->internalSubset != NULL) &&
  ------------------
  |  Branch (7977:9): [True: 16.1k, False: 0]
  |  Branch (7977:32): [True: 16.1k, False: 0]
  ------------------
 7978|  16.1k|	(!ctxt->disableSAX))
  ------------------
  |  Branch (7978:2): [True: 16.0k, False: 118]
  ------------------
 7979|  16.0k|	ctxt->sax->internalSubset(ctxt->userData, name, publicId, URI);
 7980|       |
 7981|  16.1k|    if ((RAW != '[') && (RAW != '>')) {
  ------------------
  |  | 2224|  16.1k|#define RAW (*ctxt->input->cur)
  ------------------
                  if ((RAW != '[') && (RAW != '>')) {
  ------------------
  |  | 2224|  4.60k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (7981:9): [True: 4.60k, False: 11.5k]
  |  Branch (7981:25): [True: 201, False: 4.40k]
  ------------------
 7982|       |	xmlFatalErr(ctxt, XML_ERR_DOCTYPE_NOT_FINISHED, NULL);
 7983|    201|    }
 7984|  16.1k|}
xmlParseAttribute:
 8090|   157k|xmlParseAttribute(xmlParserCtxt *ctxt, xmlChar **value) {
 8091|   157k|    const xmlChar *name;
 8092|   157k|    xmlChar *val;
 8093|       |
 8094|   157k|    *value = NULL;
 8095|   157k|    GROW;
  ------------------
  |  | 2271|   157k|    if ((!PARSER_PROGRESSIVE(ctxt)) && \
  |  |  ------------------
  |  |  |  |   47|   157k|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|   157k|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2271:9): [True: 94.0k, False: 62.9k]
  |  |  ------------------
  |  | 2272|   157k|        (ctxt->input->end - ctxt->input->cur < INPUT_CHUNK)) \
  |  |  ------------------
  |  |  |  |   63|  94.0k|#define INPUT_CHUNK	250
  |  |  ------------------
  |  |  |  Branch (2272:9): [True: 8.29k, False: 85.7k]
  |  |  ------------------
  |  | 2273|   157k|	xmlParserGrow(ctxt);
  ------------------
 8096|   157k|    name = xmlParseName(ctxt);
 8097|   157k|    if (name == NULL) {
  ------------------
  |  Branch (8097:9): [True: 49.8k, False: 107k]
  ------------------
 8098|  49.8k|	xmlFatalErrMsg(ctxt, XML_ERR_NAME_REQUIRED,
 8099|  49.8k|	               "error parsing attribute name\n");
 8100|  49.8k|        return(NULL);
 8101|  49.8k|    }
 8102|       |
 8103|       |    /*
 8104|       |     * read the value
 8105|       |     */
 8106|   107k|    SKIP_BLANKS;
  ------------------
  |  | 2275|   107k|#define SKIP_BLANKS xmlSkipBlankChars(ctxt)
  ------------------
 8107|   107k|    if (RAW == '=') {
  ------------------
  |  | 2224|   107k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (8107:9): [True: 95.0k, False: 12.0k]
  ------------------
 8108|  95.0k|        NEXT;
  ------------------
  |  | 2279|  95.0k|#define NEXT xmlNextChar(ctxt)
  ------------------
 8109|  95.0k|	SKIP_BLANKS;
  ------------------
  |  | 2275|  95.0k|#define SKIP_BLANKS xmlSkipBlankChars(ctxt)
  ------------------
 8110|  95.0k|	val = xmlParseAttValue(ctxt);
 8111|  95.0k|    } else {
 8112|  12.0k|	xmlFatalErrMsgStr(ctxt, XML_ERR_ATTRIBUTE_WITHOUT_VALUE,
 8113|  12.0k|	       "Specification mandates value for attribute %s\n", name);
 8114|  12.0k|	return(name);
 8115|  12.0k|    }
 8116|       |
 8117|       |    /*
 8118|       |     * Check that xml:lang conforms to the specification
 8119|       |     * No more registered as an error, just generate a warning now
 8120|       |     * since this was deprecated in XML second edition
 8121|       |     */
 8122|  95.0k|    if ((ctxt->pedantic) && (xmlStrEqual(name, BAD_CAST "xml:lang"))) {
  ------------------
  |  |   34|  43.0k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (8122:9): [True: 43.0k, False: 51.9k]
  |  Branch (8122:29): [True: 9.32k, False: 33.7k]
  ------------------
 8123|  9.32k|	if (!xmlCheckLanguageID(val)) {
  ------------------
  |  Branch (8123:6): [True: 6.20k, False: 3.11k]
  ------------------
 8124|  6.20k|	    xmlWarningMsg(ctxt, XML_WAR_LANG_VALUE,
 8125|  6.20k|		          "Malformed value for xml:lang : %s\n",
 8126|  6.20k|			  val, NULL);
 8127|  6.20k|	}
 8128|  9.32k|    }
 8129|       |
 8130|       |    /*
 8131|       |     * Check that xml:space conforms to the specification
 8132|       |     */
 8133|  95.0k|    if (xmlStrEqual(name, BAD_CAST "xml:space")) {
  ------------------
  |  |   34|  95.0k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (8133:9): [True: 857, False: 94.2k]
  ------------------
 8134|    857|	if (xmlStrEqual(val, BAD_CAST "default"))
  ------------------
  |  |   34|    857|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (8134:6): [True: 188, False: 669]
  ------------------
 8135|    188|	    *(ctxt->space) = 0;
 8136|    669|	else if (xmlStrEqual(val, BAD_CAST "preserve"))
  ------------------
  |  |   34|    669|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (8136:11): [True: 431, False: 238]
  ------------------
 8137|    431|	    *(ctxt->space) = 1;
 8138|    238|	else {
 8139|    238|		xmlWarningMsg(ctxt, XML_WAR_SPACE_VALUE,
 8140|    238|"Invalid value \"%s\" for xml:space : \"default\" or \"preserve\" expected\n",
 8141|    238|                                 val, NULL);
 8142|    238|	}
 8143|    857|    }
 8144|       |
 8145|  95.0k|    *value = val;
 8146|  95.0k|    return(name);
 8147|   107k|}
xmlParseStartTag:
 8177|   300k|xmlParseStartTag(xmlParserCtxt *ctxt) {
 8178|   300k|    const xmlChar *name;
 8179|   300k|    const xmlChar *attname;
 8180|   300k|    xmlChar *attvalue;
 8181|   300k|    const xmlChar **atts = ctxt->atts;
 8182|   300k|    int nbatts = 0;
 8183|   300k|    int maxatts = ctxt->maxatts;
 8184|   300k|    int i;
 8185|       |
 8186|   300k|    if (RAW != '<') return(NULL);
  ------------------
  |  | 2224|   300k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (8186:9): [True: 0, False: 300k]
  ------------------
 8187|   300k|    NEXT1;
  ------------------
  |  | 2281|   300k|#define NEXT1 {								\
  |  | 2282|   300k|	ctxt->input->col++;						\
  |  | 2283|   300k|	ctxt->input->cur++;						\
  |  | 2284|   300k|	if (*ctxt->input->cur == 0)					\
  |  |  ------------------
  |  |  |  Branch (2284:6): [True: 634, False: 299k]
  |  |  ------------------
  |  | 2285|   300k|	    xmlParserGrow(ctxt);						\
  |  | 2286|   300k|    }
  ------------------
 8188|       |
 8189|   300k|    name = xmlParseName(ctxt);
 8190|   300k|    if (name == NULL) {
  ------------------
  |  Branch (8190:9): [True: 14.2k, False: 285k]
  ------------------
 8191|  14.2k|	xmlFatalErrMsg(ctxt, XML_ERR_NAME_REQUIRED,
 8192|  14.2k|	     "xmlParseStartTag: invalid element name\n");
 8193|  14.2k|        return(NULL);
 8194|  14.2k|    }
 8195|       |
 8196|       |    /*
 8197|       |     * Now parse the attributes, it ends up with the ending
 8198|       |     *
 8199|       |     * (S Attribute)* S?
 8200|       |     */
 8201|   285k|    SKIP_BLANKS;
  ------------------
  |  | 2275|   285k|#define SKIP_BLANKS xmlSkipBlankChars(ctxt)
  ------------------
 8202|   285k|    GROW;
  ------------------
  |  | 2271|   285k|    if ((!PARSER_PROGRESSIVE(ctxt)) && \
  |  |  ------------------
  |  |  |  |   47|   285k|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|   285k|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2271:9): [True: 197k, False: 88.0k]
  |  |  ------------------
  |  | 2272|   285k|        (ctxt->input->end - ctxt->input->cur < INPUT_CHUNK)) \
  |  |  ------------------
  |  |  |  |   63|   197k|#define INPUT_CHUNK	250
  |  |  ------------------
  |  |  |  Branch (2272:9): [True: 21.4k, False: 176k]
  |  |  ------------------
  |  | 2273|   285k|	xmlParserGrow(ctxt);
  ------------------
 8203|       |
 8204|   343k|    while (((RAW != '>') &&
  ------------------
  |  | 2224|   343k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (8204:13): [True: 210k, False: 132k]
  ------------------
 8205|   210k|	   ((RAW != '/') || (NXT(1) != '>')) &&
  ------------------
  |  | 2224|   210k|#define RAW (*ctxt->input->cur)
  ------------------
              	   ((RAW != '/') || (NXT(1) != '>')) &&
  ------------------
  |  | 2226|  53.0k|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
  |  Branch (8205:6): [True: 157k, False: 53.0k]
  |  Branch (8205:22): [True: 5.17k, False: 47.8k]
  ------------------
 8206|   162k|	   (IS_BYTE_CHAR(RAW))) && (PARSER_STOPPED(ctxt) == 0)) {
  ------------------
  |  |  103|   162k|#define IS_BYTE_CHAR(c)	 xmlIsChar_ch(c)
  |  |  ------------------
  |  |  |  |  108|   162k|#define xmlIsChar_ch(c)		(((0x9 <= (c)) && ((c) <= 0xa)) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (108:28): [True: 158k, False: 4.39k]
  |  |  |  |  |  Branch (108:44): [True: 0, False: 158k]
  |  |  |  |  ------------------
  |  |  |  |  109|   162k|				 ((c) == 0xd) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (109:6): [True: 0, False: 162k]
  |  |  |  |  ------------------
  |  |  |  |  110|   162k|				  (0x20 <= (c)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (110:7): [True: 157k, False: 5.46k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
              	   (IS_BYTE_CHAR(RAW))) && (PARSER_STOPPED(ctxt) == 0)) {
  ------------------
  |  |   44|   157k|#define PARSER_STOPPED(ctxt) ((ctxt)->disableSAX > 1)
  ------------------
  |  Branch (8206:29): [True: 157k, False: 91]
  ------------------
 8207|   157k|	attname = xmlParseAttribute(ctxt, &attvalue);
 8208|   157k|        if (attname == NULL)
  ------------------
  |  Branch (8208:13): [True: 49.8k, False: 107k]
  ------------------
 8209|  49.8k|	    break;
 8210|   107k|        if (attvalue != NULL) {
  ------------------
  |  Branch (8210:13): [True: 92.1k, False: 14.9k]
  ------------------
 8211|       |	    /*
 8212|       |	     * [ WFC: Unique Att Spec ]
 8213|       |	     * No attribute name may appear more than once in the same
 8214|       |	     * start-tag or empty-element tag.
 8215|       |	     */
 8216|   205k|	    for (i = 0; i < nbatts;i += 2) {
  ------------------
  |  Branch (8216:18): [True: 123k, False: 82.2k]
  ------------------
 8217|   123k|	        if (xmlStrEqual(atts[i], attname)) {
  ------------------
  |  Branch (8217:14): [True: 9.94k, False: 113k]
  ------------------
 8218|  9.94k|		    xmlErrAttributeDup(ctxt, NULL, attname);
 8219|  9.94k|		    goto failed;
 8220|  9.94k|		}
 8221|   123k|	    }
 8222|       |	    /*
 8223|       |	     * Add the pair to atts
 8224|       |	     */
 8225|  82.2k|	    if (nbatts + 4 > maxatts) {
  ------------------
  |  Branch (8225:10): [True: 15.8k, False: 66.3k]
  ------------------
 8226|  15.8k|	        const xmlChar **n;
 8227|  15.8k|                int newSize;
 8228|       |
 8229|  15.8k|                newSize = xmlGrowCapacity(maxatts, sizeof(n[0]) * 2,
 8230|  15.8k|                                          11, XML_MAX_ATTRS);
  ------------------
  |  |   93|  15.8k|#define XML_MAX_ATTRS 100000000 /* 100 million */
  ------------------
 8231|  15.8k|                if (newSize < 0) {
  ------------------
  |  Branch (8231:21): [True: 0, False: 15.8k]
  ------------------
 8232|      0|		    xmlErrMemory(ctxt);
 8233|      0|		    goto failed;
 8234|      0|		}
 8235|  15.8k|#ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
 8236|  15.8k|                if (newSize < 2)
  ------------------
  |  Branch (8236:21): [True: 9.88k, False: 5.95k]
  ------------------
 8237|  9.88k|                    newSize = 2;
 8238|  15.8k|#endif
 8239|  15.8k|	        n = xmlRealloc(atts, newSize * sizeof(n[0]) * 2);
 8240|  15.8k|		if (n == NULL) {
  ------------------
  |  Branch (8240:7): [True: 2, False: 15.8k]
  ------------------
 8241|      2|		    xmlErrMemory(ctxt);
 8242|      2|		    goto failed;
 8243|      2|		}
 8244|  15.8k|		atts = n;
 8245|  15.8k|                maxatts = newSize * 2;
 8246|  15.8k|		ctxt->atts = atts;
 8247|  15.8k|		ctxt->maxatts = maxatts;
 8248|  15.8k|	    }
 8249|       |
 8250|  82.2k|	    atts[nbatts++] = attname;
 8251|  82.2k|	    atts[nbatts++] = attvalue;
 8252|  82.2k|	    atts[nbatts] = NULL;
 8253|  82.2k|	    atts[nbatts + 1] = NULL;
 8254|       |
 8255|  82.2k|            attvalue = NULL;
 8256|  82.2k|	}
 8257|       |
 8258|   107k|failed:
 8259|       |
 8260|   107k|        if (attvalue != NULL)
  ------------------
  |  Branch (8260:13): [True: 9.95k, False: 97.2k]
  ------------------
 8261|  9.95k|            xmlFree(attvalue);
 8262|       |
 8263|   107k|	GROW
  ------------------
  |  | 2271|   107k|    if ((!PARSER_PROGRESSIVE(ctxt)) && \
  |  |  ------------------
  |  |  |  |   47|   107k|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|   107k|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2271:9): [True: 55.4k, False: 51.7k]
  |  |  ------------------
  |  | 2272|   107k|        (ctxt->input->end - ctxt->input->cur < INPUT_CHUNK)) \
  |  |  ------------------
  |  |  |  |   63|  55.4k|#define INPUT_CHUNK	250
  |  |  ------------------
  |  |  |  Branch (2272:9): [True: 7.75k, False: 47.6k]
  |  |  ------------------
  |  | 2273|   107k|	xmlParserGrow(ctxt);
  ------------------
 8264|   107k|	if ((RAW == '>') || (((RAW == '/') && (NXT(1) == '>'))))
  ------------------
  |  | 2224|   107k|#define RAW (*ctxt->input->cur)
  ------------------
              	if ((RAW == '>') || (((RAW == '/') && (NXT(1) == '>'))))
  ------------------
  |  | 2224|  81.8k|#define RAW (*ctxt->input->cur)
  ------------------
              	if ((RAW == '>') || (((RAW == '/') && (NXT(1) == '>'))))
  ------------------
  |  | 2226|  25.3k|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
  |  Branch (8264:6): [True: 25.2k, False: 81.8k]
  |  Branch (8264:24): [True: 25.3k, False: 56.4k]
  |  Branch (8264:40): [True: 24.6k, False: 719]
  ------------------
 8265|  49.9k|	    break;
 8266|  57.1k|	if (SKIP_BLANKS == 0) {
  ------------------
  |  | 2275|  57.1k|#define SKIP_BLANKS xmlSkipBlankChars(ctxt)
  ------------------
  |  Branch (8266:6): [True: 20.1k, False: 37.0k]
  ------------------
 8267|  20.1k|	    xmlFatalErrMsg(ctxt, XML_ERR_SPACE_REQUIRED,
 8268|  20.1k|			   "attributes construct error\n");
 8269|  20.1k|	}
 8270|  57.1k|	SHRINK;
  ------------------
  |  | 2267|  57.1k|    if (!PARSER_PROGRESSIVE(ctxt)) \
  |  |  ------------------
  |  |  |  |   47|  57.1k|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|  57.1k|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2267:9): [True: 25.1k, False: 32.0k]
  |  |  ------------------
  |  | 2268|  57.1k|	xmlParserShrink(ctxt);
  ------------------
 8271|  57.1k|        GROW;
  ------------------
  |  | 2271|  57.1k|    if ((!PARSER_PROGRESSIVE(ctxt)) && \
  |  |  ------------------
  |  |  |  |   47|  57.1k|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|  57.1k|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2271:9): [True: 25.1k, False: 32.0k]
  |  |  ------------------
  |  | 2272|  57.1k|        (ctxt->input->end - ctxt->input->cur < INPUT_CHUNK)) \
  |  |  ------------------
  |  |  |  |   63|  25.1k|#define INPUT_CHUNK	250
  |  |  ------------------
  |  |  |  Branch (2272:9): [True: 4.18k, False: 20.9k]
  |  |  ------------------
  |  | 2273|  57.1k|	xmlParserGrow(ctxt);
  ------------------
 8272|  57.1k|    }
 8273|       |
 8274|       |    /*
 8275|       |     * SAX: Start of Element !
 8276|       |     */
 8277|   285k|    if ((ctxt->sax != NULL) && (ctxt->sax->startElement != NULL) &&
  ------------------
  |  Branch (8277:9): [True: 285k, False: 0]
  |  Branch (8277:32): [True: 285k, False: 0]
  ------------------
 8278|   285k|	(!ctxt->disableSAX)) {
  ------------------
  |  Branch (8278:2): [True: 228k, False: 57.3k]
  ------------------
 8279|   228k|	if (nbatts > 0)
  ------------------
  |  Branch (8279:6): [True: 52.0k, False: 176k]
  ------------------
 8280|  52.0k|	    ctxt->sax->startElement(ctxt->userData, name, atts);
 8281|   176k|	else
 8282|   176k|	    ctxt->sax->startElement(ctxt->userData, name, NULL);
 8283|   228k|    }
 8284|       |
 8285|   285k|    if (atts != NULL) {
  ------------------
  |  Branch (8285:9): [True: 217k, False: 68.6k]
  ------------------
 8286|       |        /* Free only the content strings */
 8287|   299k|        for (i = 1;i < nbatts;i+=2)
  ------------------
  |  Branch (8287:20): [True: 82.2k, False: 217k]
  ------------------
 8288|  82.2k|	    if (atts[i] != NULL)
  ------------------
  |  Branch (8288:10): [True: 82.2k, False: 0]
  ------------------
 8289|  82.2k|	       xmlFree((xmlChar *) atts[i]);
 8290|   217k|    }
 8291|   285k|    return(name);
 8292|   285k|}
xmlParseCDSect:
 9443|  35.9k|xmlParseCDSect(xmlParserCtxt *ctxt) {
 9444|  35.9k|    xmlChar *buf = NULL;
 9445|  35.9k|    int len = 0;
 9446|  35.9k|    int size = XML_PARSER_BUFFER_SIZE;
  ------------------
  |  |  172|  35.9k|#define XML_PARSER_BUFFER_SIZE 100
  ------------------
 9447|  35.9k|    int r, rl;
 9448|  35.9k|    int	s, sl;
 9449|  35.9k|    int cur, l;
 9450|  35.9k|    int maxLength = (ctxt->options & XML_PARSE_HUGE) ?
  ------------------
  |  Branch (9450:21): [True: 11.2k, False: 24.7k]
  ------------------
 9451|  11.2k|                    XML_MAX_HUGE_LENGTH :
  ------------------
  |  |   55|  11.2k|#define XML_MAX_HUGE_LENGTH 1000000000
  ------------------
 9452|  35.9k|                    XML_MAX_TEXT_LENGTH;
  ------------------
  |  |   50|  24.7k|#define XML_MAX_TEXT_LENGTH 10000000
  ------------------
 9453|       |
 9454|  35.9k|    if ((CUR != '<') || (NXT(1) != '!') || (NXT(2) != '['))
  ------------------
  |  | 2225|  35.9k|#define CUR (*ctxt->input->cur)
  ------------------
                  if ((CUR != '<') || (NXT(1) != '!') || (NXT(2) != '['))
  ------------------
  |  | 2226|  35.9k|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
                  if ((CUR != '<') || (NXT(1) != '!') || (NXT(2) != '['))
  ------------------
  |  | 2226|  35.9k|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
  |  Branch (9454:9): [True: 0, False: 35.9k]
  |  Branch (9454:25): [True: 0, False: 35.9k]
  |  Branch (9454:44): [True: 0, False: 35.9k]
  ------------------
 9455|      0|        return;
 9456|  35.9k|    SKIP(3);
  ------------------
  |  | 2248|  35.9k|#define SKIP(val) do {							\
  |  | 2249|  35.9k|    ctxt->input->cur += (val),ctxt->input->col+=(val);			\
  |  | 2250|  35.9k|    if (*ctxt->input->cur == 0)						\
  |  |  ------------------
  |  |  |  Branch (2250:9): [True: 0, False: 35.9k]
  |  |  ------------------
  |  | 2251|  35.9k|        xmlParserGrow(ctxt);						\
  |  | 2252|  35.9k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2252:12): [Folded, False: 35.9k]
  |  |  ------------------
  ------------------
 9457|       |
 9458|  35.9k|    if (!CMP6(CUR_PTR, 'C', 'D', 'A', 'T', 'A', '['))
  ------------------
  |  | 2236|  35.9k|  ( CMP5( s, c1, c2, c3, c4, c5 ) && ((unsigned char *) s)[ 5 ] == c6 )
  |  |  ------------------
  |  |  |  | 2234|  71.9k|  ( CMP4( s, c1, c2, c3, c4 ) && ((unsigned char *) s)[ 4 ] == c5 )
  |  |  |  |  ------------------
  |  |  |  |  |  | 2231|  71.9k|  ( ((unsigned char *) s)[ 0 ] == c1 && ((unsigned char *) s)[ 1 ] == c2 && \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (2231:5): [True: 35.9k, False: 0]
  |  |  |  |  |  |  |  Branch (2231:41): [True: 35.9k, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 2232|  35.9k|    ((unsigned char *) s)[ 2 ] == c3 && ((unsigned char *) s)[ 3 ] == c4 )
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (2232:5): [True: 35.9k, False: 0]
  |  |  |  |  |  |  |  Branch (2232:41): [True: 35.9k, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2234:34): [True: 35.9k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2236:38): [True: 35.9k, False: 0]
  |  |  ------------------
  ------------------
 9459|      0|        return;
 9460|  35.9k|    SKIP(6);
  ------------------
  |  | 2248|  35.9k|#define SKIP(val) do {							\
  |  | 2249|  35.9k|    ctxt->input->cur += (val),ctxt->input->col+=(val);			\
  |  | 2250|  35.9k|    if (*ctxt->input->cur == 0)						\
  |  |  ------------------
  |  |  |  Branch (2250:9): [True: 64, False: 35.9k]
  |  |  ------------------
  |  | 2251|  35.9k|        xmlParserGrow(ctxt);						\
  |  | 2252|  35.9k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2252:12): [Folded, False: 35.9k]
  |  |  ------------------
  ------------------
 9461|       |
 9462|  35.9k|    r = xmlCurrentCharRecover(ctxt, &rl);
 9463|  35.9k|    if (!IS_CHAR(r)) {
  ------------------
  |  |  115|  35.9k|#define IS_CHAR(c)   xmlIsCharQ(c)
  |  |  ------------------
  |  |  |  |  117|  35.9k|#define xmlIsCharQ(c)		(((c) < 0x100) ? \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (117:25): [True: 33.1k, False: 2.88k]
  |  |  |  |  ------------------
  |  |  |  |  118|  35.9k|				 xmlIsChar_ch((c)) :\
  |  |  |  |  ------------------
  |  |  |  |  |  |  108|  33.1k|#define xmlIsChar_ch(c)		(((0x9 <= (c)) && ((c) <= 0xa)) || \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (108:28): [True: 32.9k, False: 202]
  |  |  |  |  |  |  |  Branch (108:44): [True: 1.06k, False: 31.8k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  109|  33.1k|				 ((c) == 0xd) || \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (109:6): [True: 0, False: 32.0k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  110|  33.1k|				  (0x20 <= (c)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (110:7): [True: 31.6k, False: 351]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  119|  35.9k|				(((0x100 <= (c)) && ((c) <= 0xd7ff)) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (119:7): [True: 2.88k, False: 0]
  |  |  |  |  |  Branch (119:25): [True: 1.27k, False: 1.61k]
  |  |  |  |  ------------------
  |  |  |  |  120|  2.88k|				 ((0xe000 <= (c)) && ((c) <= 0xfffd)) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (120:7): [True: 1.61k, False: 0]
  |  |  |  |  |  Branch (120:26): [True: 982, False: 631]
  |  |  |  |  ------------------
  |  |  |  |  121|  2.88k|				 ((0x10000 <= (c)) && ((c) <= 0x10ffff))))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (121:7): [True: 561, False: 70]
  |  |  |  |  |  Branch (121:27): [True: 561, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (9463:9): [True: 421, False: 35.5k]
  ------------------
 9464|    421|	xmlFatalErr(ctxt, XML_ERR_CDATA_NOT_FINISHED, NULL);
 9465|    421|        goto out;
 9466|    421|    }
 9467|  35.5k|    NEXTL(rl);
  ------------------
  |  | 2288|  35.5k|#define NEXTL(l) do {							\
  |  | 2289|  35.5k|    if (*(ctxt->input->cur) == '\n') {					\
  |  |  ------------------
  |  |  |  Branch (2289:9): [True: 1.04k, False: 34.5k]
  |  |  ------------------
  |  | 2290|  1.04k|	ctxt->input->line++; ctxt->input->col = 1;			\
  |  | 2291|  34.5k|    } else ctxt->input->col++;						\
  |  | 2292|  35.5k|    ctxt->input->cur += l;				\
  |  | 2293|  35.5k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2293:12): [Folded, False: 35.5k]
  |  |  ------------------
  ------------------
 9468|  35.5k|    s = xmlCurrentCharRecover(ctxt, &sl);
 9469|  35.5k|    if (!IS_CHAR(s)) {
  ------------------
  |  |  115|  35.5k|#define IS_CHAR(c)   xmlIsCharQ(c)
  |  |  ------------------
  |  |  |  |  117|  35.5k|#define xmlIsCharQ(c)		(((c) < 0x100) ? \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (117:25): [True: 33.5k, False: 1.99k]
  |  |  |  |  ------------------
  |  |  |  |  118|  35.5k|				 xmlIsChar_ch((c)) :\
  |  |  |  |  ------------------
  |  |  |  |  |  |  108|  33.5k|#define xmlIsChar_ch(c)		(((0x9 <= (c)) && ((c) <= 0xa)) || \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (108:28): [True: 30.7k, False: 2.82k]
  |  |  |  |  |  |  |  Branch (108:44): [True: 320, False: 30.4k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  109|  33.5k|				 ((c) == 0xd) || \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (109:6): [True: 0, False: 33.2k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  110|  33.5k|				  (0x20 <= (c)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (110:7): [True: 30.2k, False: 2.96k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  119|  35.5k|				(((0x100 <= (c)) && ((c) <= 0xd7ff)) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (119:7): [True: 1.99k, False: 0]
  |  |  |  |  |  Branch (119:25): [True: 291, False: 1.70k]
  |  |  |  |  ------------------
  |  |  |  |  120|  1.99k|				 ((0xe000 <= (c)) && ((c) <= 0xfffd)) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (120:7): [True: 1.70k, False: 0]
  |  |  |  |  |  Branch (120:26): [True: 1.32k, False: 379]
  |  |  |  |  ------------------
  |  |  |  |  121|  1.99k|				 ((0x10000 <= (c)) && ((c) <= 0x10ffff))))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (121:7): [True: 202, False: 177]
  |  |  |  |  |  Branch (121:27): [True: 202, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (9469:9): [True: 3.14k, False: 32.4k]
  ------------------
 9470|  3.14k|	xmlFatalErr(ctxt, XML_ERR_CDATA_NOT_FINISHED, NULL);
 9471|  3.14k|        goto out;
 9472|  3.14k|    }
 9473|  32.4k|    NEXTL(sl);
  ------------------
  |  | 2288|  32.4k|#define NEXTL(l) do {							\
  |  | 2289|  32.4k|    if (*(ctxt->input->cur) == '\n') {					\
  |  |  ------------------
  |  |  |  Branch (2289:9): [True: 301, False: 32.1k]
  |  |  ------------------
  |  | 2290|    301|	ctxt->input->line++; ctxt->input->col = 1;			\
  |  | 2291|  32.1k|    } else ctxt->input->col++;						\
  |  | 2292|  32.4k|    ctxt->input->cur += l;				\
  |  | 2293|  32.4k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2293:12): [Folded, False: 32.4k]
  |  |  ------------------
  ------------------
 9474|  32.4k|    cur = xmlCurrentCharRecover(ctxt, &l);
 9475|  32.4k|    buf = xmlMalloc(size);
 9476|  32.4k|    if (buf == NULL) {
  ------------------
  |  Branch (9476:9): [True: 3, False: 32.4k]
  ------------------
 9477|      3|	xmlErrMemory(ctxt);
 9478|      3|        goto out;
 9479|      3|    }
 9480|  1.06M|    while (IS_CHAR(cur) &&
  ------------------
  |  |  115|  1.06M|#define IS_CHAR(c)   xmlIsCharQ(c)
  |  |  ------------------
  |  |  |  |  117|  2.12M|#define xmlIsCharQ(c)		(((c) < 0x100) ? \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (117:24): [True: 1.05M, False: 3.94k]
  |  |  |  |  |  Branch (117:25): [True: 1.01M, False: 44.0k]
  |  |  |  |  ------------------
  |  |  |  |  118|  2.12M|				 xmlIsChar_ch((c)) :\
  |  |  |  |  ------------------
  |  |  |  |  |  |  108|  1.01M|#define xmlIsChar_ch(c)		(((0x9 <= (c)) && ((c) <= 0xa)) || \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (108:28): [True: 1.01M, False: 2.16k]
  |  |  |  |  |  |  |  Branch (108:44): [True: 3.17k, False: 1.01M]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  109|  1.01M|				 ((c) == 0xd) || \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (109:6): [True: 0, False: 1.01M]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  110|  1.01M|				  (0x20 <= (c)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (110:7): [True: 1.00M, False: 3.72k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  119|  2.12M|				(((0x100 <= (c)) && ((c) <= 0xd7ff)) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (119:7): [True: 44.0k, False: 0]
  |  |  |  |  |  Branch (119:25): [True: 1.58k, False: 42.4k]
  |  |  |  |  ------------------
  |  |  |  |  120|  44.0k|				 ((0xe000 <= (c)) && ((c) <= 0xfffd)) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (120:7): [True: 42.4k, False: 0]
  |  |  |  |  |  Branch (120:26): [True: 41.7k, False: 706]
  |  |  |  |  ------------------
  |  |  |  |  121|  44.0k|				 ((0x10000 <= (c)) && ((c) <= 0x10ffff))))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (121:7): [True: 483, False: 223]
  |  |  |  |  |  Branch (121:27): [True: 483, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 9481|  1.05M|           ((r != ']') || (s != ']') || (cur != '>'))) {
  ------------------
  |  Branch (9481:13): [True: 969k, False: 87.4k]
  |  Branch (9481:27): [True: 2.41k, False: 85.0k]
  |  Branch (9481:41): [True: 56.5k, False: 28.4k]
  ------------------
 9482|  1.02M|	if (len + 5 >= size) {
  ------------------
  |  Branch (9482:6): [True: 1.47k, False: 1.02M]
  ------------------
 9483|  1.47k|	    xmlChar *tmp;
 9484|  1.47k|            int newSize;
 9485|       |
 9486|  1.47k|            newSize = xmlGrowCapacity(size, 1, 1, maxLength);
 9487|  1.47k|            if (newSize < 0) {
  ------------------
  |  Branch (9487:17): [True: 0, False: 1.47k]
  ------------------
 9488|      0|                xmlFatalErrMsg(ctxt, XML_ERR_CDATA_NOT_FINISHED,
 9489|      0|                               "CData section too big found\n");
 9490|      0|                goto out;
 9491|      0|            }
 9492|  1.47k|	    tmp = xmlRealloc(buf, newSize);
 9493|  1.47k|	    if (tmp == NULL) {
  ------------------
  |  Branch (9493:10): [True: 1, False: 1.47k]
  ------------------
 9494|      1|		xmlErrMemory(ctxt);
 9495|      1|                goto out;
 9496|      1|	    }
 9497|  1.47k|	    buf = tmp;
 9498|  1.47k|	    size = newSize;
 9499|  1.47k|	}
 9500|  1.02M|	COPY_BUF(buf, len, r);
  ------------------
  |  | 2296|  1.02M|    if (v < 0x80) b[i++] = v;						\
  |  |  ------------------
  |  |  |  Branch (2296:9): [True: 193k, False: 834k]
  |  |  ------------------
  |  | 2297|  1.02M|    else i += xmlCopyCharMultiByte(&b[i],v)
  ------------------
 9501|  1.02M|	r = s;
 9502|  1.02M|	rl = sl;
 9503|  1.02M|	s = cur;
 9504|  1.02M|	sl = l;
 9505|  1.02M|	NEXTL(l);
  ------------------
  |  | 2288|  1.02M|#define NEXTL(l) do {							\
  |  | 2289|  1.02M|    if (*(ctxt->input->cur) == '\n') {					\
  |  |  ------------------
  |  |  |  Branch (2289:9): [True: 2.70k, False: 1.02M]
  |  |  ------------------
  |  | 2290|  2.70k|	ctxt->input->line++; ctxt->input->col = 1;			\
  |  | 2291|  1.02M|    } else ctxt->input->col++;						\
  |  | 2292|  1.02M|    ctxt->input->cur += l;				\
  |  | 2293|  1.02M|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2293:12): [Folded, False: 1.02M]
  |  |  ------------------
  ------------------
 9506|  1.02M|	cur = xmlCurrentCharRecover(ctxt, &l);
 9507|  1.02M|    }
 9508|  32.4k|    buf[len] = 0;
 9509|  32.4k|    if (cur != '>') {
  ------------------
  |  Branch (9509:9): [True: 3.94k, False: 28.4k]
  ------------------
 9510|  3.94k|	xmlFatalErrMsgStr(ctxt, XML_ERR_CDATA_NOT_FINISHED,
 9511|  3.94k|	                     "CData section not finished\n%.50s\n", buf);
 9512|  3.94k|        goto out;
 9513|  3.94k|    }
 9514|  28.4k|    NEXTL(l);
  ------------------
  |  | 2288|  28.4k|#define NEXTL(l) do {							\
  |  | 2289|  28.4k|    if (*(ctxt->input->cur) == '\n') {					\
  |  |  ------------------
  |  |  |  Branch (2289:9): [True: 0, False: 28.4k]
  |  |  ------------------
  |  | 2290|      0|	ctxt->input->line++; ctxt->input->col = 1;			\
  |  | 2291|  28.4k|    } else ctxt->input->col++;						\
  |  | 2292|  28.4k|    ctxt->input->cur += l;				\
  |  | 2293|  28.4k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2293:12): [Folded, False: 28.4k]
  |  |  ------------------
  ------------------
 9515|       |
 9516|       |    /*
 9517|       |     * OK the buffer is to be consumed as cdata.
 9518|       |     */
 9519|  28.4k|    if ((ctxt->sax != NULL) && (!ctxt->disableSAX)) {
  ------------------
  |  Branch (9519:9): [True: 28.4k, False: 0]
  |  Branch (9519:32): [True: 28.2k, False: 272]
  ------------------
 9520|  28.2k|        if ((ctxt->sax->cdataBlock != NULL) &&
  ------------------
  |  Branch (9520:13): [True: 28.2k, False: 0]
  ------------------
 9521|  28.2k|            ((ctxt->options & XML_PARSE_NOCDATA) == 0)) {
  ------------------
  |  Branch (9521:13): [True: 25.9k, False: 2.27k]
  ------------------
 9522|  25.9k|            ctxt->sax->cdataBlock(ctxt->userData, buf, len);
 9523|  25.9k|        } else if (ctxt->sax->characters != NULL) {
  ------------------
  |  Branch (9523:20): [True: 2.27k, False: 0]
  ------------------
 9524|  2.27k|            ctxt->sax->characters(ctxt->userData, buf, len);
 9525|  2.27k|        }
 9526|  28.2k|    }
 9527|       |
 9528|  35.9k|out:
 9529|  35.9k|    xmlFree(buf);
 9530|  35.9k|}
xmlParseElement:
 9670|  6.63k|xmlParseElement(xmlParserCtxt *ctxt) {
 9671|  6.63k|    if (xmlParseElementStart(ctxt) != 0)
  ------------------
  |  Branch (9671:9): [True: 2.68k, False: 3.95k]
  ------------------
 9672|  2.68k|        return;
 9673|       |
 9674|  3.95k|    xmlParseContentInternal(ctxt);
 9675|       |
 9676|  3.95k|    if (ctxt->input->cur >= ctxt->input->end) {
  ------------------
  |  Branch (9676:9): [True: 421, False: 3.53k]
  ------------------
 9677|    421|        if (ctxt->wellFormed) {
  ------------------
  |  Branch (9677:13): [True: 2, False: 419]
  ------------------
 9678|      2|            const xmlChar *name = ctxt->nameTab[ctxt->nameNr - 1];
 9679|      2|            int line = ctxt->pushTab[ctxt->nameNr - 1].line;
 9680|      2|            xmlFatalErrMsgStrIntStr(ctxt, XML_ERR_TAG_NOT_FINISHED,
 9681|      2|                    "Premature end of data in tag %s line %d\n",
 9682|      2|                    name, line, NULL);
 9683|      2|        }
 9684|    421|        return;
 9685|    421|    }
 9686|       |
 9687|  3.53k|    xmlParseElementEnd(ctxt);
 9688|  3.53k|}
xmlParseVersionNum:
 9868|  10.7k|xmlParseVersionNum(xmlParserCtxt *ctxt) {
 9869|  10.7k|    xmlChar *buf = NULL;
 9870|  10.7k|    int len = 0;
 9871|  10.7k|    int size = 10;
 9872|  10.7k|    int maxLength = (ctxt->options & XML_PARSE_HUGE) ?
  ------------------
  |  Branch (9872:21): [True: 3.33k, False: 7.37k]
  ------------------
 9873|  3.33k|                    XML_MAX_TEXT_LENGTH :
  ------------------
  |  |   50|  3.33k|#define XML_MAX_TEXT_LENGTH 10000000
  ------------------
 9874|  10.7k|                    XML_MAX_NAME_LENGTH;
  ------------------
  |  |   65|  7.37k|#define XML_MAX_NAME_LENGTH 50000
  ------------------
 9875|  10.7k|    xmlChar cur;
 9876|       |
 9877|  10.7k|    buf = xmlMalloc(size);
 9878|  10.7k|    if (buf == NULL) {
  ------------------
  |  Branch (9878:9): [True: 2, False: 10.7k]
  ------------------
 9879|      2|	xmlErrMemory(ctxt);
 9880|      2|	return(NULL);
 9881|      2|    }
 9882|  10.7k|    cur = CUR;
  ------------------
  |  | 2225|  10.7k|#define CUR (*ctxt->input->cur)
  ------------------
 9883|  10.7k|    if (!((cur >= '0') && (cur <= '9'))) {
  ------------------
  |  Branch (9883:11): [True: 10.4k, False: 211]
  |  Branch (9883:27): [True: 10.3k, False: 171]
  ------------------
 9884|    382|	xmlFree(buf);
 9885|    382|	return(NULL);
 9886|    382|    }
 9887|  10.3k|    buf[len++] = cur;
 9888|  10.3k|    NEXT;
  ------------------
  |  | 2279|  10.3k|#define NEXT xmlNextChar(ctxt)
  ------------------
 9889|  10.3k|    cur=CUR;
  ------------------
  |  | 2225|  10.3k|#define CUR (*ctxt->input->cur)
  ------------------
 9890|  10.3k|    if (cur != '.') {
  ------------------
  |  Branch (9890:9): [True: 2.44k, False: 7.88k]
  ------------------
 9891|  2.44k|	xmlFree(buf);
 9892|  2.44k|	return(NULL);
 9893|  2.44k|    }
 9894|  7.88k|    buf[len++] = cur;
 9895|  7.88k|    NEXT;
  ------------------
  |  | 2279|  7.88k|#define NEXT xmlNextChar(ctxt)
  ------------------
 9896|  7.88k|    cur=CUR;
  ------------------
  |  | 2225|  7.88k|#define CUR (*ctxt->input->cur)
  ------------------
 9897|   104k|    while ((cur >= '0') && (cur <= '9')) {
  ------------------
  |  Branch (9897:12): [True: 96.6k, False: 7.70k]
  |  Branch (9897:28): [True: 96.4k, False: 172]
  ------------------
 9898|  96.4k|	if (len + 1 >= size) {
  ------------------
  |  Branch (9898:6): [True: 359, False: 96.1k]
  ------------------
 9899|    359|	    xmlChar *tmp;
 9900|    359|            int newSize;
 9901|       |
 9902|    359|            newSize = xmlGrowCapacity(size, 1, 1, maxLength);
 9903|    359|            if (newSize < 0) {
  ------------------
  |  Branch (9903:17): [True: 1, False: 358]
  ------------------
 9904|      1|                xmlFatalErr(ctxt, XML_ERR_NAME_TOO_LONG, "VersionNum");
 9905|      1|                xmlFree(buf);
 9906|      1|                return(NULL);
 9907|      1|            }
 9908|    358|	    tmp = xmlRealloc(buf, newSize);
 9909|    358|	    if (tmp == NULL) {
  ------------------
  |  Branch (9909:10): [True: 1, False: 357]
  ------------------
 9910|      1|		xmlErrMemory(ctxt);
 9911|      1|	        xmlFree(buf);
 9912|      1|		return(NULL);
 9913|      1|	    }
 9914|    357|	    buf = tmp;
 9915|    357|            size = newSize;
 9916|    357|	}
 9917|  96.4k|	buf[len++] = cur;
 9918|  96.4k|	NEXT;
  ------------------
  |  | 2279|  96.4k|#define NEXT xmlNextChar(ctxt)
  ------------------
 9919|  96.4k|	cur=CUR;
  ------------------
  |  | 2225|  96.4k|#define CUR (*ctxt->input->cur)
  ------------------
 9920|  96.4k|    }
 9921|  7.88k|    buf[len] = 0;
 9922|  7.88k|    return(buf);
 9923|  7.88k|}
xmlParseVersionInfo:
 9939|   168k|xmlParseVersionInfo(xmlParserCtxt *ctxt) {
 9940|   168k|    xmlChar *version = NULL;
 9941|       |
 9942|   168k|    if (CMP7(CUR_PTR, 'v', 'e', 'r', 's', 'i', 'o', 'n')) {
  ------------------
  |  | 2238|   168k|  ( CMP6( s, c1, c2, c3, c4, c5, c6 ) && ((unsigned char *) s)[ 6 ] == c7 )
  |  |  ------------------
  |  |  |  | 2236|   336k|  ( CMP5( s, c1, c2, c3, c4, c5 ) && ((unsigned char *) s)[ 5 ] == c6 )
  |  |  |  |  ------------------
  |  |  |  |  |  | 2234|   336k|  ( CMP4( s, c1, c2, c3, c4 ) && ((unsigned char *) s)[ 4 ] == c5 )
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  | 2231|   336k|  ( ((unsigned char *) s)[ 0 ] == c1 && ((unsigned char *) s)[ 1 ] == c2 && \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (2231:5): [True: 14.0k, False: 154k]
  |  |  |  |  |  |  |  |  |  Branch (2231:41): [True: 13.7k, False: 241]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  | 2232|   168k|    ((unsigned char *) s)[ 2 ] == c3 && ((unsigned char *) s)[ 3 ] == c4 )
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (2232:5): [True: 13.0k, False: 686]
  |  |  |  |  |  |  |  |  |  Branch (2232:41): [True: 12.8k, False: 235]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (2234:34): [True: 12.3k, False: 535]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2236:38): [True: 11.8k, False: 445]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2238:42): [True: 11.5k, False: 295]
  |  |  ------------------
  ------------------
 9943|  11.5k|	SKIP(7);
  ------------------
  |  | 2248|  11.5k|#define SKIP(val) do {							\
  |  | 2249|  11.5k|    ctxt->input->cur += (val),ctxt->input->col+=(val);			\
  |  | 2250|  11.5k|    if (*ctxt->input->cur == 0)						\
  |  |  ------------------
  |  |  |  Branch (2250:9): [True: 246, False: 11.3k]
  |  |  ------------------
  |  | 2251|  11.5k|        xmlParserGrow(ctxt);						\
  |  | 2252|  11.5k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2252:12): [Folded, False: 11.5k]
  |  |  ------------------
  ------------------
 9944|  11.5k|	SKIP_BLANKS;
  ------------------
  |  | 2275|  11.5k|#define SKIP_BLANKS xmlSkipBlankChars(ctxt)
  ------------------
 9945|  11.5k|	if (RAW != '=') {
  ------------------
  |  | 2224|  11.5k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (9945:6): [True: 501, False: 11.0k]
  ------------------
 9946|    501|	    xmlFatalErr(ctxt, XML_ERR_EQUAL_REQUIRED, NULL);
 9947|    501|	    return(NULL);
 9948|    501|        }
 9949|  11.0k|	NEXT;
  ------------------
  |  | 2279|  11.0k|#define NEXT xmlNextChar(ctxt)
  ------------------
 9950|  11.0k|	SKIP_BLANKS;
  ------------------
  |  | 2275|  11.0k|#define SKIP_BLANKS xmlSkipBlankChars(ctxt)
  ------------------
 9951|  11.0k|	if (RAW == '"') {
  ------------------
  |  | 2224|  11.0k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (9951:6): [True: 2.60k, False: 8.47k]
  ------------------
 9952|  2.60k|	    NEXT;
  ------------------
  |  | 2279|  2.60k|#define NEXT xmlNextChar(ctxt)
  ------------------
 9953|  2.60k|	    version = xmlParseVersionNum(ctxt);
 9954|  2.60k|	    if (RAW != '"') {
  ------------------
  |  | 2224|  2.60k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (9954:10): [True: 157, False: 2.45k]
  ------------------
 9955|    157|		xmlFatalErr(ctxt, XML_ERR_STRING_NOT_CLOSED, NULL);
 9956|    157|	    } else
 9957|  2.45k|	        NEXT;
  ------------------
  |  | 2279|  2.45k|#define NEXT xmlNextChar(ctxt)
  ------------------
 9958|  8.47k|	} else if (RAW == '\''){
  ------------------
  |  | 2224|  8.47k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (9958:13): [True: 8.10k, False: 373]
  ------------------
 9959|  8.10k|	    NEXT;
  ------------------
  |  | 2279|  8.10k|#define NEXT xmlNextChar(ctxt)
  ------------------
 9960|  8.10k|	    version = xmlParseVersionNum(ctxt);
 9961|  8.10k|	    if (RAW != '\'') {
  ------------------
  |  | 2224|  8.10k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (9961:10): [True: 2.89k, False: 5.20k]
  ------------------
 9962|  2.89k|		xmlFatalErr(ctxt, XML_ERR_STRING_NOT_CLOSED, NULL);
 9963|  2.89k|	    } else
 9964|  5.20k|	        NEXT;
  ------------------
  |  | 2279|  5.20k|#define NEXT xmlNextChar(ctxt)
  ------------------
 9965|  8.10k|	} else {
 9966|    373|	    xmlFatalErr(ctxt, XML_ERR_STRING_NOT_STARTED, NULL);
 9967|    373|	}
 9968|  11.0k|    }
 9969|   167k|    return(version);
 9970|   168k|}
xmlParseEncName:
 9983|  5.58k|xmlParseEncName(xmlParserCtxt *ctxt) {
 9984|  5.58k|    xmlChar *buf = NULL;
 9985|  5.58k|    int len = 0;
 9986|  5.58k|    int size = 10;
 9987|  5.58k|    int maxLength = (ctxt->options & XML_PARSE_HUGE) ?
  ------------------
  |  Branch (9987:21): [True: 1.77k, False: 3.80k]
  ------------------
 9988|  1.77k|                    XML_MAX_TEXT_LENGTH :
  ------------------
  |  |   50|  1.77k|#define XML_MAX_TEXT_LENGTH 10000000
  ------------------
 9989|  5.58k|                    XML_MAX_NAME_LENGTH;
  ------------------
  |  |   65|  3.80k|#define XML_MAX_NAME_LENGTH 50000
  ------------------
 9990|  5.58k|    xmlChar cur;
 9991|       |
 9992|  5.58k|    cur = CUR;
  ------------------
  |  | 2225|  5.58k|#define CUR (*ctxt->input->cur)
  ------------------
 9993|  5.58k|    if (((cur >= 'a') && (cur <= 'z')) ||
  ------------------
  |  Branch (9993:10): [True: 664, False: 4.91k]
  |  Branch (9993:26): [True: 453, False: 211]
  ------------------
 9994|  5.16k|        ((cur >= 'A') && (cur <= 'Z'))) {
  ------------------
  |  Branch (9994:10): [True: 4.92k, False: 203]
  |  Branch (9994:26): [True: 4.71k, False: 211]
  ------------------
 9995|  5.16k|	buf = xmlMalloc(size);
 9996|  5.16k|	if (buf == NULL) {
  ------------------
  |  Branch (9996:6): [True: 2, False: 5.16k]
  ------------------
 9997|      2|	    xmlErrMemory(ctxt);
 9998|      2|	    return(NULL);
 9999|      2|	}
10000|       |
10001|  5.16k|	buf[len++] = cur;
10002|  5.16k|	NEXT;
  ------------------
  |  | 2279|  5.16k|#define NEXT xmlNextChar(ctxt)
  ------------------
10003|  5.16k|	cur = CUR;
  ------------------
  |  | 2225|  5.16k|#define CUR (*ctxt->input->cur)
  ------------------
10004|   159k|	while (((cur >= 'a') && (cur <= 'z')) ||
  ------------------
  |  Branch (10004:10): [True: 119k, False: 40.2k]
  |  Branch (10004:26): [True: 119k, False: 188]
  ------------------
10005|  40.3k|	       ((cur >= 'A') && (cur <= 'Z')) ||
  ------------------
  |  Branch (10005:10): [True: 12.8k, False: 27.4k]
  |  Branch (10005:26): [True: 12.4k, False: 406]
  ------------------
10006|  27.9k|	       ((cur >= '0') && (cur <= '9')) ||
  ------------------
  |  Branch (10006:10): [True: 16.1k, False: 11.7k]
  |  Branch (10006:26): [True: 15.7k, False: 431]
  ------------------
10007|  12.1k|	       (cur == '.') || (cur == '_') ||
  ------------------
  |  Branch (10007:9): [True: 324, False: 11.8k]
  |  Branch (10007:25): [True: 216, False: 11.6k]
  ------------------
10008|   154k|	       (cur == '-')) {
  ------------------
  |  Branch (10008:9): [True: 6.47k, False: 5.16k]
  ------------------
10009|   154k|	    if (len + 1 >= size) {
  ------------------
  |  Branch (10009:10): [True: 3.09k, False: 151k]
  ------------------
10010|  3.09k|	        xmlChar *tmp;
10011|  3.09k|                int newSize;
10012|       |
10013|  3.09k|                newSize = xmlGrowCapacity(size, 1, 1, maxLength);
10014|  3.09k|                if (newSize < 0) {
  ------------------
  |  Branch (10014:21): [True: 1, False: 3.09k]
  ------------------
10015|      1|                    xmlFatalErr(ctxt, XML_ERR_NAME_TOO_LONG, "EncName");
10016|      1|                    xmlFree(buf);
10017|      1|                    return(NULL);
10018|      1|                }
10019|  3.09k|		tmp = xmlRealloc(buf, newSize);
10020|  3.09k|		if (tmp == NULL) {
  ------------------
  |  Branch (10020:7): [True: 2, False: 3.09k]
  ------------------
10021|      2|		    xmlErrMemory(ctxt);
10022|      2|		    xmlFree(buf);
10023|      2|		    return(NULL);
10024|      2|		}
10025|  3.09k|		buf = tmp;
10026|  3.09k|                size = newSize;
10027|  3.09k|	    }
10028|   154k|	    buf[len++] = cur;
10029|   154k|	    NEXT;
  ------------------
  |  | 2279|   154k|#define NEXT xmlNextChar(ctxt)
  ------------------
10030|   154k|	    cur = CUR;
  ------------------
  |  | 2225|   154k|#define CUR (*ctxt->input->cur)
  ------------------
10031|   154k|        }
10032|  5.16k|	buf[len] = 0;
10033|  5.16k|    } else {
10034|    414|	xmlFatalErr(ctxt, XML_ERR_ENCODING_NAME, NULL);
10035|    414|    }
10036|  5.57k|    return(buf);
10037|  5.58k|}
xmlParseEncodingDecl:
10054|   166k|xmlParseEncodingDecl(xmlParserCtxt *ctxt) {
10055|   166k|    xmlChar *encoding = NULL;
10056|       |
10057|   166k|    SKIP_BLANKS;
  ------------------
  |  | 2275|   166k|#define SKIP_BLANKS xmlSkipBlankChars(ctxt)
  ------------------
10058|   166k|    if (CMP8(CUR_PTR, 'e', 'n', 'c', 'o', 'd', 'i', 'n', 'g') == 0)
  ------------------
  |  | 2240|   166k|  ( CMP7( s, c1, c2, c3, c4, c5, c6, c7 ) && ((unsigned char *) s)[ 7 ] == c8 )
  |  |  ------------------
  |  |  |  | 2238|   333k|  ( CMP6( s, c1, c2, c3, c4, c5, c6 ) && ((unsigned char *) s)[ 6 ] == c7 )
  |  |  |  |  ------------------
  |  |  |  |  |  | 2236|   333k|  ( CMP5( s, c1, c2, c3, c4, c5 ) && ((unsigned char *) s)[ 5 ] == c6 )
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  | 2234|   333k|  ( CMP4( s, c1, c2, c3, c4 ) && ((unsigned char *) s)[ 4 ] == c5 )
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  | 2231|   333k|  ( ((unsigned char *) s)[ 0 ] == c1 && ((unsigned char *) s)[ 1 ] == c2 && \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (2231:5): [True: 8.63k, False: 158k]
  |  |  |  |  |  |  |  |  |  |  |  Branch (2231:41): [True: 8.28k, False: 349]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  | 2232|   166k|    ((unsigned char *) s)[ 2 ] == c3 && ((unsigned char *) s)[ 3 ] == c4 )
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (2232:5): [True: 7.94k, False: 345]
  |  |  |  |  |  |  |  |  |  |  |  Branch (2232:41): [True: 7.65k, False: 283]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (2234:34): [True: 7.19k, False: 460]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (2236:38): [True: 6.85k, False: 345]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2238:42): [True: 6.50k, False: 348]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2240:46): [True: 6.22k, False: 277]
  |  |  ------------------
  ------------------
  |  Branch (10058:9): [True: 160k, False: 6.22k]
  ------------------
10059|   160k|        return(NULL);
10060|       |
10061|  6.22k|    SKIP(8);
  ------------------
  |  | 2248|  6.22k|#define SKIP(val) do {							\
  |  | 2249|  6.22k|    ctxt->input->cur += (val),ctxt->input->col+=(val);			\
  |  | 2250|  6.22k|    if (*ctxt->input->cur == 0)						\
  |  |  ------------------
  |  |  |  Branch (2250:9): [True: 233, False: 5.99k]
  |  |  ------------------
  |  | 2251|  6.22k|        xmlParserGrow(ctxt);						\
  |  | 2252|  6.22k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2252:12): [Folded, False: 6.22k]
  |  |  ------------------
  ------------------
10062|  6.22k|    SKIP_BLANKS;
  ------------------
  |  | 2275|  6.22k|#define SKIP_BLANKS xmlSkipBlankChars(ctxt)
  ------------------
10063|  6.22k|    if (RAW != '=') {
  ------------------
  |  | 2224|  6.22k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (10063:9): [True: 259, False: 5.97k]
  ------------------
10064|    259|        xmlFatalErr(ctxt, XML_ERR_EQUAL_REQUIRED, NULL);
10065|    259|        return(NULL);
10066|    259|    }
10067|  5.97k|    NEXT;
  ------------------
  |  | 2279|  5.97k|#define NEXT xmlNextChar(ctxt)
  ------------------
10068|  5.97k|    SKIP_BLANKS;
  ------------------
  |  | 2275|  5.97k|#define SKIP_BLANKS xmlSkipBlankChars(ctxt)
  ------------------
10069|  5.97k|    if (RAW == '"') {
  ------------------
  |  | 2224|  5.97k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (10069:9): [True: 1.28k, False: 4.68k]
  ------------------
10070|  1.28k|        NEXT;
  ------------------
  |  | 2279|  1.28k|#define NEXT xmlNextChar(ctxt)
  ------------------
10071|  1.28k|        encoding = xmlParseEncName(ctxt);
10072|  1.28k|        if (RAW != '"') {
  ------------------
  |  | 2224|  1.28k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (10072:13): [True: 350, False: 931]
  ------------------
10073|    350|            xmlFatalErr(ctxt, XML_ERR_STRING_NOT_CLOSED, NULL);
10074|    350|            xmlFree(encoding);
10075|    350|            return(NULL);
10076|    350|        } else
10077|    931|            NEXT;
  ------------------
  |  | 2279|    931|#define NEXT xmlNextChar(ctxt)
  ------------------
10078|  4.68k|    } else if (RAW == '\''){
  ------------------
  |  | 2224|  4.68k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (10078:16): [True: 4.30k, False: 387]
  ------------------
10079|  4.30k|        NEXT;
  ------------------
  |  | 2279|  4.30k|#define NEXT xmlNextChar(ctxt)
  ------------------
10080|  4.30k|        encoding = xmlParseEncName(ctxt);
10081|  4.30k|        if (RAW != '\'') {
  ------------------
  |  | 2224|  4.30k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (10081:13): [True: 341, False: 3.96k]
  ------------------
10082|    341|            xmlFatalErr(ctxt, XML_ERR_STRING_NOT_CLOSED, NULL);
10083|    341|            xmlFree(encoding);
10084|    341|            return(NULL);
10085|    341|        } else
10086|  3.96k|            NEXT;
  ------------------
  |  | 2279|  3.96k|#define NEXT xmlNextChar(ctxt)
  ------------------
10087|  4.30k|    } else {
10088|    387|        xmlFatalErr(ctxt, XML_ERR_STRING_NOT_STARTED, NULL);
10089|    387|    }
10090|       |
10091|  5.27k|    if (encoding == NULL)
  ------------------
  |  Branch (10091:9): [True: 398, False: 4.88k]
  ------------------
10092|    398|        return(NULL);
10093|       |
10094|  4.88k|    xmlSetDeclaredEncoding(ctxt, encoding);
10095|       |
10096|  4.88k|    return(ctxt->encoding);
10097|  5.27k|}
xmlParseSDDecl:
10131|  1.09k|xmlParseSDDecl(xmlParserCtxt *ctxt) {
10132|  1.09k|    int standalone = -2;
10133|       |
10134|  1.09k|    SKIP_BLANKS;
  ------------------
  |  | 2275|  1.09k|#define SKIP_BLANKS xmlSkipBlankChars(ctxt)
  ------------------
10135|  1.09k|    if (CMP10(CUR_PTR, 's', 't', 'a', 'n', 'd', 'a', 'l', 'o', 'n', 'e')) {
  ------------------
  |  | 2245|  1.09k|  ( CMP9( s, c1, c2, c3, c4, c5, c6, c7, c8, c9 ) && \
  |  |  ------------------
  |  |  |  | 2242|  2.18k|  ( CMP8( s, c1, c2, c3, c4, c5, c6, c7, c8 ) && \
  |  |  |  |  ------------------
  |  |  |  |  |  | 2240|  2.18k|  ( CMP7( s, c1, c2, c3, c4, c5, c6, c7 ) && ((unsigned char *) s)[ 7 ] == c8 )
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  | 2238|  2.18k|  ( CMP6( s, c1, c2, c3, c4, c5, c6 ) && ((unsigned char *) s)[ 6 ] == c7 )
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  | 2236|  2.18k|  ( CMP5( s, c1, c2, c3, c4, c5 ) && ((unsigned char *) s)[ 5 ] == c6 )
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  | 2234|  2.18k|  ( CMP4( s, c1, c2, c3, c4 ) && ((unsigned char *) s)[ 4 ] == c5 )
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  | 2231|  2.18k|  ( ((unsigned char *) s)[ 0 ] == c1 && ((unsigned char *) s)[ 1 ] == c2 && \
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  Branch (2231:5): [True: 270, False: 822]
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  Branch (2231:41): [True: 267, False: 3]
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  | 2232|  1.09k|    ((unsigned char *) s)[ 2 ] == c3 && ((unsigned char *) s)[ 3 ] == c4 )
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  Branch (2232:5): [True: 261, False: 6]
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  Branch (2232:41): [True: 260, False: 1]
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  Branch (2234:34): [True: 259, False: 1]
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (2236:38): [True: 258, False: 1]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (2238:42): [True: 257, False: 1]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (2240:46): [True: 254, False: 3]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 2243|  2.18k|    ((unsigned char *) s)[ 8 ] == c9 )
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2243:5): [True: 246, False: 8]
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 2246|  1.09k|    ((unsigned char *) s)[ 9 ] == c10 )
  |  |  ------------------
  |  |  |  Branch (2246:5): [True: 244, False: 2]
  |  |  ------------------
  ------------------
10136|    244|	SKIP(10);
  ------------------
  |  | 2248|    244|#define SKIP(val) do {							\
  |  | 2249|    244|    ctxt->input->cur += (val),ctxt->input->col+=(val);			\
  |  | 2250|    244|    if (*ctxt->input->cur == 0)						\
  |  |  ------------------
  |  |  |  Branch (2250:9): [True: 1, False: 243]
  |  |  ------------------
  |  | 2251|    244|        xmlParserGrow(ctxt);						\
  |  | 2252|    244|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2252:12): [Folded, False: 244]
  |  |  ------------------
  ------------------
10137|    244|        SKIP_BLANKS;
  ------------------
  |  | 2275|    244|#define SKIP_BLANKS xmlSkipBlankChars(ctxt)
  ------------------
10138|    244|	if (RAW != '=') {
  ------------------
  |  | 2224|    244|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (10138:6): [True: 3, False: 241]
  ------------------
10139|      3|	    xmlFatalErr(ctxt, XML_ERR_EQUAL_REQUIRED, NULL);
10140|      3|	    return(standalone);
10141|      3|        }
10142|    241|	NEXT;
  ------------------
  |  | 2279|    241|#define NEXT xmlNextChar(ctxt)
  ------------------
10143|    241|	SKIP_BLANKS;
  ------------------
  |  | 2275|    241|#define SKIP_BLANKS xmlSkipBlankChars(ctxt)
  ------------------
10144|    241|        if (RAW == '\''){
  ------------------
  |  | 2224|    241|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (10144:13): [True: 231, False: 10]
  ------------------
10145|    231|	    NEXT;
  ------------------
  |  | 2279|    231|#define NEXT xmlNextChar(ctxt)
  ------------------
10146|    231|	    if ((RAW == 'n') && (NXT(1) == 'o')) {
  ------------------
  |  | 2224|    231|#define RAW (*ctxt->input->cur)
  ------------------
              	    if ((RAW == 'n') && (NXT(1) == 'o')) {
  ------------------
  |  | 2226|      6|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
  |  Branch (10146:10): [True: 6, False: 225]
  |  Branch (10146:26): [True: 5, False: 1]
  ------------------
10147|      5|	        standalone = 0;
10148|      5|                SKIP(2);
  ------------------
  |  | 2248|      5|#define SKIP(val) do {							\
  |  | 2249|      5|    ctxt->input->cur += (val),ctxt->input->col+=(val);			\
  |  | 2250|      5|    if (*ctxt->input->cur == 0)						\
  |  |  ------------------
  |  |  |  Branch (2250:9): [True: 1, False: 4]
  |  |  ------------------
  |  | 2251|      5|        xmlParserGrow(ctxt);						\
  |  | 2252|      5|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2252:12): [Folded, False: 5]
  |  |  ------------------
  ------------------
10149|    226|	    } else if ((RAW == 'y') && (NXT(1) == 'e') &&
  ------------------
  |  | 2224|    226|#define RAW (*ctxt->input->cur)
  ------------------
              	    } else if ((RAW == 'y') && (NXT(1) == 'e') &&
  ------------------
  |  | 2226|    221|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
  |  Branch (10149:17): [True: 221, False: 5]
  |  Branch (10149:33): [True: 220, False: 1]
  ------------------
10150|    220|	               (NXT(2) == 's')) {
  ------------------
  |  | 2226|    220|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
  |  Branch (10150:17): [True: 219, False: 1]
  ------------------
10151|    219|	        standalone = 1;
10152|    219|		SKIP(3);
  ------------------
  |  | 2248|    219|#define SKIP(val) do {							\
  |  | 2249|    219|    ctxt->input->cur += (val),ctxt->input->col+=(val);			\
  |  | 2250|    219|    if (*ctxt->input->cur == 0)						\
  |  |  ------------------
  |  |  |  Branch (2250:9): [True: 1, False: 218]
  |  |  ------------------
  |  | 2251|    219|        xmlParserGrow(ctxt);						\
  |  | 2252|    219|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2252:12): [Folded, False: 219]
  |  |  ------------------
  ------------------
10153|    219|            } else {
10154|      7|		xmlFatalErr(ctxt, XML_ERR_STANDALONE_VALUE, NULL);
10155|      7|	    }
10156|    231|	    if (RAW != '\'') {
  ------------------
  |  | 2224|    231|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (10156:10): [True: 17, False: 214]
  ------------------
10157|     17|		xmlFatalErr(ctxt, XML_ERR_STRING_NOT_CLOSED, NULL);
10158|     17|	    } else
10159|    214|	        NEXT;
  ------------------
  |  | 2279|    214|#define NEXT xmlNextChar(ctxt)
  ------------------
10160|    231|	} else if (RAW == '"'){
  ------------------
  |  | 2224|     10|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (10160:13): [True: 9, False: 1]
  ------------------
10161|      9|	    NEXT;
  ------------------
  |  | 2279|      9|#define NEXT xmlNextChar(ctxt)
  ------------------
10162|      9|	    if ((RAW == 'n') && (NXT(1) == 'o')) {
  ------------------
  |  | 2224|      9|#define RAW (*ctxt->input->cur)
  ------------------
              	    if ((RAW == 'n') && (NXT(1) == 'o')) {
  ------------------
  |  | 2226|      4|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
  |  Branch (10162:10): [True: 4, False: 5]
  |  Branch (10162:26): [True: 2, False: 2]
  ------------------
10163|      2|	        standalone = 0;
10164|      2|		SKIP(2);
  ------------------
  |  | 2248|      2|#define SKIP(val) do {							\
  |  | 2249|      2|    ctxt->input->cur += (val),ctxt->input->col+=(val);			\
  |  | 2250|      2|    if (*ctxt->input->cur == 0)						\
  |  |  ------------------
  |  |  |  Branch (2250:9): [True: 1, False: 1]
  |  |  ------------------
  |  | 2251|      2|        xmlParserGrow(ctxt);						\
  |  | 2252|      2|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2252:12): [Folded, False: 2]
  |  |  ------------------
  ------------------
10165|      7|	    } else if ((RAW == 'y') && (NXT(1) == 'e') &&
  ------------------
  |  | 2224|      7|#define RAW (*ctxt->input->cur)
  ------------------
              	    } else if ((RAW == 'y') && (NXT(1) == 'e') &&
  ------------------
  |  | 2226|      4|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
  |  Branch (10165:17): [True: 4, False: 3]
  |  Branch (10165:33): [True: 3, False: 1]
  ------------------
10166|      3|	               (NXT(2) == 's')) {
  ------------------
  |  | 2226|      3|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
  |  Branch (10166:17): [True: 2, False: 1]
  ------------------
10167|      2|	        standalone = 1;
10168|      2|                SKIP(3);
  ------------------
  |  | 2248|      2|#define SKIP(val) do {							\
  |  | 2249|      2|    ctxt->input->cur += (val),ctxt->input->col+=(val);			\
  |  | 2250|      2|    if (*ctxt->input->cur == 0)						\
  |  |  ------------------
  |  |  |  Branch (2250:9): [True: 1, False: 1]
  |  |  ------------------
  |  | 2251|      2|        xmlParserGrow(ctxt);						\
  |  | 2252|      2|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2252:12): [Folded, False: 2]
  |  |  ------------------
  ------------------
10169|      5|            } else {
10170|      5|		xmlFatalErr(ctxt, XML_ERR_STANDALONE_VALUE, NULL);
10171|      5|	    }
10172|      9|	    if (RAW != '"') {
  ------------------
  |  | 2224|      9|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (10172:10): [True: 7, False: 2]
  ------------------
10173|      7|		xmlFatalErr(ctxt, XML_ERR_STRING_NOT_CLOSED, NULL);
10174|      7|	    } else
10175|      2|	        NEXT;
  ------------------
  |  | 2279|      2|#define NEXT xmlNextChar(ctxt)
  ------------------
10176|      9|	} else {
10177|      1|	    xmlFatalErr(ctxt, XML_ERR_STRING_NOT_STARTED, NULL);
10178|      1|        }
10179|    241|    }
10180|  1.08k|    return(standalone);
10181|  1.09k|}
xmlParseXMLDecl:
10193|  3.04k|xmlParseXMLDecl(xmlParserCtxt *ctxt) {
10194|  3.04k|    xmlChar *version;
10195|       |
10196|       |    /*
10197|       |     * This value for standalone indicates that the document has an
10198|       |     * XML declaration but it does not have a standalone attribute.
10199|       |     * It will be overwritten later if a standalone attribute is found.
10200|       |     */
10201|       |
10202|  3.04k|    ctxt->standalone = -2;
10203|       |
10204|       |    /*
10205|       |     * We know that '<?xml' is here.
10206|       |     */
10207|  3.04k|    SKIP(5);
  ------------------
  |  | 2248|  3.04k|#define SKIP(val) do {							\
  |  | 2249|  3.04k|    ctxt->input->cur += (val),ctxt->input->col+=(val);			\
  |  | 2250|  3.04k|    if (*ctxt->input->cur == 0)						\
  |  |  ------------------
  |  |  |  Branch (2250:9): [True: 0, False: 3.04k]
  |  |  ------------------
  |  | 2251|  3.04k|        xmlParserGrow(ctxt);						\
  |  | 2252|  3.04k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2252:12): [Folded, False: 3.04k]
  |  |  ------------------
  ------------------
10208|       |
10209|  3.04k|    if (!IS_BLANK_CH(RAW)) {
  ------------------
  |  |  137|  3.04k|#define IS_BLANK_CH(c)  xmlIsBlank_ch(c)
  |  |  ------------------
  |  |  |  |   90|  3.04k|#define xmlIsBlank_ch(c)	(((c) == 0x20) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (90:27): [True: 3.01k, False: 32]
  |  |  |  |  ------------------
  |  |  |  |   91|  3.04k|				 ((0x9 <= (c)) && ((c) <= 0xa)) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (91:7): [True: 32, False: 0]
  |  |  |  |  |  Branch (91:23): [True: 23, False: 9]
  |  |  |  |  ------------------
  |  |  |  |   92|  3.04k|				 ((c) == 0xd))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (92:6): [True: 9, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
10210|      0|	xmlFatalErrMsg(ctxt, XML_ERR_SPACE_REQUIRED,
10211|      0|	               "Blank needed after '<?xml'\n");
10212|      0|    }
10213|  3.04k|    SKIP_BLANKS;
  ------------------
  |  | 2275|  3.04k|#define SKIP_BLANKS xmlSkipBlankChars(ctxt)
  ------------------
10214|       |
10215|       |    /*
10216|       |     * We must have the VersionInfo here.
10217|       |     */
10218|  3.04k|    version = xmlParseVersionInfo(ctxt);
10219|  3.04k|    if (version == NULL) {
  ------------------
  |  Branch (10219:9): [True: 737, False: 2.31k]
  ------------------
10220|    737|	xmlFatalErr(ctxt, XML_ERR_VERSION_MISSING, NULL);
10221|  2.31k|    } else {
10222|  2.31k|	if (!xmlStrEqual(version, (const xmlChar *) XML_DEFAULT_VERSION)) {
  ------------------
  |  |   42|  2.31k|#define XML_DEFAULT_VERSION	"1.0"
  ------------------
  |  Branch (10222:6): [True: 191, False: 2.12k]
  ------------------
10223|       |	    /*
10224|       |	     * Changed here for XML-1.0 5th edition
10225|       |	     */
10226|    191|	    if (ctxt->options & XML_PARSE_OLD10) {
  ------------------
  |  Branch (10226:10): [True: 28, False: 163]
  ------------------
10227|     28|		xmlFatalErrMsgStr(ctxt, XML_ERR_UNKNOWN_VERSION,
10228|     28|			          "Unsupported version '%s'\n",
10229|     28|			          version);
10230|    163|	    } else {
10231|    163|	        if ((version[0] == '1') && ((version[1] == '.'))) {
  ------------------
  |  Branch (10231:14): [True: 122, False: 41]
  |  Branch (10231:37): [True: 122, False: 0]
  ------------------
10232|    122|		    xmlWarningMsg(ctxt, XML_WAR_UNKNOWN_VERSION,
10233|    122|		                  "Unsupported version '%s'\n",
10234|    122|				  version, NULL);
10235|    122|		} else {
10236|     41|		    xmlFatalErrMsgStr(ctxt, XML_ERR_UNKNOWN_VERSION,
10237|     41|				      "Unsupported version '%s'\n",
10238|     41|				      version);
10239|     41|		}
10240|    163|	    }
10241|    191|	}
10242|  2.31k|	if (ctxt->version != NULL)
  ------------------
  |  Branch (10242:6): [True: 0, False: 2.31k]
  ------------------
10243|      0|	    xmlFree(ctxt->version);
10244|  2.31k|	ctxt->version = version;
10245|  2.31k|    }
10246|       |
10247|       |    /*
10248|       |     * We may have the encoding declaration
10249|       |     */
10250|  3.04k|    if (!IS_BLANK_CH(RAW)) {
  ------------------
  |  |  137|  3.04k|#define IS_BLANK_CH(c)  xmlIsBlank_ch(c)
  |  |  ------------------
  |  |  |  |   90|  3.04k|#define xmlIsBlank_ch(c)	(((c) == 0x20) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (90:27): [True: 998, False: 2.05k]
  |  |  |  |  ------------------
  |  |  |  |   91|  3.04k|				 ((0x9 <= (c)) && ((c) <= 0xa)) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (91:7): [True: 2.03k, False: 19]
  |  |  |  |  |  Branch (91:23): [True: 4, False: 2.02k]
  |  |  |  |  ------------------
  |  |  |  |   92|  3.04k|				 ((c) == 0xd))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (92:6): [True: 10, False: 2.03k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
10251|  2.03k|        if ((RAW == '?') && (NXT(1) == '>')) {
  ------------------
  |  | 2224|  2.03k|#define RAW (*ctxt->input->cur)
  ------------------
                      if ((RAW == '?') && (NXT(1) == '>')) {
  ------------------
  |  | 2226|  1.29k|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
  |  Branch (10251:13): [True: 1.29k, False: 746]
  |  Branch (10251:29): [True: 1.27k, False: 18]
  ------------------
10252|  1.27k|	    SKIP(2);
  ------------------
  |  | 2248|  1.27k|#define SKIP(val) do {							\
  |  | 2249|  1.27k|    ctxt->input->cur += (val),ctxt->input->col+=(val);			\
  |  | 2250|  1.27k|    if (*ctxt->input->cur == 0)						\
  |  |  ------------------
  |  |  |  Branch (2250:9): [True: 1, False: 1.27k]
  |  |  ------------------
  |  | 2251|  1.27k|        xmlParserGrow(ctxt);						\
  |  | 2252|  1.27k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2252:12): [Folded, False: 1.27k]
  |  |  ------------------
  ------------------
10253|  1.27k|	    return;
10254|  1.27k|	}
10255|    764|	xmlFatalErrMsg(ctxt, XML_ERR_SPACE_REQUIRED, "Blank needed here\n");
10256|    764|    }
10257|  1.77k|    xmlParseEncodingDecl(ctxt);
10258|       |
10259|       |    /*
10260|       |     * We may have the standalone status.
10261|       |     */
10262|  1.77k|    if ((ctxt->encoding != NULL) && (!IS_BLANK_CH(RAW))) {
  ------------------
  |  |  137|    807|#define IS_BLANK_CH(c)  xmlIsBlank_ch(c)
  |  |  ------------------
  |  |  |  |   90|    807|#define xmlIsBlank_ch(c)	(((c) == 0x20) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (90:27): [True: 43, False: 764]
  |  |  |  |  ------------------
  |  |  |  |   91|    807|				 ((0x9 <= (c)) && ((c) <= 0xa)) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (91:7): [True: 756, False: 8]
  |  |  |  |  |  Branch (91:23): [True: 11, False: 745]
  |  |  |  |  ------------------
  |  |  |  |   92|    807|				 ((c) == 0xd))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (92:6): [True: 4, False: 749]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (10262:9): [True: 807, False: 969]
  ------------------
10263|    749|        if ((RAW == '?') && (NXT(1) == '>')) {
  ------------------
  |  | 2224|    749|#define RAW (*ctxt->input->cur)
  ------------------
                      if ((RAW == '?') && (NXT(1) == '>')) {
  ------------------
  |  | 2226|    698|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
  |  Branch (10263:13): [True: 698, False: 51]
  |  Branch (10263:29): [True: 684, False: 14]
  ------------------
10264|    684|	    SKIP(2);
  ------------------
  |  | 2248|    684|#define SKIP(val) do {							\
  |  | 2249|    684|    ctxt->input->cur += (val),ctxt->input->col+=(val);			\
  |  | 2250|    684|    if (*ctxt->input->cur == 0)						\
  |  |  ------------------
  |  |  |  Branch (2250:9): [True: 1, False: 683]
  |  |  ------------------
  |  | 2251|    684|        xmlParserGrow(ctxt);						\
  |  | 2252|    684|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2252:12): [Folded, False: 684]
  |  |  ------------------
  ------------------
10265|    684|	    return;
10266|    684|	}
10267|     65|	xmlFatalErrMsg(ctxt, XML_ERR_SPACE_REQUIRED, "Blank needed here\n");
10268|     65|    }
10269|       |
10270|       |    /*
10271|       |     * We can grow the input buffer freely at that point
10272|       |     */
10273|  1.09k|    GROW;
  ------------------
  |  | 2271|  1.09k|    if ((!PARSER_PROGRESSIVE(ctxt)) && \
  |  |  ------------------
  |  |  |  |   47|  1.09k|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|  1.09k|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2271:9): [True: 43, False: 1.04k]
  |  |  ------------------
  |  | 2272|  1.09k|        (ctxt->input->end - ctxt->input->cur < INPUT_CHUNK)) \
  |  |  ------------------
  |  |  |  |   63|     43|#define INPUT_CHUNK	250
  |  |  ------------------
  |  |  |  Branch (2272:9): [True: 26, False: 17]
  |  |  ------------------
  |  | 2273|  1.09k|	xmlParserGrow(ctxt);
  ------------------
10274|       |
10275|  1.09k|    SKIP_BLANKS;
  ------------------
  |  | 2275|  1.09k|#define SKIP_BLANKS xmlSkipBlankChars(ctxt)
  ------------------
10276|  1.09k|    ctxt->standalone = xmlParseSDDecl(ctxt);
10277|       |
10278|  1.09k|    SKIP_BLANKS;
  ------------------
  |  | 2275|  1.09k|#define SKIP_BLANKS xmlSkipBlankChars(ctxt)
  ------------------
10279|  1.09k|    if ((RAW == '?') && (NXT(1) == '>')) {
  ------------------
  |  | 2224|  1.09k|#define RAW (*ctxt->input->cur)
  ------------------
                  if ((RAW == '?') && (NXT(1) == '>')) {
  ------------------
  |  | 2226|    311|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
  |  Branch (10279:9): [True: 311, False: 781]
  |  Branch (10279:25): [True: 276, False: 35]
  ------------------
10280|    276|        SKIP(2);
  ------------------
  |  | 2248|    276|#define SKIP(val) do {							\
  |  | 2249|    276|    ctxt->input->cur += (val),ctxt->input->col+=(val);			\
  |  | 2250|    276|    if (*ctxt->input->cur == 0)						\
  |  |  ------------------
  |  |  |  Branch (2250:9): [True: 1, False: 275]
  |  |  ------------------
  |  | 2251|    276|        xmlParserGrow(ctxt);						\
  |  | 2252|    276|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2252:12): [Folded, False: 276]
  |  |  ------------------
  ------------------
10281|    816|    } else if (RAW == '>') {
  ------------------
  |  | 2224|    816|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (10281:16): [True: 25, False: 791]
  ------------------
10282|       |        /* Deprecated old WD ... */
10283|     25|	xmlFatalErr(ctxt, XML_ERR_XMLDECL_NOT_FINISHED, NULL);
10284|     25|	NEXT;
  ------------------
  |  | 2279|     25|#define NEXT xmlNextChar(ctxt)
  ------------------
10285|    791|    } else {
10286|    791|        int c;
10287|       |
10288|    791|	xmlFatalErr(ctxt, XML_ERR_XMLDECL_NOT_FINISHED, NULL);
10289|  99.4k|        while ((PARSER_STOPPED(ctxt) == 0) &&
  ------------------
  |  |   44|  99.4k|#define PARSER_STOPPED(ctxt) ((ctxt)->disableSAX > 1)
  ------------------
  |  Branch (10289:16): [True: 99.4k, False: 41]
  ------------------
10290|  99.4k|               ((c = CUR) != 0)) {
  ------------------
  |  | 2225|  99.4k|#define CUR (*ctxt->input->cur)
  ------------------
  |  Branch (10290:16): [True: 99.1k, False: 321]
  ------------------
10291|  99.1k|            NEXT;
  ------------------
  |  | 2279|  99.1k|#define NEXT xmlNextChar(ctxt)
  ------------------
10292|  99.1k|            if (c == '>')
  ------------------
  |  Branch (10292:17): [True: 429, False: 98.6k]
  ------------------
10293|    429|                break;
10294|  99.1k|        }
10295|    791|    }
10296|  1.09k|}
xmlParseMisc:
10336|  15.3k|xmlParseMisc(xmlParserCtxt *ctxt) {
10337|  17.1k|    while (PARSER_STOPPED(ctxt) == 0) {
  ------------------
  |  |   44|  17.1k|#define PARSER_STOPPED(ctxt) ((ctxt)->disableSAX > 1)
  ------------------
  |  Branch (10337:12): [True: 16.9k, False: 167]
  ------------------
10338|  16.9k|        SKIP_BLANKS;
  ------------------
  |  | 2275|  16.9k|#define SKIP_BLANKS xmlSkipBlankChars(ctxt)
  ------------------
10339|  16.9k|        GROW;
  ------------------
  |  | 2271|  16.9k|    if ((!PARSER_PROGRESSIVE(ctxt)) && \
  |  |  ------------------
  |  |  |  |   47|  16.9k|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|  16.9k|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2271:9): [True: 16.9k, False: 0]
  |  |  ------------------
  |  | 2272|  16.9k|        (ctxt->input->end - ctxt->input->cur < INPUT_CHUNK)) \
  |  |  ------------------
  |  |  |  |   63|  16.9k|#define INPUT_CHUNK	250
  |  |  ------------------
  |  |  |  Branch (2272:9): [True: 13.1k, False: 3.85k]
  |  |  ------------------
  |  | 2273|  16.9k|	xmlParserGrow(ctxt);
  ------------------
10340|  16.9k|        if ((RAW == '<') && (NXT(1) == '?')) {
  ------------------
  |  | 2224|  16.9k|#define RAW (*ctxt->input->cur)
  ------------------
                      if ((RAW == '<') && (NXT(1) == '?')) {
  ------------------
  |  | 2226|  10.7k|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
  |  Branch (10340:13): [True: 10.7k, False: 6.20k]
  |  Branch (10340:29): [True: 814, False: 9.96k]
  ------------------
10341|    814|	    xmlParsePI(ctxt);
10342|  16.1k|        } else if (CMP4(CUR_PTR, '<', '!', '-', '-')) {
  ------------------
  |  | 2231|  16.1k|  ( ((unsigned char *) s)[ 0 ] == c1 && ((unsigned char *) s)[ 1 ] == c2 && \
  |  |  ------------------
  |  |  |  Branch (2231:5): [True: 9.96k, False: 6.20k]
  |  |  |  Branch (2231:41): [True: 3.05k, False: 6.91k]
  |  |  ------------------
  |  | 2232|  16.1k|    ((unsigned char *) s)[ 2 ] == c3 && ((unsigned char *) s)[ 3 ] == c4 )
  |  |  ------------------
  |  |  |  Branch (2232:5): [True: 965, False: 2.09k]
  |  |  |  Branch (2232:41): [True: 963, False: 2]
  |  |  ------------------
  ------------------
10343|    963|	    xmlParseComment(ctxt);
10344|  15.2k|        } else {
10345|  15.2k|            break;
10346|  15.2k|        }
10347|  16.9k|    }
10348|  15.3k|}
xmlParseDocument:
10381|  6.71k|xmlParseDocument(xmlParserCtxt *ctxt) {
10382|  6.71k|    if ((ctxt == NULL) || (ctxt->input == NULL))
  ------------------
  |  Branch (10382:9): [True: 0, False: 6.71k]
  |  Branch (10382:27): [True: 0, False: 6.71k]
  ------------------
10383|      0|        return(-1);
10384|       |
10385|  6.71k|    GROW;
  ------------------
  |  | 2271|  6.71k|    if ((!PARSER_PROGRESSIVE(ctxt)) && \
  |  |  ------------------
  |  |  |  |   47|  6.71k|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|  6.71k|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2271:9): [True: 6.71k, False: 0]
  |  |  ------------------
  |  | 2272|  6.71k|        (ctxt->input->end - ctxt->input->cur < INPUT_CHUNK)) \
  |  |  ------------------
  |  |  |  |   63|  6.71k|#define INPUT_CHUNK	250
  |  |  ------------------
  |  |  |  Branch (2272:9): [True: 4.64k, False: 2.06k]
  |  |  ------------------
  |  | 2273|  6.71k|	xmlParserGrow(ctxt);
  ------------------
10386|       |
10387|       |    /*
10388|       |     * SAX: detecting the level.
10389|       |     */
10390|  6.71k|    xmlCtxtInitializeLate(ctxt);
10391|       |
10392|  6.71k|    if ((ctxt->sax) && (ctxt->sax->setDocumentLocator)) {
  ------------------
  |  Branch (10392:9): [True: 6.71k, False: 0]
  |  Branch (10392:24): [True: 6.71k, False: 0]
  ------------------
10393|  6.71k|        ctxt->sax->setDocumentLocator(ctxt->userData,
10394|  6.71k|                (xmlSAXLocator *) &xmlDefaultSAXLocator);
10395|  6.71k|    }
10396|       |
10397|  6.71k|    xmlDetectEncoding(ctxt);
10398|       |
10399|  6.71k|    if (CUR == 0) {
  ------------------
  |  | 2225|  6.71k|#define CUR (*ctxt->input->cur)
  ------------------
  |  Branch (10399:9): [True: 2, False: 6.71k]
  ------------------
10400|      2|	xmlFatalErr(ctxt, XML_ERR_DOCUMENT_EMPTY, NULL);
10401|      2|	return(-1);
10402|      2|    }
10403|       |
10404|  6.71k|    GROW;
  ------------------
  |  | 2271|  6.71k|    if ((!PARSER_PROGRESSIVE(ctxt)) && \
  |  |  ------------------
  |  |  |  |   47|  6.71k|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|  6.71k|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2271:9): [True: 6.71k, False: 0]
  |  |  ------------------
  |  | 2272|  6.71k|        (ctxt->input->end - ctxt->input->cur < INPUT_CHUNK)) \
  |  |  ------------------
  |  |  |  |   63|  6.71k|#define INPUT_CHUNK	250
  |  |  ------------------
  |  |  |  Branch (2272:9): [True: 4.64k, False: 2.06k]
  |  |  ------------------
  |  | 2273|  6.71k|	xmlParserGrow(ctxt);
  ------------------
10405|  6.71k|    if ((CMP5(CUR_PTR, '<', '?', 'x', 'm', 'l')) && (IS_BLANK_CH(NXT(5)))) {
  ------------------
  |  | 2234|  6.71k|  ( CMP4( s, c1, c2, c3, c4 ) && ((unsigned char *) s)[ 4 ] == c5 )
  |  |  ------------------
  |  |  |  | 2231|  13.4k|  ( ((unsigned char *) s)[ 0 ] == c1 && ((unsigned char *) s)[ 1 ] == c2 && \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2231:5): [True: 6.62k, False: 87]
  |  |  |  |  |  Branch (2231:41): [True: 557, False: 6.06k]
  |  |  |  |  ------------------
  |  |  |  | 2232|  6.71k|    ((unsigned char *) s)[ 2 ] == c3 && ((unsigned char *) s)[ 3 ] == c4 )
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2232:5): [True: 334, False: 223]
  |  |  |  |  |  Branch (2232:41): [True: 172, False: 162]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2234:34): [True: 169, False: 3]
  |  |  ------------------
  ------------------
                  if ((CMP5(CUR_PTR, '<', '?', 'x', 'm', 'l')) && (IS_BLANK_CH(NXT(5)))) {
  ------------------
  |  |  137|    169|#define IS_BLANK_CH(c)  xmlIsBlank_ch(c)
  |  |  ------------------
  |  |  |  |   90|    169|#define xmlIsBlank_ch(c)	(((c) == 0x20) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (90:27): [True: 161, False: 8]
  |  |  |  |  ------------------
  |  |  |  |   91|    169|				 ((0x9 <= (c)) && ((c) <= 0xa)) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (91:7): [True: 7, False: 1]
  |  |  |  |  |  Branch (91:23): [True: 2, False: 5]
  |  |  |  |  ------------------
  |  |  |  |   92|    169|				 ((c) == 0xd))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (92:6): [True: 2, False: 4]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
10406|       |
10407|       |	/*
10408|       |	 * Note that we will switch encoding on the fly.
10409|       |	 */
10410|    165|	xmlParseXMLDecl(ctxt);
10411|    165|	SKIP_BLANKS;
  ------------------
  |  | 2275|    165|#define SKIP_BLANKS xmlSkipBlankChars(ctxt)
  ------------------
10412|  6.54k|    } else {
10413|  6.54k|	ctxt->version = xmlCharStrdup(XML_DEFAULT_VERSION);
  ------------------
  |  |   42|  6.54k|#define XML_DEFAULT_VERSION	"1.0"
  ------------------
10414|  6.54k|        if (ctxt->version == NULL) {
  ------------------
  |  Branch (10414:13): [True: 1, False: 6.54k]
  ------------------
10415|      1|            xmlErrMemory(ctxt);
10416|      1|            return(-1);
10417|      1|        }
10418|  6.54k|    }
10419|  6.70k|    if ((ctxt->sax) && (ctxt->sax->startDocument) && (!ctxt->disableSAX))
  ------------------
  |  Branch (10419:9): [True: 6.70k, False: 0]
  |  Branch (10419:24): [True: 6.70k, False: 0]
  |  Branch (10419:54): [True: 6.66k, False: 45]
  ------------------
10420|  6.66k|        ctxt->sax->startDocument(ctxt->userData);
10421|  6.70k|    if ((ctxt->myDoc != NULL) && (ctxt->input != NULL) &&
  ------------------
  |  Branch (10421:9): [True: 6.66k, False: 47]
  |  Branch (10421:34): [True: 6.66k, False: 0]
  ------------------
10422|  6.66k|        (ctxt->input->buf != NULL) && (ctxt->input->buf->compressed >= 0)) {
  ------------------
  |  Branch (10422:9): [True: 6.66k, False: 0]
  |  Branch (10422:39): [True: 0, False: 6.66k]
  ------------------
10423|      0|	ctxt->myDoc->compression = ctxt->input->buf->compressed;
10424|      0|    }
10425|       |
10426|       |    /*
10427|       |     * The Misc part of the Prolog
10428|       |     */
10429|  6.70k|    xmlParseMisc(ctxt);
10430|       |
10431|       |    /*
10432|       |     * Then possibly doc type declaration(s) and more Misc
10433|       |     * (doctypedecl Misc*)?
10434|       |     */
10435|  6.70k|    GROW;
  ------------------
  |  | 2271|  6.70k|    if ((!PARSER_PROGRESSIVE(ctxt)) && \
  |  |  ------------------
  |  |  |  |   47|  6.70k|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|  6.70k|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2271:9): [True: 6.70k, False: 0]
  |  |  ------------------
  |  | 2272|  6.70k|        (ctxt->input->end - ctxt->input->cur < INPUT_CHUNK)) \
  |  |  ------------------
  |  |  |  |   63|  6.70k|#define INPUT_CHUNK	250
  |  |  ------------------
  |  |  |  Branch (2272:9): [True: 4.67k, False: 2.03k]
  |  |  ------------------
  |  | 2273|  6.70k|	xmlParserGrow(ctxt);
  ------------------
10436|  6.70k|    if (CMP9(CUR_PTR, '<', '!', 'D', 'O', 'C', 'T', 'Y', 'P', 'E')) {
  ------------------
  |  | 2242|  6.70k|  ( CMP8( s, c1, c2, c3, c4, c5, c6, c7, c8 ) && \
  |  |  ------------------
  |  |  |  | 2240|  13.4k|  ( CMP7( s, c1, c2, c3, c4, c5, c6, c7 ) && ((unsigned char *) s)[ 7 ] == c8 )
  |  |  |  |  ------------------
  |  |  |  |  |  | 2238|  13.4k|  ( CMP6( s, c1, c2, c3, c4, c5, c6 ) && ((unsigned char *) s)[ 6 ] == c7 )
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  | 2236|  13.4k|  ( CMP5( s, c1, c2, c3, c4, c5 ) && ((unsigned char *) s)[ 5 ] == c6 )
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  | 2234|  13.4k|  ( CMP4( s, c1, c2, c3, c4 ) && ((unsigned char *) s)[ 4 ] == c5 )
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  | 2231|  13.4k|  ( ((unsigned char *) s)[ 0 ] == c1 && ((unsigned char *) s)[ 1 ] == c2 && \
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  Branch (2231:5): [True: 6.70k, False: 9]
  |  |  |  |  |  |  |  |  |  |  |  |  |  Branch (2231:41): [True: 2.05k, False: 4.64k]
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  | 2232|  6.70k|    ((unsigned char *) s)[ 2 ] == c3 && ((unsigned char *) s)[ 3 ] == c4 )
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  Branch (2232:5): [True: 2.04k, False: 10]
  |  |  |  |  |  |  |  |  |  |  |  |  |  Branch (2232:41): [True: 2.04k, False: 3]
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (2234:34): [True: 2.04k, False: 3]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (2236:38): [True: 2.04k, False: 1]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (2238:42): [True: 2.03k, False: 7]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2240:46): [True: 2.03k, False: 2]
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 2243|  6.70k|    ((unsigned char *) s)[ 8 ] == c9 )
  |  |  ------------------
  |  |  |  Branch (2243:5): [True: 2.02k, False: 5]
  |  |  ------------------
  ------------------
10437|       |
10438|  2.02k|	ctxt->inSubset = 1;
10439|  2.02k|	xmlParseDocTypeDecl(ctxt);
10440|  2.02k|	if (RAW == '[') {
  ------------------
  |  | 2224|  2.02k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (10440:6): [True: 644, False: 1.38k]
  ------------------
10441|    644|	    xmlParseInternalSubset(ctxt);
10442|  1.38k|	} else if (RAW == '>') {
  ------------------
  |  | 2224|  1.38k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (10442:13): [True: 1.36k, False: 18]
  ------------------
10443|  1.36k|            NEXT;
  ------------------
  |  | 2279|  1.36k|#define NEXT xmlNextChar(ctxt)
  ------------------
10444|  1.36k|        }
10445|       |
10446|       |	/*
10447|       |	 * Create and update the external subset.
10448|       |	 */
10449|  2.02k|	ctxt->inSubset = 2;
10450|  2.02k|	if ((ctxt->sax != NULL) && (ctxt->sax->externalSubset != NULL) &&
  ------------------
  |  Branch (10450:6): [True: 2.02k, False: 0]
  |  Branch (10450:29): [True: 2.02k, False: 0]
  ------------------
10451|  2.02k|	    (!ctxt->disableSAX))
  ------------------
  |  Branch (10451:6): [True: 1.95k, False: 69]
  ------------------
10452|  1.95k|	    ctxt->sax->externalSubset(ctxt->userData, ctxt->intSubName,
10453|  1.95k|	                              ctxt->extSubSystem, ctxt->extSubURI);
10454|  2.02k|	ctxt->inSubset = 0;
10455|       |
10456|  2.02k|        xmlCleanSpecialAttr(ctxt);
10457|       |
10458|  2.02k|	xmlParseMisc(ctxt);
10459|  2.02k|    }
10460|       |
10461|       |    /*
10462|       |     * Time to start parsing the tree itself
10463|       |     */
10464|  6.70k|    GROW;
  ------------------
  |  | 2271|  6.70k|    if ((!PARSER_PROGRESSIVE(ctxt)) && \
  |  |  ------------------
  |  |  |  |   47|  6.70k|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|  6.70k|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2271:9): [True: 6.70k, False: 0]
  |  |  ------------------
  |  | 2272|  6.70k|        (ctxt->input->end - ctxt->input->cur < INPUT_CHUNK)) \
  |  |  ------------------
  |  |  |  |   63|  6.70k|#define INPUT_CHUNK	250
  |  |  ------------------
  |  |  |  Branch (2272:9): [True: 4.82k, False: 1.88k]
  |  |  ------------------
  |  | 2273|  6.70k|	xmlParserGrow(ctxt);
  ------------------
10465|  6.70k|    if (RAW != '<') {
  ------------------
  |  | 2224|  6.70k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (10465:9): [True: 72, False: 6.63k]
  ------------------
10466|     72|        if (ctxt->wellFormed)
  ------------------
  |  Branch (10466:13): [True: 2, False: 70]
  ------------------
10467|      2|            xmlFatalErrMsg(ctxt, XML_ERR_DOCUMENT_EMPTY,
10468|      2|                           "Start tag expected, '<' not found\n");
10469|  6.63k|    } else {
10470|  6.63k|	xmlParseElement(ctxt);
10471|       |
10472|       |	/*
10473|       |	 * The Misc part at the end
10474|       |	 */
10475|  6.63k|	xmlParseMisc(ctxt);
10476|       |
10477|  6.63k|        xmlParserCheckEOF(ctxt, XML_ERR_DOCUMENT_END);
10478|  6.63k|    }
10479|       |
10480|  6.70k|    ctxt->instate = XML_PARSER_EOF;
10481|  6.70k|    xmlFinishDocument(ctxt);
10482|       |
10483|  6.70k|    if (! ctxt->wellFormed) {
  ------------------
  |  Branch (10483:9): [True: 757, False: 5.95k]
  ------------------
10484|    757|	ctxt->valid = 0;
10485|    757|	return(-1);
10486|    757|    }
10487|       |
10488|  5.95k|    return(0);
10489|  6.70k|}
xmlParseChunk:
11238|   374k|              int terminate) {
11239|   374k|    size_t curBase;
11240|   374k|    size_t maxLength;
11241|   374k|    size_t pos;
11242|   374k|    int end_in_lf = 0;
11243|   374k|    int res;
11244|       |
11245|   374k|    if ((ctxt == NULL) || (size < 0))
  ------------------
  |  Branch (11245:9): [True: 0, False: 374k]
  |  Branch (11245:27): [True: 0, False: 374k]
  ------------------
11246|      0|        return(XML_ERR_ARGUMENT);
11247|   374k|    if ((chunk == NULL) && (size > 0))
  ------------------
  |  Branch (11247:9): [True: 0, False: 374k]
  |  Branch (11247:28): [True: 0, False: 0]
  ------------------
11248|      0|        return(XML_ERR_ARGUMENT);
11249|   374k|    if ((ctxt->input == NULL) || (ctxt->input->buf == NULL))
  ------------------
  |  Branch (11249:9): [True: 0, False: 374k]
  |  Branch (11249:34): [True: 0, False: 374k]
  ------------------
11250|      0|        return(XML_ERR_ARGUMENT);
11251|   374k|    if (ctxt->disableSAX != 0)
  ------------------
  |  Branch (11251:9): [True: 3.86k, False: 370k]
  ------------------
11252|  3.86k|        return(ctxt->errNo);
11253|       |
11254|   370k|    ctxt->input->flags |= XML_INPUT_PROGRESSIVE;
  ------------------
  |  |   41|   370k|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  ------------------
11255|   370k|    if (ctxt->instate == XML_PARSER_START)
  ------------------
  |  Branch (11255:9): [True: 31.8k, False: 338k]
  ------------------
11256|  31.8k|        xmlCtxtInitializeLate(ctxt);
11257|   370k|    if ((size > 0) && (chunk != NULL) && (!terminate) &&
  ------------------
  |  Branch (11257:9): [True: 345k, False: 24.9k]
  |  Branch (11257:23): [True: 345k, False: 0]
  |  Branch (11257:42): [True: 345k, False: 0]
  ------------------
11258|   345k|        (chunk[size - 1] == '\r')) {
  ------------------
  |  Branch (11258:9): [True: 1.91k, False: 343k]
  ------------------
11259|  1.91k|	end_in_lf = 1;
11260|  1.91k|	size--;
11261|  1.91k|    }
11262|       |
11263|       |    /*
11264|       |     * Also push an empty chunk to make sure that the raw buffer
11265|       |     * will be flushed if there is an encoder.
11266|       |     */
11267|   370k|    pos = ctxt->input->cur - ctxt->input->base;
11268|   370k|    res = xmlParserInputBufferPush(ctxt->input->buf, size, chunk);
11269|   370k|    xmlBufUpdateInput(ctxt->input->buf->buffer, ctxt->input, pos);
11270|   370k|    if (res < 0) {
  ------------------
  |  Branch (11270:9): [True: 470, False: 369k]
  ------------------
11271|    470|        xmlCtxtErrIO(ctxt, ctxt->input->buf->error, NULL);
11272|    470|        return(ctxt->errNo);
11273|    470|    }
11274|       |
11275|   369k|    xmlParseTryOrFinish(ctxt, terminate);
11276|       |
11277|   369k|    curBase = ctxt->input->cur - ctxt->input->base;
11278|   369k|    maxLength = (ctxt->options & XML_PARSE_HUGE) ?
  ------------------
  |  Branch (11278:17): [True: 171k, False: 197k]
  ------------------
11279|   171k|                XML_MAX_HUGE_LENGTH :
  ------------------
  |  |   55|   171k|#define XML_MAX_HUGE_LENGTH 1000000000
  ------------------
11280|   369k|                XML_MAX_LOOKUP_LIMIT;
  ------------------
  |  |   81|   567k|#define XML_MAX_LOOKUP_LIMIT 10000000
  ------------------
11281|   369k|    if (curBase > maxLength) {
  ------------------
  |  Branch (11281:9): [True: 0, False: 369k]
  ------------------
11282|      0|        xmlFatalErr(ctxt, XML_ERR_RESOURCE_LIMIT,
11283|      0|                    "Buffer size limit exceeded, try XML_PARSE_HUGE\n");
11284|      0|    }
11285|       |
11286|   369k|    if ((ctxt->errNo != XML_ERR_OK) && (ctxt->disableSAX != 0))
  ------------------
  |  Branch (11286:9): [True: 81.0k, False: 288k]
  |  Branch (11286:40): [True: 9.72k, False: 71.3k]
  ------------------
11287|  9.72k|        return(ctxt->errNo);
11288|       |
11289|   359k|    if (end_in_lf == 1) {
  ------------------
  |  Branch (11289:9): [True: 1.91k, False: 358k]
  ------------------
11290|  1.91k|	pos = ctxt->input->cur - ctxt->input->base;
11291|  1.91k|	res = xmlParserInputBufferPush(ctxt->input->buf, 1, "\r");
11292|  1.91k|	xmlBufUpdateInput(ctxt->input->buf->buffer, ctxt->input, pos);
11293|  1.91k|        if (res < 0) {
  ------------------
  |  Branch (11293:13): [True: 2, False: 1.90k]
  ------------------
11294|      2|            xmlCtxtErrIO(ctxt, ctxt->input->buf->error, NULL);
11295|      2|            return(ctxt->errNo);
11296|      2|        }
11297|  1.91k|    }
11298|   359k|    if (terminate) {
  ------------------
  |  Branch (11298:9): [True: 16.9k, False: 342k]
  ------------------
11299|       |	/*
11300|       |	 * Check for termination
11301|       |	 */
11302|  16.9k|        if ((ctxt->instate != XML_PARSER_EOF) &&
  ------------------
  |  Branch (11302:13): [True: 8.90k, False: 8.08k]
  ------------------
11303|  8.90k|            (ctxt->instate != XML_PARSER_EPILOG)) {
  ------------------
  |  Branch (11303:13): [True: 4.61k, False: 4.29k]
  ------------------
11304|  4.61k|            if (ctxt->nameNr > 0) {
  ------------------
  |  Branch (11304:17): [True: 3.48k, False: 1.13k]
  ------------------
11305|  3.48k|                const xmlChar *name = ctxt->nameTab[ctxt->nameNr - 1];
11306|  3.48k|                int line = ctxt->pushTab[ctxt->nameNr - 1].line;
11307|  3.48k|                xmlFatalErrMsgStrIntStr(ctxt, XML_ERR_TAG_NOT_FINISHED,
11308|  3.48k|                        "Premature end of data in tag %s line %d\n",
11309|  3.48k|                        name, line, NULL);
11310|  3.48k|            } else if (ctxt->instate == XML_PARSER_START) {
  ------------------
  |  Branch (11310:24): [True: 18, False: 1.11k]
  ------------------
11311|     18|                xmlFatalErr(ctxt, XML_ERR_DOCUMENT_EMPTY, NULL);
11312|  1.11k|            } else {
11313|  1.11k|                xmlFatalErrMsg(ctxt, XML_ERR_DOCUMENT_EMPTY,
11314|  1.11k|                               "Start tag expected, '<' not found\n");
11315|  1.11k|            }
11316|  12.3k|        } else {
11317|  12.3k|            xmlParserCheckEOF(ctxt, XML_ERR_DOCUMENT_END);
11318|  12.3k|        }
11319|  16.9k|	if (ctxt->instate != XML_PARSER_EOF) {
  ------------------
  |  Branch (11319:6): [True: 8.72k, False: 8.26k]
  ------------------
11320|  8.72k|            ctxt->instate = XML_PARSER_EOF;
11321|  8.72k|            xmlFinishDocument(ctxt);
11322|  8.72k|	}
11323|  16.9k|    }
11324|   359k|    if (ctxt->wellFormed == 0)
  ------------------
  |  Branch (11324:9): [True: 18.2k, False: 341k]
  ------------------
11325|  18.2k|	return((xmlParserErrors) ctxt->errNo);
11326|   341k|    else
11327|   341k|        return(0);
11328|   359k|}
xmlCreatePushParserCtxt:
11359|  31.6k|                        const char *chunk, int size, const char *filename) {
11360|  31.6k|    xmlParserCtxtPtr ctxt;
11361|  31.6k|    xmlParserInputPtr input;
11362|       |
11363|  31.6k|    ctxt = xmlNewSAXParserCtxt(sax, user_data);
11364|  31.6k|    if (ctxt == NULL)
  ------------------
  |  Branch (11364:9): [True: 19, False: 31.6k]
  ------------------
11365|     19|	return(NULL);
11366|       |
11367|  31.6k|    ctxt->options &= ~XML_PARSE_NODICT;
11368|  31.6k|    ctxt->dictNames = 1;
11369|       |
11370|  31.6k|    input = xmlNewPushInput(filename, chunk, size);
11371|  31.6k|    if (input == NULL) {
  ------------------
  |  Branch (11371:9): [True: 9, False: 31.5k]
  ------------------
11372|      9|	xmlFreeParserCtxt(ctxt);
11373|      9|	return(NULL);
11374|      9|    }
11375|  31.5k|    if (xmlCtxtPushInput(ctxt, input) < 0) {
  ------------------
  |  Branch (11375:9): [True: 0, False: 31.5k]
  ------------------
11376|      0|        xmlFreeInputStream(input);
11377|      0|        xmlFreeParserCtxt(ctxt);
11378|      0|        return(NULL);
11379|      0|    }
11380|       |
11381|  31.5k|    return(ctxt);
11382|  31.5k|}
xmlStopParser:
11391|  33.8k|xmlStopParser(xmlParserCtxt *ctxt) {
11392|  33.8k|    if (ctxt == NULL)
  ------------------
  |  Branch (11392:9): [True: 0, False: 33.8k]
  ------------------
11393|      0|        return;
11394|       |
11395|       |    /* This stops the parser */
11396|  33.8k|    ctxt->disableSAX = 2;
11397|       |
11398|       |    /*
11399|       |     * xmlStopParser is often called from error handlers,
11400|       |     * so we can't raise an error here to avoid infinite
11401|       |     * loops. Just make sure that an error condition is
11402|       |     * reported.
11403|       |     */
11404|  33.8k|    if (ctxt->errNo == XML_ERR_OK) {
  ------------------
  |  Branch (11404:9): [True: 2.88k, False: 30.9k]
  ------------------
11405|  2.88k|        ctxt->errNo = XML_ERR_USER_STOP;
11406|  2.88k|        ctxt->lastError.code = XML_ERR_USER_STOP;
11407|  2.88k|        ctxt->wellFormed = 0;
11408|  2.88k|    }
11409|  33.8k|}
xmlCtxtUseOptions:
13267|  39.0k|{
13268|  39.0k|    int keepMask;
13269|       |
13270|  39.0k|#ifdef LIBXML_HTML_ENABLED
13271|  39.0k|    if ((ctxt != NULL) && (ctxt->html))
  ------------------
  |  Branch (13271:9): [True: 39.0k, False: 0]
  |  Branch (13271:27): [True: 0, False: 39.0k]
  ------------------
13272|      0|        return(htmlCtxtUseOptions(ctxt, options));
13273|  39.0k|#endif
13274|       |
13275|       |    /*
13276|       |     * For historic reasons, some options can only be enabled.
13277|       |     */
13278|  39.0k|    keepMask = XML_PARSE_NOERROR |
13279|  39.0k|               XML_PARSE_NOWARNING |
13280|  39.0k|               XML_PARSE_NONET |
13281|  39.0k|               XML_PARSE_NSCLEAN |
13282|  39.0k|               XML_PARSE_NOCDATA |
13283|  39.0k|               XML_PARSE_COMPACT |
13284|  39.0k|               XML_PARSE_OLD10 |
13285|  39.0k|               XML_PARSE_HUGE |
13286|  39.0k|               XML_PARSE_OLDSAX |
13287|  39.0k|               XML_PARSE_IGNORE_ENC |
13288|  39.0k|               XML_PARSE_BIG_LINES;
13289|       |
13290|  39.0k|    return(xmlCtxtSetOptionsInternal(ctxt, options, keepMask));
13291|  39.0k|}
parser.c:xmlParserNsLookup:
 1488|  1.26M|                  xmlParserNsBucket **bucketPtr) {
 1489|  1.26M|    xmlParserNsBucket *bucket, *tombstone;
 1490|  1.26M|    unsigned index, hashValue;
 1491|       |
 1492|  1.26M|    if (prefix->name == NULL)
  ------------------
  |  Branch (1492:9): [True: 557k, False: 708k]
  ------------------
 1493|   557k|        return(ctxt->nsdb->defaultNsIndex);
 1494|       |
 1495|   708k|    if (ctxt->nsdb->hashSize == 0)
  ------------------
  |  Branch (1495:9): [True: 22.7k, False: 685k]
  ------------------
 1496|  22.7k|        return(INT_MAX);
 1497|       |
 1498|   685k|    hashValue = prefix->hashValue;
 1499|   685k|    index = hashValue & (ctxt->nsdb->hashSize - 1);
 1500|   685k|    bucket = &ctxt->nsdb->hash[index];
 1501|   685k|    tombstone = NULL;
 1502|       |
 1503|  1.02M|    while (bucket->hashValue) {
  ------------------
  |  Branch (1503:12): [True: 908k, False: 120k]
  ------------------
 1504|   908k|        if (bucket->index == INT_MAX) {
  ------------------
  |  Branch (1504:13): [True: 62.1k, False: 846k]
  ------------------
 1505|  62.1k|            if (tombstone == NULL)
  ------------------
  |  Branch (1505:17): [True: 46.2k, False: 15.8k]
  ------------------
 1506|  46.2k|                tombstone = bucket;
 1507|   846k|        } else if (bucket->hashValue == hashValue) {
  ------------------
  |  Branch (1507:20): [True: 565k, False: 281k]
  ------------------
 1508|   565k|            if (ctxt->nsTab[bucket->index * 2] == prefix->name) {
  ------------------
  |  Branch (1508:17): [True: 565k, False: 0]
  ------------------
 1509|   565k|                if (bucketPtr != NULL)
  ------------------
  |  Branch (1509:21): [True: 384k, False: 181k]
  ------------------
 1510|   384k|                    *bucketPtr = bucket;
 1511|   565k|                return(bucket->index);
 1512|   565k|            }
 1513|   565k|        }
 1514|       |
 1515|   343k|        index++;
 1516|   343k|        bucket++;
 1517|   343k|        if (index == ctxt->nsdb->hashSize) {
  ------------------
  |  Branch (1517:13): [True: 88.7k, False: 254k]
  ------------------
 1518|  88.7k|            index = 0;
 1519|  88.7k|            bucket = ctxt->nsdb->hash;
 1520|  88.7k|        }
 1521|   343k|    }
 1522|       |
 1523|   120k|    if (bucketPtr != NULL)
  ------------------
  |  Branch (1523:9): [True: 28.4k, False: 91.7k]
  ------------------
 1524|  28.4k|        *bucketPtr = tombstone ? tombstone : bucket;
  ------------------
  |  Branch (1524:22): [True: 25.2k, False: 3.20k]
  ------------------
 1525|       |    return(INT_MAX);
 1526|   685k|}
parser.c:xmlFatalErrMsg:
  259|  25.5M|{
  260|  25.5M|    xmlCtxtErr(ctxt, NULL, XML_FROM_PARSER, error, XML_ERR_FATAL,
  261|  25.5M|               NULL, NULL, NULL, 0, "%s", msg);
  262|  25.5M|}
parser.c:xmlErrMemory:
  224|    361|xmlErrMemory(xmlParserCtxtPtr ctxt) {
  225|    361|    xmlCtxtErrMemory(ctxt);
  226|    361|}
parser.c:xmlFatalErrMsgInt:
  313|  7.08M|{
  314|  7.08M|    xmlCtxtErr(ctxt, NULL, XML_FROM_PARSER, error, XML_ERR_FATAL,
  315|  7.08M|               NULL, NULL, NULL, val, msg, val);
  316|  7.08M|}
parser.c:xmlIsNameChar:
 3031|  21.9M|xmlIsNameChar(int c, int old10) {
 3032|  21.9M|    if (!old10)
  ------------------
  |  Branch (3032:9): [True: 13.5M, False: 8.42M]
  ------------------
 3033|  13.5M|        return(xmlIsNameCharNew(c));
 3034|  8.42M|    else
 3035|  8.42M|        return(xmlIsNameCharOld(c));
 3036|  21.9M|}
parser.c:xmlIsNameCharNew:
 2973|  13.5M|xmlIsNameCharNew(int c) {
 2974|       |    /*
 2975|       |     * Use the new checks of production [4] [4a] amd [5] of the
 2976|       |     * Update 5 of XML-1.0
 2977|       |     */
 2978|  13.5M|    if ((c != ' ') && (c != '>') && (c != '/') && /* accelerators */
  ------------------
  |  Branch (2978:9): [True: 13.5M, False: 56.7k]
  |  Branch (2978:23): [True: 13.4M, False: 20.5k]
  |  Branch (2978:37): [True: 13.4M, False: 10.2k]
  ------------------
 2979|  13.4M|        (((c >= 'a') && (c <= 'z')) ||
  ------------------
  |  Branch (2979:11): [True: 9.52M, False: 3.94M]
  |  Branch (2979:25): [True: 2.98M, False: 6.54M]
  ------------------
 2980|  10.4M|         ((c >= 'A') && (c <= 'Z')) ||
  ------------------
  |  Branch (2980:11): [True: 8.06M, False: 2.42M]
  |  Branch (2980:25): [True: 1.45M, False: 6.60M]
  ------------------
 2981|  9.03M|         ((c >= '0') && (c <= '9')) || /* !start */
  ------------------
  |  Branch (2981:11): [True: 8.84M, False: 188k]
  |  Branch (2981:25): [True: 769k, False: 8.07M]
  ------------------
 2982|  8.26M|         (c == '_') || (c == ':') ||
  ------------------
  |  Branch (2982:10): [True: 52.8k, False: 8.21M]
  |  Branch (2982:24): [True: 13.9k, False: 8.19M]
  ------------------
 2983|  8.19M|         (c == '-') || (c == '.') || (c == 0xB7) || /* !start */
  ------------------
  |  Branch (2983:10): [True: 53.2k, False: 8.14M]
  |  Branch (2983:24): [True: 26.8k, False: 8.11M]
  |  Branch (2983:38): [True: 683, False: 8.11M]
  ------------------
 2984|  8.11M|         ((c >= 0xC0) && (c <= 0xD6)) ||
  ------------------
  |  Branch (2984:11): [True: 6.53M, False: 1.58M]
  |  Branch (2984:26): [True: 1.17M, False: 5.36M]
  ------------------
 2985|  6.94M|         ((c >= 0xD8) && (c <= 0xF6)) ||
  ------------------
  |  Branch (2985:11): [True: 5.36M, False: 1.58M]
  |  Branch (2985:26): [True: 1.72k, False: 5.35M]
  ------------------
 2986|  6.93M|         ((c >= 0xF8) && (c <= 0x2FF)) ||
  ------------------
  |  Branch (2986:11): [True: 5.35M, False: 1.58M]
  |  Branch (2986:26): [True: 1.54M, False: 3.81M]
  ------------------
 2987|  5.39M|         ((c >= 0x300) && (c <= 0x36F)) || /* !start */
  ------------------
  |  Branch (2987:11): [True: 3.81M, False: 1.58M]
  |  Branch (2987:27): [True: 943, False: 3.81M]
  ------------------
 2988|  5.39M|         ((c >= 0x370) && (c <= 0x37D)) ||
  ------------------
  |  Branch (2988:11): [True: 3.81M, False: 1.58M]
  |  Branch (2988:27): [True: 195, False: 3.81M]
  ------------------
 2989|  5.39M|         ((c >= 0x37F) && (c <= 0x1FFF)) ||
  ------------------
  |  Branch (2989:11): [True: 3.81M, False: 1.58M]
  |  Branch (2989:27): [True: 1.38M, False: 2.42M]
  ------------------
 2990|  4.00M|         ((c >= 0x200C) && (c <= 0x200D)) ||
  ------------------
  |  Branch (2990:11): [True: 2.42M, False: 1.58M]
  |  Branch (2990:28): [True: 310, False: 2.42M]
  ------------------
 2991|  4.00M|         ((c >= 0x203F) && (c <= 0x2040)) || /* !start */
  ------------------
  |  Branch (2991:11): [True: 2.42M, False: 1.58M]
  |  Branch (2991:28): [True: 100, False: 2.42M]
  ------------------
 2992|  4.00M|         ((c >= 0x2070) && (c <= 0x218F)) ||
  ------------------
  |  Branch (2992:11): [True: 2.42M, False: 1.58M]
  |  Branch (2992:28): [True: 1.30k, False: 2.42M]
  ------------------
 2993|  4.00M|         ((c >= 0x2C00) && (c <= 0x2FEF)) ||
  ------------------
  |  Branch (2993:11): [True: 2.42M, False: 1.58M]
  |  Branch (2993:28): [True: 2.28k, False: 2.41M]
  ------------------
 2994|  4.00M|         ((c >= 0x3001) && (c <= 0xD7FF)) ||
  ------------------
  |  Branch (2994:11): [True: 2.41M, False: 1.58M]
  |  Branch (2994:28): [True: 28.6k, False: 2.38M]
  ------------------
 2995|  3.97M|         ((c >= 0xF900) && (c <= 0xFDCF)) ||
  ------------------
  |  Branch (2995:11): [True: 2.38M, False: 1.58M]
  |  Branch (2995:28): [True: 307, False: 2.38M]
  ------------------
 2996|  3.97M|         ((c >= 0xFDF0) && (c <= 0xFFFD)) ||
  ------------------
  |  Branch (2996:11): [True: 2.38M, False: 1.58M]
  |  Branch (2996:28): [True: 2.37M, False: 14.8k]
  ------------------
 2997|  1.59M|         ((c >= 0x10000) && (c <= 0xEFFFF))))
  ------------------
  |  Branch (2997:11): [True: 14.8k, False: 1.58M]
  |  Branch (2997:29): [True: 2.31k, False: 12.5k]
  ------------------
 2998|  11.8M|         return(1);
 2999|  1.68M|    return(0);
 3000|  13.5M|}
parser.c:xmlIsNameCharOld:
 3011|  8.42M|xmlIsNameCharOld(int c) {
 3012|  8.42M|    if ((c != ' ') && (c != '>') && (c != '/') && /* accelerators */
  ------------------
  |  Branch (3012:9): [True: 8.42M, False: 2.88k]
  |  Branch (3012:23): [True: 8.42M, False: 1.12k]
  |  Branch (3012:37): [True: 8.42M, False: 812]
  ------------------
 3013|  8.42M|        ((IS_LETTER(c)) || (IS_DIGIT(c)) ||
  ------------------
  |  |  208|  8.42M|#define IS_LETTER(c) (IS_BASECHAR(c) || IS_IDEOGRAPHIC(c))
  |  |  ------------------
  |  |  |  |  145|  8.42M|#define IS_BASECHAR(c) xmlIsBaseCharQ(c)
  |  |  |  |  ------------------
  |  |  |  |  |  |   81|  16.8M|#define xmlIsBaseCharQ(c)	(((c) < 0x100) ? \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (81:27): [True: 7.06M, False: 1.36M]
  |  |  |  |  |  |  |  Branch (81:28): [True: 6.64M, False: 1.78M]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   82|  16.8M|				 xmlIsBaseChar_ch((c)) : \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|  6.64M|#define xmlIsBaseChar_ch(c)	(((0x41 <= (c)) && ((c) <= 0x5a)) || \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (70:31): [True: 5.31M, False: 1.32M]
  |  |  |  |  |  |  |  |  |  Branch (70:48): [True: 2.35M, False: 2.95M]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   71|  6.64M|				 ((0x61 <= (c)) && ((c) <= 0x7a)) || \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (71:7): [True: 2.93M, False: 1.34M]
  |  |  |  |  |  |  |  |  |  Branch (71:24): [True: 505k, False: 2.43M]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   72|  6.64M|				 ((0xc0 <= (c)) && ((c) <= 0xd6)) || \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (72:7): [True: 2.43M, False: 1.34M]
  |  |  |  |  |  |  |  |  |  Branch (72:24): [True: 2.42M, False: 7.95k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   73|  6.64M|				 ((0xd8 <= (c)) && ((c) <= 0xf6)) || \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (73:7): [True: 7.95k, False: 1.34M]
  |  |  |  |  |  |  |  |  |  Branch (73:24): [True: 2.07k, False: 5.88k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   74|  6.64M|				  (0xf8 <= (c)))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (74:7): [True: 5.88k, False: 1.34M]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   83|  16.8M|				 xmlCharInRange((c), &xmlIsBaseCharGroup))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define IS_LETTER(c) (IS_BASECHAR(c) || IS_IDEOGRAPHIC(c))
  |  |  ------------------
  |  |  |  |  200|  1.36M|#define IS_IDEOGRAPHIC(c) xmlIsIdeographicQ(c)
  |  |  |  |  ------------------
  |  |  |  |  |  |  169|  1.36M|#define xmlIsIdeographicQ(c)	(((c) < 0x100) ? \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (169:30): [True: 2.71k, False: 1.35M]
  |  |  |  |  |  |  |  Branch (169:31): [True: 1.34M, False: 13.4k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  170|  1.36M|				 0 :\
  |  |  |  |  |  |  171|  1.36M|				(((0x4e00 <= (c)) && ((c) <= 0x9fa5)) || \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (171:7): [True: 10.8k, False: 2.59k]
  |  |  |  |  |  |  |  Branch (171:26): [True: 1.87k, False: 9.01k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  172|  13.4k|				 ((c) == 0x3007) || \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (172:6): [True: 517, False: 11.0k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  173|  13.4k|				 ((0x3021 <= (c)) && ((c) <= 0x3029))))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (173:7): [True: 9.51k, False: 1.57k]
  |  |  |  |  |  |  |  Branch (173:26): [True: 331, False: 9.18k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                      ((IS_LETTER(c)) || (IS_DIGIT(c)) ||
  ------------------
  |  |  153|  1.35M|#define IS_DIGIT(c) xmlIsDigitQ(c)
  |  |  ------------------
  |  |  |  |  144|  1.35M|#define xmlIsDigitQ(c)		(((c) < 0x100) ? \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (144:26): [True: 1.34M, False: 10.7k]
  |  |  |  |  ------------------
  |  |  |  |  145|  1.35M|				 xmlIsDigit_ch((c)) : \
  |  |  |  |  ------------------
  |  |  |  |  |  |  137|  1.34M|#define xmlIsDigit_ch(c)	(((0x30 <= (c)) && ((c) <= 0x39)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (137:28): [True: 1.32M, False: 18.3k]
  |  |  |  |  |  |  |  Branch (137:45): [True: 589k, False: 739k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  146|  1.35M|				 xmlCharInRange((c), &xmlIsDigitGroup))
  |  |  ------------------
  ------------------
  |  Branch (3013:28): [True: 590k, False: 768k]
  ------------------
 3014|   768k|         (c == '.') || (c == '-') ||
  ------------------
  |  Branch (3014:10): [True: 956, False: 767k]
  |  Branch (3014:24): [True: 2.74k, False: 764k]
  ------------------
 3015|   764k|         (c == '_') || (c == ':') ||
  ------------------
  |  Branch (3015:10): [True: 16.3k, False: 748k]
  |  Branch (3015:24): [True: 6.28k, False: 742k]
  ------------------
 3016|   742k|         (IS_COMBINING(c)) ||
  ------------------
  |  |  168|   742k|#define IS_COMBINING(c) xmlIsCombiningQ(c)
  |  |  ------------------
  |  |  |  |  128|   742k|#define xmlIsCombiningQ(c)	(((c) < 0x100) ? \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (128:29): [True: 731k, False: 10.5k]
  |  |  |  |  ------------------
  |  |  |  |  129|   742k|				 0 : \
  |  |  |  |  130|   742k|				 xmlCharInRange((c), &xmlIsCombiningGroup))
  |  |  ------------------
  ------------------
  |  Branch (3016:10): [True: 680, False: 741k]
  ------------------
 3017|   741k|         (IS_EXTENDER(c))))
  ------------------
  |  |  185|   741k|#define IS_EXTENDER(c) xmlIsExtenderQ(c)
  |  |  ------------------
  |  |  |  |  160|   741k|#define xmlIsExtenderQ(c)	(((c) < 0x100) ? \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (160:28): [True: 731k, False: 9.82k]
  |  |  |  |  ------------------
  |  |  |  |  161|   741k|				 xmlIsExtender_ch((c)) : \
  |  |  |  |  ------------------
  |  |  |  |  |  |  153|   731k|#define xmlIsExtender_ch(c)	(((c) == 0xb7))
  |  |  |  |  ------------------
  |  |  |  |  162|   741k|				 xmlCharInRange((c), &xmlIsExtenderGroup))
  |  |  ------------------
  ------------------
  |  Branch (3017:10): [True: 845, False: 740k]
  ------------------
 3018|  7.68M|        return(1);
 3019|   745k|    return(0);
 3020|  8.42M|}
parser.c:xmlIsNameStartChar:
 3023|  2.68M|xmlIsNameStartChar(int c, int old10) {
 3024|  2.68M|    if (!old10)
  ------------------
  |  Branch (3024:9): [True: 1.85M, False: 829k]
  ------------------
 3025|  1.85M|        return(xmlIsNameStartCharNew(c));
 3026|   829k|    else
 3027|   829k|        return(xmlIsNameStartCharOld(c));
 3028|  2.68M|}
parser.c:xmlIsNameStartCharNew:
 2947|  1.85M|xmlIsNameStartCharNew(int c) {
 2948|       |    /*
 2949|       |     * Use the new checks of production [4] [4a] amd [5] of the
 2950|       |     * Update 5 of XML-1.0
 2951|       |     */
 2952|  1.85M|    if ((c != ' ') && (c != '>') && (c != '/') && /* accelerators */
  ------------------
  |  Branch (2952:9): [True: 1.85M, False: 1.96k]
  |  Branch (2952:23): [True: 1.84M, False: 4.68k]
  |  Branch (2952:37): [True: 1.84M, False: 4.70k]
  ------------------
 2953|  1.84M|        (((c >= 'a') && (c <= 'z')) ||
  ------------------
  |  Branch (2953:11): [True: 1.63M, False: 212k]
  |  Branch (2953:25): [True: 1.59M, False: 39.2k]
  ------------------
 2954|   251k|         ((c >= 'A') && (c <= 'Z')) ||
  ------------------
  |  Branch (2954:11): [True: 105k, False: 145k]
  |  Branch (2954:25): [True: 55.7k, False: 49.8k]
  ------------------
 2955|   195k|         (c == '_') || (c == ':') ||
  ------------------
  |  Branch (2955:10): [True: 6.16k, False: 189k]
  |  Branch (2955:24): [True: 2.37k, False: 187k]
  ------------------
 2956|   187k|         ((c >= 0xC0) && (c <= 0xD6)) ||
  ------------------
  |  Branch (2956:11): [True: 36.1k, False: 150k]
  |  Branch (2956:26): [True: 444, False: 35.6k]
  ------------------
 2957|   186k|         ((c >= 0xD8) && (c <= 0xF6)) ||
  ------------------
  |  Branch (2957:11): [True: 35.6k, False: 150k]
  |  Branch (2957:26): [True: 751, False: 34.9k]
  ------------------
 2958|   185k|         ((c >= 0xF8) && (c <= 0x2FF)) ||
  ------------------
  |  Branch (2958:11): [True: 34.9k, False: 150k]
  |  Branch (2958:26): [True: 2.51k, False: 32.4k]
  ------------------
 2959|   183k|         ((c >= 0x370) && (c <= 0x37D)) ||
  ------------------
  |  Branch (2959:11): [True: 32.4k, False: 150k]
  |  Branch (2959:27): [True: 206, False: 32.1k]
  ------------------
 2960|   183k|         ((c >= 0x37F) && (c <= 0x1FFF)) ||
  ------------------
  |  Branch (2960:11): [True: 32.1k, False: 150k]
  |  Branch (2960:27): [True: 2.58k, False: 29.6k]
  ------------------
 2961|   180k|         ((c >= 0x200C) && (c <= 0x200D)) ||
  ------------------
  |  Branch (2961:11): [True: 29.6k, False: 150k]
  |  Branch (2961:28): [True: 70, False: 29.5k]
  ------------------
 2962|   180k|         ((c >= 0x2070) && (c <= 0x218F)) ||
  ------------------
  |  Branch (2962:11): [True: 29.3k, False: 151k]
  |  Branch (2962:28): [True: 264, False: 29.0k]
  ------------------
 2963|   180k|         ((c >= 0x2C00) && (c <= 0x2FEF)) ||
  ------------------
  |  Branch (2963:11): [True: 29.0k, False: 151k]
  |  Branch (2963:28): [True: 332, False: 28.7k]
  ------------------
 2964|   179k|         ((c >= 0x3001) && (c <= 0xD7FF)) ||
  ------------------
  |  Branch (2964:11): [True: 28.7k, False: 151k]
  |  Branch (2964:28): [True: 3.25k, False: 25.4k]
  ------------------
 2965|   176k|         ((c >= 0xF900) && (c <= 0xFDCF)) ||
  ------------------
  |  Branch (2965:11): [True: 25.4k, False: 151k]
  |  Branch (2965:28): [True: 393, False: 25.0k]
  ------------------
 2966|   176k|         ((c >= 0xFDF0) && (c <= 0xFFFD)) ||
  ------------------
  |  Branch (2966:11): [True: 25.0k, False: 151k]
  |  Branch (2966:28): [True: 7.17k, False: 17.8k]
  ------------------
 2967|   169k|         ((c >= 0x10000) && (c <= 0xEFFFF))))
  ------------------
  |  Branch (2967:11): [True: 17.8k, False: 151k]
  |  Branch (2967:29): [True: 907, False: 16.9k]
  ------------------
 2968|  1.67M|        return(1);
 2969|   179k|    return(0);
 2970|  1.85M|}
parser.c:xmlIsNameStartCharOld:
 3003|   829k|xmlIsNameStartCharOld(int c) {
 3004|   829k|    if ((c != ' ') && (c != '>') && (c != '/') && /* accelerators */
  ------------------
  |  Branch (3004:9): [True: 826k, False: 2.32k]
  |  Branch (3004:23): [True: 824k, False: 2.40k]
  |  Branch (3004:37): [True: 823k, False: 1.34k]
  ------------------
 3005|   823k|        ((IS_LETTER(c) || (c == '_') || (c == ':'))))
  ------------------
  |  |  208|  1.64M|#define IS_LETTER(c) (IS_BASECHAR(c) || IS_IDEOGRAPHIC(c))
  |  |  ------------------
  |  |  |  |  145|   823k|#define IS_BASECHAR(c) xmlIsBaseCharQ(c)
  |  |  |  |  ------------------
  |  |  |  |  |  |   81|  1.64M|#define xmlIsBaseCharQ(c)	(((c) < 0x100) ? \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (81:27): [True: 732k, False: 90.0k]
  |  |  |  |  |  |  |  Branch (81:28): [True: 809k, False: 13.0k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   82|  1.64M|				 xmlIsBaseChar_ch((c)) : \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|   809k|#define xmlIsBaseChar_ch(c)	(((0x41 <= (c)) && ((c) <= 0x5a)) || \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (70:31): [True: 734k, False: 75.2k]
  |  |  |  |  |  |  |  |  |  Branch (70:48): [True: 3.48k, False: 731k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   71|   809k|				 ((0x61 <= (c)) && ((c) <= 0x7a)) || \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (71:7): [True: 729k, False: 77.4k]
  |  |  |  |  |  |  |  |  |  Branch (71:24): [True: 726k, False: 2.37k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   72|   809k|				 ((0xc0 <= (c)) && ((c) <= 0xd6)) || \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (72:7): [True: 1.56k, False: 78.2k]
  |  |  |  |  |  |  |  |  |  Branch (72:24): [True: 427, False: 1.14k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   73|   809k|				 ((0xd8 <= (c)) && ((c) <= 0xf6)) || \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (73:7): [True: 1.14k, False: 78.2k]
  |  |  |  |  |  |  |  |  |  Branch (73:24): [True: 679, False: 463]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   74|   809k|				  (0xf8 <= (c)))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (74:7): [True: 460, False: 78.2k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   83|  1.64M|				 xmlCharInRange((c), &xmlIsBaseCharGroup))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define IS_LETTER(c) (IS_BASECHAR(c) || IS_IDEOGRAPHIC(c))
  |  |  ------------------
  |  |  |  |  200|  90.0k|#define IS_IDEOGRAPHIC(c) xmlIsIdeographicQ(c)
  |  |  |  |  ------------------
  |  |  |  |  |  |  169|  90.0k|#define xmlIsIdeographicQ(c)	(((c) < 0x100) ? \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (169:30): [True: 1.56k, False: 88.4k]
  |  |  |  |  |  |  |  Branch (169:31): [True: 78.2k, False: 11.8k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  170|  90.0k|				 0 :\
  |  |  |  |  |  |  171|  90.0k|				(((0x4e00 <= (c)) && ((c) <= 0x9fa5)) || \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (171:7): [True: 10.1k, False: 1.68k]
  |  |  |  |  |  |  |  Branch (171:26): [True: 727, False: 9.41k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  172|  11.8k|				 ((c) == 0x3007) || \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (172:6): [True: 520, False: 10.5k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  173|  11.8k|				 ((0x3021 <= (c)) && ((c) <= 0x3029))))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (173:7): [True: 9.75k, False: 823]
  |  |  |  |  |  |  |  Branch (173:26): [True: 316, False: 9.43k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (3005:27): [True: 768, False: 87.7k]
  |  Branch (3005:41): [True: 2.89k, False: 84.8k]
  ------------------
 3006|   738k|        return(1);
 3007|  90.9k|    return(0);
 3008|   829k|}
parser.c:xmlParseNameComplex:
 3086|   223k|xmlParseNameComplex(xmlParserCtxtPtr ctxt) {
 3087|   223k|    const xmlChar *ret;
 3088|   223k|    int len = 0, l;
 3089|   223k|    int c;
 3090|   223k|    int maxLength = (ctxt->options & XML_PARSE_HUGE) ?
  ------------------
  |  Branch (3090:21): [True: 116k, False: 107k]
  ------------------
 3091|   116k|                    XML_MAX_TEXT_LENGTH :
  ------------------
  |  |   50|   116k|#define XML_MAX_TEXT_LENGTH 10000000
  ------------------
 3092|   223k|                    XML_MAX_NAME_LENGTH;
  ------------------
  |  |   65|   107k|#define XML_MAX_NAME_LENGTH 50000
  ------------------
 3093|   223k|    int old10 = (ctxt->options & XML_PARSE_OLD10) ? 1 : 0;
  ------------------
  |  Branch (3093:17): [True: 50.4k, False: 173k]
  ------------------
 3094|       |
 3095|       |    /*
 3096|       |     * Handler for more complex cases
 3097|       |     */
 3098|   223k|    c = xmlCurrentChar(ctxt, &l);
 3099|   223k|    if (!xmlIsNameStartChar(c, old10))
  ------------------
  |  Branch (3099:9): [True: 164k, False: 59.4k]
  ------------------
 3100|   164k|        return(NULL);
 3101|  59.4k|    len += l;
 3102|  59.4k|    NEXTL(l);
  ------------------
  |  | 2288|  59.4k|#define NEXTL(l) do {							\
  |  | 2289|  59.4k|    if (*(ctxt->input->cur) == '\n') {					\
  |  |  ------------------
  |  |  |  Branch (2289:9): [True: 0, False: 59.4k]
  |  |  ------------------
  |  | 2290|      0|	ctxt->input->line++; ctxt->input->col = 1;			\
  |  | 2291|  59.4k|    } else ctxt->input->col++;						\
  |  | 2292|  59.4k|    ctxt->input->cur += l;				\
  |  | 2293|  59.4k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2293:12): [Folded, False: 59.4k]
  |  |  ------------------
  ------------------
 3103|  59.4k|    c = xmlCurrentChar(ctxt, &l);
 3104|  6.31M|    while (xmlIsNameChar(c, old10)) {
  ------------------
  |  Branch (3104:12): [True: 6.25M, False: 59.4k]
  ------------------
 3105|  6.25M|        if (len <= INT_MAX - l)
  ------------------
  |  Branch (3105:13): [True: 6.25M, False: 0]
  ------------------
 3106|  6.25M|            len += l;
 3107|  6.25M|        NEXTL(l);
  ------------------
  |  | 2288|  6.25M|#define NEXTL(l) do {							\
  |  | 2289|  6.25M|    if (*(ctxt->input->cur) == '\n') {					\
  |  |  ------------------
  |  |  |  Branch (2289:9): [True: 0, False: 6.25M]
  |  |  ------------------
  |  | 2290|      0|	ctxt->input->line++; ctxt->input->col = 1;			\
  |  | 2291|  6.25M|    } else ctxt->input->col++;						\
  |  | 2292|  6.25M|    ctxt->input->cur += l;				\
  |  | 2293|  6.25M|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2293:12): [Folded, False: 6.25M]
  |  |  ------------------
  ------------------
 3108|  6.25M|        c = xmlCurrentChar(ctxt, &l);
 3109|  6.25M|    }
 3110|  59.4k|    if (len > maxLength) {
  ------------------
  |  Branch (3110:9): [True: 63, False: 59.3k]
  ------------------
 3111|     63|        xmlFatalErr(ctxt, XML_ERR_NAME_TOO_LONG, "Name");
 3112|     63|        return(NULL);
 3113|     63|    }
 3114|  59.3k|    if (ctxt->input->cur - ctxt->input->base < len) {
  ------------------
  |  Branch (3114:9): [True: 0, False: 59.3k]
  ------------------
 3115|       |        /*
 3116|       |         * There were a couple of bugs where PERefs lead to to a change
 3117|       |         * of the buffer. Check the buffer size to avoid passing an invalid
 3118|       |         * pointer to xmlDictLookup.
 3119|       |         */
 3120|      0|        xmlFatalErr(ctxt, XML_ERR_INTERNAL_ERROR,
 3121|      0|                    "unexpected change of input buffer");
 3122|      0|        return (NULL);
 3123|      0|    }
 3124|  59.3k|    if ((*ctxt->input->cur == '\n') && (ctxt->input->cur[-1] == '\r'))
  ------------------
  |  Branch (3124:9): [True: 4.24k, False: 55.1k]
  |  Branch (3124:40): [True: 363, False: 3.88k]
  ------------------
 3125|    363|        ret = xmlDictLookup(ctxt->dict, ctxt->input->cur - (len + 1), len);
 3126|  59.0k|    else
 3127|  59.0k|        ret = xmlDictLookup(ctxt->dict, ctxt->input->cur - len, len);
 3128|  59.3k|    if (ret == NULL)
  ------------------
  |  Branch (3128:9): [True: 1, False: 59.3k]
  ------------------
 3129|      1|        xmlErrMemory(ctxt);
 3130|  59.3k|    return(ret);
 3131|  59.3k|}
parser.c:xmlSBufInit:
  682|   422k|xmlSBufInit(xmlSBuf *buf, unsigned max) {
  683|       |    buf->mem = NULL;
  684|   422k|    buf->size = 0;
  685|   422k|    buf->cap = 0;
  686|   422k|    buf->max = max;
  687|   422k|    buf->code = XML_ERR_OK;
  688|   422k|}
parser.c:xmlExpandPEsInEntityValue:
 3461|   242k|                          const xmlChar *str, int length, int depth) {
 3462|   242k|    int maxDepth = (ctxt->options & XML_PARSE_HUGE) ? 40 : 20;
  ------------------
  |  Branch (3462:20): [True: 60.3k, False: 181k]
  ------------------
 3463|   242k|    const xmlChar *end, *chunk;
 3464|   242k|    int c, l;
 3465|       |
 3466|   242k|    if (str == NULL)
  ------------------
  |  Branch (3466:9): [True: 134k, False: 107k]
  ------------------
 3467|   134k|        return;
 3468|       |
 3469|   107k|    depth += 1;
 3470|   107k|    if (depth > maxDepth) {
  ------------------
  |  Branch (3470:9): [True: 0, False: 107k]
  ------------------
 3471|      0|	xmlFatalErrMsg(ctxt, XML_ERR_RESOURCE_LIMIT,
 3472|      0|                       "Maximum entity nesting depth exceeded");
 3473|      0|	return;
 3474|      0|    }
 3475|       |
 3476|   107k|    end = str + length;
 3477|   107k|    chunk = str;
 3478|       |
 3479|  78.9M|    while ((str < end) && (!PARSER_STOPPED(ctxt))) {
  ------------------
  |  |   44|  78.9M|#define PARSER_STOPPED(ctxt) ((ctxt)->disableSAX > 1)
  ------------------
  |  Branch (3479:12): [True: 78.9M, False: 48.9k]
  |  Branch (3479:27): [True: 78.9M, False: 116]
  ------------------
 3480|  78.9M|        c = *str;
 3481|       |
 3482|  78.9M|        if (c >= 0x80) {
  ------------------
  |  Branch (3482:13): [True: 41.3M, False: 37.5M]
  ------------------
 3483|  41.3M|            l = xmlUTF8MultibyteLen(ctxt, str,
 3484|  41.3M|                    "invalid character in entity value\n");
 3485|  41.3M|            if (l == 0) {
  ------------------
  |  Branch (3485:17): [True: 16.6M, False: 24.7M]
  ------------------
 3486|  16.6M|                if (chunk < str)
  ------------------
  |  Branch (3486:21): [True: 115k, False: 16.5M]
  ------------------
 3487|   115k|                    xmlSBufAddString(buf, chunk, str - chunk);
 3488|  16.6M|                xmlSBufAddReplChar(buf);
 3489|  16.6M|                str += 1;
 3490|  16.6M|                chunk = str;
 3491|  24.7M|            } else {
 3492|  24.7M|                str += l;
 3493|  24.7M|            }
 3494|  41.3M|        } else if (c == '&') {
  ------------------
  |  Branch (3494:20): [True: 97.6k, False: 37.4M]
  ------------------
 3495|  97.6k|            if (str[1] == '#') {
  ------------------
  |  Branch (3495:17): [True: 25.8k, False: 71.7k]
  ------------------
 3496|  25.8k|                if (chunk < str)
  ------------------
  |  Branch (3496:21): [True: 21.4k, False: 4.47k]
  ------------------
 3497|  21.4k|                    xmlSBufAddString(buf, chunk, str - chunk);
 3498|       |
 3499|  25.8k|                c = xmlParseStringCharRef(ctxt, &str);
 3500|  25.8k|                if (c == 0)
  ------------------
  |  Branch (3500:21): [True: 2.20k, False: 23.6k]
  ------------------
 3501|  2.20k|                    return;
 3502|       |
 3503|  23.6k|                xmlSBufAddChar(buf, c);
 3504|       |
 3505|  23.6k|                chunk = str;
 3506|  71.7k|            } else {
 3507|  71.7k|                xmlChar *name;
 3508|       |
 3509|       |                /*
 3510|       |                 * General entity references are checked for
 3511|       |                 * syntactic validity.
 3512|       |                 */
 3513|  71.7k|                str++;
 3514|  71.7k|                name = xmlParseStringName(ctxt, &str);
 3515|       |
 3516|  71.7k|                if ((name == NULL) || (*str++ != ';')) {
  ------------------
  |  Branch (3516:21): [True: 3.79k, False: 67.9k]
  |  Branch (3516:39): [True: 5.42k, False: 62.5k]
  ------------------
 3517|  9.22k|                    xmlFatalErrMsg(ctxt, XML_ERR_ENTITY_CHAR_ERROR,
 3518|  9.22k|                            "EntityValue: '&' forbidden except for entities "
 3519|  9.22k|                            "references\n");
 3520|  9.22k|                    xmlFree(name);
 3521|  9.22k|                    return;
 3522|  9.22k|                }
 3523|       |
 3524|  62.5k|                xmlFree(name);
 3525|  62.5k|            }
 3526|  37.4M|        } else if (c == '%') {
  ------------------
  |  Branch (3526:20): [True: 187k, False: 37.2M]
  ------------------
 3527|   187k|            xmlEntityPtr ent;
 3528|       |
 3529|   187k|            if (chunk < str)
  ------------------
  |  Branch (3529:17): [True: 85.8k, False: 102k]
  ------------------
 3530|  85.8k|                xmlSBufAddString(buf, chunk, str - chunk);
 3531|       |
 3532|   187k|            ent = xmlParseStringPEReference(ctxt, &str);
 3533|   187k|            if (ent == NULL)
  ------------------
  |  Branch (3533:17): [True: 46.7k, False: 141k]
  ------------------
 3534|  46.7k|                return;
 3535|       |
 3536|   141k|            if (!PARSER_EXTERNAL(ctxt)) {
  ------------------
  |  |   55|   141k|    (((ctxt)->inSubset == 2) || \
  |  |  ------------------
  |  |  |  Branch (55:6): [True: 5.04k, False: 136k]
  |  |  ------------------
  |  |   56|   141k|     (((ctxt)->input->entity != NULL) && \
  |  |  ------------------
  |  |  |  Branch (56:7): [True: 136k, False: 49]
  |  |  ------------------
  |  |   57|   136k|      ((ctxt)->input->entity->etype == XML_EXTERNAL_PARAMETER_ENTITY)))
  |  |  ------------------
  |  |  |  Branch (57:7): [True: 136k, False: 0]
  |  |  ------------------
  ------------------
 3537|     49|                xmlFatalErr(ctxt, XML_ERR_ENTITY_PE_INTERNAL, NULL);
 3538|     49|                return;
 3539|     49|            }
 3540|       |
 3541|   141k|            if (ent->content == NULL) {
  ------------------
  |  Branch (3541:17): [True: 135k, False: 6.05k]
  ------------------
 3542|       |                /*
 3543|       |                 * Note: external parsed entities will not be loaded,
 3544|       |                 * it is not required for a non-validating parser to
 3545|       |                 * complete external PEReferences coming from the
 3546|       |                 * internal subset
 3547|       |                 */
 3548|   135k|                if (((ctxt->options & XML_PARSE_NO_XXE) == 0) &&
  ------------------
  |  Branch (3548:21): [True: 135k, False: 0]
  ------------------
 3549|   135k|                    ((ctxt->replaceEntities) ||
  ------------------
  |  Branch (3549:22): [True: 123k, False: 11.7k]
  ------------------
 3550|   133k|                     (ctxt->validate))) {
  ------------------
  |  Branch (3550:22): [True: 9.68k, False: 2.01k]
  ------------------
 3551|   133k|                    xmlLoadEntityContent(ctxt, ent);
 3552|   133k|                } else {
 3553|  2.01k|                    xmlWarningMsg(ctxt, XML_ERR_ENTITY_PROCESSING,
 3554|  2.01k|                                  "not validating will not read content for "
 3555|  2.01k|                                  "PE entity %s\n", ent->name, NULL);
 3556|  2.01k|                }
 3557|   135k|            }
 3558|       |
 3559|       |            /*
 3560|       |             * TODO: Skip if ent->content is still NULL.
 3561|       |             */
 3562|       |
 3563|   141k|            if (xmlParserEntityCheck(ctxt, ent->length))
  ------------------
  |  Branch (3563:17): [True: 24, False: 141k]
  ------------------
 3564|     24|                return;
 3565|       |
 3566|   141k|            if (ent->flags & XML_ENT_EXPANDING) {
  ------------------
  |  |   22|   141k|#define XML_ENT_EXPANDING   (1u << 3)
  ------------------
  |  Branch (3566:17): [True: 56, False: 141k]
  ------------------
 3567|     56|                xmlFatalErr(ctxt, XML_ERR_ENTITY_LOOP, NULL);
 3568|     56|                return;
 3569|     56|            }
 3570|       |
 3571|   141k|            ent->flags |= XML_ENT_EXPANDING;
  ------------------
  |  |   22|   141k|#define XML_ENT_EXPANDING   (1u << 3)
  ------------------
 3572|   141k|            xmlExpandPEsInEntityValue(ctxt, buf, ent->content, ent->length,
 3573|   141k|                                      depth);
 3574|   141k|            ent->flags &= ~XML_ENT_EXPANDING;
  ------------------
  |  |   22|   141k|#define XML_ENT_EXPANDING   (1u << 3)
  ------------------
 3575|       |
 3576|   141k|            chunk = str;
 3577|  37.2M|        } else {
 3578|       |            /* Normal ASCII char */
 3579|  37.2M|            if (!IS_BYTE_CHAR(c)) {
  ------------------
  |  |  103|  37.2M|#define IS_BYTE_CHAR(c)	 xmlIsChar_ch(c)
  |  |  ------------------
  |  |  |  |  108|  37.2M|#define xmlIsChar_ch(c)		(((0x9 <= (c)) && ((c) <= 0xa)) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (108:28): [True: 36.2M, False: 1.02M]
  |  |  |  |  |  Branch (108:44): [True: 4.68M, False: 31.5M]
  |  |  |  |  ------------------
  |  |  |  |  109|  37.2M|				 ((c) == 0xd) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (109:6): [True: 21.4k, False: 32.5M]
  |  |  |  |  ------------------
  |  |  |  |  110|  37.2M|				  (0x20 <= (c)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (110:7): [True: 31.3M, False: 1.22M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3580|  1.22M|                xmlFatalErrMsg(ctxt, XML_ERR_INVALID_CHAR,
 3581|  1.22M|                        "invalid character in entity value\n");
 3582|  1.22M|                if (chunk < str)
  ------------------
  |  Branch (3582:21): [True: 11.9k, False: 1.21M]
  ------------------
 3583|  11.9k|                    xmlSBufAddString(buf, chunk, str - chunk);
 3584|  1.22M|                xmlSBufAddReplChar(buf);
 3585|  1.22M|                str += 1;
 3586|  1.22M|                chunk = str;
 3587|  36.0M|            } else {
 3588|  36.0M|                str += 1;
 3589|  36.0M|            }
 3590|  37.2M|        }
 3591|  78.9M|    }
 3592|       |
 3593|  49.0k|    if (chunk < str)
  ------------------
  |  Branch (3593:9): [True: 44.9k, False: 4.11k]
  ------------------
 3594|  44.9k|        xmlSBufAddString(buf, chunk, str - chunk);
 3595|  49.0k|}
parser.c:xmlUTF8MultibyteLen:
  817|  89.5M|                    const char *errMsg) {
  818|  89.5M|    int c = str[0];
  819|  89.5M|    int c1 = str[1];
  820|       |
  821|  89.5M|    if ((c1 & 0xC0) != 0x80)
  ------------------
  |  Branch (821:9): [True: 45.8M, False: 43.7M]
  ------------------
  822|  45.8M|        goto encoding_error;
  823|       |
  824|  43.7M|    if (c < 0xE0) {
  ------------------
  |  Branch (824:9): [True: 14.2M, False: 29.4M]
  ------------------
  825|       |        /* 2-byte sequence */
  826|  14.2M|        if (c < 0xC2)
  ------------------
  |  Branch (826:13): [True: 13.4M, False: 834k]
  ------------------
  827|  13.4M|            goto encoding_error;
  828|       |
  829|   834k|        return(2);
  830|  29.4M|    } else {
  831|  29.4M|        int c2 = str[2];
  832|       |
  833|  29.4M|        if ((c2 & 0xC0) != 0x80)
  ------------------
  |  Branch (833:13): [True: 7.47k, False: 29.4M]
  ------------------
  834|  7.47k|            goto encoding_error;
  835|       |
  836|  29.4M|        if (c < 0xF0) {
  ------------------
  |  Branch (836:13): [True: 29.4M, False: 28.0k]
  ------------------
  837|       |            /* 3-byte sequence */
  838|  29.4M|            if (c == 0xE0) {
  ------------------
  |  Branch (838:17): [True: 5.02M, False: 24.4M]
  ------------------
  839|       |                /* overlong */
  840|  5.02M|                if (c1 < 0xA0)
  ------------------
  |  Branch (840:21): [True: 1.42k, False: 5.02M]
  ------------------
  841|  1.42k|                    goto encoding_error;
  842|  24.4M|            } else if (c == 0xED) {
  ------------------
  |  Branch (842:24): [True: 2.87k, False: 24.4M]
  ------------------
  843|       |                /* surrogate */
  844|  2.87k|                if (c1 >= 0xA0)
  ------------------
  |  Branch (844:21): [True: 215, False: 2.66k]
  ------------------
  845|    215|                    goto encoding_error;
  846|  24.4M|            } else if (c == 0xEF) {
  ------------------
  |  Branch (846:24): [True: 15.8M, False: 8.55M]
  ------------------
  847|       |                /* U+FFFE and U+FFFF are invalid Chars */
  848|  15.8M|                if ((c1 == 0xBF) && (c2 >= 0xBE))
  ------------------
  |  Branch (848:21): [True: 15.8M, False: 2.88k]
  |  Branch (848:37): [True: 209, False: 15.8M]
  ------------------
  849|    209|                    xmlFatalErrMsg(ctxt, XML_ERR_INVALID_CHAR, errMsg);
  850|  15.8M|            }
  851|       |
  852|  29.4M|            return(3);
  853|  29.4M|        } else {
  854|       |            /* 4-byte sequence */
  855|  28.0k|            if ((str[3] & 0xC0) != 0x80)
  ------------------
  |  Branch (855:17): [True: 3.08k, False: 25.0k]
  ------------------
  856|  3.08k|                goto encoding_error;
  857|  25.0k|            if (c == 0xF0) {
  ------------------
  |  Branch (857:17): [True: 1.09k, False: 23.9k]
  ------------------
  858|       |                /* overlong */
  859|  1.09k|                if (c1 < 0x90)
  ------------------
  |  Branch (859:21): [True: 582, False: 511]
  ------------------
  860|    582|                    goto encoding_error;
  861|  23.9k|            } else if (c >= 0xF4) {
  ------------------
  |  Branch (861:24): [True: 4.55k, False: 19.3k]
  ------------------
  862|       |                /* greater than 0x10FFFF */
  863|  4.55k|                if ((c > 0xF4) || (c1 >= 0x90))
  ------------------
  |  Branch (863:21): [True: 3.96k, False: 592]
  |  Branch (863:35): [True: 217, False: 375]
  ------------------
  864|  4.17k|                    goto encoding_error;
  865|  4.55k|            }
  866|       |
  867|  20.2k|            return(4);
  868|  25.0k|        }
  869|  29.4M|    }
  870|       |
  871|  59.2M|encoding_error:
  872|       |    /* Only report the first error */
  873|  59.2M|    if ((ctxt->input->flags & XML_INPUT_ENCODING_ERROR) == 0) {
  ------------------
  |  |   40|  59.2M|#define XML_INPUT_ENCODING_ERROR    (1u << 5)
  ------------------
  |  Branch (873:9): [True: 16.8k, False: 59.2M]
  ------------------
  874|  16.8k|        xmlCtxtErrIO(ctxt, XML_ERR_INVALID_ENCODING, NULL);
  875|  16.8k|        ctxt->input->flags |= XML_INPUT_ENCODING_ERROR;
  ------------------
  |  |   40|  16.8k|#define XML_INPUT_ENCODING_ERROR    (1u << 5)
  ------------------
  876|  16.8k|    }
  877|       |
  878|  59.2M|    return(0);
  879|  43.7M|}
parser.c:xmlSBufAddString:
  718|  99.6M|xmlSBufAddString(xmlSBuf *buf, const xmlChar *str, unsigned len) {
  719|  99.6M|    if (buf->max - buf->size < len) {
  ------------------
  |  Branch (719:9): [True: 0, False: 99.6M]
  ------------------
  720|      0|        if (buf->code == XML_ERR_OK)
  ------------------
  |  Branch (720:13): [True: 0, False: 0]
  ------------------
  721|      0|            buf->code = XML_ERR_RESOURCE_LIMIT;
  722|      0|        return;
  723|      0|    }
  724|       |
  725|  99.6M|    if (buf->cap - buf->size <= len) {
  ------------------
  |  Branch (725:9): [True: 373k, False: 99.2M]
  ------------------
  726|   373k|        if (xmlSBufGrow(buf, len) < 0)
  ------------------
  |  Branch (726:13): [True: 75, False: 373k]
  ------------------
  727|     75|            return;
  728|   373k|    }
  729|       |
  730|  99.6M|    if (len > 0)
  ------------------
  |  Branch (730:9): [True: 99.6M, False: 0]
  ------------------
  731|  99.6M|        memcpy(buf->mem + buf->size, str, len);
  732|  99.6M|    buf->size += len;
  733|  99.6M|}
parser.c:xmlSBufGrow:
  691|   378k|xmlSBufGrow(xmlSBuf *buf, unsigned len) {
  692|   378k|    xmlChar *mem;
  693|   378k|    unsigned cap;
  694|       |
  695|   378k|    if (len >= UINT_MAX / 2 - buf->size) {
  ------------------
  |  Branch (695:9): [True: 0, False: 378k]
  ------------------
  696|      0|        if (buf->code == XML_ERR_OK)
  ------------------
  |  Branch (696:13): [True: 0, False: 0]
  ------------------
  697|      0|            buf->code = XML_ERR_RESOURCE_LIMIT;
  698|      0|        return(-1);
  699|      0|    }
  700|       |
  701|   378k|    cap = (buf->size + len) * 2;
  702|   378k|    if (cap < 240)
  ------------------
  |  Branch (702:9): [True: 265k, False: 113k]
  ------------------
  703|   265k|        cap = 240;
  704|       |
  705|   378k|    mem = xmlRealloc(buf->mem, cap);
  706|   378k|    if (mem == NULL) {
  ------------------
  |  Branch (706:9): [True: 81, False: 378k]
  ------------------
  707|     81|        buf->code = XML_ERR_NO_MEMORY;
  708|     81|        return(-1);
  709|     81|    }
  710|       |
  711|   378k|    buf->mem = mem;
  712|   378k|    buf->cap = cap;
  713|       |
  714|   378k|    return(0);
  715|   378k|}
parser.c:xmlSBufAddReplChar:
  766|  84.3M|xmlSBufAddReplChar(xmlSBuf *buf) {
  767|  84.3M|    xmlSBufAddCString(buf, "\xEF\xBF\xBD", 3);
  768|  84.3M|}
parser.c:xmlSBufAddCString:
  736|  93.8M|xmlSBufAddCString(xmlSBuf *buf, const char *str, unsigned len) {
  737|  93.8M|    xmlSBufAddString(buf, (const xmlChar *) str, len);
  738|  93.8M|}
parser.c:xmlParseStringCharRef:
 2634|   822k|xmlParseStringCharRef(xmlParserCtxtPtr ctxt, const xmlChar **str) {
 2635|   822k|    const xmlChar *ptr;
 2636|   822k|    xmlChar cur;
 2637|   822k|    int val = 0;
 2638|       |
 2639|   822k|    if ((str == NULL) || (*str == NULL)) return(0);
  ------------------
  |  Branch (2639:9): [True: 0, False: 822k]
  |  Branch (2639:26): [True: 0, False: 822k]
  ------------------
 2640|   822k|    ptr = *str;
 2641|   822k|    cur = *ptr;
 2642|   822k|    if ((cur == '&') && (ptr[1] == '#') && (ptr[2] == 'x')) {
  ------------------
  |  Branch (2642:9): [True: 822k, False: 0]
  |  Branch (2642:25): [True: 822k, False: 0]
  |  Branch (2642:44): [True: 22.9k, False: 799k]
  ------------------
 2643|  22.9k|	ptr += 3;
 2644|  22.9k|	cur = *ptr;
 2645|  86.7k|	while (cur != ';') { /* Non input consuming loop */
  ------------------
  |  Branch (2645:9): [True: 64.3k, False: 22.3k]
  ------------------
 2646|  64.3k|	    if ((cur >= '0') && (cur <= '9'))
  ------------------
  |  Branch (2646:10): [True: 64.1k, False: 256]
  |  Branch (2646:26): [True: 41.0k, False: 23.0k]
  ------------------
 2647|  41.0k|	        val = val * 16 + (cur - '0');
 2648|  23.3k|	    else if ((cur >= 'a') && (cur <= 'f'))
  ------------------
  |  Branch (2648:15): [True: 7.46k, False: 15.8k]
  |  Branch (2648:31): [True: 7.24k, False: 221]
  ------------------
 2649|  7.24k|	        val = val * 16 + (cur - 'a') + 10;
 2650|  16.0k|	    else if ((cur >= 'A') && (cur <= 'F'))
  ------------------
  |  Branch (2650:15): [True: 15.8k, False: 267]
  |  Branch (2650:31): [True: 15.4k, False: 370]
  ------------------
 2651|  15.4k|	        val = val * 16 + (cur - 'A') + 10;
 2652|    637|	    else {
 2653|    637|		xmlFatalErr(ctxt, XML_ERR_INVALID_HEX_CHARREF, NULL);
 2654|    637|		val = 0;
 2655|    637|		break;
 2656|    637|	    }
 2657|  63.7k|	    if (val > 0x110000)
  ------------------
  |  Branch (2657:10): [True: 9.90k, False: 53.8k]
  ------------------
 2658|  9.90k|	        val = 0x110000;
 2659|       |
 2660|  63.7k|	    ptr++;
 2661|  63.7k|	    cur = *ptr;
 2662|  63.7k|	}
 2663|  22.9k|	if (cur == ';')
  ------------------
  |  Branch (2663:6): [True: 22.3k, False: 637]
  ------------------
 2664|  22.3k|	    ptr++;
 2665|   799k|    } else if  ((cur == '&') && (ptr[1] == '#')){
  ------------------
  |  Branch (2665:17): [True: 799k, False: 0]
  |  Branch (2665:33): [True: 799k, False: 0]
  ------------------
 2666|   799k|	ptr += 2;
 2667|   799k|	cur = *ptr;
 2668|  2.40M|	while (cur != ';') { /* Non input consuming loops */
  ------------------
  |  Branch (2668:9): [True: 1.60M, False: 798k]
  ------------------
 2669|  1.60M|	    if ((cur >= '0') && (cur <= '9'))
  ------------------
  |  Branch (2669:10): [True: 1.60M, False: 243]
  |  Branch (2669:26): [True: 1.60M, False: 345]
  ------------------
 2670|  1.60M|	        val = val * 10 + (cur - '0');
 2671|    588|	    else {
 2672|    588|		xmlFatalErr(ctxt, XML_ERR_INVALID_DEC_CHARREF, NULL);
 2673|    588|		val = 0;
 2674|    588|		break;
 2675|    588|	    }
 2676|  1.60M|	    if (val > 0x110000)
  ------------------
  |  Branch (2676:10): [True: 1.58k, False: 1.60M]
  ------------------
 2677|  1.58k|	        val = 0x110000;
 2678|       |
 2679|  1.60M|	    ptr++;
 2680|  1.60M|	    cur = *ptr;
 2681|  1.60M|	}
 2682|   799k|	if (cur == ';')
  ------------------
  |  Branch (2682:6): [True: 798k, False: 588]
  ------------------
 2683|   798k|	    ptr++;
 2684|   799k|    } else {
 2685|      0|	xmlFatalErr(ctxt, XML_ERR_INVALID_CHARREF, NULL);
 2686|      0|	return(0);
 2687|      0|    }
 2688|   822k|    *str = ptr;
 2689|       |
 2690|       |    /*
 2691|       |     * [ WFC: Legal Character ]
 2692|       |     * Characters referred to using character references must match the
 2693|       |     * production for Char.
 2694|       |     */
 2695|   822k|    if (val >= 0x110000) {
  ------------------
  |  Branch (2695:9): [True: 221, False: 821k]
  ------------------
 2696|    221|        xmlFatalErrMsgInt(ctxt, XML_ERR_INVALID_CHAR,
 2697|    221|                "xmlParseStringCharRef: character reference out of bounds\n",
 2698|    221|                val);
 2699|   821k|    } else if (IS_CHAR(val)) {
  ------------------
  |  |  115|   821k|#define IS_CHAR(c)   xmlIsCharQ(c)
  |  |  ------------------
  |  |  |  |  117|   821k|#define xmlIsCharQ(c)		(((c) < 0x100) ? \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (117:24): [True: 819k, False: 1.99k]
  |  |  |  |  |  Branch (117:25): [True: 813k, False: 8.58k]
  |  |  |  |  ------------------
  |  |  |  |  118|   821k|				 xmlIsChar_ch((c)) :\
  |  |  |  |  ------------------
  |  |  |  |  |  |  108|   813k|#define xmlIsChar_ch(c)		(((0x9 <= (c)) && ((c) <= 0xa)) || \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (108:28): [True: 811k, False: 1.85k]
  |  |  |  |  |  |  |  Branch (108:44): [True: 1.36k, False: 810k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  109|   813k|				 ((c) == 0xd) || \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (109:6): [True: 1.47k, False: 810k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  110|   813k|				  (0x20 <= (c)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (110:7): [True: 808k, False: 1.86k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  119|   821k|				(((0x100 <= (c)) && ((c) <= 0xd7ff)) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (119:7): [True: 8.58k, False: 0]
  |  |  |  |  |  Branch (119:25): [True: 7.25k, False: 1.33k]
  |  |  |  |  ------------------
  |  |  |  |  120|  8.58k|				 ((0xe000 <= (c)) && ((c) <= 0xfffd)) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (120:7): [True: 1.22k, False: 112]
  |  |  |  |  |  Branch (120:26): [True: 194, False: 1.02k]
  |  |  |  |  ------------------
  |  |  |  |  121|  8.58k|				 ((0x10000 <= (c)) && ((c) <= 0x10ffff))))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (121:7): [True: 1.02k, False: 121]
  |  |  |  |  |  Branch (121:27): [True: 1.02k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2700|   819k|        return(val);
 2701|   819k|    } else {
 2702|  1.99k|        xmlFatalErrMsgInt(ctxt, XML_ERR_INVALID_CHAR,
 2703|  1.99k|			  "xmlParseStringCharRef: invalid xmlChar value %d\n",
 2704|  1.99k|			  val);
 2705|  1.99k|    }
 2706|  2.21k|    return(0);
 2707|   822k|}
parser.c:xmlSBufAddChar:
  741|   847k|xmlSBufAddChar(xmlSBuf *buf, int c) {
  742|   847k|    xmlChar *end;
  743|       |
  744|   847k|    if (buf->max - buf->size < 4) {
  ------------------
  |  Branch (744:9): [True: 0, False: 847k]
  ------------------
  745|      0|        if (buf->code == XML_ERR_OK)
  ------------------
  |  Branch (745:13): [True: 0, False: 0]
  ------------------
  746|      0|            buf->code = XML_ERR_RESOURCE_LIMIT;
  747|      0|        return;
  748|      0|    }
  749|       |
  750|   847k|    if (buf->cap - buf->size <= 4) {
  ------------------
  |  Branch (750:9): [True: 4.87k, False: 842k]
  ------------------
  751|  4.87k|        if (xmlSBufGrow(buf, 4) < 0)
  ------------------
  |  Branch (751:13): [True: 6, False: 4.86k]
  ------------------
  752|      6|            return;
  753|  4.87k|    }
  754|       |
  755|   847k|    end = buf->mem + buf->size;
  756|       |
  757|   847k|    if (c < 0x80) {
  ------------------
  |  Branch (757:9): [True: 841k, False: 5.53k]
  ------------------
  758|   841k|        *end = (xmlChar) c;
  759|   841k|        buf->size += 1;
  760|   841k|    } else {
  761|  5.53k|        buf->size += xmlCopyCharMultiByte(end, c);
  762|  5.53k|    }
  763|   847k|}
parser.c:xmlParseStringName:
 3340|  2.15M|xmlParseStringName(xmlParserCtxtPtr ctxt, const xmlChar** str) {
 3341|  2.15M|    xmlChar *ret;
 3342|  2.15M|    const xmlChar *cur = *str;
 3343|  2.15M|    int flags = 0;
 3344|  2.15M|    int maxLength = (ctxt->options & XML_PARSE_HUGE) ?
  ------------------
  |  Branch (3344:21): [True: 929k, False: 1.22M]
  ------------------
 3345|   929k|                    XML_MAX_TEXT_LENGTH :
  ------------------
  |  |   50|   929k|#define XML_MAX_TEXT_LENGTH 10000000
  ------------------
 3346|  2.15M|                    XML_MAX_NAME_LENGTH;
  ------------------
  |  |   65|  1.22M|#define XML_MAX_NAME_LENGTH 50000
  ------------------
 3347|       |
 3348|  2.15M|    if (ctxt->options & XML_PARSE_OLD10)
  ------------------
  |  Branch (3348:9): [True: 712k, False: 1.44M]
  ------------------
 3349|   712k|        flags |= XML_SCAN_OLD10;
  ------------------
  |  |   71|   712k|#define XML_SCAN_OLD10      4
  ------------------
 3350|       |
 3351|  2.15M|    cur = xmlScanName(*str, maxLength, flags);
 3352|  2.15M|    if (cur == NULL) {
  ------------------
  |  Branch (3352:9): [True: 56, False: 2.15M]
  ------------------
 3353|     56|        xmlFatalErr(ctxt, XML_ERR_NAME_TOO_LONG, "NCName");
 3354|     56|        return(NULL);
 3355|     56|    }
 3356|  2.15M|    if (cur == *str)
  ------------------
  |  Branch (3356:9): [True: 5.55k, False: 2.14M]
  ------------------
 3357|  5.55k|        return(NULL);
 3358|       |
 3359|  2.14M|    ret = xmlStrndup(*str, cur - *str);
 3360|  2.14M|    if (ret == NULL)
  ------------------
  |  Branch (3360:9): [True: 27, False: 2.14M]
  ------------------
 3361|     27|        xmlErrMemory(ctxt);
 3362|  2.14M|    *str = cur;
 3363|  2.14M|    return(ret);
 3364|  2.15M|}
parser.c:xmlParseStringPEReference:
 7861|   187k|xmlParseStringPEReference(xmlParserCtxtPtr ctxt, const xmlChar **str) {
 7862|   187k|    const xmlChar *ptr;
 7863|   187k|    xmlChar cur;
 7864|   187k|    xmlChar *name;
 7865|   187k|    xmlEntityPtr entity = NULL;
 7866|       |
 7867|   187k|    if ((str == NULL) || (*str == NULL)) return(NULL);
  ------------------
  |  Branch (7867:9): [True: 0, False: 187k]
  |  Branch (7867:26): [True: 0, False: 187k]
  ------------------
 7868|   187k|    ptr = *str;
 7869|   187k|    cur = *ptr;
 7870|   187k|    if (cur != '%')
  ------------------
  |  Branch (7870:9): [True: 0, False: 187k]
  ------------------
 7871|      0|        return(NULL);
 7872|   187k|    ptr++;
 7873|   187k|    name = xmlParseStringName(ctxt, &ptr);
 7874|   187k|    if (name == NULL) {
  ------------------
  |  Branch (7874:9): [True: 1.82k, False: 186k]
  ------------------
 7875|  1.82k|	xmlFatalErrMsg(ctxt, XML_ERR_NAME_REQUIRED,
 7876|  1.82k|		       "xmlParseStringPEReference: no name\n");
 7877|  1.82k|	*str = ptr;
 7878|  1.82k|	return(NULL);
 7879|  1.82k|    }
 7880|   186k|    cur = *ptr;
 7881|   186k|    if (cur != ';') {
  ------------------
  |  Branch (7881:9): [True: 2.58k, False: 183k]
  ------------------
 7882|  2.58k|	xmlFatalErr(ctxt, XML_ERR_ENTITYREF_SEMICOL_MISSING, NULL);
 7883|  2.58k|	xmlFree(name);
 7884|  2.58k|	*str = ptr;
 7885|  2.58k|	return(NULL);
 7886|  2.58k|    }
 7887|   183k|    ptr++;
 7888|       |
 7889|       |    /* Must be set before xmlHandleUndeclaredEntity */
 7890|   183k|    ctxt->hasPErefs = 1;
 7891|       |
 7892|       |    /*
 7893|       |     * Request the entity from SAX
 7894|       |     */
 7895|   183k|    if ((ctxt->sax != NULL) &&
  ------------------
  |  Branch (7895:9): [True: 183k, False: 0]
  ------------------
 7896|   183k|	(ctxt->sax->getParameterEntity != NULL))
  ------------------
  |  Branch (7896:2): [True: 183k, False: 0]
  ------------------
 7897|   183k|	entity = ctxt->sax->getParameterEntity(ctxt->userData, name);
 7898|       |
 7899|   183k|    if (entity == NULL) {
  ------------------
  |  Branch (7899:9): [True: 42.3k, False: 141k]
  ------------------
 7900|  42.3k|        xmlHandleUndeclaredEntity(ctxt, name);
 7901|   141k|    } else {
 7902|       |	/*
 7903|       |	 * Internal checking in case the entity quest barfed
 7904|       |	 */
 7905|   141k|	if ((entity->etype != XML_INTERNAL_PARAMETER_ENTITY) &&
  ------------------
  |  Branch (7905:6): [True: 135k, False: 5.32k]
  ------------------
 7906|   135k|	    (entity->etype != XML_EXTERNAL_PARAMETER_ENTITY)) {
  ------------------
  |  Branch (7906:6): [True: 0, False: 135k]
  ------------------
 7907|      0|	    xmlWarningMsg(ctxt, XML_WAR_UNDECLARED_ENTITY,
 7908|      0|			  "%%%s; is not a parameter entity\n",
 7909|      0|			  name, NULL);
 7910|      0|	}
 7911|   141k|    }
 7912|       |
 7913|   183k|    xmlFree(name);
 7914|   183k|    *str = ptr;
 7915|   183k|    return(entity);
 7916|   186k|}
parser.c:xmlHandleUndeclaredEntity:
 7334|   405k|xmlHandleUndeclaredEntity(xmlParserCtxtPtr ctxt, const xmlChar *name) {
 7335|       |    /*
 7336|       |     * [ WFC: Entity Declared ]
 7337|       |     * In a document without any DTD, a document with only an
 7338|       |     * internal DTD subset which contains no parameter entity
 7339|       |     * references, or a document with "standalone='yes'", the
 7340|       |     * Name given in the entity reference must match that in an
 7341|       |     * entity declaration, except that well-formed documents
 7342|       |     * need not declare any of the following entities: amp, lt,
 7343|       |     * gt, apos, quot.
 7344|       |     * The declaration of a parameter entity must precede any
 7345|       |     * reference to it.
 7346|       |     * Similarly, the declaration of a general entity must
 7347|       |     * precede any reference to it which appears in a default
 7348|       |     * value in an attribute-list declaration. Note that if
 7349|       |     * entities are declared in the external subset or in
 7350|       |     * external parameter entities, a non-validating processor
 7351|       |     * is not obligated to read and process their declarations;
 7352|       |     * for such documents, the rule that an entity must be
 7353|       |     * declared is a well-formedness constraint only if
 7354|       |     * standalone='yes'.
 7355|       |     */
 7356|   405k|    if ((ctxt->standalone == 1) ||
  ------------------
  |  Branch (7356:9): [True: 755, False: 404k]
  ------------------
 7357|   404k|        ((ctxt->hasExternalSubset == 0) &&
  ------------------
  |  Branch (7357:10): [True: 401k, False: 3.82k]
  ------------------
 7358|   401k|         (ctxt->hasPErefs == 0))) {
  ------------------
  |  Branch (7358:10): [True: 137k, False: 263k]
  ------------------
 7359|   138k|        xmlFatalErrMsgStr(ctxt, XML_ERR_UNDECLARED_ENTITY,
 7360|   138k|                          "Entity '%s' not defined\n", name);
 7361|   138k|#ifdef LIBXML_VALID_ENABLED
 7362|   266k|    } else if (ctxt->validate) {
  ------------------
  |  Branch (7362:16): [True: 224k, False: 42.0k]
  ------------------
 7363|       |        /*
 7364|       |         * [ VC: Entity Declared ]
 7365|       |         * In a document with an external subset or external
 7366|       |         * parameter entities with "standalone='no'", ...
 7367|       |         * ... The declaration of a parameter entity must
 7368|       |         * precede any reference to it...
 7369|       |         */
 7370|   224k|        xmlValidityError(ctxt, XML_ERR_UNDECLARED_ENTITY,
 7371|   224k|                         "Entity '%s' not defined\n", name, NULL);
 7372|   224k|#endif
 7373|   224k|    } else if ((ctxt->loadsubset & ~XML_SKIP_IDS) ||
  ------------------
  |  |  210|  42.0k|#define XML_SKIP_IDS		8
  ------------------
  |  Branch (7373:16): [True: 34.2k, False: 7.84k]
  ------------------
 7374|  7.84k|               ((ctxt->replaceEntities) &&
  ------------------
  |  Branch (7374:17): [True: 7.35k, False: 490]
  ------------------
 7375|  41.0k|                ((ctxt->options & XML_PARSE_NO_XXE) == 0))) {
  ------------------
  |  Branch (7375:17): [True: 6.83k, False: 526]
  ------------------
 7376|       |        /*
 7377|       |         * Also raise a non-fatal error
 7378|       |         *
 7379|       |         * - if the external subset is loaded and all entity declarations
 7380|       |         *   should be available, or
 7381|       |         * - entity substition was requested without restricting
 7382|       |         *   external entity access.
 7383|       |         */
 7384|  41.0k|        xmlErrMsgStr(ctxt, XML_WAR_UNDECLARED_ENTITY,
 7385|  41.0k|                     "Entity '%s' not defined\n", name);
 7386|  41.0k|    } else {
 7387|  1.01k|        xmlWarningMsg(ctxt, XML_WAR_UNDECLARED_ENTITY,
 7388|  1.01k|                      "Entity '%s' not defined\n", name, NULL);
 7389|  1.01k|    }
 7390|       |
 7391|   405k|    ctxt->valid = 0;
 7392|   405k|}
parser.c:xmlErrMsgStr:
  364|  41.0k|{
  365|  41.0k|    xmlCtxtErr(ctxt, NULL, XML_FROM_PARSER, error, XML_ERR_ERROR,
  366|  41.0k|               val, NULL, NULL, 0, msg, val);
  367|  41.0k|}
parser.c:xmlLoadEntityContent:
 7698|   133k|xmlLoadEntityContent(xmlParserCtxtPtr ctxt, xmlEntityPtr entity) {
 7699|   133k|    xmlParserInputPtr oldinput, input = NULL;
 7700|   133k|    xmlParserInputPtr *oldinputTab;
 7701|   133k|    xmlChar *oldencoding;
 7702|   133k|    xmlChar *content = NULL;
 7703|   133k|    xmlResourceType rtype;
 7704|   133k|    size_t length, i;
 7705|   133k|    int oldinputNr, oldinputMax;
 7706|   133k|    int ret = -1;
 7707|   133k|    int res;
 7708|       |
 7709|   133k|    if ((ctxt == NULL) || (entity == NULL) ||
  ------------------
  |  Branch (7709:9): [True: 0, False: 133k]
  |  Branch (7709:27): [True: 0, False: 133k]
  ------------------
 7710|   133k|        ((entity->etype != XML_EXTERNAL_PARAMETER_ENTITY) &&
  ------------------
  |  Branch (7710:10): [True: 0, False: 133k]
  ------------------
 7711|      0|	 (entity->etype != XML_EXTERNAL_GENERAL_PARSED_ENTITY)) ||
  ------------------
  |  Branch (7711:3): [True: 0, False: 0]
  ------------------
 7712|   133k|	(entity->content != NULL)) {
  ------------------
  |  Branch (7712:2): [True: 0, False: 133k]
  ------------------
 7713|      0|	xmlFatalErr(ctxt, XML_ERR_ARGUMENT,
 7714|      0|	            "xmlLoadEntityContent parameter error");
 7715|      0|        return(-1);
 7716|      0|    }
 7717|       |
 7718|   133k|    if (entity->etype == XML_EXTERNAL_PARAMETER_ENTITY)
  ------------------
  |  Branch (7718:9): [True: 133k, False: 0]
  ------------------
 7719|   133k|        rtype = XML_RESOURCE_PARAMETER_ENTITY;
 7720|      0|    else
 7721|      0|        rtype = XML_RESOURCE_GENERAL_ENTITY;
 7722|       |
 7723|   133k|    input = xmlLoadResource(ctxt, (char *) entity->URI,
 7724|   133k|                            (char *) entity->ExternalID, rtype);
 7725|   133k|    if (input == NULL)
  ------------------
  |  Branch (7725:9): [True: 769, False: 132k]
  ------------------
 7726|    769|        return(-1);
 7727|       |
 7728|   132k|    oldinput = ctxt->input;
 7729|   132k|    oldinputNr = ctxt->inputNr;
 7730|   132k|    oldinputMax = ctxt->inputMax;
 7731|   132k|    oldinputTab = ctxt->inputTab;
 7732|   132k|    oldencoding = ctxt->encoding;
 7733|       |
 7734|   132k|    ctxt->input = NULL;
 7735|   132k|    ctxt->inputNr = 0;
 7736|   132k|    ctxt->inputMax = 1;
 7737|   132k|    ctxt->encoding = NULL;
 7738|   132k|    ctxt->inputTab = xmlMalloc(sizeof(xmlParserInputPtr));
 7739|   132k|    if (ctxt->inputTab == NULL) {
  ------------------
  |  Branch (7739:9): [True: 4, False: 132k]
  ------------------
 7740|      4|        xmlErrMemory(ctxt);
 7741|      4|        xmlFreeInputStream(input);
 7742|      4|        goto error;
 7743|      4|    }
 7744|       |
 7745|   132k|    xmlBufResetInput(input->buf->buffer, input);
 7746|       |
 7747|   132k|    if (xmlCtxtPushInput(ctxt, input) < 0) {
  ------------------
  |  Branch (7747:9): [True: 7, False: 132k]
  ------------------
 7748|      7|        xmlFreeInputStream(input);
 7749|      7|        goto error;
 7750|      7|    }
 7751|       |
 7752|   132k|    xmlDetectEncoding(ctxt);
 7753|       |
 7754|       |    /*
 7755|       |     * Parse a possible text declaration first
 7756|       |     */
 7757|   132k|    if ((CMP5(CUR_PTR, '<', '?', 'x', 'm', 'l')) && (IS_BLANK_CH(NXT(5)))) {
  ------------------
  |  | 2234|   132k|  ( CMP4( s, c1, c2, c3, c4 ) && ((unsigned char *) s)[ 4 ] == c5 )
  |  |  ------------------
  |  |  |  | 2231|   264k|  ( ((unsigned char *) s)[ 0 ] == c1 && ((unsigned char *) s)[ 1 ] == c2 && \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2231:5): [True: 128k, False: 3.64k]
  |  |  |  |  |  Branch (2231:41): [True: 126k, False: 1.69k]
  |  |  |  |  ------------------
  |  |  |  | 2232|   132k|    ((unsigned char *) s)[ 2 ] == c3 && ((unsigned char *) s)[ 3 ] == c4 )
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2232:5): [True: 126k, False: 242]
  |  |  |  |  |  Branch (2232:41): [True: 126k, False: 223]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2234:34): [True: 126k, False: 415]
  |  |  ------------------
  ------------------
                  if ((CMP5(CUR_PTR, '<', '?', 'x', 'm', 'l')) && (IS_BLANK_CH(NXT(5)))) {
  ------------------
  |  |  137|   126k|#define IS_BLANK_CH(c)  xmlIsBlank_ch(c)
  |  |  ------------------
  |  |  |  |   90|   126k|#define xmlIsBlank_ch(c)	(((c) == 0x20) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (90:27): [True: 124k, False: 1.55k]
  |  |  |  |  ------------------
  |  |  |  |   91|   126k|				 ((0x9 <= (c)) && ((c) <= 0xa)) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (91:7): [True: 1.31k, False: 242]
  |  |  |  |  |  Branch (91:23): [True: 205, False: 1.10k]
  |  |  |  |  ------------------
  |  |  |  |   92|   126k|				 ((c) == 0xd))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (92:6): [True: 1.06k, False: 281]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 7758|   125k|	xmlParseTextDecl(ctxt);
 7759|       |        /*
 7760|       |         * An XML-1.0 document can't reference an entity not XML-1.0
 7761|       |         */
 7762|   125k|        if ((xmlStrEqual(ctxt->version, BAD_CAST "1.0")) &&
  ------------------
  |  |   34|   125k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (7762:13): [True: 1.08k, False: 124k]
  ------------------
 7763|  1.08k|            (!xmlStrEqual(ctxt->input->version, BAD_CAST "1.0"))) {
  ------------------
  |  |   34|  1.08k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (7763:13): [True: 229, False: 852]
  ------------------
 7764|    229|            xmlFatalErrMsg(ctxt, XML_ERR_VERSION_MISMATCH,
 7765|    229|                           "Version mismatch between document and entity\n");
 7766|    229|        }
 7767|   125k|    }
 7768|       |
 7769|   132k|    length = input->cur - input->base;
 7770|   132k|    xmlBufShrink(input->buf->buffer, length);
 7771|   132k|    xmlSaturatedAdd(&ctxt->sizeentities, length);
 7772|       |
 7773|   141k|    while ((res = xmlParserInputBufferGrow(input->buf, 4096)) > 0)
  ------------------
  |  Branch (7773:12): [True: 9.17k, False: 132k]
  ------------------
 7774|  9.17k|        ;
 7775|       |
 7776|   132k|    xmlBufResetInput(input->buf->buffer, input);
 7777|       |
 7778|   132k|    if (res < 0) {
  ------------------
  |  Branch (7778:9): [True: 1.04k, False: 131k]
  ------------------
 7779|  1.04k|        xmlCtxtErrIO(ctxt, input->buf->error, NULL);
 7780|  1.04k|        goto error;
 7781|  1.04k|    }
 7782|       |
 7783|   131k|    length = xmlBufUse(input->buf->buffer);
 7784|   131k|    if (length > INT_MAX) {
  ------------------
  |  Branch (7784:9): [True: 0, False: 131k]
  ------------------
 7785|      0|        xmlErrMemory(ctxt);
 7786|      0|        goto error;
 7787|      0|    }
 7788|       |
 7789|   131k|    content = xmlStrndup(xmlBufContent(input->buf->buffer), length);
 7790|   131k|    if (content == NULL) {
  ------------------
  |  Branch (7790:9): [True: 2, False: 131k]
  ------------------
 7791|      2|        xmlErrMemory(ctxt);
 7792|      2|        goto error;
 7793|      2|    }
 7794|       |
 7795|  16.1M|    for (i = 0; i < length; ) {
  ------------------
  |  Branch (7795:17): [True: 16.1M, False: 161]
  ------------------
 7796|  16.1M|        int clen = length - i;
 7797|  16.1M|        int c = xmlGetUTF8Char(content + i, &clen);
 7798|       |
 7799|  16.1M|        if ((c < 0) || (!IS_CHAR(c))) {
  ------------------
  |  |  115|  16.0M|#define IS_CHAR(c)   xmlIsCharQ(c)
  |  |  ------------------
  |  |  |  |  117|  16.0M|#define xmlIsCharQ(c)		(((c) < 0x100) ? \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (117:25): [True: 13.9M, False: 2.08M]
  |  |  |  |  ------------------
  |  |  |  |  118|  16.0M|				 xmlIsChar_ch((c)) :\
  |  |  |  |  ------------------
  |  |  |  |  |  |  108|  13.9M|#define xmlIsChar_ch(c)		(((0x9 <= (c)) && ((c) <= 0xa)) || \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (108:28): [True: 13.9M, False: 3.91k]
  |  |  |  |  |  |  |  Branch (108:44): [True: 235k, False: 13.7M]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  109|  13.9M|				 ((c) == 0xd) || \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (109:6): [True: 161k, False: 13.5M]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  110|  13.9M|				  (0x20 <= (c)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (110:7): [True: 13.5M, False: 10.3k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  119|  16.0M|				(((0x100 <= (c)) && ((c) <= 0xd7ff)) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (119:7): [True: 2.08M, False: 0]
  |  |  |  |  |  Branch (119:25): [True: 2.07M, False: 5.85k]
  |  |  |  |  ------------------
  |  |  |  |  120|  2.08M|				 ((0xe000 <= (c)) && ((c) <= 0xfffd)) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (120:7): [True: 5.85k, False: 0]
  |  |  |  |  |  Branch (120:26): [True: 3.46k, False: 2.39k]
  |  |  |  |  ------------------
  |  |  |  |  121|  2.08M|				 ((0x10000 <= (c)) && ((c) <= 0x10ffff))))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (121:7): [True: 1.45k, False: 945]
  |  |  |  |  |  Branch (121:27): [True: 1.45k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (7799:13): [True: 119k, False: 16.0M]
  |  Branch (7799:24): [True: 11.2k, False: 16.0M]
  ------------------
 7800|   131k|            xmlFatalErrMsgInt(ctxt, XML_ERR_INVALID_CHAR,
 7801|   131k|                              "xmlLoadEntityContent: invalid char value %d\n",
 7802|   131k|                              content[i]);
 7803|   131k|            goto error;
 7804|   131k|        }
 7805|  16.0M|        i += clen;
 7806|  16.0M|    }
 7807|       |
 7808|    161|    xmlSaturatedAdd(&ctxt->sizeentities, length);
 7809|    161|    entity->content = content;
 7810|    161|    entity->length = length;
 7811|    161|    content = NULL;
 7812|    161|    ret = 0;
 7813|       |
 7814|   132k|error:
 7815|   264k|    while (ctxt->inputNr > 0)
  ------------------
  |  Branch (7815:12): [True: 132k, False: 132k]
  ------------------
 7816|   132k|        xmlFreeInputStream(xmlCtxtPopInput(ctxt));
 7817|   132k|    xmlFree(ctxt->inputTab);
 7818|   132k|    xmlFree(ctxt->encoding);
 7819|       |
 7820|   132k|    ctxt->input = oldinput;
 7821|   132k|    ctxt->inputNr = oldinputNr;
 7822|   132k|    ctxt->inputMax = oldinputMax;
 7823|   132k|    ctxt->inputTab = oldinputTab;
 7824|   132k|    ctxt->encoding = oldencoding;
 7825|       |
 7826|   132k|    xmlFree(content);
 7827|       |
 7828|   132k|    return(ret);
 7829|    161|}
parser.c:xmlSBufFinish:
  780|   263k|              const char *errMsg) {
  781|   263k|    if (buf->mem == NULL) {
  ------------------
  |  Branch (781:9): [True: 25.7k, False: 237k]
  ------------------
  782|  25.7k|        buf->mem = xmlMalloc(1);
  783|  25.7k|        if (buf->mem == NULL) {
  ------------------
  |  Branch (783:13): [True: 5, False: 25.7k]
  ------------------
  784|      5|            buf->code = XML_ERR_NO_MEMORY;
  785|  25.7k|        } else {
  786|  25.7k|            buf->mem[0] = 0;
  787|  25.7k|        }
  788|   237k|    } else {
  789|   237k|        buf->mem[buf->size] = 0;
  790|   237k|    }
  791|       |
  792|   263k|    if (buf->code == XML_ERR_OK) {
  ------------------
  |  Branch (792:9): [True: 263k, False: 54]
  ------------------
  793|   263k|        if (sizeOut != NULL)
  ------------------
  |  Branch (793:13): [True: 24.9k, False: 238k]
  ------------------
  794|  24.9k|            *sizeOut = buf->size;
  795|   263k|        return(buf->mem);
  796|   263k|    }
  797|       |
  798|     54|    xmlSBufReportError(buf, ctxt, errMsg);
  799|       |
  800|     54|    xmlFree(buf->mem);
  801|       |
  802|     54|    if (sizeOut != NULL)
  ------------------
  |  Branch (802:9): [True: 10, False: 44]
  ------------------
  803|     10|        *sizeOut = 0;
  804|       |    return(NULL);
  805|   263k|}
parser.c:xmlSBufReportError:
  771|     86|xmlSBufReportError(xmlSBuf *buf, xmlParserCtxtPtr ctxt, const char *errMsg) {
  772|     86|    if (buf->code == XML_ERR_NO_MEMORY)
  ------------------
  |  Branch (772:9): [True: 86, False: 0]
  ------------------
  773|     86|        xmlCtxtErrMemory(ctxt);
  774|      0|    else
  775|      0|        xmlFatalErr(ctxt, buf->code, errMsg);
  776|     86|}
parser.c:xmlSBufCleanup:
  808|   152k|xmlSBufCleanup(xmlSBuf *buf, xmlParserCtxtPtr ctxt, const char *errMsg) {
  809|   152k|    if (buf->code != XML_ERR_OK)
  ------------------
  |  Branch (809:9): [True: 32, False: 152k]
  ------------------
  810|     32|        xmlSBufReportError(buf, ctxt, errMsg);
  811|       |
  812|   152k|    xmlFree(buf->mem);
  813|   152k|}
parser.c:xmlExpandEntityInAttValue:
 3802|  1.24M|                          int *inSpace, int depth, int check) {
 3803|  1.24M|    int maxDepth = (ctxt->options & XML_PARSE_HUGE) ? 40 : 20;
  ------------------
  |  Branch (3803:20): [True: 557k, False: 689k]
  ------------------
 3804|  1.24M|    int c, chunkSize;
 3805|  1.24M|    int normChange = 0;
 3806|       |
 3807|  1.24M|    if (str == NULL)
  ------------------
  |  Branch (3807:9): [True: 139, False: 1.24M]
  ------------------
 3808|    139|        return(0);
 3809|       |
 3810|  1.24M|    depth += 1;
 3811|  1.24M|    if (depth > maxDepth) {
  ------------------
  |  Branch (3811:9): [True: 1, False: 1.24M]
  ------------------
 3812|      1|	xmlFatalErrMsg(ctxt, XML_ERR_RESOURCE_LIMIT,
 3813|      1|                       "Maximum entity nesting depth exceeded");
 3814|      1|	return(0);
 3815|      1|    }
 3816|       |
 3817|  1.24M|    if (pent != NULL) {
  ------------------
  |  Branch (3817:9): [True: 1.22M, False: 19.8k]
  ------------------
 3818|  1.22M|        if (pent->flags & XML_ENT_EXPANDING) {
  ------------------
  |  |   22|  1.22M|#define XML_ENT_EXPANDING   (1u << 3)
  ------------------
  |  Branch (3818:13): [True: 2, False: 1.22M]
  ------------------
 3819|      2|            xmlFatalErr(ctxt, XML_ERR_ENTITY_LOOP, NULL);
 3820|      2|            return(0);
 3821|      2|        }
 3822|       |
 3823|  1.22M|        if (check) {
  ------------------
  |  Branch (3823:13): [True: 1.17M, False: 51.7k]
  ------------------
 3824|  1.17M|            if (xmlParserEntityCheck(ctxt, pent->length))
  ------------------
  |  Branch (3824:17): [True: 31, False: 1.17M]
  ------------------
 3825|     31|                return(0);
 3826|  1.17M|        }
 3827|  1.22M|    }
 3828|       |
 3829|  1.24M|    chunkSize = 0;
 3830|       |
 3831|       |    /*
 3832|       |     * Note that entity values are already validated. No special
 3833|       |     * handling for multi-byte characters is needed.
 3834|       |     */
 3835|   218M|    while (!PARSER_STOPPED(ctxt)) {
  ------------------
  |  |   44|   218M|#define PARSER_STOPPED(ctxt) ((ctxt)->disableSAX > 1)
  ------------------
  |  Branch (3835:12): [True: 218M, False: 168]
  ------------------
 3836|   218M|        c = *str;
 3837|       |
 3838|   218M|	if (c != '&') {
  ------------------
  |  Branch (3838:6): [True: 215M, False: 2.66M]
  ------------------
 3839|   215M|            if (c == 0)
  ------------------
  |  Branch (3839:17): [True: 1.16M, False: 214M]
  ------------------
 3840|  1.16M|                break;
 3841|       |
 3842|       |            /*
 3843|       |             * If this function is called without an entity, it is used to
 3844|       |             * expand entities in an attribute content where less-than was
 3845|       |             * already unscaped and is allowed.
 3846|       |             */
 3847|   214M|            if ((pent != NULL) && (c == '<')) {
  ------------------
  |  Branch (3847:17): [True: 212M, False: 2.65M]
  |  Branch (3847:35): [True: 85.8k, False: 212M]
  ------------------
 3848|  85.8k|                xmlFatalErrMsgStr(ctxt, XML_ERR_LT_IN_ATTRIBUTE,
 3849|  85.8k|                        "'<' in entity '%s' is not allowed in attributes "
 3850|  85.8k|                        "values\n", pent->name);
 3851|  85.8k|                break;
 3852|  85.8k|            }
 3853|       |
 3854|   214M|            if (c <= 0x20) {
  ------------------
  |  Branch (3854:17): [True: 11.1M, False: 203M]
  ------------------
 3855|  11.1M|                if ((normalize) && (*inSpace)) {
  ------------------
  |  Branch (3855:21): [True: 59.0k, False: 11.0M]
  |  Branch (3855:36): [True: 23.8k, False: 35.2k]
  ------------------
 3856|       |                    /* Skip char */
 3857|  23.8k|                    if (chunkSize > 0) {
  ------------------
  |  Branch (3857:25): [True: 16.3k, False: 7.46k]
  ------------------
 3858|  16.3k|                        xmlSBufAddString(buf, str - chunkSize, chunkSize);
 3859|  16.3k|                        chunkSize = 0;
 3860|  16.3k|                    }
 3861|  23.8k|                    normChange = 1;
 3862|  11.1M|                } else if (c < 0x20) {
  ------------------
  |  Branch (3862:28): [True: 4.03M, False: 7.08M]
  ------------------
 3863|  4.03M|                    if (chunkSize > 0) {
  ------------------
  |  Branch (3863:25): [True: 691k, False: 3.34M]
  ------------------
 3864|   691k|                        xmlSBufAddString(buf, str - chunkSize, chunkSize);
 3865|   691k|                        chunkSize = 0;
 3866|   691k|                    }
 3867|       |
 3868|  4.03M|                    xmlSBufAddCString(buf, " ", 1);
 3869|  7.08M|                } else {
 3870|  7.08M|                    chunkSize += 1;
 3871|  7.08M|                }
 3872|       |
 3873|  11.1M|                *inSpace = 1;
 3874|   203M|            } else {
 3875|   203M|                chunkSize += 1;
 3876|   203M|                *inSpace = 0;
 3877|   203M|            }
 3878|       |
 3879|   214M|            str += 1;
 3880|   214M|        } else if (str[1] == '#') {
  ------------------
  |  Branch (3880:20): [True: 789k, False: 1.88M]
  ------------------
 3881|   789k|            int val;
 3882|       |
 3883|   789k|            if (chunkSize > 0) {
  ------------------
  |  Branch (3883:17): [True: 785k, False: 3.28k]
  ------------------
 3884|   785k|                xmlSBufAddString(buf, str - chunkSize, chunkSize);
 3885|   785k|                chunkSize = 0;
 3886|   785k|            }
 3887|       |
 3888|   789k|	    val = xmlParseStringCharRef(ctxt, &str);
 3889|   789k|	    if (val == 0) {
  ------------------
  |  Branch (3889:10): [True: 3, False: 789k]
  ------------------
 3890|      3|                if (pent != NULL)
  ------------------
  |  Branch (3890:21): [True: 3, False: 0]
  ------------------
 3891|      3|                    pent->content[0] = 0;
 3892|      3|                break;
 3893|      3|            }
 3894|       |
 3895|   789k|            if (val == ' ') {
  ------------------
  |  Branch (3895:17): [True: 6.20k, False: 783k]
  ------------------
 3896|  6.20k|                if ((normalize) && (*inSpace))
  ------------------
  |  Branch (3896:21): [True: 2.74k, False: 3.45k]
  |  Branch (3896:36): [True: 1.64k, False: 1.10k]
  ------------------
 3897|  1.64k|                    normChange = 1;
 3898|  4.55k|                else
 3899|  4.55k|                    xmlSBufAddCString(buf, " ", 1);
 3900|  6.20k|                *inSpace = 1;
 3901|   783k|            } else {
 3902|   783k|                xmlSBufAddChar(buf, val);
 3903|   783k|                *inSpace = 0;
 3904|   783k|            }
 3905|  1.88M|	} else {
 3906|  1.88M|            xmlChar *name;
 3907|  1.88M|            xmlEntityPtr ent;
 3908|       |
 3909|  1.88M|            if (chunkSize > 0) {
  ------------------
  |  Branch (3909:17): [True: 1.05M, False: 824k]
  ------------------
 3910|  1.05M|                xmlSBufAddString(buf, str - chunkSize, chunkSize);
 3911|  1.05M|                chunkSize = 0;
 3912|  1.05M|            }
 3913|       |
 3914|  1.88M|	    name = xmlParseStringEntityRef(ctxt, &str);
 3915|  1.88M|            if (name == NULL) {
  ------------------
  |  Branch (3915:17): [True: 18, False: 1.88M]
  ------------------
 3916|     18|                if (pent != NULL)
  ------------------
  |  Branch (3916:21): [True: 17, False: 1]
  ------------------
 3917|     17|                    pent->content[0] = 0;
 3918|     18|                break;
 3919|     18|            }
 3920|       |
 3921|  1.88M|            ent = xmlLookupGeneralEntity(ctxt, name, /* inAttr */ 1);
 3922|  1.88M|            xmlFree(name);
 3923|       |
 3924|  1.88M|	    if ((ent != NULL) &&
  ------------------
  |  Branch (3924:10): [True: 1.81M, False: 69.5k]
  ------------------
 3925|  1.81M|		(ent->etype == XML_INTERNAL_PREDEFINED_ENTITY)) {
  ------------------
  |  Branch (3925:3): [True: 984k, False: 826k]
  ------------------
 3926|   984k|		if (ent->content == NULL) {
  ------------------
  |  Branch (3926:7): [True: 0, False: 984k]
  ------------------
 3927|      0|		    xmlFatalErrMsg(ctxt, XML_ERR_INTERNAL_ERROR,
 3928|      0|			    "predefined entity has no content\n");
 3929|      0|                    break;
 3930|      0|                }
 3931|       |
 3932|   984k|                xmlSBufAddString(buf, ent->content, ent->length);
 3933|       |
 3934|   984k|                *inSpace = 0;
 3935|   984k|	    } else if ((ent != NULL) && (ent->content != NULL)) {
  ------------------
  |  Branch (3935:17): [True: 826k, False: 69.5k]
  |  Branch (3935:34): [True: 826k, False: 171]
  ------------------
 3936|   826k|                if (pent != NULL)
  ------------------
  |  Branch (3936:21): [True: 810k, False: 15.6k]
  ------------------
 3937|   810k|                    pent->flags |= XML_ENT_EXPANDING;
  ------------------
  |  |   22|   810k|#define XML_ENT_EXPANDING   (1u << 3)
  ------------------
 3938|   826k|		normChange |= xmlExpandEntityInAttValue(ctxt, buf,
 3939|   826k|                        ent->content, ent, normalize, inSpace, depth, check);
 3940|   826k|                if (pent != NULL)
  ------------------
  |  Branch (3940:21): [True: 810k, False: 15.6k]
  ------------------
 3941|   810k|                    pent->flags &= ~XML_ENT_EXPANDING;
  ------------------
  |  |   22|   810k|#define XML_ENT_EXPANDING   (1u << 3)
  ------------------
 3942|   826k|	    }
 3943|  1.88M|        }
 3944|   218M|    }
 3945|       |
 3946|  1.24M|    if (chunkSize > 0)
  ------------------
  |  Branch (3946:9): [True: 811k, False: 435k]
  ------------------
 3947|   811k|        xmlSBufAddString(buf, str - chunkSize, chunkSize);
 3948|       |
 3949|  1.24M|    return(normChange);
 3950|  1.24M|}
parser.c:xmlParseStringEntityRef:
 7536|  1.89M|xmlParseStringEntityRef(xmlParserCtxtPtr ctxt, const xmlChar ** str) {
 7537|  1.89M|    xmlChar *name;
 7538|  1.89M|    const xmlChar *ptr;
 7539|  1.89M|    xmlChar cur;
 7540|       |
 7541|  1.89M|    if ((str == NULL) || (*str == NULL))
  ------------------
  |  Branch (7541:9): [True: 0, False: 1.89M]
  |  Branch (7541:26): [True: 0, False: 1.89M]
  ------------------
 7542|      0|        return(NULL);
 7543|  1.89M|    ptr = *str;
 7544|  1.89M|    cur = *ptr;
 7545|  1.89M|    if (cur != '&')
  ------------------
  |  Branch (7545:9): [True: 0, False: 1.89M]
  ------------------
 7546|      0|	return(NULL);
 7547|       |
 7548|  1.89M|    ptr++;
 7549|  1.89M|    name = xmlParseStringName(ctxt, &ptr);
 7550|  1.89M|    if (name == NULL) {
  ------------------
  |  Branch (7550:9): [True: 22, False: 1.89M]
  ------------------
 7551|     22|	xmlFatalErrMsg(ctxt, XML_ERR_NAME_REQUIRED,
 7552|     22|		       "xmlParseStringEntityRef: no name\n");
 7553|     22|	*str = ptr;
 7554|     22|	return(NULL);
 7555|     22|    }
 7556|  1.89M|    if (*ptr != ';') {
  ------------------
  |  Branch (7556:9): [True: 8, False: 1.89M]
  ------------------
 7557|      8|	xmlFatalErr(ctxt, XML_ERR_ENTITYREF_SEMICOL_MISSING, NULL);
 7558|      8|        xmlFree(name);
 7559|      8|	*str = ptr;
 7560|      8|	return(NULL);
 7561|      8|    }
 7562|  1.89M|    ptr++;
 7563|       |
 7564|  1.89M|    *str = ptr;
 7565|  1.89M|    return(name);
 7566|  1.89M|}
parser.c:xmlParseAttValueInternal:
 4019|   299k|                         int special, int isNamespace) {
 4020|   299k|    unsigned maxLength = (ctxt->options & XML_PARSE_HUGE) ?
  ------------------
  |  Branch (4020:26): [True: 160k, False: 139k]
  ------------------
 4021|   160k|                         XML_MAX_HUGE_LENGTH :
  ------------------
  |  |   55|   160k|#define XML_MAX_HUGE_LENGTH 1000000000
  ------------------
 4022|   299k|                         XML_MAX_TEXT_LENGTH;
  ------------------
  |  |   50|   438k|#define XML_MAX_TEXT_LENGTH 10000000
  ------------------
 4023|   299k|    xmlSBuf buf;
 4024|   299k|    xmlChar *ret;
 4025|   299k|    int c, l, quote, entFlags, chunkSize;
 4026|   299k|    int inSpace = 1;
 4027|   299k|    int replaceEntities;
 4028|   299k|    int normalize = (special & XML_SPECIAL_TYPE_MASK) > XML_ATTRIBUTE_CDATA;
  ------------------
  |  |   96|   299k|#define XML_SPECIAL_TYPE_MASK   (XML_SPECIAL_EXTERNAL - 1)
  |  |  ------------------
  |  |  |  |   95|   299k|#define XML_SPECIAL_EXTERNAL    (1 << 20)
  |  |  ------------------
  ------------------
 4029|   299k|    int attvalFlags = 0;
 4030|       |
 4031|       |    /* Always expand namespace URIs */
 4032|   299k|    replaceEntities = (ctxt->replaceEntities) || (isNamespace);
  ------------------
  |  Branch (4032:23): [True: 187k, False: 112k]
  |  Branch (4032:50): [True: 16.3k, False: 96.2k]
  ------------------
 4033|       |
 4034|   299k|    xmlSBufInit(&buf, maxLength);
 4035|       |
 4036|   299k|    GROW;
  ------------------
  |  | 2271|   299k|    if ((!PARSER_PROGRESSIVE(ctxt)) && \
  |  |  ------------------
  |  |  |  |   47|   299k|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|   299k|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2271:9): [True: 148k, False: 151k]
  |  |  ------------------
  |  | 2272|   299k|        (ctxt->input->end - ctxt->input->cur < INPUT_CHUNK)) \
  |  |  ------------------
  |  |  |  |   63|   148k|#define INPUT_CHUNK	250
  |  |  ------------------
  |  |  |  Branch (2272:9): [True: 40.0k, False: 108k]
  |  |  ------------------
  |  | 2273|   299k|	xmlParserGrow(ctxt);
  ------------------
 4037|       |
 4038|   299k|    quote = CUR;
  ------------------
  |  | 2225|   299k|#define CUR (*ctxt->input->cur)
  ------------------
 4039|   299k|    if ((quote != '"') && (quote != '\'')) {
  ------------------
  |  Branch (4039:9): [True: 168k, False: 131k]
  |  Branch (4039:27): [True: 6.56k, False: 161k]
  ------------------
 4040|  6.56k|	xmlFatalErr(ctxt, XML_ERR_ATTRIBUTE_NOT_STARTED, NULL);
 4041|  6.56k|	return(NULL);
 4042|  6.56k|    }
 4043|   293k|    NEXTL(1);
  ------------------
  |  | 2288|   293k|#define NEXTL(l) do {							\
  |  | 2289|   293k|    if (*(ctxt->input->cur) == '\n') {					\
  |  |  ------------------
  |  |  |  Branch (2289:9): [True: 0, False: 293k]
  |  |  ------------------
  |  | 2290|      0|	ctxt->input->line++; ctxt->input->col = 1;			\
  |  | 2291|   293k|    } else ctxt->input->col++;						\
  |  | 2292|   293k|    ctxt->input->cur += l;				\
  |  | 2293|   293k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2293:12): [Folded, False: 293k]
  |  |  ------------------
  ------------------
 4044|       |
 4045|   293k|    if (ctxt->inSubset == 0)
  ------------------
  |  Branch (4045:9): [True: 232k, False: 60.2k]
  ------------------
 4046|   232k|        entFlags = XML_ENT_CHECKED | XML_ENT_VALIDATED;
  ------------------
  |  |   20|   232k|#define XML_ENT_CHECKED     (1u << 1)
  ------------------
                      entFlags = XML_ENT_CHECKED | XML_ENT_VALIDATED;
  ------------------
  |  |   21|   232k|#define XML_ENT_VALIDATED   (1u << 2)
  ------------------
 4047|  60.2k|    else
 4048|  60.2k|        entFlags = XML_ENT_VALIDATED;
  ------------------
  |  |   21|  60.2k|#define XML_ENT_VALIDATED   (1u << 2)
  ------------------
 4049|       |
 4050|   293k|    inSpace = 1;
 4051|   293k|    chunkSize = 0;
 4052|       |
 4053|   129M|    while (1) {
  ------------------
  |  Branch (4053:12): [True: 129M, Folded]
  ------------------
 4054|   129M|        if (PARSER_STOPPED(ctxt))
  ------------------
  |  |   44|   129M|#define PARSER_STOPPED(ctxt) ((ctxt)->disableSAX > 1)
  |  |  ------------------
  |  |  |  Branch (44:30): [True: 104, False: 129M]
  |  |  ------------------
  ------------------
 4055|    104|            goto error;
 4056|       |
 4057|   129M|        if (CUR_PTR >= ctxt->input->end) {
  ------------------
  |  | 2227|   129M|#define CUR_PTR ctxt->input->cur
  ------------------
  |  Branch (4057:13): [True: 35.3k, False: 129M]
  ------------------
 4058|  35.3k|            xmlFatalErrMsg(ctxt, XML_ERR_ATTRIBUTE_NOT_FINISHED,
 4059|  35.3k|                           "AttValue: ' expected\n");
 4060|  35.3k|            goto error;
 4061|  35.3k|        }
 4062|       |
 4063|       |        /*
 4064|       |         * TODO: Check growth threshold
 4065|       |         */
 4066|   129M|        if (ctxt->input->end - CUR_PTR < 10)
  ------------------
  |  | 2227|   129M|#define CUR_PTR ctxt->input->cur
  ------------------
  |  Branch (4066:13): [True: 377k, False: 128M]
  ------------------
 4067|   377k|            GROW;
  ------------------
  |  | 2271|   377k|    if ((!PARSER_PROGRESSIVE(ctxt)) && \
  |  |  ------------------
  |  |  |  |   47|   377k|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|   377k|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2271:9): [True: 335k, False: 42.4k]
  |  |  ------------------
  |  | 2272|   377k|        (ctxt->input->end - ctxt->input->cur < INPUT_CHUNK)) \
  |  |  ------------------
  |  |  |  |   63|   335k|#define INPUT_CHUNK	250
  |  |  ------------------
  |  |  |  Branch (2272:9): [True: 335k, False: 0]
  |  |  ------------------
  |  | 2273|   377k|	xmlParserGrow(ctxt);
  ------------------
 4068|       |
 4069|   129M|        c = CUR;
  ------------------
  |  | 2225|   129M|#define CUR (*ctxt->input->cur)
  ------------------
 4070|       |
 4071|   129M|        if (c >= 0x80) {
  ------------------
  |  Branch (4071:13): [True: 48.2M, False: 81.0M]
  ------------------
 4072|  48.2M|            l = xmlUTF8MultibyteLen(ctxt, CUR_PTR,
  ------------------
  |  | 2227|  48.2M|#define CUR_PTR ctxt->input->cur
  ------------------
 4073|  48.2M|                    "invalid character in attribute value\n");
 4074|  48.2M|            if (l == 0) {
  ------------------
  |  Branch (4074:17): [True: 42.6M, False: 5.60M]
  ------------------
 4075|  42.6M|                if (chunkSize > 0) {
  ------------------
  |  Branch (4075:21): [True: 230k, False: 42.3M]
  ------------------
 4076|   230k|                    xmlSBufAddString(&buf, CUR_PTR - chunkSize, chunkSize);
  ------------------
  |  | 2227|   230k|#define CUR_PTR ctxt->input->cur
  ------------------
 4077|   230k|                    chunkSize = 0;
 4078|   230k|                }
 4079|  42.6M|                xmlSBufAddReplChar(&buf);
 4080|  42.6M|                NEXTL(1);
  ------------------
  |  | 2288|  42.6M|#define NEXTL(l) do {							\
  |  | 2289|  42.6M|    if (*(ctxt->input->cur) == '\n') {					\
  |  |  ------------------
  |  |  |  Branch (2289:9): [True: 0, False: 42.6M]
  |  |  ------------------
  |  | 2290|      0|	ctxt->input->line++; ctxt->input->col = 1;			\
  |  | 2291|  42.6M|    } else ctxt->input->col++;						\
  |  | 2292|  42.6M|    ctxt->input->cur += l;				\
  |  | 2293|  42.6M|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2293:12): [Folded, False: 42.6M]
  |  |  ------------------
  ------------------
 4081|  42.6M|            } else {
 4082|  5.60M|                chunkSize += l;
 4083|  5.60M|                NEXTL(l);
  ------------------
  |  | 2288|  5.60M|#define NEXTL(l) do {							\
  |  | 2289|  5.60M|    if (*(ctxt->input->cur) == '\n') {					\
  |  |  ------------------
  |  |  |  Branch (2289:9): [True: 0, False: 5.60M]
  |  |  ------------------
  |  | 2290|      0|	ctxt->input->line++; ctxt->input->col = 1;			\
  |  | 2291|  5.60M|    } else ctxt->input->col++;						\
  |  | 2292|  5.60M|    ctxt->input->cur += l;				\
  |  | 2293|  5.60M|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2293:12): [Folded, False: 5.60M]
  |  |  ------------------
  ------------------
 4084|  5.60M|            }
 4085|       |
 4086|  48.2M|            inSpace = 0;
 4087|  81.0M|        } else if (c != '&') {
  ------------------
  |  Branch (4087:20): [True: 80.2M, False: 827k]
  ------------------
 4088|  80.2M|            if (c > 0x20) {
  ------------------
  |  Branch (4088:17): [True: 49.0M, False: 31.1M]
  ------------------
 4089|  49.0M|                if (c == quote)
  ------------------
  |  Branch (4089:21): [True: 256k, False: 48.8M]
  ------------------
 4090|   256k|                    break;
 4091|       |
 4092|  48.8M|                if (c == '<')
  ------------------
  |  Branch (4092:21): [True: 553k, False: 48.2M]
  ------------------
 4093|   553k|                    xmlFatalErr(ctxt, XML_ERR_LT_IN_ATTRIBUTE, NULL);
 4094|       |
 4095|  48.8M|                chunkSize += 1;
 4096|  48.8M|                inSpace = 0;
 4097|  48.8M|            } else if (!IS_BYTE_CHAR(c)) {
  ------------------
  |  |  103|  31.1M|#define IS_BYTE_CHAR(c)	 xmlIsChar_ch(c)
  |  |  ------------------
  |  |  |  |  108|  31.1M|#define xmlIsChar_ch(c)		(((0x9 <= (c)) && ((c) <= 0xa)) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (108:28): [True: 7.32M, False: 23.8M]
  |  |  |  |  |  Branch (108:44): [True: 4.79M, False: 2.52M]
  |  |  |  |  ------------------
  |  |  |  |  109|  31.1M|				 ((c) == 0xd) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (109:6): [True: 489k, False: 25.8M]
  |  |  |  |  ------------------
  |  |  |  |  110|  31.1M|				  (0x20 <= (c)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (110:7): [True: 1.98M, False: 23.8M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 4098|  23.8M|                xmlFatalErrMsg(ctxt, XML_ERR_INVALID_CHAR,
 4099|  23.8M|                        "invalid character in attribute value\n");
 4100|  23.8M|                if (chunkSize > 0) {
  ------------------
  |  Branch (4100:21): [True: 61.1k, False: 23.8M]
  ------------------
 4101|  61.1k|                    xmlSBufAddString(&buf, CUR_PTR - chunkSize, chunkSize);
  ------------------
  |  | 2227|  61.1k|#define CUR_PTR ctxt->input->cur
  ------------------
 4102|  61.1k|                    chunkSize = 0;
 4103|  61.1k|                }
 4104|  23.8M|                xmlSBufAddReplChar(&buf);
 4105|  23.8M|                inSpace = 0;
 4106|  23.8M|            } else {
 4107|       |                /* Whitespace */
 4108|  7.27M|                if ((normalize) && (inSpace)) {
  ------------------
  |  Branch (4108:21): [True: 66.2k, False: 7.20M]
  |  Branch (4108:36): [True: 33.8k, False: 32.4k]
  ------------------
 4109|       |                    /* Skip char */
 4110|  33.8k|                    if (chunkSize > 0) {
  ------------------
  |  Branch (4110:25): [True: 21.1k, False: 12.6k]
  ------------------
 4111|  21.1k|                        xmlSBufAddString(&buf, CUR_PTR - chunkSize, chunkSize);
  ------------------
  |  | 2227|  21.1k|#define CUR_PTR ctxt->input->cur
  ------------------
 4112|  21.1k|                        chunkSize = 0;
 4113|  21.1k|                    }
 4114|  33.8k|                    attvalFlags |= XML_ATTVAL_NORM_CHANGE;
  ------------------
  |  |   99|  33.8k|#define XML_ATTVAL_NORM_CHANGE  (1 << 1)
  ------------------
 4115|  7.23M|                } else if (c < 0x20) {
  ------------------
  |  Branch (4115:28): [True: 5.27M, False: 1.95M]
  ------------------
 4116|       |                    /* Convert to space */
 4117|  5.27M|                    if (chunkSize > 0) {
  ------------------
  |  Branch (4117:25): [True: 186k, False: 5.09M]
  ------------------
 4118|   186k|                        xmlSBufAddString(&buf, CUR_PTR - chunkSize, chunkSize);
  ------------------
  |  | 2227|   186k|#define CUR_PTR ctxt->input->cur
  ------------------
 4119|   186k|                        chunkSize = 0;
 4120|   186k|                    }
 4121|       |
 4122|  5.27M|                    xmlSBufAddCString(&buf, " ", 1);
 4123|  5.27M|                } else {
 4124|  1.95M|                    chunkSize += 1;
 4125|  1.95M|                }
 4126|       |
 4127|  7.27M|                inSpace = 1;
 4128|       |
 4129|  7.27M|                if ((c == 0xD) && (NXT(1) == 0xA))
  ------------------
  |  | 2226|   489k|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
  |  Branch (4129:21): [True: 489k, False: 6.78M]
  |  Branch (4129:35): [True: 56.5k, False: 432k]
  ------------------
 4130|  56.5k|                    CUR_PTR++;
  ------------------
  |  | 2227|  56.5k|#define CUR_PTR ctxt->input->cur
  ------------------
 4131|  7.27M|            }
 4132|       |
 4133|  79.9M|            NEXTL(1);
  ------------------
  |  | 2288|  79.9M|#define NEXTL(l) do {							\
  |  | 2289|  79.9M|    if (*(ctxt->input->cur) == '\n') {					\
  |  |  ------------------
  |  |  |  Branch (2289:9): [True: 4.80M, False: 75.1M]
  |  |  ------------------
  |  | 2290|  4.80M|	ctxt->input->line++; ctxt->input->col = 1;			\
  |  | 2291|  75.1M|    } else ctxt->input->col++;						\
  |  | 2292|  79.9M|    ctxt->input->cur += l;				\
  |  | 2293|  79.9M|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2293:12): [Folded, False: 79.9M]
  |  |  ------------------
  ------------------
 4134|  79.9M|        } else if (NXT(1) == '#') {
  ------------------
  |  | 2226|   827k|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
  |  Branch (4134:20): [True: 45.8k, False: 781k]
  ------------------
 4135|  45.8k|            int val;
 4136|       |
 4137|  45.8k|            if (chunkSize > 0) {
  ------------------
  |  Branch (4137:17): [True: 37.1k, False: 8.73k]
  ------------------
 4138|  37.1k|                xmlSBufAddString(&buf, CUR_PTR - chunkSize, chunkSize);
  ------------------
  |  | 2227|  37.1k|#define CUR_PTR ctxt->input->cur
  ------------------
 4139|  37.1k|                chunkSize = 0;
 4140|  37.1k|            }
 4141|       |
 4142|  45.8k|            val = xmlParseCharRef(ctxt);
 4143|  45.8k|            if (val == 0)
  ------------------
  |  Branch (4143:17): [True: 1.35k, False: 44.4k]
  ------------------
 4144|  1.35k|                goto error;
 4145|       |
 4146|  44.4k|            if ((val == '&') && (!replaceEntities)) {
  ------------------
  |  Branch (4146:17): [True: 4.08k, False: 40.4k]
  |  Branch (4146:33): [True: 2.26k, False: 1.82k]
  ------------------
 4147|       |                /*
 4148|       |                 * The reparsing will be done in xmlNodeParseContent()
 4149|       |                 * called from SAX2.c
 4150|       |                 */
 4151|  2.26k|                xmlSBufAddCString(&buf, "&#38;", 5);
 4152|  2.26k|                inSpace = 0;
 4153|  42.2k|            } else if (val == ' ') {
  ------------------
  |  Branch (4153:24): [True: 1.51k, False: 40.7k]
  ------------------
 4154|  1.51k|                if ((normalize) && (inSpace))
  ------------------
  |  Branch (4154:21): [True: 336, False: 1.17k]
  |  Branch (4154:36): [True: 84, False: 252]
  ------------------
 4155|     84|                    attvalFlags |= XML_ATTVAL_NORM_CHANGE;
  ------------------
  |  |   99|     84|#define XML_ATTVAL_NORM_CHANGE  (1 << 1)
  ------------------
 4156|  1.42k|                else
 4157|  1.42k|                    xmlSBufAddCString(&buf, " ", 1);
 4158|  1.51k|                inSpace = 1;
 4159|  40.7k|            } else {
 4160|  40.7k|                xmlSBufAddChar(&buf, val);
 4161|  40.7k|                inSpace = 0;
 4162|  40.7k|            }
 4163|   781k|        } else {
 4164|   781k|            const xmlChar *name;
 4165|   781k|            xmlEntityPtr ent;
 4166|       |
 4167|   781k|            if (chunkSize > 0) {
  ------------------
  |  Branch (4167:17): [True: 446k, False: 334k]
  ------------------
 4168|   446k|                xmlSBufAddString(&buf, CUR_PTR - chunkSize, chunkSize);
  ------------------
  |  | 2227|   446k|#define CUR_PTR ctxt->input->cur
  ------------------
 4169|   446k|                chunkSize = 0;
 4170|   446k|            }
 4171|       |
 4172|   781k|            name = xmlParseEntityRefInternal(ctxt);
 4173|   781k|            if (name == NULL) {
  ------------------
  |  Branch (4173:17): [True: 104k, False: 676k]
  ------------------
 4174|       |                /*
 4175|       |                 * Probably a literal '&' which wasn't escaped.
 4176|       |                 * TODO: Handle gracefully in recovery mode.
 4177|       |                 */
 4178|   104k|                continue;
 4179|   104k|            }
 4180|       |
 4181|   676k|            ent = xmlLookupGeneralEntity(ctxt, name, /* isAttr */ 1);
 4182|   676k|            if (ent == NULL)
  ------------------
  |  Branch (4182:17): [True: 192k, False: 484k]
  ------------------
 4183|   192k|                continue;
 4184|       |
 4185|   484k|            if (ent->etype == XML_INTERNAL_PREDEFINED_ENTITY) {
  ------------------
  |  Branch (4185:17): [True: 19.8k, False: 464k]
  ------------------
 4186|  19.8k|                if ((ent->content[0] == '&') && (!replaceEntities))
  ------------------
  |  Branch (4186:21): [True: 3.18k, False: 16.6k]
  |  Branch (4186:49): [True: 2.11k, False: 1.06k]
  ------------------
 4187|  2.11k|                    xmlSBufAddCString(&buf, "&#38;", 5);
 4188|  17.7k|                else
 4189|  17.7k|                    xmlSBufAddString(&buf, ent->content, ent->length);
 4190|  19.8k|                inSpace = 0;
 4191|   464k|            } else if (replaceEntities) {
  ------------------
  |  Branch (4191:24): [True: 400k, False: 64.4k]
  ------------------
 4192|   400k|                if (xmlExpandEntityInAttValue(ctxt, &buf,
  ------------------
  |  Branch (4192:21): [True: 4.31k, False: 396k]
  ------------------
 4193|   400k|                        ent->content, ent, normalize, &inSpace, ctxt->inputNr,
 4194|   400k|                        /* check */ 1) > 0)
 4195|  4.31k|                    attvalFlags |= XML_ATTVAL_NORM_CHANGE;
  ------------------
  |  |   99|  4.31k|#define XML_ATTVAL_NORM_CHANGE  (1 << 1)
  ------------------
 4196|   400k|            } else {
 4197|  64.4k|                if ((ent->flags & entFlags) != entFlags)
  ------------------
  |  Branch (4197:21): [True: 749, False: 63.6k]
  ------------------
 4198|    749|                    xmlCheckEntityInAttValue(ctxt, ent, ctxt->inputNr);
 4199|       |
 4200|  64.4k|                if (xmlParserEntityCheck(ctxt, ent->expandedSize)) {
  ------------------
  |  Branch (4200:21): [True: 77, False: 64.3k]
  ------------------
 4201|     77|                    ent->content[0] = 0;
 4202|     77|                    goto error;
 4203|     77|                }
 4204|       |
 4205|       |                /*
 4206|       |                 * Just output the reference
 4207|       |                 */
 4208|  64.3k|                xmlSBufAddCString(&buf, "&", 1);
 4209|  64.3k|                xmlSBufAddString(&buf, ent->name, xmlStrlen(ent->name));
 4210|  64.3k|                xmlSBufAddCString(&buf, ";", 1);
 4211|       |
 4212|  64.3k|                inSpace = 0;
 4213|  64.3k|            }
 4214|   484k|	}
 4215|   129M|    }
 4216|       |
 4217|   256k|    if ((buf.mem == NULL) && (outFlags != NULL)) {
  ------------------
  |  Branch (4217:9): [True: 207k, False: 48.6k]
  |  Branch (4217:30): [True: 113k, False: 93.8k]
  ------------------
 4218|   113k|        ret = (xmlChar *) CUR_PTR - chunkSize;
  ------------------
  |  | 2227|   113k|#define CUR_PTR ctxt->input->cur
  ------------------
 4219|       |
 4220|   113k|        if (attlen != NULL)
  ------------------
  |  Branch (4220:13): [True: 113k, False: 0]
  ------------------
 4221|   113k|            *attlen = chunkSize;
 4222|   113k|        if ((normalize) && (inSpace) && (chunkSize > 0)) {
  ------------------
  |  Branch (4222:13): [True: 1.20k, False: 112k]
  |  Branch (4222:28): [True: 471, False: 733]
  |  Branch (4222:41): [True: 270, False: 201]
  ------------------
 4223|    270|            attvalFlags |= XML_ATTVAL_NORM_CHANGE;
  ------------------
  |  |   99|    270|#define XML_ATTVAL_NORM_CHANGE  (1 << 1)
  ------------------
 4224|    270|            *attlen -= 1;
 4225|    270|        }
 4226|       |
 4227|       |        /* Report potential error */
 4228|   113k|        xmlSBufCleanup(&buf, ctxt, "AttValue length too long");
 4229|   142k|    } else {
 4230|   142k|        if (chunkSize > 0)
  ------------------
  |  Branch (4230:13): [True: 117k, False: 25.0k]
  ------------------
 4231|   117k|            xmlSBufAddString(&buf, CUR_PTR - chunkSize, chunkSize);
  ------------------
  |  | 2227|   117k|#define CUR_PTR ctxt->input->cur
  ------------------
 4232|       |
 4233|   142k|        if ((normalize) && (inSpace) && (buf.size > 0)) {
  ------------------
  |  Branch (4233:13): [True: 1.70k, False: 140k]
  |  Branch (4233:28): [True: 336, False: 1.36k]
  |  Branch (4233:41): [True: 336, False: 0]
  ------------------
 4234|    336|            attvalFlags |= XML_ATTVAL_NORM_CHANGE;
  ------------------
  |  |   99|    336|#define XML_ATTVAL_NORM_CHANGE  (1 << 1)
  ------------------
 4235|    336|            buf.size--;
 4236|    336|        }
 4237|       |
 4238|   142k|        ret = xmlSBufFinish(&buf, attlen, ctxt, "AttValue length too long");
 4239|   142k|        attvalFlags |= XML_ATTVAL_ALLOC;
  ------------------
  |  |   98|   142k|#define XML_ATTVAL_ALLOC        (1 << 0)
  ------------------
 4240|       |
 4241|   142k|        if (ret != NULL) {
  ------------------
  |  Branch (4241:13): [True: 142k, False: 19]
  ------------------
 4242|   142k|            if (attlen != NULL)
  ------------------
  |  Branch (4242:17): [True: 24.9k, False: 117k]
  ------------------
 4243|  24.9k|                *attlen = buf.size;
 4244|   142k|        }
 4245|   142k|    }
 4246|       |
 4247|   256k|    if (outFlags != NULL)
  ------------------
  |  Branch (4247:9): [True: 138k, False: 117k]
  ------------------
 4248|   138k|        *outFlags = attvalFlags;
 4249|       |
 4250|   256k|    NEXTL(1);
  ------------------
  |  | 2288|   256k|#define NEXTL(l) do {							\
  |  | 2289|   256k|    if (*(ctxt->input->cur) == '\n') {					\
  |  |  ------------------
  |  |  |  Branch (2289:9): [True: 0, False: 256k]
  |  |  ------------------
  |  | 2290|      0|	ctxt->input->line++; ctxt->input->col = 1;			\
  |  | 2291|   256k|    } else ctxt->input->col++;						\
  |  | 2292|   256k|    ctxt->input->cur += l;				\
  |  | 2293|   256k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2293:12): [Folded, False: 256k]
  |  |  ------------------
  ------------------
 4251|       |
 4252|   256k|    return(ret);
 4253|       |
 4254|  36.8k|error:
 4255|  36.8k|    xmlSBufCleanup(&buf, ctxt, "AttValue length too long");
 4256|       |    return(NULL);
 4257|   293k|}
parser.c:xmlCheckEntityInAttValue:
 3692|  3.52k|xmlCheckEntityInAttValue(xmlParserCtxtPtr ctxt, xmlEntityPtr pent, int depth) {
 3693|  3.52k|    int maxDepth = (ctxt->options & XML_PARSE_HUGE) ? 40 : 20;
  ------------------
  |  Branch (3693:20): [True: 2.72k, False: 801]
  ------------------
 3694|  3.52k|    const xmlChar *str;
 3695|  3.52k|    unsigned long expandedSize = pent->length;
 3696|  3.52k|    int c, flags;
 3697|       |
 3698|  3.52k|    depth += 1;
 3699|  3.52k|    if (depth > maxDepth) {
  ------------------
  |  Branch (3699:9): [True: 1, False: 3.52k]
  ------------------
 3700|      1|	xmlFatalErrMsg(ctxt, XML_ERR_RESOURCE_LIMIT,
 3701|      1|                       "Maximum entity nesting depth exceeded");
 3702|      1|	return;
 3703|      1|    }
 3704|       |
 3705|  3.52k|    if (pent->flags & XML_ENT_EXPANDING) {
  ------------------
  |  |   22|  3.52k|#define XML_ENT_EXPANDING   (1u << 3)
  ------------------
  |  Branch (3705:9): [True: 7, False: 3.51k]
  ------------------
 3706|      7|        xmlFatalErr(ctxt, XML_ERR_ENTITY_LOOP, NULL);
 3707|      7|        return;
 3708|      7|    }
 3709|       |
 3710|       |    /*
 3711|       |     * If we're parsing a default attribute value in DTD content,
 3712|       |     * the entity might reference other entities which weren't
 3713|       |     * defined yet, so the check isn't reliable.
 3714|       |     */
 3715|  3.51k|    if (ctxt->inSubset == 0)
  ------------------
  |  Branch (3715:9): [True: 3.38k, False: 133]
  ------------------
 3716|  3.38k|        flags = XML_ENT_CHECKED | XML_ENT_VALIDATED;
  ------------------
  |  |   20|  3.38k|#define XML_ENT_CHECKED     (1u << 1)
  ------------------
                      flags = XML_ENT_CHECKED | XML_ENT_VALIDATED;
  ------------------
  |  |   21|  3.38k|#define XML_ENT_VALIDATED   (1u << 2)
  ------------------
 3717|    133|    else
 3718|    133|        flags = XML_ENT_VALIDATED;
  ------------------
  |  |   21|    133|#define XML_ENT_VALIDATED   (1u << 2)
  ------------------
 3719|       |
 3720|  3.51k|    str = pent->content;
 3721|  3.51k|    if (str == NULL)
  ------------------
  |  Branch (3721:9): [True: 2, False: 3.51k]
  ------------------
 3722|      2|        goto done;
 3723|       |
 3724|       |    /*
 3725|       |     * Note that entity values are already validated. We only check
 3726|       |     * for illegal less-than signs and compute the expanded size
 3727|       |     * of the entity. No special handling for multi-byte characters
 3728|       |     * is needed.
 3729|       |     */
 3730|  29.3M|    while (!PARSER_STOPPED(ctxt)) {
  ------------------
  |  |   44|  29.3M|#define PARSER_STOPPED(ctxt) ((ctxt)->disableSAX > 1)
  ------------------
  |  Branch (3730:12): [True: 29.3M, False: 98]
  ------------------
 3731|  29.3M|        c = *str;
 3732|       |
 3733|  29.3M|	if (c != '&') {
  ------------------
  |  Branch (3733:6): [True: 29.3M, False: 20.7k]
  ------------------
 3734|  29.3M|            if (c == 0)
  ------------------
  |  Branch (3734:17): [True: 3.40k, False: 29.3M]
  ------------------
 3735|  3.40k|                break;
 3736|       |
 3737|  29.3M|            if (c == '<')
  ------------------
  |  Branch (3737:17): [True: 2.00k, False: 29.3M]
  ------------------
 3738|  2.00k|                xmlFatalErrMsgStr(ctxt, XML_ERR_LT_IN_ATTRIBUTE,
 3739|  2.00k|                        "'<' in entity '%s' is not allowed in attributes "
 3740|  2.00k|                        "values\n", pent->name);
 3741|       |
 3742|  29.3M|            str += 1;
 3743|  29.3M|        } else if (str[1] == '#') {
  ------------------
  |  Branch (3743:20): [True: 6.94k, False: 13.8k]
  ------------------
 3744|  6.94k|            int val;
 3745|       |
 3746|  6.94k|	    val = xmlParseStringCharRef(ctxt, &str);
 3747|  6.94k|	    if (val == 0) {
  ------------------
  |  Branch (3747:10): [True: 2, False: 6.94k]
  ------------------
 3748|      2|                pent->content[0] = 0;
 3749|      2|                break;
 3750|      2|            }
 3751|  13.8k|	} else {
 3752|  13.8k|            xmlChar *name;
 3753|  13.8k|            xmlEntityPtr ent;
 3754|       |
 3755|  13.8k|	    name = xmlParseStringEntityRef(ctxt, &str);
 3756|  13.8k|	    if (name == NULL) {
  ------------------
  |  Branch (3756:10): [True: 12, False: 13.8k]
  ------------------
 3757|     12|                pent->content[0] = 0;
 3758|     12|                break;
 3759|     12|            }
 3760|       |
 3761|  13.8k|            ent = xmlLookupGeneralEntity(ctxt, name, /* inAttr */ 1);
 3762|  13.8k|            xmlFree(name);
 3763|       |
 3764|  13.8k|            if ((ent != NULL) &&
  ------------------
  |  Branch (3764:17): [True: 5.99k, False: 7.81k]
  ------------------
 3765|  5.99k|                (ent->etype != XML_INTERNAL_PREDEFINED_ENTITY)) {
  ------------------
  |  Branch (3765:17): [True: 5.40k, False: 588]
  ------------------
 3766|  5.40k|                if ((ent->flags & flags) != flags) {
  ------------------
  |  Branch (3766:21): [True: 2.77k, False: 2.63k]
  ------------------
 3767|  2.77k|                    pent->flags |= XML_ENT_EXPANDING;
  ------------------
  |  |   22|  2.77k|#define XML_ENT_EXPANDING   (1u << 3)
  ------------------
 3768|  2.77k|                    xmlCheckEntityInAttValue(ctxt, ent, depth);
 3769|  2.77k|                    pent->flags &= ~XML_ENT_EXPANDING;
  ------------------
  |  |   22|  2.77k|#define XML_ENT_EXPANDING   (1u << 3)
  ------------------
 3770|  2.77k|                }
 3771|       |
 3772|  5.40k|                xmlSaturatedAdd(&expandedSize, ent->expandedSize);
 3773|  5.40k|                xmlSaturatedAdd(&expandedSize, XML_ENT_FIXED_COST);
  ------------------
  |  |  169|  5.40k|#define XML_ENT_FIXED_COST 20
  ------------------
 3774|  5.40k|            }
 3775|  13.8k|        }
 3776|  29.3M|    }
 3777|       |
 3778|  3.51k|done:
 3779|  3.51k|    if (ctxt->inSubset == 0)
  ------------------
  |  Branch (3779:9): [True: 3.38k, False: 133]
  ------------------
 3780|  3.38k|        pent->expandedSize = expandedSize;
 3781|       |
 3782|  3.51k|    pent->flags |= flags;
 3783|  3.51k|}
parser.c:xmlCurrentCharRecover:
 2300|  37.6M|xmlCurrentCharRecover(xmlParserCtxtPtr ctxt, int *len) {
 2301|  37.6M|    int c = xmlCurrentChar(ctxt, len);
 2302|       |
 2303|  37.6M|    if (c == XML_INVALID_CHAR)
  ------------------
  |  |    9|  37.6M|#define XML_INVALID_CHAR 0x200000
  ------------------
  |  Branch (2303:9): [True: 8.08M, False: 29.5M]
  ------------------
 2304|  8.08M|        c = 0xFFFD; /* replacement character */
 2305|       |
 2306|  37.6M|    return(c);
 2307|  37.6M|}
parser.c:xmlParseCharDataInternal:
 4533|  7.47M|xmlParseCharDataInternal(xmlParserCtxtPtr ctxt, int partial) {
 4534|  7.47M|    const xmlChar *in;
 4535|  7.47M|    int line = ctxt->input->line;
 4536|  7.47M|    int col = ctxt->input->col;
 4537|  7.47M|    int ccol;
 4538|  7.47M|    int terminate = 0;
 4539|       |
 4540|  7.47M|    GROW;
  ------------------
  |  | 2271|  7.47M|    if ((!PARSER_PROGRESSIVE(ctxt)) && \
  |  |  ------------------
  |  |  |  |   47|  7.47M|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|  7.47M|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2271:9): [True: 4.01M, False: 3.46M]
  |  |  ------------------
  |  | 2272|  7.47M|        (ctxt->input->end - ctxt->input->cur < INPUT_CHUNK)) \
  |  |  ------------------
  |  |  |  |   63|  4.01M|#define INPUT_CHUNK	250
  |  |  ------------------
  |  |  |  Branch (2272:9): [True: 35.0k, False: 3.98M]
  |  |  ------------------
  |  | 2273|  7.47M|	xmlParserGrow(ctxt);
  ------------------
 4541|       |    /*
 4542|       |     * Accelerated common case where input don't need to be
 4543|       |     * modified before passing it to the handler.
 4544|       |     */
 4545|  7.47M|    in = ctxt->input->cur;
 4546|  7.48M|    do {
 4547|  7.58M|get_more_space:
 4548|  7.72M|        while (*in == 0x20) { in++; ctxt->input->col++; }
  ------------------
  |  Branch (4548:16): [True: 143k, False: 7.58M]
  ------------------
 4549|  7.58M|        if (*in == 0xA) {
  ------------------
  |  Branch (4549:13): [True: 104k, False: 7.48M]
  ------------------
 4550|  4.35M|            do {
 4551|  4.35M|                ctxt->input->line++; ctxt->input->col = 1;
 4552|  4.35M|                in++;
 4553|  4.35M|            } while (*in == 0xA);
  ------------------
  |  Branch (4553:22): [True: 4.25M, False: 104k]
  ------------------
 4554|   104k|            goto get_more_space;
 4555|   104k|        }
 4556|  7.48M|        if (*in == '<') {
  ------------------
  |  Branch (4556:13): [True: 78.8k, False: 7.40M]
  ------------------
 4557|   157k|            while (in > ctxt->input->cur) {
  ------------------
  |  Branch (4557:20): [True: 78.8k, False: 78.8k]
  ------------------
 4558|  78.8k|                const xmlChar *tmp = ctxt->input->cur;
 4559|  78.8k|                size_t nbchar = in - tmp;
 4560|       |
 4561|  78.8k|                if (nbchar > XML_MAX_ITEMS)
  ------------------
  |  |   13|  78.8k|#define XML_MAX_ITEMS 1000000000 /* 1 billion */
  ------------------
  |  Branch (4561:21): [True: 0, False: 78.8k]
  ------------------
 4562|      0|                    nbchar = XML_MAX_ITEMS;
  ------------------
  |  |   13|      0|#define XML_MAX_ITEMS 1000000000 /* 1 billion */
  ------------------
 4563|  78.8k|                ctxt->input->cur += nbchar;
 4564|       |
 4565|  78.8k|                xmlCharacters(ctxt, tmp, nbchar, 1);
 4566|  78.8k|            }
 4567|  78.8k|            return;
 4568|  78.8k|        }
 4569|       |
 4570|  7.95M|get_more:
 4571|  7.95M|        ccol = ctxt->input->col;
 4572|  15.2M|        while (test_char_data[*in]) {
  ------------------
  |  Branch (4572:16): [True: 7.30M, False: 7.95M]
  ------------------
 4573|  7.30M|            in++;
 4574|  7.30M|            ccol++;
 4575|  7.30M|        }
 4576|  7.95M|        ctxt->input->col = ccol;
 4577|  7.95M|        if (*in == 0xA) {
  ------------------
  |  Branch (4577:13): [True: 48.4k, False: 7.90M]
  ------------------
 4578|  3.02M|            do {
 4579|  3.02M|                ctxt->input->line++; ctxt->input->col = 1;
 4580|  3.02M|                in++;
 4581|  3.02M|            } while (*in == 0xA);
  ------------------
  |  Branch (4581:22): [True: 2.97M, False: 48.4k]
  ------------------
 4582|  48.4k|            goto get_more;
 4583|  48.4k|        }
 4584|  7.90M|        if (*in == ']') {
  ------------------
  |  Branch (4584:13): [True: 502k, False: 7.40M]
  ------------------
 4585|   502k|            size_t avail = ctxt->input->end - in;
 4586|       |
 4587|   502k|            if (partial && avail < 2) {
  ------------------
  |  Branch (4587:17): [True: 434k, False: 67.8k]
  |  Branch (4587:28): [True: 75, False: 434k]
  ------------------
 4588|     75|                terminate = 1;
 4589|     75|                goto invoke_callback;
 4590|     75|            }
 4591|   502k|            if (in[1] == ']') {
  ------------------
  |  Branch (4591:17): [True: 405k, False: 96.6k]
  ------------------
 4592|   405k|                if (partial && avail < 3) {
  ------------------
  |  Branch (4592:21): [True: 398k, False: 7.19k]
  |  Branch (4592:32): [True: 440, False: 398k]
  ------------------
 4593|    440|                    terminate = 1;
 4594|    440|                    goto invoke_callback;
 4595|    440|                }
 4596|   405k|                if (in[2] == '>')
  ------------------
  |  Branch (4596:21): [True: 3.09k, False: 402k]
  ------------------
 4597|  3.09k|                    xmlFatalErr(ctxt, XML_ERR_MISPLACED_CDATA_END, NULL);
 4598|   405k|            }
 4599|       |
 4600|   501k|            in++;
 4601|   501k|            ctxt->input->col++;
 4602|   501k|            goto get_more;
 4603|   502k|        }
 4604|       |
 4605|  7.40M|invoke_callback:
 4606|  7.89M|        while (in > ctxt->input->cur) {
  ------------------
  |  Branch (4606:16): [True: 492k, False: 7.40M]
  ------------------
 4607|   492k|            const xmlChar *tmp = ctxt->input->cur;
 4608|   492k|            size_t nbchar = in - tmp;
 4609|       |
 4610|   492k|            if (nbchar > XML_MAX_ITEMS)
  ------------------
  |  |   13|   492k|#define XML_MAX_ITEMS 1000000000 /* 1 billion */
  ------------------
  |  Branch (4610:17): [True: 0, False: 492k]
  ------------------
 4611|      0|                nbchar = XML_MAX_ITEMS;
  ------------------
  |  |   13|      0|#define XML_MAX_ITEMS 1000000000 /* 1 billion */
  ------------------
 4612|   492k|            ctxt->input->cur += nbchar;
 4613|       |
 4614|   492k|            xmlCharacters(ctxt, tmp, nbchar, 0);
 4615|       |
 4616|   492k|            line = ctxt->input->line;
 4617|   492k|            col = ctxt->input->col;
 4618|   492k|        }
 4619|  7.40M|        ctxt->input->cur = in;
 4620|  7.40M|        if (*in == 0xD) {
  ------------------
  |  Branch (4620:13): [True: 15.4k, False: 7.38M]
  ------------------
 4621|  15.4k|            in++;
 4622|  15.4k|            if (*in == 0xA) {
  ------------------
  |  Branch (4622:17): [True: 5.80k, False: 9.65k]
  ------------------
 4623|  5.80k|                ctxt->input->cur = in;
 4624|  5.80k|                in++;
 4625|  5.80k|                ctxt->input->line++; ctxt->input->col = 1;
 4626|  5.80k|                continue; /* while */
 4627|  5.80k|            }
 4628|  9.65k|            in--;
 4629|  9.65k|        }
 4630|  7.39M|        if (*in == '<') {
  ------------------
  |  Branch (4630:13): [True: 347k, False: 7.04M]
  ------------------
 4631|   347k|            return;
 4632|   347k|        }
 4633|  7.04M|        if (*in == '&') {
  ------------------
  |  Branch (4633:13): [True: 40.2k, False: 7.00M]
  ------------------
 4634|  40.2k|            return;
 4635|  40.2k|        }
 4636|  7.00M|        if (terminate) {
  ------------------
  |  Branch (4636:13): [True: 515, False: 7.00M]
  ------------------
 4637|    515|            return;
 4638|    515|        }
 4639|  7.00M|        SHRINK;
  ------------------
  |  | 2267|  7.00M|    if (!PARSER_PROGRESSIVE(ctxt)) \
  |  |  ------------------
  |  |  |  |   47|  7.00M|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|  7.00M|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2267:9): [True: 3.68M, False: 3.32M]
  |  |  ------------------
  |  | 2268|  7.00M|	xmlParserShrink(ctxt);
  ------------------
 4640|  7.00M|        GROW;
  ------------------
  |  | 2271|  7.00M|    if ((!PARSER_PROGRESSIVE(ctxt)) && \
  |  |  ------------------
  |  |  |  |   47|  7.00M|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|  7.00M|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2271:9): [True: 3.68M, False: 3.32M]
  |  |  ------------------
  |  | 2272|  7.00M|        (ctxt->input->end - ctxt->input->cur < INPUT_CHUNK)) \
  |  |  ------------------
  |  |  |  |   63|  3.68M|#define INPUT_CHUNK	250
  |  |  ------------------
  |  |  |  Branch (2272:9): [True: 16.4k, False: 3.66M]
  |  |  ------------------
  |  | 2273|  7.00M|	xmlParserGrow(ctxt);
  ------------------
 4641|  7.00M|        in = ctxt->input->cur;
 4642|  7.01M|    } while (((*in >= 0x20) && (*in <= 0x7F)) ||
  ------------------
  |  Branch (4642:15): [True: 109k, False: 6.90M]
  |  Branch (4642:32): [True: 1.33k, False: 108k]
  ------------------
 4643|  7.01M|             (*in == 0x09) || (*in == 0x0a));
  ------------------
  |  Branch (4643:14): [True: 2.87k, False: 7.01M]
  |  Branch (4643:31): [True: 1.42k, False: 7.00M]
  ------------------
 4644|  7.00M|    ctxt->input->line = line;
 4645|  7.00M|    ctxt->input->col = col;
 4646|  7.00M|    xmlParseCharDataComplex(ctxt, partial);
 4647|  7.00M|}
parser.c:xmlCharacters:
 4487|   744k|              int isBlank) {
 4488|   744k|    int checkBlanks;
 4489|       |
 4490|   744k|    if ((ctxt->sax == NULL) || (ctxt->disableSAX))
  ------------------
  |  Branch (4490:9): [True: 0, False: 744k]
  |  Branch (4490:32): [True: 125k, False: 619k]
  ------------------
 4491|   125k|        return;
 4492|       |
 4493|   619k|    checkBlanks = (!ctxt->keepBlanks) ||
  ------------------
  |  Branch (4493:19): [True: 375k, False: 244k]
  ------------------
 4494|   244k|                  (ctxt->sax->ignorableWhitespace != ctxt->sax->characters);
  ------------------
  |  Branch (4494:19): [True: 0, False: 244k]
  ------------------
 4495|       |
 4496|       |    /*
 4497|       |     * Calling areBlanks with only parts of a text node
 4498|       |     * is fundamentally broken, making the NOBLANKS option
 4499|       |     * essentially unusable.
 4500|       |     */
 4501|   619k|    if ((checkBlanks) &&
  ------------------
  |  Branch (4501:9): [True: 375k, False: 244k]
  ------------------
 4502|   375k|        (areBlanks(ctxt, buf, size, isBlank))) {
  ------------------
  |  Branch (4502:9): [True: 11.8k, False: 363k]
  ------------------
 4503|  11.8k|        if ((ctxt->sax->ignorableWhitespace != NULL) &&
  ------------------
  |  Branch (4503:13): [True: 11.8k, False: 0]
  ------------------
 4504|  11.8k|            (ctxt->keepBlanks))
  ------------------
  |  Branch (4504:13): [True: 0, False: 11.8k]
  ------------------
 4505|      0|            ctxt->sax->ignorableWhitespace(ctxt->userData, buf, size);
 4506|   607k|    } else {
 4507|   607k|        if (ctxt->sax->characters != NULL)
  ------------------
  |  Branch (4507:13): [True: 607k, False: 0]
  ------------------
 4508|   607k|            ctxt->sax->characters(ctxt->userData, buf, size);
 4509|       |
 4510|       |        /*
 4511|       |         * The old code used to update this value for "complex" data
 4512|       |         * even if checkBlanks was false. This was probably a bug.
 4513|       |         */
 4514|   607k|        if ((checkBlanks) && (*ctxt->space == -1))
  ------------------
  |  Branch (4514:13): [True: 363k, False: 244k]
  |  Branch (4514:30): [True: 133k, False: 229k]
  ------------------
 4515|   133k|            *ctxt->space = -2;
 4516|   607k|    }
 4517|   619k|}
parser.c:areBlanks:
 2815|   375k|                     int blank_chars) {
 2816|   375k|    int i;
 2817|   375k|    xmlNodePtr lastChild;
 2818|       |
 2819|       |    /*
 2820|       |     * Check for xml:space value.
 2821|       |     */
 2822|   375k|    if ((ctxt->space == NULL) || (*(ctxt->space) == 1) ||
  ------------------
  |  Branch (2822:9): [True: 0, False: 375k]
  |  Branch (2822:34): [True: 403, False: 374k]
  ------------------
 2823|   374k|        (*(ctxt->space) == -2))
  ------------------
  |  Branch (2823:9): [True: 228k, False: 146k]
  ------------------
 2824|   228k|	return(0);
 2825|       |
 2826|       |    /*
 2827|       |     * Check that the string is made of blanks
 2828|       |     */
 2829|   146k|    if (blank_chars == 0) {
  ------------------
  |  Branch (2829:9): [True: 135k, False: 10.3k]
  ------------------
 2830|   217k|	for (i = 0;i < len;i++)
  ------------------
  |  Branch (2830:13): [True: 212k, False: 4.66k]
  ------------------
 2831|   212k|	    if (!(IS_BLANK_CH(str[i]))) return(0);
  ------------------
  |  |  137|   212k|#define IS_BLANK_CH(c)  xmlIsBlank_ch(c)
  |  |  ------------------
  |  |  |  |   90|   212k|#define xmlIsBlank_ch(c)	(((c) == 0x20) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (90:27): [True: 12.8k, False: 199k]
  |  |  |  |  ------------------
  |  |  |  |   91|   212k|				 ((0x9 <= (c)) && ((c) <= 0xa)) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (91:7): [True: 199k, False: 0]
  |  |  |  |  |  Branch (91:23): [True: 68.7k, False: 131k]
  |  |  |  |  ------------------
  |  |  |  |   92|   212k|				 ((c) == 0xd))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (92:6): [True: 0, False: 131k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2832|   135k|    }
 2833|       |
 2834|       |    /*
 2835|       |     * Look if the element is mixed content in the DTD if available
 2836|       |     */
 2837|  15.0k|    if (ctxt->node == NULL) return(0);
  ------------------
  |  Branch (2837:9): [True: 0, False: 15.0k]
  ------------------
 2838|  15.0k|    if (ctxt->myDoc != NULL) {
  ------------------
  |  Branch (2838:9): [True: 15.0k, False: 0]
  ------------------
 2839|  15.0k|        xmlElementPtr elemDecl = NULL;
 2840|  15.0k|        xmlDocPtr doc = ctxt->myDoc;
 2841|  15.0k|        const xmlChar *prefix = NULL;
 2842|       |
 2843|  15.0k|        if (ctxt->node->ns)
  ------------------
  |  Branch (2843:13): [True: 1.86k, False: 13.1k]
  ------------------
 2844|  1.86k|            prefix = ctxt->node->ns->prefix;
 2845|  15.0k|        if (doc->intSubset != NULL)
  ------------------
  |  Branch (2845:13): [True: 9.40k, False: 5.61k]
  ------------------
 2846|  9.40k|            elemDecl = xmlHashLookup2(doc->intSubset->elements, ctxt->node->name,
 2847|  9.40k|                                      prefix);
 2848|  15.0k|        if ((elemDecl == NULL) && (doc->extSubset != NULL))
  ------------------
  |  Branch (2848:13): [True: 12.2k, False: 2.73k]
  |  Branch (2848:35): [True: 408, False: 11.8k]
  ------------------
 2849|    408|            elemDecl = xmlHashLookup2(doc->extSubset->elements, ctxt->node->name,
 2850|    408|                                      prefix);
 2851|  15.0k|        if (elemDecl != NULL) {
  ------------------
  |  Branch (2851:13): [True: 2.81k, False: 12.2k]
  ------------------
 2852|  2.81k|            if (elemDecl->etype == XML_ELEMENT_TYPE_ELEMENT)
  ------------------
  |  Branch (2852:17): [True: 1.74k, False: 1.06k]
  ------------------
 2853|  1.74k|                return(1);
 2854|  1.06k|            if ((elemDecl->etype == XML_ELEMENT_TYPE_ANY) ||
  ------------------
  |  Branch (2854:17): [True: 273, False: 793]
  ------------------
 2855|    793|                (elemDecl->etype == XML_ELEMENT_TYPE_MIXED))
  ------------------
  |  Branch (2855:17): [True: 281, False: 512]
  ------------------
 2856|    554|                return(0);
 2857|  1.06k|        }
 2858|  15.0k|    }
 2859|       |
 2860|       |    /*
 2861|       |     * Otherwise, heuristic :-\
 2862|       |     *
 2863|       |     * When push parsing, we could be at the end of a chunk.
 2864|       |     * This makes the look-ahead and consequently the NOBLANKS
 2865|       |     * option unreliable.
 2866|       |     */
 2867|  12.7k|    if ((RAW != '<') && (RAW != 0xD)) return(0);
  ------------------
  |  | 2224|  12.7k|#define RAW (*ctxt->input->cur)
  ------------------
                  if ((RAW != '<') && (RAW != 0xD)) return(0);
  ------------------
  |  | 2224|  3.39k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (2867:9): [True: 3.39k, False: 9.32k]
  |  Branch (2867:25): [True: 1.74k, False: 1.64k]
  ------------------
 2868|  10.9k|    if ((ctxt->node->children == NULL) &&
  ------------------
  |  Branch (2868:9): [True: 8.94k, False: 2.03k]
  ------------------
 2869|  8.94k|	(RAW == '<') && (NXT(1) == '/')) return(0);
  ------------------
  |  | 2224|  8.94k|#define RAW (*ctxt->input->cur)
  ------------------
              	(RAW == '<') && (NXT(1) == '/')) return(0);
  ------------------
  |  | 2226|  7.41k|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
  |  Branch (2869:2): [True: 7.41k, False: 1.52k]
  |  Branch (2869:18): [True: 388, False: 7.03k]
  ------------------
 2870|       |
 2871|  10.5k|    lastChild = xmlGetLastChild(ctxt->node);
 2872|  10.5k|    if (lastChild == NULL) {
  ------------------
  |  Branch (2872:9): [True: 8.55k, False: 2.03k]
  ------------------
 2873|  8.55k|        if ((ctxt->node->type != XML_ELEMENT_NODE) &&
  ------------------
  |  Branch (2873:13): [True: 0, False: 8.55k]
  ------------------
 2874|      0|            (ctxt->node->content != NULL)) return(0);
  ------------------
  |  Branch (2874:13): [True: 0, False: 0]
  ------------------
 2875|  8.55k|    } else if (xmlNodeIsText(lastChild))
  ------------------
  |  Branch (2875:16): [True: 231, False: 1.80k]
  ------------------
 2876|    231|        return(0);
 2877|  1.80k|    else if ((ctxt->node->children != NULL) &&
  ------------------
  |  Branch (2877:14): [True: 1.80k, False: 0]
  ------------------
 2878|  1.80k|             (xmlNodeIsText(ctxt->node->children)))
  ------------------
  |  Branch (2878:14): [True: 216, False: 1.58k]
  ------------------
 2879|    216|        return(0);
 2880|  10.1k|    return(1);
 2881|  10.5k|}
parser.c:xmlParseCharDataComplex:
 4660|  7.00M|xmlParseCharDataComplex(xmlParserCtxtPtr ctxt, int partial) {
 4661|  7.00M|    xmlChar buf[XML_PARSER_BIG_BUFFER_SIZE + 5];
 4662|  7.00M|    int nbchar = 0;
 4663|  7.00M|    int cur, l;
 4664|       |
 4665|  7.00M|    cur = xmlCurrentCharRecover(ctxt, &l);
 4666|  17.6M|    while ((cur != '<') && /* checked */
  ------------------
  |  Branch (4666:12): [True: 17.5M, False: 59.2k]
  ------------------
 4667|  17.5M|           (cur != '&') &&
  ------------------
  |  Branch (4667:12): [True: 17.5M, False: 6.10k]
  ------------------
 4668|  17.5M|	   (IS_CHAR(cur))) {
  ------------------
  |  |  115|  17.5M|#define IS_CHAR(c)   xmlIsCharQ(c)
  |  |  ------------------
  |  |  |  |  117|  17.5M|#define xmlIsCharQ(c)		(((c) < 0x100) ? \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (117:25): [True: 13.1M, False: 4.41M]
  |  |  |  |  ------------------
  |  |  |  |  118|  17.5M|				 xmlIsChar_ch((c)) :\
  |  |  |  |  ------------------
  |  |  |  |  |  |  108|  13.1M|#define xmlIsChar_ch(c)		(((0x9 <= (c)) && ((c) <= 0xa)) || \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (108:28): [True: 6.33M, False: 6.81M]
  |  |  |  |  |  |  |  Branch (108:44): [True: 2.51M, False: 3.81M]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  109|  13.1M|				 ((c) == 0xd) || \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (109:6): [True: 0, False: 10.6M]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  110|  13.1M|				  (0x20 <= (c)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (110:7): [True: 3.68M, False: 6.93M]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  119|  17.5M|				(((0x100 <= (c)) && ((c) <= 0xd7ff)) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (119:7): [True: 4.41M, False: 0]
  |  |  |  |  |  Branch (119:25): [True: 972k, False: 3.43M]
  |  |  |  |  ------------------
  |  |  |  |  120|  4.41M|				 ((0xe000 <= (c)) && ((c) <= 0xfffd)) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (120:7): [True: 3.43M, False: 0]
  |  |  |  |  |  Branch (120:26): [True: 3.43M, False: 8.94k]
  |  |  |  |  ------------------
  |  |  |  |  121|  4.41M|				 ((0x10000 <= (c)) && ((c) <= 0x10ffff))))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (121:7): [True: 6.72k, False: 2.22k]
  |  |  |  |  |  Branch (121:27): [True: 6.72k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (4668:5): [True: 10.6M, False: 6.94M]
  ------------------
 4669|  10.6M|        if (cur == ']') {
  ------------------
  |  Branch (4669:13): [True: 1.08M, False: 9.53M]
  ------------------
 4670|  1.08M|            size_t avail = ctxt->input->end - ctxt->input->cur;
 4671|       |
 4672|  1.08M|            if (partial && avail < 2)
  ------------------
  |  Branch (4672:17): [True: 1.07M, False: 16.2k]
  |  Branch (4672:28): [True: 51, False: 1.07M]
  ------------------
 4673|     51|                break;
 4674|  1.08M|            if (NXT(1) == ']') {
  ------------------
  |  | 2226|  1.08M|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
  |  Branch (4674:17): [True: 1.06M, False: 25.0k]
  ------------------
 4675|  1.06M|                if (partial && avail < 3)
  ------------------
  |  Branch (4675:21): [True: 1.04M, False: 11.8k]
  |  Branch (4675:32): [True: 2.40k, False: 1.04M]
  ------------------
 4676|  2.40k|                    break;
 4677|  1.05M|                if (NXT(2) == '>')
  ------------------
  |  | 2226|  1.05M|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
  |  Branch (4677:21): [True: 1.43k, False: 1.05M]
  ------------------
 4678|  1.43k|                    xmlFatalErr(ctxt, XML_ERR_MISPLACED_CDATA_END, NULL);
 4679|  1.05M|            }
 4680|  1.08M|        }
 4681|       |
 4682|  10.6M|	COPY_BUF(buf, nbchar, cur);
  ------------------
  |  | 2296|  10.6M|    if (v < 0x80) b[i++] = v;						\
  |  |  ------------------
  |  |  |  Branch (2296:9): [True: 4.98M, False: 5.63M]
  |  |  ------------------
  |  | 2297|  10.6M|    else i += xmlCopyCharMultiByte(&b[i],v)
  ------------------
 4683|       |	/* move current position before possible calling of ctxt->sax->characters */
 4684|  10.6M|	NEXTL(l);
  ------------------
  |  | 2288|  10.6M|#define NEXTL(l) do {							\
  |  | 2289|  10.6M|    if (*(ctxt->input->cur) == '\n') {					\
  |  |  ------------------
  |  |  |  Branch (2289:9): [True: 2.44M, False: 8.16M]
  |  |  ------------------
  |  | 2290|  2.44M|	ctxt->input->line++; ctxt->input->col = 1;			\
  |  | 2291|  8.16M|    } else ctxt->input->col++;						\
  |  | 2292|  10.6M|    ctxt->input->cur += l;				\
  |  | 2293|  10.6M|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2293:12): [Folded, False: 10.6M]
  |  |  ------------------
  ------------------
 4685|  10.6M|	if (nbchar >= XML_PARSER_BIG_BUFFER_SIZE) {
  ------------------
  |  |  171|  10.6M|#define XML_PARSER_BIG_BUFFER_SIZE 300
  ------------------
  |  Branch (4685:6): [True: 57.1k, False: 10.5M]
  ------------------
 4686|  57.1k|	    buf[nbchar] = 0;
 4687|       |
 4688|  57.1k|            xmlCharacters(ctxt, buf, nbchar, 0);
 4689|  57.1k|	    nbchar = 0;
 4690|  57.1k|            SHRINK;
  ------------------
  |  | 2267|  57.1k|    if (!PARSER_PROGRESSIVE(ctxt)) \
  |  |  ------------------
  |  |  |  |   47|  57.1k|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|  57.1k|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2267:9): [True: 43.6k, False: 13.5k]
  |  |  ------------------
  |  | 2268|  57.1k|	xmlParserShrink(ctxt);
  ------------------
 4691|  57.1k|	}
 4692|  10.6M|	cur = xmlCurrentCharRecover(ctxt, &l);
 4693|  10.6M|    }
 4694|  7.00M|    if (nbchar != 0) {
  ------------------
  |  Branch (4694:9): [True: 116k, False: 6.89M]
  ------------------
 4695|   116k|        buf[nbchar] = 0;
 4696|       |
 4697|   116k|        xmlCharacters(ctxt, buf, nbchar, 0);
 4698|   116k|    }
 4699|       |    /*
 4700|       |     * cur == 0 can mean
 4701|       |     *
 4702|       |     * - End of buffer.
 4703|       |     * - An actual 0 character.
 4704|       |     * - An incomplete UTF-8 sequence. This is allowed if partial is set.
 4705|       |     */
 4706|  7.00M|    if (ctxt->input->cur < ctxt->input->end) {
  ------------------
  |  Branch (4706:9): [True: 7.00M, False: 3.64k]
  ------------------
 4707|  7.00M|        if ((cur == 0) && (CUR != 0)) {
  ------------------
  |  | 2225|  6.59M|#define CUR (*ctxt->input->cur)
  ------------------
  |  Branch (4707:13): [True: 6.59M, False: 408k]
  |  Branch (4707:27): [True: 622, False: 6.59M]
  ------------------
 4708|    622|            if (partial == 0) {
  ------------------
  |  Branch (4708:17): [True: 369, False: 253]
  ------------------
 4709|    369|                xmlFatalErrMsgInt(ctxt, XML_ERR_INVALID_CHAR,
 4710|    369|                        "Incomplete UTF-8 sequence starting with %02X\n", CUR);
  ------------------
  |  | 2225|    369|#define CUR (*ctxt->input->cur)
  ------------------
 4711|    369|                NEXTL(1);
  ------------------
  |  | 2288|    369|#define NEXTL(l) do {							\
  |  | 2289|    369|    if (*(ctxt->input->cur) == '\n') {					\
  |  |  ------------------
  |  |  |  Branch (2289:9): [True: 0, False: 369]
  |  |  ------------------
  |  | 2290|      0|	ctxt->input->line++; ctxt->input->col = 1;			\
  |  | 2291|    369|    } else ctxt->input->col++;						\
  |  | 2292|    369|    ctxt->input->cur += l;				\
  |  | 2293|    369|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2293:12): [Folded, False: 369]
  |  |  ------------------
  ------------------
 4712|    369|            }
 4713|  7.00M|        } else if ((cur != '<') && (cur != '&') && (cur != ']')) {
  ------------------
  |  Branch (4713:20): [True: 6.94M, False: 59.2k]
  |  Branch (4713:36): [True: 6.93M, False: 6.10k]
  |  Branch (4713:52): [True: 6.93M, False: 2.46k]
  ------------------
 4714|       |            /* Generate the error and skip the offending character */
 4715|  6.93M|            xmlFatalErrMsgInt(ctxt, XML_ERR_INVALID_CHAR,
 4716|  6.93M|                              "PCDATA invalid Char value %d\n", cur);
 4717|  6.93M|            NEXTL(l);
  ------------------
  |  | 2288|  6.93M|#define NEXTL(l) do {							\
  |  | 2289|  6.93M|    if (*(ctxt->input->cur) == '\n') {					\
  |  |  ------------------
  |  |  |  Branch (2289:9): [True: 0, False: 6.93M]
  |  |  ------------------
  |  | 2290|      0|	ctxt->input->line++; ctxt->input->col = 1;			\
  |  | 2291|  6.93M|    } else ctxt->input->col++;						\
  |  | 2292|  6.93M|    ctxt->input->cur += l;				\
  |  | 2293|  6.93M|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2293:12): [Folded, False: 6.93M]
  |  |  ------------------
  ------------------
 4718|  6.93M|        }
 4719|  7.00M|    }
 4720|  7.00M|}
parser.c:xmlFatalErrMsgStr:
  348|   506k|{
  349|   506k|    xmlCtxtErr(ctxt, NULL, XML_FROM_PARSER, error, XML_ERR_FATAL,
  350|   506k|               val, NULL, NULL, 0, msg, val);
  351|   506k|}
parser.c:xmlParseCommentComplex:
 4819|   116k|                       size_t len, size_t size) {
 4820|   116k|    int q, ql;
 4821|   116k|    int r, rl;
 4822|   116k|    int cur, l;
 4823|   116k|    int maxLength = (ctxt->options & XML_PARSE_HUGE) ?
  ------------------
  |  Branch (4823:21): [True: 46.0k, False: 70.9k]
  ------------------
 4824|  46.0k|                    XML_MAX_HUGE_LENGTH :
  ------------------
  |  |   55|  46.0k|#define XML_MAX_HUGE_LENGTH 1000000000
  ------------------
 4825|   116k|                    XML_MAX_TEXT_LENGTH;
  ------------------
  |  |   50|  70.9k|#define XML_MAX_TEXT_LENGTH 10000000
  ------------------
 4826|       |
 4827|   116k|    if (buf == NULL) {
  ------------------
  |  Branch (4827:9): [True: 16.2k, False: 100k]
  ------------------
 4828|  16.2k|        len = 0;
 4829|  16.2k|	size = XML_PARSER_BUFFER_SIZE;
  ------------------
  |  |  172|  16.2k|#define XML_PARSER_BUFFER_SIZE 100
  ------------------
 4830|  16.2k|	buf = xmlMalloc(size);
 4831|  16.2k|	if (buf == NULL) {
  ------------------
  |  Branch (4831:6): [True: 2, False: 16.2k]
  ------------------
 4832|      2|	    xmlErrMemory(ctxt);
 4833|      2|	    return;
 4834|      2|	}
 4835|  16.2k|    }
 4836|   116k|    q = xmlCurrentCharRecover(ctxt, &ql);
 4837|   116k|    if (q == 0)
  ------------------
  |  Branch (4837:9): [True: 897, False: 116k]
  ------------------
 4838|    897|        goto not_terminated;
 4839|   116k|    if (!IS_CHAR(q)) {
  ------------------
  |  |  115|   116k|#define IS_CHAR(c)   xmlIsCharQ(c)
  |  |  ------------------
  |  |  |  |  117|   116k|#define xmlIsCharQ(c)		(((c) < 0x100) ? \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (117:25): [True: 69.4k, False: 46.6k]
  |  |  |  |  ------------------
  |  |  |  |  118|   116k|				 xmlIsChar_ch((c)) :\
  |  |  |  |  ------------------
  |  |  |  |  |  |  108|  69.4k|#define xmlIsChar_ch(c)		(((0x9 <= (c)) && ((c) <= 0xa)) || \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (108:28): [True: 69.1k, False: 326]
  |  |  |  |  |  |  |  Branch (108:44): [True: 65.7k, False: 3.40k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  109|  69.4k|				 ((c) == 0xd) || \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (109:6): [True: 0, False: 3.73k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  110|  69.4k|				  (0x20 <= (c)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (110:7): [True: 3.01k, False: 713]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  119|   116k|				(((0x100 <= (c)) && ((c) <= 0xd7ff)) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (119:7): [True: 46.6k, False: 0]
  |  |  |  |  |  Branch (119:25): [True: 4.73k, False: 41.8k]
  |  |  |  |  ------------------
  |  |  |  |  120|  46.6k|				 ((0xe000 <= (c)) && ((c) <= 0xfffd)) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (120:7): [True: 41.8k, False: 0]
  |  |  |  |  |  Branch (120:26): [True: 41.4k, False: 459]
  |  |  |  |  ------------------
  |  |  |  |  121|  46.6k|				 ((0x10000 <= (c)) && ((c) <= 0x10ffff))))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (121:7): [True: 244, False: 215]
  |  |  |  |  |  Branch (121:27): [True: 244, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (4839:9): [True: 928, False: 115k]
  ------------------
 4840|    928|        xmlFatalErrMsgInt(ctxt, XML_ERR_INVALID_CHAR,
 4841|    928|                          "xmlParseComment: invalid xmlChar value %d\n",
 4842|    928|	                  q);
 4843|    928|	xmlFree (buf);
 4844|    928|	return;
 4845|    928|    }
 4846|   115k|    NEXTL(ql);
  ------------------
  |  | 2288|   115k|#define NEXTL(l) do {							\
  |  | 2289|   115k|    if (*(ctxt->input->cur) == '\n') {					\
  |  |  ------------------
  |  |  |  Branch (2289:9): [True: 295, False: 114k]
  |  |  ------------------
  |  | 2290|    295|	ctxt->input->line++; ctxt->input->col = 1;			\
  |  | 2291|   114k|    } else ctxt->input->col++;						\
  |  | 2292|   115k|    ctxt->input->cur += l;				\
  |  | 2293|   115k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2293:12): [Folded, False: 115k]
  |  |  ------------------
  ------------------
 4847|   115k|    r = xmlCurrentCharRecover(ctxt, &rl);
 4848|   115k|    if (r == 0)
  ------------------
  |  Branch (4848:9): [True: 572, False: 114k]
  ------------------
 4849|    572|        goto not_terminated;
 4850|   114k|    if (!IS_CHAR(r)) {
  ------------------
  |  |  115|   114k|#define IS_CHAR(c)   xmlIsCharQ(c)
  |  |  ------------------
  |  |  |  |  117|   114k|#define xmlIsCharQ(c)		(((c) < 0x100) ? \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (117:25): [True: 84.2k, False: 30.3k]
  |  |  |  |  ------------------
  |  |  |  |  118|   114k|				 xmlIsChar_ch((c)) :\
  |  |  |  |  ------------------
  |  |  |  |  |  |  108|  84.2k|#define xmlIsChar_ch(c)		(((0x9 <= (c)) && ((c) <= 0xa)) || \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (108:28): [True: 83.7k, False: 466]
  |  |  |  |  |  |  |  Branch (108:44): [True: 70.1k, False: 13.5k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  109|  84.2k|				 ((c) == 0xd) || \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (109:6): [True: 0, False: 14.0k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  110|  84.2k|				  (0x20 <= (c)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (110:7): [True: 13.5k, False: 515]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  119|   114k|				(((0x100 <= (c)) && ((c) <= 0xd7ff)) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (119:7): [True: 30.3k, False: 0]
  |  |  |  |  |  Branch (119:25): [True: 1.12k, False: 29.2k]
  |  |  |  |  ------------------
  |  |  |  |  120|  30.3k|				 ((0xe000 <= (c)) && ((c) <= 0xfffd)) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (120:7): [True: 29.2k, False: 0]
  |  |  |  |  |  Branch (120:26): [True: 28.3k, False: 857]
  |  |  |  |  ------------------
  |  |  |  |  121|  30.3k|				 ((0x10000 <= (c)) && ((c) <= 0x10ffff))))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (121:7): [True: 547, False: 310]
  |  |  |  |  |  Branch (121:27): [True: 547, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (4850:9): [True: 825, False: 113k]
  ------------------
 4851|    825|        xmlFatalErrMsgInt(ctxt, XML_ERR_INVALID_CHAR,
 4852|    825|                          "xmlParseComment: invalid xmlChar value %d\n",
 4853|    825|	                  r);
 4854|    825|	xmlFree (buf);
 4855|    825|	return;
 4856|    825|    }
 4857|   113k|    NEXTL(rl);
  ------------------
  |  | 2288|   113k|#define NEXTL(l) do {							\
  |  | 2289|   113k|    if (*(ctxt->input->cur) == '\n') {					\
  |  |  ------------------
  |  |  |  Branch (2289:9): [True: 11.1k, False: 102k]
  |  |  ------------------
  |  | 2290|  11.1k|	ctxt->input->line++; ctxt->input->col = 1;			\
  |  | 2291|   102k|    } else ctxt->input->col++;						\
  |  | 2292|   113k|    ctxt->input->cur += l;				\
  |  | 2293|   113k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2293:12): [Folded, False: 113k]
  |  |  ------------------
  ------------------
 4858|   113k|    cur = xmlCurrentCharRecover(ctxt, &l);
 4859|   113k|    if (cur == 0)
  ------------------
  |  Branch (4859:9): [True: 866, False: 112k]
  ------------------
 4860|    866|        goto not_terminated;
 4861|  9.87M|    while (IS_CHAR(cur) && /* checked */
  ------------------
  |  |  115|  9.87M|#define IS_CHAR(c)   xmlIsCharQ(c)
  |  |  ------------------
  |  |  |  |  117|  19.7M|#define xmlIsCharQ(c)		(((c) < 0x100) ? \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (117:24): [True: 9.86M, False: 4.56k]
  |  |  |  |  |  Branch (117:25): [True: 8.23M, False: 1.63M]
  |  |  |  |  ------------------
  |  |  |  |  118|  19.7M|				 xmlIsChar_ch((c)) :\
  |  |  |  |  ------------------
  |  |  |  |  |  |  108|  8.23M|#define xmlIsChar_ch(c)		(((0x9 <= (c)) && ((c) <= 0xa)) || \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (108:28): [True: 8.22M, False: 4.02k]
  |  |  |  |  |  |  |  Branch (108:44): [True: 1.84M, False: 6.38M]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  109|  8.23M|				 ((c) == 0xd) || \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (109:6): [True: 0, False: 6.38M]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  110|  8.23M|				  (0x20 <= (c)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (110:7): [True: 6.38M, False: 4.12k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  119|  19.7M|				(((0x100 <= (c)) && ((c) <= 0xd7ff)) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (119:7): [True: 1.63M, False: 0]
  |  |  |  |  |  Branch (119:25): [True: 12.1k, False: 1.62M]
  |  |  |  |  ------------------
  |  |  |  |  120|  1.63M|				 ((0xe000 <= (c)) && ((c) <= 0xfffd)) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (120:7): [True: 1.62M, False: 0]
  |  |  |  |  |  Branch (120:26): [True: 1.62M, False: 848]
  |  |  |  |  ------------------
  |  |  |  |  121|  1.63M|				 ((0x10000 <= (c)) && ((c) <= 0x10ffff))))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (121:7): [True: 403, False: 445]
  |  |  |  |  |  Branch (121:27): [True: 403, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 4862|  9.86M|           ((cur != '>') ||
  ------------------
  |  Branch (4862:13): [True: 9.54M, False: 317k]
  ------------------
 4863|  9.75M|	    (r != '-') || (q != '-'))) {
  ------------------
  |  Branch (4863:6): [True: 200k, False: 116k]
  |  Branch (4863:20): [True: 8.44k, False: 108k]
  ------------------
 4864|  9.75M|	if ((r == '-') && (q == '-')) {
  ------------------
  |  Branch (4864:6): [True: 561k, False: 9.19M]
  |  Branch (4864:20): [True: 286k, False: 275k]
  ------------------
 4865|   286k|	    xmlFatalErr(ctxt, XML_ERR_HYPHEN_IN_COMMENT, NULL);
 4866|   286k|	}
 4867|  9.75M|	if (len + 5 >= size) {
  ------------------
  |  Branch (4867:6): [True: 48.6k, False: 9.70M]
  ------------------
 4868|  48.6k|	    xmlChar *tmp;
 4869|  48.6k|            int newSize;
 4870|       |
 4871|  48.6k|	    newSize = xmlGrowCapacity(size, 1, 1, maxLength);
 4872|  48.6k|            if (newSize < 0) {
  ------------------
  |  Branch (4872:17): [True: 0, False: 48.6k]
  ------------------
 4873|      0|                xmlFatalErrMsgStr(ctxt, XML_ERR_COMMENT_NOT_FINISHED,
 4874|      0|                             "Comment too big found", NULL);
 4875|      0|                xmlFree (buf);
 4876|      0|                return;
 4877|      0|            }
 4878|  48.6k|	    tmp = xmlRealloc(buf, newSize);
 4879|  48.6k|	    if (tmp == NULL) {
  ------------------
  |  Branch (4879:10): [True: 6, False: 48.6k]
  ------------------
 4880|      6|		xmlErrMemory(ctxt);
 4881|      6|		xmlFree(buf);
 4882|      6|		return;
 4883|      6|	    }
 4884|  48.6k|	    buf = tmp;
 4885|  48.6k|            size = newSize;
 4886|  48.6k|	}
 4887|  9.75M|	COPY_BUF(buf, len, q);
  ------------------
  |  | 2296|  9.75M|    if (v < 0x80) b[i++] = v;						\
  |  |  ------------------
  |  |  |  Branch (2296:9): [True: 7.81M, False: 1.94M]
  |  |  ------------------
  |  | 2297|  9.75M|    else i += xmlCopyCharMultiByte(&b[i],v)
  ------------------
 4888|       |
 4889|  9.75M|	q = r;
 4890|  9.75M|	ql = rl;
 4891|  9.75M|	r = cur;
 4892|  9.75M|	rl = l;
 4893|       |
 4894|  9.75M|	NEXTL(l);
  ------------------
  |  | 2288|  9.75M|#define NEXTL(l) do {							\
  |  | 2289|  9.75M|    if (*(ctxt->input->cur) == '\n') {					\
  |  |  ------------------
  |  |  |  Branch (2289:9): [True: 1.32M, False: 8.42M]
  |  |  ------------------
  |  | 2290|  1.32M|	ctxt->input->line++; ctxt->input->col = 1;			\
  |  | 2291|  8.42M|    } else ctxt->input->col++;						\
  |  | 2292|  9.75M|    ctxt->input->cur += l;				\
  |  | 2293|  9.75M|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2293:12): [Folded, False: 9.75M]
  |  |  ------------------
  ------------------
 4895|  9.75M|	cur = xmlCurrentCharRecover(ctxt, &l);
 4896|       |
 4897|  9.75M|    }
 4898|   112k|    buf[len] = 0;
 4899|   112k|    if (cur == 0) {
  ------------------
  |  Branch (4899:9): [True: 3.62k, False: 109k]
  ------------------
 4900|  3.62k|	xmlFatalErrMsgStr(ctxt, XML_ERR_COMMENT_NOT_FINISHED,
 4901|  3.62k|	                     "Comment not terminated \n<!--%.50s\n", buf);
 4902|   109k|    } else if (!IS_CHAR(cur)) {
  ------------------
  |  |  115|   109k|#define IS_CHAR(c)   xmlIsCharQ(c)
  |  |  ------------------
  |  |  |  |  117|   109k|#define xmlIsCharQ(c)		(((c) < 0x100) ? \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (117:25): [True: 108k, False: 445]
  |  |  |  |  ------------------
  |  |  |  |  118|   109k|				 xmlIsChar_ch((c)) :\
  |  |  |  |  ------------------
  |  |  |  |  |  |  108|   108k|#define xmlIsChar_ch(c)		(((0x9 <= (c)) && ((c) <= 0xa)) || \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (108:28): [True: 108k, False: 404]
  |  |  |  |  |  |  |  Branch (108:44): [True: 0, False: 108k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  109|   108k|				 ((c) == 0xd) || \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (109:6): [True: 0, False: 108k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  110|   108k|				  (0x20 <= (c)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (110:7): [True: 108k, False: 498]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  119|   109k|				(((0x100 <= (c)) && ((c) <= 0xd7ff)) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (119:7): [True: 445, False: 0]
  |  |  |  |  |  Branch (119:25): [True: 0, False: 445]
  |  |  |  |  ------------------
  |  |  |  |  120|    445|				 ((0xe000 <= (c)) && ((c) <= 0xfffd)) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (120:7): [True: 445, False: 0]
  |  |  |  |  |  Branch (120:26): [True: 0, False: 445]
  |  |  |  |  ------------------
  |  |  |  |  121|    445|				 ((0x10000 <= (c)) && ((c) <= 0x10ffff))))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (121:7): [True: 0, False: 445]
  |  |  |  |  |  Branch (121:27): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (4902:16): [True: 943, False: 108k]
  ------------------
 4903|    943|        xmlFatalErrMsgInt(ctxt, XML_ERR_INVALID_CHAR,
 4904|    943|                          "xmlParseComment: invalid xmlChar value %d\n",
 4905|    943|	                  cur);
 4906|   108k|    } else {
 4907|   108k|        NEXT;
  ------------------
  |  | 2279|   108k|#define NEXT xmlNextChar(ctxt)
  ------------------
 4908|   108k|	if ((ctxt->sax != NULL) && (ctxt->sax->comment != NULL) &&
  ------------------
  |  Branch (4908:6): [True: 108k, False: 0]
  |  Branch (4908:29): [True: 108k, False: 0]
  ------------------
 4909|   108k|	    (!ctxt->disableSAX))
  ------------------
  |  Branch (4909:6): [True: 101k, False: 6.37k]
  ------------------
 4910|   101k|	    ctxt->sax->comment(ctxt->userData, buf);
 4911|   108k|    }
 4912|   112k|    xmlFree(buf);
 4913|   112k|    return;
 4914|  2.33k|not_terminated:
 4915|  2.33k|    xmlFatalErrMsgStr(ctxt, XML_ERR_COMMENT_NOT_FINISHED,
 4916|       |			 "Comment not terminated\n", NULL);
 4917|  2.33k|    xmlFree(buf);
 4918|  2.33k|}
parser.c:xmlNsErr:
  384|   141k|{
  385|   141k|    ctxt->nsWellFormed = 0;
  386|       |
  387|       |    xmlCtxtErr(ctxt, NULL, XML_FROM_NAMESPACE, error, XML_ERR_ERROR,
  388|   141k|               info1, info2, info3, 0, msg, info1, info2, info3);
  389|   141k|}
parser.c:xmlSkipBlankCharsPE:
 2400|   989k|xmlSkipBlankCharsPE(xmlParserCtxtPtr ctxt) {
 2401|   989k|    int res = 0;
 2402|   989k|    int inParam;
 2403|   989k|    int expandParam;
 2404|       |
 2405|   989k|    inParam = PARSER_IN_PE(ctxt);
  ------------------
  |  |   50|   989k|    (((ctxt)->input->entity != NULL) && \
  |  |  ------------------
  |  |  |  Branch (50:6): [True: 824k, False: 164k]
  |  |  ------------------
  |  |   51|   989k|     (((ctxt)->input->entity->etype == XML_INTERNAL_PARAMETER_ENTITY) || \
  |  |  ------------------
  |  |  |  Branch (51:7): [True: 124k, False: 699k]
  |  |  ------------------
  |  |   52|   824k|      ((ctxt)->input->entity->etype == XML_EXTERNAL_PARAMETER_ENTITY)))
  |  |  ------------------
  |  |  |  Branch (52:7): [True: 699k, False: 0]
  |  |  ------------------
  ------------------
 2406|   989k|    expandParam = PARSER_EXTERNAL(ctxt);
  ------------------
  |  |   55|   989k|    (((ctxt)->inSubset == 2) || \
  |  |  ------------------
  |  |  |  Branch (55:6): [True: 123k, False: 866k]
  |  |  ------------------
  |  |   56|   989k|     (((ctxt)->input->entity != NULL) && \
  |  |  ------------------
  |  |  |  Branch (56:7): [True: 728k, False: 138k]
  |  |  ------------------
  |  |   57|   866k|      ((ctxt)->input->entity->etype == XML_EXTERNAL_PARAMETER_ENTITY)))
  |  |  ------------------
  |  |  |  Branch (57:7): [True: 697k, False: 30.7k]
  |  |  ------------------
  ------------------
 2407|       |
 2408|   989k|    if (!inParam && !expandParam)
  ------------------
  |  Branch (2408:9): [True: 164k, False: 824k]
  |  Branch (2408:21): [True: 138k, False: 26.8k]
  ------------------
 2409|   138k|        return(xmlSkipBlankChars(ctxt));
 2410|       |
 2411|       |    /*
 2412|       |     * It's Okay to use CUR/NEXT here since all the blanks are on
 2413|       |     * the ASCII range.
 2414|       |     */
 2415|  1.97M|    while (PARSER_STOPPED(ctxt) == 0) {
  ------------------
  |  |   44|  1.97M|#define PARSER_STOPPED(ctxt) ((ctxt)->disableSAX > 1)
  ------------------
  |  Branch (2415:12): [True: 1.97M, False: 358]
  ------------------
 2416|  1.97M|        if (IS_BLANK_CH(CUR)) { /* CHECKED tstblanks.xml */
  ------------------
  |  |  137|  1.97M|#define IS_BLANK_CH(c)  xmlIsBlank_ch(c)
  |  |  ------------------
  |  |  |  |   90|  1.97M|#define xmlIsBlank_ch(c)	(((c) == 0x20) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (90:27): [True: 617k, False: 1.36M]
  |  |  |  |  ------------------
  |  |  |  |   91|  1.97M|				 ((0x9 <= (c)) && ((c) <= 0xa)) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (91:7): [True: 1.30M, False: 53.2k]
  |  |  |  |  |  Branch (91:23): [True: 458k, False: 848k]
  |  |  |  |  ------------------
  |  |  |  |   92|  1.97M|				 ((c) == 0xd))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (92:6): [True: 30.2k, False: 871k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2417|  1.10M|            NEXT;
  ------------------
  |  | 2279|  1.10M|#define NEXT xmlNextChar(ctxt)
  ------------------
 2418|  1.10M|        } else if (CUR == '%') {
  ------------------
  |  | 2225|   871k|#define CUR (*ctxt->input->cur)
  ------------------
  |  Branch (2418:20): [True: 71.3k, False: 799k]
  ------------------
 2419|  71.3k|            if ((expandParam == 0) ||
  ------------------
  |  Branch (2419:17): [True: 16, False: 71.3k]
  ------------------
 2420|  71.3k|                (IS_BLANK_CH(NXT(1))) || (NXT(1) == 0))
  ------------------
  |  |  137|  71.3k|#define IS_BLANK_CH(c)  xmlIsBlank_ch(c)
  |  |  ------------------
  |  |  |  |   90|  71.3k|#define xmlIsBlank_ch(c)	(((c) == 0x20) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (90:27): [True: 54.1k, False: 17.1k]
  |  |  |  |  ------------------
  |  |  |  |   91|  71.3k|				 ((0x9 <= (c)) && ((c) <= 0xa)) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (91:7): [True: 15.1k, False: 1.98k]
  |  |  |  |  |  Branch (91:23): [True: 885, False: 14.3k]
  |  |  |  |  ------------------
  |  |  |  |   92|  71.3k|				 ((c) == 0xd))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (92:6): [True: 154, False: 16.1k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                              (IS_BLANK_CH(NXT(1))) || (NXT(1) == 0))
  ------------------
  |  | 2226|  16.1k|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
  |  Branch (2420:42): [True: 1.98k, False: 14.1k]
  ------------------
 2421|  57.2k|                break;
 2422|       |
 2423|       |            /*
 2424|       |             * Expand parameter entity. We continue to consume
 2425|       |             * whitespace at the start of the entity and possible
 2426|       |             * even consume the whole entity and pop it. We might
 2427|       |             * even pop multiple PEs in this loop.
 2428|       |             */
 2429|  14.1k|            xmlParsePERefInternal(ctxt, 0);
 2430|       |
 2431|  14.1k|            inParam = PARSER_IN_PE(ctxt);
  ------------------
  |  |   50|  14.1k|    (((ctxt)->input->entity != NULL) && \
  |  |  ------------------
  |  |  |  Branch (50:6): [True: 13.4k, False: 682]
  |  |  ------------------
  |  |   51|  14.1k|     (((ctxt)->input->entity->etype == XML_INTERNAL_PARAMETER_ENTITY) || \
  |  |  ------------------
  |  |  |  Branch (51:7): [True: 3.96k, False: 9.51k]
  |  |  ------------------
  |  |   52|  13.4k|      ((ctxt)->input->entity->etype == XML_EXTERNAL_PARAMETER_ENTITY)))
  |  |  ------------------
  |  |  |  Branch (52:7): [True: 9.51k, False: 0]
  |  |  ------------------
  ------------------
 2432|  14.1k|            expandParam = PARSER_EXTERNAL(ctxt);
  ------------------
  |  |   55|  14.1k|    (((ctxt)->inSubset == 2) || \
  |  |  ------------------
  |  |  |  Branch (55:6): [True: 3.34k, False: 10.8k]
  |  |  ------------------
  |  |   56|  14.1k|     (((ctxt)->input->entity != NULL) && \
  |  |  ------------------
  |  |  |  Branch (56:7): [True: 10.8k, False: 0]
  |  |  ------------------
  |  |   57|  10.8k|      ((ctxt)->input->entity->etype == XML_EXTERNAL_PARAMETER_ENTITY)))
  |  |  ------------------
  |  |  |  Branch (57:7): [True: 8.41k, False: 2.39k]
  |  |  ------------------
  ------------------
 2433|   799k|        } else if (CUR == 0) {
  ------------------
  |  | 2225|   799k|#define CUR (*ctxt->input->cur)
  ------------------
  |  Branch (2433:20): [True: 53.2k, False: 746k]
  ------------------
 2434|  53.2k|            if (inParam == 0)
  ------------------
  |  Branch (2434:17): [True: 122, False: 53.1k]
  ------------------
 2435|    122|                break;
 2436|       |
 2437|       |            /*
 2438|       |             * Don't pop parameter entities that start a markup
 2439|       |             * declaration to detect Well-formedness constraint:
 2440|       |             * PE Between Declarations.
 2441|       |             */
 2442|  53.1k|            if (ctxt->input->flags & XML_INPUT_MARKUP_DECL)
  ------------------
  |  |   42|  53.1k|#define XML_INPUT_MARKUP_DECL       (1u << 7)
  ------------------
  |  Branch (2442:17): [True: 47.2k, False: 5.92k]
  ------------------
 2443|  47.2k|                break;
 2444|       |
 2445|  5.92k|            xmlPopPE(ctxt);
 2446|       |
 2447|  5.92k|            inParam = PARSER_IN_PE(ctxt);
  ------------------
  |  |   50|  5.92k|    (((ctxt)->input->entity != NULL) && \
  |  |  ------------------
  |  |  |  Branch (50:6): [True: 4.32k, False: 1.60k]
  |  |  ------------------
  |  |   51|  5.92k|     (((ctxt)->input->entity->etype == XML_INTERNAL_PARAMETER_ENTITY) || \
  |  |  ------------------
  |  |  |  Branch (51:7): [True: 3, False: 4.31k]
  |  |  ------------------
  |  |   52|  4.32k|      ((ctxt)->input->entity->etype == XML_EXTERNAL_PARAMETER_ENTITY)))
  |  |  ------------------
  |  |  |  Branch (52:7): [True: 4.31k, False: 0]
  |  |  ------------------
  ------------------
 2448|  5.92k|            expandParam = PARSER_EXTERNAL(ctxt);
  ------------------
  |  |   55|  5.92k|    (((ctxt)->inSubset == 2) || \
  |  |  ------------------
  |  |  |  Branch (55:6): [True: 1.95k, False: 3.97k]
  |  |  ------------------
  |  |   56|  5.92k|     (((ctxt)->input->entity != NULL) && \
  |  |  ------------------
  |  |  |  Branch (56:7): [True: 3.96k, False: 2]
  |  |  ------------------
  |  |   57|  3.97k|      ((ctxt)->input->entity->etype == XML_EXTERNAL_PARAMETER_ENTITY)))
  |  |  ------------------
  |  |  |  Branch (57:7): [True: 3.96k, False: 0]
  |  |  ------------------
  ------------------
 2449|   746k|        } else {
 2450|   746k|            break;
 2451|   746k|        }
 2452|       |
 2453|       |        /*
 2454|       |         * Also increase the counter when entering or exiting a PERef.
 2455|       |         * The spec says: "When a parameter-entity reference is recognized
 2456|       |         * in the DTD and included, its replacement text MUST be enlarged
 2457|       |         * by the attachment of one leading and one following space (#x20)
 2458|       |         * character."
 2459|       |         */
 2460|  1.12M|        if (res < INT_MAX)
  ------------------
  |  Branch (2460:13): [True: 1.12M, False: 0]
  ------------------
 2461|  1.12M|            res++;
 2462|  1.12M|    }
 2463|       |
 2464|   851k|    return(res);
 2465|   989k|}
parser.c:xmlValidityError:
  294|   227k|{
  295|   227k|    ctxt->valid = 0;
  296|       |
  297|   227k|    xmlCtxtErr(ctxt, NULL, XML_FROM_DTD, error, XML_ERR_ERROR,
  298|       |               str1, str2, NULL, 0, msg, str1, str2);
  299|   227k|}
parser.c:xmlAttrNormalizeSpace:
  988|  22.8k|{
  989|  22.8k|    if ((src == NULL) || (dst == NULL))
  ------------------
  |  Branch (989:9): [True: 0, False: 22.8k]
  |  Branch (989:26): [True: 0, False: 22.8k]
  ------------------
  990|      0|        return(NULL);
  991|       |
  992|  29.7k|    while (*src == 0x20) src++;
  ------------------
  |  Branch (992:12): [True: 6.90k, False: 22.8k]
  ------------------
  993|  1.86M|    while (*src != 0) {
  ------------------
  |  Branch (993:12): [True: 1.84M, False: 22.8k]
  ------------------
  994|  1.84M|	if (*src == 0x20) {
  ------------------
  |  Branch (994:6): [True: 22.7k, False: 1.82M]
  ------------------
  995|   125k|	    while (*src == 0x20) src++;
  ------------------
  |  Branch (995:13): [True: 103k, False: 22.7k]
  ------------------
  996|  22.7k|	    if (*src != 0)
  ------------------
  |  Branch (996:10): [True: 21.8k, False: 964]
  ------------------
  997|  21.8k|		*dst++ = 0x20;
  998|  1.82M|	} else {
  999|  1.82M|	    *dst++ = *src++;
 1000|  1.82M|	}
 1001|  1.84M|    }
 1002|  22.8k|    *dst = 0;
 1003|  22.8k|    if (dst == src)
  ------------------
  |  Branch (1003:9): [True: 18.6k, False: 4.26k]
  ------------------
 1004|  18.6k|       return(NULL);
 1005|  4.26k|    return(dst);
 1006|  22.8k|}
parser.c:xmlAddDefAttrs:
 1020|  17.7k|               const xmlChar *value) {
 1021|  17.7k|    xmlDefAttrsPtr defaults;
 1022|  17.7k|    xmlDefAttr *attr;
 1023|  17.7k|    int len, expandedSize;
 1024|  17.7k|    xmlHashedString name;
 1025|  17.7k|    xmlHashedString prefix;
 1026|  17.7k|    xmlHashedString hvalue;
 1027|  17.7k|    const xmlChar *localname;
 1028|       |
 1029|       |    /*
 1030|       |     * Allows to detect attribute redefinitions
 1031|       |     */
 1032|  17.7k|    if (ctxt->attsSpecial != NULL) {
  ------------------
  |  Branch (1032:9): [True: 15.5k, False: 2.16k]
  ------------------
 1033|  15.5k|        if (xmlHashLookup2(ctxt->attsSpecial, fullname, fullattr) != NULL)
  ------------------
  |  Branch (1033:13): [True: 9.44k, False: 6.14k]
  ------------------
 1034|  9.44k|	    return;
 1035|  15.5k|    }
 1036|       |
 1037|  8.30k|    if (ctxt->attsDefault == NULL) {
  ------------------
  |  Branch (1037:9): [True: 2.25k, False: 6.05k]
  ------------------
 1038|  2.25k|        ctxt->attsDefault = xmlHashCreateDict(10, ctxt->dict);
 1039|  2.25k|	if (ctxt->attsDefault == NULL)
  ------------------
  |  Branch (1039:6): [True: 1, False: 2.24k]
  ------------------
 1040|      1|	    goto mem_error;
 1041|  2.25k|    }
 1042|       |
 1043|       |    /*
 1044|       |     * split the element name into prefix:localname , the string found
 1045|       |     * are within the DTD and then not associated to namespace names.
 1046|       |     */
 1047|  8.30k|    localname = xmlSplitQName3(fullname, &len);
 1048|  8.30k|    if (localname == NULL) {
  ------------------
  |  Branch (1048:9): [True: 7.86k, False: 441]
  ------------------
 1049|  7.86k|        name = xmlDictLookupHashed(ctxt->dict, fullname, -1);
 1050|  7.86k|	prefix.name = NULL;
 1051|  7.86k|    } else {
 1052|    441|        name = xmlDictLookupHashed(ctxt->dict, localname, -1);
 1053|    441|	prefix = xmlDictLookupHashed(ctxt->dict, fullname, len);
 1054|    441|        if (prefix.name == NULL)
  ------------------
  |  Branch (1054:13): [True: 1, False: 440]
  ------------------
 1055|      1|            goto mem_error;
 1056|    441|    }
 1057|  8.30k|    if (name.name == NULL)
  ------------------
  |  Branch (1057:9): [True: 1, False: 8.30k]
  ------------------
 1058|      1|        goto mem_error;
 1059|       |
 1060|       |    /*
 1061|       |     * make sure there is some storage
 1062|       |     */
 1063|  8.30k|    defaults = xmlHashLookup2(ctxt->attsDefault, name.name, prefix.name);
 1064|  8.30k|    if ((defaults == NULL) ||
  ------------------
  |  Branch (1064:9): [True: 2.59k, False: 5.71k]
  ------------------
 1065|  5.71k|        (defaults->nbAttrs >= defaults->maxAttrs)) {
  ------------------
  |  Branch (1065:9): [True: 598, False: 5.11k]
  ------------------
 1066|  3.18k|        xmlDefAttrsPtr temp;
 1067|  3.18k|        int newSize;
 1068|       |
 1069|  3.18k|        if (defaults == NULL) {
  ------------------
  |  Branch (1069:13): [True: 2.59k, False: 598]
  ------------------
 1070|  2.59k|            newSize = 4;
 1071|  2.59k|        } else {
 1072|    598|            if ((defaults->maxAttrs >= XML_MAX_ATTRS) ||
  ------------------
  |  |   93|    598|#define XML_MAX_ATTRS 100000000 /* 100 million */
  ------------------
  |  Branch (1072:17): [True: 0, False: 598]
  ------------------
 1073|    598|                ((size_t) defaults->maxAttrs >
  ------------------
  |  Branch (1073:17): [True: 0, False: 598]
  ------------------
 1074|    598|                     SIZE_MAX / 2 / sizeof(temp[0]) - sizeof(*defaults)))
 1075|      0|                goto mem_error;
 1076|       |
 1077|    598|            if (defaults->maxAttrs > XML_MAX_ATTRS / 2)
  ------------------
  |  |   93|    598|#define XML_MAX_ATTRS 100000000 /* 100 million */
  ------------------
  |  Branch (1077:17): [True: 0, False: 598]
  ------------------
 1078|      0|                newSize = XML_MAX_ATTRS;
  ------------------
  |  |   93|      0|#define XML_MAX_ATTRS 100000000 /* 100 million */
  ------------------
 1079|    598|            else
 1080|    598|                newSize = defaults->maxAttrs * 2;
 1081|    598|        }
 1082|  3.18k|        temp = xmlRealloc(defaults,
 1083|  3.18k|                          sizeof(*defaults) + newSize * sizeof(xmlDefAttr));
 1084|  3.18k|	if (temp == NULL)
  ------------------
  |  Branch (1084:6): [True: 2, False: 3.18k]
  ------------------
 1085|      2|	    goto mem_error;
 1086|  3.18k|        if (defaults == NULL)
  ------------------
  |  Branch (1086:13): [True: 2.58k, False: 598]
  ------------------
 1087|  2.58k|            temp->nbAttrs = 0;
 1088|  3.18k|	temp->maxAttrs = newSize;
 1089|  3.18k|        defaults = temp;
 1090|  3.18k|	if (xmlHashUpdateEntry2(ctxt->attsDefault, name.name, prefix.name,
  ------------------
  |  Branch (1090:6): [True: 0, False: 3.18k]
  ------------------
 1091|  3.18k|	                        defaults, NULL) < 0) {
 1092|      0|	    xmlFree(defaults);
 1093|      0|	    goto mem_error;
 1094|      0|	}
 1095|  3.18k|    }
 1096|       |
 1097|       |    /*
 1098|       |     * Split the attribute name into prefix:localname , the string found
 1099|       |     * are within the DTD and hen not associated to namespace names.
 1100|       |     */
 1101|  8.30k|    localname = xmlSplitQName3(fullattr, &len);
 1102|  8.30k|    if (localname == NULL) {
  ------------------
  |  Branch (1102:9): [True: 5.62k, False: 2.68k]
  ------------------
 1103|  5.62k|        name = xmlDictLookupHashed(ctxt->dict, fullattr, -1);
 1104|  5.62k|	prefix.name = NULL;
 1105|  5.62k|    } else {
 1106|  2.68k|        name = xmlDictLookupHashed(ctxt->dict, localname, -1);
 1107|  2.68k|	prefix = xmlDictLookupHashed(ctxt->dict, fullattr, len);
 1108|  2.68k|        if (prefix.name == NULL)
  ------------------
  |  Branch (1108:13): [True: 1, False: 2.68k]
  ------------------
 1109|      1|            goto mem_error;
 1110|  2.68k|    }
 1111|  8.30k|    if (name.name == NULL)
  ------------------
  |  Branch (1111:9): [True: 1, False: 8.30k]
  ------------------
 1112|      1|        goto mem_error;
 1113|       |
 1114|       |    /* intern the string and precompute the end */
 1115|  8.30k|    len = strlen((const char *) value);
 1116|  8.30k|    hvalue = xmlDictLookupHashed(ctxt->dict, value, len);
 1117|  8.30k|    if (hvalue.name == NULL)
  ------------------
  |  Branch (1117:9): [True: 1, False: 8.30k]
  ------------------
 1118|      1|        goto mem_error;
 1119|       |
 1120|  8.30k|    expandedSize = strlen((const char *) name.name);
 1121|  8.30k|    if (prefix.name != NULL)
  ------------------
  |  Branch (1121:9): [True: 2.67k, False: 5.62k]
  ------------------
 1122|  2.67k|        expandedSize += strlen((const char *) prefix.name);
 1123|  8.30k|    expandedSize += len;
 1124|       |
 1125|  8.30k|    attr = &defaults->attrs[defaults->nbAttrs++];
 1126|  8.30k|    attr->name = name;
 1127|  8.30k|    attr->prefix = prefix;
 1128|  8.30k|    attr->value = hvalue;
 1129|  8.30k|    attr->valueEnd = hvalue.name + len;
 1130|  8.30k|    attr->external = PARSER_EXTERNAL(ctxt);
  ------------------
  |  |   55|  8.30k|    (((ctxt)->inSubset == 2) || \
  |  |  ------------------
  |  |  |  Branch (55:6): [True: 381, False: 7.91k]
  |  |  ------------------
  |  |   56|  8.30k|     (((ctxt)->input->entity != NULL) && \
  |  |  ------------------
  |  |  |  Branch (56:7): [True: 483, False: 7.43k]
  |  |  ------------------
  |  |   57|  7.91k|      ((ctxt)->input->entity->etype == XML_EXTERNAL_PARAMETER_ENTITY)))
  |  |  ------------------
  |  |  |  Branch (57:7): [True: 414, False: 69]
  |  |  ------------------
  ------------------
 1131|  8.30k|    attr->expandedSize = expandedSize;
 1132|       |
 1133|  8.30k|    return;
 1134|       |
 1135|      8|mem_error:
 1136|      8|    xmlErrMemory(ctxt);
 1137|      8|}
parser.c:xmlAddSpecialAttr:
 1152|  33.6k|{
 1153|  33.6k|    if (ctxt->attsSpecial == NULL) {
  ------------------
  |  Branch (1153:9): [True: 2.77k, False: 30.8k]
  ------------------
 1154|  2.77k|        ctxt->attsSpecial = xmlHashCreateDict(10, ctxt->dict);
 1155|  2.77k|	if (ctxt->attsSpecial == NULL)
  ------------------
  |  Branch (1155:6): [True: 1, False: 2.77k]
  ------------------
 1156|      1|	    goto mem_error;
 1157|  2.77k|    }
 1158|       |
 1159|  33.6k|    if (PARSER_EXTERNAL(ctxt))
  ------------------
  |  |   55|  33.6k|    (((ctxt)->inSubset == 2) || \
  |  |  ------------------
  |  |  |  Branch (55:6): [True: 9.51k, False: 24.0k]
  |  |  ------------------
  |  |   56|  33.6k|     (((ctxt)->input->entity != NULL) && \
  |  |  ------------------
  |  |  |  Branch (56:7): [True: 15.3k, False: 8.76k]
  |  |  ------------------
  |  |   57|  24.0k|      ((ctxt)->input->entity->etype == XML_EXTERNAL_PARAMETER_ENTITY)))
  |  |  ------------------
  |  |  |  Branch (57:7): [True: 11.7k, False: 3.62k]
  |  |  ------------------
  ------------------
 1160|  21.2k|        type |= XML_SPECIAL_EXTERNAL;
  ------------------
  |  |   95|  21.2k|#define XML_SPECIAL_EXTERNAL    (1 << 20)
  ------------------
 1161|       |
 1162|  33.6k|    if (xmlHashAdd2(ctxt->attsSpecial, fullname, fullattr,
  ------------------
  |  Branch (1162:9): [True: 1, False: 33.6k]
  ------------------
 1163|  33.6k|                    XML_INT_TO_PTR(type)) < 0)
  ------------------
  |  |   59|  33.6k|#define XML_INT_TO_PTR(i) ((void *) (XML_INTPTR_T) (i))
  ------------------
 1164|      1|        goto mem_error;
 1165|  33.6k|    return;
 1166|       |
 1167|  33.6k|mem_error:
 1168|      2|    xmlErrMemory(ctxt);
 1169|      2|}
parser.c:xmlSkipBlankCharsPEBalanced:
 6087|   397k|xmlSkipBlankCharsPEBalanced(xmlParserCtxt *ctxt, int openInputNr) {
 6088|   397k|    SKIP_BLANKS;
  ------------------
  |  | 2275|   397k|#define SKIP_BLANKS xmlSkipBlankChars(ctxt)
  ------------------
 6089|   397k|    GROW;
  ------------------
  |  | 2271|   397k|    if ((!PARSER_PROGRESSIVE(ctxt)) && \
  |  |  ------------------
  |  |  |  |   47|   397k|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|   397k|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2271:9): [True: 63.5k, False: 334k]
  |  |  ------------------
  |  | 2272|   397k|        (ctxt->input->end - ctxt->input->cur < INPUT_CHUNK)) \
  |  |  ------------------
  |  |  |  |   63|  63.5k|#define INPUT_CHUNK	250
  |  |  ------------------
  |  |  |  Branch (2272:9): [True: 44.3k, False: 19.1k]
  |  |  ------------------
  |  | 2273|   397k|	xmlParserGrow(ctxt);
  ------------------
 6090|       |
 6091|   397k|    (void) openInputNr;
 6092|       |
 6093|   397k|    if (!PARSER_EXTERNAL(ctxt) && !PARSER_IN_PE(ctxt))
  ------------------
  |  |   55|   795k|    (((ctxt)->inSubset == 2) || \
  |  |  ------------------
  |  |  |  Branch (55:6): [True: 14.3k, False: 383k]
  |  |  ------------------
  |  |   56|   795k|     (((ctxt)->input->entity != NULL) && \
  |  |  ------------------
  |  |  |  Branch (56:7): [True: 47.9k, False: 335k]
  |  |  ------------------
  |  |   57|   383k|      ((ctxt)->input->entity->etype == XML_EXTERNAL_PARAMETER_ENTITY)))
  |  |  ------------------
  |  |  |  Branch (57:7): [True: 29.2k, False: 18.7k]
  |  |  ------------------
  ------------------
                  if (!PARSER_EXTERNAL(ctxt) && !PARSER_IN_PE(ctxt))
  ------------------
  |  |   50|   354k|    (((ctxt)->input->entity != NULL) && \
  |  |  ------------------
  |  |  |  Branch (50:6): [True: 18.7k, False: 335k]
  |  |  ------------------
  |  |   51|   354k|     (((ctxt)->input->entity->etype == XML_INTERNAL_PARAMETER_ENTITY) || \
  |  |  ------------------
  |  |  |  Branch (51:7): [True: 18.7k, False: 0]
  |  |  ------------------
  |  |   52|  18.7k|      ((ctxt)->input->entity->etype == XML_EXTERNAL_PARAMETER_ENTITY)))
  |  |  ------------------
  |  |  |  Branch (52:7): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 6094|   335k|        return;
 6095|       |
 6096|  68.4k|    while (!PARSER_STOPPED(ctxt)) {
  ------------------
  |  |   44|  68.4k|#define PARSER_STOPPED(ctxt) ((ctxt)->disableSAX > 1)
  ------------------
  |  Branch (6096:12): [True: 68.2k, False: 262]
  ------------------
 6097|  68.2k|        if (ctxt->input->cur >= ctxt->input->end) {
  ------------------
  |  Branch (6097:13): [True: 2.24k, False: 65.9k]
  ------------------
 6098|  2.24k|#ifdef LIBXML_VALID_ENABLED
 6099|  2.24k|            if ((ctxt->validate) && (ctxt->inputNr <= openInputNr)) {
  ------------------
  |  Branch (6099:17): [True: 1.47k, False: 774]
  |  Branch (6099:37): [True: 653, False: 822]
  ------------------
 6100|    653|                xmlValidityError(ctxt, XML_ERR_ENTITY_BOUNDARY,
 6101|    653|                                 "Element content declaration doesn't start "
 6102|    653|                                 "and stop in the same entity\n",
 6103|    653|                                 NULL, NULL);
 6104|    653|            }
 6105|  2.24k|#endif
 6106|  2.24k|            if (PARSER_IN_PE(ctxt))
  ------------------
  |  |   50|  2.24k|    (((ctxt)->input->entity != NULL) && \
  |  |  ------------------
  |  |  |  Branch (50:6): [True: 2.20k, False: 45]
  |  |  ------------------
  |  |   51|  2.24k|     (((ctxt)->input->entity->etype == XML_INTERNAL_PARAMETER_ENTITY) || \
  |  |  ------------------
  |  |  |  Branch (51:7): [True: 876, False: 1.32k]
  |  |  ------------------
  |  |   52|  2.20k|      ((ctxt)->input->entity->etype == XML_EXTERNAL_PARAMETER_ENTITY)))
  |  |  ------------------
  |  |  |  Branch (52:7): [True: 1.32k, False: 0]
  |  |  ------------------
  ------------------
 6107|  2.20k|                xmlPopPE(ctxt);
 6108|     45|            else
 6109|     45|                break;
 6110|  65.9k|        } else if (RAW == '%') {
  ------------------
  |  | 2224|  65.9k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (6110:20): [True: 3.91k, False: 62.0k]
  ------------------
 6111|  3.91k|            xmlParsePERefInternal(ctxt, 0);
 6112|  62.0k|        } else {
 6113|  62.0k|            break;
 6114|  62.0k|        }
 6115|       |
 6116|  6.11k|        SKIP_BLANKS;
  ------------------
  |  | 2275|  6.11k|#define SKIP_BLANKS xmlSkipBlankChars(ctxt)
  ------------------
 6117|  6.11k|        GROW;
  ------------------
  |  | 2271|  6.11k|    if ((!PARSER_PROGRESSIVE(ctxt)) && \
  |  |  ------------------
  |  |  |  |   47|  6.11k|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|  6.11k|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2271:9): [True: 5.40k, False: 710]
  |  |  ------------------
  |  | 2272|  6.11k|        (ctxt->input->end - ctxt->input->cur < INPUT_CHUNK)) \
  |  |  ------------------
  |  |  |  |   63|  5.40k|#define INPUT_CHUNK	250
  |  |  ------------------
  |  |  |  Branch (2272:9): [True: 4.18k, False: 1.21k]
  |  |  ------------------
  |  | 2273|  6.11k|	xmlParserGrow(ctxt);
  ------------------
 6118|  6.11k|    }
 6119|  62.3k|}
parser.c:xmlParseElementChildrenContentDeclPriv:
 6271|  57.8k|                                       int depth) {
 6272|  57.8k|    int maxDepth = (ctxt->options & XML_PARSE_HUGE) ? 2048 : 256;
  ------------------
  |  Branch (6272:20): [True: 47.7k, False: 10.0k]
  ------------------
 6273|  57.8k|    xmlElementContentPtr ret = NULL, cur = NULL, last = NULL, op = NULL;
 6274|  57.8k|    const xmlChar *elem;
 6275|  57.8k|    xmlChar type = 0;
 6276|       |
 6277|  57.8k|    if (depth > maxDepth) {
  ------------------
  |  Branch (6277:9): [True: 1, False: 57.8k]
  ------------------
 6278|      1|        xmlFatalErrMsgInt(ctxt, XML_ERR_RESOURCE_LIMIT,
 6279|      1|                "xmlParseElementChildrenContentDecl : depth %d too deep, "
 6280|      1|                "use XML_PARSE_HUGE\n", depth);
 6281|      1|	return(NULL);
 6282|      1|    }
 6283|  57.8k|    xmlSkipBlankCharsPEBalanced(ctxt, openInputNr);
 6284|  57.8k|    if (RAW == '(') {
  ------------------
  |  | 2224|  57.8k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (6284:9): [True: 28.2k, False: 29.5k]
  ------------------
 6285|  28.2k|        int newInputNr = ctxt->inputNr;
 6286|       |
 6287|       |        /* Recurse on first child */
 6288|  28.2k|	NEXT;
  ------------------
  |  | 2279|  28.2k|#define NEXT xmlNextChar(ctxt)
  ------------------
 6289|  28.2k|        cur = ret = xmlParseElementChildrenContentDeclPriv(ctxt, newInputNr,
 6290|  28.2k|                                                           depth + 1);
 6291|  28.2k|        if (cur == NULL)
  ------------------
  |  Branch (6291:13): [True: 25.6k, False: 2.63k]
  ------------------
 6292|  25.6k|            return(NULL);
 6293|  29.5k|    } else {
 6294|  29.5k|	elem = xmlParseName(ctxt);
 6295|  29.5k|	if (elem == NULL) {
  ------------------
  |  Branch (6295:6): [True: 394, False: 29.2k]
  ------------------
 6296|    394|	    xmlFatalErr(ctxt, XML_ERR_ELEMCONTENT_NOT_STARTED, NULL);
 6297|    394|	    return(NULL);
 6298|    394|	}
 6299|  29.2k|        cur = ret = xmlNewDocElementContent(ctxt->myDoc, elem, XML_ELEMENT_CONTENT_ELEMENT);
 6300|  29.2k|	if (cur == NULL) {
  ------------------
  |  Branch (6300:6): [True: 3, False: 29.1k]
  ------------------
 6301|      3|	    xmlErrMemory(ctxt);
 6302|      3|	    return(NULL);
 6303|      3|	}
 6304|  29.1k|	GROW;
  ------------------
  |  | 2271|  29.1k|    if ((!PARSER_PROGRESSIVE(ctxt)) && \
  |  |  ------------------
  |  |  |  |   47|  29.1k|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|  29.1k|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2271:9): [True: 5.29k, False: 23.9k]
  |  |  ------------------
  |  | 2272|  29.1k|        (ctxt->input->end - ctxt->input->cur < INPUT_CHUNK)) \
  |  |  ------------------
  |  |  |  |   63|  5.29k|#define INPUT_CHUNK	250
  |  |  ------------------
  |  |  |  Branch (2272:9): [True: 3.28k, False: 2.01k]
  |  |  ------------------
  |  | 2273|  29.1k|	xmlParserGrow(ctxt);
  ------------------
 6305|  29.1k|	if (RAW == '?') {
  ------------------
  |  | 2224|  29.1k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (6305:6): [True: 1.11k, False: 28.0k]
  ------------------
 6306|  1.11k|	    cur->ocur = XML_ELEMENT_CONTENT_OPT;
 6307|  1.11k|	    NEXT;
  ------------------
  |  | 2279|  1.11k|#define NEXT xmlNextChar(ctxt)
  ------------------
 6308|  28.0k|	} else if (RAW == '*') {
  ------------------
  |  | 2224|  28.0k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (6308:13): [True: 1.23k, False: 26.8k]
  ------------------
 6309|  1.23k|	    cur->ocur = XML_ELEMENT_CONTENT_MULT;
 6310|  1.23k|	    NEXT;
  ------------------
  |  | 2279|  1.23k|#define NEXT xmlNextChar(ctxt)
  ------------------
 6311|  26.8k|	} else if (RAW == '+') {
  ------------------
  |  | 2224|  26.8k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (6311:13): [True: 327, False: 26.5k]
  ------------------
 6312|    327|	    cur->ocur = XML_ELEMENT_CONTENT_PLUS;
 6313|    327|	    NEXT;
  ------------------
  |  | 2279|    327|#define NEXT xmlNextChar(ctxt)
  ------------------
 6314|  26.5k|	} else {
 6315|  26.5k|	    cur->ocur = XML_ELEMENT_CONTENT_ONCE;
 6316|  26.5k|	}
 6317|  29.1k|	GROW;
  ------------------
  |  | 2271|  29.1k|    if ((!PARSER_PROGRESSIVE(ctxt)) && \
  |  |  ------------------
  |  |  |  |   47|  29.1k|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|  29.1k|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2271:9): [True: 5.29k, False: 23.9k]
  |  |  ------------------
  |  | 2272|  29.1k|        (ctxt->input->end - ctxt->input->cur < INPUT_CHUNK)) \
  |  |  ------------------
  |  |  |  |   63|  5.29k|#define INPUT_CHUNK	250
  |  |  ------------------
  |  |  |  Branch (2272:9): [True: 3.28k, False: 2.01k]
  |  |  ------------------
  |  | 2273|  29.1k|	xmlParserGrow(ctxt);
  ------------------
 6318|  29.1k|    }
 6319|   161k|    while (!PARSER_STOPPED(ctxt)) {
  ------------------
  |  |   44|   161k|#define PARSER_STOPPED(ctxt) ((ctxt)->disableSAX > 1)
  ------------------
  |  Branch (6319:12): [True: 159k, False: 2.44k]
  ------------------
 6320|   159k|        xmlSkipBlankCharsPEBalanced(ctxt, openInputNr);
 6321|   159k|        if (RAW == ')')
  ------------------
  |  | 2224|   159k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (6321:13): [True: 27.5k, False: 131k]
  ------------------
 6322|  27.5k|            break;
 6323|       |        /*
 6324|       |	 * Each loop we parse one separator and one element.
 6325|       |	 */
 6326|   131k|        if (RAW == ',') {
  ------------------
  |  | 2224|   131k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (6326:13): [True: 74.9k, False: 56.6k]
  ------------------
 6327|  74.9k|	    if (type == 0) type = CUR;
  ------------------
  |  | 2225|  5.79k|#define CUR (*ctxt->input->cur)
  ------------------
  |  Branch (6327:10): [True: 5.79k, False: 69.1k]
  ------------------
 6328|       |
 6329|       |	    /*
 6330|       |	     * Detect "Name | Name , Name" error
 6331|       |	     */
 6332|  69.1k|	    else if (type != CUR) {
  ------------------
  |  | 2225|  69.1k|#define CUR (*ctxt->input->cur)
  ------------------
  |  Branch (6332:15): [True: 1, False: 69.1k]
  ------------------
 6333|      1|		xmlFatalErrMsgInt(ctxt, XML_ERR_SEPARATOR_REQUIRED,
 6334|      1|		    "xmlParseElementChildrenContentDecl : '%c' expected\n",
 6335|      1|		                  type);
 6336|      1|		if ((last != NULL) && (last != ret))
  ------------------
  |  Branch (6336:7): [True: 1, False: 0]
  |  Branch (6336:25): [True: 1, False: 0]
  ------------------
 6337|      1|		    xmlFreeDocElementContent(ctxt->myDoc, last);
 6338|      1|		if (ret != NULL)
  ------------------
  |  Branch (6338:7): [True: 1, False: 0]
  ------------------
 6339|      1|		    xmlFreeDocElementContent(ctxt->myDoc, ret);
 6340|      1|		return(NULL);
 6341|      1|	    }
 6342|  74.9k|	    NEXT;
  ------------------
  |  | 2279|  74.9k|#define NEXT xmlNextChar(ctxt)
  ------------------
 6343|       |
 6344|  74.9k|	    op = xmlNewDocElementContent(ctxt->myDoc, NULL, XML_ELEMENT_CONTENT_SEQ);
 6345|  74.9k|	    if (op == NULL) {
  ------------------
  |  Branch (6345:10): [True: 1, False: 74.9k]
  ------------------
 6346|      1|                xmlErrMemory(ctxt);
 6347|      1|		if ((last != NULL) && (last != ret))
  ------------------
  |  Branch (6347:7): [True: 0, False: 1]
  |  Branch (6347:25): [True: 0, False: 0]
  ------------------
 6348|      0|		    xmlFreeDocElementContent(ctxt->myDoc, last);
 6349|      1|	        xmlFreeDocElementContent(ctxt->myDoc, ret);
 6350|      1|		return(NULL);
 6351|      1|	    }
 6352|  74.9k|	    if (last == NULL) {
  ------------------
  |  Branch (6352:10): [True: 5.79k, False: 69.1k]
  ------------------
 6353|  5.79k|		op->c1 = ret;
 6354|  5.79k|		if (ret != NULL)
  ------------------
  |  Branch (6354:7): [True: 5.79k, False: 0]
  ------------------
 6355|  5.79k|		    ret->parent = op;
 6356|  5.79k|		ret = cur = op;
 6357|  69.1k|	    } else {
 6358|  69.1k|	        cur->c2 = op;
 6359|  69.1k|		if (op != NULL)
  ------------------
  |  Branch (6359:7): [True: 69.1k, False: 0]
  ------------------
 6360|  69.1k|		    op->parent = cur;
 6361|  69.1k|		op->c1 = last;
 6362|  69.1k|		if (last != NULL)
  ------------------
  |  Branch (6362:7): [True: 69.1k, False: 0]
  ------------------
 6363|  69.1k|		    last->parent = op;
 6364|  69.1k|		cur =op;
 6365|  69.1k|		last = NULL;
 6366|  69.1k|	    }
 6367|  74.9k|	} else if (RAW == '|') {
  ------------------
  |  | 2224|  56.6k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (6367:13): [True: 55.2k, False: 1.39k]
  ------------------
 6368|  55.2k|	    if (type == 0) type = CUR;
  ------------------
  |  | 2225|  16.1k|#define CUR (*ctxt->input->cur)
  ------------------
  |  Branch (6368:10): [True: 16.1k, False: 39.1k]
  ------------------
 6369|       |
 6370|       |	    /*
 6371|       |	     * Detect "Name , Name | Name" error
 6372|       |	     */
 6373|  39.1k|	    else if (type != CUR) {
  ------------------
  |  | 2225|  39.1k|#define CUR (*ctxt->input->cur)
  ------------------
  |  Branch (6373:15): [True: 1, False: 39.1k]
  ------------------
 6374|      1|		xmlFatalErrMsgInt(ctxt, XML_ERR_SEPARATOR_REQUIRED,
 6375|      1|		    "xmlParseElementChildrenContentDecl : '%c' expected\n",
 6376|      1|				  type);
 6377|      1|		if ((last != NULL) && (last != ret))
  ------------------
  |  Branch (6377:7): [True: 1, False: 0]
  |  Branch (6377:25): [True: 1, False: 0]
  ------------------
 6378|      1|		    xmlFreeDocElementContent(ctxt->myDoc, last);
 6379|      1|		if (ret != NULL)
  ------------------
  |  Branch (6379:7): [True: 1, False: 0]
  ------------------
 6380|      1|		    xmlFreeDocElementContent(ctxt->myDoc, ret);
 6381|      1|		return(NULL);
 6382|      1|	    }
 6383|  55.2k|	    NEXT;
  ------------------
  |  | 2279|  55.2k|#define NEXT xmlNextChar(ctxt)
  ------------------
 6384|       |
 6385|  55.2k|	    op = xmlNewDocElementContent(ctxt->myDoc, NULL, XML_ELEMENT_CONTENT_OR);
 6386|  55.2k|	    if (op == NULL) {
  ------------------
  |  Branch (6386:10): [True: 1, False: 55.2k]
  ------------------
 6387|      1|                xmlErrMemory(ctxt);
 6388|      1|		if ((last != NULL) && (last != ret))
  ------------------
  |  Branch (6388:7): [True: 0, False: 1]
  |  Branch (6388:25): [True: 0, False: 0]
  ------------------
 6389|      0|		    xmlFreeDocElementContent(ctxt->myDoc, last);
 6390|      1|		if (ret != NULL)
  ------------------
  |  Branch (6390:7): [True: 1, False: 0]
  ------------------
 6391|      1|		    xmlFreeDocElementContent(ctxt->myDoc, ret);
 6392|      1|		return(NULL);
 6393|      1|	    }
 6394|  55.2k|	    if (last == NULL) {
  ------------------
  |  Branch (6394:10): [True: 16.0k, False: 39.1k]
  ------------------
 6395|  16.0k|		op->c1 = ret;
 6396|  16.0k|		if (ret != NULL)
  ------------------
  |  Branch (6396:7): [True: 16.0k, False: 0]
  ------------------
 6397|  16.0k|		    ret->parent = op;
 6398|  16.0k|		ret = cur = op;
 6399|  39.1k|	    } else {
 6400|  39.1k|	        cur->c2 = op;
 6401|  39.1k|		if (op != NULL)
  ------------------
  |  Branch (6401:7): [True: 39.1k, False: 0]
  ------------------
 6402|  39.1k|		    op->parent = cur;
 6403|  39.1k|		op->c1 = last;
 6404|  39.1k|		if (last != NULL)
  ------------------
  |  Branch (6404:7): [True: 39.1k, False: 0]
  ------------------
 6405|  39.1k|		    last->parent = op;
 6406|  39.1k|		cur =op;
 6407|  39.1k|		last = NULL;
 6408|  39.1k|	    }
 6409|  55.2k|	} else {
 6410|  1.39k|	    xmlFatalErr(ctxt, XML_ERR_ELEMCONTENT_NOT_FINISHED, NULL);
 6411|  1.39k|	    if ((last != NULL) && (last != ret))
  ------------------
  |  Branch (6411:10): [True: 490, False: 908]
  |  Branch (6411:28): [True: 490, False: 0]
  ------------------
 6412|    490|	        xmlFreeDocElementContent(ctxt->myDoc, last);
 6413|  1.39k|	    if (ret != NULL)
  ------------------
  |  Branch (6413:10): [True: 1.39k, False: 0]
  ------------------
 6414|  1.39k|		xmlFreeDocElementContent(ctxt->myDoc, ret);
 6415|  1.39k|	    return(NULL);
 6416|  1.39k|	}
 6417|   130k|        xmlSkipBlankCharsPEBalanced(ctxt, openInputNr);
 6418|   130k|        if (RAW == '(') {
  ------------------
  |  | 2224|   130k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (6418:13): [True: 21.8k, False: 108k]
  ------------------
 6419|  21.8k|            int newInputNr = ctxt->inputNr;
 6420|       |
 6421|       |	    /* Recurse on second child */
 6422|  21.8k|	    NEXT;
  ------------------
  |  | 2279|  21.8k|#define NEXT xmlNextChar(ctxt)
  ------------------
 6423|  21.8k|	    last = xmlParseElementChildrenContentDeclPriv(ctxt, newInputNr,
 6424|  21.8k|                                                          depth + 1);
 6425|  21.8k|            if (last == NULL) {
  ------------------
  |  Branch (6425:17): [True: 266, False: 21.5k]
  ------------------
 6426|    266|		if (ret != NULL)
  ------------------
  |  Branch (6426:7): [True: 266, False: 0]
  ------------------
 6427|    266|		    xmlFreeDocElementContent(ctxt->myDoc, ret);
 6428|    266|		return(NULL);
 6429|    266|            }
 6430|   108k|	} else {
 6431|   108k|	    elem = xmlParseName(ctxt);
 6432|   108k|	    if (elem == NULL) {
  ------------------
  |  Branch (6432:10): [True: 186, False: 108k]
  ------------------
 6433|    186|		xmlFatalErr(ctxt, XML_ERR_ELEMCONTENT_NOT_STARTED, NULL);
 6434|    186|		if (ret != NULL)
  ------------------
  |  Branch (6434:7): [True: 186, False: 0]
  ------------------
 6435|    186|		    xmlFreeDocElementContent(ctxt->myDoc, ret);
 6436|    186|		return(NULL);
 6437|    186|	    }
 6438|   108k|	    last = xmlNewDocElementContent(ctxt->myDoc, elem, XML_ELEMENT_CONTENT_ELEMENT);
 6439|   108k|	    if (last == NULL) {
  ------------------
  |  Branch (6439:10): [True: 1, False: 108k]
  ------------------
 6440|      1|                xmlErrMemory(ctxt);
 6441|      1|		if (ret != NULL)
  ------------------
  |  Branch (6441:7): [True: 1, False: 0]
  ------------------
 6442|      1|		    xmlFreeDocElementContent(ctxt->myDoc, ret);
 6443|      1|		return(NULL);
 6444|      1|	    }
 6445|   108k|	    if (RAW == '?') {
  ------------------
  |  | 2224|   108k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (6445:10): [True: 9.64k, False: 98.5k]
  ------------------
 6446|  9.64k|		last->ocur = XML_ELEMENT_CONTENT_OPT;
 6447|  9.64k|		NEXT;
  ------------------
  |  | 2279|  9.64k|#define NEXT xmlNextChar(ctxt)
  ------------------
 6448|  98.5k|	    } else if (RAW == '*') {
  ------------------
  |  | 2224|  98.5k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (6448:17): [True: 8.35k, False: 90.1k]
  ------------------
 6449|  8.35k|		last->ocur = XML_ELEMENT_CONTENT_MULT;
 6450|  8.35k|		NEXT;
  ------------------
  |  | 2279|  8.35k|#define NEXT xmlNextChar(ctxt)
  ------------------
 6451|  90.1k|	    } else if (RAW == '+') {
  ------------------
  |  | 2224|  90.1k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (6451:17): [True: 9.80k, False: 80.3k]
  ------------------
 6452|  9.80k|		last->ocur = XML_ELEMENT_CONTENT_PLUS;
 6453|  9.80k|		NEXT;
  ------------------
  |  | 2279|  9.80k|#define NEXT xmlNextChar(ctxt)
  ------------------
 6454|  80.3k|	    } else {
 6455|  80.3k|		last->ocur = XML_ELEMENT_CONTENT_ONCE;
 6456|  80.3k|	    }
 6457|   108k|	}
 6458|   130k|    }
 6459|  29.9k|    if ((cur != NULL) && (last != NULL)) {
  ------------------
  |  Branch (6459:9): [True: 29.9k, False: 0]
  |  Branch (6459:26): [True: 20.9k, False: 9.03k]
  ------------------
 6460|  20.9k|        cur->c2 = last;
 6461|  20.9k|	if (last != NULL)
  ------------------
  |  Branch (6461:6): [True: 20.9k, False: 0]
  ------------------
 6462|  20.9k|	    last->parent = cur;
 6463|  20.9k|    }
 6464|  29.9k|#ifdef LIBXML_VALID_ENABLED
 6465|  29.9k|    if ((ctxt->validate) && (ctxt->inputNr > openInputNr)) {
  ------------------
  |  Branch (6465:9): [True: 25.9k, False: 4.03k]
  |  Branch (6465:29): [True: 86, False: 25.8k]
  ------------------
 6466|     86|        xmlValidityError(ctxt, XML_ERR_ENTITY_BOUNDARY,
 6467|     86|                         "Element content declaration doesn't start "
 6468|     86|                         "and stop in the same entity\n",
 6469|     86|                         NULL, NULL);
 6470|     86|    }
 6471|  29.9k|#endif
 6472|  29.9k|    NEXT;
  ------------------
  |  | 2279|  29.9k|#define NEXT xmlNextChar(ctxt)
  ------------------
 6473|  29.9k|    if (RAW == '?') {
  ------------------
  |  | 2224|  29.9k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (6473:9): [True: 5.13k, False: 24.8k]
  ------------------
 6474|  5.13k|	if (ret != NULL) {
  ------------------
  |  Branch (6474:6): [True: 5.13k, False: 0]
  ------------------
 6475|  5.13k|	    if ((ret->ocur == XML_ELEMENT_CONTENT_PLUS) ||
  ------------------
  |  Branch (6475:10): [True: 81, False: 5.05k]
  ------------------
 6476|  5.05k|	        (ret->ocur == XML_ELEMENT_CONTENT_MULT))
  ------------------
  |  Branch (6476:10): [True: 71, False: 4.98k]
  ------------------
 6477|    152|	        ret->ocur = XML_ELEMENT_CONTENT_MULT;
 6478|  4.98k|	    else
 6479|  4.98k|	        ret->ocur = XML_ELEMENT_CONTENT_OPT;
 6480|  5.13k|	}
 6481|  5.13k|	NEXT;
  ------------------
  |  | 2279|  5.13k|#define NEXT xmlNextChar(ctxt)
  ------------------
 6482|  24.8k|    } else if (RAW == '*') {
  ------------------
  |  | 2224|  24.8k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (6482:16): [True: 11.3k, False: 13.4k]
  ------------------
 6483|  11.3k|	if (ret != NULL) {
  ------------------
  |  Branch (6483:6): [True: 11.3k, False: 0]
  ------------------
 6484|  11.3k|	    ret->ocur = XML_ELEMENT_CONTENT_MULT;
 6485|  11.3k|	    cur = ret;
 6486|       |	    /*
 6487|       |	     * Some normalization:
 6488|       |	     * (a | b* | c?)* == (a | b | c)*
 6489|       |	     */
 6490|  49.7k|	    while ((cur != NULL) && (cur->type == XML_ELEMENT_CONTENT_OR)) {
  ------------------
  |  Branch (6490:13): [True: 49.7k, False: 0]
  |  Branch (6490:30): [True: 38.3k, False: 11.3k]
  ------------------
 6491|  38.3k|		if ((cur->c1 != NULL) &&
  ------------------
  |  Branch (6491:7): [True: 38.3k, False: 0]
  ------------------
 6492|  38.3k|	            ((cur->c1->ocur == XML_ELEMENT_CONTENT_OPT) ||
  ------------------
  |  Branch (6492:15): [True: 280, False: 38.1k]
  ------------------
 6493|  38.1k|		     (cur->c1->ocur == XML_ELEMENT_CONTENT_MULT)))
  ------------------
  |  Branch (6493:8): [True: 1.56k, False: 36.5k]
  ------------------
 6494|  1.84k|		    cur->c1->ocur = XML_ELEMENT_CONTENT_ONCE;
 6495|  38.3k|		if ((cur->c2 != NULL) &&
  ------------------
  |  Branch (6495:7): [True: 38.3k, False: 0]
  ------------------
 6496|  38.3k|	            ((cur->c2->ocur == XML_ELEMENT_CONTENT_OPT) ||
  ------------------
  |  Branch (6496:15): [True: 121, False: 38.2k]
  ------------------
 6497|  38.2k|		     (cur->c2->ocur == XML_ELEMENT_CONTENT_MULT)))
  ------------------
  |  Branch (6497:8): [True: 41, False: 38.2k]
  ------------------
 6498|    162|		    cur->c2->ocur = XML_ELEMENT_CONTENT_ONCE;
 6499|  38.3k|		cur = cur->c2;
 6500|  38.3k|	    }
 6501|  11.3k|	}
 6502|  11.3k|	NEXT;
  ------------------
  |  | 2279|  11.3k|#define NEXT xmlNextChar(ctxt)
  ------------------
 6503|  13.4k|    } else if (RAW == '+') {
  ------------------
  |  | 2224|  13.4k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (6503:16): [True: 3.36k, False: 10.0k]
  ------------------
 6504|  3.36k|	if (ret != NULL) {
  ------------------
  |  Branch (6504:6): [True: 3.36k, False: 0]
  ------------------
 6505|  3.36k|	    int found = 0;
 6506|       |
 6507|  3.36k|	    if ((ret->ocur == XML_ELEMENT_CONTENT_OPT) ||
  ------------------
  |  Branch (6507:10): [True: 208, False: 3.15k]
  ------------------
 6508|  3.15k|	        (ret->ocur == XML_ELEMENT_CONTENT_MULT))
  ------------------
  |  Branch (6508:10): [True: 39, False: 3.11k]
  ------------------
 6509|    247|	        ret->ocur = XML_ELEMENT_CONTENT_MULT;
 6510|  3.11k|	    else
 6511|  3.11k|	        ret->ocur = XML_ELEMENT_CONTENT_PLUS;
 6512|       |	    /*
 6513|       |	     * Some normalization:
 6514|       |	     * (a | b*)+ == (a | b)*
 6515|       |	     * (a | b?)+ == (a | b)*
 6516|       |	     */
 6517|  6.51k|	    while ((cur != NULL) && (cur->type == XML_ELEMENT_CONTENT_OR)) {
  ------------------
  |  Branch (6517:13): [True: 6.51k, False: 0]
  |  Branch (6517:30): [True: 3.14k, False: 3.36k]
  ------------------
 6518|  3.14k|		if ((cur->c1 != NULL) &&
  ------------------
  |  Branch (6518:7): [True: 3.14k, False: 0]
  ------------------
 6519|  3.14k|	            ((cur->c1->ocur == XML_ELEMENT_CONTENT_OPT) ||
  ------------------
  |  Branch (6519:15): [True: 63, False: 3.08k]
  ------------------
 6520|  3.08k|		     (cur->c1->ocur == XML_ELEMENT_CONTENT_MULT))) {
  ------------------
  |  Branch (6520:8): [True: 116, False: 2.96k]
  ------------------
 6521|    179|		    cur->c1->ocur = XML_ELEMENT_CONTENT_ONCE;
 6522|    179|		    found = 1;
 6523|    179|		}
 6524|  3.14k|		if ((cur->c2 != NULL) &&
  ------------------
  |  Branch (6524:7): [True: 3.14k, False: 0]
  ------------------
 6525|  3.14k|	            ((cur->c2->ocur == XML_ELEMENT_CONTENT_OPT) ||
  ------------------
  |  Branch (6525:15): [True: 17, False: 3.12k]
  ------------------
 6526|  3.12k|		     (cur->c2->ocur == XML_ELEMENT_CONTENT_MULT))) {
  ------------------
  |  Branch (6526:8): [True: 18, False: 3.11k]
  ------------------
 6527|     35|		    cur->c2->ocur = XML_ELEMENT_CONTENT_ONCE;
 6528|     35|		    found = 1;
 6529|     35|		}
 6530|  3.14k|		cur = cur->c2;
 6531|  3.14k|	    }
 6532|  3.36k|	    if (found)
  ------------------
  |  Branch (6532:10): [True: 142, False: 3.22k]
  ------------------
 6533|    142|		ret->ocur = XML_ELEMENT_CONTENT_MULT;
 6534|  3.36k|	}
 6535|  3.36k|	NEXT;
  ------------------
  |  | 2279|  3.36k|#define NEXT xmlNextChar(ctxt)
  ------------------
 6536|  3.36k|    }
 6537|  29.9k|    return(ret);
 6538|  31.8k|}
parser.c:xmlCtxtInitializeLate:
  896|  39.7k|xmlCtxtInitializeLate(xmlParserCtxtPtr ctxt) {
  897|  39.7k|    xmlSAXHandlerPtr sax;
  898|       |
  899|       |    /* Avoid unused variable warning if features are disabled. */
  900|  39.7k|    (void) sax;
  901|       |
  902|       |    /*
  903|       |     * Changing the SAX struct directly is still widespread practice
  904|       |     * in internal and external code.
  905|       |     */
  906|  39.7k|    if (ctxt == NULL) return;
  ------------------
  |  Branch (906:9): [True: 0, False: 39.7k]
  ------------------
  907|  39.7k|    sax = ctxt->sax;
  908|  39.7k|#ifdef LIBXML_SAX1_ENABLED
  909|       |    /*
  910|       |     * Only enable SAX2 if there SAX2 element handlers, except when there
  911|       |     * are no element handlers at all.
  912|       |     */
  913|  39.7k|    if (((ctxt->options & XML_PARSE_SAX1) == 0) &&
  ------------------
  |  Branch (913:9): [True: 22.6k, False: 17.0k]
  ------------------
  914|  22.6k|        (sax) &&
  ------------------
  |  Branch (914:9): [True: 22.6k, False: 0]
  ------------------
  915|  22.6k|        (sax->initialized == XML_SAX2_MAGIC) &&
  ------------------
  |  |  953|  22.6k|#define XML_SAX2_MAGIC 0xDEEDBEAF
  ------------------
  |  Branch (915:9): [True: 22.6k, False: 0]
  ------------------
  916|  22.6k|        ((sax->startElementNs != NULL) ||
  ------------------
  |  Branch (916:10): [True: 22.6k, False: 0]
  ------------------
  917|      0|         (sax->endElementNs != NULL) ||
  ------------------
  |  Branch (917:10): [True: 0, False: 0]
  ------------------
  918|      0|         ((sax->startElement == NULL) && (sax->endElement == NULL))))
  ------------------
  |  Branch (918:11): [True: 0, False: 0]
  |  Branch (918:42): [True: 0, False: 0]
  ------------------
  919|  22.6k|        ctxt->sax2 = 1;
  920|       |#else
  921|       |    ctxt->sax2 = 1;
  922|       |#endif /* LIBXML_SAX1_ENABLED */
  923|       |
  924|       |    /*
  925|       |     * Some users replace the dictionary directly in the context struct.
  926|       |     * We really need an API function to do that cleanly.
  927|       |     */
  928|  39.7k|    ctxt->str_xml = xmlDictLookup(ctxt->dict, BAD_CAST "xml", 3);
  ------------------
  |  |   34|  39.7k|#define BAD_CAST (xmlChar *)
  ------------------
  929|  39.7k|    ctxt->str_xmlns = xmlDictLookup(ctxt->dict, BAD_CAST "xmlns", 5);
  ------------------
  |  |   34|  39.7k|#define BAD_CAST (xmlChar *)
  ------------------
  930|  39.7k|    ctxt->str_xml_ns = xmlDictLookup(ctxt->dict, XML_XML_NAMESPACE, 36);
  ------------------
  |  |  146|  39.7k|    (const xmlChar *) "http://www.w3.org/XML/1998/namespace"
  ------------------
  931|  39.7k|    if ((ctxt->str_xml==NULL) || (ctxt->str_xmlns==NULL) ||
  ------------------
  |  Branch (931:9): [True: 9, False: 39.7k]
  |  Branch (931:34): [True: 0, False: 39.7k]
  ------------------
  932|  39.7k|		(ctxt->str_xml_ns == NULL)) {
  ------------------
  |  Branch (932:3): [True: 0, False: 39.7k]
  ------------------
  933|      9|        xmlErrMemory(ctxt);
  934|      9|    }
  935|       |
  936|  39.7k|    xmlDictSetLimit(ctxt->dict,
  937|  39.7k|                    (ctxt->options & XML_PARSE_HUGE) ?
  ------------------
  |  Branch (937:21): [True: 19.4k, False: 20.2k]
  ------------------
  938|  19.4k|                        0 :
  939|  39.7k|                        XML_MAX_DICTIONARY_LIMIT);
  ------------------
  |  |   73|  60.0k|#define XML_MAX_DICTIONARY_LIMIT 100000000
  ------------------
  940|       |
  941|  39.7k|#ifdef LIBXML_VALID_ENABLED
  942|  39.7k|    if (ctxt->validate)
  ------------------
  |  Branch (942:9): [True: 18.9k, False: 20.7k]
  ------------------
  943|  18.9k|        ctxt->vctxt.flags |= XML_VCTXT_VALIDATE;
  ------------------
  |  |   24|  18.9k|#define XML_VCTXT_VALIDATE (1u << 2)
  ------------------
  944|  20.7k|    else
  945|  20.7k|        ctxt->vctxt.flags &= ~XML_VCTXT_VALIDATE;
  ------------------
  |  |   24|  20.7k|#define XML_VCTXT_VALIDATE (1u << 2)
  ------------------
  946|  39.7k|#endif /* LIBXML_VALID_ENABLED */
  947|  39.7k|}
parser.c:xmlPopPE:
 2347|  95.0k|xmlPopPE(xmlParserCtxtPtr ctxt) {
 2348|  95.0k|    unsigned long consumed;
 2349|  95.0k|    xmlEntityPtr ent;
 2350|       |
 2351|  95.0k|    ent = ctxt->input->entity;
 2352|       |
 2353|  95.0k|    ent->flags &= ~XML_ENT_EXPANDING;
  ------------------
  |  |   22|  95.0k|#define XML_ENT_EXPANDING   (1u << 3)
  ------------------
 2354|       |
 2355|  95.0k|    if ((ent->flags & XML_ENT_CHECKED) == 0) {
  ------------------
  |  |   20|  95.0k|#define XML_ENT_CHECKED     (1u << 1)
  ------------------
  |  Branch (2355:9): [True: 4.05k, False: 91.0k]
  ------------------
 2356|  4.05k|        int result;
 2357|       |
 2358|       |        /*
 2359|       |         * Read the rest of the stream in case of errors. We want
 2360|       |         * to account for the whole entity size.
 2361|       |         */
 2362|  4.11k|        do {
 2363|  4.11k|            ctxt->input->cur = ctxt->input->end;
 2364|  4.11k|            xmlParserShrink(ctxt);
 2365|  4.11k|            result = xmlParserGrow(ctxt);
 2366|  4.11k|        } while (result > 0);
  ------------------
  |  Branch (2366:18): [True: 67, False: 4.05k]
  ------------------
 2367|       |
 2368|  4.05k|        consumed = ctxt->input->consumed;
 2369|  4.05k|        xmlSaturatedAddSizeT(&consumed,
 2370|  4.05k|                             ctxt->input->end - ctxt->input->base);
 2371|       |
 2372|  4.05k|        xmlSaturatedAdd(&ent->expandedSize, consumed);
 2373|       |
 2374|       |        /*
 2375|       |         * Add to sizeentities when parsing an external entity
 2376|       |         * for the first time.
 2377|       |         */
 2378|  4.05k|        if (ent->etype == XML_EXTERNAL_PARAMETER_ENTITY) {
  ------------------
  |  Branch (2378:13): [True: 3.10k, False: 951]
  ------------------
 2379|  3.10k|            xmlSaturatedAdd(&ctxt->sizeentities, consumed);
 2380|  3.10k|        }
 2381|       |
 2382|  4.05k|        ent->flags |= XML_ENT_CHECKED;
  ------------------
  |  |   20|  4.05k|#define XML_ENT_CHECKED     (1u << 1)
  ------------------
 2383|  4.05k|    }
 2384|       |
 2385|  95.0k|    xmlFreeInputStream(xmlCtxtPopInput(ctxt));
 2386|       |
 2387|  95.0k|    xmlParserEntityCheck(ctxt, ent->expandedSize);
 2388|       |
 2389|  95.0k|    GROW;
  ------------------
  |  | 2271|  95.0k|    if ((!PARSER_PROGRESSIVE(ctxt)) && \
  |  |  ------------------
  |  |  |  |   47|  95.0k|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|  95.0k|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2271:9): [True: 85.3k, False: 9.76k]
  |  |  ------------------
  |  | 2272|  95.0k|        (ctxt->input->end - ctxt->input->cur < INPUT_CHUNK)) \
  |  |  ------------------
  |  |  |  |   63|  85.3k|#define INPUT_CHUNK	250
  |  |  ------------------
  |  |  |  Branch (2272:9): [True: 61.5k, False: 23.7k]
  |  |  ------------------
  |  | 2273|  95.0k|	xmlParserGrow(ctxt);
  ------------------
 2390|  95.0k|}
parser.c:xmlParseConditionalSections:
 6746|  4.34k|xmlParseConditionalSections(xmlParserCtxtPtr ctxt) {
 6747|  4.34k|    size_t depth = 0;
 6748|  4.34k|    int isFreshPE = 0;
 6749|  4.34k|    int oldInputNr = ctxt->inputNr;
 6750|  4.34k|    int declInputNr = ctxt->inputNr;
 6751|       |
 6752|  9.41k|    while (!PARSER_STOPPED(ctxt)) {
  ------------------
  |  |   44|  9.41k|#define PARSER_STOPPED(ctxt) ((ctxt)->disableSAX > 1)
  ------------------
  |  Branch (6752:12): [True: 9.40k, False: 6]
  ------------------
 6753|  9.40k|        if (ctxt->input->cur >= ctxt->input->end) {
  ------------------
  |  Branch (6753:13): [True: 635, False: 8.77k]
  ------------------
 6754|    635|            if (ctxt->inputNr <= oldInputNr) {
  ------------------
  |  Branch (6754:17): [True: 180, False: 455]
  ------------------
 6755|    180|                xmlFatalErr(ctxt, XML_ERR_EXT_SUBSET_NOT_FINISHED, NULL);
 6756|    180|                return;
 6757|    180|            }
 6758|       |
 6759|    455|            xmlPopPE(ctxt);
 6760|    455|            declInputNr = ctxt->inputNr;
 6761|  8.77k|        } else if ((RAW == '<') && (NXT(1) == '!') && (NXT(2) == '[')) {
  ------------------
  |  | 2224|  8.77k|#define RAW (*ctxt->input->cur)
  ------------------
                      } else if ((RAW == '<') && (NXT(1) == '!') && (NXT(2) == '[')) {
  ------------------
  |  | 2226|  6.04k|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
                      } else if ((RAW == '<') && (NXT(1) == '!') && (NXT(2) == '[')) {
  ------------------
  |  | 2226|  5.64k|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
  |  Branch (6761:20): [True: 6.04k, False: 2.72k]
  |  Branch (6761:36): [True: 5.64k, False: 396]
  |  Branch (6761:55): [True: 4.52k, False: 1.12k]
  ------------------
 6762|  4.52k|            SKIP(3);
  ------------------
  |  | 2248|  4.52k|#define SKIP(val) do {							\
  |  | 2249|  4.52k|    ctxt->input->cur += (val),ctxt->input->col+=(val);			\
  |  | 2250|  4.52k|    if (*ctxt->input->cur == 0)						\
  |  |  ------------------
  |  |  |  Branch (2250:9): [True: 212, False: 4.31k]
  |  |  ------------------
  |  | 2251|  4.52k|        xmlParserGrow(ctxt);						\
  |  | 2252|  4.52k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2252:12): [Folded, False: 4.52k]
  |  |  ------------------
  ------------------
 6763|  4.52k|            SKIP_BLANKS_PE;
  ------------------
  |  | 2277|  4.52k|#define SKIP_BLANKS_PE xmlSkipBlankCharsPE(ctxt)
  ------------------
 6764|       |
 6765|  4.52k|            isFreshPE = 0;
 6766|       |
 6767|  4.52k|            if (CMP7(CUR_PTR, 'I', 'N', 'C', 'L', 'U', 'D', 'E')) {
  ------------------
  |  | 2238|  4.52k|  ( CMP6( s, c1, c2, c3, c4, c5, c6 ) && ((unsigned char *) s)[ 6 ] == c7 )
  |  |  ------------------
  |  |  |  | 2236|  9.05k|  ( CMP5( s, c1, c2, c3, c4, c5 ) && ((unsigned char *) s)[ 5 ] == c6 )
  |  |  |  |  ------------------
  |  |  |  |  |  | 2234|  9.05k|  ( CMP4( s, c1, c2, c3, c4 ) && ((unsigned char *) s)[ 4 ] == c5 )
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  | 2231|  9.05k|  ( ((unsigned char *) s)[ 0 ] == c1 && ((unsigned char *) s)[ 1 ] == c2 && \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (2231:5): [True: 4.20k, False: 317]
  |  |  |  |  |  |  |  |  |  Branch (2231:41): [True: 1.95k, False: 2.25k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  | 2232|  4.52k|    ((unsigned char *) s)[ 2 ] == c3 && ((unsigned char *) s)[ 3 ] == c4 )
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (2232:5): [True: 1.95k, False: 3]
  |  |  |  |  |  |  |  |  |  Branch (2232:41): [True: 1.95k, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (2234:34): [True: 1.94k, False: 2]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2236:38): [True: 1.94k, False: 2]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2238:42): [True: 1.94k, False: 1]
  |  |  ------------------
  ------------------
 6768|  1.94k|                SKIP(7);
  ------------------
  |  | 2248|  1.94k|#define SKIP(val) do {							\
  |  | 2249|  1.94k|    ctxt->input->cur += (val),ctxt->input->col+=(val);			\
  |  | 2250|  1.94k|    if (*ctxt->input->cur == 0)						\
  |  |  ------------------
  |  |  |  Branch (2250:9): [True: 43, False: 1.90k]
  |  |  ------------------
  |  | 2251|  1.94k|        xmlParserGrow(ctxt);						\
  |  | 2252|  1.94k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2252:12): [Folded, False: 1.94k]
  |  |  ------------------
  ------------------
 6769|  1.94k|                SKIP_BLANKS_PE;
  ------------------
  |  | 2277|  1.94k|#define SKIP_BLANKS_PE xmlSkipBlankCharsPE(ctxt)
  ------------------
 6770|  1.94k|                if (RAW != '[') {
  ------------------
  |  | 2224|  1.94k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (6770:21): [True: 215, False: 1.73k]
  ------------------
 6771|    215|                    xmlFatalErr(ctxt, XML_ERR_CONDSEC_INVALID, NULL);
 6772|    215|                    return;
 6773|    215|                }
 6774|  1.73k|#ifdef LIBXML_VALID_ENABLED
 6775|  1.73k|                if ((ctxt->validate) && (ctxt->inputNr > declInputNr)) {
  ------------------
  |  Branch (6775:21): [True: 764, False: 966]
  |  Branch (6775:41): [True: 29, False: 735]
  ------------------
 6776|     29|		    xmlValidityError(ctxt, XML_ERR_ENTITY_BOUNDARY,
 6777|     29|                                     "All markup of the conditional section is"
 6778|     29|                                     " not in the same entity\n",
 6779|     29|                                     NULL, NULL);
 6780|     29|                }
 6781|  1.73k|#endif
 6782|  1.73k|                NEXT;
  ------------------
  |  | 2279|  1.73k|#define NEXT xmlNextChar(ctxt)
  ------------------
 6783|       |
 6784|  1.73k|                depth++;
 6785|  2.58k|            } else if (CMP6(CUR_PTR, 'I', 'G', 'N', 'O', 'R', 'E')) {
  ------------------
  |  | 2236|  2.58k|  ( CMP5( s, c1, c2, c3, c4, c5 ) && ((unsigned char *) s)[ 5 ] == c6 )
  |  |  ------------------
  |  |  |  | 2234|  5.16k|  ( CMP4( s, c1, c2, c3, c4 ) && ((unsigned char *) s)[ 4 ] == c5 )
  |  |  |  |  ------------------
  |  |  |  |  |  | 2231|  5.16k|  ( ((unsigned char *) s)[ 0 ] == c1 && ((unsigned char *) s)[ 1 ] == c2 && \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (2231:5): [True: 2.26k, False: 317]
  |  |  |  |  |  |  |  Branch (2231:41): [True: 2.25k, False: 10]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 2232|  2.58k|    ((unsigned char *) s)[ 2 ] == c3 && ((unsigned char *) s)[ 3 ] == c4 )
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (2232:5): [True: 2.25k, False: 2]
  |  |  |  |  |  |  |  Branch (2232:41): [True: 2.25k, False: 1]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2234:34): [True: 2.24k, False: 2]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2236:38): [True: 2.24k, False: 1]
  |  |  ------------------
  ------------------
 6786|  2.24k|                size_t ignoreDepth = 0;
 6787|       |
 6788|  2.24k|                SKIP(6);
  ------------------
  |  | 2248|  2.24k|#define SKIP(val) do {							\
  |  | 2249|  2.24k|    ctxt->input->cur += (val),ctxt->input->col+=(val);			\
  |  | 2250|  2.24k|    if (*ctxt->input->cur == 0)						\
  |  |  ------------------
  |  |  |  Branch (2250:9): [True: 236, False: 2.01k]
  |  |  ------------------
  |  | 2251|  2.24k|        xmlParserGrow(ctxt);						\
  |  | 2252|  2.24k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2252:12): [Folded, False: 2.24k]
  |  |  ------------------
  ------------------
 6789|  2.24k|                SKIP_BLANKS_PE;
  ------------------
  |  | 2277|  2.24k|#define SKIP_BLANKS_PE xmlSkipBlankCharsPE(ctxt)
  ------------------
 6790|  2.24k|                if (RAW != '[') {
  ------------------
  |  | 2224|  2.24k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (6790:21): [True: 419, False: 1.82k]
  ------------------
 6791|    419|                    xmlFatalErr(ctxt, XML_ERR_CONDSEC_INVALID, NULL);
 6792|    419|                    return;
 6793|    419|                }
 6794|  1.82k|#ifdef LIBXML_VALID_ENABLED
 6795|  1.82k|                if ((ctxt->validate) && (ctxt->inputNr > declInputNr)) {
  ------------------
  |  Branch (6795:21): [True: 1.09k, False: 732]
  |  Branch (6795:41): [True: 6, False: 1.09k]
  ------------------
 6796|      6|		    xmlValidityError(ctxt, XML_ERR_ENTITY_BOUNDARY,
 6797|      6|                                     "All markup of the conditional section is"
 6798|      6|                                     " not in the same entity\n",
 6799|      6|                                     NULL, NULL);
 6800|      6|                }
 6801|  1.82k|#endif
 6802|  1.82k|                NEXT;
  ------------------
  |  | 2279|  1.82k|#define NEXT xmlNextChar(ctxt)
  ------------------
 6803|       |
 6804|  54.4k|                while (PARSER_STOPPED(ctxt) == 0) {
  ------------------
  |  |   44|  54.4k|#define PARSER_STOPPED(ctxt) ((ctxt)->disableSAX > 1)
  ------------------
  |  Branch (6804:24): [True: 54.4k, False: 2]
  ------------------
 6805|  54.4k|                    if (RAW == 0) {
  ------------------
  |  | 2224|  54.4k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (6805:25): [True: 1.22k, False: 53.2k]
  ------------------
 6806|  1.22k|                        xmlFatalErr(ctxt, XML_ERR_CONDSEC_NOT_FINISHED, NULL);
 6807|  1.22k|                        return;
 6808|  1.22k|                    }
 6809|  53.2k|                    if ((RAW == '<') && (NXT(1) == '!') && (NXT(2) == '[')) {
  ------------------
  |  | 2224|  53.2k|#define RAW (*ctxt->input->cur)
  ------------------
                                  if ((RAW == '<') && (NXT(1) == '!') && (NXT(2) == '[')) {
  ------------------
  |  | 2226|  2.63k|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
                                  if ((RAW == '<') && (NXT(1) == '!') && (NXT(2) == '[')) {
  ------------------
  |  | 2226|  1.51k|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
  |  Branch (6809:25): [True: 2.63k, False: 50.5k]
  |  Branch (6809:41): [True: 1.51k, False: 1.12k]
  |  Branch (6809:60): [True: 853, False: 660]
  ------------------
 6810|    853|                        SKIP(3);
  ------------------
  |  | 2248|    853|#define SKIP(val) do {							\
  |  | 2249|    853|    ctxt->input->cur += (val),ctxt->input->col+=(val);			\
  |  | 2250|    853|    if (*ctxt->input->cur == 0)						\
  |  |  ------------------
  |  |  |  Branch (2250:9): [True: 88, False: 765]
  |  |  ------------------
  |  | 2251|    853|        xmlParserGrow(ctxt);						\
  |  | 2252|    853|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2252:12): [Folded, False: 853]
  |  |  ------------------
  ------------------
 6811|    853|                        ignoreDepth++;
 6812|       |                        /* Check for integer overflow */
 6813|    853|                        if (ignoreDepth == 0) {
  ------------------
  |  Branch (6813:29): [True: 0, False: 853]
  ------------------
 6814|      0|                            xmlErrMemory(ctxt);
 6815|      0|                            return;
 6816|      0|                        }
 6817|  52.3k|                    } else if ((RAW == ']') && (NXT(1) == ']') &&
  ------------------
  |  | 2224|  52.3k|#define RAW (*ctxt->input->cur)
  ------------------
                                  } else if ((RAW == ']') && (NXT(1) == ']') &&
  ------------------
  |  | 2226|  3.06k|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
  |  Branch (6817:32): [True: 3.06k, False: 49.3k]
  |  Branch (6817:48): [True: 1.35k, False: 1.70k]
  ------------------
 6818|  1.35k|                               (NXT(2) == '>')) {
  ------------------
  |  | 2226|  1.35k|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
  |  Branch (6818:32): [True: 973, False: 386]
  ------------------
 6819|    973|                        SKIP(3);
  ------------------
  |  | 2248|    973|#define SKIP(val) do {							\
  |  | 2249|    973|    ctxt->input->cur += (val),ctxt->input->col+=(val);			\
  |  | 2250|    973|    if (*ctxt->input->cur == 0)						\
  |  |  ------------------
  |  |  |  Branch (2250:9): [True: 278, False: 695]
  |  |  ------------------
  |  | 2251|    973|        xmlParserGrow(ctxt);						\
  |  | 2252|    973|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2252:12): [Folded, False: 973]
  |  |  ------------------
  ------------------
 6820|    973|                        if (ignoreDepth == 0)
  ------------------
  |  Branch (6820:29): [True: 606, False: 367]
  ------------------
 6821|    606|                            break;
 6822|    367|                        ignoreDepth--;
 6823|  51.4k|                    } else {
 6824|  51.4k|                        NEXT;
  ------------------
  |  | 2279|  51.4k|#define NEXT xmlNextChar(ctxt)
  ------------------
 6825|  51.4k|                    }
 6826|  53.2k|                }
 6827|       |
 6828|    608|#ifdef LIBXML_VALID_ENABLED
 6829|    608|                if ((ctxt->validate) && (ctxt->inputNr > declInputNr)) {
  ------------------
  |  Branch (6829:21): [True: 361, False: 247]
  |  Branch (6829:41): [True: 6, False: 355]
  ------------------
 6830|      6|		    xmlValidityError(ctxt, XML_ERR_ENTITY_BOUNDARY,
 6831|      6|                                     "All markup of the conditional section is"
 6832|      6|                                     " not in the same entity\n",
 6833|      6|                                     NULL, NULL);
 6834|      6|                }
 6835|    608|#endif
 6836|    608|            } else {
 6837|    333|                xmlFatalErr(ctxt, XML_ERR_CONDSEC_INVALID_KEYWORD, NULL);
 6838|    333|                return;
 6839|    333|            }
 6840|  4.52k|        } else if ((depth > 0) &&
  ------------------
  |  Branch (6840:20): [True: 4.24k, False: 0]
  ------------------
 6841|  4.24k|                   (RAW == ']') && (NXT(1) == ']') && (NXT(2) == '>')) {
  ------------------
  |  | 2224|  4.24k|#define RAW (*ctxt->input->cur)
  ------------------
                                 (RAW == ']') && (NXT(1) == ']') && (NXT(2) == '>')) {
  ------------------
  |  | 2226|  1.35k|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
                                 (RAW == ']') && (NXT(1) == ']') && (NXT(2) == '>')) {
  ------------------
  |  | 2226|  1.35k|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
  |  Branch (6841:20): [True: 1.35k, False: 2.88k]
  |  Branch (6841:36): [True: 1.35k, False: 4]
  |  Branch (6841:55): [True: 1.35k, False: 1]
  ------------------
 6842|  1.35k|            if (isFreshPE) {
  ------------------
  |  Branch (6842:17): [True: 2, False: 1.34k]
  ------------------
 6843|      2|                xmlFatalErrMsg(ctxt, XML_ERR_CONDSEC_INVALID,
 6844|      2|                               "Parameter entity must match "
 6845|      2|                               "extSubsetDecl\n");
 6846|      2|                return;
 6847|      2|            }
 6848|       |
 6849|  1.34k|            depth--;
 6850|  1.34k|#ifdef LIBXML_VALID_ENABLED
 6851|  1.34k|            if ((ctxt->validate) && (ctxt->inputNr > declInputNr)) {
  ------------------
  |  Branch (6851:17): [True: 505, False: 844]
  |  Branch (6851:37): [True: 18, False: 487]
  ------------------
 6852|     18|		xmlValidityError(ctxt, XML_ERR_ENTITY_BOUNDARY,
 6853|     18|                                 "All markup of the conditional section is not"
 6854|     18|                                 " in the same entity\n",
 6855|     18|                                 NULL, NULL);
 6856|     18|            }
 6857|  1.34k|#endif
 6858|  1.34k|            SKIP(3);
  ------------------
  |  | 2248|  1.34k|#define SKIP(val) do {							\
  |  | 2249|  1.34k|    ctxt->input->cur += (val),ctxt->input->col+=(val);			\
  |  | 2250|  1.34k|    if (*ctxt->input->cur == 0)						\
  |  |  ------------------
  |  |  |  Branch (2250:9): [True: 645, False: 704]
  |  |  ------------------
  |  | 2251|  1.34k|        xmlParserGrow(ctxt);						\
  |  | 2252|  1.34k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2252:12): [Folded, False: 1.34k]
  |  |  ------------------
  ------------------
 6859|  2.89k|        } else if ((RAW == '<') && ((NXT(1) == '!') || (NXT(1) == '?'))) {
  ------------------
  |  | 2224|  2.89k|#define RAW (*ctxt->input->cur)
  ------------------
                      } else if ((RAW == '<') && ((NXT(1) == '!') || (NXT(1) == '?'))) {
  ------------------
  |  | 2226|  1.51k|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
                      } else if ((RAW == '<') && ((NXT(1) == '!') || (NXT(1) == '?'))) {
  ------------------
  |  | 2226|    396|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
  |  Branch (6859:20): [True: 1.51k, False: 1.37k]
  |  Branch (6859:37): [True: 1.12k, False: 396]
  |  Branch (6859:56): [True: 391, False: 5]
  ------------------
 6860|  1.51k|            isFreshPE = 0;
 6861|  1.51k|            xmlParseMarkupDecl(ctxt);
 6862|  1.51k|        } else if (RAW == '%') {
  ------------------
  |  | 2224|  1.38k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (6862:20): [True: 1.33k, False: 47]
  ------------------
 6863|  1.33k|            xmlParsePERefInternal(ctxt, 1);
 6864|  1.33k|            if (ctxt->inputNr > declInputNr) {
  ------------------
  |  Branch (6864:17): [True: 459, False: 875]
  ------------------
 6865|    459|                isFreshPE = 1;
 6866|    459|                declInputNr = ctxt->inputNr;
 6867|    459|            }
 6868|  1.33k|        } else {
 6869|     47|            xmlFatalErr(ctxt, XML_ERR_EXT_SUBSET_NOT_FINISHED, NULL);
 6870|     47|            return;
 6871|     47|        }
 6872|       |
 6873|  6.98k|        if (depth == 0)
  ------------------
  |  Branch (6873:13): [True: 1.92k, False: 5.06k]
  ------------------
 6874|  1.92k|            break;
 6875|       |
 6876|  5.06k|        SKIP_BLANKS;
  ------------------
  |  | 2275|  5.06k|#define SKIP_BLANKS xmlSkipBlankChars(ctxt)
  ------------------
 6877|  5.06k|        SHRINK;
  ------------------
  |  | 2267|  5.06k|    if (!PARSER_PROGRESSIVE(ctxt)) \
  |  |  ------------------
  |  |  |  |   47|  5.06k|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|  5.06k|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2267:9): [True: 4.96k, False: 103]
  |  |  ------------------
  |  | 2268|  5.06k|	xmlParserShrink(ctxt);
  ------------------
 6878|  5.06k|        GROW;
  ------------------
  |  | 2271|  5.06k|    if ((!PARSER_PROGRESSIVE(ctxt)) && \
  |  |  ------------------
  |  |  |  |   47|  5.06k|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|  5.06k|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2271:9): [True: 4.96k, False: 103]
  |  |  ------------------
  |  | 2272|  5.06k|        (ctxt->input->end - ctxt->input->cur < INPUT_CHUNK)) \
  |  |  ------------------
  |  |  |  |   63|  4.96k|#define INPUT_CHUNK	250
  |  |  ------------------
  |  |  |  Branch (2272:9): [True: 4.13k, False: 831]
  |  |  ------------------
  |  | 2273|  5.06k|	xmlParserGrow(ctxt);
  ------------------
 6879|  5.06k|    }
 6880|  4.34k|}
parser.c:xmlParserEntityCheck:
  435|  1.93M|{
  436|  1.93M|    unsigned long consumed;
  437|  1.93M|    unsigned long *expandedSize;
  438|  1.93M|    xmlParserInputPtr input = ctxt->input;
  439|  1.93M|    xmlEntityPtr entity = input->entity;
  440|       |
  441|  1.93M|    if ((entity) && (entity->flags & XML_ENT_CHECKED))
  ------------------
  |  |   20|   458k|#define XML_ENT_CHECKED     (1u << 1)
  ------------------
  |  Branch (441:9): [True: 458k, False: 1.47M]
  |  Branch (441:21): [True: 314k, False: 144k]
  ------------------
  442|   314k|        return(0);
  443|       |
  444|       |    /*
  445|       |     * Compute total consumed bytes so far, including input streams of
  446|       |     * external entities.
  447|       |     */
  448|  1.61M|    consumed = input->consumed;
  449|  1.61M|    xmlSaturatedAddSizeT(&consumed, input->cur - input->base);
  450|  1.61M|    xmlSaturatedAdd(&consumed, ctxt->sizeentities);
  451|       |
  452|  1.61M|    if (entity)
  ------------------
  |  Branch (452:9): [True: 144k, False: 1.47M]
  ------------------
  453|   144k|        expandedSize = &entity->expandedSize;
  454|  1.47M|    else
  455|  1.47M|        expandedSize = &ctxt->sizeentcopy;
  456|       |
  457|       |    /*
  458|       |     * Add extra cost and some fixed cost.
  459|       |     */
  460|  1.61M|    xmlSaturatedAdd(expandedSize, extra);
  461|  1.61M|    xmlSaturatedAdd(expandedSize, XML_ENT_FIXED_COST);
  ------------------
  |  |  169|  1.61M|#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|  1.61M|    if ((*expandedSize > XML_PARSER_ALLOWED_EXPANSION) &&
  ------------------
  |  |  162|  1.61M|#define XML_PARSER_ALLOWED_EXPANSION 1000000
  ------------------
  |  Branch (468:9): [True: 338k, False: 1.27M]
  ------------------
  469|   338k|        ((*expandedSize >= ULONG_MAX) ||
  ------------------
  |  Branch (469:10): [True: 0, False: 338k]
  ------------------
  470|   338k|         (*expandedSize / ctxt->maxAmpl > consumed))) {
  ------------------
  |  Branch (470:10): [True: 213, False: 337k]
  ------------------
  471|    213|        xmlFatalErrMsg(ctxt, XML_ERR_RESOURCE_LIMIT,
  472|    213|                       "Maximum entity amplification factor exceeded, see "
  473|    213|                       "xmlCtxtSetMaxAmplification.\n");
  474|    213|        return(1);
  475|    213|    }
  476|       |
  477|  1.61M|    return(0);
  478|  1.61M|}
parser.c:xmlLookupGeneralEntity:
 7395|  2.64M|xmlLookupGeneralEntity(xmlParserCtxtPtr ctxt, const xmlChar *name, int inAttr) {
 7396|  2.64M|    xmlEntityPtr ent = NULL;
 7397|       |
 7398|       |    /*
 7399|       |     * Predefined entities override any extra definition
 7400|       |     */
 7401|  2.64M|    if ((ctxt->options & XML_PARSE_OLDSAX) == 0) {
  ------------------
  |  Branch (7401:9): [True: 1.30M, False: 1.34M]
  ------------------
 7402|  1.30M|        ent = xmlGetPredefinedEntity(name);
 7403|  1.30M|        if (ent != NULL)
  ------------------
  |  Branch (7403:13): [True: 506k, False: 796k]
  ------------------
 7404|   506k|            return(ent);
 7405|  1.30M|    }
 7406|       |
 7407|       |    /*
 7408|       |     * Ask first SAX for entity resolution, otherwise try the
 7409|       |     * entities which may have stored in the parser context.
 7410|       |     */
 7411|  2.13M|    if (ctxt->sax != NULL) {
  ------------------
  |  Branch (7411:9): [True: 2.13M, False: 0]
  ------------------
 7412|  2.13M|	if (ctxt->sax->getEntity != NULL)
  ------------------
  |  Branch (7412:6): [True: 2.13M, False: 0]
  ------------------
 7413|  2.13M|	    ent = ctxt->sax->getEntity(ctxt->userData, name);
 7414|  2.13M|	if ((ctxt->wellFormed == 1 ) && (ent == NULL) &&
  ------------------
  |  Branch (7414:6): [True: 28.1k, False: 2.11M]
  |  Branch (7414:34): [True: 2.69k, False: 25.4k]
  ------------------
 7415|  2.69k|	    (ctxt->options & XML_PARSE_OLDSAX))
  ------------------
  |  Branch (7415:6): [True: 615, False: 2.08k]
  ------------------
 7416|    615|	    ent = xmlGetPredefinedEntity(name);
 7417|  2.13M|	if ((ctxt->wellFormed == 1 ) && (ent == NULL) &&
  ------------------
  |  Branch (7417:6): [True: 28.1k, False: 2.11M]
  |  Branch (7417:34): [True: 2.69k, False: 25.4k]
  ------------------
 7418|  2.69k|	    (ctxt->userData==ctxt)) {
  ------------------
  |  Branch (7418:6): [True: 2.69k, False: 0]
  ------------------
 7419|  2.69k|	    ent = xmlSAX2GetEntity(ctxt, name);
 7420|  2.69k|	}
 7421|  2.13M|    }
 7422|       |
 7423|  2.13M|    if (ent == NULL) {
  ------------------
  |  Branch (7423:9): [True: 319k, False: 1.81M]
  ------------------
 7424|   319k|        xmlHandleUndeclaredEntity(ctxt, name);
 7425|   319k|    }
 7426|       |
 7427|       |    /*
 7428|       |     * [ WFC: Parsed Entity ]
 7429|       |     * An entity reference must not contain the name of an
 7430|       |     * unparsed entity
 7431|       |     */
 7432|  1.81M|    else if (ent->etype == XML_EXTERNAL_GENERAL_UNPARSED_ENTITY) {
  ------------------
  |  Branch (7432:14): [True: 301, False: 1.81M]
  ------------------
 7433|    301|	xmlFatalErrMsgStr(ctxt, XML_ERR_UNPARSED_ENTITY,
 7434|    301|		 "Entity reference to unparsed entity %s\n", name);
 7435|    301|        ent = NULL;
 7436|    301|    }
 7437|       |
 7438|       |    /*
 7439|       |     * [ WFC: No External Entity References ]
 7440|       |     * Attribute values cannot contain direct or indirect
 7441|       |     * entity references to external entities.
 7442|       |     */
 7443|  1.81M|    else if (ent->etype == XML_EXTERNAL_GENERAL_PARSED_ENTITY) {
  ------------------
  |  Branch (7443:14): [True: 12.2k, False: 1.80M]
  ------------------
 7444|  12.2k|        if (inAttr) {
  ------------------
  |  Branch (7444:13): [True: 711, False: 11.5k]
  ------------------
 7445|    711|            xmlFatalErrMsgStr(ctxt, XML_ERR_ENTITY_IS_EXTERNAL,
 7446|    711|                 "Attribute references external entity '%s'\n", name);
 7447|    711|            ent = NULL;
 7448|    711|        }
 7449|  12.2k|    }
 7450|       |
 7451|  2.13M|    return(ent);
 7452|  2.64M|}
parser.c:xmlParseEntityRefInternal:
 7463|   874k|xmlParseEntityRefInternal(xmlParserCtxtPtr ctxt) {
 7464|   874k|    const xmlChar *name;
 7465|       |
 7466|   874k|    GROW;
  ------------------
  |  | 2271|   874k|    if ((!PARSER_PROGRESSIVE(ctxt)) && \
  |  |  ------------------
  |  |  |  |   47|   874k|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|   874k|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2271:9): [True: 447k, False: 426k]
  |  |  ------------------
  |  | 2272|   874k|        (ctxt->input->end - ctxt->input->cur < INPUT_CHUNK)) \
  |  |  ------------------
  |  |  |  |   63|   447k|#define INPUT_CHUNK	250
  |  |  ------------------
  |  |  |  Branch (2272:9): [True: 225k, False: 222k]
  |  |  ------------------
  |  | 2273|   874k|	xmlParserGrow(ctxt);
  ------------------
 7467|       |
 7468|   874k|    if (RAW != '&')
  ------------------
  |  | 2224|   874k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (7468:9): [True: 0, False: 874k]
  ------------------
 7469|      0|        return(NULL);
 7470|   874k|    NEXT;
  ------------------
  |  | 2279|   874k|#define NEXT xmlNextChar(ctxt)
  ------------------
 7471|   874k|    name = xmlParseName(ctxt);
 7472|   874k|    if (name == NULL) {
  ------------------
  |  Branch (7472:9): [True: 40.3k, False: 833k]
  ------------------
 7473|  40.3k|	xmlFatalErrMsg(ctxt, XML_ERR_NAME_REQUIRED,
 7474|  40.3k|		       "xmlParseEntityRef: no name\n");
 7475|  40.3k|        return(NULL);
 7476|  40.3k|    }
 7477|   833k|    if (RAW != ';') {
  ------------------
  |  | 2224|   833k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (7477:9): [True: 82.0k, False: 751k]
  ------------------
 7478|  82.0k|	xmlFatalErr(ctxt, XML_ERR_ENTITYREF_SEMICOL_MISSING, NULL);
 7479|  82.0k|	return(NULL);
 7480|  82.0k|    }
 7481|   751k|    NEXT;
  ------------------
  |  | 2279|   751k|#define NEXT xmlNextChar(ctxt)
  ------------------
 7482|       |
 7483|   751k|    return(name);
 7484|   833k|}
parser.c:xmlParsePERefInternal:
 7599|   164k|xmlParsePERefInternal(xmlParserCtxt *ctxt, int markupDecl) {
 7600|   164k|    const xmlChar *name;
 7601|   164k|    xmlEntityPtr entity = NULL;
 7602|   164k|    xmlParserInputPtr input;
 7603|       |
 7604|   164k|    if (RAW != '%')
  ------------------
  |  | 2224|   164k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (7604:9): [True: 0, False: 164k]
  ------------------
 7605|      0|        return;
 7606|   164k|    NEXT;
  ------------------
  |  | 2279|   164k|#define NEXT xmlNextChar(ctxt)
  ------------------
 7607|   164k|    name = xmlParseName(ctxt);
 7608|   164k|    if (name == NULL) {
  ------------------
  |  Branch (7608:9): [True: 10.9k, False: 153k]
  ------------------
 7609|  10.9k|	xmlFatalErrMsg(ctxt, XML_ERR_PEREF_NO_NAME, "PEReference: no name\n");
 7610|  10.9k|	return;
 7611|  10.9k|    }
 7612|   153k|    if (RAW != ';') {
  ------------------
  |  | 2224|   153k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (7612:9): [True: 11.4k, False: 142k]
  ------------------
 7613|  11.4k|	xmlFatalErr(ctxt, XML_ERR_PEREF_SEMICOL_MISSING, NULL);
 7614|  11.4k|        return;
 7615|  11.4k|    }
 7616|       |
 7617|   142k|    NEXT;
  ------------------
  |  | 2279|   142k|#define NEXT xmlNextChar(ctxt)
  ------------------
 7618|       |
 7619|       |    /* Must be set before xmlHandleUndeclaredEntity */
 7620|   142k|    ctxt->hasPErefs = 1;
 7621|       |
 7622|       |    /*
 7623|       |     * Request the entity from SAX
 7624|       |     */
 7625|   142k|    if ((ctxt->sax != NULL) &&
  ------------------
  |  Branch (7625:9): [True: 142k, False: 0]
  ------------------
 7626|   142k|	(ctxt->sax->getParameterEntity != NULL))
  ------------------
  |  Branch (7626:2): [True: 142k, False: 0]
  ------------------
 7627|   142k|	entity = ctxt->sax->getParameterEntity(ctxt->userData, name);
 7628|       |
 7629|   142k|    if (entity == NULL) {
  ------------------
  |  Branch (7629:9): [True: 44.3k, False: 98.0k]
  ------------------
 7630|  44.3k|        xmlHandleUndeclaredEntity(ctxt, name);
 7631|  98.0k|    } else {
 7632|       |	/*
 7633|       |	 * Internal checking in case the entity quest barfed
 7634|       |	 */
 7635|  98.0k|	if ((entity->etype != XML_INTERNAL_PARAMETER_ENTITY) &&
  ------------------
  |  Branch (7635:6): [True: 91.0k, False: 6.96k]
  ------------------
 7636|  91.0k|	    (entity->etype != XML_EXTERNAL_PARAMETER_ENTITY)) {
  ------------------
  |  Branch (7636:6): [True: 0, False: 91.0k]
  ------------------
 7637|      0|	    xmlWarningMsg(ctxt, XML_WAR_UNDECLARED_ENTITY,
 7638|      0|		  "Internal: %%%s; is not a parameter entity\n",
 7639|      0|			  name, NULL);
 7640|  98.0k|	} else {
 7641|  98.0k|	    if ((entity->etype == XML_EXTERNAL_PARAMETER_ENTITY) &&
  ------------------
  |  Branch (7641:10): [True: 91.0k, False: 6.96k]
  ------------------
 7642|  91.0k|                ((ctxt->options & XML_PARSE_NO_XXE) ||
  ------------------
  |  Branch (7642:18): [True: 53, False: 90.9k]
  ------------------
 7643|  90.9k|		 (((ctxt->loadsubset & ~XML_SKIP_IDS) == 0) &&
  ------------------
  |  |  210|  90.9k|#define XML_SKIP_IDS		8
  ------------------
  |  Branch (7643:5): [True: 24.8k, False: 66.1k]
  ------------------
 7644|  24.8k|		  (ctxt->replaceEntities == 0) &&
  ------------------
  |  Branch (7644:5): [True: 9.63k, False: 15.1k]
  ------------------
 7645|  9.63k|		  (ctxt->validate == 0))))
  ------------------
  |  Branch (7645:5): [True: 201, False: 9.43k]
  ------------------
 7646|    254|		return;
 7647|       |
 7648|  97.7k|            if (entity->flags & XML_ENT_EXPANDING) {
  ------------------
  |  |   22|  97.7k|#define XML_ENT_EXPANDING   (1u << 3)
  ------------------
  |  Branch (7648:17): [True: 12, False: 97.7k]
  ------------------
 7649|     12|                xmlFatalErr(ctxt, XML_ERR_ENTITY_LOOP, NULL);
 7650|     12|                return;
 7651|     12|            }
 7652|       |
 7653|  97.7k|	    input = xmlNewEntityInputStream(ctxt, entity);
 7654|  97.7k|	    if (xmlCtxtPushInput(ctxt, input) < 0) {
  ------------------
  |  Branch (7654:10): [True: 1.91k, False: 95.8k]
  ------------------
 7655|  1.91k|                xmlFreeInputStream(input);
 7656|  1.91k|		return;
 7657|  1.91k|            }
 7658|       |
 7659|  95.8k|            entity->flags |= XML_ENT_EXPANDING;
  ------------------
  |  |   22|  95.8k|#define XML_ENT_EXPANDING   (1u << 3)
  ------------------
 7660|       |
 7661|  95.8k|            if (markupDecl)
  ------------------
  |  Branch (7661:17): [True: 87.6k, False: 8.14k]
  ------------------
 7662|  87.6k|                input->flags |= XML_INPUT_MARKUP_DECL;
  ------------------
  |  |   42|  87.6k|#define XML_INPUT_MARKUP_DECL       (1u << 7)
  ------------------
 7663|       |
 7664|  95.8k|            GROW;
  ------------------
  |  | 2271|  95.8k|    if ((!PARSER_PROGRESSIVE(ctxt)) && \
  |  |  ------------------
  |  |  |  |   47|  95.8k|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|  95.8k|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2271:9): [True: 95.8k, False: 0]
  |  |  ------------------
  |  | 2272|  95.8k|        (ctxt->input->end - ctxt->input->cur < INPUT_CHUNK)) \
  |  |  ------------------
  |  |  |  |   63|  95.8k|#define INPUT_CHUNK	250
  |  |  ------------------
  |  |  |  Branch (2272:9): [True: 59.2k, False: 36.5k]
  |  |  ------------------
  |  | 2273|  95.8k|	xmlParserGrow(ctxt);
  ------------------
 7665|       |
 7666|  95.8k|	    if (entity->etype == XML_EXTERNAL_PARAMETER_ENTITY) {
  ------------------
  |  Branch (7666:10): [True: 88.8k, False: 6.95k]
  ------------------
 7667|  88.8k|                xmlDetectEncoding(ctxt);
 7668|       |
 7669|  88.8k|                if ((CMP5(CUR_PTR, '<', '?', 'x', 'm', 'l')) &&
  ------------------
  |  | 2234|  88.8k|  ( CMP4( s, c1, c2, c3, c4 ) && ((unsigned char *) s)[ 4 ] == c5 )
  |  |  ------------------
  |  |  |  | 2231|   177k|  ( ((unsigned char *) s)[ 0 ] == c1 && ((unsigned char *) s)[ 1 ] == c2 && \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2231:5): [True: 71.4k, False: 17.3k]
  |  |  |  |  |  Branch (2231:41): [True: 45.4k, False: 26.0k]
  |  |  |  |  ------------------
  |  |  |  | 2232|  88.8k|    ((unsigned char *) s)[ 2 ] == c3 && ((unsigned char *) s)[ 3 ] == c4 )
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2232:5): [True: 42.0k, False: 3.38k]
  |  |  |  |  |  Branch (2232:41): [True: 40.9k, False: 1.11k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2234:34): [True: 39.5k, False: 1.35k]
  |  |  ------------------
  ------------------
 7670|  39.5k|                    (IS_BLANK_CH(NXT(5)))) {
  ------------------
  |  |  137|  39.5k|#define IS_BLANK_CH(c)  xmlIsBlank_ch(c)
  |  |  ------------------
  |  |  |  |   90|  39.5k|#define xmlIsBlank_ch(c)	(((c) == 0x20) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (90:27): [True: 37.7k, False: 1.84k]
  |  |  |  |  ------------------
  |  |  |  |   91|  39.5k|				 ((0x9 <= (c)) && ((c) <= 0xa)) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (91:7): [True: 1.77k, False: 74]
  |  |  |  |  |  Branch (91:23): [True: 608, False: 1.16k]
  |  |  |  |  ------------------
  |  |  |  |   92|  39.5k|				 ((c) == 0xd))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (92:6): [True: 541, False: 699]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 7671|  38.8k|                    xmlParseTextDecl(ctxt);
 7672|  38.8k|                }
 7673|  88.8k|            }
 7674|  95.8k|	}
 7675|  98.0k|    }
 7676|   142k|}
parser.c:xmlErrAttributeDup:
  238|  48.7k|{
  239|  48.7k|    if (prefix == NULL)
  ------------------
  |  Branch (239:9): [True: 12.8k, False: 35.8k]
  ------------------
  240|  12.8k|        xmlCtxtErr(ctxt, NULL, XML_FROM_PARSER, XML_ERR_ATTRIBUTE_REDEFINED,
  241|  12.8k|                   XML_ERR_FATAL, localname, NULL, NULL, 0,
  242|  12.8k|                   "Attribute %s redefined\n", localname);
  243|  35.8k|    else
  244|  35.8k|        xmlCtxtErr(ctxt, NULL, XML_FROM_PARSER, XML_ERR_ATTRIBUTE_REDEFINED,
  245|       |                   XML_ERR_FATAL, prefix, localname, NULL, 0,
  246|  35.8k|                   "Attribute %s:%s redefined\n", prefix, localname);
  247|  48.7k|}
parser.c:xmlParseEndTag1:
 8307|  75.5k|xmlParseEndTag1(xmlParserCtxtPtr ctxt, int line) {
 8308|  75.5k|    const xmlChar *name;
 8309|       |
 8310|  75.5k|    GROW;
  ------------------
  |  | 2271|  75.5k|    if ((!PARSER_PROGRESSIVE(ctxt)) && \
  |  |  ------------------
  |  |  |  |   47|  75.5k|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|  75.5k|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2271:9): [True: 64.3k, False: 11.1k]
  |  |  ------------------
  |  | 2272|  75.5k|        (ctxt->input->end - ctxt->input->cur < INPUT_CHUNK)) \
  |  |  ------------------
  |  |  |  |   63|  64.3k|#define INPUT_CHUNK	250
  |  |  ------------------
  |  |  |  Branch (2272:9): [True: 8.28k, False: 56.0k]
  |  |  ------------------
  |  | 2273|  75.5k|	xmlParserGrow(ctxt);
  ------------------
 8311|  75.5k|    if ((RAW != '<') || (NXT(1) != '/')) {
  ------------------
  |  | 2224|  75.5k|#define RAW (*ctxt->input->cur)
  ------------------
                  if ((RAW != '<') || (NXT(1) != '/')) {
  ------------------
  |  | 2226|  75.5k|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
  |  Branch (8311:9): [True: 20, False: 75.5k]
  |  Branch (8311:25): [True: 14, False: 75.5k]
  ------------------
 8312|     34|	xmlFatalErrMsg(ctxt, XML_ERR_LTSLASH_REQUIRED,
 8313|     34|		       "xmlParseEndTag: '</' not found\n");
 8314|     34|	return;
 8315|     34|    }
 8316|  75.5k|    SKIP(2);
  ------------------
  |  | 2248|  75.5k|#define SKIP(val) do {							\
  |  | 2249|  75.5k|    ctxt->input->cur += (val),ctxt->input->col+=(val);			\
  |  | 2250|  75.5k|    if (*ctxt->input->cur == 0)						\
  |  |  ------------------
  |  |  |  Branch (2250:9): [True: 295, False: 75.2k]
  |  |  ------------------
  |  | 2251|  75.5k|        xmlParserGrow(ctxt);						\
  |  | 2252|  75.5k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2252:12): [Folded, False: 75.5k]
  |  |  ------------------
  ------------------
 8317|       |
 8318|  75.5k|    name = xmlParseNameAndCompare(ctxt,ctxt->name);
 8319|       |
 8320|       |    /*
 8321|       |     * We should definitely be at the ending "S? '>'" part
 8322|       |     */
 8323|  75.5k|    GROW;
  ------------------
  |  | 2271|  75.5k|    if ((!PARSER_PROGRESSIVE(ctxt)) && \
  |  |  ------------------
  |  |  |  |   47|  75.5k|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|  75.5k|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2271:9): [True: 64.3k, False: 11.1k]
  |  |  ------------------
  |  | 2272|  75.5k|        (ctxt->input->end - ctxt->input->cur < INPUT_CHUNK)) \
  |  |  ------------------
  |  |  |  |   63|  64.3k|#define INPUT_CHUNK	250
  |  |  ------------------
  |  |  |  Branch (2272:9): [True: 8.32k, False: 56.0k]
  |  |  ------------------
  |  | 2273|  75.5k|	xmlParserGrow(ctxt);
  ------------------
 8324|  75.5k|    SKIP_BLANKS;
  ------------------
  |  | 2275|  75.5k|#define SKIP_BLANKS xmlSkipBlankChars(ctxt)
  ------------------
 8325|  75.5k|    if ((!IS_BYTE_CHAR(RAW)) || (RAW != '>')) {
  ------------------
  |  |  103|  75.5k|#define IS_BYTE_CHAR(c)	 xmlIsChar_ch(c)
  |  |  ------------------
  |  |  |  |  108|  75.5k|#define xmlIsChar_ch(c)		(((0x9 <= (c)) && ((c) <= 0xa)) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (108:28): [True: 73.2k, False: 2.20k]
  |  |  |  |  |  Branch (108:44): [True: 0, False: 73.2k]
  |  |  |  |  ------------------
  |  |  |  |  109|  75.5k|				 ((c) == 0xd) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (109:6): [True: 0, False: 75.5k]
  |  |  |  |  ------------------
  |  |  |  |  110|  75.5k|				  (0x20 <= (c)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (110:7): [True: 73.1k, False: 2.35k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                  if ((!IS_BYTE_CHAR(RAW)) || (RAW != '>')) {
  ------------------
  |  | 2224|  73.1k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (8325:33): [True: 6.90k, False: 66.2k]
  ------------------
 8326|  9.25k|	xmlFatalErr(ctxt, XML_ERR_GT_REQUIRED, NULL);
 8327|  9.25k|    } else
 8328|  66.2k|	NEXT1;
  ------------------
  |  | 2281|  66.2k|#define NEXT1 {								\
  |  | 2282|  66.2k|	ctxt->input->col++;						\
  |  | 2283|  66.2k|	ctxt->input->cur++;						\
  |  | 2284|  66.2k|	if (*ctxt->input->cur == 0)					\
  |  |  ------------------
  |  |  |  Branch (2284:6): [True: 1.24k, False: 64.9k]
  |  |  ------------------
  |  | 2285|  66.2k|	    xmlParserGrow(ctxt);						\
  |  | 2286|  66.2k|    }
  ------------------
 8329|       |
 8330|       |    /*
 8331|       |     * [ WFC: Element Type Match ]
 8332|       |     * The Name in an element's end-tag must match the element type in the
 8333|       |     * start-tag.
 8334|       |     *
 8335|       |     */
 8336|  75.5k|    if (name != (xmlChar*)1) {
  ------------------
  |  Branch (8336:9): [True: 6.98k, False: 68.5k]
  ------------------
 8337|  6.98k|        if (name == NULL) name = BAD_CAST "unparsable";
  ------------------
  |  |   34|  1.73k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (8337:13): [True: 1.73k, False: 5.24k]
  ------------------
 8338|  6.98k|        xmlFatalErrMsgStrIntStr(ctxt, XML_ERR_TAG_NAME_MISMATCH,
 8339|  6.98k|		     "Opening and ending tag mismatch: %s line %d and %s\n",
 8340|  6.98k|		                ctxt->name, line, name);
 8341|  6.98k|    }
 8342|       |
 8343|       |    /*
 8344|       |     * SAX: End of Tag
 8345|       |     */
 8346|  75.5k|    if ((ctxt->sax != NULL) && (ctxt->sax->endElement != NULL) &&
  ------------------
  |  Branch (8346:9): [True: 75.5k, False: 0]
  |  Branch (8346:32): [True: 75.5k, False: 0]
  ------------------
 8347|  75.5k|	(!ctxt->disableSAX))
  ------------------
  |  Branch (8347:2): [True: 66.4k, False: 9.08k]
  ------------------
 8348|  66.4k|        ctxt->sax->endElement(ctxt->userData, ctxt->name);
 8349|       |
 8350|  75.5k|    namePop(ctxt);
 8351|  75.5k|    spacePop(ctxt);
 8352|  75.5k|}
parser.c:xmlParseNameAndCompare:
 3303|   309k|xmlParseNameAndCompare(xmlParserCtxtPtr ctxt, xmlChar const *other) {
 3304|   309k|    register const xmlChar *cmp = other;
 3305|   309k|    register const xmlChar *in;
 3306|   309k|    const xmlChar *ret;
 3307|       |
 3308|   309k|    GROW;
  ------------------
  |  | 2271|   309k|    if ((!PARSER_PROGRESSIVE(ctxt)) && \
  |  |  ------------------
  |  |  |  |   47|   309k|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|   309k|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2271:9): [True: 282k, False: 27.5k]
  |  |  ------------------
  |  | 2272|   309k|        (ctxt->input->end - ctxt->input->cur < INPUT_CHUNK)) \
  |  |  ------------------
  |  |  |  |   63|   282k|#define INPUT_CHUNK	250
  |  |  ------------------
  |  |  |  Branch (2272:9): [True: 16.2k, False: 266k]
  |  |  ------------------
  |  | 2273|   309k|	xmlParserGrow(ctxt);
  ------------------
 3309|       |
 3310|   309k|    in = ctxt->input->cur;
 3311|   676k|    while (*in != 0 && *in == *cmp) {
  ------------------
  |  Branch (3311:12): [True: 672k, False: 4.19k]
  |  Branch (3311:24): [True: 367k, False: 305k]
  ------------------
 3312|   367k|	++in;
 3313|   367k|	++cmp;
 3314|   367k|    }
 3315|   309k|    if (*cmp == 0 && (*in == '>' || IS_BLANK_CH (*in))) {
  ------------------
  |  |  137|  15.7k|#define IS_BLANK_CH(c)  xmlIsBlank_ch(c)
  |  |  ------------------
  |  |  |  |   90|  15.7k|#define xmlIsBlank_ch(c)	(((c) == 0x20) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (90:27): [True: 559, False: 15.2k]
  |  |  |  |  ------------------
  |  |  |  |   91|  15.7k|				 ((0x9 <= (c)) && ((c) <= 0xa)) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (91:7): [True: 12.4k, False: 2.79k]
  |  |  |  |  |  Branch (91:23): [True: 2.94k, False: 9.49k]
  |  |  |  |  ------------------
  |  |  |  |   92|  15.7k|				 ((c) == 0xd))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (92:6): [True: 3.23k, False: 9.05k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (3315:9): [True: 292k, False: 17.1k]
  |  Branch (3315:23): [True: 277k, False: 15.7k]
  ------------------
 3316|       |	/* success */
 3317|   283k|	ctxt->input->col += in - ctxt->input->cur;
 3318|   283k|	ctxt->input->cur = in;
 3319|   283k|	return (const xmlChar*) 1;
 3320|   283k|    }
 3321|       |    /* failure (or end of input buffer), check with full function */
 3322|  26.1k|    ret = xmlParseName (ctxt);
 3323|       |    /* strings coming from the dictionary direct compare possible */
 3324|  26.1k|    if (ret == other) {
  ------------------
  |  Branch (3324:9): [True: 6.37k, False: 19.8k]
  ------------------
 3325|  6.37k|	return (const xmlChar*) 1;
 3326|  6.37k|    }
 3327|  19.8k|    return ret;
 3328|  26.1k|}
parser.c:namePop:
 2138|   604k|{
 2139|   604k|    const xmlChar *ret;
 2140|       |
 2141|   604k|    if ((ctxt == NULL) || (ctxt->nameNr <= 0))
  ------------------
  |  Branch (2141:9): [True: 0, False: 604k]
  |  Branch (2141:27): [True: 2, False: 604k]
  ------------------
 2142|      2|        return (NULL);
 2143|   604k|    ctxt->nameNr--;
 2144|   604k|    if (ctxt->nameNr > 0)
  ------------------
  |  Branch (2144:9): [True: 597k, False: 7.10k]
  ------------------
 2145|   597k|        ctxt->name = ctxt->nameTab[ctxt->nameNr - 1];
 2146|  7.10k|    else
 2147|  7.10k|        ctxt->name = NULL;
 2148|   604k|    ret = ctxt->nameTab[ctxt->nameNr];
 2149|       |    ctxt->nameTab[ctxt->nameNr] = NULL;
 2150|   604k|    return (ret);
 2151|   604k|}
parser.c:spacePop:
 2179|   793k|static int spacePop(xmlParserCtxtPtr ctxt) {
 2180|   793k|    int ret;
 2181|   793k|    if (ctxt->spaceNr <= 0) return(0);
  ------------------
  |  Branch (2181:9): [True: 0, False: 793k]
  ------------------
 2182|   793k|    ctxt->spaceNr--;
 2183|   793k|    if (ctxt->spaceNr > 0)
  ------------------
  |  Branch (2183:9): [True: 793k, False: 13]
  ------------------
 2184|   793k|	ctxt->space = &ctxt->spaceTab[ctxt->spaceNr - 1];
 2185|     13|    else
 2186|     13|        ctxt->space = &ctxt->spaceTab[0];
 2187|   793k|    ret = ctxt->spaceTab[ctxt->spaceNr];
 2188|   793k|    ctxt->spaceTab[ctxt->spaceNr] = -1;
 2189|   793k|    return(ret);
 2190|   793k|}
parser.c:xmlParseContentInternal:
 9540|  8.54k|xmlParseContentInternal(xmlParserCtxtPtr ctxt) {
 9541|  8.54k|    int oldNameNr = ctxt->nameNr;
 9542|  8.54k|    int oldSpaceNr = ctxt->spaceNr;
 9543|  8.54k|    int oldNodeNr = ctxt->nodeNr;
 9544|       |
 9545|  8.54k|    GROW;
  ------------------
  |  | 2271|  8.54k|    if ((!PARSER_PROGRESSIVE(ctxt)) && \
  |  |  ------------------
  |  |  |  |   47|  8.54k|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|  8.54k|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2271:9): [True: 8.54k, False: 0]
  |  |  ------------------
  |  | 2272|  8.54k|        (ctxt->input->end - ctxt->input->cur < INPUT_CHUNK)) \
  |  |  ------------------
  |  |  |  |   63|  8.54k|#define INPUT_CHUNK	250
  |  |  ------------------
  |  |  |  Branch (2272:9): [True: 6.60k, False: 1.93k]
  |  |  ------------------
  |  | 2273|  8.54k|	xmlParserGrow(ctxt);
  ------------------
 9546|  5.10M|    while ((ctxt->input->cur < ctxt->input->end) &&
  ------------------
  |  Branch (9546:12): [True: 5.10M, False: 4.64k]
  ------------------
 9547|  5.10M|	   (PARSER_STOPPED(ctxt) == 0)) {
  ------------------
  |  |   44|  5.10M|#define PARSER_STOPPED(ctxt) ((ctxt)->disableSAX > 1)
  ------------------
  |  Branch (9547:5): [True: 5.10M, False: 417]
  ------------------
 9548|  5.10M|	const xmlChar *cur = ctxt->input->cur;
 9549|       |
 9550|       |	/*
 9551|       |	 * First case : a Processing Instruction.
 9552|       |	 */
 9553|  5.10M|	if ((*cur == '<') && (cur[1] == '?')) {
  ------------------
  |  Branch (9553:6): [True: 999k, False: 4.10M]
  |  Branch (9553:23): [True: 36.6k, False: 962k]
  ------------------
 9554|  36.6k|	    xmlParsePI(ctxt);
 9555|  36.6k|	}
 9556|       |
 9557|       |	/*
 9558|       |	 * Second case : a CDSection
 9559|       |	 */
 9560|       |	/* 2.6.0 test was *cur not RAW */
 9561|  5.06M|	else if (CMP9(CUR_PTR, '<', '!', '[', 'C', 'D', 'A', 'T', 'A', '[')) {
  ------------------
  |  | 2242|  5.06M|  ( CMP8( s, c1, c2, c3, c4, c5, c6, c7, c8 ) && \
  |  |  ------------------
  |  |  |  | 2240|  10.1M|  ( CMP7( s, c1, c2, c3, c4, c5, c6, c7 ) && ((unsigned char *) s)[ 7 ] == c8 )
  |  |  |  |  ------------------
  |  |  |  |  |  | 2238|  10.1M|  ( CMP6( s, c1, c2, c3, c4, c5, c6 ) && ((unsigned char *) s)[ 6 ] == c7 )
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  | 2236|  10.1M|  ( CMP5( s, c1, c2, c3, c4, c5 ) && ((unsigned char *) s)[ 5 ] == c6 )
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  | 2234|  10.1M|  ( CMP4( s, c1, c2, c3, c4 ) && ((unsigned char *) s)[ 4 ] == c5 )
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  | 2231|  10.1M|  ( ((unsigned char *) s)[ 0 ] == c1 && ((unsigned char *) s)[ 1 ] == c2 && \
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  Branch (2231:5): [True: 962k, False: 4.10M]
  |  |  |  |  |  |  |  |  |  |  |  |  |  Branch (2231:41): [True: 70.8k, False: 892k]
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  | 2232|  5.06M|    ((unsigned char *) s)[ 2 ] == c3 && ((unsigned char *) s)[ 3 ] == c4 )
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  Branch (2232:5): [True: 33.9k, False: 36.8k]
  |  |  |  |  |  |  |  |  |  |  |  |  |  Branch (2232:41): [True: 32.4k, False: 1.55k]
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (2234:34): [True: 31.4k, False: 918]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (2236:38): [True: 31.0k, False: 428]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (2238:42): [True: 27.6k, False: 3.42k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2240:46): [True: 27.5k, False: 138]
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 2243|  5.06M|    ((unsigned char *) s)[ 8 ] == c9 )
  |  |  ------------------
  |  |  |  Branch (2243:5): [True: 26.9k, False: 542]
  |  |  ------------------
  ------------------
 9562|  26.9k|	    xmlParseCDSect(ctxt);
 9563|  26.9k|	}
 9564|       |
 9565|       |	/*
 9566|       |	 * Third case :  a comment
 9567|       |	 */
 9568|  5.03M|	else if ((*cur == '<') && (NXT(1) == '!') &&
  ------------------
  |  | 2226|   935k|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
  |  Branch (9568:11): [True: 935k, False: 4.10M]
  |  Branch (9568:28): [True: 43.8k, False: 892k]
  ------------------
 9569|  43.8k|		 (NXT(2) == '-') && (NXT(3) == '-')) {
  ------------------
  |  | 2226|  43.8k|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
              		 (NXT(2) == '-') && (NXT(3) == '-')) {
  ------------------
  |  | 2226|  17.0k|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
  |  Branch (9569:4): [True: 17.0k, False: 26.8k]
  |  Branch (9569:23): [True: 16.7k, False: 274]
  ------------------
 9570|  16.7k|	    xmlParseComment(ctxt);
 9571|  16.7k|	}
 9572|       |
 9573|       |	/*
 9574|       |	 * Fourth case :  a sub-element.
 9575|       |	 */
 9576|  5.01M|	else if (*cur == '<') {
  ------------------
  |  Branch (9576:11): [True: 919k, False: 4.10M]
  ------------------
 9577|   919k|            if (NXT(1) == '/') {
  ------------------
  |  | 2226|   919k|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
  |  Branch (9577:17): [True: 294k, False: 624k]
  ------------------
 9578|   294k|                if (ctxt->nameNr <= oldNameNr)
  ------------------
  |  Branch (9578:21): [True: 3.48k, False: 291k]
  ------------------
 9579|  3.48k|                    break;
 9580|   291k|	        xmlParseElementEnd(ctxt);
 9581|   624k|            } else {
 9582|   624k|	        xmlParseElementStart(ctxt);
 9583|   624k|            }
 9584|   919k|	}
 9585|       |
 9586|       |	/*
 9587|       |	 * Fifth case : a reference. If if has not been resolved,
 9588|       |	 *    parsing returns it's Name, create the node
 9589|       |	 */
 9590|       |
 9591|  4.10M|	else if (*cur == '&') {
  ------------------
  |  Branch (9591:11): [True: 85.3k, False: 4.01M]
  ------------------
 9592|  85.3k|	    xmlParseReference(ctxt);
 9593|  85.3k|	}
 9594|       |
 9595|       |	/*
 9596|       |	 * Last case, text. Note that References are handled directly.
 9597|       |	 */
 9598|  4.01M|	else {
 9599|  4.01M|	    xmlParseCharDataInternal(ctxt, 0);
 9600|  4.01M|	}
 9601|       |
 9602|  5.09M|	SHRINK;
  ------------------
  |  | 2267|  5.09M|    if (!PARSER_PROGRESSIVE(ctxt)) \
  |  |  ------------------
  |  |  |  |   47|  5.09M|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|  5.09M|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2267:9): [True: 5.09M, False: 0]
  |  |  ------------------
  |  | 2268|  5.09M|	xmlParserShrink(ctxt);
  ------------------
 9603|  5.09M|	GROW;
  ------------------
  |  | 2271|  5.09M|    if ((!PARSER_PROGRESSIVE(ctxt)) && \
  |  |  ------------------
  |  |  |  |   47|  5.09M|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|  5.09M|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2271:9): [True: 5.09M, False: 0]
  |  |  ------------------
  |  | 2272|  5.09M|        (ctxt->input->end - ctxt->input->cur < INPUT_CHUNK)) \
  |  |  ------------------
  |  |  |  |   63|  5.09M|#define INPUT_CHUNK	250
  |  |  ------------------
  |  |  |  Branch (2272:9): [True: 109k, False: 4.98M]
  |  |  ------------------
  |  | 2273|  5.09M|	xmlParserGrow(ctxt);
  ------------------
 9604|  5.09M|    }
 9605|       |
 9606|  8.54k|    if ((ctxt->nameNr > oldNameNr) &&
  ------------------
  |  Branch (9606:9): [True: 1.33k, False: 7.21k]
  ------------------
 9607|  1.33k|        (ctxt->input->cur >= ctxt->input->end) &&
  ------------------
  |  Branch (9607:9): [True: 1.15k, False: 178]
  ------------------
 9608|  1.15k|        (ctxt->wellFormed)) {
  ------------------
  |  Branch (9608:9): [True: 28, False: 1.12k]
  ------------------
 9609|     28|        const xmlChar *name = ctxt->nameTab[ctxt->nameNr - 1];
 9610|     28|        int line = ctxt->pushTab[ctxt->nameNr - 1].line;
 9611|     28|        xmlFatalErrMsgStrIntStr(ctxt, XML_ERR_TAG_NOT_FINISHED,
 9612|     28|                "Premature end of data in tag %s line %d\n",
 9613|     28|                name, line, NULL);
 9614|     28|    }
 9615|       |
 9616|       |    /*
 9617|       |     * Clean up in error case
 9618|       |     */
 9619|       |
 9620|  65.3k|    while (ctxt->nodeNr > oldNodeNr)
  ------------------
  |  Branch (9620:12): [True: 56.8k, False: 8.54k]
  ------------------
 9621|  56.8k|        nodePop(ctxt);
 9622|       |
 9623|  96.5k|    while (ctxt->nameNr > oldNameNr) {
  ------------------
  |  Branch (9623:12): [True: 88.0k, False: 8.54k]
  ------------------
 9624|  88.0k|        xmlStartTag *tag = &ctxt->pushTab[ctxt->nameNr - 1];
 9625|       |
 9626|  88.0k|        if (tag->nsNr != 0)
  ------------------
  |  Branch (9626:13): [True: 18.8k, False: 69.2k]
  ------------------
 9627|  18.8k|            xmlParserNsPop(ctxt, tag->nsNr);
 9628|       |
 9629|  88.0k|        namePop(ctxt);
 9630|  88.0k|    }
 9631|       |
 9632|  96.5k|    while (ctxt->spaceNr > oldSpaceNr)
  ------------------
  |  Branch (9632:12): [True: 88.0k, False: 8.54k]
  ------------------
 9633|  88.0k|        spacePop(ctxt);
 9634|  8.54k|}
parser.c:xmlFatalErrMsgStrIntStr:
  332|   139k|{
  333|   139k|    xmlCtxtErr(ctxt, NULL, XML_FROM_PARSER, error, XML_ERR_FATAL,
  334|       |               str1, str2, NULL, val, msg, str1, val, str2);
  335|   139k|}
parser.c:xmlParseElementStart:
 9699|   631k|xmlParseElementStart(xmlParserCtxtPtr ctxt) {
 9700|   631k|    int maxDepth = (ctxt->options & XML_PARSE_HUGE) ? 2048 : 256;
  ------------------
  |  Branch (9700:20): [True: 403k, False: 227k]
  ------------------
 9701|   631k|    const xmlChar *name;
 9702|   631k|    const xmlChar *prefix = NULL;
 9703|   631k|    const xmlChar *URI = NULL;
 9704|   631k|    xmlParserNodeInfo node_info;
 9705|   631k|    int line;
 9706|   631k|    xmlNodePtr cur;
 9707|   631k|    int nbNs = 0;
 9708|       |
 9709|   631k|    if (ctxt->nameNr > maxDepth) {
  ------------------
  |  Branch (9709:9): [True: 12, False: 631k]
  ------------------
 9710|     12|        xmlFatalErrMsgInt(ctxt, XML_ERR_RESOURCE_LIMIT,
 9711|     12|                "Excessive depth in document: %d use XML_PARSE_HUGE option\n",
 9712|     12|                ctxt->nameNr);
 9713|     12|	return(-1);
 9714|     12|    }
 9715|       |
 9716|       |    /* Capture start position */
 9717|   631k|    if (ctxt->record_info) {
  ------------------
  |  Branch (9717:9): [True: 0, False: 631k]
  ------------------
 9718|      0|        node_info.begin_pos = ctxt->input->consumed +
 9719|      0|                          (CUR_PTR - ctxt->input->base);
  ------------------
  |  | 2227|      0|#define CUR_PTR ctxt->input->cur
  ------------------
 9720|      0|	node_info.begin_line = ctxt->input->line;
 9721|      0|    }
 9722|       |
 9723|   631k|    if (ctxt->spaceNr == 0)
  ------------------
  |  Branch (9723:9): [True: 0, False: 631k]
  ------------------
 9724|      0|	spacePush(ctxt, -1);
 9725|   631k|    else if (*ctxt->space == -2)
  ------------------
  |  Branch (9725:14): [True: 108k, False: 522k]
  ------------------
 9726|   108k|	spacePush(ctxt, -1);
 9727|   522k|    else
 9728|   522k|	spacePush(ctxt, *ctxt->space);
 9729|       |
 9730|   631k|    line = ctxt->input->line;
 9731|   631k|#ifdef LIBXML_SAX1_ENABLED
 9732|   631k|    if (ctxt->sax2)
  ------------------
  |  Branch (9732:9): [True: 419k, False: 211k]
  ------------------
 9733|   419k|#endif /* LIBXML_SAX1_ENABLED */
 9734|   419k|        name = xmlParseStartTag2(ctxt, &prefix, &URI, &nbNs);
 9735|   211k|#ifdef LIBXML_SAX1_ENABLED
 9736|   211k|    else
 9737|   211k|	name = xmlParseStartTag(ctxt);
 9738|   631k|#endif /* LIBXML_SAX1_ENABLED */
 9739|   631k|    if (name == NULL) {
  ------------------
  |  Branch (9739:9): [True: 42.2k, False: 588k]
  ------------------
 9740|  42.2k|	spacePop(ctxt);
 9741|  42.2k|        return(-1);
 9742|  42.2k|    }
 9743|   588k|    nameNsPush(ctxt, name, prefix, URI, line, nbNs);
 9744|   588k|    cur = ctxt->node;
 9745|       |
 9746|   588k|#ifdef LIBXML_VALID_ENABLED
 9747|       |    /*
 9748|       |     * [ VC: Root Element Type ]
 9749|       |     * The Name in the document type declaration must match the element
 9750|       |     * type of the root element.
 9751|       |     */
 9752|   588k|    if (ctxt->validate && ctxt->wellFormed && ctxt->myDoc &&
  ------------------
  |  Branch (9752:9): [True: 175k, False: 413k]
  |  Branch (9752:27): [True: 6.20k, False: 169k]
  |  Branch (9752:47): [True: 6.20k, False: 0]
  ------------------
 9753|  6.20k|        ctxt->node && (ctxt->node == ctxt->myDoc->children))
  ------------------
  |  Branch (9753:9): [True: 6.20k, False: 0]
  |  Branch (9753:23): [True: 0, False: 6.20k]
  ------------------
 9754|      0|        ctxt->valid &= xmlValidateRoot(&ctxt->vctxt, ctxt->myDoc);
 9755|   588k|#endif /* LIBXML_VALID_ENABLED */
 9756|       |
 9757|       |    /*
 9758|       |     * Check for an Empty Element.
 9759|       |     */
 9760|   588k|    if ((RAW == '/') && (NXT(1) == '>')) {
  ------------------
  |  | 2224|   588k|#define RAW (*ctxt->input->cur)
  ------------------
                  if ((RAW == '/') && (NXT(1) == '>')) {
  ------------------
  |  | 2226|   104k|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
  |  Branch (9760:9): [True: 104k, False: 484k]
  |  Branch (9760:25): [True: 96.4k, False: 7.68k]
  ------------------
 9761|  96.4k|        SKIP(2);
  ------------------
  |  | 2248|  96.4k|#define SKIP(val) do {							\
  |  | 2249|  96.4k|    ctxt->input->cur += (val),ctxt->input->col+=(val);			\
  |  | 2250|  96.4k|    if (*ctxt->input->cur == 0)						\
  |  |  ------------------
  |  |  |  Branch (2250:9): [True: 720, False: 95.7k]
  |  |  ------------------
  |  | 2251|  96.4k|        xmlParserGrow(ctxt);						\
  |  | 2252|  96.4k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2252:12): [Folded, False: 96.4k]
  |  |  ------------------
  ------------------
 9762|  96.4k|	if (ctxt->sax2) {
  ------------------
  |  Branch (9762:6): [True: 41.5k, False: 54.9k]
  ------------------
 9763|  41.5k|	    if ((ctxt->sax != NULL) && (ctxt->sax->endElementNs != NULL) &&
  ------------------
  |  Branch (9763:10): [True: 41.5k, False: 0]
  |  Branch (9763:33): [True: 41.5k, False: 0]
  ------------------
 9764|  41.5k|		(!ctxt->disableSAX))
  ------------------
  |  Branch (9764:3): [True: 28.2k, False: 13.2k]
  ------------------
 9765|  28.2k|		ctxt->sax->endElementNs(ctxt->userData, name, prefix, URI);
 9766|  41.5k|#ifdef LIBXML_SAX1_ENABLED
 9767|  54.9k|	} else {
 9768|  54.9k|	    if ((ctxt->sax != NULL) && (ctxt->sax->endElement != NULL) &&
  ------------------
  |  Branch (9768:10): [True: 54.9k, False: 0]
  |  Branch (9768:33): [True: 54.9k, False: 0]
  ------------------
 9769|  54.9k|		(!ctxt->disableSAX))
  ------------------
  |  Branch (9769:3): [True: 43.1k, False: 11.7k]
  ------------------
 9770|  43.1k|		ctxt->sax->endElement(ctxt->userData, name);
 9771|  54.9k|#endif /* LIBXML_SAX1_ENABLED */
 9772|  54.9k|	}
 9773|  96.4k|	namePop(ctxt);
 9774|  96.4k|	spacePop(ctxt);
 9775|  96.4k|	if (nbNs > 0)
  ------------------
  |  Branch (9775:6): [True: 7.87k, False: 88.5k]
  ------------------
 9776|  7.87k|	    xmlParserNsPop(ctxt, nbNs);
 9777|  96.4k|	if (cur != NULL && ctxt->record_info) {
  ------------------
  |  Branch (9777:6): [True: 72.1k, False: 24.2k]
  |  Branch (9777:21): [True: 0, False: 72.1k]
  ------------------
 9778|      0|            node_info.node = cur;
 9779|      0|            node_info.end_pos = ctxt->input->consumed +
 9780|      0|                                (CUR_PTR - ctxt->input->base);
  ------------------
  |  | 2227|      0|#define CUR_PTR ctxt->input->cur
  ------------------
 9781|      0|            node_info.end_line = ctxt->input->line;
 9782|      0|            xmlParserAddNodeInfo(ctxt, &node_info);
 9783|      0|	}
 9784|  96.4k|	return(1);
 9785|  96.4k|    }
 9786|   492k|    if (RAW == '>') {
  ------------------
  |  | 2224|   492k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (9786:9): [True: 383k, False: 109k]
  ------------------
 9787|   383k|        NEXT1;
  ------------------
  |  | 2281|   383k|#define NEXT1 {								\
  |  | 2282|   383k|	ctxt->input->col++;						\
  |  | 2283|   383k|	ctxt->input->cur++;						\
  |  | 2284|   383k|	if (*ctxt->input->cur == 0)					\
  |  |  ------------------
  |  |  |  Branch (2284:6): [True: 726, False: 382k]
  |  |  ------------------
  |  | 2285|   383k|	    xmlParserGrow(ctxt);						\
  |  | 2286|   383k|    }
  ------------------
 9788|   383k|        if (cur != NULL && ctxt->record_info) {
  ------------------
  |  Branch (9788:13): [True: 283k, False: 99.5k]
  |  Branch (9788:28): [True: 0, False: 283k]
  ------------------
 9789|      0|            node_info.node = cur;
 9790|      0|            node_info.end_pos = 0;
 9791|      0|            node_info.end_line = 0;
 9792|      0|            xmlParserAddNodeInfo(ctxt, &node_info);
 9793|      0|        }
 9794|   383k|    } else {
 9795|   109k|        xmlFatalErrMsgStrIntStr(ctxt, XML_ERR_GT_REQUIRED,
 9796|   109k|		     "Couldn't find end of Start Tag %s line %d\n",
 9797|   109k|		                name, line, NULL);
 9798|       |
 9799|       |	/*
 9800|       |	 * end of parsing of this node.
 9801|       |	 */
 9802|   109k|	nodePop(ctxt);
 9803|   109k|	namePop(ctxt);
 9804|   109k|	spacePop(ctxt);
 9805|   109k|	if (nbNs > 0)
  ------------------
  |  Branch (9805:6): [True: 35.1k, False: 74.1k]
  ------------------
 9806|  35.1k|	    xmlParserNsPop(ctxt, nbNs);
 9807|   109k|	return(-1);
 9808|   109k|    }
 9809|       |
 9810|   383k|    return(0);
 9811|   492k|}
parser.c:spacePush:
 2153|   907k|static int spacePush(xmlParserCtxtPtr ctxt, int val) {
 2154|   907k|    if (ctxt->spaceNr >= ctxt->spaceMax) {
  ------------------
  |  Branch (2154:9): [True: 70.9k, False: 837k]
  ------------------
 2155|  70.9k|        int *tmp;
 2156|  70.9k|        int newSize;
 2157|       |
 2158|  70.9k|        newSize = xmlGrowCapacity(ctxt->spaceMax, sizeof(tmp[0]),
 2159|  70.9k|                                  10, XML_MAX_ITEMS);
  ------------------
  |  |   13|  70.9k|#define XML_MAX_ITEMS 1000000000 /* 1 billion */
  ------------------
 2160|  70.9k|        if (newSize < 0) {
  ------------------
  |  Branch (2160:13): [True: 0, False: 70.9k]
  ------------------
 2161|      0|	    xmlErrMemory(ctxt);
 2162|      0|	    return(-1);
 2163|      0|        }
 2164|       |
 2165|  70.9k|        tmp = xmlRealloc(ctxt->spaceTab, newSize * sizeof(tmp[0]));
 2166|  70.9k|        if (tmp == NULL) {
  ------------------
  |  Branch (2166:13): [True: 42, False: 70.8k]
  ------------------
 2167|     42|	    xmlErrMemory(ctxt);
 2168|     42|	    return(-1);
 2169|     42|	}
 2170|  70.8k|	ctxt->spaceTab = tmp;
 2171|       |
 2172|  70.8k|        ctxt->spaceMax = newSize;
 2173|  70.8k|    }
 2174|   907k|    ctxt->spaceTab[ctxt->spaceNr] = val;
 2175|   907k|    ctxt->space = &ctxt->spaceTab[ctxt->spaceNr];
 2176|   907k|    return(ctxt->spaceNr++);
 2177|   907k|}
parser.c:xmlParseStartTag2:
 8751|   603k|                  const xmlChar **URI, int *nbNsPtr) {
 8752|   603k|    xmlHashedString hlocalname;
 8753|   603k|    xmlHashedString hprefix;
 8754|   603k|    xmlHashedString hattname;
 8755|   603k|    xmlHashedString haprefix;
 8756|   603k|    const xmlChar *localname;
 8757|   603k|    const xmlChar *prefix;
 8758|   603k|    const xmlChar *attname;
 8759|   603k|    const xmlChar *aprefix;
 8760|   603k|    const xmlChar *uri;
 8761|   603k|    xmlChar *attvalue = NULL;
 8762|   603k|    const xmlChar **atts = ctxt->atts;
 8763|   603k|    unsigned attrHashSize = 0;
 8764|   603k|    int maxatts = ctxt->maxatts;
 8765|   603k|    int nratts, nbatts, nbdef;
 8766|   603k|    int i, j, nbNs, nbTotalDef, attval, nsIndex, maxAtts;
 8767|   603k|    int alloc = 0;
 8768|   603k|    int numNsErr = 0;
 8769|   603k|    int numDupErr = 0;
 8770|       |
 8771|   603k|    if (RAW != '<') return(NULL);
  ------------------
  |  | 2224|   603k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (8771:9): [True: 0, False: 603k]
  ------------------
 8772|   603k|    NEXT1;
  ------------------
  |  | 2281|   603k|#define NEXT1 {								\
  |  | 2282|   603k|	ctxt->input->col++;						\
  |  | 2283|   603k|	ctxt->input->cur++;						\
  |  | 2284|   603k|	if (*ctxt->input->cur == 0)					\
  |  |  ------------------
  |  |  |  Branch (2284:6): [True: 926, False: 602k]
  |  |  ------------------
  |  | 2285|   603k|	    xmlParserGrow(ctxt);						\
  |  | 2286|   603k|    }
  ------------------
 8773|       |
 8774|   603k|    nbatts = 0;
 8775|   603k|    nratts = 0;
 8776|   603k|    nbdef = 0;
 8777|   603k|    nbNs = 0;
 8778|   603k|    nbTotalDef = 0;
 8779|   603k|    attval = 0;
 8780|       |
 8781|   603k|    if (xmlParserNsStartElement(ctxt->nsdb) < 0) {
  ------------------
  |  Branch (8781:9): [True: 0, False: 603k]
  ------------------
 8782|      0|        xmlErrMemory(ctxt);
 8783|      0|        return(NULL);
 8784|      0|    }
 8785|       |
 8786|   603k|    hlocalname = xmlParseQNameHashed(ctxt, &hprefix);
 8787|   603k|    if (hlocalname.name == NULL) {
  ------------------
  |  Branch (8787:9): [True: 29.5k, False: 573k]
  ------------------
 8788|  29.5k|	xmlFatalErrMsg(ctxt, XML_ERR_NAME_REQUIRED,
 8789|  29.5k|		       "StartTag: invalid element name\n");
 8790|  29.5k|        return(NULL);
 8791|  29.5k|    }
 8792|   573k|    localname = hlocalname.name;
 8793|   573k|    prefix = hprefix.name;
 8794|       |
 8795|       |    /*
 8796|       |     * Now parse the attributes, it ends up with the ending
 8797|       |     *
 8798|       |     * (S Attribute)* S?
 8799|       |     */
 8800|   573k|    SKIP_BLANKS;
  ------------------
  |  | 2275|   573k|#define SKIP_BLANKS xmlSkipBlankChars(ctxt)
  ------------------
 8801|   573k|    GROW;
  ------------------
  |  | 2271|   573k|    if ((!PARSER_PROGRESSIVE(ctxt)) && \
  |  |  ------------------
  |  |  |  |   47|   573k|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|   573k|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2271:9): [True: 391k, False: 182k]
  |  |  ------------------
  |  | 2272|   573k|        (ctxt->input->end - ctxt->input->cur < INPUT_CHUNK)) \
  |  |  ------------------
  |  |  |  |   63|   391k|#define INPUT_CHUNK	250
  |  |  ------------------
  |  |  |  Branch (2272:9): [True: 25.0k, False: 366k]
  |  |  ------------------
  |  | 2273|   573k|	xmlParserGrow(ctxt);
  ------------------
 8802|       |
 8803|       |    /*
 8804|       |     * The ctxt->atts array will be ultimately passed to the SAX callback
 8805|       |     * containing five xmlChar pointers for each attribute:
 8806|       |     *
 8807|       |     * [0] attribute name
 8808|       |     * [1] attribute prefix
 8809|       |     * [2] namespace URI
 8810|       |     * [3] attribute value
 8811|       |     * [4] end of attribute value
 8812|       |     *
 8813|       |     * To save memory, we reuse this array temporarily and store integers
 8814|       |     * in these pointer variables.
 8815|       |     *
 8816|       |     * [0] attribute name
 8817|       |     * [1] attribute prefix
 8818|       |     * [2] hash value of attribute prefix, and later namespace index
 8819|       |     * [3] for non-allocated values: ptrdiff_t offset into input buffer
 8820|       |     * [4] for non-allocated values: ptrdiff_t offset into input buffer
 8821|       |     *
 8822|       |     * The ctxt->attallocs array contains an additional unsigned int for
 8823|       |     * each attribute, containing the hash value of the attribute name
 8824|       |     * and the alloc flag in bit 31.
 8825|       |     */
 8826|       |
 8827|   655k|    while (((RAW != '>') &&
  ------------------
  |  | 2224|   655k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (8827:13): [True: 323k, False: 331k]
  ------------------
 8828|   323k|	   ((RAW != '/') || (NXT(1) != '>')) &&
  ------------------
  |  | 2224|   323k|#define RAW (*ctxt->input->cur)
  ------------------
              	   ((RAW != '/') || (NXT(1) != '>')) &&
  ------------------
  |  | 2226|  98.0k|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
  |  Branch (8828:6): [True: 225k, False: 98.0k]
  |  Branch (8828:22): [True: 4.66k, False: 93.4k]
  ------------------
 8829|   230k|	   (IS_BYTE_CHAR(RAW))) && (PARSER_STOPPED(ctxt) == 0)) {
  ------------------
  |  |  103|   230k|#define IS_BYTE_CHAR(c)	 xmlIsChar_ch(c)
  |  |  ------------------
  |  |  |  |  108|   230k|#define xmlIsChar_ch(c)		(((0x9 <= (c)) && ((c) <= 0xa)) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (108:28): [True: 217k, False: 12.0k]
  |  |  |  |  |  Branch (108:44): [True: 0, False: 217k]
  |  |  |  |  ------------------
  |  |  |  |  109|   230k|				 ((c) == 0xd) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (109:6): [True: 0, False: 230k]
  |  |  |  |  ------------------
  |  |  |  |  110|   230k|				  (0x20 <= (c)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (110:7): [True: 217k, False: 12.8k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
              	   (IS_BYTE_CHAR(RAW))) && (PARSER_STOPPED(ctxt) == 0)) {
  ------------------
  |  |   44|   217k|#define PARSER_STOPPED(ctxt) ((ctxt)->disableSAX > 1)
  ------------------
  |  Branch (8829:29): [True: 217k, False: 27]
  ------------------
 8830|   217k|	int len = -1;
 8831|       |
 8832|   217k|	hattname = xmlParseAttribute2(ctxt, prefix, localname,
 8833|   217k|                                          &haprefix, &attvalue, &len,
 8834|   217k|                                          &alloc);
 8835|   217k|        if (hattname.name == NULL)
  ------------------
  |  Branch (8835:13): [True: 57.5k, False: 159k]
  ------------------
 8836|  57.5k|	    break;
 8837|   159k|        if (attvalue == NULL)
  ------------------
  |  Branch (8837:13): [True: 20.9k, False: 138k]
  ------------------
 8838|  20.9k|            goto next_attr;
 8839|   138k|        attname = hattname.name;
 8840|   138k|        aprefix = haprefix.name;
 8841|   138k|	if (len < 0) len = xmlStrlen(attvalue);
  ------------------
  |  Branch (8841:6): [True: 0, False: 138k]
  ------------------
 8842|       |
 8843|   138k|        if ((attname == ctxt->str_xmlns) && (aprefix == NULL)) {
  ------------------
  |  Branch (8843:13): [True: 16.7k, False: 121k]
  |  Branch (8843:45): [True: 16.2k, False: 427]
  ------------------
 8844|  16.2k|            xmlHashedString huri;
 8845|  16.2k|            xmlURIPtr parsedUri;
 8846|       |
 8847|  16.2k|            huri = xmlDictLookupHashed(ctxt->dict, attvalue, len);
 8848|  16.2k|            uri = huri.name;
 8849|  16.2k|            if (uri == NULL) {
  ------------------
  |  Branch (8849:17): [True: 1, False: 16.2k]
  ------------------
 8850|      1|                xmlErrMemory(ctxt);
 8851|      1|                goto next_attr;
 8852|      1|            }
 8853|  16.2k|            if (*uri != 0) {
  ------------------
  |  Branch (8853:17): [True: 7.00k, False: 9.29k]
  ------------------
 8854|  7.00k|                if (xmlParseURISafe((const char *) uri, &parsedUri) < 0) {
  ------------------
  |  Branch (8854:21): [True: 17, False: 6.98k]
  ------------------
 8855|     17|                    xmlErrMemory(ctxt);
 8856|     17|                    goto next_attr;
 8857|     17|                }
 8858|  6.98k|                if (parsedUri == NULL) {
  ------------------
  |  Branch (8858:21): [True: 1.48k, False: 5.49k]
  ------------------
 8859|  1.48k|                    xmlNsErr(ctxt, XML_WAR_NS_URI,
 8860|  1.48k|                             "xmlns: '%s' is not a valid URI\n",
 8861|  1.48k|                                       uri, NULL, NULL);
 8862|  5.49k|                } else {
 8863|  5.49k|                    if (parsedUri->scheme == NULL) {
  ------------------
  |  Branch (8863:25): [True: 3.91k, False: 1.58k]
  ------------------
 8864|  3.91k|                        xmlNsWarn(ctxt, XML_WAR_NS_URI_RELATIVE,
 8865|  3.91k|                                  "xmlns: URI %s is not absolute\n",
 8866|  3.91k|                                  uri, NULL, NULL);
 8867|  3.91k|                    }
 8868|  5.49k|                    xmlFreeURI(parsedUri);
 8869|  5.49k|                }
 8870|  6.98k|                if (uri == ctxt->str_xml_ns) {
  ------------------
  |  Branch (8870:21): [True: 226, False: 6.75k]
  ------------------
 8871|    226|                    if (attname != ctxt->str_xml) {
  ------------------
  |  Branch (8871:25): [True: 226, False: 0]
  ------------------
 8872|    226|                        xmlNsErr(ctxt, XML_NS_ERR_XML_NAMESPACE,
 8873|    226|                     "xml namespace URI cannot be the default namespace\n",
 8874|    226|                                 NULL, NULL, NULL);
 8875|    226|                    }
 8876|    226|                    goto next_attr;
 8877|    226|                }
 8878|  6.75k|                if ((len == 29) &&
  ------------------
  |  Branch (8878:21): [True: 572, False: 6.18k]
  ------------------
 8879|    572|                    (xmlStrEqual(uri,
  ------------------
  |  Branch (8879:21): [True: 207, False: 365]
  ------------------
 8880|    572|                             BAD_CAST "http://www.w3.org/2000/xmlns/"))) {
  ------------------
  |  |   34|    572|#define BAD_CAST (xmlChar *)
  ------------------
 8881|    207|                    xmlNsErr(ctxt, XML_NS_ERR_XML_NAMESPACE,
 8882|    207|                         "reuse of the xmlns namespace name is forbidden\n",
 8883|    207|                             NULL, NULL, NULL);
 8884|    207|                    goto next_attr;
 8885|    207|                }
 8886|  6.75k|            }
 8887|       |
 8888|  15.8k|            if (xmlParserNsPush(ctxt, NULL, &huri, NULL, 0) > 0)
  ------------------
  |  Branch (8888:17): [True: 11.7k, False: 4.13k]
  ------------------
 8889|  11.7k|                nbNs++;
 8890|   122k|        } else if (aprefix == ctxt->str_xmlns) {
  ------------------
  |  Branch (8890:20): [True: 23.9k, False: 98.4k]
  ------------------
 8891|  23.9k|            xmlHashedString huri;
 8892|  23.9k|            xmlURIPtr parsedUri;
 8893|       |
 8894|  23.9k|            huri = xmlDictLookupHashed(ctxt->dict, attvalue, len);
 8895|  23.9k|            uri = huri.name;
 8896|  23.9k|            if (uri == NULL) {
  ------------------
  |  Branch (8896:17): [True: 1, False: 23.9k]
  ------------------
 8897|      1|                xmlErrMemory(ctxt);
 8898|      1|                goto next_attr;
 8899|      1|            }
 8900|       |
 8901|  23.9k|            if (attname == ctxt->str_xml) {
  ------------------
  |  Branch (8901:17): [True: 462, False: 23.4k]
  ------------------
 8902|    462|                if (uri != ctxt->str_xml_ns) {
  ------------------
  |  Branch (8902:21): [True: 246, False: 216]
  ------------------
 8903|    246|                    xmlNsErr(ctxt, XML_NS_ERR_XML_NAMESPACE,
 8904|    246|                             "xml namespace prefix mapped to wrong URI\n",
 8905|    246|                             NULL, NULL, NULL);
 8906|    246|                }
 8907|       |                /*
 8908|       |                 * Do not keep a namespace definition node
 8909|       |                 */
 8910|    462|                goto next_attr;
 8911|    462|            }
 8912|  23.4k|            if (uri == ctxt->str_xml_ns) {
  ------------------
  |  Branch (8912:17): [True: 415, False: 23.0k]
  ------------------
 8913|    415|                if (attname != ctxt->str_xml) {
  ------------------
  |  Branch (8913:21): [True: 415, False: 0]
  ------------------
 8914|    415|                    xmlNsErr(ctxt, XML_NS_ERR_XML_NAMESPACE,
 8915|    415|                             "xml namespace URI mapped to wrong prefix\n",
 8916|    415|                             NULL, NULL, NULL);
 8917|    415|                }
 8918|    415|                goto next_attr;
 8919|    415|            }
 8920|  23.0k|            if (attname == ctxt->str_xmlns) {
  ------------------
  |  Branch (8920:17): [True: 384, False: 22.6k]
  ------------------
 8921|    384|                xmlNsErr(ctxt, XML_NS_ERR_XML_NAMESPACE,
 8922|    384|                         "redefinition of the xmlns prefix is forbidden\n",
 8923|    384|                         NULL, NULL, NULL);
 8924|    384|                goto next_attr;
 8925|    384|            }
 8926|  22.6k|            if ((len == 29) &&
  ------------------
  |  Branch (8926:17): [True: 455, False: 22.1k]
  ------------------
 8927|    455|                (xmlStrEqual(uri,
  ------------------
  |  Branch (8927:17): [True: 171, False: 284]
  ------------------
 8928|    455|                             BAD_CAST "http://www.w3.org/2000/xmlns/"))) {
  ------------------
  |  |   34|    455|#define BAD_CAST (xmlChar *)
  ------------------
 8929|    171|                xmlNsErr(ctxt, XML_NS_ERR_XML_NAMESPACE,
 8930|    171|                         "reuse of the xmlns namespace name is forbidden\n",
 8931|    171|                         NULL, NULL, NULL);
 8932|    171|                goto next_attr;
 8933|    171|            }
 8934|  22.4k|            if ((uri == NULL) || (uri[0] == 0)) {
  ------------------
  |  Branch (8934:17): [True: 0, False: 22.4k]
  |  Branch (8934:34): [True: 279, False: 22.2k]
  ------------------
 8935|    279|                xmlNsErr(ctxt, XML_NS_ERR_XML_NAMESPACE,
 8936|    279|                         "xmlns:%s: Empty XML namespace is not allowed\n",
 8937|    279|                              attname, NULL, NULL);
 8938|    279|                goto next_attr;
 8939|  22.2k|            } else {
 8940|  22.2k|                if (xmlParseURISafe((const char *) uri, &parsedUri) < 0) {
  ------------------
  |  Branch (8940:21): [True: 3, False: 22.2k]
  ------------------
 8941|      3|                    xmlErrMemory(ctxt);
 8942|      3|                    goto next_attr;
 8943|      3|                }
 8944|  22.2k|                if (parsedUri == NULL) {
  ------------------
  |  Branch (8944:21): [True: 6.65k, False: 15.5k]
  ------------------
 8945|  6.65k|                    xmlNsErr(ctxt, XML_WAR_NS_URI,
 8946|  6.65k|                         "xmlns:%s: '%s' is not a valid URI\n",
 8947|  6.65k|                                       attname, uri, NULL);
 8948|  15.5k|                } else {
 8949|  15.5k|                    if ((ctxt->pedantic) && (parsedUri->scheme == NULL)) {
  ------------------
  |  Branch (8949:25): [True: 7.52k, False: 8.01k]
  |  Branch (8949:45): [True: 6.34k, False: 1.17k]
  ------------------
 8950|  6.34k|                        xmlNsWarn(ctxt, XML_WAR_NS_URI_RELATIVE,
 8951|  6.34k|                                  "xmlns:%s: URI %s is not absolute\n",
 8952|  6.34k|                                  attname, uri, NULL);
 8953|  6.34k|                    }
 8954|  15.5k|                    xmlFreeURI(parsedUri);
 8955|  15.5k|                }
 8956|  22.2k|            }
 8957|       |
 8958|  22.2k|            if (xmlParserNsPush(ctxt, &hattname, &huri, NULL, 0) > 0)
  ------------------
  |  Branch (8958:17): [True: 20.8k, False: 1.35k]
  ------------------
 8959|  20.8k|                nbNs++;
 8960|  98.4k|        } else {
 8961|       |            /*
 8962|       |             * Populate attributes array, see above for repurposing
 8963|       |             * of xmlChar pointers.
 8964|       |             */
 8965|  98.4k|            if ((atts == NULL) || (nbatts + 5 > maxatts)) {
  ------------------
  |  Branch (8965:17): [True: 9.68k, False: 88.7k]
  |  Branch (8965:35): [True: 8.27k, False: 80.4k]
  ------------------
 8966|  17.9k|                int res = xmlCtxtGrowAttrs(ctxt);
 8967|       |
 8968|  17.9k|                maxatts = ctxt->maxatts;
 8969|  17.9k|                atts = ctxt->atts;
 8970|       |
 8971|  17.9k|                if (res < 0)
  ------------------
  |  Branch (8971:21): [True: 7, False: 17.9k]
  ------------------
 8972|      7|                    goto next_attr;
 8973|  17.9k|            }
 8974|  98.4k|            ctxt->attallocs[nratts++] = (hattname.hashValue & 0x7FFFFFFF) |
 8975|  98.4k|                                        ((unsigned) alloc << 31);
 8976|  98.4k|            atts[nbatts++] = attname;
 8977|  98.4k|            atts[nbatts++] = aprefix;
 8978|  98.4k|            atts[nbatts++] = XML_INT_TO_PTR(haprefix.hashValue);
  ------------------
  |  |   59|  98.4k|#define XML_INT_TO_PTR(i) ((void *) (XML_INTPTR_T) (i))
  ------------------
 8979|  98.4k|            if (alloc) {
  ------------------
  |  Branch (8979:17): [True: 18.7k, False: 79.6k]
  ------------------
 8980|  18.7k|                atts[nbatts++] = attvalue;
 8981|  18.7k|                attvalue += len;
 8982|  18.7k|                atts[nbatts++] = attvalue;
 8983|  79.6k|            } else {
 8984|       |                /*
 8985|       |                 * attvalue points into the input buffer which can be
 8986|       |                 * reallocated. Store differences to input->base instead.
 8987|       |                 * The pointers will be reconstructed later.
 8988|       |                 */
 8989|  79.6k|                atts[nbatts++] = XML_INT_TO_PTR(attvalue - BASE_PTR);
  ------------------
  |  |   59|  79.6k|#define XML_INT_TO_PTR(i) ((void *) (XML_INTPTR_T) (i))
  ------------------
 8990|  79.6k|                attvalue += len;
 8991|  79.6k|                atts[nbatts++] = XML_INT_TO_PTR(attvalue - BASE_PTR);
  ------------------
  |  |   59|  79.6k|#define XML_INT_TO_PTR(i) ((void *) (XML_INTPTR_T) (i))
  ------------------
 8992|  79.6k|            }
 8993|       |            /*
 8994|       |             * tag if some deallocation is needed
 8995|       |             */
 8996|  98.4k|            if (alloc != 0) attval = 1;
  ------------------
  |  Branch (8996:17): [True: 18.7k, False: 79.6k]
  ------------------
 8997|  98.4k|            attvalue = NULL; /* moved into atts */
 8998|  98.4k|        }
 8999|       |
 9000|   159k|next_attr:
 9001|   159k|        if ((attvalue != NULL) && (alloc != 0)) {
  ------------------
  |  Branch (9001:13): [True: 40.2k, False: 119k]
  |  Branch (9001:35): [True: 6.20k, False: 34.0k]
  ------------------
 9002|  6.20k|            xmlFree(attvalue);
 9003|  6.20k|            attvalue = NULL;
 9004|  6.20k|        }
 9005|       |
 9006|   159k|	GROW
  ------------------
  |  | 2271|   159k|    if ((!PARSER_PROGRESSIVE(ctxt)) && \
  |  |  ------------------
  |  |  |  |   47|   159k|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|   159k|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2271:9): [True: 57.3k, False: 102k]
  |  |  ------------------
  |  | 2272|   159k|        (ctxt->input->end - ctxt->input->cur < INPUT_CHUNK)) \
  |  |  ------------------
  |  |  |  |   63|  57.3k|#define INPUT_CHUNK	250
  |  |  ------------------
  |  |  |  Branch (2272:9): [True: 9.09k, False: 48.2k]
  |  |  ------------------
  |  | 2273|   159k|	xmlParserGrow(ctxt);
  ------------------
 9007|   159k|	if ((RAW == '>') || (((RAW == '/') && (NXT(1) == '>'))))
  ------------------
  |  | 2224|   159k|#define RAW (*ctxt->input->cur)
  ------------------
              	if ((RAW == '>') || (((RAW == '/') && (NXT(1) == '>'))))
  ------------------
  |  | 2224|   118k|#define RAW (*ctxt->input->cur)
  ------------------
              	if ((RAW == '>') || (((RAW == '/') && (NXT(1) == '>'))))
  ------------------
  |  | 2226|  12.8k|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
  |  Branch (9007:6): [True: 41.0k, False: 118k]
  |  Branch (9007:24): [True: 12.8k, False: 105k]
  |  Branch (9007:40): [True: 12.1k, False: 675]
  ------------------
 9008|  53.2k|	    break;
 9009|   106k|	if (SKIP_BLANKS == 0) {
  ------------------
  |  | 2275|   106k|#define SKIP_BLANKS xmlSkipBlankChars(ctxt)
  ------------------
  |  Branch (9009:6): [True: 24.9k, False: 81.3k]
  ------------------
 9010|  24.9k|	    xmlFatalErrMsg(ctxt, XML_ERR_SPACE_REQUIRED,
 9011|  24.9k|			   "attributes construct error\n");
 9012|  24.9k|	    break;
 9013|  24.9k|	}
 9014|  81.3k|        GROW;
  ------------------
  |  | 2271|  81.3k|    if ((!PARSER_PROGRESSIVE(ctxt)) && \
  |  |  ------------------
  |  |  |  |   47|  81.3k|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|  81.3k|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2271:9): [True: 19.5k, False: 61.8k]
  |  |  ------------------
  |  | 2272|  81.3k|        (ctxt->input->end - ctxt->input->cur < INPUT_CHUNK)) \
  |  |  ------------------
  |  |  |  |   63|  19.5k|#define INPUT_CHUNK	250
  |  |  ------------------
  |  |  |  Branch (2272:9): [True: 4.31k, False: 15.2k]
  |  |  ------------------
  |  | 2273|  81.3k|	xmlParserGrow(ctxt);
  ------------------
 9015|  81.3k|    }
 9016|       |
 9017|       |    /*
 9018|       |     * Namespaces from default attributes
 9019|       |     */
 9020|   573k|    if (ctxt->attsDefault != NULL) {
  ------------------
  |  Branch (9020:9): [True: 223k, False: 349k]
  ------------------
 9021|   223k|        xmlDefAttrsPtr defaults;
 9022|       |
 9023|   223k|	defaults = xmlHashLookup2(ctxt->attsDefault, localname, prefix);
 9024|   223k|	if (defaults != NULL) {
  ------------------
  |  Branch (9024:6): [True: 174k, False: 49.5k]
  ------------------
 9025|   616k|	    for (i = 0; i < defaults->nbAttrs; i++) {
  ------------------
  |  Branch (9025:18): [True: 442k, False: 174k]
  ------------------
 9026|   442k|                xmlDefAttr *attr = &defaults->attrs[i];
 9027|       |
 9028|   442k|	        attname = attr->name.name;
 9029|   442k|		aprefix = attr->prefix.name;
 9030|       |
 9031|   442k|		if ((attname == ctxt->str_xmlns) && (aprefix == NULL)) {
  ------------------
  |  Branch (9031:7): [True: 18.7k, False: 423k]
  |  Branch (9031:39): [True: 18.1k, False: 577]
  ------------------
 9032|  18.1k|                    xmlParserEntityCheck(ctxt, attr->expandedSize);
 9033|       |
 9034|  18.1k|                    if (xmlParserNsPush(ctxt, NULL, &attr->value, NULL, 1) > 0)
  ------------------
  |  Branch (9034:25): [True: 17.2k, False: 921]
  ------------------
 9035|  17.2k|                        nbNs++;
 9036|   424k|		} else if (aprefix == ctxt->str_xmlns) {
  ------------------
  |  Branch (9036:14): [True: 208k, False: 215k]
  ------------------
 9037|   208k|                    xmlParserEntityCheck(ctxt, attr->expandedSize);
 9038|       |
 9039|   208k|                    if (xmlParserNsPush(ctxt, &attr->name, &attr->value,
  ------------------
  |  Branch (9039:25): [True: 206k, False: 2.60k]
  ------------------
 9040|   208k|                                      NULL, 1) > 0)
 9041|   206k|                        nbNs++;
 9042|   215k|		} else {
 9043|   215k|                    if (nratts + nbTotalDef >= XML_MAX_ATTRS) {
  ------------------
  |  |   93|   215k|#define XML_MAX_ATTRS 100000000 /* 100 million */
  ------------------
  |  Branch (9043:25): [True: 0, False: 215k]
  ------------------
 9044|      0|                        xmlFatalErr(ctxt, XML_ERR_RESOURCE_LIMIT,
 9045|      0|                                    "Maximum number of attributes exceeded");
 9046|      0|                        break;
 9047|      0|                    }
 9048|   215k|                    nbTotalDef += 1;
 9049|   215k|                }
 9050|   442k|	    }
 9051|   174k|	}
 9052|   223k|    }
 9053|       |
 9054|       |    /*
 9055|       |     * Resolve attribute namespaces
 9056|       |     */
 9057|   672k|    for (i = 0; i < nbatts; i += 5) {
  ------------------
  |  Branch (9057:17): [True: 98.4k, False: 573k]
  ------------------
 9058|  98.4k|        attname = atts[i];
 9059|  98.4k|        aprefix = atts[i+1];
 9060|       |
 9061|       |        /*
 9062|       |	* The default namespace does not apply to attribute names.
 9063|       |	*/
 9064|  98.4k|	if (aprefix == NULL) {
  ------------------
  |  Branch (9064:6): [True: 41.1k, False: 57.3k]
  ------------------
 9065|  41.1k|            nsIndex = NS_INDEX_EMPTY;
  ------------------
  |  |   80|  41.1k|#define NS_INDEX_EMPTY  INT_MAX
  ------------------
 9066|  57.3k|        } else if (aprefix == ctxt->str_xml) {
  ------------------
  |  Branch (9066:20): [True: 38.3k, False: 18.9k]
  ------------------
 9067|  38.3k|            nsIndex = NS_INDEX_XML;
  ------------------
  |  |   81|  38.3k|#define NS_INDEX_XML    (INT_MAX - 1)
  ------------------
 9068|  38.3k|        } else {
 9069|  18.9k|            haprefix.name = aprefix;
 9070|  18.9k|            haprefix.hashValue = (size_t) atts[i+2];
 9071|  18.9k|            nsIndex = xmlParserNsLookup(ctxt, &haprefix, NULL);
 9072|       |
 9073|  18.9k|	    if ((nsIndex == INT_MAX) || (nsIndex < ctxt->nsdb->minNsIndex)) {
  ------------------
  |  Branch (9073:10): [True: 10.0k, False: 8.85k]
  |  Branch (9073:34): [True: 299, False: 8.55k]
  ------------------
 9074|  10.3k|                xmlNsErr(ctxt, XML_NS_ERR_UNDEFINED_NAMESPACE,
 9075|  10.3k|		    "Namespace prefix %s for %s on %s is not defined\n",
 9076|  10.3k|		    aprefix, attname, localname);
 9077|  10.3k|                nsIndex = NS_INDEX_EMPTY;
  ------------------
  |  |   80|  10.3k|#define NS_INDEX_EMPTY  INT_MAX
  ------------------
 9078|  10.3k|            }
 9079|  18.9k|        }
 9080|       |
 9081|  98.4k|        atts[i+2] = XML_INT_TO_PTR(nsIndex);
  ------------------
  |  |   59|  98.4k|#define XML_INT_TO_PTR(i) ((void *) (XML_INTPTR_T) (i))
  ------------------
 9082|  98.4k|    }
 9083|       |
 9084|       |    /*
 9085|       |     * Maximum number of attributes including default attributes.
 9086|       |     */
 9087|   573k|    maxAtts = nratts + nbTotalDef;
 9088|       |
 9089|       |    /*
 9090|       |     * Verify that attribute names are unique.
 9091|       |     */
 9092|   573k|    if (maxAtts > 1) {
  ------------------
  |  Branch (9092:9): [True: 38.8k, False: 534k]
  ------------------
 9093|  38.8k|        attrHashSize = 4;
 9094|  90.0k|        while (attrHashSize / 2 < (unsigned) maxAtts)
  ------------------
  |  Branch (9094:16): [True: 51.2k, False: 38.8k]
  ------------------
 9095|  51.2k|            attrHashSize *= 2;
 9096|       |
 9097|  38.8k|        if (attrHashSize > ctxt->attrHashMax) {
  ------------------
  |  Branch (9097:13): [True: 5.70k, False: 33.1k]
  ------------------
 9098|  5.70k|            xmlAttrHashBucket *tmp;
 9099|       |
 9100|  5.70k|            tmp = xmlRealloc(ctxt->attrHash, attrHashSize * sizeof(tmp[0]));
 9101|  5.70k|            if (tmp == NULL) {
  ------------------
  |  Branch (9101:17): [True: 2, False: 5.70k]
  ------------------
 9102|      2|                xmlErrMemory(ctxt);
 9103|      2|                goto done;
 9104|      2|            }
 9105|       |
 9106|  5.70k|            ctxt->attrHash = tmp;
 9107|  5.70k|            ctxt->attrHashMax = attrHashSize;
 9108|  5.70k|        }
 9109|       |
 9110|  38.8k|        memset(ctxt->attrHash, -1, attrHashSize * sizeof(ctxt->attrHash[0]));
 9111|       |
 9112|   111k|        for (i = 0, j = 0; j < nratts; i += 5, j++) {
  ------------------
  |  Branch (9112:28): [True: 72.5k, False: 38.8k]
  ------------------
 9113|  72.5k|            const xmlChar *nsuri;
 9114|  72.5k|            unsigned hashValue, nameHashValue, uriHashValue;
 9115|  72.5k|            int res;
 9116|       |
 9117|  72.5k|            attname = atts[i];
 9118|  72.5k|            aprefix = atts[i+1];
 9119|  72.5k|            nsIndex = XML_PTR_TO_INT(atts[i+2]);
  ------------------
  |  |   58|  72.5k|#define XML_PTR_TO_INT(p) ((XML_INTPTR_T) (p))
  ------------------
 9120|       |            /* Hash values always have bit 31 set, see dict.c */
 9121|  72.5k|            nameHashValue = ctxt->attallocs[j] | 0x80000000;
 9122|       |
 9123|  72.5k|            if (nsIndex == NS_INDEX_EMPTY) {
  ------------------
  |  |   80|  72.5k|#define NS_INDEX_EMPTY  INT_MAX
  ------------------
  |  Branch (9123:17): [True: 31.0k, False: 41.5k]
  ------------------
 9124|       |                /*
 9125|       |                 * Prefix with empty namespace means an undeclared
 9126|       |                 * prefix which was already reported above.
 9127|       |                 */
 9128|  31.0k|                if (aprefix != NULL)
  ------------------
  |  Branch (9128:21): [True: 8.08k, False: 22.9k]
  ------------------
 9129|  8.08k|                    continue;
 9130|  22.9k|                nsuri = NULL;
 9131|  22.9k|                uriHashValue = URI_HASH_EMPTY;
  ------------------
  |  |   82|  22.9k|#define URI_HASH_EMPTY  0xD943A04E
  ------------------
 9132|  41.5k|            } else if (nsIndex == NS_INDEX_XML) {
  ------------------
  |  |   81|  41.5k|#define NS_INDEX_XML    (INT_MAX - 1)
  ------------------
  |  Branch (9132:24): [True: 33.3k, False: 8.21k]
  ------------------
 9133|  33.3k|                nsuri = ctxt->str_xml_ns;
 9134|  33.3k|                uriHashValue = URI_HASH_XML;
  ------------------
  |  |   83|  33.3k|#define URI_HASH_XML    0xF0451F02
  ------------------
 9135|  33.3k|            } else {
 9136|  8.21k|                nsuri = ctxt->nsTab[nsIndex * 2 + 1];
 9137|  8.21k|                uriHashValue = ctxt->nsdb->extra[nsIndex].uriHashValue;
 9138|  8.21k|            }
 9139|       |
 9140|  64.5k|            hashValue = xmlDictCombineHash(nameHashValue, uriHashValue);
 9141|  64.5k|            res = xmlAttrHashInsert(ctxt, attrHashSize, attname, nsuri,
 9142|  64.5k|                                    hashValue, i);
 9143|  64.5k|            if (res < 0)
  ------------------
  |  Branch (9143:17): [True: 0, False: 64.5k]
  ------------------
 9144|      0|                continue;
 9145|       |
 9146|       |            /*
 9147|       |             * [ WFC: Unique Att Spec ]
 9148|       |             * No attribute name may appear more than once in the same
 9149|       |             * start-tag or empty-element tag.
 9150|       |             * As extended by the Namespace in XML REC.
 9151|       |             */
 9152|  64.5k|            if (res < INT_MAX) {
  ------------------
  |  Branch (9152:17): [True: 39.0k, False: 25.4k]
  ------------------
 9153|  39.0k|                if (aprefix == atts[res+1]) {
  ------------------
  |  Branch (9153:21): [True: 35.4k, False: 3.56k]
  ------------------
 9154|  35.4k|                    xmlErrAttributeDup(ctxt, aprefix, attname);
 9155|  35.4k|                    numDupErr += 1;
 9156|  35.4k|                } else {
 9157|  3.56k|                    xmlNsErr(ctxt, XML_NS_ERR_ATTRIBUTE_REDEFINED,
 9158|  3.56k|                             "Namespaced Attribute %s in '%s' redefined\n",
 9159|  3.56k|                             attname, nsuri, NULL);
 9160|  3.56k|                    numNsErr += 1;
 9161|  3.56k|                }
 9162|  39.0k|            }
 9163|  64.5k|        }
 9164|  38.8k|    }
 9165|       |
 9166|       |    /*
 9167|       |     * Default attributes
 9168|       |     */
 9169|   573k|    if (ctxt->attsDefault != NULL) {
  ------------------
  |  Branch (9169:9): [True: 223k, False: 349k]
  ------------------
 9170|   223k|        xmlDefAttrsPtr defaults;
 9171|       |
 9172|   223k|	defaults = xmlHashLookup2(ctxt->attsDefault, localname, prefix);
 9173|   223k|	if (defaults != NULL) {
  ------------------
  |  Branch (9173:6): [True: 174k, False: 49.5k]
  ------------------
 9174|   616k|	    for (i = 0; i < defaults->nbAttrs; i++) {
  ------------------
  |  Branch (9174:18): [True: 442k, False: 174k]
  ------------------
 9175|   442k|                xmlDefAttr *attr = &defaults->attrs[i];
 9176|   442k|                const xmlChar *nsuri = NULL;
 9177|   442k|                unsigned hashValue, uriHashValue = 0;
 9178|   442k|                int res;
 9179|       |
 9180|   442k|	        attname = attr->name.name;
 9181|   442k|		aprefix = attr->prefix.name;
 9182|       |
 9183|   442k|		if ((attname == ctxt->str_xmlns) && (aprefix == NULL))
  ------------------
  |  Branch (9183:7): [True: 18.7k, False: 423k]
  |  Branch (9183:39): [True: 18.1k, False: 577]
  ------------------
 9184|  18.1k|                    continue;
 9185|   424k|		if (aprefix == ctxt->str_xmlns)
  ------------------
  |  Branch (9185:7): [True: 208k, False: 215k]
  ------------------
 9186|   208k|                    continue;
 9187|       |
 9188|   215k|                if (aprefix == NULL) {
  ------------------
  |  Branch (9188:21): [True: 109k, False: 105k]
  ------------------
 9189|   109k|                    nsIndex = NS_INDEX_EMPTY;
  ------------------
  |  |   80|   109k|#define NS_INDEX_EMPTY  INT_MAX
  ------------------
 9190|   109k|                    nsuri = NULL;
 9191|   109k|                    uriHashValue = URI_HASH_EMPTY;
  ------------------
  |  |   82|   109k|#define URI_HASH_EMPTY  0xD943A04E
  ------------------
 9192|   109k|                } else if (aprefix == ctxt->str_xml) {
  ------------------
  |  Branch (9192:28): [True: 30.0k, False: 75.7k]
  ------------------
 9193|  30.0k|                    nsIndex = NS_INDEX_XML;
  ------------------
  |  |   81|  30.0k|#define NS_INDEX_XML    (INT_MAX - 1)
  ------------------
 9194|  30.0k|                    nsuri = ctxt->str_xml_ns;
 9195|  30.0k|                    uriHashValue = URI_HASH_XML;
  ------------------
  |  |   83|  30.0k|#define URI_HASH_XML    0xF0451F02
  ------------------
 9196|  75.7k|                } else {
 9197|  75.7k|                    nsIndex = xmlParserNsLookup(ctxt, &attr->prefix, NULL);
 9198|  75.7k|                    if ((nsIndex == INT_MAX) ||
  ------------------
  |  Branch (9198:25): [True: 64.2k, False: 11.4k]
  ------------------
 9199|  64.3k|                        (nsIndex < ctxt->nsdb->minNsIndex)) {
  ------------------
  |  Branch (9199:25): [True: 73, False: 11.4k]
  ------------------
 9200|  64.3k|                        xmlNsErr(ctxt, XML_NS_ERR_UNDEFINED_NAMESPACE,
 9201|  64.3k|                                 "Namespace prefix %s for %s on %s is not "
 9202|  64.3k|                                 "defined\n",
 9203|  64.3k|                                 aprefix, attname, localname);
 9204|  64.3k|                        nsIndex = NS_INDEX_EMPTY;
  ------------------
  |  |   80|  64.3k|#define NS_INDEX_EMPTY  INT_MAX
  ------------------
 9205|  64.3k|                        nsuri = NULL;
 9206|  64.3k|                        uriHashValue = URI_HASH_EMPTY;
  ------------------
  |  |   82|  64.3k|#define URI_HASH_EMPTY  0xD943A04E
  ------------------
 9207|  64.3k|                    } else {
 9208|  11.4k|                        nsuri = ctxt->nsTab[nsIndex * 2 + 1];
 9209|  11.4k|                        uriHashValue = ctxt->nsdb->extra[nsIndex].uriHashValue;
 9210|  11.4k|                    }
 9211|  75.7k|                }
 9212|       |
 9213|       |                /*
 9214|       |                 * Check whether the attribute exists
 9215|       |                 */
 9216|   215k|                if (maxAtts > 1) {
  ------------------
  |  Branch (9216:21): [True: 184k, False: 30.9k]
  ------------------
 9217|   184k|                    hashValue = xmlDictCombineHash(attr->name.hashValue,
 9218|   184k|                                                   uriHashValue);
 9219|   184k|                    res = xmlAttrHashInsert(ctxt, attrHashSize, attname, nsuri,
 9220|   184k|                                            hashValue, nbatts);
 9221|   184k|                    if (res < 0)
  ------------------
  |  Branch (9221:25): [True: 0, False: 184k]
  ------------------
 9222|      0|                        continue;
 9223|   184k|                    if (res < INT_MAX) {
  ------------------
  |  Branch (9223:25): [True: 5.78k, False: 178k]
  ------------------
 9224|  5.78k|                        if (aprefix == atts[res+1])
  ------------------
  |  Branch (9224:29): [True: 1.46k, False: 4.32k]
  ------------------
 9225|  1.46k|                            continue;
 9226|  4.32k|                        xmlNsErr(ctxt, XML_NS_ERR_ATTRIBUTE_REDEFINED,
 9227|  4.32k|                                 "Namespaced Attribute %s in '%s' redefined\n",
 9228|  4.32k|                                 attname, nsuri, NULL);
 9229|  4.32k|                    }
 9230|   184k|                }
 9231|       |
 9232|   214k|                xmlParserEntityCheck(ctxt, attr->expandedSize);
 9233|       |
 9234|   214k|                if ((atts == NULL) || (nbatts + 5 > maxatts)) {
  ------------------
  |  Branch (9234:21): [True: 1.07k, False: 213k]
  |  Branch (9234:39): [True: 826, False: 212k]
  ------------------
 9235|  1.90k|                    res = xmlCtxtGrowAttrs(ctxt);
 9236|       |
 9237|  1.90k|                    maxatts = ctxt->maxatts;
 9238|  1.90k|                    atts = ctxt->atts;
 9239|       |
 9240|  1.90k|                    if (res < 0) {
  ------------------
  |  Branch (9240:25): [True: 4, False: 1.89k]
  ------------------
 9241|      4|                        localname = NULL;
 9242|      4|                        goto done;
 9243|      4|                    }
 9244|  1.90k|                }
 9245|       |
 9246|   214k|                atts[nbatts++] = attname;
 9247|   214k|                atts[nbatts++] = aprefix;
 9248|   214k|                atts[nbatts++] = XML_INT_TO_PTR(nsIndex);
  ------------------
  |  |   59|   214k|#define XML_INT_TO_PTR(i) ((void *) (XML_INTPTR_T) (i))
  ------------------
 9249|   214k|                atts[nbatts++] = attr->value.name;
 9250|   214k|                atts[nbatts++] = attr->valueEnd;
 9251|       |
 9252|   214k|#ifdef LIBXML_VALID_ENABLED
 9253|       |                /*
 9254|       |                 * This should be moved to valid.c, but we don't keep track
 9255|       |                 * whether an attribute was defaulted.
 9256|       |                 */
 9257|   214k|                if ((ctxt->validate) &&
  ------------------
  |  Branch (9257:21): [True: 107k, False: 106k]
  ------------------
 9258|   107k|                    (ctxt->standalone == 1) &&
  ------------------
  |  Branch (9258:21): [True: 964, False: 106k]
  ------------------
 9259|    964|                    (attr->external != 0)) {
  ------------------
  |  Branch (9259:21): [True: 750, False: 214]
  ------------------
 9260|    750|                    xmlValidityError(ctxt, XML_DTD_STANDALONE_DEFAULTED,
 9261|    750|                            "standalone: attribute %s on %s defaulted "
 9262|    750|                            "from external subset\n",
 9263|    750|                            attname, localname);
 9264|    750|                }
 9265|   214k|#endif
 9266|   214k|                nbdef++;
 9267|   214k|	    }
 9268|   174k|	}
 9269|   223k|    }
 9270|       |
 9271|       |    /*
 9272|       |     * Using a single hash table for nsUri/localName pairs cannot
 9273|       |     * detect duplicate QNames reliably. The following example will
 9274|       |     * only result in two namespace errors.
 9275|       |     *
 9276|       |     * <doc xmlns:a="a" xmlns:b="a">
 9277|       |     *   <elem a:a="" b:a="" b:a=""/>
 9278|       |     * </doc>
 9279|       |     *
 9280|       |     * If we saw more than one namespace error but no duplicate QNames
 9281|       |     * were found, we have to scan for duplicate QNames.
 9282|       |     */
 9283|   573k|    if ((numDupErr == 0) && (numNsErr > 1)) {
  ------------------
  |  Branch (9283:9): [True: 572k, False: 998]
  |  Branch (9283:29): [True: 1.26k, False: 571k]
  ------------------
 9284|  1.26k|        memset(ctxt->attrHash, -1,
 9285|  1.26k|               attrHashSize * sizeof(ctxt->attrHash[0]));
 9286|       |
 9287|  7.26k|        for (i = 0, j = 0; j < nratts; i += 5, j++) {
  ------------------
  |  Branch (9287:28): [True: 5.99k, False: 1.26k]
  ------------------
 9288|  5.99k|            unsigned hashValue, nameHashValue, prefixHashValue;
 9289|  5.99k|            int res;
 9290|       |
 9291|  5.99k|            aprefix = atts[i+1];
 9292|  5.99k|            if (aprefix == NULL)
  ------------------
  |  Branch (9292:17): [True: 293, False: 5.70k]
  ------------------
 9293|    293|                continue;
 9294|       |
 9295|  5.70k|            attname = atts[i];
 9296|       |            /* Hash values always have bit 31 set, see dict.c */
 9297|  5.70k|            nameHashValue = ctxt->attallocs[j] | 0x80000000;
 9298|  5.70k|            prefixHashValue = xmlDictComputeHash(ctxt->dict, aprefix);
 9299|       |
 9300|  5.70k|            hashValue = xmlDictCombineHash(nameHashValue, prefixHashValue);
 9301|  5.70k|            res = xmlAttrHashInsertQName(ctxt, attrHashSize, attname,
 9302|  5.70k|                                         aprefix, hashValue, i);
 9303|  5.70k|            if (res < INT_MAX)
  ------------------
  |  Branch (9303:17): [True: 2.30k, False: 3.40k]
  ------------------
 9304|  2.30k|                xmlErrAttributeDup(ctxt, aprefix, attname);
 9305|  5.70k|        }
 9306|  1.26k|    }
 9307|       |
 9308|       |    /*
 9309|       |     * Reconstruct attribute pointers
 9310|       |     */
 9311|   886k|    for (i = 0, j = 0; i < nbatts; i += 5, j++) {
  ------------------
  |  Branch (9311:24): [True: 312k, False: 573k]
  ------------------
 9312|       |        /* namespace URI */
 9313|   312k|        nsIndex = XML_PTR_TO_INT(atts[i+2]);
  ------------------
  |  |   58|   312k|#define XML_PTR_TO_INT(p) ((XML_INTPTR_T) (p))
  ------------------
 9314|   312k|        if (nsIndex == INT_MAX)
  ------------------
  |  Branch (9314:13): [True: 224k, False: 87.6k]
  ------------------
 9315|   224k|            atts[i+2] = NULL;
 9316|  87.6k|        else if (nsIndex == INT_MAX - 1)
  ------------------
  |  Branch (9316:18): [True: 67.6k, False: 19.9k]
  ------------------
 9317|  67.6k|            atts[i+2] = ctxt->str_xml_ns;
 9318|  19.9k|        else
 9319|  19.9k|            atts[i+2] = ctxt->nsTab[nsIndex * 2 + 1];
 9320|       |
 9321|   312k|        if ((j < nratts) && (ctxt->attallocs[j] & 0x80000000) == 0) {
  ------------------
  |  Branch (9321:13): [True: 98.4k, False: 214k]
  |  Branch (9321:29): [True: 79.6k, False: 18.7k]
  ------------------
 9322|  79.6k|            atts[i+3] = BASE_PTR + XML_PTR_TO_INT(atts[i+3]);  /* value */
  ------------------
  |  | 2228|  79.6k|#define BASE_PTR ctxt->input->base
  ------------------
                          atts[i+3] = BASE_PTR + XML_PTR_TO_INT(atts[i+3]);  /* value */
  ------------------
  |  |   58|  79.6k|#define XML_PTR_TO_INT(p) ((XML_INTPTR_T) (p))
  ------------------
 9323|  79.6k|            atts[i+4] = BASE_PTR + XML_PTR_TO_INT(atts[i+4]);  /* valuend */
  ------------------
  |  | 2228|  79.6k|#define BASE_PTR ctxt->input->base
  ------------------
                          atts[i+4] = BASE_PTR + XML_PTR_TO_INT(atts[i+4]);  /* valuend */
  ------------------
  |  |   58|  79.6k|#define XML_PTR_TO_INT(p) ((XML_INTPTR_T) (p))
  ------------------
 9324|  79.6k|        }
 9325|   312k|    }
 9326|       |
 9327|   573k|    uri = xmlParserNsLookupUri(ctxt, &hprefix);
 9328|   573k|    if ((prefix != NULL) && (uri == NULL)) {
  ------------------
  |  Branch (9328:9): [True: 54.4k, False: 519k]
  |  Branch (9328:29): [True: 33.5k, False: 20.8k]
  ------------------
 9329|  33.5k|	xmlNsErr(ctxt, XML_NS_ERR_UNDEFINED_NAMESPACE,
 9330|  33.5k|	         "Namespace prefix %s on %s is not defined\n",
 9331|  33.5k|		 prefix, localname, NULL);
 9332|  33.5k|    }
 9333|   573k|    *pref = prefix;
 9334|   573k|    *URI = uri;
 9335|       |
 9336|       |    /*
 9337|       |     * SAX callback
 9338|       |     */
 9339|   573k|    if ((ctxt->sax != NULL) && (ctxt->sax->startElementNs != NULL) &&
  ------------------
  |  Branch (9339:9): [True: 573k, False: 0]
  |  Branch (9339:32): [True: 573k, False: 0]
  ------------------
 9340|   573k|	(!ctxt->disableSAX)) {
  ------------------
  |  Branch (9340:2): [True: 420k, False: 153k]
  ------------------
 9341|   420k|	if (nbNs > 0)
  ------------------
  |  Branch (9341:6): [True: 49.7k, False: 370k]
  ------------------
 9342|  49.7k|	    ctxt->sax->startElementNs(ctxt->userData, localname, prefix, uri,
 9343|  49.7k|                          nbNs, ctxt->nsTab + 2 * (ctxt->nsNr - nbNs),
 9344|  49.7k|			  nbatts / 5, nbdef, atts);
 9345|   370k|	else
 9346|   370k|	    ctxt->sax->startElementNs(ctxt->userData, localname, prefix, uri,
 9347|   370k|                          0, NULL, nbatts / 5, nbdef, atts);
 9348|   420k|    }
 9349|       |
 9350|   573k|done:
 9351|       |    /*
 9352|       |     * Free allocated attribute values
 9353|       |     */
 9354|   573k|    if (attval != 0) {
  ------------------
  |  Branch (9354:9): [True: 10.3k, False: 563k]
  ------------------
 9355|  61.2k|	for (i = 0, j = 0; j < nratts; i += 5, j++)
  ------------------
  |  Branch (9355:21): [True: 50.9k, False: 10.3k]
  ------------------
 9356|  50.9k|	    if (ctxt->attallocs[j] & 0x80000000)
  ------------------
  |  Branch (9356:10): [True: 18.7k, False: 32.2k]
  ------------------
 9357|  18.7k|	        xmlFree((xmlChar *) atts[i+3]);
 9358|  10.3k|    }
 9359|       |
 9360|   573k|    *nbNsPtr = nbNs;
 9361|   573k|    return(localname);
 9362|   573k|}
parser.c:xmlParserNsStartElement:
 1467|   603k|xmlParserNsStartElement(xmlParserNsData *nsdb) {
 1468|   603k|    if (nsdb->elementId == UINT_MAX)
  ------------------
  |  Branch (1468:9): [True: 0, False: 603k]
  ------------------
 1469|      0|        return(-1);
 1470|   603k|    nsdb->elementId++;
 1471|       |
 1472|   603k|    return(0);
 1473|   603k|}
parser.c:xmlParseQNameHashed:
 8392|   834k|xmlParseQNameHashed(xmlParserCtxtPtr ctxt, xmlHashedString *prefix) {
 8393|   834k|    xmlHashedString l, p;
 8394|   834k|    int start, isNCName = 0;
 8395|       |
 8396|   834k|    l.name = NULL;
 8397|   834k|    p.name = NULL;
 8398|       |
 8399|   834k|    GROW;
  ------------------
  |  | 2271|   834k|    if ((!PARSER_PROGRESSIVE(ctxt)) && \
  |  |  ------------------
  |  |  |  |   47|   834k|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|   834k|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2271:9): [True: 534k, False: 299k]
  |  |  ------------------
  |  | 2272|   834k|        (ctxt->input->end - ctxt->input->cur < INPUT_CHUNK)) \
  |  |  ------------------
  |  |  |  |   63|   534k|#define INPUT_CHUNK	250
  |  |  ------------------
  |  |  |  Branch (2272:9): [True: 37.7k, False: 497k]
  |  |  ------------------
  |  | 2273|   834k|	xmlParserGrow(ctxt);
  ------------------
 8400|   834k|    start = CUR_PTR - BASE_PTR;
  ------------------
  |  | 2227|   834k|#define CUR_PTR ctxt->input->cur
  ------------------
                  start = CUR_PTR - BASE_PTR;
  ------------------
  |  | 2228|   834k|#define BASE_PTR ctxt->input->base
  ------------------
 8401|       |
 8402|   834k|    l = xmlParseNCName(ctxt);
 8403|   834k|    if (l.name != NULL) {
  ------------------
  |  Branch (8403:9): [True: 743k, False: 91.0k]
  ------------------
 8404|   743k|        isNCName = 1;
 8405|   743k|        if (CUR == ':') {
  ------------------
  |  | 2225|   743k|#define CUR (*ctxt->input->cur)
  ------------------
  |  Branch (8405:13): [True: 156k, False: 587k]
  ------------------
 8406|   156k|            NEXT;
  ------------------
  |  | 2279|   156k|#define NEXT xmlNextChar(ctxt)
  ------------------
 8407|   156k|            p = l;
 8408|   156k|            l = xmlParseNCName(ctxt);
 8409|   156k|        }
 8410|   743k|    }
 8411|   834k|    if ((l.name == NULL) || (CUR == ':')) {
  ------------------
  |  | 2225|   734k|#define CUR (*ctxt->input->cur)
  ------------------
  |  Branch (8411:9): [True: 99.6k, False: 734k]
  |  Branch (8411:29): [True: 1.74k, False: 733k]
  ------------------
 8412|   101k|        xmlChar *tmp;
 8413|       |
 8414|   101k|        l.name = NULL;
 8415|   101k|        p.name = NULL;
 8416|   101k|        if ((isNCName == 0) && (CUR != ':'))
  ------------------
  |  | 2225|  91.0k|#define CUR (*ctxt->input->cur)
  ------------------
  |  Branch (8416:13): [True: 91.0k, False: 10.3k]
  |  Branch (8416:32): [True: 87.7k, False: 3.34k]
  ------------------
 8417|  87.7k|            return(l);
 8418|  13.6k|        tmp = xmlParseNmtoken(ctxt);
 8419|  13.6k|        if (tmp != NULL)
  ------------------
  |  Branch (8419:13): [True: 6.38k, False: 7.27k]
  ------------------
 8420|  6.38k|            xmlFree(tmp);
 8421|  13.6k|        l = xmlDictLookupHashed(ctxt->dict, BASE_PTR + start,
  ------------------
  |  | 2228|  13.6k|#define BASE_PTR ctxt->input->base
  ------------------
 8422|  13.6k|                                CUR_PTR - (BASE_PTR + start));
  ------------------
  |  | 2227|  13.6k|#define CUR_PTR ctxt->input->cur
  ------------------
                                              CUR_PTR - (BASE_PTR + start));
  ------------------
  |  | 2228|  13.6k|#define BASE_PTR ctxt->input->base
  ------------------
 8423|  13.6k|        if (l.name == NULL) {
  ------------------
  |  Branch (8423:13): [True: 1, False: 13.6k]
  ------------------
 8424|      1|            xmlErrMemory(ctxt);
 8425|      1|            return(l);
 8426|      1|        }
 8427|  13.6k|        xmlNsErr(ctxt, XML_NS_ERR_QNAME,
 8428|  13.6k|                 "Failed to parse QName '%s'\n", l.name, NULL, NULL);
 8429|  13.6k|    }
 8430|       |
 8431|   746k|    *prefix = p;
 8432|   746k|    return(l);
 8433|   834k|}
parser.c:xmlParseNCName:
 3246|   990k|xmlParseNCName(xmlParserCtxtPtr ctxt) {
 3247|   990k|    const xmlChar *in, *e;
 3248|   990k|    xmlHashedString ret;
 3249|   990k|    size_t count = 0;
 3250|   990k|    size_t maxLength = (ctxt->options & XML_PARSE_HUGE) ?
  ------------------
  |  Branch (3250:24): [True: 570k, False: 420k]
  ------------------
 3251|   570k|                       XML_MAX_TEXT_LENGTH :
  ------------------
  |  |   50|   570k|#define XML_MAX_TEXT_LENGTH 10000000
  ------------------
 3252|   990k|                       XML_MAX_NAME_LENGTH;
  ------------------
  |  |   65|  1.41M|#define XML_MAX_NAME_LENGTH 50000
  ------------------
 3253|       |
 3254|   990k|    ret.name = NULL;
 3255|       |
 3256|       |    /*
 3257|       |     * Accelerator for simple ASCII names
 3258|       |     */
 3259|   990k|    in = ctxt->input->cur;
 3260|   990k|    e = ctxt->input->end;
 3261|   990k|    if ((((*in >= 0x61) && (*in <= 0x7A)) ||
  ------------------
  |  Branch (3261:11): [True: 888k, False: 102k]
  |  Branch (3261:28): [True: 873k, False: 15.1k]
  ------------------
 3262|   117k|	 ((*in >= 0x41) && (*in <= 0x5A)) ||
  ------------------
  |  Branch (3262:4): [True: 30.0k, False: 87.2k]
  |  Branch (3262:21): [True: 11.1k, False: 18.8k]
  ------------------
 3263|   885k|	 (*in == '_')) && (in < e)) {
  ------------------
  |  Branch (3263:3): [True: 1.33k, False: 104k]
  |  Branch (3263:20): [True: 885k, False: 0]
  ------------------
 3264|   885k|	in++;
 3265|  4.76M|	while ((((*in >= 0x61) && (*in <= 0x7A)) ||
  ------------------
  |  Branch (3265:11): [True: 2.84M, False: 1.91M]
  |  Branch (3265:28): [True: 2.83M, False: 9.16k]
  ------------------
 3266|  1.92M|	        ((*in >= 0x41) && (*in <= 0x5A)) ||
  ------------------
  |  Branch (3266:11): [True: 264k, False: 1.65M]
  |  Branch (3266:28): [True: 250k, False: 13.8k]
  ------------------
 3267|  1.67M|	        ((*in >= 0x30) && (*in <= 0x39)) ||
  ------------------
  |  Branch (3267:11): [True: 1.45M, False: 214k]
  |  Branch (3267:28): [True: 775k, False: 681k]
  ------------------
 3268|   896k|	        (*in == '_') || (*in == '-') ||
  ------------------
  |  Branch (3268:10): [True: 3.34k, False: 893k]
  |  Branch (3268:26): [True: 5.32k, False: 887k]
  ------------------
 3269|  3.87M|	        (*in == '.')) && (in < e))
  ------------------
  |  Branch (3269:10): [True: 1.74k, False: 885k]
  |  Branch (3269:27): [True: 3.87M, False: 0]
  ------------------
 3270|  3.87M|	    in++;
 3271|   885k|	if (in >= e)
  ------------------
  |  Branch (3271:6): [True: 410, False: 885k]
  ------------------
 3272|    410|	    goto complex;
 3273|   885k|	if ((*in > 0) && (*in < 0x80)) {
  ------------------
  |  Branch (3273:6): [True: 877k, False: 7.64k]
  |  Branch (3273:19): [True: 869k, False: 8.70k]
  ------------------
 3274|   869k|	    count = in - ctxt->input->cur;
 3275|   869k|            if (count > maxLength) {
  ------------------
  |  Branch (3275:17): [True: 26, False: 869k]
  ------------------
 3276|     26|                xmlFatalErr(ctxt, XML_ERR_NAME_TOO_LONG, "NCName");
 3277|     26|                return(ret);
 3278|     26|            }
 3279|   869k|	    ret = xmlDictLookupHashed(ctxt->dict, ctxt->input->cur, count);
 3280|   869k|	    ctxt->input->cur = in;
 3281|   869k|	    ctxt->input->col += count;
 3282|   869k|	    if (ret.name == NULL) {
  ------------------
  |  Branch (3282:10): [True: 3, False: 869k]
  ------------------
 3283|      3|	        xmlErrMemory(ctxt);
 3284|      3|	    }
 3285|   869k|	    return(ret);
 3286|   869k|	}
 3287|   885k|    }
 3288|   121k|complex:
 3289|   121k|    return(xmlParseNCNameComplex(ctxt));
 3290|   990k|}
parser.c:xmlParseNCNameComplex:
 3193|   121k|xmlParseNCNameComplex(xmlParserCtxtPtr ctxt) {
 3194|   121k|    xmlHashedString ret;
 3195|   121k|    int len = 0, l;
 3196|   121k|    int c;
 3197|   121k|    int maxLength = (ctxt->options & XML_PARSE_HUGE) ?
  ------------------
  |  Branch (3197:21): [True: 89.7k, False: 31.7k]
  ------------------
 3198|  89.7k|                    XML_MAX_TEXT_LENGTH :
  ------------------
  |  |   50|  89.7k|#define XML_MAX_TEXT_LENGTH 10000000
  ------------------
 3199|   121k|                    XML_MAX_NAME_LENGTH;
  ------------------
  |  |   65|  31.7k|#define XML_MAX_NAME_LENGTH 50000
  ------------------
 3200|   121k|    int old10 = (ctxt->options & XML_PARSE_OLD10) ? 1 : 0;
  ------------------
  |  Branch (3200:17): [True: 62.8k, False: 58.6k]
  ------------------
 3201|   121k|    size_t startPosition = 0;
 3202|       |
 3203|   121k|    ret.name = NULL;
 3204|   121k|    ret.hashValue = 0;
 3205|       |
 3206|       |    /*
 3207|       |     * Handler for more complex cases
 3208|       |     */
 3209|   121k|    startPosition = CUR_PTR - BASE_PTR;
  ------------------
  |  | 2227|   121k|#define CUR_PTR ctxt->input->cur
  ------------------
                  startPosition = CUR_PTR - BASE_PTR;
  ------------------
  |  | 2228|   121k|#define BASE_PTR ctxt->input->base
  ------------------
 3210|   121k|    c = xmlCurrentChar(ctxt, &l);
 3211|   121k|    if ((c == ' ') || (c == '>') || (c == '/') || /* accelerators */
  ------------------
  |  Branch (3211:9): [True: 1.44k, False: 120k]
  |  Branch (3211:23): [True: 2.29k, False: 117k]
  |  Branch (3211:37): [True: 4.96k, False: 112k]
  ------------------
 3212|   112k|	(!xmlIsNameStartChar(c, old10) || (c == ':'))) {
  ------------------
  |  Branch (3212:3): [True: 87.3k, False: 25.4k]
  |  Branch (3212:36): [True: 3.56k, False: 21.9k]
  ------------------
 3213|  99.5k|	return(ret);
 3214|  99.5k|    }
 3215|       |
 3216|  3.76M|    while ((c != ' ') && (c != '>') && (c != '/') && /* test bigname.xml */
  ------------------
  |  Branch (3216:12): [True: 3.76M, False: 587]
  |  Branch (3216:26): [True: 3.76M, False: 1.65k]
  |  Branch (3216:40): [True: 3.76M, False: 226]
  ------------------
 3217|  3.76M|	   (xmlIsNameChar(c, old10) && (c != ':'))) {
  ------------------
  |  Branch (3217:6): [True: 3.74M, False: 18.0k]
  |  Branch (3217:33): [True: 3.74M, False: 1.41k]
  ------------------
 3218|  3.74M|        if (len <= INT_MAX - l)
  ------------------
  |  Branch (3218:13): [True: 3.74M, False: 0]
  ------------------
 3219|  3.74M|	    len += l;
 3220|  3.74M|	NEXTL(l);
  ------------------
  |  | 2288|  3.74M|#define NEXTL(l) do {							\
  |  | 2289|  3.74M|    if (*(ctxt->input->cur) == '\n') {					\
  |  |  ------------------
  |  |  |  Branch (2289:9): [True: 0, False: 3.74M]
  |  |  ------------------
  |  | 2290|      0|	ctxt->input->line++; ctxt->input->col = 1;			\
  |  | 2291|  3.74M|    } else ctxt->input->col++;						\
  |  | 2292|  3.74M|    ctxt->input->cur += l;				\
  |  | 2293|  3.74M|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2293:12): [Folded, False: 3.74M]
  |  |  ------------------
  ------------------
 3221|  3.74M|	c = xmlCurrentChar(ctxt, &l);
 3222|  3.74M|    }
 3223|  21.9k|    if (len > maxLength) {
  ------------------
  |  Branch (3223:9): [True: 22, False: 21.9k]
  ------------------
 3224|     22|        xmlFatalErr(ctxt, XML_ERR_NAME_TOO_LONG, "NCName");
 3225|     22|        return(ret);
 3226|     22|    }
 3227|  21.9k|    ret = xmlDictLookupHashed(ctxt->dict, (BASE_PTR + startPosition), len);
  ------------------
  |  | 2228|  21.9k|#define BASE_PTR ctxt->input->base
  ------------------
 3228|  21.9k|    if (ret.name == NULL)
  ------------------
  |  Branch (3228:9): [True: 2, False: 21.9k]
  ------------------
 3229|      2|        xmlErrMemory(ctxt);
 3230|  21.9k|    return(ret);
 3231|  21.9k|}
parser.c:xmlParseAttribute2:
 8530|   217k|{
 8531|   217k|    xmlHashedString hname;
 8532|   217k|    const xmlChar *prefix, *name;
 8533|   217k|    xmlChar *val = NULL, *internal_val = NULL;
 8534|   217k|    int special = 0;
 8535|   217k|    int isNamespace;
 8536|   217k|    int flags;
 8537|       |
 8538|   217k|    *value = NULL;
 8539|   217k|    GROW;
  ------------------
  |  | 2271|   217k|    if ((!PARSER_PROGRESSIVE(ctxt)) && \
  |  |  ------------------
  |  |  |  |   47|   217k|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|   217k|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2271:9): [True: 105k, False: 111k]
  |  |  ------------------
  |  | 2272|   217k|        (ctxt->input->end - ctxt->input->cur < INPUT_CHUNK)) \
  |  |  ------------------
  |  |  |  |   63|   105k|#define INPUT_CHUNK	250
  |  |  ------------------
  |  |  |  Branch (2272:9): [True: 10.5k, False: 94.5k]
  |  |  ------------------
  |  | 2273|   217k|	xmlParserGrow(ctxt);
  ------------------
 8540|   217k|    hname = xmlParseQNameHashed(ctxt, hprefix);
 8541|   217k|    if (hname.name == NULL) {
  ------------------
  |  Branch (8541:9): [True: 57.5k, False: 159k]
  ------------------
 8542|  57.5k|        xmlFatalErrMsg(ctxt, XML_ERR_NAME_REQUIRED,
 8543|  57.5k|                       "error parsing attribute name\n");
 8544|  57.5k|        return(hname);
 8545|  57.5k|    }
 8546|   159k|    name = hname.name;
 8547|   159k|    prefix = hprefix->name;
 8548|       |
 8549|       |    /*
 8550|       |     * get the type if needed
 8551|       |     */
 8552|   159k|    if (ctxt->attsSpecial != NULL) {
  ------------------
  |  Branch (8552:9): [True: 25.6k, False: 133k]
  ------------------
 8553|  25.6k|        special = XML_PTR_TO_INT(xmlHashQLookup2(ctxt->attsSpecial, pref, elem,
  ------------------
  |  |   58|  25.6k|#define XML_PTR_TO_INT(p) ((XML_INTPTR_T) (p))
  ------------------
 8554|  25.6k|                                              prefix, name));
 8555|  25.6k|    }
 8556|       |
 8557|       |    /*
 8558|       |     * read the value
 8559|       |     */
 8560|   159k|    SKIP_BLANKS;
  ------------------
  |  | 2275|   159k|#define SKIP_BLANKS xmlSkipBlankChars(ctxt)
  ------------------
 8561|   159k|    if (RAW != '=') {
  ------------------
  |  | 2224|   159k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (8561:9): [True: 17.3k, False: 142k]
  ------------------
 8562|  17.3k|        xmlFatalErrMsgStr(ctxt, XML_ERR_ATTRIBUTE_WITHOUT_VALUE,
 8563|  17.3k|                          "Specification mandates value for attribute %s\n",
 8564|  17.3k|                          name);
 8565|  17.3k|        goto error;
 8566|  17.3k|    }
 8567|       |
 8568|       |
 8569|   142k|    NEXT;
  ------------------
  |  | 2279|   142k|#define NEXT xmlNextChar(ctxt)
  ------------------
 8570|   142k|    SKIP_BLANKS;
  ------------------
  |  | 2275|   142k|#define SKIP_BLANKS xmlSkipBlankChars(ctxt)
  ------------------
 8571|   142k|    flags = 0;
 8572|   142k|    isNamespace = (((prefix == NULL) && (name == ctxt->str_xmlns)) ||
  ------------------
  |  Branch (8572:21): [True: 59.6k, False: 82.5k]
  |  Branch (8572:41): [True: 16.6k, False: 43.0k]
  ------------------
 8573|   125k|                   (prefix == ctxt->str_xmlns));
  ------------------
  |  Branch (8573:20): [True: 24.4k, False: 101k]
  ------------------
 8574|   142k|    val = xmlParseAttValueInternal(ctxt, len, &flags, special,
 8575|   142k|                                   isNamespace);
 8576|   142k|    if (val == NULL)
  ------------------
  |  Branch (8576:9): [True: 3.58k, False: 138k]
  ------------------
 8577|  3.58k|        goto error;
 8578|       |
 8579|   138k|    *alloc = (flags & XML_ATTVAL_ALLOC) != 0;
  ------------------
  |  |   98|   138k|#define XML_ATTVAL_ALLOC        (1 << 0)
  ------------------
 8580|       |
 8581|   138k|#ifdef LIBXML_VALID_ENABLED
 8582|   138k|    if ((ctxt->validate) &&
  ------------------
  |  Branch (8582:9): [True: 56.0k, False: 82.5k]
  ------------------
 8583|  56.0k|        (ctxt->standalone == 1) &&
  ------------------
  |  Branch (8583:9): [True: 502, False: 55.5k]
  ------------------
 8584|    502|        (special & XML_SPECIAL_EXTERNAL) &&
  ------------------
  |  |   95|    502|#define XML_SPECIAL_EXTERNAL    (1 << 20)
  ------------------
  |  Branch (8584:9): [True: 95, False: 407]
  ------------------
 8585|     95|        (flags & XML_ATTVAL_NORM_CHANGE)) {
  ------------------
  |  |   99|     95|#define XML_ATTVAL_NORM_CHANGE  (1 << 1)
  ------------------
  |  Branch (8585:9): [True: 37, False: 58]
  ------------------
 8586|     37|        xmlValidityError(ctxt, XML_DTD_NOT_STANDALONE,
 8587|     37|                         "standalone: normalization of attribute %s on %s "
 8588|     37|                         "by external subset declaration\n",
 8589|     37|                         name, elem);
 8590|     37|    }
 8591|   138k|#endif
 8592|       |
 8593|   138k|    if (prefix == ctxt->str_xml) {
  ------------------
  |  Branch (8593:9): [True: 38.3k, False: 100k]
  ------------------
 8594|       |        /*
 8595|       |         * Check that xml:lang conforms to the specification
 8596|       |         * No more registered as an error, just generate a warning now
 8597|       |         * since this was deprecated in XML second edition
 8598|       |         */
 8599|  38.3k|        if ((ctxt->pedantic) && (xmlStrEqual(name, BAD_CAST "lang"))) {
  ------------------
  |  |   34|  33.9k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (8599:13): [True: 33.9k, False: 4.42k]
  |  Branch (8599:33): [True: 31.3k, False: 2.56k]
  ------------------
 8600|  31.3k|            internal_val = xmlStrndup(val, *len);
 8601|  31.3k|            if (internal_val == NULL)
  ------------------
  |  Branch (8601:17): [True: 1, False: 31.3k]
  ------------------
 8602|      1|                goto mem_error;
 8603|  31.3k|            if (!xmlCheckLanguageID(internal_val)) {
  ------------------
  |  Branch (8603:17): [True: 27.7k, False: 3.67k]
  ------------------
 8604|  27.7k|                xmlWarningMsg(ctxt, XML_WAR_LANG_VALUE,
 8605|  27.7k|                              "Malformed value for xml:lang : %s\n",
 8606|  27.7k|                              internal_val, NULL);
 8607|  27.7k|            }
 8608|  31.3k|        }
 8609|       |
 8610|       |        /*
 8611|       |         * Check that xml:space conforms to the specification
 8612|       |         */
 8613|  38.3k|        if (xmlStrEqual(name, BAD_CAST "space")) {
  ------------------
  |  |   34|  38.3k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (8613:13): [True: 811, False: 37.5k]
  ------------------
 8614|    811|            internal_val = xmlStrndup(val, *len);
 8615|    811|            if (internal_val == NULL)
  ------------------
  |  Branch (8615:17): [True: 1, False: 810]
  ------------------
 8616|      1|                goto mem_error;
 8617|    810|            if (xmlStrEqual(internal_val, BAD_CAST "default"))
  ------------------
  |  |   34|    810|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (8617:17): [True: 179, False: 631]
  ------------------
 8618|    179|                *(ctxt->space) = 0;
 8619|    631|            else if (xmlStrEqual(internal_val, BAD_CAST "preserve"))
  ------------------
  |  |   34|    631|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (8619:22): [True: 395, False: 236]
  ------------------
 8620|    395|                *(ctxt->space) = 1;
 8621|    236|            else {
 8622|    236|                xmlWarningMsg(ctxt, XML_WAR_SPACE_VALUE,
 8623|    236|                              "Invalid value \"%s\" for xml:space : \"default\" or \"preserve\" expected\n",
 8624|    236|                              internal_val, NULL);
 8625|    236|            }
 8626|    810|        }
 8627|  38.3k|        if (internal_val) {
  ------------------
  |  Branch (8627:13): [True: 32.2k, False: 6.18k]
  ------------------
 8628|  32.2k|            xmlFree(internal_val);
 8629|  32.2k|        }
 8630|  38.3k|    }
 8631|       |
 8632|   138k|    *value = val;
 8633|   138k|    return (hname);
 8634|       |
 8635|      2|mem_error:
 8636|      2|    xmlErrMemory(ctxt);
 8637|  20.9k|error:
 8638|  20.9k|    if ((val != NULL) && (*alloc != 0))
  ------------------
  |  Branch (8638:9): [True: 2, False: 20.9k]
  |  Branch (8638:26): [True: 1, False: 1]
  ------------------
 8639|      1|        xmlFree(val);
 8640|  20.9k|    return(hname);
 8641|      2|}
parser.c:xmlNsWarn:
  406|  10.2k|{
  407|       |    xmlCtxtErr(ctxt, NULL, XML_FROM_NAMESPACE, error, XML_ERR_WARNING,
  408|  10.2k|               info1, info2, info3, 0, msg, info1, info2, info3);
  409|  10.2k|}
parser.c:xmlCtxtGrowAttrs:
 1849|  19.8k|xmlCtxtGrowAttrs(xmlParserCtxtPtr ctxt) {
 1850|  19.8k|    const xmlChar **atts;
 1851|  19.8k|    unsigned *attallocs;
 1852|  19.8k|    int newSize;
 1853|       |
 1854|  19.8k|    newSize = xmlGrowCapacity(ctxt->maxatts / 5,
 1855|  19.8k|                              sizeof(atts[0]) * 5 + sizeof(attallocs[0]),
 1856|  19.8k|                              10, XML_MAX_ATTRS);
  ------------------
  |  |   93|  19.8k|#define XML_MAX_ATTRS 100000000 /* 100 million */
  ------------------
 1857|  19.8k|    if (newSize < 0) {
  ------------------
  |  Branch (1857:9): [True: 0, False: 19.8k]
  ------------------
 1858|      0|        xmlFatalErr(ctxt, XML_ERR_RESOURCE_LIMIT,
 1859|      0|                    "Maximum number of attributes exceeded");
 1860|      0|        return(-1);
 1861|      0|    }
 1862|       |
 1863|  19.8k|    atts = xmlRealloc(ctxt->atts, newSize * sizeof(atts[0]) * 5);
 1864|  19.8k|    if (atts == NULL)
  ------------------
  |  Branch (1864:9): [True: 4, False: 19.8k]
  ------------------
 1865|      4|        goto mem_error;
 1866|  19.8k|    ctxt->atts = atts;
 1867|       |
 1868|  19.8k|    attallocs = xmlRealloc(ctxt->attallocs,
 1869|  19.8k|                           newSize * sizeof(attallocs[0]));
 1870|  19.8k|    if (attallocs == NULL)
  ------------------
  |  Branch (1870:9): [True: 7, False: 19.8k]
  ------------------
 1871|      7|        goto mem_error;
 1872|  19.8k|    ctxt->attallocs = attallocs;
 1873|       |
 1874|  19.8k|    ctxt->maxatts = newSize * 5;
 1875|       |
 1876|  19.8k|    return(0);
 1877|       |
 1878|     11|mem_error:
 1879|     11|    xmlErrMemory(ctxt);
 1880|     11|    return(-1);
 1881|  19.8k|}
parser.c:xmlAttrHashInsert:
 8657|   249k|                  const xmlChar *uri, unsigned hashValue, int aindex) {
 8658|   249k|    xmlAttrHashBucket *table = ctxt->attrHash;
 8659|   249k|    xmlAttrHashBucket *bucket;
 8660|   249k|    unsigned hindex;
 8661|       |
 8662|   249k|    hindex = hashValue & (size - 1);
 8663|   249k|    bucket = &table[hindex];
 8664|       |
 8665|   282k|    while (bucket->index >= 0) {
  ------------------
  |  Branch (8665:12): [True: 77.9k, False: 204k]
  ------------------
 8666|  77.9k|        const xmlChar **atts = &ctxt->atts[bucket->index];
 8667|       |
 8668|  77.9k|        if (name == atts[0]) {
  ------------------
  |  Branch (8668:13): [True: 45.5k, False: 32.4k]
  ------------------
 8669|  45.5k|            int nsIndex = XML_PTR_TO_INT(atts[2]);
  ------------------
  |  |   58|  45.5k|#define XML_PTR_TO_INT(p) ((XML_INTPTR_T) (p))
  ------------------
 8670|       |
 8671|  45.5k|            if ((nsIndex == NS_INDEX_EMPTY) ? (uri == NULL) :
  ------------------
  |  |   80|  45.5k|#define NS_INDEX_EMPTY  INT_MAX
  ------------------
  |  Branch (8671:17): [True: 7.59k, False: 37.9k]
  |  Branch (8671:17): [True: 44.7k, False: 776]
  ------------------
 8672|  45.5k|                (nsIndex == NS_INDEX_XML) ? (uri == ctxt->str_xml_ns) :
  ------------------
  |  |   81|  37.9k|#define NS_INDEX_XML    (INT_MAX - 1)
  ------------------
  |  Branch (8672:17): [True: 32.0k, False: 5.91k]
  ------------------
 8673|  37.9k|                (uri == ctxt->nsTab[nsIndex * 2 + 1]))
 8674|  44.7k|                return(bucket->index);
 8675|  45.5k|        }
 8676|       |
 8677|  33.1k|        hindex++;
 8678|  33.1k|        bucket++;
 8679|  33.1k|        if (hindex >= size) {
  ------------------
  |  Branch (8679:13): [True: 1.62k, False: 31.5k]
  ------------------
 8680|  1.62k|            hindex = 0;
 8681|  1.62k|            bucket = table;
 8682|  1.62k|        }
 8683|  33.1k|    }
 8684|       |
 8685|   204k|    bucket->index = aindex;
 8686|       |
 8687|       |    return(INT_MAX);
 8688|   249k|}
parser.c:xmlAttrHashInsertQName:
 8693|  5.70k|                       unsigned hashValue, int aindex) {
 8694|  5.70k|    xmlAttrHashBucket *table = ctxt->attrHash;
 8695|  5.70k|    xmlAttrHashBucket *bucket;
 8696|  5.70k|    unsigned hindex;
 8697|       |
 8698|  5.70k|    hindex = hashValue & (size - 1);
 8699|  5.70k|    bucket = &table[hindex];
 8700|       |
 8701|  6.73k|    while (bucket->index >= 0) {
  ------------------
  |  Branch (8701:12): [True: 3.32k, False: 3.40k]
  ------------------
 8702|  3.32k|        const xmlChar **atts = &ctxt->atts[bucket->index];
 8703|       |
 8704|  3.32k|        if ((name == atts[0]) && (prefix == atts[1]))
  ------------------
  |  Branch (8704:13): [True: 2.99k, False: 332]
  |  Branch (8704:34): [True: 2.30k, False: 695]
  ------------------
 8705|  2.30k|            return(bucket->index);
 8706|       |
 8707|  1.02k|        hindex++;
 8708|  1.02k|        bucket++;
 8709|  1.02k|        if (hindex >= size) {
  ------------------
  |  Branch (8709:13): [True: 54, False: 973]
  ------------------
 8710|     54|            hindex = 0;
 8711|     54|            bucket = table;
 8712|     54|        }
 8713|  1.02k|    }
 8714|       |
 8715|  3.40k|    bucket->index = aindex;
 8716|       |
 8717|       |    return(INT_MAX);
 8718|  5.70k|}
parser.c:xmlParserNsLookupUri:
 1536|   573k|xmlParserNsLookupUri(xmlParserCtxtPtr ctxt, const xmlHashedString *prefix) {
 1537|   573k|    const xmlChar *ret;
 1538|   573k|    int nsIndex;
 1539|       |
 1540|   573k|    if (prefix->name == ctxt->str_xml)
  ------------------
  |  Branch (1540:9): [True: 373, False: 573k]
  ------------------
 1541|    373|        return(ctxt->str_xml_ns);
 1542|       |
 1543|       |    /*
 1544|       |     * minNsIndex is used when building an entity tree. We must
 1545|       |     * ignore namespaces declared outside the entity.
 1546|       |     */
 1547|   573k|    nsIndex = xmlParserNsLookup(ctxt, prefix, NULL);
 1548|   573k|    if ((nsIndex == INT_MAX) || (nsIndex < ctxt->nsdb->minNsIndex))
  ------------------
  |  Branch (1548:9): [True: 455k, False: 117k]
  |  Branch (1548:33): [True: 3.89k, False: 113k]
  ------------------
 1549|   459k|        return(NULL);
 1550|       |
 1551|   113k|    ret = ctxt->nsTab[nsIndex * 2 + 1];
 1552|   113k|    if (ret[0] == 0)
  ------------------
  |  Branch (1552:9): [True: 13.0k, False: 100k]
  ------------------
 1553|  13.0k|        ret = NULL;
 1554|   113k|    return(ret);
 1555|   573k|}
parser.c:nameNsPush:
 2061|   741k|{
 2062|   741k|    xmlStartTag *tag;
 2063|       |
 2064|   741k|    if (ctxt->nameNr >= ctxt->nameMax) {
  ------------------
  |  Branch (2064:9): [True: 38.2k, False: 702k]
  ------------------
 2065|  38.2k|        const xmlChar **tmp;
 2066|  38.2k|        xmlStartTag *tmp2;
 2067|  38.2k|        int newSize;
 2068|       |
 2069|  38.2k|        newSize = xmlGrowCapacity(ctxt->nameMax,
 2070|  38.2k|                                  sizeof(tmp[0]) + sizeof(tmp2[0]),
 2071|  38.2k|                                  10, XML_MAX_ITEMS);
  ------------------
  |  |   13|  38.2k|#define XML_MAX_ITEMS 1000000000 /* 1 billion */
  ------------------
 2072|  38.2k|        if (newSize < 0)
  ------------------
  |  Branch (2072:13): [True: 0, False: 38.2k]
  ------------------
 2073|      0|            goto mem_error;
 2074|       |
 2075|  38.2k|        tmp = xmlRealloc(ctxt->nameTab, newSize * sizeof(tmp[0]));
 2076|  38.2k|        if (tmp == NULL)
  ------------------
  |  Branch (2076:13): [True: 14, False: 38.2k]
  ------------------
 2077|     14|	    goto mem_error;
 2078|  38.2k|	ctxt->nameTab = tmp;
 2079|       |
 2080|  38.2k|        tmp2 = xmlRealloc(ctxt->pushTab, newSize * sizeof(tmp2[0]));
 2081|  38.2k|        if (tmp2 == NULL)
  ------------------
  |  Branch (2081:13): [True: 12, False: 38.2k]
  ------------------
 2082|     12|	    goto mem_error;
 2083|  38.2k|	ctxt->pushTab = tmp2;
 2084|       |
 2085|  38.2k|        ctxt->nameMax = newSize;
 2086|   702k|    } else if (ctxt->pushTab == NULL) {
  ------------------
  |  Branch (2086:16): [True: 24.0k, False: 678k]
  ------------------
 2087|  24.0k|        ctxt->pushTab = xmlMalloc(ctxt->nameMax * sizeof(ctxt->pushTab[0]));
 2088|  24.0k|        if (ctxt->pushTab == NULL)
  ------------------
  |  Branch (2088:13): [True: 7, False: 24.0k]
  ------------------
 2089|      7|            goto mem_error;
 2090|  24.0k|    }
 2091|   741k|    ctxt->nameTab[ctxt->nameNr] = value;
 2092|   741k|    ctxt->name = value;
 2093|   741k|    tag = &ctxt->pushTab[ctxt->nameNr];
 2094|   741k|    tag->prefix = prefix;
 2095|   741k|    tag->URI = URI;
 2096|   741k|    tag->line = line;
 2097|   741k|    tag->nsNr = nsNr;
 2098|   741k|    return (ctxt->nameNr++);
 2099|     33|mem_error:
 2100|     33|    xmlErrMemory(ctxt);
 2101|     33|    return (-1);
 2102|   741k|}
parser.c:xmlParseElementEnd:
 9819|   294k|xmlParseElementEnd(xmlParserCtxtPtr ctxt) {
 9820|   294k|    xmlNodePtr cur = ctxt->node;
 9821|       |
 9822|   294k|    if (ctxt->nameNr <= 0) {
  ------------------
  |  Branch (9822:9): [True: 5, False: 294k]
  ------------------
 9823|      5|        if ((RAW == '<') && (NXT(1) == '/'))
  ------------------
  |  | 2224|      5|#define RAW (*ctxt->input->cur)
  ------------------
                      if ((RAW == '<') && (NXT(1) == '/'))
  ------------------
  |  | 2226|      3|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
  |  Branch (9823:13): [True: 3, False: 2]
  |  Branch (9823:29): [True: 2, False: 1]
  ------------------
 9824|      2|            SKIP(2);
  ------------------
  |  | 2248|      2|#define SKIP(val) do {							\
  |  | 2249|      2|    ctxt->input->cur += (val),ctxt->input->col+=(val);			\
  |  | 2250|      2|    if (*ctxt->input->cur == 0)						\
  |  |  ------------------
  |  |  |  Branch (2250:9): [True: 1, False: 1]
  |  |  ------------------
  |  | 2251|      2|        xmlParserGrow(ctxt);						\
  |  | 2252|      2|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2252:12): [Folded, False: 2]
  |  |  ------------------
  ------------------
 9825|      5|        return;
 9826|      5|    }
 9827|       |
 9828|       |    /*
 9829|       |     * parse the end of tag: '</' should be here.
 9830|       |     */
 9831|   294k|    if (ctxt->sax2) {
  ------------------
  |  Branch (9831:9): [True: 230k, False: 64.3k]
  ------------------
 9832|   230k|	xmlParseEndTag2(ctxt, &ctxt->pushTab[ctxt->nameNr - 1]);
 9833|   230k|	namePop(ctxt);
 9834|   230k|    }
 9835|  64.3k|#ifdef LIBXML_SAX1_ENABLED
 9836|  64.3k|    else
 9837|  64.3k|	xmlParseEndTag1(ctxt, 0);
 9838|   294k|#endif /* LIBXML_SAX1_ENABLED */
 9839|       |
 9840|       |    /*
 9841|       |     * Capture end position
 9842|       |     */
 9843|   294k|    if (cur != NULL && ctxt->record_info) {
  ------------------
  |  Branch (9843:9): [True: 218k, False: 75.7k]
  |  Branch (9843:24): [True: 0, False: 218k]
  ------------------
 9844|      0|        xmlParserNodeInfoPtr node_info;
 9845|       |
 9846|      0|        node_info = (xmlParserNodeInfoPtr) xmlParserFindNodeInfo(ctxt, cur);
 9847|      0|        if (node_info != NULL) {
  ------------------
  |  Branch (9847:13): [True: 0, False: 0]
  ------------------
 9848|      0|            node_info->end_pos = ctxt->input->consumed +
 9849|      0|                                 (CUR_PTR - ctxt->input->base);
  ------------------
  |  | 2227|      0|#define CUR_PTR ctxt->input->cur
  ------------------
 9850|      0|            node_info->end_line = ctxt->input->line;
 9851|      0|        }
 9852|      0|    }
 9853|   294k|}
parser.c:xmlParseEndTag2:
 9377|   252k|xmlParseEndTag2(xmlParserCtxtPtr ctxt, const xmlStartTag *tag) {
 9378|   252k|    const xmlChar *name;
 9379|       |
 9380|   252k|    GROW;
  ------------------
  |  | 2271|   252k|    if ((!PARSER_PROGRESSIVE(ctxt)) && \
  |  |  ------------------
  |  |  |  |   47|   252k|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|   252k|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2271:9): [True: 230k, False: 21.9k]
  |  |  ------------------
  |  | 2272|   252k|        (ctxt->input->end - ctxt->input->cur < INPUT_CHUNK)) \
  |  |  ------------------
  |  |  |  |   63|   230k|#define INPUT_CHUNK	250
  |  |  ------------------
  |  |  |  Branch (2272:9): [True: 9.52k, False: 220k]
  |  |  ------------------
  |  | 2273|   252k|	xmlParserGrow(ctxt);
  ------------------
 9381|   252k|    if ((RAW != '<') || (NXT(1) != '/')) {
  ------------------
  |  | 2224|   252k|#define RAW (*ctxt->input->cur)
  ------------------
                  if ((RAW != '<') || (NXT(1) != '/')) {
  ------------------
  |  | 2226|   252k|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
  |  Branch (9381:9): [True: 24, False: 252k]
  |  Branch (9381:25): [True: 25, False: 252k]
  ------------------
 9382|     49|	xmlFatalErr(ctxt, XML_ERR_LTSLASH_REQUIRED, NULL);
 9383|     49|	return;
 9384|     49|    }
 9385|   252k|    SKIP(2);
  ------------------
  |  | 2248|   252k|#define SKIP(val) do {							\
  |  | 2249|   252k|    ctxt->input->cur += (val),ctxt->input->col+=(val);			\
  |  | 2250|   252k|    if (*ctxt->input->cur == 0)						\
  |  |  ------------------
  |  |  |  Branch (2250:9): [True: 693, False: 251k]
  |  |  ------------------
  |  | 2251|   252k|        xmlParserGrow(ctxt);						\
  |  | 2252|   252k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2252:12): [Folded, False: 252k]
  |  |  ------------------
  ------------------
 9386|       |
 9387|   252k|    if (tag->prefix == NULL)
  ------------------
  |  Branch (9387:9): [True: 234k, False: 17.8k]
  ------------------
 9388|   234k|        name = xmlParseNameAndCompare(ctxt, ctxt->name);
 9389|  17.8k|    else
 9390|  17.8k|        name = xmlParseQNameAndCompare(ctxt, ctxt->name, tag->prefix);
 9391|       |
 9392|       |    /*
 9393|       |     * We should definitely be at the ending "S? '>'" part
 9394|       |     */
 9395|   252k|    GROW;
  ------------------
  |  | 2271|   252k|    if ((!PARSER_PROGRESSIVE(ctxt)) && \
  |  |  ------------------
  |  |  |  |   47|   252k|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|   252k|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2271:9): [True: 230k, False: 21.9k]
  |  |  ------------------
  |  | 2272|   252k|        (ctxt->input->end - ctxt->input->cur < INPUT_CHUNK)) \
  |  |  ------------------
  |  |  |  |   63|   230k|#define INPUT_CHUNK	250
  |  |  ------------------
  |  |  |  Branch (2272:9): [True: 9.56k, False: 220k]
  |  |  ------------------
  |  | 2273|   252k|	xmlParserGrow(ctxt);
  ------------------
 9396|   252k|    SKIP_BLANKS;
  ------------------
  |  | 2275|   252k|#define SKIP_BLANKS xmlSkipBlankChars(ctxt)
  ------------------
 9397|   252k|    if ((!IS_BYTE_CHAR(RAW)) || (RAW != '>')) {
  ------------------
  |  |  103|   252k|#define IS_BYTE_CHAR(c)	 xmlIsChar_ch(c)
  |  |  ------------------
  |  |  |  |  108|   252k|#define xmlIsChar_ch(c)		(((0x9 <= (c)) && ((c) <= 0xa)) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (108:28): [True: 236k, False: 15.6k]
  |  |  |  |  |  Branch (108:44): [True: 0, False: 236k]
  |  |  |  |  ------------------
  |  |  |  |  109|   252k|				 ((c) == 0xd) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (109:6): [True: 0, False: 252k]
  |  |  |  |  ------------------
  |  |  |  |  110|   252k|				  (0x20 <= (c)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (110:7): [True: 236k, False: 16.0k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                  if ((!IS_BYTE_CHAR(RAW)) || (RAW != '>')) {
  ------------------
  |  | 2224|   236k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (9397:33): [True: 12.1k, False: 224k]
  ------------------
 9398|  28.2k|	xmlFatalErr(ctxt, XML_ERR_GT_REQUIRED, NULL);
 9399|  28.2k|    } else
 9400|   224k|	NEXT1;
  ------------------
  |  | 2281|   224k|#define NEXT1 {								\
  |  | 2282|   224k|	ctxt->input->col++;						\
  |  | 2283|   224k|	ctxt->input->cur++;						\
  |  | 2284|   224k|	if (*ctxt->input->cur == 0)					\
  |  |  ------------------
  |  |  |  Branch (2284:6): [True: 1.10k, False: 222k]
  |  |  ------------------
  |  | 2285|   224k|	    xmlParserGrow(ctxt);						\
  |  | 2286|   224k|    }
  ------------------
 9401|       |
 9402|       |    /*
 9403|       |     * [ WFC: Element Type Match ]
 9404|       |     * The Name in an element's end-tag must match the element type in the
 9405|       |     * start-tag.
 9406|       |     *
 9407|       |     */
 9408|   252k|    if (name != (xmlChar*)1) {
  ------------------
  |  Branch (9408:9): [True: 20.1k, False: 232k]
  ------------------
 9409|  20.1k|        if (name == NULL) name = BAD_CAST "unparsable";
  ------------------
  |  |   34|  5.46k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (9409:13): [True: 5.46k, False: 14.6k]
  ------------------
 9410|  20.1k|        xmlFatalErrMsgStrIntStr(ctxt, XML_ERR_TAG_NAME_MISMATCH,
 9411|  20.1k|		     "Opening and ending tag mismatch: %s line %d and %s\n",
 9412|  20.1k|		                ctxt->name, tag->line, name);
 9413|  20.1k|    }
 9414|       |
 9415|       |    /*
 9416|       |     * SAX: End of Tag
 9417|       |     */
 9418|   252k|    if ((ctxt->sax != NULL) && (ctxt->sax->endElementNs != NULL) &&
  ------------------
  |  Branch (9418:9): [True: 252k, False: 0]
  |  Branch (9418:32): [True: 252k, False: 0]
  ------------------
 9419|   252k|	(!ctxt->disableSAX))
  ------------------
  |  Branch (9419:2): [True: 177k, False: 74.4k]
  ------------------
 9420|   177k|	ctxt->sax->endElementNs(ctxt->userData, ctxt->name, tag->prefix,
 9421|   177k|                                tag->URI);
 9422|       |
 9423|   252k|    spacePop(ctxt);
 9424|   252k|    if (tag->nsNr != 0)
  ------------------
  |  Branch (9424:9): [True: 69.1k, False: 183k]
  ------------------
 9425|  69.1k|	xmlParserNsPop(ctxt, tag->nsNr);
 9426|   252k|}
parser.c:xmlParseQNameAndCompare:
 8471|  17.8k|                        xmlChar const *prefix) {
 8472|  17.8k|    const xmlChar *cmp;
 8473|  17.8k|    const xmlChar *in;
 8474|  17.8k|    const xmlChar *ret;
 8475|  17.8k|    const xmlChar *prefix2;
 8476|       |
 8477|  17.8k|    if (prefix == NULL) return(xmlParseNameAndCompare(ctxt, name));
  ------------------
  |  Branch (8477:9): [True: 0, False: 17.8k]
  ------------------
 8478|       |
 8479|  17.8k|    GROW;
  ------------------
  |  | 2271|  17.8k|    if ((!PARSER_PROGRESSIVE(ctxt)) && \
  |  |  ------------------
  |  |  |  |   47|  17.8k|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|  17.8k|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2271:9): [True: 12.2k, False: 5.54k]
  |  |  ------------------
  |  | 2272|  17.8k|        (ctxt->input->end - ctxt->input->cur < INPUT_CHUNK)) \
  |  |  ------------------
  |  |  |  |   63|  12.2k|#define INPUT_CHUNK	250
  |  |  ------------------
  |  |  |  Branch (2272:9): [True: 1.60k, False: 10.6k]
  |  |  ------------------
  |  | 2273|  17.8k|	xmlParserGrow(ctxt);
  ------------------
 8480|  17.8k|    in = ctxt->input->cur;
 8481|       |
 8482|  17.8k|    cmp = prefix;
 8483|  35.4k|    while (*in != 0 && *in == *cmp) {
  ------------------
  |  Branch (8483:12): [True: 34.7k, False: 674]
  |  Branch (8483:24): [True: 17.5k, False: 17.1k]
  ------------------
 8484|  17.5k|	++in;
 8485|  17.5k|	++cmp;
 8486|  17.5k|    }
 8487|  17.8k|    if ((*cmp == 0) && (*in == ':')) {
  ------------------
  |  Branch (8487:9): [True: 16.5k, False: 1.26k]
  |  Branch (8487:24): [True: 15.5k, False: 1.05k]
  ------------------
 8488|  15.5k|        in++;
 8489|  15.5k|	cmp = name;
 8490|  32.4k|	while (*in != 0 && *in == *cmp) {
  ------------------
  |  Branch (8490:9): [True: 24.4k, False: 7.95k]
  |  Branch (8490:21): [True: 16.9k, False: 7.57k]
  ------------------
 8491|  16.9k|	    ++in;
 8492|  16.9k|	    ++cmp;
 8493|  16.9k|	}
 8494|  15.5k|	if (*cmp == 0 && (*in == '>' || IS_BLANK_CH (*in))) {
  ------------------
  |  |  137|  7.60k|#define IS_BLANK_CH(c)  xmlIsBlank_ch(c)
  |  |  ------------------
  |  |  |  |   90|  7.60k|#define xmlIsBlank_ch(c)	(((c) == 0x20) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (90:27): [True: 204, False: 7.40k]
  |  |  |  |  ------------------
  |  |  |  |   91|  7.60k|				 ((0x9 <= (c)) && ((c) <= 0xa)) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (91:7): [True: 1.23k, False: 6.17k]
  |  |  |  |  |  Branch (91:23): [True: 209, False: 1.02k]
  |  |  |  |  ------------------
  |  |  |  |   92|  7.60k|				 ((c) == 0xd))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (92:6): [True: 225, False: 6.97k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (8494:6): [True: 10.6k, False: 4.90k]
  |  Branch (8494:20): [True: 3.01k, False: 7.60k]
  ------------------
 8495|       |	    /* success */
 8496|  3.64k|            ctxt->input->col += in - ctxt->input->cur;
 8497|  3.64k|	    ctxt->input->cur = in;
 8498|  3.64k|	    return((const xmlChar*) 1);
 8499|  3.64k|	}
 8500|  15.5k|    }
 8501|       |    /*
 8502|       |     * all strings coms from the dictionary, equality can be done directly
 8503|       |     */
 8504|  14.1k|    ret = xmlParseQName (ctxt, &prefix2);
 8505|  14.1k|    if (ret == NULL)
  ------------------
  |  Branch (8505:9): [True: 697, False: 13.4k]
  ------------------
 8506|    697|        return(NULL);
 8507|  13.4k|    if ((ret == name) && (prefix == prefix2))
  ------------------
  |  Branch (8507:9): [True: 7.85k, False: 5.64k]
  |  Branch (8507:26): [True: 6.90k, False: 943]
  ------------------
 8508|  6.90k|	return((const xmlChar*) 1);
 8509|  6.58k|    return ret;
 8510|  13.4k|}
parser.c:xmlParseQName:
 8448|  14.1k|xmlParseQName(xmlParserCtxtPtr ctxt, const xmlChar **prefix) {
 8449|  14.1k|    xmlHashedString n, p;
 8450|       |
 8451|  14.1k|    n = xmlParseQNameHashed(ctxt, &p);
 8452|  14.1k|    if (n.name == NULL)
  ------------------
  |  Branch (8452:9): [True: 697, False: 13.4k]
  ------------------
 8453|    697|        return(NULL);
 8454|  13.4k|    *prefix = p.name;
 8455|  13.4k|    return(n.name);
 8456|  14.1k|}
parser.c:xmlParseInternalSubset:
 7994|  11.4k|xmlParseInternalSubset(xmlParserCtxtPtr ctxt) {
 7995|       |    /*
 7996|       |     * Is there any DTD definition ?
 7997|       |     */
 7998|  11.4k|    if (RAW == '[') {
  ------------------
  |  | 2224|  11.4k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (7998:9): [True: 11.4k, False: 0]
  ------------------
 7999|  11.4k|        int oldInputNr = ctxt->inputNr;
 8000|       |
 8001|  11.4k|        NEXT;
  ------------------
  |  | 2279|  11.4k|#define NEXT xmlNextChar(ctxt)
  ------------------
 8002|       |	/*
 8003|       |	 * Parse the succession of Markup declarations and
 8004|       |	 * PEReferences.
 8005|       |	 * Subsequence (markupdecl | PEReference | S)*
 8006|       |	 */
 8007|  11.4k|	SKIP_BLANKS;
  ------------------
  |  | 2275|  11.4k|#define SKIP_BLANKS xmlSkipBlankChars(ctxt)
  ------------------
 8008|   627k|        while (1) {
  ------------------
  |  Branch (8008:16): [True: 627k, Folded]
  ------------------
 8009|   627k|            if (PARSER_STOPPED(ctxt)) {
  ------------------
  |  |   44|   627k|#define PARSER_STOPPED(ctxt) ((ctxt)->disableSAX > 1)
  |  |  ------------------
  |  |  |  Branch (44:30): [True: 615, False: 627k]
  |  |  ------------------
  ------------------
 8010|    615|                return;
 8011|   627k|            } else if (ctxt->input->cur >= ctxt->input->end) {
  ------------------
  |  Branch (8011:24): [True: 86.2k, False: 540k]
  ------------------
 8012|  86.2k|                if (ctxt->inputNr <= oldInputNr) {
  ------------------
  |  Branch (8012:21): [True: 1.21k, False: 84.9k]
  ------------------
 8013|  1.21k|                xmlFatalErr(ctxt, XML_ERR_INT_SUBSET_NOT_FINISHED, NULL);
 8014|  1.21k|                    return;
 8015|  1.21k|                }
 8016|  84.9k|                xmlPopPE(ctxt);
 8017|   540k|            } else if ((RAW == ']') && (ctxt->inputNr <= oldInputNr)) {
  ------------------
  |  | 2224|   540k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (8017:24): [True: 7.01k, False: 533k]
  |  Branch (8017:40): [True: 7.01k, False: 2]
  ------------------
 8018|  7.01k|                NEXT;
  ------------------
  |  | 2279|  7.01k|#define NEXT xmlNextChar(ctxt)
  ------------------
 8019|  7.01k|                SKIP_BLANKS;
  ------------------
  |  | 2275|  7.01k|#define SKIP_BLANKS xmlSkipBlankChars(ctxt)
  ------------------
 8020|  7.01k|                break;
 8021|   533k|            } else if ((PARSER_EXTERNAL(ctxt)) &&
  ------------------
  |  |   55|   533k|    (((ctxt)->inSubset == 2) || \
  |  |  ------------------
  |  |  |  Branch (55:6): [True: 0, False: 533k]
  |  |  ------------------
  |  |   56|   533k|     (((ctxt)->input->entity != NULL) && \
  |  |  ------------------
  |  |  |  Branch (56:7): [True: 487k, False: 46.6k]
  |  |  ------------------
  |  |   57|   533k|      ((ctxt)->input->entity->etype == XML_EXTERNAL_PARAMETER_ENTITY)))
  |  |  ------------------
  |  |  |  Branch (57:7): [True: 483k, False: 4.12k]
  |  |  ------------------
  ------------------
 8022|   483k|                       (RAW == '<') && (NXT(1) == '!') && (NXT(2) == '[')) {
  ------------------
  |  | 2224|   483k|#define RAW (*ctxt->input->cur)
  ------------------
                                     (RAW == '<') && (NXT(1) == '!') && (NXT(2) == '[')) {
  ------------------
  |  | 2226|   356k|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
                                     (RAW == '<') && (NXT(1) == '!') && (NXT(2) == '[')) {
  ------------------
  |  | 2226|   348k|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
  |  Branch (8022:24): [True: 356k, False: 126k]
  |  Branch (8022:40): [True: 348k, False: 7.33k]
  |  Branch (8022:59): [True: 3.44k, False: 345k]
  ------------------
 8023|       |                /*
 8024|       |                 * Conditional sections are allowed in external entities
 8025|       |                 * included by PE References in the internal subset.
 8026|       |                 */
 8027|  3.44k|                xmlParseConditionalSections(ctxt);
 8028|   530k|            } else if ((RAW == '<') && ((NXT(1) == '!') || (NXT(1) == '?'))) {
  ------------------
  |  | 2224|   530k|#define RAW (*ctxt->input->cur)
  ------------------
                          } else if ((RAW == '<') && ((NXT(1) == '!') || (NXT(1) == '?'))) {
  ------------------
  |  | 2226|   385k|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
                          } else if ((RAW == '<') && ((NXT(1) == '!') || (NXT(1) == '?'))) {
  ------------------
  |  | 2226|  8.37k|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
  |  Branch (8028:24): [True: 385k, False: 145k]
  |  Branch (8028:41): [True: 376k, False: 8.37k]
  |  Branch (8028:60): [True: 7.77k, False: 598]
  ------------------
 8029|   384k|                xmlParseMarkupDecl(ctxt);
 8030|   384k|            } else if (RAW == '%') {
  ------------------
  |  | 2224|   145k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (8030:24): [True: 143k, False: 2.63k]
  ------------------
 8031|   143k|                xmlParsePERefInternal(ctxt, 1);
 8032|   143k|            } else {
 8033|  2.63k|                xmlFatalErr(ctxt, XML_ERR_INT_SUBSET_NOT_FINISHED, NULL);
 8034|       |
 8035|  3.20k|                while (ctxt->inputNr > oldInputNr)
  ------------------
  |  Branch (8035:24): [True: 564, False: 2.63k]
  ------------------
 8036|    564|                    xmlPopPE(ctxt);
 8037|  2.63k|                return;
 8038|  2.63k|            }
 8039|   616k|            SKIP_BLANKS;
  ------------------
  |  | 2275|   616k|#define SKIP_BLANKS xmlSkipBlankChars(ctxt)
  ------------------
 8040|   616k|            SHRINK;
  ------------------
  |  | 2267|   616k|    if (!PARSER_PROGRESSIVE(ctxt)) \
  |  |  ------------------
  |  |  |  |   47|   616k|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|   616k|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2267:9): [True: 574k, False: 41.4k]
  |  |  ------------------
  |  | 2268|   616k|	xmlParserShrink(ctxt);
  ------------------
 8041|   616k|            GROW;
  ------------------
  |  | 2271|   616k|    if ((!PARSER_PROGRESSIVE(ctxt)) && \
  |  |  ------------------
  |  |  |  |   47|   616k|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|   616k|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2271:9): [True: 574k, False: 41.4k]
  |  |  ------------------
  |  | 2272|   616k|        (ctxt->input->end - ctxt->input->cur < INPUT_CHUNK)) \
  |  |  ------------------
  |  |  |  |   63|   574k|#define INPUT_CHUNK	250
  |  |  ------------------
  |  |  |  Branch (2272:9): [True: 395k, False: 179k]
  |  |  ------------------
  |  | 2273|   616k|	xmlParserGrow(ctxt);
  ------------------
 8042|   616k|        }
 8043|  11.4k|    }
 8044|       |
 8045|       |    /*
 8046|       |     * We should be at the end of the DOCTYPE declaration.
 8047|       |     */
 8048|  7.01k|    if (RAW != '>') {
  ------------------
  |  | 2224|  7.01k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (8048:9): [True: 105, False: 6.90k]
  ------------------
 8049|    105|        xmlFatalErr(ctxt, XML_ERR_DOCTYPE_NOT_FINISHED, NULL);
 8050|    105|        return;
 8051|    105|    }
 8052|  6.90k|    NEXT;
  ------------------
  |  | 2279|  6.90k|#define NEXT xmlNextChar(ctxt)
  ------------------
 8053|  6.90k|}
parser.c:xmlCleanSpecialAttr:
 1194|  16.0k|{
 1195|  16.0k|    if (ctxt->attsSpecial == NULL)
  ------------------
  |  Branch (1195:9): [True: 13.3k, False: 2.77k]
  ------------------
 1196|  13.3k|        return;
 1197|       |
 1198|  2.77k|    xmlHashScanFull(ctxt->attsSpecial, xmlCleanSpecialAttrCallback, ctxt);
 1199|       |
 1200|  2.77k|    if (xmlHashSize(ctxt->attsSpecial) == 0) {
  ------------------
  |  Branch (1200:9): [True: 163, False: 2.60k]
  ------------------
 1201|    163|        xmlHashFree(ctxt->attsSpecial, NULL);
 1202|       |        ctxt->attsSpecial = NULL;
 1203|    163|    }
 1204|  2.77k|}
parser.c:xmlCleanSpecialAttrCallback:
 1177|  18.3k|                            const xmlChar *unused ATTRIBUTE_UNUSED) {
 1178|  18.3k|    xmlParserCtxtPtr ctxt = (xmlParserCtxtPtr) data;
 1179|       |
 1180|  18.3k|    if (XML_PTR_TO_INT(payload) == XML_ATTRIBUTE_CDATA) {
  ------------------
  |  |   58|  18.3k|#define XML_PTR_TO_INT(p) ((XML_INTPTR_T) (p))
  ------------------
  |  Branch (1180:9): [True: 1.69k, False: 16.6k]
  ------------------
 1181|       |        xmlHashRemoveEntry2(ctxt->attsSpecial, fullname, fullattr, NULL);
 1182|  1.69k|    }
 1183|  18.3k|}
parser.c:xmlFinishDocument:
10351|  20.5k|xmlFinishDocument(xmlParserCtxtPtr ctxt) {
10352|  20.5k|    xmlDocPtr doc;
10353|       |
10354|       |    /*
10355|       |     * SAX: end of the document processing.
10356|       |     */
10357|  20.5k|    if ((ctxt->sax) && (ctxt->sax->endDocument != NULL))
  ------------------
  |  Branch (10357:9): [True: 20.5k, False: 0]
  |  Branch (10357:24): [True: 20.5k, False: 0]
  ------------------
10358|  20.5k|        ctxt->sax->endDocument(ctxt->userData);
10359|       |
10360|       |    /*
10361|       |     * Remove locally kept entity definitions if the tree was not built
10362|       |     */
10363|  20.5k|    doc = ctxt->myDoc;
10364|  20.5k|    if ((doc != NULL) &&
  ------------------
  |  Branch (10364:9): [True: 20.4k, False: 55]
  ------------------
10365|  20.4k|        (xmlStrEqual(doc->version, SAX_COMPAT_MODE))) {
  ------------------
  |  |  173|  20.4k|#define SAX_COMPAT_MODE BAD_CAST "SAX compatibility mode document"
  |  |  ------------------
  |  |  |  |   34|  20.4k|#define BAD_CAST (xmlChar *)
  |  |  ------------------
  ------------------
  |  Branch (10365:9): [True: 16, False: 20.4k]
  ------------------
10366|     16|        xmlFreeDoc(doc);
10367|       |        ctxt->myDoc = NULL;
10368|     16|    }
10369|  20.5k|}
parser.c:xmlParseTryOrFinish:
10830|   369k|xmlParseTryOrFinish(xmlParserCtxtPtr ctxt, int terminate) {
10831|   369k|    int ret = 0;
10832|   369k|    size_t avail;
10833|   369k|    xmlChar cur, next;
10834|       |
10835|   369k|    if (ctxt->input == NULL)
  ------------------
  |  Branch (10835:9): [True: 0, False: 369k]
  ------------------
10836|      0|        return(0);
10837|       |
10838|   369k|    if ((ctxt->input != NULL) &&
  ------------------
  |  Branch (10838:9): [True: 369k, False: 0]
  ------------------
10839|   369k|        (ctxt->input->cur - ctxt->input->base > 4096)) {
  ------------------
  |  Branch (10839:9): [True: 2.28k, False: 367k]
  ------------------
10840|  2.28k|        xmlParserShrink(ctxt);
10841|  2.28k|    }
10842|       |
10843|  4.71M|    while (ctxt->disableSAX == 0) {
  ------------------
  |  Branch (10843:12): [True: 4.70M, False: 9.04k]
  ------------------
10844|  4.70M|        avail = ctxt->input->end - ctxt->input->cur;
10845|  4.70M|        if (avail < 1)
  ------------------
  |  Branch (10845:13): [True: 18.3k, False: 4.68M]
  ------------------
10846|  18.3k|	    goto done;
10847|  4.68M|        switch (ctxt->instate) {
10848|  4.08k|            case XML_PARSER_EOF:
  ------------------
  |  Branch (10848:13): [True: 4.08k, False: 4.67M]
  ------------------
10849|       |	        /*
10850|       |		 * Document parsing is done !
10851|       |		 */
10852|  4.08k|	        goto done;
10853|  31.8k|            case XML_PARSER_START:
  ------------------
  |  Branch (10853:13): [True: 31.8k, False: 4.65M]
  ------------------
10854|       |                /*
10855|       |                 * Very first chars read from the document flow.
10856|       |                 */
10857|  31.8k|                if ((!terminate) && (avail < 4))
  ------------------
  |  Branch (10857:21): [True: 30.8k, False: 930]
  |  Branch (10857:37): [True: 381, False: 30.5k]
  ------------------
10858|    381|                    goto done;
10859|       |
10860|       |                /*
10861|       |                 * We need more bytes to detect EBCDIC code pages.
10862|       |                 * See xmlDetectEBCDIC.
10863|       |                 */
10864|  31.4k|                if ((CMP4(CUR_PTR, 0x4C, 0x6F, 0xA7, 0x94)) &&
  ------------------
  |  | 2231|  31.4k|  ( ((unsigned char *) s)[ 0 ] == c1 && ((unsigned char *) s)[ 1 ] == c2 && \
  |  |  ------------------
  |  |  |  Branch (2231:5): [True: 672, False: 30.7k]
  |  |  |  Branch (2231:41): [True: 655, False: 17]
  |  |  ------------------
  |  | 2232|  31.4k|    ((unsigned char *) s)[ 2 ] == c3 && ((unsigned char *) s)[ 3 ] == c4 )
  |  |  ------------------
  |  |  |  Branch (2232:5): [True: 640, False: 15]
  |  |  |  Branch (2232:41): [True: 632, False: 8]
  |  |  ------------------
  ------------------
10865|    632|                    (!terminate) && (avail < 200))
  ------------------
  |  Branch (10865:21): [True: 328, False: 304]
  |  Branch (10865:37): [True: 301, False: 27]
  ------------------
10866|    301|                    goto done;
10867|       |
10868|  31.1k|                xmlDetectEncoding(ctxt);
10869|  31.1k|                ctxt->instate = XML_PARSER_XML_DECL;
10870|  31.1k|		break;
10871|       |
10872|  42.8k|            case XML_PARSER_XML_DECL:
  ------------------
  |  Branch (10872:13): [True: 42.8k, False: 4.64M]
  ------------------
10873|  42.8k|		if ((!terminate) && (avail < 2))
  ------------------
  |  Branch (10873:7): [True: 40.9k, False: 1.84k]
  |  Branch (10873:23): [True: 3, False: 40.9k]
  ------------------
10874|      3|		    goto done;
10875|  42.8k|		cur = ctxt->input->cur[0];
10876|  42.8k|		next = ctxt->input->cur[1];
10877|  42.8k|	        if ((cur == '<') && (next == '?')) {
  ------------------
  |  Branch (10877:14): [True: 42.1k, False: 712]
  |  Branch (10877:30): [True: 19.5k, False: 22.5k]
  ------------------
10878|       |		    /* PI or XML decl */
10879|  19.5k|		    if ((!terminate) &&
  ------------------
  |  Branch (10879:11): [True: 18.3k, False: 1.24k]
  ------------------
10880|  18.3k|                        (!xmlParseLookupString(ctxt, 2, "?>", 2)))
  ------------------
  |  Branch (10880:25): [True: 11.7k, False: 6.60k]
  ------------------
10881|  11.7k|			goto done;
10882|  7.85k|		    if ((ctxt->input->cur[2] == 'x') &&
  ------------------
  |  Branch (10882:11): [True: 6.42k, False: 1.43k]
  ------------------
10883|  6.42k|			(ctxt->input->cur[3] == 'm') &&
  ------------------
  |  Branch (10883:4): [True: 5.63k, False: 784]
  ------------------
10884|  5.63k|			(ctxt->input->cur[4] == 'l') &&
  ------------------
  |  Branch (10884:4): [True: 2.98k, False: 2.65k]
  ------------------
10885|  2.98k|			(IS_BLANK_CH(ctxt->input->cur[5]))) {
  ------------------
  |  |  137|  2.98k|#define IS_BLANK_CH(c)  xmlIsBlank_ch(c)
  |  |  ------------------
  |  |  |  |   90|  2.98k|#define xmlIsBlank_ch(c)	(((c) == 0x20) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (90:27): [True: 2.85k, False: 129]
  |  |  |  |  ------------------
  |  |  |  |   91|  2.98k|				 ((0x9 <= (c)) && ((c) <= 0xa)) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (91:7): [True: 125, False: 4]
  |  |  |  |  |  Branch (91:23): [True: 21, False: 104]
  |  |  |  |  ------------------
  |  |  |  |   92|  2.98k|				 ((c) == 0xd))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (92:6): [True: 7, False: 101]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
10886|  2.88k|			ret += 5;
10887|  2.88k|			xmlParseXMLDecl(ctxt);
10888|  4.97k|		    } else {
10889|  4.97k|			ctxt->version = xmlCharStrdup(XML_DEFAULT_VERSION);
  ------------------
  |  |   42|  4.97k|#define XML_DEFAULT_VERSION	"1.0"
  ------------------
10890|  4.97k|                        if (ctxt->version == NULL) {
  ------------------
  |  Branch (10890:29): [True: 3, False: 4.96k]
  ------------------
10891|      3|                            xmlErrMemory(ctxt);
10892|      3|                            break;
10893|      3|                        }
10894|  4.97k|		    }
10895|  23.2k|		} else {
10896|  23.2k|		    ctxt->version = xmlCharStrdup(XML_DEFAULT_VERSION);
  ------------------
  |  |   42|  23.2k|#define XML_DEFAULT_VERSION	"1.0"
  ------------------
10897|  23.2k|		    if (ctxt->version == NULL) {
  ------------------
  |  Branch (10897:11): [True: 3, False: 23.2k]
  ------------------
10898|      3|		        xmlErrMemory(ctxt);
10899|      3|			break;
10900|      3|		    }
10901|  23.2k|		}
10902|  31.0k|                if ((ctxt->sax) && (ctxt->sax->setDocumentLocator)) {
  ------------------
  |  Branch (10902:21): [True: 31.0k, False: 0]
  |  Branch (10902:36): [True: 31.0k, False: 0]
  ------------------
10903|  31.0k|                    ctxt->sax->setDocumentLocator(ctxt->userData,
10904|  31.0k|                            (xmlSAXLocator *) &xmlDefaultSAXLocator);
10905|  31.0k|                }
10906|  31.0k|                if ((ctxt->sax) && (ctxt->sax->startDocument) &&
  ------------------
  |  Branch (10906:21): [True: 31.0k, False: 0]
  |  Branch (10906:36): [True: 31.0k, False: 0]
  ------------------
10907|  31.0k|                    (!ctxt->disableSAX))
  ------------------
  |  Branch (10907:21): [True: 30.7k, False: 289]
  ------------------
10908|  30.7k|                    ctxt->sax->startDocument(ctxt->userData);
10909|  31.0k|                ctxt->instate = XML_PARSER_MISC;
10910|  31.0k|		break;
10911|   486k|            case XML_PARSER_START_TAG: {
  ------------------
  |  Branch (10911:13): [True: 486k, False: 4.19M]
  ------------------
10912|   486k|	        const xmlChar *name;
10913|   486k|		const xmlChar *prefix = NULL;
10914|   486k|		const xmlChar *URI = NULL;
10915|   486k|                int line = ctxt->input->line;
10916|   486k|		int nbNs = 0;
10917|       |
10918|   486k|		if ((!terminate) && (avail < 2))
  ------------------
  |  Branch (10918:7): [True: 418k, False: 67.7k]
  |  Branch (10918:23): [True: 99, False: 418k]
  ------------------
10919|     99|		    goto done;
10920|   486k|		cur = ctxt->input->cur[0];
10921|   486k|	        if (cur != '<') {
  ------------------
  |  Branch (10921:14): [True: 1.80k, False: 484k]
  ------------------
10922|  1.80k|		    xmlFatalErrMsg(ctxt, XML_ERR_DOCUMENT_EMPTY,
10923|  1.80k|                                   "Start tag expected, '<' not found");
10924|  1.80k|                    ctxt->instate = XML_PARSER_EOF;
10925|  1.80k|                    xmlFinishDocument(ctxt);
10926|  1.80k|		    goto done;
10927|  1.80k|		}
10928|   484k|		if ((!terminate) && (!xmlParseLookupGt(ctxt)))
  ------------------
  |  Branch (10928:7): [True: 418k, False: 66.3k]
  |  Branch (10928:23): [True: 212k, False: 205k]
  ------------------
10929|   212k|                    goto done;
10930|   272k|		if (ctxt->spaceNr == 0)
  ------------------
  |  Branch (10930:7): [True: 0, False: 272k]
  ------------------
10931|      0|		    spacePush(ctxt, -1);
10932|   272k|		else if (*ctxt->space == -2)
  ------------------
  |  Branch (10932:12): [True: 52.2k, False: 219k]
  ------------------
10933|  52.2k|		    spacePush(ctxt, -1);
10934|   219k|		else
10935|   219k|		    spacePush(ctxt, *ctxt->space);
10936|   272k|#ifdef LIBXML_SAX1_ENABLED
10937|   272k|		if (ctxt->sax2)
  ------------------
  |  Branch (10937:7): [True: 183k, False: 88.6k]
  ------------------
10938|   183k|#endif /* LIBXML_SAX1_ENABLED */
10939|   183k|		    name = xmlParseStartTag2(ctxt, &prefix, &URI, &nbNs);
10940|  88.6k|#ifdef LIBXML_SAX1_ENABLED
10941|  88.6k|		else
10942|  88.6k|		    name = xmlParseStartTag(ctxt);
10943|   272k|#endif /* LIBXML_SAX1_ENABLED */
10944|   272k|		if (name == NULL) {
  ------------------
  |  Branch (10944:7): [True: 1.53k, False: 270k]
  ------------------
10945|  1.53k|		    spacePop(ctxt);
10946|  1.53k|                    ctxt->instate = XML_PARSER_EOF;
10947|  1.53k|                    xmlFinishDocument(ctxt);
10948|  1.53k|		    goto done;
10949|  1.53k|		}
10950|   270k|#ifdef LIBXML_VALID_ENABLED
10951|       |		/*
10952|       |		 * [ VC: Root Element Type ]
10953|       |		 * The Name in the document type declaration must match
10954|       |		 * the element type of the root element.
10955|       |		 */
10956|   270k|		if (ctxt->validate && ctxt->wellFormed && ctxt->myDoc &&
  ------------------
  |  Branch (10956:7): [True: 122k, False: 148k]
  |  Branch (10956:25): [True: 96.7k, False: 25.7k]
  |  Branch (10956:45): [True: 96.7k, False: 0]
  ------------------
10957|  96.7k|		    ctxt->node && (ctxt->node == ctxt->myDoc->children))
  ------------------
  |  Branch (10957:7): [True: 96.7k, False: 0]
  |  Branch (10957:21): [True: 0, False: 96.7k]
  ------------------
10958|      0|		    ctxt->valid &= xmlValidateRoot(&ctxt->vctxt, ctxt->myDoc);
10959|   270k|#endif /* LIBXML_VALID_ENABLED */
10960|       |
10961|       |		/*
10962|       |		 * Check for an Empty Element.
10963|       |		 */
10964|   270k|		if ((RAW == '/') && (NXT(1) == '>')) {
  ------------------
  |  | 2224|   270k|#define RAW (*ctxt->input->cur)
  ------------------
              		if ((RAW == '/') && (NXT(1) == '>')) {
  ------------------
  |  | 2226|  84.4k|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
  |  Branch (10964:7): [True: 84.4k, False: 186k]
  |  Branch (10964:23): [True: 81.6k, False: 2.82k]
  ------------------
10965|  81.6k|		    SKIP(2);
  ------------------
  |  | 2248|  81.6k|#define SKIP(val) do {							\
  |  | 2249|  81.6k|    ctxt->input->cur += (val),ctxt->input->col+=(val);			\
  |  | 2250|  81.6k|    if (*ctxt->input->cur == 0)						\
  |  |  ------------------
  |  |  |  Branch (2250:9): [True: 792, False: 80.8k]
  |  |  ------------------
  |  | 2251|  81.6k|        xmlParserGrow(ctxt);						\
  |  | 2252|  81.6k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2252:12): [Folded, False: 81.6k]
  |  |  ------------------
  ------------------
10966|       |
10967|  81.6k|		    if (ctxt->sax2) {
  ------------------
  |  Branch (10967:11): [True: 64.0k, False: 17.5k]
  ------------------
10968|  64.0k|			if ((ctxt->sax != NULL) &&
  ------------------
  |  Branch (10968:8): [True: 64.0k, False: 0]
  ------------------
10969|  64.0k|			    (ctxt->sax->endElementNs != NULL) &&
  ------------------
  |  Branch (10969:8): [True: 64.0k, False: 0]
  ------------------
10970|  64.0k|			    (!ctxt->disableSAX))
  ------------------
  |  Branch (10970:8): [True: 64.0k, False: 41]
  ------------------
10971|  64.0k|			    ctxt->sax->endElementNs(ctxt->userData, name,
10972|  64.0k|			                            prefix, URI);
10973|  64.0k|			if (nbNs > 0)
  ------------------
  |  Branch (10973:8): [True: 4.36k, False: 59.6k]
  ------------------
10974|  4.36k|			    xmlParserNsPop(ctxt, nbNs);
10975|  64.0k|#ifdef LIBXML_SAX1_ENABLED
10976|  64.0k|		    } else {
10977|  17.5k|			if ((ctxt->sax != NULL) &&
  ------------------
  |  Branch (10977:8): [True: 17.5k, False: 0]
  ------------------
10978|  17.5k|			    (ctxt->sax->endElement != NULL) &&
  ------------------
  |  Branch (10978:8): [True: 17.5k, False: 0]
  ------------------
10979|  17.5k|			    (!ctxt->disableSAX))
  ------------------
  |  Branch (10979:8): [True: 17.5k, False: 20]
  ------------------
10980|  17.5k|			    ctxt->sax->endElement(ctxt->userData, name);
10981|  17.5k|#endif /* LIBXML_SAX1_ENABLED */
10982|  17.5k|		    }
10983|  81.6k|		    spacePop(ctxt);
10984|   189k|		} else if (RAW == '>') {
  ------------------
  |  | 2224|   189k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (10984:14): [True: 147k, False: 41.5k]
  ------------------
10985|   147k|		    NEXT;
  ------------------
  |  | 2279|   147k|#define NEXT xmlNextChar(ctxt)
  ------------------
10986|   147k|                    nameNsPush(ctxt, name, prefix, URI, line, nbNs);
10987|   147k|		} else {
10988|  41.5k|		    xmlFatalErrMsgStr(ctxt, XML_ERR_GT_REQUIRED,
10989|  41.5k|					 "Couldn't find end of Start Tag %s\n",
10990|  41.5k|					 name);
10991|  41.5k|		    nodePop(ctxt);
10992|  41.5k|		    spacePop(ctxt);
10993|  41.5k|                    if (nbNs > 0)
  ------------------
  |  Branch (10993:25): [True: 4.36k, False: 37.1k]
  ------------------
10994|  4.36k|                        xmlParserNsPop(ctxt, nbNs);
10995|  41.5k|		}
10996|       |
10997|   270k|                if (ctxt->nameNr == 0)
  ------------------
  |  Branch (10997:21): [True: 6.76k, False: 263k]
  ------------------
10998|  6.76k|                    ctxt->instate = XML_PARSER_EPILOG;
10999|   263k|                else
11000|   263k|                    ctxt->instate = XML_PARSER_CONTENT;
11001|   270k|                break;
11002|   272k|	    }
11003|  3.88M|            case XML_PARSER_CONTENT: {
  ------------------
  |  Branch (11003:13): [True: 3.88M, False: 795k]
  ------------------
11004|  3.88M|		cur = ctxt->input->cur[0];
11005|       |
11006|  3.88M|		if (cur == '<') {
  ------------------
  |  Branch (11006:7): [True: 378k, False: 3.50M]
  ------------------
11007|   378k|                    if ((!terminate) && (avail < 2))
  ------------------
  |  Branch (11007:25): [True: 298k, False: 79.7k]
  |  Branch (11007:41): [True: 983, False: 297k]
  ------------------
11008|    983|                        goto done;
11009|   377k|		    next = ctxt->input->cur[1];
11010|       |
11011|   377k|                    if (next == '/') {
  ------------------
  |  Branch (11011:25): [True: 34.0k, False: 343k]
  ------------------
11012|  34.0k|                        ctxt->instate = XML_PARSER_END_TAG;
11013|  34.0k|                        break;
11014|   343k|                    } else if (next == '?') {
  ------------------
  |  Branch (11014:32): [True: 19.9k, False: 323k]
  ------------------
11015|  19.9k|                        if ((!terminate) &&
  ------------------
  |  Branch (11015:29): [True: 17.7k, False: 2.20k]
  ------------------
11016|  17.7k|                            (!xmlParseLookupString(ctxt, 2, "?>", 2)))
  ------------------
  |  Branch (11016:29): [True: 5.00k, False: 12.7k]
  ------------------
11017|  5.00k|                            goto done;
11018|  14.9k|                        xmlParsePI(ctxt);
11019|  14.9k|                        ctxt->instate = XML_PARSER_CONTENT;
11020|  14.9k|                        break;
11021|   323k|                    } else if (next == '!') {
  ------------------
  |  Branch (11021:32): [True: 74.4k, False: 248k]
  ------------------
11022|  74.4k|                        if ((!terminate) && (avail < 3))
  ------------------
  |  Branch (11022:29): [True: 66.2k, False: 8.17k]
  |  Branch (11022:45): [True: 161, False: 66.1k]
  ------------------
11023|    161|                            goto done;
11024|  74.3k|                        next = ctxt->input->cur[2];
11025|       |
11026|  74.3k|                        if (next == '-') {
  ------------------
  |  Branch (11026:29): [True: 59.0k, False: 15.2k]
  ------------------
11027|  59.0k|                            if ((!terminate) && (avail < 4))
  ------------------
  |  Branch (11027:33): [True: 54.4k, False: 4.61k]
  |  Branch (11027:49): [True: 120, False: 54.2k]
  ------------------
11028|    120|                                goto done;
11029|  58.9k|                            if (ctxt->input->cur[3] == '-') {
  ------------------
  |  Branch (11029:33): [True: 58.8k, False: 18]
  ------------------
11030|  58.8k|                                if ((!terminate) &&
  ------------------
  |  Branch (11030:37): [True: 54.2k, False: 4.60k]
  ------------------
11031|  54.2k|                                    (!xmlParseLookupString(ctxt, 4, "-->", 3)))
  ------------------
  |  Branch (11031:37): [True: 3.57k, False: 50.7k]
  ------------------
11032|  3.57k|                                    goto done;
11033|  55.3k|                                xmlParseComment(ctxt);
11034|  55.3k|                                ctxt->instate = XML_PARSER_CONTENT;
11035|  55.3k|                                break;
11036|  58.8k|                            }
11037|  58.9k|                        } else if (next == '[') {
  ------------------
  |  Branch (11037:36): [True: 15.0k, False: 244]
  ------------------
11038|  15.0k|                            if ((!terminate) && (avail < 9))
  ------------------
  |  Branch (11038:33): [True: 11.5k, False: 3.47k]
  |  Branch (11038:49): [True: 93, False: 11.4k]
  ------------------
11039|     93|                                goto done;
11040|  14.9k|                            if ((ctxt->input->cur[2] == '[') &&
  ------------------
  |  Branch (11040:33): [True: 14.9k, False: 0]
  ------------------
11041|  14.9k|                                (ctxt->input->cur[3] == 'C') &&
  ------------------
  |  Branch (11041:33): [True: 14.9k, False: 21]
  ------------------
11042|  14.9k|                                (ctxt->input->cur[4] == 'D') &&
  ------------------
  |  Branch (11042:33): [True: 14.9k, False: 8]
  ------------------
11043|  14.9k|                                (ctxt->input->cur[5] == 'A') &&
  ------------------
  |  Branch (11043:33): [True: 14.9k, False: 7]
  ------------------
11044|  14.9k|                                (ctxt->input->cur[6] == 'T') &&
  ------------------
  |  Branch (11044:33): [True: 14.8k, False: 12]
  ------------------
11045|  14.8k|                                (ctxt->input->cur[7] == 'A') &&
  ------------------
  |  Branch (11045:33): [True: 14.8k, False: 8]
  ------------------
11046|  14.8k|                                (ctxt->input->cur[8] == '[')) {
  ------------------
  |  Branch (11046:33): [True: 14.8k, False: 11]
  ------------------
11047|  14.8k|                                if ((!terminate) &&
  ------------------
  |  Branch (11047:37): [True: 11.4k, False: 3.43k]
  ------------------
11048|  11.4k|                                    (!xmlParseLookupString(ctxt, 9, "]]>", 3)))
  ------------------
  |  Branch (11048:37): [True: 5.84k, False: 5.59k]
  ------------------
11049|  5.84k|                                    goto done;
11050|  9.02k|                                ctxt->instate = XML_PARSER_CDATA_SECTION;
11051|  9.02k|                                xmlParseCDSect(ctxt);
11052|  9.02k|                                ctxt->instate = XML_PARSER_CONTENT;
11053|  9.02k|                                break;
11054|  14.8k|                            }
11055|  14.9k|                        }
11056|  74.3k|                    }
11057|  3.50M|		} else if (cur == '&') {
  ------------------
  |  Branch (11057:14): [True: 41.4k, False: 3.46M]
  ------------------
11058|  41.4k|		    if ((!terminate) && (!xmlParseLookupChar(ctxt, ';')))
  ------------------
  |  Branch (11058:11): [True: 32.8k, False: 8.61k]
  |  Branch (11058:27): [True: 17.1k, False: 15.7k]
  ------------------
11059|  17.1k|			goto done;
11060|  24.3k|		    xmlParseReference(ctxt);
11061|  24.3k|                    break;
11062|  3.46M|		} else {
11063|       |		    /* TODO Avoid the extra copy, handle directly !!! */
11064|       |		    /*
11065|       |		     * Goal of the following test is:
11066|       |		     *  - minimize calls to the SAX 'character' callback
11067|       |		     *    when they are mergeable
11068|       |		     *  - handle an problem for isBlank when we only parse
11069|       |		     *    a sequence of blank chars and the next one is
11070|       |		     *    not available to check against '<' presence.
11071|       |		     *  - tries to homogenize the differences in SAX
11072|       |		     *    callbacks between the push and pull versions
11073|       |		     *    of the parser.
11074|       |		     */
11075|  3.46M|		    if (avail < XML_PARSER_BIG_BUFFER_SIZE) {
  ------------------
  |  |  171|  3.46M|#define XML_PARSER_BIG_BUFFER_SIZE 300
  ------------------
  |  Branch (11075:11): [True: 103k, False: 3.36M]
  ------------------
11076|   103k|			if ((!terminate) && (!xmlParseLookupCharData(ctxt)))
  ------------------
  |  Branch (11076:8): [True: 83.6k, False: 19.8k]
  |  Branch (11076:24): [True: 7.48k, False: 76.1k]
  ------------------
11077|  7.48k|			    goto done;
11078|   103k|                    }
11079|  3.46M|                    ctxt->checkIndex = 0;
11080|  3.46M|		    xmlParseCharDataInternal(ctxt, !terminate);
11081|  3.46M|                    break;
11082|  3.46M|		}
11083|       |
11084|   249k|                ctxt->instate = XML_PARSER_START_TAG;
11085|   249k|		break;
11086|  3.88M|	    }
11087|  38.2k|            case XML_PARSER_END_TAG:
  ------------------
  |  Branch (11087:13): [True: 38.2k, False: 4.64M]
  ------------------
11088|  38.2k|		if ((!terminate) && (!xmlParseLookupChar(ctxt, '>')))
  ------------------
  |  Branch (11088:7): [True: 27.9k, False: 10.2k]
  |  Branch (11088:23): [True: 5.10k, False: 22.8k]
  ------------------
11089|  5.10k|		    goto done;
11090|  33.1k|		if (ctxt->sax2) {
  ------------------
  |  Branch (11090:7): [True: 21.9k, False: 11.1k]
  ------------------
11091|  21.9k|	            xmlParseEndTag2(ctxt, &ctxt->pushTab[ctxt->nameNr - 1]);
11092|  21.9k|		    nameNsPop(ctxt);
11093|  21.9k|		}
11094|  11.1k|#ifdef LIBXML_SAX1_ENABLED
11095|  11.1k|		  else
11096|  11.1k|		    xmlParseEndTag1(ctxt, 0);
11097|  33.1k|#endif /* LIBXML_SAX1_ENABLED */
11098|  33.1k|		if (ctxt->nameNr == 0) {
  ------------------
  |  Branch (11098:7): [True: 2.14k, False: 31.0k]
  ------------------
11099|  2.14k|		    ctxt->instate = XML_PARSER_EPILOG;
11100|  31.0k|		} else {
11101|  31.0k|		    ctxt->instate = XML_PARSER_CONTENT;
11102|  31.0k|		}
11103|  33.1k|		break;
11104|  80.8k|            case XML_PARSER_MISC:
  ------------------
  |  Branch (11104:13): [True: 80.8k, False: 4.60M]
  ------------------
11105|   153k|            case XML_PARSER_PROLOG:
  ------------------
  |  Branch (11105:13): [True: 72.2k, False: 4.61M]
  ------------------
11106|   157k|            case XML_PARSER_EPILOG:
  ------------------
  |  Branch (11106:13): [True: 4.71k, False: 4.67M]
  ------------------
11107|   157k|		SKIP_BLANKS;
  ------------------
  |  | 2275|   157k|#define SKIP_BLANKS xmlSkipBlankChars(ctxt)
  ------------------
11108|   157k|                avail = ctxt->input->end - ctxt->input->cur;
11109|   157k|		if (avail < 1)
  ------------------
  |  Branch (11109:7): [True: 2.75k, False: 155k]
  ------------------
11110|  2.75k|		    goto done;
11111|   155k|		if (ctxt->input->cur[0] == '<') {
  ------------------
  |  Branch (11111:7): [True: 151k, False: 3.30k]
  ------------------
11112|   151k|                    if ((!terminate) && (avail < 2))
  ------------------
  |  Branch (11112:25): [True: 147k, False: 4.23k]
  |  Branch (11112:41): [True: 178, False: 147k]
  ------------------
11113|    178|                        goto done;
11114|   151k|                    next = ctxt->input->cur[1];
11115|   151k|                    if (next == '?') {
  ------------------
  |  Branch (11115:25): [True: 26.0k, False: 125k]
  ------------------
11116|  26.0k|                        if ((!terminate) &&
  ------------------
  |  Branch (11116:29): [True: 24.8k, False: 1.18k]
  ------------------
11117|  24.8k|                            (!xmlParseLookupString(ctxt, 2, "?>", 2)))
  ------------------
  |  Branch (11117:29): [True: 7.08k, False: 17.7k]
  ------------------
11118|  7.08k|                            goto done;
11119|  18.9k|                        xmlParsePI(ctxt);
11120|  18.9k|                        break;
11121|   125k|                    } else if (next == '!') {
  ------------------
  |  Branch (11121:32): [True: 100k, False: 24.8k]
  ------------------
11122|   100k|                        if ((!terminate) && (avail < 3))
  ------------------
  |  Branch (11122:29): [True: 98.7k, False: 1.87k]
  |  Branch (11122:45): [True: 122, False: 98.6k]
  ------------------
11123|    122|                            goto done;
11124|       |
11125|   100k|                        if (ctxt->input->cur[2] == '-') {
  ------------------
  |  Branch (11125:29): [True: 62.0k, False: 38.4k]
  ------------------
11126|  62.0k|                            if ((!terminate) && (avail < 4))
  ------------------
  |  Branch (11126:33): [True: 61.6k, False: 431]
  |  Branch (11126:49): [True: 138, False: 61.5k]
  ------------------
11127|    138|                                goto done;
11128|  61.9k|                            if (ctxt->input->cur[3] == '-') {
  ------------------
  |  Branch (11128:33): [True: 61.9k, False: 7]
  ------------------
11129|  61.9k|                                if ((!terminate) &&
  ------------------
  |  Branch (11129:37): [True: 61.5k, False: 426]
  ------------------
11130|  61.5k|                                    (!xmlParseLookupString(ctxt, 4, "-->", 3)))
  ------------------
  |  Branch (11130:37): [True: 6.47k, False: 55.0k]
  ------------------
11131|  6.47k|                                    goto done;
11132|  55.4k|                                xmlParseComment(ctxt);
11133|  55.4k|                                break;
11134|  61.9k|                            }
11135|  61.9k|                        } else if (ctxt->instate == XML_PARSER_MISC) {
  ------------------
  |  Branch (11135:36): [True: 38.3k, False: 78]
  ------------------
11136|  38.3k|                            if ((!terminate) && (avail < 9))
  ------------------
  |  Branch (11136:33): [True: 36.9k, False: 1.40k]
  |  Branch (11136:49): [True: 21, False: 36.9k]
  ------------------
11137|     21|                                goto done;
11138|  38.3k|                            if ((ctxt->input->cur[2] == 'D') &&
  ------------------
  |  Branch (11138:33): [True: 38.3k, False: 24]
  ------------------
11139|  38.3k|                                (ctxt->input->cur[3] == 'O') &&
  ------------------
  |  Branch (11139:33): [True: 38.3k, False: 9]
  ------------------
11140|  38.3k|                                (ctxt->input->cur[4] == 'C') &&
  ------------------
  |  Branch (11140:33): [True: 38.3k, False: 6]
  ------------------
11141|  38.3k|                                (ctxt->input->cur[5] == 'T') &&
  ------------------
  |  Branch (11141:33): [True: 38.3k, False: 8]
  ------------------
11142|  38.3k|                                (ctxt->input->cur[6] == 'Y') &&
  ------------------
  |  Branch (11142:33): [True: 38.3k, False: 1]
  ------------------
11143|  38.3k|                                (ctxt->input->cur[7] == 'P') &&
  ------------------
  |  Branch (11143:33): [True: 38.3k, False: 3]
  ------------------
11144|  38.3k|                                (ctxt->input->cur[8] == 'E')) {
  ------------------
  |  Branch (11144:33): [True: 38.3k, False: 2]
  ------------------
11145|  38.3k|                                if ((!terminate) && (!xmlParseLookupGt(ctxt)))
  ------------------
  |  Branch (11145:37): [True: 36.9k, False: 1.36k]
  |  Branch (11145:53): [True: 24.1k, False: 12.7k]
  ------------------
11146|  24.1k|                                    goto done;
11147|  14.1k|                                ctxt->inSubset = 1;
11148|  14.1k|                                xmlParseDocTypeDecl(ctxt);
11149|  14.1k|                                if (RAW == '[') {
  ------------------
  |  | 2224|  14.1k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (11149:37): [True: 10.9k, False: 3.22k]
  ------------------
11150|  10.9k|                                    ctxt->instate = XML_PARSER_DTD;
11151|  10.9k|                                } else {
11152|  3.22k|                                    if (RAW == '>')
  ------------------
  |  | 2224|  3.22k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (11152:41): [True: 3.03k, False: 183]
  ------------------
11153|  3.03k|                                        NEXT;
  ------------------
  |  | 2279|  3.03k|#define NEXT xmlNextChar(ctxt)
  ------------------
11154|       |                                    /*
11155|       |                                     * Create and update the external subset.
11156|       |                                     */
11157|  3.22k|                                    ctxt->inSubset = 2;
11158|  3.22k|                                    if ((ctxt->sax != NULL) &&
  ------------------
  |  Branch (11158:41): [True: 3.22k, False: 0]
  ------------------
11159|  3.22k|                                        (!ctxt->disableSAX) &&
  ------------------
  |  Branch (11159:41): [True: 3.13k, False: 89]
  ------------------
11160|  3.13k|                                        (ctxt->sax->externalSubset != NULL))
  ------------------
  |  Branch (11160:41): [True: 3.13k, False: 0]
  ------------------
11161|  3.13k|                                        ctxt->sax->externalSubset(
11162|  3.13k|                                                ctxt->userData,
11163|  3.13k|                                                ctxt->intSubName,
11164|  3.13k|                                                ctxt->extSubSystem,
11165|  3.13k|                                                ctxt->extSubURI);
11166|  3.22k|                                    ctxt->inSubset = 0;
11167|  3.22k|                                    xmlCleanSpecialAttr(ctxt);
11168|  3.22k|                                    ctxt->instate = XML_PARSER_PROLOG;
11169|  3.22k|                                }
11170|  14.1k|                                break;
11171|  38.3k|                            }
11172|  38.3k|                        }
11173|   100k|                    }
11174|   151k|                }
11175|       |
11176|  28.2k|                if (ctxt->instate == XML_PARSER_EPILOG) {
  ------------------
  |  Branch (11176:21): [True: 1.77k, False: 26.5k]
  ------------------
11177|  1.77k|                    if (ctxt->errNo == XML_ERR_OK)
  ------------------
  |  Branch (11177:25): [True: 18, False: 1.75k]
  ------------------
11178|     18|                        xmlFatalErr(ctxt, XML_ERR_DOCUMENT_END, NULL);
11179|  1.77k|		    ctxt->instate = XML_PARSER_EOF;
11180|  1.77k|                    xmlFinishDocument(ctxt);
11181|  26.5k|                } else {
11182|  26.5k|		    ctxt->instate = XML_PARSER_START_TAG;
11183|  26.5k|		}
11184|  28.2k|		break;
11185|  34.5k|            case XML_PARSER_DTD: {
  ------------------
  |  Branch (11185:13): [True: 34.5k, False: 4.64M]
  ------------------
11186|  34.5k|                if ((!terminate) && (!xmlParseLookupInternalSubset(ctxt)))
  ------------------
  |  Branch (11186:21): [True: 30.4k, False: 4.05k]
  |  Branch (11186:37): [True: 23.7k, False: 6.78k]
  ------------------
11187|  23.7k|                    goto done;
11188|  10.8k|		xmlParseInternalSubset(ctxt);
11189|  10.8k|		ctxt->inSubset = 2;
11190|  10.8k|		if ((ctxt->sax != NULL) && (!ctxt->disableSAX) &&
  ------------------
  |  Branch (11190:7): [True: 10.8k, False: 0]
  |  Branch (11190:30): [True: 8.86k, False: 1.97k]
  ------------------
11191|  8.86k|		    (ctxt->sax->externalSubset != NULL))
  ------------------
  |  Branch (11191:7): [True: 8.86k, False: 0]
  ------------------
11192|  8.86k|		    ctxt->sax->externalSubset(ctxt->userData, ctxt->intSubName,
11193|  8.86k|			    ctxt->extSubSystem, ctxt->extSubURI);
11194|  10.8k|		ctxt->inSubset = 0;
11195|  10.8k|		xmlCleanSpecialAttr(ctxt);
11196|  10.8k|		ctxt->instate = XML_PARSER_PROLOG;
11197|  10.8k|                break;
11198|  34.5k|	    }
11199|      0|            default:
  ------------------
  |  Branch (11199:13): [True: 0, False: 4.68M]
  ------------------
11200|      0|                xmlFatalErrMsg(ctxt, XML_ERR_INTERNAL_ERROR,
11201|      0|			"PP: internal error\n");
11202|      0|		ctxt->instate = XML_PARSER_EOF;
11203|      0|		break;
11204|  4.68M|	}
11205|  4.68M|    }
11206|   369k|done:
11207|   369k|    return(ret);
11208|   369k|}
parser.c:xmlParseLookupString:
10610|   188k|                     const char *str, size_t strLen) {
10611|   188k|    const xmlChar *cur, *term;
10612|       |
10613|   188k|    if (ctxt->checkIndex == 0) {
  ------------------
  |  Branch (10613:9): [True: 150k, False: 37.8k]
  ------------------
10614|   150k|        cur = ctxt->input->cur + startDelta;
10615|   150k|    } else {
10616|  37.8k|        cur = ctxt->input->cur + ctxt->checkIndex;
10617|  37.8k|    }
10618|       |
10619|   188k|    term = BAD_CAST strstr((const char *) cur, str);
  ------------------
  |  |   34|   188k|#define BAD_CAST (xmlChar *)
  ------------------
10620|   188k|    if (term == NULL) {
  ------------------
  |  Branch (10620:9): [True: 39.7k, False: 148k]
  ------------------
10621|  39.7k|        const xmlChar *end = ctxt->input->end;
10622|  39.7k|        size_t index;
10623|       |
10624|       |        /* Rescan (strLen - 1) characters. */
10625|  39.7k|        if ((size_t) (end - cur) < strLen)
  ------------------
  |  Branch (10625:13): [True: 914, False: 38.8k]
  ------------------
10626|    914|            end = cur;
10627|  38.8k|        else
10628|  38.8k|            end -= strLen - 1;
10629|  39.7k|        index = end - ctxt->input->cur;
10630|  39.7k|        if (index > LONG_MAX) {
  ------------------
  |  Branch (10630:13): [True: 0, False: 39.7k]
  ------------------
10631|      0|            ctxt->checkIndex = 0;
10632|      0|            return(ctxt->input->end - strLen);
10633|      0|        }
10634|  39.7k|        ctxt->checkIndex = index;
10635|   148k|    } else {
10636|   148k|        ctxt->checkIndex = 0;
10637|   148k|    }
10638|       |
10639|   188k|    return(term);
10640|   188k|}
parser.c:xmlParseLookupGt:
10677|   455k|xmlParseLookupGt(xmlParserCtxtPtr ctxt) {
10678|   455k|    const xmlChar *cur;
10679|   455k|    const xmlChar *end = ctxt->input->end;
10680|   455k|    int state = ctxt->endCheckState;
10681|   455k|    size_t index;
10682|       |
10683|   455k|    if (ctxt->checkIndex == 0)
  ------------------
  |  Branch (10683:9): [True: 226k, False: 228k]
  ------------------
10684|   226k|        cur = ctxt->input->cur + 1;
10685|   228k|    else
10686|   228k|        cur = ctxt->input->cur + ctxt->checkIndex;
10687|       |
10688|   141M|    while (cur < end) {
  ------------------
  |  Branch (10688:12): [True: 141M, False: 236k]
  ------------------
10689|   141M|        if (state) {
  ------------------
  |  Branch (10689:13): [True: 121M, False: 19.5M]
  ------------------
10690|   121M|            if (*cur == state)
  ------------------
  |  Branch (10690:17): [True: 151k, False: 121M]
  ------------------
10691|   151k|                state = 0;
10692|   121M|        } else if (*cur == '\'' || *cur == '"') {
  ------------------
  |  Branch (10692:20): [True: 63.2k, False: 19.4M]
  |  Branch (10692:36): [True: 90.5k, False: 19.4M]
  ------------------
10693|   153k|            state = *cur;
10694|  19.4M|        } else if (*cur == '>') {
  ------------------
  |  Branch (10694:20): [True: 218k, False: 19.1M]
  ------------------
10695|   218k|            ctxt->checkIndex = 0;
10696|   218k|            ctxt->endCheckState = 0;
10697|   218k|            return(1);
10698|   218k|        }
10699|   141M|        cur++;
10700|   141M|    }
10701|       |
10702|   236k|    index = cur - ctxt->input->cur;
10703|   236k|    if (index > LONG_MAX) {
  ------------------
  |  Branch (10703:9): [True: 0, False: 236k]
  ------------------
10704|      0|        ctxt->checkIndex = 0;
10705|      0|        ctxt->endCheckState = 0;
10706|      0|        return(1);
10707|      0|    }
10708|   236k|    ctxt->checkIndex = index;
10709|   236k|    ctxt->endCheckState = state;
10710|   236k|    return(0);
10711|   236k|}
parser.c:xmlParseLookupChar:
10576|  60.8k|xmlParseLookupChar(xmlParserCtxtPtr ctxt, int c) {
10577|  60.8k|    const xmlChar *cur;
10578|       |
10579|  60.8k|    if (ctxt->checkIndex == 0) {
  ------------------
  |  Branch (10579:9): [True: 41.5k, False: 19.2k]
  ------------------
10580|  41.5k|        cur = ctxt->input->cur + 1;
10581|  41.5k|    } else {
10582|  19.2k|        cur = ctxt->input->cur + ctxt->checkIndex;
10583|  19.2k|    }
10584|       |
10585|  60.8k|    if (memchr(cur, c, ctxt->input->end - cur) == NULL) {
  ------------------
  |  Branch (10585:9): [True: 22.2k, False: 38.5k]
  ------------------
10586|  22.2k|        size_t index = ctxt->input->end - ctxt->input->cur;
10587|       |
10588|  22.2k|        if (index > LONG_MAX) {
  ------------------
  |  Branch (10588:13): [True: 0, False: 22.2k]
  ------------------
10589|      0|            ctxt->checkIndex = 0;
10590|      0|            return(1);
10591|      0|        }
10592|  22.2k|        ctxt->checkIndex = index;
10593|  22.2k|        return(0);
10594|  38.5k|    } else {
10595|  38.5k|        ctxt->checkIndex = 0;
10596|  38.5k|        return(1);
10597|  38.5k|    }
10598|  60.8k|}
parser.c:xmlParseLookupCharData:
10648|  83.6k|xmlParseLookupCharData(xmlParserCtxtPtr ctxt) {
10649|  83.6k|    const xmlChar *cur = ctxt->input->cur + ctxt->checkIndex;
10650|  83.6k|    const xmlChar *end = ctxt->input->end;
10651|  83.6k|    size_t index;
10652|       |
10653|   913k|    while (cur < end) {
  ------------------
  |  Branch (10653:12): [True: 906k, False: 7.48k]
  ------------------
10654|   906k|        if ((*cur == '<') || (*cur == '&')) {
  ------------------
  |  Branch (10654:13): [True: 70.3k, False: 836k]
  |  Branch (10654:30): [True: 5.79k, False: 830k]
  ------------------
10655|  76.1k|            ctxt->checkIndex = 0;
10656|  76.1k|            return(1);
10657|  76.1k|        }
10658|   830k|        cur++;
10659|   830k|    }
10660|       |
10661|  7.48k|    index = cur - ctxt->input->cur;
10662|  7.48k|    if (index > LONG_MAX) {
  ------------------
  |  Branch (10662:9): [True: 0, False: 7.48k]
  ------------------
10663|      0|        ctxt->checkIndex = 0;
10664|      0|        return(1);
10665|      0|    }
10666|  7.48k|    ctxt->checkIndex = index;
10667|  7.48k|    return(0);
10668|  7.48k|}
parser.c:nameNsPop:
 2112|  21.9k|{
 2113|  21.9k|    const xmlChar *ret;
 2114|       |
 2115|  21.9k|    if (ctxt->nameNr <= 0)
  ------------------
  |  Branch (2115:9): [True: 0, False: 21.9k]
  ------------------
 2116|      0|        return (NULL);
 2117|  21.9k|    ctxt->nameNr--;
 2118|  21.9k|    if (ctxt->nameNr > 0)
  ------------------
  |  Branch (2118:9): [True: 20.8k, False: 1.15k]
  ------------------
 2119|  20.8k|        ctxt->name = ctxt->nameTab[ctxt->nameNr - 1];
 2120|  1.15k|    else
 2121|  1.15k|        ctxt->name = NULL;
 2122|  21.9k|    ret = ctxt->nameTab[ctxt->nameNr];
 2123|       |    ctxt->nameTab[ctxt->nameNr] = NULL;
 2124|  21.9k|    return (ret);
 2125|  21.9k|}
parser.c:xmlParseLookupInternalSubset:
10720|  30.4k|xmlParseLookupInternalSubset(xmlParserCtxtPtr ctxt) {
10721|       |    /*
10722|       |     * Sorry, but progressive parsing of the internal subset is not
10723|       |     * supported. We first check that the full content of the internal
10724|       |     * subset is available and parsing is launched only at that point.
10725|       |     * Internal subset ends with "']' S? '>'" in an unescaped section and
10726|       |     * not in a ']]>' sequence which are conditional sections.
10727|       |     */
10728|  30.4k|    const xmlChar *cur, *start;
10729|  30.4k|    const xmlChar *end = ctxt->input->end;
10730|  30.4k|    int state = ctxt->endCheckState;
10731|  30.4k|    size_t index;
10732|       |
10733|  30.4k|    if (ctxt->checkIndex == 0) {
  ------------------
  |  Branch (10733:9): [True: 9.70k, False: 20.7k]
  ------------------
10734|  9.70k|        cur = ctxt->input->cur + 1;
10735|  20.7k|    } else {
10736|  20.7k|        cur = ctxt->input->cur + ctxt->checkIndex;
10737|  20.7k|    }
10738|  30.4k|    start = cur;
10739|       |
10740|  19.3M|    while (cur < end) {
  ------------------
  |  Branch (10740:12): [True: 19.3M, False: 23.7k]
  ------------------
10741|  19.3M|        if (state == '-') {
  ------------------
  |  Branch (10741:13): [True: 321k, False: 18.9M]
  ------------------
10742|   321k|            if ((*cur == '-') &&
  ------------------
  |  Branch (10742:17): [True: 33.9k, False: 287k]
  ------------------
10743|  33.9k|                (cur[1] == '-') &&
  ------------------
  |  Branch (10743:17): [True: 29.1k, False: 4.78k]
  ------------------
10744|  29.1k|                (cur[2] == '>')) {
  ------------------
  |  Branch (10744:17): [True: 22.1k, False: 6.96k]
  ------------------
10745|  22.1k|                state = 0;
10746|  22.1k|                cur += 3;
10747|  22.1k|                start = cur;
10748|  22.1k|                continue;
10749|  22.1k|            }
10750|   321k|        }
10751|  18.9M|        else if (state == ']') {
  ------------------
  |  Branch (10751:18): [True: 8.98k, False: 18.9M]
  ------------------
10752|  8.98k|            if (*cur == '>') {
  ------------------
  |  Branch (10752:17): [True: 6.59k, False: 2.39k]
  ------------------
10753|  6.59k|                ctxt->checkIndex = 0;
10754|  6.59k|                ctxt->endCheckState = 0;
10755|  6.59k|                return(1);
10756|  6.59k|            }
10757|  2.39k|            if (IS_BLANK_CH(*cur)) {
  ------------------
  |  |  137|  2.39k|#define IS_BLANK_CH(c)  xmlIsBlank_ch(c)
  |  |  ------------------
  |  |  |  |   90|  2.39k|#define xmlIsBlank_ch(c)	(((c) == 0x20) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (90:27): [True: 288, False: 2.11k]
  |  |  |  |  ------------------
  |  |  |  |   91|  2.39k|				 ((0x9 <= (c)) && ((c) <= 0xa)) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (91:7): [True: 1.92k, False: 183]
  |  |  |  |  |  Branch (91:23): [True: 426, False: 1.50k]
  |  |  |  |  ------------------
  |  |  |  |   92|  2.39k|				 ((c) == 0xd))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (92:6): [True: 257, False: 1.42k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
10758|    971|                state = ' ';
10759|  1.42k|            } else if (*cur != ']') {
  ------------------
  |  Branch (10759:24): [True: 1.04k, False: 378]
  ------------------
10760|  1.04k|                state = 0;
10761|  1.04k|                start = cur;
10762|  1.04k|                continue;
10763|  1.04k|            }
10764|  2.39k|        }
10765|  18.9M|        else if (state == ' ') {
  ------------------
  |  Branch (10765:18): [True: 1.65k, False: 18.9M]
  ------------------
10766|  1.65k|            if (*cur == '>') {
  ------------------
  |  Branch (10766:17): [True: 193, False: 1.46k]
  ------------------
10767|    193|                ctxt->checkIndex = 0;
10768|    193|                ctxt->endCheckState = 0;
10769|    193|                return(1);
10770|    193|            }
10771|  1.46k|            if (!IS_BLANK_CH(*cur)) {
  ------------------
  |  |  137|  1.46k|#define IS_BLANK_CH(c)  xmlIsBlank_ch(c)
  |  |  ------------------
  |  |  |  |   90|  1.46k|#define xmlIsBlank_ch(c)	(((c) == 0x20) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (90:27): [True: 230, False: 1.23k]
  |  |  |  |  ------------------
  |  |  |  |   91|  1.46k|				 ((0x9 <= (c)) && ((c) <= 0xa)) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (91:7): [True: 996, False: 239]
  |  |  |  |  |  Branch (91:23): [True: 286, False: 710]
  |  |  |  |  ------------------
  |  |  |  |   92|  1.46k|				 ((c) == 0xd))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (92:6): [True: 175, False: 774]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
10772|    774|                state = 0;
10773|    774|                start = cur;
10774|    774|                continue;
10775|    774|            }
10776|  1.46k|        }
10777|  18.9M|        else if (state != 0) {
  ------------------
  |  Branch (10777:18): [True: 14.7M, False: 4.19M]
  ------------------
10778|  14.7M|            if (*cur == state) {
  ------------------
  |  Branch (10778:17): [True: 30.4k, False: 14.7M]
  ------------------
10779|  30.4k|                state = 0;
10780|  30.4k|                start = cur + 1;
10781|  30.4k|            }
10782|  14.7M|        }
10783|  4.19M|        else if (*cur == '<') {
  ------------------
  |  Branch (10783:18): [True: 63.1k, False: 4.12M]
  ------------------
10784|  63.1k|            if ((cur[1] == '!') &&
  ------------------
  |  Branch (10784:17): [True: 49.4k, False: 13.7k]
  ------------------
10785|  49.4k|                (cur[2] == '-') &&
  ------------------
  |  Branch (10785:17): [True: 22.5k, False: 26.8k]
  ------------------
10786|  22.5k|                (cur[3] == '-')) {
  ------------------
  |  Branch (10786:17): [True: 22.2k, False: 366]
  ------------------
10787|  22.2k|                state = '-';
10788|  22.2k|                cur += 4;
10789|       |                /* Don't treat <!--> as comment */
10790|  22.2k|                start = cur;
10791|  22.2k|                continue;
10792|  22.2k|            }
10793|  63.1k|        }
10794|  4.12M|        else if ((*cur == '"') || (*cur == '\'') || (*cur == ']')) {
  ------------------
  |  Branch (10794:18): [True: 19.3k, False: 4.10M]
  |  Branch (10794:35): [True: 11.4k, False: 4.09M]
  |  Branch (10794:53): [True: 8.62k, False: 4.08M]
  ------------------
10795|  39.4k|            state = *cur;
10796|  39.4k|        }
10797|       |
10798|  19.2M|        cur++;
10799|  19.2M|    }
10800|       |
10801|       |    /*
10802|       |     * Rescan the three last characters to detect "<!--" and "-->"
10803|       |     * split across chunks.
10804|       |     */
10805|  23.7k|    if ((state == 0) || (state == '-')) {
  ------------------
  |  Branch (10805:9): [True: 6.68k, False: 17.0k]
  |  Branch (10805:25): [True: 765, False: 16.2k]
  ------------------
10806|  7.44k|        if (cur - start < 3)
  ------------------
  |  Branch (10806:13): [True: 612, False: 6.83k]
  ------------------
10807|    612|            cur = start;
10808|  6.83k|        else
10809|  6.83k|            cur -= 3;
10810|  7.44k|    }
10811|  23.7k|    index = cur - ctxt->input->cur;
10812|  23.7k|    if (index > LONG_MAX) {
  ------------------
  |  Branch (10812:9): [True: 0, False: 23.7k]
  ------------------
10813|      0|        ctxt->checkIndex = 0;
10814|      0|        ctxt->endCheckState = 0;
10815|      0|        return(1);
10816|      0|    }
10817|  23.7k|    ctxt->checkIndex = index;
10818|  23.7k|    ctxt->endCheckState = state;
10819|  23.7k|    return(0);
10820|  23.7k|}
parser.c:xmlCtxtParseEntity:
11759|  6.22k|xmlCtxtParseEntity(xmlParserCtxtPtr ctxt, xmlEntityPtr ent) {
11760|  6.22k|    xmlParserInputPtr input;
11761|  6.22k|    xmlNodePtr list;
11762|  6.22k|    unsigned long consumed;
11763|  6.22k|    int isExternal;
11764|  6.22k|    int buildTree;
11765|  6.22k|    int oldMinNsIndex;
11766|  6.22k|    int oldNodelen, oldNodemem;
11767|       |
11768|  6.22k|    isExternal = (ent->etype == XML_EXTERNAL_GENERAL_PARSED_ENTITY);
11769|  6.22k|    buildTree = (ctxt->node != NULL);
11770|       |
11771|       |    /*
11772|       |     * Recursion check
11773|       |     */
11774|  6.22k|    if (ent->flags & XML_ENT_EXPANDING) {
  ------------------
  |  |   22|  6.22k|#define XML_ENT_EXPANDING   (1u << 3)
  ------------------
  |  Branch (11774:9): [True: 7, False: 6.22k]
  ------------------
11775|      7|        xmlFatalErr(ctxt, XML_ERR_ENTITY_LOOP, NULL);
11776|      7|        goto error;
11777|      7|    }
11778|       |
11779|       |    /*
11780|       |     * Load entity
11781|       |     */
11782|  6.22k|    input = xmlNewEntityInputStream(ctxt, ent);
11783|  6.22k|    if (input == NULL)
  ------------------
  |  Branch (11783:9): [True: 1.63k, False: 4.58k]
  ------------------
11784|  1.63k|        goto error;
11785|       |
11786|       |    /*
11787|       |     * When building a tree, we need to limit the scope of namespace
11788|       |     * declarations, so that entities don't reference xmlNs structs
11789|       |     * from the parent of a reference.
11790|       |     */
11791|  4.58k|    oldMinNsIndex = ctxt->nsdb->minNsIndex;
11792|  4.58k|    if (buildTree)
  ------------------
  |  Branch (11792:9): [True: 4.58k, False: 0]
  ------------------
11793|  4.58k|        ctxt->nsdb->minNsIndex = ctxt->nsNr;
11794|       |
11795|  4.58k|    oldNodelen = ctxt->nodelen;
11796|  4.58k|    oldNodemem = ctxt->nodemem;
11797|  4.58k|    ctxt->nodelen = 0;
11798|  4.58k|    ctxt->nodemem = 0;
11799|       |
11800|       |    /*
11801|       |     * Parse content
11802|       |     *
11803|       |     * This initiates a recursive call chain:
11804|       |     *
11805|       |     * - xmlCtxtParseContentInternal
11806|       |     * - xmlParseContentInternal
11807|       |     * - xmlParseReference
11808|       |     * - xmlCtxtParseEntity
11809|       |     *
11810|       |     * The nesting depth is limited by the maximum number of inputs,
11811|       |     * see xmlCtxtPushInput.
11812|       |     *
11813|       |     * It's possible to make this non-recursive (minNsIndex must be
11814|       |     * stored in the input struct) at the expense of code readability.
11815|       |     */
11816|       |
11817|  4.58k|    ent->flags |= XML_ENT_EXPANDING;
  ------------------
  |  |   22|  4.58k|#define XML_ENT_EXPANDING   (1u << 3)
  ------------------
11818|       |
11819|  4.58k|    list = xmlCtxtParseContentInternal(ctxt, input, isExternal, buildTree);
11820|       |
11821|  4.58k|    ent->flags &= ~XML_ENT_EXPANDING;
  ------------------
  |  |   22|  4.58k|#define XML_ENT_EXPANDING   (1u << 3)
  ------------------
11822|       |
11823|  4.58k|    ctxt->nsdb->minNsIndex = oldMinNsIndex;
11824|  4.58k|    ctxt->nodelen = oldNodelen;
11825|  4.58k|    ctxt->nodemem = oldNodemem;
11826|       |
11827|       |    /*
11828|       |     * Entity size accounting
11829|       |     */
11830|  4.58k|    consumed = input->consumed;
11831|  4.58k|    xmlSaturatedAddSizeT(&consumed, input->end - input->base);
11832|       |
11833|  4.58k|    if ((ent->flags & XML_ENT_CHECKED) == 0)
  ------------------
  |  |   20|  4.58k|#define XML_ENT_CHECKED     (1u << 1)
  ------------------
  |  Branch (11833:9): [True: 2.78k, False: 1.80k]
  ------------------
11834|  2.78k|        xmlSaturatedAdd(&ent->expandedSize, consumed);
11835|       |
11836|  4.58k|    if ((ent->flags & XML_ENT_PARSED) == 0) {
  ------------------
  |  |   19|  4.58k|#define XML_ENT_PARSED      (1u << 0)
  ------------------
  |  Branch (11836:9): [True: 2.78k, False: 1.80k]
  ------------------
11837|  2.78k|        if (isExternal)
  ------------------
  |  Branch (11837:13): [True: 1.32k, False: 1.45k]
  ------------------
11838|  1.32k|            xmlSaturatedAdd(&ctxt->sizeentities, consumed);
11839|       |
11840|  2.78k|        ent->children = list;
11841|       |
11842|  19.1k|        while (list != NULL) {
  ------------------
  |  Branch (11842:16): [True: 16.3k, False: 2.78k]
  ------------------
11843|  16.3k|            list->parent = (xmlNodePtr) ent;
11844|       |
11845|       |            /*
11846|       |             * Downstream code like the nginx xslt module can set
11847|       |             * ctxt->myDoc->extSubset to a separate DTD, so the entity
11848|       |             * might have a different or a NULL document.
11849|       |             */
11850|  16.3k|            if (list->doc != ent->doc)
  ------------------
  |  Branch (11850:17): [True: 0, False: 16.3k]
  ------------------
11851|      0|                xmlSetTreeDoc(list, ent->doc);
11852|       |
11853|  16.3k|            if (list->next == NULL)
  ------------------
  |  Branch (11853:17): [True: 1.93k, False: 14.4k]
  ------------------
11854|  1.93k|                ent->last = list;
11855|  16.3k|            list = list->next;
11856|  16.3k|        }
11857|  2.78k|    } else {
11858|  1.80k|        xmlFreeNodeList(list);
11859|  1.80k|    }
11860|       |
11861|  4.58k|    xmlFreeInputStream(input);
11862|       |
11863|  6.22k|error:
11864|  6.22k|    ent->flags |= XML_ENT_PARSED | XML_ENT_CHECKED;
  ------------------
  |  |   19|  6.22k|#define XML_ENT_PARSED      (1u << 0)
  ------------------
                  ent->flags |= XML_ENT_PARSED | XML_ENT_CHECKED;
  ------------------
  |  |   20|  6.22k|#define XML_ENT_CHECKED     (1u << 1)
  ------------------
11865|  6.22k|}
parser.c:xmlCtxtParseContentInternal:
11669|  4.58k|                            int hasTextDecl, int buildTree) {
11670|  4.58k|    xmlNodePtr root = NULL;
11671|  4.58k|    xmlNodePtr list = NULL;
11672|  4.58k|    xmlChar *rootName = BAD_CAST "#root";
  ------------------
  |  |   34|  4.58k|#define BAD_CAST (xmlChar *)
  ------------------
11673|  4.58k|    int result;
11674|       |
11675|  4.58k|    if (buildTree) {
  ------------------
  |  Branch (11675:9): [True: 4.58k, False: 0]
  ------------------
11676|  4.58k|        root = xmlNewDocNode(ctxt->myDoc, NULL, rootName, NULL);
11677|  4.58k|        if (root == NULL) {
  ------------------
  |  Branch (11677:13): [True: 1, False: 4.58k]
  ------------------
11678|      1|            xmlErrMemory(ctxt);
11679|      1|            goto error;
11680|      1|        }
11681|  4.58k|    }
11682|       |
11683|  4.58k|    if (xmlCtxtPushInput(ctxt, input) < 0)
  ------------------
  |  Branch (11683:9): [True: 2, False: 4.58k]
  ------------------
11684|      2|        goto error;
11685|       |
11686|  4.58k|    nameNsPush(ctxt, rootName, NULL, NULL, 0, 0);
11687|  4.58k|    spacePush(ctxt, -1);
11688|       |
11689|  4.58k|    if (buildTree)
  ------------------
  |  Branch (11689:9): [True: 4.58k, False: 0]
  ------------------
11690|  4.58k|        nodePush(ctxt, root);
11691|       |
11692|  4.58k|    if (hasTextDecl) {
  ------------------
  |  Branch (11692:9): [True: 1.51k, False: 3.06k]
  ------------------
11693|  1.51k|        xmlDetectEncoding(ctxt);
11694|       |
11695|       |        /*
11696|       |         * Parse a possible text declaration first
11697|       |         */
11698|  1.51k|        if ((CMP5(CUR_PTR, '<', '?', 'x', 'm', 'l')) &&
  ------------------
  |  | 2234|  1.51k|  ( CMP4( s, c1, c2, c3, c4 ) && ((unsigned char *) s)[ 4 ] == c5 )
  |  |  ------------------
  |  |  |  | 2231|  3.03k|  ( ((unsigned char *) s)[ 0 ] == c1 && ((unsigned char *) s)[ 1 ] == c2 && \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2231:5): [True: 1.03k, False: 486]
  |  |  |  |  |  Branch (2231:41): [True: 300, False: 733]
  |  |  |  |  ------------------
  |  |  |  | 2232|  1.51k|    ((unsigned char *) s)[ 2 ] == c3 && ((unsigned char *) s)[ 3 ] == c4 )
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2232:5): [True: 286, False: 14]
  |  |  |  |  |  Branch (2232:41): [True: 285, False: 1]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2234:34): [True: 281, False: 4]
  |  |  ------------------
  ------------------
11699|    281|            (IS_BLANK_CH(NXT(5)))) {
  ------------------
  |  |  137|    281|#define IS_BLANK_CH(c)  xmlIsBlank_ch(c)
  |  |  ------------------
  |  |  |  |   90|    281|#define xmlIsBlank_ch(c)	(((c) == 0x20) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (90:27): [True: 205, False: 76]
  |  |  |  |  ------------------
  |  |  |  |   91|    281|				 ((0x9 <= (c)) && ((c) <= 0xa)) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (91:7): [True: 76, False: 0]
  |  |  |  |  |  Branch (91:23): [True: 41, False: 35]
  |  |  |  |  ------------------
  |  |  |  |   92|    281|				 ((c) == 0xd))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (92:6): [True: 34, False: 1]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
11700|    280|            xmlParseTextDecl(ctxt);
11701|       |            /*
11702|       |             * An XML-1.0 document can't reference an entity not XML-1.0
11703|       |             */
11704|    280|            if ((xmlStrEqual(ctxt->version, BAD_CAST "1.0")) &&
  ------------------
  |  |   34|    280|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (11704:17): [True: 278, False: 2]
  ------------------
11705|    278|                (!xmlStrEqual(ctxt->input->version, BAD_CAST "1.0"))) {
  ------------------
  |  |   34|    278|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (11705:17): [True: 37, False: 241]
  ------------------
11706|     37|                xmlFatalErrMsg(ctxt, XML_ERR_VERSION_MISMATCH,
11707|     37|                               "Version mismatch between document and "
11708|     37|                               "entity\n");
11709|     37|            }
11710|    280|        }
11711|  1.51k|    }
11712|       |
11713|  4.58k|    xmlParseContentInternal(ctxt);
11714|       |
11715|  4.58k|    if (ctxt->input->cur < ctxt->input->end)
  ------------------
  |  Branch (11715:9): [True: 364, False: 4.22k]
  ------------------
11716|    364|	xmlFatalErr(ctxt, XML_ERR_NOT_WELL_BALANCED, NULL);
11717|       |
11718|  4.58k|    if ((ctxt->wellFormed) ||
  ------------------
  |  Branch (11718:9): [True: 3.17k, False: 1.41k]
  ------------------
11719|  3.85k|        ((ctxt->recovery) && (!xmlCtxtIsCatastrophicError(ctxt)))) {
  ------------------
  |  Branch (11719:10): [True: 816, False: 595]
  |  Branch (11719:30): [True: 681, False: 135]
  ------------------
11720|  3.85k|        if (root != NULL) {
  ------------------
  |  Branch (11720:13): [True: 3.85k, False: 0]
  ------------------
11721|  3.85k|            xmlNodePtr cur;
11722|       |
11723|       |            /*
11724|       |             * Unlink newly created node list.
11725|       |             */
11726|  3.85k|            list = root->children;
11727|  3.85k|            root->children = NULL;
11728|  3.85k|            root->last = NULL;
11729|  20.2k|            for (cur = list; cur != NULL; cur = cur->next)
  ------------------
  |  Branch (11729:30): [True: 16.3k, False: 3.85k]
  ------------------
11730|  16.3k|                cur->parent = NULL;
11731|  3.85k|        }
11732|  3.85k|    }
11733|       |
11734|       |    /*
11735|       |     * Read the rest of the stream in case of errors. We want
11736|       |     * to account for the whole entity size.
11737|       |     */
11738|  5.09k|    do {
11739|  5.09k|        ctxt->input->cur = ctxt->input->end;
11740|  5.09k|        xmlParserShrink(ctxt);
11741|  5.09k|        result = xmlParserGrow(ctxt);
11742|  5.09k|    } while (result > 0);
  ------------------
  |  Branch (11742:14): [True: 513, False: 4.58k]
  ------------------
11743|       |
11744|  4.58k|    if (buildTree)
  ------------------
  |  Branch (11744:9): [True: 4.58k, False: 0]
  ------------------
11745|  4.58k|        nodePop(ctxt);
11746|       |
11747|  4.58k|    namePop(ctxt);
11748|  4.58k|    spacePop(ctxt);
11749|       |
11750|  4.58k|    xmlCtxtPopInput(ctxt);
11751|       |
11752|  4.58k|error:
11753|  4.58k|    xmlFreeNode(root);
11754|       |
11755|  4.58k|    return(list);
11756|  4.58k|}
parser.c:xmlParserNsPush:
 1666|   264k|                const xmlHashedString *uri, void *saxData, int defAttr) {
 1667|   264k|    xmlParserNsBucket *bucket = NULL;
 1668|   264k|    xmlParserNsExtra *extra;
 1669|   264k|    const xmlChar **ns;
 1670|   264k|    unsigned hashValue, nsIndex, oldIndex;
 1671|       |
 1672|   264k|    if ((prefix != NULL) && (prefix->name == ctxt->str_xml))
  ------------------
  |  Branch (1672:9): [True: 230k, False: 34.0k]
  |  Branch (1672:29): [True: 197, False: 230k]
  ------------------
 1673|    197|        return(0);
 1674|       |
 1675|   264k|    if ((ctxt->nsNr >= ctxt->nsMax) && (xmlParserNsGrow(ctxt) < 0)) {
  ------------------
  |  Branch (1675:9): [True: 13.3k, False: 251k]
  |  Branch (1675:40): [True: 15, False: 13.3k]
  ------------------
 1676|     15|        xmlErrMemory(ctxt);
 1677|     15|        return(-1);
 1678|     15|    }
 1679|       |
 1680|       |    /*
 1681|       |     * Default namespace and 'xml' namespace
 1682|       |     */
 1683|   264k|    if ((prefix == NULL) || (prefix->name == NULL)) {
  ------------------
  |  Branch (1683:9): [True: 33.9k, False: 230k]
  |  Branch (1683:29): [True: 0, False: 230k]
  ------------------
 1684|  33.9k|        oldIndex = ctxt->nsdb->defaultNsIndex;
 1685|       |
 1686|  33.9k|        if (oldIndex != INT_MAX) {
  ------------------
  |  Branch (1686:13): [True: 31.4k, False: 2.49k]
  ------------------
 1687|  31.4k|            extra = &ctxt->nsdb->extra[oldIndex];
 1688|       |
 1689|  31.4k|            if (extra->elementId == ctxt->nsdb->elementId) {
  ------------------
  |  Branch (1689:17): [True: 631, False: 30.8k]
  ------------------
 1690|    631|                if (defAttr == 0)
  ------------------
  |  Branch (1690:21): [True: 409, False: 222]
  ------------------
 1691|    409|                    xmlErrAttributeDup(ctxt, NULL, BAD_CAST "xmlns");
  ------------------
  |  |   34|    409|#define BAD_CAST (xmlChar *)
  ------------------
 1692|    631|                return(0);
 1693|    631|            }
 1694|       |
 1695|  30.8k|            if ((ctxt->options & XML_PARSE_NSCLEAN) &&
  ------------------
  |  Branch (1695:17): [True: 5.78k, False: 25.0k]
  ------------------
 1696|  5.78k|                (uri->name == ctxt->nsTab[oldIndex * 2 + 1]))
  ------------------
  |  Branch (1696:17): [True: 4.40k, False: 1.37k]
  ------------------
 1697|  4.40k|                return(0);
 1698|  30.8k|        }
 1699|       |
 1700|  28.9k|        ctxt->nsdb->defaultNsIndex = ctxt->nsNr;
 1701|  28.9k|        goto populate_entry;
 1702|  33.9k|    }
 1703|       |
 1704|       |    /*
 1705|       |     * Hash table lookup
 1706|       |     */
 1707|   230k|    oldIndex = xmlParserNsLookup(ctxt, prefix, &bucket);
 1708|   230k|    if (oldIndex != INT_MAX) {
  ------------------
  |  Branch (1708:9): [True: 195k, False: 35.1k]
  ------------------
 1709|   195k|        extra = &ctxt->nsdb->extra[oldIndex];
 1710|       |
 1711|       |        /*
 1712|       |         * Check for duplicate definitions on the same element.
 1713|       |         */
 1714|   195k|        if (extra->elementId == ctxt->nsdb->elementId) {
  ------------------
  |  Branch (1714:13): [True: 714, False: 194k]
  ------------------
 1715|    714|            if (defAttr == 0)
  ------------------
  |  Branch (1715:17): [True: 639, False: 75]
  ------------------
 1716|    639|                xmlErrAttributeDup(ctxt, BAD_CAST "xmlns", prefix->name);
  ------------------
  |  |   34|    639|#define BAD_CAST (xmlChar *)
  ------------------
 1717|    714|            return(0);
 1718|    714|        }
 1719|       |
 1720|   194k|        if ((ctxt->options & XML_PARSE_NSCLEAN) &&
  ------------------
  |  Branch (1720:13): [True: 4.00k, False: 190k]
  ------------------
 1721|  4.00k|            (uri->name == ctxt->nsTab[bucket->index * 2 + 1]))
  ------------------
  |  Branch (1721:13): [True: 3.03k, False: 971]
  ------------------
 1722|  3.03k|            return(0);
 1723|       |
 1724|   191k|        bucket->index = ctxt->nsNr;
 1725|   191k|        goto populate_entry;
 1726|   194k|    }
 1727|       |
 1728|       |    /*
 1729|       |     * Insert new bucket
 1730|       |     */
 1731|       |
 1732|  35.1k|    hashValue = prefix->hashValue;
 1733|       |
 1734|       |    /*
 1735|       |     * Grow hash table, 50% fill factor
 1736|       |     */
 1737|  35.1k|    if (ctxt->nsdb->hashElems + 1 > ctxt->nsdb->hashSize / 2) {
  ------------------
  |  Branch (1737:9): [True: 7.15k, False: 28.0k]
  ------------------
 1738|  7.15k|        xmlParserNsBucket *newHash;
 1739|  7.15k|        unsigned newSize, i, index;
 1740|       |
 1741|  7.15k|        if (ctxt->nsdb->hashSize > UINT_MAX / 2) {
  ------------------
  |  Branch (1741:13): [True: 0, False: 7.15k]
  ------------------
 1742|      0|            xmlErrMemory(ctxt);
 1743|      0|            return(-1);
 1744|      0|        }
 1745|  7.15k|        newSize = ctxt->nsdb->hashSize ? ctxt->nsdb->hashSize * 2 : 16;
  ------------------
  |  Branch (1745:19): [True: 491, False: 6.65k]
  ------------------
 1746|  7.15k|        newHash = xmlMalloc(newSize * sizeof(newHash[0]));
 1747|  7.15k|        if (newHash == NULL) {
  ------------------
  |  Branch (1747:13): [True: 2, False: 7.14k]
  ------------------
 1748|      2|            xmlErrMemory(ctxt);
 1749|      2|            return(-1);
 1750|      2|        }
 1751|  7.14k|        memset(newHash, 0, newSize * sizeof(newHash[0]));
 1752|       |
 1753|  92.0k|        for (i = 0; i < ctxt->nsdb->hashSize; i++) {
  ------------------
  |  Branch (1753:21): [True: 84.8k, False: 7.14k]
  ------------------
 1754|  84.8k|            unsigned hv = ctxt->nsdb->hash[i].hashValue;
 1755|  84.8k|            unsigned newIndex;
 1756|       |
 1757|  84.8k|            if ((hv == 0) || (ctxt->nsdb->hash[i].index == INT_MAX))
  ------------------
  |  Branch (1757:17): [True: 82.5k, False: 2.30k]
  |  Branch (1757:30): [True: 1.04k, False: 1.26k]
  ------------------
 1758|  83.6k|                continue;
 1759|  1.26k|            newIndex = hv & (newSize - 1);
 1760|       |
 1761|  1.95k|            while (newHash[newIndex].hashValue != 0) {
  ------------------
  |  Branch (1761:20): [True: 698, False: 1.26k]
  ------------------
 1762|    698|                newIndex++;
 1763|    698|                if (newIndex == newSize)
  ------------------
  |  Branch (1763:21): [True: 150, False: 548]
  ------------------
 1764|    150|                    newIndex = 0;
 1765|    698|            }
 1766|       |
 1767|  1.26k|            newHash[newIndex] = ctxt->nsdb->hash[i];
 1768|  1.26k|        }
 1769|       |
 1770|  7.14k|        xmlFree(ctxt->nsdb->hash);
 1771|  7.14k|        ctxt->nsdb->hash = newHash;
 1772|  7.14k|        ctxt->nsdb->hashSize = newSize;
 1773|       |
 1774|       |        /*
 1775|       |         * Relookup
 1776|       |         */
 1777|  7.14k|        index = hashValue & (newSize - 1);
 1778|       |
 1779|  7.43k|        while (newHash[index].hashValue != 0) {
  ------------------
  |  Branch (1779:16): [True: 284, False: 7.14k]
  ------------------
 1780|    284|            index++;
 1781|    284|            if (index == newSize)
  ------------------
  |  Branch (1781:17): [True: 42, False: 242]
  ------------------
 1782|     42|                index = 0;
 1783|    284|        }
 1784|       |
 1785|  7.14k|        bucket = &newHash[index];
 1786|  7.14k|    }
 1787|       |
 1788|  35.1k|    bucket->hashValue = hashValue;
 1789|  35.1k|    bucket->index = ctxt->nsNr;
 1790|  35.1k|    ctxt->nsdb->hashElems++;
 1791|  35.1k|    oldIndex = INT_MAX;
 1792|       |
 1793|   255k|populate_entry:
 1794|   255k|    nsIndex = ctxt->nsNr;
 1795|       |
 1796|   255k|    ns = &ctxt->nsTab[nsIndex * 2];
 1797|   255k|    ns[0] = prefix ? prefix->name : NULL;
  ------------------
  |  Branch (1797:13): [True: 227k, False: 28.9k]
  ------------------
 1798|   255k|    ns[1] = uri->name;
 1799|       |
 1800|   255k|    extra = &ctxt->nsdb->extra[nsIndex];
 1801|   255k|    extra->saxData = saxData;
 1802|   255k|    extra->prefixHashValue = prefix ? prefix->hashValue : 0;
  ------------------
  |  Branch (1802:30): [True: 227k, False: 28.9k]
  ------------------
 1803|   255k|    extra->uriHashValue = uri->hashValue;
 1804|   255k|    extra->elementId = ctxt->nsdb->elementId;
 1805|   255k|    extra->oldIndex = oldIndex;
 1806|       |
 1807|   255k|    ctxt->nsNr++;
 1808|       |
 1809|   255k|    return(1);
 1810|  35.1k|}
parser.c:xmlParserNsGrow:
 1624|  13.3k|xmlParserNsGrow(xmlParserCtxtPtr ctxt) {
 1625|  13.3k|    const xmlChar **table;
 1626|  13.3k|    xmlParserNsExtra *extra;
 1627|  13.3k|    int newSize;
 1628|       |
 1629|  13.3k|    newSize = xmlGrowCapacity(ctxt->nsMax,
 1630|  13.3k|                              sizeof(table[0]) + sizeof(extra[0]),
 1631|  13.3k|                              16, XML_MAX_ITEMS);
  ------------------
  |  |   13|  13.3k|#define XML_MAX_ITEMS 1000000000 /* 1 billion */
  ------------------
 1632|  13.3k|    if (newSize < 0)
  ------------------
  |  Branch (1632:9): [True: 0, False: 13.3k]
  ------------------
 1633|      0|        goto error;
 1634|       |
 1635|  13.3k|    table = xmlRealloc(ctxt->nsTab, 2 * newSize * sizeof(table[0]));
 1636|  13.3k|    if (table == NULL)
  ------------------
  |  Branch (1636:9): [True: 7, False: 13.3k]
  ------------------
 1637|      7|        goto error;
 1638|  13.3k|    ctxt->nsTab = table;
 1639|       |
 1640|  13.3k|    extra = xmlRealloc(ctxt->nsdb->extra, newSize * sizeof(extra[0]));
 1641|  13.3k|    if (extra == NULL)
  ------------------
  |  Branch (1641:9): [True: 8, False: 13.3k]
  ------------------
 1642|      8|        goto error;
 1643|  13.3k|    ctxt->nsdb->extra = extra;
 1644|       |
 1645|  13.3k|    ctxt->nsMax = newSize;
 1646|  13.3k|    return(0);
 1647|       |
 1648|     15|error:
 1649|     15|    xmlErrMemory(ctxt);
 1650|     15|    return(-1);
 1651|  13.3k|}
parser.c:xmlParserNsPop:
 1821|   139k|{
 1822|   139k|    int i;
 1823|       |
 1824|       |    /* assert(nr <= ctxt->nsNr); */
 1825|       |
 1826|   342k|    for (i = ctxt->nsNr - 1; i >= ctxt->nsNr - nr; i--) {
  ------------------
  |  Branch (1826:30): [True: 202k, False: 139k]
  ------------------
 1827|   202k|        const xmlChar *prefix = ctxt->nsTab[i * 2];
 1828|   202k|        xmlParserNsExtra *extra = &ctxt->nsdb->extra[i];
 1829|       |
 1830|   202k|        if (prefix == NULL) {
  ------------------
  |  Branch (1830:13): [True: 13.5k, False: 188k]
  ------------------
 1831|  13.5k|            ctxt->nsdb->defaultNsIndex = extra->oldIndex;
 1832|   188k|        } else {
 1833|   188k|            xmlHashedString hprefix;
 1834|   188k|            xmlParserNsBucket *bucket = NULL;
 1835|       |
 1836|   188k|            hprefix.name = prefix;
 1837|   188k|            hprefix.hashValue = extra->prefixHashValue;
 1838|   188k|            xmlParserNsLookup(ctxt, &hprefix, &bucket);
 1839|       |            /* assert(bucket && bucket->hashValue); */
 1840|   188k|            bucket->index = extra->oldIndex;
 1841|   188k|        }
 1842|   202k|    }
 1843|       |
 1844|   139k|    ctxt->nsNr -= nr;
 1845|   139k|    return(nr);
 1846|   139k|}
parser.c:xmlCtxtSetOptionsInternal:
13132|  39.0k|{
13133|  39.0k|    int allMask;
13134|       |
13135|  39.0k|    if (ctxt == NULL)
  ------------------
  |  Branch (13135:9): [True: 0, False: 39.0k]
  ------------------
13136|      0|        return(-1);
13137|       |
13138|       |    /*
13139|       |     * XInclude options aren't handled by the parser.
13140|       |     *
13141|       |     * XML_PARSE_XINCLUDE
13142|       |     * XML_PARSE_NOXINCNODE
13143|       |     * XML_PARSE_NOBASEFIX
13144|       |     */
13145|  39.0k|    allMask = XML_PARSE_RECOVER |
13146|  39.0k|              XML_PARSE_NOENT |
13147|  39.0k|              XML_PARSE_DTDLOAD |
13148|  39.0k|              XML_PARSE_DTDATTR |
13149|  39.0k|              XML_PARSE_DTDVALID |
13150|  39.0k|              XML_PARSE_NOERROR |
13151|  39.0k|              XML_PARSE_NOWARNING |
13152|  39.0k|              XML_PARSE_PEDANTIC |
13153|  39.0k|              XML_PARSE_NOBLANKS |
13154|  39.0k|#ifdef LIBXML_SAX1_ENABLED
13155|  39.0k|              XML_PARSE_SAX1 |
13156|  39.0k|#endif
13157|  39.0k|              XML_PARSE_NONET |
13158|  39.0k|              XML_PARSE_NODICT |
13159|  39.0k|              XML_PARSE_NSCLEAN |
13160|  39.0k|              XML_PARSE_NOCDATA |
13161|  39.0k|              XML_PARSE_COMPACT |
13162|  39.0k|              XML_PARSE_OLD10 |
13163|  39.0k|              XML_PARSE_HUGE |
13164|  39.0k|              XML_PARSE_OLDSAX |
13165|  39.0k|              XML_PARSE_IGNORE_ENC |
13166|  39.0k|              XML_PARSE_BIG_LINES |
13167|  39.0k|              XML_PARSE_NO_XXE |
13168|  39.0k|              XML_PARSE_UNZIP |
13169|  39.0k|              XML_PARSE_NO_SYS_CATALOG |
13170|  39.0k|              XML_PARSE_CATALOG_PI;
13171|       |
13172|  39.0k|    ctxt->options = (ctxt->options & keepMask) | (options & allMask);
13173|       |
13174|       |    /*
13175|       |     * For some options, struct members are historically the source
13176|       |     * of truth. The values are initalized from global variables and
13177|       |     * old code could also modify them directly. Several older API
13178|       |     * functions that don't take an options argument rely on these
13179|       |     * deprecated mechanisms.
13180|       |     *
13181|       |     * Once public access to struct members and the globals are
13182|       |     * disabled, we can use the options bitmask as source of
13183|       |     * truth, making all these struct members obsolete.
13184|       |     *
13185|       |     * The XML_DETECT_IDS flags is misnamed. It simply enables
13186|       |     * loading of the external subset.
13187|       |     */
13188|  39.0k|    ctxt->recovery = (options & XML_PARSE_RECOVER) ? 1 : 0;
  ------------------
  |  Branch (13188:22): [True: 19.8k, False: 19.2k]
  ------------------
13189|  39.0k|    ctxt->replaceEntities = (options & XML_PARSE_NOENT) ? 1 : 0;
  ------------------
  |  Branch (13189:29): [True: 19.8k, False: 19.1k]
  ------------------
13190|  39.0k|    ctxt->loadsubset = (options & XML_PARSE_DTDLOAD) ? XML_DETECT_IDS : 0;
  ------------------
  |  |  208|  21.6k|#define XML_DETECT_IDS		2
  ------------------
  |  Branch (13190:24): [True: 21.6k, False: 17.3k]
  ------------------
13191|  39.0k|    ctxt->loadsubset |= (options & XML_PARSE_DTDATTR) ? XML_COMPLETE_ATTRS : 0;
  ------------------
  |  |  209|  18.9k|#define XML_COMPLETE_ATTRS	4
  ------------------
  |  Branch (13191:25): [True: 18.9k, False: 20.0k]
  ------------------
13192|  39.0k|    ctxt->loadsubset |= (options & XML_PARSE_SKIP_IDS) ? XML_SKIP_IDS : 0;
  ------------------
  |  |  210|  18.8k|#define XML_SKIP_IDS		8
  ------------------
  |  Branch (13192:25): [True: 18.8k, False: 20.2k]
  ------------------
13193|  39.0k|    ctxt->validate = (options & XML_PARSE_DTDVALID) ? 1 : 0;
  ------------------
  |  Branch (13193:22): [True: 18.5k, False: 20.5k]
  ------------------
13194|  39.0k|    ctxt->pedantic = (options & XML_PARSE_PEDANTIC) ? 1 : 0;
  ------------------
  |  Branch (13194:22): [True: 9.00k, False: 30.0k]
  ------------------
13195|  39.0k|    ctxt->keepBlanks = (options & XML_PARSE_NOBLANKS) ? 0 : 1;
  ------------------
  |  Branch (13195:24): [True: 18.0k, False: 20.9k]
  ------------------
13196|  39.0k|    ctxt->dictNames = (options & XML_PARSE_NODICT) ? 0 : 1;
  ------------------
  |  Branch (13196:23): [True: 16.8k, False: 22.2k]
  ------------------
13197|       |
13198|  39.0k|    return(options & ~allMask);
13199|  39.0k|}

xmlCtxtSetErrorHandler:
  122|  39.0k|{
  123|  39.0k|    if (ctxt == NULL)
  ------------------
  |  Branch (123:9): [True: 0, False: 39.0k]
  ------------------
  124|      0|        return;
  125|  39.0k|    ctxt->errorHandler = handler;
  126|  39.0k|    ctxt->errorCtxt = data;
  127|  39.0k|}
xmlCtxtErrMemory:
  179|  10.1k|{
  180|  10.1k|    xmlStructuredErrorFunc schannel = NULL;
  181|  10.1k|    xmlGenericErrorFunc channel = NULL;
  182|  10.1k|    void *data;
  183|       |
  184|  10.1k|    if (ctxt == NULL) {
  ------------------
  |  Branch (184:9): [True: 0, False: 10.1k]
  ------------------
  185|      0|        xmlRaiseMemoryError(NULL, NULL, NULL, XML_FROM_PARSER, NULL);
  186|      0|        return;
  187|      0|    }
  188|       |
  189|  10.1k|    ctxt->errNo = XML_ERR_NO_MEMORY;
  190|  10.1k|    ctxt->instate = XML_PARSER_EOF; /* TODO: Remove after refactoring */
  191|  10.1k|    ctxt->wellFormed = 0;
  192|  10.1k|    ctxt->disableSAX = 2;
  193|       |
  194|  10.1k|    if (ctxt->errorHandler) {
  ------------------
  |  Branch (194:9): [True: 10.1k, False: 0]
  ------------------
  195|  10.1k|        schannel = ctxt->errorHandler;
  196|  10.1k|        data = ctxt->errorCtxt;
  197|  10.1k|    } 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|  10.1k|    xmlRaiseMemoryError(schannel, channel, data, XML_FROM_PARSER,
  207|  10.1k|                        &ctxt->lastError);
  208|  10.1k|}
xmlCtxtErrIO:
  221|   193k|{
  222|   193k|    const char *errstr, *msg, *str1, *str2;
  223|   193k|    xmlErrorLevel level;
  224|       |
  225|   193k|    if (ctxt == NULL)
  ------------------
  |  Branch (225:9): [True: 0, False: 193k]
  ------------------
  226|      0|        return;
  227|       |
  228|   193k|    if (((code == XML_IO_ENOENT) ||
  ------------------
  |  Branch (228:10): [True: 4.76k, False: 188k]
  ------------------
  229|   188k|         (code == XML_IO_UNKNOWN))) {
  ------------------
  |  Branch (229:10): [True: 0, False: 188k]
  ------------------
  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|  4.76k|        if (ctxt->validate == 0)
  ------------------
  |  Branch (236:13): [True: 1.80k, False: 2.96k]
  ------------------
  237|  1.80k|            level = XML_ERR_WARNING;
  238|  2.96k|        else
  239|  2.96k|            level = XML_ERR_ERROR;
  240|   188k|    } else if (code == XML_IO_NETWORK_ATTEMPT) {
  ------------------
  |  Branch (240:16): [True: 0, False: 188k]
  ------------------
  241|      0|        level = XML_ERR_ERROR;
  242|   188k|    } else {
  243|   188k|        level = XML_ERR_FATAL;
  244|   188k|    }
  245|       |
  246|   193k|    errstr = xmlErrString(code);
  247|       |
  248|   193k|    if (uri == NULL) {
  ------------------
  |  Branch (248:9): [True: 188k, False: 4.83k]
  ------------------
  249|   188k|        msg = "%s\n";
  250|   188k|        str1 = errstr;
  251|   188k|        str2 = NULL;
  252|   188k|    } else {
  253|  4.83k|        msg = "failed to load \"%s\": %s\n";
  254|  4.83k|        str1 = uri;
  255|  4.83k|        str2 = errstr;
  256|  4.83k|    }
  257|       |
  258|   193k|    xmlCtxtErr(ctxt, NULL, XML_FROM_IO, code, level,
  259|   193k|               (const xmlChar *) uri, NULL, NULL, 0,
  260|   193k|               msg, str1, str2);
  261|   193k|}
xmlCtxtIsCatastrophicError:
  268|  42.0M|xmlCtxtIsCatastrophicError(xmlParserCtxt *ctxt) {
  269|  42.0M|    if (ctxt == NULL)
  ------------------
  |  Branch (269:9): [True: 0, False: 42.0M]
  ------------------
  270|      0|        return(1);
  271|       |
  272|  42.0M|    return(xmlIsCatastrophicError(ctxt->lastError.level,
  273|  42.0M|                                  ctxt->lastError.code));
  274|  42.0M|}
xmlCtxtVErr:
  296|  42.2M|{
  297|  42.2M|    xmlStructuredErrorFunc schannel = NULL;
  298|  42.2M|    xmlGenericErrorFunc channel = NULL;
  299|  42.2M|    void *data = NULL;
  300|  42.2M|    const char *file = NULL;
  301|  42.2M|    int line = 0;
  302|  42.2M|    int col = 0;
  303|  42.2M|    int res;
  304|       |
  305|  42.2M|    if (code == XML_ERR_NO_MEMORY) {
  ------------------
  |  Branch (305:9): [True: 2.83k, False: 42.2M]
  ------------------
  306|  2.83k|        xmlCtxtErrMemory(ctxt);
  307|  2.83k|        return;
  308|  2.83k|    }
  309|       |
  310|  42.2M|    if (ctxt == NULL) {
  ------------------
  |  Branch (310:9): [True: 0, False: 42.2M]
  ------------------
  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|  42.2M|    if (PARSER_STOPPED(ctxt))
  ------------------
  |  |   44|  42.2M|#define PARSER_STOPPED(ctxt) ((ctxt)->disableSAX > 1)
  |  |  ------------------
  |  |  |  Branch (44:30): [True: 270k, False: 41.9M]
  |  |  ------------------
  ------------------
  322|   270k|	return;
  323|       |
  324|       |    /* Don't overwrite catastrophic errors */
  325|  41.9M|    if (xmlCtxtIsCatastrophicError(ctxt))
  ------------------
  |  Branch (325:9): [True: 0, False: 41.9M]
  ------------------
  326|      0|        return;
  327|       |
  328|  41.9M|    if (level == XML_ERR_WARNING) {
  ------------------
  |  Branch (328:9): [True: 108k, False: 41.8M]
  ------------------
  329|   108k|        if (ctxt->nbWarnings >= XML_MAX_ERRORS)
  ------------------
  |  |   54|   108k|#define XML_MAX_ERRORS 100
  ------------------
  |  Branch (329:13): [True: 66.9k, False: 41.7k]
  ------------------
  330|  66.9k|            return;
  331|  41.7k|        ctxt->nbWarnings += 1;
  332|  41.8M|    } else {
  333|       |        /*
  334|       |         * By long-standing design, the parser isn't completely
  335|       |         * stopped on well-formedness errors. Only SAX callbacks
  336|       |         * are disabled.
  337|       |         *
  338|       |         * In some situations, we really want to abort as fast
  339|       |         * as possible.
  340|       |         */
  341|  41.8M|        if (xmlIsCatastrophicError(level, code) ||
  ------------------
  |  Branch (341:13): [True: 15, False: 41.8M]
  ------------------
  342|  41.8M|            code == XML_ERR_RESOURCE_LIMIT ||
  ------------------
  |  Branch (342:13): [True: 241, False: 41.8M]
  ------------------
  343|  41.8M|            code == XML_ERR_ENTITY_LOOP) {
  ------------------
  |  Branch (343:13): [True: 77, False: 41.8M]
  ------------------
  344|    333|            ctxt->disableSAX = 2; /* really stop parser */
  345|  41.8M|        } else {
  346|       |            /* Report at least one fatal error. */
  347|  41.8M|            if (ctxt->nbErrors >= XML_MAX_ERRORS &&
  ------------------
  |  |   54|  83.7M|#define XML_MAX_ERRORS 100
  ------------------
  |  Branch (347:17): [True: 41.3M, False: 498k]
  ------------------
  348|  41.3M|                (level < XML_ERR_FATAL || ctxt->wellFormed == 0))
  ------------------
  |  Branch (348:18): [True: 546k, False: 40.8M]
  |  Branch (348:43): [True: 40.8M, False: 181]
  ------------------
  349|  41.3M|                return;
  350|       |
  351|   498k|            if (level == XML_ERR_FATAL && ctxt->recovery == 0)
  ------------------
  |  Branch (351:17): [True: 378k, False: 119k]
  |  Branch (351:43): [True: 93.9k, False: 284k]
  ------------------
  352|  93.9k|                ctxt->disableSAX = 1;
  353|   498k|        }
  354|       |
  355|   498k|        if (level == XML_ERR_FATAL)
  ------------------
  |  Branch (355:13): [True: 379k, False: 119k]
  ------------------
  356|   379k|            ctxt->wellFormed = 0;
  357|   498k|        ctxt->errNo = code;
  358|   498k|        ctxt->nbErrors += 1;
  359|   498k|    }
  360|       |
  361|   540k|    if (((ctxt->options & XML_PARSE_NOERROR) == 0) &&
  ------------------
  |  Branch (361:9): [True: 196k, False: 344k]
  ------------------
  362|   196k|        ((level != XML_ERR_WARNING) ||
  ------------------
  |  Branch (362:10): [True: 181k, False: 14.8k]
  ------------------
  363|   189k|         ((ctxt->options & XML_PARSE_NOWARNING) == 0))) {
  ------------------
  |  Branch (363:10): [True: 8.13k, False: 6.70k]
  ------------------
  364|   189k|        if (ctxt->errorHandler) {
  ------------------
  |  Branch (364:13): [True: 189k, False: 0]
  ------------------
  365|   189k|            schannel = ctxt->errorHandler;
  366|   189k|            data = ctxt->errorCtxt;
  367|   189k|        } 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|   189k|    }
  385|       |
  386|   540k|    if (ctxt->input != NULL) {
  ------------------
  |  Branch (386:9): [True: 538k, False: 2.09k]
  ------------------
  387|   538k|        xmlParserInputPtr input = ctxt->input;
  388|       |
  389|   538k|        if ((input->filename == NULL) &&
  ------------------
  |  Branch (389:13): [True: 313k, False: 224k]
  ------------------
  390|   313k|            (ctxt->inputNr > 1)) {
  ------------------
  |  Branch (390:13): [True: 17.4k, False: 296k]
  ------------------
  391|  17.4k|            input = ctxt->inputTab[ctxt->inputNr - 2];
  392|  17.4k|        }
  393|   538k|        file = input->filename;
  394|   538k|        line = input->line;
  395|   538k|        col = input->col;
  396|   538k|    }
  397|       |
  398|   540k|    res = xmlVRaiseError(schannel, channel, data, ctxt, node, domain, code,
  399|   540k|                         level, file, line, (const char *) str1,
  400|   540k|                         (const char *) str2, (const char *) str3, int1, col,
  401|   540k|                         msg, ap);
  402|       |
  403|   540k|    if (res < 0) {
  ------------------
  |  Branch (403:9): [True: 2.02k, False: 538k]
  ------------------
  404|  2.02k|        xmlCtxtErrMemory(ctxt);
  405|  2.02k|        return;
  406|  2.02k|    }
  407|   540k|}
xmlCtxtErr:
  429|  41.9M|{
  430|  41.9M|    va_list ap;
  431|       |
  432|  41.9M|    va_start(ap, msg);
  433|  41.9M|    xmlCtxtVErr(ctxt, node, domain, code, level,
  434|  41.9M|                str1, str2, str3, int1, msg, ap);
  435|       |    va_end(ap);
  436|  41.9M|}
xmlFatalErr:
  481|  7.86M|{
  482|  7.86M|    const char *errmsg;
  483|  7.86M|    xmlErrorDomain domain = XML_FROM_PARSER;
  484|  7.86M|    xmlErrorLevel level = XML_ERR_FATAL;
  485|       |
  486|  7.86M|    errmsg = xmlErrString(code);
  487|       |
  488|  7.86M|    if ((ctxt != NULL) && (ctxt->html)) {
  ------------------
  |  Branch (488:9): [True: 7.86M, False: 0]
  |  Branch (488:27): [True: 0, False: 7.86M]
  ------------------
  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|  7.86M|    if (info == NULL) {
  ------------------
  |  Branch (496:9): [True: 1.21M, False: 6.64M]
  ------------------
  497|  1.21M|        xmlCtxtErr(ctxt, NULL, domain, code, level,
  498|  1.21M|                   NULL, NULL, NULL, 0, "%s\n", errmsg);
  499|  6.64M|    } else {
  500|  6.64M|        xmlCtxtErr(ctxt, NULL, domain, code, level,
  501|  6.64M|                   (const xmlChar *) info, NULL, NULL, 0,
  502|  6.64M|                   "%s: %s\n", errmsg, info);
  503|  6.64M|    }
  504|  7.86M|}
xmlParserGrow:
  616|  8.00M|xmlParserGrow(xmlParserCtxt *ctxt) {
  617|  8.00M|    xmlParserInputPtr in = ctxt->input;
  618|  8.00M|    xmlParserInputBufferPtr buf = in->buf;
  619|  8.00M|    size_t curEnd = in->end - in->cur;
  620|  8.00M|    size_t curBase = in->cur - in->base;
  621|  8.00M|    size_t maxLength = (ctxt->options & XML_PARSE_HUGE) ?
  ------------------
  |  Branch (621:24): [True: 2.80M, False: 5.19M]
  ------------------
  622|  2.80M|                       XML_MAX_HUGE_LENGTH :
  ------------------
  |  |   55|  2.80M|#define XML_MAX_HUGE_LENGTH 1000000000
  ------------------
  623|  8.00M|                       XML_MAX_LOOKUP_LIMIT;
  ------------------
  |  |   81|  13.1M|#define XML_MAX_LOOKUP_LIMIT 10000000
  ------------------
  624|  8.00M|    int ret;
  625|       |
  626|  8.00M|    if (buf == NULL)
  ------------------
  |  Branch (626:9): [True: 0, False: 8.00M]
  ------------------
  627|      0|        return(0);
  628|       |    /* Don't grow push parser buffer. */
  629|  8.00M|    if (PARSER_PROGRESSIVE(ctxt))
  ------------------
  |  |   47|  8.00M|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  ------------------
  |  |  |  |   41|  8.00M|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  ------------------
  |  |  |  Branch (47:5): [True: 2.39M, False: 5.60M]
  |  |  ------------------
  ------------------
  630|  2.39M|        return(0);
  631|       |    /* Don't grow memory buffers. */
  632|  5.60M|    if ((buf->encoder == NULL) && (buf->readcallback == NULL))
  ------------------
  |  Branch (632:9): [True: 5.27M, False: 332k]
  |  Branch (632:35): [True: 5.27M, False: 0]
  ------------------
  633|  5.27M|        return(0);
  634|   332k|    if (buf->error != 0)
  ------------------
  |  Branch (634:9): [True: 80.7k, False: 252k]
  ------------------
  635|  80.7k|        return(-1);
  636|       |
  637|   252k|    if (curBase > maxLength) {
  ------------------
  |  Branch (637:9): [True: 0, False: 252k]
  ------------------
  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|   252k|    if (curEnd >= INPUT_CHUNK)
  ------------------
  |  |   63|   252k|#define INPUT_CHUNK	250
  ------------------
  |  Branch (643:9): [True: 331, False: 251k]
  ------------------
  644|    331|        return(0);
  645|       |
  646|   251k|    ret = xmlParserInputBufferGrow(buf, INPUT_CHUNK);
  ------------------
  |  |   63|   251k|#define INPUT_CHUNK	250
  ------------------
  647|   251k|    xmlBufUpdateInput(buf->buffer, in, curBase);
  648|       |
  649|   251k|    if (ret < 0) {
  ------------------
  |  Branch (649:9): [True: 378, False: 251k]
  ------------------
  650|    378|        xmlCtxtErrIO(ctxt, buf->error, NULL);
  651|    378|    }
  652|       |
  653|   251k|    return(ret);
  654|   252k|}
xmlParserCheckEOF:
  664|  19.5k|xmlParserCheckEOF(xmlParserCtxt *ctxt, xmlParserErrors code) {
  665|  19.5k|    xmlParserInputPtr in = ctxt->input;
  666|  19.5k|    xmlParserInputBufferPtr buf;
  667|       |
  668|  19.5k|    if (ctxt->errNo != XML_ERR_OK)
  ------------------
  |  Branch (668:9): [True: 16.0k, False: 3.49k]
  ------------------
  669|  16.0k|        return;
  670|       |
  671|  3.49k|    if (in->cur < in->end) {
  ------------------
  |  Branch (671:9): [True: 2, False: 3.49k]
  ------------------
  672|      2|        xmlFatalErr(ctxt, code, NULL);
  673|      2|        return;
  674|      2|    }
  675|       |
  676|  3.49k|    buf = in->buf;
  677|  3.49k|    if ((buf != NULL) && (buf->encoder != NULL)) {
  ------------------
  |  Branch (677:9): [True: 3.49k, False: 0]
  |  Branch (677:26): [True: 12, False: 3.48k]
  ------------------
  678|     12|        size_t curBase = in->cur - in->base;
  679|     12|        size_t sizeOut = 64;
  680|     12|        xmlCharEncError ret;
  681|       |
  682|       |        /*
  683|       |         * Check for truncated multi-byte sequence
  684|       |         */
  685|     12|        ret = xmlCharEncInput(buf, &sizeOut, /* flush */ 1);
  686|     12|        xmlBufUpdateInput(buf->buffer, in, curBase);
  687|     12|        if (ret != XML_ENC_ERR_SUCCESS) {
  ------------------
  |  Branch (687:13): [True: 0, False: 12]
  ------------------
  688|      0|            xmlCtxtErrIO(ctxt, buf->error, NULL);
  689|      0|            return;
  690|      0|        }
  691|       |
  692|       |        /* Shouldn't happen */
  693|     12|        if (in->cur < in->end)
  ------------------
  |  Branch (693:13): [True: 0, False: 12]
  ------------------
  694|      0|            xmlFatalErr(ctxt, XML_ERR_INTERNAL_ERROR, "expected EOF");
  695|     12|    }
  696|  3.49k|}
xmlParserShrink:
  749|  10.2M|xmlParserShrink(xmlParserCtxt *ctxt) {
  750|  10.2M|    xmlParserInputPtr in = ctxt->input;
  751|  10.2M|    xmlParserInputBufferPtr buf = in->buf;
  752|  10.2M|    size_t used, res;
  753|       |
  754|  10.2M|    if (buf == NULL)
  ------------------
  |  Branch (754:9): [True: 0, False: 10.2M]
  ------------------
  755|      0|        return;
  756|       |
  757|  10.2M|    used = in->cur - in->base;
  758|       |
  759|  10.2M|    if (used > LINE_LEN) {
  ------------------
  |  |  595|  10.2M|#define LINE_LEN        80
  ------------------
  |  Branch (759:9): [True: 6.26M, False: 3.98M]
  ------------------
  760|  6.26M|        res = xmlBufShrink(buf->buffer, used - LINE_LEN);
  ------------------
  |  |  595|  6.26M|#define LINE_LEN        80
  ------------------
  761|       |
  762|  6.26M|        if (res > 0) {
  ------------------
  |  Branch (762:13): [True: 6.26M, False: 213]
  ------------------
  763|  6.26M|            used -= res;
  764|  6.26M|            xmlSaturatedAddSizeT(&in->consumed, res);
  765|  6.26M|        }
  766|       |
  767|  6.26M|        xmlBufUpdateInput(buf->buffer, in, used);
  768|  6.26M|    }
  769|  10.2M|}
xmlNextChar:
  818|   266M|{
  819|   266M|    const unsigned char *cur;
  820|   266M|    size_t avail;
  821|   266M|    int c;
  822|       |
  823|   266M|    if ((ctxt == NULL) || (ctxt->input == NULL))
  ------------------
  |  Branch (823:9): [True: 0, False: 266M]
  |  Branch (823:27): [True: 0, False: 266M]
  ------------------
  824|      0|        return;
  825|       |
  826|   266M|    avail = ctxt->input->end - ctxt->input->cur;
  827|       |
  828|   266M|    if (avail < INPUT_CHUNK) {
  ------------------
  |  |   63|   266M|#define INPUT_CHUNK	250
  ------------------
  |  Branch (828:9): [True: 1.99M, False: 264M]
  ------------------
  829|  1.99M|        xmlParserGrow(ctxt);
  830|  1.99M|        if (ctxt->input->cur >= ctxt->input->end)
  ------------------
  |  Branch (830:13): [True: 570, False: 1.99M]
  ------------------
  831|    570|            return;
  832|  1.99M|        avail = ctxt->input->end - ctxt->input->cur;
  833|  1.99M|    }
  834|       |
  835|   266M|    cur = ctxt->input->cur;
  836|   266M|    c = *cur;
  837|       |
  838|   266M|    if (c < 0x80) {
  ------------------
  |  Branch (838:9): [True: 246M, False: 20.1M]
  ------------------
  839|   246M|        if (c == '\n') {
  ------------------
  |  Branch (839:13): [True: 356k, False: 246M]
  ------------------
  840|   356k|            ctxt->input->cur++;
  841|   356k|            ctxt->input->line++;
  842|   356k|            ctxt->input->col = 1;
  843|   246M|        } else if (c == '\r') {
  ------------------
  |  Branch (843:20): [True: 30.9k, False: 246M]
  ------------------
  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|  30.9k|            ctxt->input->cur += ((cur[1] == '\n') ? 2 : 1);
  ------------------
  |  Branch (850:34): [True: 29.9k, False: 1.01k]
  ------------------
  851|  30.9k|            ctxt->input->line++;
  852|  30.9k|            ctxt->input->col = 1;
  853|  30.9k|            return;
  854|   246M|        } else {
  855|   246M|            ctxt->input->cur++;
  856|   246M|            ctxt->input->col++;
  857|   246M|        }
  858|   246M|    } else {
  859|  20.1M|        ctxt->input->col++;
  860|       |
  861|  20.1M|        if ((avail < 2) || (cur[1] & 0xc0) != 0x80)
  ------------------
  |  Branch (861:13): [True: 2.07k, False: 20.1M]
  |  Branch (861:28): [True: 18.7M, False: 1.43M]
  ------------------
  862|  18.7M|            goto encoding_error;
  863|       |
  864|  1.43M|        if (c < 0xe0) {
  ------------------
  |  Branch (864:13): [True: 1.28M, False: 145k]
  ------------------
  865|       |            /* 2-byte code */
  866|  1.28M|            if (c < 0xc2)
  ------------------
  |  Branch (866:17): [True: 531k, False: 754k]
  ------------------
  867|   531k|                goto encoding_error;
  868|   754k|            ctxt->input->cur += 2;
  869|   754k|        } else {
  870|   145k|            unsigned int val = (c << 8) | cur[1];
  871|       |
  872|   145k|            if ((avail < 3) || (cur[2] & 0xc0) != 0x80)
  ------------------
  |  Branch (872:17): [True: 321, False: 144k]
  |  Branch (872:32): [True: 2.16k, False: 142k]
  ------------------
  873|  2.48k|                goto encoding_error;
  874|       |
  875|   142k|            if (c < 0xf0) {
  ------------------
  |  Branch (875:17): [True: 117k, False: 25.0k]
  ------------------
  876|       |                /* 3-byte code */
  877|   117k|                if ((val < 0xe0a0) || ((val >= 0xeda0) && (val < 0xee00)))
  ------------------
  |  Branch (877:21): [True: 383, False: 117k]
  |  Branch (877:40): [True: 10.7k, False: 106k]
  |  Branch (877:59): [True: 1.23k, False: 9.53k]
  ------------------
  878|  1.61k|                    goto encoding_error;
  879|   116k|                ctxt->input->cur += 3;
  880|   116k|            } else {
  881|  25.0k|                if ((avail < 4) || ((cur[3] & 0xc0) != 0x80))
  ------------------
  |  Branch (881:21): [True: 306, False: 24.7k]
  |  Branch (881:36): [True: 267, False: 24.4k]
  ------------------
  882|    573|                    goto encoding_error;
  883|       |
  884|       |                /* 4-byte code */
  885|  24.4k|                if ((val < 0xf090) || (val >= 0xf490))
  ------------------
  |  Branch (885:21): [True: 261, False: 24.2k]
  |  Branch (885:39): [True: 2.03k, False: 22.1k]
  ------------------
  886|  2.29k|                    goto encoding_error;
  887|  22.1k|                ctxt->input->cur += 4;
  888|  22.1k|            }
  889|   142k|        }
  890|  1.43M|    }
  891|       |
  892|   247M|    return;
  893|       |
  894|   247M|encoding_error:
  895|       |    /* Only report the first error */
  896|  19.3M|    if ((ctxt->input->flags & XML_INPUT_ENCODING_ERROR) == 0) {
  ------------------
  |  |   40|  19.3M|#define XML_INPUT_ENCODING_ERROR    (1u << 5)
  ------------------
  |  Branch (896:9): [True: 155k, False: 19.1M]
  ------------------
  897|   155k|        xmlCtxtErrIO(ctxt, XML_ERR_INVALID_ENCODING, NULL);
  898|   155k|        ctxt->input->flags |= XML_INPUT_ENCODING_ERROR;
  ------------------
  |  |   40|   155k|#define XML_INPUT_ENCODING_ERROR    (1u << 5)
  ------------------
  899|   155k|    }
  900|  19.3M|    ctxt->input->cur++;
  901|  19.3M|}
xmlCurrentChar:
  924|  52.2M|xmlCurrentChar(xmlParserCtxt *ctxt, int *len) {
  925|  52.2M|    const unsigned char *cur;
  926|  52.2M|    size_t avail;
  927|  52.2M|    int c;
  928|       |
  929|  52.2M|    if ((ctxt == NULL) || (len == NULL) || (ctxt->input == NULL)) return(0);
  ------------------
  |  Branch (929:9): [True: 0, False: 52.2M]
  |  Branch (929:27): [True: 0, False: 52.2M]
  |  Branch (929:44): [True: 0, False: 52.2M]
  ------------------
  930|       |
  931|  52.2M|    avail = ctxt->input->end - ctxt->input->cur;
  932|       |
  933|  52.2M|    if (avail < INPUT_CHUNK) {
  ------------------
  |  |   63|  52.2M|#define INPUT_CHUNK	250
  ------------------
  |  Branch (933:9): [True: 2.80M, False: 49.4M]
  ------------------
  934|  2.80M|        xmlParserGrow(ctxt);
  935|  2.80M|        avail = ctxt->input->end - ctxt->input->cur;
  936|  2.80M|    }
  937|       |
  938|  52.2M|    cur = ctxt->input->cur;
  939|  52.2M|    c = *cur;
  940|       |
  941|  52.2M|    if (c < 0x80) {
  ------------------
  |  Branch (941:9): [True: 27.6M, False: 24.6M]
  ------------------
  942|       |	/* 1-byte code */
  943|  27.6M|        if (c < 0x20) {
  ------------------
  |  Branch (943:13): [True: 11.6M, False: 15.9M]
  ------------------
  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|  11.6M|            if (c == '\r') {
  ------------------
  |  Branch (950:17): [True: 700k, False: 10.9M]
  ------------------
  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|   700k|                if (cur[1] == '\n')
  ------------------
  |  Branch (956:21): [True: 17.9k, False: 682k]
  ------------------
  957|  17.9k|                    ctxt->input->cur++;
  958|   700k|                *len = 1;
  959|   700k|                c = '\n';
  960|  10.9M|            } else if (c == 0) {
  ------------------
  |  Branch (960:24): [True: 6.67M, False: 4.31M]
  ------------------
  961|  6.67M|                if (ctxt->input->cur >= ctxt->input->end) {
  ------------------
  |  Branch (961:21): [True: 28.0k, False: 6.64M]
  ------------------
  962|  28.0k|                    *len = 0;
  963|  6.64M|                } else {
  964|  6.64M|                    *len = 1;
  965|       |                    /*
  966|       |                     * TODO: Null bytes should be handled by callers,
  967|       |                     * but this can be tricky.
  968|       |                     */
  969|  6.64M|                    xmlFatalErr(ctxt, XML_ERR_INVALID_CHAR,
  970|  6.64M|                            "Char 0x0 out of allowed range\n");
  971|  6.64M|                }
  972|  6.67M|            } else {
  973|  4.31M|                *len = 1;
  974|  4.31M|            }
  975|  15.9M|        } else {
  976|  15.9M|            *len = 1;
  977|  15.9M|        }
  978|       |
  979|  27.6M|        return(c);
  980|  27.6M|    } else {
  981|  24.6M|        int val;
  982|       |
  983|  24.6M|        if (avail < 2)
  ------------------
  |  Branch (983:13): [True: 1.14k, False: 24.6M]
  ------------------
  984|  1.14k|            goto incomplete_sequence;
  985|  24.6M|        if ((cur[1] & 0xc0) != 0x80)
  ------------------
  |  Branch (985:13): [True: 7.60M, False: 17.0M]
  ------------------
  986|  7.60M|            goto encoding_error;
  987|       |
  988|  17.0M|        if (c < 0xe0) {
  ------------------
  |  Branch (988:13): [True: 10.6M, False: 6.41M]
  ------------------
  989|       |            /* 2-byte code */
  990|  10.6M|            if (c < 0xc2)
  ------------------
  |  Branch (990:17): [True: 500k, False: 10.1M]
  ------------------
  991|   500k|                goto encoding_error;
  992|  10.1M|            val = (c & 0x1f) << 6;
  993|  10.1M|            val |= cur[1] & 0x3f;
  994|  10.1M|            *len = 2;
  995|  10.1M|        } else {
  996|  6.41M|            if (avail < 3)
  ------------------
  |  Branch (996:17): [True: 140, False: 6.41M]
  ------------------
  997|    140|                goto incomplete_sequence;
  998|  6.41M|            if ((cur[2] & 0xc0) != 0x80)
  ------------------
  |  Branch (998:17): [True: 7.81k, False: 6.40M]
  ------------------
  999|  7.81k|                goto encoding_error;
 1000|       |
 1001|  6.40M|            if (c < 0xf0) {
  ------------------
  |  Branch (1001:17): [True: 6.38M, False: 23.2k]
  ------------------
 1002|       |                /* 3-byte code */
 1003|  6.38M|                val = (c & 0xf) << 12;
 1004|  6.38M|                val |= (cur[1] & 0x3f) << 6;
 1005|  6.38M|                val |= cur[2] & 0x3f;
 1006|  6.38M|                if ((val < 0x800) || ((val >= 0xd800) && (val < 0xe000)))
  ------------------
  |  Branch (1006:21): [True: 270, False: 6.38M]
  |  Branch (1006:39): [True: 2.15M, False: 4.22M]
  |  Branch (1006:58): [True: 99, False: 2.15M]
  ------------------
 1007|    369|                    goto encoding_error;
 1008|  6.38M|                *len = 3;
 1009|  6.38M|            } else {
 1010|  23.2k|                if (avail < 4)
  ------------------
  |  Branch (1010:21): [True: 432, False: 22.8k]
  ------------------
 1011|    432|                    goto incomplete_sequence;
 1012|  22.8k|                if ((cur[3] & 0xc0) != 0x80)
  ------------------
  |  Branch (1012:21): [True: 2.82k, False: 20.0k]
  ------------------
 1013|  2.82k|                    goto encoding_error;
 1014|       |
 1015|       |                /* 4-byte code */
 1016|  20.0k|                val = (c & 0x0f) << 18;
 1017|  20.0k|                val |= (cur[1] & 0x3f) << 12;
 1018|  20.0k|                val |= (cur[2] & 0x3f) << 6;
 1019|  20.0k|                val |= cur[3] & 0x3f;
 1020|  20.0k|                if ((val < 0x10000) || (val >= 0x110000))
  ------------------
  |  Branch (1020:21): [True: 227, False: 19.7k]
  |  Branch (1020:40): [True: 5.30k, False: 14.4k]
  ------------------
 1021|  5.53k|                    goto encoding_error;
 1022|  14.4k|                *len = 4;
 1023|  14.4k|            }
 1024|  6.40M|        }
 1025|       |
 1026|  16.5M|        return(val);
 1027|  17.0M|    }
 1028|       |
 1029|  8.12M|encoding_error:
 1030|       |    /* Only report the first error */
 1031|  8.12M|    if ((ctxt->input->flags & XML_INPUT_ENCODING_ERROR) == 0) {
  ------------------
  |  |   40|  8.12M|#define XML_INPUT_ENCODING_ERROR    (1u << 5)
  ------------------
  |  Branch (1031:9): [True: 11.7k, False: 8.11M]
  ------------------
 1032|  11.7k|        xmlCtxtErrIO(ctxt, XML_ERR_INVALID_ENCODING, NULL);
 1033|  11.7k|        ctxt->input->flags |= XML_INPUT_ENCODING_ERROR;
  ------------------
  |  |   40|  11.7k|#define XML_INPUT_ENCODING_ERROR    (1u << 5)
  ------------------
 1034|  11.7k|    }
 1035|  8.12M|    *len = 1;
 1036|  8.12M|    return(XML_INVALID_CHAR);
  ------------------
  |  |    9|  8.12M|#define XML_INVALID_CHAR 0x200000
  ------------------
 1037|       |
 1038|  1.71k|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.71k|    *len = 0;
 1046|  1.71k|    return(0);
 1047|  52.2M|}
xmlCopyCharMultiByte:
 1086|  18.5M|xmlCopyCharMultiByte(xmlChar *out, int val) {
 1087|  18.5M|    if ((out == NULL) || (val < 0)) return(0);
  ------------------
  |  Branch (1087:9): [True: 0, False: 18.5M]
  |  Branch (1087:26): [True: 0, False: 18.5M]
  ------------------
 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|  18.5M|    if  (val >= 0x80) {
  ------------------
  |  Branch (1097:10): [True: 18.5M, False: 7.58k]
  ------------------
 1098|  18.5M|	xmlChar *savedout = out;
 1099|  18.5M|	int bits;
 1100|  18.5M|	if (val <   0x800) { *out++= (val >>  6) | 0xC0;  bits=  0; }
  ------------------
  |  Branch (1100:6): [True: 5.94M, False: 12.5M]
  ------------------
 1101|  12.5M|	else if (val < 0x10000) { *out++= (val >> 12) | 0xE0;  bits=  6;}
  ------------------
  |  Branch (1101:11): [True: 12.5M, False: 11.5k]
  ------------------
 1102|  11.5k|	else if (val < 0x110000)  { *out++= (val >> 18) | 0xF0;  bits=  12; }
  ------------------
  |  Branch (1102:11): [True: 11.5k, 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|  49.6M|	for ( ; bits >= 0; bits-= 6)
  ------------------
  |  Branch (1109:10): [True: 31.1M, False: 18.5M]
  ------------------
 1110|  31.1M|	    *out++= ((val >> bits) & 0x3F) | 0x80 ;
 1111|  18.5M|	return (out - savedout);
 1112|  18.5M|    }
 1113|  7.58k|    *out = val;
 1114|  7.58k|    return 1;
 1115|  18.5M|}
xmlSwitchEncoding:
 1263|  5.68k|{
 1264|  5.68k|    xmlCharEncodingHandlerPtr handler = NULL;
 1265|  5.68k|    int ret;
 1266|  5.68k|    xmlParserErrors code;
 1267|       |
 1268|  5.68k|    if ((ctxt == NULL) || (ctxt->input == NULL))
  ------------------
  |  Branch (1268:9): [True: 0, False: 5.68k]
  |  Branch (1268:27): [True: 0, False: 5.68k]
  ------------------
 1269|      0|        return(-1);
 1270|       |
 1271|  5.68k|    code = xmlLookupCharEncodingHandler(enc, &handler);
 1272|  5.68k|    if (code != 0) {
  ------------------
  |  Branch (1272:9): [True: 3, False: 5.67k]
  ------------------
 1273|      3|        xmlFatalErr(ctxt, code, NULL);
 1274|      3|        return(-1);
 1275|      3|    }
 1276|       |
 1277|  5.67k|    ret = xmlSwitchToEncoding(ctxt, handler);
 1278|       |
 1279|  5.67k|    if ((ret >= 0) && (enc == XML_CHAR_ENCODING_NONE)) {
  ------------------
  |  Branch (1279:9): [True: 4.23k, False: 1.44k]
  |  Branch (1279:23): [True: 0, False: 4.23k]
  ------------------
 1280|      0|        ctxt->input->flags &= ~XML_INPUT_HAS_ENCODING;
  ------------------
  |  |   33|      0|#define XML_INPUT_HAS_ENCODING      (1u << 0)
  ------------------
 1281|      0|    }
 1282|       |
 1283|  5.67k|    return(ret);
 1284|  5.68k|}
xmlInputSetEncodingHandler:
 1353|  11.9k|                           xmlCharEncodingHandler *handler) {
 1354|  11.9k|    xmlParserInputBufferPtr in;
 1355|  11.9k|    xmlBufPtr buf;
 1356|  11.9k|    xmlParserErrors code = XML_ERR_OK;
 1357|       |
 1358|  11.9k|    if ((input == NULL) || (input->buf == NULL)) {
  ------------------
  |  Branch (1358:9): [True: 0, False: 11.9k]
  |  Branch (1358:28): [True: 0, False: 11.9k]
  ------------------
 1359|      0|        xmlCharEncCloseFunc(handler);
 1360|      0|	return(XML_ERR_ARGUMENT);
 1361|      0|    }
 1362|  11.9k|    in = input->buf;
 1363|       |
 1364|  11.9k|    input->flags |= XML_INPUT_HAS_ENCODING;
  ------------------
  |  |   33|  11.9k|#define XML_INPUT_HAS_ENCODING      (1u << 0)
  ------------------
 1365|       |
 1366|       |    /*
 1367|       |     * UTF-8 requires no encoding handler.
 1368|       |     */
 1369|  11.9k|    if ((handler != NULL) &&
  ------------------
  |  Branch (1369:9): [True: 11.6k, False: 231]
  ------------------
 1370|  11.6k|        (xmlStrcasecmp(BAD_CAST handler->name, BAD_CAST "UTF-8") == 0)) {
  ------------------
  |  |   34|  11.6k|#define BAD_CAST (xmlChar *)
  ------------------
                      (xmlStrcasecmp(BAD_CAST handler->name, BAD_CAST "UTF-8") == 0)) {
  ------------------
  |  |   34|  11.6k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (1370:9): [True: 0, False: 11.6k]
  ------------------
 1371|      0|        xmlCharEncCloseFunc(handler);
 1372|      0|        handler = NULL;
 1373|      0|    }
 1374|       |
 1375|  11.9k|    if (in->encoder == handler)
  ------------------
  |  Branch (1375:9): [True: 231, False: 11.6k]
  ------------------
 1376|    231|        return(XML_ERR_OK);
 1377|       |
 1378|  11.6k|    if (in->encoder != NULL) {
  ------------------
  |  Branch (1378:9): [True: 0, False: 11.6k]
  ------------------
 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|  11.6k|    buf = xmlBufCreate(XML_IO_BUFFER_SIZE);
  ------------------
  |  |   20|  11.6k|#define XML_IO_BUFFER_SIZE 6000
  ------------------
 1394|  11.6k|    if (buf == NULL) {
  ------------------
  |  Branch (1394:9): [True: 26, False: 11.6k]
  ------------------
 1395|     26|        xmlCharEncCloseFunc(handler);
 1396|     26|        return(XML_ERR_NO_MEMORY);
 1397|     26|    }
 1398|       |
 1399|  11.6k|    in->encoder = handler;
 1400|  11.6k|    in->raw = in->buffer;
 1401|  11.6k|    in->buffer = buf;
 1402|       |
 1403|       |    /*
 1404|       |     * Is there already some content down the pipe to convert ?
 1405|       |     */
 1406|  11.6k|    if (input->end > input->base) {
  ------------------
  |  Branch (1406:9): [True: 11.6k, False: 0]
  ------------------
 1407|  11.6k|        size_t processed;
 1408|  11.6k|        size_t nbchars;
 1409|  11.6k|        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|  11.6k|        processed = input->cur - input->base;
 1416|  11.6k|        xmlBufShrink(in->raw, processed);
 1417|  11.6k|        input->consumed += processed;
 1418|  11.6k|        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|  11.6k|        if (input->flags & XML_INPUT_PROGRESSIVE)
  ------------------
  |  |   41|  11.6k|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  ------------------
  |  Branch (1426:13): [True: 1.17k, False: 10.4k]
  ------------------
 1427|  1.17k|            nbchars = SIZE_MAX;
 1428|  10.4k|        else
 1429|  10.4k|            nbchars = 4000 /* MINLEN */;
 1430|  11.6k|        res = xmlCharEncInput(in, &nbchars, /* flush */ 0);
 1431|  11.6k|        if (res != XML_ENC_ERR_SUCCESS)
  ------------------
  |  Branch (1431:13): [True: 2.12k, False: 9.53k]
  ------------------
 1432|  2.12k|            code = in->error;
 1433|  11.6k|    }
 1434|       |
 1435|  11.6k|    xmlBufResetInput(in->buffer, input);
 1436|       |
 1437|  11.6k|    return(code);
 1438|  11.6k|}
xmlSwitchToEncoding:
 1475|  8.61k|{
 1476|  8.61k|    xmlParserErrors code;
 1477|       |
 1478|  8.61k|    if (ctxt == NULL)
  ------------------
  |  Branch (1478:9): [True: 0, False: 8.61k]
  ------------------
 1479|      0|        return(-1);
 1480|       |
 1481|  8.61k|    code = xmlInputSetEncodingHandler(ctxt->input, handler);
 1482|  8.61k|    if (code != XML_ERR_OK) {
  ------------------
  |  Branch (1482:9): [True: 1.52k, False: 7.09k]
  ------------------
 1483|  1.52k|        xmlCtxtErrIO(ctxt, code, NULL);
 1484|  1.52k|        return(-1);
 1485|  1.52k|    }
 1486|       |
 1487|  7.09k|    return(0);
 1488|  8.61k|}
xmlDetectEncoding:
 1498|   261k|xmlDetectEncoding(xmlParserCtxt *ctxt) {
 1499|   261k|    const xmlChar *in;
 1500|   261k|    xmlCharEncoding enc;
 1501|   261k|    int bomSize;
 1502|   261k|    int autoFlag = 0;
 1503|       |
 1504|   261k|    if (xmlParserGrow(ctxt) < 0)
  ------------------
  |  Branch (1504:9): [True: 0, False: 261k]
  ------------------
 1505|      0|        return;
 1506|   261k|    in = ctxt->input->cur;
 1507|   261k|    if (ctxt->input->end - in < 4)
  ------------------
  |  Branch (1507:9): [True: 1.06k, False: 260k]
  ------------------
 1508|  1.06k|        return;
 1509|       |
 1510|   260k|    if (ctxt->input->flags & XML_INPUT_HAS_ENCODING) {
  ------------------
  |  |   33|   260k|#define XML_INPUT_HAS_ENCODING      (1u << 0)
  ------------------
  |  Branch (1510:9): [True: 0, False: 260k]
  ------------------
 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|   260k|    enc = XML_CHAR_ENCODING_NONE;
 1523|   260k|    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|   260k|    switch (in[0]) {
  ------------------
  |  Branch (1531:13): [True: 242k, False: 18.4k]
  ------------------
 1532|  1.08k|        case 0x00:
  ------------------
  |  Branch (1532:9): [True: 1.08k, False: 259k]
  ------------------
 1533|  1.08k|            if ((!ctxt->html) &&
  ------------------
  |  Branch (1533:17): [True: 1.08k, False: 0]
  ------------------
 1534|  1.08k|                (in[1] == 0x00) && (in[2] == 0x00) && (in[3] == 0x3C)) {
  ------------------
  |  Branch (1534:17): [True: 518, False: 571]
  |  Branch (1534:36): [True: 168, False: 350]
  |  Branch (1534:55): [True: 78, False: 90]
  ------------------
 1535|     78|                enc = XML_CHAR_ENCODING_UCS4BE;
 1536|     78|                autoFlag = XML_INPUT_AUTO_OTHER;
  ------------------
  |  |   38|     78|#define XML_INPUT_AUTO_OTHER        (4u << 1)
  ------------------
 1537|  1.01k|            } else if ((in[1] == 0x3C) && (in[2] == 0x00) && (in[3] == 0x3F)) {
  ------------------
  |  Branch (1537:24): [True: 488, False: 523]
  |  Branch (1537:43): [True: 383, False: 105]
  |  Branch (1537:62): [True: 301, False: 82]
  ------------------
 1538|       |                /*
 1539|       |                 * TODO: The HTML5 spec requires to check that the
 1540|       |                 * next codepoint is an 'x'.
 1541|       |                 */
 1542|    301|                enc = XML_CHAR_ENCODING_UTF16BE;
 1543|    301|                autoFlag = XML_INPUT_AUTO_UTF16BE;
  ------------------
  |  |   37|    301|#define XML_INPUT_AUTO_UTF16BE      (3u << 1)
  ------------------
 1544|    301|            }
 1545|  1.08k|            break;
 1546|       |
 1547|   235k|        case 0x3C:
  ------------------
  |  Branch (1547:9): [True: 235k, False: 25.5k]
  ------------------
 1548|   235k|            if (in[1] == 0x00) {
  ------------------
  |  Branch (1548:17): [True: 4.06k, False: 231k]
  ------------------
 1549|  4.06k|                if ((!ctxt->html) &&
  ------------------
  |  Branch (1549:21): [True: 4.06k, False: 0]
  ------------------
 1550|  4.06k|                    (in[2] == 0x00) && (in[3] == 0x00)) {
  ------------------
  |  Branch (1550:21): [True: 1.03k, False: 3.03k]
  |  Branch (1550:40): [True: 816, False: 215]
  ------------------
 1551|    816|                    enc = XML_CHAR_ENCODING_UCS4LE;
 1552|    816|                    autoFlag = XML_INPUT_AUTO_OTHER;
  ------------------
  |  |   38|    816|#define XML_INPUT_AUTO_OTHER        (4u << 1)
  ------------------
 1553|  3.24k|                } else if ((in[2] == 0x3F) && (in[3] == 0x00)) {
  ------------------
  |  Branch (1553:28): [True: 2.80k, False: 436]
  |  Branch (1553:47): [True: 2.56k, False: 244]
  ------------------
 1554|       |                    /*
 1555|       |                     * TODO: The HTML5 spec requires to check that the
 1556|       |                     * next codepoint is an 'x'.
 1557|       |                     */
 1558|  2.56k|                    enc = XML_CHAR_ENCODING_UTF16LE;
 1559|  2.56k|                    autoFlag = XML_INPUT_AUTO_UTF16LE;
  ------------------
  |  |   36|  2.56k|#define XML_INPUT_AUTO_UTF16LE      (2u << 1)
  ------------------
 1560|  2.56k|                }
 1561|  4.06k|            }
 1562|   235k|            break;
 1563|       |
 1564|  3.60k|        case 0x4C:
  ------------------
  |  Branch (1564:9): [True: 3.60k, False: 257k]
  ------------------
 1565|  3.60k|	    if ((!ctxt->html) &&
  ------------------
  |  Branch (1565:10): [True: 3.60k, False: 0]
  ------------------
 1566|  3.60k|                (in[1] == 0x6F) && (in[2] == 0xA7) && (in[3] == 0x94)) {
  ------------------
  |  Branch (1566:17): [True: 3.35k, False: 248]
  |  Branch (1566:36): [True: 3.19k, False: 164]
  |  Branch (1566:55): [True: 3.06k, False: 133]
  ------------------
 1567|  3.06k|	        enc = XML_CHAR_ENCODING_EBCDIC;
 1568|  3.06k|                autoFlag = XML_INPUT_AUTO_OTHER;
  ------------------
  |  |   38|  3.06k|#define XML_INPUT_AUTO_OTHER        (4u << 1)
  ------------------
 1569|  3.06k|            }
 1570|  3.60k|            break;
 1571|       |
 1572|    169|        case 0xEF:
  ------------------
  |  Branch (1572:9): [True: 169, False: 260k]
  ------------------
 1573|    169|            if ((in[1] == 0xBB) && (in[2] == 0xBF)) {
  ------------------
  |  Branch (1573:17): [True: 81, False: 88]
  |  Branch (1573:36): [True: 47, False: 34]
  ------------------
 1574|     47|                enc = XML_CHAR_ENCODING_UTF8;
 1575|     47|                autoFlag = XML_INPUT_AUTO_UTF8;
  ------------------
  |  |   35|     47|#define XML_INPUT_AUTO_UTF8         (1u << 1)
  ------------------
 1576|     47|                bomSize = 3;
 1577|     47|            }
 1578|    169|            break;
 1579|       |
 1580|  1.78k|        case 0xFE:
  ------------------
  |  Branch (1580:9): [True: 1.78k, False: 258k]
  ------------------
 1581|  1.78k|            if (in[1] == 0xFF) {
  ------------------
  |  Branch (1581:17): [True: 1.60k, False: 180]
  ------------------
 1582|  1.60k|                enc = XML_CHAR_ENCODING_UTF16BE;
 1583|  1.60k|                autoFlag = XML_INPUT_AUTO_UTF16BE;
  ------------------
  |  |   37|  1.60k|#define XML_INPUT_AUTO_UTF16BE      (3u << 1)
  ------------------
 1584|  1.60k|                bomSize = 2;
 1585|  1.60k|            }
 1586|  1.78k|            break;
 1587|       |
 1588|    466|        case 0xFF:
  ------------------
  |  Branch (1588:9): [True: 466, False: 260k]
  ------------------
 1589|    466|            if (in[1] == 0xFE) {
  ------------------
  |  Branch (1589:17): [True: 265, False: 201]
  ------------------
 1590|    265|                enc = XML_CHAR_ENCODING_UTF16LE;
 1591|    265|                autoFlag = XML_INPUT_AUTO_UTF16LE;
  ------------------
  |  |   36|    265|#define XML_INPUT_AUTO_UTF16LE      (2u << 1)
  ------------------
 1592|    265|                bomSize = 2;
 1593|    265|            }
 1594|    466|            break;
 1595|   260k|    }
 1596|       |
 1597|   260k|    if (bomSize > 0) {
  ------------------
  |  Branch (1597:9): [True: 1.92k, False: 258k]
  ------------------
 1598|  1.92k|        ctxt->input->cur += bomSize;
 1599|  1.92k|    }
 1600|       |
 1601|   260k|    if (enc != XML_CHAR_ENCODING_NONE) {
  ------------------
  |  Branch (1601:9): [True: 8.74k, False: 251k]
  ------------------
 1602|  8.74k|        ctxt->input->flags |= autoFlag;
 1603|       |
 1604|  8.74k|        if (enc == XML_CHAR_ENCODING_EBCDIC) {
  ------------------
  |  Branch (1604:13): [True: 3.06k, False: 5.68k]
  ------------------
 1605|  3.06k|            xmlCharEncodingHandlerPtr handler;
 1606|  3.06k|            xmlParserErrors res;
 1607|       |
 1608|  3.06k|            res = xmlDetectEBCDIC(ctxt, &handler);
 1609|  3.06k|            if (res != XML_ERR_OK) {
  ------------------
  |  Branch (1609:17): [True: 120, False: 2.94k]
  ------------------
 1610|    120|                xmlFatalErr(ctxt, res, "detecting EBCDIC\n");
 1611|  2.94k|            } else {
 1612|  2.94k|                xmlSwitchToEncoding(ctxt, handler);
 1613|  2.94k|            }
 1614|  5.68k|        } else {
 1615|  5.68k|            xmlSwitchEncoding(ctxt, enc);
 1616|  5.68k|        }
 1617|  8.74k|    }
 1618|   260k|}
xmlSetDeclaredEncoding:
 1632|  4.88k|xmlSetDeclaredEncoding(xmlParserCtxt *ctxt, xmlChar *encoding) {
 1633|  4.88k|    if (((ctxt->input->flags & XML_INPUT_HAS_ENCODING) == 0) &&
  ------------------
  |  |   33|  4.88k|#define XML_INPUT_HAS_ENCODING      (1u << 0)
  ------------------
  |  Branch (1633:9): [True: 4.87k, False: 6]
  ------------------
 1634|  4.87k|        ((ctxt->options & XML_PARSE_IGNORE_ENC) == 0)) {
  ------------------
  |  Branch (1634:9): [True: 3.80k, False: 1.06k]
  ------------------
 1635|  3.80k|        xmlCharEncodingHandlerPtr handler;
 1636|  3.80k|        xmlParserErrors res;
 1637|  3.80k|        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|  3.80k|        if (ctxt->html)
  ------------------
  |  Branch (1644:13): [True: 0, False: 3.80k]
  ------------------
 1645|      0|            flags |= XML_ENC_HTML;
 1646|  3.80k|        res = xmlCreateCharEncodingHandler((const char *) encoding,
 1647|  3.80k|                flags, ctxt->convImpl, ctxt->convCtxt, &handler);
 1648|  3.80k|        if (res != XML_ERR_OK) {
  ------------------
  |  Branch (1648:13): [True: 516, False: 3.29k]
  ------------------
 1649|    516|            xmlFatalErr(ctxt, res, (const char *) encoding);
 1650|    516|            xmlFree(encoding);
 1651|    516|            return;
 1652|    516|        }
 1653|       |
 1654|  3.29k|        res  = xmlInputSetEncodingHandler(ctxt->input, handler);
 1655|  3.29k|        if (res != XML_ERR_OK) {
  ------------------
  |  Branch (1655:13): [True: 621, False: 2.67k]
  ------------------
 1656|    621|            xmlCtxtErrIO(ctxt, res, NULL);
 1657|    621|            xmlFree(encoding);
 1658|    621|            return;
 1659|    621|        }
 1660|       |
 1661|  2.67k|        ctxt->input->flags |= XML_INPUT_USES_ENC_DECL;
  ------------------
  |  |   39|  2.67k|#define XML_INPUT_USES_ENC_DECL     (1u << 4)
  ------------------
 1662|  2.67k|    } else if (ctxt->input->flags & XML_INPUT_AUTO_ENCODING) {
  ------------------
  |  |   34|  1.07k|#define XML_INPUT_AUTO_ENCODING     (7u << 1)
  ------------------
  |  Branch (1662:16): [True: 6, False: 1.06k]
  ------------------
 1663|      6|        static const char *allowedUTF8[] = {
 1664|      6|            "UTF-8", "UTF8", NULL
 1665|      6|        };
 1666|      6|        static const char *allowedUTF16LE[] = {
 1667|      6|            "UTF-16", "UTF-16LE", "UTF16", NULL
 1668|      6|        };
 1669|      6|        static const char *allowedUTF16BE[] = {
 1670|      6|            "UTF-16", "UTF-16BE", "UTF16", NULL
 1671|      6|        };
 1672|      6|        const char **allowed = NULL;
 1673|      6|        const char *autoEnc = NULL;
 1674|       |
 1675|      6|        switch (ctxt->input->flags & XML_INPUT_AUTO_ENCODING) {
  ------------------
  |  |   34|      6|#define XML_INPUT_AUTO_ENCODING     (7u << 1)
  ------------------
  |  Branch (1675:17): [True: 5, False: 1]
  ------------------
 1676|      5|            case XML_INPUT_AUTO_UTF8:
  ------------------
  |  |   35|      5|#define XML_INPUT_AUTO_UTF8         (1u << 1)
  ------------------
  |  Branch (1676:13): [True: 5, False: 1]
  ------------------
 1677|      5|                allowed = allowedUTF8;
 1678|      5|                autoEnc = "UTF-8";
 1679|      5|                break;
 1680|      0|            case XML_INPUT_AUTO_UTF16LE:
  ------------------
  |  |   36|      0|#define XML_INPUT_AUTO_UTF16LE      (2u << 1)
  ------------------
  |  Branch (1680:13): [True: 0, False: 6]
  ------------------
 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: 6]
  ------------------
 1685|      0|                allowed = allowedUTF16BE;
 1686|      0|                autoEnc = "UTF-16BE";
 1687|      0|                break;
 1688|      6|        }
 1689|       |
 1690|      6|        if (allowed != NULL) {
  ------------------
  |  Branch (1690:13): [True: 5, False: 1]
  ------------------
 1691|      5|            const char **p;
 1692|      5|            int match = 0;
 1693|       |
 1694|     14|            for (p = allowed; *p != NULL; p++) {
  ------------------
  |  Branch (1694:31): [True: 10, False: 4]
  ------------------
 1695|     10|                if (xmlStrcasecmp(encoding, BAD_CAST *p) == 0) {
  ------------------
  |  |   34|     10|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (1695:21): [True: 1, False: 9]
  ------------------
 1696|      1|                    match = 1;
 1697|      1|                    break;
 1698|      1|                }
 1699|     10|            }
 1700|       |
 1701|      5|            if (match == 0) {
  ------------------
  |  Branch (1701:17): [True: 4, False: 1]
  ------------------
 1702|      4|                xmlWarningMsg(ctxt, XML_WAR_ENCODING_MISMATCH,
 1703|      4|                              "Encoding '%s' doesn't match "
 1704|      4|                              "auto-detected '%s'\n",
 1705|      4|                              encoding, BAD_CAST autoEnc);
  ------------------
  |  |   34|      4|#define BAD_CAST (xmlChar *)
  ------------------
 1706|      4|                xmlFree(encoding);
 1707|      4|                encoding = xmlStrdup(BAD_CAST autoEnc);
  ------------------
  |  |   34|      4|#define BAD_CAST (xmlChar *)
  ------------------
 1708|      4|                if (encoding == NULL)
  ------------------
  |  Branch (1708:21): [True: 2, False: 2]
  ------------------
 1709|      2|                    xmlCtxtErrMemory(ctxt);
 1710|      4|            }
 1711|      5|        }
 1712|      6|    }
 1713|       |
 1714|  3.74k|    if (ctxt->encoding != NULL)
  ------------------
  |  Branch (1714:9): [True: 1.37k, False: 2.36k]
  ------------------
 1715|  1.37k|        xmlFree(ctxt->encoding);
 1716|  3.74k|    ctxt->encoding = encoding;
 1717|  3.74k|}
xmlGetActualEncoding:
 1740|  24.2k|xmlGetActualEncoding(xmlParserCtxt *ctxt) {
 1741|  24.2k|    const xmlChar *encoding = NULL;
 1742|       |
 1743|  24.2k|    if ((ctxt->input->flags & XML_INPUT_USES_ENC_DECL) ||
  ------------------
  |  |   39|  24.2k|#define XML_INPUT_USES_ENC_DECL     (1u << 4)
  ------------------
  |  Branch (1743:9): [True: 798, False: 23.4k]
  ------------------
 1744|  23.4k|        (ctxt->input->flags & XML_INPUT_AUTO_ENCODING)) {
  ------------------
  |  |   34|  23.4k|#define XML_INPUT_AUTO_ENCODING     (7u << 1)
  ------------------
  |  Branch (1744:9): [True: 490, False: 22.9k]
  ------------------
 1745|       |        /* Preserve encoding exactly */
 1746|  1.28k|        encoding = ctxt->encoding;
 1747|  22.9k|    } else if ((ctxt->input->buf) && (ctxt->input->buf->encoder)) {
  ------------------
  |  Branch (1747:16): [True: 22.9k, False: 0]
  |  Branch (1747:38): [True: 180, False: 22.7k]
  ------------------
 1748|    180|        encoding = BAD_CAST ctxt->input->buf->encoder->name;
  ------------------
  |  |   34|    180|#define BAD_CAST (xmlChar *)
  ------------------
 1749|  22.7k|    } else if (ctxt->input->flags & XML_INPUT_HAS_ENCODING) {
  ------------------
  |  |   33|  22.7k|#define XML_INPUT_HAS_ENCODING      (1u << 0)
  ------------------
  |  Branch (1749:16): [True: 235, False: 22.5k]
  ------------------
 1750|    235|        encoding = BAD_CAST "UTF-8";
  ------------------
  |  |   34|    235|#define BAD_CAST (xmlChar *)
  ------------------
 1751|    235|    }
 1752|       |
 1753|  24.2k|    return(encoding);
 1754|  24.2k|}
xmlFreeInputStream:
 1768|   274k|xmlFreeInputStream(xmlParserInput *input) {
 1769|   274k|    if (input == NULL) return;
  ------------------
  |  Branch (1769:9): [True: 1.96k, False: 272k]
  ------------------
 1770|       |
 1771|   272k|    if (input->filename != NULL) xmlFree((char *) input->filename);
  ------------------
  |  Branch (1771:9): [True: 230k, False: 41.6k]
  ------------------
 1772|   272k|    if (input->version != NULL) xmlFree((char *) input->version);
  ------------------
  |  Branch (1772:9): [True: 165k, False: 107k]
  ------------------
 1773|   272k|    if ((input->free != NULL) && (input->base != NULL))
  ------------------
  |  Branch (1773:9): [True: 0, False: 272k]
  |  Branch (1773:34): [True: 0, False: 0]
  ------------------
 1774|      0|        input->free((xmlChar *) input->base);
 1775|   272k|    if (input->buf != NULL)
  ------------------
  |  Branch (1775:9): [True: 272k, False: 0]
  ------------------
 1776|   272k|        xmlFreeParserInputBuffer(input->buf);
 1777|   272k|    xmlFree(input);
 1778|   272k|}
xmlNewInputFromMemory:
 1892|   230k|                      xmlParserInputFlags flags) {
 1893|   230k|    xmlParserInputBufferPtr buf;
 1894|       |
 1895|   230k|    if (mem == NULL)
  ------------------
  |  Branch (1895:9): [True: 0, False: 230k]
  ------------------
 1896|      0|	return(NULL);
 1897|       |
 1898|   230k|    buf = xmlNewInputBufferMemory(mem, size, flags, XML_CHAR_ENCODING_NONE);
 1899|   230k|    if (buf == NULL)
  ------------------
  |  Branch (1899:9): [True: 32, False: 230k]
  ------------------
 1900|     32|        return(NULL);
 1901|       |
 1902|   230k|    return(xmlNewInputInternal(buf, url));
 1903|   230k|}
xmlNewInputFromString:
 1954|  10.0k|                      xmlParserInputFlags flags) {
 1955|  10.0k|    xmlParserInputBufferPtr buf;
 1956|       |
 1957|  10.0k|    if (str == NULL)
  ------------------
  |  Branch (1957:9): [True: 0, False: 10.0k]
  ------------------
 1958|      0|	return(NULL);
 1959|       |
 1960|  10.0k|    buf = xmlNewInputBufferString(str, flags);
 1961|  10.0k|    if (buf == NULL)
  ------------------
  |  Branch (1961:9): [True: 8, False: 10.0k]
  ------------------
 1962|      8|        return(NULL);
 1963|       |
 1964|  10.0k|    return(xmlNewInputInternal(buf, url));
 1965|  10.0k|}
xmlCtxtNewInputFromString:
 1978|  10.0k|                          xmlParserInputFlags flags) {
 1979|  10.0k|    xmlParserInputPtr input;
 1980|       |
 1981|  10.0k|    if ((ctxt == NULL) || (str == NULL))
  ------------------
  |  Branch (1981:9): [True: 0, False: 10.0k]
  |  Branch (1981:27): [True: 0, False: 10.0k]
  ------------------
 1982|      0|	return(NULL);
 1983|       |
 1984|  10.0k|    input = xmlNewInputFromString(url, str, flags);
 1985|  10.0k|    if (input == NULL) {
  ------------------
  |  Branch (1985:9): [True: 9, False: 10.0k]
  ------------------
 1986|      9|        xmlCtxtErrMemory(ctxt);
 1987|      9|        return(NULL);
 1988|      9|    }
 1989|       |
 1990|  10.0k|    if (encoding != NULL)
  ------------------
  |  Branch (1990:9): [True: 0, False: 10.0k]
  ------------------
 1991|      0|        xmlSwitchInputEncodingName(ctxt, input, encoding);
 1992|       |
 1993|  10.0k|    return(input);
 1994|  10.0k|}
xmlNewPushInput:
 2155|  31.6k|xmlNewPushInput(const char *url, const char *chunk, int size) {
 2156|  31.6k|    xmlParserInputBufferPtr buf;
 2157|  31.6k|    xmlParserInputPtr input;
 2158|       |
 2159|  31.6k|    buf = xmlAllocParserInputBuffer(XML_CHAR_ENCODING_NONE);
 2160|  31.6k|    if (buf == NULL)
  ------------------
  |  Branch (2160:9): [True: 7, False: 31.5k]
  ------------------
 2161|      7|        return(NULL);
 2162|       |
 2163|  31.5k|    input = xmlNewInputInternal(buf, url);
 2164|  31.5k|    if (input == NULL)
  ------------------
  |  Branch (2164:9): [True: 2, False: 31.5k]
  ------------------
 2165|      2|	return(NULL);
 2166|       |
 2167|  31.5k|    input->flags |= XML_INPUT_PROGRESSIVE;
  ------------------
  |  |   41|  31.5k|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  ------------------
 2168|       |
 2169|  31.5k|    if ((size > 0) && (chunk != NULL)) {
  ------------------
  |  Branch (2169:9): [True: 30.7k, False: 805]
  |  Branch (2169:23): [True: 30.7k, False: 0]
  ------------------
 2170|  30.7k|        int res;
 2171|       |
 2172|  30.7k|	res = xmlParserInputBufferPush(input->buf, size, chunk);
 2173|  30.7k|        xmlBufResetInput(input->buf->buffer, input);
 2174|  30.7k|        if (res < 0) {
  ------------------
  |  Branch (2174:13): [True: 0, False: 30.7k]
  ------------------
 2175|      0|            xmlFreeInputStream(input);
 2176|      0|            return(NULL);
 2177|      0|        }
 2178|  30.7k|    }
 2179|       |
 2180|  31.5k|    return(input);
 2181|  31.5k|}
xmlNewEntityInputStream:
 2224|   103k|xmlNewEntityInputStream(xmlParserCtxt *ctxt, xmlEntity *ent) {
 2225|   103k|    xmlParserInputPtr input;
 2226|       |
 2227|   103k|    if ((ctxt == NULL) || (ent == NULL))
  ------------------
  |  Branch (2227:9): [True: 0, False: 103k]
  |  Branch (2227:27): [True: 0, False: 103k]
  ------------------
 2228|      0|	return(NULL);
 2229|       |
 2230|   103k|    if (ent->content != NULL) {
  ------------------
  |  Branch (2230:9): [True: 10.0k, False: 93.9k]
  ------------------
 2231|  10.0k|        input = xmlCtxtNewInputFromString(ctxt, NULL,
 2232|  10.0k|                (const char *) ent->content, NULL, XML_INPUT_BUF_STATIC);
 2233|  93.9k|    } else if (ent->URI != NULL) {
  ------------------
  |  Branch (2233:16): [True: 93.3k, False: 556]
  ------------------
 2234|  93.3k|        xmlResourceType rtype;
 2235|       |
 2236|  93.3k|        if (ent->etype == XML_EXTERNAL_PARAMETER_ENTITY)
  ------------------
  |  Branch (2236:13): [True: 90.3k, False: 2.99k]
  ------------------
 2237|  90.3k|            rtype = XML_RESOURCE_PARAMETER_ENTITY;
 2238|  2.99k|        else
 2239|  2.99k|            rtype = XML_RESOURCE_GENERAL_ENTITY;
 2240|       |
 2241|  93.3k|        input = xmlLoadResource(ctxt, (char *) ent->URI,
 2242|  93.3k|                                (char *) ent->ExternalID, rtype);
 2243|  93.3k|    } else {
 2244|    556|        return(NULL);
 2245|    556|    }
 2246|       |
 2247|   103k|    if (input == NULL)
  ------------------
  |  Branch (2247:9): [True: 2.98k, False: 100k]
  ------------------
 2248|  2.98k|        return(NULL);
 2249|       |
 2250|   100k|    input->entity = ent;
 2251|       |
 2252|   100k|    return(input);
 2253|   103k|}
xmlCtxtSetResourceLoader:
 2645|  39.0k|                         void *vctxt) {
 2646|  39.0k|    if (ctxt == NULL)
  ------------------
  |  Branch (2646:9): [True: 0, False: 39.0k]
  ------------------
 2647|      0|        return;
 2648|       |
 2649|  39.0k|    ctxt->resourceLoader = loader;
 2650|  39.0k|    ctxt->resourceCtxt = vctxt;
 2651|  39.0k|}
xmlLoadResource:
 2662|   235k|                xmlResourceType type) {
 2663|   235k|    char *canonicFilename;
 2664|   235k|    xmlParserInputPtr ret;
 2665|       |
 2666|   235k|    if (url == NULL)
  ------------------
  |  Branch (2666:9): [True: 212, False: 235k]
  ------------------
 2667|    212|        return(NULL);
 2668|       |
 2669|   235k|    if ((ctxt != NULL) && (ctxt->resourceLoader != NULL)) {
  ------------------
  |  Branch (2669:9): [True: 235k, False: 0]
  |  Branch (2669:27): [True: 235k, False: 0]
  ------------------
 2670|   235k|        char *resource = NULL;
 2671|   235k|        void *userData;
 2672|   235k|        xmlParserInputFlags flags = 0;
 2673|   235k|        int code;
 2674|       |
 2675|   235k|#ifdef LIBXML_CATALOG_ENABLED
 2676|   235k|        resource = xmlCtxtResolveFromCatalog(ctxt, url, publicId);
 2677|   235k|        if (resource != NULL)
  ------------------
  |  Branch (2677:13): [True: 0, False: 235k]
  ------------------
 2678|      0|            url = resource;
 2679|   235k|#endif
 2680|       |
 2681|   235k|        if (ctxt->options & XML_PARSE_UNZIP)
  ------------------
  |  Branch (2681:13): [True: 125k, False: 109k]
  ------------------
 2682|   125k|            flags |= XML_INPUT_UNZIP;
 2683|   235k|        if ((ctxt->options & XML_PARSE_NONET) == 0)
  ------------------
  |  Branch (2683:13): [True: 164k, False: 71.4k]
  ------------------
 2684|   164k|            flags |= XML_INPUT_NETWORK;
 2685|       |
 2686|   235k|        userData = ctxt->resourceCtxt;
 2687|   235k|        if (userData == NULL)
  ------------------
  |  Branch (2687:13): [True: 235k, False: 0]
  ------------------
 2688|   235k|            userData = ctxt;
 2689|       |
 2690|   235k|        code = ctxt->resourceLoader(userData, url, publicId, type,
 2691|   235k|                                    flags, &ret);
 2692|   235k|        if (code != XML_ERR_OK) {
  ------------------
  |  Branch (2692:13): [True: 4.83k, False: 230k]
  ------------------
 2693|  4.83k|            xmlCtxtErrIO(ctxt, code, url);
 2694|  4.83k|            ret = NULL;
 2695|  4.83k|        }
 2696|   235k|        if (resource != NULL)
  ------------------
  |  Branch (2696:13): [True: 0, False: 235k]
  ------------------
 2697|      0|            xmlFree(resource);
 2698|   235k|        return(ret);
 2699|   235k|    }
 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|  39.1k|{
 2948|  39.1k|    xmlParserInputPtr input;
 2949|       |
 2950|  39.1k|    if (ctxt == NULL) return;
  ------------------
  |  Branch (2950:9): [True: 32, False: 39.0k]
  ------------------
 2951|       |
 2952|  78.0k|    while ((input = xmlCtxtPopInput(ctxt)) != NULL) { /* Non consuming */
  ------------------
  |  Branch (2952:12): [True: 38.9k, False: 39.0k]
  ------------------
 2953|  38.9k|        xmlFreeInputStream(input);
 2954|  38.9k|    }
 2955|  39.0k|    if (ctxt->spaceTab != NULL) xmlFree(ctxt->spaceTab);
  ------------------
  |  Branch (2955:9): [True: 39.0k, False: 27]
  ------------------
 2956|  39.0k|    if (ctxt->nameTab != NULL) xmlFree((xmlChar * *)ctxt->nameTab);
  ------------------
  |  Branch (2956:9): [True: 39.0k, False: 21]
  ------------------
 2957|  39.0k|    if (ctxt->nodeTab != NULL) xmlFree(ctxt->nodeTab);
  ------------------
  |  Branch (2957:9): [True: 39.0k, False: 16]
  ------------------
 2958|  39.0k|    if (ctxt->nodeInfoTab != NULL) xmlFree(ctxt->nodeInfoTab);
  ------------------
  |  Branch (2958:9): [True: 0, False: 39.0k]
  ------------------
 2959|  39.0k|    if (ctxt->inputTab != NULL) xmlFree(ctxt->inputTab);
  ------------------
  |  Branch (2959:9): [True: 39.0k, False: 13]
  ------------------
 2960|  39.0k|    if (ctxt->version != NULL) xmlFree(ctxt->version);
  ------------------
  |  Branch (2960:9): [True: 37.0k, False: 2.03k]
  ------------------
 2961|  39.0k|    if (ctxt->encoding != NULL) xmlFree(ctxt->encoding);
  ------------------
  |  Branch (2961:9): [True: 944, False: 38.1k]
  ------------------
 2962|  39.0k|    if (ctxt->extSubURI != NULL) xmlFree(ctxt->extSubURI);
  ------------------
  |  Branch (2962:9): [True: 2.37k, False: 36.7k]
  ------------------
 2963|  39.0k|    if (ctxt->extSubSystem != NULL) xmlFree(ctxt->extSubSystem);
  ------------------
  |  Branch (2963:9): [True: 665, False: 38.4k]
  ------------------
 2964|  39.0k|#ifdef LIBXML_SAX1_ENABLED
 2965|  39.0k|    if ((ctxt->sax != NULL) &&
  ------------------
  |  Branch (2965:9): [True: 39.0k, False: 8]
  ------------------
 2966|  39.0k|        (ctxt->sax != (xmlSAXHandlerPtr) &xmlDefaultSAXHandler))
  ------------------
  |  Branch (2966:9): [True: 39.0k, False: 0]
  ------------------
 2967|       |#else
 2968|       |    if (ctxt->sax != NULL)
 2969|       |#endif /* LIBXML_SAX1_ENABLED */
 2970|  39.0k|        xmlFree(ctxt->sax);
 2971|  39.0k|    if (ctxt->directory != NULL) xmlFree(ctxt->directory);
  ------------------
  |  Branch (2971:9): [True: 8.25k, False: 30.8k]
  ------------------
 2972|  39.0k|    if (ctxt->vctxt.nodeTab != NULL) xmlFree(ctxt->vctxt.nodeTab);
  ------------------
  |  Branch (2972:9): [True: 0, False: 39.0k]
  ------------------
 2973|  39.0k|    if (ctxt->atts != NULL) xmlFree((xmlChar * *)ctxt->atts);
  ------------------
  |  Branch (2973:9): [True: 20.6k, False: 18.4k]
  ------------------
 2974|  39.0k|    if (ctxt->dict != NULL) xmlDictFree(ctxt->dict);
  ------------------
  |  Branch (2974:9): [True: 39.0k, False: 4]
  ------------------
 2975|  39.0k|    if (ctxt->nsTab != NULL) xmlFree(ctxt->nsTab);
  ------------------
  |  Branch (2975:9): [True: 7.64k, False: 31.4k]
  ------------------
 2976|  39.0k|    if (ctxt->nsdb != NULL) xmlParserNsFree(ctxt->nsdb);
  ------------------
  |  Branch (2976:9): [True: 39.0k, False: 30]
  ------------------
 2977|  39.0k|    if (ctxt->attrHash != NULL) xmlFree(ctxt->attrHash);
  ------------------
  |  Branch (2977:9): [True: 5.54k, False: 33.5k]
  ------------------
 2978|  39.0k|    if (ctxt->pushTab != NULL) xmlFree(ctxt->pushTab);
  ------------------
  |  Branch (2978:9): [True: 24.0k, False: 15.0k]
  ------------------
 2979|  39.0k|    if (ctxt->attallocs != NULL) xmlFree(ctxt->attallocs);
  ------------------
  |  Branch (2979:9): [True: 10.7k, False: 28.3k]
  ------------------
 2980|  39.0k|    if (ctxt->attsDefault != NULL)
  ------------------
  |  Branch (2980:9): [True: 2.24k, False: 36.8k]
  ------------------
 2981|  2.24k|        xmlHashFree(ctxt->attsDefault, xmlHashDefaultDeallocator);
 2982|  39.0k|    if (ctxt->attsSpecial != NULL)
  ------------------
  |  Branch (2982:9): [True: 2.60k, False: 36.4k]
  ------------------
 2983|  2.60k|        xmlHashFree(ctxt->attsSpecial, NULL);
 2984|  39.0k|    if (ctxt->freeElems != NULL) {
  ------------------
  |  Branch (2984:9): [True: 20.7k, False: 18.3k]
  ------------------
 2985|  20.7k|        xmlNodePtr cur, next;
 2986|       |
 2987|  20.7k|	cur = ctxt->freeElems;
 2988|  41.5k|	while (cur != NULL) {
  ------------------
  |  Branch (2988:9): [True: 20.7k, False: 20.7k]
  ------------------
 2989|  20.7k|	    next = cur->next;
 2990|  20.7k|	    xmlFree(cur);
 2991|  20.7k|	    cur = next;
 2992|  20.7k|	}
 2993|  20.7k|    }
 2994|  39.0k|    if (ctxt->freeAttrs != NULL) {
  ------------------
  |  Branch (2994:9): [True: 12.1k, False: 26.9k]
  ------------------
 2995|  12.1k|        xmlAttrPtr cur, next;
 2996|       |
 2997|  12.1k|	cur = ctxt->freeAttrs;
 2998|  24.3k|	while (cur != NULL) {
  ------------------
  |  Branch (2998:9): [True: 12.1k, False: 12.1k]
  ------------------
 2999|  12.1k|	    next = cur->next;
 3000|  12.1k|	    xmlFree(cur);
 3001|  12.1k|	    cur = next;
 3002|  12.1k|	}
 3003|  12.1k|    }
 3004|       |    /*
 3005|       |     * cleanup the error strings
 3006|       |     */
 3007|  39.0k|    if (ctxt->lastError.message != NULL)
  ------------------
  |  Branch (3007:9): [True: 26.9k, False: 12.1k]
  ------------------
 3008|  26.9k|        xmlFree(ctxt->lastError.message);
 3009|  39.0k|    if (ctxt->lastError.file != NULL)
  ------------------
  |  Branch (3009:9): [True: 6.97k, False: 32.1k]
  ------------------
 3010|  6.97k|        xmlFree(ctxt->lastError.file);
 3011|  39.0k|    if (ctxt->lastError.str1 != NULL)
  ------------------
  |  Branch (3011:9): [True: 15.2k, False: 23.8k]
  ------------------
 3012|  15.2k|        xmlFree(ctxt->lastError.str1);
 3013|  39.0k|    if (ctxt->lastError.str2 != NULL)
  ------------------
  |  Branch (3013:9): [True: 4.76k, False: 34.3k]
  ------------------
 3014|  4.76k|        xmlFree(ctxt->lastError.str2);
 3015|  39.0k|    if (ctxt->lastError.str3 != NULL)
  ------------------
  |  Branch (3015:9): [True: 407, False: 38.6k]
  ------------------
 3016|    407|        xmlFree(ctxt->lastError.str3);
 3017|       |
 3018|  39.0k|#ifdef LIBXML_CATALOG_ENABLED
 3019|  39.0k|    if (ctxt->catalogs != NULL)
  ------------------
  |  Branch (3019:9): [True: 0, False: 39.0k]
  ------------------
 3020|      0|	xmlCatalogFreeLocal(ctxt->catalogs);
 3021|  39.0k|#endif
 3022|  39.0k|    xmlFree(ctxt);
 3023|  39.0k|}
xmlNewParserCtxt:
 3033|  7.46k|{
 3034|  7.46k|    return(xmlNewSAXParserCtxt(NULL, NULL));
 3035|  7.46k|}
xmlNewSAXParserCtxt:
 3054|  39.0k|{
 3055|  39.0k|    xmlParserCtxtPtr ctxt;
 3056|       |
 3057|  39.0k|    xmlInitParser();
 3058|       |
 3059|  39.0k|    ctxt = (xmlParserCtxtPtr) xmlMalloc(sizeof(xmlParserCtxt));
 3060|  39.0k|    if (ctxt == NULL)
  ------------------
  |  Branch (3060:9): [True: 3, False: 39.0k]
  ------------------
 3061|      3|	return(NULL);
 3062|  39.0k|    memset(ctxt, 0, sizeof(xmlParserCtxt));
 3063|  39.0k|    if (xmlInitSAXParserCtxt(ctxt, sax, userData) < 0) {
  ------------------
  |  Branch (3063:9): [True: 30, False: 39.0k]
  ------------------
 3064|     30|        xmlFreeParserCtxt(ctxt);
 3065|     30|	return(NULL);
 3066|     30|    }
 3067|  39.0k|    return(ctxt);
 3068|  39.0k|}
xmlInitNodeInfoSeq:
 3547|  39.0k|{
 3548|  39.0k|    if (seq == NULL)
  ------------------
  |  Branch (3548:9): [True: 0, False: 39.0k]
  ------------------
 3549|      0|        return;
 3550|  39.0k|    seq->length = 0;
 3551|  39.0k|    seq->maximum = 0;
 3552|       |    seq->buffer = NULL;
 3553|  39.0k|}
parserInternals.c:xmlDetectEBCDIC:
 1168|  3.06k|xmlDetectEBCDIC(xmlParserCtxtPtr ctxt, xmlCharEncodingHandlerPtr *hout) {
 1169|  3.06k|    xmlChar out[200];
 1170|  3.06k|    xmlParserInputPtr input = ctxt->input;
 1171|  3.06k|    xmlCharEncodingHandlerPtr handler;
 1172|  3.06k|    int inlen, outlen, i;
 1173|  3.06k|    xmlParserErrors code;
 1174|  3.06k|    xmlCharEncError res;
 1175|       |
 1176|  3.06k|    *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|  3.06k|    code = xmlCreateCharEncodingHandler("IBM037", XML_ENC_INPUT,
 1183|  3.06k|            ctxt->convImpl, ctxt->convCtxt, &handler);
 1184|  3.06k|    if (code != XML_ERR_OK)
  ------------------
  |  Branch (1184:9): [True: 6, False: 3.05k]
  ------------------
 1185|      6|        return(code);
 1186|  3.05k|    outlen = sizeof(out) - 1;
 1187|  3.05k|    inlen = input->end - input->cur;
 1188|  3.05k|    res = xmlEncInputChunk(handler, out, &outlen, input->cur, &inlen,
 1189|  3.05k|                           /* flush */ 0);
 1190|       |    /*
 1191|       |     * Return the EBCDIC handler if decoding failed. The error will
 1192|       |     * be reported later.
 1193|       |     */
 1194|  3.05k|    if (res < 0)
  ------------------
  |  Branch (1194:9): [True: 535, False: 2.52k]
  ------------------
 1195|    535|        goto done;
 1196|  2.52k|    out[outlen] = 0;
 1197|       |
 1198|  60.4k|    for (i = 0; i < outlen; i++) {
  ------------------
  |  Branch (1198:17): [True: 59.4k, False: 963]
  ------------------
 1199|  59.4k|        if (out[i] == '>')
  ------------------
  |  Branch (1199:13): [True: 274, False: 59.1k]
  ------------------
 1200|    274|            break;
 1201|  59.1k|        if ((out[i] == 'e') &&
  ------------------
  |  Branch (1201:13): [True: 3.26k, False: 55.9k]
  ------------------
 1202|  3.26k|            (xmlStrncmp(out + i, BAD_CAST "encoding", 8) == 0)) {
  ------------------
  |  |   34|  3.26k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (1202:13): [True: 1.28k, False: 1.98k]
  ------------------
 1203|  1.28k|            int start, cur, quote;
 1204|       |
 1205|  1.28k|            i += 8;
 1206|  1.28k|            while (IS_BLANK_CH(out[i]))
 1207|    730|                i += 1;
 1208|  1.28k|            if (out[i++] != '=')
  ------------------
  |  Branch (1208:17): [True: 273, False: 1.01k]
  ------------------
 1209|    273|                break;
 1210|  1.01k|            while (IS_BLANK_CH(out[i]))
 1211|    805|                i += 1;
 1212|  1.01k|            quote = out[i++];
 1213|  1.01k|            if ((quote != '\'') && (quote != '"'))
  ------------------
  |  Branch (1213:17): [True: 748, False: 262]
  |  Branch (1213:36): [True: 249, False: 499]
  ------------------
 1214|    249|                break;
 1215|    761|            start = i;
 1216|    761|            cur = out[i];
 1217|  4.15k|            while (((cur >= 'a') && (cur <= 'z')) ||
  ------------------
  |  Branch (1217:21): [True: 984, False: 3.17k]
  |  Branch (1217:37): [True: 700, False: 284]
  ------------------
 1218|  3.45k|                   ((cur >= 'A') && (cur <= 'Z')) ||
  ------------------
  |  Branch (1218:21): [True: 2.29k, False: 1.16k]
  |  Branch (1218:37): [True: 1.13k, False: 1.15k]
  ------------------
 1219|  2.32k|                   ((cur >= '0') && (cur <= '9')) ||
  ------------------
  |  Branch (1219:21): [True: 1.39k, False: 926]
  |  Branch (1219:37): [True: 239, False: 1.15k]
  ------------------
 1220|  2.08k|                   (cur == '.') || (cur == '_') ||
  ------------------
  |  Branch (1220:20): [True: 87, False: 1.99k]
  |  Branch (1220:36): [True: 870, False: 1.12k]
  ------------------
 1221|  1.12k|                   (cur == '-'))
  ------------------
  |  Branch (1221:20): [True: 364, False: 761]
  ------------------
 1222|  3.39k|                cur = out[++i];
 1223|    761|            if (cur != quote)
  ------------------
  |  Branch (1223:17): [True: 570, False: 191]
  ------------------
 1224|    570|                break;
 1225|    191|            out[i] = 0;
 1226|    191|            xmlCharEncCloseFunc(handler);
 1227|    191|            code = xmlCreateCharEncodingHandler((char *) out + start,
 1228|    191|                    XML_ENC_INPUT, ctxt->convImpl, ctxt->convCtxt,
 1229|    191|                    &handler);
 1230|    191|            if (code != XML_ERR_OK)
  ------------------
  |  Branch (1230:17): [True: 104, False: 87]
  ------------------
 1231|    104|                return(code);
 1232|     87|            *hout = handler;
 1233|     87|            return(XML_ERR_OK);
 1234|    191|        }
 1235|  59.1k|    }
 1236|       |
 1237|  2.86k|done:
 1238|       |    /*
 1239|       |     * Encoding handlers are stateful, so we have to recreate them.
 1240|       |     */
 1241|  2.86k|    xmlCharEncCloseFunc(handler);
 1242|  2.86k|    code = xmlCreateCharEncodingHandler("IBM037", XML_ENC_INPUT,
 1243|  2.86k|            ctxt->convImpl, ctxt->convCtxt, &handler);
 1244|  2.86k|    if (code != XML_ERR_OK)
  ------------------
  |  Branch (1244:9): [True: 10, False: 2.85k]
  ------------------
 1245|     10|        return(code);
 1246|  2.85k|    *hout = handler;
 1247|  2.85k|    return(XML_ERR_OK);
 1248|  2.86k|}
parserInternals.c:xmlNewInputInternal:
 1842|   272k|xmlNewInputInternal(xmlParserInputBufferPtr buf, const char *filename) {
 1843|   272k|    xmlParserInputPtr input;
 1844|       |
 1845|   272k|    input = (xmlParserInputPtr) xmlMalloc(sizeof(xmlParserInput));
 1846|   272k|    if (input == NULL) {
  ------------------
  |  Branch (1846:9): [True: 10, False: 272k]
  ------------------
 1847|     10|	xmlFreeParserInputBuffer(buf);
 1848|     10|	return(NULL);
 1849|     10|    }
 1850|   272k|    memset(input, 0, sizeof(xmlParserInput));
 1851|   272k|    input->line = 1;
 1852|   272k|    input->col = 1;
 1853|       |
 1854|   272k|    input->buf = buf;
 1855|   272k|    xmlBufResetInput(input->buf->buffer, input);
 1856|       |
 1857|   272k|    if (filename != NULL) {
  ------------------
  |  Branch (1857:9): [True: 230k, False: 41.6k]
  ------------------
 1858|   230k|        input->filename = xmlMemStrdup(filename);
 1859|   230k|        if (input->filename == NULL) {
  ------------------
  |  Branch (1859:13): [True: 14, False: 230k]
  ------------------
 1860|     14|            xmlFreeInputStream(input);
 1861|     14|            return(NULL);
 1862|     14|        }
 1863|   230k|    }
 1864|       |
 1865|   272k|    return(input);
 1866|   272k|}
parserInternals.c:xmlCtxtResolveFromCatalog:
 2363|   235k|                          const char *publicId) {
 2364|   235k|    char *resource;
 2365|   235k|    void *localCatalogs = NULL;
 2366|   235k|    int allowGlobal = 1;
 2367|   235k|    xmlParserErrors code;
 2368|       |
 2369|   235k|    if (ctxt != NULL) {
  ------------------
  |  Branch (2369:9): [True: 235k, False: 0]
  ------------------
 2370|       |        /*
 2371|       |         * Loading of HTML documents shouldn't use XML catalogs.
 2372|       |         */
 2373|   235k|        if (ctxt->html)
  ------------------
  |  Branch (2373:13): [True: 0, False: 235k]
  ------------------
 2374|      0|            return(NULL);
 2375|       |
 2376|   235k|        localCatalogs = ctxt->catalogs;
 2377|       |
 2378|   235k|        if (ctxt->options & XML_PARSE_NO_SYS_CATALOG)
  ------------------
  |  Branch (2378:13): [True: 32.1k, False: 203k]
  ------------------
 2379|  32.1k|            allowGlobal = 0;
 2380|   235k|    }
 2381|       |
 2382|   235k|    switch (xmlCatalogGetDefaults()) {
  ------------------
  |  Branch (2382:13): [True: 235k, False: 0]
  ------------------
 2383|   235k|        case XML_CATA_ALLOW_NONE:
  ------------------
  |  Branch (2383:9): [True: 235k, False: 0]
  ------------------
 2384|   235k|            return(NULL);
 2385|      0|        case XML_CATA_ALLOW_DOCUMENT:
  ------------------
  |  Branch (2385:9): [True: 0, False: 235k]
  ------------------
 2386|      0|            allowGlobal = 0;
 2387|      0|            break;
 2388|      0|        case XML_CATA_ALLOW_GLOBAL:
  ------------------
  |  Branch (2388:9): [True: 0, False: 235k]
  ------------------
 2389|      0|            localCatalogs = NULL;
 2390|      0|            break;
 2391|      0|        case XML_CATA_ALLOW_ALL:
  ------------------
  |  Branch (2391:9): [True: 0, False: 235k]
  ------------------
 2392|      0|            break;
 2393|   235k|    }
 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|   235k|}
parserInternals.c:xmlInitSAXParserCtxt:
 2766|  39.0k|{
 2767|  39.0k|    xmlParserInputPtr input;
 2768|  39.0k|#ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
 2769|  39.0k|    size_t initialNodeTabSize = 1;
 2770|       |#else
 2771|       |    size_t initialNodeTabSize = 10;
 2772|       |#endif
 2773|       |
 2774|  39.0k|    if (ctxt == NULL)
  ------------------
  |  Branch (2774:9): [True: 0, False: 39.0k]
  ------------------
 2775|      0|        return(-1);
 2776|       |
 2777|  39.0k|    if (ctxt->dict == NULL)
  ------------------
  |  Branch (2777:9): [True: 39.0k, False: 0]
  ------------------
 2778|  39.0k|	ctxt->dict = xmlDictCreate();
 2779|  39.0k|    if (ctxt->dict == NULL)
  ------------------
  |  Branch (2779:9): [True: 4, False: 39.0k]
  ------------------
 2780|      4|	return(-1);
 2781|       |
 2782|  39.0k|    if (ctxt->sax == NULL)
  ------------------
  |  Branch (2782:9): [True: 39.0k, False: 0]
  ------------------
 2783|  39.0k|	ctxt->sax = (xmlSAXHandler *) xmlMalloc(sizeof(xmlSAXHandler));
 2784|  39.0k|    if (ctxt->sax == NULL)
  ------------------
  |  Branch (2784:9): [True: 4, False: 39.0k]
  ------------------
 2785|      4|	return(-1);
 2786|  39.0k|    if (sax == NULL) {
  ------------------
  |  Branch (2786:9): [True: 7.46k, False: 31.6k]
  ------------------
 2787|  7.46k|	memset(ctxt->sax, 0, sizeof(xmlSAXHandler));
 2788|  7.46k|        xmlSAXVersion(ctxt->sax, 2);
 2789|  7.46k|        ctxt->userData = ctxt;
 2790|  31.6k|    } else {
 2791|  31.6k|	if (sax->initialized == XML_SAX2_MAGIC) {
  ------------------
  |  |  953|  31.6k|#define XML_SAX2_MAGIC 0xDEEDBEAF
  ------------------
  |  Branch (2791:6): [True: 31.6k, False: 0]
  ------------------
 2792|  31.6k|	    memcpy(ctxt->sax, sax, sizeof(xmlSAXHandler));
 2793|  31.6k|        } else {
 2794|      0|	    memset(ctxt->sax, 0, sizeof(xmlSAXHandler));
 2795|      0|	    memcpy(ctxt->sax, sax, sizeof(xmlSAXHandlerV1));
 2796|      0|        }
 2797|  31.6k|        ctxt->userData = userData ? userData : ctxt;
  ------------------
  |  Branch (2797:26): [True: 0, False: 31.6k]
  ------------------
 2798|  31.6k|    }
 2799|       |
 2800|  39.0k|    ctxt->maxatts = 0;
 2801|  39.0k|    ctxt->atts = NULL;
 2802|       |    /* Allocate the Input stack */
 2803|  39.0k|    if (ctxt->inputTab == NULL) {
  ------------------
  |  Branch (2803:9): [True: 39.0k, False: 0]
  ------------------
 2804|  39.0k|#ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
 2805|  39.0k|        size_t initialSize = 1;
 2806|       |#else
 2807|       |        size_t initialSize = 5;
 2808|       |#endif
 2809|       |
 2810|  39.0k|	ctxt->inputTab = xmlMalloc(initialSize * sizeof(xmlParserInputPtr));
 2811|  39.0k|	ctxt->inputMax = initialSize;
 2812|  39.0k|    }
 2813|  39.0k|    if (ctxt->inputTab == NULL)
  ------------------
  |  Branch (2813:9): [True: 5, False: 39.0k]
  ------------------
 2814|      5|	return(-1);
 2815|  39.0k|    while ((input = xmlCtxtPopInput(ctxt)) != NULL) { /* Non consuming */
  ------------------
  |  Branch (2815:12): [True: 0, False: 39.0k]
  ------------------
 2816|      0|        xmlFreeInputStream(input);
 2817|      0|    }
 2818|  39.0k|    ctxt->inputNr = 0;
 2819|  39.0k|    ctxt->input = NULL;
 2820|       |
 2821|  39.0k|    ctxt->version = NULL;
 2822|  39.0k|    ctxt->encoding = NULL;
 2823|  39.0k|    ctxt->standalone = -1;
 2824|  39.0k|    ctxt->hasExternalSubset = 0;
 2825|  39.0k|    ctxt->hasPErefs = 0;
 2826|  39.0k|    ctxt->html = 0;
 2827|  39.0k|    ctxt->instate = XML_PARSER_START;
 2828|       |
 2829|       |    /* Allocate the Node stack */
 2830|  39.0k|    if (ctxt->nodeTab == NULL) {
  ------------------
  |  Branch (2830:9): [True: 39.0k, False: 0]
  ------------------
 2831|  39.0k|	ctxt->nodeTab = xmlMalloc(initialNodeTabSize * sizeof(xmlNodePtr));
 2832|  39.0k|	ctxt->nodeMax = initialNodeTabSize;
 2833|  39.0k|    }
 2834|  39.0k|    if (ctxt->nodeTab == NULL)
  ------------------
  |  Branch (2834:9): [True: 3, False: 39.0k]
  ------------------
 2835|      3|	return(-1);
 2836|  39.0k|    ctxt->nodeNr = 0;
 2837|  39.0k|    ctxt->node = NULL;
 2838|       |
 2839|       |    /* Allocate the Name stack */
 2840|  39.0k|    if (ctxt->nameTab == NULL) {
  ------------------
  |  Branch (2840:9): [True: 39.0k, False: 0]
  ------------------
 2841|  39.0k|	ctxt->nameTab = xmlMalloc(initialNodeTabSize * sizeof(xmlChar *));
 2842|  39.0k|	ctxt->nameMax = initialNodeTabSize;
 2843|  39.0k|    }
 2844|  39.0k|    if (ctxt->nameTab == NULL)
  ------------------
  |  Branch (2844:9): [True: 5, False: 39.0k]
  ------------------
 2845|      5|	return(-1);
 2846|  39.0k|    ctxt->nameNr = 0;
 2847|  39.0k|    ctxt->name = NULL;
 2848|       |
 2849|       |    /* Allocate the space stack */
 2850|  39.0k|    if (ctxt->spaceTab == NULL) {
  ------------------
  |  Branch (2850:9): [True: 39.0k, False: 0]
  ------------------
 2851|  39.0k|	ctxt->spaceTab = xmlMalloc(initialNodeTabSize * sizeof(int));
 2852|  39.0k|	ctxt->spaceMax = initialNodeTabSize;
 2853|  39.0k|    }
 2854|  39.0k|    if (ctxt->spaceTab == NULL)
  ------------------
  |  Branch (2854:9): [True: 6, False: 39.0k]
  ------------------
 2855|      6|	return(-1);
 2856|  39.0k|    ctxt->spaceNr = 1;
 2857|  39.0k|    ctxt->spaceTab[0] = -1;
 2858|  39.0k|    ctxt->space = &ctxt->spaceTab[0];
 2859|  39.0k|    ctxt->myDoc = NULL;
 2860|  39.0k|    ctxt->wellFormed = 1;
 2861|  39.0k|    ctxt->nsWellFormed = 1;
 2862|  39.0k|    ctxt->valid = 1;
 2863|       |
 2864|  39.0k|    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|  39.0k|    ctxt->loadsubset = xmlLoadExtDtdDefaultValue;
  ------------------
  |  | 1331|  39.0k|  #define xmlLoadExtDtdDefaultValue (*__xmlLoadExtDtdDefaultValue())
  ------------------
 2873|  39.0k|    if (ctxt->loadsubset) {
  ------------------
  |  Branch (2873:9): [True: 0, False: 39.0k]
  ------------------
 2874|      0|        ctxt->options |= XML_PARSE_DTDLOAD;
 2875|      0|    }
 2876|  39.0k|    ctxt->validate = xmlDoValidityCheckingDefaultValue;
  ------------------
  |  | 1302|  39.0k|    (*__xmlDoValidityCheckingDefaultValue())
  ------------------
 2877|  39.0k|    if (ctxt->validate) {
  ------------------
  |  Branch (2877:9): [True: 0, False: 39.0k]
  ------------------
 2878|      0|        ctxt->options |= XML_PARSE_DTDVALID;
 2879|      0|    }
 2880|  39.0k|    ctxt->pedantic = xmlPedanticParserDefaultValue;
  ------------------
  |  | 1339|  39.0k|    (*__xmlPedanticParserDefaultValue())
  ------------------
 2881|  39.0k|    if (ctxt->pedantic) {
  ------------------
  |  Branch (2881:9): [True: 0, False: 39.0k]
  ------------------
 2882|      0|        ctxt->options |= XML_PARSE_PEDANTIC;
 2883|      0|    }
 2884|  39.0k|    ctxt->keepBlanks = xmlKeepBlanksDefaultValue;
  ------------------
  |  | 1316|  39.0k|  #define xmlKeepBlanksDefaultValue (*__xmlKeepBlanksDefaultValue())
  ------------------
 2885|  39.0k|    if (ctxt->keepBlanks == 0) {
  ------------------
  |  Branch (2885:9): [True: 0, False: 39.0k]
  ------------------
 2886|      0|	ctxt->sax->ignorableWhitespace = xmlSAX2IgnorableWhitespace;
 2887|      0|	ctxt->options |= XML_PARSE_NOBLANKS;
 2888|      0|    }
 2889|  39.0k|    ctxt->replaceEntities = xmlSubstituteEntitiesDefaultValue;
  ------------------
  |  | 1347|  39.0k|    (*__xmlSubstituteEntitiesDefaultValue())
  ------------------
 2890|  39.0k|    if (ctxt->replaceEntities) {
  ------------------
  |  Branch (2890:9): [True: 0, False: 39.0k]
  ------------------
 2891|      0|        ctxt->options |= XML_PARSE_NOENT;
 2892|      0|    }
 2893|  39.0k|    if (xmlGetWarningsDefaultValue == 0)
  ------------------
  |  | 1309|  39.0k|    (*__xmlGetWarningsDefaultValue())
  ------------------
  |  Branch (2893:9): [True: 0, False: 39.0k]
  ------------------
 2894|      0|        ctxt->options |= XML_PARSE_NOWARNING;
 2895|       |
 2896|  39.0k|    ctxt->vctxt.flags = XML_VCTXT_USE_PCTXT;
  ------------------
  |  |   20|  39.0k|#define XML_VCTXT_USE_PCTXT (1u << 1)
  ------------------
 2897|  39.0k|    ctxt->vctxt.userData = ctxt;
 2898|  39.0k|    ctxt->vctxt.error = xmlParserValidityError;
 2899|  39.0k|    ctxt->vctxt.warning = xmlParserValidityWarning;
 2900|       |
 2901|  39.0k|    ctxt->record_info = 0;
 2902|  39.0k|    ctxt->checkIndex = 0;
 2903|  39.0k|    ctxt->inSubset = 0;
 2904|  39.0k|    ctxt->errNo = XML_ERR_OK;
 2905|  39.0k|    ctxt->depth = 0;
 2906|  39.0k|    ctxt->catalogs = NULL;
 2907|  39.0k|    ctxt->sizeentities = 0;
 2908|  39.0k|    ctxt->sizeentcopy = 0;
 2909|  39.0k|    ctxt->input_id = 1;
 2910|  39.0k|    ctxt->maxAmpl = XML_MAX_AMPLIFICATION_DEFAULT;
  ------------------
  |  |   60|  39.0k|#define XML_MAX_AMPLIFICATION_DEFAULT 5
  ------------------
 2911|  39.0k|    xmlInitNodeInfoSeq(&ctxt->node_seq);
 2912|       |
 2913|  39.0k|    if (ctxt->nsdb == NULL) {
  ------------------
  |  Branch (2913:9): [True: 39.0k, False: 0]
  ------------------
 2914|  39.0k|        ctxt->nsdb = xmlParserNsCreate();
 2915|  39.0k|        if (ctxt->nsdb == NULL)
  ------------------
  |  Branch (2915:13): [True: 3, False: 39.0k]
  ------------------
 2916|      3|            return(-1);
 2917|  39.0k|    }
 2918|       |
 2919|  39.0k|    return(0);
 2920|  39.0k|}

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|   119k|{
  125|   119k|    if (tok == NULL)
  ------------------
  |  Branch (125:9): [True: 0, False: 119k]
  ------------------
  126|      0|        return;
  127|   119k|#ifdef HAVE_POSIX_THREADS
  128|       |    /*
  129|       |     * This assumes that __libc_single_threaded won't change while the
  130|       |     * lock is held.
  131|       |     */
  132|   119k|    pthread_mutex_lock(&tok->lock);
  133|       |#elif defined HAVE_WIN32_THREADS
  134|       |    EnterCriticalSection(&tok->cs);
  135|       |#endif
  136|       |
  137|   119k|}
xmlMutexUnlock:
  146|   119k|{
  147|   119k|    if (tok == NULL)
  ------------------
  |  Branch (147:9): [True: 0, False: 119k]
  ------------------
  148|      0|        return;
  149|   119k|#ifdef HAVE_POSIX_THREADS
  150|   119k|    pthread_mutex_unlock(&tok->lock);
  151|       |#elif defined HAVE_WIN32_THREADS
  152|       |    LeaveCriticalSection(&tok->cs);
  153|       |#endif
  154|   119k|}
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.12M|xmlInitParser(void) {
  405|  2.12M|#ifdef HAVE_POSIX_THREADS
  406|  2.12M|    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.12M|}
threads.c:xmlInitParserInternal:
  356|      2|xmlInitParserInternal(void) {
  357|       |    /*
  358|       |     * Note that the initialization code must not make memory allocations.
  359|       |     */
  360|      2|    xmlInitRandom(); /* Required by xmlInitGlobalsInternal */
  361|      2|    xmlInitMemoryInternal();
  362|      2|    xmlInitThreadsInternal();
  363|      2|    xmlInitGlobalsInternal();
  364|      2|    xmlInitDictInternal();
  365|      2|    xmlInitEncodingInternal();
  366|      2|#if defined(LIBXML_XPATH_ENABLED)
  367|      2|    xmlInitXPathInternal();
  368|      2|#endif
  369|      2|    xmlInitIOCallbacks();
  370|      2|#ifdef LIBXML_CATALOG_ENABLED
  371|      2|    xmlInitCatalogInternal();
  372|      2|#endif
  373|      2|#ifdef LIBXML_SCHEMAS_ENABLED
  374|      2|    xmlInitSchemasTypesInternal();
  375|      2|#endif
  376|      2|#ifdef LIBXML_RELAXNG_ENABLED
  377|      2|    xmlInitRelaxNGInternal();
  378|      2|#endif
  379|       |
  380|      2|    xmlParserInitialized = 1;
  381|      2|}
threads.c:xmlInitThreadsInternal:
  330|      2|xmlInitThreadsInternal(void) {
  331|      2|    xmlInitRMutex(&xmlLibraryLock);
  332|      2|}

libxml_domnode_binary_insertion_sort:
  249|  20.3k|void BINARY_INSERTION_SORT(SORT_TYPE *dst, const size_t size) {
  250|       |  /* don't bother sorting an array of size <= 1 */
  251|  20.3k|  if (size <= 1) {
  ------------------
  |  Branch (251:7): [True: 0, False: 20.3k]
  ------------------
  252|      0|    return;
  253|      0|  }
  254|       |
  255|  20.3k|  BINARY_INSERTION_SORT_START(dst, 1, size);
  ------------------
  |  |  149|  20.3k|#define BINARY_INSERTION_SORT_START    SORT_MAKE_STR(binary_insertion_sort_start)
  |  |  ------------------
  |  |  |  |  146|  20.3k|#define SORT_MAKE_STR(x) SORT_MAKE_STR1(SORT_NAME,x)
  |  |  |  |  ------------------
  |  |  |  |  |  |  145|  20.3k|#define SORT_MAKE_STR1(x, y) SORT_CONCAT(x,y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  144|  20.3k|#define SORT_CONCAT(x, y) x ## _ ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  256|  20.3k|}
libxml_domnode_tim_sort:
  533|  31.4k|void TIM_SORT(SORT_TYPE *dst, const size_t size) {
  534|  31.4k|  size_t minrun;
  535|  31.4k|  TEMP_STORAGE_T _store, *store;
  536|  31.4k|  TIM_SORT_RUN_T run_stack[TIM_SORT_STACK_SIZE];
  537|  31.4k|  size_t stack_curr = 0;
  538|  31.4k|  size_t curr = 0;
  539|       |
  540|       |  /* don't bother sorting an array of size 1 */
  541|  31.4k|  if (size <= 1) {
  ------------------
  |  Branch (541:7): [True: 0, False: 31.4k]
  ------------------
  542|      0|    return;
  543|      0|  }
  544|       |
  545|  31.4k|  if (size < 64) {
  ------------------
  |  Branch (545:7): [True: 20.3k, False: 11.1k]
  ------------------
  546|  20.3k|    BINARY_INSERTION_SORT(dst, size);
  ------------------
  |  |  150|  20.3k|#define BINARY_INSERTION_SORT          SORT_MAKE_STR(binary_insertion_sort)
  |  |  ------------------
  |  |  |  |  146|  20.3k|#define SORT_MAKE_STR(x) SORT_MAKE_STR1(SORT_NAME,x)
  |  |  |  |  ------------------
  |  |  |  |  |  |  145|  20.3k|#define SORT_MAKE_STR1(x, y) SORT_CONCAT(x,y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  144|  20.3k|#define SORT_CONCAT(x, y) x ## _ ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  547|  20.3k|    return;
  548|  20.3k|  }
  549|       |
  550|       |  /* compute the minimum run length */
  551|  11.1k|  minrun = compute_minrun(size);
  552|       |  /* temporary storage for merges */
  553|  11.1k|  store = &_store;
  554|  11.1k|  store->alloc = 0;
  555|  11.1k|  store->storage = NULL;
  556|       |
  557|  11.1k|  if (!PUSH_NEXT(dst, size, store, minrun, run_stack, &stack_curr, &curr)) {
  ------------------
  |  Branch (557:7): [True: 0, False: 11.1k]
  ------------------
  558|      0|    return;
  559|      0|  }
  560|       |
  561|  11.1k|  if (!PUSH_NEXT(dst, size, store, minrun, run_stack, &stack_curr, &curr)) {
  ------------------
  |  Branch (561:7): [True: 9.08k, False: 2.04k]
  ------------------
  562|  9.08k|    return;
  563|  9.08k|  }
  564|       |
  565|  2.04k|  if (!PUSH_NEXT(dst, size, store, minrun, run_stack, &stack_curr, &curr)) {
  ------------------
  |  Branch (565:7): [True: 1.72k, False: 323]
  ------------------
  566|  1.72k|    return;
  567|  1.72k|  }
  568|       |
  569|  5.17k|  while (1) {
  ------------------
  |  Branch (569:10): [True: 5.17k, Folded]
  ------------------
  570|  5.17k|    if (!CHECK_INVARIANT(run_stack, stack_curr)) {
  ------------------
  |  |  153|  5.17k|#define CHECK_INVARIANT                SORT_MAKE_STR(check_invariant)
  |  |  ------------------
  |  |  |  |  146|  5.17k|#define SORT_MAKE_STR(x) SORT_MAKE_STR1(SORT_NAME,x)
  |  |  |  |  ------------------
  |  |  |  |  |  |  145|  5.17k|#define SORT_MAKE_STR1(x, y) SORT_CONCAT(x,y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  144|  5.17k|#define SORT_CONCAT(x, y) x ## _ ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (570:9): [True: 1.96k, False: 3.20k]
  ------------------
  571|  1.96k|      stack_curr = TIM_SORT_COLLAPSE(dst, run_stack, stack_curr, store, size);
  ------------------
  |  |  157|  1.96k|#define TIM_SORT_COLLAPSE              SORT_MAKE_STR(tim_sort_collapse)
  |  |  ------------------
  |  |  |  |  146|  1.96k|#define SORT_MAKE_STR(x) SORT_MAKE_STR1(SORT_NAME,x)
  |  |  |  |  ------------------
  |  |  |  |  |  |  145|  1.96k|#define SORT_MAKE_STR1(x, y) SORT_CONCAT(x,y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  144|  1.96k|#define SORT_CONCAT(x, y) x ## _ ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  572|  1.96k|      continue;
  573|  1.96k|    }
  574|       |
  575|  3.20k|    if (!PUSH_NEXT(dst, size, store, minrun, run_stack, &stack_curr, &curr)) {
  ------------------
  |  Branch (575:9): [True: 323, False: 2.88k]
  ------------------
  576|    323|      return;
  577|    323|    }
  578|  3.20k|  }
  579|    323|}
xpath.c:libxml_domnode_binary_insertion_sort_start:
  219|  25.6k|static void BINARY_INSERTION_SORT_START(SORT_TYPE *dst, const size_t start, const size_t size) {
  220|  25.6k|  size_t i;
  221|       |
  222|   345k|  for (i = start; i < size; i++) {
  ------------------
  |  Branch (222:19): [True: 319k, False: 25.6k]
  ------------------
  223|   319k|    size_t j;
  224|   319k|    SORT_TYPE x;
  ------------------
  |  |  593|   319k|#define SORT_TYPE xmlNodePtr
  ------------------
  225|   319k|    size_t location;
  226|       |
  227|       |    /* If this entry is already correct, just move along */
  228|   319k|    if (SORT_CMP(dst[i - 1], dst[i]) <= 0) {
  ------------------
  |  |  617|   319k|#define SORT_CMP(x, y)  (wrap_cmp(x, y))
  ------------------
  |  Branch (228:9): [True: 200k, False: 119k]
  ------------------
  229|   200k|      continue;
  230|   200k|    }
  231|       |
  232|       |    /* Else we need to find the right place, shift everything over, and squeeze in */
  233|   119k|    x = dst[i];
  234|   119k|    location = BINARY_INSERTION_FIND(dst, x, i);
  ------------------
  |  |  148|   119k|#define BINARY_INSERTION_FIND          SORT_MAKE_STR(binary_insertion_find)
  |  |  ------------------
  |  |  |  |  146|   119k|#define SORT_MAKE_STR(x) SORT_MAKE_STR1(SORT_NAME,x)
  |  |  |  |  ------------------
  |  |  |  |  |  |  145|   119k|#define SORT_MAKE_STR1(x, y) SORT_CONCAT(x,y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  144|   119k|#define SORT_CONCAT(x, y) x ## _ ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  235|       |
  236|   645k|    for (j = i - 1; j >= location; j--) {
  ------------------
  |  Branch (236:21): [True: 529k, False: 116k]
  ------------------
  237|   529k|      dst[j + 1] = dst[j];
  238|       |
  239|   529k|      if (j == 0) { /* check edge case because j is unsigned */
  ------------------
  |  Branch (239:11): [True: 3.03k, False: 526k]
  ------------------
  240|  3.03k|        break;
  241|  3.03k|      }
  242|   529k|    }
  243|       |
  244|   119k|    dst[location] = x;
  245|   119k|  }
  246|  25.6k|}
xpath.c:libxml_domnode_binary_insertion_find:
  180|   119k|    const size_t size) {
  181|   119k|  size_t l, c, r;
  182|   119k|  SORT_TYPE cx;
  ------------------
  |  |  593|   119k|#define SORT_TYPE xmlNodePtr
  ------------------
  183|   119k|  l = 0;
  184|   119k|  r = size - 1;
  185|   119k|  c = r >> 1;
  186|       |
  187|       |  /* check for out of bounds at the beginning. */
  188|   119k|  if (SORT_CMP(x, dst[0]) < 0) {
  ------------------
  |  |  617|   119k|#define SORT_CMP(x, y)  (wrap_cmp(x, y))
  ------------------
  |  Branch (188:7): [True: 3.03k, False: 116k]
  ------------------
  189|  3.03k|    return 0;
  190|   116k|  } else if (SORT_CMP(x, dst[r]) > 0) {
  ------------------
  |  |  617|   116k|#define SORT_CMP(x, y)  (wrap_cmp(x, y))
  ------------------
  |  Branch (190:14): [True: 0, False: 116k]
  ------------------
  191|      0|    return r;
  192|      0|  }
  193|       |
  194|   116k|  cx = dst[c];
  195|       |
  196|   495k|  while (1) {
  ------------------
  |  Branch (196:10): [True: 495k, Folded]
  ------------------
  197|   495k|    const int val = SORT_CMP(x, cx);
  ------------------
  |  |  617|   495k|#define SORT_CMP(x, y)  (wrap_cmp(x, y))
  ------------------
  198|       |
  199|   495k|    if (val < 0) {
  ------------------
  |  Branch (199:9): [True: 105k, False: 390k]
  ------------------
  200|   105k|      if (c - l <= 1) {
  ------------------
  |  Branch (200:11): [True: 47.0k, False: 58.2k]
  ------------------
  201|  47.0k|        return c;
  202|  47.0k|      }
  203|       |
  204|  58.2k|      r = c;
  205|   390k|    } else { /* allow = for stability. The binary search favors the right. */
  206|   390k|      if (r - c <= 1) {
  ------------------
  |  Branch (206:11): [True: 69.2k, False: 321k]
  ------------------
  207|  69.2k|        return c + 1;
  208|  69.2k|      }
  209|       |
  210|   321k|      l = c;
  211|   321k|    }
  212|       |
  213|   379k|    c = l + ((r - l) >> 1);
  214|   379k|    cx = dst[c];
  215|   379k|  }
  216|   116k|}
xpath.c:compute_minrun:
  129|  11.1k|static __inline int compute_minrun(const uint64_t size) {
  130|  11.1k|  const int top_bit = 64 - CLZ(size);
  ------------------
  |  |   78|  11.1k|#define CLZ __builtin_clzll
  ------------------
  131|  11.1k|  const int shift = MAX(top_bit, 6) - 6;
  ------------------
  |  |   67|  11.1k|#define MAX(x,y) (((x) > (y) ? (x) : (y)))
  |  |  ------------------
  |  |  |  Branch (67:20): [True: 11.1k, False: 0]
  |  |  ------------------
  ------------------
  132|  11.1k|  const int minrun = size >> shift;
  133|  11.1k|  const uint64_t mask = (1ULL << shift) - 1;
  134|       |
  135|  11.1k|  if (mask & size) {
  ------------------
  |  Branch (135:7): [True: 6.90k, False: 4.23k]
  ------------------
  136|  6.90k|    return minrun + 1;
  137|  6.90k|  }
  138|       |
  139|  4.23k|  return minrun;
  140|  11.1k|}
xpath.c:PUSH_NEXT:
  496|  27.5k|                              size_t *curr) {
  497|  27.5k|  size_t len = COUNT_RUN(dst, *curr, size);
  ------------------
  |  |  152|  27.5k|#define COUNT_RUN                      SORT_MAKE_STR(count_run)
  |  |  ------------------
  |  |  |  |  146|  27.5k|#define SORT_MAKE_STR(x) SORT_MAKE_STR1(SORT_NAME,x)
  |  |  |  |  ------------------
  |  |  |  |  |  |  145|  27.5k|#define SORT_MAKE_STR1(x, y) SORT_CONCAT(x,y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  144|  27.5k|#define SORT_CONCAT(x, y) x ## _ ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  498|  27.5k|  size_t run = minrun;
  499|       |
  500|  27.5k|  if (run > size - *curr) {
  ------------------
  |  Branch (500:7): [True: 10.9k, False: 16.5k]
  ------------------
  501|  10.9k|    run = size - *curr;
  502|  10.9k|  }
  503|       |
  504|  27.5k|  if (run > len) {
  ------------------
  |  Branch (504:7): [True: 5.37k, False: 22.1k]
  ------------------
  505|  5.37k|    BINARY_INSERTION_SORT_START(&dst[*curr], len, run);
  ------------------
  |  |  149|  5.37k|#define BINARY_INSERTION_SORT_START    SORT_MAKE_STR(binary_insertion_sort_start)
  |  |  ------------------
  |  |  |  |  146|  5.37k|#define SORT_MAKE_STR(x) SORT_MAKE_STR1(SORT_NAME,x)
  |  |  |  |  ------------------
  |  |  |  |  |  |  145|  5.37k|#define SORT_MAKE_STR1(x, y) SORT_CONCAT(x,y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  144|  5.37k|#define SORT_CONCAT(x, y) x ## _ ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  506|  5.37k|    len = run;
  507|  5.37k|  }
  508|       |
  509|  27.5k|  run_stack[*stack_curr].start = *curr;
  510|  27.5k|  run_stack[*stack_curr].length = len;
  511|  27.5k|  (*stack_curr)++;
  512|  27.5k|  *curr += len;
  513|       |
  514|  27.5k|  if (*curr == size) {
  ------------------
  |  Branch (514:7): [True: 11.1k, False: 16.3k]
  ------------------
  515|       |    /* finish up */
  516|  24.2k|    while (*stack_curr > 1) {
  ------------------
  |  Branch (516:12): [True: 13.0k, False: 11.1k]
  ------------------
  517|  13.0k|      TIM_SORT_MERGE(dst, run_stack, *stack_curr, store);
  ------------------
  |  |  156|  13.0k|#define TIM_SORT_MERGE                 SORT_MAKE_STR(tim_sort_merge)
  |  |  ------------------
  |  |  |  |  146|  13.0k|#define SORT_MAKE_STR(x) SORT_MAKE_STR1(SORT_NAME,x)
  |  |  |  |  ------------------
  |  |  |  |  |  |  145|  13.0k|#define SORT_MAKE_STR1(x, y) SORT_CONCAT(x,y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  144|  13.0k|#define SORT_CONCAT(x, y) x ## _ ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  518|  13.0k|      run_stack[*stack_curr - 2].length += run_stack[*stack_curr - 1].length;
  519|  13.0k|      (*stack_curr)--;
  520|  13.0k|    }
  521|       |
  522|  11.1k|    if (store->storage != NULL) {
  ------------------
  |  Branch (522:9): [True: 11.1k, False: 0]
  ------------------
  523|  11.1k|      free(store->storage);
  524|  11.1k|      store->storage = NULL;
  525|  11.1k|    }
  526|       |
  527|  11.1k|    return 0;
  528|  11.1k|  }
  529|       |
  530|  16.3k|  return 1;
  531|  27.5k|}
xpath.c:libxml_domnode_count_run:
  272|  27.5k|static size_t COUNT_RUN(SORT_TYPE *dst, const size_t start, const size_t size) {
  273|  27.5k|  size_t curr;
  274|       |
  275|  27.5k|  if (size - start == 1) {
  ------------------
  |  Branch (275:7): [True: 10.1k, False: 17.3k]
  ------------------
  276|  10.1k|    return 1;
  277|  10.1k|  }
  278|       |
  279|  17.3k|  if (start >= size - 2) {
  ------------------
  |  Branch (279:7): [True: 90, False: 17.2k]
  ------------------
  280|     90|    if (SORT_CMP(dst[size - 2], dst[size - 1]) > 0) {
  ------------------
  |  |  617|     90|#define SORT_CMP(x, y)  (wrap_cmp(x, y))
  ------------------
  |  Branch (280:9): [True: 27, False: 63]
  ------------------
  281|     27|      SORT_SWAP(dst[size - 2], dst[size - 1]);
  ------------------
  |  |   59|     27|#define SORT_SWAP(x,y) {SORT_TYPE __SORT_SWAP_t = (x); (x) = (y); (y) = __SORT_SWAP_t;}
  |  |  ------------------
  |  |  |  |  593|     27|#define SORT_TYPE xmlNodePtr
  |  |  ------------------
  ------------------
  282|     27|    }
  283|       |
  284|     90|    return 2;
  285|     90|  }
  286|       |
  287|  17.2k|  curr = start + 2;
  288|       |
  289|  17.2k|  if (SORT_CMP(dst[start], dst[start + 1]) <= 0) {
  ------------------
  |  |  617|  17.2k|#define SORT_CMP(x, y)  (wrap_cmp(x, y))
  ------------------
  |  Branch (289:7): [True: 15.9k, False: 1.30k]
  ------------------
  290|       |    /* increasing run */
  291|  1.26M|    while (1) {
  ------------------
  |  Branch (291:12): [True: 1.26M, Folded]
  ------------------
  292|  1.26M|      if (curr == size - 1) {
  ------------------
  |  Branch (292:11): [True: 10.8k, False: 1.25M]
  ------------------
  293|  10.8k|        break;
  294|  10.8k|      }
  295|       |
  296|  1.25M|      if (SORT_CMP(dst[curr - 1], dst[curr]) > 0) {
  ------------------
  |  |  617|  1.25M|#define SORT_CMP(x, y)  (wrap_cmp(x, y))
  ------------------
  |  Branch (296:11): [True: 5.11k, False: 1.25M]
  ------------------
  297|  5.11k|        break;
  298|  5.11k|      }
  299|       |
  300|  1.25M|      curr++;
  301|  1.25M|    }
  302|       |
  303|  15.9k|    return curr - start;
  304|  15.9k|  } else {
  305|       |    /* decreasing run */
  306|  1.88k|    while (1) {
  ------------------
  |  Branch (306:12): [True: 1.88k, Folded]
  ------------------
  307|  1.88k|      if (curr == size - 1) {
  ------------------
  |  Branch (307:11): [True: 104, False: 1.77k]
  ------------------
  308|    104|        break;
  309|    104|      }
  310|       |
  311|  1.77k|      if (SORT_CMP(dst[curr - 1], dst[curr]) <= 0) {
  ------------------
  |  |  617|  1.77k|#define SORT_CMP(x, y)  (wrap_cmp(x, y))
  ------------------
  |  Branch (311:11): [True: 1.20k, False: 576]
  ------------------
  312|  1.20k|        break;
  313|  1.20k|      }
  314|       |
  315|    576|      curr++;
  316|    576|    }
  317|       |
  318|       |    /* reverse in-place */
  319|  1.30k|    REVERSE_ELEMENTS(dst, start, curr - 1);
  ------------------
  |  |  151|  1.30k|#define REVERSE_ELEMENTS               SORT_MAKE_STR(reverse_elements)
  |  |  ------------------
  |  |  |  |  146|  1.30k|#define SORT_MAKE_STR(x) SORT_MAKE_STR1(SORT_NAME,x)
  |  |  |  |  ------------------
  |  |  |  |  |  |  145|  1.30k|#define SORT_MAKE_STR1(x, y) SORT_CONCAT(x,y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  144|  1.30k|#define SORT_CONCAT(x, y) x ## _ ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  320|  1.30k|    return curr - start;
  321|  1.30k|  }
  322|  17.2k|}
xpath.c:libxml_domnode_reverse_elements:
  260|  1.30k|static __inline void REVERSE_ELEMENTS(SORT_TYPE *dst, size_t start, size_t end) {
  261|  2.73k|  while (1) {
  ------------------
  |  Branch (261:10): [True: 2.73k, Folded]
  ------------------
  262|  2.73k|    if (start >= end) {
  ------------------
  |  Branch (262:9): [True: 1.30k, False: 1.42k]
  ------------------
  263|  1.30k|      return;
  264|  1.30k|    }
  265|       |
  266|  1.42k|    SORT_SWAP(dst[start], dst[end]);
  ------------------
  |  |   59|  1.42k|#define SORT_SWAP(x,y) {SORT_TYPE __SORT_SWAP_t = (x); (x) = (y); (y) = __SORT_SWAP_t;}
  |  |  ------------------
  |  |  |  |  593|  1.42k|#define SORT_TYPE xmlNodePtr
  |  |  ------------------
  ------------------
  267|  1.42k|    start++;
  268|  1.42k|    end--;
  269|  1.42k|  }
  270|  1.30k|}
xpath.c:libxml_domnode_tim_sort_merge:
  374|  16.3k|                           TEMP_STORAGE_T *store) {
  375|  16.3k|  const size_t A = stack[stack_curr - 2].length;
  376|  16.3k|  const size_t B = stack[stack_curr - 1].length;
  377|  16.3k|  const size_t curr = stack[stack_curr - 2].start;
  378|  16.3k|  SORT_TYPE *storage;
  ------------------
  |  |  593|  16.3k|#define SORT_TYPE xmlNodePtr
  ------------------
  379|  16.3k|  size_t i, j, k;
  380|  16.3k|  TIM_SORT_RESIZE(store, MIN(A, B));
  ------------------
  |  |  155|  16.3k|#define TIM_SORT_RESIZE                SORT_MAKE_STR(tim_sort_resize)
  |  |  ------------------
  |  |  |  |  146|  16.3k|#define SORT_MAKE_STR(x) SORT_MAKE_STR1(SORT_NAME,x)
  |  |  |  |  ------------------
  |  |  |  |  |  |  145|  16.3k|#define SORT_MAKE_STR1(x, y) SORT_CONCAT(x,y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  144|  16.3k|#define SORT_CONCAT(x, y) x ## _ ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                TIM_SORT_RESIZE(store, MIN(A, B));
  ------------------
  |  |   71|  16.3k|#define MIN(x,y) (((x) < (y) ? (x) : (y)))
  |  |  ------------------
  |  |  |  Branch (71:20): [True: 3.12k, False: 13.2k]
  |  |  ------------------
  ------------------
  381|  16.3k|  storage = store->storage;
  382|       |
  383|       |  /* left merge */
  384|  16.3k|  if (A < B) {
  ------------------
  |  Branch (384:7): [True: 3.12k, False: 13.2k]
  ------------------
  385|  3.12k|    memcpy(storage, &dst[curr], A * sizeof(SORT_TYPE));
  386|  3.12k|    i = 0;
  387|  3.12k|    j = curr + A;
  388|       |
  389|   462k|    for (k = curr; k < curr + A + B; k++) {
  ------------------
  |  Branch (389:20): [True: 461k, False: 521]
  ------------------
  390|   461k|      if ((i < A) && (j < curr + A + B)) {
  ------------------
  |  Branch (390:11): [True: 459k, False: 2.60k]
  |  Branch (390:22): [True: 450k, False: 8.97k]
  ------------------
  391|   450k|        if (SORT_CMP(storage[i], dst[j]) <= 0) {
  ------------------
  |  |  617|   450k|#define SORT_CMP(x, y)  (wrap_cmp(x, y))
  ------------------
  |  Branch (391:13): [True: 222k, False: 227k]
  ------------------
  392|   222k|          dst[k] = storage[i++];
  393|   227k|        } else {
  394|   227k|          dst[k] = dst[j++];
  395|   227k|        }
  396|   450k|      } else if (i < A) {
  ------------------
  |  Branch (396:18): [True: 8.97k, False: 2.60k]
  ------------------
  397|  8.97k|        dst[k] = storage[i++];
  398|  8.97k|      } else {
  399|  2.60k|        break;
  400|  2.60k|      }
  401|   461k|    }
  402|  13.2k|  } else {
  403|       |    /* right merge */
  404|  13.2k|    memcpy(storage, &dst[curr + A], B * sizeof(SORT_TYPE));
  405|  13.2k|    i = B;
  406|  13.2k|    j = curr + A;
  407|  13.2k|    k = curr + A + B;
  408|       |
  409|   406k|    while (k > curr) {
  ------------------
  |  Branch (409:12): [True: 406k, False: 265]
  ------------------
  410|   406k|      k--;
  411|   406k|      if ((i > 0) && (j > curr)) {
  ------------------
  |  Branch (411:11): [True: 393k, False: 13.0k]
  |  Branch (411:22): [True: 389k, False: 3.68k]
  ------------------
  412|   389k|        if (SORT_CMP(dst[j - 1], storage[i - 1]) > 0) {
  ------------------
  |  |  617|   389k|#define SORT_CMP(x, y)  (wrap_cmp(x, y))
  ------------------
  |  Branch (412:13): [True: 91.5k, False: 298k]
  ------------------
  413|  91.5k|          dst[k] = dst[--j];
  414|   298k|        } else {
  415|   298k|          dst[k] = storage[--i];
  416|   298k|        }
  417|   389k|      } else if (i > 0) {
  ------------------
  |  Branch (417:18): [True: 3.68k, False: 13.0k]
  ------------------
  418|  3.68k|        dst[k] = storage[--i];
  419|  13.0k|      } else {
  420|  13.0k|        break;
  421|  13.0k|      }
  422|   406k|    }
  423|  13.2k|  }
  424|  16.3k|}
xpath.c:libxml_domnode_tim_sort_resize:
  358|  16.3k|static void TIM_SORT_RESIZE(TEMP_STORAGE_T *store, const size_t new_size) {
  359|  16.3k|  if (store->alloc < new_size) {
  ------------------
  |  Branch (359:7): [True: 13.3k, False: 3.05k]
  ------------------
  360|  13.3k|    SORT_TYPE *tempstore = (SORT_TYPE *)realloc(store->storage, new_size * sizeof(SORT_TYPE));
  ------------------
  |  |  593|  13.3k|#define SORT_TYPE xmlNodePtr
  ------------------
  361|       |
  362|  13.3k|    if (tempstore == NULL) {
  ------------------
  |  Branch (362:9): [True: 0, False: 13.3k]
  ------------------
  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.3k|    store->storage = tempstore;
  369|  13.3k|    store->alloc = new_size;
  370|  13.3k|  }
  371|  16.3k|}
xpath.c:libxml_domnode_check_invariant:
  324|  5.17k|static int CHECK_INVARIANT(TIM_SORT_RUN_T *stack, const int stack_curr) {
  325|  5.17k|  size_t A, B, C;
  326|       |
  327|  5.17k|  if (stack_curr < 2) {
  ------------------
  |  Branch (327:7): [True: 262, False: 4.90k]
  ------------------
  328|    262|    return 1;
  329|    262|  }
  330|       |
  331|  4.90k|  if (stack_curr == 2) {
  ------------------
  |  Branch (331:7): [True: 596, False: 4.31k]
  ------------------
  332|    596|    const size_t A1 = stack[stack_curr - 2].length;
  333|    596|    const size_t B1 = stack[stack_curr - 1].length;
  334|       |
  335|    596|    if (A1 <= B1) {
  ------------------
  |  Branch (335:9): [True: 23, False: 573]
  ------------------
  336|     23|      return 0;
  337|     23|    }
  338|       |
  339|    573|    return 1;
  340|    596|  }
  341|       |
  342|  4.31k|  A = stack[stack_curr - 3].length;
  343|  4.31k|  B = stack[stack_curr - 2].length;
  344|  4.31k|  C = stack[stack_curr - 1].length;
  345|       |
  346|  4.31k|  if ((A <= B + C) || (B <= C)) {
  ------------------
  |  Branch (346:7): [True: 1.15k, False: 3.15k]
  |  Branch (346:23): [True: 779, False: 2.37k]
  ------------------
  347|  1.93k|    return 0;
  348|  1.93k|  }
  349|       |
  350|  2.37k|  return 1;
  351|  4.31k|}
xpath.c:libxml_domnode_tim_sort_collapse:
  427|  1.96k|                             TEMP_STORAGE_T *store, const size_t size) {
  428|  5.01k|  while (1) {
  ------------------
  |  Branch (428:10): [True: 5.01k, Folded]
  ------------------
  429|  5.01k|    size_t A, B, C, D;
  430|  5.01k|    int ABC, BCD, CD;
  431|       |
  432|       |    /* if the stack only has one thing on it, we are done with the collapse */
  433|  5.01k|    if (stack_curr <= 1) {
  ------------------
  |  Branch (433:9): [True: 0, False: 5.01k]
  ------------------
  434|      0|      break;
  435|      0|    }
  436|       |
  437|       |    /* if this is the last merge, just do it */
  438|  5.01k|    if ((stack_curr == 2) && (stack[0].length + stack[1].length == size)) {
  ------------------
  |  Branch (438:9): [True: 767, False: 4.24k]
  |  Branch (438:30): [True: 0, False: 767]
  ------------------
  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|  5.01k|    else if ((stack_curr == 2) && (stack[0].length <= stack[1].length)) {
  ------------------
  |  Branch (445:14): [True: 767, False: 4.24k]
  |  Branch (445:35): [True: 262, False: 505]
  ------------------
  446|    262|      TIM_SORT_MERGE(dst, stack, stack_curr, store);
  ------------------
  |  |  156|    262|#define TIM_SORT_MERGE                 SORT_MAKE_STR(tim_sort_merge)
  |  |  ------------------
  |  |  |  |  146|    262|#define SORT_MAKE_STR(x) SORT_MAKE_STR1(SORT_NAME,x)
  |  |  |  |  ------------------
  |  |  |  |  |  |  145|    262|#define SORT_MAKE_STR1(x, y) SORT_CONCAT(x,y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  144|    262|#define SORT_CONCAT(x, y) x ## _ ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  447|    262|      stack[0].length += stack[1].length;
  448|    262|      stack_curr--;
  449|    262|      break;
  450|  4.75k|    } else if (stack_curr == 2) {
  ------------------
  |  Branch (450:16): [True: 505, False: 4.24k]
  ------------------
  451|    505|      break;
  452|    505|    }
  453|       |
  454|  4.24k|    B = stack[stack_curr - 3].length;
  455|  4.24k|    C = stack[stack_curr - 2].length;
  456|  4.24k|    D = stack[stack_curr - 1].length;
  457|       |
  458|  4.24k|    if (stack_curr >= 4) {
  ------------------
  |  Branch (458:9): [True: 3.02k, False: 1.21k]
  ------------------
  459|  3.02k|      A = stack[stack_curr - 4].length;
  460|  3.02k|      ABC = (A <= B + C);
  461|  3.02k|    } else {
  462|  1.21k|      ABC = 0;
  463|  1.21k|    }
  464|       |
  465|  4.24k|    BCD = (B <= C + D) || ABC;
  ------------------
  |  Branch (465:11): [True: 1.69k, False: 2.55k]
  |  Branch (465:27): [True: 32, False: 2.52k]
  ------------------
  466|  4.24k|    CD = (C <= D);
  467|       |
  468|       |    /* Both invariants are good */
  469|  4.24k|    if (!BCD && !CD) {
  ------------------
  |  Branch (469:9): [True: 2.52k, False: 1.72k]
  |  Branch (469:17): [True: 1.19k, False: 1.32k]
  ------------------
  470|  1.19k|      break;
  471|  1.19k|    }
  472|       |
  473|       |    /* left merge */
  474|  3.05k|    if (BCD && !CD) {
  ------------------
  |  Branch (474:9): [True: 1.72k, False: 1.32k]
  |  Branch (474:16): [True: 663, False: 1.06k]
  ------------------
  475|    663|      TIM_SORT_MERGE(dst, stack, stack_curr - 1, store);
  ------------------
  |  |  156|    663|#define TIM_SORT_MERGE                 SORT_MAKE_STR(tim_sort_merge)
  |  |  ------------------
  |  |  |  |  146|    663|#define SORT_MAKE_STR(x) SORT_MAKE_STR1(SORT_NAME,x)
  |  |  |  |  ------------------
  |  |  |  |  |  |  145|    663|#define SORT_MAKE_STR1(x, y) SORT_CONCAT(x,y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  144|    663|#define SORT_CONCAT(x, y) x ## _ ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  476|    663|      stack[stack_curr - 3].length += stack[stack_curr - 2].length;
  477|    663|      stack[stack_curr - 2] = stack[stack_curr - 1];
  478|    663|      stack_curr--;
  479|  2.38k|    } else {
  480|       |      /* right merge */
  481|  2.38k|      TIM_SORT_MERGE(dst, stack, stack_curr, store);
  ------------------
  |  |  156|  2.38k|#define TIM_SORT_MERGE                 SORT_MAKE_STR(tim_sort_merge)
  |  |  ------------------
  |  |  |  |  146|  2.38k|#define SORT_MAKE_STR(x) SORT_MAKE_STR1(SORT_NAME,x)
  |  |  |  |  ------------------
  |  |  |  |  |  |  145|  2.38k|#define SORT_MAKE_STR1(x, y) SORT_CONCAT(x,y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  144|  2.38k|#define SORT_CONCAT(x, y) x ## _ ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  482|  2.38k|      stack[stack_curr - 2].length += stack[stack_curr - 1].length;
  483|  2.38k|      stack_curr--;
  484|  2.38k|    }
  485|  3.05k|  }
  486|       |
  487|  1.96k|  return stack_curr;
  488|  1.96k|}

xmlBuildQName:
  170|   309k|	      xmlChar *memory, int len) {
  171|   309k|    size_t lenn, lenp;
  172|   309k|    xmlChar *ret;
  173|       |
  174|   309k|    if ((ncname == NULL) || (len < 0)) return(NULL);
  ------------------
  |  Branch (174:9): [True: 0, False: 309k]
  |  Branch (174:29): [True: 0, False: 309k]
  ------------------
  175|   309k|    if (prefix == NULL) return((xmlChar *) ncname);
  ------------------
  |  Branch (175:9): [True: 195k, False: 114k]
  ------------------
  176|       |
  177|   114k|#ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
  178|       |    /* Make allocation more likely */
  179|   114k|    if (len > 8)
  ------------------
  |  Branch (179:9): [True: 73.3k, False: 40.9k]
  ------------------
  180|  73.3k|        len = 8;
  181|   114k|#endif
  182|       |
  183|   114k|    lenn = strlen((char *) ncname);
  184|   114k|    lenp = strlen((char *) prefix);
  185|   114k|    if (lenn >= SIZE_MAX - lenp - 1)
  ------------------
  |  Branch (185:9): [True: 0, False: 114k]
  ------------------
  186|      0|        return(NULL);
  187|       |
  188|   114k|    if ((memory == NULL) || ((size_t) len < lenn + lenp + 2)) {
  ------------------
  |  Branch (188:9): [True: 40.9k, False: 73.3k]
  |  Branch (188:29): [True: 27.2k, False: 46.1k]
  ------------------
  189|  68.2k|	ret = xmlMalloc(lenn + lenp + 2);
  190|  68.2k|	if (ret == NULL)
  ------------------
  |  Branch (190:6): [True: 57, False: 68.1k]
  ------------------
  191|     57|	    return(NULL);
  192|  68.2k|    } else {
  193|  46.1k|	ret = memory;
  194|  46.1k|    }
  195|   114k|    memcpy(&ret[0], prefix, lenp);
  196|   114k|    ret[lenp] = ':';
  197|   114k|    memcpy(&ret[lenp + 1], ncname, lenn);
  198|   114k|    ret[lenn + lenp + 1] = 0;
  199|   114k|    return(ret);
  200|   114k|}
xmlSplitQName3:
  268|   172k|xmlSplitQName3(const xmlChar *name, int *len) {
  269|   172k|    int l = 0;
  270|       |
  271|   172k|    if (name == NULL) return(NULL);
  ------------------
  |  Branch (271:9): [True: 0, False: 172k]
  ------------------
  272|   172k|    if (len == NULL) return(NULL);
  ------------------
  |  Branch (272:9): [True: 0, False: 172k]
  ------------------
  273|       |
  274|       |    /* nasty but valid */
  275|   172k|    if (name[0] == ':')
  ------------------
  |  Branch (275:9): [True: 1.24k, False: 171k]
  ------------------
  276|  1.24k|	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|   860k|    while ((name[l] != 0) && (name[l] != ':'))
  ------------------
  |  Branch (282:12): [True: 701k, False: 159k]
  |  Branch (282:30): [True: 689k, False: 11.9k]
  ------------------
  283|   689k|	l++;
  284|       |
  285|   171k|    if ((name[l] == 0) || (name[l+1] == 0))
  ------------------
  |  Branch (285:9): [True: 159k, False: 11.9k]
  |  Branch (285:27): [True: 539, False: 11.3k]
  ------------------
  286|   159k|	return(NULL);
  287|       |
  288|  11.3k|    *len = l;
  289|       |
  290|  11.3k|    return(&name[l+1]);
  291|   171k|}
xmlSplitQName4:
  306|   464k|xmlSplitQName4(const xmlChar *name, xmlChar **prefixPtr) {
  307|   464k|    xmlChar *prefix;
  308|   464k|    int l = 0;
  309|       |
  310|   464k|    if ((name == NULL) || (prefixPtr == NULL))
  ------------------
  |  Branch (310:9): [True: 0, False: 464k]
  |  Branch (310:27): [True: 0, False: 464k]
  ------------------
  311|      0|        return(NULL);
  312|       |
  313|   464k|    *prefixPtr = NULL;
  314|       |
  315|       |    /* nasty but valid */
  316|   464k|    if (name[0] == ':')
  ------------------
  |  Branch (316:9): [True: 2.72k, False: 462k]
  ------------------
  317|  2.72k|	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|  1.88M|    while ((name[l] != 0) && (name[l] != ':'))
  ------------------
  |  Branch (323:12): [True: 1.53M, False: 352k]
  |  Branch (323:30): [True: 1.42M, False: 109k]
  ------------------
  324|  1.42M|	l++;
  325|       |
  326|       |    /*
  327|       |     * TODO: What about names with multiple colons?
  328|       |     */
  329|   462k|    if ((name[l] == 0) || (name[l+1] == 0))
  ------------------
  |  Branch (329:9): [True: 352k, False: 109k]
  |  Branch (329:27): [True: 1.54k, False: 108k]
  ------------------
  330|   353k|	return(name);
  331|       |
  332|   108k|    prefix = xmlStrndup(name, l);
  333|   108k|    if (prefix == NULL)
  ------------------
  |  Branch (333:9): [True: 43, False: 108k]
  ------------------
  334|     43|        return(NULL);
  335|       |
  336|   108k|    *prefixPtr = prefix;
  337|   108k|    return(&name[l+1]);
  338|   108k|}
xmlValidateNCName:
  355|  2.41k|xmlValidateNCName(const xmlChar *value, int space) {
  356|  2.41k|    const xmlChar *cur;
  357|       |
  358|  2.41k|    if (value == NULL)
  ------------------
  |  Branch (358:9): [True: 0, False: 2.41k]
  ------------------
  359|      0|        return(-1);
  360|       |
  361|  2.41k|    cur = value;
  362|       |
  363|  2.41k|    if (space) {
  ------------------
  |  Branch (363:9): [True: 2.41k, False: 0]
  ------------------
  364|  2.41k|	while (IS_BLANK_CH(*cur))
  365|    611|            cur++;
  366|  2.41k|    }
  367|       |
  368|  2.41k|    value = cur;
  369|  2.41k|    cur = xmlScanName(value, SIZE_MAX, XML_SCAN_NC);
  ------------------
  |  |   69|  2.41k|#define XML_SCAN_NC         1
  ------------------
  370|  2.41k|    if ((cur == NULL) || (cur == value))
  ------------------
  |  Branch (370:9): [True: 0, False: 2.41k]
  |  Branch (370:26): [True: 523, False: 1.88k]
  ------------------
  371|    523|        return(1);
  372|       |
  373|  1.88k|    if (space) {
  ------------------
  |  Branch (373:9): [True: 1.88k, False: 0]
  ------------------
  374|  1.88k|	while (IS_BLANK_CH(*cur))
  375|    970|            cur++;
  376|  1.88k|    }
  377|       |
  378|  1.88k|    return(*cur != 0);
  379|  2.41k|}
xmlNewNs:
  517|  3.80M|xmlNewNs(xmlNode *node, const xmlChar *href, const xmlChar *prefix) {
  518|  3.80M|    xmlNsPtr cur;
  519|       |
  520|  3.80M|    if ((node != NULL) && (node->type != XML_ELEMENT_NODE))
  ------------------
  |  Branch (520:9): [True: 56.5k, False: 3.74M]
  |  Branch (520:27): [True: 0, False: 56.5k]
  ------------------
  521|      0|	return(NULL);
  522|       |
  523|       |    /*
  524|       |     * Allocate a new Namespace and fill the fields.
  525|       |     */
  526|  3.80M|    cur = (xmlNsPtr) xmlMalloc(sizeof(xmlNs));
  527|  3.80M|    if (cur == NULL)
  ------------------
  |  Branch (527:9): [True: 48, False: 3.80M]
  ------------------
  528|     48|	return(NULL);
  529|  3.80M|    memset(cur, 0, sizeof(xmlNs));
  530|  3.80M|    cur->type = XML_LOCAL_NAMESPACE;
  ------------------
  |  |  500|  3.80M|#define XML_LOCAL_NAMESPACE XML_NAMESPACE_DECL
  ------------------
  531|       |
  532|  3.80M|    if (href != NULL) {
  ------------------
  |  Branch (532:9): [True: 3.78M, False: 19.4k]
  ------------------
  533|  3.78M|	cur->href = xmlStrdup(href);
  534|  3.78M|        if (cur->href == NULL)
  ------------------
  |  Branch (534:13): [True: 36, False: 3.78M]
  ------------------
  535|     36|            goto error;
  536|  3.78M|    }
  537|  3.80M|    if (prefix != NULL) {
  ------------------
  |  Branch (537:9): [True: 3.76M, False: 41.0k]
  ------------------
  538|  3.76M|	cur->prefix = xmlStrdup(prefix);
  539|  3.76M|        if (cur->prefix == NULL)
  ------------------
  |  Branch (539:13): [True: 29, False: 3.76M]
  ------------------
  540|     29|            goto error;
  541|  3.76M|    }
  542|       |
  543|       |    /*
  544|       |     * Add it at the end to preserve parsing order ...
  545|       |     * and checks for existing use of the prefix
  546|       |     */
  547|  3.80M|    if (node != NULL) {
  ------------------
  |  Branch (547:9): [True: 56.4k, False: 3.74M]
  ------------------
  548|  56.4k|	if (node->nsDef == NULL) {
  ------------------
  |  Branch (548:6): [True: 48.0k, False: 8.42k]
  ------------------
  549|  48.0k|	    node->nsDef = cur;
  550|  48.0k|	} else {
  551|  8.42k|	    xmlNsPtr prev = node->nsDef;
  552|       |
  553|  8.42k|	    if ((xmlStrEqual(prev->prefix, cur->prefix)) &&
  ------------------
  |  Branch (553:10): [True: 0, False: 8.42k]
  ------------------
  554|      0|                (prev->href != NULL))
  ------------------
  |  Branch (554:17): [True: 0, False: 0]
  ------------------
  555|      0|                goto error;
  556|  13.7k|	    while (prev->next != NULL) {
  ------------------
  |  Branch (556:13): [True: 5.33k, False: 8.42k]
  ------------------
  557|  5.33k|	        prev = prev->next;
  558|  5.33k|		if ((xmlStrEqual(prev->prefix, cur->prefix)) &&
  ------------------
  |  Branch (558:7): [True: 0, False: 5.33k]
  ------------------
  559|      0|                    (prev->href != NULL))
  ------------------
  |  Branch (559:21): [True: 0, False: 0]
  ------------------
  560|      0|                    goto error;
  561|  5.33k|	    }
  562|  8.42k|	    prev->next = cur;
  563|  8.42k|	}
  564|  56.4k|    }
  565|  3.80M|    return(cur);
  566|       |
  567|     65|error:
  568|     65|    xmlFreeNs(cur);
  569|       |    return(NULL);
  570|  3.80M|}
xmlSetNs:
  580|  51.6k|xmlSetNs(xmlNode *node, xmlNs *ns) {
  581|  51.6k|    if (node == NULL) {
  ------------------
  |  Branch (581:9): [True: 0, False: 51.6k]
  ------------------
  582|      0|	return;
  583|      0|    }
  584|  51.6k|    if ((node->type == XML_ELEMENT_NODE) ||
  ------------------
  |  Branch (584:9): [True: 51.6k, False: 0]
  ------------------
  585|      0|        (node->type == XML_ATTRIBUTE_NODE))
  ------------------
  |  Branch (585:9): [True: 0, False: 0]
  ------------------
  586|  51.6k|	node->ns = ns;
  587|  51.6k|}
xmlFreeNs:
  595|  3.81M|xmlFreeNs(xmlNs *cur) {
  596|  3.81M|    if (cur == NULL) {
  ------------------
  |  Branch (596:9): [True: 0, False: 3.81M]
  ------------------
  597|      0|	return;
  598|      0|    }
  599|  3.81M|    if (cur->href != NULL) xmlFree((char *) cur->href);
  ------------------
  |  Branch (599:9): [True: 3.79M, False: 19.5k]
  ------------------
  600|  3.81M|    if (cur->prefix != NULL) xmlFree((char *) cur->prefix);
  ------------------
  |  Branch (600:9): [True: 3.76M, False: 41.1k]
  ------------------
  601|  3.81M|    xmlFree(cur);
  602|  3.81M|}
xmlFreeNsList:
  610|  3.69M|xmlFreeNsList(xmlNs *cur) {
  611|  3.69M|    xmlNsPtr next;
  612|  3.69M|    if (cur == NULL) {
  ------------------
  |  Branch (612:9): [True: 32, False: 3.69M]
  ------------------
  613|     32|	return;
  614|     32|    }
  615|  7.50M|    while (cur != NULL) {
  ------------------
  |  Branch (615:12): [True: 3.81M, False: 3.69M]
  ------------------
  616|  3.81M|        next = cur->next;
  617|  3.81M|        xmlFreeNs(cur);
  618|  3.81M|	cur = next;
  619|  3.81M|    }
  620|  3.69M|}
xmlNewDtd:
  640|  7.18k|          const xmlChar *systemId) {
  641|  7.18k|    xmlDtdPtr cur;
  642|       |
  643|  7.18k|    if ((doc != NULL) && (doc->extSubset != NULL)) {
  ------------------
  |  Branch (643:9): [True: 1.21k, False: 5.97k]
  |  Branch (643:26): [True: 0, False: 1.21k]
  ------------------
  644|      0|	return(NULL);
  645|      0|    }
  646|       |
  647|       |    /*
  648|       |     * Allocate a new DTD and fill the fields.
  649|       |     */
  650|  7.18k|    cur = (xmlDtdPtr) xmlMalloc(sizeof(xmlDtd));
  651|  7.18k|    if (cur == NULL)
  ------------------
  |  Branch (651:9): [True: 11, False: 7.17k]
  ------------------
  652|     11|	return(NULL);
  653|  7.17k|    memset(cur, 0 , sizeof(xmlDtd));
  654|  7.17k|    cur->type = XML_DTD_NODE;
  655|       |
  656|  7.17k|    if (name != NULL) {
  ------------------
  |  Branch (656:9): [True: 7.17k, False: 0]
  ------------------
  657|  7.17k|	cur->name = xmlStrdup(name);
  658|  7.17k|        if (cur->name == NULL)
  ------------------
  |  Branch (658:13): [True: 10, False: 7.16k]
  ------------------
  659|     10|            goto error;
  660|  7.17k|    }
  661|  7.16k|    if (publicId != NULL) {
  ------------------
  |  Branch (661:9): [True: 325, False: 6.84k]
  ------------------
  662|    325|	cur->ExternalID = xmlStrdup(publicId);
  663|    325|        if (cur->ExternalID == NULL)
  ------------------
  |  Branch (663:13): [True: 1, False: 324]
  ------------------
  664|      1|            goto error;
  665|    325|    }
  666|  7.16k|    if (systemId != NULL) {
  ------------------
  |  Branch (666:9): [True: 1.65k, False: 5.51k]
  ------------------
  667|  1.65k|	cur->SystemID = xmlStrdup(systemId);
  668|  1.65k|        if (cur->SystemID == NULL)
  ------------------
  |  Branch (668:13): [True: 5, False: 1.64k]
  ------------------
  669|      5|            goto error;
  670|  1.65k|    }
  671|  7.16k|    if (doc != NULL)
  ------------------
  |  Branch (671:9): [True: 1.20k, False: 5.95k]
  ------------------
  672|  1.20k|	doc->extSubset = cur;
  673|  7.16k|    cur->doc = doc;
  674|       |
  675|  7.16k|    if ((xmlRegisterCallbacks) && (xmlRegisterNodeDefaultValue))
  ------------------
  |  |  932|      0|    (*__xmlRegisterNodeDefaultValue())
  ------------------
  |  Branch (675:9): [True: 0, False: 7.16k]
  |  Branch (675:35): [True: 0, False: 0]
  ------------------
  676|      0|	xmlRegisterNodeDefaultValue((xmlNodePtr)cur);
  ------------------
  |  |  932|      0|    (*__xmlRegisterNodeDefaultValue())
  ------------------
  677|  7.16k|    return(cur);
  678|       |
  679|     16|error:
  680|     16|    xmlFreeDtd(cur);
  681|       |    return(NULL);
  682|  7.16k|}
xmlGetIntSubset:
  691|  63.2k|xmlGetIntSubset(const xmlDoc *doc) {
  692|  63.2k|    xmlNodePtr cur;
  693|       |
  694|  63.2k|    if (doc == NULL)
  ------------------
  |  Branch (694:9): [True: 5.74k, False: 57.4k]
  ------------------
  695|  5.74k|	return(NULL);
  696|  57.4k|    cur = doc->children;
  697|  69.5k|    while (cur != NULL) {
  ------------------
  |  Branch (697:12): [True: 31.8k, False: 37.6k]
  ------------------
  698|  31.8k|	if (cur->type == XML_DTD_NODE)
  ------------------
  |  Branch (698:6): [True: 19.8k, False: 12.0k]
  ------------------
  699|  19.8k|	    return((xmlDtdPtr) cur);
  700|  12.0k|	cur = cur->next;
  701|  12.0k|    }
  702|  37.6k|    return((xmlDtdPtr) doc->intSubset);
  703|  57.4k|}
xmlCreateIntSubset:
  722|  16.1k|                   const xmlChar *systemId) {
  723|  16.1k|    xmlDtdPtr cur;
  724|       |
  725|  16.1k|    if (doc != NULL) {
  ------------------
  |  Branch (725:9): [True: 16.1k, False: 0]
  ------------------
  726|  16.1k|        cur = xmlGetIntSubset(doc);
  727|  16.1k|        if (cur != NULL)
  ------------------
  |  Branch (727:13): [True: 0, False: 16.1k]
  ------------------
  728|      0|            return(cur);
  729|  16.1k|    }
  730|       |
  731|       |    /*
  732|       |     * Allocate a new DTD and fill the fields.
  733|       |     */
  734|  16.1k|    cur = (xmlDtdPtr) xmlMalloc(sizeof(xmlDtd));
  735|  16.1k|    if (cur == NULL)
  ------------------
  |  Branch (735:9): [True: 6, False: 16.1k]
  ------------------
  736|      6|	return(NULL);
  737|  16.1k|    memset(cur, 0, sizeof(xmlDtd));
  738|  16.1k|    cur->type = XML_DTD_NODE;
  739|       |
  740|  16.1k|    if (name != NULL) {
  ------------------
  |  Branch (740:9): [True: 15.4k, False: 747]
  ------------------
  741|  15.4k|	cur->name = xmlStrdup(name);
  742|  15.4k|	if (cur->name == NULL)
  ------------------
  |  Branch (742:6): [True: 3, False: 15.4k]
  ------------------
  743|      3|            goto error;
  744|  15.4k|    }
  745|  16.1k|    if (publicId != NULL) {
  ------------------
  |  Branch (745:9): [True: 656, False: 15.5k]
  ------------------
  746|    656|	cur->ExternalID = xmlStrdup(publicId);
  747|    656|	if (cur->ExternalID  == NULL)
  ------------------
  |  Branch (747:6): [True: 1, False: 655]
  ------------------
  748|      1|            goto error;
  749|    656|    }
  750|  16.1k|    if (systemId != NULL) {
  ------------------
  |  Branch (750:9): [True: 2.33k, False: 13.8k]
  ------------------
  751|  2.33k|	cur->SystemID = xmlStrdup(systemId);
  752|  2.33k|	if (cur->SystemID == NULL)
  ------------------
  |  Branch (752:6): [True: 1, False: 2.33k]
  ------------------
  753|      1|            goto error;
  754|  2.33k|    }
  755|  16.1k|    if (doc != NULL) {
  ------------------
  |  Branch (755:9): [True: 16.1k, False: 0]
  ------------------
  756|  16.1k|	doc->intSubset = cur;
  757|  16.1k|	cur->parent = doc;
  758|  16.1k|	cur->doc = doc;
  759|  16.1k|	if (doc->children == NULL) {
  ------------------
  |  Branch (759:6): [True: 14.4k, False: 1.70k]
  ------------------
  760|  14.4k|	    doc->children = (xmlNodePtr) cur;
  761|  14.4k|	    doc->last = (xmlNodePtr) cur;
  762|  14.4k|	} else {
  763|  1.70k|	    if (doc->type == XML_HTML_DOCUMENT_NODE) {
  ------------------
  |  Branch (763:10): [True: 0, False: 1.70k]
  ------------------
  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|  1.70k|	    } else {
  771|  1.70k|		xmlNodePtr next;
  772|       |
  773|  1.70k|		next = doc->children;
  774|  4.03k|		while ((next != NULL) && (next->type != XML_ELEMENT_NODE))
  ------------------
  |  Branch (774:10): [True: 2.46k, False: 1.57k]
  |  Branch (774:28): [True: 2.33k, False: 129]
  ------------------
  775|  2.33k|		    next = next->next;
  776|  1.70k|		if (next == NULL) {
  ------------------
  |  Branch (776:7): [True: 1.57k, False: 129]
  ------------------
  777|  1.57k|		    cur->prev = doc->last;
  778|  1.57k|		    cur->prev->next = (xmlNodePtr) cur;
  779|  1.57k|		    cur->next = NULL;
  780|  1.57k|		    doc->last = (xmlNodePtr) cur;
  781|  1.57k|		} else {
  782|    129|		    cur->next = next;
  783|    129|		    cur->prev = next->prev;
  784|    129|		    if (cur->prev == NULL)
  ------------------
  |  Branch (784:11): [True: 120, False: 9]
  ------------------
  785|    120|			doc->children = (xmlNodePtr) cur;
  786|      9|		    else
  787|      9|			cur->prev->next = (xmlNodePtr) cur;
  788|    129|		    next->prev = (xmlNodePtr) cur;
  789|    129|		}
  790|  1.70k|	    }
  791|  1.70k|	}
  792|  16.1k|    }
  793|       |
  794|  16.1k|    if ((xmlRegisterCallbacks) && (xmlRegisterNodeDefaultValue))
  ------------------
  |  |  932|      0|    (*__xmlRegisterNodeDefaultValue())
  ------------------
  |  Branch (794:9): [True: 0, False: 16.1k]
  |  Branch (794:35): [True: 0, False: 0]
  ------------------
  795|      0|	xmlRegisterNodeDefaultValue((xmlNodePtr)cur);
  ------------------
  |  |  932|      0|    (*__xmlRegisterNodeDefaultValue())
  ------------------
  796|  16.1k|    return(cur);
  797|       |
  798|      5|error:
  799|      5|    xmlFreeDtd(cur);
  800|       |    return(NULL);
  801|  16.1k|}
xmlFreeDtd:
  820|  23.3k|xmlFreeDtd(xmlDtd *cur) {
  821|  23.3k|    xmlDictPtr dict = NULL;
  822|       |
  823|  23.3k|    if (cur == NULL) {
  ------------------
  |  Branch (823:9): [True: 0, False: 23.3k]
  ------------------
  824|      0|	return;
  825|      0|    }
  826|  23.3k|    if (cur->doc != NULL) dict = cur->doc->dict;
  ------------------
  |  Branch (826:9): [True: 17.3k, False: 5.97k]
  ------------------
  827|       |
  828|  23.3k|    if ((xmlRegisterCallbacks) && (xmlDeregisterNodeDefaultValue))
  ------------------
  |  |  934|      0|    (*__xmlDeregisterNodeDefaultValue())
  ------------------
  |  Branch (828:9): [True: 0, False: 23.3k]
  |  Branch (828:35): [True: 0, False: 0]
  ------------------
  829|      0|	xmlDeregisterNodeDefaultValue((xmlNodePtr)cur);
  ------------------
  |  |  934|      0|    (*__xmlDeregisterNodeDefaultValue())
  ------------------
  830|       |
  831|  23.3k|    if (cur->children != NULL) {
  ------------------
  |  Branch (831:9): [True: 15.7k, False: 7.56k]
  ------------------
  832|  15.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|   360k|        while (c != NULL) {
  ------------------
  |  Branch (838:16): [True: 344k, False: 15.7k]
  ------------------
  839|   344k|	    next = c->next;
  840|   344k|	    if ((c->type != XML_ELEMENT_DECL) &&
  ------------------
  |  Branch (840:10): [True: 331k, False: 13.5k]
  ------------------
  841|   331k|		(c->type != XML_ATTRIBUTE_DECL) &&
  ------------------
  |  Branch (841:3): [True: 302k, False: 28.8k]
  ------------------
  842|   302k|		(c->type != XML_ENTITY_DECL)) {
  ------------------
  |  Branch (842:3): [True: 282k, False: 19.8k]
  ------------------
  843|   282k|		xmlUnlinkNodeInternal(c);
  844|   282k|		xmlFreeNode(c);
  845|   282k|	    }
  846|   344k|	    c = next;
  847|   344k|	}
  848|  15.7k|    }
  849|       |
  850|  23.3k|    DICT_FREE(cur->name)
  ------------------
  |  |  810|  23.3k|	if ((str) && ((!dict) ||				\
  |  |  ------------------
  |  |  |  Branch (810:6): [True: 22.5k, False: 760]
  |  |  |  Branch (810:16): [True: 13.1k, False: 9.44k]
  |  |  ------------------
  |  |  811|  22.5k|	    (xmlDictOwns(dict, (const xmlChar *)(str)) == 0)))	\
  |  |  ------------------
  |  |  |  Branch (811:6): [True: 9.44k, False: 0]
  |  |  ------------------
  |  |  812|  23.3k|	    xmlFree((char *)(str));
  ------------------
  851|       |
  852|  23.3k|    if (cur->SystemID != NULL)
  ------------------
  |  Branch (852:9): [True: 3.97k, False: 19.3k]
  ------------------
  853|  3.97k|        xmlFree(cur->SystemID);
  854|  23.3k|    if (cur->ExternalID != NULL)
  ------------------
  |  Branch (854:9): [True: 979, False: 22.3k]
  ------------------
  855|    979|        xmlFree(cur->ExternalID);
  856|       |
  857|       |    /* TODO !!! */
  858|  23.3k|    if (cur->notations != NULL)
  ------------------
  |  Branch (858:9): [True: 1.11k, False: 22.2k]
  ------------------
  859|  1.11k|        xmlFreeNotationTable((xmlNotationTablePtr) cur->notations);
  860|       |
  861|  23.3k|    if (cur->elements != NULL)
  ------------------
  |  Branch (861:9): [True: 11.0k, False: 12.2k]
  ------------------
  862|  11.0k|        xmlFreeElementTable((xmlElementTablePtr) cur->elements);
  863|  23.3k|    if (cur->attributes != NULL)
  ------------------
  |  Branch (863:9): [True: 7.22k, False: 16.1k]
  ------------------
  864|  7.22k|        xmlFreeAttributeTable((xmlAttributeTablePtr) cur->attributes);
  865|  23.3k|    if (cur->entities != NULL)
  ------------------
  |  Branch (865:9): [True: 5.66k, False: 17.6k]
  ------------------
  866|  5.66k|        xmlFreeEntitiesTable((xmlEntitiesTablePtr) cur->entities);
  867|  23.3k|    if (cur->pentities != NULL)
  ------------------
  |  Branch (867:9): [True: 3.14k, False: 20.2k]
  ------------------
  868|  3.14k|        xmlFreeEntitiesTable((xmlEntitiesTablePtr) cur->pentities);
  869|       |
  870|  23.3k|    xmlFree(cur);
  871|  23.3k|}
xmlNewDoc:
  880|  37.4k|xmlNewDoc(const xmlChar *version) {
  881|  37.4k|    xmlDocPtr cur;
  882|       |
  883|  37.4k|    if (version == NULL)
  ------------------
  |  Branch (883:9): [True: 470, False: 37.0k]
  ------------------
  884|    470|	version = (const xmlChar *) "1.0";
  885|       |
  886|       |    /*
  887|       |     * Allocate a new document and fill the fields.
  888|       |     */
  889|  37.4k|    cur = (xmlDocPtr) xmlMalloc(sizeof(xmlDoc));
  890|  37.4k|    if (cur == NULL)
  ------------------
  |  Branch (890:9): [True: 7, False: 37.4k]
  ------------------
  891|      7|	return(NULL);
  892|  37.4k|    memset(cur, 0, sizeof(xmlDoc));
  893|  37.4k|    cur->type = XML_DOCUMENT_NODE;
  894|       |
  895|  37.4k|    cur->version = xmlStrdup(version);
  896|  37.4k|    if (cur->version == NULL) {
  ------------------
  |  Branch (896:9): [True: 11, False: 37.4k]
  ------------------
  897|     11|	xmlFree(cur);
  898|     11|	return(NULL);
  899|     11|    }
  900|  37.4k|    cur->standalone = -1;
  901|  37.4k|    cur->compression = -1; /* not initialized */
  902|  37.4k|    cur->doc = cur;
  903|  37.4k|    cur->parseFlags = 0;
  904|  37.4k|    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|  37.4k|    cur->charset = XML_CHAR_ENCODING_UTF8;
  911|       |
  912|  37.4k|    if ((xmlRegisterCallbacks) && (xmlRegisterNodeDefaultValue))
  ------------------
  |  |  932|      0|    (*__xmlRegisterNodeDefaultValue())
  ------------------
  |  Branch (912:9): [True: 0, False: 37.4k]
  |  Branch (912:35): [True: 0, False: 0]
  ------------------
  913|      0|	xmlRegisterNodeDefaultValue((xmlNodePtr)cur);
  ------------------
  |  |  932|      0|    (*__xmlRegisterNodeDefaultValue())
  ------------------
  914|  37.4k|    return(cur);
  915|  37.4k|}
xmlFreeDoc:
  923|  11.3k|xmlFreeDoc(xmlDoc *cur) {
  924|  11.3k|    xmlDtdPtr extSubset, intSubset;
  925|  11.3k|    xmlDictPtr dict = NULL;
  926|       |
  927|  11.3k|    if (cur == NULL) {
  ------------------
  |  Branch (927:9): [True: 1.40k, False: 9.90k]
  ------------------
  928|  1.40k|	return;
  929|  1.40k|    }
  930|       |
  931|  9.90k|    dict = cur->dict;
  932|       |
  933|  9.90k|    if ((xmlRegisterCallbacks) && (xmlDeregisterNodeDefaultValue))
  ------------------
  |  |  934|      0|    (*__xmlDeregisterNodeDefaultValue())
  ------------------
  |  Branch (933:9): [True: 0, False: 9.90k]
  |  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|  9.90k|    if (cur->ids != NULL) xmlFreeIDTable((xmlIDTablePtr) cur->ids);
  ------------------
  |  Branch (939:9): [True: 176, False: 9.72k]
  ------------------
  940|  9.90k|    cur->ids = NULL;
  941|  9.90k|    if (cur->refs != NULL) xmlFreeRefTable((xmlRefTablePtr) cur->refs);
  ------------------
  |  Branch (941:9): [True: 266, False: 9.63k]
  ------------------
  942|  9.90k|    cur->refs = NULL;
  943|  9.90k|    extSubset = cur->extSubset;
  944|  9.90k|    intSubset = cur->intSubset;
  945|  9.90k|    if (intSubset == extSubset)
  ------------------
  |  Branch (945:9): [True: 6.26k, False: 3.64k]
  ------------------
  946|  6.26k|	extSubset = NULL;
  947|  9.90k|    if (extSubset != NULL) {
  ------------------
  |  Branch (947:9): [True: 137, False: 9.76k]
  ------------------
  948|    137|	xmlUnlinkNodeInternal((xmlNodePtr) cur->extSubset);
  949|    137|	cur->extSubset = NULL;
  950|    137|	xmlFreeDtd(extSubset);
  951|    137|    }
  952|  9.90k|    if (intSubset != NULL) {
  ------------------
  |  Branch (952:9): [True: 3.66k, False: 6.24k]
  ------------------
  953|  3.66k|	xmlUnlinkNodeInternal((xmlNodePtr) cur->intSubset);
  954|  3.66k|	cur->intSubset = NULL;
  955|  3.66k|	xmlFreeDtd(intSubset);
  956|  3.66k|    }
  957|       |
  958|  9.90k|    if (cur->children != NULL) xmlFreeNodeList(cur->children);
  ------------------
  |  Branch (958:9): [True: 9.32k, False: 577]
  ------------------
  959|  9.90k|    if (cur->oldNs != NULL) xmlFreeNsList(cur->oldNs);
  ------------------
  |  Branch (959:9): [True: 1.35k, False: 8.55k]
  ------------------
  960|       |
  961|  9.90k|    DICT_FREE(cur->name)
  ------------------
  |  |  810|  9.90k|	if ((str) && ((!dict) ||				\
  |  |  ------------------
  |  |  |  Branch (810:6): [True: 0, False: 9.90k]
  |  |  |  Branch (810:16): [True: 0, False: 0]
  |  |  ------------------
  |  |  811|      0|	    (xmlDictOwns(dict, (const xmlChar *)(str)) == 0)))	\
  |  |  ------------------
  |  |  |  Branch (811:6): [True: 0, False: 0]
  |  |  ------------------
  |  |  812|  9.90k|	    xmlFree((char *)(str));
  ------------------
  962|       |
  963|  9.90k|    if (cur->version != NULL)
  ------------------
  |  Branch (963:9): [True: 9.90k, False: 0]
  ------------------
  964|  9.90k|        xmlFree(cur->version);
  965|  9.90k|    if (cur->encoding != NULL)
  ------------------
  |  Branch (965:9): [True: 96, False: 9.80k]
  ------------------
  966|     96|        xmlFree(cur->encoding);
  967|  9.90k|    if (cur->URL != NULL)
  ------------------
  |  Branch (967:9): [True: 6.65k, False: 3.25k]
  ------------------
  968|  6.65k|        xmlFree(cur->URL);
  969|       |
  970|  9.90k|    xmlFree(cur);
  971|  9.90k|    if (dict) xmlDictFree(dict);
  ------------------
  |  Branch (971:9): [True: 5.20k, False: 4.70k]
  ------------------
  972|  9.90k|}
xmlNodeParseAttValue:
  998|  69.0k|                     const xmlChar *value, size_t len, xmlNode **listPtr) {
  999|  69.0k|    xmlNodePtr head = NULL, last = NULL;
 1000|  69.0k|    xmlNodePtr node;
 1001|  69.0k|    xmlChar *val = NULL;
 1002|  69.0k|    const xmlChar *cur;
 1003|  69.0k|    const xmlChar *q;
 1004|  69.0k|    xmlEntityPtr ent;
 1005|  69.0k|    xmlBufPtr buf;
 1006|  69.0k|    size_t remaining = len;
 1007|       |
 1008|  69.0k|    if (listPtr != NULL)
  ------------------
  |  Branch (1008:9): [True: 0, False: 69.0k]
  ------------------
 1009|      0|        *listPtr = NULL;
 1010|       |
 1011|  69.0k|    if ((value == NULL) || (value[0] == 0))
  ------------------
  |  Branch (1011:9): [True: 0, False: 69.0k]
  |  Branch (1011:28): [True: 3.53k, False: 65.4k]
  ------------------
 1012|  3.53k|        goto done;
 1013|       |
 1014|  65.4k|    cur = value;
 1015|       |
 1016|  65.4k|    buf = xmlBufCreate(50);
 1017|  65.4k|    if (buf == NULL)
  ------------------
  |  Branch (1017:9): [True: 26, False: 65.4k]
  ------------------
 1018|     26|        return(-1);
 1019|       |
 1020|  65.4k|    q = cur;
 1021|  71.5M|    while ((remaining > 0) && (*cur != 0)) {
  ------------------
  |  Branch (1021:12): [True: 71.4M, False: 34.8k]
  |  Branch (1021:31): [True: 71.4M, False: 30.4k]
  ------------------
 1022|  71.4M|	if (cur[0] == '&') {
  ------------------
  |  Branch (1022:6): [True: 34.7k, False: 71.4M]
  ------------------
 1023|  34.7k|	    int charval = 0;
 1024|       |
 1025|       |	    /*
 1026|       |	     * Save the current text.
 1027|       |	     */
 1028|  34.7k|            if (cur != q) {
  ------------------
  |  Branch (1028:17): [True: 21.3k, False: 13.4k]
  ------------------
 1029|  21.3k|		if (xmlBufAdd(buf, q, cur - q))
  ------------------
  |  Branch (1029:7): [True: 1, False: 21.3k]
  ------------------
 1030|      1|		    goto out;
 1031|  21.3k|	        q = cur;
 1032|  21.3k|	    }
 1033|       |
 1034|  34.7k|	    if ((remaining > 2) && (cur[1] == '#') && (cur[2] == 'x')) {
  ------------------
  |  Branch (1034:10): [True: 34.7k, False: 0]
  |  Branch (1034:29): [True: 14.3k, False: 20.4k]
  |  Branch (1034:48): [True: 6.71k, False: 7.59k]
  ------------------
 1035|  6.71k|	        int tmp = 0;
 1036|       |
 1037|  6.71k|		cur += 3;
 1038|  6.71k|                remaining -= 3;
 1039|  28.2k|		while ((remaining > 0) && ((tmp = *cur) != ';')) {
  ------------------
  |  Branch (1039:10): [True: 28.2k, False: 0]
  |  Branch (1039:29): [True: 21.5k, False: 6.71k]
  ------------------
 1040|  21.5k|		    if ((tmp >= '0') && (tmp <= '9'))
  ------------------
  |  Branch (1040:11): [True: 21.5k, False: 0]
  |  Branch (1040:27): [True: 476, False: 21.0k]
  ------------------
 1041|    476|			charval = charval * 16 + (tmp - '0');
 1042|  21.0k|		    else if ((tmp >= 'a') && (tmp <= 'f'))
  ------------------
  |  Branch (1042:16): [True: 6.54k, False: 14.5k]
  |  Branch (1042:32): [True: 6.54k, False: 0]
  ------------------
 1043|  6.54k|			charval = charval * 16 + (tmp - 'a') + 10;
 1044|  14.5k|		    else if ((tmp >= 'A') && (tmp <= 'F'))
  ------------------
  |  Branch (1044:16): [True: 14.5k, False: 0]
  |  Branch (1044:32): [True: 14.5k, False: 0]
  ------------------
 1045|  14.5k|			charval = charval * 16 + (tmp - 'A') + 10;
 1046|      0|		    else {
 1047|      0|			charval = 0;
 1048|      0|			break;
 1049|      0|		    }
 1050|  21.5k|                    if (charval > 0x110000)
  ------------------
  |  Branch (1050:25): [True: 0, False: 21.5k]
  ------------------
 1051|      0|                        charval = 0x110000;
 1052|  21.5k|		    cur++;
 1053|  21.5k|                    remaining--;
 1054|  21.5k|		}
 1055|  6.71k|		if (tmp == ';') {
  ------------------
  |  Branch (1055:7): [True: 6.71k, False: 0]
  ------------------
 1056|  6.71k|		    cur++;
 1057|  6.71k|                    remaining--;
 1058|  6.71k|                }
 1059|  6.71k|		q = cur;
 1060|  28.0k|	    } else if ((remaining > 1) && (cur[1] == '#')) {
  ------------------
  |  Branch (1060:17): [True: 28.0k, False: 0]
  |  Branch (1060:36): [True: 7.59k, False: 20.4k]
  ------------------
 1061|  7.59k|	        int tmp = 0;
 1062|       |
 1063|  7.59k|		cur += 2;
 1064|  7.59k|                remaining -= 2;
 1065|  22.7k|		while ((remaining > 0) && ((tmp = *cur) != ';')) {
  ------------------
  |  Branch (1065:10): [True: 22.7k, False: 0]
  |  Branch (1065:29): [True: 15.2k, False: 7.59k]
  ------------------
 1066|  15.2k|		    if ((tmp >= '0') && (tmp <= '9'))
  ------------------
  |  Branch (1066:11): [True: 15.2k, False: 0]
  |  Branch (1066:27): [True: 15.2k, False: 0]
  ------------------
 1067|  15.2k|			charval = charval * 10 + (tmp - '0');
 1068|      0|		    else {
 1069|      0|			charval = 0;
 1070|      0|			break;
 1071|      0|		    }
 1072|  15.2k|                    if (charval > 0x110000)
  ------------------
  |  Branch (1072:25): [True: 0, False: 15.2k]
  ------------------
 1073|      0|                        charval = 0x110000;
 1074|  15.2k|		    cur++;
 1075|  15.2k|                    remaining--;
 1076|  15.2k|		}
 1077|  7.59k|		if (tmp == ';') {
  ------------------
  |  Branch (1077:7): [True: 7.59k, False: 0]
  ------------------
 1078|  7.59k|		    cur++;
 1079|  7.59k|                    remaining--;
 1080|  7.59k|                }
 1081|  7.59k|		q = cur;
 1082|  20.4k|	    } else {
 1083|       |		/*
 1084|       |		 * Read the entity string
 1085|       |		 */
 1086|  20.4k|		cur++;
 1087|  20.4k|                remaining--;
 1088|  20.4k|		q = cur;
 1089|   118k|		while ((remaining > 0) && (*cur != 0) && (*cur != ';')) {
  ------------------
  |  Branch (1089:10): [True: 118k, False: 0]
  |  Branch (1089:29): [True: 118k, False: 0]
  |  Branch (1089:44): [True: 98.4k, False: 20.4k]
  ------------------
 1090|  98.4k|                    cur++;
 1091|  98.4k|                    remaining--;
 1092|  98.4k|                }
 1093|  20.4k|		if ((remaining <= 0) || (*cur == 0))
  ------------------
  |  Branch (1093:7): [True: 0, False: 20.4k]
  |  Branch (1093:27): [True: 0, False: 20.4k]
  ------------------
 1094|      0|		    break;
 1095|  20.4k|		if (cur != q) {
  ------------------
  |  Branch (1095:7): [True: 20.4k, False: 0]
  ------------------
 1096|  20.4k|		    val = xmlStrndup(q, cur - q);
 1097|  20.4k|                    if (val == NULL)
  ------------------
  |  Branch (1097:25): [True: 8, False: 20.4k]
  ------------------
 1098|      8|                        goto out;
 1099|  20.4k|		    ent = xmlGetDocEntity(doc, val);
 1100|  20.4k|		    if ((ent != NULL) &&
  ------------------
  |  Branch (1100:11): [True: 13.5k, False: 6.87k]
  ------------------
 1101|  13.5k|			(ent->etype == XML_INTERNAL_PREDEFINED_ENTITY)) {
  ------------------
  |  Branch (1101:4): [True: 171, False: 13.3k]
  ------------------
 1102|       |                        /*
 1103|       |                         * Predefined entities don't generate nodes
 1104|       |                         */
 1105|    171|			if (xmlBufCat(buf, ent->content))
  ------------------
  |  Branch (1105:8): [True: 1, False: 170]
  ------------------
 1106|      1|			    goto out;
 1107|  20.2k|                    } else if (ent == NULL ||
  ------------------
  |  Branch (1107:32): [True: 6.87k, False: 13.3k]
  ------------------
 1108|  20.2k|                               (ent->flags & XML_ENT_EXPANDING) == 0) {
  ------------------
  |  |   22|  13.3k|#define XML_ENT_EXPANDING   (1u << 3)
  ------------------
  |  Branch (1108:32): [True: 13.3k, False: 0]
  ------------------
 1109|       |			/*
 1110|       |			 * Flush buffer so far
 1111|       |			 */
 1112|  20.2k|			if (!xmlBufIsEmpty(buf)) {
  ------------------
  |  Branch (1112:8): [True: 14.1k, False: 6.16k]
  ------------------
 1113|  14.1k|			    node = xmlNewDocText(doc, NULL);
 1114|  14.1k|			    if (node == NULL)
  ------------------
  |  Branch (1114:12): [True: 4, False: 14.1k]
  ------------------
 1115|      4|				goto out;
 1116|  14.1k|			    node->content = xmlBufDetach(buf);
 1117|  14.1k|                            node->parent = (xmlNode *) attr;
 1118|       |
 1119|  14.1k|			    if (last == NULL) {
  ------------------
  |  Branch (1119:12): [True: 517, False: 13.5k]
  ------------------
 1120|    517|				head = node;
 1121|  13.5k|			    } else {
 1122|  13.5k|                                last->next = node;
 1123|  13.5k|                                node->prev = last;
 1124|  13.5k|			    }
 1125|  14.1k|                            last = node;
 1126|  14.1k|			}
 1127|       |
 1128|  20.2k|			if ((ent != NULL) &&
  ------------------
  |  Branch (1128:8): [True: 13.3k, False: 6.86k]
  ------------------
 1129|  13.3k|                            ((ent->flags & XML_ENT_PARSED) == 0) &&
  ------------------
  |  |   19|  13.3k|#define XML_ENT_PARSED      (1u << 0)
  ------------------
  |  Branch (1129:29): [True: 878, False: 12.5k]
  ------------------
 1130|    878|                            (ent->content != NULL)) {
  ------------------
  |  Branch (1130:29): [True: 757, False: 121]
  ------------------
 1131|    757|                            int res;
 1132|       |
 1133|    757|                            ent->flags |= XML_ENT_EXPANDING;
  ------------------
  |  |   22|    757|#define XML_ENT_EXPANDING   (1u << 3)
  ------------------
 1134|    757|                            res = xmlNodeParseAttValue(doc, (xmlAttr *) ent,
 1135|    757|                                                       ent->content, SIZE_MAX,
 1136|    757|                                                       NULL);
 1137|    757|                            ent->flags &= ~XML_ENT_EXPANDING;
  ------------------
  |  |   22|    757|#define XML_ENT_EXPANDING   (1u << 3)
  ------------------
 1138|    757|                            if (res < 0)
  ------------------
  |  Branch (1138:33): [True: 89, False: 668]
  ------------------
 1139|     89|                                goto out;
 1140|    668|                            ent->flags |= XML_ENT_PARSED;
  ------------------
  |  |   19|    668|#define XML_ENT_PARSED      (1u << 0)
  ------------------
 1141|    668|			}
 1142|       |
 1143|       |			/*
 1144|       |			 * Create a new REFERENCE_REF node
 1145|       |			 */
 1146|  20.1k|			node = xmlNewEntityRef((xmlDocPtr) doc, val);
 1147|  20.1k|                        val = NULL;
 1148|  20.1k|			if (node == NULL)
  ------------------
  |  Branch (1148:8): [True: 4, False: 20.1k]
  ------------------
 1149|      4|			    goto out;
 1150|  20.1k|                        node->parent = (xmlNode *) attr;
 1151|  20.1k|                        node->last = (xmlNodePtr) ent;
 1152|  20.1k|                        if (ent != NULL) {
  ------------------
  |  Branch (1152:29): [True: 13.3k, False: 6.86k]
  ------------------
 1153|  13.3k|                            node->children = (xmlNodePtr) ent;
 1154|  13.3k|                            node->content = ent->content;
 1155|  13.3k|                        }
 1156|       |
 1157|  20.1k|			if (last == NULL) {
  ------------------
  |  Branch (1157:8): [True: 1.77k, False: 18.3k]
  ------------------
 1158|  1.77k|			    head = node;
 1159|  18.3k|			} else {
 1160|  18.3k|                            last->next = node;
 1161|  18.3k|                            node->prev = last;
 1162|  18.3k|			}
 1163|  20.1k|                        last = node;
 1164|  20.1k|		    }
 1165|  20.3k|		    xmlFree(val);
 1166|  20.3k|                    val = NULL;
 1167|  20.3k|		}
 1168|  20.3k|		cur++;
 1169|  20.3k|                remaining--;
 1170|  20.3k|		q = cur;
 1171|  20.3k|	    }
 1172|  34.6k|	    if (charval != 0) {
  ------------------
  |  Branch (1172:10): [True: 14.3k, False: 20.3k]
  ------------------
 1173|  14.3k|		xmlChar buffer[10];
 1174|  14.3k|		int l;
 1175|       |
 1176|  14.3k|                if (charval >= 0x110000)
  ------------------
  |  Branch (1176:21): [True: 0, False: 14.3k]
  ------------------
 1177|      0|                    charval = 0xFFFD; /* replacement character */
 1178|       |
 1179|  14.3k|		l = xmlCopyCharMultiByte(buffer, charval);
 1180|  14.3k|		buffer[l] = 0;
 1181|       |
 1182|  14.3k|		if (xmlBufCat(buf, buffer))
  ------------------
  |  Branch (1182:7): [True: 1, False: 14.3k]
  ------------------
 1183|      1|		    goto out;
 1184|  14.3k|	    }
 1185|  71.4M|	} else {
 1186|  71.4M|	    cur++;
 1187|  71.4M|            remaining--;
 1188|  71.4M|        }
 1189|  71.4M|    }
 1190|       |
 1191|  65.3k|    if (cur != q) {
  ------------------
  |  Branch (1191:9): [True: 63.6k, False: 1.69k]
  ------------------
 1192|       |        /*
 1193|       |	 * Handle the last piece of text.
 1194|       |	 */
 1195|  63.6k|	if (xmlBufAdd(buf, q, cur - q))
  ------------------
  |  Branch (1195:6): [True: 4, False: 63.6k]
  ------------------
 1196|      4|	    goto out;
 1197|  63.6k|    }
 1198|       |
 1199|  65.3k|    if (!xmlBufIsEmpty(buf)) {
  ------------------
  |  Branch (1199:9): [True: 64.2k, False: 1.04k]
  ------------------
 1200|  64.2k|	node = xmlNewDocText(doc, NULL);
 1201|  64.2k|	if (node == NULL)
  ------------------
  |  Branch (1201:6): [True: 18, False: 64.2k]
  ------------------
 1202|     18|            goto out;
 1203|  64.2k|        node->parent = (xmlNode *) attr;
 1204|  64.2k|	node->content = xmlBufDetach(buf);
 1205|       |
 1206|  64.2k|	if (last == NULL) {
  ------------------
  |  Branch (1206:6): [True: 63.0k, False: 1.20k]
  ------------------
 1207|  63.0k|	    head = node;
 1208|  63.0k|	} else {
 1209|  1.20k|            last->next = node;
 1210|  1.20k|            node->prev = last;
 1211|  1.20k|	}
 1212|  64.2k|        last = node;
 1213|  64.2k|    } else if (head == NULL) {
  ------------------
  |  Branch (1213:16): [True: 0, False: 1.04k]
  ------------------
 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|  65.3k|    xmlBufFree(buf);
 1222|       |
 1223|  68.8k|done:
 1224|  68.8k|    if (attr != NULL) {
  ------------------
  |  Branch (1224:9): [True: 68.8k, False: 0]
  ------------------
 1225|  68.8k|        if (attr->children != NULL)
  ------------------
  |  Branch (1225:13): [True: 0, False: 68.8k]
  ------------------
 1226|      0|            xmlFreeNodeList(attr->children);
 1227|  68.8k|        attr->children = head;
 1228|  68.8k|        attr->last = last;
 1229|  68.8k|    }
 1230|       |
 1231|  68.8k|    if (listPtr != NULL)
  ------------------
  |  Branch (1231:9): [True: 0, False: 68.8k]
  ------------------
 1232|      0|        *listPtr = head;
 1233|       |
 1234|  68.8k|    return(0);
 1235|       |
 1236|    130|out:
 1237|    130|    xmlBufFree(buf);
 1238|    130|    if (val != NULL)
  ------------------
  |  Branch (1238:9): [True: 94, False: 36]
  ------------------
 1239|     94|        xmlFree(val);
 1240|    130|    if (head != NULL)
  ------------------
  |  Branch (1240:9): [True: 48, False: 82]
  ------------------
 1241|     48|        xmlFreeNodeList(head);
 1242|    130|    return(-1);
 1243|  65.3k|}
xmlNodeListGetStringInternal:
 1297|  1.16k|xmlNodeListGetStringInternal(const xmlNode *node, int escape, int flags) {
 1298|  1.16k|    xmlBufPtr buf;
 1299|  1.16k|    xmlChar *ret;
 1300|       |
 1301|  1.16k|    if (node == NULL)
  ------------------
  |  Branch (1301:9): [True: 0, False: 1.16k]
  ------------------
 1302|      0|        return(xmlStrdup(BAD_CAST ""));
  ------------------
  |  |   34|      0|#define BAD_CAST (xmlChar *)
  ------------------
 1303|       |
 1304|  1.16k|    if ((escape == 0) &&
  ------------------
  |  Branch (1304:9): [True: 1.16k, False: 0]
  ------------------
 1305|  1.16k|        ((node->type == XML_TEXT_NODE) ||
  ------------------
  |  Branch (1305:10): [True: 954, False: 208]
  ------------------
 1306|    208|         (node->type == XML_CDATA_SECTION_NODE)) &&
  ------------------
  |  Branch (1306:10): [True: 0, False: 208]
  ------------------
 1307|    954|        (node->next == NULL)) {
  ------------------
  |  Branch (1307:9): [True: 660, False: 294]
  ------------------
 1308|    660|        if (node->content == NULL)
  ------------------
  |  Branch (1308:13): [True: 0, False: 660]
  ------------------
 1309|      0|            return(xmlStrdup(BAD_CAST ""));
  ------------------
  |  |   34|      0|#define BAD_CAST (xmlChar *)
  ------------------
 1310|    660|        return(xmlStrdup(node->content));
 1311|    660|    }
 1312|       |
 1313|    502|    buf = xmlBufCreate(50);
 1314|    502|    if (buf == NULL)
  ------------------
  |  Branch (1314:9): [True: 5, False: 497]
  ------------------
 1315|      5|        return(NULL);
 1316|       |
 1317|  1.45k|    while (node != NULL) {
  ------------------
  |  Branch (1317:12): [True: 953, False: 497]
  ------------------
 1318|    953|        if ((node->type == XML_TEXT_NODE) ||
  ------------------
  |  Branch (1318:13): [True: 380, False: 573]
  ------------------
 1319|    573|            (node->type == XML_CDATA_SECTION_NODE)) {
  ------------------
  |  Branch (1319:13): [True: 0, False: 573]
  ------------------
 1320|    380|            if (node->content != NULL) {
  ------------------
  |  Branch (1320:17): [True: 380, False: 0]
  ------------------
 1321|    380|                if (escape == 0) {
  ------------------
  |  Branch (1321:21): [True: 380, False: 0]
  ------------------
 1322|    380|                    xmlBufCat(buf, node->content);
 1323|    380|                } 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|    380|            }
 1333|    573|        } else if (node->type == XML_ENTITY_REF_NODE) {
  ------------------
  |  Branch (1333:20): [True: 573, False: 0]
  ------------------
 1334|    573|            if (escape == 0) {
  ------------------
  |  Branch (1334:17): [True: 573, False: 0]
  ------------------
 1335|    573|                xmlBufGetNodeContent(buf, node);
 1336|    573|            } 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|    573|        }
 1342|       |
 1343|    953|        node = node->next;
 1344|    953|    }
 1345|       |
 1346|    497|    ret = xmlBufDetach(buf);
 1347|    497|    xmlBufFree(buf);
 1348|    497|    return(ret);
 1349|       |
 1350|      0|error:
 1351|      0|    xmlBufFree(buf);
 1352|       |    return(NULL);
 1353|    497|}
xmlNodeListGetString:
 1374|  1.16k|{
 1375|  1.16k|    int flags = 0;
 1376|  1.16k|    int escape = 0;
 1377|       |
 1378|       |    /* backward compatibility */
 1379|  1.16k|    if (list == NULL)
  ------------------
  |  Branch (1379:9): [True: 0, False: 1.16k]
  ------------------
 1380|      0|        return(NULL);
 1381|       |
 1382|  1.16k|    if (!inLine) {
  ------------------
  |  Branch (1382:9): [True: 0, False: 1.16k]
  ------------------
 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.16k|    return(xmlNodeListGetStringInternal(list, escape, flags));
 1396|  1.16k|}
xmlNewNsProp:
 1572|  64.5k|           const xmlChar *value) {
 1573|       |
 1574|  64.5k|    if (name == NULL) {
  ------------------
  |  Branch (1574:9): [True: 0, False: 64.5k]
  ------------------
 1575|      0|	return(NULL);
 1576|      0|    }
 1577|       |
 1578|  64.5k|    return xmlNewPropInternal(node, ns, name, value, 0);
 1579|  64.5k|}
xmlNewDocProp:
 1621|   894k|xmlNewDocProp(xmlDoc *doc, const xmlChar *name, const xmlChar *value) {
 1622|   894k|    xmlAttrPtr cur;
 1623|       |
 1624|   894k|    if (name == NULL) {
  ------------------
  |  Branch (1624:9): [True: 1.70k, False: 892k]
  ------------------
 1625|  1.70k|	return(NULL);
 1626|  1.70k|    }
 1627|       |
 1628|       |    /*
 1629|       |     * Allocate a new property and fill the fields.
 1630|       |     */
 1631|   892k|    cur = (xmlAttrPtr) xmlMalloc(sizeof(xmlAttr));
 1632|   892k|    if (cur == NULL)
  ------------------
  |  Branch (1632:9): [True: 17, False: 892k]
  ------------------
 1633|     17|	return(NULL);
 1634|   892k|    memset(cur, 0, sizeof(xmlAttr));
 1635|   892k|    cur->type = XML_ATTRIBUTE_NODE;
 1636|       |
 1637|   892k|    if ((doc != NULL) && (doc->dict != NULL))
  ------------------
  |  Branch (1637:9): [True: 892k, False: 95]
  |  Branch (1637:26): [True: 794k, False: 97.8k]
  ------------------
 1638|   794k|	cur->name = xmlDictLookup(doc->dict, name, -1);
 1639|  97.9k|    else
 1640|  97.9k|	cur->name = xmlStrdup(name);
 1641|   892k|    if (cur->name == NULL)
  ------------------
  |  Branch (1641:9): [True: 13, False: 892k]
  ------------------
 1642|     13|        goto error;
 1643|   892k|    cur->doc = doc;
 1644|   892k|    if (value != NULL) {
  ------------------
  |  Branch (1644:9): [True: 0, False: 892k]
  ------------------
 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|   892k|    if ((xmlRegisterCallbacks) && (xmlRegisterNodeDefaultValue))
  ------------------
  |  |  932|      0|    (*__xmlRegisterNodeDefaultValue())
  ------------------
  |  Branch (1653:9): [True: 0, False: 892k]
  |  Branch (1653:35): [True: 0, False: 0]
  ------------------
 1654|      0|	xmlRegisterNodeDefaultValue((xmlNodePtr)cur);
  ------------------
  |  |  932|      0|    (*__xmlRegisterNodeDefaultValue())
  ------------------
 1655|   892k|    return(cur);
 1656|       |
 1657|     13|error:
 1658|     13|    xmlFreeProp(cur);
 1659|       |    return(NULL);
 1660|   892k|}
xmlFreePropList:
 1668|   673k|xmlFreePropList(xmlAttr *cur) {
 1669|   673k|    xmlAttrPtr next;
 1670|   673k|    if (cur == NULL) return;
  ------------------
  |  Branch (1670:9): [True: 1.12k, False: 672k]
  ------------------
 1671|  1.45M|    while (cur != NULL) {
  ------------------
  |  Branch (1671:12): [True: 778k, False: 672k]
  ------------------
 1672|   778k|        next = cur->next;
 1673|   778k|        xmlFreeProp(cur);
 1674|   778k|	cur = next;
 1675|   778k|    }
 1676|   672k|}
xmlFreeProp:
 1684|   779k|xmlFreeProp(xmlAttr *cur) {
 1685|   779k|    xmlDictPtr dict = NULL;
 1686|   779k|    if (cur == NULL) return;
  ------------------
  |  Branch (1686:9): [True: 0, False: 779k]
  ------------------
 1687|       |
 1688|   779k|    if (cur->doc != NULL) dict = cur->doc->dict;
  ------------------
  |  Branch (1688:9): [True: 779k, False: 108]
  ------------------
 1689|       |
 1690|   779k|    if ((xmlRegisterCallbacks) && (xmlDeregisterNodeDefaultValue))
  ------------------
  |  |  934|      0|    (*__xmlDeregisterNodeDefaultValue())
  ------------------
  |  Branch (1690:9): [True: 0, False: 779k]
  |  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|   779k|    if (cur->doc != NULL && cur->id != NULL) {
  ------------------
  |  Branch (1694:9): [True: 779k, False: 108]
  |  Branch (1694:29): [True: 1.46k, False: 778k]
  ------------------
 1695|  1.46k|        xmlRemoveID(cur->doc, cur);
 1696|  1.46k|    }
 1697|   779k|    if (cur->children != NULL) xmlFreeNodeList(cur->children);
  ------------------
  |  Branch (1697:9): [True: 755k, False: 24.8k]
  ------------------
 1698|   779k|    DICT_FREE(cur->name)
  ------------------
  |  |  810|   779k|	if ((str) && ((!dict) ||				\
  |  |  ------------------
  |  |  |  Branch (810:6): [True: 779k, False: 45]
  |  |  |  Branch (810:16): [True: 159k, False: 620k]
  |  |  ------------------
  |  |  811|   779k|	    (xmlDictOwns(dict, (const xmlChar *)(str)) == 0)))	\
  |  |  ------------------
  |  |  |  Branch (811:6): [True: 0, False: 620k]
  |  |  ------------------
  |  |  812|   779k|	    xmlFree((char *)(str));
  ------------------
 1699|   779k|    xmlFree(cur);
 1700|   779k|}
xmlNewDocPI:
 1753|  77.5k|xmlNewDocPI(xmlDoc *doc, const xmlChar *name, const xmlChar *content) {
 1754|  77.5k|    xmlNodePtr cur;
 1755|       |
 1756|  77.5k|    if (name == NULL) {
  ------------------
  |  Branch (1756:9): [True: 0, False: 77.5k]
  ------------------
 1757|      0|	return(NULL);
 1758|      0|    }
 1759|       |
 1760|       |    /*
 1761|       |     * Allocate a new node and fill the fields.
 1762|       |     */
 1763|  77.5k|    cur = (xmlNodePtr) xmlMalloc(sizeof(xmlNode));
 1764|  77.5k|    if (cur == NULL)
  ------------------
  |  Branch (1764:9): [True: 5, False: 77.5k]
  ------------------
 1765|      5|	return(NULL);
 1766|  77.5k|    memset(cur, 0, sizeof(xmlNode));
 1767|  77.5k|    cur->type = XML_PI_NODE;
 1768|  77.5k|    cur->doc = doc;
 1769|       |
 1770|  77.5k|    if ((doc != NULL) && (doc->dict != NULL))
  ------------------
  |  Branch (1770:9): [True: 77.5k, False: 0]
  |  Branch (1770:26): [True: 44.0k, False: 33.5k]
  ------------------
 1771|  44.0k|        cur->name = xmlDictLookup(doc->dict, name, -1);
 1772|  33.5k|    else
 1773|  33.5k|	cur->name = xmlStrdup(name);
 1774|  77.5k|    if (cur->name == NULL)
  ------------------
  |  Branch (1774:9): [True: 1, False: 77.5k]
  ------------------
 1775|      1|        goto error;
 1776|  77.5k|    if (content != NULL) {
  ------------------
  |  Branch (1776:9): [True: 18.5k, False: 59.0k]
  ------------------
 1777|  18.5k|	cur->content = xmlStrdup(content);
 1778|  18.5k|        if (cur->content == NULL)
  ------------------
  |  Branch (1778:13): [True: 3, False: 18.5k]
  ------------------
 1779|      3|            goto error;
 1780|  18.5k|    }
 1781|       |
 1782|  77.5k|    if ((xmlRegisterCallbacks) && (xmlRegisterNodeDefaultValue))
  ------------------
  |  |  932|      0|    (*__xmlRegisterNodeDefaultValue())
  ------------------
  |  Branch (1782:9): [True: 0, False: 77.5k]
  |  Branch (1782:35): [True: 0, False: 0]
  ------------------
 1783|      0|	xmlRegisterNodeDefaultValue((xmlNodePtr)cur);
  ------------------
  |  |  932|      0|    (*__xmlRegisterNodeDefaultValue())
  ------------------
 1784|  77.5k|    return(cur);
 1785|       |
 1786|      4|error:
 1787|      4|    xmlFreeNode(cur);
 1788|       |    return(NULL);
 1789|  77.5k|}
xmlNewDocNode:
 1900|   442k|              const xmlChar *name, const xmlChar *content) {
 1901|   442k|    xmlNodePtr cur;
 1902|   442k|    xmlChar *copy;
 1903|       |
 1904|   442k|    if (name == NULL)
  ------------------
  |  Branch (1904:9): [True: 0, False: 442k]
  ------------------
 1905|      0|        return(NULL);
 1906|       |
 1907|   442k|    if ((doc != NULL) && (doc->dict != NULL)) {
  ------------------
  |  Branch (1907:9): [True: 442k, False: 0]
  |  Branch (1907:26): [True: 111k, False: 331k]
  ------------------
 1908|   111k|        const xmlChar *dictName = xmlDictLookup(doc->dict, name, -1);
 1909|       |
 1910|   111k|        if (dictName == NULL)
  ------------------
  |  Branch (1910:13): [True: 1, False: 111k]
  ------------------
 1911|      1|            return(NULL);
 1912|   111k|        return(xmlNewElem(doc, ns, dictName, content));
 1913|   111k|    }
 1914|       |
 1915|   331k|    copy = xmlStrdup(name);
 1916|   331k|    if (copy == NULL)
  ------------------
  |  Branch (1916:9): [True: 33, False: 331k]
  ------------------
 1917|     33|        return(NULL);
 1918|       |
 1919|   331k|    cur = xmlNewElem(doc, ns, copy, content);
 1920|   331k|    if (cur == NULL) {
  ------------------
  |  Branch (1920:9): [True: 32, False: 331k]
  ------------------
 1921|     32|        xmlFree(copy);
 1922|     32|        return(NULL);
 1923|     32|    }
 1924|       |
 1925|   331k|    return(cur);
 1926|   331k|}
xmlNewDocNodeEatName:
 1944|   218k|                     xmlChar *name, const xmlChar *content) {
 1945|   218k|    xmlNodePtr cur;
 1946|       |
 1947|   218k|    if (name == NULL)
  ------------------
  |  Branch (1947:9): [True: 0, False: 218k]
  ------------------
 1948|      0|        return(NULL);
 1949|       |
 1950|   218k|    cur = xmlNewElem(doc, ns, name, content);
 1951|   218k|    if (cur == NULL) {
  ------------------
  |  Branch (1951:9): [True: 32, False: 218k]
  ------------------
 1952|       |        /* if name doesn't come from the doc dictionary free it here */
 1953|     32|        if ((doc == NULL) ||
  ------------------
  |  Branch (1953:13): [True: 0, False: 32]
  ------------------
 1954|     32|            (doc->dict == NULL) ||
  ------------------
  |  Branch (1954:13): [True: 1, False: 31]
  ------------------
 1955|     31|            (!xmlDictOwns(doc->dict, name)))
  ------------------
  |  Branch (1955:13): [True: 0, False: 31]
  ------------------
 1956|      1|            xmlFree(name);
 1957|     32|        return(NULL);
 1958|     32|    }
 1959|       |
 1960|   218k|    return(cur);
 1961|   218k|}
xmlNewText:
 2037|   111k|xmlNewText(const xmlChar *content) {
 2038|   111k|    xmlNodePtr cur;
 2039|       |
 2040|       |    /*
 2041|       |     * Allocate a new node and fill the fields.
 2042|       |     */
 2043|   111k|    cur = (xmlNodePtr) xmlMalloc(sizeof(xmlNode));
 2044|   111k|    if (cur == NULL)
  ------------------
  |  Branch (2044:9): [True: 40, False: 111k]
  ------------------
 2045|     40|	return(NULL);
 2046|   111k|    memset(cur, 0, sizeof(xmlNode));
 2047|   111k|    cur->type = XML_TEXT_NODE;
 2048|       |
 2049|   111k|    cur->name = xmlStringText;
 2050|   111k|    if (content != NULL) {
  ------------------
  |  Branch (2050:9): [True: 33.0k, False: 78.5k]
  ------------------
 2051|  33.0k|	cur->content = xmlStrdup(content);
 2052|  33.0k|        if (cur->content == NULL)
  ------------------
  |  Branch (2052:13): [True: 15, False: 32.9k]
  ------------------
 2053|     15|            goto error;
 2054|  33.0k|    }
 2055|       |
 2056|   111k|    if ((xmlRegisterCallbacks) && (xmlRegisterNodeDefaultValue))
  ------------------
  |  |  932|      0|    (*__xmlRegisterNodeDefaultValue())
  ------------------
  |  Branch (2056:9): [True: 0, False: 111k]
  |  Branch (2056:35): [True: 0, False: 0]
  ------------------
 2057|      0|	xmlRegisterNodeDefaultValue(cur);
  ------------------
  |  |  932|      0|    (*__xmlRegisterNodeDefaultValue())
  ------------------
 2058|   111k|    return(cur);
 2059|       |
 2060|     15|error:
 2061|     15|    xmlFreeNode(cur);
 2062|       |    return(NULL);
 2063|   111k|}
xmlNewReference:
 2209|  39.3k|xmlNewReference(const xmlDoc *doc, const xmlChar *name) {
 2210|  39.3k|    xmlNodePtr cur;
 2211|  39.3k|    xmlEntityPtr ent;
 2212|       |
 2213|  39.3k|    if (name == NULL)
  ------------------
  |  Branch (2213:9): [True: 0, False: 39.3k]
  ------------------
 2214|      0|        return(NULL);
 2215|       |
 2216|       |    /*
 2217|       |     * Allocate a new node and fill the fields.
 2218|       |     */
 2219|  39.3k|    cur = (xmlNodePtr) xmlMalloc(sizeof(xmlNode));
 2220|  39.3k|    if (cur == NULL)
  ------------------
  |  Branch (2220:9): [True: 4, False: 39.3k]
  ------------------
 2221|      4|	return(NULL);
 2222|  39.3k|    memset(cur, 0, sizeof(xmlNode));
 2223|  39.3k|    cur->type = XML_ENTITY_REF_NODE;
 2224|       |
 2225|  39.3k|    cur->doc = (xmlDoc *)doc;
 2226|  39.3k|    if (name[0] == '&') {
  ------------------
  |  Branch (2226:9): [True: 0, False: 39.3k]
  ------------------
 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|  39.3k|	cur->name = xmlStrdup(name);
 2236|  39.3k|    if (cur->name == NULL)
  ------------------
  |  Branch (2236:9): [True: 2, False: 39.3k]
  ------------------
 2237|      2|        goto error;
 2238|       |
 2239|  39.3k|    ent = xmlGetDocEntity(doc, cur->name);
 2240|  39.3k|    if (ent != NULL) {
  ------------------
  |  Branch (2240:9): [True: 4.99k, False: 34.3k]
  ------------------
 2241|  4.99k|	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|  4.99k|	cur->children = (xmlNodePtr) ent;
 2248|  4.99k|	cur->last = (xmlNodePtr) ent;
 2249|  4.99k|    }
 2250|       |
 2251|  39.3k|    if ((xmlRegisterCallbacks) && (xmlRegisterNodeDefaultValue))
  ------------------
  |  |  932|      0|    (*__xmlRegisterNodeDefaultValue())
  ------------------
  |  Branch (2251:9): [True: 0, False: 39.3k]
  |  Branch (2251:35): [True: 0, False: 0]
  ------------------
 2252|      0|	xmlRegisterNodeDefaultValue(cur);
  ------------------
  |  |  932|      0|    (*__xmlRegisterNodeDefaultValue())
  ------------------
 2253|  39.3k|    return(cur);
 2254|       |
 2255|      2|error:
 2256|      2|    xmlFreeNode(cur);
 2257|       |    return(NULL);
 2258|  39.3k|}
xmlNewDocText:
 2269|   111k|xmlNewDocText(const xmlDoc *doc, const xmlChar *content) {
 2270|   111k|    xmlNodePtr cur;
 2271|       |
 2272|   111k|    cur = xmlNewText(content);
 2273|   111k|    if (cur != NULL) cur->doc = (xmlDoc *)doc;
  ------------------
  |  Branch (2273:9): [True: 111k, False: 55]
  ------------------
 2274|   111k|    return(cur);
 2275|   111k|}
xmlNewComment:
 2342|   382k|xmlNewComment(const xmlChar *content) {
 2343|   382k|    xmlNodePtr cur;
 2344|       |
 2345|       |    /*
 2346|       |     * Allocate a new node and fill the fields.
 2347|       |     */
 2348|   382k|    cur = (xmlNodePtr) xmlMalloc(sizeof(xmlNode));
 2349|   382k|    if (cur == NULL)
  ------------------
  |  Branch (2349:9): [True: 3, False: 382k]
  ------------------
 2350|      3|	return(NULL);
 2351|   382k|    memset(cur, 0, sizeof(xmlNode));
 2352|   382k|    cur->type = XML_COMMENT_NODE;
 2353|       |
 2354|   382k|    cur->name = xmlStringComment;
 2355|   382k|    if (content != NULL) {
  ------------------
  |  Branch (2355:9): [True: 382k, False: 0]
  ------------------
 2356|   382k|	cur->content = xmlStrdup(content);
 2357|   382k|        if (cur->content == NULL)
  ------------------
  |  Branch (2357:13): [True: 5, False: 382k]
  ------------------
 2358|      5|            goto error;
 2359|   382k|    }
 2360|       |
 2361|   382k|    if ((xmlRegisterCallbacks) && (xmlRegisterNodeDefaultValue))
  ------------------
  |  |  932|      0|    (*__xmlRegisterNodeDefaultValue())
  ------------------
  |  Branch (2361:9): [True: 0, False: 382k]
  |  Branch (2361:35): [True: 0, False: 0]
  ------------------
 2362|      0|	xmlRegisterNodeDefaultValue(cur);
  ------------------
  |  |  932|      0|    (*__xmlRegisterNodeDefaultValue())
  ------------------
 2363|   382k|    return(cur);
 2364|       |
 2365|      5|error:
 2366|      5|    xmlFreeNode(cur);
 2367|       |    return(NULL);
 2368|   382k|}
xmlNewCDataBlock:
 2380|  26.2k|xmlNewCDataBlock(xmlDoc *doc, const xmlChar *content, int len) {
 2381|  26.2k|    xmlNodePtr cur;
 2382|       |
 2383|       |    /*
 2384|       |     * Allocate a new node and fill the fields.
 2385|       |     */
 2386|  26.2k|    cur = (xmlNodePtr) xmlMalloc(sizeof(xmlNode));
 2387|  26.2k|    if (cur == NULL)
  ------------------
  |  Branch (2387:9): [True: 1, False: 26.2k]
  ------------------
 2388|      1|	return(NULL);
 2389|  26.2k|    memset(cur, 0, sizeof(xmlNode));
 2390|  26.2k|    cur->type = XML_CDATA_SECTION_NODE;
 2391|  26.2k|    cur->doc = doc;
 2392|       |
 2393|  26.2k|    if (content != NULL) {
  ------------------
  |  Branch (2393:9): [True: 26.2k, False: 0]
  ------------------
 2394|  26.2k|	cur->content = xmlStrndup(content, len);
 2395|  26.2k|        if (cur->content == NULL) {
  ------------------
  |  Branch (2395:13): [True: 4, False: 26.2k]
  ------------------
 2396|      4|            xmlFree(cur);
 2397|      4|            return(NULL);
 2398|      4|        }
 2399|  26.2k|    }
 2400|       |
 2401|  26.2k|    if ((xmlRegisterCallbacks) && (xmlRegisterNodeDefaultValue))
  ------------------
  |  |  932|      0|    (*__xmlRegisterNodeDefaultValue())
  ------------------
  |  Branch (2401:9): [True: 0, False: 26.2k]
  |  Branch (2401:35): [True: 0, False: 0]
  ------------------
 2402|      0|	xmlRegisterNodeDefaultValue(cur);
  ------------------
  |  |  932|      0|    (*__xmlRegisterNodeDefaultValue())
  ------------------
 2403|  26.2k|    return(cur);
 2404|  26.2k|}
xmlNewDocComment:
 2415|   382k|xmlNewDocComment(xmlDoc *doc, const xmlChar *content) {
 2416|   382k|    xmlNodePtr cur;
 2417|       |
 2418|   382k|    cur = xmlNewComment(content);
 2419|   382k|    if (cur != NULL) cur->doc = doc;
  ------------------
  |  Branch (2419:9): [True: 382k, False: 8]
  ------------------
 2420|   382k|    return(cur);
 2421|   382k|}
xmlAddNextSibling:
 2893|  9.88k|xmlAddNextSibling(xmlNode *prev, xmlNode *cur) {
 2894|  9.88k|    if ((prev == NULL) || (prev->type == XML_NAMESPACE_DECL) ||
  ------------------
  |  Branch (2894:9): [True: 0, False: 9.88k]
  |  Branch (2894:27): [True: 0, False: 9.88k]
  ------------------
 2895|  9.88k|        (cur == NULL) || (cur->type == XML_NAMESPACE_DECL) ||
  ------------------
  |  Branch (2895:9): [True: 0, False: 9.88k]
  |  Branch (2895:26): [True: 0, False: 9.88k]
  ------------------
 2896|  9.88k|        (cur == prev))
  ------------------
  |  Branch (2896:9): [True: 0, False: 9.88k]
  ------------------
 2897|      0|	return(NULL);
 2898|       |
 2899|  9.88k|    if (cur == prev->next)
  ------------------
  |  Branch (2899:9): [True: 0, False: 9.88k]
  ------------------
 2900|      0|        return(cur);
 2901|       |
 2902|  9.88k|    return(xmlInsertNode(prev->doc, cur, prev->parent, prev, prev->next, 0));
 2903|  9.88k|}
xmlAddPrevSibling:
 2922|   149k|xmlAddPrevSibling(xmlNode *next, xmlNode *cur) {
 2923|   149k|    if ((next == NULL) || (next->type == XML_NAMESPACE_DECL) ||
  ------------------
  |  Branch (2923:9): [True: 0, False: 149k]
  |  Branch (2923:27): [True: 0, False: 149k]
  ------------------
 2924|   149k|        (cur == NULL) || (cur->type == XML_NAMESPACE_DECL) ||
  ------------------
  |  Branch (2924:9): [True: 0, False: 149k]
  |  Branch (2924:26): [True: 0, False: 149k]
  ------------------
 2925|   149k|        (cur == next))
  ------------------
  |  Branch (2925:9): [True: 0, False: 149k]
  ------------------
 2926|      0|	return(NULL);
 2927|       |
 2928|   149k|    if (cur == next->prev)
  ------------------
  |  Branch (2928:9): [True: 0, False: 149k]
  ------------------
 2929|      0|        return(cur);
 2930|       |
 2931|   149k|    return(xmlInsertNode(next->doc, cur, next->parent, next->prev, next, 0));
 2932|   149k|}
xmlGetLastChild:
 3141|  10.5k|xmlGetLastChild(const xmlNode *parent) {
 3142|  10.5k|    if ((parent == NULL) || (parent->type == XML_NAMESPACE_DECL)) {
  ------------------
  |  Branch (3142:9): [True: 0, False: 10.5k]
  |  Branch (3142:29): [True: 0, False: 10.5k]
  ------------------
 3143|      0|	return(NULL);
 3144|      0|    }
 3145|  10.5k|    return(parent->last);
 3146|  10.5k|}
xmlFreeNodeList:
 3328|   782k|xmlFreeNodeList(xmlNode *cur) {
 3329|   782k|    xmlNodePtr next;
 3330|   782k|    xmlNodePtr parent;
 3331|   782k|    xmlDictPtr dict = NULL;
 3332|   782k|    size_t depth = 0;
 3333|       |
 3334|   782k|    if (cur == NULL) return;
  ------------------
  |  Branch (3334:9): [True: 6.78k, False: 776k]
  ------------------
 3335|   776k|    if (cur->type == XML_NAMESPACE_DECL) {
  ------------------
  |  Branch (3335:9): [True: 0, False: 776k]
  ------------------
 3336|      0|	xmlFreeNsList((xmlNsPtr) cur);
 3337|      0|	return;
 3338|      0|    }
 3339|   776k|    if (cur->doc != NULL) dict = cur->doc->dict;
  ------------------
  |  Branch (3339:9): [True: 775k, False: 618]
  ------------------
 3340|  9.51M|    while (1) {
  ------------------
  |  Branch (3340:12): [True: 9.51M, Folded]
  ------------------
 3341|  13.0M|        while ((cur->children != NULL) &&
  ------------------
  |  Branch (3341:16): [True: 3.55M, False: 9.51M]
  ------------------
 3342|  3.55M|               (cur->type != XML_DOCUMENT_NODE) &&
  ------------------
  |  Branch (3342:16): [True: 3.55M, False: 0]
  ------------------
 3343|  3.55M|               (cur->type != XML_HTML_DOCUMENT_NODE) &&
  ------------------
  |  Branch (3343:16): [True: 3.55M, False: 0]
  ------------------
 3344|  3.55M|               (cur->type != XML_DTD_NODE) &&
  ------------------
  |  Branch (3344:16): [True: 3.55M, False: 0]
  ------------------
 3345|  3.55M|               (cur->type != XML_ENTITY_REF_NODE)) {
  ------------------
  |  Branch (3345:16): [True: 3.55M, False: 5.66k]
  ------------------
 3346|  3.55M|            cur = cur->children;
 3347|  3.55M|            depth += 1;
 3348|  3.55M|        }
 3349|       |
 3350|  9.51M|        next = cur->next;
 3351|  9.51M|        parent = cur->parent;
 3352|  9.51M|	if ((cur->type == XML_DOCUMENT_NODE) ||
  ------------------
  |  Branch (3352:6): [True: 0, False: 9.51M]
  ------------------
 3353|  9.51M|            (cur->type == XML_HTML_DOCUMENT_NODE)) {
  ------------------
  |  Branch (3353:13): [True: 0, False: 9.51M]
  ------------------
 3354|      0|            xmlFreeDoc((xmlDocPtr) cur);
 3355|  9.51M|        } else if (cur->type == XML_DTD_NODE) {
  ------------------
  |  Branch (3355:20): [True: 0, False: 9.51M]
  ------------------
 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|  9.51M|        } else {
 3363|  9.51M|	    if ((xmlRegisterCallbacks) && (xmlDeregisterNodeDefaultValue))
  ------------------
  |  |  934|      0|    (*__xmlDeregisterNodeDefaultValue())
  ------------------
  |  Branch (3363:10): [True: 0, False: 9.51M]
  |  Branch (3363:36): [True: 0, False: 0]
  ------------------
 3364|      0|		xmlDeregisterNodeDefaultValue(cur);
  ------------------
  |  |  934|      0|    (*__xmlDeregisterNodeDefaultValue())
  ------------------
 3365|       |
 3366|  9.51M|	    if (((cur->type == XML_ELEMENT_NODE) ||
  ------------------
  |  Branch (3366:11): [True: 4.48M, False: 5.02M]
  ------------------
 3367|  5.02M|		 (cur->type == XML_XINCLUDE_START) ||
  ------------------
  |  Branch (3367:4): [True: 36.0k, False: 4.99M]
  ------------------
 3368|  4.99M|		 (cur->type == XML_XINCLUDE_END)) &&
  ------------------
  |  Branch (3368:4): [True: 1.50M, False: 3.48M]
  ------------------
 3369|  6.02M|		(cur->properties != NULL))
  ------------------
  |  Branch (3369:3): [True: 666k, False: 5.36M]
  ------------------
 3370|   666k|		xmlFreePropList(cur->properties);
 3371|  9.51M|	    if ((cur->type != XML_ELEMENT_NODE) &&
  ------------------
  |  Branch (3371:10): [True: 5.02M, False: 4.48M]
  ------------------
 3372|  5.02M|		(cur->type != XML_XINCLUDE_START) &&
  ------------------
  |  Branch (3372:3): [True: 4.99M, False: 36.0k]
  ------------------
 3373|  4.99M|		(cur->type != XML_XINCLUDE_END) &&
  ------------------
  |  Branch (3373:3): [True: 3.48M, False: 1.50M]
  ------------------
 3374|  3.48M|		(cur->type != XML_ENTITY_REF_NODE) &&
  ------------------
  |  Branch (3374:3): [True: 3.38M, False: 104k]
  ------------------
 3375|  3.38M|		(cur->content != (xmlChar *) &(cur->properties))) {
  ------------------
  |  Branch (3375:3): [True: 3.26M, False: 117k]
  ------------------
 3376|  3.26M|		DICT_FREE(cur->content)
  ------------------
  |  |  810|  3.26M|	if ((str) && ((!dict) ||				\
  |  |  ------------------
  |  |  |  Branch (810:6): [True: 3.15M, False: 116k]
  |  |  |  Branch (810:16): [True: 820k, False: 2.33M]
  |  |  ------------------
  |  |  811|  3.15M|	    (xmlDictOwns(dict, (const xmlChar *)(str)) == 0)))	\
  |  |  ------------------
  |  |  |  Branch (811:6): [True: 2.32M, False: 452]
  |  |  ------------------
  |  |  812|  3.26M|	    xmlFree((char *)(str));
  ------------------
 3377|  3.26M|	    }
 3378|  9.51M|	    if (((cur->type == XML_ELEMENT_NODE) ||
  ------------------
  |  Branch (3378:11): [True: 4.48M, False: 5.02M]
  ------------------
 3379|  5.02M|	         (cur->type == XML_XINCLUDE_START) ||
  ------------------
  |  Branch (3379:11): [True: 36.0k, False: 4.99M]
  ------------------
 3380|  4.99M|		 (cur->type == XML_XINCLUDE_END)) &&
  ------------------
  |  Branch (3380:4): [True: 1.50M, False: 3.48M]
  ------------------
 3381|  6.02M|		(cur->nsDef != NULL))
  ------------------
  |  Branch (3381:3): [True: 1.66M, False: 4.36M]
  ------------------
 3382|  1.66M|		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|  9.51M|	    if ((cur->name != NULL) &&
  ------------------
  |  Branch (3390:10): [True: 9.44M, False: 75.7k]
  ------------------
 3391|  9.44M|		(cur->type != XML_TEXT_NODE) &&
  ------------------
  |  Branch (3391:3): [True: 6.31M, False: 3.12M]
  ------------------
 3392|  6.31M|		(cur->type != XML_COMMENT_NODE))
  ------------------
  |  Branch (3392:3): [True: 6.25M, False: 65.8k]
  ------------------
 3393|  6.25M|		DICT_FREE(cur->name)
  ------------------
  |  |  810|  6.25M|	if ((str) && ((!dict) ||				\
  |  |  ------------------
  |  |  |  Branch (810:6): [True: 6.25M, False: 0]
  |  |  |  Branch (810:16): [True: 737k, False: 5.51M]
  |  |  ------------------
  |  |  811|  6.25M|	    (xmlDictOwns(dict, (const xmlChar *)(str)) == 0)))	\
  |  |  ------------------
  |  |  |  Branch (811:6): [True: 25.9k, False: 5.48M]
  |  |  ------------------
  |  |  812|  6.25M|	    xmlFree((char *)(str));
  ------------------
 3394|  9.51M|	    xmlFree(cur);
 3395|  9.51M|	}
 3396|       |
 3397|  9.51M|        if (next != NULL) {
  ------------------
  |  Branch (3397:13): [True: 5.18M, False: 4.32M]
  ------------------
 3398|  5.18M|	    cur = next;
 3399|  5.18M|        } else {
 3400|  4.32M|            if ((depth == 0) || (parent == NULL))
  ------------------
  |  Branch (3400:17): [True: 776k, False: 3.55M]
  |  Branch (3400:33): [True: 0, False: 3.55M]
  ------------------
 3401|   776k|                break;
 3402|  3.55M|            depth -= 1;
 3403|  3.55M|            cur = parent;
 3404|       |            cur->children = NULL;
 3405|  3.55M|        }
 3406|  9.51M|    }
 3407|   776k|}
xmlFreeNode:
 3418|   330k|xmlFreeNode(xmlNode *cur) {
 3419|   330k|    xmlDictPtr dict = NULL;
 3420|       |
 3421|   330k|    if (cur == NULL) return;
  ------------------
  |  Branch (3421:9): [True: 86, False: 330k]
  ------------------
 3422|       |
 3423|       |    /* use xmlFreeDtd for DTD nodes */
 3424|   330k|    if (cur->type == XML_DTD_NODE) {
  ------------------
  |  Branch (3424:9): [True: 5.74k, False: 324k]
  ------------------
 3425|  5.74k|	xmlFreeDtd((xmlDtdPtr) cur);
 3426|  5.74k|	return;
 3427|  5.74k|    }
 3428|   324k|    if (cur->type == XML_NAMESPACE_DECL) {
  ------------------
  |  Branch (3428:9): [True: 0, False: 324k]
  ------------------
 3429|      0|	xmlFreeNs((xmlNsPtr) cur);
 3430|      0|        return;
 3431|      0|    }
 3432|   324k|    if (cur->type == XML_ATTRIBUTE_NODE) {
  ------------------
  |  Branch (3432:9): [True: 0, False: 324k]
  ------------------
 3433|      0|	xmlFreeProp((xmlAttrPtr) cur);
 3434|      0|	return;
 3435|      0|    }
 3436|   324k|    if (cur->type == XML_ENTITY_DECL) {
  ------------------
  |  Branch (3436:9): [True: 0, False: 324k]
  ------------------
 3437|      0|        xmlFreeEntity((xmlEntityPtr) cur);
 3438|      0|        return;
 3439|      0|    }
 3440|       |
 3441|   324k|    if ((xmlRegisterCallbacks) && (xmlDeregisterNodeDefaultValue))
  ------------------
  |  |  934|      0|    (*__xmlDeregisterNodeDefaultValue())
  ------------------
  |  Branch (3441:9): [True: 0, False: 324k]
  |  Branch (3441:35): [True: 0, False: 0]
  ------------------
 3442|      0|	xmlDeregisterNodeDefaultValue(cur);
  ------------------
  |  |  934|      0|    (*__xmlDeregisterNodeDefaultValue())
  ------------------
 3443|       |
 3444|   324k|    if (cur->doc != NULL) dict = cur->doc->dict;
  ------------------
  |  Branch (3444:9): [True: 324k, False: 193]
  ------------------
 3445|       |
 3446|   324k|    if ((cur->children != NULL) &&
  ------------------
  |  Branch (3446:9): [True: 7.51k, False: 316k]
  ------------------
 3447|  7.51k|	(cur->type != XML_ENTITY_REF_NODE))
  ------------------
  |  Branch (3447:2): [True: 7.00k, False: 511]
  ------------------
 3448|  7.00k|	xmlFreeNodeList(cur->children);
 3449|       |
 3450|   324k|    if ((cur->type == XML_ELEMENT_NODE) ||
  ------------------
  |  Branch (3450:9): [True: 25.5k, False: 298k]
  ------------------
 3451|   298k|        (cur->type == XML_XINCLUDE_START) ||
  ------------------
  |  Branch (3451:9): [True: 790, False: 298k]
  ------------------
 3452|   298k|        (cur->type == XML_XINCLUDE_END)) {
  ------------------
  |  Branch (3452:9): [True: 389, False: 297k]
  ------------------
 3453|  26.7k|        if (cur->properties != NULL)
  ------------------
  |  Branch (3453:13): [True: 4.72k, False: 21.9k]
  ------------------
 3454|  4.72k|            xmlFreePropList(cur->properties);
 3455|  26.7k|        if (cur->nsDef != NULL)
  ------------------
  |  Branch (3455:13): [True: 4.69k, False: 22.0k]
  ------------------
 3456|  4.69k|            xmlFreeNsList(cur->nsDef);
 3457|   297k|    } else if ((cur->content != NULL) &&
  ------------------
  |  Branch (3457:16): [True: 293k, False: 4.11k]
  ------------------
 3458|   293k|               (cur->type != XML_ENTITY_REF_NODE) &&
  ------------------
  |  Branch (3458:16): [True: 293k, False: 213]
  ------------------
 3459|   293k|               (cur->content != (xmlChar *) &(cur->properties))) {
  ------------------
  |  Branch (3459:16): [True: 292k, False: 1.12k]
  ------------------
 3460|   292k|        DICT_FREE(cur->content)
  ------------------
  |  |  810|   292k|	if ((str) && ((!dict) ||				\
  |  |  ------------------
  |  |  |  Branch (810:6): [True: 292k, False: 0]
  |  |  |  Branch (810:16): [True: 44.0k, False: 248k]
  |  |  ------------------
  |  |  811|   292k|	    (xmlDictOwns(dict, (const xmlChar *)(str)) == 0)))	\
  |  |  ------------------
  |  |  |  Branch (811:6): [True: 248k, False: 263]
  |  |  ------------------
  |  |  812|   292k|	    xmlFree((char *)(str));
  ------------------
 3461|   292k|    }
 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|   324k|    if ((cur->name != NULL) &&
  ------------------
  |  Branch (3468:9): [True: 323k, False: 825]
  ------------------
 3469|   323k|        (cur->type != XML_TEXT_NODE) &&
  ------------------
  |  Branch (3469:9): [True: 311k, False: 11.6k]
  ------------------
 3470|   311k|        (cur->type != XML_COMMENT_NODE))
  ------------------
  |  Branch (3470:9): [True: 42.6k, False: 269k]
  ------------------
 3471|  42.6k|	DICT_FREE(cur->name)
  ------------------
  |  |  810|  42.6k|	if ((str) && ((!dict) ||				\
  |  |  ------------------
  |  |  |  Branch (810:6): [True: 42.6k, False: 0]
  |  |  |  Branch (810:16): [True: 12.9k, False: 29.6k]
  |  |  ------------------
  |  |  811|  42.6k|	    (xmlDictOwns(dict, (const xmlChar *)(str)) == 0)))	\
  |  |  ------------------
  |  |  |  Branch (811:6): [True: 191, False: 29.4k]
  |  |  ------------------
  |  |  812|  42.6k|	    xmlFree((char *)(str));
  ------------------
 3472|       |
 3473|   324k|    xmlFree(cur);
 3474|   324k|}
xmlUnlinkNode:
 3518|   213k|xmlUnlinkNode(xmlNode *cur) {
 3519|   213k|    if (cur == NULL)
  ------------------
  |  Branch (3519:9): [True: 0, False: 213k]
  ------------------
 3520|      0|	return;
 3521|       |
 3522|   213k|    if (cur->type == XML_NAMESPACE_DECL)
  ------------------
  |  Branch (3522:9): [True: 0, False: 213k]
  ------------------
 3523|      0|        return;
 3524|       |
 3525|   213k|    if (cur->type == XML_DTD_NODE) {
  ------------------
  |  Branch (3525:9): [True: 13.5k, False: 199k]
  ------------------
 3526|  13.5k|	xmlDocPtr doc = cur->doc;
 3527|       |
 3528|  13.5k|	if (doc != NULL) {
  ------------------
  |  Branch (3528:6): [True: 13.5k, False: 0]
  ------------------
 3529|  13.5k|	    if (doc->intSubset == (xmlDtdPtr) cur)
  ------------------
  |  Branch (3529:10): [True: 12.5k, False: 1.05k]
  ------------------
 3530|  12.5k|		doc->intSubset = NULL;
 3531|  13.5k|	    if (doc->extSubset == (xmlDtdPtr) cur)
  ------------------
  |  Branch (3531:10): [True: 1.05k, False: 12.5k]
  ------------------
 3532|  1.05k|		doc->extSubset = NULL;
 3533|  13.5k|	}
 3534|  13.5k|    }
 3535|       |
 3536|   213k|    if (cur->type == XML_ENTITY_DECL)
  ------------------
  |  Branch (3536:9): [True: 0, False: 213k]
  ------------------
 3537|      0|        xmlRemoveEntity((xmlEntityPtr) cur);
 3538|       |
 3539|   213k|    xmlUnlinkNodeInternal(cur);
 3540|   213k|}
xmlCopyNamespace:
 3616|  3.60M|xmlCopyNamespace(xmlNs *cur) {
 3617|  3.60M|    xmlNsPtr ret;
 3618|       |
 3619|  3.60M|    if (cur == NULL) return(NULL);
  ------------------
  |  Branch (3619:9): [True: 0, False: 3.60M]
  ------------------
 3620|  3.60M|    switch (cur->type) {
 3621|  3.60M|	case XML_LOCAL_NAMESPACE:
  ------------------
  |  |  500|  3.60M|#define XML_LOCAL_NAMESPACE XML_NAMESPACE_DECL
  ------------------
  |  Branch (3621:2): [True: 3.60M, False: 0]
  ------------------
 3622|  3.60M|	    ret = xmlNewNs(NULL, cur->href, cur->prefix);
 3623|  3.60M|	    break;
 3624|      0|	default:
  ------------------
  |  Branch (3624:2): [True: 0, False: 3.60M]
  ------------------
 3625|      0|	    return(NULL);
 3626|  3.60M|    }
 3627|  3.60M|    return(ret);
 3628|  3.60M|}
xmlCopyNamespaceList:
 3638|  3.59M|xmlCopyNamespaceList(xmlNs *cur) {
 3639|  3.59M|    xmlNsPtr ret = NULL;
 3640|  3.59M|    xmlNsPtr p = NULL,q;
 3641|       |
 3642|  7.19M|    while (cur != NULL) {
  ------------------
  |  Branch (3642:12): [True: 3.60M, False: 3.59M]
  ------------------
 3643|  3.60M|        q = xmlCopyNamespace(cur);
 3644|  3.60M|        if (q == NULL) {
  ------------------
  |  Branch (3644:13): [True: 41, False: 3.60M]
  ------------------
 3645|     41|            xmlFreeNsList(ret);
 3646|     41|            return(NULL);
 3647|     41|        }
 3648|  3.60M|	if (p == NULL) {
  ------------------
  |  Branch (3648:6): [True: 3.59M, False: 14.9k]
  ------------------
 3649|  3.59M|	    ret = p = q;
 3650|  3.59M|	} else {
 3651|  14.9k|	    p->next = q;
 3652|  14.9k|	    p = q;
 3653|  14.9k|	}
 3654|  3.60M|	cur = cur->next;
 3655|  3.60M|    }
 3656|  3.59M|    return(ret);
 3657|  3.59M|}
xmlCopyProp:
 3792|   894k|xmlCopyProp(xmlNode *target, xmlAttr *cur) {
 3793|       |	return xmlCopyPropInternal(NULL, target, cur);
 3794|   894k|}
xmlCopyPropList:
 3807|   836k|xmlCopyPropList(xmlNode *target, xmlAttr *cur) {
 3808|   836k|    xmlAttrPtr ret = NULL;
 3809|   836k|    xmlAttrPtr p = NULL,q;
 3810|       |
 3811|   836k|    if ((target != NULL) && (target->type != XML_ELEMENT_NODE))
  ------------------
  |  Branch (3811:9): [True: 836k, False: 0]
  |  Branch (3811:29): [True: 0, False: 836k]
  ------------------
 3812|      0|        return(NULL);
 3813|  1.72M|    while (cur != NULL) {
  ------------------
  |  Branch (3813:12): [True: 894k, False: 834k]
  ------------------
 3814|   894k|        q = xmlCopyProp(target, cur);
 3815|   894k|	if (q == NULL) {
  ------------------
  |  Branch (3815:6): [True: 1.77k, False: 892k]
  ------------------
 3816|  1.77k|            xmlFreePropList(ret);
 3817|  1.77k|	    return(NULL);
 3818|  1.77k|        }
 3819|   892k|	if (p == NULL) {
  ------------------
  |  Branch (3819:6): [True: 835k, False: 57.1k]
  ------------------
 3820|   835k|	    ret = p = q;
 3821|   835k|	} else {
 3822|  57.1k|	    p->next = q;
 3823|  57.1k|	    q->prev = p;
 3824|  57.1k|	    p = q;
 3825|  57.1k|	}
 3826|   892k|	cur = cur->next;
 3827|   892k|    }
 3828|   834k|    return(ret);
 3829|   836k|}
xmlStaticCopyNode:
 3861|  17.8M|                  int extended) {
 3862|  17.8M|    xmlNodePtr ret;
 3863|       |
 3864|  17.8M|    if (node == NULL) return(NULL);
  ------------------
  |  Branch (3864:9): [True: 0, False: 17.8M]
  ------------------
 3865|  17.8M|    switch (node->type) {
 3866|  5.30M|        case XML_TEXT_NODE:
  ------------------
  |  Branch (3866:9): [True: 5.30M, False: 12.5M]
  ------------------
 3867|  5.36M|        case XML_CDATA_SECTION_NODE:
  ------------------
  |  Branch (3867:9): [True: 57.1k, False: 17.7M]
  ------------------
 3868|  14.1M|        case XML_ELEMENT_NODE:
  ------------------
  |  Branch (3868:9): [True: 8.80M, False: 9.04M]
  ------------------
 3869|  14.1M|        case XML_DOCUMENT_FRAG_NODE:
  ------------------
  |  Branch (3869:9): [True: 0, False: 17.8M]
  ------------------
 3870|  14.2M|        case XML_ENTITY_REF_NODE:
  ------------------
  |  Branch (3870:9): [True: 60.2k, False: 17.7M]
  ------------------
 3871|  14.3M|        case XML_PI_NODE:
  ------------------
  |  Branch (3871:9): [True: 86.9k, False: 17.7M]
  ------------------
 3872|  14.3M|        case XML_COMMENT_NODE:
  ------------------
  |  Branch (3872:9): [True: 11.3k, False: 17.8M]
  ------------------
 3873|  14.3M|        case XML_XINCLUDE_START:
  ------------------
  |  Branch (3873:9): [True: 35.5k, False: 17.8M]
  ------------------
 3874|  17.8M|        case XML_XINCLUDE_END:
  ------------------
  |  Branch (3874:9): [True: 3.48M, False: 14.3M]
  ------------------
 3875|  17.8M|	    break;
 3876|      0|        case XML_ATTRIBUTE_NODE:
  ------------------
  |  Branch (3876:9): [True: 0, False: 17.8M]
  ------------------
 3877|      0|		return((xmlNodePtr) xmlCopyPropInternal(doc, parent, (xmlAttrPtr) node));
 3878|      0|        case XML_NAMESPACE_DECL:
  ------------------
  |  Branch (3878:9): [True: 0, False: 17.8M]
  ------------------
 3879|      0|	    return((xmlNodePtr) xmlCopyNamespaceList((xmlNsPtr) node));
 3880|  5.97k|        case XML_DTD_NODE:
  ------------------
  |  Branch (3880:9): [True: 5.97k, False: 17.8M]
  ------------------
 3881|  5.97k|            return((xmlNodePtr) xmlCopyDtd((xmlDtdPtr) node));
 3882|      0|        case XML_DOCUMENT_NODE:
  ------------------
  |  Branch (3882:9): [True: 0, False: 17.8M]
  ------------------
 3883|      0|        case XML_HTML_DOCUMENT_NODE:
  ------------------
  |  Branch (3883:9): [True: 0, False: 17.8M]
  ------------------
 3884|      0|	    return((xmlNodePtr) xmlCopyDoc((xmlDocPtr) node, extended));
 3885|      0|        default:
  ------------------
  |  Branch (3885:9): [True: 0, False: 17.8M]
  ------------------
 3886|      0|            return(NULL);
 3887|  17.8M|    }
 3888|       |
 3889|       |    /*
 3890|       |     * Allocate a new node and fill the fields.
 3891|       |     */
 3892|  17.8M|    ret = (xmlNodePtr) xmlMalloc(sizeof(xmlNode));
 3893|  17.8M|    if (ret == NULL)
  ------------------
  |  Branch (3893:9): [True: 147, False: 17.8M]
  ------------------
 3894|    147|	return(NULL);
 3895|  17.8M|    memset(ret, 0, sizeof(xmlNode));
 3896|  17.8M|    ret->type = node->type;
 3897|       |
 3898|  17.8M|    ret->doc = doc;
 3899|  17.8M|    ret->parent = parent;
 3900|  17.8M|    if (node->name == xmlStringText)
  ------------------
  |  Branch (3900:9): [True: 5.30M, False: 12.5M]
  ------------------
 3901|  5.30M|	ret->name = xmlStringText;
 3902|  12.5M|    else if (node->name == xmlStringTextNoenc)
  ------------------
  |  Branch (3902:14): [True: 0, False: 12.5M]
  ------------------
 3903|      0|	ret->name = xmlStringTextNoenc;
 3904|  12.5M|    else if (node->name == xmlStringComment)
  ------------------
  |  Branch (3904:14): [True: 11.3k, False: 12.5M]
  ------------------
 3905|  11.3k|	ret->name = xmlStringComment;
 3906|  12.5M|    else if (node->name != NULL) {
  ------------------
  |  Branch (3906:14): [True: 12.4M, False: 57.1k]
  ------------------
 3907|  12.4M|        if ((doc != NULL) && (doc->dict != NULL))
  ------------------
  |  Branch (3907:13): [True: 12.4M, False: 1.27k]
  |  Branch (3907:30): [True: 11.9M, False: 503k]
  ------------------
 3908|  11.9M|	    ret->name = xmlDictLookup(doc->dict, node->name, -1);
 3909|   505k|	else
 3910|   505k|	    ret->name = xmlStrdup(node->name);
 3911|  12.4M|        if (ret->name == NULL)
  ------------------
  |  Branch (3911:13): [True: 30, False: 12.4M]
  ------------------
 3912|     30|            goto error;
 3913|  12.4M|    }
 3914|  17.8M|    if ((node->type != XML_ELEMENT_NODE) &&
  ------------------
  |  Branch (3914:9): [True: 9.03M, False: 8.80M]
  ------------------
 3915|  9.03M|	(node->content != NULL) &&
  ------------------
  |  Branch (3915:2): [True: 5.37M, False: 3.66M]
  ------------------
 3916|  5.37M|	(node->type != XML_ENTITY_REF_NODE) &&
  ------------------
  |  Branch (3916:2): [True: 5.37M, False: 1.25k]
  ------------------
 3917|  5.37M|	(node->type != XML_XINCLUDE_END) &&
  ------------------
  |  Branch (3917:2): [True: 5.37M, False: 0]
  ------------------
 3918|  5.37M|	(node->type != XML_XINCLUDE_START)) {
  ------------------
  |  Branch (3918:2): [True: 5.37M, False: 0]
  ------------------
 3919|  5.37M|	ret->content = xmlStrdup(node->content);
 3920|  5.37M|        if (ret->content == NULL)
  ------------------
  |  Branch (3920:13): [True: 69, False: 5.37M]
  ------------------
 3921|     69|            goto error;
 3922|  12.4M|    }else{
 3923|  12.4M|      if (node->type == XML_ELEMENT_NODE)
  ------------------
  |  Branch (3923:11): [True: 8.80M, False: 3.66M]
  ------------------
 3924|  8.80M|        ret->line = node->line;
 3925|  12.4M|    }
 3926|       |
 3927|  17.8M|    if (!extended)
  ------------------
  |  Branch (3927:9): [True: 161, False: 17.8M]
  ------------------
 3928|    161|	goto out;
 3929|  17.8M|    if (((node->type == XML_ELEMENT_NODE) ||
  ------------------
  |  Branch (3929:10): [True: 8.80M, False: 9.03M]
  ------------------
 3930|  9.03M|         (node->type == XML_XINCLUDE_START)) && (node->nsDef != NULL)) {
  ------------------
  |  Branch (3930:10): [True: 35.5k, False: 8.99M]
  |  Branch (3930:49): [True: 3.59M, False: 5.24M]
  ------------------
 3931|  3.59M|        ret->nsDef = xmlCopyNamespaceList(node->nsDef);
 3932|  3.59M|        if (ret->nsDef == NULL)
  ------------------
  |  Branch (3932:13): [True: 41, False: 3.59M]
  ------------------
 3933|     41|            goto error;
 3934|  3.59M|    }
 3935|       |
 3936|  17.8M|    if ((node->type == XML_ELEMENT_NODE) && (node->ns != NULL)) {
  ------------------
  |  Branch (3936:9): [True: 8.80M, False: 9.03M]
  |  Branch (3936:45): [True: 714k, False: 8.09M]
  ------------------
 3937|   714k|        xmlNsPtr ns = NULL;
 3938|   714k|        int res;
 3939|       |
 3940|   714k|	res = xmlSearchNsSafe(ret, node->ns->prefix, &ns);
 3941|   714k|        if (res < 0)
  ------------------
  |  Branch (3941:13): [True: 1, False: 714k]
  ------------------
 3942|      1|            goto error;
 3943|   714k|	if (ns == NULL) {
  ------------------
  |  Branch (3943:6): [True: 932, False: 713k]
  ------------------
 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|    932|	    res = xmlSearchNsSafe(node, node->ns->prefix, &ns);
 3953|    932|            if (res < 0)
  ------------------
  |  Branch (3953:17): [True: 0, False: 932]
  ------------------
 3954|      0|                goto error;
 3955|    932|	    if (ns != NULL) {
  ------------------
  |  Branch (3955:10): [True: 932, False: 0]
  ------------------
 3956|    932|	        xmlNodePtr root = ret;
 3957|       |
 3958|  1.35k|		while (root->parent != NULL) root = root->parent;
  ------------------
  |  Branch (3958:10): [True: 427, False: 932]
  ------------------
 3959|    932|		ret->ns = xmlNewNs(root, ns->href, ns->prefix);
 3960|    932|            } else {
 3961|      0|                ret->ns = xmlNewReconciledNs(ret, node->ns);
 3962|      0|	    }
 3963|    932|            if (ret->ns == NULL)
  ------------------
  |  Branch (3963:17): [True: 1, False: 931]
  ------------------
 3964|      1|                goto error;
 3965|   713k|	} else {
 3966|       |	    /*
 3967|       |	     * reference the existing namespace definition in our own tree.
 3968|       |	     */
 3969|   713k|	    ret->ns = ns;
 3970|   713k|	}
 3971|   714k|    }
 3972|  17.8M|    if ((node->type == XML_ELEMENT_NODE) && (node->properties != NULL)) {
  ------------------
  |  Branch (3972:9): [True: 8.80M, False: 9.03M]
  |  Branch (3972:45): [True: 836k, False: 7.96M]
  ------------------
 3973|   836k|        ret->properties = xmlCopyPropList(ret, node->properties);
 3974|   836k|        if (ret->properties == NULL)
  ------------------
  |  Branch (3974:13): [True: 1.77k, False: 834k]
  ------------------
 3975|  1.77k|            goto error;
 3976|   836k|    }
 3977|  17.8M|    if (node->type == XML_ENTITY_REF_NODE) {
  ------------------
  |  Branch (3977:9): [True: 60.2k, False: 17.7M]
  ------------------
 3978|  60.2k|	if ((doc == NULL) || (node->doc != doc)) {
  ------------------
  |  Branch (3978:6): [True: 554, False: 59.6k]
  |  Branch (3978:23): [True: 235, False: 59.4k]
  ------------------
 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|    789|	    ret->children = (xmlNodePtr) xmlGetDocEntity(doc, ret->name);
 3986|  59.4k|	} else {
 3987|  59.4k|            ret->children = node->children;
 3988|  59.4k|	}
 3989|  60.2k|	ret->last = ret->children;
 3990|  17.7M|    } else if ((node->children != NULL) && (extended != 2)) {
  ------------------
  |  Branch (3990:16): [True: 7.55M, False: 10.2M]
  |  Branch (3990:44): [True: 11.5k, False: 7.54M]
  ------------------
 3991|  11.5k|        xmlNodePtr cur, insert;
 3992|       |
 3993|  11.5k|        cur = node->children;
 3994|  11.5k|        insert = ret;
 3995|  15.7M|        while (cur != NULL) {
  ------------------
  |  Branch (3995:16): [True: 15.7M, False: 10.3k]
  ------------------
 3996|  15.7M|            xmlNodePtr copy = xmlStaticCopyNode(cur, doc, insert, 2);
 3997|  15.7M|            if (copy == NULL)
  ------------------
  |  Branch (3997:17): [True: 1.27k, False: 15.7M]
  ------------------
 3998|  1.27k|                goto error;
 3999|       |
 4000|       |            /* Check for coalesced text nodes */
 4001|  15.7M|            if (insert->last != copy) {
  ------------------
  |  Branch (4001:17): [True: 15.7M, False: 0]
  ------------------
 4002|  15.7M|                if (insert->last == NULL) {
  ------------------
  |  Branch (4002:21): [True: 7.11M, False: 8.63M]
  ------------------
 4003|  7.11M|                    insert->children = copy;
 4004|  8.63M|                } else {
 4005|  8.63M|                    copy->prev = insert->last;
 4006|  8.63M|                    insert->last->next = copy;
 4007|  8.63M|                }
 4008|  15.7M|                insert->last = copy;
 4009|  15.7M|            }
 4010|       |
 4011|  15.7M|            if ((cur->type != XML_ENTITY_REF_NODE) &&
  ------------------
  |  Branch (4011:17): [True: 15.6M, False: 58.4k]
  ------------------
 4012|  15.6M|                (cur->children != NULL)) {
  ------------------
  |  Branch (4012:17): [True: 7.10M, False: 8.58M]
  ------------------
 4013|  7.10M|                cur = cur->children;
 4014|  7.10M|                insert = copy;
 4015|  7.10M|                continue;
 4016|  7.10M|            }
 4017|       |
 4018|  15.7M|            while (1) {
  ------------------
  |  Branch (4018:20): [True: 15.7M, Folded]
  ------------------
 4019|  15.7M|                if (cur->next != NULL) {
  ------------------
  |  Branch (4019:21): [True: 8.63M, False: 7.06M]
  ------------------
 4020|  8.63M|                    cur = cur->next;
 4021|  8.63M|                    break;
 4022|  8.63M|                }
 4023|       |
 4024|  7.06M|                cur = cur->parent;
 4025|  7.06M|                insert = insert->parent;
 4026|  7.06M|                if (cur == node) {
  ------------------
  |  Branch (4026:21): [True: 10.3k, False: 7.05M]
  ------------------
 4027|  10.3k|                    cur = NULL;
 4028|  10.3k|                    break;
 4029|  10.3k|                }
 4030|  7.06M|            }
 4031|  8.64M|        }
 4032|  11.5k|    }
 4033|       |
 4034|  17.8M|out:
 4035|  17.8M|    if ((xmlRegisterCallbacks) && (xmlRegisterNodeDefaultValue))
  ------------------
  |  |  932|      0|    (*__xmlRegisterNodeDefaultValue())
  ------------------
  |  Branch (4035:9): [True: 0, False: 17.8M]
  |  Branch (4035:35): [True: 0, False: 0]
  ------------------
 4036|      0|	xmlRegisterNodeDefaultValue((xmlNodePtr)ret);
  ------------------
  |  |  932|      0|    (*__xmlRegisterNodeDefaultValue())
  ------------------
 4037|  17.8M|    return(ret);
 4038|       |
 4039|  3.18k|error:
 4040|  3.18k|    xmlFreeNode(ret);
 4041|       |    return(NULL);
 4042|  17.8M|}
xmlStaticCopyNodeList:
 4055|   866k|xmlStaticCopyNodeList(xmlNode *node, xmlDoc *doc, xmlNode *parent) {
 4056|   866k|    xmlNodePtr ret = NULL;
 4057|   866k|    xmlNodePtr p = NULL,q;
 4058|   866k|    xmlDtdPtr newSubset = NULL;
 4059|   866k|    int linkedSubset = 0;
 4060|       |
 4061|  1.73M|    while (node != NULL) {
  ------------------
  |  Branch (4061:12): [True: 868k, False: 866k]
  ------------------
 4062|   868k|        xmlNodePtr next = node->next;
 4063|       |
 4064|   868k|	if (node->type == XML_DTD_NODE ) {
  ------------------
  |  Branch (4064:6): [True: 0, False: 868k]
  ------------------
 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|   868k|	    q = xmlStaticCopyNode(node, doc, parent, 1);
 4102|   868k|	if (q == NULL) goto error;
  ------------------
  |  Branch (4102:6): [True: 40, False: 868k]
  ------------------
 4103|   868k|	if (ret == NULL) {
  ------------------
  |  Branch (4103:6): [True: 866k, False: 1.91k]
  ------------------
 4104|   866k|	    q->prev = NULL;
 4105|   866k|	    ret = p = q;
 4106|   866k|	} else if (p != q) {
  ------------------
  |  Branch (4106:13): [True: 1.91k, False: 0]
  ------------------
 4107|       |	/* the test is required if xmlStaticCopyNode coalesced 2 text nodes */
 4108|  1.91k|	    p->next = q;
 4109|  1.91k|	    q->prev = p;
 4110|  1.91k|	    p = q;
 4111|  1.91k|	}
 4112|   868k|	node = next;
 4113|   868k|    }
 4114|   866k|    if ((doc != NULL) && (newSubset != NULL))
  ------------------
  |  Branch (4114:9): [True: 865k, False: 613]
  |  Branch (4114:26): [True: 0, False: 865k]
  ------------------
 4115|      0|        doc->intSubset = newSubset;
 4116|   866k|    return(ret);
 4117|     40|error:
 4118|     40|    xmlFreeNodeList(ret);
 4119|     40|    if (newSubset != NULL)
  ------------------
  |  Branch (4119:9): [True: 0, False: 40]
  ------------------
 4120|      0|        xmlFreeDtd(newSubset);
 4121|     40|    if (linkedSubset != 0) {
  ------------------
  |  Branch (4121:9): [True: 0, False: 40]
  ------------------
 4122|      0|        doc->intSubset->next = NULL;
 4123|      0|        doc->intSubset->prev = NULL;
 4124|      0|    }
 4125|       |    return(NULL);
 4126|   866k|}
xmlCopyNode:
 4146|    165|xmlCopyNode(xmlNode *node, int extended) {
 4147|    165|    xmlNodePtr ret;
 4148|       |
 4149|    165|    ret = xmlStaticCopyNode(node, NULL, NULL, extended);
 4150|    165|    return(ret);
 4151|    165|}
xmlDocCopyNode:
 4170|  63.9k|xmlDocCopyNode(xmlNode *node, xmlDoc *doc, int extended) {
 4171|  63.9k|    xmlNodePtr ret;
 4172|       |
 4173|       |    ret = xmlStaticCopyNode(node, doc, NULL, extended);
 4174|  63.9k|    return(ret);
 4175|  63.9k|}
xmlCopyDtd:
 4211|  5.97k|xmlCopyDtd(xmlDtd *dtd) {
 4212|  5.97k|    xmlDtdPtr ret;
 4213|  5.97k|    xmlNodePtr cur, p = NULL, q;
 4214|       |
 4215|  5.97k|    if (dtd == NULL) return(NULL);
  ------------------
  |  Branch (4215:9): [True: 0, False: 5.97k]
  ------------------
 4216|  5.97k|    ret = xmlNewDtd(NULL, dtd->name, dtd->ExternalID, dtd->SystemID);
 4217|  5.97k|    if (ret == NULL) return(NULL);
  ------------------
  |  Branch (4217:9): [True: 23, False: 5.95k]
  ------------------
 4218|  5.95k|    if (dtd->entities != NULL) {
  ------------------
  |  Branch (4218:9): [True: 1.61k, False: 4.33k]
  ------------------
 4219|  1.61k|        ret->entities = (void *) xmlCopyEntitiesTable(
 4220|  1.61k|	                    (xmlEntitiesTablePtr) dtd->entities);
 4221|  1.61k|        if (ret->entities == NULL)
  ------------------
  |  Branch (4221:13): [True: 25, False: 1.59k]
  ------------------
 4222|     25|            goto error;
 4223|  1.61k|    }
 4224|  5.92k|    if (dtd->notations != NULL) {
  ------------------
  |  Branch (4224:9): [True: 888, False: 5.04k]
  ------------------
 4225|    888|        ret->notations = (void *) xmlCopyNotationTable(
 4226|    888|	                    (xmlNotationTablePtr) dtd->notations);
 4227|    888|        if (ret->notations == NULL)
  ------------------
  |  Branch (4227:13): [True: 11, False: 877]
  ------------------
 4228|     11|            goto error;
 4229|    888|    }
 4230|  5.91k|    if (dtd->elements != NULL) {
  ------------------
  |  Branch (4230:9): [True: 4.53k, False: 1.38k]
  ------------------
 4231|  4.53k|        ret->elements = (void *) xmlCopyElementTable(
 4232|  4.53k|	                    (xmlElementTablePtr) dtd->elements);
 4233|  4.53k|        if (ret->elements == NULL)
  ------------------
  |  Branch (4233:13): [True: 89, False: 4.44k]
  ------------------
 4234|     89|            goto error;
 4235|  4.53k|    }
 4236|  5.82k|    if (dtd->attributes != NULL) {
  ------------------
  |  Branch (4236:9): [True: 3.08k, False: 2.74k]
  ------------------
 4237|  3.08k|        ret->attributes = (void *) xmlCopyAttributeTable(
 4238|  3.08k|	                    (xmlAttributeTablePtr) dtd->attributes);
 4239|  3.08k|        if (ret->attributes == NULL)
  ------------------
  |  Branch (4239:13): [True: 70, False: 3.01k]
  ------------------
 4240|     70|            goto error;
 4241|  3.08k|    }
 4242|  5.75k|    if (dtd->pentities != NULL) {
  ------------------
  |  Branch (4242:9): [True: 351, False: 5.40k]
  ------------------
 4243|    351|	ret->pentities = (void *) xmlCopyEntitiesTable(
 4244|    351|			    (xmlEntitiesTablePtr) dtd->pentities);
 4245|    351|        if (ret->pentities == NULL)
  ------------------
  |  Branch (4245:13): [True: 11, False: 340]
  ------------------
 4246|     11|            goto error;
 4247|    351|    }
 4248|       |
 4249|  5.74k|    cur = dtd->children;
 4250|  19.4k|    while (cur != NULL) {
  ------------------
  |  Branch (4250:12): [True: 13.7k, False: 5.74k]
  ------------------
 4251|  13.7k|	q = NULL;
 4252|       |
 4253|  13.7k|	if (cur->type == XML_ENTITY_DECL) {
  ------------------
  |  Branch (4253:6): [True: 2.62k, False: 11.1k]
  ------------------
 4254|  2.62k|	    xmlEntityPtr tmp = (xmlEntityPtr) cur;
 4255|  2.62k|	    switch (tmp->etype) {
  ------------------
  |  Branch (4255:14): [True: 2.62k, False: 0]
  ------------------
 4256|  1.43k|		case XML_INTERNAL_GENERAL_ENTITY:
  ------------------
  |  Branch (4256:3): [True: 1.43k, False: 1.18k]
  ------------------
 4257|  2.08k|		case XML_EXTERNAL_GENERAL_PARSED_ENTITY:
  ------------------
  |  Branch (4257:3): [True: 649, False: 1.97k]
  ------------------
 4258|  2.26k|		case XML_EXTERNAL_GENERAL_UNPARSED_ENTITY:
  ------------------
  |  Branch (4258:3): [True: 182, False: 2.44k]
  ------------------
 4259|  2.26k|		    q = (xmlNodePtr) xmlGetEntityFromDtd(ret, tmp->name);
 4260|  2.26k|		    break;
 4261|    241|		case XML_INTERNAL_PARAMETER_ENTITY:
  ------------------
  |  Branch (4261:3): [True: 241, False: 2.38k]
  ------------------
 4262|    355|		case XML_EXTERNAL_PARAMETER_ENTITY:
  ------------------
  |  Branch (4262:3): [True: 114, False: 2.51k]
  ------------------
 4263|    355|		    q = (xmlNodePtr)
 4264|    355|			xmlGetParameterEntityFromDtd(ret, tmp->name);
 4265|    355|		    break;
 4266|      0|		case XML_INTERNAL_PREDEFINED_ENTITY:
  ------------------
  |  Branch (4266:3): [True: 0, False: 2.62k]
  ------------------
 4267|      0|		    break;
 4268|  2.62k|	    }
 4269|  11.1k|	} else if (cur->type == XML_ELEMENT_DECL) {
  ------------------
  |  Branch (4269:13): [True: 4.62k, False: 6.48k]
  ------------------
 4270|  4.62k|	    xmlElementPtr tmp = (xmlElementPtr) cur;
 4271|  4.62k|	    q = (xmlNodePtr)
 4272|  4.62k|		xmlGetDtdQElementDesc(ret, tmp->name, tmp->prefix);
 4273|  6.48k|	} else if (cur->type == XML_ATTRIBUTE_DECL) {
  ------------------
  |  Branch (4273:13): [True: 6.24k, False: 248]
  ------------------
 4274|  6.24k|	    xmlAttributePtr tmp = (xmlAttributePtr) cur;
 4275|  6.24k|	    q = (xmlNodePtr)
 4276|  6.24k|		xmlGetDtdQAttrDesc(ret, tmp->elem, tmp->name, tmp->prefix);
 4277|  6.24k|	} else if (cur->type == XML_COMMENT_NODE) {
  ------------------
  |  Branch (4277:13): [True: 165, False: 83]
  ------------------
 4278|    165|	    q = xmlCopyNode(cur, 0);
 4279|    165|            if (q == NULL)
  ------------------
  |  Branch (4279:17): [True: 4, False: 161]
  ------------------
 4280|      4|                goto error;
 4281|    165|	}
 4282|       |
 4283|  13.7k|	if (q == NULL) {
  ------------------
  |  Branch (4283:6): [True: 83, False: 13.6k]
  ------------------
 4284|     83|	    cur = cur->next;
 4285|     83|	    continue;
 4286|     83|	}
 4287|       |
 4288|  13.6k|	if (p == NULL)
  ------------------
  |  Branch (4288:6): [True: 4.95k, False: 8.70k]
  ------------------
 4289|  4.95k|	    ret->children = q;
 4290|  8.70k|	else
 4291|  8.70k|	    p->next = q;
 4292|       |
 4293|  13.6k|	q->prev = p;
 4294|  13.6k|	q->parent = (xmlNodePtr) ret;
 4295|  13.6k|	q->next = NULL;
 4296|  13.6k|	ret->last = q;
 4297|  13.6k|	p = q;
 4298|  13.6k|	cur = cur->next;
 4299|  13.6k|    }
 4300|       |
 4301|  5.74k|    return(ret);
 4302|       |
 4303|    210|error:
 4304|    210|    xmlFreeDtd(ret);
 4305|       |    return(NULL);
 4306|  5.74k|}
xmlGetLineNo:
 4446|  35.1k|{
 4447|  35.1k|    return(xmlGetLineNoInternal(node, 0));
 4448|  35.1k|}
xmlDocGetRootElement:
 4674|   192k|xmlDocGetRootElement(const xmlDoc *doc) {
 4675|   192k|    xmlNodePtr ret;
 4676|       |
 4677|   192k|    if (doc == NULL) return(NULL);
  ------------------
  |  Branch (4677:9): [True: 0, False: 192k]
  ------------------
 4678|   192k|    ret = doc->children;
 4679|   233k|    while (ret != NULL) {
  ------------------
  |  Branch (4679:12): [True: 233k, False: 1]
  ------------------
 4680|   233k|	if (ret->type == XML_ELEMENT_NODE)
  ------------------
  |  Branch (4680:6): [True: 192k, False: 40.5k]
  ------------------
 4681|   192k|	    return(ret);
 4682|  40.5k|        ret = ret->next;
 4683|  40.5k|    }
 4684|      1|    return(ret);
 4685|   192k|}
xmlNodeGetLang:
 4771|  5.95k|xmlNodeGetLang(const xmlNode *cur) {
 4772|  5.95k|    xmlChar *lang;
 4773|  5.95k|    int res;
 4774|       |
 4775|  5.95k|    if ((cur == NULL) || (cur->type == XML_NAMESPACE_DECL))
  ------------------
  |  Branch (4775:9): [True: 0, False: 5.95k]
  |  Branch (4775:26): [True: 0, False: 5.95k]
  ------------------
 4776|      0|        return(NULL);
 4777|       |
 4778|   129k|    while (cur != NULL) {
  ------------------
  |  Branch (4778:12): [True: 124k, False: 5.62k]
  ------------------
 4779|   124k|        res = xmlNodeGetAttrValue(cur, BAD_CAST "lang", XML_XML_NAMESPACE,
  ------------------
  |  |   34|   124k|#define BAD_CAST (xmlChar *)
  ------------------
                      res = xmlNodeGetAttrValue(cur, BAD_CAST "lang", XML_XML_NAMESPACE,
  ------------------
  |  |  146|   124k|    (const xmlChar *) "http://www.w3.org/XML/1998/namespace"
  ------------------
 4780|   124k|                                  &lang);
 4781|   124k|        if (res < 0)
  ------------------
  |  Branch (4781:13): [True: 2, False: 124k]
  ------------------
 4782|      2|            return(NULL);
 4783|   124k|	if (lang != NULL)
  ------------------
  |  Branch (4783:6): [True: 324, False: 123k]
  ------------------
 4784|    324|	    return(lang);
 4785|       |
 4786|   123k|	cur = cur->parent;
 4787|   123k|    }
 4788|       |
 4789|  5.62k|    return(NULL);
 4790|  5.95k|}
xmlNodeGetSpacePreserve:
 4837|    586|xmlNodeGetSpacePreserve(const xmlNode *cur) {
 4838|    586|    xmlChar *space;
 4839|    586|        int res;
 4840|       |
 4841|    586|    if ((cur == NULL) || (cur->type != XML_ELEMENT_NODE))
  ------------------
  |  Branch (4841:9): [True: 0, False: 586]
  |  Branch (4841:26): [True: 586, False: 0]
  ------------------
 4842|    586|        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|  1.78k|xmlNodeSetBase(xmlNode *cur, const xmlChar* uri) {
 4922|  1.78k|    xmlNsPtr ns;
 4923|  1.78k|    xmlChar* fixed;
 4924|       |
 4925|  1.78k|    if (cur == NULL)
  ------------------
  |  Branch (4925:9): [True: 0, False: 1.78k]
  ------------------
 4926|      0|        return(-1);
 4927|  1.78k|    switch(cur->type) {
 4928|  1.78k|        case XML_ELEMENT_NODE:
  ------------------
  |  Branch (4928:9): [True: 1.78k, False: 0]
  ------------------
 4929|  1.78k|        case XML_ATTRIBUTE_NODE:
  ------------------
  |  Branch (4929:9): [True: 0, False: 1.78k]
  ------------------
 4930|  1.78k|	    break;
 4931|      0|        case XML_DOCUMENT_NODE:
  ------------------
  |  Branch (4931:9): [True: 0, False: 1.78k]
  ------------------
 4932|      0|        case XML_HTML_DOCUMENT_NODE: {
  ------------------
  |  Branch (4932:9): [True: 0, False: 1.78k]
  ------------------
 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: 1.78k]
  ------------------
 4947|      0|	    return(-1);
 4948|  1.78k|    }
 4949|       |
 4950|  1.78k|    xmlSearchNsByHrefSafe(cur, XML_XML_NAMESPACE, &ns);
  ------------------
  |  |  146|  1.78k|    (const xmlChar *) "http://www.w3.org/XML/1998/namespace"
  ------------------
 4951|  1.78k|    if (ns == NULL)
  ------------------
  |  Branch (4951:9): [True: 1, False: 1.78k]
  ------------------
 4952|      1|	return(-1);
 4953|  1.78k|    fixed = xmlPathToURI(uri);
 4954|  1.78k|    if (fixed == NULL)
  ------------------
  |  Branch (4954:9): [True: 5, False: 1.77k]
  ------------------
 4955|      5|        return(-1);
 4956|  1.77k|    if (xmlSetNsProp(cur, ns, BAD_CAST "base", fixed) == NULL) {
  ------------------
  |  |   34|  1.77k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (4956:9): [True: 13, False: 1.76k]
  ------------------
 4957|     13|        xmlFree(fixed);
 4958|     13|        return(-1);
 4959|     13|    }
 4960|  1.76k|    xmlFree(fixed);
 4961|       |
 4962|  1.76k|    return(0);
 4963|  1.77k|}
xmlNodeGetBaseSafe:
 4982|  65.5k|xmlNodeGetBaseSafe(const xmlDoc *doc, const xmlNode *cur, xmlChar **baseOut) {
 4983|  65.5k|    xmlChar *ret = NULL;
 4984|  65.5k|    xmlChar *base, *newbase;
 4985|  65.5k|    int res;
 4986|       |
 4987|  65.5k|    if (baseOut == NULL)
  ------------------
  |  Branch (4987:9): [True: 0, False: 65.5k]
  ------------------
 4988|      0|        return(1);
 4989|  65.5k|    *baseOut = NULL;
 4990|  65.5k|    if ((cur == NULL) && (doc == NULL))
  ------------------
  |  Branch (4990:9): [True: 0, False: 65.5k]
  |  Branch (4990:26): [True: 0, False: 0]
  ------------------
 4991|      0|        return(1);
 4992|  65.5k|    if ((cur != NULL) && (cur->type == XML_NAMESPACE_DECL))
  ------------------
  |  Branch (4992:9): [True: 65.5k, False: 0]
  |  Branch (4992:26): [True: 0, False: 65.5k]
  ------------------
 4993|      0|        return(1);
 4994|  65.5k|    if (doc == NULL)
  ------------------
  |  Branch (4994:9): [True: 43.2k, False: 22.3k]
  ------------------
 4995|  43.2k|        doc = cur->doc;
 4996|       |
 4997|  65.5k|    if ((doc != NULL) && (doc->type == XML_HTML_DOCUMENT_NODE)) {
  ------------------
  |  Branch (4997:9): [True: 65.5k, False: 0]
  |  Branch (4997:26): [True: 0, False: 65.5k]
  ------------------
 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|  8.07M|    while (cur != NULL) {
  ------------------
  |  Branch (5024:12): [True: 8.02M, False: 52.5k]
  ------------------
 5025|  8.02M|	if (cur->type == XML_ENTITY_DECL) {
  ------------------
  |  Branch (5025:6): [True: 442, False: 8.02M]
  ------------------
 5026|    442|	    xmlEntityPtr ent = (xmlEntityPtr) cur;
 5027|       |
 5028|    442|            if (ent->URI == NULL)
  ------------------
  |  Branch (5028:17): [True: 199, False: 243]
  ------------------
 5029|    199|                break;
 5030|    243|            xmlFree(ret);
 5031|    243|	    ret = xmlStrdup(ent->URI);
 5032|    243|            if (ret == NULL)
  ------------------
  |  Branch (5032:17): [True: 1, False: 242]
  ------------------
 5033|      1|                return(-1);
 5034|    242|            goto found;
 5035|    243|	}
 5036|  8.02M|	if (cur->type == XML_ELEMENT_NODE) {
  ------------------
  |  Branch (5036:6): [True: 7.96M, False: 54.6k]
  ------------------
 5037|  7.96M|	    if (xmlNodeGetAttrValue(cur, BAD_CAST "base", XML_XML_NAMESPACE,
  ------------------
  |  |   34|  7.96M|#define BAD_CAST (xmlChar *)
  ------------------
              	    if (xmlNodeGetAttrValue(cur, BAD_CAST "base", XML_XML_NAMESPACE,
  ------------------
  |  |  146|  7.96M|    (const xmlChar *) "http://www.w3.org/XML/1998/namespace"
  ------------------
  |  Branch (5037:10): [True: 135, False: 7.96M]
  ------------------
 5038|  7.96M|                                    &base) < 0) {
 5039|    135|                xmlFree(ret);
 5040|    135|                return(-1);
 5041|    135|            }
 5042|  7.96M|	    if (base != NULL) {
  ------------------
  |  Branch (5042:10): [True: 307k, False: 7.65M]
  ------------------
 5043|   307k|		if (ret != NULL) {
  ------------------
  |  Branch (5043:7): [True: 263k, False: 43.7k]
  ------------------
 5044|   263k|		    res = xmlBuildURISafe(ret, base, &newbase);
 5045|   263k|                    xmlFree(ret);
 5046|   263k|                    xmlFree(base);
 5047|   263k|                    if (res != 0)
  ------------------
  |  Branch (5047:25): [True: 9.75k, False: 253k]
  ------------------
 5048|  9.75k|                        return(res);
 5049|   253k|		    ret = newbase;
 5050|   253k|		} else {
 5051|  43.7k|		    ret = base;
 5052|  43.7k|		}
 5053|   297k|		if ((!xmlStrncmp(ret, BAD_CAST "http://", 7)) ||
  ------------------
  |  |   34|   297k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (5053:7): [True: 619, False: 297k]
  ------------------
 5054|   297k|		    (!xmlStrncmp(ret, BAD_CAST "ftp://", 6)) ||
  ------------------
  |  |   34|   297k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (5054:7): [True: 600, False: 296k]
  ------------------
 5055|   296k|		    (!xmlStrncmp(ret, BAD_CAST "urn:", 4)))
  ------------------
  |  |   34|   296k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (5055:7): [True: 1.49k, False: 294k]
  ------------------
 5056|  2.71k|                    goto found;
 5057|   297k|	    }
 5058|  7.96M|	}
 5059|  8.00M|	cur = cur->parent;
 5060|  8.00M|    }
 5061|       |
 5062|  52.7k|    if ((doc != NULL) && (doc->URL != NULL)) {
  ------------------
  |  Branch (5062:9): [True: 52.7k, False: 0]
  |  Branch (5062:26): [True: 7.92k, False: 44.8k]
  ------------------
 5063|  7.92k|	if (ret == NULL) {
  ------------------
  |  Branch (5063:6): [True: 7.03k, False: 896]
  ------------------
 5064|  7.03k|	    ret = xmlStrdup(doc->URL);
 5065|  7.03k|            if (ret == NULL)
  ------------------
  |  Branch (5065:17): [True: 21, False: 7.01k]
  ------------------
 5066|     21|                return(-1);
 5067|  7.03k|        } else {
 5068|    896|            res = xmlBuildURISafe(ret, doc->URL, &newbase);
 5069|    896|            xmlFree(ret);
 5070|    896|            if (res != 0)
  ------------------
  |  Branch (5070:17): [True: 313, False: 583]
  ------------------
 5071|    313|                return(res);
 5072|    583|            ret = newbase;
 5073|    583|        }
 5074|  7.92k|    }
 5075|       |
 5076|  55.3k|found:
 5077|  55.3k|    *baseOut = ret;
 5078|  55.3k|    return(0);
 5079|  52.7k|}
xmlBufGetNodeContent:
 5202|   170k|{
 5203|   170k|    if ((cur == NULL) || (buf == NULL))
  ------------------
  |  Branch (5203:9): [True: 0, False: 170k]
  |  Branch (5203:26): [True: 0, False: 170k]
  ------------------
 5204|      0|        return(-1);
 5205|       |
 5206|   170k|    switch (cur->type) {
 5207|  74.0k|        case XML_DOCUMENT_NODE:
  ------------------
  |  Branch (5207:9): [True: 74.0k, False: 96.9k]
  ------------------
 5208|  74.0k|        case XML_HTML_DOCUMENT_NODE:
  ------------------
  |  Branch (5208:9): [True: 0, False: 170k]
  ------------------
 5209|  74.0k|        case XML_DOCUMENT_FRAG_NODE:
  ------------------
  |  Branch (5209:9): [True: 0, False: 170k]
  ------------------
 5210|   169k|        case XML_ELEMENT_NODE:
  ------------------
  |  Branch (5210:9): [True: 95.2k, False: 75.7k]
  ------------------
 5211|   170k|        case XML_ATTRIBUTE_NODE:
  ------------------
  |  Branch (5211:9): [True: 1.12k, False: 169k]
  ------------------
 5212|   170k|        case XML_ENTITY_DECL:
  ------------------
  |  Branch (5212:9): [True: 0, False: 170k]
  ------------------
 5213|   170k|            xmlBufGetChildContent(buf, cur);
 5214|   170k|            break;
 5215|       |
 5216|      0|        case XML_CDATA_SECTION_NODE:
  ------------------
  |  Branch (5216:9): [True: 0, False: 170k]
  ------------------
 5217|      0|        case XML_TEXT_NODE:
  ------------------
  |  Branch (5217:9): [True: 0, False: 170k]
  ------------------
 5218|      0|        case XML_COMMENT_NODE:
  ------------------
  |  Branch (5218:9): [True: 0, False: 170k]
  ------------------
 5219|      0|        case XML_PI_NODE:
  ------------------
  |  Branch (5219:9): [True: 0, False: 170k]
  ------------------
 5220|      0|	    xmlBufCat(buf, cur->content);
 5221|      0|            break;
 5222|       |
 5223|    573|        case XML_ENTITY_REF_NODE:
  ------------------
  |  Branch (5223:9): [True: 573, False: 170k]
  ------------------
 5224|    573|            xmlBufGetEntityRefContent(buf, cur);
 5225|    573|            break;
 5226|       |
 5227|      0|        case XML_NAMESPACE_DECL:
  ------------------
  |  Branch (5227:9): [True: 0, False: 170k]
  ------------------
 5228|      0|	    xmlBufCat(buf, ((xmlNsPtr) cur)->href);
 5229|      0|	    break;
 5230|       |
 5231|      0|        default:
  ------------------
  |  Branch (5231:9): [True: 0, False: 170k]
  ------------------
 5232|      0|            break;
 5233|   170k|    }
 5234|       |
 5235|   170k|    return(0);
 5236|   170k|}
xmlNodeGetContent:
 5253|   663k|{
 5254|   663k|    xmlBufPtr buf;
 5255|   663k|    xmlChar *ret;
 5256|       |
 5257|   663k|    if (cur == NULL)
  ------------------
  |  Branch (5257:9): [True: 0, False: 663k]
  ------------------
 5258|      0|        return (NULL);
 5259|       |
 5260|   663k|    switch (cur->type) {
 5261|  74.1k|        case XML_DOCUMENT_NODE:
  ------------------
  |  Branch (5261:9): [True: 74.1k, False: 589k]
  ------------------
 5262|  74.1k|        case XML_HTML_DOCUMENT_NODE:
  ------------------
  |  Branch (5262:9): [True: 0, False: 663k]
  ------------------
 5263|  74.1k|        case XML_ENTITY_REF_NODE:
  ------------------
  |  Branch (5263:9): [True: 0, False: 663k]
  ------------------
 5264|  74.1k|            break;
 5265|       |
 5266|      0|        case XML_DOCUMENT_FRAG_NODE:
  ------------------
  |  Branch (5266:9): [True: 0, False: 663k]
  ------------------
 5267|   224k|        case XML_ELEMENT_NODE:
  ------------------
  |  Branch (5267:9): [True: 224k, False: 438k]
  ------------------
 5268|   561k|        case XML_ATTRIBUTE_NODE:
  ------------------
  |  Branch (5268:9): [True: 336k, False: 326k]
  ------------------
 5269|   561k|        case XML_ENTITY_DECL: {
  ------------------
  |  Branch (5269:9): [True: 0, False: 663k]
  ------------------
 5270|   561k|            xmlNodePtr children = cur->children;
 5271|       |
 5272|   561k|            if (children == NULL)
  ------------------
  |  Branch (5272:17): [True: 202k, False: 359k]
  ------------------
 5273|   202k|                return(xmlStrdup(BAD_CAST ""));
  ------------------
  |  |   34|   202k|#define BAD_CAST (xmlChar *)
  ------------------
 5274|       |
 5275|       |            /* Optimization for single text children */
 5276|   359k|            if (((children->type == XML_TEXT_NODE) ||
  ------------------
  |  Branch (5276:18): [True: 293k, False: 65.7k]
  ------------------
 5277|  65.7k|                 (children->type == XML_CDATA_SECTION_NODE)) &&
  ------------------
  |  Branch (5277:18): [True: 2.54k, False: 63.2k]
  ------------------
 5278|   296k|                (children->next == NULL)) {
  ------------------
  |  Branch (5278:17): [True: 263k, False: 32.2k]
  ------------------
 5279|   263k|                if (children->content == NULL)
  ------------------
  |  Branch (5279:21): [True: 0, False: 263k]
  ------------------
 5280|      0|                    return(xmlStrdup(BAD_CAST ""));
  ------------------
  |  |   34|      0|#define BAD_CAST (xmlChar *)
  ------------------
 5281|   263k|                return(xmlStrdup(children->content));
 5282|   263k|            }
 5283|       |
 5284|  95.5k|            break;
 5285|   359k|        }
 5286|       |
 5287|  95.5k|        case XML_CDATA_SECTION_NODE:
  ------------------
  |  Branch (5287:9): [True: 715, False: 662k]
  ------------------
 5288|  26.7k|        case XML_TEXT_NODE:
  ------------------
  |  Branch (5288:9): [True: 26.0k, False: 637k]
  ------------------
 5289|  27.2k|        case XML_COMMENT_NODE:
  ------------------
  |  Branch (5289:9): [True: 427, False: 662k]
  ------------------
 5290|  27.5k|        case XML_PI_NODE:
  ------------------
  |  Branch (5290:9): [True: 359, False: 662k]
  ------------------
 5291|  27.5k|            if (cur->content != NULL)
  ------------------
  |  Branch (5291:17): [True: 27.2k, False: 359]
  ------------------
 5292|  27.2k|                return(xmlStrdup(cur->content));
 5293|    359|            else
 5294|    359|                return(xmlStrdup(BAD_CAST ""));
  ------------------
  |  |   34|    359|#define BAD_CAST (xmlChar *)
  ------------------
 5295|       |
 5296|    244|        case XML_NAMESPACE_DECL:
  ------------------
  |  Branch (5296:9): [True: 244, False: 662k]
  ------------------
 5297|    244|	    return(xmlStrdup(((xmlNsPtr) cur)->href));
 5298|       |
 5299|      0|        default:
  ------------------
  |  Branch (5299:9): [True: 0, False: 663k]
  ------------------
 5300|      0|            return(NULL);
 5301|   663k|    }
 5302|       |
 5303|   169k|    buf = xmlBufCreate(50);
 5304|   169k|    if (buf == NULL)
  ------------------
  |  Branch (5304:9): [True: 44, False: 169k]
  ------------------
 5305|     44|        return (NULL);
 5306|   169k|    xmlBufGetNodeContent(buf, cur);
 5307|   169k|    ret = xmlBufDetach(buf);
 5308|   169k|    xmlBufFree(buf);
 5309|       |
 5310|   169k|    return(ret);
 5311|   169k|}
xmlNodeAddContentLen:
 5414|     35|xmlNodeAddContentLen(xmlNode *cur, const xmlChar *content, int len) {
 5415|     35|    if (cur == NULL)
  ------------------
  |  Branch (5415:9): [True: 0, False: 35]
  ------------------
 5416|      0|	return(1);
 5417|     35|    if ((content == NULL) || (len <= 0))
  ------------------
  |  Branch (5417:9): [True: 0, False: 35]
  |  Branch (5417:30): [True: 13, False: 22]
  ------------------
 5418|     13|        return(0);
 5419|       |
 5420|     22|    switch (cur->type) {
 5421|      0|        case XML_DOCUMENT_FRAG_NODE:
  ------------------
  |  Branch (5421:9): [True: 0, False: 22]
  ------------------
 5422|      0|        case XML_ELEMENT_NODE:
  ------------------
  |  Branch (5422:9): [True: 0, False: 22]
  ------------------
 5423|      0|        case XML_ATTRIBUTE_NODE: {
  ------------------
  |  Branch (5423:9): [True: 0, False: 22]
  ------------------
 5424|      0|	    xmlNodePtr newNode, tmp;
 5425|       |
 5426|      0|	    newNode = xmlNewDocTextLen(cur->doc, content, len);
 5427|      0|	    if (newNode == NULL)
  ------------------
  |  Branch (5427:10): [True: 0, False: 0]
  ------------------
 5428|      0|                return(-1);
 5429|      0|            tmp = xmlAddChild(cur, newNode);
 5430|      0|            if (tmp == NULL) {
  ------------------
  |  Branch (5430:17): [True: 0, False: 0]
  ------------------
 5431|      0|                xmlFreeNode(newNode);
 5432|      0|                return(-1);
 5433|      0|            }
 5434|      0|	    break;
 5435|      0|	}
 5436|      0|	    break;
 5437|     22|        case XML_TEXT_NODE:
  ------------------
  |  Branch (5437:9): [True: 22, False: 0]
  ------------------
 5438|     22|        case XML_CDATA_SECTION_NODE:
  ------------------
  |  Branch (5438:9): [True: 0, False: 22]
  ------------------
 5439|     22|        case XML_PI_NODE:
  ------------------
  |  Branch (5439:9): [True: 0, False: 22]
  ------------------
 5440|     22|        case XML_COMMENT_NODE:
  ------------------
  |  Branch (5440:9): [True: 0, False: 22]
  ------------------
 5441|     22|            return(xmlTextAddContent(cur, content, len));
 5442|      0|        default:
  ------------------
  |  Branch (5442:9): [True: 0, False: 22]
  ------------------
 5443|      0|            break;
 5444|     22|    }
 5445|       |
 5446|      0|    return(0);
 5447|     22|}
xmlGetNsListSafe:
 5513|  15.9k|{
 5514|  15.9k|    xmlNsPtr cur;
 5515|  15.9k|    xmlNsPtr *namespaces = NULL;
 5516|  15.9k|    int nbns = 0;
 5517|  15.9k|    int maxns = 0;
 5518|  15.9k|    int i;
 5519|       |
 5520|  15.9k|    if (out == NULL)
  ------------------
  |  Branch (5520:9): [True: 0, False: 15.9k]
  ------------------
 5521|      0|        return(1);
 5522|  15.9k|    *out = NULL;
 5523|  15.9k|    if ((node == NULL) || (node->type == XML_NAMESPACE_DECL))
  ------------------
  |  Branch (5523:9): [True: 0, False: 15.9k]
  |  Branch (5523:27): [True: 0, False: 15.9k]
  ------------------
 5524|      0|        return(1);
 5525|       |
 5526|  95.8k|    while (node != NULL) {
  ------------------
  |  Branch (5526:12): [True: 79.8k, False: 15.9k]
  ------------------
 5527|  79.8k|        if (node->type == XML_ELEMENT_NODE) {
  ------------------
  |  Branch (5527:13): [True: 63.9k, False: 15.9k]
  ------------------
 5528|  63.9k|            cur = node->nsDef;
 5529|  86.2k|            while (cur != NULL) {
  ------------------
  |  Branch (5529:20): [True: 22.3k, False: 63.9k]
  ------------------
 5530|  28.9k|                for (i = 0; i < nbns; i++) {
  ------------------
  |  Branch (5530:29): [True: 7.46k, False: 21.5k]
  ------------------
 5531|  7.46k|                    if ((cur->prefix == namespaces[i]->prefix) ||
  ------------------
  |  Branch (5531:25): [True: 279, False: 7.18k]
  ------------------
 5532|  7.18k|                        (xmlStrEqual(cur->prefix, namespaces[i]->prefix)))
  ------------------
  |  Branch (5532:25): [True: 555, False: 6.63k]
  ------------------
 5533|    834|                        break;
 5534|  7.46k|                }
 5535|  22.3k|                if (i >= nbns) {
  ------------------
  |  Branch (5535:21): [True: 21.5k, False: 834]
  ------------------
 5536|  21.5k|                    if (nbns >= maxns) {
  ------------------
  |  Branch (5536:25): [True: 15.1k, False: 6.37k]
  ------------------
 5537|  15.1k|                        xmlNsPtr *tmp;
 5538|  15.1k|                        int newSize;
 5539|       |
 5540|  15.1k|                        newSize = xmlGrowCapacity(maxns, sizeof(tmp[0]),
 5541|  15.1k|                                                  10, XML_MAX_ITEMS);
  ------------------
  |  |   13|  15.1k|#define XML_MAX_ITEMS 1000000000 /* 1 billion */
  ------------------
 5542|  15.1k|                        if (newSize < 0) {
  ------------------
  |  Branch (5542:29): [True: 0, False: 15.1k]
  ------------------
 5543|      0|                            xmlFree(namespaces);
 5544|      0|                            return(-1);
 5545|      0|                        }
 5546|  15.1k|#ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
 5547|  15.1k|                        if (newSize < 2)
  ------------------
  |  Branch (5547:29): [True: 15.0k, False: 126]
  ------------------
 5548|  15.0k|                            newSize = 2;
 5549|  15.1k|#endif
 5550|  15.1k|                        tmp = xmlRealloc(namespaces,
 5551|  15.1k|                                         (newSize + 1) * sizeof(tmp[0]));
 5552|  15.1k|                        if (tmp == NULL) {
  ------------------
  |  Branch (5552:29): [True: 5, False: 15.1k]
  ------------------
 5553|      5|                            xmlFree(namespaces);
 5554|      5|                            return(-1);
 5555|      5|                        }
 5556|  15.1k|                        namespaces = tmp;
 5557|  15.1k|                        maxns = newSize;
 5558|  15.1k|                    }
 5559|  21.5k|                    namespaces[nbns++] = cur;
 5560|  21.5k|                    namespaces[nbns] = NULL;
 5561|  21.5k|                }
 5562|       |
 5563|  22.3k|                cur = cur->next;
 5564|  22.3k|            }
 5565|  63.9k|        }
 5566|  79.8k|        node = node->parent;
 5567|  79.8k|    }
 5568|       |
 5569|  15.9k|    *out = namespaces;
 5570|  15.9k|    return((namespaces == NULL) ? 1 : 0);
  ------------------
  |  Branch (5570:12): [True: 927, False: 15.0k]
  ------------------
 5571|  15.9k|}
xmlSearchNsSafe:
 5650|  1.39M|                xmlNs **out) {
 5651|  1.39M|    xmlNsPtr cur;
 5652|  1.39M|    xmlDocPtr doc;
 5653|  1.39M|    xmlNodePtr orig = node;
 5654|  1.39M|    xmlNodePtr parent;
 5655|       |
 5656|  1.39M|    if (out == NULL)
  ------------------
  |  Branch (5656:9): [True: 0, False: 1.39M]
  ------------------
 5657|      0|        return(1);
 5658|  1.39M|    *out = NULL;
 5659|  1.39M|    if ((node == NULL) || (node->type == XML_NAMESPACE_DECL))
  ------------------
  |  Branch (5659:9): [True: 0, False: 1.39M]
  |  Branch (5659:27): [True: 0, False: 1.39M]
  ------------------
 5660|      0|        return(1);
 5661|       |
 5662|  1.39M|    doc = node->doc;
 5663|       |
 5664|  1.39M|    if ((doc != NULL) && (IS_STR_XML(prefix))) {
  ------------------
  |  |  100|  1.39M|#define IS_STR_XML(str) ((str != NULL) && (str[0] == 'x') && \
  |  |  ------------------
  |  |  |  Branch (100:26): [True: 1.01M, False: 375k]
  |  |  |  Branch (100:43): [True: 861k, False: 153k]
  |  |  ------------------
  |  |  101|  1.39M|  (str[1] == 'm') && (str[2] == 'l') && (str[3] == 0))
  |  |  ------------------
  |  |  |  Branch (101:3): [True: 230k, False: 631k]
  |  |  |  Branch (101:22): [True: 228k, False: 1.33k]
  |  |  |  Branch (101:41): [True: 226k, False: 2.36k]
  |  |  ------------------
  ------------------
  |  Branch (5664:9): [True: 1.39M, False: 204]
  ------------------
 5665|   226k|        cur = xmlTreeEnsureXMLDecl(doc);
 5666|   226k|        if (cur == NULL)
  ------------------
  |  Branch (5666:13): [True: 22, False: 226k]
  ------------------
 5667|     22|            return(-1);
 5668|   226k|        *out = cur;
 5669|   226k|        return(0);
 5670|   226k|    }
 5671|       |
 5672|  1.16M|    while (node->type != XML_ELEMENT_NODE) {
  ------------------
  |  Branch (5672:12): [True: 12.3k, False: 1.15M]
  ------------------
 5673|  12.3k|        node = node->parent;
 5674|  12.3k|        if (node == NULL)
  ------------------
  |  Branch (5674:13): [True: 10.7k, False: 1.56k]
  ------------------
 5675|  10.7k|            return(0);
 5676|  12.3k|    }
 5677|       |
 5678|  1.15M|    parent = node;
 5679|       |
 5680|  64.4M|    while ((node != NULL) && (node->type == XML_ELEMENT_NODE)) {
  ------------------
  |  Branch (5680:12): [True: 64.4M, False: 45.6k]
  |  Branch (5680:30): [True: 64.1M, False: 304k]
  ------------------
 5681|  64.1M|        cur = node->nsDef;
 5682|  68.9M|        while (cur != NULL) {
  ------------------
  |  Branch (5682:16): [True: 5.56M, False: 63.3M]
  ------------------
 5683|  5.56M|            if ((xmlStrEqual(cur->prefix, prefix)) &&
  ------------------
  |  Branch (5683:17): [True: 1.80M, False: 3.75M]
  ------------------
 5684|  1.80M|                (cur->href != NULL)) {
  ------------------
  |  Branch (5684:17): [True: 739k, False: 1.06M]
  ------------------
 5685|   739k|                *out = cur;
 5686|   739k|                return(0);
 5687|   739k|            }
 5688|  4.82M|            cur = cur->next;
 5689|  4.82M|        }
 5690|  63.3M|        if (orig != node) {
  ------------------
  |  Branch (5690:13): [True: 62.3M, False: 1.04M]
  ------------------
 5691|  62.3M|            cur = node->ns;
 5692|  62.3M|            if ((cur != NULL) &&
  ------------------
  |  Branch (5692:17): [True: 1.62M, False: 60.7M]
  ------------------
 5693|  1.62M|                (xmlStrEqual(cur->prefix, prefix)) &&
  ------------------
  |  Branch (5693:17): [True: 64.9k, False: 1.56M]
  ------------------
 5694|  64.9k|                (cur->href != NULL)) {
  ------------------
  |  Branch (5694:17): [True: 64.9k, False: 0]
  ------------------
 5695|  64.9k|                *out = cur;
 5696|  64.9k|                return(0);
 5697|  64.9k|            }
 5698|  62.3M|        }
 5699|       |
 5700|  63.3M|	node = node->parent;
 5701|  63.3M|    }
 5702|       |
 5703|       |    /*
 5704|       |     * The XML-1.0 namespace is normally held on the document
 5705|       |     * element. In this case exceptionally create it on the
 5706|       |     * node element.
 5707|       |     */
 5708|   350k|    if ((doc == NULL) && (IS_STR_XML(prefix))) {
  ------------------
  |  |  100|    196|#define IS_STR_XML(str) ((str != NULL) && (str[0] == 'x') && \
  |  |  ------------------
  |  |  |  Branch (100:26): [True: 196, False: 0]
  |  |  |  Branch (100:43): [True: 196, False: 0]
  |  |  ------------------
  |  |  101|    196|  (str[1] == 'm') && (str[2] == 'l') && (str[3] == 0))
  |  |  ------------------
  |  |  |  Branch (101:3): [True: 196, False: 0]
  |  |  |  Branch (101:22): [True: 196, False: 0]
  |  |  |  Branch (101:41): [True: 196, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (5708:9): [True: 196, False: 350k]
  ------------------
 5709|    196|        cur = xmlNewXmlNs();
 5710|    196|        if (cur == NULL)
  ------------------
  |  Branch (5710:13): [True: 1, False: 195]
  ------------------
 5711|      1|            return(-1);
 5712|    195|        cur->next = parent->nsDef;
 5713|    195|        parent->nsDef = cur;
 5714|    195|        *out = cur;
 5715|    195|    }
 5716|       |
 5717|   350k|    return(0);
 5718|   350k|}
xmlSearchNsByHrefSafe:
 5797|  4.37k|                      xmlNs **out) {
 5798|  4.37k|    xmlNsPtr cur;
 5799|  4.37k|    xmlDocPtr doc;
 5800|  4.37k|    xmlNodePtr orig = node;
 5801|  4.37k|    xmlNodePtr parent;
 5802|  4.37k|    int is_attr;
 5803|       |
 5804|  4.37k|    if (out == NULL)
  ------------------
  |  Branch (5804:9): [True: 0, False: 4.37k]
  ------------------
 5805|      0|        return(1);
 5806|  4.37k|    *out = NULL;
 5807|  4.37k|    if ((node == NULL) || (node->type == XML_NAMESPACE_DECL))
  ------------------
  |  Branch (5807:9): [True: 0, False: 4.37k]
  |  Branch (5807:27): [True: 0, False: 4.37k]
  ------------------
 5808|      0|        return(1);
 5809|       |
 5810|  4.37k|    doc = node->doc;
 5811|       |
 5812|  4.37k|    if ((doc != NULL) && (xmlStrEqual(href, XML_XML_NAMESPACE))) {
  ------------------
  |  |  146|  4.37k|    (const xmlChar *) "http://www.w3.org/XML/1998/namespace"
  ------------------
  |  Branch (5812:9): [True: 4.37k, False: 0]
  |  Branch (5812:26): [True: 1.78k, False: 2.59k]
  ------------------
 5813|  1.78k|        cur = xmlTreeEnsureXMLDecl(doc);
 5814|  1.78k|        if (cur == NULL)
  ------------------
  |  Branch (5814:13): [True: 1, False: 1.78k]
  ------------------
 5815|      1|            return(-1);
 5816|  1.78k|        *out = cur;
 5817|  1.78k|        return(0);
 5818|  1.78k|    }
 5819|       |
 5820|  2.59k|    is_attr = (node->type == XML_ATTRIBUTE_NODE);
 5821|       |
 5822|  2.59k|    while (node->type != XML_ELEMENT_NODE) {
  ------------------
  |  Branch (5822:12): [True: 0, False: 2.59k]
  ------------------
 5823|      0|        node = node->parent;
 5824|      0|        if (node == NULL)
  ------------------
  |  Branch (5824:13): [True: 0, False: 0]
  ------------------
 5825|      0|            return(0);
 5826|      0|    }
 5827|       |
 5828|  2.59k|    parent = node;
 5829|       |
 5830|   116k|    while ((node != NULL) && (node->type == XML_ELEMENT_NODE)) {
  ------------------
  |  Branch (5830:12): [True: 115k, False: 635]
  |  Branch (5830:30): [True: 115k, False: 0]
  ------------------
 5831|   115k|        cur = node->nsDef;
 5832|   174k|        while (cur != NULL) {
  ------------------
  |  Branch (5832:16): [True: 60.5k, False: 114k]
  ------------------
 5833|  60.5k|            if (xmlStrEqual(cur->href, href)) {
  ------------------
  |  Branch (5833:17): [True: 16.3k, False: 44.2k]
  ------------------
 5834|  16.3k|                if (((!is_attr) || (cur->prefix != NULL)) &&
  ------------------
  |  Branch (5834:22): [True: 16.3k, False: 0]
  |  Branch (5834:36): [True: 0, False: 0]
  ------------------
 5835|  16.3k|                    (xmlNsInScope(doc, orig, node, cur->prefix) == 1)) {
  ------------------
  |  Branch (5835:21): [True: 1.61k, False: 14.7k]
  ------------------
 5836|  1.61k|                    *out = cur;
 5837|  1.61k|                    return(0);
 5838|  1.61k|                }
 5839|  16.3k|            }
 5840|  58.9k|            cur = cur->next;
 5841|  58.9k|        }
 5842|   114k|        if (orig != node) {
  ------------------
  |  Branch (5842:13): [True: 111k, False: 2.39k]
  ------------------
 5843|   111k|            cur = node->ns;
 5844|   111k|            if (cur != NULL) {
  ------------------
  |  Branch (5844:17): [True: 99.3k, False: 12.4k]
  ------------------
 5845|  99.3k|                if (xmlStrEqual(cur->href, href)) {
  ------------------
  |  Branch (5845:21): [True: 24.6k, False: 74.7k]
  ------------------
 5846|  24.6k|                    if (((!is_attr) || (cur->prefix != NULL)) &&
  ------------------
  |  Branch (5846:26): [True: 24.6k, False: 0]
  |  Branch (5846:40): [True: 0, False: 0]
  ------------------
 5847|  24.6k|                        (xmlNsInScope(doc, orig, node,
  ------------------
  |  Branch (5847:25): [True: 337, False: 24.2k]
  ------------------
 5848|  24.6k|                                      cur->prefix) == 1)) {
 5849|    337|                        *out = cur;
 5850|    337|                        return(0);
 5851|    337|                    }
 5852|  24.6k|                }
 5853|  99.3k|            }
 5854|   111k|        }
 5855|       |
 5856|   113k|        node = node->parent;
 5857|   113k|    }
 5858|       |
 5859|       |    /*
 5860|       |     * The XML-1.0 namespace is normally held on the document
 5861|       |     * element. In this case exceptionally create it on the
 5862|       |     * node element.
 5863|       |     */
 5864|    635|    if ((doc == NULL) && (xmlStrEqual(href, XML_XML_NAMESPACE))) {
  ------------------
  |  |  146|      0|    (const xmlChar *) "http://www.w3.org/XML/1998/namespace"
  ------------------
  |  Branch (5864:9): [True: 0, False: 635]
  |  Branch (5864:26): [True: 0, False: 0]
  ------------------
 5865|      0|        cur = xmlNewXmlNs();
 5866|      0|        if (cur == NULL)
  ------------------
  |  Branch (5866:13): [True: 0, False: 0]
  ------------------
 5867|      0|            return(-1);
 5868|      0|        cur->next = parent->nsDef;
 5869|      0|        parent->nsDef = cur;
 5870|      0|        *out = cur;
 5871|      0|    }
 5872|       |
 5873|    635|    return(0);
 5874|    635|}
xmlNodeGetAttrValue:
 6351|  8.26M|                    const xmlChar *nsUri, xmlChar **out) {
 6352|  8.26M|    xmlAttrPtr prop;
 6353|       |
 6354|  8.26M|    if (out == NULL)
  ------------------
  |  Branch (6354:9): [True: 0, False: 8.26M]
  ------------------
 6355|      0|        return(1);
 6356|  8.26M|    *out = NULL;
 6357|       |
 6358|  8.26M|    prop = xmlGetPropNodeInternal(node, name, nsUri, 0);
 6359|  8.26M|    if (prop == NULL)
  ------------------
  |  Branch (6359:9): [True: 7.93M, False: 333k]
  ------------------
 6360|  7.93M|	return(1);
 6361|       |
 6362|   333k|    *out = xmlGetPropNodeValueInternal(prop);
 6363|   333k|    if (*out == NULL)
  ------------------
  |  Branch (6363:9): [True: 192, False: 333k]
  ------------------
 6364|    192|        return(-1);
 6365|   333k|    return(0);
 6366|   333k|}
xmlUnsetProp:
 6468|    121|xmlUnsetProp(xmlNode *node, const xmlChar *name) {
 6469|    121|    xmlAttrPtr prop;
 6470|       |
 6471|    121|    prop = xmlGetPropNodeInternal(node, name, NULL, 0);
 6472|    121|    if (prop == NULL)
  ------------------
  |  Branch (6472:9): [True: 17, False: 104]
  ------------------
 6473|     17|	return(-1);
 6474|    104|    xmlUnlinkNodeInternal((xmlNodePtr) prop);
 6475|    104|    xmlFreeProp(prop);
 6476|    104|    return(0);
 6477|    121|}
xmlUnsetNsProp:
 6488|  4.87k|xmlUnsetNsProp(xmlNode *node, xmlNs *ns, const xmlChar *name) {
 6489|  4.87k|    xmlAttrPtr prop;
 6490|       |
 6491|  4.87k|    prop = xmlGetPropNodeInternal(node, name,
 6492|  4.87k|                                  (ns != NULL) ? ns->href : NULL, 0);
  ------------------
  |  Branch (6492:35): [True: 4.87k, False: 0]
  ------------------
 6493|  4.87k|    if (prop == NULL)
  ------------------
  |  Branch (6493:9): [True: 3.90k, False: 966]
  ------------------
 6494|  3.90k|	return(-1);
 6495|    966|    xmlUnlinkNodeInternal((xmlNodePtr) prop);
 6496|    966|    xmlFreeProp(prop);
 6497|    966|    return(0);
 6498|  4.87k|}
xmlSetNsProp:
 6553|  1.77k|{
 6554|  1.77k|    xmlAttrPtr prop;
 6555|       |
 6556|  1.77k|    if (ns && (ns->href == NULL))
  ------------------
  |  Branch (6556:9): [True: 1.77k, False: 0]
  |  Branch (6556:15): [True: 0, False: 1.77k]
  ------------------
 6557|      0|	return(NULL);
 6558|  1.77k|    if (name == NULL)
  ------------------
  |  Branch (6558:9): [True: 0, False: 1.77k]
  ------------------
 6559|      0|        return(NULL);
 6560|  1.77k|    prop = xmlGetPropNodeInternal(node, name,
 6561|  1.77k|                                  (ns != NULL) ? ns->href : NULL, 0);
  ------------------
  |  Branch (6561:35): [True: 1.77k, False: 0]
  ------------------
 6562|  1.77k|    if (prop != NULL) {
  ------------------
  |  Branch (6562:9): [True: 1.26k, False: 509]
  ------------------
 6563|  1.26k|        xmlNodePtr children = NULL;
 6564|       |
 6565|       |	/*
 6566|       |	* Modify the attribute's value.
 6567|       |	*/
 6568|  1.26k|        if (value != NULL) {
  ------------------
  |  Branch (6568:13): [True: 1.26k, False: 0]
  ------------------
 6569|  1.26k|	    children = xmlNewDocText(node->doc, value);
 6570|  1.26k|            if (children == NULL)
  ------------------
  |  Branch (6570:17): [True: 7, False: 1.26k]
  ------------------
 6571|      7|                return(NULL);
 6572|  1.26k|        }
 6573|       |
 6574|  1.26k|	if (prop->id != NULL) {
  ------------------
  |  Branch (6574:6): [True: 0, False: 1.26k]
  ------------------
 6575|      0|	    xmlRemoveID(node->doc, prop);
 6576|      0|	    prop->atype = XML_ATTRIBUTE_ID;
 6577|      0|	}
 6578|  1.26k|	if (prop->children != NULL)
  ------------------
  |  Branch (6578:6): [True: 1.24k, False: 21]
  ------------------
 6579|  1.24k|	    xmlFreeNodeList(prop->children);
 6580|  1.26k|	prop->children = NULL;
 6581|  1.26k|	prop->last = NULL;
 6582|  1.26k|	prop->ns = ns;
 6583|  1.26k|	if (value != NULL) {
  ------------------
  |  Branch (6583:6): [True: 1.26k, False: 0]
  ------------------
 6584|  1.26k|	    xmlNodePtr tmp;
 6585|       |
 6586|  1.26k|	    prop->children = children;
 6587|  1.26k|	    prop->last = NULL;
 6588|  1.26k|	    tmp = prop->children;
 6589|  2.52k|	    while (tmp != NULL) {
  ------------------
  |  Branch (6589:13): [True: 1.26k, False: 1.26k]
  ------------------
 6590|  1.26k|		tmp->parent = (xmlNodePtr) prop;
 6591|  1.26k|		if (tmp->next == NULL)
  ------------------
  |  Branch (6591:7): [True: 1.26k, False: 0]
  ------------------
 6592|  1.26k|		    prop->last = tmp;
 6593|  1.26k|		tmp = tmp->next;
 6594|  1.26k|	    }
 6595|  1.26k|	}
 6596|  1.26k|	if ((prop->atype == XML_ATTRIBUTE_ID) &&
  ------------------
  |  Branch (6596:6): [True: 0, False: 1.26k]
  ------------------
 6597|      0|	    (xmlAddIDSafe(prop, value) < 0)) {
  ------------------
  |  Branch (6597:6): [True: 0, False: 0]
  ------------------
 6598|      0|            return(NULL);
 6599|      0|        }
 6600|  1.26k|	return(prop);
 6601|  1.26k|    }
 6602|       |    /*
 6603|       |    * No equal attr found; create a new one.
 6604|       |    */
 6605|    509|    return(xmlNewPropInternal(node, ns, name, value, 0));
 6606|  1.77k|}
xmlNodeIsText:
 6615|  3.83k|xmlNodeIsText(const xmlNode *node) {
 6616|  3.83k|    if (node == NULL) return(0);
  ------------------
  |  Branch (6616:9): [True: 0, False: 3.83k]
  ------------------
 6617|       |
 6618|  3.83k|    if (node->type == XML_TEXT_NODE) return(1);
  ------------------
  |  Branch (6618:9): [True: 447, False: 3.38k]
  ------------------
 6619|  3.38k|    return(0);
 6620|  3.83k|}
xmlIsBlankNode:
 6630|  6.65k|xmlIsBlankNode(const xmlNode *node) {
 6631|  6.65k|    const xmlChar *cur;
 6632|  6.65k|    if (node == NULL) return(0);
  ------------------
  |  Branch (6632:9): [True: 0, False: 6.65k]
  ------------------
 6633|       |
 6634|  6.65k|    if ((node->type != XML_TEXT_NODE) &&
  ------------------
  |  Branch (6634:9): [True: 124, False: 6.53k]
  ------------------
 6635|    124|        (node->type != XML_CDATA_SECTION_NODE))
  ------------------
  |  Branch (6635:9): [True: 124, False: 0]
  ------------------
 6636|    124|	return(0);
 6637|  6.53k|    if (node->content == NULL) return(1);
  ------------------
  |  Branch (6637:9): [True: 70, False: 6.46k]
  ------------------
 6638|  6.46k|    cur = node->content;
 6639|  13.2k|    while (*cur != 0) {
  ------------------
  |  Branch (6639:12): [True: 10.8k, False: 2.39k]
  ------------------
 6640|  10.8k|	if (!IS_BLANK_CH(*cur)) return(0);
  ------------------
  |  |  137|  10.8k|#define IS_BLANK_CH(c)  xmlIsBlank_ch(c)
  |  |  ------------------
  |  |  |  |   90|  10.8k|#define xmlIsBlank_ch(c)	(((c) == 0x20) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (90:27): [True: 3.13k, False: 7.67k]
  |  |  |  |  ------------------
  |  |  |  |   91|  10.8k|				 ((0x9 <= (c)) && ((c) <= 0xa)) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (91:7): [True: 7.66k, False: 9]
  |  |  |  |  |  Branch (91:23): [True: 3.45k, False: 4.20k]
  |  |  |  |  ------------------
  |  |  |  |   92|  10.8k|				 ((c) == 0xd))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (92:6): [True: 154, False: 4.06k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 6641|  6.74k|	cur++;
 6642|  6.74k|    }
 6643|       |
 6644|  2.39k|    return(1);
 6645|  6.46k|}
xmlIsXHTML:
 8846|  19.8k|xmlIsXHTML(const xmlChar *systemID, const xmlChar *publicID) {
 8847|  19.8k|    if ((systemID == NULL) && (publicID == NULL))
  ------------------
  |  Branch (8847:9): [True: 5.71k, False: 14.1k]
  |  Branch (8847:31): [True: 5.71k, False: 0]
  ------------------
 8848|  5.71k|	return(-1);
 8849|  14.1k|    if (publicID != NULL) {
  ------------------
  |  Branch (8849:9): [True: 13.7k, False: 402]
  ------------------
 8850|  13.7k|	if (xmlStrEqual(publicID, XHTML_STRICT_PUBLIC_ID)) return(1);
  ------------------
  |  | 8825|  13.7k|#define XHTML_STRICT_PUBLIC_ID BAD_CAST \
  |  |  ------------------
  |  |  |  |   34|  13.7k|#define BAD_CAST (xmlChar *)
  |  |  ------------------
  |  | 8826|  13.7k|   "-//W3C//DTD XHTML 1.0 Strict//EN"
  ------------------
  |  Branch (8850:6): [True: 507, False: 13.2k]
  ------------------
 8851|  13.2k|	if (xmlStrEqual(publicID, XHTML_FRAME_PUBLIC_ID)) return(1);
  ------------------
  |  | 8829|  13.2k|#define XHTML_FRAME_PUBLIC_ID BAD_CAST \
  |  |  ------------------
  |  |  |  |   34|  13.2k|#define BAD_CAST (xmlChar *)
  |  |  ------------------
  |  | 8830|  13.2k|   "-//W3C//DTD XHTML 1.0 Frameset//EN"
  ------------------
  |  Branch (8851:6): [True: 4.06k, False: 9.14k]
  ------------------
 8852|  9.14k|	if (xmlStrEqual(publicID, XHTML_TRANS_PUBLIC_ID)) return(1);
  ------------------
  |  | 8833|  9.14k|#define XHTML_TRANS_PUBLIC_ID BAD_CAST \
  |  |  ------------------
  |  |  |  |   34|  9.14k|#define BAD_CAST (xmlChar *)
  |  |  ------------------
  |  | 8834|  9.14k|   "-//W3C//DTD XHTML 1.0 Transitional//EN"
  ------------------
  |  Branch (8852:6): [True: 1.25k, False: 7.88k]
  ------------------
 8853|  9.14k|    }
 8854|  8.28k|    if (systemID != NULL) {
  ------------------
  |  Branch (8854:9): [True: 8.28k, False: 0]
  ------------------
 8855|  8.28k|	if (xmlStrEqual(systemID, XHTML_STRICT_SYSTEM_ID)) return(1);
  ------------------
  |  | 8827|  8.28k|#define XHTML_STRICT_SYSTEM_ID BAD_CAST \
  |  |  ------------------
  |  |  |  |   34|  8.28k|#define BAD_CAST (xmlChar *)
  |  |  ------------------
  |  | 8828|  8.28k|   "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"
  ------------------
  |  Branch (8855:6): [True: 6.49k, False: 1.78k]
  ------------------
 8856|  1.78k|	if (xmlStrEqual(systemID, XHTML_FRAME_SYSTEM_ID)) return(1);
  ------------------
  |  | 8831|  1.78k|#define XHTML_FRAME_SYSTEM_ID BAD_CAST \
  |  |  ------------------
  |  |  |  |   34|  1.78k|#define BAD_CAST (xmlChar *)
  |  |  ------------------
  |  | 8832|  1.78k|   "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd"
  ------------------
  |  Branch (8856:6): [True: 682, False: 1.10k]
  ------------------
 8857|  1.10k|	if (xmlStrEqual(systemID, XHTML_TRANS_SYSTEM_ID)) return(1);
  ------------------
  |  | 8835|  1.10k|#define XHTML_TRANS_SYSTEM_ID BAD_CAST \
  |  |  ------------------
  |  |  |  |   34|  1.10k|#define BAD_CAST (xmlChar *)
  |  |  ------------------
  |  | 8836|  1.10k|   "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"
  ------------------
  |  Branch (8857:6): [True: 28, False: 1.07k]
  ------------------
 8858|  1.10k|    }
 8859|  1.07k|    return(0);
 8860|  8.28k|}
tree.c:xmlNewPropInternal:
 1435|  65.0k|{
 1436|  65.0k|    xmlAttrPtr cur;
 1437|  65.0k|    xmlDocPtr doc = NULL;
 1438|       |
 1439|  65.0k|    if ((node != NULL) && (node->type != XML_ELEMENT_NODE)) {
  ------------------
  |  Branch (1439:9): [True: 65.0k, False: 0]
  |  Branch (1439:27): [True: 0, False: 65.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|  65.0k|    cur = (xmlAttrPtr) xmlMalloc(sizeof(xmlAttr));
 1451|  65.0k|    if (cur == NULL) {
  ------------------
  |  Branch (1451:9): [True: 21, False: 65.0k]
  ------------------
 1452|     21|        if ((eatname == 1) &&
  ------------------
  |  Branch (1452:13): [True: 0, False: 21]
  ------------------
 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|     21|        return (NULL);
 1458|     21|    }
 1459|  65.0k|    memset(cur, 0, sizeof(xmlAttr));
 1460|  65.0k|    cur->type = XML_ATTRIBUTE_NODE;
 1461|       |
 1462|  65.0k|    cur->parent = node;
 1463|  65.0k|    if (node != NULL) {
  ------------------
  |  Branch (1463:9): [True: 65.0k, False: 0]
  ------------------
 1464|  65.0k|        doc = node->doc;
 1465|  65.0k|        cur->doc = doc;
 1466|  65.0k|    }
 1467|  65.0k|    cur->ns = ns;
 1468|       |
 1469|  65.0k|    if (eatname == 0) {
  ------------------
  |  Branch (1469:9): [True: 65.0k, False: 0]
  ------------------
 1470|  65.0k|        if ((doc != NULL) && (doc->dict != NULL))
  ------------------
  |  Branch (1470:13): [True: 65.0k, False: 0]
  |  Branch (1470:30): [True: 31.5k, False: 33.4k]
  ------------------
 1471|  31.5k|            cur->name = (xmlChar *) xmlDictLookup(doc->dict, name, -1);
 1472|  33.4k|        else
 1473|  33.4k|            cur->name = xmlStrdup(name);
 1474|  65.0k|        if (cur->name == NULL)
  ------------------
  |  Branch (1474:13): [True: 13, False: 65.0k]
  ------------------
 1475|     13|            goto error;
 1476|  65.0k|    } else
 1477|      0|        cur->name = name;
 1478|       |
 1479|  65.0k|    if (value != NULL) {
  ------------------
  |  Branch (1479:9): [True: 507, False: 64.5k]
  ------------------
 1480|    507|        xmlNodePtr tmp;
 1481|       |
 1482|    507|        cur->children = xmlNewDocText(doc, value);
 1483|    507|        if (cur->children == NULL)
  ------------------
  |  Branch (1483:13): [True: 3, False: 504]
  ------------------
 1484|      3|            goto error;
 1485|    504|        cur->last = NULL;
 1486|    504|        tmp = cur->children;
 1487|  1.00k|        while (tmp != NULL) {
  ------------------
  |  Branch (1487:16): [True: 504, False: 504]
  ------------------
 1488|    504|            tmp->parent = (xmlNodePtr) cur;
 1489|    504|            if (tmp->next == NULL)
  ------------------
  |  Branch (1489:17): [True: 504, False: 0]
  ------------------
 1490|    504|                cur->last = tmp;
 1491|    504|            tmp = tmp->next;
 1492|    504|        }
 1493|       |
 1494|    504|        if (doc != NULL) {
  ------------------
  |  Branch (1494:13): [True: 504, False: 0]
  ------------------
 1495|    504|            int res = xmlIsID(doc, node, cur);
 1496|       |
 1497|    504|            if (res < 0)
  ------------------
  |  Branch (1497:17): [True: 1, False: 503]
  ------------------
 1498|      1|                goto error;
 1499|    503|            if ((res == 1) && (xmlAddIDSafe(cur, value) < 0))
  ------------------
  |  Branch (1499:17): [True: 0, False: 503]
  |  Branch (1499:31): [True: 0, False: 0]
  ------------------
 1500|      0|                goto error;
 1501|    503|        }
 1502|    504|    }
 1503|       |
 1504|       |    /*
 1505|       |     * Add it at the end to preserve parsing order ...
 1506|       |     */
 1507|  65.0k|    if (node != NULL) {
  ------------------
  |  Branch (1507:9): [True: 65.0k, False: 0]
  ------------------
 1508|  65.0k|        if (node->properties == NULL) {
  ------------------
  |  Branch (1508:13): [True: 46.9k, False: 18.1k]
  ------------------
 1509|  46.9k|            node->properties = cur;
 1510|  46.9k|        } else {
 1511|  18.1k|            xmlAttrPtr prev = node->properties;
 1512|       |
 1513|   112k|            while (prev->next != NULL)
  ------------------
  |  Branch (1513:20): [True: 93.8k, False: 18.1k]
  ------------------
 1514|  93.8k|                prev = prev->next;
 1515|  18.1k|            prev->next = cur;
 1516|  18.1k|            cur->prev = prev;
 1517|  18.1k|        }
 1518|  65.0k|    }
 1519|       |
 1520|  65.0k|    if ((xmlRegisterCallbacks) && (xmlRegisterNodeDefaultValue))
  ------------------
  |  |  932|      0|    (*__xmlRegisterNodeDefaultValue())
  ------------------
  |  Branch (1520:9): [True: 0, False: 65.0k]
  |  Branch (1520:35): [True: 0, False: 0]
  ------------------
 1521|      0|        xmlRegisterNodeDefaultValue((xmlNodePtr) cur);
  ------------------
  |  |  932|      0|    (*__xmlRegisterNodeDefaultValue())
  ------------------
 1522|  65.0k|    return (cur);
 1523|       |
 1524|     17|error:
 1525|     17|    xmlFreeProp(cur);
 1526|       |    return(NULL);
 1527|  65.0k|}
tree.c:xmlNewElem:
 1842|   660k|           const xmlChar *content) {
 1843|   660k|    xmlNodePtr cur;
 1844|       |
 1845|   660k|    cur = (xmlNodePtr) xmlMalloc(sizeof(xmlNode));
 1846|   660k|    if (cur == NULL)
  ------------------
  |  Branch (1846:9): [True: 77, False: 660k]
  ------------------
 1847|     77|	return(NULL);
 1848|   660k|    memset(cur, 0, sizeof(xmlNode));
 1849|       |
 1850|   660k|    cur->type = XML_ELEMENT_NODE;
 1851|   660k|    cur->doc = doc;
 1852|   660k|    cur->name = name;
 1853|   660k|    cur->ns = ns;
 1854|       |
 1855|   660k|    if (content != NULL) {
  ------------------
  |  Branch (1855:9): [True: 0, False: 660k]
  ------------------
 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|   660k|    if ((xmlRegisterCallbacks) && (xmlRegisterNodeDefaultValue))
  ------------------
  |  |  932|      0|    (*__xmlRegisterNodeDefaultValue())
  ------------------
  |  Branch (1868:9): [True: 0, False: 660k]
  |  Branch (1868:35): [True: 0, False: 0]
  ------------------
 1869|      0|	xmlRegisterNodeDefaultValue((xmlNodePtr)cur);
  ------------------
  |  |  932|      0|    (*__xmlRegisterNodeDefaultValue())
  ------------------
 1870|       |
 1871|   660k|    return(cur);
 1872|   660k|}
tree.c:xmlNewEntityRef:
 2137|  20.1k|xmlNewEntityRef(xmlDocPtr doc, xmlChar *name) {
 2138|  20.1k|    xmlNodePtr cur;
 2139|       |
 2140|       |    /*
 2141|       |     * Allocate a new node and fill the fields.
 2142|       |     */
 2143|  20.1k|    cur = (xmlNodePtr) xmlMalloc(sizeof(xmlNode));
 2144|  20.1k|    if (cur == NULL) {
  ------------------
  |  Branch (2144:9): [True: 4, False: 20.1k]
  ------------------
 2145|      4|        xmlFree(name);
 2146|      4|	return(NULL);
 2147|      4|    }
 2148|  20.1k|    memset(cur, 0, sizeof(xmlNode));
 2149|  20.1k|    cur->type = XML_ENTITY_REF_NODE;
 2150|  20.1k|    cur->doc = doc;
 2151|  20.1k|    cur->name = name;
 2152|       |
 2153|  20.1k|    if ((xmlRegisterCallbacks) && (xmlRegisterNodeDefaultValue))
  ------------------
  |  |  932|      0|    (*__xmlRegisterNodeDefaultValue())
  ------------------
  |  Branch (2153:9): [True: 0, False: 20.1k]
  |  Branch (2153:35): [True: 0, False: 0]
  ------------------
 2154|      0|	xmlRegisterNodeDefaultValue(cur);
  ------------------
  |  |  932|      0|    (*__xmlRegisterNodeDefaultValue())
  ------------------
 2155|       |
 2156|  20.1k|    return(cur);
 2157|  20.1k|}
tree.c:xmlInsertNode:
 2791|   159k|              xmlNodePtr prev, xmlNodePtr next, int coalesce) {
 2792|   159k|    xmlNodePtr oldParent;
 2793|       |
 2794|   159k|    if (cur->type == XML_ATTRIBUTE_NODE)
  ------------------
  |  Branch (2794:9): [True: 0, False: 159k]
  ------------------
 2795|      0|	return xmlInsertProp(doc, cur, parent, prev, next);
 2796|       |
 2797|       |    /*
 2798|       |     * Coalesce text nodes
 2799|       |     */
 2800|   159k|    if ((coalesce) && (cur->type == XML_TEXT_NODE)) {
  ------------------
  |  Branch (2800:9): [True: 0, False: 159k]
  |  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|   159k|    oldParent = cur->parent;
 2829|   159k|    if (oldParent != NULL) {
  ------------------
  |  Branch (2829:9): [True: 0, False: 159k]
  ------------------
 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|   159k|    if (cur->next != NULL)
  ------------------
  |  Branch (2835:9): [True: 145k, False: 14.2k]
  ------------------
 2836|   145k|        cur->next->prev = cur->prev;
 2837|   159k|    if (cur->prev != NULL)
  ------------------
  |  Branch (2837:9): [True: 0, False: 159k]
  ------------------
 2838|      0|        cur->prev->next = cur->next;
 2839|       |
 2840|   159k|    if (cur->doc != doc) {
  ------------------
  |  Branch (2840:9): [True: 0, False: 159k]
  ------------------
 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|   159k|    cur->parent = parent;
 2857|   159k|    cur->prev = prev;
 2858|   159k|    cur->next = next;
 2859|       |
 2860|   159k|    if (prev == NULL) {
  ------------------
  |  Branch (2860:9): [True: 0, False: 159k]
  ------------------
 2861|      0|        if (parent != NULL)
  ------------------
  |  Branch (2861:13): [True: 0, False: 0]
  ------------------
 2862|      0|            parent->children = cur;
 2863|   159k|    } else {
 2864|   159k|        prev->next = cur;
 2865|   159k|    }
 2866|   159k|    if (next == NULL) {
  ------------------
  |  Branch (2866:9): [True: 896, False: 158k]
  ------------------
 2867|    896|        if (parent != NULL)
  ------------------
  |  Branch (2867:13): [True: 896, False: 0]
  ------------------
 2868|    896|            parent->last = cur;
 2869|   158k|    } else {
 2870|   158k|        next->prev = cur;
 2871|   158k|    }
 2872|       |
 2873|   159k|    return(cur);
 2874|   159k|}
tree.c:xmlTextSetContent:
 2717|     21|xmlTextSetContent(xmlNodePtr text, xmlChar *content) {
 2718|     21|    if ((text->content != NULL) &&
  ------------------
  |  Branch (2718:9): [True: 0, False: 21]
  ------------------
 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|     21|    text->content = content;
 2729|       |    text->properties = NULL;
 2730|     21|}
tree.c:xmlTextAddContent:
 2733|     22|xmlTextAddContent(xmlNodePtr text, const xmlChar *content, int len) {
 2734|     22|    xmlChar *merged;
 2735|       |
 2736|     22|    if (content == NULL)
  ------------------
  |  Branch (2736:9): [True: 0, False: 22]
  ------------------
 2737|      0|        return(0);
 2738|       |
 2739|     22|    merged = xmlStrncatNew(text->content, content, len);
 2740|     22|    if (merged == NULL)
  ------------------
  |  Branch (2740:9): [True: 1, False: 21]
  ------------------
 2741|      1|        return(-1);
 2742|       |
 2743|     21|    xmlTextSetContent(text, merged);
 2744|     21|    return(0);
 2745|     22|}
tree.c:xmlUnlinkNodeInternal:
 3485|   500k|xmlUnlinkNodeInternal(xmlNodePtr cur) {
 3486|   500k|    if (cur->parent != NULL) {
  ------------------
  |  Branch (3486:9): [True: 472k, False: 27.8k]
  ------------------
 3487|   472k|	xmlNodePtr parent;
 3488|   472k|	parent = cur->parent;
 3489|   472k|	if (cur->type == XML_ATTRIBUTE_NODE) {
  ------------------
  |  Branch (3489:6): [True: 1.07k, False: 471k]
  ------------------
 3490|  1.07k|	    if (parent->properties == (xmlAttrPtr) cur)
  ------------------
  |  Branch (3490:10): [True: 1.02k, False: 46]
  ------------------
 3491|  1.02k|		parent->properties = ((xmlAttrPtr) cur)->next;
 3492|   471k|	} else {
 3493|   471k|	    if (parent->children == cur)
  ------------------
  |  Branch (3493:10): [True: 156k, False: 314k]
  ------------------
 3494|   156k|		parent->children = cur->next;
 3495|   471k|	    if (parent->last == cur)
  ------------------
  |  Branch (3495:10): [True: 33.8k, False: 437k]
  ------------------
 3496|  33.8k|		parent->last = cur->prev;
 3497|   471k|	}
 3498|   472k|	cur->parent = NULL;
 3499|   472k|    }
 3500|       |
 3501|   500k|    if (cur->next != NULL)
  ------------------
  |  Branch (3501:9): [True: 438k, False: 62.3k]
  ------------------
 3502|   438k|        cur->next->prev = cur->prev;
 3503|   500k|    if (cur->prev != NULL)
  ------------------
  |  Branch (3503:9): [True: 314k, False: 185k]
  ------------------
 3504|   314k|        cur->prev->next = cur->next;
 3505|   500k|    cur->next = NULL;
 3506|       |    cur->prev = NULL;
 3507|   500k|}
tree.c:xmlCopyPropInternal:
 3660|   894k|xmlCopyPropInternal(xmlDocPtr doc, xmlNodePtr target, xmlAttrPtr cur) {
 3661|   894k|    xmlAttrPtr ret = NULL;
 3662|       |
 3663|   894k|    if (cur == NULL) return(NULL);
  ------------------
  |  Branch (3663:9): [True: 0, False: 894k]
  ------------------
 3664|   894k|    if ((target != NULL) && (target->type != XML_ELEMENT_NODE))
  ------------------
  |  Branch (3664:9): [True: 894k, False: 0]
  |  Branch (3664:29): [True: 0, False: 894k]
  ------------------
 3665|      0|        return(NULL);
 3666|   894k|    if (target != NULL)
  ------------------
  |  Branch (3666:9): [True: 894k, False: 0]
  ------------------
 3667|   894k|	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|   894k|    if (ret == NULL) return(NULL);
  ------------------
  |  Branch (3676:9): [True: 1.73k, False: 892k]
  ------------------
 3677|   892k|    ret->parent = target;
 3678|       |
 3679|   892k|    if ((cur->ns != NULL) && (target != NULL)) {
  ------------------
  |  Branch (3679:9): [True: 193k, False: 699k]
  |  Branch (3679:30): [True: 193k, False: 0]
  ------------------
 3680|   193k|      xmlNsPtr ns;
 3681|   193k|      int res;
 3682|       |
 3683|   193k|      res = xmlSearchNsSafe(target, cur->ns->prefix, &ns);
 3684|   193k|      if (res < 0)
  ------------------
  |  Branch (3684:11): [True: 1, False: 193k]
  ------------------
 3685|      1|          goto error;
 3686|   193k|      if (ns == NULL) {
  ------------------
  |  Branch (3686:11): [True: 728, False: 192k]
  ------------------
 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|    728|        res = xmlSearchNsSafe(cur->parent, cur->ns->prefix, &ns);
 3693|    728|        if (res < 0)
  ------------------
  |  Branch (3693:13): [True: 0, False: 728]
  ------------------
 3694|      0|          goto error;
 3695|    728|        if (ns != NULL) {
  ------------------
  |  Branch (3695:13): [True: 728, False: 0]
  ------------------
 3696|    728|          xmlNodePtr root = target;
 3697|    728|          xmlNodePtr pred = NULL;
 3698|       |
 3699|    902|          while (root->parent != NULL) {
  ------------------
  |  Branch (3699:18): [True: 174, False: 728]
  ------------------
 3700|    174|            pred = root;
 3701|    174|            root = root->parent;
 3702|    174|          }
 3703|    728|          if (root == (xmlNodePtr) target->doc) {
  ------------------
  |  Branch (3703:15): [True: 0, False: 728]
  ------------------
 3704|       |            /* correct possibly cycling above the document elt */
 3705|      0|            root = pred;
 3706|      0|          }
 3707|    728|          ret->ns = xmlNewNs(root, ns->href, ns->prefix);
 3708|    728|          if (ret->ns == NULL)
  ------------------
  |  Branch (3708:15): [True: 0, False: 728]
  ------------------
 3709|      0|              goto error;
 3710|    728|        }
 3711|   192k|      } 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|   192k|        if (xmlStrEqual(ns->href, cur->ns->href)) {
  ------------------
  |  Branch (3717:13): [True: 189k, False: 2.59k]
  ------------------
 3718|       |          /* this is the nice case */
 3719|   189k|          ret->ns = ns;
 3720|   189k|        } else {
 3721|       |          /*
 3722|       |           * we are in trouble: we need a new reconciled namespace.
 3723|       |           * This is expensive
 3724|       |           */
 3725|  2.59k|          ret->ns = xmlNewReconciledNs(target, cur->ns);
 3726|  2.59k|          if (ret->ns == NULL)
  ------------------
  |  Branch (3726:15): [True: 1, False: 2.59k]
  ------------------
 3727|      1|              goto error;
 3728|  2.59k|        }
 3729|   192k|      }
 3730|       |
 3731|   193k|    } else
 3732|   699k|        ret->ns = NULL;
 3733|       |
 3734|   892k|    if (cur->children != NULL) {
  ------------------
  |  Branch (3734:9): [True: 865k, False: 26.8k]
  ------------------
 3735|   865k|	xmlNodePtr tmp;
 3736|       |
 3737|   865k|	ret->children = xmlStaticCopyNodeList(cur->children, ret->doc, (xmlNodePtr) ret);
 3738|   865k|        if (ret->children == NULL)
  ------------------
  |  Branch (3738:13): [True: 32, False: 865k]
  ------------------
 3739|     32|            goto error;
 3740|   865k|	ret->last = NULL;
 3741|   865k|	tmp = ret->children;
 3742|  1.73M|	while (tmp != NULL) {
  ------------------
  |  Branch (3742:9): [True: 866k, False: 865k]
  ------------------
 3743|       |	    /* tmp->parent = (xmlNodePtr)ret; */
 3744|   866k|	    if (tmp->next == NULL)
  ------------------
  |  Branch (3744:10): [True: 865k, False: 622]
  ------------------
 3745|   865k|	        ret->last = tmp;
 3746|   866k|	    tmp = tmp->next;
 3747|   866k|	}
 3748|   865k|    }
 3749|       |    /*
 3750|       |     * Try to handle IDs
 3751|       |     */
 3752|   892k|    if ((target != NULL) && (cur != NULL) &&
  ------------------
  |  Branch (3752:9): [True: 892k, False: 0]
  |  Branch (3752:29): [True: 892k, False: 0]
  ------------------
 3753|   892k|	(target->doc != NULL) && (cur->doc != NULL) &&
  ------------------
  |  Branch (3753:2): [True: 892k, False: 93]
  |  Branch (3753:27): [True: 892k, False: 0]
  ------------------
 3754|   892k|        (cur->parent != NULL) &&
  ------------------
  |  Branch (3754:9): [True: 892k, False: 0]
  ------------------
 3755|   892k|        (cur->children != NULL)) {
  ------------------
  |  Branch (3755:9): [True: 865k, False: 26.8k]
  ------------------
 3756|   865k|        int res = xmlIsID(cur->doc, cur->parent, cur);
 3757|       |
 3758|   865k|        if (res < 0)
  ------------------
  |  Branch (3758:13): [True: 3, False: 865k]
  ------------------
 3759|      3|            goto error;
 3760|   865k|	if (res != 0) {
  ------------------
  |  Branch (3760:6): [True: 2.86k, False: 862k]
  ------------------
 3761|  2.86k|	    xmlChar *id;
 3762|       |
 3763|  2.86k|	    id = xmlNodeGetContent((xmlNodePtr) cur);
 3764|  2.86k|	    if (id == NULL)
  ------------------
  |  Branch (3764:10): [True: 3, False: 2.86k]
  ------------------
 3765|      3|                goto error;
 3766|  2.86k|            res = xmlAddIDSafe(ret, id);
 3767|  2.86k|	    xmlFree(id);
 3768|  2.86k|            if (res < 0)
  ------------------
  |  Branch (3768:17): [True: 6, False: 2.85k]
  ------------------
 3769|      6|                goto error;
 3770|  2.86k|	}
 3771|   865k|    }
 3772|   892k|    return(ret);
 3773|       |
 3774|     46|error:
 3775|     46|    xmlFreeProp(ret);
 3776|       |    return(NULL);
 3777|   892k|}
tree.c:xmlGetEntityFromDtd:
  119|  2.26k|xmlGetEntityFromDtd(const xmlDtd *dtd, const xmlChar *name) {
  120|  2.26k|    xmlEntitiesTablePtr table;
  121|       |
  122|  2.26k|    if((dtd != NULL) && (dtd->entities != NULL)) {
  ------------------
  |  Branch (122:8): [True: 2.26k, False: 0]
  |  Branch (122:25): [True: 2.26k, False: 0]
  ------------------
  123|  2.26k|	table = (xmlEntitiesTablePtr) dtd->entities;
  124|  2.26k|	return((xmlEntityPtr) xmlHashLookup(table, name));
  125|       |	/* return(xmlGetEntityFromTable(table, name)); */
  126|  2.26k|    }
  127|      0|    return(NULL);
  128|  2.26k|}
tree.c:xmlGetParameterEntityFromDtd:
  137|    355|xmlGetParameterEntityFromDtd(const xmlDtd *dtd, const xmlChar *name) {
  138|    355|    xmlEntitiesTablePtr table;
  139|       |
  140|    355|    if ((dtd != NULL) && (dtd->pentities != NULL)) {
  ------------------
  |  Branch (140:9): [True: 355, False: 0]
  |  Branch (140:26): [True: 355, False: 0]
  ------------------
  141|    355|	table = (xmlEntitiesTablePtr) dtd->pentities;
  142|    355|	return((xmlEntityPtr) xmlHashLookup(table, name));
  143|       |	/* return(xmlGetEntityFromTable(table, name)); */
  144|    355|    }
  145|      0|    return(NULL);
  146|    355|}
tree.c:xmlGetLineNoInternal:
 4398|  78.5k|{
 4399|  78.5k|    long result = -1;
 4400|       |
 4401|  78.5k|    if (depth >= 5)
  ------------------
  |  Branch (4401:9): [True: 7.70k, False: 70.8k]
  ------------------
 4402|  7.70k|        return(-1);
 4403|       |
 4404|  70.8k|    if (!node)
  ------------------
  |  Branch (4404:9): [True: 0, False: 70.8k]
  ------------------
 4405|      0|        return result;
 4406|  70.8k|    if ((node->type == XML_ELEMENT_NODE) ||
  ------------------
  |  Branch (4406:9): [True: 56.0k, False: 14.8k]
  ------------------
 4407|  14.8k|        (node->type == XML_TEXT_NODE) ||
  ------------------
  |  Branch (4407:9): [True: 13.2k, False: 1.59k]
  ------------------
 4408|  1.59k|	(node->type == XML_COMMENT_NODE) ||
  ------------------
  |  Branch (4408:2): [True: 79, False: 1.51k]
  ------------------
 4409|  69.9k|	(node->type == XML_PI_NODE)) {
  ------------------
  |  Branch (4409:2): [True: 625, False: 888]
  ------------------
 4410|  69.9k|	if (node->line == 65535) {
  ------------------
  |  Branch (4410:6): [True: 54.9k, False: 15.0k]
  ------------------
 4411|  54.9k|	    if ((node->type == XML_TEXT_NODE) && (node->psvi != NULL))
  ------------------
  |  Branch (4411:10): [True: 13.2k, False: 41.6k]
  |  Branch (4411:43): [True: 2.40k, False: 10.8k]
  ------------------
 4412|  2.40k|	        result = XML_PTR_TO_INT(node->psvi);
  ------------------
  |  |   58|  2.40k|#define XML_PTR_TO_INT(p) ((XML_INTPTR_T) (p))
  ------------------
 4413|  52.5k|	    else if ((node->type == XML_ELEMENT_NODE) &&
  ------------------
  |  Branch (4413:15): [True: 40.9k, False: 11.5k]
  ------------------
 4414|  40.9k|	             (node->children != NULL))
  ------------------
  |  Branch (4414:15): [True: 3.36k, False: 37.6k]
  ------------------
 4415|  3.36k|	        result = xmlGetLineNoInternal(node->children, depth + 1);
 4416|  49.1k|	    else if (node->next != NULL)
  ------------------
  |  Branch (4416:15): [True: 15.6k, False: 33.5k]
  ------------------
 4417|  15.6k|	        result = xmlGetLineNoInternal(node->next, depth + 1);
 4418|  33.5k|	    else if (node->prev != NULL)
  ------------------
  |  Branch (4418:15): [True: 23.6k, False: 9.96k]
  ------------------
 4419|  23.6k|	        result = xmlGetLineNoInternal(node->prev, depth + 1);
 4420|  54.9k|	}
 4421|  69.9k|	if ((result == -1) || (result == 65535))
  ------------------
  |  Branch (4421:6): [True: 32.7k, False: 37.2k]
  |  Branch (4421:24): [True: 31.0k, False: 6.19k]
  ------------------
 4422|  63.7k|	    result = node->line;
 4423|  69.9k|    } else if ((node->prev != NULL) &&
  ------------------
  |  Branch (4423:16): [True: 807, False: 81]
  ------------------
 4424|    807|             ((node->prev->type == XML_ELEMENT_NODE) ||
  ------------------
  |  Branch (4424:15): [True: 305, False: 502]
  ------------------
 4425|    502|	      (node->prev->type == XML_TEXT_NODE) ||
  ------------------
  |  Branch (4425:8): [True: 43, False: 459]
  ------------------
 4426|    459|	      (node->prev->type == XML_COMMENT_NODE) ||
  ------------------
  |  Branch (4426:8): [True: 0, False: 459]
  ------------------
 4427|    459|	      (node->prev->type == XML_PI_NODE)))
  ------------------
  |  Branch (4427:8): [True: 155, False: 304]
  ------------------
 4428|    503|        result = xmlGetLineNoInternal(node->prev, depth + 1);
 4429|    385|    else if ((node->parent != NULL) &&
  ------------------
  |  Branch (4429:14): [True: 385, False: 0]
  ------------------
 4430|    385|             (node->parent->type == XML_ELEMENT_NODE))
  ------------------
  |  Branch (4430:14): [True: 379, False: 6]
  ------------------
 4431|    379|        result = xmlGetLineNoInternal(node->parent, depth + 1);
 4432|       |
 4433|  70.8k|    return result;
 4434|  70.8k|}
tree.c:xmlBufGetChildContent:
 5157|   172k|xmlBufGetChildContent(xmlBufPtr buf, const xmlNode *tree) {
 5158|   172k|    const xmlNode *cur = tree->children;
 5159|       |
 5160|  19.2M|    while (cur != NULL) {
  ------------------
  |  Branch (5160:12): [True: 19.2M, False: 1.47k]
  ------------------
 5161|  19.2M|        switch (cur->type) {
 5162|  3.80M|            case XML_TEXT_NODE:
  ------------------
  |  Branch (5162:13): [True: 3.80M, False: 15.4M]
  ------------------
 5163|  3.82M|            case XML_CDATA_SECTION_NODE:
  ------------------
  |  Branch (5163:13): [True: 23.4k, False: 19.2M]
  ------------------
 5164|  3.82M|                xmlBufCat(buf, cur->content);
 5165|  3.82M|                break;
 5166|       |
 5167|  2.26k|            case XML_ENTITY_REF_NODE:
  ------------------
  |  Branch (5167:13): [True: 2.26k, False: 19.2M]
  ------------------
 5168|  2.26k|                xmlBufGetEntityRefContent(buf, cur);
 5169|  2.26k|                break;
 5170|       |
 5171|  15.4M|            default:
  ------------------
  |  Branch (5171:13): [True: 15.4M, False: 3.83M]
  ------------------
 5172|  15.4M|                if (cur->children != NULL) {
  ------------------
  |  Branch (5172:21): [True: 13.6M, False: 1.75M]
  ------------------
 5173|  13.6M|                    cur = cur->children;
 5174|  13.6M|                    continue;
 5175|  13.6M|                }
 5176|  1.75M|                break;
 5177|  19.2M|        }
 5178|       |
 5179|  19.2M|        while (cur->next == NULL) {
  ------------------
  |  Branch (5179:16): [True: 13.8M, False: 5.41M]
  ------------------
 5180|  13.8M|            cur = cur->parent;
 5181|  13.8M|            if (cur == tree)
  ------------------
  |  Branch (5181:17): [True: 171k, False: 13.6M]
  ------------------
 5182|   171k|                return;
 5183|  13.8M|        }
 5184|  5.41M|        cur = cur->next;
 5185|  5.41M|    }
 5186|   172k|}
tree.c:xmlBufGetEntityRefContent:
 5126|  2.84k|xmlBufGetEntityRefContent(xmlBufPtr buf, const xmlNode *ref) {
 5127|  2.84k|    xmlEntityPtr ent;
 5128|       |
 5129|  2.84k|    if (ref->children != NULL) {
  ------------------
  |  Branch (5129:9): [True: 2.19k, False: 651]
  ------------------
 5130|  2.19k|        ent = (xmlEntityPtr) ref->children;
 5131|  2.19k|    } else {
 5132|       |        /* lookup entity declaration */
 5133|    651|        ent = xmlGetDocEntity(ref->doc, ref->name);
 5134|    651|        if (ent == NULL)
  ------------------
  |  Branch (5134:13): [True: 651, False: 0]
  ------------------
 5135|    651|            return;
 5136|    651|    }
 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.19k|    if (ent->etype == XML_INTERNAL_PREDEFINED_ENTITY) {
  ------------------
  |  Branch (5143:9): [True: 0, False: 2.19k]
  ------------------
 5144|      0|        xmlBufCat(buf, ent->content);
 5145|      0|        return;
 5146|      0|    }
 5147|       |
 5148|  2.19k|    if (ent->flags & XML_ENT_EXPANDING)
  ------------------
  |  |   22|  2.19k|#define XML_ENT_EXPANDING   (1u << 3)
  ------------------
  |  Branch (5148:9): [True: 0, False: 2.19k]
  ------------------
 5149|      0|        return;
 5150|       |
 5151|  2.19k|    ent->flags |= XML_ENT_EXPANDING;
  ------------------
  |  |   22|  2.19k|#define XML_ENT_EXPANDING   (1u << 3)
  ------------------
 5152|  2.19k|    xmlBufGetChildContent(buf, (xmlNodePtr) ent);
 5153|  2.19k|    ent->flags &= ~XML_ENT_EXPANDING;
  ------------------
  |  |   22|  2.19k|#define XML_ENT_EXPANDING   (1u << 3)
  ------------------
 5154|  2.19k|}
tree.c:xmlTreeEnsureXMLDecl:
 5626|   228k|{
 5627|   228k|    xmlNsPtr ns;
 5628|       |
 5629|   228k|    ns = doc->oldNs;
 5630|   228k|    if (ns != NULL)
  ------------------
  |  Branch (5630:9): [True: 223k, False: 4.85k]
  ------------------
 5631|   223k|	return (ns);
 5632|       |
 5633|  4.85k|    ns = xmlNewXmlNs();
 5634|  4.85k|    doc->oldNs = ns;
 5635|       |
 5636|  4.85k|    return(ns);
 5637|   228k|}
tree.c:xmlNewXmlNs:
 5594|  5.04k|xmlNewXmlNs(void) {
 5595|  5.04k|    xmlNsPtr ns;
 5596|       |
 5597|  5.04k|    ns = (xmlNsPtr) xmlMalloc(sizeof(xmlNs));
 5598|  5.04k|    if (ns == NULL)
  ------------------
  |  Branch (5598:9): [True: 7, False: 5.04k]
  ------------------
 5599|      7|        return(NULL);
 5600|  5.04k|    memset(ns, 0, sizeof(xmlNs));
 5601|  5.04k|    ns->type = XML_LOCAL_NAMESPACE;
  ------------------
  |  |  500|  5.04k|#define XML_LOCAL_NAMESPACE XML_NAMESPACE_DECL
  ------------------
 5602|  5.04k|    ns->href = xmlStrdup(XML_XML_NAMESPACE);
  ------------------
  |  |  146|  5.04k|    (const xmlChar *) "http://www.w3.org/XML/1998/namespace"
  ------------------
 5603|  5.04k|    if (ns->href == NULL) {
  ------------------
  |  Branch (5603:9): [True: 9, False: 5.03k]
  ------------------
 5604|      9|        xmlFreeNs(ns);
 5605|      9|        return(NULL);
 5606|      9|    }
 5607|  5.03k|    ns->prefix = xmlStrdup(BAD_CAST "xml");
  ------------------
  |  |   34|  5.03k|#define BAD_CAST (xmlChar *)
  ------------------
 5608|  5.03k|    if (ns->prefix == NULL) {
  ------------------
  |  Branch (5608:9): [True: 8, False: 5.02k]
  ------------------
 5609|      8|        xmlFreeNs(ns);
 5610|      8|        return(NULL);
 5611|      8|    }
 5612|       |
 5613|  5.02k|    return(ns);
 5614|  5.03k|}
tree.c:xmlNsInScope:
 5759|  40.9k|{
 5760|  40.9k|    xmlNsPtr tst;
 5761|       |
 5762|   172k|    while ((node != NULL) && (node != ancestor)) {
  ------------------
  |  Branch (5762:12): [True: 172k, False: 0]
  |  Branch (5762:30): [True: 170k, False: 1.95k]
  ------------------
 5763|   170k|        if ((node->type == XML_ENTITY_REF_NODE) ||
  ------------------
  |  Branch (5763:13): [True: 0, False: 170k]
  ------------------
 5764|   170k|            (node->type == XML_ENTITY_DECL))
  ------------------
  |  Branch (5764:13): [True: 0, False: 170k]
  ------------------
 5765|      0|            return (-1);
 5766|   170k|        if (node->type == XML_ELEMENT_NODE) {
  ------------------
  |  Branch (5766:13): [True: 170k, False: 0]
  ------------------
 5767|   170k|            tst = node->nsDef;
 5768|   235k|            while (tst != NULL) {
  ------------------
  |  Branch (5768:20): [True: 104k, False: 131k]
  ------------------
 5769|   104k|                if ((tst->prefix == NULL)
  ------------------
  |  Branch (5769:21): [True: 10.4k, False: 94.0k]
  ------------------
 5770|  10.4k|                    && (prefix == NULL))
  ------------------
  |  Branch (5770:24): [True: 4.53k, False: 5.91k]
  ------------------
 5771|  4.53k|                    return (0);
 5772|  99.9k|                if ((tst->prefix != NULL)
  ------------------
  |  Branch (5772:21): [True: 94.0k, False: 5.91k]
  ------------------
 5773|  94.0k|                    && (prefix != NULL)
  ------------------
  |  Branch (5773:24): [True: 81.0k, False: 13.0k]
  ------------------
 5774|  81.0k|                    && (xmlStrEqual(tst->prefix, prefix)))
  ------------------
  |  Branch (5774:24): [True: 34.4k, False: 46.6k]
  ------------------
 5775|  34.4k|                    return (0);
 5776|  65.5k|                tst = tst->next;
 5777|  65.5k|            }
 5778|   170k|        }
 5779|   131k|        node = node->parent;
 5780|   131k|    }
 5781|  1.95k|    if (node != ancestor)
  ------------------
  |  Branch (5781:9): [True: 0, False: 1.95k]
  ------------------
 5782|      0|        return (-1);
 5783|  1.95k|    return (1);
 5784|  1.95k|}
tree.c:xmlNewReconciledNs:
 5909|  2.59k|xmlNewReconciledNs(xmlNodePtr tree, xmlNsPtr ns) {
 5910|  2.59k|    xmlNsPtr def;
 5911|  2.59k|    xmlChar prefix[50];
 5912|  2.59k|    int counter = 1;
 5913|  2.59k|    int res;
 5914|       |
 5915|  2.59k|    if ((tree == NULL) || (tree->type != XML_ELEMENT_NODE)) {
  ------------------
  |  Branch (5915:9): [True: 0, False: 2.59k]
  |  Branch (5915:27): [True: 0, False: 2.59k]
  ------------------
 5916|      0|	return(NULL);
 5917|      0|    }
 5918|  2.59k|    if ((ns == NULL) || (ns->type != XML_NAMESPACE_DECL)) {
  ------------------
  |  Branch (5918:9): [True: 0, False: 2.59k]
  |  Branch (5918:25): [True: 0, False: 2.59k]
  ------------------
 5919|      0|	return(NULL);
 5920|      0|    }
 5921|       |    /*
 5922|       |     * Search an existing namespace definition inherited.
 5923|       |     */
 5924|  2.59k|    res = xmlSearchNsByHrefSafe(tree, ns->href, &def);
 5925|  2.59k|    if (res < 0)
  ------------------
  |  Branch (5925:9): [True: 0, False: 2.59k]
  ------------------
 5926|      0|        return(NULL);
 5927|  2.59k|    if (def != NULL)
  ------------------
  |  Branch (5927:9): [True: 1.95k, False: 635]
  ------------------
 5928|  1.95k|        return(def);
 5929|       |
 5930|       |    /*
 5931|       |     * Find a close prefix which is not already in use.
 5932|       |     * Let's strip namespace prefixes longer than 20 chars !
 5933|       |     */
 5934|    635|    if (ns->prefix == NULL)
  ------------------
  |  Branch (5934:9): [True: 0, False: 635]
  ------------------
 5935|      0|	snprintf((char *) prefix, sizeof(prefix), "default");
 5936|    635|    else
 5937|    635|	snprintf((char *) prefix, sizeof(prefix), "%.20s", (char *)ns->prefix);
 5938|       |
 5939|    635|    res = xmlSearchNsSafe(tree, prefix, &def);
 5940|    635|    if (res < 0)
  ------------------
  |  Branch (5940:9): [True: 0, False: 635]
  ------------------
 5941|      0|        return(NULL);
 5942|  2.12k|    while (def != NULL) {
  ------------------
  |  Branch (5942:12): [True: 1.49k, False: 635]
  ------------------
 5943|  1.49k|        if (counter > 1000) return(NULL);
  ------------------
  |  Branch (5943:13): [True: 0, False: 1.49k]
  ------------------
 5944|  1.49k|	if (ns->prefix == NULL)
  ------------------
  |  Branch (5944:6): [True: 0, False: 1.49k]
  ------------------
 5945|      0|	    snprintf((char *) prefix, sizeof(prefix), "default%d", counter++);
 5946|  1.49k|	else
 5947|  1.49k|	    snprintf((char *) prefix, sizeof(prefix), "%.20s%d",
 5948|  1.49k|		(char *)ns->prefix, counter++);
 5949|  1.49k|	res = xmlSearchNsSafe(tree, prefix, &def);
 5950|  1.49k|        if (res < 0)
  ------------------
  |  Branch (5950:13): [True: 0, False: 1.49k]
  ------------------
 5951|      0|            return(NULL);
 5952|  1.49k|    }
 5953|       |
 5954|       |    /*
 5955|       |     * OK, now we are ready to create a new one.
 5956|       |     */
 5957|    635|    def = xmlNewNs(tree, ns->href, prefix);
 5958|    635|    return(def);
 5959|    635|}
tree.c:xmlGetPropNodeInternal:
 6119|  8.27M|{
 6120|  8.27M|    xmlAttrPtr prop;
 6121|       |
 6122|       |    /* Avoid unused variable warning if features are disabled. */
 6123|  8.27M|    (void) useDTD;
 6124|       |
 6125|  8.27M|    if ((node == NULL) || (node->type != XML_ELEMENT_NODE) || (name == NULL))
  ------------------
  |  Branch (6125:9): [True: 0, False: 8.27M]
  |  Branch (6125:27): [True: 12.6k, False: 8.26M]
  |  Branch (6125:63): [True: 0, False: 8.26M]
  ------------------
 6126|  12.6k|	return(NULL);
 6127|       |
 6128|  8.26M|    if (node->properties != NULL) {
  ------------------
  |  Branch (6128:9): [True: 507k, False: 7.75M]
  ------------------
 6129|   507k|	prop = node->properties;
 6130|   507k|	if (nsName == NULL) {
  ------------------
  |  Branch (6130:6): [True: 51.7k, False: 455k]
  ------------------
 6131|       |	    /*
 6132|       |	    * We want the attr to be in no namespace.
 6133|       |	    */
 6134|  85.5k|	    do {
 6135|  85.5k|		if ((prop->ns == NULL) && xmlStrEqual(prop->name, name)) {
  ------------------
  |  Branch (6135:7): [True: 77.1k, False: 8.36k]
  |  Branch (6135:29): [True: 25.1k, False: 52.0k]
  ------------------
 6136|  25.1k|		    return(prop);
 6137|  25.1k|		}
 6138|  60.4k|		prop = prop->next;
 6139|  60.4k|	    } while (prop != NULL);
  ------------------
  |  Branch (6139:15): [True: 33.7k, False: 26.6k]
  ------------------
 6140|   455k|	} else {
 6141|       |	    /*
 6142|       |	    * We want the attr to be in the specified namespace.
 6143|       |	    */
 6144|   538k|	    do {
 6145|   538k|		if ((prop->ns != NULL) && xmlStrEqual(prop->name, name) &&
  ------------------
  |  Branch (6145:7): [True: 358k, False: 179k]
  |  Branch (6145:29): [True: 311k, False: 47.5k]
  ------------------
 6146|   311k|		    ((prop->ns->href == nsName) ||
  ------------------
  |  Branch (6146:8): [True: 1.48k, False: 309k]
  ------------------
 6147|   309k|		     xmlStrEqual(prop->ns->href, nsName)))
  ------------------
  |  Branch (6147:8): [True: 309k, False: 677]
  ------------------
 6148|   310k|		{
 6149|   310k|		    return(prop);
 6150|   310k|		}
 6151|   227k|		prop = prop->next;
 6152|   227k|	    } while (prop != NULL);
  ------------------
  |  Branch (6152:15): [True: 82.3k, False: 145k]
  ------------------
 6153|   455k|	}
 6154|   507k|    }
 6155|       |
 6156|  7.92M|    if (! useDTD)
  ------------------
  |  Branch (6156:9): [True: 7.92M, False: 0]
  ------------------
 6157|  7.92M|	return(NULL);
 6158|       |    /*
 6159|       |     * Check if there is a default/fixed attribute declaration in
 6160|       |     * the internal or external subset.
 6161|       |     */
 6162|      0|    if ((node->doc != NULL) && (node->doc->intSubset != NULL)) {
  ------------------
  |  Branch (6162:9): [True: 0, False: 0]
  |  Branch (6162:32): [True: 0, False: 0]
  ------------------
 6163|      0|	xmlDocPtr doc = node->doc;
 6164|      0|	xmlAttributePtr attrDecl = NULL;
 6165|      0|	xmlChar *elemQName, *tmpstr = NULL;
 6166|       |
 6167|       |	/*
 6168|       |	* We need the QName of the element for the DTD-lookup.
 6169|       |	*/
 6170|      0|	if ((node->ns != NULL) && (node->ns->prefix != NULL)) {
  ------------------
  |  Branch (6170:6): [True: 0, False: 0]
  |  Branch (6170:28): [True: 0, False: 0]
  ------------------
 6171|      0|	    tmpstr = xmlStrdup(node->ns->prefix);
 6172|      0|	    if (tmpstr == NULL)
  ------------------
  |  Branch (6172:10): [True: 0, False: 0]
  ------------------
 6173|      0|		return(NULL);
 6174|      0|	    tmpstr = xmlStrcat(tmpstr, BAD_CAST ":");
  ------------------
  |  |   34|      0|#define BAD_CAST (xmlChar *)
  ------------------
 6175|      0|	    if (tmpstr == NULL)
  ------------------
  |  Branch (6175:10): [True: 0, False: 0]
  ------------------
 6176|      0|		return(NULL);
 6177|      0|	    tmpstr = xmlStrcat(tmpstr, node->name);
 6178|      0|	    if (tmpstr == NULL)
  ------------------
  |  Branch (6178:10): [True: 0, False: 0]
  ------------------
 6179|      0|		return(NULL);
 6180|      0|	    elemQName = tmpstr;
 6181|      0|	} else
 6182|      0|	    elemQName = (xmlChar *) node->name;
 6183|      0|	if (nsName == NULL) {
  ------------------
  |  Branch (6183:6): [True: 0, False: 0]
  ------------------
 6184|       |	    /*
 6185|       |	    * The common and nice case: Attr in no namespace.
 6186|       |	    */
 6187|      0|	    attrDecl = xmlGetDtdQAttrDesc(doc->intSubset,
 6188|      0|		elemQName, name, NULL);
 6189|      0|	    if ((attrDecl == NULL) && (doc->extSubset != NULL)) {
  ------------------
  |  Branch (6189:10): [True: 0, False: 0]
  |  Branch (6189:32): [True: 0, False: 0]
  ------------------
 6190|      0|		attrDecl = xmlGetDtdQAttrDesc(doc->extSubset,
 6191|      0|		    elemQName, name, NULL);
 6192|      0|	    }
 6193|      0|        } else if (xmlStrEqual(nsName, XML_XML_NAMESPACE)) {
  ------------------
  |  |  146|      0|    (const xmlChar *) "http://www.w3.org/XML/1998/namespace"
  ------------------
  |  Branch (6193:20): [True: 0, False: 0]
  ------------------
 6194|       |	    /*
 6195|       |	    * The XML namespace must be bound to prefix 'xml'.
 6196|       |	    */
 6197|      0|	    attrDecl = xmlGetDtdQAttrDesc(doc->intSubset,
 6198|      0|		elemQName, name, BAD_CAST "xml");
  ------------------
  |  |   34|      0|#define BAD_CAST (xmlChar *)
  ------------------
 6199|      0|	    if ((attrDecl == NULL) && (doc->extSubset != NULL)) {
  ------------------
  |  Branch (6199:10): [True: 0, False: 0]
  |  Branch (6199:32): [True: 0, False: 0]
  ------------------
 6200|      0|		attrDecl = xmlGetDtdQAttrDesc(doc->extSubset,
 6201|      0|		    elemQName, name, BAD_CAST "xml");
  ------------------
  |  |   34|      0|#define BAD_CAST (xmlChar *)
  ------------------
 6202|      0|	    }
 6203|      0|	} else {
 6204|      0|	    xmlNsPtr *nsList, *cur;
 6205|       |
 6206|       |	    /*
 6207|       |	    * The ugly case: Search using the prefixes of in-scope
 6208|       |	    * ns-decls corresponding to @nsName.
 6209|       |	    */
 6210|      0|	    nsList = xmlGetNsList(node->doc, node);
 6211|      0|	    if (nsList == NULL) {
  ------------------
  |  Branch (6211:10): [True: 0, False: 0]
  ------------------
 6212|      0|		if (tmpstr != NULL)
  ------------------
  |  Branch (6212:7): [True: 0, False: 0]
  ------------------
 6213|      0|		    xmlFree(tmpstr);
 6214|      0|		return(NULL);
 6215|      0|	    }
 6216|      0|	    cur = nsList;
 6217|      0|	    while (*cur != NULL) {
  ------------------
  |  Branch (6217:13): [True: 0, False: 0]
  ------------------
 6218|      0|		if (xmlStrEqual((*cur)->href, nsName)) {
  ------------------
  |  Branch (6218:7): [True: 0, False: 0]
  ------------------
 6219|      0|		    attrDecl = xmlGetDtdQAttrDesc(doc->intSubset, elemQName,
 6220|      0|			name, (*cur)->prefix);
 6221|      0|		    if (attrDecl)
  ------------------
  |  Branch (6221:11): [True: 0, False: 0]
  ------------------
 6222|      0|			break;
 6223|      0|		    if (doc->extSubset != NULL) {
  ------------------
  |  Branch (6223:11): [True: 0, False: 0]
  ------------------
 6224|      0|			attrDecl = xmlGetDtdQAttrDesc(doc->extSubset, elemQName,
 6225|      0|			    name, (*cur)->prefix);
 6226|      0|			if (attrDecl)
  ------------------
  |  Branch (6226:8): [True: 0, False: 0]
  ------------------
 6227|      0|			    break;
 6228|      0|		    }
 6229|      0|		}
 6230|      0|		cur++;
 6231|      0|	    }
 6232|      0|	    xmlFree(nsList);
 6233|      0|	}
 6234|      0|	if (tmpstr != NULL)
  ------------------
  |  Branch (6234:6): [True: 0, False: 0]
  ------------------
 6235|      0|	    xmlFree(tmpstr);
 6236|       |	/*
 6237|       |	* Only default/fixed attrs are relevant.
 6238|       |	*/
 6239|      0|	if ((attrDecl != NULL) && (attrDecl->defaultValue != NULL))
  ------------------
  |  Branch (6239:6): [True: 0, False: 0]
  |  Branch (6239:28): [True: 0, False: 0]
  ------------------
 6240|      0|	    return((xmlAttrPtr) attrDecl);
 6241|      0|    }
 6242|       |
 6243|      0|    return(NULL);
 6244|      0|}
tree.c:xmlGetPropNodeValueInternal:
 6248|   333k|{
 6249|   333k|    if (prop == NULL)
  ------------------
  |  Branch (6249:9): [True: 0, False: 333k]
  ------------------
 6250|      0|	return(NULL);
 6251|   333k|    if (prop->type == XML_ATTRIBUTE_NODE) {
  ------------------
  |  Branch (6251:9): [True: 333k, False: 0]
  ------------------
 6252|   333k|	return(xmlNodeGetContent((xmlNodePtr) prop));
 6253|   333k|    } else if (prop->type == XML_ATTRIBUTE_DECL) {
  ------------------
  |  Branch (6253:16): [True: 0, False: 0]
  ------------------
 6254|      0|	return(xmlStrdup(((xmlAttributePtr)prop)->defaultValue));
 6255|      0|    }
 6256|      0|    return(NULL);
 6257|   333k|}

xmlParseURISafe:
  962|   363k|xmlParseURISafe(const char *str, xmlURI **uriOut) {
  963|   363k|    xmlURIPtr uri;
  964|   363k|    int ret;
  965|       |
  966|   363k|    if (uriOut == NULL)
  ------------------
  |  Branch (966:9): [True: 0, False: 363k]
  ------------------
  967|      0|        return(1);
  968|   363k|    *uriOut = NULL;
  969|   363k|    if (str == NULL)
  ------------------
  |  Branch (969:9): [True: 0, False: 363k]
  ------------------
  970|      0|	return(1);
  971|       |
  972|   363k|    uri = xmlCreateURI();
  973|   363k|    if (uri == NULL)
  ------------------
  |  Branch (973:9): [True: 133, False: 362k]
  ------------------
  974|    133|        return(-1);
  975|       |
  976|   362k|    ret = xmlParse3986URIReference(uri, str);
  977|   362k|    if (ret) {
  ------------------
  |  Branch (977:9): [True: 27.0k, False: 335k]
  ------------------
  978|  27.0k|        xmlFreeURI(uri);
  979|  27.0k|        return(ret);
  980|  27.0k|    }
  981|       |
  982|   335k|    *uriOut = uri;
  983|   335k|    return(0);
  984|   362k|}
xmlParseURIReference:
 1012|    513|xmlParseURIReference(xmlURI *uri, const char *str) {
 1013|    513|    return(xmlParse3986URIReference(uri, str));
 1014|    513|}
xmlCreateURI:
 1058|   382k|xmlCreateURI(void) {
 1059|   382k|    xmlURIPtr ret;
 1060|       |
 1061|   382k|    ret = (xmlURIPtr) xmlMalloc(sizeof(xmlURI));
 1062|   382k|    if (ret == NULL)
  ------------------
  |  Branch (1062:9): [True: 173, False: 382k]
  ------------------
 1063|    173|	return(NULL);
 1064|   382k|    memset(ret, 0, sizeof(xmlURI));
 1065|   382k|    ret->port = PORT_EMPTY;
  ------------------
  |  |   36|   382k|#define PORT_EMPTY           0
  ------------------
 1066|   382k|    return(ret);
 1067|   382k|}
xmlSaveUri:
 1095|  39.9k|xmlSaveUri(xmlURI *uri) {
 1096|  39.9k|    xmlChar *ret = NULL;
 1097|  39.9k|    xmlChar *temp;
 1098|  39.9k|    const char *p;
 1099|  39.9k|    int len;
 1100|  39.9k|    int max;
 1101|       |
 1102|  39.9k|    if (uri == NULL) return(NULL);
  ------------------
  |  Branch (1102:9): [True: 0, False: 39.9k]
  ------------------
 1103|       |
 1104|       |
 1105|  39.9k|    max = 80;
 1106|  39.9k|    ret = xmlMalloc(max + 1);
 1107|  39.9k|    if (ret == NULL)
  ------------------
  |  Branch (1107:9): [True: 85, False: 39.8k]
  ------------------
 1108|     85|	return(NULL);
 1109|  39.8k|    len = 0;
 1110|       |
 1111|  39.8k|    if (uri->scheme != NULL) {
  ------------------
  |  Branch (1111:9): [True: 11.6k, False: 28.1k]
  ------------------
 1112|  11.6k|	p = uri->scheme;
 1113|   114k|	while (*p != 0) {
  ------------------
  |  Branch (1113:9): [True: 103k, False: 11.6k]
  ------------------
 1114|   103k|	    if (len >= max) {
  ------------------
  |  Branch (1114:10): [True: 363, False: 102k]
  ------------------
 1115|    363|                temp = xmlSaveUriRealloc(ret, &max);
 1116|    363|                if (temp == NULL) goto mem_error;
  ------------------
  |  Branch (1116:21): [True: 2, False: 361]
  ------------------
 1117|    361|		ret = temp;
 1118|    361|	    }
 1119|   103k|	    ret[len++] = *p++;
 1120|   103k|	}
 1121|  11.6k|	if (len >= max) {
  ------------------
  |  Branch (1121:6): [True: 263, False: 11.4k]
  ------------------
 1122|    263|            temp = xmlSaveUriRealloc(ret, &max);
 1123|    263|            if (temp == NULL) goto mem_error;
  ------------------
  |  Branch (1123:17): [True: 3, False: 260]
  ------------------
 1124|    260|            ret = temp;
 1125|    260|	}
 1126|  11.6k|	ret[len++] = ':';
 1127|  11.6k|    }
 1128|  39.8k|    if (uri->opaque != NULL) {
  ------------------
  |  Branch (1128:9): [True: 0, False: 39.8k]
  ------------------
 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|  39.8k|    } else {
 1147|  39.8k|	if ((uri->server != NULL) || (uri->port != PORT_EMPTY)) {
  ------------------
  |  |   36|  31.2k|#define PORT_EMPTY           0
  ------------------
  |  Branch (1147:6): [True: 8.61k, False: 31.2k]
  |  Branch (1147:31): [True: 2.36k, False: 28.8k]
  ------------------
 1148|  10.9k|	    if (len + 3 >= max) {
  ------------------
  |  Branch (1148:10): [True: 273, False: 10.7k]
  ------------------
 1149|    273|                temp = xmlSaveUriRealloc(ret, &max);
 1150|    273|                if (temp == NULL) goto mem_error;
  ------------------
  |  Branch (1150:21): [True: 3, False: 270]
  ------------------
 1151|    270|                ret = temp;
 1152|    270|	    }
 1153|  10.9k|	    ret[len++] = '/';
 1154|  10.9k|	    ret[len++] = '/';
 1155|  10.9k|	    if (uri->user != NULL) {
  ------------------
  |  Branch (1155:10): [True: 3.87k, False: 7.09k]
  ------------------
 1156|  3.87k|		p = uri->user;
 1157|  33.5M|		while (*p != 0) {
  ------------------
  |  Branch (1157:10): [True: 33.5M, False: 3.86k]
  ------------------
 1158|  33.5M|		    if (len + 3 >= max) {
  ------------------
  |  Branch (1158:11): [True: 2.24k, False: 33.5M]
  ------------------
 1159|  2.24k|                        temp = xmlSaveUriRealloc(ret, &max);
 1160|  2.24k|                        if (temp == NULL) goto mem_error;
  ------------------
  |  Branch (1160:29): [True: 11, False: 2.22k]
  ------------------
 1161|  2.22k|                        ret = temp;
 1162|  2.22k|		    }
 1163|  33.5M|		    if ((IS_UNRESERVED(*(p))) ||
  ------------------
  |  |  103|  33.5M|#define IS_UNRESERVED(x) (IS_ALPHANUM(x) || IS_MARK(x))
  |  |  ------------------
  |  |  |  |   73|  67.0M|#define IS_ALPHANUM(x) (IS_ALPHA(x) || IS_DIGIT(x))
  |  |  |  |  ------------------
  |  |  |  |  |  |   45|  67.0M|#define IS_ALPHA(x) (IS_LOWALPHA(x) || IS_UPALPHA(x))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   53|  67.0M|#define IS_LOWALPHA(x) (((x) >= 'a') && ((x) <= 'z'))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (53:25): [True: 18.7k, False: 33.4M]
  |  |  |  |  |  |  |  |  |  Branch (53:41): [True: 17.5k, False: 1.24k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define IS_ALPHA(x) (IS_LOWALPHA(x) || IS_UPALPHA(x))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   60|  33.4M|#define IS_UPALPHA(x) (((x) >= 'A') && ((x) <= 'Z'))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (60:24): [True: 31.8M, False: 1.64M]
  |  |  |  |  |  |  |  |  |  Branch (60:40): [True: 31.8M, False: 1.94k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define IS_ALPHANUM(x) (IS_ALPHA(x) || IS_DIGIT(x))
  |  |  |  |  ------------------
  |  |  |  |  |  |   68|  1.65M|#define IS_DIGIT(x) (((x) >= '0') && ((x) <= '9'))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (68:22): [True: 47.4k, False: 1.60M]
  |  |  |  |  |  |  |  Branch (68:38): [True: 26.9k, False: 20.4k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define IS_UNRESERVED(x) (IS_ALPHANUM(x) || IS_MARK(x))
  |  |  ------------------
  |  |  |  |   79|  1.62M|#define IS_MARK(x) (((x) == '-') || ((x) == '_') || ((x) == '.') ||     \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (79:21): [True: 1.25k, False: 1.62M]
  |  |  |  |  |  Branch (79:37): [True: 666, False: 1.62M]
  |  |  |  |  |  Branch (79:53): [True: 2.13k, False: 1.62M]
  |  |  |  |  ------------------
  |  |  |  |   80|  1.62M|    ((x) == '!') || ((x) == '~') || ((x) == '*') || ((x) == '\'') ||    \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (80:5): [True: 3.40k, False: 1.61M]
  |  |  |  |  |  Branch (80:21): [True: 1.19k, False: 1.61M]
  |  |  |  |  |  Branch (80:37): [True: 1.16k, False: 1.61M]
  |  |  |  |  |  Branch (80:53): [True: 1.21k, False: 1.61M]
  |  |  |  |  ------------------
  |  |  |  |   81|  1.62M|    ((x) == '(') || ((x) == ')'))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (81:5): [True: 1.12k, False: 1.61M]
  |  |  |  |  |  Branch (81:21): [True: 1.94k, False: 1.60M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1164|  1.60M|			((*(p) == ';')) || ((*(p) == ':')) ||
  ------------------
  |  Branch (1164:4): [True: 4.07k, False: 1.60M]
  |  Branch (1164:23): [True: 3.57k, False: 1.60M]
  ------------------
 1165|  1.60M|			((*(p) == '&')) || ((*(p) == '=')) ||
  ------------------
  |  Branch (1165:4): [True: 268, False: 1.60M]
  |  Branch (1165:23): [True: 1.67k, False: 1.60M]
  ------------------
 1166|  1.60M|			((*(p) == '+')) || ((*(p) == '$')) ||
  ------------------
  |  Branch (1166:4): [True: 1.29k, False: 1.59M]
  |  Branch (1166:23): [True: 1.28k, False: 1.59M]
  ------------------
 1167|  1.59M|			((*(p) == ',')))
  ------------------
  |  Branch (1167:4): [True: 503, False: 1.59M]
  ------------------
 1168|  31.9M|			ret[len++] = *p++;
 1169|  1.59M|		    else {
 1170|  1.59M|			int val = *(unsigned char *)p++;
 1171|  1.59M|			int hi = val / 0x10, lo = val % 0x10;
 1172|  1.59M|			ret[len++] = '%';
 1173|  1.59M|			ret[len++] = hi + (hi > 9? 'A'-10 : '0');
  ------------------
  |  Branch (1173:23): [True: 3.80k, False: 1.59M]
  ------------------
 1174|  1.59M|			ret[len++] = lo + (lo > 9? 'A'-10 : '0');
  ------------------
  |  Branch (1174:23): [True: 28.1k, False: 1.56M]
  ------------------
 1175|  1.59M|		    }
 1176|  33.5M|		}
 1177|  3.86k|		if (len + 3 >= max) {
  ------------------
  |  Branch (1177:7): [True: 275, False: 3.59k]
  ------------------
 1178|    275|                    temp = xmlSaveUriRealloc(ret, &max);
 1179|    275|                    if (temp == NULL) goto mem_error;
  ------------------
  |  Branch (1179:25): [True: 0, False: 275]
  ------------------
 1180|    275|                    ret = temp;
 1181|    275|		}
 1182|  3.86k|		ret[len++] = '@';
 1183|  3.86k|	    }
 1184|  10.9k|	    if (uri->server != NULL) {
  ------------------
  |  Branch (1184:10): [True: 8.60k, False: 2.36k]
  ------------------
 1185|  8.60k|		p = uri->server;
 1186|  3.60M|		while (*p != 0) {
  ------------------
  |  Branch (1186:10): [True: 3.60M, False: 8.59k]
  ------------------
 1187|  3.60M|		    if (len >= max) {
  ------------------
  |  Branch (1187:11): [True: 320, False: 3.60M]
  ------------------
 1188|    320|			temp = xmlSaveUriRealloc(ret, &max);
 1189|    320|			if (temp == NULL) goto mem_error;
  ------------------
  |  Branch (1189:8): [True: 9, False: 311]
  ------------------
 1190|    311|			ret = temp;
 1191|    311|		    }
 1192|       |                    /* TODO: escaping? */
 1193|  3.60M|		    ret[len++] = (xmlChar) *p++;
 1194|  3.60M|		}
 1195|  8.60k|	    }
 1196|  10.9k|            if (uri->port > 0) {
  ------------------
  |  Branch (1196:17): [True: 1.25k, False: 9.70k]
  ------------------
 1197|  1.25k|                if (len + 10 >= max) {
  ------------------
  |  Branch (1197:21): [True: 227, False: 1.02k]
  ------------------
 1198|    227|                    temp = xmlSaveUriRealloc(ret, &max);
 1199|    227|                    if (temp == NULL) goto mem_error;
  ------------------
  |  Branch (1199:25): [True: 1, False: 226]
  ------------------
 1200|    226|                    ret = temp;
 1201|    226|                }
 1202|  1.25k|                len += snprintf((char *) &ret[len], max - len, ":%d", uri->port);
 1203|  1.25k|            }
 1204|  28.8k|	} else if (uri->authority != NULL) {
  ------------------
  |  Branch (1204:13): [True: 0, False: 28.8k]
  ------------------
 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|  28.8k|	} else if (uri->scheme != NULL) {
  ------------------
  |  Branch (1232:13): [True: 838, False: 28.0k]
  ------------------
 1233|    838|	    if (len + 3 >= max) {
  ------------------
  |  Branch (1233:10): [True: 222, False: 616]
  ------------------
 1234|    222|                temp = xmlSaveUriRealloc(ret, &max);
 1235|    222|                if (temp == NULL) goto mem_error;
  ------------------
  |  Branch (1235:21): [True: 2, False: 220]
  ------------------
 1236|    220|                ret = temp;
 1237|    220|	    }
 1238|    838|	}
 1239|  39.8k|	if (uri->path != NULL) {
  ------------------
  |  Branch (1239:6): [True: 33.1k, False: 6.68k]
  ------------------
 1240|  33.1k|	    p = uri->path;
 1241|       |	    /*
 1242|       |	     * the colon in file:///d: should not be escaped or
 1243|       |	     * Windows accesses fail later.
 1244|       |	     */
 1245|  33.1k|	    if ((uri->scheme != NULL) &&
  ------------------
  |  Branch (1245:10): [True: 7.73k, False: 25.3k]
  ------------------
 1246|  7.73k|		(p[0] == '/') &&
  ------------------
  |  Branch (1246:3): [True: 7.01k, False: 722]
  ------------------
 1247|  7.01k|		(((p[1] >= 'a') && (p[1] <= 'z')) ||
  ------------------
  |  Branch (1247:5): [True: 1.49k, False: 5.51k]
  |  Branch (1247:22): [True: 1.25k, False: 249]
  ------------------
 1248|  5.76k|		 ((p[1] >= 'A') && (p[1] <= 'Z'))) &&
  ------------------
  |  Branch (1248:5): [True: 759, False: 5.00k]
  |  Branch (1248:22): [True: 505, False: 254]
  ------------------
 1249|  1.75k|		(p[2] == ':') &&
  ------------------
  |  Branch (1249:3): [True: 622, False: 1.13k]
  ------------------
 1250|    622|	        (xmlStrEqual(BAD_CAST uri->scheme, BAD_CAST "file"))) {
  ------------------
  |  |   34|    622|#define BAD_CAST (xmlChar *)
  ------------------
              	        (xmlStrEqual(BAD_CAST uri->scheme, BAD_CAST "file"))) {
  ------------------
  |  |   34|    622|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (1250:10): [True: 394, False: 228]
  ------------------
 1251|    394|		if (len + 3 >= max) {
  ------------------
  |  Branch (1251:7): [True: 199, False: 195]
  ------------------
 1252|    199|                    temp = xmlSaveUriRealloc(ret, &max);
 1253|    199|                    if (temp == NULL) goto mem_error;
  ------------------
  |  Branch (1253:25): [True: 2, False: 197]
  ------------------
 1254|    197|                    ret = temp;
 1255|    197|		}
 1256|    392|		ret[len++] = *p++;
 1257|    392|		ret[len++] = *p++;
 1258|    392|		ret[len++] = *p++;
 1259|    392|	    }
 1260|  5.86M|	    while (*p != 0) {
  ------------------
  |  Branch (1260:13): [True: 5.83M, False: 33.1k]
  ------------------
 1261|  5.83M|		if (len + 3 >= max) {
  ------------------
  |  Branch (1261:7): [True: 1.95k, False: 5.83M]
  ------------------
 1262|  1.95k|                    temp = xmlSaveUriRealloc(ret, &max);
 1263|  1.95k|                    if (temp == NULL) goto mem_error;
  ------------------
  |  Branch (1263:25): [True: 4, False: 1.94k]
  ------------------
 1264|  1.94k|                    ret = temp;
 1265|  1.94k|		}
 1266|  5.83M|		if ((IS_UNRESERVED(*(p))) || ((*(p) == '/')) ||
  ------------------
  |  |  103|  5.83M|#define IS_UNRESERVED(x) (IS_ALPHANUM(x) || IS_MARK(x))
  |  |  ------------------
  |  |  |  |   73|  11.6M|#define IS_ALPHANUM(x) (IS_ALPHA(x) || IS_DIGIT(x))
  |  |  |  |  ------------------
  |  |  |  |  |  |   45|  11.6M|#define IS_ALPHA(x) (IS_LOWALPHA(x) || IS_UPALPHA(x))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   53|  11.6M|#define IS_LOWALPHA(x) (((x) >= 'a') && ((x) <= 'z'))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (53:25): [True: 175k, False: 5.65M]
  |  |  |  |  |  |  |  |  |  Branch (53:41): [True: 174k, False: 1.26k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define IS_ALPHA(x) (IS_LOWALPHA(x) || IS_UPALPHA(x))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   60|  5.65M|#define IS_UPALPHA(x) (((x) >= 'A') && ((x) <= 'Z'))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (60:24): [True: 3.13M, False: 2.52M]
  |  |  |  |  |  |  |  |  |  Branch (60:40): [True: 3.13M, False: 1.88k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define IS_ALPHANUM(x) (IS_ALPHA(x) || IS_DIGIT(x))
  |  |  |  |  ------------------
  |  |  |  |  |  |   68|  2.52M|#define IS_DIGIT(x) (((x) >= '0') && ((x) <= '9'))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (68:22): [True: 57.1k, False: 2.46M]
  |  |  |  |  |  |  |  Branch (68:38): [True: 45.3k, False: 11.7k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define IS_UNRESERVED(x) (IS_ALPHANUM(x) || IS_MARK(x))
  |  |  ------------------
  |  |  |  |   79|  2.47M|#define IS_MARK(x) (((x) == '-') || ((x) == '_') || ((x) == '.') ||     \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (79:21): [True: 48.4k, False: 2.42M]
  |  |  |  |  |  Branch (79:37): [True: 594, False: 2.42M]
  |  |  |  |  |  Branch (79:53): [True: 47.8k, False: 2.38M]
  |  |  |  |  ------------------
  |  |  |  |   80|  2.47M|    ((x) == '!') || ((x) == '~') || ((x) == '*') || ((x) == '\'') ||    \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (80:5): [True: 3.03k, False: 2.37M]
  |  |  |  |  |  Branch (80:21): [True: 1.17k, False: 2.37M]
  |  |  |  |  |  Branch (80:37): [True: 2.24M, False: 136k]
  |  |  |  |  |  Branch (80:53): [True: 1.53k, False: 134k]
  |  |  |  |  ------------------
  |  |  |  |   81|  2.47M|    ((x) == '(') || ((x) == ')'))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (81:5): [True: 1.26k, False: 133k]
  |  |  |  |  |  Branch (81:21): [True: 1.92k, False: 131k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (1266:32): [True: 98.7k, False: 32.7k]
  ------------------
 1267|  32.7k|                    ((*(p) == ';')) || ((*(p) == '@')) || ((*(p) == '&')) ||
  ------------------
  |  Branch (1267:21): [True: 2.45k, False: 30.2k]
  |  Branch (1267:40): [True: 2.30k, False: 27.9k]
  |  Branch (1267:59): [True: 267, False: 27.7k]
  ------------------
 1268|  27.7k|	            ((*(p) == '=')) || ((*(p) == '+')) || ((*(p) == '$')) ||
  ------------------
  |  Branch (1268:14): [True: 1.02k, False: 26.6k]
  |  Branch (1268:33): [True: 1.69k, False: 24.9k]
  |  Branch (1268:52): [True: 9.39k, False: 15.6k]
  ------------------
 1269|  15.6k|	            ((*(p) == ',')))
  ------------------
  |  Branch (1269:14): [True: 2.18k, False: 13.4k]
  ------------------
 1270|  5.82M|		    ret[len++] = *p++;
 1271|  13.4k|		else {
 1272|  13.4k|		    int val = *(unsigned char *)p++;
 1273|  13.4k|		    int hi = val / 0x10, lo = val % 0x10;
 1274|  13.4k|		    ret[len++] = '%';
 1275|  13.4k|		    ret[len++] = hi + (hi > 9? 'A'-10 : '0');
  ------------------
  |  Branch (1275:26): [True: 1.23k, False: 12.1k]
  ------------------
 1276|  13.4k|		    ret[len++] = lo + (lo > 9? 'A'-10 : '0');
  ------------------
  |  Branch (1276:26): [True: 5.42k, False: 7.99k]
  ------------------
 1277|  13.4k|		}
 1278|  5.83M|	    }
 1279|  33.1k|	}
 1280|  39.8k|	if (uri->query_raw != NULL) {
  ------------------
  |  Branch (1280:6): [True: 3.92k, False: 35.8k]
  ------------------
 1281|  3.92k|	    if (len + 1 >= max) {
  ------------------
  |  Branch (1281:10): [True: 70, False: 3.85k]
  ------------------
 1282|     70|                temp = xmlSaveUriRealloc(ret, &max);
 1283|     70|                if (temp == NULL) goto mem_error;
  ------------------
  |  Branch (1283:21): [True: 1, False: 69]
  ------------------
 1284|     69|                ret = temp;
 1285|     69|	    }
 1286|  3.92k|	    ret[len++] = '?';
 1287|  3.92k|	    p = uri->query_raw;
 1288|  6.94M|	    while (*p != 0) {
  ------------------
  |  Branch (1288:13): [True: 6.94M, False: 3.91k]
  ------------------
 1289|  6.94M|		if (len + 1 >= max) {
  ------------------
  |  Branch (1289:7): [True: 572, False: 6.94M]
  ------------------
 1290|    572|                    temp = xmlSaveUriRealloc(ret, &max);
 1291|    572|                    if (temp == NULL) goto mem_error;
  ------------------
  |  Branch (1291:25): [True: 12, False: 560]
  ------------------
 1292|    560|                    ret = temp;
 1293|    560|		}
 1294|  6.94M|		ret[len++] = *p++;
 1295|  6.94M|	    }
 1296|  35.8k|	} else if (uri->query != NULL) {
  ------------------
  |  Branch (1296:13): [True: 0, False: 35.8k]
  ------------------
 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|  39.8k|    }
 1322|  39.7k|    if (uri->fragment != NULL) {
  ------------------
  |  Branch (1322:9): [True: 7.38k, False: 32.3k]
  ------------------
 1323|  7.38k|	if (len + 3 >= max) {
  ------------------
  |  Branch (1323:6): [True: 320, False: 7.06k]
  ------------------
 1324|    320|            temp = xmlSaveUriRealloc(ret, &max);
 1325|    320|            if (temp == NULL) goto mem_error;
  ------------------
  |  Branch (1325:17): [True: 1, False: 319]
  ------------------
 1326|    319|            ret = temp;
 1327|    319|	}
 1328|  7.38k|	ret[len++] = '#';
 1329|  7.38k|	p = uri->fragment;
 1330|  41.8k|	while (*p != 0) {
  ------------------
  |  Branch (1330:9): [True: 34.5k, False: 7.38k]
  ------------------
 1331|  34.5k|	    if (len + 3 >= max) {
  ------------------
  |  Branch (1331:10): [True: 326, False: 34.1k]
  ------------------
 1332|    326|                temp = xmlSaveUriRealloc(ret, &max);
 1333|    326|                if (temp == NULL) goto mem_error;
  ------------------
  |  Branch (1333:21): [True: 1, False: 325]
  ------------------
 1334|    325|                ret = temp;
 1335|    325|	    }
 1336|  34.5k|	    if ((IS_UNRESERVED(*(p))) || (IS_RESERVED(*(p))))
  ------------------
  |  |  103|  34.5k|#define IS_UNRESERVED(x) (IS_ALPHANUM(x) || IS_MARK(x))
  |  |  ------------------
  |  |  |  |   73|  69.0k|#define IS_ALPHANUM(x) (IS_ALPHA(x) || IS_DIGIT(x))
  |  |  |  |  ------------------
  |  |  |  |  |  |   45|  69.0k|#define IS_ALPHA(x) (IS_LOWALPHA(x) || IS_UPALPHA(x))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   53|  69.0k|#define IS_LOWALPHA(x) (((x) >= 'a') && ((x) <= 'z'))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (53:25): [True: 4.60k, False: 29.8k]
  |  |  |  |  |  |  |  |  |  Branch (53:41): [True: 3.43k, False: 1.16k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define IS_ALPHA(x) (IS_LOWALPHA(x) || IS_UPALPHA(x))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   60|  31.0k|#define IS_UPALPHA(x) (((x) >= 'A') && ((x) <= 'Z'))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (60:24): [True: 8.15k, False: 22.9k]
  |  |  |  |  |  |  |  |  |  Branch (60:40): [True: 3.81k, False: 4.33k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define IS_ALPHANUM(x) (IS_ALPHA(x) || IS_DIGIT(x))
  |  |  |  |  ------------------
  |  |  |  |  |  |   68|  27.2k|#define IS_DIGIT(x) (((x) >= '0') && ((x) <= '9'))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (68:22): [True: 13.7k, False: 13.5k]
  |  |  |  |  |  |  |  Branch (68:38): [True: 4.14k, False: 9.58k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define IS_UNRESERVED(x) (IS_ALPHANUM(x) || IS_MARK(x))
  |  |  ------------------
  |  |  |  |   79|  23.0k|#define IS_MARK(x) (((x) == '-') || ((x) == '_') || ((x) == '.') ||     \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (79:21): [True: 546, False: 22.5k]
  |  |  |  |  |  Branch (79:37): [True: 252, False: 22.2k]
  |  |  |  |  |  Branch (79:53): [True: 1.18k, False: 21.1k]
  |  |  |  |  ------------------
  |  |  |  |   80|  23.0k|    ((x) == '!') || ((x) == '~') || ((x) == '*') || ((x) == '\'') ||    \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (80:5): [True: 401, False: 20.7k]
  |  |  |  |  |  Branch (80:21): [True: 1.16k, False: 19.5k]
  |  |  |  |  |  Branch (80:37): [True: 2.89k, False: 16.6k]
  |  |  |  |  |  Branch (80:53): [True: 744, False: 15.9k]
  |  |  |  |  ------------------
  |  |  |  |   81|  23.0k|    ((x) == '(') || ((x) == ')'))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (81:5): [True: 385, False: 15.5k]
  |  |  |  |  |  Branch (81:21): [True: 330, False: 15.1k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
              	    if ((IS_UNRESERVED(*(p))) || (IS_RESERVED(*(p))))
  ------------------
  |  |   95|  15.1k|#define IS_RESERVED(x) (((x) == ';') || ((x) == '/') || ((x) == '?') || \
  |  |  ------------------
  |  |  |  Branch (95:25): [True: 1.01k, False: 14.1k]
  |  |  |  Branch (95:41): [True: 760, False: 13.4k]
  |  |  |  Branch (95:57): [True: 2.58k, False: 10.8k]
  |  |  ------------------
  |  |   96|  15.1k|        ((x) == ':') || ((x) == '@') || ((x) == '&') || ((x) == '=') || \
  |  |  ------------------
  |  |  |  Branch (96:9): [True: 525, False: 10.3k]
  |  |  |  Branch (96:25): [True: 913, False: 9.39k]
  |  |  |  Branch (96:41): [True: 237, False: 9.15k]
  |  |  |  Branch (96:57): [True: 211, False: 8.94k]
  |  |  ------------------
  |  |   97|  15.1k|        ((x) == '+') || ((x) == '$') || ((x) == ',') || ((x) == '[') || \
  |  |  ------------------
  |  |  |  Branch (97:9): [True: 1.21k, False: 7.73k]
  |  |  |  Branch (97:25): [True: 1.07k, False: 6.66k]
  |  |  |  Branch (97:41): [True: 3.18k, False: 3.47k]
  |  |  |  Branch (97:57): [True: 409, False: 3.06k]
  |  |  ------------------
  |  |   98|  15.1k|        ((x) == ']'))
  |  |  ------------------
  |  |  |  Branch (98:9): [True: 2.50k, False: 558]
  |  |  ------------------
  ------------------
 1337|  33.9k|		ret[len++] = *p++;
 1338|    558|	    else {
 1339|    558|		int val = *(unsigned char *)p++;
 1340|    558|		int hi = val / 0x10, lo = val % 0x10;
 1341|    558|		ret[len++] = '%';
 1342|    558|		ret[len++] = hi + (hi > 9? 'A'-10 : '0');
  ------------------
  |  Branch (1342:22): [True: 458, False: 100]
  ------------------
 1343|    558|		ret[len++] = lo + (lo > 9? 'A'-10 : '0');
  ------------------
  |  Branch (1343:22): [True: 394, False: 164]
  ------------------
 1344|    558|	    }
 1345|  34.5k|	}
 1346|  7.38k|    }
 1347|  39.7k|    if (len >= max) {
  ------------------
  |  Branch (1347:9): [True: 213, False: 39.5k]
  ------------------
 1348|    213|        temp = xmlSaveUriRealloc(ret, &max);
 1349|    213|        if (temp == NULL) goto mem_error;
  ------------------
  |  Branch (1349:13): [True: 1, False: 212]
  ------------------
 1350|    212|        ret = temp;
 1351|    212|    }
 1352|  39.7k|    ret[len] = 0;
 1353|  39.7k|    return(ret);
 1354|       |
 1355|     53|mem_error:
 1356|     53|    xmlFree(ret);
 1357|       |    return(NULL);
 1358|  39.7k|}
xmlFreeURI:
 1412|   389k|xmlFreeURI(xmlURI *uri) {
 1413|   389k|    if (uri == NULL) return;
  ------------------
  |  Branch (1413:9): [True: 6.94k, False: 382k]
  ------------------
 1414|       |
 1415|   382k|    if (uri->scheme != NULL) xmlFree(uri->scheme);
  ------------------
  |  Branch (1415:9): [True: 36.0k, False: 346k]
  ------------------
 1416|   382k|    if (uri->server != NULL) xmlFree(uri->server);
  ------------------
  |  Branch (1416:9): [True: 26.4k, False: 355k]
  ------------------
 1417|   382k|    if (uri->user != NULL) xmlFree(uri->user);
  ------------------
  |  Branch (1417:9): [True: 7.23k, False: 374k]
  ------------------
 1418|   382k|    if (uri->path != NULL) xmlFree(uri->path);
  ------------------
  |  Branch (1418:9): [True: 175k, False: 206k]
  ------------------
 1419|   382k|    if (uri->fragment != NULL) xmlFree(uri->fragment);
  ------------------
  |  Branch (1419:9): [True: 174k, False: 207k]
  ------------------
 1420|   382k|    if (uri->opaque != NULL) xmlFree(uri->opaque);
  ------------------
  |  Branch (1420:9): [True: 0, False: 382k]
  ------------------
 1421|   382k|    if (uri->authority != NULL) xmlFree(uri->authority);
  ------------------
  |  Branch (1421:9): [True: 0, False: 382k]
  ------------------
 1422|   382k|    if (uri->query != NULL) xmlFree(uri->query);
  ------------------
  |  Branch (1422:9): [True: 6.74k, False: 375k]
  ------------------
 1423|   382k|    if (uri->query_raw != NULL) xmlFree(uri->query_raw);
  ------------------
  |  Branch (1423:9): [True: 9.31k, False: 372k]
  ------------------
 1424|   382k|    xmlFree(uri);
 1425|   382k|}
xmlNormalizeURIPath:
 1555|  7.07k|xmlNormalizeURIPath(char *path) {
 1556|  7.07k|    return(xmlNormalizePath(path, 0));
 1557|  7.07k|}
xmlURIUnescapeString:
 1580|   627k|xmlURIUnescapeString(const char *str, int len, char *target) {
 1581|   627k|    char *ret, *out;
 1582|   627k|    const char *in;
 1583|       |
 1584|   627k|    if (str == NULL)
  ------------------
  |  Branch (1584:9): [True: 0, False: 627k]
  ------------------
 1585|      0|	return(NULL);
 1586|   627k|    if (len <= 0) len = strlen(str);
  ------------------
  |  Branch (1586:9): [True: 245k, False: 381k]
  ------------------
 1587|   627k|    if (len < 0) return(NULL);
  ------------------
  |  Branch (1587:9): [True: 0, False: 627k]
  ------------------
 1588|       |
 1589|   627k|    if (target == NULL) {
  ------------------
  |  Branch (1589:9): [True: 627k, False: 0]
  ------------------
 1590|   627k|	ret = xmlMalloc(len + 1);
 1591|   627k|	if (ret == NULL)
  ------------------
  |  Branch (1591:6): [True: 270, False: 627k]
  ------------------
 1592|    270|	    return(NULL);
 1593|   627k|    } else
 1594|      0|	ret = target;
 1595|   627k|    in = str;
 1596|   627k|    out = ret;
 1597|   116M|    while(len > 0) {
  ------------------
  |  Branch (1597:11): [True: 115M, False: 627k]
  ------------------
 1598|   115M|	if ((len > 2) && (*in == '%') && (is_hex(in[1])) && (is_hex(in[2]))) {
  ------------------
  |  Branch (1598:6): [True: 114M, False: 733k]
  |  Branch (1598:19): [True: 1.63M, False: 113M]
  |  Branch (1598:35): [True: 1.63M, False: 2.15k]
  |  Branch (1598:54): [True: 1.63M, False: 1.05k]
  ------------------
 1599|  1.63M|            int c = 0;
 1600|  1.63M|	    in++;
 1601|  1.63M|	    if ((*in >= '0') && (*in <= '9'))
  ------------------
  |  Branch (1601:10): [True: 1.63M, False: 0]
  |  Branch (1601:26): [True: 1.61M, False: 15.1k]
  ------------------
 1602|  1.61M|	        c = (*in - '0');
 1603|  15.1k|	    else if ((*in >= 'a') && (*in <= 'f'))
  ------------------
  |  Branch (1603:15): [True: 5.59k, False: 9.59k]
  |  Branch (1603:31): [True: 5.59k, False: 0]
  ------------------
 1604|  5.59k|	        c = (*in - 'a') + 10;
 1605|  9.59k|	    else if ((*in >= 'A') && (*in <= 'F'))
  ------------------
  |  Branch (1605:15): [True: 9.59k, False: 0]
  |  Branch (1605:31): [True: 9.59k, False: 0]
  ------------------
 1606|  9.59k|	        c = (*in - 'A') + 10;
 1607|  1.63M|	    in++;
 1608|  1.63M|	    if ((*in >= '0') && (*in <= '9'))
  ------------------
  |  Branch (1608:10): [True: 1.63M, False: 0]
  |  Branch (1608:26): [True: 1.61M, False: 13.3k]
  ------------------
 1609|  1.61M|	        c = c * 16 + (*in - '0');
 1610|  13.3k|	    else if ((*in >= 'a') && (*in <= 'f'))
  ------------------
  |  Branch (1610:15): [True: 5.47k, False: 7.91k]
  |  Branch (1610:31): [True: 5.47k, False: 0]
  ------------------
 1611|  5.47k|	        c = c * 16 + (*in - 'a') + 10;
 1612|  7.91k|	    else if ((*in >= 'A') && (*in <= 'F'))
  ------------------
  |  Branch (1612:15): [True: 7.91k, False: 0]
  |  Branch (1612:31): [True: 7.91k, False: 0]
  ------------------
 1613|  7.91k|	        c = c * 16 + (*in - 'A') + 10;
 1614|  1.63M|	    in++;
 1615|  1.63M|	    len -= 3;
 1616|       |            /* Explicit sign change */
 1617|  1.63M|	    *out++ = (char) c;
 1618|   113M|	} else {
 1619|   113M|	    *out++ = *in++;
 1620|   113M|	    len--;
 1621|   113M|	}
 1622|   115M|    }
 1623|   627k|    *out = 0;
 1624|   627k|    return(ret);
 1625|   627k|}
xmlURIEscapeStr:
 1637|  1.36k|xmlURIEscapeStr(const xmlChar *str, const xmlChar *list) {
 1638|  1.36k|    xmlChar *ret, ch;
 1639|  1.36k|    const xmlChar *in;
 1640|  1.36k|    int len, out;
 1641|       |
 1642|  1.36k|    if (str == NULL)
  ------------------
  |  Branch (1642:9): [True: 0, False: 1.36k]
  ------------------
 1643|      0|	return(NULL);
 1644|  1.36k|    if (str[0] == 0)
  ------------------
  |  Branch (1644:9): [True: 0, False: 1.36k]
  ------------------
 1645|      0|	return(xmlStrdup(str));
 1646|  1.36k|    len = xmlStrlen(str);
 1647|  1.36k|    if (len == 0)
  ------------------
  |  Branch (1647:9): [True: 0, False: 1.36k]
  ------------------
 1648|      0|        return(NULL);
 1649|       |
 1650|  1.36k|    len += 20;
 1651|  1.36k|    ret = xmlMalloc(len);
 1652|  1.36k|    if (ret == NULL)
  ------------------
  |  Branch (1652:9): [True: 7, False: 1.36k]
  ------------------
 1653|      7|	return(NULL);
 1654|  1.36k|    in = (const xmlChar *) str;
 1655|  1.36k|    out = 0;
 1656|  5.19M|    while(*in != 0) {
  ------------------
  |  Branch (1656:11): [True: 5.19M, False: 1.35k]
  ------------------
 1657|  5.19M|	if (len - out <= 3) {
  ------------------
  |  Branch (1657:6): [True: 901, False: 5.19M]
  ------------------
 1658|    901|            xmlChar *temp;
 1659|    901|            int newSize;
 1660|       |
 1661|    901|            newSize = xmlGrowCapacity(len, 1, 1, XML_MAX_ITEMS);
  ------------------
  |  |   13|    901|#define XML_MAX_ITEMS 1000000000 /* 1 billion */
  ------------------
 1662|    901|            if (newSize < 0) {
  ------------------
  |  Branch (1662:17): [True: 0, False: 901]
  ------------------
 1663|      0|		xmlFree(ret);
 1664|      0|                return(NULL);
 1665|      0|            }
 1666|    901|            temp = xmlRealloc(ret, newSize);
 1667|    901|	    if (temp == NULL) {
  ------------------
  |  Branch (1667:10): [True: 2, False: 899]
  ------------------
 1668|      2|		xmlFree(ret);
 1669|      2|		return(NULL);
 1670|      2|	    }
 1671|    899|	    ret = temp;
 1672|    899|            len = newSize;
 1673|    899|	}
 1674|       |
 1675|  5.19M|	ch = *in;
 1676|       |
 1677|  5.19M|	if ((ch != '@') && (!IS_UNRESERVED(ch)) && (!xmlStrchr(list, ch))) {
  ------------------
  |  |  103|  5.19M|#define IS_UNRESERVED(x) (IS_ALPHANUM(x) || IS_MARK(x))
  |  |  ------------------
  |  |  |  |   73|  10.3M|#define IS_ALPHANUM(x) (IS_ALPHA(x) || IS_DIGIT(x))
  |  |  |  |  ------------------
  |  |  |  |  |  |   45|  10.3M|#define IS_ALPHA(x) (IS_LOWALPHA(x) || IS_UPALPHA(x))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   53|  10.3M|#define IS_LOWALPHA(x) (((x) >= 'a') && ((x) <= 'z'))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (53:25): [True: 109k, False: 5.08M]
  |  |  |  |  |  |  |  |  |  Branch (53:41): [True: 93.7k, False: 15.5k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define IS_ALPHA(x) (IS_LOWALPHA(x) || IS_UPALPHA(x))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   60|  5.09M|#define IS_UPALPHA(x) (((x) >= 'A') && ((x) <= 'Z'))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (60:24): [True: 160k, False: 4.93M]
  |  |  |  |  |  |  |  |  |  Branch (60:40): [True: 142k, False: 17.3k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define IS_ALPHANUM(x) (IS_ALPHA(x) || IS_DIGIT(x))
  |  |  |  |  ------------------
  |  |  |  |  |  |   68|  4.95M|#define IS_DIGIT(x) (((x) >= '0') && ((x) <= '9'))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (68:22): [True: 45.3k, False: 4.90M]
  |  |  |  |  |  |  |  Branch (68:38): [True: 19.8k, False: 25.5k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define IS_UNRESERVED(x) (IS_ALPHANUM(x) || IS_MARK(x))
  |  |  ------------------
  |  |  |  |   79|  4.93M|#define IS_MARK(x) (((x) == '-') || ((x) == '_') || ((x) == '.') ||     \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (79:21): [True: 25.6k, False: 4.90M]
  |  |  |  |  |  Branch (79:37): [True: 414, False: 4.90M]
  |  |  |  |  |  Branch (79:53): [True: 142k, False: 4.76M]
  |  |  |  |  ------------------
  |  |  |  |   80|  4.93M|    ((x) == '!') || ((x) == '~') || ((x) == '*') || ((x) == '\'') ||    \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (80:5): [True: 4.74k, False: 4.76M]
  |  |  |  |  |  Branch (80:21): [True: 1.72k, False: 4.75M]
  |  |  |  |  |  Branch (80:37): [True: 1.09M, False: 3.66M]
  |  |  |  |  |  Branch (80:53): [True: 2.61k, False: 3.65M]
  |  |  |  |  ------------------
  |  |  |  |   81|  4.93M|    ((x) == '(') || ((x) == ')'))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (81:5): [True: 2.16k, False: 3.65M]
  |  |  |  |  |  Branch (81:21): [True: 1.04k, False: 3.65M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (1677:6): [True: 5.19M, False: 978]
  |  Branch (1677:45): [True: 3.54M, False: 111k]
  ------------------
 1678|  3.54M|	    unsigned char val;
 1679|  3.54M|	    ret[out++] = '%';
 1680|  3.54M|	    val = ch >> 4;
 1681|  3.54M|	    if (val <= 9)
  ------------------
  |  Branch (1681:10): [True: 3.53M, False: 9.58k]
  ------------------
 1682|  3.53M|		ret[out++] = '0' + val;
 1683|  9.58k|	    else
 1684|  9.58k|		ret[out++] = 'A' + val - 0xA;
 1685|  3.54M|	    val = ch & 0xF;
 1686|  3.54M|	    if (val <= 9)
  ------------------
  |  Branch (1686:10): [True: 3.53M, False: 6.92k]
  ------------------
 1687|  3.53M|		ret[out++] = '0' + val;
 1688|  6.92k|	    else
 1689|  6.92k|		ret[out++] = 'A' + val - 0xA;
 1690|  3.54M|	    in++;
 1691|  3.54M|	} else {
 1692|  1.64M|	    ret[out++] = *in++;
 1693|  1.64M|	}
 1694|       |
 1695|  5.19M|    }
 1696|  1.35k|    ret[out] = 0;
 1697|  1.35k|    return(ret);
 1698|  1.36k|}
xmlBuildURISafe:
 1972|   287k|xmlBuildURISafe(const xmlChar *URI, const xmlChar *base, xmlChar **valPtr) {
 1973|   287k|    xmlChar *val = NULL;
 1974|   287k|    int ret, len, indx, cur, out;
 1975|   287k|    xmlURIPtr ref = NULL;
 1976|   287k|    xmlURIPtr bas = NULL;
 1977|   287k|    xmlURIPtr res = NULL;
 1978|       |
 1979|   287k|    if (valPtr == NULL)
  ------------------
  |  Branch (1979:9): [True: 0, False: 287k]
  ------------------
 1980|      0|        return(1);
 1981|   287k|    *valPtr = NULL;
 1982|       |
 1983|   287k|    if (URI == NULL)
  ------------------
  |  Branch (1983:9): [True: 0, False: 287k]
  ------------------
 1984|      0|        return(1);
 1985|       |
 1986|   287k|    if (base == NULL) {
  ------------------
  |  Branch (1986:9): [True: 15.9k, False: 271k]
  ------------------
 1987|  15.9k|        val = xmlStrdup(URI);
 1988|  15.9k|        if (val == NULL)
  ------------------
  |  Branch (1988:13): [True: 7, False: 15.9k]
  ------------------
 1989|      7|            return(-1);
 1990|  15.9k|        *valPtr = val;
 1991|  15.9k|        return(0);
 1992|  15.9k|    }
 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|   271k|    if (URI[0] != 0)
  ------------------
  |  Branch (2002:9): [True: 267k, False: 3.85k]
  ------------------
 2003|   267k|        ret = xmlParseURISafe((const char *) URI, &ref);
 2004|  3.85k|    else
 2005|  3.85k|        ret = 0;
 2006|   271k|    if (ret != 0)
  ------------------
  |  Branch (2006:9): [True: 7.91k, False: 263k]
  ------------------
 2007|  7.91k|	goto done;
 2008|   263k|    if ((ref != NULL) && (ref->scheme != NULL)) {
  ------------------
  |  Branch (2008:9): [True: 260k, False: 3.85k]
  |  Branch (2008:26): [True: 3.70k, False: 256k]
  ------------------
 2009|       |	/*
 2010|       |	 * The URI is absolute don't modify.
 2011|       |	 */
 2012|  3.70k|	val = xmlStrdup(URI);
 2013|  3.70k|        if (val == NULL)
  ------------------
  |  Branch (2013:13): [True: 21, False: 3.68k]
  ------------------
 2014|     21|            ret = -1;
 2015|  3.70k|	goto done;
 2016|  3.70k|    }
 2017|       |
 2018|       |    /*
 2019|       |     * If base has no scheme or authority, it is assumed to be a
 2020|       |     * filesystem path.
 2021|       |     */
 2022|   260k|    if (xmlStrstr(base, BAD_CAST "://") == NULL) {
  ------------------
  |  |   34|   260k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (2022:9): [True: 237k, False: 22.8k]
  ------------------
 2023|   237k|        xmlFreeURI(ref);
 2024|   237k|        return(xmlResolvePath(URI, base, valPtr));
 2025|   237k|    }
 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|  22.8k|    ret = xmlParseURISafe((const char *) base, &bas);
 2045|  22.8k|    if (ret < 0)
  ------------------
  |  Branch (2045:9): [True: 162, False: 22.6k]
  ------------------
 2046|    162|        goto done;
 2047|  22.6k|    if (ret != 0) {
  ------------------
  |  Branch (2047:9): [True: 7.47k, False: 15.2k]
  ------------------
 2048|  7.47k|	if (ref) {
  ------------------
  |  Branch (2048:6): [True: 6.42k, False: 1.05k]
  ------------------
 2049|  6.42k|            ret = 0;
 2050|  6.42k|	    val = xmlSaveUri(ref);
 2051|  6.42k|            if (val == NULL)
  ------------------
  |  Branch (2051:17): [True: 18, False: 6.41k]
  ------------------
 2052|     18|                ret = -1;
 2053|  6.42k|        }
 2054|  7.47k|	goto done;
 2055|  7.47k|    }
 2056|  15.2k|    if (ref == NULL) {
  ------------------
  |  Branch (2056:9): [True: 1.65k, False: 13.5k]
  ------------------
 2057|       |	/*
 2058|       |	 * the base fragment must be ignored
 2059|       |	 */
 2060|  1.65k|	if (bas->fragment != NULL) {
  ------------------
  |  Branch (2060:6): [True: 237, False: 1.41k]
  ------------------
 2061|    237|	    xmlFree(bas->fragment);
 2062|    237|	    bas->fragment = NULL;
 2063|    237|	}
 2064|  1.65k|	val = xmlSaveUri(bas);
 2065|  1.65k|        if (val == NULL)
  ------------------
  |  Branch (2065:13): [True: 17, False: 1.63k]
  ------------------
 2066|     17|            ret = -1;
 2067|  1.65k|	goto done;
 2068|  1.65k|    }
 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|  13.5k|    ret = -1;
 2083|  13.5k|    res = xmlCreateURI();
 2084|  13.5k|    if (res == NULL)
  ------------------
  |  Branch (2084:9): [True: 26, False: 13.5k]
  ------------------
 2085|     26|	goto done;
 2086|  13.5k|    if ((ref->scheme == NULL) && (ref->path == NULL) &&
  ------------------
  |  Branch (2086:9): [True: 13.5k, False: 0]
  |  Branch (2086:34): [True: 5.17k, False: 8.35k]
  ------------------
 2087|  5.17k|	((ref->authority == NULL) && (ref->server == NULL) &&
  ------------------
  |  Branch (2087:3): [True: 5.17k, False: 0]
  |  Branch (2087:31): [True: 4.62k, False: 555]
  ------------------
 2088|  4.62k|         (ref->port == PORT_EMPTY))) {
  ------------------
  |  |   36|  4.62k|#define PORT_EMPTY           0
  ------------------
  |  Branch (2088:10): [True: 4.39k, False: 223]
  ------------------
 2089|  4.39k|	if (bas->scheme != NULL) {
  ------------------
  |  Branch (2089:6): [True: 3.58k, False: 810]
  ------------------
 2090|  3.58k|	    res->scheme = xmlMemStrdup(bas->scheme);
 2091|  3.58k|            if (res->scheme == NULL)
  ------------------
  |  Branch (2091:17): [True: 8, False: 3.57k]
  ------------------
 2092|      8|                goto done;
 2093|  3.58k|        }
 2094|  4.38k|	if (bas->authority != NULL) {
  ------------------
  |  Branch (2094:6): [True: 0, False: 4.38k]
  ------------------
 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.38k|        } else {
 2099|  4.38k|	    if (bas->server != NULL) {
  ------------------
  |  Branch (2099:10): [True: 2.75k, False: 1.63k]
  ------------------
 2100|  2.75k|		res->server = xmlMemStrdup(bas->server);
 2101|  2.75k|                if (res->server == NULL)
  ------------------
  |  Branch (2101:21): [True: 7, False: 2.74k]
  ------------------
 2102|      7|                    goto done;
 2103|  2.75k|            }
 2104|  4.38k|	    if (bas->user != NULL) {
  ------------------
  |  Branch (2104:10): [True: 1.82k, False: 2.55k]
  ------------------
 2105|  1.82k|		res->user = xmlMemStrdup(bas->user);
 2106|  1.82k|                if (res->user == NULL)
  ------------------
  |  Branch (2106:21): [True: 5, False: 1.81k]
  ------------------
 2107|      5|                    goto done;
 2108|  1.82k|            }
 2109|  4.37k|	    res->port = bas->port;
 2110|  4.37k|	}
 2111|  4.37k|	if (bas->path != NULL) {
  ------------------
  |  Branch (2111:6): [True: 2.01k, False: 2.35k]
  ------------------
 2112|  2.01k|	    res->path = xmlMemStrdup(bas->path);
 2113|  2.01k|            if (res->path == NULL)
  ------------------
  |  Branch (2113:17): [True: 8, False: 2.01k]
  ------------------
 2114|      8|                goto done;
 2115|  2.01k|        }
 2116|  4.36k|	if (ref->query_raw != NULL) {
  ------------------
  |  Branch (2116:6): [True: 330, False: 4.03k]
  ------------------
 2117|    330|	    res->query_raw = xmlMemStrdup (ref->query_raw);
 2118|    330|            if (res->query_raw == NULL)
  ------------------
  |  Branch (2118:17): [True: 2, False: 328]
  ------------------
 2119|      2|                goto done;
 2120|  4.03k|        } else if (ref->query != NULL) {
  ------------------
  |  Branch (2120:20): [True: 0, False: 4.03k]
  ------------------
 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.03k|        } else if (bas->query_raw != NULL) {
  ------------------
  |  Branch (2124:20): [True: 1.57k, False: 2.46k]
  ------------------
 2125|  1.57k|	    res->query_raw = xmlMemStrdup(bas->query_raw);
 2126|  1.57k|            if (res->query_raw == NULL)
  ------------------
  |  Branch (2126:17): [True: 6, False: 1.57k]
  ------------------
 2127|      6|                goto done;
 2128|  2.46k|        } else if (bas->query != NULL) {
  ------------------
  |  Branch (2128:20): [True: 0, False: 2.46k]
  ------------------
 2129|      0|	    res->query = xmlMemStrdup(bas->query);
 2130|      0|            if (res->query == NULL)
  ------------------
  |  Branch (2130:17): [True: 0, False: 0]
  ------------------
 2131|      0|                goto done;
 2132|      0|        }
 2133|  4.36k|	if (ref->fragment != NULL) {
  ------------------
  |  Branch (2133:6): [True: 3.95k, False: 408]
  ------------------
 2134|  3.95k|	    res->fragment = xmlMemStrdup(ref->fragment);
 2135|  3.95k|            if (res->fragment == NULL)
  ------------------
  |  Branch (2135:17): [True: 7, False: 3.94k]
  ------------------
 2136|      7|                goto done;
 2137|  3.95k|        }
 2138|  4.35k|	goto step_7;
 2139|  4.36k|    }
 2140|       |
 2141|       |    /*
 2142|       |     * 3) If the scheme component is defined, indicating that the reference
 2143|       |     *    starts with a scheme name, then the reference is interpreted as an
 2144|       |     *    absolute URI and we are done.  Otherwise, the reference URI's
 2145|       |     *    scheme is inherited from the base URI's scheme component.
 2146|       |     */
 2147|  9.13k|    if (ref->scheme != NULL) {
  ------------------
  |  Branch (2147:9): [True: 0, False: 9.13k]
  ------------------
 2148|      0|	val = xmlSaveUri(ref);
 2149|      0|        if (val != NULL)
  ------------------
  |  Branch (2149:13): [True: 0, False: 0]
  ------------------
 2150|      0|            ret = 0;
 2151|      0|	goto done;
 2152|      0|    }
 2153|  9.13k|    if (bas->scheme != NULL) {
  ------------------
  |  Branch (2153:9): [True: 6.61k, False: 2.51k]
  ------------------
 2154|  6.61k|	res->scheme = xmlMemStrdup(bas->scheme);
 2155|  6.61k|        if (res->scheme == NULL)
  ------------------
  |  Branch (2155:13): [True: 12, False: 6.60k]
  ------------------
 2156|     12|            goto done;
 2157|  6.61k|    }
 2158|       |
 2159|  9.12k|    if (ref->query_raw != NULL) {
  ------------------
  |  Branch (2159:9): [True: 679, False: 8.44k]
  ------------------
 2160|    679|	res->query_raw = xmlMemStrdup(ref->query_raw);
 2161|    679|        if (res->query_raw == NULL)
  ------------------
  |  Branch (2161:13): [True: 1, False: 678]
  ------------------
 2162|      1|            goto done;
 2163|  8.44k|    } else if (ref->query != NULL) {
  ------------------
  |  Branch (2163:16): [True: 0, False: 8.44k]
  ------------------
 2164|      0|	res->query = xmlMemStrdup(ref->query);
 2165|      0|        if (res->query == NULL)
  ------------------
  |  Branch (2165:13): [True: 0, False: 0]
  ------------------
 2166|      0|            goto done;
 2167|      0|    }
 2168|  9.11k|    if (ref->fragment != NULL) {
  ------------------
  |  Branch (2168:9): [True: 1.29k, False: 7.82k]
  ------------------
 2169|  1.29k|	res->fragment = xmlMemStrdup(ref->fragment);
 2170|  1.29k|        if (res->fragment == NULL)
  ------------------
  |  Branch (2170:13): [True: 6, False: 1.28k]
  ------------------
 2171|      6|            goto done;
 2172|  1.29k|    }
 2173|       |
 2174|       |    /*
 2175|       |     * 4) If the authority component is defined, then the reference is a
 2176|       |     *    network-path and we skip to step 7.  Otherwise, the reference
 2177|       |     *    URI's authority is inherited from the base URI's authority
 2178|       |     *    component, which will also be undefined if the URI scheme does not
 2179|       |     *    use an authority component.
 2180|       |     */
 2181|  9.11k|    if ((ref->authority != NULL) || (ref->server != NULL) ||
  ------------------
  |  Branch (2181:9): [True: 0, False: 9.11k]
  |  Branch (2181:37): [True: 869, False: 8.24k]
  ------------------
 2182|  8.24k|         (ref->port != PORT_EMPTY)) {
  ------------------
  |  |   36|  8.24k|#define PORT_EMPTY           0
  ------------------
  |  Branch (2182:10): [True: 223, False: 8.02k]
  ------------------
 2183|  1.09k|	if (ref->authority != NULL) {
  ------------------
  |  Branch (2183:6): [True: 0, False: 1.09k]
  ------------------
 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.09k|        } else {
 2188|  1.09k|            if (ref->server != NULL) {
  ------------------
  |  Branch (2188:17): [True: 869, False: 223]
  ------------------
 2189|    869|                res->server = xmlMemStrdup(ref->server);
 2190|    869|                if (res->server == NULL)
  ------------------
  |  Branch (2190:21): [True: 2, False: 867]
  ------------------
 2191|      2|                    goto done;
 2192|    869|            }
 2193|  1.09k|	    if (ref->user != NULL) {
  ------------------
  |  Branch (2193:10): [True: 212, False: 878]
  ------------------
 2194|    212|		res->user = xmlMemStrdup(ref->user);
 2195|    212|                if (res->user == NULL)
  ------------------
  |  Branch (2195:21): [True: 2, False: 210]
  ------------------
 2196|      2|                    goto done;
 2197|    212|            }
 2198|  1.08k|            res->port = ref->port;
 2199|  1.08k|	}
 2200|  1.08k|	if (ref->path != NULL) {
  ------------------
  |  Branch (2200:6): [True: 312, False: 776]
  ------------------
 2201|    312|	    res->path = xmlMemStrdup(ref->path);
 2202|    312|            if (res->path == NULL)
  ------------------
  |  Branch (2202:17): [True: 0, False: 312]
  ------------------
 2203|      0|                goto done;
 2204|    312|        }
 2205|  1.08k|	goto step_7;
 2206|  1.08k|    }
 2207|  8.02k|    if (bas->authority != NULL) {
  ------------------
  |  Branch (2207:9): [True: 0, False: 8.02k]
  ------------------
 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.02k|    } else if ((bas->server != NULL) || (bas->port != PORT_EMPTY)) {
  ------------------
  |  |   36|  4.17k|#define PORT_EMPTY           0
  ------------------
  |  Branch (2211:16): [True: 3.85k, False: 4.17k]
  |  Branch (2211:41): [True: 1.24k, False: 2.93k]
  ------------------
 2212|  5.09k|	if (bas->server != NULL) {
  ------------------
  |  Branch (2212:6): [True: 3.85k, False: 1.24k]
  ------------------
 2213|  3.85k|	    res->server = xmlMemStrdup(bas->server);
 2214|  3.85k|            if (res->server == NULL)
  ------------------
  |  Branch (2214:17): [True: 9, False: 3.84k]
  ------------------
 2215|      9|                goto done;
 2216|  3.85k|        }
 2217|  5.08k|	if (bas->user != NULL) {
  ------------------
  |  Branch (2217:6): [True: 1.12k, False: 3.95k]
  ------------------
 2218|  1.12k|	    res->user = xmlMemStrdup(bas->user);
 2219|  1.12k|            if (res->user == NULL)
  ------------------
  |  Branch (2219:17): [True: 5, False: 1.12k]
  ------------------
 2220|      5|                goto done;
 2221|  1.12k|        }
 2222|  5.07k|	res->port = bas->port;
 2223|  5.07k|    }
 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.00k|    if ((ref->path != NULL) && (ref->path[0] == '/')) {
  ------------------
  |  Branch (2229:9): [True: 8.00k, False: 0]
  |  Branch (2229:32): [True: 912, False: 7.09k]
  ------------------
 2230|    912|	res->path = xmlMemStrdup(ref->path);
 2231|    912|        if (res->path == NULL)
  ------------------
  |  Branch (2231:13): [True: 3, False: 909]
  ------------------
 2232|      3|            goto done;
 2233|    909|	goto step_7;
 2234|    912|    }
 2235|       |
 2236|       |
 2237|       |    /*
 2238|       |     * 6) If this step is reached, then we are resolving a relative-path
 2239|       |     *    reference.  The relative path needs to be merged with the base
 2240|       |     *    URI's path.  Although there are many ways to do this, we will
 2241|       |     *    describe a simple method using a separate string buffer.
 2242|       |     *
 2243|       |     * Allocate a buffer large enough for the result string.
 2244|       |     */
 2245|  7.09k|    len = 2; /* extra / and 0 */
 2246|  7.09k|    if (ref->path != NULL)
  ------------------
  |  Branch (2246:9): [True: 7.09k, False: 0]
  ------------------
 2247|  7.09k|	len += strlen(ref->path);
 2248|  7.09k|    if (bas->path != NULL)
  ------------------
  |  Branch (2248:9): [True: 3.45k, False: 3.63k]
  ------------------
 2249|  3.45k|	len += strlen(bas->path);
 2250|  7.09k|    res->path = xmlMalloc(len);
 2251|  7.09k|    if (res->path == NULL)
  ------------------
  |  Branch (2251:9): [True: 18, False: 7.07k]
  ------------------
 2252|     18|	goto done;
 2253|  7.07k|    res->path[0] = 0;
 2254|       |
 2255|       |    /*
 2256|       |     * a) All but the last segment of the base URI's path component is
 2257|       |     *    copied to the buffer.  In other words, any characters after the
 2258|       |     *    last (right-most) slash character, if any, are excluded.
 2259|       |     */
 2260|  7.07k|    cur = 0;
 2261|  7.07k|    out = 0;
 2262|  7.07k|    if (bas->path != NULL) {
  ------------------
  |  Branch (2262:9): [True: 3.45k, False: 3.62k]
  ------------------
 2263|  59.0k|	while (bas->path[cur] != 0) {
  ------------------
  |  Branch (2263:9): [True: 57.8k, False: 1.24k]
  ------------------
 2264|  2.52M|	    while ((bas->path[cur] != 0) && (bas->path[cur] != '/'))
  ------------------
  |  Branch (2264:13): [True: 2.51M, False: 2.20k]
  |  Branch (2264:38): [True: 2.46M, False: 55.6k]
  ------------------
 2265|  2.46M|		cur++;
 2266|  57.8k|	    if (bas->path[cur] == 0)
  ------------------
  |  Branch (2266:10): [True: 2.20k, False: 55.6k]
  ------------------
 2267|  2.20k|		break;
 2268|       |
 2269|  55.6k|	    cur++;
 2270|  2.44M|	    while (out < cur) {
  ------------------
  |  Branch (2270:13): [True: 2.38M, False: 55.6k]
  ------------------
 2271|  2.38M|		res->path[out] = bas->path[out];
 2272|  2.38M|		out++;
 2273|  2.38M|	    }
 2274|  55.6k|	}
 2275|  3.45k|    }
 2276|  7.07k|    res->path[out] = 0;
 2277|       |
 2278|       |    /*
 2279|       |     * b) The reference's path component is appended to the buffer
 2280|       |     *    string.
 2281|       |     */
 2282|  7.07k|    if (ref->path != NULL && ref->path[0] != 0) {
  ------------------
  |  Branch (2282:9): [True: 7.07k, False: 0]
  |  Branch (2282:30): [True: 7.04k, False: 36]
  ------------------
 2283|  7.04k|	indx = 0;
 2284|       |	/*
 2285|       |	 * Ensure the path includes a '/'
 2286|       |	 */
 2287|  7.04k|	if ((out == 0) && ((bas->server != NULL) || bas->port != PORT_EMPTY))
  ------------------
  |  |   36|  1.93k|#define PORT_EMPTY           0
  ------------------
  |  Branch (2287:6): [True: 4.22k, False: 2.81k]
  |  Branch (2287:21): [True: 2.29k, False: 1.93k]
  |  Branch (2287:46): [True: 670, False: 1.26k]
  ------------------
 2288|  2.96k|	    res->path[out++] = '/';
 2289|   100k|	while (ref->path[indx] != 0) {
  ------------------
  |  Branch (2289:9): [True: 93.4k, False: 7.04k]
  ------------------
 2290|  93.4k|	    res->path[out++] = ref->path[indx++];
 2291|  93.4k|	}
 2292|  7.04k|    }
 2293|  7.07k|    res->path[out] = 0;
 2294|       |
 2295|       |    /*
 2296|       |     * Steps c) to h) are really path normalization steps
 2297|       |     */
 2298|  7.07k|    xmlNormalizeURIPath(res->path);
 2299|       |
 2300|  13.4k|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|  13.4k|    val = xmlSaveUri(res);
 2308|  13.4k|    if (val != NULL)
  ------------------
  |  Branch (2308:9): [True: 13.3k, False: 88]
  ------------------
 2309|  13.3k|        ret = 0;
 2310|       |
 2311|  34.4k|done:
 2312|  34.4k|    if (ref != NULL)
  ------------------
  |  Branch (2312:9): [True: 23.8k, False: 10.6k]
  ------------------
 2313|  23.8k|	xmlFreeURI(ref);
 2314|  34.4k|    if (bas != NULL)
  ------------------
  |  Branch (2314:9): [True: 15.2k, False: 19.2k]
  ------------------
 2315|  15.2k|	xmlFreeURI(bas);
 2316|  34.4k|    if (res != NULL)
  ------------------
  |  Branch (2316:9): [True: 13.5k, False: 20.9k]
  ------------------
 2317|  13.5k|	xmlFreeURI(res);
 2318|  34.4k|    *valPtr = val;
 2319|  34.4k|    return(ret);
 2320|  13.4k|}
xmlBuildRelativeURISafe:
 2493|  4.43k|{
 2494|  4.43k|    xmlChar *val = NULL;
 2495|  4.43k|    int ret = 0;
 2496|  4.43k|    size_t ix = 0;
 2497|  4.43k|    size_t nbslash = 0;
 2498|  4.43k|    size_t len = 0;
 2499|  4.43k|    xmlURIPtr ref = NULL;
 2500|  4.43k|    xmlURIPtr bas = NULL;
 2501|  4.43k|    const xmlChar *bptr, *uptr, *rptr;
 2502|  4.43k|    xmlChar *vptr;
 2503|  4.43k|    int remove_path = 0;
 2504|  4.43k|    int refDrive, baseDrive;
 2505|       |
 2506|  4.43k|    if (valPtr == NULL)
  ------------------
  |  Branch (2506:9): [True: 0, False: 4.43k]
  ------------------
 2507|      0|        return(1);
 2508|  4.43k|    *valPtr = NULL;
 2509|  4.43k|    if ((URI == NULL) || (*URI == 0))
  ------------------
  |  Branch (2509:9): [True: 0, False: 4.43k]
  |  Branch (2509:26): [True: 198, False: 4.23k]
  ------------------
 2510|    198|	return(1);
 2511|       |
 2512|  4.23k|    ret = xmlParseUriOrPath((char *) URI, &ref, &refDrive);
 2513|  4.23k|    if (ret < 0)
  ------------------
  |  Branch (2513:9): [True: 26, False: 4.20k]
  ------------------
 2514|     26|        goto done;
 2515|  4.20k|    if (ret != 0) {
  ------------------
  |  Branch (2515:9): [True: 191, False: 4.01k]
  ------------------
 2516|       |        /* Return URI if URI is invalid */
 2517|    191|        ret = 0;
 2518|    191|        val = xmlStrdup(URI);
 2519|    191|        if (val == NULL)
  ------------------
  |  Branch (2519:13): [True: 1, False: 190]
  ------------------
 2520|      1|            ret = -1;
 2521|    191|        goto done;
 2522|    191|    }
 2523|       |
 2524|       |    /* Return URI if base is empty */
 2525|  4.01k|    if ((base == NULL) || (*base == 0))
  ------------------
  |  Branch (2525:9): [True: 0, False: 4.01k]
  |  Branch (2525:27): [True: 2.46k, False: 1.55k]
  ------------------
 2526|  2.46k|        goto done;
 2527|       |
 2528|  1.55k|    ret = xmlParseUriOrPath((char *) base, &bas, &baseDrive);
 2529|  1.55k|    if (ret < 0)
  ------------------
  |  Branch (2529:9): [True: 7, False: 1.54k]
  ------------------
 2530|      7|        goto done;
 2531|  1.54k|    if (ret != 0) {
  ------------------
  |  Branch (2531:9): [True: 221, False: 1.32k]
  ------------------
 2532|       |        /* Return URI if base is invalid */
 2533|    221|        ret = 0;
 2534|    221|        goto done;
 2535|    221|    }
 2536|       |
 2537|       |    /*
 2538|       |     * If the scheme / server on the URI differs from the base,
 2539|       |     * just return the URI
 2540|       |     */
 2541|  1.32k|    if ((xmlStrcmp ((xmlChar *)bas->scheme, (xmlChar *)ref->scheme)) ||
  ------------------
  |  Branch (2541:9): [True: 27, False: 1.29k]
  ------------------
 2542|  1.29k|	(xmlStrcmp ((xmlChar *)bas->server, (xmlChar *)ref->server)) ||
  ------------------
  |  Branch (2542:2): [True: 18, False: 1.27k]
  ------------------
 2543|  1.27k|        (bas->port != ref->port) ||
  ------------------
  |  Branch (2543:9): [True: 0, False: 1.27k]
  ------------------
 2544|  1.27k|        (baseDrive != refDrive)) {
  ------------------
  |  Branch (2544:9): [True: 0, False: 1.27k]
  ------------------
 2545|     45|	goto done;
 2546|     45|    }
 2547|  1.27k|    if (xmlStrEqual((xmlChar *)bas->path, (xmlChar *)ref->path)) {
  ------------------
  |  Branch (2547:9): [True: 100, False: 1.17k]
  ------------------
 2548|    100|	val = xmlStrdup(BAD_CAST "");
  ------------------
  |  |   34|    100|#define BAD_CAST (xmlChar *)
  ------------------
 2549|    100|        if (val == NULL)
  ------------------
  |  Branch (2549:13): [True: 1, False: 99]
  ------------------
 2550|      1|            ret = -1;
 2551|    100|	goto done;
 2552|    100|    }
 2553|  1.17k|    if (bas->path == NULL) {
  ------------------
  |  Branch (2553:9): [True: 7, False: 1.17k]
  ------------------
 2554|      7|	val = xmlStrdup((xmlChar *)ref->path);
 2555|      7|        if (val == NULL) {
  ------------------
  |  Branch (2555:13): [True: 1, False: 6]
  ------------------
 2556|      1|            ret = -1;
 2557|      1|            goto done;
 2558|      1|        }
 2559|      6|	goto escape;
 2560|      7|    }
 2561|  1.17k|    if (ref->path == NULL) {
  ------------------
  |  Branch (2561:9): [True: 9, False: 1.16k]
  ------------------
 2562|      9|        ref->path = (char *) "/";
 2563|      9|	remove_path = 1;
 2564|      9|    }
 2565|       |
 2566|  1.17k|    bptr = (xmlChar *) bas->path;
 2567|  1.17k|    rptr = (xmlChar *) ref->path;
 2568|       |
 2569|       |    /*
 2570|       |     * Return URI if URI and base aren't both absolute or relative.
 2571|       |     */
 2572|  1.17k|    if ((bptr[0] == '/') != (rptr[0] == '/'))
  ------------------
  |  Branch (2572:9): [True: 226, False: 946]
  ------------------
 2573|    226|        goto done;
 2574|       |
 2575|       |    /*
 2576|       |     * At this point we can compare the two paths
 2577|       |     */
 2578|    946|    {
 2579|    946|        size_t pos = 0;
 2580|       |
 2581|       |        /*
 2582|       |         * Next we compare the two strings and find where they first differ
 2583|       |         */
 2584|  3.01k|	while ((bptr[pos] == rptr[pos]) && (bptr[pos] != 0))
  ------------------
  |  Branch (2584:9): [True: 2.07k, False: 946]
  |  Branch (2584:37): [True: 2.07k, False: 0]
  ------------------
 2585|  2.07k|	    pos++;
 2586|       |
 2587|    946|	if (bptr[pos] == rptr[pos]) {
  ------------------
  |  Branch (2587:6): [True: 0, False: 946]
  ------------------
 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|    946|	ix = pos;
 2599|  1.87k|	for (; ix > 0; ix--) {
  ------------------
  |  Branch (2599:9): [True: 1.07k, False: 807]
  ------------------
 2600|  1.07k|	    if (rptr[ix - 1] == '/')
  ------------------
  |  Branch (2600:10): [True: 139, False: 933]
  ------------------
 2601|    139|		break;
 2602|  1.07k|	}
 2603|    946|	uptr = (xmlChar *)&rptr[ix];
 2604|       |
 2605|       |	/*
 2606|       |	 * In base, count the number of '/' from the differing point
 2607|       |	 */
 2608|   236k|	for (; bptr[ix] != 0; ix++) {
  ------------------
  |  Branch (2608:9): [True: 235k, False: 946]
  ------------------
 2609|   235k|	    if (bptr[ix] == '/')
  ------------------
  |  Branch (2609:10): [True: 63.7k, False: 172k]
  ------------------
 2610|  63.7k|		nbslash++;
 2611|   235k|	}
 2612|       |
 2613|       |	/*
 2614|       |	 * e.g: URI="foo/" base="foo/bar" -> "./"
 2615|       |	 */
 2616|    946|	if (nbslash == 0 && !uptr[0]) {
  ------------------
  |  Branch (2616:6): [True: 247, False: 699]
  |  Branch (2616:22): [True: 2, False: 245]
  ------------------
 2617|      2|	    val = xmlStrdup(BAD_CAST "./");
  ------------------
  |  |   34|      2|#define BAD_CAST (xmlChar *)
  ------------------
 2618|      2|            if (val == NULL)
  ------------------
  |  Branch (2618:17): [True: 1, False: 1]
  ------------------
 2619|      1|                ret = -1;
 2620|      2|	    goto done;
 2621|      2|	}
 2622|       |
 2623|    944|	len = (size_t) xmlStrlen (uptr) + 1;
 2624|    944|    }
 2625|       |
 2626|    944|    if (nbslash == 0) {
  ------------------
  |  Branch (2626:9): [True: 245, False: 699]
  ------------------
 2627|    245|	if (uptr != NULL) {
  ------------------
  |  Branch (2627:6): [True: 245, False: 0]
  ------------------
 2628|       |	    /* exception characters from xmlSaveUri */
 2629|    245|	    val = xmlURIEscapeStr(uptr, BAD_CAST "/;&=+$,");
  ------------------
  |  |   34|    245|#define BAD_CAST (xmlChar *)
  ------------------
 2630|    245|            if (val == NULL)
  ------------------
  |  Branch (2630:17): [True: 3, False: 242]
  ------------------
 2631|      3|                ret = -1;
 2632|    245|        }
 2633|    245|	goto done;
 2634|    245|    }
 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|    699|    if (len + 3 * nbslash > SIZE_MAX) {
  ------------------
  |  Branch (2641:9): [True: 0, False: 699]
  ------------------
 2642|      0|        ret = -1;
 2643|      0|        goto done;
 2644|      0|    }
 2645|    699|    val = (xmlChar *) xmlMalloc (len + 3 * nbslash);
 2646|    699|    if (val == NULL) {
  ------------------
  |  Branch (2646:9): [True: 1, False: 698]
  ------------------
 2647|      1|        ret = -1;
 2648|      1|	goto done;
 2649|      1|    }
 2650|    698|    vptr = val;
 2651|       |    /*
 2652|       |     * Put in as many "../" as needed
 2653|       |     */
 2654|  64.4k|    for (; nbslash>0; nbslash--) {
  ------------------
  |  Branch (2654:12): [True: 63.7k, False: 698]
  ------------------
 2655|  63.7k|	*vptr++ = '.';
 2656|  63.7k|	*vptr++ = '.';
 2657|  63.7k|	*vptr++ = '/';
 2658|  63.7k|    }
 2659|       |    /*
 2660|       |     * Finish up with the end of the URI
 2661|       |     */
 2662|    698|    if (uptr != NULL) {
  ------------------
  |  Branch (2662:9): [True: 698, False: 0]
  ------------------
 2663|    698|        if ((vptr > val) && (len > 0) &&
  ------------------
  |  Branch (2663:13): [True: 698, False: 0]
  |  Branch (2663:29): [True: 698, False: 0]
  ------------------
 2664|    698|	    (uptr[0] == '/') && (vptr[-1] == '/')) {
  ------------------
  |  Branch (2664:6): [True: 0, False: 698]
  |  Branch (2664:26): [True: 0, False: 0]
  ------------------
 2665|      0|	    memcpy (vptr, uptr + 1, len - 1);
 2666|      0|	    vptr[len - 2] = 0;
 2667|    698|	} else {
 2668|    698|	    memcpy (vptr, uptr, len);
 2669|    698|	    vptr[len - 1] = 0;
 2670|    698|	}
 2671|    698|    } else {
 2672|      0|	vptr[len - 1] = 0;
 2673|      0|    }
 2674|       |
 2675|    704|escape:
 2676|       |    /* escape the freshly-built path */
 2677|    704|    vptr = val;
 2678|       |    /* exception characters from xmlSaveUri */
 2679|    704|    val = xmlURIEscapeStr(vptr, BAD_CAST "/;&=+$,");
  ------------------
  |  |   34|    704|#define BAD_CAST (xmlChar *)
  ------------------
 2680|    704|    if (val == NULL)
  ------------------
  |  Branch (2680:9): [True: 3, False: 701]
  ------------------
 2681|      3|        ret = -1;
 2682|    701|    else
 2683|    701|        ret = 0;
 2684|    704|    xmlFree(vptr);
 2685|       |
 2686|  4.23k|done:
 2687|  4.23k|    if ((ret == 0) && (val == NULL)) {
  ------------------
  |  Branch (2687:9): [True: 4.18k, False: 44]
  |  Branch (2687:23): [True: 2.95k, False: 1.23k]
  ------------------
 2688|  2.95k|        val = xmlSaveUri(ref);
 2689|  2.95k|        if (val == NULL)
  ------------------
  |  Branch (2689:13): [True: 4, False: 2.95k]
  ------------------
 2690|      4|            ret = -1;
 2691|  2.95k|    }
 2692|       |
 2693|       |    /*
 2694|       |     * Free the working variables
 2695|       |     */
 2696|  4.23k|    if (remove_path != 0)
  ------------------
  |  Branch (2696:9): [True: 9, False: 4.22k]
  ------------------
 2697|      9|        ref->path = NULL;
 2698|  4.23k|    if (ref != NULL)
  ------------------
  |  Branch (2698:9): [True: 4.01k, False: 217]
  ------------------
 2699|  4.01k|	xmlFreeURI (ref);
 2700|  4.23k|    if (bas != NULL)
  ------------------
  |  Branch (2700:9): [True: 1.32k, False: 2.90k]
  ------------------
 2701|  1.32k|	xmlFreeURI (bas);
 2702|  4.23k|    if (ret != 0) {
  ------------------
  |  Branch (2702:9): [True: 48, False: 4.18k]
  ------------------
 2703|     48|        xmlFree(val);
 2704|     48|        val = NULL;
 2705|     48|    }
 2706|       |
 2707|  4.23k|    *valPtr = val;
 2708|  4.23k|    return(ret);
 2709|    704|}
xmlCanonicPath:
 2747|  8.44k|{
 2748|  8.44k|    xmlChar *ret;
 2749|       |
 2750|  8.44k|    if (path == NULL)
  ------------------
  |  Branch (2750:9): [True: 0, False: 8.44k]
  ------------------
 2751|      0|	return(NULL);
 2752|       |
 2753|       |    /* Check if this is an "absolute uri" */
 2754|  8.44k|    if (xmlStrstr(path, BAD_CAST "://") != NULL) {
  ------------------
  |  |   34|  8.44k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (2754:9): [True: 419, False: 8.02k]
  ------------------
 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|    419|        ret = xmlURIEscapeStr(path, BAD_CAST ":/?#[]@!$&()*+,;='%");
  ------------------
  |  |   34|    419|#define BAD_CAST (xmlChar *)
  ------------------
 2763|  8.02k|    } else {
 2764|  8.02k|        ret = xmlStrdup((const xmlChar *) path);
 2765|  8.02k|    }
 2766|       |
 2767|  8.44k|    return(ret);
 2768|  8.44k|}
xmlPathToURI:
 2781|  8.44k|{
 2782|  8.44k|    return(xmlCanonicPath(path));
 2783|  8.44k|}
uri.c:xmlParse3986URIReference:
  924|   363k|xmlParse3986URIReference(xmlURIPtr uri, const char *str) {
  925|   363k|    int ret;
  926|       |
  927|   363k|    if (str == NULL)
  ------------------
  |  Branch (927:9): [True: 0, False: 363k]
  ------------------
  928|      0|	return(-1);
  929|   363k|    xmlCleanURI(uri);
  930|       |
  931|       |    /*
  932|       |     * Try first to parse absolute refs, then fallback to relative if
  933|       |     * it fails.
  934|       |     */
  935|   363k|    ret = xmlParse3986URI(uri, str);
  936|   363k|    if (ret < 0)
  ------------------
  |  Branch (936:9): [True: 143, False: 363k]
  ------------------
  937|    143|        return(ret);
  938|   363k|    if (ret != 0) {
  ------------------
  |  Branch (938:9): [True: 337k, False: 25.7k]
  ------------------
  939|   337k|	xmlCleanURI(uri);
  940|   337k|        ret = xmlParse3986RelativeRef(uri, str);
  941|   337k|	if (ret != 0) {
  ------------------
  |  Branch (941:6): [True: 27.2k, False: 310k]
  ------------------
  942|  27.2k|	    xmlCleanURI(uri);
  943|  27.2k|	    return(ret);
  944|  27.2k|	}
  945|   337k|    }
  946|   335k|    return(0);
  947|   363k|}
uri.c:xmlCleanURI:
 1383|   761k|xmlCleanURI(xmlURIPtr uri) {
 1384|   761k|    if (uri == NULL) return;
  ------------------
  |  Branch (1384:9): [True: 0, False: 761k]
  ------------------
 1385|       |
 1386|   761k|    if (uri->scheme != NULL) xmlFree(uri->scheme);
  ------------------
  |  Branch (1386:9): [True: 52.8k, False: 708k]
  ------------------
 1387|   761k|    uri->scheme = NULL;
 1388|   761k|    if (uri->server != NULL) xmlFree(uri->server);
  ------------------
  |  Branch (1388:9): [True: 4.14k, False: 757k]
  ------------------
 1389|   761k|    uri->server = NULL;
 1390|   761k|    if (uri->user != NULL) xmlFree(uri->user);
  ------------------
  |  Branch (1390:9): [True: 766, False: 760k]
  ------------------
 1391|   761k|    uri->user = NULL;
 1392|   761k|    if (uri->path != NULL) xmlFree(uri->path);
  ------------------
  |  Branch (1392:9): [True: 21.9k, False: 739k]
  ------------------
 1393|   761k|    uri->path = NULL;
 1394|   761k|    if (uri->fragment != NULL) xmlFree(uri->fragment);
  ------------------
  |  Branch (1394:9): [True: 1.75k, False: 759k]
  ------------------
 1395|   761k|    uri->fragment = NULL;
 1396|   761k|    if (uri->opaque != NULL) xmlFree(uri->opaque);
  ------------------
  |  Branch (1396:9): [True: 0, False: 761k]
  ------------------
 1397|   761k|    uri->opaque = NULL;
 1398|   761k|    if (uri->authority != NULL) xmlFree(uri->authority);
  ------------------
  |  Branch (1398:9): [True: 0, False: 761k]
  ------------------
 1399|   761k|    uri->authority = NULL;
 1400|   761k|    if (uri->query != NULL) xmlFree(uri->query);
  ------------------
  |  Branch (1400:9): [True: 2.23k, False: 759k]
  ------------------
 1401|   761k|    uri->query = NULL;
 1402|   761k|    if (uri->query_raw != NULL) xmlFree(uri->query_raw);
  ------------------
  |  Branch (1402:9): [True: 2.22k, False: 759k]
  ------------------
 1403|       |    uri->query_raw = NULL;
 1404|   761k|}
uri.c:xmlParse3986URI:
  885|   363k|xmlParse3986URI(xmlURIPtr uri, const char *str) {
  886|   363k|    int ret;
  887|       |
  888|   363k|    ret = xmlParse3986Scheme(uri, &str);
  889|   363k|    if (ret != 0) return(ret);
  ------------------
  |  Branch (889:9): [True: 284k, False: 78.6k]
  ------------------
  890|  78.6k|    if (*str != ':') {
  ------------------
  |  Branch (890:9): [True: 44.1k, False: 34.5k]
  ------------------
  891|  44.1k|	return(1);
  892|  44.1k|    }
  893|  34.5k|    str++;
  894|  34.5k|    ret = xmlParse3986HierPart(uri, &str);
  895|  34.5k|    if (ret != 0) return(ret);
  ------------------
  |  Branch (895:9): [True: 1.18k, False: 33.3k]
  ------------------
  896|  33.3k|    if (*str == '?') {
  ------------------
  |  Branch (896:9): [True: 3.48k, False: 29.8k]
  ------------------
  897|  3.48k|	str++;
  898|  3.48k|	ret = xmlParse3986Query(uri, &str);
  899|  3.48k|	if (ret != 0) return(ret);
  ------------------
  |  Branch (899:6): [True: 17, False: 3.46k]
  ------------------
  900|  3.48k|    }
  901|  33.3k|    if (*str == '#') {
  ------------------
  |  Branch (901:9): [True: 1.52k, False: 31.7k]
  ------------------
  902|  1.52k|	str++;
  903|  1.52k|	ret = xmlParse3986Fragment(uri, &str);
  904|  1.52k|	if (ret != 0) return(ret);
  ------------------
  |  Branch (904:6): [True: 3, False: 1.52k]
  ------------------
  905|  1.52k|    }
  906|  33.3k|    if (*str != 0) {
  ------------------
  |  Branch (906:9): [True: 7.56k, False: 25.7k]
  ------------------
  907|  7.56k|	xmlCleanURI(uri);
  908|  7.56k|	return(1);
  909|  7.56k|    }
  910|  25.7k|    return(0);
  911|  33.3k|}
uri.c:xmlParse3986Scheme:
  224|   363k|xmlParse3986Scheme(xmlURIPtr uri, const char **str) {
  225|   363k|    const char *cur;
  226|       |
  227|   363k|    cur = *str;
  228|   363k|    if (!ISA_ALPHA(cur))
  ------------------
  |  |  128|   363k|#define ISA_ALPHA(p) (((*(p) >= 'a') && (*(p) <= 'z')) ||		\
  |  |  ------------------
  |  |  |  Branch (128:24): [True: 75.6k, False: 287k]
  |  |  |  Branch (128:41): [True: 73.9k, False: 1.74k]
  |  |  ------------------
  |  |  129|   363k|                      ((*(p) >= 'A') && (*(p) <= 'Z')))
  |  |  ------------------
  |  |  |  Branch (129:24): [True: 7.25k, False: 282k]
  |  |  |  Branch (129:41): [True: 4.77k, False: 2.47k]
  |  |  ------------------
  ------------------
  229|   284k|	return(1);
  230|  78.7k|    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|   257k|    while (ISA_ALPHA(cur) || ISA_DIGIT(cur) ||
  ------------------
  |  |  128|   515k|#define ISA_ALPHA(p) (((*(p) >= 'a') && (*(p) <= 'z')) ||		\
  |  |  ------------------
  |  |  |  Branch (128:24): [True: 89.7k, False: 167k]
  |  |  |  Branch (128:41): [True: 89.4k, False: 337]
  |  |  ------------------
  |  |  129|   515k|                      ((*(p) >= 'A') && (*(p) <= 'Z')))
  |  |  ------------------
  |  |  |  Branch (129:24): [True: 68.1k, False: 100k]
  |  |  |  Branch (129:41): [True: 67.5k, False: 547]
  |  |  ------------------
  ------------------
                  while (ISA_ALPHA(cur) || ISA_DIGIT(cur) ||
  ------------------
  |  |  127|   358k|#define ISA_DIGIT(p) ((*(p) >= '0') && (*(p) <= '9'))
  |  |  ------------------
  |  |  |  Branch (127:23): [True: 48.5k, False: 52.1k]
  |  |  |  Branch (127:40): [True: 11.0k, False: 37.4k]
  |  |  ------------------
  ------------------
  241|   178k|           (*cur == '+') || (*cur == '-') || (*cur == '.')) cur++;
  ------------------
  |  Branch (241:12): [True: 6.43k, False: 83.1k]
  |  Branch (241:29): [True: 2.20k, False: 80.9k]
  |  Branch (241:46): [True: 2.26k, False: 78.7k]
  ------------------
  242|  78.7k|    if (uri != NULL) {
  ------------------
  |  Branch (242:9): [True: 78.7k, False: 0]
  ------------------
  243|  78.7k|	if (uri->scheme != NULL) xmlFree(uri->scheme);
  ------------------
  |  Branch (243:6): [True: 0, False: 78.7k]
  ------------------
  244|  78.7k|	uri->scheme = STRNDUP(*str, cur - *str);
  ------------------
  |  |  119|  78.7k|#define STRNDUP(s, n) (char *) xmlStrndup((const xmlChar *)(s), (n))
  ------------------
  245|  78.7k|        if (uri->scheme == NULL)
  ------------------
  |  Branch (245:13): [True: 56, False: 78.6k]
  ------------------
  246|     56|            return(-1);
  247|  78.7k|    }
  248|  78.6k|    *str = cur;
  249|  78.6k|    return(0);
  250|  78.7k|}
uri.c:xmlParse3986HierPart:
  782|  34.5k|{
  783|  34.5k|    const char *cur;
  784|  34.5k|    int ret;
  785|       |
  786|  34.5k|    cur = *str;
  787|       |
  788|  34.5k|    if ((*cur == '/') && (*(cur + 1) == '/')) {
  ------------------
  |  Branch (788:9): [True: 25.7k, False: 8.73k]
  |  Branch (788:26): [True: 25.0k, False: 730]
  ------------------
  789|  25.0k|        cur += 2;
  790|  25.0k|	ret = xmlParse3986Authority(uri, &cur);
  791|  25.0k|	if (ret != 0) return(ret);
  ------------------
  |  Branch (791:6): [True: 1.16k, False: 23.8k]
  ------------------
  792|       |        /*
  793|       |         * An empty server is marked with a special URI value.
  794|       |         */
  795|  23.8k|	if ((uri->server == NULL) && (uri->port == PORT_EMPTY))
  ------------------
  |  |   36|  2.96k|#define PORT_EMPTY           0
  ------------------
  |  Branch (795:6): [True: 2.96k, False: 20.9k]
  |  Branch (795:31): [True: 2.68k, False: 278]
  ------------------
  796|  2.68k|	    uri->port = PORT_EMPTY_SERVER;
  ------------------
  |  |   37|  2.68k|#define PORT_EMPTY_SERVER   -1
  ------------------
  797|  23.8k|	ret = xmlParse3986PathAbEmpty(uri, &cur);
  798|  23.8k|	if (ret != 0) return(ret);
  ------------------
  |  Branch (798:6): [True: 10, False: 23.8k]
  ------------------
  799|  23.8k|	*str = cur;
  800|  23.8k|	return(0);
  801|  23.8k|    } else if (*cur == '/') {
  ------------------
  |  Branch (801:16): [True: 730, False: 8.73k]
  ------------------
  802|    730|        ret = xmlParse3986PathAbsolute(uri, &cur);
  803|    730|	if (ret != 0) return(ret);
  ------------------
  |  Branch (803:6): [True: 1, False: 729]
  ------------------
  804|  8.73k|    } else if (ISA_PCHAR(uri, cur)) {
  ------------------
  |  |  174|  8.73k|     (ISA_UNRESERVED(u, p) || ISA_PCT_ENCODED(p) || ISA_SUB_DELIM(p) ||	\
  |  |  ------------------
  |  |  |  |  189|  17.4k|#define ISA_UNRESERVED(u, p) (xmlIsUnreserved(u, p))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (189:30): [True: 2.62k, False: 6.10k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                    (ISA_UNRESERVED(u, p) || ISA_PCT_ENCODED(p) || ISA_SUB_DELIM(p) ||	\
  |  |  ------------------
  |  |  |  |  168|  14.8k|     ((*(p) == '%') && (ISA_HEXDIG(p + 1)) && (ISA_HEXDIG(p + 2)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  131|  2.19k|       (ISA_DIGIT(p) || ((*(p) >= 'a') && (*(p) <= 'f')) ||		\
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  127|  4.38k|#define ISA_DIGIT(p) ((*(p) >= '0') && (*(p) <= '9'))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (127:23): [True: 1.93k, False: 259]
  |  |  |  |  |  |  |  |  |  Branch (127:40): [True: 319, False: 1.61k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (131:26): [True: 1.14k, False: 733]
  |  |  |  |  |  |  |  Branch (131:43): [True: 949, False: 192]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  132|  2.19k|        ((*(p) >= 'A') && (*(p) <= 'F')))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (132:10): [True: 655, False: 270]
  |  |  |  |  |  |  |  Branch (132:27): [True: 460, False: 195]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |                    ((*(p) == '%') && (ISA_HEXDIG(p + 1)) && (ISA_HEXDIG(p + 2)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  131|  1.72k|       (ISA_DIGIT(p) || ((*(p) >= 'a') && (*(p) <= 'f')) ||		\
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  127|  3.45k|#define ISA_DIGIT(p) ((*(p) >= '0') && (*(p) <= '9'))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (127:23): [True: 1.28k, False: 439]
  |  |  |  |  |  |  |  |  |  Branch (127:40): [True: 298, False: 991]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (131:26): [True: 722, False: 708]
  |  |  |  |  |  |  |  Branch (131:43): [True: 507, False: 215]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  132|  1.72k|        ((*(p) >= 'A') && (*(p) <= 'F')))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (132:10): [True: 480, False: 443]
  |  |  |  |  |  |  |  Branch (132:27): [True: 128, False: 352]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (168:7): [True: 2.19k, False: 3.90k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                    (ISA_UNRESERVED(u, p) || ISA_PCT_ENCODED(p) || ISA_SUB_DELIM(p) ||	\
  |  |  ------------------
  |  |  |  |  139|  13.8k|      (((*(p) == '!')) || ((*(p) == '$')) || ((*(p) == '&')) ||		\
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (139:8): [True: 209, False: 4.95k]
  |  |  |  |  |  Branch (139:27): [True: 220, False: 4.73k]
  |  |  |  |  |  Branch (139:46): [True: 92, False: 4.64k]
  |  |  |  |  ------------------
  |  |  |  |  140|  5.16k|       ((*(p) == '(')) || ((*(p) == ')')) || ((*(p) == '*')) ||		\
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (140:8): [True: 229, False: 4.41k]
  |  |  |  |  |  Branch (140:27): [True: 204, False: 4.21k]
  |  |  |  |  |  Branch (140:46): [True: 267, False: 3.94k]
  |  |  |  |  ------------------
  |  |  |  |  141|  5.16k|       ((*(p) == '+')) || ((*(p) == ',')) || ((*(p) == ';')) ||		\
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (141:8): [True: 164, False: 3.78k]
  |  |  |  |  |  Branch (141:27): [True: 239, False: 3.54k]
  |  |  |  |  |  Branch (141:46): [True: 345, False: 3.19k]
  |  |  |  |  ------------------
  |  |  |  |  142|  5.16k|       ((*(p) == '=')) || ((*(p) == '\'')))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (142:8): [True: 201, False: 2.99k]
  |  |  |  |  |  Branch (142:27): [True: 63, False: 2.93k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  175|  8.73k|      ((*(p) == ':')) || ((*(p) == '@')))
  |  |  ------------------
  |  |  |  Branch (175:7): [True: 319, False: 2.61k]
  |  |  |  Branch (175:26): [True: 216, False: 2.40k]
  |  |  ------------------
  ------------------
  805|  6.33k|        ret = xmlParse3986PathRootless(uri, &cur);
  806|  6.33k|	if (ret != 0) return(ret);
  ------------------
  |  Branch (806:6): [True: 12, False: 6.31k]
  ------------------
  807|  6.33k|    } else {
  808|       |	/* path-empty is effectively empty */
  809|  2.40k|	if (uri != NULL) {
  ------------------
  |  Branch (809:6): [True: 2.40k, False: 0]
  ------------------
  810|  2.40k|	    if (uri->path != NULL) xmlFree(uri->path);
  ------------------
  |  Branch (810:10): [True: 0, False: 2.40k]
  ------------------
  811|  2.40k|	    uri->path = NULL;
  812|  2.40k|	}
  813|  2.40k|    }
  814|  9.44k|    *str = cur;
  815|  9.44k|    return (0);
  816|  34.5k|}
uri.c:xmlParse3986Authority:
  529|  27.4k|{
  530|  27.4k|    const char *cur;
  531|  27.4k|    int ret;
  532|       |
  533|  27.4k|    cur = *str;
  534|       |    /*
  535|       |     * try to parse an userinfo and check for the trailing @
  536|       |     */
  537|  27.4k|    ret = xmlParse3986Userinfo(uri, &cur);
  538|  27.4k|    if (ret < 0)
  ------------------
  |  Branch (538:9): [True: 18, False: 27.3k]
  ------------------
  539|     18|        return(ret);
  540|  27.3k|    if ((ret != 0) || (*cur != '@'))
  ------------------
  |  Branch (540:9): [True: 22.5k, False: 4.84k]
  |  Branch (540:23): [True: 0, False: 4.84k]
  ------------------
  541|  22.5k|        cur = *str;
  542|  4.84k|    else
  543|  4.84k|        cur++;
  544|  27.3k|    ret = xmlParse3986Host(uri, &cur);
  545|  27.3k|    if (ret != 0) return(ret);
  ------------------
  |  Branch (545:9): [True: 237, False: 27.1k]
  ------------------
  546|  27.1k|    if (*cur == ':') {
  ------------------
  |  Branch (546:9): [True: 3.16k, False: 23.9k]
  ------------------
  547|  3.16k|        cur++;
  548|  3.16k|        ret = xmlParse3986Port(uri, &cur);
  549|  3.16k|	if (ret != 0) return(ret);
  ------------------
  |  Branch (549:6): [True: 1.22k, False: 1.93k]
  ------------------
  550|  3.16k|    }
  551|  25.9k|    *str = cur;
  552|  25.9k|    return(0);
  553|  27.1k|}
uri.c:xmlParse3986Userinfo:
  379|  27.4k|{
  380|  27.4k|    const char *cur;
  381|       |
  382|  27.4k|    cur = *str;
  383|  3.58M|    while (ISA_UNRESERVED(uri, cur) || ISA_PCT_ENCODED(cur) ||
  ------------------
  |  |  189|  7.16M|#define ISA_UNRESERVED(u, p) (xmlIsUnreserved(u, p))
  |  |  ------------------
  |  |  |  Branch (189:30): [True: 179k, False: 3.40M]
  |  |  ------------------
  ------------------
                  while (ISA_UNRESERVED(uri, cur) || ISA_PCT_ENCODED(cur) ||
  ------------------
  |  |  168|  6.98M|     ((*(p) == '%') && (ISA_HEXDIG(p + 1)) && (ISA_HEXDIG(p + 2)))
  |  |  ------------------
  |  |  |  |  131|  3.35M|       (ISA_DIGIT(p) || ((*(p) >= 'a') && (*(p) <= 'f')) ||		\
  |  |  |  |  ------------------
  |  |  |  |  |  |  127|  6.71M|#define ISA_DIGIT(p) ((*(p) >= '0') && (*(p) <= '9'))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (127:23): [True: 3.35M, False: 281]
  |  |  |  |  |  |  |  Branch (127:40): [True: 3.34M, False: 9.59k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (131:26): [True: 1.27k, False: 8.60k]
  |  |  |  |  |  Branch (131:43): [True: 1.09k, False: 180]
  |  |  |  |  ------------------
  |  |  |  |  132|  3.35M|        ((*(p) >= 'A') && (*(p) <= 'F')))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (132:10): [True: 8.49k, False: 286]
  |  |  |  |  |  Branch (132:27): [True: 8.31k, False: 182]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                    ((*(p) == '%') && (ISA_HEXDIG(p + 1)) && (ISA_HEXDIG(p + 2)))
  |  |  ------------------
  |  |  |  |  131|  3.35M|       (ISA_DIGIT(p) || ((*(p) >= 'a') && (*(p) <= 'f')) ||		\
  |  |  |  |  ------------------
  |  |  |  |  |  |  127|  6.71M|#define ISA_DIGIT(p) ((*(p) >= '0') && (*(p) <= '9'))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (127:23): [True: 3.35M, False: 253]
  |  |  |  |  |  |  |  Branch (127:40): [True: 3.35M, False: 2.59k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (131:26): [True: 976, False: 1.87k]
  |  |  |  |  |  Branch (131:43): [True: 717, False: 259]
  |  |  |  |  ------------------
  |  |  |  |  132|  3.35M|        ((*(p) >= 'A') && (*(p) <= 'F')))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (132:10): [True: 1.66k, False: 467]
  |  |  |  |  |  Branch (132:27): [True: 1.40k, False: 261]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (168:7): [True: 3.35M, False: 46.3k]
  |  |  ------------------
  ------------------
  384|  47.5k|           ISA_SUB_DELIM(cur) || (*cur == ':'))
  ------------------
  |  |  139|  3.63M|      (((*(p) == '!')) || ((*(p) == '$')) || ((*(p) == '&')) ||		\
  |  |  ------------------
  |  |  |  Branch (139:8): [True: 3.11k, False: 44.4k]
  |  |  |  Branch (139:27): [True: 702, False: 43.7k]
  |  |  |  Branch (139:46): [True: 574, False: 43.1k]
  |  |  ------------------
  |  |  140|  47.5k|       ((*(p) == '(')) || ((*(p) == ')')) || ((*(p) == '*')) ||		\
  |  |  ------------------
  |  |  |  Branch (140:8): [True: 543, False: 42.6k]
  |  |  |  Branch (140:27): [True: 1.81k, False: 40.8k]
  |  |  |  Branch (140:46): [True: 1.91k, False: 38.8k]
  |  |  ------------------
  |  |  141|  47.5k|       ((*(p) == '+')) || ((*(p) == ',')) || ((*(p) == ';')) ||		\
  |  |  ------------------
  |  |  |  Branch (141:8): [True: 977, False: 37.9k]
  |  |  |  Branch (141:27): [True: 619, False: 37.2k]
  |  |  |  Branch (141:46): [True: 899, False: 36.3k]
  |  |  ------------------
  |  |  142|  47.5k|       ((*(p) == '=')) || ((*(p) == '\'')))
  |  |  ------------------
  |  |  |  Branch (142:8): [True: 1.21k, False: 35.1k]
  |  |  |  Branch (142:27): [True: 2.58k, False: 32.6k]
  |  |  ------------------
  ------------------
  |  Branch (384:34): [True: 5.19k, False: 27.4k]
  ------------------
  385|  3.55M|	NEXT(cur);
  ------------------
  |  |  108|  3.55M|#define NEXT(p) ((*p == '%')? p += 3 : p++)
  |  |  ------------------
  |  |  |  Branch (108:18): [True: 3.35M, False: 199k]
  |  |  ------------------
  ------------------
  386|  27.4k|    if (*cur == '@') {
  ------------------
  |  Branch (386:9): [True: 4.86k, False: 22.5k]
  ------------------
  387|  4.86k|	if (uri != NULL) {
  ------------------
  |  Branch (387:6): [True: 4.86k, False: 0]
  ------------------
  388|  4.86k|	    if (uri->user != NULL) xmlFree(uri->user);
  ------------------
  |  Branch (388:10): [True: 0, False: 4.86k]
  ------------------
  389|  4.86k|	    if (uri->cleanup & XML_URI_NO_UNESCAPE)
  ------------------
  |  |  192|  4.86k|#define XML_URI_NO_UNESCAPE     2
  ------------------
  |  Branch (389:10): [True: 0, False: 4.86k]
  ------------------
  390|      0|		uri->user = STRNDUP(*str, cur - *str);
  ------------------
  |  |  119|      0|#define STRNDUP(s, n) (char *) xmlStrndup((const xmlChar *)(s), (n))
  ------------------
  391|  4.86k|	    else
  392|  4.86k|		uri->user = xmlURIUnescapeString(*str, cur - *str, NULL);
  393|  4.86k|            if (uri->user == NULL)
  ------------------
  |  Branch (393:17): [True: 18, False: 4.84k]
  ------------------
  394|     18|                return(-1);
  395|  4.86k|	}
  396|  4.84k|	*str = cur;
  397|  4.84k|	return(0);
  398|  4.86k|    }
  399|  22.5k|    return(1);
  400|  27.4k|}
uri.c:xmlParse3986Host:
  452|  27.3k|{
  453|  27.3k|    const char *cur = *str;
  454|  27.3k|    const char *host;
  455|       |
  456|  27.3k|    host = cur;
  457|       |    /*
  458|       |     * IPv6 and future addressing scheme are enclosed between brackets
  459|       |     */
  460|  27.3k|    if (*cur == '[') {
  ------------------
  |  Branch (460:9): [True: 445, False: 26.9k]
  ------------------
  461|    445|        cur++;
  462|  12.5k|	while ((*cur != ']') && (*cur != 0))
  ------------------
  |  Branch (462:9): [True: 12.2k, False: 239]
  |  Branch (462:26): [True: 12.0k, False: 206]
  ------------------
  463|  12.0k|	    cur++;
  464|    445|	if (*cur != ']')
  ------------------
  |  Branch (464:6): [True: 206, False: 239]
  ------------------
  465|    206|	    return(1);
  466|    239|	cur++;
  467|    239|	goto found;
  468|    445|    }
  469|       |    /*
  470|       |     * try to parse an IPv4
  471|       |     */
  472|  26.9k|    if (ISA_DIGIT(cur)) {
  ------------------
  |  |  127|  26.9k|#define ISA_DIGIT(p) ((*(p) >= '0') && (*(p) <= '9'))
  |  |  ------------------
  |  |  |  Branch (127:23): [True: 20.8k, False: 6.10k]
  |  |  |  Branch (127:40): [True: 6.69k, False: 14.1k]
  |  |  ------------------
  ------------------
  473|  6.69k|        if (xmlParse3986DecOctet(&cur) != 0)
  ------------------
  |  Branch (473:13): [True: 812, False: 5.88k]
  ------------------
  474|    812|	    goto not_ipv4;
  475|  5.88k|	if (*cur != '.')
  ------------------
  |  Branch (475:6): [True: 3.38k, False: 2.49k]
  ------------------
  476|  3.38k|	    goto not_ipv4;
  477|  2.49k|	cur++;
  478|  2.49k|        if (xmlParse3986DecOctet(&cur) != 0)
  ------------------
  |  Branch (478:13): [True: 1.23k, False: 1.26k]
  ------------------
  479|  1.23k|	    goto not_ipv4;
  480|  1.26k|	if (*cur != '.')
  ------------------
  |  Branch (480:6): [True: 948, False: 315]
  ------------------
  481|    948|	    goto not_ipv4;
  482|    315|        if (xmlParse3986DecOctet(&cur) != 0)
  ------------------
  |  Branch (482:13): [True: 315, False: 0]
  ------------------
  483|    315|	    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|  6.69k|not_ipv4:
  490|  6.69k|        cur = *str;
  491|  6.69k|    }
  492|       |    /*
  493|       |     * then this should be a hostname which can be empty
  494|       |     */
  495|  4.30M|    while (ISA_UNRESERVED(uri, cur) ||
  ------------------
  |  |  189|  8.60M|#define ISA_UNRESERVED(u, p) (xmlIsUnreserved(u, p))
  |  |  ------------------
  |  |  |  Branch (189:30): [True: 4.21M, False: 89.7k]
  |  |  ------------------
  ------------------
  496|  89.7k|           ISA_PCT_ENCODED(cur) || ISA_SUB_DELIM(cur))
  ------------------
  |  |  168|  4.39M|     ((*(p) == '%') && (ISA_HEXDIG(p + 1)) && (ISA_HEXDIG(p + 2)))
  |  |  ------------------
  |  |  |  |  131|  43.6k|       (ISA_DIGIT(p) || ((*(p) >= 'a') && (*(p) <= 'f')) ||		\
  |  |  |  |  ------------------
  |  |  |  |  |  |  127|  87.2k|#define ISA_DIGIT(p) ((*(p) >= '0') && (*(p) <= '9'))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (127:23): [True: 43.3k, False: 291]
  |  |  |  |  |  |  |  Branch (127:40): [True: 40.2k, False: 3.09k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (131:26): [True: 1.33k, False: 2.04k]
  |  |  |  |  |  Branch (131:43): [True: 1.15k, False: 188]
  |  |  |  |  ------------------
  |  |  |  |  132|  43.6k|        ((*(p) >= 'A') && (*(p) <= 'F')))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (132:10): [True: 1.94k, False: 296]
  |  |  |  |  |  Branch (132:27): [True: 1.75k, False: 190]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                    ((*(p) == '%') && (ISA_HEXDIG(p + 1)) && (ISA_HEXDIG(p + 2)))
  |  |  ------------------
  |  |  |  |  131|  43.1k|       (ISA_DIGIT(p) || ((*(p) >= 'a') && (*(p) <= 'f')) ||		\
  |  |  |  |  ------------------
  |  |  |  |  |  |  127|  86.2k|#define ISA_DIGIT(p) ((*(p) >= '0') && (*(p) <= '9'))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (127:23): [True: 42.8k, False: 257]
  |  |  |  |  |  |  |  Branch (127:40): [True: 40.2k, False: 2.63k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (131:26): [True: 1.04k, False: 1.85k]
  |  |  |  |  |  Branch (131:43): [True: 786, False: 259]
  |  |  |  |  ------------------
  |  |  |  |  132|  43.1k|        ((*(p) >= 'A') && (*(p) <= 'F')))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (132:10): [True: 1.63k, False: 471]
  |  |  |  |  |  Branch (132:27): [True: 1.37k, False: 261]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (168:7): [True: 43.6k, False: 46.1k]
  |  |  ------------------
  ------------------
                         ISA_PCT_ENCODED(cur) || ISA_SUB_DELIM(cur))
  ------------------
  |  |  139|  47.3k|      (((*(p) == '!')) || ((*(p) == '$')) || ((*(p) == '&')) ||		\
  |  |  ------------------
  |  |  |  Branch (139:8): [True: 4.51k, False: 42.8k]
  |  |  |  Branch (139:27): [True: 1.17k, False: 41.6k]
  |  |  |  Branch (139:46): [True: 416, False: 41.2k]
  |  |  ------------------
  |  |  140|  47.3k|       ((*(p) == '(')) || ((*(p) == ')')) || ((*(p) == '*')) ||		\
  |  |  ------------------
  |  |  |  Branch (140:8): [True: 1.58k, False: 39.6k]
  |  |  |  Branch (140:27): [True: 2.04k, False: 37.6k]
  |  |  |  Branch (140:46): [True: 2.16k, False: 35.4k]
  |  |  ------------------
  |  |  141|  47.3k|       ((*(p) == '+')) || ((*(p) == ',')) || ((*(p) == ';')) ||		\
  |  |  ------------------
  |  |  |  Branch (141:8): [True: 1.43k, False: 34.0k]
  |  |  |  Branch (141:27): [True: 597, False: 33.4k]
  |  |  |  Branch (141:46): [True: 3.29k, False: 30.1k]
  |  |  ------------------
  |  |  142|  47.3k|       ((*(p) == '=')) || ((*(p) == '\'')))
  |  |  ------------------
  |  |  |  Branch (142:8): [True: 1.83k, False: 28.3k]
  |  |  |  Branch (142:27): [True: 1.36k, False: 26.9k]
  |  |  ------------------
  ------------------
  497|  4.27M|        NEXT(cur);
  ------------------
  |  |  108|  4.30M|#define NEXT(p) ((*p == '%')? p += 3 : p++)
  |  |  ------------------
  |  |  |  Branch (108:18): [True: 42.3k, False: 4.23M]
  |  |  ------------------
  ------------------
  498|  27.1k|found:
  499|  27.1k|    if (uri != NULL) {
  ------------------
  |  Branch (499:9): [True: 27.1k, False: 0]
  ------------------
  500|  27.1k|	if (uri->authority != NULL) xmlFree(uri->authority);
  ------------------
  |  Branch (500:6): [True: 0, False: 27.1k]
  ------------------
  501|  27.1k|	uri->authority = NULL;
  502|  27.1k|	if (uri->server != NULL) xmlFree(uri->server);
  ------------------
  |  Branch (502:6): [True: 0, False: 27.1k]
  ------------------
  503|  27.1k|	if (cur != host) {
  ------------------
  |  Branch (503:6): [True: 23.1k, False: 4.05k]
  ------------------
  504|  23.1k|	    if (uri->cleanup & XML_URI_NO_UNESCAPE)
  ------------------
  |  |  192|  23.1k|#define XML_URI_NO_UNESCAPE     2
  ------------------
  |  Branch (504:10): [True: 0, False: 23.1k]
  ------------------
  505|      0|		uri->server = STRNDUP(host, cur - host);
  ------------------
  |  |  119|      0|#define STRNDUP(s, n) (char *) xmlStrndup((const xmlChar *)(s), (n))
  ------------------
  506|  23.1k|	    else
  507|  23.1k|		uri->server = xmlURIUnescapeString(host, cur - host, NULL);
  508|  23.1k|            if (uri->server == NULL)
  ------------------
  |  Branch (508:17): [True: 31, False: 23.1k]
  ------------------
  509|     31|                return(-1);
  510|  23.1k|	} else
  511|  4.05k|	    uri->server = NULL;
  512|  27.1k|    }
  513|  27.1k|    *str = cur;
  514|  27.1k|    return(0);
  515|  27.1k|}
uri.c:xmlParse3986DecOctet:
  415|  9.50k|xmlParse3986DecOctet(const char **str) {
  416|  9.50k|    const char *cur = *str;
  417|       |
  418|  9.50k|    if (!(ISA_DIGIT(cur)))
  ------------------
  |  |  127|  9.50k|#define ISA_DIGIT(p) ((*(p) >= '0') && (*(p) <= '9'))
  |  |  ------------------
  |  |  |  Branch (127:23): [True: 8.66k, False: 840]
  |  |  |  Branch (127:40): [True: 8.42k, False: 235]
  |  |  ------------------
  ------------------
  419|  1.07k|        return(1);
  420|  8.42k|    if (!ISA_DIGIT(cur+1))
  ------------------
  |  |  127|  8.42k|#define ISA_DIGIT(p) ((*(p) >= '0') && (*(p) <= '9'))
  |  |  ------------------
  |  |  |  Branch (127:23): [True: 5.27k, False: 3.15k]
  |  |  |  Branch (127:40): [True: 4.26k, False: 1.00k]
  |  |  ------------------
  ------------------
  421|  4.15k|	cur++;
  422|  4.26k|    else if ((*cur != '0') && (ISA_DIGIT(cur + 1)) && (!ISA_DIGIT(cur+2)))
  ------------------
  |  |  127|  3.53k|#define ISA_DIGIT(p) ((*(p) >= '0') && (*(p) <= '9'))
  |  |  ------------------
  |  |  |  Branch (127:23): [True: 3.53k, False: 0]
  |  |  |  Branch (127:40): [True: 3.53k, False: 0]
  |  |  ------------------
  ------------------
                  else if ((*cur != '0') && (ISA_DIGIT(cur + 1)) && (!ISA_DIGIT(cur+2)))
  ------------------
  |  |  127|  3.53k|#define ISA_DIGIT(p) ((*(p) >= '0') && (*(p) <= '9'))
  |  |  ------------------
  |  |  |  Branch (127:23): [True: 2.62k, False: 917]
  |  |  |  Branch (127:40): [True: 1.79k, False: 829]
  |  |  ------------------
  ------------------
  |  Branch (422:14): [True: 3.53k, False: 729]
  ------------------
  423|  1.74k|	cur += 2;
  424|  2.52k|    else if ((*cur == '1') && (ISA_DIGIT(cur + 1)) && (ISA_DIGIT(cur + 2)))
  ------------------
  |  |  127|    412|#define ISA_DIGIT(p) ((*(p) >= '0') && (*(p) <= '9'))
  |  |  ------------------
  |  |  |  Branch (127:23): [True: 412, False: 0]
  |  |  |  Branch (127:40): [True: 412, False: 0]
  |  |  ------------------
  ------------------
                  else if ((*cur == '1') && (ISA_DIGIT(cur + 1)) && (ISA_DIGIT(cur + 2)))
  ------------------
  |  |  127|    412|#define ISA_DIGIT(p) ((*(p) >= '0') && (*(p) <= '9'))
  |  |  ------------------
  |  |  |  Branch (127:23): [True: 412, False: 0]
  |  |  |  Branch (127:40): [True: 412, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (424:14): [True: 412, False: 2.10k]
  ------------------
  425|    412|	cur += 3;
  426|  2.10k|    else if ((*cur == '2') && (*(cur + 1) >= '0') &&
  ------------------
  |  Branch (426:14): [True: 1.21k, False: 892]
  |  Branch (426:31): [True: 1.21k, False: 0]
  ------------------
  427|  1.21k|	     (*(cur + 1) <= '4') && (ISA_DIGIT(cur + 2)))
  ------------------
  |  |  127|    272|#define ISA_DIGIT(p) ((*(p) >= '0') && (*(p) <= '9'))
  |  |  ------------------
  |  |  |  Branch (127:23): [True: 272, False: 0]
  |  |  |  Branch (127:40): [True: 272, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (427:7): [True: 272, False: 945]
  ------------------
  428|    272|	cur += 3;
  429|  1.83k|    else if ((*cur == '2') && (*(cur + 1) == '5') &&
  ------------------
  |  Branch (429:14): [True: 945, False: 892]
  |  Branch (429:31): [True: 554, False: 391]
  ------------------
  430|    554|	     (*(cur + 2) >= '0') && (*(cur + 1) <= '5'))
  ------------------
  |  Branch (430:7): [True: 554, False: 0]
  |  Branch (430:30): [True: 554, False: 0]
  ------------------
  431|    554|	cur += 3;
  432|  1.28k|    else
  433|  1.28k|        return(1);
  434|  7.14k|    *str = cur;
  435|  7.14k|    return(0);
  436|  8.42k|}
uri.c:xmlParse3986Port:
  342|  3.16k|{
  343|  3.16k|    const char *cur = *str;
  344|  3.16k|    int port = 0;
  345|       |
  346|  3.16k|    if (ISA_DIGIT(cur)) {
  ------------------
  |  |  127|  3.16k|#define ISA_DIGIT(p) ((*(p) >= '0') && (*(p) <= '9'))
  |  |  ------------------
  |  |  |  Branch (127:23): [True: 2.76k, False: 399]
  |  |  |  Branch (127:40): [True: 2.36k, False: 406]
  |  |  ------------------
  ------------------
  347|  11.1k|	while (ISA_DIGIT(cur)) {
  ------------------
  |  |  127|  11.1k|#define ISA_DIGIT(p) ((*(p) >= '0') && (*(p) <= '9'))
  |  |  ------------------
  |  |  |  Branch (127:23): [True: 9.44k, False: 1.68k]
  |  |  |  Branch (127:40): [True: 9.18k, False: 258]
  |  |  ------------------
  ------------------
  348|  9.18k|            int digit = *cur - '0';
  349|       |
  350|  9.18k|            if (port > INT_MAX / 10)
  ------------------
  |  Branch (350:17): [True: 235, False: 8.95k]
  ------------------
  351|    235|                return(1);
  352|  8.95k|            port *= 10;
  353|  8.95k|            if (port > INT_MAX - digit)
  ------------------
  |  Branch (353:17): [True: 188, False: 8.76k]
  ------------------
  354|    188|                return(1);
  355|  8.76k|	    port += digit;
  356|       |
  357|  8.76k|	    cur++;
  358|  8.76k|	}
  359|  1.93k|	if (uri != NULL)
  ------------------
  |  Branch (359:6): [True: 1.93k, False: 0]
  ------------------
  360|  1.93k|	    uri->port = port;
  361|  1.93k|	*str = cur;
  362|  1.93k|	return(0);
  363|  2.36k|    }
  364|    805|    return(1);
  365|  3.16k|}
uri.c:xmlParse3986PathAbEmpty:
  609|  25.9k|{
  610|  25.9k|    const char *cur;
  611|  25.9k|    int ret;
  612|       |
  613|  25.9k|    cur = *str;
  614|       |
  615|   107k|    while (*cur == '/') {
  ------------------
  |  Branch (615:12): [True: 81.2k, False: 25.9k]
  ------------------
  616|  81.2k|        cur++;
  617|  81.2k|	ret = xmlParse3986Segment(uri, &cur, 0, 1);
  618|  81.2k|	if (ret != 0) return(ret);
  ------------------
  |  Branch (618:6): [True: 0, False: 81.2k]
  ------------------
  619|  81.2k|    }
  620|  25.9k|    if (uri != NULL) {
  ------------------
  |  Branch (620:9): [True: 25.9k, False: 0]
  ------------------
  621|  25.9k|	if (uri->path != NULL) xmlFree(uri->path);
  ------------------
  |  Branch (621:6): [True: 0, False: 25.9k]
  ------------------
  622|  25.9k|        if (*str != cur) {
  ------------------
  |  Branch (622:13): [True: 13.2k, False: 12.6k]
  ------------------
  623|  13.2k|            if (uri->cleanup & XML_URI_NO_UNESCAPE)
  ------------------
  |  |  192|  13.2k|#define XML_URI_NO_UNESCAPE     2
  ------------------
  |  Branch (623:17): [True: 0, False: 13.2k]
  ------------------
  624|      0|                uri->path = STRNDUP(*str, cur - *str);
  ------------------
  |  |  119|      0|#define STRNDUP(s, n) (char *) xmlStrndup((const xmlChar *)(s), (n))
  ------------------
  625|  13.2k|            else
  626|  13.2k|                uri->path = xmlURIUnescapeString(*str, cur - *str, NULL);
  627|  13.2k|            if (uri->path == NULL)
  ------------------
  |  Branch (627:17): [True: 11, False: 13.2k]
  ------------------
  628|     11|                return (-1);
  629|  13.2k|        } else {
  630|  12.6k|            uri->path = NULL;
  631|  12.6k|        }
  632|  25.9k|    }
  633|  25.9k|    *str = cur;
  634|  25.9k|    return (0);
  635|  25.9k|}
uri.c:xmlParse3986Segment:
  572|   303k|{
  573|   303k|    const char *cur;
  574|       |
  575|   303k|    cur = *str;
  576|   303k|    if (!ISA_PCHAR(uri, cur) || (*cur == forbid)) {
  ------------------
  |  |  174|   606k|     (ISA_UNRESERVED(u, p) || ISA_PCT_ENCODED(p) || ISA_SUB_DELIM(p) ||	\
  |  |  ------------------
  |  |  |  |  189|   606k|#define ISA_UNRESERVED(u, p) (xmlIsUnreserved(u, p))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (189:30): [True: 213k, False: 89.8k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                    (ISA_UNRESERVED(u, p) || ISA_PCT_ENCODED(p) || ISA_SUB_DELIM(p) ||	\
  |  |  ------------------
  |  |  |  |  168|   393k|     ((*(p) == '%') && (ISA_HEXDIG(p + 1)) && (ISA_HEXDIG(p + 2)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  131|  4.62k|       (ISA_DIGIT(p) || ((*(p) >= 'a') && (*(p) <= 'f')) ||		\
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  127|  9.25k|#define ISA_DIGIT(p) ((*(p) >= '0') && (*(p) <= '9'))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (127:23): [True: 4.33k, False: 293]
  |  |  |  |  |  |  |  |  |  Branch (127:40): [True: 1.34k, False: 2.99k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (131:26): [True: 2.07k, False: 1.20k]
  |  |  |  |  |  |  |  Branch (131:43): [True: 1.84k, False: 236]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  132|  4.62k|        ((*(p) >= 'A') && (*(p) <= 'F')))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (132:10): [True: 1.00k, False: 438]
  |  |  |  |  |  |  |  Branch (132:27): [True: 768, False: 237]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |                    ((*(p) == '%') && (ISA_HEXDIG(p + 1)) && (ISA_HEXDIG(p + 2)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  131|  3.95k|       (ISA_DIGIT(p) || ((*(p) >= 'a') && (*(p) <= 'f')) ||		\
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  127|  7.90k|#define ISA_DIGIT(p) ((*(p) >= '0') && (*(p) <= '9'))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (127:23): [True: 3.74k, False: 211]
  |  |  |  |  |  |  |  |  |  Branch (127:40): [True: 1.11k, False: 2.62k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (131:26): [True: 1.38k, False: 1.45k]
  |  |  |  |  |  |  |  Branch (131:43): [True: 1.17k, False: 203]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  132|  3.95k|        ((*(p) >= 'A') && (*(p) <= 'F')))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (132:10): [True: 1.41k, False: 243]
  |  |  |  |  |  |  |  Branch (132:27): [True: 1.04k, False: 368]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (168:7): [True: 4.62k, False: 85.2k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                    (ISA_UNRESERVED(u, p) || ISA_PCT_ENCODED(p) || ISA_SUB_DELIM(p) ||	\
  |  |  ------------------
  |  |  |  |  139|   389k|      (((*(p) == '!')) || ((*(p) == '$')) || ((*(p) == '&')) ||		\
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (139:8): [True: 1.93k, False: 84.6k]
  |  |  |  |  |  Branch (139:27): [True: 2.46k, False: 82.1k]
  |  |  |  |  |  Branch (139:46): [True: 472, False: 81.6k]
  |  |  |  |  ------------------
  |  |  |  |  140|  86.5k|       ((*(p) == '(')) || ((*(p) == ')')) || ((*(p) == '*')) ||		\
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (140:8): [True: 1.27k, False: 80.4k]
  |  |  |  |  |  Branch (140:27): [True: 972, False: 79.4k]
  |  |  |  |  |  Branch (140:46): [True: 43.1k, False: 36.2k]
  |  |  |  |  ------------------
  |  |  |  |  141|  86.5k|       ((*(p) == '+')) || ((*(p) == ',')) || ((*(p) == ';')) ||		\
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (141:8): [True: 1.47k, False: 34.8k]
  |  |  |  |  |  Branch (141:27): [True: 936, False: 33.8k]
  |  |  |  |  |  Branch (141:46): [True: 2.09k, False: 31.7k]
  |  |  |  |  ------------------
  |  |  |  |  142|  86.5k|       ((*(p) == '=')) || ((*(p) == '\'')))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (142:8): [True: 1.31k, False: 30.4k]
  |  |  |  |  |  Branch (142:27): [True: 2.12k, False: 28.3k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  175|   303k|      ((*(p) == ':')) || ((*(p) == '@')))
  |  |  ------------------
  |  |  |  Branch (175:7): [True: 3.20k, False: 25.1k]
  |  |  |  Branch (175:26): [True: 1.96k, False: 23.1k]
  |  |  ------------------
  ------------------
  |  Branch (576:33): [True: 925, False: 279k]
  ------------------
  577|  24.1k|        if (empty)
  ------------------
  |  Branch (577:13): [True: 21.3k, False: 2.72k]
  ------------------
  578|  21.3k|	    return(0);
  579|  2.72k|	return(1);
  580|  24.1k|    }
  581|   279k|    NEXT(cur);
  ------------------
  |  |  108|   279k|#define NEXT(p) ((*p == '%')? p += 3 : p++)
  |  |  ------------------
  |  |  |  Branch (108:18): [True: 3.34k, False: 275k]
  |  |  ------------------
  ------------------
  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|  6.81M|    while (ISA_PCHAR(uri, cur) && (*cur != forbid))
  ------------------
  |  |  174|  13.6M|     (ISA_UNRESERVED(u, p) || ISA_PCT_ENCODED(p) || ISA_SUB_DELIM(p) ||	\
  |  |  ------------------
  |  |  |  |  189|  13.6M|#define ISA_UNRESERVED(u, p) (xmlIsUnreserved(u, p))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (189:30): [True: 4.26M, False: 2.54M]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                    (ISA_UNRESERVED(u, p) || ISA_PCT_ENCODED(p) || ISA_SUB_DELIM(p) ||	\
  |  |  ------------------
  |  |  |  |  168|  9.36M|     ((*(p) == '%') && (ISA_HEXDIG(p + 1)) && (ISA_HEXDIG(p + 2)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  131|  10.7k|       (ISA_DIGIT(p) || ((*(p) >= 'a') && (*(p) <= 'f')) ||		\
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  127|  21.5k|#define ISA_DIGIT(p) ((*(p) >= '0') && (*(p) <= '9'))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (127:23): [True: 10.4k, False: 305]
  |  |  |  |  |  |  |  |  |  Branch (127:40): [True: 7.09k, False: 3.39k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (131:26): [True: 1.11k, False: 2.58k]
  |  |  |  |  |  |  |  Branch (131:43): [True: 881, False: 236]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  132|  10.7k|        ((*(p) >= 'A') && (*(p) <= 'F')))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (132:10): [True: 2.37k, False: 447]
  |  |  |  |  |  |  |  Branch (132:27): [True: 2.09k, False: 277]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |                    ((*(p) == '%') && (ISA_HEXDIG(p + 1)) && (ISA_HEXDIG(p + 2)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  131|  10.0k|       (ISA_DIGIT(p) || ((*(p) >= 'a') && (*(p) <= 'f')) ||		\
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  127|  20.1k|#define ISA_DIGIT(p) ((*(p) >= '0') && (*(p) <= '9'))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (127:23): [True: 9.62k, False: 443]
  |  |  |  |  |  |  |  |  |  Branch (127:40): [True: 6.81k, False: 2.81k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (131:26): [True: 1.10k, False: 2.14k]
  |  |  |  |  |  |  |  Branch (131:43): [True: 834, False: 273]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  132|  10.0k|        ((*(p) >= 'A') && (*(p) <= 'F')))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (132:10): [True: 1.93k, False: 483]
  |  |  |  |  |  |  |  Branch (132:27): [True: 1.39k, False: 549]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (168:7): [True: 10.7k, False: 2.53M]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                    (ISA_UNRESERVED(u, p) || ISA_PCT_ENCODED(p) || ISA_SUB_DELIM(p) ||	\
  |  |  ------------------
  |  |  |  |  139|  9.35M|      (((*(p) == '!')) || ((*(p) == '$')) || ((*(p) == '&')) ||		\
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (139:8): [True: 2.39k, False: 2.53M]
  |  |  |  |  |  Branch (139:27): [True: 9.19k, False: 2.52M]
  |  |  |  |  |  Branch (139:46): [True: 332, False: 2.52M]
  |  |  |  |  ------------------
  |  |  |  |  140|  2.53M|       ((*(p) == '(')) || ((*(p) == ')')) || ((*(p) == '*')) ||		\
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (140:8): [True: 5.44k, False: 2.52M]
  |  |  |  |  |  Branch (140:27): [True: 2.23k, False: 2.52M]
  |  |  |  |  |  Branch (140:46): [True: 2.22M, False: 294k]
  |  |  |  |  ------------------
  |  |  |  |  141|  2.53M|       ((*(p) == '+')) || ((*(p) == ',')) || ((*(p) == ';')) ||		\
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (141:8): [True: 2.08k, False: 292k]
  |  |  |  |  |  Branch (141:27): [True: 2.08k, False: 290k]
  |  |  |  |  |  Branch (141:46): [True: 1.94k, False: 288k]
  |  |  |  |  ------------------
  |  |  |  |  142|  2.53M|       ((*(p) == '=')) || ((*(p) == '\'')))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (142:8): [True: 2.24k, False: 286k]
  |  |  |  |  |  Branch (142:27): [True: 1.62k, False: 284k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  175|  6.81M|      ((*(p) == ':')) || ((*(p) == '@')))
  |  |  ------------------
  |  |  |  Branch (175:7): [True: 14.3k, False: 270k]
  |  |  |  Branch (175:26): [True: 1.53k, False: 269k]
  |  |  ------------------
  ------------------
  |  Branch (591:35): [True: 6.53M, False: 10.1k]
  ------------------
  592|  6.53M|        NEXT(cur);
  ------------------
  |  |  108|  6.81M|#define NEXT(p) ((*p == '%')? p += 3 : p++)
  |  |  ------------------
  |  |  |  Branch (108:18): [True: 9.03k, False: 6.52M]
  |  |  ------------------
  ------------------
  593|   279k|    *str = cur;
  594|   279k|    return (0);
  595|   303k|}
uri.c:xmlParse3986PathAbsolute:
  649|  7.75k|{
  650|  7.75k|    const char *cur;
  651|  7.75k|    int ret;
  652|       |
  653|  7.75k|    cur = *str;
  654|       |
  655|  7.75k|    if (*cur != '/')
  ------------------
  |  Branch (655:9): [True: 0, False: 7.75k]
  ------------------
  656|      0|        return(1);
  657|  7.75k|    cur++;
  658|  7.75k|    ret = xmlParse3986Segment(uri, &cur, 0, 0);
  659|  7.75k|    if (ret == 0) {
  ------------------
  |  Branch (659:9): [True: 5.95k, False: 1.79k]
  ------------------
  660|  17.4k|	while (*cur == '/') {
  ------------------
  |  Branch (660:9): [True: 11.4k, False: 5.95k]
  ------------------
  661|  11.4k|	    cur++;
  662|  11.4k|	    ret = xmlParse3986Segment(uri, &cur, 0, 1);
  663|  11.4k|	    if (ret != 0) return(ret);
  ------------------
  |  Branch (663:10): [True: 0, False: 11.4k]
  ------------------
  664|  11.4k|	}
  665|  5.95k|    }
  666|  7.75k|    if (uri != NULL) {
  ------------------
  |  Branch (666:9): [True: 7.75k, False: 0]
  ------------------
  667|  7.75k|	if (uri->path != NULL) xmlFree(uri->path);
  ------------------
  |  Branch (667:6): [True: 0, False: 7.75k]
  ------------------
  668|  7.75k|        if (cur != *str) {
  ------------------
  |  Branch (668:13): [True: 7.75k, False: 0]
  ------------------
  669|  7.75k|            if (uri->cleanup & XML_URI_NO_UNESCAPE)
  ------------------
  |  |  192|  7.75k|#define XML_URI_NO_UNESCAPE     2
  ------------------
  |  Branch (669:17): [True: 0, False: 7.75k]
  ------------------
  670|      0|                uri->path = STRNDUP(*str, cur - *str);
  ------------------
  |  |  119|      0|#define STRNDUP(s, n) (char *) xmlStrndup((const xmlChar *)(s), (n))
  ------------------
  671|  7.75k|            else
  672|  7.75k|                uri->path = xmlURIUnescapeString(*str, cur - *str, NULL);
  673|  7.75k|            if (uri->path == NULL)
  ------------------
  |  Branch (673:17): [True: 16, False: 7.73k]
  ------------------
  674|     16|                return (-1);
  675|  7.75k|        } else {
  676|      0|            uri->path = NULL;
  677|      0|        }
  678|  7.75k|    }
  679|  7.73k|    *str = cur;
  680|  7.73k|    return (0);
  681|  7.75k|}
uri.c:xmlIsUnreserved:
  196|  45.7M|xmlIsUnreserved(xmlURIPtr uri, const char *cur) {
  197|  45.7M|    if (uri == NULL)
  ------------------
  |  Branch (197:9): [True: 0, False: 45.7M]
  ------------------
  198|      0|        return(0);
  199|       |
  200|  45.7M|    if (ISA_STRICTLY_UNRESERVED(cur))
  ------------------
  |  |  161|  45.7M|      ((ISA_ALPHA(p)) || (ISA_DIGIT(p)) || ((*(p) == '-')) ||		\
  |  |  ------------------
  |  |  |  |  128|  45.7M|#define ISA_ALPHA(p) (((*(p) >= 'a') && (*(p) <= 'z')) ||		\
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (128:24): [True: 1.69M, False: 44.1M]
  |  |  |  |  |  Branch (128:41): [True: 1.67M, False: 12.0k]
  |  |  |  |  ------------------
  |  |  |  |  129|  45.7M|                      ((*(p) >= 'A') && (*(p) <= 'Z')))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (129:24): [True: 35.4M, False: 8.68M]
  |  |  |  |  |  Branch (129:41): [True: 35.4M, False: 20.6k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                     ((ISA_ALPHA(p)) || (ISA_DIGIT(p)) || ((*(p) == '-')) ||		\
  |  |  ------------------
  |  |  |  |  127|  8.70M|#define ISA_DIGIT(p) ((*(p) >= '0') && (*(p) <= '9'))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (127:23): [True: 692k, False: 8.00M]
  |  |  |  |  |  Branch (127:40): [True: 431k, False: 260k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (161:44): [True: 69.5k, False: 8.19M]
  |  |  ------------------
  |  |  162|  45.7M|       ((*(p) == '.')) || ((*(p) == '_')) || ((*(p) == '~')))
  |  |  ------------------
  |  |  |  Branch (162:8): [True: 275k, False: 7.92M]
  |  |  |  Branch (162:27): [True: 1.91k, False: 7.92M]
  |  |  |  Branch (162:46): [True: 11.2k, False: 7.91M]
  |  |  ------------------
  ------------------
  201|  37.8M|        return(1);
  202|       |
  203|  7.91M|    if (uri->cleanup & XML_URI_ALLOW_UNWISE) {
  ------------------
  |  |  191|  7.91M|#define XML_URI_ALLOW_UNWISE    1
  ------------------
  |  Branch (203:9): [True: 0, False: 7.91M]
  ------------------
  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|  7.91M|    } else if (uri->cleanup & XML_URI_ALLOW_UCSCHAR) {
  ------------------
  |  |  193|  7.91M|#define XML_URI_ALLOW_UCSCHAR   4
  ------------------
  |  Branch (206:16): [True: 0, False: 7.91M]
  ------------------
  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|  7.91M|    return(0);
  212|  7.91M|}
uri.c:xmlParse3986PathRootless:
  695|  6.33k|{
  696|  6.33k|    const char *cur;
  697|  6.33k|    int ret;
  698|       |
  699|  6.33k|    cur = *str;
  700|       |
  701|  6.33k|    ret = xmlParse3986Segment(uri, &cur, 0, 0);
  702|  6.33k|    if (ret != 0) return(ret);
  ------------------
  |  Branch (702:9): [True: 0, False: 6.33k]
  ------------------
  703|  8.81k|    while (*cur == '/') {
  ------------------
  |  Branch (703:12): [True: 2.48k, False: 6.33k]
  ------------------
  704|  2.48k|        cur++;
  705|  2.48k|	ret = xmlParse3986Segment(uri, &cur, 0, 1);
  706|  2.48k|	if (ret != 0) return(ret);
  ------------------
  |  Branch (706:6): [True: 0, False: 2.48k]
  ------------------
  707|  2.48k|    }
  708|  6.33k|    if (uri != NULL) {
  ------------------
  |  Branch (708:9): [True: 6.33k, False: 0]
  ------------------
  709|  6.33k|	if (uri->path != NULL) xmlFree(uri->path);
  ------------------
  |  Branch (709:6): [True: 0, False: 6.33k]
  ------------------
  710|  6.33k|        if (cur != *str) {
  ------------------
  |  Branch (710:13): [True: 6.33k, False: 0]
  ------------------
  711|  6.33k|            if (uri->cleanup & XML_URI_NO_UNESCAPE)
  ------------------
  |  |  192|  6.33k|#define XML_URI_NO_UNESCAPE     2
  ------------------
  |  Branch (711:17): [True: 0, False: 6.33k]
  ------------------
  712|      0|                uri->path = STRNDUP(*str, cur - *str);
  ------------------
  |  |  119|      0|#define STRNDUP(s, n) (char *) xmlStrndup((const xmlChar *)(s), (n))
  ------------------
  713|  6.33k|            else
  714|  6.33k|                uri->path = xmlURIUnescapeString(*str, cur - *str, NULL);
  715|  6.33k|            if (uri->path == NULL)
  ------------------
  |  Branch (715:17): [True: 12, False: 6.31k]
  ------------------
  716|     12|                return (-1);
  717|  6.33k|        } else {
  718|      0|            uri->path = NULL;
  719|      0|        }
  720|  6.33k|    }
  721|  6.31k|    *str = cur;
  722|  6.31k|    return (0);
  723|  6.33k|}
uri.c:xmlParse3986Query:
  300|  9.01k|{
  301|  9.01k|    const char *cur;
  302|       |
  303|  9.01k|    cur = *str;
  304|       |
  305|  27.6M|    while ((ISA_PCHAR(uri, cur)) || (*cur == '/') || (*cur == '?'))
  ------------------
  |  |  174|  27.6M|     (ISA_UNRESERVED(u, p) || ISA_PCT_ENCODED(p) || ISA_SUB_DELIM(p) ||	\
  |  |  ------------------
  |  |  |  |  189|  55.2M|#define ISA_UNRESERVED(u, p) (xmlIsUnreserved(u, p))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (189:30): [True: 27.5M, False: 89.3k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                    (ISA_UNRESERVED(u, p) || ISA_PCT_ENCODED(p) || ISA_SUB_DELIM(p) ||	\
  |  |  ------------------
  |  |  |  |  168|  27.7M|     ((*(p) == '%') && (ISA_HEXDIG(p + 1)) && (ISA_HEXDIG(p + 2)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  131|  4.12k|       (ISA_DIGIT(p) || ((*(p) >= 'a') && (*(p) <= 'f')) ||		\
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  127|  8.25k|#define ISA_DIGIT(p) ((*(p) >= '0') && (*(p) <= '9'))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (127:23): [True: 3.86k, False: 263]
  |  |  |  |  |  |  |  |  |  Branch (127:40): [True: 906, False: 2.96k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (131:26): [True: 1.90k, False: 1.31k]
  |  |  |  |  |  |  |  Branch (131:43): [True: 1.61k, False: 291]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  132|  4.12k|        ((*(p) >= 'A') && (*(p) <= 'F')))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (132:10): [True: 1.29k, False: 318]
  |  |  |  |  |  |  |  Branch (132:27): [True: 986, False: 305]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |                    ((*(p) == '%') && (ISA_HEXDIG(p + 1)) && (ISA_HEXDIG(p + 2)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  131|  3.50k|       (ISA_DIGIT(p) || ((*(p) >= 'a') && (*(p) <= 'f')) ||		\
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  127|  7.01k|#define ISA_DIGIT(p) ((*(p) >= '0') && (*(p) <= '9'))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (127:23): [True: 3.10k, False: 406]
  |  |  |  |  |  |  |  |  |  Branch (127:40): [True: 236, False: 2.86k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (131:26): [True: 1.32k, False: 1.94k]
  |  |  |  |  |  |  |  Branch (131:43): [True: 1.11k, False: 204]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  132|  3.50k|        ((*(p) >= 'A') && (*(p) <= 'F')))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (132:10): [True: 1.58k, False: 571]
  |  |  |  |  |  |  |  Branch (132:27): [True: 1.22k, False: 360]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (168:7): [True: 4.12k, False: 85.2k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                    (ISA_UNRESERVED(u, p) || ISA_PCT_ENCODED(p) || ISA_SUB_DELIM(p) ||	\
  |  |  ------------------
  |  |  |  |  139|  27.7M|      (((*(p) == '!')) || ((*(p) == '$')) || ((*(p) == '&')) ||		\
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (139:8): [True: 1.75k, False: 85.0k]
  |  |  |  |  |  Branch (139:27): [True: 824, False: 84.1k]
  |  |  |  |  |  Branch (139:46): [True: 243, False: 83.9k]
  |  |  |  |  ------------------
  |  |  |  |  140|  86.7k|       ((*(p) == '(')) || ((*(p) == ')')) || ((*(p) == '*')) ||		\
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (140:8): [True: 5.73k, False: 78.2k]
  |  |  |  |  |  Branch (140:27): [True: 933, False: 77.2k]
  |  |  |  |  |  Branch (140:46): [True: 22.7k, False: 54.4k]
  |  |  |  |  ------------------
  |  |  |  |  141|  86.7k|       ((*(p) == '+')) || ((*(p) == ',')) || ((*(p) == ';')) ||		\
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (141:8): [True: 1.09k, False: 53.3k]
  |  |  |  |  |  Branch (141:27): [True: 497, False: 52.8k]
  |  |  |  |  |  Branch (141:46): [True: 1.22k, False: 51.6k]
  |  |  |  |  ------------------
  |  |  |  |  142|  86.7k|       ((*(p) == '=')) || ((*(p) == '\'')))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (142:8): [True: 705, False: 50.9k]
  |  |  |  |  |  Branch (142:27): [True: 651, False: 50.3k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  175|  27.6M|      ((*(p) == ':')) || ((*(p) == '@')))
  |  |  ------------------
  |  |  |  Branch (175:7): [True: 3.36k, False: 46.9k]
  |  |  |  Branch (175:26): [True: 2.51k, False: 44.4k]
  |  |  ------------------
  ------------------
  |  Branch (305:37): [True: 20.7k, False: 23.6k]
  |  Branch (305:54): [True: 14.6k, False: 9.01k]
  ------------------
  306|  27.6M|        NEXT(cur);
  ------------------
  |  |  108|  27.6M|#define NEXT(p) ((*p == '%')? p += 3 : p++)
  |  |  ------------------
  |  |  |  Branch (108:18): [True: 2.57k, False: 27.6M]
  |  |  ------------------
  ------------------
  307|  9.01k|    if (uri != NULL) {
  ------------------
  |  Branch (307:9): [True: 9.01k, False: 0]
  ------------------
  308|  9.01k|        if (uri->query != NULL)
  ------------------
  |  Branch (308:13): [True: 0, False: 9.01k]
  ------------------
  309|      0|            xmlFree(uri->query);
  310|  9.01k|	if (uri->cleanup & XML_URI_NO_UNESCAPE)
  ------------------
  |  |  192|  9.01k|#define XML_URI_NO_UNESCAPE     2
  ------------------
  |  Branch (310:6): [True: 0, False: 9.01k]
  ------------------
  311|      0|	    uri->query = STRNDUP(*str, cur - *str);
  ------------------
  |  |  119|      0|#define STRNDUP(s, n) (char *) xmlStrndup((const xmlChar *)(s), (n))
  ------------------
  312|  9.01k|	else
  313|  9.01k|	    uri->query = xmlURIUnescapeString(*str, cur - *str, NULL);
  314|  9.01k|        if (uri->query == NULL)
  ------------------
  |  Branch (314:13): [True: 28, False: 8.98k]
  ------------------
  315|     28|            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|  8.98k|	if (uri->query_raw != NULL)
  ------------------
  |  Branch (320:6): [True: 0, False: 8.98k]
  ------------------
  321|      0|	    xmlFree (uri->query_raw);
  322|  8.98k|	uri->query_raw = STRNDUP (*str, cur - *str);
  ------------------
  |  |  119|  8.98k|#define STRNDUP(s, n) (char *) xmlStrndup((const xmlChar *)(s), (n))
  ------------------
  323|  8.98k|        if (uri->query_raw == NULL)
  ------------------
  |  Branch (323:13): [True: 20, False: 8.96k]
  ------------------
  324|     20|            return (-1);
  325|  8.98k|    }
  326|  8.96k|    *str = cur;
  327|  8.96k|    return (0);
  328|  9.01k|}
uri.c:xmlParse3986Fragment:
  267|   172k|{
  268|   172k|    const char *cur;
  269|       |
  270|   172k|    cur = *str;
  271|       |
  272|  2.81M|    while ((ISA_PCHAR(uri, cur)) || (*cur == '/') || (*cur == '?') ||
  ------------------
  |  |  174|  2.81M|     (ISA_UNRESERVED(u, p) || ISA_PCT_ENCODED(p) || ISA_SUB_DELIM(p) ||	\
  |  |  ------------------
  |  |  |  |  189|  5.63M|#define ISA_UNRESERVED(u, p) (xmlIsUnreserved(u, p))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (189:30): [True: 1.32M, False: 1.49M]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                    (ISA_UNRESERVED(u, p) || ISA_PCT_ENCODED(p) || ISA_SUB_DELIM(p) ||	\
  |  |  ------------------
  |  |  |  |  168|  4.31M|     ((*(p) == '%') && (ISA_HEXDIG(p + 1)) && (ISA_HEXDIG(p + 2)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  131|  6.90k|       (ISA_DIGIT(p) || ((*(p) >= 'a') && (*(p) <= 'f')) ||		\
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  127|  13.8k|#define ISA_DIGIT(p) ((*(p) >= '0') && (*(p) <= '9'))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (127:23): [True: 6.63k, False: 272]
  |  |  |  |  |  |  |  |  |  Branch (127:40): [True: 4.29k, False: 2.34k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (131:26): [True: 662, False: 1.95k]
  |  |  |  |  |  |  |  Branch (131:43): [True: 463, False: 199]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  132|  6.90k|        ((*(p) >= 'A') && (*(p) <= 'F')))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (132:10): [True: 1.70k, False: 441]
  |  |  |  |  |  |  |  Branch (132:27): [True: 1.46k, False: 246]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |                    ((*(p) == '%') && (ISA_HEXDIG(p + 1)) && (ISA_HEXDIG(p + 2)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  131|  6.22k|       (ISA_DIGIT(p) || ((*(p) >= 'a') && (*(p) <= 'f')) ||		\
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  127|  12.4k|#define ISA_DIGIT(p) ((*(p) >= '0') && (*(p) <= '9'))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (127:23): [True: 5.92k, False: 297]
  |  |  |  |  |  |  |  |  |  Branch (127:40): [True: 3.89k, False: 2.03k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (131:26): [True: 803, False: 1.52k]
  |  |  |  |  |  |  |  Branch (131:43): [True: 479, False: 324]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  132|  6.22k|        ((*(p) >= 'A') && (*(p) <= 'F')))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (132:10): [True: 1.53k, False: 314]
  |  |  |  |  |  |  |  Branch (132:27): [True: 1.05k, False: 486]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (168:7): [True: 6.90k, False: 1.48M]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                    (ISA_UNRESERVED(u, p) || ISA_PCT_ENCODED(p) || ISA_SUB_DELIM(p) ||	\
  |  |  ------------------
  |  |  |  |  139|  4.30M|      (((*(p) == '!')) || ((*(p) == '$')) || ((*(p) == '&')) ||		\
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (139:8): [True: 645k, False: 843k]
  |  |  |  |  |  Branch (139:27): [True: 14.0k, False: 829k]
  |  |  |  |  |  Branch (139:46): [True: 536, False: 828k]
  |  |  |  |  ------------------
  |  |  |  |  140|  1.48M|       ((*(p) == '(')) || ((*(p) == ')')) || ((*(p) == '*')) ||		\
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (140:8): [True: 72.6k, False: 756k]
  |  |  |  |  |  Branch (140:27): [True: 77.0k, False: 679k]
  |  |  |  |  |  Branch (140:46): [True: 5.26k, False: 674k]
  |  |  |  |  ------------------
  |  |  |  |  141|  1.48M|       ((*(p) == '+')) || ((*(p) == ',')) || ((*(p) == ';')) ||		\
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (141:8): [True: 2.03k, False: 671k]
  |  |  |  |  |  Branch (141:27): [True: 92.3k, False: 579k]
  |  |  |  |  |  Branch (141:46): [True: 72.2k, False: 507k]
  |  |  |  |  ------------------
  |  |  |  |  142|  1.48M|       ((*(p) == '=')) || ((*(p) == '\'')))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (142:8): [True: 893, False: 506k]
  |  |  |  |  |  Branch (142:27): [True: 1.51k, False: 504k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  175|  2.81M|      ((*(p) == ':')) || ((*(p) == '@')))
  |  |  ------------------
  |  |  |  Branch (175:7): [True: 69.1k, False: 435k]
  |  |  |  Branch (175:26): [True: 3.54k, False: 432k]
  |  |  ------------------
  ------------------
  |  Branch (272:37): [True: 249k, False: 182k]
  |  Branch (272:54): [True: 4.91k, False: 177k]
  ------------------
  273|   177k|           (*cur == '[') || (*cur == ']'))
  ------------------
  |  Branch (273:12): [True: 1.34k, False: 176k]
  |  Branch (273:29): [True: 3.51k, False: 172k]
  ------------------
  274|  2.64M|        NEXT(cur);
  ------------------
  |  |  108|  2.64M|#define NEXT(p) ((*p == '%')? p += 3 : p++)
  |  |  ------------------
  |  |  |  Branch (108:18): [True: 5.42k, False: 2.64M]
  |  |  ------------------
  ------------------
  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: 30, False: 172k]
  ------------------
  283|     30|            return (-1);
  284|   172k|    }
  285|   172k|    *str = cur;
  286|   172k|    return (0);
  287|   172k|}
uri.c:xmlParse3986RelativeRef:
  833|   337k|xmlParse3986RelativeRef(xmlURIPtr uri, const char *str) {
  834|   337k|    int ret;
  835|       |
  836|   337k|    if ((*str == '/') && (*(str + 1) == '/')) {
  ------------------
  |  Branch (836:9): [True: 9.37k, False: 328k]
  |  Branch (836:26): [True: 2.35k, False: 7.02k]
  ------------------
  837|  2.35k|        str += 2;
  838|  2.35k|	ret = xmlParse3986Authority(uri, &str);
  839|  2.35k|	if (ret != 0) return(ret);
  ------------------
  |  Branch (839:6): [True: 320, False: 2.03k]
  ------------------
  840|  2.03k|	ret = xmlParse3986PathAbEmpty(uri, &str);
  841|  2.03k|	if (ret != 0) return(ret);
  ------------------
  |  Branch (841:6): [True: 1, False: 2.03k]
  ------------------
  842|   335k|    } else if (*str == '/') {
  ------------------
  |  Branch (842:16): [True: 7.02k, False: 328k]
  ------------------
  843|  7.02k|	ret = xmlParse3986PathAbsolute(uri, &str);
  844|  7.02k|	if (ret != 0) return(ret);
  ------------------
  |  Branch (844:6): [True: 15, False: 7.00k]
  ------------------
  845|   328k|    } else if (ISA_PCHAR(uri, str)) {
  ------------------
  |  |  174|   328k|     (ISA_UNRESERVED(u, p) || ISA_PCT_ENCODED(p) || ISA_SUB_DELIM(p) ||	\
  |  |  ------------------
  |  |  |  |  189|   656k|#define ISA_UNRESERVED(u, p) (xmlIsUnreserved(u, p))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (189:30): [True: 140k, False: 187k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                    (ISA_UNRESERVED(u, p) || ISA_PCT_ENCODED(p) || ISA_SUB_DELIM(p) ||	\
  |  |  ------------------
  |  |  |  |  168|   516k|     ((*(p) == '%') && (ISA_HEXDIG(p + 1)) && (ISA_HEXDIG(p + 2)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  131|  3.64k|       (ISA_DIGIT(p) || ((*(p) >= 'a') && (*(p) <= 'f')) ||		\
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  127|  7.28k|#define ISA_DIGIT(p) ((*(p) >= '0') && (*(p) <= '9'))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (127:23): [True: 3.37k, False: 265]
  |  |  |  |  |  |  |  |  |  Branch (127:40): [True: 724, False: 2.65k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (131:26): [True: 1.42k, False: 1.49k]
  |  |  |  |  |  |  |  Branch (131:43): [True: 1.18k, False: 241]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  132|  3.64k|        ((*(p) >= 'A') && (*(p) <= 'F')))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (132:10): [True: 1.28k, False: 453]
  |  |  |  |  |  |  |  Branch (132:27): [True: 843, False: 441]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |                    ((*(p) == '%') && (ISA_HEXDIG(p + 1)) && (ISA_HEXDIG(p + 2)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  131|  2.75k|       (ISA_DIGIT(p) || ((*(p) >= 'a') && (*(p) <= 'f')) ||		\
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  127|  5.50k|#define ISA_DIGIT(p) ((*(p) >= '0') && (*(p) <= '9'))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (127:23): [True: 2.48k, False: 263]
  |  |  |  |  |  |  |  |  |  Branch (127:40): [True: 787, False: 1.70k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (131:26): [True: 574, False: 1.38k]
  |  |  |  |  |  |  |  Branch (131:43): [True: 374, False: 200]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  132|  2.75k|        ((*(p) >= 'A') && (*(p) <= 'F')))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (132:10): [True: 1.04k, False: 546]
  |  |  |  |  |  |  |  Branch (132:27): [True: 710, False: 333]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (168:7): [True: 3.64k, False: 184k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                    (ISA_UNRESERVED(u, p) || ISA_PCT_ENCODED(p) || ISA_SUB_DELIM(p) ||	\
  |  |  ------------------
  |  |  |  |  139|   514k|      (((*(p) == '!')) || ((*(p) == '$')) || ((*(p) == '&')) ||		\
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (139:8): [True: 1.37k, False: 184k]
  |  |  |  |  |  Branch (139:27): [True: 1.97k, False: 182k]
  |  |  |  |  |  Branch (139:46): [True: 303, False: 182k]
  |  |  |  |  ------------------
  |  |  |  |  140|   186k|       ((*(p) == '(')) || ((*(p) == ')')) || ((*(p) == '*')) ||		\
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (140:8): [True: 924, False: 181k]
  |  |  |  |  |  Branch (140:27): [True: 504, False: 180k]
  |  |  |  |  |  Branch (140:46): [True: 1.49k, False: 179k]
  |  |  |  |  ------------------
  |  |  |  |  141|   186k|       ((*(p) == '+')) || ((*(p) == ',')) || ((*(p) == ';')) ||		\
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (141:8): [True: 1.05k, False: 178k]
  |  |  |  |  |  Branch (141:27): [True: 687, False: 177k]
  |  |  |  |  |  Branch (141:46): [True: 946, False: 176k]
  |  |  |  |  ------------------
  |  |  |  |  142|   186k|       ((*(p) == '=')) || ((*(p) == '\'')))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (142:8): [True: 1.05k, False: 175k]
  |  |  |  |  |  Branch (142:27): [True: 1.28k, False: 174k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  175|   328k|      ((*(p) == ':')) || ((*(p) == '@')))
  |  |  ------------------
  |  |  |  Branch (175:7): [True: 925, False: 173k]
  |  |  |  Branch (175:26): [True: 773, False: 172k]
  |  |  ------------------
  ------------------
  846|   155k|        ret = xmlParse3986PathNoScheme(uri, &str);
  847|   155k|	if (ret != 0) return(ret);
  ------------------
  |  Branch (847:6): [True: 1.01k, False: 154k]
  ------------------
  848|   172k|    } else {
  849|       |	/* path-empty is effectively empty */
  850|   172k|	if (uri != NULL) {
  ------------------
  |  Branch (850:6): [True: 172k, False: 0]
  ------------------
  851|   172k|	    if (uri->path != NULL) xmlFree(uri->path);
  ------------------
  |  Branch (851:10): [True: 0, False: 172k]
  ------------------
  852|   172k|	    uri->path = NULL;
  853|   172k|	}
  854|   172k|    }
  855|       |
  856|   336k|    if (*str == '?') {
  ------------------
  |  Branch (856:9): [True: 5.52k, False: 330k]
  ------------------
  857|  5.52k|	str++;
  858|  5.52k|	ret = xmlParse3986Query(uri, &str);
  859|  5.52k|	if (ret != 0) return(ret);
  ------------------
  |  Branch (859:6): [True: 31, False: 5.49k]
  ------------------
  860|  5.52k|    }
  861|   336k|    if (*str == '#') {
  ------------------
  |  Branch (861:9): [True: 171k, False: 165k]
  ------------------
  862|   171k|	str++;
  863|   171k|	ret = xmlParse3986Fragment(uri, &str);
  864|   171k|	if (ret != 0) return(ret);
  ------------------
  |  Branch (864:6): [True: 27, False: 171k]
  ------------------
  865|   171k|    }
  866|   336k|    if (*str != 0) {
  ------------------
  |  Branch (866:9): [True: 25.8k, False: 310k]
  ------------------
  867|  25.8k|	xmlCleanURI(uri);
  868|  25.8k|	return(1);
  869|  25.8k|    }
  870|   310k|    return(0);
  871|   336k|}
uri.c:xmlParse3986PathNoScheme:
  737|   155k|{
  738|   155k|    const char *cur;
  739|   155k|    int ret;
  740|       |
  741|   155k|    cur = *str;
  742|       |
  743|   155k|    ret = xmlParse3986Segment(uri, &cur, ':', 0);
  744|   155k|    if (ret != 0) return(ret);
  ------------------
  |  Branch (744:9): [True: 925, False: 154k]
  ------------------
  745|   193k|    while (*cur == '/') {
  ------------------
  |  Branch (745:12): [True: 38.6k, False: 154k]
  ------------------
  746|  38.6k|        cur++;
  747|  38.6k|	ret = xmlParse3986Segment(uri, &cur, 0, 1);
  748|  38.6k|	if (ret != 0) return(ret);
  ------------------
  |  Branch (748:6): [True: 0, False: 38.6k]
  ------------------
  749|  38.6k|    }
  750|   154k|    if (uri != NULL) {
  ------------------
  |  Branch (750:9): [True: 154k, False: 0]
  ------------------
  751|   154k|	if (uri->path != NULL) xmlFree(uri->path);
  ------------------
  |  Branch (751:6): [True: 0, False: 154k]
  ------------------
  752|   154k|        if (cur != *str) {
  ------------------
  |  Branch (752:13): [True: 154k, False: 0]
  ------------------
  753|   154k|            if (uri->cleanup & XML_URI_NO_UNESCAPE)
  ------------------
  |  |  192|   154k|#define XML_URI_NO_UNESCAPE     2
  ------------------
  |  Branch (753:17): [True: 0, False: 154k]
  ------------------
  754|      0|                uri->path = STRNDUP(*str, cur - *str);
  ------------------
  |  |  119|      0|#define STRNDUP(s, n) (char *) xmlStrndup((const xmlChar *)(s), (n))
  ------------------
  755|   154k|            else
  756|   154k|                uri->path = xmlURIUnescapeString(*str, cur - *str, NULL);
  757|   154k|            if (uri->path == NULL)
  ------------------
  |  Branch (757:17): [True: 92, False: 154k]
  ------------------
  758|     92|                return (-1);
  759|   154k|        } else {
  760|      0|            uri->path = NULL;
  761|      0|        }
  762|   154k|    }
  763|   154k|    *str = cur;
  764|   154k|    return (0);
  765|   154k|}
uri.c:xmlSaveUriRealloc:
 1074|  7.83k|xmlSaveUriRealloc(xmlChar *ret, int *max) {
 1075|  7.83k|    xmlChar *temp;
 1076|  7.83k|    int newSize;
 1077|       |
 1078|  7.83k|    newSize = xmlGrowCapacity(*max, 1, 80, MAX_URI_LENGTH);
  ------------------
  |  |   34|  7.83k|#define MAX_URI_LENGTH 1024 * 1024
  ------------------
 1079|  7.83k|    if (newSize < 0)
  ------------------
  |  Branch (1079:9): [True: 26, False: 7.81k]
  ------------------
 1080|     26|        return(NULL);
 1081|  7.81k|    temp = xmlRealloc(ret, newSize + 1);
 1082|  7.81k|    if (temp == NULL)
  ------------------
  |  Branch (1082:9): [True: 27, False: 7.78k]
  ------------------
 1083|     27|        return(NULL);
 1084|  7.78k|    *max = newSize;
 1085|  7.78k|    return(temp);
 1086|  7.81k|}
uri.c:xmlNormalizePath:
 1456|  86.2k|xmlNormalizePath(char *path, int isFile) {
 1457|  86.2k|    char *cur, *out;
 1458|  86.2k|    int numSeg = 0;
 1459|       |
 1460|  86.2k|    if (path == NULL)
  ------------------
  |  Branch (1460:9): [True: 967, False: 85.2k]
  ------------------
 1461|    967|	return(-1);
 1462|       |
 1463|  85.2k|    cur = path;
 1464|  85.2k|    out = path;
 1465|       |
 1466|  85.2k|    if (*cur == 0)
  ------------------
  |  Branch (1466:9): [True: 36, False: 85.2k]
  ------------------
 1467|     36|        return(0);
 1468|       |
 1469|  85.2k|    if (xmlIsPathSeparator(*cur, isFile)) {
  ------------------
  |  Branch (1469:9): [True: 6.26k, False: 78.9k]
  ------------------
 1470|  6.26k|        cur++;
 1471|  6.26k|        *out++ = '/';
 1472|  6.26k|    }
 1473|       |
 1474|   324k|    while (*cur != 0) {
  ------------------
  |  Branch (1474:12): [True: 305k, False: 18.6k]
  ------------------
 1475|       |        /*
 1476|       |         * At this point, out is either empty or ends with a separator.
 1477|       |         * Collapse multiple separators first.
 1478|       |         */
 1479|   350k|        while (xmlIsPathSeparator(*cur, isFile)) {
  ------------------
  |  Branch (1479:16): [True: 44.4k, False: 305k]
  ------------------
 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|  44.4k|            cur++;
 1486|  44.4k|        }
 1487|       |
 1488|   305k|        if (*cur == '.') {
  ------------------
  |  Branch (1488:13): [True: 202k, False: 103k]
  ------------------
 1489|   202k|            if (cur[1] == 0) {
  ------------------
  |  Branch (1489:17): [True: 66.1k, False: 136k]
  ------------------
 1490|       |                /* Ignore "." at end of path */
 1491|  66.1k|                break;
 1492|   136k|            } else if (xmlIsPathSeparator(cur[1], isFile)) {
  ------------------
  |  Branch (1492:24): [True: 70.6k, False: 65.5k]
  ------------------
 1493|       |                /* Skip "./" */
 1494|  70.6k|                cur += 2;
 1495|  70.6k|                continue;
 1496|  70.6k|            } else if ((cur[1] == '.') &&
  ------------------
  |  Branch (1496:24): [True: 63.8k, False: 1.66k]
  ------------------
 1497|  63.8k|                       ((cur[2] == 0) || xmlIsPathSeparator(cur[2], isFile))) {
  ------------------
  |  Branch (1497:25): [True: 468, False: 63.4k]
  |  Branch (1497:42): [True: 62.9k, False: 514]
  ------------------
 1498|  63.3k|                if (numSeg > 0) {
  ------------------
  |  Branch (1498:21): [True: 3.81k, False: 59.5k]
  ------------------
 1499|       |                    /* Handle ".." by removing last segment */
 1500|  49.0k|                    do {
 1501|  49.0k|                        out--;
 1502|  49.0k|                    } while ((out > path) &&
  ------------------
  |  Branch (1502:30): [True: 48.6k, False: 441]
  ------------------
 1503|  48.6k|                             !xmlIsPathSeparator(out[-1], isFile));
  ------------------
  |  Branch (1503:30): [True: 45.2k, False: 3.37k]
  ------------------
 1504|  3.81k|                    numSeg--;
 1505|       |
 1506|  3.81k|                    if (cur[2] == 0)
  ------------------
  |  Branch (1506:25): [True: 239, False: 3.57k]
  ------------------
 1507|    239|                        break;
 1508|  3.57k|                    cur += 3;
 1509|  3.57k|                    continue;
 1510|  59.5k|                } else if (out[0] == '/') {
  ------------------
  |  Branch (1510:28): [True: 534, False: 59.0k]
  ------------------
 1511|       |                    /* Ignore extraneous ".." in absolute paths */
 1512|    534|                    if (cur[2] == 0)
  ------------------
  |  Branch (1512:25): [True: 212, False: 322]
  ------------------
 1513|    212|                        break;
 1514|    322|                    cur += 3;
 1515|    322|                    continue;
 1516|  59.0k|                } else {
 1517|       |                    /* Keep "../" at start of relative path */
 1518|  59.0k|                    numSeg--;
 1519|  59.0k|                }
 1520|  63.3k|            }
 1521|   202k|        }
 1522|       |
 1523|       |        /* Copy segment */
 1524|  3.00M|        while ((*cur != 0) && !xmlIsPathSeparator(*cur, isFile)) {
  ------------------
  |  Branch (1524:16): [True: 2.98M, False: 17.5k]
  |  Branch (1524:31): [True: 2.83M, False: 147k]
  ------------------
 1525|  2.83M|            *out++ = *cur++;
 1526|  2.83M|        }
 1527|       |
 1528|       |        /* Copy separator */
 1529|   164k|        if (*cur != 0) {
  ------------------
  |  Branch (1529:13): [True: 147k, False: 17.5k]
  ------------------
 1530|   147k|            cur++;
 1531|   147k|            *out++ = '/';
 1532|   147k|        }
 1533|       |
 1534|   164k|        numSeg++;
 1535|   164k|    }
 1536|       |
 1537|       |    /* Keep "." if output is empty and it's a file */
 1538|  85.2k|    if ((isFile) && (out <= path))
  ------------------
  |  Branch (1538:9): [True: 78.0k, False: 7.12k]
  |  Branch (1538:21): [True: 66.0k, False: 12.0k]
  ------------------
 1539|  66.0k|        *out++ = '.';
 1540|  85.2k|    *out = 0;
 1541|       |
 1542|  85.2k|    return(0);
 1543|  85.2k|}
uri.c:xmlIsPathSeparator:
 1434|  3.87M|xmlIsPathSeparator(int c, int isFile) {
 1435|  3.87M|    (void) isFile;
 1436|       |
 1437|  3.87M|    if (c == '/')
  ------------------
  |  Branch (1437:9): [True: 410k, False: 3.46M]
  ------------------
 1438|   410k|        return(1);
 1439|       |
 1440|       |#if defined(LIBXML_WINPATH_ENABLED)
 1441|       |    if (isFile && (c == '\\'))
 1442|       |        return(1);
 1443|       |#endif
 1444|       |
 1445|  3.46M|    return(0);
 1446|  3.87M|}
uri.c:is_hex:
 1559|  3.26M|static int is_hex(char c) {
 1560|  3.26M|    if (((c >= '0') && (c <= '9')) ||
  ------------------
  |  Branch (1560:10): [True: 3.26M, False: 1.71k]
  |  Branch (1560:24): [True: 3.23M, False: 30.6k]
  ------------------
 1561|  32.3k|        ((c >= 'a') && (c <= 'f')) ||
  ------------------
  |  Branch (1561:10): [True: 12.3k, False: 19.9k]
  |  Branch (1561:24): [True: 11.4k, False: 944]
  ------------------
 1562|  20.9k|        ((c >= 'A') && (c <= 'F')))
  ------------------
  |  Branch (1562:10): [True: 18.9k, False: 1.96k]
  |  Branch (1562:24): [True: 17.7k, False: 1.24k]
  ------------------
 1563|  3.26M|	return(1);
 1564|  3.20k|    return(0);
 1565|  3.26M|}
uri.c:xmlResolvePath:
 1863|   237k|xmlResolvePath(const xmlChar *escRef, const xmlChar *base, xmlChar **out) {
 1864|   237k|    const xmlChar *fragment;
 1865|   237k|    xmlChar *tmp = NULL;
 1866|   237k|    xmlChar *ref = NULL;
 1867|   237k|    xmlChar *result = NULL;
 1868|   237k|    int ret = -1;
 1869|   237k|    int i;
 1870|       |
 1871|   237k|    if (out == NULL)
  ------------------
  |  Branch (1871:9): [True: 0, False: 237k]
  ------------------
 1872|      0|        return(1);
 1873|   237k|    *out = NULL;
 1874|       |
 1875|   237k|    if ((escRef == NULL) || (escRef[0] == 0)) {
  ------------------
  |  Branch (1875:9): [True: 0, False: 237k]
  |  Branch (1875:29): [True: 1.11k, False: 236k]
  ------------------
 1876|  1.11k|        if ((base == NULL) || (base[0] == 0))
  ------------------
  |  Branch (1876:13): [True: 0, False: 1.11k]
  |  Branch (1876:31): [True: 744, False: 373]
  ------------------
 1877|    744|            return(1);
 1878|    373|        ref = xmlStrdup(base);
 1879|    373|        if (ref == NULL)
  ------------------
  |  Branch (1879:13): [True: 3, False: 370]
  ------------------
 1880|      3|            goto err_memory;
 1881|    370|        *out = ref;
 1882|    370|        return(0);
 1883|    373|    }
 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|   236k|    fragment = xmlStrchr(escRef, '#');
 1891|   236k|    if (fragment != NULL) {
  ------------------
  |  Branch (1891:9): [True: 160k, False: 76.0k]
  ------------------
 1892|   160k|        tmp = xmlStrndup(escRef, fragment - escRef);
 1893|   160k|        if (tmp == NULL)
  ------------------
  |  Branch (1893:13): [True: 8, False: 160k]
  ------------------
 1894|      8|            goto err_memory;
 1895|   160k|        escRef = tmp;
 1896|   160k|    }
 1897|       |
 1898|   236k|    ref = (xmlChar *) xmlURIUnescapeString((char *) escRef, -1, NULL);
 1899|   236k|    if (ref == NULL)
  ------------------
  |  Branch (1899:9): [True: 32, False: 236k]
  ------------------
 1900|     32|        goto err_memory;
 1901|       |
 1902|   236k|    if ((base == NULL) || (base[0] == 0))
  ------------------
  |  Branch (1902:9): [True: 0, False: 236k]
  |  Branch (1902:27): [True: 160k, False: 75.6k]
  ------------------
 1903|   160k|        goto done;
 1904|       |
 1905|  75.6k|    if (xmlIsAbsolutePath(ref))
  ------------------
  |  Branch (1905:9): [True: 1.84k, False: 73.8k]
  ------------------
 1906|  1.84k|        goto done;
 1907|       |
 1908|       |    /*
 1909|       |     * Remove last segment from base
 1910|       |     */
 1911|  73.8k|    i = xmlStrlen(base);
 1912|   127k|    while ((i > 0) && !xmlIsPathSeparator(base[i-1], 1))
  ------------------
  |  Branch (1912:12): [True: 126k, False: 950]
  |  Branch (1912:23): [True: 53.9k, False: 72.8k]
  ------------------
 1913|  53.9k|        i--;
 1914|       |
 1915|       |    /*
 1916|       |     * Concatenate base and ref
 1917|       |     */
 1918|  73.8k|    if (i > 0) {
  ------------------
  |  Branch (1918:9): [True: 72.8k, False: 950]
  ------------------
 1919|  72.8k|        int refLen = xmlStrlen(ref);
 1920|       |
 1921|  72.8k|        result = xmlMalloc(i + refLen + 1);
 1922|  72.8k|        if (result == NULL)
  ------------------
  |  Branch (1922:13): [True: 16, False: 72.8k]
  ------------------
 1923|     16|            goto err_memory;
 1924|       |
 1925|  72.8k|        memcpy(result, base, i);
 1926|  72.8k|        memcpy(result + i, ref, refLen + 1);
 1927|  72.8k|    }
 1928|       |
 1929|       |    /*
 1930|       |     * Normalize
 1931|       |     */
 1932|  73.8k|    xmlNormalizePath((char *) result, 1);
 1933|       |
 1934|   236k|done:
 1935|   236k|    if (result == NULL) {
  ------------------
  |  Branch (1935:9): [True: 163k, False: 72.8k]
  ------------------
 1936|   163k|        result = ref;
 1937|   163k|        ref = NULL;
 1938|   163k|    }
 1939|       |
 1940|   236k|    if (fragment != NULL) {
  ------------------
  |  Branch (1940:9): [True: 160k, False: 76.0k]
  ------------------
 1941|   160k|        result = xmlStrcat(result, fragment);
 1942|   160k|        if (result == NULL)
  ------------------
  |  Branch (1942:13): [True: 12, False: 160k]
  ------------------
 1943|     12|            goto err_memory;
 1944|   160k|    }
 1945|       |
 1946|   236k|    *out = result;
 1947|   236k|    ret = 0;
 1948|       |
 1949|   236k|err_memory:
 1950|   236k|    xmlFree(tmp);
 1951|   236k|    xmlFree(ref);
 1952|   236k|    return(ret);
 1953|   236k|}
uri.c:xmlIsAbsolutePath:
 1837|  80.9k|xmlIsAbsolutePath(const xmlChar *path) {
 1838|  80.9k|    int c = path[0];
 1839|       |
 1840|  80.9k|    if (xmlIsPathSeparator(c, 1))
  ------------------
  |  Branch (1840:9): [True: 2.55k, False: 78.3k]
  ------------------
 1841|  2.55k|        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|  78.3k|    return(0);
 1851|  80.9k|}
uri.c:xmlParseUriOrPath:
 2344|  5.78k|xmlParseUriOrPath(const char *str, xmlURIPtr *out, int *drive) {
 2345|  5.78k|    xmlURIPtr uri;
 2346|  5.78k|    char *buf = NULL;
 2347|  5.78k|    int ret;
 2348|       |
 2349|  5.78k|    *out = NULL;
 2350|  5.78k|    *drive = 0;
 2351|       |
 2352|  5.78k|    uri = xmlCreateURI();
 2353|  5.78k|    if (uri == NULL) {
  ------------------
  |  Branch (2353:9): [True: 14, False: 5.77k]
  ------------------
 2354|     14|        ret = -1;
 2355|     14|	goto done;
 2356|     14|    }
 2357|       |
 2358|  5.77k|    if (xmlStrstr(BAD_CAST str, BAD_CAST "://") == NULL) {
  ------------------
  |  |   34|  5.77k|#define BAD_CAST (xmlChar *)
  ------------------
                  if (xmlStrstr(BAD_CAST str, BAD_CAST "://") == NULL) {
  ------------------
  |  |   34|  5.77k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (2358:9): [True: 5.25k, False: 513]
  ------------------
 2359|  5.25k|        const char *path;
 2360|  5.25k|        size_t pathSize;
 2361|  5.25k|        int prependSlash = 0;
 2362|       |
 2363|  5.25k|        buf = xmlMemStrdup(str);
 2364|  5.25k|        if (buf == NULL) {
  ------------------
  |  Branch (2364:13): [True: 11, False: 5.24k]
  ------------------
 2365|     11|            ret = -1;
 2366|     11|            goto done;
 2367|     11|        }
 2368|  5.24k|        xmlNormalizePath(buf, /* isFile */ 1);
 2369|       |
 2370|  5.24k|        path = buf;
 2371|       |
 2372|  5.24k|        if (xmlIsAbsolutePath(BAD_CAST buf)) {
  ------------------
  |  |   34|  5.24k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (2372:13): [True: 717, False: 4.53k]
  ------------------
 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|    717|        }
 2426|       |
 2427|  5.24k|        pathSize = strlen(path);
 2428|  5.24k|        uri->path = xmlMalloc(pathSize + prependSlash + 1);
 2429|  5.24k|        if (uri->path == NULL) {
  ------------------
  |  Branch (2429:13): [True: 7, False: 5.24k]
  ------------------
 2430|      7|            ret = -1;
 2431|      7|            goto done;
 2432|      7|        }
 2433|  5.24k|        if (prependSlash) {
  ------------------
  |  Branch (2433:13): [True: 0, False: 5.24k]
  ------------------
 2434|      0|            uri->path[0] = '/';
 2435|      0|            memcpy(uri->path + 1, path, pathSize + 1);
 2436|  5.24k|        } else {
 2437|  5.24k|            memcpy(uri->path, path, pathSize + 1);
 2438|  5.24k|        }
 2439|  5.24k|    } else {
 2440|    513|	ret = xmlParseURIReference(uri, str);
 2441|    513|	if (ret != 0)
  ------------------
  |  Branch (2441:6): [True: 413, False: 100]
  ------------------
 2442|    413|	    goto done;
 2443|       |
 2444|    100|        xmlNormalizePath(uri->path, /* isFile */ 0);
 2445|    100|    }
 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|  5.34k|    *out = uri;
 2456|  5.34k|    uri = NULL;
 2457|  5.34k|    ret = 0;
 2458|       |
 2459|  5.78k|done:
 2460|  5.78k|    xmlFreeURI(uri);
 2461|  5.78k|    xmlFree(buf);
 2462|       |
 2463|  5.78k|    return(ret);
 2464|  5.34k|}

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

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

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

xmlRegNewExecCtxt:
 3615|  12.5k|xmlRegNewExecCtxt(xmlRegexp *comp, xmlRegExecCallbacks callback, void *data) {
 3616|  12.5k|    xmlRegExecCtxtPtr exec;
 3617|       |
 3618|  12.5k|    if (comp == NULL)
  ------------------
  |  Branch (3618:9): [True: 0, False: 12.5k]
  ------------------
 3619|      0|	return(NULL);
 3620|  12.5k|    if ((comp->compact == NULL) && (comp->states == NULL))
  ------------------
  |  Branch (3620:9): [True: 1.25k, False: 11.3k]
  |  Branch (3620:36): [True: 0, False: 1.25k]
  ------------------
 3621|      0|        return(NULL);
 3622|  12.5k|    exec = (xmlRegExecCtxtPtr) xmlMalloc(sizeof(xmlRegExecCtxt));
 3623|  12.5k|    if (exec == NULL)
  ------------------
  |  Branch (3623:9): [True: 16, False: 12.5k]
  ------------------
 3624|     16|	return(NULL);
 3625|  12.5k|    memset(exec, 0, sizeof(xmlRegExecCtxt));
 3626|  12.5k|    exec->inputString = NULL;
 3627|  12.5k|    exec->index = 0;
 3628|  12.5k|    exec->determinist = 1;
 3629|  12.5k|    exec->maxRollbacks = 0;
 3630|  12.5k|    exec->nbRollbacks = 0;
 3631|  12.5k|    exec->rollbacks = NULL;
 3632|  12.5k|    exec->status = XML_REGEXP_OK;
  ------------------
  |  |   11|  12.5k|#define XML_REGEXP_OK               0
  ------------------
 3633|  12.5k|    exec->comp = comp;
 3634|  12.5k|    if (comp->compact == NULL)
  ------------------
  |  Branch (3634:9): [True: 1.25k, False: 11.3k]
  ------------------
 3635|  1.25k|	exec->state = comp->states[0];
 3636|  12.5k|    exec->transno = 0;
 3637|  12.5k|    exec->transcount = 0;
 3638|  12.5k|    exec->callback = callback;
 3639|  12.5k|    exec->data = data;
 3640|  12.5k|    if (comp->nbCounters > 0) {
  ------------------
  |  Branch (3640:9): [True: 0, False: 12.5k]
  ------------------
 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|  12.5k|    } else {
 3654|  12.5k|	exec->counts = NULL;
 3655|  12.5k|	exec->errCounts = NULL;
 3656|  12.5k|    }
 3657|  12.5k|    exec->inputStackMax = 0;
 3658|  12.5k|    exec->inputStackNr = 0;
 3659|  12.5k|    exec->inputStack = NULL;
 3660|  12.5k|    exec->errStateNo = -1;
 3661|       |    exec->errString = NULL;
 3662|  12.5k|    exec->nbPush = 0;
 3663|  12.5k|    return(exec);
 3664|  12.5k|}
xmlRegFreeExecCtxt:
 3674|  13.0k|xmlRegFreeExecCtxt(xmlRegExecCtxt *exec) {
 3675|  13.0k|    if (exec == NULL)
  ------------------
  |  Branch (3675:9): [True: 460, False: 12.5k]
  ------------------
 3676|    460|	return;
 3677|       |
 3678|  12.5k|    if (exec->rollbacks != NULL) {
  ------------------
  |  Branch (3678:9): [True: 358, False: 12.2k]
  ------------------
 3679|    358|	if (exec->counts != NULL) {
  ------------------
  |  Branch (3679:6): [True: 0, False: 358]
  ------------------
 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|    358|	xmlFree(exec->rollbacks);
 3687|    358|    }
 3688|  12.5k|    if (exec->counts != NULL)
  ------------------
  |  Branch (3688:9): [True: 0, False: 12.5k]
  ------------------
 3689|      0|	xmlFree(exec->counts);
 3690|  12.5k|    if (exec->inputStack != NULL) {
  ------------------
  |  Branch (3690:9): [True: 357, False: 12.2k]
  ------------------
 3691|    357|	int i;
 3692|       |
 3693|  46.6k|	for (i = 0;i < exec->inputStackNr;i++) {
  ------------------
  |  Branch (3693:13): [True: 46.2k, False: 357]
  ------------------
 3694|  46.2k|	    if (exec->inputStack[i].value != NULL)
  ------------------
  |  Branch (3694:10): [True: 46.2k, False: 0]
  ------------------
 3695|  46.2k|		xmlFree(exec->inputStack[i].value);
 3696|  46.2k|	}
 3697|    357|	xmlFree(exec->inputStack);
 3698|    357|    }
 3699|  12.5k|    if (exec->errString != NULL)
  ------------------
  |  Branch (3699:9): [True: 6.34k, False: 6.21k]
  ------------------
 3700|  6.34k|        xmlFree(exec->errString);
 3701|  12.5k|    xmlFree(exec);
 3702|  12.5k|}
xmlRegExecPushString:
 4197|  69.5k|	             void *data) {
 4198|  69.5k|    return(xmlRegExecPushStringInternal(exec, value, data, 0));
 4199|  69.5k|}
xmlRegexpIsDeterminist:
 5558|  5.95k|xmlRegexpIsDeterminist(xmlRegexp *comp) {
 5559|  5.95k|    xmlAutomataPtr am;
 5560|  5.95k|    int ret;
 5561|       |
 5562|  5.95k|    if (comp == NULL)
  ------------------
  |  Branch (5562:9): [True: 0, False: 5.95k]
  ------------------
 5563|      0|	return(-1);
 5564|  5.95k|    if (comp->determinist != -1)
  ------------------
  |  Branch (5564:9): [True: 4.79k, False: 1.15k]
  ------------------
 5565|  4.79k|	return(comp->determinist);
 5566|       |
 5567|  1.15k|    am = xmlNewAutomata();
 5568|  1.15k|    if (am == NULL)
  ------------------
  |  Branch (5568:9): [True: 12, False: 1.14k]
  ------------------
 5569|     12|        return(-1);
 5570|  1.14k|    if (am->states != NULL) {
  ------------------
  |  Branch (5570:9): [True: 1.14k, False: 0]
  ------------------
 5571|  1.14k|	int i;
 5572|       |
 5573|  2.29k|	for (i = 0;i < am->nbStates;i++)
  ------------------
  |  Branch (5573:13): [True: 1.14k, False: 1.14k]
  ------------------
 5574|  1.14k|	    xmlRegFreeState(am->states[i]);
 5575|  1.14k|	xmlFree(am->states);
 5576|  1.14k|    }
 5577|  1.14k|    am->nbAtoms = comp->nbAtoms;
 5578|  1.14k|    am->atoms = comp->atoms;
 5579|  1.14k|    am->nbStates = comp->nbStates;
 5580|  1.14k|    am->states = comp->states;
 5581|  1.14k|    am->determinist = -1;
 5582|  1.14k|    am->flags = comp->flags;
 5583|  1.14k|    ret = xmlFAComputesDeterminism(am);
 5584|  1.14k|    am->atoms = NULL;
 5585|       |    am->states = NULL;
 5586|  1.14k|    xmlFreeAutomata(am);
 5587|  1.14k|    comp->determinist = ret;
 5588|  1.14k|    return(ret);
 5589|  1.15k|}
xmlRegFreeRegexp:
 5597|  1.08k|xmlRegFreeRegexp(xmlRegexp *regexp) {
 5598|  1.08k|    int i;
 5599|  1.08k|    if (regexp == NULL)
  ------------------
  |  Branch (5599:9): [True: 0, False: 1.08k]
  ------------------
 5600|      0|	return;
 5601|       |
 5602|  1.08k|    if (regexp->string != NULL)
  ------------------
  |  Branch (5602:9): [True: 0, False: 1.08k]
  ------------------
 5603|      0|	xmlFree(regexp->string);
 5604|  1.08k|    if (regexp->states != NULL) {
  ------------------
  |  Branch (5604:9): [True: 342, False: 743]
  ------------------
 5605|   144k|	for (i = 0;i < regexp->nbStates;i++)
  ------------------
  |  Branch (5605:13): [True: 143k, False: 342]
  ------------------
 5606|   143k|	    xmlRegFreeState(regexp->states[i]);
 5607|    342|	xmlFree(regexp->states);
 5608|    342|    }
 5609|  1.08k|    if (regexp->atoms != NULL) {
  ------------------
  |  Branch (5609:9): [True: 342, False: 743]
  ------------------
 5610|   104k|	for (i = 0;i < regexp->nbAtoms;i++)
  ------------------
  |  Branch (5610:13): [True: 104k, False: 342]
  ------------------
 5611|   104k|	    xmlRegFreeAtom(regexp->atoms[i]);
 5612|    342|	xmlFree(regexp->atoms);
 5613|    342|    }
 5614|  1.08k|    if (regexp->counters != NULL)
  ------------------
  |  Branch (5614:9): [True: 0, False: 1.08k]
  ------------------
 5615|      0|	xmlFree(regexp->counters);
 5616|  1.08k|    if (regexp->compact != NULL)
  ------------------
  |  Branch (5616:9): [True: 743, False: 342]
  ------------------
 5617|    743|	xmlFree(regexp->compact);
 5618|  1.08k|    if (regexp->transdata != NULL)
  ------------------
  |  Branch (5618:9): [True: 0, False: 1.08k]
  ------------------
 5619|      0|	xmlFree(regexp->transdata);
 5620|  1.08k|    if (regexp->stringMap != NULL) {
  ------------------
  |  Branch (5620:9): [True: 743, False: 342]
  ------------------
 5621|  3.57k|	for (i = 0; i < regexp->nbstrings;i++)
  ------------------
  |  Branch (5621:14): [True: 2.82k, False: 743]
  ------------------
 5622|  2.82k|	    xmlFree(regexp->stringMap[i]);
 5623|    743|	xmlFree(regexp->stringMap);
 5624|    743|    }
 5625|       |
 5626|  1.08k|    xmlFree(regexp);
 5627|  1.08k|}
xmlNewAutomata:
 5643|  2.71k|xmlNewAutomata(void) {
 5644|  2.71k|    xmlAutomataPtr ctxt;
 5645|       |
 5646|  2.71k|    ctxt = xmlRegNewParserCtxt(NULL);
 5647|  2.71k|    if (ctxt == NULL)
  ------------------
  |  Branch (5647:9): [True: 13, False: 2.69k]
  ------------------
 5648|     13|	return(NULL);
 5649|       |
 5650|       |    /* initialize the parser */
 5651|  2.69k|    ctxt->state = xmlRegStatePush(ctxt);
 5652|  2.69k|    if (ctxt->state == NULL) {
  ------------------
  |  Branch (5652:9): [True: 15, False: 2.68k]
  ------------------
 5653|     15|	xmlFreeAutomata(ctxt);
 5654|     15|	return(NULL);
 5655|     15|    }
 5656|  2.68k|    ctxt->start = ctxt->state;
 5657|  2.68k|    ctxt->end = NULL;
 5658|       |
 5659|  2.68k|    ctxt->start->type = XML_REGEXP_START_STATE;
 5660|  2.68k|    ctxt->flags = 0;
 5661|       |
 5662|  2.68k|    return(ctxt);
 5663|  2.69k|}
xmlFreeAutomata:
 5673|  2.69k|xmlFreeAutomata(xmlAutomata *am) {
 5674|  2.69k|    if (am == NULL)
  ------------------
  |  Branch (5674:9): [True: 0, False: 2.69k]
  ------------------
 5675|      0|	return;
 5676|  2.69k|    xmlRegFreeParserCtxt(am);
 5677|  2.69k|}
xmlAutomataGetInitState:
 5703|  1.53k|xmlAutomataGetInitState(xmlAutomata *am) {
 5704|  1.53k|    if (am == NULL)
  ------------------
  |  Branch (5704:9): [True: 0, False: 1.53k]
  ------------------
 5705|      0|	return(NULL);
 5706|  1.53k|    return(am->start);
 5707|  1.53k|}
xmlAutomataSetFinalState:
 5719|  1.52k|xmlAutomataSetFinalState(xmlAutomata *am, xmlAutomataState *state) {
 5720|  1.52k|    if ((am == NULL) || (state == NULL))
  ------------------
  |  Branch (5720:9): [True: 0, False: 1.52k]
  |  Branch (5720:25): [True: 56, False: 1.47k]
  ------------------
 5721|     56|	return(-1);
 5722|  1.47k|    state->type = XML_REGEXP_FINAL_STATE;
 5723|  1.47k|    return(0);
 5724|  1.52k|}
xmlAutomataNewTransition:
 5745|   185k|			 void *data) {
 5746|   185k|    xmlRegAtomPtr atom;
 5747|       |
 5748|   185k|    if ((am == NULL) || (from == NULL) || (token == NULL))
  ------------------
  |  Branch (5748:9): [True: 0, False: 185k]
  |  Branch (5748:25): [True: 1.76k, False: 183k]
  |  Branch (5748:43): [True: 0, False: 183k]
  ------------------
 5749|  1.76k|	return(NULL);
 5750|   183k|    atom = xmlRegNewAtom(am, XML_REGEXP_STRING);
 5751|   183k|    if (atom == NULL)
  ------------------
  |  Branch (5751:9): [True: 33, False: 183k]
  ------------------
 5752|     33|        return(NULL);
 5753|   183k|    atom->data = data;
 5754|   183k|    atom->valuep = xmlStrdup(token);
 5755|   183k|    if (atom->valuep == NULL) {
  ------------------
  |  Branch (5755:9): [True: 26, False: 183k]
  ------------------
 5756|     26|        xmlRegFreeAtom(atom);
 5757|     26|        xmlRegexpErrMemory(am);
 5758|     26|        return(NULL);
 5759|     26|    }
 5760|       |
 5761|   183k|    if (xmlFAGenerateTransitions(am, from, to, atom) < 0) {
  ------------------
  |  Branch (5761:9): [True: 64, False: 183k]
  ------------------
 5762|     64|        xmlRegFreeAtom(atom);
 5763|     64|	return(NULL);
 5764|     64|    }
 5765|   183k|    if (to == NULL)
  ------------------
  |  Branch (5765:9): [True: 162k, False: 20.8k]
  ------------------
 5766|   162k|	return(am->state);
 5767|  20.8k|    return(to);
 5768|   183k|}
xmlAutomataNewState:
 6229|  28.3k|xmlAutomataNewState(xmlAutomata *am) {
 6230|  28.3k|    if (am == NULL)
  ------------------
  |  Branch (6230:9): [True: 0, False: 28.3k]
  ------------------
 6231|      0|	return(NULL);
 6232|  28.3k|    return(xmlRegStatePush(am));
 6233|  28.3k|}
xmlAutomataNewEpsilon:
 6249|   240k|		      xmlAutomataState *to) {
 6250|   240k|    if ((am == NULL) || (from == NULL))
  ------------------
  |  Branch (6250:9): [True: 0, False: 240k]
  |  Branch (6250:25): [True: 555, False: 240k]
  ------------------
 6251|    555|	return(NULL);
 6252|   240k|    xmlFAGenerateEpsilonTransition(am, from, to);
 6253|   240k|    if (to == NULL)
  ------------------
  |  Branch (6253:9): [True: 77.3k, False: 162k]
  ------------------
 6254|  77.3k|	return(am->state);
 6255|   162k|    return(to);
 6256|   240k|}
xmlAutomataCompile:
 6366|  1.52k|xmlAutomataCompile(xmlAutomata *am) {
 6367|  1.52k|    xmlRegexpPtr ret;
 6368|       |
 6369|  1.52k|    if ((am == NULL) || (am->error != 0)) return(NULL);
  ------------------
  |  Branch (6369:9): [True: 0, False: 1.52k]
  |  Branch (6369:25): [True: 274, False: 1.25k]
  ------------------
 6370|  1.25k|    xmlFAEliminateEpsilonTransitions(am);
 6371|  1.25k|    if (am->error != 0)
  ------------------
  |  Branch (6371:9): [True: 89, False: 1.16k]
  ------------------
 6372|     89|        return(NULL);
 6373|       |    /* xmlFAComputesDeterminism(am); */
 6374|  1.16k|    ret = xmlRegEpxFromParse(am);
 6375|       |
 6376|  1.16k|    return(ret);
 6377|  1.25k|}
xmlregexp.c:xmlRegExecPushStringInternal:
 3886|  69.5k|	                     void *data, int compound) {
 3887|  69.5k|    xmlRegTransPtr trans;
 3888|  69.5k|    xmlRegAtomPtr atom;
 3889|  69.5k|    int ret;
 3890|  69.5k|    int final = 0;
 3891|  69.5k|    int progress = 1;
 3892|       |
 3893|  69.5k|    if (exec == NULL)
  ------------------
  |  Branch (3893:9): [True: 0, False: 69.5k]
  ------------------
 3894|      0|	return(-1);
 3895|  69.5k|    if (exec->comp == NULL)
  ------------------
  |  Branch (3895:9): [True: 0, False: 69.5k]
  ------------------
 3896|      0|	return(-1);
 3897|  69.5k|    if (exec->status != XML_REGEXP_OK)
  ------------------
  |  |   11|  69.5k|#define XML_REGEXP_OK               0
  ------------------
  |  Branch (3897:9): [True: 10.4k, False: 59.0k]
  ------------------
 3898|  10.4k|	return(exec->status);
 3899|       |
 3900|  59.0k|    if (exec->comp->compact != NULL)
  ------------------
  |  Branch (3900:9): [True: 11.4k, False: 47.6k]
  ------------------
 3901|  11.4k|	return(xmlRegCompactPushString(exec, exec->comp, value, data));
 3902|       |
 3903|  47.6k|    if (value == NULL) {
  ------------------
  |  Branch (3903:9): [True: 728, False: 46.8k]
  ------------------
 3904|    728|        if (exec->state->type == XML_REGEXP_FINAL_STATE)
  ------------------
  |  Branch (3904:13): [True: 362, False: 366]
  ------------------
 3905|    362|	    return(1);
 3906|    366|	final = 1;
 3907|    366|    }
 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|  47.2k|    if ((value != NULL) && (exec->inputStackNr > 0)) {
  ------------------
  |  Branch (3913:9): [True: 46.8k, False: 366]
  |  Branch (3913:28): [True: 45.8k, False: 994]
  ------------------
 3914|  45.8k|	xmlFARegExecSaveInputString(exec, value, data);
 3915|  45.8k|	value = exec->inputStack[exec->index].value;
 3916|  45.8k|	data = exec->inputStack[exec->index].data;
 3917|  45.8k|    }
 3918|       |
 3919|  69.2M|    while ((exec->status == XML_REGEXP_OK) &&
  ------------------
  |  |   11|  69.2M|#define XML_REGEXP_OK               0
  ------------------
  |  Branch (3919:12): [True: 69.2M, False: 874]
  ------------------
 3920|  69.2M|	   ((value != NULL) ||
  ------------------
  |  Branch (3920:6): [True: 68.9M, False: 309k]
  ------------------
 3921|   309k|	    ((final == 1) &&
  ------------------
  |  Branch (3921:7): [True: 262k, False: 46.3k]
  ------------------
 3922|  69.1M|	     (exec->state->type != XML_REGEXP_FINAL_STATE)))) {
  ------------------
  |  Branch (3922:7): [True: 262k, False: 14]
  ------------------
 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|  69.1M|	if ((value == NULL) && (exec->counts == NULL))
  ------------------
  |  Branch (3929:6): [True: 262k, False: 68.9M]
  |  Branch (3929:25): [True: 262k, False: 0]
  ------------------
 3930|   262k|	    goto rollback;
 3931|       |
 3932|  68.9M|	exec->transcount = 0;
 3933|   137M|	for (;exec->transno < exec->state->nbTrans;exec->transno++) {
  ------------------
  |  Branch (3933:8): [True: 103M, False: 34.3M]
  ------------------
 3934|   103M|	    trans = &exec->state->trans[exec->transno];
 3935|   103M|	    if (trans->to < 0)
  ------------------
  |  Branch (3935:10): [True: 34.3M, False: 68.9M]
  ------------------
 3936|  34.3M|		continue;
 3937|  68.9M|	    atom = trans->atom;
 3938|  68.9M|	    ret = 0;
 3939|  68.9M|	    if (trans->count == REGEXP_ALL_LAX_COUNTER) {
  ------------------
  |  |  405|  68.9M|#define REGEXP_ALL_LAX_COUNTER	0x123457
  ------------------
  |  Branch (3939:10): [True: 0, False: 68.9M]
  ------------------
 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|  68.9M|	    } else if (trans->count == REGEXP_ALL_COUNTER) {
  ------------------
  |  |  404|  68.9M|#define REGEXP_ALL_COUNTER	0x123456
  ------------------
  |  Branch (3974:17): [True: 0, False: 68.9M]
  ------------------
 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|  68.9M|	    } else if (trans->count >= 0) {
  ------------------
  |  Branch (3996:17): [True: 0, False: 68.9M]
  ------------------
 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|  68.9M|	    } else if (atom == NULL) {
  ------------------
  |  Branch (4007:17): [True: 0, False: 68.9M]
  ------------------
 4008|      0|		exec->status = XML_REGEXP_INTERNAL_ERROR;
  ------------------
  |  |   13|      0|#define XML_REGEXP_INTERNAL_ERROR   (-4)
  ------------------
 4009|      0|		break;
 4010|  68.9M|	    } else if (value != NULL) {
  ------------------
  |  Branch (4010:17): [True: 68.9M, False: 0]
  ------------------
 4011|  68.9M|		ret = xmlRegStrEqualWildcard(atom->valuep, value);
 4012|  68.9M|		if (atom->neg) {
  ------------------
  |  Branch (4012:7): [True: 0, False: 68.9M]
  ------------------
 4013|      0|		    ret = !ret;
 4014|      0|		    if (!compound)
  ------------------
  |  Branch (4014:11): [True: 0, False: 0]
  ------------------
 4015|      0|		        ret = 0;
 4016|      0|		}
 4017|  68.9M|		if ((ret == 1) && (trans->counter >= 0)) {
  ------------------
  |  Branch (4017:7): [True: 34.6M, False: 34.3M]
  |  Branch (4017:21): [True: 0, False: 34.6M]
  ------------------
 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|  68.9M|		if ((ret == 1) && (atom->min > 0) && (atom->max > 0)) {
  ------------------
  |  Branch (4027:7): [True: 34.6M, False: 34.3M]
  |  Branch (4027:21): [True: 0, False: 34.6M]
  |  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|  68.9M|	    }
 4091|  68.9M|	    if (ret == 1) {
  ------------------
  |  Branch (4091:10): [True: 34.6M, False: 34.3M]
  ------------------
 4092|  34.6M|		if ((exec->callback != NULL) && (atom != NULL) &&
  ------------------
  |  Branch (4092:7): [True: 0, False: 34.6M]
  |  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|  34.6M|		if (exec->state->nbTrans > exec->transno + 1) {
  ------------------
  |  Branch (4097:7): [True: 34.5M, False: 44.2k]
  ------------------
 4098|  34.5M|		    if (exec->inputStackNr <= 0) {
  ------------------
  |  Branch (4098:11): [True: 359, False: 34.5M]
  ------------------
 4099|    359|			xmlFARegExecSaveInputString(exec, value, data);
 4100|    359|		    }
 4101|  34.5M|		    xmlFARegExecSave(exec);
 4102|  34.5M|		}
 4103|  34.6M|		if (trans->counter >= 0) {
  ------------------
  |  Branch (4103:7): [True: 0, False: 34.6M]
  ------------------
 4104|      0|		    exec->counts[trans->counter]++;
 4105|      0|		}
 4106|  34.6M|		if ((trans->count >= 0) &&
  ------------------
  |  Branch (4106:7): [True: 0, False: 34.6M]
  ------------------
 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|  34.6M|                if ((exec->comp->states[trans->to] != NULL) &&
  ------------------
  |  Branch (4110:21): [True: 34.6M, False: 0]
  ------------------
 4111|  34.6M|		    (exec->comp->states[trans->to]->type ==
  ------------------
  |  Branch (4111:7): [True: 0, False: 34.6M]
  ------------------
 4112|  34.6M|		     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|  34.6M|		exec->state = exec->comp->states[trans->to];
 4124|  34.6M|		exec->transno = 0;
 4125|  34.6M|		if (trans->atom != NULL) {
  ------------------
  |  Branch (4125:7): [True: 34.6M, False: 0]
  ------------------
 4126|  34.6M|		    if (exec->inputStack != NULL) {
  ------------------
  |  Branch (4126:11): [True: 34.6M, False: 150]
  ------------------
 4127|  34.6M|			exec->index++;
 4128|  34.6M|			if (exec->index < exec->inputStackNr) {
  ------------------
  |  Branch (4128:8): [True: 34.3M, False: 308k]
  ------------------
 4129|  34.3M|			    value = exec->inputStack[exec->index].value;
 4130|  34.3M|			    data = exec->inputStack[exec->index].data;
 4131|  34.3M|			} else {
 4132|   308k|			    value = NULL;
 4133|   308k|			    data = NULL;
 4134|   308k|			}
 4135|  34.6M|		    } else {
 4136|    150|			value = NULL;
 4137|    150|			data = NULL;
 4138|    150|		    }
 4139|  34.6M|		}
 4140|  34.6M|		goto progress;
 4141|  34.6M|	    } else if (ret < 0) {
  ------------------
  |  Branch (4141:17): [True: 0, False: 34.3M]
  ------------------
 4142|      0|		exec->status = XML_REGEXP_INTERNAL_ERROR;
  ------------------
  |  |   13|      0|#define XML_REGEXP_INTERNAL_ERROR   (-4)
  ------------------
 4143|      0|		break;
 4144|      0|	    }
 4145|  68.9M|	}
 4146|  34.3M|	if ((exec->transno != 0) || (exec->state->nbTrans == 0)) {
  ------------------
  |  Branch (4146:6): [True: 34.3M, False: 301]
  |  Branch (4146:30): [True: 301, False: 0]
  ------------------
 4147|  34.5M|rollback:
 4148|       |            /*
 4149|       |	     * if we didn't yet rollback on the current input
 4150|       |	     * store the current state as the error state.
 4151|       |	     */
 4152|  34.5M|	    if ((progress) && (exec->state != NULL) &&
  ------------------
  |  Branch (4152:10): [True: 309k, False: 34.2M]
  |  Branch (4152:24): [True: 309k, False: 0]
  ------------------
 4153|   309k|	        (exec->state->type != XML_REGEXP_SINK_STATE)) {
  ------------------
  |  Branch (4153:10): [True: 309k, False: 0]
  ------------------
 4154|   309k|	        progress = 0;
 4155|   309k|                if (xmlRegExecSetErrString(exec, value) < 0)
  ------------------
  |  Branch (4155:21): [True: 1, False: 309k]
  ------------------
 4156|      1|                    break;
 4157|   309k|		exec->errState = exec->state;
 4158|   309k|                if (exec->comp->nbCounters)
  ------------------
  |  Branch (4158:21): [True: 0, False: 309k]
  ------------------
 4159|      0|                    memcpy(exec->errCounts, exec->counts,
 4160|      0|                           exec->comp->nbCounters * sizeof(int));
 4161|   309k|	    }
 4162|       |
 4163|       |	    /*
 4164|       |	     * Failed to find a way out
 4165|       |	     */
 4166|  34.5M|	    exec->determinist = 0;
 4167|  34.5M|	    xmlFARegExecRollBack(exec);
 4168|  34.5M|	    if ((exec->inputStack != NULL ) &&
  ------------------
  |  Branch (4168:10): [True: 34.5M, False: 601]
  ------------------
 4169|  34.5M|                (exec->status == XML_REGEXP_OK)) {
  ------------------
  |  |   11|  34.5M|#define XML_REGEXP_OK               0
  ------------------
  |  Branch (4169:17): [True: 34.5M, False: 266]
  ------------------
 4170|  34.5M|		value = exec->inputStack[exec->index].value;
 4171|  34.5M|		data = exec->inputStack[exec->index].data;
 4172|  34.5M|	    }
 4173|  34.5M|	}
 4174|  34.5M|	continue;
 4175|  34.6M|progress:
 4176|  34.6M|        progress = 1;
 4177|  34.6M|    }
 4178|  47.2k|    if (exec->status == XML_REGEXP_OK) {
  ------------------
  |  |   11|  47.2k|#define XML_REGEXP_OK               0
  ------------------
  |  Branch (4178:9): [True: 46.3k, False: 875]
  ------------------
 4179|  46.3k|        return(exec->state->type == XML_REGEXP_FINAL_STATE);
 4180|  46.3k|    }
 4181|    875|    return(exec->status);
 4182|  47.2k|}
xmlregexp.c:xmlFARegExecSaveInputString:
 3722|  46.2k|	                    void *data) {
 3723|  46.2k|    if (exec->inputStackNr + 1 >= exec->inputStackMax) {
  ------------------
  |  Branch (3723:9): [True: 755, False: 45.5k]
  ------------------
 3724|    755|	xmlRegInputTokenPtr tmp;
 3725|    755|        int newSize;
 3726|       |
 3727|    755|        newSize = xmlGrowCapacity(exec->inputStackMax, sizeof(tmp[0]),
 3728|    755|                                  4, XML_MAX_ITEMS);
  ------------------
  |  |   13|    755|#define XML_MAX_ITEMS 1000000000 /* 1 billion */
  ------------------
 3729|    755|	if (newSize < 0) {
  ------------------
  |  Branch (3729:6): [True: 0, False: 755]
  ------------------
 3730|      0|            exec->status = XML_REGEXP_OUT_OF_MEMORY;
  ------------------
  |  |   14|      0|#define XML_REGEXP_OUT_OF_MEMORY    (-5)
  ------------------
 3731|      0|	    return;
 3732|      0|	}
 3733|    755|#ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
 3734|    755|        if (newSize < 2)
  ------------------
  |  Branch (3734:13): [True: 359, False: 396]
  ------------------
 3735|    359|            newSize = 2;
 3736|    755|#endif
 3737|    755|	tmp = xmlRealloc(exec->inputStack, newSize * sizeof(tmp[0]));
 3738|    755|	if (tmp == NULL) {
  ------------------
  |  Branch (3738:6): [True: 2, False: 753]
  ------------------
 3739|      2|            exec->status = XML_REGEXP_OUT_OF_MEMORY;
  ------------------
  |  |   14|      2|#define XML_REGEXP_OUT_OF_MEMORY    (-5)
  ------------------
 3740|      2|	    return;
 3741|      2|	}
 3742|    753|	exec->inputStack = tmp;
 3743|    753|	exec->inputStackMax = newSize;
 3744|    753|    }
 3745|  46.2k|    if (value == NULL) {
  ------------------
  |  Branch (3745:9): [True: 0, False: 46.2k]
  ------------------
 3746|      0|        exec->inputStack[exec->inputStackNr].value = NULL;
 3747|  46.2k|    } else {
 3748|  46.2k|        exec->inputStack[exec->inputStackNr].value = xmlStrdup(value);
 3749|  46.2k|        if (exec->inputStack[exec->inputStackNr].value == NULL) {
  ------------------
  |  Branch (3749:13): [True: 2, False: 46.2k]
  ------------------
 3750|      2|            exec->status = XML_REGEXP_OUT_OF_MEMORY;
  ------------------
  |  |   14|      2|#define XML_REGEXP_OUT_OF_MEMORY    (-5)
  ------------------
 3751|      2|            return;
 3752|      2|        }
 3753|  46.2k|    }
 3754|  46.2k|    exec->inputStack[exec->inputStackNr].data = data;
 3755|  46.2k|    exec->inputStackNr++;
 3756|  46.2k|    exec->inputStack[exec->inputStackNr].value = NULL;
 3757|       |    exec->inputStack[exec->inputStackNr].data = NULL;
 3758|  46.2k|}
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|   129M|    do {
 3777|       |	/*
 3778|       |	* Eval if we have a wildcard for the current item.
 3779|       |	*/
 3780|   129M|        if (*expStr != *valStr) {
  ------------------
  |  Branch (3780:13): [True: 62.5M, False: 67.1M]
  ------------------
 3781|       |	    /* if one of them starts with a wildcard make valStr be it */
 3782|  62.5M|	    if (*valStr == '*') {
  ------------------
  |  Branch (3782:10): [True: 0, False: 62.5M]
  ------------------
 3783|      0|	        const xmlChar *tmp;
 3784|       |
 3785|      0|		tmp = valStr;
 3786|      0|		valStr = expStr;
 3787|      0|		expStr = tmp;
 3788|      0|	    }
 3789|  62.5M|	    if ((*valStr != 0) && (*expStr != 0) && (*expStr++ == '*')) {
  ------------------
  |  Branch (3789:10): [True: 62.5M, False: 0]
  |  Branch (3789:28): [True: 61.8M, False: 748k]
  |  Branch (3789:46): [True: 0, False: 61.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.5M|		return(0);
 3798|  62.5M|	}
 3799|  67.1M|	expStr++;
 3800|  67.1M|	valStr++;
 3801|  67.1M|    } while (*valStr != 0);
  ------------------
  |  Branch (3801:14): [True: 22.2M, False: 44.8M]
  ------------------
 3802|  44.8M|    if (*expStr != 0)
  ------------------
  |  Branch (3802:9): [True: 688k, False: 44.2M]
  ------------------
 3803|   688k|	return (0);
 3804|  44.2M|    else
 3805|  44.2M|	return (1);
 3806|  44.8M|}
xmlregexp.c:xmlFARegExecSave:
 3241|  34.5M|xmlFARegExecSave(xmlRegExecCtxtPtr exec) {
 3242|  34.5M|#ifdef MAX_PUSH
 3243|  34.5M|    if (exec->nbPush > MAX_PUSH) {
  ------------------
  |  |   41|  34.5M|#define MAX_PUSH 10000000
  ------------------
  |  Branch (3243:9): [True: 2, False: 34.5M]
  ------------------
 3244|      2|        exec->status = XML_REGEXP_INTERNAL_LIMIT;
  ------------------
  |  |   15|      2|#define XML_REGEXP_INTERNAL_LIMIT   (-6)
  ------------------
 3245|      2|        return;
 3246|      2|    }
 3247|  34.5M|    exec->nbPush++;
 3248|  34.5M|#endif
 3249|       |
 3250|  34.5M|    if (exec->nbRollbacks >= exec->maxRollbacks) {
  ------------------
  |  Branch (3250:9): [True: 784, False: 34.5M]
  ------------------
 3251|    784|	xmlRegExecRollback *tmp;
 3252|    784|        int newSize;
 3253|    784|	int len = exec->nbRollbacks;
 3254|       |
 3255|    784|        newSize = xmlGrowCapacity(exec->maxRollbacks, sizeof(tmp[0]),
 3256|    784|                                  4, XML_MAX_ITEMS);
  ------------------
  |  |   13|    784|#define XML_MAX_ITEMS 1000000000 /* 1 billion */
  ------------------
 3257|    784|	if (newSize < 0) {
  ------------------
  |  Branch (3257:6): [True: 0, False: 784]
  ------------------
 3258|      0|            exec->status = XML_REGEXP_OUT_OF_MEMORY;
  ------------------
  |  |   14|      0|#define XML_REGEXP_OUT_OF_MEMORY    (-5)
  ------------------
 3259|      0|	    return;
 3260|      0|	}
 3261|    784|	tmp = xmlRealloc(exec->rollbacks, newSize * sizeof(tmp[0]));
 3262|    784|	if (tmp == NULL) {
  ------------------
  |  Branch (3262:6): [True: 1, False: 783]
  ------------------
 3263|      1|            exec->status = XML_REGEXP_OUT_OF_MEMORY;
  ------------------
  |  |   14|      1|#define XML_REGEXP_OUT_OF_MEMORY    (-5)
  ------------------
 3264|      1|	    return;
 3265|      1|	}
 3266|    783|	exec->rollbacks = tmp;
 3267|    783|	exec->maxRollbacks = newSize;
 3268|    783|	tmp = &exec->rollbacks[len];
 3269|    783|	memset(tmp, 0, (exec->maxRollbacks - len) * sizeof(xmlRegExecRollback));
 3270|    783|    }
 3271|  34.5M|    exec->rollbacks[exec->nbRollbacks].state = exec->state;
 3272|  34.5M|    exec->rollbacks[exec->nbRollbacks].index = exec->index;
 3273|  34.5M|    exec->rollbacks[exec->nbRollbacks].nextbranch = exec->transno + 1;
 3274|  34.5M|    if (exec->comp->nbCounters > 0) {
  ------------------
  |  Branch (3274:9): [True: 0, False: 34.5M]
  ------------------
 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|  34.5M|    exec->nbRollbacks++;
 3287|  34.5M|}
xmlregexp.c:xmlRegExecSetErrString:
 3705|   315k|xmlRegExecSetErrString(xmlRegExecCtxtPtr exec, const xmlChar *value) {
 3706|   315k|    if (exec->errString != NULL)
  ------------------
  |  Branch (3706:9): [True: 46.1k, False: 269k]
  ------------------
 3707|  46.1k|        xmlFree(exec->errString);
 3708|   315k|    if (value == NULL) {
  ------------------
  |  Branch (3708:9): [True: 262k, False: 52.4k]
  ------------------
 3709|   262k|        exec->errString = NULL;
 3710|   262k|    } else {
 3711|  52.4k|        exec->errString = xmlStrdup(value);
 3712|  52.4k|        if (exec->errString == NULL) {
  ------------------
  |  Branch (3712:13): [True: 23, False: 52.4k]
  ------------------
 3713|     23|            exec->status = XML_REGEXP_OUT_OF_MEMORY;
  ------------------
  |  |   14|     23|#define XML_REGEXP_OUT_OF_MEMORY    (-5)
  ------------------
 3714|     23|            return(-1);
 3715|     23|        }
 3716|  52.4k|    }
 3717|   315k|    return(0);
 3718|   315k|}
xmlregexp.c:xmlFARegExecRollBack:
 3290|  34.5M|xmlFARegExecRollBack(xmlRegExecCtxtPtr exec) {
 3291|  34.5M|    if (exec->status != XML_REGEXP_OK)
  ------------------
  |  |   11|  34.5M|#define XML_REGEXP_OK               0
  ------------------
  |  Branch (3291:9): [True: 0, False: 34.5M]
  ------------------
 3292|      0|        return;
 3293|  34.5M|    if (exec->nbRollbacks <= 0) {
  ------------------
  |  Branch (3293:9): [True: 867, False: 34.5M]
  ------------------
 3294|    867|	exec->status = XML_REGEXP_NOT_FOUND;
  ------------------
  |  |   12|    867|#define XML_REGEXP_NOT_FOUND        (-1)
  ------------------
 3295|    867|	return;
 3296|    867|    }
 3297|  34.5M|    exec->nbRollbacks--;
 3298|  34.5M|    exec->state = exec->rollbacks[exec->nbRollbacks].state;
 3299|  34.5M|    exec->index = exec->rollbacks[exec->nbRollbacks].index;
 3300|  34.5M|    exec->transno = exec->rollbacks[exec->nbRollbacks].nextbranch;
 3301|  34.5M|    if (exec->comp->nbCounters > 0) {
  ------------------
  |  Branch (3301:9): [True: 0, False: 34.5M]
  ------------------
 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|  34.5M|}
xmlregexp.c:xmlRegCompactPushString:
 3822|  11.4k|	                void *data) {
 3823|  11.4k|    int state = exec->index;
 3824|  11.4k|    int i, target;
 3825|       |
 3826|  11.4k|    if ((comp == NULL) || (comp->compact == NULL) || (comp->stringMap == NULL))
  ------------------
  |  Branch (3826:9): [True: 0, False: 11.4k]
  |  Branch (3826:27): [True: 0, False: 11.4k]
  |  Branch (3826:54): [True: 0, False: 11.4k]
  ------------------
 3827|      0|	return(-1);
 3828|       |
 3829|  11.4k|    if (value == NULL) {
  ------------------
  |  Branch (3829:9): [True: 4.81k, False: 6.65k]
  ------------------
 3830|       |	/*
 3831|       |	 * are we at a final state ?
 3832|       |	 */
 3833|  4.81k|	if (comp->compact[state * (comp->nbstrings + 1)] ==
  ------------------
  |  Branch (3833:6): [True: 1.27k, False: 3.54k]
  ------------------
 3834|  4.81k|            XML_REGEXP_FINAL_STATE)
 3835|  1.27k|	    return(1);
 3836|  3.54k|	return(0);
 3837|  4.81k|    }
 3838|       |
 3839|       |    /*
 3840|       |     * Examine all outside transitions from current state
 3841|       |     */
 3842|  23.2k|    for (i = 0;i < comp->nbstrings;i++) {
  ------------------
  |  Branch (3842:16): [True: 17.4k, False: 5.84k]
  ------------------
 3843|  17.4k|	target = comp->compact[state * (comp->nbstrings + 1) + i + 1];
 3844|  17.4k|	if ((target > 0) && (target <= comp->nbstates)) {
  ------------------
  |  Branch (3844:6): [True: 14.8k, False: 2.52k]
  |  Branch (3844:22): [True: 14.8k, False: 0]
  ------------------
 3845|  14.8k|	    target--; /* to avoid 0 */
 3846|  14.8k|	    if (xmlRegStrEqualWildcard(comp->stringMap[i], value)) {
  ------------------
  |  Branch (3846:10): [True: 807, False: 14.0k]
  ------------------
 3847|    807|		exec->index = target;
 3848|    807|		if ((exec->callback != NULL) && (comp->transdata != NULL)) {
  ------------------
  |  Branch (3848:7): [True: 0, False: 807]
  |  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|    807|		if (comp->compact[target * (comp->nbstrings + 1)] ==
  ------------------
  |  Branch (3852:7): [True: 0, False: 807]
  ------------------
 3853|    807|		    XML_REGEXP_SINK_STATE)
 3854|      0|		    goto error;
 3855|       |
 3856|    807|		if (comp->compact[target * (comp->nbstrings + 1)] ==
  ------------------
  |  Branch (3856:7): [True: 559, False: 248]
  ------------------
 3857|    807|		    XML_REGEXP_FINAL_STATE)
 3858|    559|		    return(1);
 3859|    248|		return(0);
 3860|    807|	    }
 3861|  14.8k|	}
 3862|  17.4k|    }
 3863|       |    /*
 3864|       |     * Failed to find an exit transition out from current state for the
 3865|       |     * current token
 3866|       |     */
 3867|  5.84k|error:
 3868|  5.84k|    exec->errStateNo = state;
 3869|  5.84k|    exec->status = XML_REGEXP_NOT_FOUND;
  ------------------
  |  |   12|  5.84k|#define XML_REGEXP_NOT_FOUND        (-1)
  ------------------
 3870|  5.84k|    xmlRegExecSetErrString(exec, value);
 3871|  5.84k|    return(exec->status);
 3872|  6.65k|}
xmlregexp.c:xmlRegNewParserCtxt:
  731|  2.71k|xmlRegNewParserCtxt(const xmlChar *string) {
  732|  2.71k|    xmlRegParserCtxtPtr ret;
  733|       |
  734|  2.71k|    ret = (xmlRegParserCtxtPtr) xmlMalloc(sizeof(xmlRegParserCtxt));
  735|  2.71k|    if (ret == NULL)
  ------------------
  |  Branch (735:9): [True: 13, False: 2.69k]
  ------------------
  736|     13|	return(NULL);
  737|  2.69k|    memset(ret, 0, sizeof(xmlRegParserCtxt));
  738|  2.69k|    if (string != NULL) {
  ------------------
  |  Branch (738:9): [True: 0, False: 2.69k]
  ------------------
  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|  2.69k|    ret->cur = ret->string;
  747|  2.69k|    ret->neg = 0;
  748|  2.69k|    ret->negs = 0;
  749|  2.69k|    ret->error = 0;
  750|  2.69k|    ret->determinist = -1;
  751|  2.69k|    return(ret);
  752|  2.69k|}
xmlregexp.c:xmlRegStatePush:
 1578|   271k|xmlRegStatePush(xmlRegParserCtxtPtr ctxt) {
 1579|   271k|    xmlRegStatePtr state;
 1580|       |
 1581|   271k|    if (ctxt->nbStates >= ctxt->maxStates) {
  ------------------
  |  Branch (1581:9): [True: 10.6k, False: 260k]
  ------------------
 1582|  10.6k|	xmlRegStatePtr *tmp;
 1583|  10.6k|        int newSize;
 1584|       |
 1585|  10.6k|        newSize = xmlGrowCapacity(ctxt->maxStates, sizeof(tmp[0]),
 1586|  10.6k|                                  4, XML_MAX_ITEMS);
  ------------------
  |  |   13|  10.6k|#define XML_MAX_ITEMS 1000000000 /* 1 billion */
  ------------------
 1587|  10.6k|	if (newSize < 0) {
  ------------------
  |  Branch (1587:6): [True: 0, False: 10.6k]
  ------------------
 1588|      0|	    xmlRegexpErrMemory(ctxt);
 1589|      0|	    return(NULL);
 1590|      0|	}
 1591|  10.6k|	tmp = xmlRealloc(ctxt->states, newSize * sizeof(tmp[0]));
 1592|  10.6k|	if (tmp == NULL) {
  ------------------
  |  Branch (1592:6): [True: 36, False: 10.6k]
  ------------------
 1593|     36|	    xmlRegexpErrMemory(ctxt);
 1594|     36|	    return(NULL);
 1595|     36|	}
 1596|  10.6k|	ctxt->states = tmp;
 1597|  10.6k|	ctxt->maxStates = newSize;
 1598|  10.6k|    }
 1599|       |
 1600|   271k|    state = xmlRegNewState(ctxt);
 1601|   271k|    if (state == NULL)
  ------------------
  |  Branch (1601:9): [True: 61, False: 271k]
  ------------------
 1602|     61|        return(NULL);
 1603|       |
 1604|   271k|    state->no = ctxt->nbStates;
 1605|   271k|    ctxt->states[ctxt->nbStates++] = state;
 1606|       |
 1607|   271k|    return(state);
 1608|   271k|}
xmlregexp.c:xmlRegNewState:
  919|   271k|xmlRegNewState(xmlRegParserCtxtPtr ctxt) {
  920|   271k|    xmlRegStatePtr ret;
  921|       |
  922|   271k|    ret = (xmlRegStatePtr) xmlMalloc(sizeof(xmlRegState));
  923|   271k|    if (ret == NULL) {
  ------------------
  |  Branch (923:9): [True: 61, False: 271k]
  ------------------
  924|     61|	xmlRegexpErrMemory(ctxt);
  925|     61|	return(NULL);
  926|     61|    }
  927|   271k|    memset(ret, 0, sizeof(xmlRegState));
  928|   271k|    ret->type = XML_REGEXP_TRANS_STATE;
  929|   271k|    ret->mark = XML_REGEXP_MARK_NORMAL;
  930|   271k|    return(ret);
  931|   271k|}
xmlregexp.c:xmlRegexpErrCompile:
  442|      3|{
  443|      3|    const char *regexp = NULL;
  444|      3|    int idx = 0;
  445|      3|    int res;
  446|       |
  447|      3|    if (ctxt != NULL) {
  ------------------
  |  Branch (447:9): [True: 3, False: 0]
  ------------------
  448|      3|        regexp = (const char *) ctxt->string;
  449|      3|	idx = ctxt->cur - ctxt->string;
  450|      3|	ctxt->error = XML_REGEXP_COMPILE_ERROR;
  451|      3|    }
  452|       |
  453|      3|    res = xmlRaiseError(NULL, NULL, NULL, NULL, NULL, XML_FROM_REGEXP,
  454|      3|                        XML_REGEXP_COMPILE_ERROR, XML_ERR_FATAL,
  455|      3|                        NULL, 0, extra, regexp, NULL, idx, 0,
  456|      3|                        "failed to compile: %s\n", extra);
  457|      3|    if (res < 0)
  ------------------
  |  Branch (457:9): [True: 0, False: 3]
  ------------------
  458|      0|        xmlRegexpErrMemory(ctxt);
  459|      3|}
xmlregexp.c:xmlFAEliminateEpsilonTransitions:
 2076|  1.25k|xmlFAEliminateEpsilonTransitions(xmlRegParserCtxtPtr ctxt) {
 2077|  1.25k|    int statenr, transnr;
 2078|  1.25k|    xmlRegStatePtr state;
 2079|  1.25k|    int has_epsilon;
 2080|       |
 2081|  1.25k|    if (ctxt->states == NULL) return;
  ------------------
  |  Branch (2081:9): [True: 0, False: 1.25k]
  ------------------
 2082|       |
 2083|       |    /*
 2084|       |     * Eliminate simple epsilon transition and the associated unreachable
 2085|       |     * states.
 2086|       |     */
 2087|  1.25k|    xmlFAEliminateSimpleEpsilonTransitions(ctxt);
 2088|   161k|    for (statenr = 0;statenr < ctxt->nbStates;statenr++) {
  ------------------
  |  Branch (2088:22): [True: 160k, False: 1.25k]
  ------------------
 2089|   160k|	state = ctxt->states[statenr];
 2090|   160k|	if ((state != NULL) && (state->type == XML_REGEXP_UNREACH_STATE)) {
  ------------------
  |  Branch (2090:6): [True: 160k, False: 0]
  |  Branch (2090:25): [True: 62.0k, False: 98.1k]
  ------------------
 2091|  62.0k|	    xmlRegFreeState(state);
 2092|  62.0k|	    ctxt->states[statenr] = NULL;
 2093|  62.0k|	}
 2094|   160k|    }
 2095|       |
 2096|  1.25k|    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|   161k|    for (statenr = ctxt->nbStates - 1;statenr >= 0;statenr--) {
  ------------------
  |  Branch (2106:39): [True: 160k, False: 1.25k]
  ------------------
 2107|   160k|	state = ctxt->states[statenr];
 2108|   160k|	if (state == NULL)
  ------------------
  |  Branch (2108:6): [True: 62.0k, False: 98.1k]
  ------------------
 2109|  62.0k|	    continue;
 2110|  98.1k|	if ((state->nbTrans == 0) &&
  ------------------
  |  Branch (2110:6): [True: 1.08k, False: 97.0k]
  ------------------
 2111|  1.08k|	    (state->type != XML_REGEXP_FINAL_STATE)) {
  ------------------
  |  Branch (2111:6): [True: 0, False: 1.08k]
  ------------------
 2112|      0|	    state->type = XML_REGEXP_SINK_STATE;
 2113|      0|	}
 2114|  1.25M|	for (transnr = 0;transnr < state->nbTrans;transnr++) {
  ------------------
  |  Branch (2114:19): [True: 1.16M, False: 98.1k]
  ------------------
 2115|  1.16M|	    if ((state->trans[transnr].atom == NULL) &&
  ------------------
  |  Branch (2115:10): [True: 107k, False: 1.05M]
  ------------------
 2116|   107k|		(state->trans[transnr].to >= 0)) {
  ------------------
  |  Branch (2116:3): [True: 65.0k, False: 42.7k]
  ------------------
 2117|  65.0k|		if (state->trans[transnr].to == statenr) {
  ------------------
  |  Branch (2117:7): [True: 0, False: 65.0k]
  ------------------
 2118|      0|		    state->trans[transnr].to = -1;
 2119|  65.0k|		} else if (state->trans[transnr].count < 0) {
  ------------------
  |  Branch (2119:14): [True: 65.0k, False: 0]
  ------------------
 2120|  65.0k|		    int newto = state->trans[transnr].to;
 2121|       |
 2122|  65.0k|		    has_epsilon = 1;
 2123|  65.0k|		    state->trans[transnr].to = -2;
 2124|  65.0k|		    state->mark = XML_REGEXP_MARK_START;
 2125|  65.0k|		    xmlFAReduceEpsilonTransitions(ctxt, statenr,
 2126|  65.0k|				      newto, state->trans[transnr].counter);
 2127|  65.0k|		    xmlFAFinishReduceEpsilonTransitions(ctxt, newto);
 2128|  65.0k|		    state->mark = XML_REGEXP_MARK_NORMAL;
 2129|  65.0k|	        }
 2130|  65.0k|	    }
 2131|  1.16M|	}
 2132|  98.1k|    }
 2133|       |    /*
 2134|       |     * Eliminate the epsilon transitions
 2135|       |     */
 2136|  1.25k|    if (has_epsilon) {
  ------------------
  |  Branch (2136:9): [True: 1.02k, False: 227]
  ------------------
 2137|   160k|	for (statenr = 0;statenr < ctxt->nbStates;statenr++) {
  ------------------
  |  Branch (2137:19): [True: 159k, False: 1.02k]
  ------------------
 2138|   159k|	    state = ctxt->states[statenr];
 2139|   159k|	    if (state == NULL)
  ------------------
  |  Branch (2139:10): [True: 61.9k, False: 97.4k]
  ------------------
 2140|  61.9k|		continue;
 2141|  1.25M|	    for (transnr = 0;transnr < state->nbTrans;transnr++) {
  ------------------
  |  Branch (2141:23): [True: 1.16M, False: 97.4k]
  ------------------
 2142|  1.16M|		xmlRegTransPtr trans = &(state->trans[transnr]);
 2143|  1.16M|		if ((trans->atom == NULL) &&
  ------------------
  |  Branch (2143:7): [True: 107k, False: 1.05M]
  ------------------
 2144|   107k|		    (trans->count < 0) &&
  ------------------
  |  Branch (2144:7): [True: 107k, False: 0]
  ------------------
 2145|   107k|		    (trans->to >= 0)) {
  ------------------
  |  Branch (2145:7): [True: 0, False: 107k]
  ------------------
 2146|      0|		    trans->to = -1;
 2147|      0|		}
 2148|  1.16M|	    }
 2149|  97.4k|	}
 2150|  1.02k|    }
 2151|       |
 2152|       |    /*
 2153|       |     * Use this pass to detect unreachable states too
 2154|       |     */
 2155|   161k|    for (statenr = 0;statenr < ctxt->nbStates;statenr++) {
  ------------------
  |  Branch (2155:22): [True: 160k, False: 1.25k]
  ------------------
 2156|   160k|	state = ctxt->states[statenr];
 2157|   160k|	if (state != NULL)
  ------------------
  |  Branch (2157:6): [True: 98.1k, False: 62.0k]
  ------------------
 2158|  98.1k|	    state->reached = XML_REGEXP_MARK_NORMAL;
 2159|   160k|    }
 2160|  1.25k|    state = ctxt->states[0];
 2161|  1.25k|    if (state != NULL)
  ------------------
  |  Branch (2161:9): [True: 1.25k, False: 0]
  ------------------
 2162|  1.25k|	state->reached = XML_REGEXP_MARK_START;
 2163|  83.6k|    while (state != NULL) {
  ------------------
  |  Branch (2163:12): [True: 82.4k, False: 1.25k]
  ------------------
 2164|  82.4k|	xmlRegStatePtr target = NULL;
 2165|  82.4k|	state->reached = XML_REGEXP_MARK_VISITED;
 2166|       |	/*
 2167|       |	 * Mark all states reachable from the current reachable state
 2168|       |	 */
 2169|  1.01M|	for (transnr = 0;transnr < state->nbTrans;transnr++) {
  ------------------
  |  Branch (2169:19): [True: 932k, False: 82.4k]
  ------------------
 2170|   932k|	    if ((state->trans[transnr].to >= 0) &&
  ------------------
  |  Branch (2170:10): [True: 831k, False: 100k]
  ------------------
 2171|   831k|		((state->trans[transnr].atom != NULL) ||
  ------------------
  |  Branch (2171:4): [True: 831k, False: 0]
  ------------------
 2172|   831k|		 (state->trans[transnr].count >= 0))) {
  ------------------
  |  Branch (2172:4): [True: 0, False: 0]
  ------------------
 2173|   831k|		int newto = state->trans[transnr].to;
 2174|       |
 2175|   831k|		if (ctxt->states[newto] == NULL)
  ------------------
  |  Branch (2175:7): [True: 1, False: 831k]
  ------------------
 2176|      1|		    continue;
 2177|   831k|		if (ctxt->states[newto]->reached == XML_REGEXP_MARK_NORMAL) {
  ------------------
  |  Branch (2177:7): [True: 81.1k, False: 750k]
  ------------------
 2178|  81.1k|		    ctxt->states[newto]->reached = XML_REGEXP_MARK_START;
 2179|  81.1k|		    target = ctxt->states[newto];
 2180|  81.1k|		}
 2181|   831k|	    }
 2182|   932k|	}
 2183|       |
 2184|       |	/*
 2185|       |	 * find the next accessible state not explored
 2186|       |	 */
 2187|  82.4k|	if (target == NULL) {
  ------------------
  |  Branch (2187:6): [True: 32.1k, False: 50.2k]
  ------------------
 2188|   224M|	    for (statenr = 1;statenr < ctxt->nbStates;statenr++) {
  ------------------
  |  Branch (2188:23): [True: 224M, False: 1.25k]
  ------------------
 2189|   224M|		state = ctxt->states[statenr];
 2190|   224M|		if ((state != NULL) && (state->reached ==
  ------------------
  |  Branch (2190:7): [True: 105M, False: 118M]
  |  Branch (2190:26): [True: 30.9k, False: 105M]
  ------------------
 2191|   105M|			XML_REGEXP_MARK_START)) {
 2192|  30.9k|		    target = state;
 2193|  30.9k|		    break;
 2194|  30.9k|		}
 2195|   224M|	    }
 2196|  32.1k|	}
 2197|  82.4k|	state = target;
 2198|  82.4k|    }
 2199|   161k|    for (statenr = 0;statenr < ctxt->nbStates;statenr++) {
  ------------------
  |  Branch (2199:22): [True: 160k, False: 1.25k]
  ------------------
 2200|   160k|	state = ctxt->states[statenr];
 2201|   160k|	if ((state != NULL) && (state->reached == XML_REGEXP_MARK_NORMAL)) {
  ------------------
  |  Branch (2201:6): [True: 98.1k, False: 62.0k]
  |  Branch (2201:25): [True: 15.7k, False: 82.4k]
  ------------------
 2202|  15.7k|	    xmlRegFreeState(state);
 2203|  15.7k|	    ctxt->states[statenr] = NULL;
 2204|  15.7k|	}
 2205|   160k|    }
 2206|       |
 2207|  1.25k|}
xmlregexp.c:xmlFAEliminateSimpleEpsilonTransitions:
 2025|  1.25k|xmlFAEliminateSimpleEpsilonTransitions(xmlRegParserCtxtPtr ctxt) {
 2026|  1.25k|    int statenr, i, j, newto;
 2027|  1.25k|    xmlRegStatePtr state, tmp;
 2028|       |
 2029|   161k|    for (statenr = 0;statenr < ctxt->nbStates;statenr++) {
  ------------------
  |  Branch (2029:22): [True: 160k, False: 1.25k]
  ------------------
 2030|   160k|	state = ctxt->states[statenr];
 2031|   160k|	if (state == NULL)
  ------------------
  |  Branch (2031:6): [True: 0, False: 160k]
  ------------------
 2032|      0|	    continue;
 2033|   160k|	if (state->nbTrans != 1)
  ------------------
  |  Branch (2033:6): [True: 63.3k, False: 96.8k]
  ------------------
 2034|  63.3k|	    continue;
 2035|  96.8k|       if (state->type == XML_REGEXP_UNREACH_STATE ||
  ------------------
  |  Branch (2035:12): [True: 0, False: 96.8k]
  ------------------
 2036|  96.8k|           state->type == XML_REGEXP_FINAL_STATE)
  ------------------
  |  Branch (2036:12): [True: 164, False: 96.6k]
  ------------------
 2037|    164|	    continue;
 2038|       |	/* is the only transition out a basic transition */
 2039|  96.6k|	if ((state->trans[0].atom == NULL) &&
  ------------------
  |  Branch (2039:6): [True: 62.6k, False: 33.9k]
  ------------------
 2040|  62.6k|	    (state->trans[0].to >= 0) &&
  ------------------
  |  Branch (2040:6): [True: 62.6k, False: 11]
  ------------------
 2041|  62.6k|	    (state->trans[0].to != statenr) &&
  ------------------
  |  Branch (2041:6): [True: 62.6k, False: 0]
  ------------------
 2042|  62.6k|	    (state->trans[0].counter < 0) &&
  ------------------
  |  Branch (2042:6): [True: 62.6k, False: 0]
  ------------------
 2043|  62.6k|	    (state->trans[0].count < 0)) {
  ------------------
  |  Branch (2043:6): [True: 62.6k, False: 0]
  ------------------
 2044|  62.6k|	    newto = state->trans[0].to;
 2045|       |
 2046|  62.6k|            if (state->type == XML_REGEXP_START_STATE) {
  ------------------
  |  Branch (2046:17): [True: 669, False: 62.0k]
  ------------------
 2047|  62.0k|            } else {
 2048|   156k|	        for (i = 0;i < state->nbTransTo;i++) {
  ------------------
  |  Branch (2048:21): [True: 94.9k, False: 62.0k]
  ------------------
 2049|  94.9k|		    tmp = ctxt->states[state->transTo[i]];
 2050|  43.6M|		    for (j = 0;j < tmp->nbTrans;j++) {
  ------------------
  |  Branch (2050:18): [True: 43.5M, False: 94.9k]
  ------------------
 2051|  43.5M|			if (tmp->trans[j].to == statenr) {
  ------------------
  |  Branch (2051:8): [True: 90.2k, False: 43.4M]
  ------------------
 2052|  90.2k|			    tmp->trans[j].to = -1;
 2053|  90.2k|			    xmlRegStateAddTrans(ctxt, tmp, tmp->trans[j].atom,
 2054|  90.2k|						ctxt->states[newto],
 2055|  90.2k|					        tmp->trans[j].counter,
 2056|  90.2k|						tmp->trans[j].count);
 2057|  90.2k|			}
 2058|  43.5M|		    }
 2059|  94.9k|		}
 2060|  62.0k|		if (state->type == XML_REGEXP_FINAL_STATE)
  ------------------
  |  Branch (2060:7): [True: 0, False: 62.0k]
  ------------------
 2061|      0|		    ctxt->states[newto]->type = XML_REGEXP_FINAL_STATE;
 2062|       |		/* eliminate the transition completely */
 2063|  62.0k|		state->nbTrans = 0;
 2064|       |
 2065|  62.0k|                state->type = XML_REGEXP_UNREACH_STATE;
 2066|       |
 2067|  62.0k|	    }
 2068|       |
 2069|  62.6k|	}
 2070|  96.6k|    }
 2071|  1.25k|}
xmlregexp.c:xmlFAReduceEpsilonTransitions:
 1928|   171k|	                      int tonr, int counter) {
 1929|   171k|    int transnr;
 1930|   171k|    xmlRegStatePtr from;
 1931|   171k|    xmlRegStatePtr to;
 1932|       |
 1933|   171k|    from = ctxt->states[fromnr];
 1934|   171k|    if (from == NULL)
  ------------------
  |  Branch (1934:9): [True: 0, False: 171k]
  ------------------
 1935|      0|	return;
 1936|   171k|    to = ctxt->states[tonr];
 1937|   171k|    if (to == NULL)
  ------------------
  |  Branch (1937:9): [True: 89, False: 171k]
  ------------------
 1938|     89|	return;
 1939|   171k|    if ((to->mark == XML_REGEXP_MARK_START) ||
  ------------------
  |  Branch (1939:9): [True: 0, False: 171k]
  ------------------
 1940|   171k|	(to->mark == XML_REGEXP_MARK_VISITED))
  ------------------
  |  Branch (1940:2): [True: 31.4k, False: 140k]
  ------------------
 1941|  31.4k|	return;
 1942|       |
 1943|   140k|    to->mark = XML_REGEXP_MARK_VISITED;
 1944|   140k|    if (to->type == XML_REGEXP_FINAL_STATE) {
  ------------------
  |  Branch (1944:9): [True: 43.6k, False: 96.4k]
  ------------------
 1945|  43.6k|	from->type = XML_REGEXP_FINAL_STATE;
 1946|  43.6k|    }
 1947|  6.90M|    for (transnr = 0;transnr < to->nbTrans;transnr++) {
  ------------------
  |  Branch (1947:22): [True: 6.76M, False: 140k]
  ------------------
 1948|  6.76M|        xmlRegTransPtr t1 = &to->trans[transnr];
 1949|  6.76M|        int tcounter;
 1950|       |
 1951|  6.76M|        if (t1->to < 0)
  ------------------
  |  Branch (1951:13): [True: 417k, False: 6.34M]
  ------------------
 1952|   417k|	    continue;
 1953|  6.34M|        if (t1->counter >= 0) {
  ------------------
  |  Branch (1953:13): [True: 0, False: 6.34M]
  ------------------
 1954|       |            /* assert(counter < 0); */
 1955|      0|            tcounter = t1->counter;
 1956|  6.34M|        } else {
 1957|  6.34M|            tcounter = counter;
 1958|  6.34M|        }
 1959|  6.34M|	if (t1->atom == NULL) {
  ------------------
  |  Branch (1959:6): [True: 107k, False: 6.24M]
  ------------------
 1960|       |	    /*
 1961|       |	     * Don't remove counted transitions
 1962|       |	     * Don't loop either
 1963|       |	     */
 1964|   107k|	    if (t1->to != fromnr) {
  ------------------
  |  Branch (1964:10): [True: 106k, False: 1.09k]
  ------------------
 1965|   106k|		if (t1->count >= 0) {
  ------------------
  |  Branch (1965:7): [True: 0, False: 106k]
  ------------------
 1966|      0|		    xmlRegStateAddTrans(ctxt, from, NULL, ctxt->states[t1->to],
 1967|      0|					-1, t1->count);
 1968|   106k|		} else {
 1969|   106k|                    xmlFAReduceEpsilonTransitions(ctxt, fromnr, t1->to,
 1970|   106k|                                                  tcounter);
 1971|   106k|		}
 1972|   106k|	    }
 1973|  6.24M|	} else {
 1974|  6.24M|            xmlRegStateAddTrans(ctxt, from, t1->atom,
 1975|  6.24M|                                ctxt->states[t1->to], tcounter, -1);
 1976|  6.24M|	}
 1977|  6.34M|    }
 1978|   140k|}
xmlregexp.c:xmlFAFinishReduceEpsilonTransitions:
 1985|   172k|xmlFAFinishReduceEpsilonTransitions(xmlRegParserCtxtPtr ctxt, int tonr) {
 1986|   172k|    int transnr;
 1987|   172k|    xmlRegStatePtr to;
 1988|       |
 1989|   172k|    to = ctxt->states[tonr];
 1990|   172k|    if (to == NULL)
  ------------------
  |  Branch (1990:9): [True: 89, False: 172k]
  ------------------
 1991|     89|	return;
 1992|   172k|    if ((to->mark == XML_REGEXP_MARK_START) ||
  ------------------
  |  Branch (1992:9): [True: 1.09k, False: 171k]
  ------------------
 1993|   171k|	(to->mark == XML_REGEXP_MARK_NORMAL))
  ------------------
  |  Branch (1993:2): [True: 31.4k, False: 140k]
  ------------------
 1994|  32.5k|	return;
 1995|       |
 1996|   140k|    to->mark = XML_REGEXP_MARK_NORMAL;
 1997|  6.90M|    for (transnr = 0;transnr < to->nbTrans;transnr++) {
  ------------------
  |  Branch (1997:22): [True: 6.76M, False: 140k]
  ------------------
 1998|  6.76M|	xmlRegTransPtr t1 = &to->trans[transnr];
 1999|  6.76M|	if ((t1->to >= 0) && (t1->atom == NULL))
  ------------------
  |  Branch (1999:6): [True: 6.34M, False: 417k]
  |  Branch (1999:23): [True: 107k, False: 6.24M]
  ------------------
 2000|   107k|            xmlFAFinishReduceEpsilonTransitions(ctxt, t1->to);
 2001|  6.76M|    }
 2002|   140k|}
xmlregexp.c:xmlRegEpxFromParse:
  503|  1.16k|xmlRegEpxFromParse(xmlRegParserCtxtPtr ctxt) {
  504|  1.16k|    xmlRegexpPtr ret;
  505|       |
  506|  1.16k|    ret = (xmlRegexpPtr) xmlMalloc(sizeof(xmlRegexp));
  507|  1.16k|    if (ret == NULL) {
  ------------------
  |  Branch (507:9): [True: 7, False: 1.15k]
  ------------------
  508|      7|	xmlRegexpErrMemory(ctxt);
  509|      7|	return(NULL);
  510|      7|    }
  511|  1.15k|    memset(ret, 0, sizeof(xmlRegexp));
  512|  1.15k|    ret->string = ctxt->string;
  513|  1.15k|    ret->nbStates = ctxt->nbStates;
  514|  1.15k|    ret->states = ctxt->states;
  515|  1.15k|    ret->nbAtoms = ctxt->nbAtoms;
  516|  1.15k|    ret->atoms = ctxt->atoms;
  517|  1.15k|    ret->nbCounters = ctxt->nbCounters;
  518|  1.15k|    ret->counters = ctxt->counters;
  519|  1.15k|    ret->determinist = ctxt->determinist;
  520|  1.15k|    ret->flags = ctxt->flags;
  521|  1.15k|    if (ret->determinist == -1) {
  ------------------
  |  Branch (521:9): [True: 1.15k, False: 0]
  ------------------
  522|  1.15k|        if (xmlRegexpIsDeterminist(ret) < 0) {
  ------------------
  |  Branch (522:13): [True: 12, False: 1.14k]
  ------------------
  523|     12|            xmlRegexpErrMemory(ctxt);
  524|     12|            xmlFree(ret);
  525|     12|            return(NULL);
  526|     12|        }
  527|  1.15k|    }
  528|       |
  529|  1.14k|    if ((ret->determinist != 0) &&
  ------------------
  |  Branch (529:9): [True: 803, False: 342]
  ------------------
  530|    803|	(ret->nbCounters == 0) &&
  ------------------
  |  Branch (530:2): [True: 803, False: 0]
  ------------------
  531|    803|	(ctxt->negs == 0) &&
  ------------------
  |  Branch (531:2): [True: 803, False: 0]
  ------------------
  532|    803|	(ret->atoms != NULL) &&
  ------------------
  |  Branch (532:2): [True: 803, False: 0]
  ------------------
  533|    803|	(ret->atoms[0] != NULL) &&
  ------------------
  |  Branch (533:2): [True: 803, False: 0]
  ------------------
  534|    803|	(ret->atoms[0]->type == XML_REGEXP_STRING)) {
  ------------------
  |  Branch (534:2): [True: 803, False: 0]
  ------------------
  535|    803|	int i, j, nbstates = 0, nbatoms = 0;
  536|    803|	int *stateRemap;
  537|    803|	int *stringRemap;
  538|    803|	int *transitions;
  539|    803|	void **transdata;
  540|    803|	xmlChar **stringMap;
  541|    803|        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|    803|	stateRemap = xmlMalloc(ret->nbStates * sizeof(int));
  552|    803|	if (stateRemap == NULL) {
  ------------------
  |  Branch (552:6): [True: 4, False: 799]
  ------------------
  553|      4|	    xmlRegexpErrMemory(ctxt);
  554|      4|	    xmlFree(ret);
  555|      4|	    return(NULL);
  556|      4|	}
  557|  15.3k|	for (i = 0;i < ret->nbStates;i++) {
  ------------------
  |  Branch (557:13): [True: 14.5k, False: 799]
  ------------------
  558|  14.5k|	    if (ret->states[i] != NULL) {
  ------------------
  |  Branch (558:10): [True: 11.1k, False: 3.31k]
  ------------------
  559|  11.1k|		stateRemap[i] = nbstates;
  560|  11.1k|		nbstates++;
  561|  11.1k|	    } else {
  562|  3.31k|		stateRemap[i] = -1;
  563|  3.31k|	    }
  564|  14.5k|	}
  565|    799|	stringMap = xmlMalloc(ret->nbAtoms * sizeof(char *));
  566|    799|	if (stringMap == NULL) {
  ------------------
  |  Branch (566:6): [True: 7, False: 792]
  ------------------
  567|      7|	    xmlRegexpErrMemory(ctxt);
  568|      7|	    xmlFree(stateRemap);
  569|      7|	    xmlFree(ret);
  570|      7|	    return(NULL);
  571|      7|	}
  572|    792|	stringRemap = xmlMalloc(ret->nbAtoms * sizeof(int));
  573|    792|	if (stringRemap == NULL) {
  ------------------
  |  Branch (573:6): [True: 5, False: 787]
  ------------------
  574|      5|	    xmlRegexpErrMemory(ctxt);
  575|      5|	    xmlFree(stringMap);
  576|      5|	    xmlFree(stateRemap);
  577|      5|	    xmlFree(ret);
  578|      5|	    return(NULL);
  579|      5|	}
  580|  14.6k|	for (i = 0;i < ret->nbAtoms;i++) {
  ------------------
  |  Branch (580:13): [True: 13.9k, False: 757]
  ------------------
  581|  13.9k|	    if ((ret->atoms[i]->type == XML_REGEXP_STRING) &&
  ------------------
  |  Branch (581:10): [True: 13.9k, False: 0]
  ------------------
  582|  13.9k|		(ret->atoms[i]->quant == XML_REGEXP_QUANT_ONCE)) {
  ------------------
  |  Branch (582:3): [True: 13.9k, False: 0]
  ------------------
  583|  13.9k|		value = ret->atoms[i]->valuep;
  584|   153k|                for (j = 0;j < nbatoms;j++) {
  ------------------
  |  Branch (584:28): [True: 150k, False: 3.07k]
  ------------------
  585|   150k|		    if (xmlStrEqual(stringMap[j], value)) {
  ------------------
  |  Branch (585:11): [True: 10.8k, False: 139k]
  ------------------
  586|  10.8k|			stringRemap[i] = j;
  587|  10.8k|			break;
  588|  10.8k|		    }
  589|   150k|		}
  590|  13.9k|		if (j >= nbatoms) {
  ------------------
  |  Branch (590:7): [True: 3.07k, False: 10.8k]
  ------------------
  591|  3.07k|		    stringRemap[i] = nbatoms;
  592|  3.07k|		    stringMap[nbatoms] = xmlStrdup(value);
  593|  3.07k|		    if (stringMap[nbatoms] == NULL) {
  ------------------
  |  Branch (593:11): [True: 30, False: 3.04k]
  ------------------
  594|    152|			for (i = 0;i < nbatoms;i++)
  ------------------
  |  Branch (594:15): [True: 122, False: 30]
  ------------------
  595|    122|			    xmlFree(stringMap[i]);
  596|     30|			xmlFree(stringRemap);
  597|     30|			xmlFree(stringMap);
  598|     30|			xmlFree(stateRemap);
  599|     30|			xmlFree(ret);
  600|     30|			return(NULL);
  601|     30|		    }
  602|  3.04k|		    nbatoms++;
  603|  3.04k|		}
  604|  13.9k|	    } 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.9k|	}
  614|    757|	transitions = (int *) xmlRegCalloc2(nbstates + 1, nbatoms + 1,
  615|    757|                                            sizeof(int));
  616|    757|	if (transitions == NULL) {
  ------------------
  |  Branch (616:6): [True: 14, False: 743]
  ------------------
  617|     14|	    xmlFree(stateRemap);
  618|     14|	    xmlFree(stringRemap);
  619|    111|            for (i = 0;i < nbatoms;i++)
  ------------------
  |  Branch (619:24): [True: 97, False: 14]
  ------------------
  620|     97|		xmlFree(stringMap[i]);
  621|     14|	    xmlFree(stringMap);
  622|     14|	    xmlFree(ret);
  623|     14|	    return(NULL);
  624|     14|	}
  625|       |
  626|       |	/*
  627|       |	 * Allocate the transition table. The first entry for each
  628|       |	 * state corresponds to the state type.
  629|       |	 */
  630|    743|	transdata = NULL;
  631|       |
  632|  14.6k|	for (i = 0;i < ret->nbStates;i++) {
  ------------------
  |  Branch (632:13): [True: 13.8k, False: 743]
  ------------------
  633|  13.8k|	    int stateno, atomno, targetno, prev;
  634|  13.8k|	    xmlRegStatePtr state;
  635|  13.8k|	    xmlRegTransPtr trans;
  636|       |
  637|  13.8k|	    stateno = stateRemap[i];
  638|  13.8k|	    if (stateno == -1)
  ------------------
  |  Branch (638:10): [True: 2.99k, False: 10.8k]
  ------------------
  639|  2.99k|		continue;
  640|  10.8k|	    state = ret->states[i];
  641|       |
  642|  10.8k|	    transitions[stateno * (nbatoms + 1)] = state->type;
  643|       |
  644|  33.3k|	    for (j = 0;j < state->nbTrans;j++) {
  ------------------
  |  Branch (644:17): [True: 22.4k, False: 10.8k]
  ------------------
  645|  22.4k|		trans = &(state->trans[j]);
  646|  22.4k|		if ((trans->to < 0) || (trans->atom == NULL))
  ------------------
  |  Branch (646:7): [True: 6.03k, False: 16.4k]
  |  Branch (646:26): [True: 0, False: 16.4k]
  ------------------
  647|  6.03k|		    continue;
  648|  16.4k|                atomno = stringRemap[trans->atom->no];
  649|  16.4k|		if ((trans->atom->data != NULL) && (transdata == NULL)) {
  ------------------
  |  Branch (649:7): [True: 0, False: 16.4k]
  |  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|  16.4k|		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|  16.4k|		prev = transitions[stateno * (nbatoms + 1) + atomno + 1];
  664|  16.4k|		if (prev != 0) {
  ------------------
  |  Branch (664:7): [True: 0, False: 16.4k]
  ------------------
  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|  16.4k|		} else {
  678|  16.4k|		    transitions[stateno * (nbatoms + 1) + atomno + 1] =
  679|  16.4k|			targetno + 1; /* to avoid 0 */
  680|  16.4k|		    if (transdata != NULL)
  ------------------
  |  Branch (680:11): [True: 0, False: 16.4k]
  ------------------
  681|      0|			transdata[stateno * nbatoms + atomno] =
  682|      0|			    trans->atom->data;
  683|  16.4k|		}
  684|  16.4k|	    }
  685|  10.8k|	}
  686|    743|	ret->determinist = 1;
  687|       |	/*
  688|       |	 * Cleanup of the old data
  689|       |	 */
  690|    743|	if (ret->states != NULL) {
  ------------------
  |  Branch (690:6): [True: 743, False: 0]
  ------------------
  691|  14.6k|	    for (i = 0;i < ret->nbStates;i++)
  ------------------
  |  Branch (691:17): [True: 13.8k, False: 743]
  ------------------
  692|  13.8k|		xmlRegFreeState(ret->states[i]);
  693|    743|	    xmlFree(ret->states);
  694|    743|	}
  695|    743|	ret->states = NULL;
  696|    743|	ret->nbStates = 0;
  697|    743|	if (ret->atoms != NULL) {
  ------------------
  |  Branch (697:6): [True: 743, False: 0]
  ------------------
  698|  14.3k|	    for (i = 0;i < ret->nbAtoms;i++)
  ------------------
  |  Branch (698:17): [True: 13.5k, False: 743]
  ------------------
  699|  13.5k|		xmlRegFreeAtom(ret->atoms[i]);
  700|    743|	    xmlFree(ret->atoms);
  701|    743|	}
  702|    743|	ret->atoms = NULL;
  703|    743|	ret->nbAtoms = 0;
  704|       |
  705|    743|	ret->compact = transitions;
  706|    743|	ret->transdata = transdata;
  707|    743|	ret->stringMap = stringMap;
  708|    743|	ret->nbstrings = nbatoms;
  709|    743|	ret->nbstates = nbstates;
  710|    743|	xmlFree(stateRemap);
  711|    743|	xmlFree(stringRemap);
  712|    743|    }
  713|  1.08k|not_determ:
  714|  1.08k|    ctxt->string = NULL;
  715|  1.08k|    ctxt->nbStates = 0;
  716|  1.08k|    ctxt->states = NULL;
  717|  1.08k|    ctxt->nbAtoms = 0;
  718|  1.08k|    ctxt->atoms = NULL;
  719|  1.08k|    ctxt->nbCounters = 0;
  720|       |    ctxt->counters = NULL;
  721|  1.08k|    return(ret);
  722|  1.14k|}
xmlregexp.c:xmlRegCalloc2:
  478|    757|xmlRegCalloc2(size_t dim1, size_t dim2, size_t elemSize) {
  479|    757|    size_t numElems, totalSize;
  480|    757|    void *ret;
  481|       |
  482|       |    /* Check for overflow */
  483|    757|    if ((dim2 == 0) || (elemSize == 0) ||
  ------------------
  |  Branch (483:9): [True: 0, False: 757]
  |  Branch (483:24): [True: 0, False: 757]
  ------------------
  484|    757|        (dim1 > SIZE_MAX / dim2 / elemSize))
  ------------------
  |  Branch (484:9): [True: 0, False: 757]
  ------------------
  485|      0|        return (NULL);
  486|    757|    numElems = dim1 * dim2;
  487|    757|    if (numElems > XML_MAX_ITEMS)
  ------------------
  |  |   13|    757|#define XML_MAX_ITEMS 1000000000 /* 1 billion */
  ------------------
  |  Branch (487:9): [True: 0, False: 757]
  ------------------
  488|      0|        return NULL;
  489|    757|    totalSize = numElems * elemSize;
  490|    757|    ret = xmlMalloc(totalSize);
  491|    757|    if (ret != NULL)
  ------------------
  |  Branch (491:9): [True: 743, False: 14]
  ------------------
  492|    743|        memset(ret, 0, totalSize);
  493|    757|    return (ret);
  494|    757|}
xmlregexp.c:xmlRegFreeParserCtxt:
  956|  2.69k|xmlRegFreeParserCtxt(xmlRegParserCtxtPtr ctxt) {
  957|  2.69k|    int i;
  958|  2.69k|    if (ctxt == NULL)
  ------------------
  |  Branch (958:9): [True: 0, False: 2.69k]
  ------------------
  959|      0|	return;
  960|       |
  961|  2.69k|    if (ctxt->string != NULL)
  ------------------
  |  Branch (961:9): [True: 0, False: 2.69k]
  ------------------
  962|      0|	xmlFree(ctxt->string);
  963|  2.69k|    if (ctxt->states != NULL) {
  ------------------
  |  Branch (963:9): [True: 460, False: 2.23k]
  ------------------
  964|   113k|	for (i = 0;i < ctxt->nbStates;i++)
  ------------------
  |  Branch (964:13): [True: 112k, False: 460]
  ------------------
  965|   112k|	    xmlRegFreeState(ctxt->states[i]);
  966|    460|	xmlFree(ctxt->states);
  967|    460|    }
  968|  2.69k|    if (ctxt->atoms != NULL) {
  ------------------
  |  Branch (968:9): [True: 435, False: 2.26k]
  ------------------
  969|  66.4k|	for (i = 0;i < ctxt->nbAtoms;i++)
  ------------------
  |  Branch (969:13): [True: 66.0k, False: 435]
  ------------------
  970|  66.0k|	    xmlRegFreeAtom(ctxt->atoms[i]);
  971|    435|	xmlFree(ctxt->atoms);
  972|    435|    }
  973|  2.69k|    if (ctxt->counters != NULL)
  ------------------
  |  Branch (973:9): [True: 0, False: 2.69k]
  ------------------
  974|      0|	xmlFree(ctxt->counters);
  975|  2.69k|    xmlFree(ctxt);
  976|  2.69k|}
xmlregexp.c:xmlRegFreeState:
  939|   348k|xmlRegFreeState(xmlRegStatePtr state) {
  940|   348k|    if (state == NULL)
  ------------------
  |  Branch (940:9): [True: 77.7k, False: 271k]
  ------------------
  941|  77.7k|	return;
  942|       |
  943|   271k|    if (state->trans != NULL)
  ------------------
  |  Branch (943:9): [True: 267k, False: 3.31k]
  ------------------
  944|   267k|	xmlFree(state->trans);
  945|   271k|    if (state->transTo != NULL)
  ------------------
  |  Branch (945:9): [True: 268k, False: 2.73k]
  ------------------
  946|   268k|	xmlFree(state->transTo);
  947|   271k|    xmlFree(state);
  948|   271k|}
xmlregexp.c:xmlFAComputesDeterminism:
 2803|  1.14k|xmlFAComputesDeterminism(xmlRegParserCtxtPtr ctxt) {
 2804|  1.14k|    int statenr, transnr;
 2805|  1.14k|    xmlRegStatePtr state;
 2806|  1.14k|    xmlRegTransPtr t1, t2, last;
 2807|  1.14k|    int i;
 2808|  1.14k|    int ret = 1;
 2809|  1.14k|    int deep = 1;
 2810|       |
 2811|  1.14k|    if (ctxt->determinist != -1)
  ------------------
  |  Branch (2811:9): [True: 0, False: 1.14k]
  ------------------
 2812|      0|	return(ctxt->determinist);
 2813|       |
 2814|  1.14k|    if (ctxt->flags & AM_AUTOMATA_RNG)
  ------------------
  |  |  288|  1.14k|#define AM_AUTOMATA_RNG 1
  ------------------
  |  Branch (2814:9): [True: 0, False: 1.14k]
  ------------------
 2815|      0|        deep = 0;
 2816|       |
 2817|       |    /*
 2818|       |     * First cleanup the automata removing cancelled transitions
 2819|       |     */
 2820|   159k|    for (statenr = 0;statenr < ctxt->nbStates;statenr++) {
  ------------------
  |  Branch (2820:22): [True: 158k, False: 1.14k]
  ------------------
 2821|   158k|	state = ctxt->states[statenr];
 2822|   158k|	if (state == NULL)
  ------------------
  |  Branch (2822:6): [True: 76.9k, False: 81.2k]
  ------------------
 2823|  76.9k|	    continue;
 2824|  81.2k|	if (state->nbTrans < 2)
  ------------------
  |  Branch (2824:6): [True: 33.0k, False: 48.1k]
  ------------------
 2825|  33.0k|	    continue;
 2826|   934k|	for (transnr = 0;transnr < state->nbTrans;transnr++) {
  ------------------
  |  Branch (2826:19): [True: 886k, False: 48.1k]
  ------------------
 2827|   886k|	    t1 = &(state->trans[transnr]);
 2828|       |	    /*
 2829|       |	     * Determinism checks in case of counted or all transitions
 2830|       |	     * will have to be handled separately
 2831|       |	     */
 2832|   886k|	    if (t1->atom == NULL) {
  ------------------
  |  Branch (2832:10): [True: 83.3k, False: 802k]
  ------------------
 2833|       |		/* t1->nd = 1; */
 2834|  83.3k|		continue;
 2835|  83.3k|	    }
 2836|   802k|	    if (t1->to < 0) /* eliminated */
  ------------------
  |  Branch (2836:10): [True: 15.3k, False: 787k]
  ------------------
 2837|  15.3k|		continue;
 2838|   272M|	    for (i = 0;i < transnr;i++) {
  ------------------
  |  Branch (2838:17): [True: 271M, False: 787k]
  ------------------
 2839|   271M|		t2 = &(state->trans[i]);
 2840|   271M|		if (t2->to < 0) /* eliminated */
  ------------------
  |  Branch (2840:7): [True: 221M, False: 50.5M]
  ------------------
 2841|   221M|		    continue;
 2842|  50.5M|		if (t2->atom != NULL) {
  ------------------
  |  Branch (2842:7): [True: 50.5M, False: 0]
  ------------------
 2843|  50.5M|		    if (t1->to == t2->to) {
  ------------------
  |  Branch (2843:11): [True: 7.79M, False: 42.7M]
  ------------------
 2844|       |                        /*
 2845|       |                         * Here we use deep because we want to keep the
 2846|       |                         * transitions which indicate a conflict
 2847|       |                         */
 2848|  7.79M|			if (xmlFAEqualAtoms(t1->atom, t2->atom, deep) &&
  ------------------
  |  Branch (2848:8): [True: 174k, False: 7.61M]
  ------------------
 2849|   174k|                            (t1->counter == t2->counter) &&
  ------------------
  |  Branch (2849:29): [True: 174k, False: 0]
  ------------------
 2850|   174k|                            (t1->count == t2->count))
  ------------------
  |  Branch (2850:29): [True: 174k, False: 0]
  ------------------
 2851|   174k|			    t2->to = -1; /* eliminated */
 2852|  7.79M|		    }
 2853|  50.5M|		}
 2854|  50.5M|	    }
 2855|   787k|	}
 2856|  48.1k|    }
 2857|       |
 2858|       |    /*
 2859|       |     * Check for all states that there aren't 2 transitions
 2860|       |     * with the same atom and a different target.
 2861|       |     */
 2862|   159k|    for (statenr = 0;statenr < ctxt->nbStates;statenr++) {
  ------------------
  |  Branch (2862:22): [True: 158k, False: 1.14k]
  ------------------
 2863|   158k|	state = ctxt->states[statenr];
 2864|   158k|	if (state == NULL)
  ------------------
  |  Branch (2864:6): [True: 76.9k, False: 81.2k]
  ------------------
 2865|  76.9k|	    continue;
 2866|  81.2k|	if (state->nbTrans < 2)
  ------------------
  |  Branch (2866:6): [True: 33.0k, False: 48.1k]
  ------------------
 2867|  33.0k|	    continue;
 2868|  48.1k|	last = NULL;
 2869|   934k|	for (transnr = 0;transnr < state->nbTrans;transnr++) {
  ------------------
  |  Branch (2869:19): [True: 886k, False: 48.1k]
  ------------------
 2870|   886k|	    t1 = &(state->trans[transnr]);
 2871|       |	    /*
 2872|       |	     * Determinism checks in case of counted or all transitions
 2873|       |	     * will have to be handled separately
 2874|       |	     */
 2875|   886k|	    if (t1->atom == NULL) {
  ------------------
  |  Branch (2875:10): [True: 83.3k, False: 802k]
  ------------------
 2876|  83.3k|		continue;
 2877|  83.3k|	    }
 2878|   802k|	    if (t1->to < 0) /* eliminated */
  ------------------
  |  Branch (2878:10): [True: 189k, False: 612k]
  ------------------
 2879|   189k|		continue;
 2880|  48.9M|	    for (i = 0;i < transnr;i++) {
  ------------------
  |  Branch (2880:17): [True: 48.3M, False: 612k]
  ------------------
 2881|  48.3M|		t2 = &(state->trans[i]);
 2882|  48.3M|		if (t2->to < 0) /* eliminated */
  ------------------
  |  Branch (2882:7): [True: 9.87M, False: 38.4M]
  ------------------
 2883|  9.87M|		    continue;
 2884|  38.4M|		if (t2->atom != NULL) {
  ------------------
  |  Branch (2884:7): [True: 38.4M, False: 0]
  ------------------
 2885|       |                    /*
 2886|       |                     * But here we don't use deep because we want to
 2887|       |                     * find transitions which indicate a conflict
 2888|       |                     */
 2889|  38.4M|		    if (xmlFACompareAtoms(t1->atom, t2->atom, 1)) {
  ------------------
  |  Branch (2889:11): [True: 9.59M, False: 28.8M]
  ------------------
 2890|       |                        /*
 2891|       |                         * Treat equal counter transitions that couldn't be
 2892|       |                         * eliminated as deterministic.
 2893|       |                         */
 2894|  9.59M|                        if ((t1->to != t2->to) ||
  ------------------
  |  Branch (2894:29): [True: 9.59M, 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|  9.59M|                            ret = 0;
 2898|       |			/* mark the transitions as non-deterministic ones */
 2899|  9.59M|			t1->nd = 1;
 2900|  9.59M|			t2->nd = 1;
 2901|  9.59M|			last = t1;
 2902|  9.59M|		    }
 2903|  38.4M|		} 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|  38.4M|	    }
 2926|       |	    /* don't shortcut the computation so all non deterministic
 2927|       |	       transition get marked down
 2928|       |	    if (ret == 0)
 2929|       |		break; */
 2930|   612k|	}
 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|  48.1k|	if (last != NULL) {
  ------------------
  |  Branch (2937:6): [True: 29.1k, False: 19.0k]
  ------------------
 2938|  29.1k|	    last->nd = 2;
 2939|  29.1k|	}
 2940|       |
 2941|       |	/* don't shortcut the computation so all non deterministic
 2942|       |	   transition get marked down
 2943|       |	if (ret == 0)
 2944|       |	    break; */
 2945|  48.1k|    }
 2946|       |
 2947|  1.14k|    ctxt->determinist = ret;
 2948|  1.14k|    return(ret);
 2949|  1.14k|}
xmlregexp.c:xmlFAEqualAtoms:
 2581|  7.79M|xmlFAEqualAtoms(xmlRegAtomPtr atom1, xmlRegAtomPtr atom2, int deep) {
 2582|  7.79M|    int ret = 0;
 2583|       |
 2584|  7.79M|    if (atom1 == atom2)
  ------------------
  |  Branch (2584:9): [True: 0, False: 7.79M]
  ------------------
 2585|      0|	return(1);
 2586|  7.79M|    if ((atom1 == NULL) || (atom2 == NULL))
  ------------------
  |  Branch (2586:9): [True: 0, False: 7.79M]
  |  Branch (2586:28): [True: 0, False: 7.79M]
  ------------------
 2587|      0|	return(0);
 2588|       |
 2589|  7.79M|    if (atom1->type != atom2->type)
  ------------------
  |  Branch (2589:9): [True: 0, False: 7.79M]
  ------------------
 2590|      0|        return(0);
 2591|  7.79M|    switch (atom1->type) {
 2592|      0|        case XML_REGEXP_EPSILON:
  ------------------
  |  Branch (2592:9): [True: 0, False: 7.79M]
  ------------------
 2593|      0|	    ret = 0;
 2594|      0|	    break;
 2595|  7.79M|        case XML_REGEXP_STRING:
  ------------------
  |  Branch (2595:9): [True: 7.79M, False: 0]
  ------------------
 2596|  7.79M|            if (!deep)
  ------------------
  |  Branch (2596:17): [True: 0, False: 7.79M]
  ------------------
 2597|      0|                ret = (atom1->valuep == atom2->valuep);
 2598|  7.79M|            else
 2599|  7.79M|                ret = xmlStrEqual((xmlChar *)atom1->valuep,
 2600|  7.79M|                                  (xmlChar *)atom2->valuep);
 2601|  7.79M|	    break;
 2602|      0|        case XML_REGEXP_CHARVAL:
  ------------------
  |  Branch (2602:9): [True: 0, False: 7.79M]
  ------------------
 2603|      0|	    ret = (atom1->codepoint == atom2->codepoint);
 2604|      0|	    break;
 2605|      0|	case XML_REGEXP_RANGES:
  ------------------
  |  Branch (2605:2): [True: 0, False: 7.79M]
  ------------------
 2606|       |	    /* too hard to do in the general case */
 2607|      0|	    ret = 0;
 2608|      0|	default:
  ------------------
  |  Branch (2608:2): [True: 0, False: 7.79M]
  ------------------
 2609|      0|	    break;
 2610|  7.79M|    }
 2611|  7.79M|    return(ret);
 2612|  7.79M|}
xmlregexp.c:xmlFACompareAtoms:
 2624|  38.4M|xmlFACompareAtoms(xmlRegAtomPtr atom1, xmlRegAtomPtr atom2, int deep) {
 2625|  38.4M|    int ret = 1;
 2626|       |
 2627|  38.4M|    if (atom1 == atom2)
  ------------------
  |  Branch (2627:9): [True: 0, False: 38.4M]
  ------------------
 2628|      0|	return(1);
 2629|  38.4M|    if ((atom1 == NULL) || (atom2 == NULL))
  ------------------
  |  Branch (2629:9): [True: 0, False: 38.4M]
  |  Branch (2629:28): [True: 0, False: 38.4M]
  ------------------
 2630|      0|	return(0);
 2631|       |
 2632|  38.4M|    if ((atom1->type == XML_REGEXP_ANYCHAR) ||
  ------------------
  |  Branch (2632:9): [True: 0, False: 38.4M]
  ------------------
 2633|  38.4M|        (atom2->type == XML_REGEXP_ANYCHAR))
  ------------------
  |  Branch (2633:9): [True: 0, False: 38.4M]
  ------------------
 2634|      0|	return(1);
 2635|       |
 2636|  38.4M|    if (atom1->type > atom2->type) {
  ------------------
  |  Branch (2636:9): [True: 0, False: 38.4M]
  ------------------
 2637|      0|	xmlRegAtomPtr tmp;
 2638|      0|	tmp = atom1;
 2639|      0|	atom1 = atom2;
 2640|      0|	atom2 = tmp;
 2641|      0|    }
 2642|  38.4M|    if (atom1->type != atom2->type) {
  ------------------
  |  Branch (2642:9): [True: 0, False: 38.4M]
  ------------------
 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|  38.4M|    switch (atom1->type) {
 2649|  38.4M|        case XML_REGEXP_STRING:
  ------------------
  |  Branch (2649:9): [True: 38.4M, False: 0]
  ------------------
 2650|  38.4M|            if (!deep)
  ------------------
  |  Branch (2650:17): [True: 0, False: 38.4M]
  ------------------
 2651|      0|                ret = (atom1->valuep != atom2->valuep);
 2652|  38.4M|            else {
 2653|  38.4M|                xmlChar *val1 = (xmlChar *)atom1->valuep;
 2654|  38.4M|                xmlChar *val2 = (xmlChar *)atom2->valuep;
 2655|  38.4M|                int compound1 = (xmlStrchr(val1, '|') != NULL);
 2656|  38.4M|                int compound2 = (xmlStrchr(val2, '|') != NULL);
 2657|       |
 2658|       |                /* Ignore negative match flag for ##other namespaces */
 2659|  38.4M|                if (compound1 != compound2)
  ------------------
  |  Branch (2659:21): [True: 0, False: 38.4M]
  ------------------
 2660|      0|                    return(0);
 2661|       |
 2662|  38.4M|                ret = xmlRegStrEqualWildcard(val1, val2);
 2663|  38.4M|            }
 2664|  38.4M|	    break;
 2665|  38.4M|        case XML_REGEXP_EPSILON:
  ------------------
  |  Branch (2665:9): [True: 0, False: 38.4M]
  ------------------
 2666|      0|	    goto not_determinist;
 2667|      0|        case XML_REGEXP_CHARVAL:
  ------------------
  |  Branch (2667:9): [True: 0, False: 38.4M]
  ------------------
 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: 38.4M]
  ------------------
 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: 38.4M]
  ------------------
 2699|      0|	    goto not_determinist;
 2700|  38.4M|    }
 2701|  38.4M|done:
 2702|  38.4M|    if (atom1->neg != atom2->neg) {
  ------------------
  |  Branch (2702:9): [True: 0, False: 38.4M]
  ------------------
 2703|      0|        ret = !ret;
 2704|      0|    }
 2705|  38.4M|    if (ret == 0)
  ------------------
  |  Branch (2705:9): [True: 28.8M, False: 9.59M]
  ------------------
 2706|  28.8M|        return(0);
 2707|  9.59M|not_determinist:
 2708|  9.59M|    return(1);
 2709|  38.4M|}
xmlregexp.c:xmlRegFreeAtom:
  855|   183k|xmlRegFreeAtom(xmlRegAtomPtr atom) {
  856|   183k|    int i;
  857|       |
  858|   183k|    if (atom == NULL)
  ------------------
  |  Branch (858:9): [True: 0, False: 183k]
  ------------------
  859|      0|	return;
  860|       |
  861|   183k|    for (i = 0;i < atom->nbRanges;i++)
  ------------------
  |  Branch (861:16): [True: 0, False: 183k]
  ------------------
  862|      0|	xmlRegFreeRange(atom->ranges[i]);
  863|   183k|    if (atom->ranges != NULL)
  ------------------
  |  Branch (863:9): [True: 0, False: 183k]
  ------------------
  864|      0|	xmlFree(atom->ranges);
  865|   183k|    if ((atom->type == XML_REGEXP_STRING) && (atom->valuep != NULL))
  ------------------
  |  Branch (865:9): [True: 183k, False: 0]
  |  Branch (865:46): [True: 183k, False: 26]
  ------------------
  866|   183k|	xmlFree(atom->valuep);
  867|   183k|    if ((atom->type == XML_REGEXP_STRING) && (atom->valuep2 != NULL))
  ------------------
  |  Branch (867:9): [True: 183k, False: 0]
  |  Branch (867:46): [True: 0, False: 183k]
  ------------------
  868|      0|	xmlFree(atom->valuep2);
  869|   183k|    if ((atom->type == XML_REGEXP_BLOCK_NAME) && (atom->valuep != NULL))
  ------------------
  |  Branch (869:9): [True: 0, False: 183k]
  |  Branch (869:50): [True: 0, False: 0]
  ------------------
  870|      0|	xmlFree(atom->valuep);
  871|   183k|    xmlFree(atom);
  872|   183k|}
xmlregexp.c:xmlRegNewAtom:
  833|   183k|xmlRegNewAtom(xmlRegParserCtxtPtr ctxt, xmlRegAtomType type) {
  834|   183k|    xmlRegAtomPtr ret;
  835|       |
  836|   183k|    ret = (xmlRegAtomPtr) xmlMalloc(sizeof(xmlRegAtom));
  837|   183k|    if (ret == NULL) {
  ------------------
  |  Branch (837:9): [True: 33, False: 183k]
  ------------------
  838|     33|	xmlRegexpErrMemory(ctxt);
  839|     33|	return(NULL);
  840|     33|    }
  841|   183k|    memset(ret, 0, sizeof(xmlRegAtom));
  842|   183k|    ret->type = type;
  843|   183k|    ret->quant = XML_REGEXP_QUANT_ONCE;
  844|   183k|    ret->min = 0;
  845|   183k|    ret->max = 0;
  846|   183k|    return(ret);
  847|   183k|}
xmlregexp.c:xmlRegexpErrMemory:
  427|    413|{
  428|    413|    if (ctxt != NULL)
  ------------------
  |  Branch (428:9): [True: 413, False: 0]
  ------------------
  429|    413|        ctxt->error = XML_ERR_NO_MEMORY;
  430|       |
  431|    413|    xmlRaiseMemoryError(NULL, NULL, NULL, XML_FROM_REGEXP, NULL);
  432|    413|}
xmlregexp.c:xmlFAGenerateTransitions:
 1698|   183k|	                 xmlRegStatePtr to, xmlRegAtomPtr atom) {
 1699|   183k|    xmlRegStatePtr end;
 1700|   183k|    int nullable = 0;
 1701|       |
 1702|   183k|    if (atom == NULL) {
  ------------------
  |  Branch (1702:9): [True: 0, False: 183k]
  ------------------
 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|   183k|    if (atom->type == XML_REGEXP_SUBREG) {
  ------------------
  |  Branch (1706:9): [True: 0, False: 183k]
  ------------------
 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|   183k|    if ((atom->min == 0) && (atom->max == 0) &&
  ------------------
  |  Branch (1849:9): [True: 183k, False: 0]
  |  Branch (1849:29): [True: 183k, False: 0]
  ------------------
 1850|   183k|               (atom->quant == XML_REGEXP_QUANT_RANGE)) {
  ------------------
  |  Branch (1850:16): [True: 0, False: 183k]
  ------------------
 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|   183k|    if (to == NULL) {
  ------------------
  |  Branch (1864:9): [True: 162k, False: 20.8k]
  ------------------
 1865|   162k|	to = xmlRegStatePush(ctxt);
 1866|   162k|	if (to == NULL)
  ------------------
  |  Branch (1866:6): [True: 46, False: 162k]
  ------------------
 1867|     46|	    return(-1);
 1868|   162k|    }
 1869|   183k|    end = to;
 1870|   183k|    if ((atom->quant == XML_REGEXP_QUANT_MULT) ||
  ------------------
  |  Branch (1870:9): [True: 0, False: 183k]
  ------------------
 1871|   183k|        (atom->quant == XML_REGEXP_QUANT_PLUS)) {
  ------------------
  |  Branch (1871:9): [True: 0, False: 183k]
  ------------------
 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|   183k|    if ((atom->quant == XML_REGEXP_QUANT_RANGE) &&
  ------------------
  |  Branch (1885:9): [True: 0, False: 183k]
  ------------------
 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|   183k|    xmlRegStateAddTrans(ctxt, from, atom, to, -1, -1);
 1893|   183k|    ctxt->state = end;
 1894|   183k|    switch (atom->quant) {
 1895|      0|	case XML_REGEXP_QUANT_OPT:
  ------------------
  |  Branch (1895:2): [True: 0, False: 183k]
  ------------------
 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: 183k]
  ------------------
 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: 183k]
  ------------------
 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: 183k]
  ------------------
 1909|      0|	    if (nullable)
  ------------------
  |  Branch (1909:10): [True: 0, False: 0]
  ------------------
 1910|      0|		xmlFAGenerateEpsilonTransition(ctxt, from, to);
 1911|      0|	    break;
 1912|   183k|	default:
  ------------------
  |  Branch (1912:2): [True: 183k, False: 0]
  ------------------
 1913|   183k|	    break;
 1914|   183k|    }
 1915|   183k|    if (xmlRegAtomPush(ctxt, atom) < 0)
  ------------------
  |  Branch (1915:9): [True: 18, False: 183k]
  ------------------
 1916|     18|	return(-1);
 1917|   183k|    return(0);
 1918|   183k|}
xmlregexp.c:xmlRegStateAddTrans:
 1521|  6.75M|		    int counter, int count) {
 1522|       |
 1523|  6.75M|    int nrtrans;
 1524|       |
 1525|  6.75M|    if (state == NULL) {
  ------------------
  |  Branch (1525:9): [True: 0, False: 6.75M]
  ------------------
 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|  6.75M|    if (target == NULL) {
  ------------------
  |  Branch (1529:9): [True: 3, False: 6.75M]
  ------------------
 1530|      3|	ERROR("add state: target is NULL");
  ------------------
  |  |   47|      3|    ctxt->error = XML_REGEXP_COMPILE_ERROR;				\
  |  |   48|      3|    xmlRegexpErrCompile(ctxt, str);
  ------------------
 1531|      3|	return;
 1532|      3|    }
 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|   920M|    for (nrtrans = state->nbTrans - 1; nrtrans >= 0; nrtrans--) {
  ------------------
  |  Branch (1539:40): [True: 919M, False: 1.40M]
  ------------------
 1540|   919M|	xmlRegTransPtr trans = &(state->trans[nrtrans]);
 1541|   919M|	if ((trans->atom == atom) &&
  ------------------
  |  Branch (1541:6): [True: 5.68M, False: 913M]
  ------------------
 1542|  5.68M|	    (trans->to == target->no) &&
  ------------------
  |  Branch (1542:6): [True: 5.35M, False: 327k]
  ------------------
 1543|  5.35M|	    (trans->counter == counter) &&
  ------------------
  |  Branch (1543:6): [True: 5.35M, False: 0]
  ------------------
 1544|  5.35M|	    (trans->count == count)) {
  ------------------
  |  Branch (1544:6): [True: 5.35M, False: 0]
  ------------------
 1545|  5.35M|	    return;
 1546|  5.35M|	}
 1547|   919M|    }
 1548|       |
 1549|  1.40M|    if (state->nbTrans >= state->maxTrans) {
  ------------------
  |  Branch (1549:9): [True: 578k, False: 822k]
  ------------------
 1550|   578k|	xmlRegTrans *tmp;
 1551|   578k|        int newSize;
 1552|       |
 1553|   578k|        newSize = xmlGrowCapacity(state->maxTrans, sizeof(tmp[0]),
 1554|   578k|                                  8, XML_MAX_ITEMS);
  ------------------
  |  |   13|   578k|#define XML_MAX_ITEMS 1000000000 /* 1 billion */
  ------------------
 1555|   578k|	if (newSize < 0) {
  ------------------
  |  Branch (1555:6): [True: 0, False: 578k]
  ------------------
 1556|      0|	    xmlRegexpErrMemory(ctxt);
 1557|      0|	    return;
 1558|      0|	}
 1559|   578k|	tmp = xmlRealloc(state->trans, newSize * sizeof(tmp[0]));
 1560|   578k|	if (tmp == NULL) {
  ------------------
  |  Branch (1560:6): [True: 98, False: 578k]
  ------------------
 1561|     98|	    xmlRegexpErrMemory(ctxt);
 1562|     98|	    return;
 1563|     98|	}
 1564|   578k|	state->trans = tmp;
 1565|   578k|	state->maxTrans = newSize;
 1566|   578k|    }
 1567|       |
 1568|  1.40M|    state->trans[state->nbTrans].atom = atom;
 1569|  1.40M|    state->trans[state->nbTrans].to = target->no;
 1570|  1.40M|    state->trans[state->nbTrans].counter = counter;
 1571|  1.40M|    state->trans[state->nbTrans].count = count;
 1572|  1.40M|    state->trans[state->nbTrans].nd = 0;
 1573|  1.40M|    state->nbTrans++;
 1574|  1.40M|    xmlRegStateAddTransTo(ctxt, target, state->no);
 1575|  1.40M|}
xmlregexp.c:xmlRegStateAddTransTo:
 1495|  1.40M|                      int from) {
 1496|  1.40M|    if (target->nbTransTo >= target->maxTransTo) {
  ------------------
  |  Branch (1496:9): [True: 565k, False: 835k]
  ------------------
 1497|   565k|	int *tmp;
 1498|   565k|        int newSize;
 1499|       |
 1500|   565k|        newSize = xmlGrowCapacity(target->maxTransTo, sizeof(tmp[0]),
 1501|   565k|                                  8, XML_MAX_ITEMS);
  ------------------
  |  |   13|   565k|#define XML_MAX_ITEMS 1000000000 /* 1 billion */
  ------------------
 1502|   565k|	if (newSize < 0) {
  ------------------
  |  Branch (1502:6): [True: 0, False: 565k]
  ------------------
 1503|      0|	    xmlRegexpErrMemory(ctxt);
 1504|      0|	    return;
 1505|      0|	}
 1506|   565k|	tmp = xmlRealloc(target->transTo, newSize * sizeof(tmp[0]));
 1507|   565k|	if (tmp == NULL) {
  ------------------
  |  Branch (1507:6): [True: 106, False: 565k]
  ------------------
 1508|    106|	    xmlRegexpErrMemory(ctxt);
 1509|    106|	    return;
 1510|    106|	}
 1511|   565k|	target->transTo = tmp;
 1512|   565k|	target->maxTransTo = newSize;
 1513|   565k|    }
 1514|  1.40M|    target->transTo[target->nbTransTo] = from;
 1515|  1.40M|    target->nbTransTo++;
 1516|  1.40M|}
xmlregexp.c:xmlRegAtomPush:
 1465|   183k|xmlRegAtomPush(xmlRegParserCtxtPtr ctxt, xmlRegAtomPtr atom) {
 1466|   183k|    if (atom == NULL) {
  ------------------
  |  Branch (1466:9): [True: 0, False: 183k]
  ------------------
 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|   183k|    if (ctxt->nbAtoms >= ctxt->maxAtoms) {
  ------------------
  |  Branch (1470:9): [True: 7.66k, False: 176k]
  ------------------
 1471|  7.66k|	xmlRegAtomPtr *tmp;
 1472|  7.66k|        int newSize;
 1473|       |
 1474|  7.66k|        newSize = xmlGrowCapacity(ctxt->maxAtoms, sizeof(tmp[0]),
 1475|  7.66k|                                  4, XML_MAX_ITEMS);
  ------------------
  |  |   13|  7.66k|#define XML_MAX_ITEMS 1000000000 /* 1 billion */
  ------------------
 1476|  7.66k|	if (newSize < 0) {
  ------------------
  |  Branch (1476:6): [True: 0, False: 7.66k]
  ------------------
 1477|      0|	    xmlRegexpErrMemory(ctxt);
 1478|      0|	    return(-1);
 1479|      0|	}
 1480|  7.66k|	tmp = xmlRealloc(ctxt->atoms, newSize * sizeof(tmp[0]));
 1481|  7.66k|	if (tmp == NULL) {
  ------------------
  |  Branch (1481:6): [True: 18, False: 7.64k]
  ------------------
 1482|     18|	    xmlRegexpErrMemory(ctxt);
 1483|     18|	    return(-1);
 1484|     18|	}
 1485|  7.64k|	ctxt->atoms = tmp;
 1486|  7.64k|        ctxt->maxAtoms = newSize;
 1487|  7.64k|    }
 1488|   183k|    atom->no = ctxt->nbAtoms;
 1489|   183k|    ctxt->atoms[ctxt->nbAtoms++] = atom;
 1490|   183k|    return(0);
 1491|   183k|}
xmlregexp.c:xmlFAGenerateEpsilonTransition:
 1640|   240k|			       xmlRegStatePtr from, xmlRegStatePtr to) {
 1641|   240k|    if (to == NULL) {
  ------------------
  |  Branch (1641:9): [True: 77.3k, False: 162k]
  ------------------
 1642|  77.3k|	to = xmlRegStatePush(ctxt);
 1643|  77.3k|        if (to == NULL)
  ------------------
  |  Branch (1643:13): [True: 19, False: 77.3k]
  ------------------
 1644|     19|            return(-1);
 1645|  77.3k|	ctxt->state = to;
 1646|  77.3k|    }
 1647|   240k|    xmlRegStateAddTrans(ctxt, from, NULL, to, -1, -1);
 1648|   240k|    return(0);
 1649|   240k|}

xmlSaveSetIndentString:
  126|  29.4k|xmlSaveSetIndentString(xmlSaveCtxt *ctxt, const char *indent) {
  127|  29.4k|    size_t len;
  128|  29.4k|    int i;
  129|       |
  130|  29.4k|    if ((ctxt == NULL) || (indent == NULL))
  ------------------
  |  Branch (130:9): [True: 0, False: 29.4k]
  |  Branch (130:27): [True: 0, False: 29.4k]
  ------------------
  131|      0|        return(-1);
  132|       |
  133|  29.4k|    len = strlen(indent);
  134|  29.4k|    if ((len <= 0) || (len > MAX_INDENT))
  ------------------
  |  |   20|  29.4k|#define MAX_INDENT 60
  ------------------
  |  Branch (134:9): [True: 0, False: 29.4k]
  |  Branch (134:23): [True: 0, False: 29.4k]
  ------------------
  135|      0|        return(-1);
  136|       |
  137|  29.4k|    ctxt->indent_size = len;
  138|  29.4k|    ctxt->indent_nr = MAX_INDENT / ctxt->indent_size;
  ------------------
  |  |   20|  29.4k|#define MAX_INDENT 60
  ------------------
  139|   913k|    for (i = 0; i < ctxt->indent_nr; i++)
  ------------------
  |  Branch (139:17): [True: 884k, False: 29.4k]
  ------------------
  140|   884k|        memcpy(&ctxt->indent[i * ctxt->indent_size], indent, len);
  141|       |
  142|  29.4k|    return(0);
  143|  29.4k|}
xmlNodeDumpOutput:
 2334|  29.4k|{
 2335|  29.4k|    xmlSaveCtxt ctxt;
 2336|  29.4k|    int options;
 2337|  29.4k|#ifdef LIBXML_HTML_ENABLED
 2338|  29.4k|    xmlDtdPtr dtd;
 2339|  29.4k|    int is_xhtml = 0;
 2340|  29.4k|#endif
 2341|       |
 2342|  29.4k|    (void) doc;
 2343|       |
 2344|  29.4k|    xmlInitParser();
 2345|       |
 2346|  29.4k|    if ((buf == NULL) || (cur == NULL)) return;
  ------------------
  |  Branch (2346:9): [True: 0, False: 29.4k]
  |  Branch (2346:26): [True: 0, False: 29.4k]
  ------------------
 2347|       |
 2348|  29.4k|    if (level < 0)
  ------------------
  |  Branch (2348:9): [True: 0, False: 29.4k]
  ------------------
 2349|      0|        level = 0;
 2350|  29.4k|    else if (level > 100)
  ------------------
  |  Branch (2350:14): [True: 0, False: 29.4k]
  ------------------
 2351|      0|        level = 100;
 2352|       |
 2353|  29.4k|    if (encoding == NULL)
  ------------------
  |  Branch (2353:9): [True: 29.4k, False: 0]
  ------------------
 2354|  29.4k|        encoding = "UTF-8";
 2355|       |
 2356|  29.4k|    memset(&ctxt, 0, sizeof(ctxt));
 2357|  29.4k|    ctxt.buf = buf;
 2358|  29.4k|    ctxt.level = level;
 2359|  29.4k|    ctxt.encoding = (const xmlChar *) encoding;
 2360|       |
 2361|  29.4k|    options = XML_SAVE_AS_XML;
 2362|  29.4k|    if (format)
  ------------------
  |  Branch (2362:9): [True: 0, False: 29.4k]
  ------------------
 2363|      0|        options |= XML_SAVE_FORMAT;
 2364|  29.4k|    xmlSaveCtxtInit(&ctxt, options);
 2365|       |
 2366|  29.4k|#ifdef LIBXML_HTML_ENABLED
 2367|  29.4k|    dtd = xmlGetIntSubset(doc);
 2368|  29.4k|    if (dtd != NULL) {
  ------------------
  |  Branch (2368:9): [True: 18.3k, False: 11.0k]
  ------------------
 2369|  18.3k|	is_xhtml = xmlIsXHTML(dtd->SystemID, dtd->ExternalID);
 2370|  18.3k|	if (is_xhtml < 0)
  ------------------
  |  Branch (2370:6): [True: 4.56k, False: 13.8k]
  ------------------
 2371|  4.56k|	    is_xhtml = 0;
 2372|  18.3k|    }
 2373|       |
 2374|  29.4k|    if (is_xhtml)
  ------------------
  |  Branch (2374:9): [True: 12.8k, False: 16.6k]
  ------------------
 2375|  12.8k|        xhtmlNodeDumpOutput(&ctxt, cur);
 2376|  16.6k|    else
 2377|  16.6k|#endif
 2378|  16.6k|        xmlNodeDumpOutputInternal(&ctxt, cur);
 2379|  29.4k|}
xmlsave.c:xmlNsDumpOutput:
  762|   746k|xmlNsDumpOutput(xmlOutputBufferPtr buf, xmlNsPtr cur, xmlSaveCtxtPtr ctxt) {
  763|   746k|    unsigned escapeFlags = XML_ESCAPE_ATTR;
  ------------------
  |  |   22|   746k|#define XML_ESCAPE_ATTR             (1u << 0)
  ------------------
  764|       |
  765|   746k|    if ((cur == NULL) || (buf == NULL)) return;
  ------------------
  |  Branch (765:9): [True: 0, False: 746k]
  |  Branch (765:26): [True: 0, False: 746k]
  ------------------
  766|       |
  767|   746k|    if ((ctxt == NULL) || (ctxt->encoding == NULL))
  ------------------
  |  Branch (767:9): [True: 0, False: 746k]
  |  Branch (767:27): [True: 0, False: 746k]
  ------------------
  768|      0|        escapeFlags |= XML_ESCAPE_NON_ASCII;
  ------------------
  |  |   23|      0|#define XML_ESCAPE_NON_ASCII        (1u << 1)
  ------------------
  769|       |
  770|   746k|    if ((cur->type == XML_LOCAL_NAMESPACE) && (cur->href != NULL)) {
  ------------------
  |  |  500|   746k|#define XML_LOCAL_NAMESPACE XML_NAMESPACE_DECL
  ------------------
  |  Branch (770:9): [True: 746k, False: 0]
  |  Branch (770:47): [True: 743k, False: 2.66k]
  ------------------
  771|   743k|	if (xmlStrEqual(cur->prefix, BAD_CAST "xml"))
  ------------------
  |  |   34|   743k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (771:6): [True: 204, False: 743k]
  ------------------
  772|    204|	    return;
  773|       |
  774|   743k|	if (ctxt != NULL && ctxt->format == 2)
  ------------------
  |  Branch (774:6): [True: 743k, False: 0]
  |  Branch (774:22): [True: 0, False: 743k]
  ------------------
  775|      0|	    xmlOutputBufferWriteWSNonSig(ctxt, 2);
  776|   743k|	else
  777|   743k|	    xmlOutputBufferWrite(buf, 1, " ");
  778|       |
  779|       |        /* Within the context of an element attributes */
  780|   743k|	if (cur->prefix != NULL) {
  ------------------
  |  Branch (780:6): [True: 739k, False: 4.52k]
  ------------------
  781|   739k|	    xmlOutputBufferWrite(buf, 6, "xmlns:");
  782|   739k|	    xmlOutputBufferWriteString(buf, (const char *)cur->prefix);
  783|   739k|	} else
  784|  4.52k|	    xmlOutputBufferWrite(buf, 5, "xmlns");
  785|   743k|        xmlOutputBufferWrite(buf, 2, "=\"");
  786|       |        xmlSerializeText(buf, cur->href, SIZE_MAX, escapeFlags);
  787|   743k|        xmlOutputBufferWrite(buf, 1, "\"");
  788|   743k|    }
  789|   746k|}
xmlsave.c:xmlSaveDocInternal:
 1226|  1.52k|                   const xmlChar *encoding) {
 1227|  1.52k|#ifdef LIBXML_HTML_ENABLED
 1228|  1.52k|    xmlDtdPtr dtd;
 1229|  1.52k|    int is_xhtml = 0;
 1230|  1.52k|#endif
 1231|  1.52k|    xmlOutputBufferPtr buf = ctxt->buf;
 1232|  1.52k|    int switched_encoding = 0;
 1233|       |
 1234|  1.52k|    xmlInitParser();
 1235|       |
 1236|  1.52k|    if ((cur->type != XML_HTML_DOCUMENT_NODE) &&
  ------------------
  |  Branch (1236:9): [True: 1.52k, False: 0]
  ------------------
 1237|  1.52k|        (cur->type != XML_DOCUMENT_NODE))
  ------------------
  |  Branch (1237:9): [True: 0, False: 1.52k]
  ------------------
 1238|      0|	 return(-1);
 1239|       |
 1240|  1.52k|    if (encoding == NULL)
  ------------------
  |  Branch (1240:9): [True: 0, False: 1.52k]
  ------------------
 1241|      0|	encoding = cur->encoding;
 1242|       |
 1243|  1.52k|    if (((cur->type == XML_HTML_DOCUMENT_NODE) &&
  ------------------
  |  Branch (1243:10): [True: 0, False: 1.52k]
  ------------------
 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.52k|        (ctxt->options & XML_SAVE_AS_HTML)) {
  ------------------
  |  Branch (1246:9): [True: 0, False: 1.52k]
  ------------------
 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.52k|    } else if ((cur->type == XML_DOCUMENT_NODE) ||
  ------------------
  |  Branch (1267:16): [True: 1.52k, False: 0]
  ------------------
 1268|      0|               (ctxt->options & XML_SAVE_AS_XML) ||
  ------------------
  |  Branch (1268:16): [True: 0, False: 0]
  ------------------
 1269|  1.52k|               (ctxt->options & XML_SAVE_XHTML)) {
  ------------------
  |  Branch (1269:16): [True: 0, False: 0]
  ------------------
 1270|  1.52k|	if ((encoding != NULL) && (ctxt->encoding == NULL)) {
  ------------------
  |  Branch (1270:6): [True: 1.52k, False: 0]
  |  Branch (1270:28): [True: 0, False: 1.52k]
  ------------------
 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.52k|	if ((ctxt->options & XML_SAVE_NO_DECL) == 0) {
  ------------------
  |  Branch (1279:6): [True: 1.52k, False: 0]
  ------------------
 1280|  1.52k|	    xmlOutputBufferWrite(buf, 15, "<?xml version=\"");
 1281|  1.52k|	    if (cur->version != NULL)
  ------------------
  |  Branch (1281:10): [True: 1.52k, False: 0]
  ------------------
 1282|  1.52k|		xmlOutputBufferWriteString(buf, (char *) cur->version);
 1283|      0|	    else
 1284|      0|		xmlOutputBufferWrite(buf, 3, "1.0");
 1285|  1.52k|	    xmlOutputBufferWrite(buf, 1, "\"");
 1286|  1.52k|	    if (encoding != NULL) {
  ------------------
  |  Branch (1286:10): [True: 1.52k, False: 0]
  ------------------
 1287|  1.52k|		xmlOutputBufferWrite(buf, 11, " encoding=\"");
 1288|  1.52k|		xmlOutputBufferWriteString(buf, (char *) encoding);
 1289|  1.52k|	        xmlOutputBufferWrite(buf, 1, "\"");
 1290|  1.52k|	    }
 1291|  1.52k|	    switch (cur->standalone) {
  ------------------
  |  Branch (1291:14): [True: 77, False: 1.45k]
  ------------------
 1292|     11|		case 0:
  ------------------
  |  Branch (1292:3): [True: 11, False: 1.51k]
  ------------------
 1293|     11|		    xmlOutputBufferWrite(buf, 16, " standalone=\"no\"");
 1294|     11|		    break;
 1295|     66|		case 1:
  ------------------
  |  Branch (1295:3): [True: 66, False: 1.46k]
  ------------------
 1296|     66|		    xmlOutputBufferWrite(buf, 17, " standalone=\"yes\"");
 1297|     66|		    break;
 1298|  1.52k|	    }
 1299|  1.52k|	    xmlOutputBufferWrite(buf, 3, "?>\n");
 1300|  1.52k|	}
 1301|       |
 1302|  1.52k|#ifdef LIBXML_HTML_ENABLED
 1303|  1.52k|        if (ctxt->options & XML_SAVE_XHTML)
  ------------------
  |  Branch (1303:13): [True: 183, False: 1.34k]
  ------------------
 1304|    183|            is_xhtml = 1;
 1305|  1.52k|	if ((ctxt->options & XML_SAVE_NO_XHTML) == 0) {
  ------------------
  |  Branch (1305:6): [True: 1.52k, False: 0]
  ------------------
 1306|  1.52k|	    dtd = xmlGetIntSubset(cur);
 1307|  1.52k|	    if (dtd != NULL) {
  ------------------
  |  Branch (1307:10): [True: 1.44k, False: 81]
  ------------------
 1308|  1.44k|		is_xhtml = xmlIsXHTML(dtd->SystemID, dtd->ExternalID);
 1309|  1.44k|		if (is_xhtml < 0) is_xhtml = 0;
  ------------------
  |  Branch (1309:7): [True: 1.14k, False: 299]
  ------------------
 1310|  1.44k|	    }
 1311|  1.52k|	}
 1312|  1.52k|#endif
 1313|  1.52k|	if (cur->children != NULL) {
  ------------------
  |  Branch (1313:6): [True: 1.52k, False: 0]
  ------------------
 1314|  1.52k|	    xmlNodePtr child = cur->children;
 1315|       |
 1316|  4.54k|	    while (child != NULL) {
  ------------------
  |  Branch (1316:13): [True: 3.01k, False: 1.52k]
  ------------------
 1317|  3.01k|		ctxt->level = 0;
 1318|  3.01k|#ifdef LIBXML_HTML_ENABLED
 1319|  3.01k|		if (is_xhtml)
  ------------------
  |  Branch (1319:7): [True: 402, False: 2.61k]
  ------------------
 1320|    402|		    xhtmlNodeDumpOutput(ctxt, child);
 1321|  2.61k|		else
 1322|  2.61k|#endif
 1323|  2.61k|		    xmlNodeDumpOutputInternal(ctxt, child);
 1324|  3.01k|                if ((child->type != XML_XINCLUDE_START) &&
  ------------------
  |  Branch (1324:21): [True: 3.01k, False: 0]
  ------------------
 1325|  3.01k|                    (child->type != XML_XINCLUDE_END))
  ------------------
  |  Branch (1325:21): [True: 3.01k, False: 0]
  ------------------
 1326|  3.01k|                    xmlOutputBufferWrite(buf, 1, "\n");
 1327|  3.01k|		child = child->next;
 1328|  3.01k|	    }
 1329|  1.52k|	}
 1330|  1.52k|    }
 1331|       |
 1332|       |    /*
 1333|       |     * Restore the state of the saving context at the end of the document
 1334|       |     */
 1335|  1.52k|    if (switched_encoding) {
  ------------------
  |  Branch (1335:9): [True: 0, False: 1.52k]
  ------------------
 1336|      0|	xmlSaveClearEncoding(ctxt);
 1337|      0|    }
 1338|       |
 1339|  1.52k|    return(0);
 1340|  1.52k|}
xmlsave.c:xhtmlNodeDumpOutput:
 1489|  13.2k|xhtmlNodeDumpOutput(xmlSaveCtxtPtr ctxt, xmlNodePtr cur) {
 1490|  13.2k|    int format = ctxt->format, addmeta, oldoptions;
 1491|  13.2k|    xmlNodePtr tmp, root, unformattedNode = NULL, parent;
 1492|  13.2k|    xmlChar *start, *end;
 1493|  13.2k|    xmlOutputBufferPtr buf = ctxt->buf;
 1494|       |
 1495|  13.2k|    if (cur == NULL) return;
  ------------------
  |  Branch (1495:9): [True: 0, False: 13.2k]
  ------------------
 1496|       |
 1497|  13.2k|    oldoptions = ctxt->options;
 1498|  13.2k|    ctxt->options |= XML_SAVE_XHTML;
 1499|       |
 1500|  13.2k|    root = cur;
 1501|  13.2k|    parent = cur->parent;
 1502|  38.3k|    while (1) {
  ------------------
  |  Branch (1502:12): [True: 38.3k, Folded]
  ------------------
 1503|  38.3k|        switch (cur->type) {
 1504|    183|        case XML_DOCUMENT_NODE:
  ------------------
  |  Branch (1504:9): [True: 183, False: 38.1k]
  ------------------
 1505|    183|        case XML_HTML_DOCUMENT_NODE:
  ------------------
  |  Branch (1505:9): [True: 0, False: 38.3k]
  ------------------
 1506|    183|            xmlSaveDocInternal(ctxt, (xmlDocPtr) cur, ctxt->encoding);
 1507|    183|	    break;
 1508|       |
 1509|      0|        case XML_NAMESPACE_DECL:
  ------------------
  |  Branch (1509:9): [True: 0, False: 38.3k]
  ------------------
 1510|      0|	    xmlNsDumpOutput(buf, (xmlNsPtr) cur, ctxt);
 1511|      0|	    break;
 1512|       |
 1513|    183|        case XML_DTD_NODE:
  ------------------
  |  Branch (1513:9): [True: 183, False: 38.1k]
  ------------------
 1514|    183|            xmlDtdDumpOutput(ctxt, (xmlDtdPtr) cur);
 1515|    183|	    break;
 1516|       |
 1517|      0|        case XML_DOCUMENT_FRAG_NODE:
  ------------------
  |  Branch (1517:9): [True: 0, False: 38.3k]
  ------------------
 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: 38.3k]
  ------------------
 1527|      0|            xmlBufDumpElementDecl(buf, (xmlElementPtr) cur);
 1528|      0|	    break;
 1529|       |
 1530|      0|        case XML_ATTRIBUTE_DECL:
  ------------------
  |  Branch (1530:9): [True: 0, False: 38.3k]
  ------------------
 1531|      0|            xmlSaveWriteAttributeDecl(ctxt, (xmlAttributePtr) cur);
 1532|      0|	    break;
 1533|       |
 1534|      0|        case XML_ENTITY_DECL:
  ------------------
  |  Branch (1534:9): [True: 0, False: 38.3k]
  ------------------
 1535|      0|            xmlBufDumpEntityDecl(buf, (xmlEntityPtr) cur);
 1536|      0|	    break;
 1537|       |
 1538|  21.8k|        case XML_ELEMENT_NODE:
  ------------------
  |  Branch (1538:9): [True: 21.8k, False: 16.5k]
  ------------------
 1539|  21.8k|            addmeta = 0;
 1540|       |
 1541|  21.8k|	    if ((cur != root) && (ctxt->format == 1))
  ------------------
  |  Branch (1541:10): [True: 12.9k, False: 8.93k]
  |  Branch (1541:27): [True: 0, False: 12.9k]
  ------------------
 1542|      0|                xmlSaveWriteIndent(ctxt, 0);
 1543|       |
 1544|       |            /*
 1545|       |             * Some users like lxml are known to pass nodes with a corrupted
 1546|       |             * tree structure. Fall back to a recursive call to handle this
 1547|       |             * case.
 1548|       |             */
 1549|  21.8k|            if ((cur->parent != parent) && (cur->children != NULL)) {
  ------------------
  |  Branch (1549:17): [True: 0, False: 21.8k]
  |  Branch (1549:44): [True: 0, False: 0]
  ------------------
 1550|      0|                xhtmlNodeDumpOutput(ctxt, cur);
 1551|      0|                break;
 1552|      0|            }
 1553|       |
 1554|  21.8k|            xmlOutputBufferWrite(buf, 1, "<");
 1555|  21.8k|            if ((cur->ns != NULL) && (cur->ns->prefix != NULL)) {
  ------------------
  |  Branch (1555:17): [True: 1.99k, False: 19.8k]
  |  Branch (1555:38): [True: 484, False: 1.50k]
  ------------------
 1556|    484|                xmlOutputBufferWriteString(buf, (const char *)cur->ns->prefix);
 1557|    484|                xmlOutputBufferWrite(buf, 1, ":");
 1558|    484|            }
 1559|       |
 1560|  21.8k|            xmlOutputBufferWriteString(buf, (const char *)cur->name);
 1561|  21.8k|            if (cur->nsDef)
  ------------------
  |  Branch (1561:17): [True: 2.87k, False: 18.9k]
  ------------------
 1562|  2.87k|                xmlNsListDumpOutputCtxt(ctxt, cur->nsDef);
 1563|  21.8k|            if ((xmlStrEqual(cur->name, BAD_CAST "html") &&
  ------------------
  |  |   34|  21.8k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (1563:18): [True: 1.24k, False: 20.6k]
  ------------------
 1564|  1.24k|                (cur->ns == NULL) && (cur->nsDef == NULL))) {
  ------------------
  |  Branch (1564:17): [True: 856, False: 392]
  |  Branch (1564:38): [True: 546, False: 310]
  ------------------
 1565|       |                /*
 1566|       |                 * 3.1.1. Strictly Conforming Documents A.3.1.1 3/
 1567|       |                 */
 1568|    546|                xmlOutputBufferWriteString(buf,
 1569|    546|                        " xmlns=\"http://www.w3.org/1999/xhtml\"");
 1570|    546|            }
 1571|  21.8k|            if (cur->properties != NULL)
  ------------------
  |  Branch (1571:17): [True: 8.33k, False: 13.5k]
  ------------------
 1572|  8.33k|                xhtmlAttrListDumpOutput(ctxt, cur->properties);
 1573|       |
 1574|  21.8k|            if ((parent != NULL) &&
  ------------------
  |  Branch (1574:17): [True: 13.1k, False: 8.75k]
  ------------------
 1575|  13.1k|                (parent->parent == (xmlNodePtr) cur->doc) &&
  ------------------
  |  Branch (1575:17): [True: 66, False: 13.0k]
  ------------------
 1576|     66|                xmlStrEqual(cur->name, BAD_CAST"head") &&
  ------------------
  |  |   34|     66|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (1576:17): [True: 0, False: 66]
  ------------------
 1577|      0|                xmlStrEqual(parent->name, BAD_CAST"html")) {
  ------------------
  |  |   34|      0|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (1577:17): [True: 0, False: 0]
  ------------------
 1578|       |
 1579|      0|                tmp = cur->children;
 1580|      0|                while (tmp != NULL) {
  ------------------
  |  Branch (1580:24): [True: 0, False: 0]
  ------------------
 1581|      0|                    if (xmlStrEqual(tmp->name, BAD_CAST"meta")) {
  ------------------
  |  |   34|      0|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (1581:25): [True: 0, False: 0]
  ------------------
 1582|      0|                        int res;
 1583|      0|                        xmlChar *httpequiv;
 1584|       |
 1585|      0|                        res = xmlNodeGetAttrValue(tmp, BAD_CAST "http-equiv",
  ------------------
  |  |   34|      0|#define BAD_CAST (xmlChar *)
  ------------------
 1586|      0|                                                  NULL, &httpequiv);
 1587|      0|                        if (res < 0) {
  ------------------
  |  Branch (1587:29): [True: 0, False: 0]
  ------------------
 1588|      0|                            xmlSaveErrMemory(buf);
 1589|      0|                        } else if (res == 0) {
  ------------------
  |  Branch (1589:36): [True: 0, False: 0]
  ------------------
 1590|      0|                            if (xmlStrcasecmp(httpequiv,
  ------------------
  |  Branch (1590:33): [True: 0, False: 0]
  ------------------
 1591|      0|                                        BAD_CAST"Content-Type") == 0) {
  ------------------
  |  |   34|      0|#define BAD_CAST (xmlChar *)
  ------------------
 1592|      0|                                xmlFree(httpequiv);
 1593|      0|                                break;
 1594|      0|                            }
 1595|      0|                            xmlFree(httpequiv);
 1596|      0|                        }
 1597|      0|                    }
 1598|      0|                    tmp = tmp->next;
 1599|      0|                }
 1600|      0|                if (tmp == NULL)
  ------------------
  |  Branch (1600:21): [True: 0, False: 0]
  ------------------
 1601|      0|                    addmeta = 1;
 1602|      0|            }
 1603|       |
 1604|  21.8k|            if (cur->children == NULL) {
  ------------------
  |  Branch (1604:17): [True: 13.6k, False: 8.20k]
  ------------------
 1605|  13.6k|                if (((cur->ns == NULL) || (cur->ns->prefix == NULL)) &&
  ------------------
  |  Branch (1605:22): [True: 12.6k, False: 1.04k]
  |  Branch (1605:43): [True: 764, False: 282]
  ------------------
 1606|  13.3k|                    ((xhtmlIsEmpty(cur) == 1) && (addmeta == 0))) {
  ------------------
  |  Branch (1606:22): [True: 2.90k, False: 10.4k]
  |  Branch (1606:50): [True: 2.90k, False: 0]
  ------------------
 1607|       |                    /*
 1608|       |                     * C.2. Empty Elements
 1609|       |                     */
 1610|  2.90k|                    xmlOutputBufferWrite(buf, 3, " />");
 1611|  10.7k|                } else {
 1612|  10.7k|                    if (addmeta == 1) {
  ------------------
  |  Branch (1612:25): [True: 0, False: 10.7k]
  ------------------
 1613|      0|                        xmlOutputBufferWrite(buf, 1, ">");
 1614|      0|                        if (ctxt->format == 1) {
  ------------------
  |  Branch (1614:29): [True: 0, False: 0]
  ------------------
 1615|      0|                            xmlOutputBufferWrite(buf, 1, "\n");
 1616|      0|                            xmlSaveWriteIndent(ctxt, 1);
 1617|      0|                        }
 1618|      0|                        xmlOutputBufferWriteString(buf,
 1619|      0|                                "<meta http-equiv=\"Content-Type\" "
 1620|      0|                                "content=\"text/html; charset=");
 1621|      0|                        if (ctxt->encoding) {
  ------------------
  |  Branch (1621:29): [True: 0, False: 0]
  ------------------
 1622|      0|                            xmlOutputBufferWriteString(buf,
 1623|      0|                                    (const char *)ctxt->encoding);
 1624|      0|                        } else {
 1625|      0|                            xmlOutputBufferWrite(buf, 5, "UTF-8");
 1626|      0|                        }
 1627|      0|                        xmlOutputBufferWrite(buf, 4, "\" />");
 1628|      0|                        if (ctxt->format == 1)
  ------------------
  |  Branch (1628:29): [True: 0, False: 0]
  ------------------
 1629|      0|                            xmlOutputBufferWrite(buf, 1, "\n");
 1630|  10.7k|                    } else {
 1631|  10.7k|                        xmlOutputBufferWrite(buf, 1, ">");
 1632|  10.7k|                    }
 1633|       |                    /*
 1634|       |                     * C.3. Element Minimization and Empty Element Content
 1635|       |                     */
 1636|  10.7k|                    xmlOutputBufferWrite(buf, 2, "</");
 1637|  10.7k|                    if ((cur->ns != NULL) && (cur->ns->prefix != NULL)) {
  ------------------
  |  Branch (1637:25): [True: 1.04k, False: 9.71k]
  |  Branch (1637:46): [True: 282, False: 764]
  ------------------
 1638|    282|                        xmlOutputBufferWriteString(buf,
 1639|    282|                                (const char *)cur->ns->prefix);
 1640|    282|                        xmlOutputBufferWrite(buf, 1, ":");
 1641|    282|                    }
 1642|  10.7k|                    xmlOutputBufferWriteString(buf, (const char *)cur->name);
 1643|  10.7k|                    xmlOutputBufferWrite(buf, 1, ">");
 1644|  10.7k|                }
 1645|  13.6k|            } else {
 1646|  8.20k|                xmlOutputBufferWrite(buf, 1, ">");
 1647|  8.20k|                if (addmeta == 1) {
  ------------------
  |  Branch (1647:21): [True: 0, False: 8.20k]
  ------------------
 1648|      0|                    if (ctxt->format == 1) {
  ------------------
  |  Branch (1648:25): [True: 0, False: 0]
  ------------------
 1649|      0|                        xmlOutputBufferWrite(buf, 1, "\n");
 1650|      0|                        xmlSaveWriteIndent(ctxt, 1);
 1651|      0|                    }
 1652|      0|                    xmlOutputBufferWriteString(buf,
 1653|      0|                            "<meta http-equiv=\"Content-Type\" "
 1654|      0|                            "content=\"text/html; charset=");
 1655|      0|                    if (ctxt->encoding) {
  ------------------
  |  Branch (1655:25): [True: 0, False: 0]
  ------------------
 1656|      0|                        xmlOutputBufferWriteString(buf,
 1657|      0|                                (const char *)ctxt->encoding);
 1658|      0|                    } else {
 1659|      0|                        xmlOutputBufferWrite(buf, 5, "UTF-8");
 1660|      0|                    }
 1661|      0|                    xmlOutputBufferWrite(buf, 4, "\" />");
 1662|      0|                }
 1663|       |
 1664|  8.20k|                if (ctxt->format == 1) {
  ------------------
  |  Branch (1664:21): [True: 0, False: 8.20k]
  ------------------
 1665|      0|                    tmp = cur->children;
 1666|      0|                    while (tmp != NULL) {
  ------------------
  |  Branch (1666:28): [True: 0, False: 0]
  ------------------
 1667|      0|                        if ((tmp->type == XML_TEXT_NODE) ||
  ------------------
  |  Branch (1667:29): [True: 0, False: 0]
  ------------------
 1668|      0|                            (tmp->type == XML_ENTITY_REF_NODE)) {
  ------------------
  |  Branch (1668:29): [True: 0, False: 0]
  ------------------
 1669|      0|                            unformattedNode = cur;
 1670|      0|                            ctxt->format = 0;
 1671|      0|                            break;
 1672|      0|                        }
 1673|      0|                        tmp = tmp->next;
 1674|      0|                    }
 1675|      0|                }
 1676|       |
 1677|  8.20k|                if (ctxt->format == 1) xmlOutputBufferWrite(buf, 1, "\n");
  ------------------
  |  Branch (1677:21): [True: 0, False: 8.20k]
  ------------------
 1678|  8.20k|                if (ctxt->level >= 0) ctxt->level++;
  ------------------
  |  Branch (1678:21): [True: 8.20k, False: 0]
  ------------------
 1679|  8.20k|                parent = cur;
 1680|  8.20k|                cur = cur->children;
 1681|  8.20k|                continue;
 1682|  8.20k|            }
 1683|       |
 1684|  13.6k|            break;
 1685|       |
 1686|  13.6k|        case XML_TEXT_NODE:
  ------------------
  |  Branch (1686:9): [True: 13.5k, False: 24.8k]
  ------------------
 1687|  13.5k|	    if (cur->content == NULL)
  ------------------
  |  Branch (1687:10): [True: 0, False: 13.5k]
  ------------------
 1688|      0|                break;
 1689|  13.5k|	    if ((cur->name == xmlStringText) ||
  ------------------
  |  Branch (1689:10): [True: 13.5k, False: 0]
  ------------------
 1690|  13.5k|		(cur->name != xmlStringTextNoenc)) {
  ------------------
  |  Branch (1690:3): [True: 0, False: 0]
  ------------------
 1691|  13.5k|                if (ctxt->escape)
  ------------------
  |  Branch (1691:21): [True: 0, False: 13.5k]
  ------------------
 1692|      0|                    xmlOutputBufferWriteEscape(buf, cur->content,
 1693|      0|                                               ctxt->escape);
 1694|  13.5k|                else
 1695|  13.5k|                    xmlSaveWriteText(ctxt, cur->content, /* flags */ 0);
 1696|  13.5k|	    } else {
 1697|       |		/*
 1698|       |		 * Disable escaping, needed for XSLT
 1699|       |		 */
 1700|      0|		xmlOutputBufferWriteString(buf, (const char *) cur->content);
 1701|      0|	    }
 1702|  13.5k|	    break;
 1703|       |
 1704|    591|        case XML_PI_NODE:
  ------------------
  |  Branch (1704:9): [True: 591, False: 37.7k]
  ------------------
 1705|    591|            if (cur->content != NULL) {
  ------------------
  |  Branch (1705:17): [True: 285, False: 306]
  ------------------
 1706|    285|                xmlOutputBufferWrite(buf, 2, "<?");
 1707|    285|                xmlOutputBufferWriteString(buf, (const char *)cur->name);
 1708|    285|                if (cur->content != NULL) {
  ------------------
  |  Branch (1708:21): [True: 285, False: 0]
  ------------------
 1709|    285|                    xmlOutputBufferWrite(buf, 1, " ");
 1710|    285|                    xmlOutputBufferWriteString(buf,
 1711|    285|                            (const char *)cur->content);
 1712|    285|                }
 1713|    285|                xmlOutputBufferWrite(buf, 2, "?>");
 1714|    306|            } else {
 1715|    306|                xmlOutputBufferWrite(buf, 2, "<?");
 1716|    306|                xmlOutputBufferWriteString(buf, (const char *)cur->name);
 1717|    306|                xmlOutputBufferWrite(buf, 2, "?>");
 1718|    306|            }
 1719|    591|            break;
 1720|       |
 1721|    796|        case XML_COMMENT_NODE:
  ------------------
  |  Branch (1721:9): [True: 796, False: 37.5k]
  ------------------
 1722|    796|            if (cur->content != NULL) {
  ------------------
  |  Branch (1722:17): [True: 796, False: 0]
  ------------------
 1723|    796|                xmlOutputBufferWrite(buf, 4, "<!--");
 1724|    796|                xmlOutputBufferWriteString(buf, (const char *)cur->content);
 1725|    796|                xmlOutputBufferWrite(buf, 3, "-->");
 1726|    796|            }
 1727|    796|            break;
 1728|       |
 1729|    456|        case XML_ENTITY_REF_NODE:
  ------------------
  |  Branch (1729:9): [True: 456, False: 37.9k]
  ------------------
 1730|    456|            xmlOutputBufferWrite(buf, 1, "&");
 1731|    456|            xmlOutputBufferWriteString(buf, (const char *)cur->name);
 1732|    456|            xmlOutputBufferWrite(buf, 1, ";");
 1733|    456|            break;
 1734|       |
 1735|    588|        case XML_CDATA_SECTION_NODE:
  ------------------
  |  Branch (1735:9): [True: 588, False: 37.7k]
  ------------------
 1736|    588|            if (cur->content == NULL || *cur->content == '\0') {
  ------------------
  |  Branch (1736:17): [True: 0, False: 588]
  |  Branch (1736:41): [True: 227, False: 361]
  ------------------
 1737|    227|                xmlOutputBufferWrite(buf, 12, "<![CDATA[]]>");
 1738|    361|            } else {
 1739|    361|                start = end = cur->content;
 1740|  1.91k|                while (*end != '\0') {
  ------------------
  |  Branch (1740:24): [True: 1.55k, False: 361]
  ------------------
 1741|  1.55k|                    if (*end == ']' && *(end + 1) == ']' &&
  ------------------
  |  Branch (1741:25): [True: 389, False: 1.16k]
  |  Branch (1741:40): [True: 291, False: 98]
  ------------------
 1742|    291|                        *(end + 2) == '>') {
  ------------------
  |  Branch (1742:25): [True: 0, False: 291]
  ------------------
 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|  1.55k|                    end++;
 1751|  1.55k|                }
 1752|    361|                if (start != end) {
  ------------------
  |  Branch (1752:21): [True: 361, False: 0]
  ------------------
 1753|    361|                    xmlOutputBufferWrite(buf, 9, "<![CDATA[");
 1754|    361|                    xmlOutputBufferWriteString(buf, (const char *)start);
 1755|    361|                    xmlOutputBufferWrite(buf, 3, "]]>");
 1756|    361|                }
 1757|    361|            }
 1758|    588|            break;
 1759|       |
 1760|      0|        case XML_ATTRIBUTE_NODE:
  ------------------
  |  Branch (1760:9): [True: 0, False: 38.3k]
  ------------------
 1761|      0|            xmlAttrDumpOutput(ctxt, (xmlAttrPtr) cur);
 1762|      0|	    break;
 1763|       |
 1764|    205|        default:
  ------------------
  |  Branch (1764:9): [True: 205, False: 38.1k]
  ------------------
 1765|    205|            break;
 1766|  38.3k|        }
 1767|       |
 1768|  38.3k|        while (1) {
  ------------------
  |  Branch (1768:16): [True: 38.3k, Folded]
  ------------------
 1769|  38.3k|            if (cur == root)
  ------------------
  |  Branch (1769:17): [True: 13.2k, False: 25.1k]
  ------------------
 1770|  13.2k|                return;
 1771|  25.1k|            if (ctxt->format == 1)
  ------------------
  |  Branch (1771:17): [True: 0, False: 25.1k]
  ------------------
 1772|      0|                xmlOutputBufferWrite(buf, 1, "\n");
 1773|  25.1k|            if (cur->next != NULL) {
  ------------------
  |  Branch (1773:17): [True: 16.9k, False: 8.20k]
  ------------------
 1774|  16.9k|                cur = cur->next;
 1775|  16.9k|                break;
 1776|  16.9k|            }
 1777|       |
 1778|  8.20k|            cur = parent;
 1779|       |            /* cur->parent was validated when descending. */
 1780|  8.20k|            parent = cur->parent;
 1781|       |
 1782|  8.20k|            if (cur->type == XML_ELEMENT_NODE) {
  ------------------
  |  Branch (1782:17): [True: 8.20k, False: 0]
  ------------------
 1783|  8.20k|                if (ctxt->level > 0) ctxt->level--;
  ------------------
  |  Branch (1783:21): [True: 8.20k, False: 0]
  ------------------
 1784|  8.20k|                if (ctxt->format == 1)
  ------------------
  |  Branch (1784:21): [True: 0, False: 8.20k]
  ------------------
 1785|      0|                    xmlSaveWriteIndent(ctxt, 0);
 1786|       |
 1787|  8.20k|                xmlOutputBufferWrite(buf, 2, "</");
 1788|  8.20k|                if ((cur->ns != NULL) && (cur->ns->prefix != NULL)) {
  ------------------
  |  Branch (1788:21): [True: 945, False: 7.25k]
  |  Branch (1788:42): [True: 202, False: 743]
  ------------------
 1789|    202|                    xmlOutputBufferWriteString(buf,
 1790|    202|                            (const char *)cur->ns->prefix);
 1791|    202|                    xmlOutputBufferWrite(buf, 1, ":");
 1792|    202|                }
 1793|       |
 1794|  8.20k|                xmlOutputBufferWriteString(buf, (const char *)cur->name);
 1795|  8.20k|                xmlOutputBufferWrite(buf, 1, ">");
 1796|       |
 1797|  8.20k|                if (cur == unformattedNode) {
  ------------------
  |  Branch (1797:21): [True: 0, False: 8.20k]
  ------------------
 1798|      0|                    ctxt->format = format;
 1799|      0|                    unformattedNode = NULL;
 1800|      0|                }
 1801|  8.20k|            }
 1802|  8.20k|        }
 1803|  30.1k|    }
 1804|       |
 1805|      0|    ctxt->options = oldoptions;
 1806|      0|}
xmlsave.c:xmlDtdDumpOutput:
  827|  7.18k|xmlDtdDumpOutput(xmlSaveCtxtPtr ctxt, xmlDtdPtr dtd) {
  828|  7.18k|    xmlOutputBufferPtr buf;
  829|  7.18k|    xmlNodePtr cur;
  830|  7.18k|    int format, level;
  831|       |
  832|  7.18k|    if (dtd == NULL) return;
  ------------------
  |  Branch (832:9): [True: 0, False: 7.18k]
  ------------------
  833|  7.18k|    if ((ctxt == NULL) || (ctxt->buf == NULL))
  ------------------
  |  Branch (833:9): [True: 0, False: 7.18k]
  |  Branch (833:27): [True: 0, False: 7.18k]
  ------------------
  834|      0|        return;
  835|  7.18k|    buf = ctxt->buf;
  836|  7.18k|    xmlOutputBufferWrite(buf, 10, "<!DOCTYPE ");
  837|  7.18k|    xmlOutputBufferWriteString(buf, (const char *)dtd->name);
  838|  7.18k|    if (dtd->ExternalID != NULL) {
  ------------------
  |  Branch (838:9): [True: 529, False: 6.66k]
  ------------------
  839|    529|	xmlOutputBufferWrite(buf, 8, " PUBLIC ");
  840|    529|	xmlOutputBufferWriteQuotedString(buf, dtd->ExternalID);
  841|    529|	xmlOutputBufferWrite(buf, 1, " ");
  842|    529|	xmlOutputBufferWriteQuotedString(buf, dtd->SystemID);
  843|  6.66k|    }  else if (dtd->SystemID != NULL) {
  ------------------
  |  Branch (843:17): [True: 221, False: 6.43k]
  ------------------
  844|    221|	xmlOutputBufferWrite(buf, 8, " SYSTEM ");
  845|    221|	xmlOutputBufferWriteQuotedString(buf, dtd->SystemID);
  846|    221|    }
  847|  7.18k|    if ((dtd->entities == NULL) && (dtd->elements == NULL) &&
  ------------------
  |  Branch (847:9): [True: 5.18k, False: 2.00k]
  |  Branch (847:36): [True: 984, False: 4.20k]
  ------------------
  848|    984|        (dtd->attributes == NULL) && (dtd->notations == NULL) &&
  ------------------
  |  Branch (848:9): [True: 984, False: 0]
  |  Branch (848:38): [True: 864, False: 120]
  ------------------
  849|    864|	(dtd->pentities == NULL)) {
  ------------------
  |  Branch (849:2): [True: 781, False: 83]
  ------------------
  850|    781|	xmlOutputBufferWrite(buf, 1, ">");
  851|    781|	return;
  852|    781|    }
  853|  6.40k|    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|  6.40k|    if ((dtd->notations != NULL) && ((dtd->doc == NULL) ||
  ------------------
  |  Branch (858:9): [True: 1.21k, False: 5.19k]
  |  Branch (858:38): [True: 866, False: 346]
  ------------------
  859|  1.21k|        (dtd->doc->intSubset == dtd))) {
  ------------------
  |  Branch (859:9): [True: 346, False: 0]
  ------------------
  860|  1.21k|        xmlBufDumpNotationTable(buf, (xmlNotationTablePtr) dtd->notations);
  861|  1.21k|    }
  862|  6.40k|    format = ctxt->format;
  863|  6.40k|    level = ctxt->level;
  864|  6.40k|    ctxt->format = 0;
  865|  6.40k|    ctxt->level = -1;
  866|  22.8k|    for (cur = dtd->children; cur != NULL; cur = cur->next) {
  ------------------
  |  Branch (866:31): [True: 16.4k, False: 6.40k]
  ------------------
  867|  16.4k|        xmlNodeDumpOutputInternal(ctxt, cur);
  868|  16.4k|    }
  869|  6.40k|    ctxt->format = format;
  870|  6.40k|    ctxt->level = level;
  871|  6.40k|    xmlOutputBufferWrite(buf, 2, "]>");
  872|  6.40k|}
xmlsave.c:xmlBufDumpElementDecl:
  417|  5.86k|xmlBufDumpElementDecl(xmlOutputBufferPtr buf, xmlElementPtr elem) {
  418|  5.86k|    xmlOutputBufferWrite(buf, 10, "<!ELEMENT ");
  419|  5.86k|    if (elem->prefix != NULL) {
  ------------------
  |  Branch (419:9): [True: 642, False: 5.22k]
  ------------------
  420|    642|        xmlOutputBufferWriteString(buf, (const char *) elem->prefix);
  421|    642|        xmlOutputBufferWrite(buf, 1, ":");
  422|    642|    }
  423|  5.86k|    xmlOutputBufferWriteString(buf, (const char *) elem->name);
  424|  5.86k|    xmlOutputBufferWrite(buf, 1, " ");
  425|       |
  426|  5.86k|    switch (elem->etype) {
  427|  1.46k|	case XML_ELEMENT_TYPE_EMPTY:
  ------------------
  |  Branch (427:2): [True: 1.46k, False: 4.39k]
  ------------------
  428|  1.46k|	    xmlOutputBufferWrite(buf, 5, "EMPTY");
  429|  1.46k|	    break;
  430|     54|	case XML_ELEMENT_TYPE_ANY:
  ------------------
  |  Branch (430:2): [True: 54, False: 5.81k]
  ------------------
  431|     54|	    xmlOutputBufferWrite(buf, 3, "ANY");
  432|     54|	    break;
  433|    247|	case XML_ELEMENT_TYPE_MIXED:
  ------------------
  |  Branch (433:2): [True: 247, False: 5.61k]
  ------------------
  434|  4.34k|	case XML_ELEMENT_TYPE_ELEMENT:
  ------------------
  |  Branch (434:2): [True: 4.09k, False: 1.77k]
  ------------------
  435|  4.34k|	    xmlBufDumpElementContent(buf, elem->content);
  436|  4.34k|	    break;
  437|      0|        default:
  ------------------
  |  Branch (437:9): [True: 0, False: 5.86k]
  ------------------
  438|       |            /* assert(0); */
  439|      0|            break;
  440|  5.86k|    }
  441|       |
  442|  5.86k|    xmlOutputBufferWrite(buf, 2, ">\n");
  443|  5.86k|}
xmlsave.c:xmlBufDumpElementContent:
  345|  4.34k|                         xmlElementContentPtr content) {
  346|  4.34k|    xmlElementContentPtr cur;
  347|       |
  348|  4.34k|    if (content == NULL) return;
  ------------------
  |  Branch (348:9): [True: 0, False: 4.34k]
  ------------------
  349|       |
  350|  4.34k|    xmlOutputBufferWrite(buf, 1, "(");
  351|  4.34k|    cur = content;
  352|       |
  353|   118k|    do {
  354|   118k|        if (cur == NULL) return;
  ------------------
  |  Branch (354:13): [True: 0, False: 118k]
  ------------------
  355|       |
  356|   118k|        switch (cur->type) {
  ------------------
  |  Branch (356:17): [True: 118k, False: 0]
  ------------------
  357|    247|            case XML_ELEMENT_CONTENT_PCDATA:
  ------------------
  |  Branch (357:13): [True: 247, False: 118k]
  ------------------
  358|    247|                xmlOutputBufferWrite(buf, 7, "#PCDATA");
  359|    247|                break;
  360|  61.2k|            case XML_ELEMENT_CONTENT_ELEMENT:
  ------------------
  |  Branch (360:13): [True: 61.2k, False: 57.3k]
  ------------------
  361|  61.2k|                if (cur->prefix != NULL) {
  ------------------
  |  Branch (361:21): [True: 4.28k, False: 56.9k]
  ------------------
  362|  4.28k|                    xmlOutputBufferWriteString(buf,
  363|  4.28k|                            (const char *) cur->prefix);
  364|  4.28k|                    xmlOutputBufferWrite(buf, 1, ":");
  365|  4.28k|                }
  366|  61.2k|                xmlOutputBufferWriteString(buf, (const char *) cur->name);
  367|  61.2k|                break;
  368|  26.9k|            case XML_ELEMENT_CONTENT_SEQ:
  ------------------
  |  Branch (368:13): [True: 26.9k, False: 91.6k]
  ------------------
  369|  57.1k|            case XML_ELEMENT_CONTENT_OR:
  ------------------
  |  Branch (369:13): [True: 30.1k, False: 88.4k]
  ------------------
  370|  57.1k|                if ((cur != content) &&
  ------------------
  |  Branch (370:21): [True: 55.4k, False: 1.69k]
  ------------------
  371|  55.4k|                    (cur->parent != NULL) &&
  ------------------
  |  Branch (371:21): [True: 55.4k, False: 0]
  ------------------
  372|  55.4k|                    ((cur->type != cur->parent->type) ||
  ------------------
  |  Branch (372:22): [True: 12.6k, False: 42.8k]
  ------------------
  373|  42.8k|                     (cur->ocur != XML_ELEMENT_CONTENT_ONCE)))
  ------------------
  |  Branch (373:22): [True: 3.99k, False: 38.8k]
  ------------------
  374|  16.6k|                    xmlOutputBufferWrite(buf, 1, "(");
  375|  57.1k|                cur = cur->c1;
  376|  57.1k|                continue;
  377|   118k|        }
  378|       |
  379|   118k|        while (cur != content) {
  ------------------
  |  Branch (379:16): [True: 114k, False: 4.34k]
  ------------------
  380|   114k|            xmlElementContentPtr parent = cur->parent;
  381|       |
  382|   114k|            if (parent == NULL) return;
  ------------------
  |  Branch (382:17): [True: 0, False: 114k]
  ------------------
  383|       |
  384|   114k|            if (((cur->type == XML_ELEMENT_CONTENT_OR) ||
  ------------------
  |  Branch (384:18): [True: 28.9k, False: 85.3k]
  ------------------
  385|  85.3k|                 (cur->type == XML_ELEMENT_CONTENT_SEQ)) &&
  ------------------
  |  Branch (385:18): [True: 26.5k, False: 58.8k]
  ------------------
  386|  55.4k|                ((cur->type != parent->type) ||
  ------------------
  |  Branch (386:18): [True: 12.6k, False: 42.8k]
  ------------------
  387|  42.8k|                 (cur->ocur != XML_ELEMENT_CONTENT_ONCE)))
  ------------------
  |  Branch (387:18): [True: 3.99k, False: 38.8k]
  ------------------
  388|  16.6k|                xmlOutputBufferWrite(buf, 1, ")");
  389|   114k|            xmlBufDumpElementOccur(buf, cur);
  390|       |
  391|   114k|            if (cur == parent->c1) {
  ------------------
  |  Branch (391:17): [True: 57.1k, False: 57.1k]
  ------------------
  392|  57.1k|                if (parent->type == XML_ELEMENT_CONTENT_SEQ)
  ------------------
  |  Branch (392:21): [True: 26.9k, False: 30.1k]
  ------------------
  393|  26.9k|                    xmlOutputBufferWrite(buf, 3, " , ");
  394|  30.1k|                else if (parent->type == XML_ELEMENT_CONTENT_OR)
  ------------------
  |  Branch (394:26): [True: 30.1k, False: 0]
  ------------------
  395|  30.1k|                    xmlOutputBufferWrite(buf, 3, " | ");
  396|       |
  397|  57.1k|                cur = parent->c2;
  398|  57.1k|                break;
  399|  57.1k|            }
  400|       |
  401|  57.1k|            cur = parent;
  402|  57.1k|        }
  403|   118k|    } while (cur != content);
  ------------------
  |  Branch (403:14): [True: 114k, False: 4.34k]
  ------------------
  404|       |
  405|  4.34k|    xmlOutputBufferWrite(buf, 1, ")");
  406|  4.34k|    xmlBufDumpElementOccur(buf, content);
  407|  4.34k|}
xmlsave.c:xmlBufDumpElementOccur:
  321|   118k|xmlBufDumpElementOccur(xmlOutputBufferPtr buf, xmlElementContentPtr cur) {
  322|   118k|    switch (cur->ocur) {
  ------------------
  |  Branch (322:13): [True: 118k, False: 0]
  ------------------
  323|  89.0k|        case XML_ELEMENT_CONTENT_ONCE:
  ------------------
  |  Branch (323:9): [True: 89.0k, False: 29.5k]
  ------------------
  324|  89.0k|            break;
  325|  13.1k|        case XML_ELEMENT_CONTENT_OPT:
  ------------------
  |  Branch (325:9): [True: 13.1k, False: 105k]
  ------------------
  326|  13.1k|            xmlOutputBufferWrite(buf, 1, "?");
  327|  13.1k|            break;
  328|  13.0k|        case XML_ELEMENT_CONTENT_MULT:
  ------------------
  |  Branch (328:9): [True: 13.0k, False: 105k]
  ------------------
  329|  13.0k|            xmlOutputBufferWrite(buf, 1, "*");
  330|  13.0k|            break;
  331|  3.37k|        case XML_ELEMENT_CONTENT_PLUS:
  ------------------
  |  Branch (331:9): [True: 3.37k, False: 115k]
  ------------------
  332|  3.37k|            xmlOutputBufferWrite(buf, 1, "+");
  333|  3.37k|            break;
  334|   118k|    }
  335|   118k|}
xmlsave.c:xmlSaveWriteAttributeDecl:
  471|  6.86k|xmlSaveWriteAttributeDecl(xmlSaveCtxtPtr ctxt, xmlAttributePtr attr) {
  472|  6.86k|    xmlOutputBufferPtr buf = ctxt->buf;
  473|       |
  474|  6.86k|    xmlOutputBufferWrite(buf, 10, "<!ATTLIST ");
  475|  6.86k|    xmlOutputBufferWriteString(buf, (const char *) attr->elem);
  476|  6.86k|    xmlOutputBufferWrite(buf, 1, " ");
  477|  6.86k|    if (attr->prefix != NULL) {
  ------------------
  |  Branch (477:9): [True: 3.03k, False: 3.82k]
  ------------------
  478|  3.03k|	xmlOutputBufferWriteString(buf, (const char *) attr->prefix);
  479|  3.03k|	xmlOutputBufferWrite(buf, 1, ":");
  480|  3.03k|    }
  481|  6.86k|    xmlOutputBufferWriteString(buf, (const char *) attr->name);
  482|       |
  483|  6.86k|    switch (attr->atype) {
  484|    721|	case XML_ATTRIBUTE_CDATA:
  ------------------
  |  Branch (484:2): [True: 721, False: 6.13k]
  ------------------
  485|    721|	    xmlOutputBufferWrite(buf, 6, " CDATA");
  486|    721|	    break;
  487|  1.21k|	case XML_ATTRIBUTE_ID:
  ------------------
  |  Branch (487:2): [True: 1.21k, False: 5.64k]
  ------------------
  488|  1.21k|	    xmlOutputBufferWrite(buf, 3, " ID");
  489|  1.21k|	    break;
  490|    355|	case XML_ATTRIBUTE_IDREF:
  ------------------
  |  Branch (490:2): [True: 355, False: 6.50k]
  ------------------
  491|    355|	    xmlOutputBufferWrite(buf, 6, " IDREF");
  492|    355|	    break;
  493|     63|	case XML_ATTRIBUTE_IDREFS:
  ------------------
  |  Branch (493:2): [True: 63, False: 6.79k]
  ------------------
  494|     63|	    xmlOutputBufferWrite(buf, 7, " IDREFS");
  495|     63|	    break;
  496|    643|	case XML_ATTRIBUTE_ENTITY:
  ------------------
  |  Branch (496:2): [True: 643, False: 6.21k]
  ------------------
  497|    643|	    xmlOutputBufferWrite(buf, 7, " ENTITY");
  498|    643|	    break;
  499|    364|	case XML_ATTRIBUTE_ENTITIES:
  ------------------
  |  Branch (499:2): [True: 364, False: 6.49k]
  ------------------
  500|    364|	    xmlOutputBufferWrite(buf, 9, " ENTITIES");
  501|    364|	    break;
  502|    116|	case XML_ATTRIBUTE_NMTOKEN:
  ------------------
  |  Branch (502:2): [True: 116, False: 6.74k]
  ------------------
  503|    116|	    xmlOutputBufferWrite(buf, 8, " NMTOKEN");
  504|    116|	    break;
  505|    302|	case XML_ATTRIBUTE_NMTOKENS:
  ------------------
  |  Branch (505:2): [True: 302, False: 6.55k]
  ------------------
  506|    302|	    xmlOutputBufferWrite(buf, 9, " NMTOKENS");
  507|    302|	    break;
  508|  2.75k|	case XML_ATTRIBUTE_ENUMERATION:
  ------------------
  |  Branch (508:2): [True: 2.75k, False: 4.10k]
  ------------------
  509|  2.75k|	    xmlOutputBufferWrite(buf, 2, " (");
  510|  2.75k|	    xmlBufDumpEnumeration(buf, attr->tree);
  511|  2.75k|	    break;
  512|    324|	case XML_ATTRIBUTE_NOTATION:
  ------------------
  |  Branch (512:2): [True: 324, False: 6.53k]
  ------------------
  513|    324|	    xmlOutputBufferWrite(buf, 11, " NOTATION (");
  514|    324|	    xmlBufDumpEnumeration(buf, attr->tree);
  515|    324|	    break;
  516|      0|	default:
  ------------------
  |  Branch (516:2): [True: 0, False: 6.86k]
  ------------------
  517|       |            /* assert(0); */
  518|      0|            break;
  519|  6.86k|    }
  520|       |
  521|  6.86k|    switch (attr->def) {
  522|  4.17k|	case XML_ATTRIBUTE_NONE:
  ------------------
  |  Branch (522:2): [True: 4.17k, False: 2.68k]
  ------------------
  523|  4.17k|	    break;
  524|    569|	case XML_ATTRIBUTE_REQUIRED:
  ------------------
  |  Branch (524:2): [True: 569, False: 6.29k]
  ------------------
  525|    569|	    xmlOutputBufferWrite(buf, 10, " #REQUIRED");
  526|    569|	    break;
  527|  1.10k|	case XML_ATTRIBUTE_IMPLIED:
  ------------------
  |  Branch (527:2): [True: 1.10k, False: 5.75k]
  ------------------
  528|  1.10k|	    xmlOutputBufferWrite(buf, 9, " #IMPLIED");
  529|  1.10k|	    break;
  530|  1.01k|	case XML_ATTRIBUTE_FIXED:
  ------------------
  |  Branch (530:2): [True: 1.01k, False: 5.84k]
  ------------------
  531|  1.01k|	    xmlOutputBufferWrite(buf, 7, " #FIXED");
  532|  1.01k|	    break;
  533|      0|	default:
  ------------------
  |  Branch (533:2): [True: 0, False: 6.86k]
  ------------------
  534|       |            /* assert(0); */
  535|      0|            break;
  536|  6.86k|    }
  537|       |
  538|  6.86k|    if (attr->defaultValue != NULL) {
  ------------------
  |  Branch (538:9): [True: 2.32k, False: 4.53k]
  ------------------
  539|  2.32k|        xmlOutputBufferWrite(buf, 2, " \"");
  540|  2.32k|        xmlSaveWriteText(ctxt, attr->defaultValue, XML_ESCAPE_ATTR);
  ------------------
  |  |   22|  2.32k|#define XML_ESCAPE_ATTR             (1u << 0)
  ------------------
  541|  2.32k|        xmlOutputBufferWrite(buf, 1, "\"");
  542|  2.32k|    }
  543|       |
  544|  6.86k|    xmlOutputBufferWrite(buf, 2, ">\n");
  545|  6.86k|}
xmlsave.c:xmlBufDumpEnumeration:
  452|  3.07k|xmlBufDumpEnumeration(xmlOutputBufferPtr buf, xmlEnumerationPtr cur) {
  453|  7.57k|    while (cur != NULL) {
  ------------------
  |  Branch (453:12): [True: 4.49k, False: 3.07k]
  ------------------
  454|  4.49k|        xmlOutputBufferWriteString(buf, (const char *) cur->name);
  455|  4.49k|        if (cur->next != NULL)
  ------------------
  |  Branch (455:13): [True: 1.41k, False: 3.07k]
  ------------------
  456|  1.41k|            xmlOutputBufferWrite(buf, 3, " | ");
  457|       |
  458|  4.49k|        cur = cur->next;
  459|  4.49k|    }
  460|       |
  461|  3.07k|    xmlOutputBufferWrite(buf, 1, ")");
  462|  3.07k|}
xmlsave.c:xmlBufDumpEntityDecl:
  592|  3.51k|xmlBufDumpEntityDecl(xmlOutputBufferPtr buf, xmlEntityPtr ent) {
  593|  3.51k|    if ((ent->etype == XML_INTERNAL_PARAMETER_ENTITY) ||
  ------------------
  |  Branch (593:9): [True: 267, False: 3.24k]
  ------------------
  594|  3.24k|        (ent->etype == XML_EXTERNAL_PARAMETER_ENTITY))
  ------------------
  |  Branch (594:9): [True: 127, False: 3.12k]
  ------------------
  595|    394|        xmlOutputBufferWrite(buf, 11, "<!ENTITY % ");
  596|  3.12k|    else
  597|  3.12k|        xmlOutputBufferWrite(buf, 9, "<!ENTITY ");
  598|  3.51k|    xmlOutputBufferWriteString(buf, (const char *) ent->name);
  599|  3.51k|    xmlOutputBufferWrite(buf, 1, " ");
  600|       |
  601|  3.51k|    if ((ent->etype == XML_EXTERNAL_GENERAL_PARSED_ENTITY) ||
  ------------------
  |  Branch (601:9): [True: 796, False: 2.72k]
  ------------------
  602|  2.72k|        (ent->etype == XML_EXTERNAL_GENERAL_UNPARSED_ENTITY) ||
  ------------------
  |  Branch (602:9): [True: 395, False: 2.32k]
  ------------------
  603|  2.32k|        (ent->etype == XML_EXTERNAL_PARAMETER_ENTITY)) {
  ------------------
  |  Branch (603:9): [True: 127, False: 2.19k]
  ------------------
  604|  1.31k|        if (ent->ExternalID != NULL) {
  ------------------
  |  Branch (604:13): [True: 325, False: 993]
  ------------------
  605|    325|             xmlOutputBufferWrite(buf, 7, "PUBLIC ");
  606|    325|             xmlOutputBufferWriteQuotedString(buf, ent->ExternalID);
  607|    325|             xmlOutputBufferWrite(buf, 1, " ");
  608|    993|        } else {
  609|    993|             xmlOutputBufferWrite(buf, 7, "SYSTEM ");
  610|    993|        }
  611|  1.31k|        xmlOutputBufferWriteQuotedString(buf, ent->SystemID);
  612|  1.31k|    }
  613|       |
  614|  3.51k|    if (ent->etype == XML_EXTERNAL_GENERAL_UNPARSED_ENTITY) {
  ------------------
  |  Branch (614:9): [True: 395, False: 3.12k]
  ------------------
  615|    395|        if (ent->content != NULL) { /* Should be true ! */
  ------------------
  |  Branch (615:13): [True: 356, False: 39]
  ------------------
  616|    356|            xmlOutputBufferWrite(buf, 7, " NDATA ");
  617|    356|            if (ent->orig != NULL)
  ------------------
  |  Branch (617:17): [True: 88, False: 268]
  ------------------
  618|     88|                xmlOutputBufferWriteString(buf, (const char *) ent->orig);
  619|    268|            else
  620|    268|                xmlOutputBufferWriteString(buf, (const char *) ent->content);
  621|    356|        }
  622|    395|    }
  623|       |
  624|  3.51k|    if ((ent->etype == XML_INTERNAL_GENERAL_ENTITY) ||
  ------------------
  |  Branch (624:9): [True: 1.93k, False: 1.58k]
  ------------------
  625|  2.19k|        (ent->etype == XML_INTERNAL_PARAMETER_ENTITY)) {
  ------------------
  |  Branch (625:9): [True: 267, False: 1.31k]
  ------------------
  626|       |        /*
  627|       |         * We could save the original quote character and avoid
  628|       |         * calling xmlOutputBufferWriteQuotedString here.
  629|       |         */
  630|  2.19k|        if (ent->orig != NULL)
  ------------------
  |  Branch (630:13): [True: 2.18k, False: 18]
  ------------------
  631|  2.18k|            xmlOutputBufferWriteQuotedString(buf, ent->orig);
  632|     18|        else
  633|     18|            xmlBufDumpEntityContent(buf, ent->content);
  634|  2.19k|    }
  635|       |
  636|  3.51k|    xmlOutputBufferWrite(buf, 2, ">\n");
  637|  3.51k|}
xmlsave.c:xmlBufDumpEntityContent:
  555|     18|xmlBufDumpEntityContent(xmlOutputBufferPtr buf, const xmlChar *content) {
  556|     18|    const char * base, *cur;
  557|       |
  558|     18|    if (content == NULL)
  ------------------
  |  Branch (558:9): [True: 0, False: 18]
  ------------------
  559|      0|        return;
  560|       |
  561|     18|    xmlOutputBufferWrite(buf, 1, "\"");
  562|     18|    base = cur = (const char *) content;
  563|    269|    while (*cur != 0) {
  ------------------
  |  Branch (563:12): [True: 251, False: 18]
  ------------------
  564|    251|        if (*cur == '"') {
  ------------------
  |  Branch (564:13): [True: 0, False: 251]
  ------------------
  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|    251|        } else if (*cur == '%') {
  ------------------
  |  Branch (570:20): [True: 0, False: 251]
  ------------------
  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|    251|        } else {
  577|    251|            cur++;
  578|    251|        }
  579|    251|    }
  580|     18|    if (base != cur)
  ------------------
  |  Branch (580:9): [True: 18, False: 0]
  ------------------
  581|     18|        xmlOutputBufferWrite(buf, cur - base, base);
  582|     18|    xmlOutputBufferWrite(buf, 1, "\"");
  583|     18|}
xmlsave.c:xmlNsListDumpOutputCtxt:
  799|   737k|xmlNsListDumpOutputCtxt(xmlSaveCtxtPtr ctxt, xmlNsPtr cur) {
  800|  1.48M|    while (cur != NULL) {
  ------------------
  |  Branch (800:12): [True: 746k, False: 737k]
  ------------------
  801|   746k|        xmlNsDumpOutput(ctxt->buf, cur, ctxt);
  802|   746k|	cur = cur->next;
  803|   746k|    }
  804|   737k|}
xmlsave.c:xhtmlAttrListDumpOutput:
 1421|  8.33k|xhtmlAttrListDumpOutput(xmlSaveCtxtPtr ctxt, xmlAttrPtr cur) {
 1422|  8.33k|    xmlAttrPtr xml_lang = NULL;
 1423|  8.33k|    xmlAttrPtr lang = NULL;
 1424|  8.33k|    xmlAttrPtr name = NULL;
 1425|  8.33k|    xmlAttrPtr id = NULL;
 1426|  8.33k|    xmlNodePtr parent;
 1427|  8.33k|    xmlOutputBufferPtr buf;
 1428|       |
 1429|  8.33k|    if (cur == NULL) return;
  ------------------
  |  Branch (1429:9): [True: 0, False: 8.33k]
  ------------------
 1430|  8.33k|    buf = ctxt->buf;
 1431|  8.33k|    parent = cur->parent;
 1432|  29.0k|    while (cur != NULL) {
  ------------------
  |  Branch (1432:12): [True: 20.7k, False: 8.33k]
  ------------------
 1433|  20.7k|	if ((cur->ns == NULL) && (xmlStrEqual(cur->name, BAD_CAST "id")))
  ------------------
  |  |   34|  19.2k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (1433:6): [True: 19.2k, False: 1.45k]
  |  Branch (1433:27): [True: 304, False: 18.9k]
  ------------------
 1434|    304|	    id = cur;
 1435|  20.4k|	else
 1436|  20.4k|	if ((cur->ns == NULL) && (xmlStrEqual(cur->name, BAD_CAST "name")))
  ------------------
  |  |   34|  18.9k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (1436:6): [True: 18.9k, False: 1.45k]
  |  Branch (1436:27): [True: 2.50k, False: 16.4k]
  ------------------
 1437|  2.50k|	    name = cur;
 1438|  17.9k|	else
 1439|  17.9k|	if ((cur->ns == NULL) && (xmlStrEqual(cur->name, BAD_CAST "lang")))
  ------------------
  |  |   34|  16.4k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (1439:6): [True: 16.4k, False: 1.45k]
  |  Branch (1439:27): [True: 771, False: 15.6k]
  ------------------
 1440|    771|	    lang = cur;
 1441|  17.1k|	else
 1442|  17.1k|	if ((cur->ns != NULL) && (xmlStrEqual(cur->name, BAD_CAST "lang")) &&
  ------------------
  |  |   34|  1.45k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (1442:6): [True: 1.45k, False: 15.6k]
  |  Branch (1442:27): [True: 958, False: 496]
  ------------------
 1443|    958|	    (xmlStrEqual(cur->ns->prefix, BAD_CAST "xml")))
  ------------------
  |  |   34|    958|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (1443:6): [True: 621, False: 337]
  ------------------
 1444|    621|	    xml_lang = cur;
 1445|  20.7k|        xmlAttrDumpOutput(ctxt, cur);
 1446|  20.7k|	cur = cur->next;
 1447|  20.7k|    }
 1448|       |    /*
 1449|       |     * C.8
 1450|       |     */
 1451|  8.33k|    if ((name != NULL) && (id == NULL)) {
  ------------------
  |  Branch (1451:9): [True: 2.50k, False: 5.83k]
  |  Branch (1451:27): [True: 2.31k, False: 191]
  ------------------
 1452|  2.31k|	if ((parent != NULL) && (parent->name != NULL) &&
  ------------------
  |  Branch (1452:6): [True: 2.31k, False: 0]
  |  Branch (1452:26): [True: 2.31k, False: 0]
  ------------------
 1453|  2.31k|	    ((xmlStrEqual(parent->name, BAD_CAST "a")) ||
  ------------------
  |  |   34|  2.31k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (1453:7): [True: 492, False: 1.81k]
  ------------------
 1454|  1.81k|	     (xmlStrEqual(parent->name, BAD_CAST "p")) ||
  ------------------
  |  |   34|  1.81k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (1454:7): [True: 116, False: 1.70k]
  ------------------
 1455|  1.70k|	     (xmlStrEqual(parent->name, BAD_CAST "div")) ||
  ------------------
  |  |   34|  1.70k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (1455:7): [True: 209, False: 1.49k]
  ------------------
 1456|  1.49k|	     (xmlStrEqual(parent->name, BAD_CAST "img")) ||
  ------------------
  |  |   34|  1.49k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (1456:7): [True: 213, False: 1.28k]
  ------------------
 1457|  1.28k|	     (xmlStrEqual(parent->name, BAD_CAST "map")) ||
  ------------------
  |  |   34|  1.28k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (1457:7): [True: 34, False: 1.24k]
  ------------------
 1458|  1.24k|	     (xmlStrEqual(parent->name, BAD_CAST "applet")) ||
  ------------------
  |  |   34|  1.24k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (1458:7): [True: 81, False: 1.16k]
  ------------------
 1459|  1.16k|	     (xmlStrEqual(parent->name, BAD_CAST "form")) ||
  ------------------
  |  |   34|  1.16k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (1459:7): [True: 519, False: 646]
  ------------------
 1460|    646|	     (xmlStrEqual(parent->name, BAD_CAST "frame")) ||
  ------------------
  |  |   34|    646|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (1460:7): [True: 243, False: 403]
  ------------------
 1461|  2.10k|	     (xmlStrEqual(parent->name, BAD_CAST "iframe")))) {
  ------------------
  |  |   34|    403|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (1461:7): [True: 193, False: 210]
  ------------------
 1462|  2.10k|	    xmlOutputBufferWrite(buf, 5, " id=\"");
 1463|  2.10k|            xmlSaveWriteAttrContent(ctxt, name);
 1464|  2.10k|	    xmlOutputBufferWrite(buf, 1, "\"");
 1465|  2.10k|	}
 1466|  2.31k|    }
 1467|       |    /*
 1468|       |     * C.7.
 1469|       |     */
 1470|  8.33k|    if ((lang != NULL) && (xml_lang == NULL)) {
  ------------------
  |  Branch (1470:9): [True: 750, False: 7.58k]
  |  Branch (1470:27): [True: 419, False: 331]
  ------------------
 1471|    419|	xmlOutputBufferWrite(buf, 11, " xml:lang=\"");
 1472|    419|        xmlSaveWriteAttrContent(ctxt, lang);
 1473|    419|	xmlOutputBufferWrite(buf, 1, "\"");
 1474|    419|    } else
 1475|  7.91k|    if ((xml_lang != NULL) && (lang == NULL)) {
  ------------------
  |  Branch (1475:9): [True: 621, False: 7.29k]
  |  Branch (1475:31): [True: 290, False: 331]
  ------------------
 1476|    290|	xmlOutputBufferWrite(buf, 7, " lang=\"");
 1477|    290|        xmlSaveWriteAttrContent(ctxt, xml_lang);
 1478|    290|	xmlOutputBufferWrite(buf, 1, "\"");
 1479|    290|    }
 1480|  8.33k|}
xmlsave.c:xmlSaveWriteAttrContent:
  241|  42.4k|{
  242|  42.4k|    xmlNodePtr children;
  243|  42.4k|    xmlOutputBufferPtr buf = ctxt->buf;
  244|       |
  245|  42.4k|    children = attr->children;
  246|  78.1k|    while (children != NULL) {
  ------------------
  |  Branch (246:12): [True: 35.7k, False: 42.4k]
  ------------------
  247|  35.7k|        switch (children->type) {
  248|  35.2k|            case XML_TEXT_NODE:
  ------------------
  |  Branch (248:13): [True: 35.2k, False: 426]
  ------------------
  249|  35.2k|	        xmlSaveWriteText(ctxt, children->content, XML_ESCAPE_ATTR);
  ------------------
  |  |   22|  35.2k|#define XML_ESCAPE_ATTR             (1u << 0)
  ------------------
  250|  35.2k|		break;
  251|    426|            case XML_ENTITY_REF_NODE:
  ------------------
  |  Branch (251:13): [True: 426, False: 35.2k]
  ------------------
  252|    426|                xmlOutputBufferWrite(buf, 1, "&");
  253|    426|                xmlOutputBufferWriteString(buf, (const char *) children->name);
  254|    426|                xmlOutputBufferWrite(buf, 1, ";");
  255|    426|                break;
  256|      0|            default:
  ------------------
  |  Branch (256:13): [True: 0, False: 35.7k]
  ------------------
  257|       |                /* should not happen unless we have a badly built tree */
  258|      0|                break;
  259|  35.7k|        }
  260|  35.7k|        children = children->next;
  261|  35.7k|    }
  262|  42.4k|}
xmlsave.c:xhtmlIsEmpty:
 1356|  13.3k|xhtmlIsEmpty(xmlNodePtr node) {
 1357|  13.3k|    if (node == NULL)
  ------------------
  |  Branch (1357:9): [True: 0, False: 13.3k]
  ------------------
 1358|      0|	return(-1);
 1359|  13.3k|    if (node->type != XML_ELEMENT_NODE)
  ------------------
  |  Branch (1359:9): [True: 0, False: 13.3k]
  ------------------
 1360|      0|	return(0);
 1361|  13.3k|    if ((node->ns != NULL) && (!xmlStrEqual(node->ns->href, XHTML_NS_NAME)))
  ------------------
  |  |   33|    764|#define XHTML_NS_NAME BAD_CAST "http://www.w3.org/1999/xhtml"
  |  |  ------------------
  |  |  |  |   34|    764|#define BAD_CAST (xmlChar *)
  |  |  ------------------
  ------------------
  |  Branch (1361:9): [True: 764, False: 12.6k]
  |  Branch (1361:31): [True: 676, False: 88]
  ------------------
 1362|    676|	return(0);
 1363|  12.7k|    if (node->children != NULL)
  ------------------
  |  Branch (1363:9): [True: 0, False: 12.7k]
  ------------------
 1364|      0|	return(0);
 1365|  12.7k|    switch (node->name ? node->name[0] : 0) {
  ------------------
  |  Branch (1365:13): [True: 12.7k, False: 0]
  |  Branch (1365:13): [True: 8.36k, False: 4.34k]
  ------------------
 1366|  2.00k|	case 'a':
  ------------------
  |  Branch (1366:2): [True: 2.00k, False: 10.7k]
  ------------------
 1367|  2.00k|	    if (xmlStrEqual(node->name, BAD_CAST "area"))
  ------------------
  |  |   34|  2.00k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (1367:10): [True: 210, False: 1.79k]
  ------------------
 1368|    210|		return(1);
 1369|  1.79k|	    return(0);
 1370|    503|	case 'b':
  ------------------
  |  Branch (1370:2): [True: 503, False: 12.2k]
  ------------------
 1371|    503|	    if (xmlStrEqual(node->name, BAD_CAST "br"))
  ------------------
  |  |   34|    503|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (1371:10): [True: 51, False: 452]
  ------------------
 1372|     51|		return(1);
 1373|    452|	    if (xmlStrEqual(node->name, BAD_CAST "base"))
  ------------------
  |  |   34|    452|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (1373:10): [True: 79, False: 373]
  ------------------
 1374|     79|		return(1);
 1375|    373|	    if (xmlStrEqual(node->name, BAD_CAST "basefont"))
  ------------------
  |  |   34|    373|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (1375:10): [True: 39, False: 334]
  ------------------
 1376|     39|		return(1);
 1377|    334|	    return(0);
 1378|    396|	case 'c':
  ------------------
  |  Branch (1378:2): [True: 396, False: 12.3k]
  ------------------
 1379|    396|	    if (xmlStrEqual(node->name, BAD_CAST "col"))
  ------------------
  |  |   34|    396|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (1379:10): [True: 225, False: 171]
  ------------------
 1380|    225|		return(1);
 1381|    171|	    return(0);
 1382|  1.05k|	case 'f':
  ------------------
  |  Branch (1382:2): [True: 1.05k, False: 11.6k]
  ------------------
 1383|  1.05k|	    if (xmlStrEqual(node->name, BAD_CAST "frame"))
  ------------------
  |  |   34|  1.05k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (1383:10): [True: 280, False: 778]
  ------------------
 1384|    280|		return(1);
 1385|    778|	    return(0);
 1386|    903|	case 'h':
  ------------------
  |  Branch (1386:2): [True: 903, False: 11.8k]
  ------------------
 1387|    903|	    if (xmlStrEqual(node->name, BAD_CAST "hr"))
  ------------------
  |  |   34|    903|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (1387:10): [True: 210, False: 693]
  ------------------
 1388|    210|		return(1);
 1389|    693|	    return(0);
 1390|  1.75k|	case 'i':
  ------------------
  |  Branch (1390:2): [True: 1.75k, False: 10.9k]
  ------------------
 1391|  1.75k|	    if (xmlStrEqual(node->name, BAD_CAST "img"))
  ------------------
  |  |   34|  1.75k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (1391:10): [True: 952, False: 803]
  ------------------
 1392|    952|		return(1);
 1393|    803|	    if (xmlStrEqual(node->name, BAD_CAST "input"))
  ------------------
  |  |   34|    803|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (1393:10): [True: 296, False: 507]
  ------------------
 1394|    296|		return(1);
 1395|    507|	    if (xmlStrEqual(node->name, BAD_CAST "isindex"))
  ------------------
  |  |   34|    507|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (1395:10): [True: 176, False: 331]
  ------------------
 1396|    176|		return(1);
 1397|    331|	    return(0);
 1398|    439|	case 'l':
  ------------------
  |  Branch (1398:2): [True: 439, False: 12.2k]
  ------------------
 1399|    439|	    if (xmlStrEqual(node->name, BAD_CAST "link"))
  ------------------
  |  |   34|    439|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (1399:10): [True: 81, False: 358]
  ------------------
 1400|     81|		return(1);
 1401|    358|	    return(0);
 1402|    710|	case 'm':
  ------------------
  |  Branch (1402:2): [True: 710, False: 11.9k]
  ------------------
 1403|    710|	    if (xmlStrEqual(node->name, BAD_CAST "meta"))
  ------------------
  |  |   34|    710|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (1403:10): [True: 75, False: 635]
  ------------------
 1404|     75|		return(1);
 1405|    635|	    return(0);
 1406|    594|	case 'p':
  ------------------
  |  Branch (1406:2): [True: 594, False: 12.1k]
  ------------------
 1407|    594|	    if (xmlStrEqual(node->name, BAD_CAST "param"))
  ------------------
  |  |   34|    594|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (1407:10): [True: 229, False: 365]
  ------------------
 1408|    229|		return(1);
 1409|    365|	    return(0);
 1410|  12.7k|    }
 1411|  4.34k|    return(0);
 1412|  12.7k|}
xmlsave.c:xmlSaveWriteText:
  226|   926k|xmlSaveWriteText(xmlSaveCtxt *ctxt, const xmlChar *text, unsigned flags) {
  227|   926k|    if (ctxt->encoding == NULL)
  ------------------
  |  Branch (227:9): [True: 0, False: 926k]
  ------------------
  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|   926k|}
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: 9.22k, False: 30.5k]
  |  Branch (891:30): [True: 8.76k, False: 463]
  ------------------
  892|  8.76k|        xmlOutputBufferWriteString(buf, (const char *)cur->ns->prefix);
  893|  8.76k|	xmlOutputBufferWrite(buf, 1, ":");
  894|  8.76k|    }
  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: 20.7k, False: 19.0k]
  ------------------
  899|  20.7k|        (cur->ns == NULL) &&
  ------------------
  |  Branch (899:9): [True: 19.2k, False: 1.45k]
  ------------------
  900|  19.2k|        ((cur->children == NULL) ||
  ------------------
  |  Branch (900:10): [True: 5.08k, False: 14.1k]
  ------------------
  901|  14.1k|         (cur->children->content == NULL) ||
  ------------------
  |  Branch (901:10): [True: 0, False: 14.1k]
  ------------------
  902|  14.1k|         (cur->children->content[0] == 0)) &&
  ------------------
  |  Branch (902:10): [True: 10.8k, False: 3.34k]
  ------------------
  903|  15.9k|        (htmlIsBooleanAttr(cur->name))) {
  ------------------
  |  Branch (903:9): [True: 183, False: 15.7k]
  ------------------
  904|    183|        xmlOutputBufferWriteString(buf, (const char *) cur->name);
  905|    183|    } else
  906|  39.6k|#endif
  907|  39.6k|    {
  908|  39.6k|        xmlSaveWriteAttrContent(ctxt, cur);
  909|  39.6k|    }
  910|  39.7k|    xmlOutputBufferWrite(buf, 1, "\"");
  911|  39.7k|}
xmlsave.c:xmlNodeDumpOutputInternal:
  961|  35.6k|xmlNodeDumpOutputInternal(xmlSaveCtxtPtr ctxt, xmlNodePtr cur) {
  962|  35.6k|    int format = ctxt->format;
  963|  35.6k|    xmlNodePtr tmp, root, unformattedNode = NULL, parent;
  964|  35.6k|    xmlAttrPtr attr;
  965|  35.6k|    xmlChar *start, *end;
  966|  35.6k|    xmlOutputBufferPtr buf;
  967|       |
  968|  35.6k|    if (cur == NULL) return;
  ------------------
  |  Branch (968:9): [True: 0, False: 35.6k]
  ------------------
  969|  35.6k|    buf = ctxt->buf;
  970|       |
  971|  35.6k|    root = cur;
  972|  35.6k|    parent = cur->parent;
  973|  3.24M|    while (1) {
  ------------------
  |  Branch (973:12): [True: 3.24M, Folded]
  ------------------
  974|  3.24M|        switch (cur->type) {
  975|  1.34k|        case XML_DOCUMENT_NODE:
  ------------------
  |  Branch (975:9): [True: 1.34k, False: 3.24M]
  ------------------
  976|  1.34k|        case XML_HTML_DOCUMENT_NODE:
  ------------------
  |  Branch (976:9): [True: 0, False: 3.24M]
  ------------------
  977|  1.34k|	    xmlSaveDocInternal(ctxt, (xmlDocPtr) cur, ctxt->encoding);
  978|  1.34k|	    break;
  979|       |
  980|  7.00k|        case XML_DTD_NODE:
  ------------------
  |  Branch (980:9): [True: 7.00k, False: 3.24M]
  ------------------
  981|  7.00k|            xmlDtdDumpOutput(ctxt, (xmlDtdPtr) cur);
  982|  7.00k|            break;
  983|       |
  984|      0|        case XML_DOCUMENT_FRAG_NODE:
  ------------------
  |  Branch (984:9): [True: 0, False: 3.24M]
  ------------------
  985|       |            /* Always validate cur->parent when descending. */
  986|      0|            if ((cur->parent == parent) && (cur->children != NULL)) {
  ------------------
  |  Branch (986:17): [True: 0, False: 0]
  |  Branch (986:44): [True: 0, False: 0]
  ------------------
  987|      0|                parent = cur;
  988|      0|                cur = cur->children;
  989|      0|                continue;
  990|      0|            }
  991|      0|	    break;
  992|       |
  993|  5.86k|        case XML_ELEMENT_DECL:
  ------------------
  |  Branch (993:9): [True: 5.86k, False: 3.24M]
  ------------------
  994|  5.86k|            xmlBufDumpElementDecl(buf, (xmlElementPtr) cur);
  995|  5.86k|            break;
  996|       |
  997|  6.86k|        case XML_ATTRIBUTE_DECL:
  ------------------
  |  Branch (997:9): [True: 6.86k, False: 3.24M]
  ------------------
  998|  6.86k|            xmlSaveWriteAttributeDecl(ctxt, (xmlAttributePtr) cur);
  999|  6.86k|            break;
 1000|       |
 1001|  3.51k|        case XML_ENTITY_DECL:
  ------------------
  |  Branch (1001:9): [True: 3.51k, False: 3.24M]
  ------------------
 1002|  3.51k|            xmlBufDumpEntityDecl(buf, (xmlEntityPtr) cur);
 1003|  3.51k|            break;
 1004|       |
 1005|  1.60M|        case XML_ELEMENT_NODE:
  ------------------
  |  Branch (1005:9): [True: 1.60M, False: 1.63M]
  ------------------
 1006|  1.60M|	    if ((cur != root) && (ctxt->format == 1))
  ------------------
  |  Branch (1006:10): [True: 1.60M, False: 5.25k]
  |  Branch (1006:27): [True: 0, False: 1.60M]
  ------------------
 1007|      0|                xmlSaveWriteIndent(ctxt, 0);
 1008|       |
 1009|       |            /*
 1010|       |             * Some users like lxml are known to pass nodes with a corrupted
 1011|       |             * tree structure. Fall back to a recursive call to handle this
 1012|       |             * case.
 1013|       |             */
 1014|  1.60M|            if ((cur->parent != parent) && (cur->children != NULL)) {
  ------------------
  |  Branch (1014:17): [True: 0, False: 1.60M]
  |  Branch (1014:44): [True: 0, False: 0]
  ------------------
 1015|      0|                xmlNodeDumpOutputInternal(ctxt, cur);
 1016|      0|                break;
 1017|      0|            }
 1018|       |
 1019|  1.60M|            xmlOutputBufferWrite(buf, 1, "<");
 1020|  1.60M|            if ((cur->ns != NULL) && (cur->ns->prefix != NULL)) {
  ------------------
  |  Branch (1020:17): [True: 14.5k, False: 1.59M]
  |  Branch (1020:38): [True: 7.03k, False: 7.49k]
  ------------------
 1021|  7.03k|                xmlOutputBufferWriteString(buf, (const char *)cur->ns->prefix);
 1022|  7.03k|                xmlOutputBufferWrite(buf, 1, ":");
 1023|  7.03k|            }
 1024|  1.60M|            xmlOutputBufferWriteString(buf, (const char *)cur->name);
 1025|  1.60M|            if (cur->nsDef)
  ------------------
  |  Branch (1025:17): [True: 734k, False: 875k]
  ------------------
 1026|   734k|                xmlNsListDumpOutputCtxt(ctxt, cur->nsDef);
 1027|  1.62M|            for (attr = cur->properties; attr != NULL; attr = attr->next)
  ------------------
  |  Branch (1027:42): [True: 19.0k, False: 1.60M]
  ------------------
 1028|  19.0k|                xmlAttrDumpOutput(ctxt, attr);
 1029|       |
 1030|  1.60M|            if (cur->children == NULL) {
  ------------------
  |  Branch (1030:17): [True: 141k, False: 1.46M]
  ------------------
 1031|   141k|                if ((ctxt->options & XML_SAVE_NO_EMPTY) == 0) {
  ------------------
  |  Branch (1031:21): [True: 141k, False: 0]
  ------------------
 1032|   141k|                    if (ctxt->format == 2)
  ------------------
  |  Branch (1032:25): [True: 0, False: 141k]
  ------------------
 1033|      0|                        xmlOutputBufferWriteWSNonSig(ctxt, 0);
 1034|   141k|                    xmlOutputBufferWrite(buf, 2, "/>");
 1035|   141k|                } 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.46M|            } else {
 1050|  1.46M|                if (ctxt->format == 1) {
  ------------------
  |  Branch (1050:21): [True: 0, False: 1.46M]
  ------------------
 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.46M|                if (ctxt->format == 2)
  ------------------
  |  Branch (1063:21): [True: 0, False: 1.46M]
  ------------------
 1064|      0|                    xmlOutputBufferWriteWSNonSig(ctxt, 1);
 1065|  1.46M|                xmlOutputBufferWrite(buf, 1, ">");
 1066|  1.46M|                if (ctxt->format == 1) xmlOutputBufferWrite(buf, 1, "\n");
  ------------------
  |  Branch (1066:21): [True: 0, False: 1.46M]
  ------------------
 1067|  1.46M|                if (ctxt->level >= 0) ctxt->level++;
  ------------------
  |  Branch (1067:21): [True: 1.46M, False: 0]
  ------------------
 1068|  1.46M|                parent = cur;
 1069|  1.46M|                cur = cur->children;
 1070|  1.46M|                continue;
 1071|  1.46M|            }
 1072|       |
 1073|   141k|            break;
 1074|       |
 1075|   875k|        case XML_TEXT_NODE:
  ------------------
  |  Branch (1075:9): [True: 875k, False: 2.37M]
  ------------------
 1076|   875k|	    if (cur->content == NULL)
  ------------------
  |  Branch (1076:10): [True: 196, False: 875k]
  ------------------
 1077|    196|                break;
 1078|   875k|	    if (cur->name != xmlStringTextNoenc) {
  ------------------
  |  Branch (1078:10): [True: 875k, False: 0]
  ------------------
 1079|   875k|                if (ctxt->escape)
  ------------------
  |  Branch (1079:21): [True: 0, False: 875k]
  ------------------
 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|   875k|                else
 1087|   875k|                    xmlSaveWriteText(ctxt, cur->content, /* flags */ 0);
 1088|   875k|	    } else {
 1089|       |		/*
 1090|       |		 * Disable escaping, needed for XSLT
 1091|       |		 */
 1092|      0|		xmlOutputBufferWriteString(buf, (const char *) cur->content);
 1093|      0|	    }
 1094|   875k|	    break;
 1095|       |
 1096|  1.84k|        case XML_PI_NODE:
  ------------------
  |  Branch (1096:9): [True: 1.84k, False: 3.24M]
  ------------------
 1097|  1.84k|	    if ((cur != root) && (ctxt->format == 1))
  ------------------
  |  Branch (1097:10): [True: 1.29k, False: 549]
  |  Branch (1097:27): [True: 0, False: 1.29k]
  ------------------
 1098|      0|                xmlSaveWriteIndent(ctxt, 0);
 1099|       |
 1100|  1.84k|            if (cur->content != NULL) {
  ------------------
  |  Branch (1100:17): [True: 1.14k, False: 704]
  ------------------
 1101|  1.14k|                xmlOutputBufferWrite(buf, 2, "<?");
 1102|  1.14k|                xmlOutputBufferWriteString(buf, (const char *)cur->name);
 1103|  1.14k|                if (cur->content != NULL) {
  ------------------
  |  Branch (1103:21): [True: 1.14k, False: 0]
  ------------------
 1104|  1.14k|                    if (ctxt->format == 2)
  ------------------
  |  Branch (1104:25): [True: 0, False: 1.14k]
  ------------------
 1105|      0|                        xmlOutputBufferWriteWSNonSig(ctxt, 0);
 1106|  1.14k|                    else
 1107|  1.14k|                        xmlOutputBufferWrite(buf, 1, " ");
 1108|  1.14k|                    xmlOutputBufferWriteString(buf,
 1109|  1.14k|                            (const char *)cur->content);
 1110|  1.14k|                }
 1111|  1.14k|                xmlOutputBufferWrite(buf, 2, "?>");
 1112|  1.14k|            } else {
 1113|    704|                xmlOutputBufferWrite(buf, 2, "<?");
 1114|    704|                xmlOutputBufferWriteString(buf, (const char *)cur->name);
 1115|    704|                if (ctxt->format == 2)
  ------------------
  |  Branch (1115:21): [True: 0, False: 704]
  ------------------
 1116|      0|                    xmlOutputBufferWriteWSNonSig(ctxt, 0);
 1117|    704|                xmlOutputBufferWrite(buf, 2, "?>");
 1118|    704|            }
 1119|  1.84k|            break;
 1120|       |
 1121|  1.08k|        case XML_COMMENT_NODE:
  ------------------
  |  Branch (1121:9): [True: 1.08k, False: 3.24M]
  ------------------
 1122|  1.08k|	    if ((cur != root) && (ctxt->format == 1))
  ------------------
  |  Branch (1122:10): [True: 679, False: 402]
  |  Branch (1122:27): [True: 0, False: 679]
  ------------------
 1123|      0|                xmlSaveWriteIndent(ctxt, 0);
 1124|       |
 1125|  1.08k|            if (cur->content != NULL) {
  ------------------
  |  Branch (1125:17): [True: 1.08k, False: 0]
  ------------------
 1126|  1.08k|                xmlOutputBufferWrite(buf, 4, "<!--");
 1127|  1.08k|                xmlOutputBufferWriteString(buf, (const char *)cur->content);
 1128|  1.08k|                xmlOutputBufferWrite(buf, 3, "-->");
 1129|  1.08k|            }
 1130|  1.08k|            break;
 1131|       |
 1132|  5.85k|        case XML_ENTITY_REF_NODE:
  ------------------
  |  Branch (1132:9): [True: 5.85k, False: 3.24M]
  ------------------
 1133|  5.85k|            xmlOutputBufferWrite(buf, 1, "&");
 1134|  5.85k|            xmlOutputBufferWriteString(buf, (const char *)cur->name);
 1135|  5.85k|            xmlOutputBufferWrite(buf, 1, ";");
 1136|  5.85k|            break;
 1137|       |
 1138|  1.05k|        case XML_CDATA_SECTION_NODE:
  ------------------
  |  Branch (1138:9): [True: 1.05k, False: 3.24M]
  ------------------
 1139|  1.05k|            if (cur->content == NULL || *cur->content == '\0') {
  ------------------
  |  Branch (1139:17): [True: 0, False: 1.05k]
  |  Branch (1139:41): [True: 281, False: 773]
  ------------------
 1140|    281|                xmlOutputBufferWrite(buf, 12, "<![CDATA[]]>");
 1141|    773|            } else {
 1142|    773|                start = end = cur->content;
 1143|  2.84k|                while (*end != '\0') {
  ------------------
  |  Branch (1143:24): [True: 2.06k, False: 773]
  ------------------
 1144|  2.06k|                    if ((*end == ']') && (*(end + 1) == ']') &&
  ------------------
  |  Branch (1144:25): [True: 453, False: 1.61k]
  |  Branch (1144:42): [True: 227, False: 226]
  ------------------
 1145|    227|                        (*(end + 2) == '>')) {
  ------------------
  |  Branch (1145:25): [True: 0, False: 227]
  ------------------
 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.06k|                    end++;
 1154|  2.06k|                }
 1155|    773|                if (start != end) {
  ------------------
  |  Branch (1155:21): [True: 773, False: 0]
  ------------------
 1156|    773|                    xmlOutputBufferWrite(buf, 9, "<![CDATA[");
 1157|    773|                    xmlOutputBufferWriteString(buf, (const char *)start);
 1158|    773|                    xmlOutputBufferWrite(buf, 3, "]]>");
 1159|    773|                }
 1160|    773|            }
 1161|  1.05k|            break;
 1162|       |
 1163|      0|        case XML_ATTRIBUTE_NODE:
  ------------------
  |  Branch (1163:9): [True: 0, False: 3.24M]
  ------------------
 1164|      0|            xmlAttrDumpOutput(ctxt, (xmlAttrPtr) cur);
 1165|      0|            break;
 1166|       |
 1167|      0|        case XML_NAMESPACE_DECL:
  ------------------
  |  Branch (1167:9): [True: 0, False: 3.24M]
  ------------------
 1168|      0|            xmlNsDumpOutput(buf, (xmlNsPtr) cur, ctxt);
 1169|      0|            break;
 1170|       |
 1171|   727k|        default:
  ------------------
  |  Branch (1171:9): [True: 727k, False: 2.52M]
  ------------------
 1172|   727k|            break;
 1173|  3.24M|        }
 1174|       |
 1175|  3.24M|        while (1) {
  ------------------
  |  Branch (1175:16): [True: 3.24M, Folded]
  ------------------
 1176|  3.24M|            if (cur == root)
  ------------------
  |  Branch (1176:17): [True: 35.6k, False: 3.21M]
  ------------------
 1177|  35.6k|                return;
 1178|  3.21M|            if ((ctxt->format == 1) &&
  ------------------
  |  Branch (1178:17): [True: 0, False: 3.21M]
  ------------------
 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.21M|            if (cur->next != NULL) {
  ------------------
  |  Branch (1182:17): [True: 1.74M, False: 1.46M]
  ------------------
 1183|  1.74M|                cur = cur->next;
 1184|  1.74M|                break;
 1185|  1.74M|            }
 1186|       |
 1187|  1.46M|            cur = parent;
 1188|       |            /* cur->parent was validated when descending. */
 1189|  1.46M|            parent = cur->parent;
 1190|       |
 1191|  1.46M|            if (cur->type == XML_ELEMENT_NODE) {
  ------------------
  |  Branch (1191:17): [True: 1.46M, False: 0]
  ------------------
 1192|  1.46M|                if (ctxt->level > 0) ctxt->level--;
  ------------------
  |  Branch (1192:21): [True: 1.46M, False: 0]
  ------------------
 1193|  1.46M|                if (ctxt->format == 1)
  ------------------
  |  Branch (1193:21): [True: 0, False: 1.46M]
  ------------------
 1194|      0|                    xmlSaveWriteIndent(ctxt, 0);
 1195|       |
 1196|  1.46M|                xmlOutputBufferWrite(buf, 2, "</");
 1197|  1.46M|                if ((cur->ns != NULL) && (cur->ns->prefix != NULL)) {
  ------------------
  |  Branch (1197:21): [True: 9.25k, False: 1.45M]
  |  Branch (1197:42): [True: 3.90k, False: 5.34k]
  ------------------
 1198|  3.90k|                    xmlOutputBufferWriteString(buf,
 1199|  3.90k|                            (const char *)cur->ns->prefix);
 1200|  3.90k|                    xmlOutputBufferWrite(buf, 1, ":");
 1201|  3.90k|                }
 1202|       |
 1203|  1.46M|                xmlOutputBufferWriteString(buf, (const char *)cur->name);
 1204|  1.46M|                if (ctxt->format == 2)
  ------------------
  |  Branch (1204:21): [True: 0, False: 1.46M]
  ------------------
 1205|      0|                    xmlOutputBufferWriteWSNonSig(ctxt, 0);
 1206|  1.46M|                xmlOutputBufferWrite(buf, 1, ">");
 1207|       |
 1208|  1.46M|                if (cur == unformattedNode) {
  ------------------
  |  Branch (1208:21): [True: 0, False: 1.46M]
  ------------------
 1209|      0|                    ctxt->format = format;
 1210|       |                    unformattedNode = NULL;
 1211|      0|                }
 1212|  1.46M|            }
 1213|  1.46M|        }
 1214|  1.77M|    }
 1215|  35.6k|}
xmlsave.c:xmlBufDumpNotationDecl:
  271|  1.24k|xmlBufDumpNotationDecl(xmlOutputBufferPtr buf, xmlNotationPtr nota) {
  272|  1.24k|    xmlOutputBufferWrite(buf, 11, "<!NOTATION ");
  273|  1.24k|    xmlOutputBufferWriteString(buf, (const char *) nota->name);
  274|       |
  275|  1.24k|    if (nota->PublicID != NULL) {
  ------------------
  |  Branch (275:9): [True: 727, False: 517]
  ------------------
  276|    727|	xmlOutputBufferWrite(buf, 8, " PUBLIC ");
  277|    727|	xmlOutputBufferWriteQuotedString(buf, nota->PublicID);
  278|    727|	if (nota->SystemID != NULL) {
  ------------------
  |  Branch (278:6): [True: 17, False: 710]
  ------------------
  279|     17|	    xmlOutputBufferWrite(buf, 1, " ");
  280|     17|	    xmlOutputBufferWriteQuotedString(buf, nota->SystemID);
  281|     17|	}
  282|    727|    } else {
  283|    517|	xmlOutputBufferWrite(buf, 8, " SYSTEM ");
  284|    517|	xmlOutputBufferWriteQuotedString(buf, nota->SystemID);
  285|    517|    }
  286|       |
  287|  1.24k|    xmlOutputBufferWrite(buf, 3, " >\n");
  288|  1.24k|}
xmlsave.c:xmlBufDumpNotationTable:
  310|  1.21k|xmlBufDumpNotationTable(xmlOutputBufferPtr buf, xmlNotationTablePtr table) {
  311|  1.21k|    xmlHashScan(table, xmlBufDumpNotationDeclScan, buf);
  312|  1.21k|}
xmlsave.c:xmlBufDumpNotationDeclScan:
  299|  1.24k|                           const xmlChar *name ATTRIBUTE_UNUSED) {
  300|  1.24k|    xmlBufDumpNotationDecl((xmlOutputBufferPtr) buf, (xmlNotationPtr) nota);
  301|  1.24k|}
xmlsave.c:xmlSaveCtxtInit:
  153|  29.4k|{
  154|  29.4k|    if (ctxt == NULL) return;
  ------------------
  |  Branch (154:9): [True: 0, False: 29.4k]
  ------------------
  155|       |
  156|  29.4k|    xmlSaveSetIndentString(ctxt, xmlTreeIndentString);
  ------------------
  |  | 1364|  29.4k|    #define xmlTreeIndentString (*__xmlTreeIndentString())
  ------------------
  157|       |
  158|  29.4k|    if (options & XML_SAVE_FORMAT)
  ------------------
  |  Branch (158:9): [True: 0, False: 29.4k]
  ------------------
  159|      0|        ctxt->format = 1;
  160|  29.4k|    else if (options & XML_SAVE_WSNONSIG)
  ------------------
  |  Branch (160:14): [True: 0, False: 29.4k]
  ------------------
  161|      0|        ctxt->format = 2;
  162|       |
  163|  29.4k|    if (((options & XML_SAVE_EMPTY) == 0) &&
  ------------------
  |  Branch (163:9): [True: 29.4k, False: 0]
  ------------------
  164|  29.4k|        (xmlSaveNoEmptyTags))
  ------------------
  |  | 1372|  29.4k|    #define xmlSaveNoEmptyTags (*__xmlSaveNoEmptyTags())
  ------------------
  |  Branch (164:9): [True: 0, False: 29.4k]
  ------------------
  165|      0|	options |= XML_SAVE_NO_EMPTY;
  166|       |
  167|  29.4k|    ctxt->options = options;
  168|  29.4k|}

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

xmlStrndup:
   50|  21.0M|xmlStrndup(const xmlChar *cur, int len) {
   51|  21.0M|    xmlChar *ret;
   52|       |
   53|  21.0M|    if ((cur == NULL) || (len < 0)) return(NULL);
  ------------------
  |  Branch (53:9): [True: 0, False: 21.0M]
  |  Branch (53:26): [True: 0, False: 21.0M]
  ------------------
   54|  21.0M|    ret = xmlMalloc((size_t) len + 1);
   55|  21.0M|    if (ret == NULL) {
  ------------------
  |  Branch (55:9): [True: 2.43k, False: 20.9M]
  ------------------
   56|  2.43k|        return(NULL);
   57|  2.43k|    }
   58|  20.9M|    memcpy(ret, cur, len);
   59|  20.9M|    ret[len] = 0;
   60|  20.9M|    return(ret);
   61|  21.0M|}
xmlStrdup:
   72|  17.5M|xmlStrdup(const xmlChar *cur) {
   73|  17.5M|    const xmlChar *p = cur;
   74|       |
   75|  17.5M|    if (cur == NULL) return(NULL);
  ------------------
  |  Branch (75:9): [True: 16, False: 17.5M]
  ------------------
   76|   819M|    while (*p != 0) p++; /* non input consuming */
  ------------------
  |  Branch (76:12): [True: 801M, False: 17.5M]
  ------------------
   77|  17.5M|    return(xmlStrndup(cur, p - cur));
   78|  17.5M|}
xmlCharStrndup:
   89|   612k|xmlCharStrndup(const char *cur, int len) {
   90|   612k|    int i;
   91|   612k|    xmlChar *ret;
   92|       |
   93|   612k|    if ((cur == NULL) || (len < 0)) return(NULL);
  ------------------
  |  Branch (93:9): [True: 0, False: 612k]
  |  Branch (93:26): [True: 0, False: 612k]
  ------------------
   94|   612k|    ret = xmlMalloc((size_t) len + 1);
   95|   612k|    if (ret == NULL) {
  ------------------
  |  Branch (95:9): [True: 139, False: 612k]
  ------------------
   96|    139|        return(NULL);
   97|    139|    }
   98|  74.0M|    for (i = 0;i < len;i++) {
  ------------------
  |  Branch (98:16): [True: 73.3M, False: 612k]
  ------------------
   99|       |        /* Explicit sign change */
  100|  73.3M|        ret[i] = (xmlChar) cur[i];
  101|  73.3M|        if (ret[i] == 0) return(ret);
  ------------------
  |  Branch (101:13): [True: 0, False: 73.3M]
  ------------------
  102|  73.3M|    }
  103|   612k|    ret[len] = 0;
  104|   612k|    return(ret);
  105|   612k|}
xmlCharStrdup:
  115|   612k|xmlCharStrdup(const char *cur) {
  116|   612k|    const char *p = cur;
  117|       |
  118|   612k|    if (cur == NULL) return(NULL);
  ------------------
  |  Branch (118:9): [True: 0, False: 612k]
  ------------------
  119|  74.0M|    while (*p != '\0') p++; /* non input consuming */
  ------------------
  |  Branch (119:12): [True: 73.4M, False: 612k]
  ------------------
  120|   612k|    return(xmlCharStrndup(cur, p - cur));
  121|   612k|}
xmlStrcmp:
  132|  2.62k|xmlStrcmp(const xmlChar *str1, const xmlChar *str2) {
  133|  2.62k|    if (str1 == str2) return(0);
  ------------------
  |  Branch (133:9): [True: 2.57k, False: 45]
  ------------------
  134|     45|    if (str1 == NULL) return(-1);
  ------------------
  |  Branch (134:9): [True: 45, 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|  22.4M|xmlStrEqual(const xmlChar *str1, const xmlChar *str2) {
  158|  22.4M|    if (str1 == str2) return(1);
  ------------------
  |  Branch (158:9): [True: 479k, False: 21.9M]
  ------------------
  159|  21.9M|    if (str1 == NULL) return(0);
  ------------------
  |  Branch (159:9): [True: 2.47M, False: 19.4M]
  ------------------
  160|  19.4M|    if (str2 == NULL) return(0);
  ------------------
  |  Branch (160:9): [True: 2.66M, False: 16.8M]
  ------------------
  161|  16.8M|#ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
  162|  16.8M|    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|  19.4M|}
xmlStrQEqual:
  181|  38.7k|xmlStrQEqual(const xmlChar *pref, const xmlChar *name, const xmlChar *str) {
  182|  38.7k|    if (pref == NULL) return(xmlStrEqual(name, str));
  ------------------
  |  Branch (182:9): [True: 9.45k, False: 29.2k]
  ------------------
  183|  29.2k|    if (name == NULL) return(0);
  ------------------
  |  Branch (183:9): [True: 0, False: 29.2k]
  ------------------
  184|  29.2k|    if (str == NULL) return(0);
  ------------------
  |  Branch (184:9): [True: 0, False: 29.2k]
  ------------------
  185|       |
  186|  99.7k|    do {
  187|  99.7k|        if (*pref++ != *str) return(0);
  ------------------
  |  Branch (187:13): [True: 0, False: 99.7k]
  ------------------
  188|  99.7k|    } while ((*str++) && (*pref));
  ------------------
  |  Branch (188:14): [True: 99.7k, False: 0]
  |  Branch (188:26): [True: 70.4k, False: 29.2k]
  ------------------
  189|  29.2k|    if (*str++ != ':') return(0);
  ------------------
  |  Branch (189:9): [True: 0, False: 29.2k]
  ------------------
  190|   193k|    do {
  191|   193k|        if (*name++ != *str) return(0);
  ------------------
  |  Branch (191:13): [True: 0, False: 193k]
  ------------------
  192|   193k|    } while (*str++);
  ------------------
  |  Branch (192:14): [True: 164k, False: 29.2k]
  ------------------
  193|  29.2k|    return(1);
  194|  29.2k|}
xmlStrncmp:
  206|  25.3M|xmlStrncmp(const xmlChar *str1, const xmlChar *str2, int len) {
  207|  25.3M|    if (len <= 0) return(0);
  ------------------
  |  Branch (207:9): [True: 12, False: 25.3M]
  ------------------
  208|  25.3M|    if (str1 == str2) return(0);
  ------------------
  |  Branch (208:9): [True: 0, False: 25.3M]
  ------------------
  209|  25.3M|    if (str1 == NULL) return(-1);
  ------------------
  |  Branch (209:9): [True: 1, False: 25.3M]
  ------------------
  210|  25.3M|    if (str2 == NULL) return(1);
  ------------------
  |  Branch (210:9): [True: 0, False: 25.3M]
  ------------------
  211|  25.3M|#ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
  212|  25.3M|    return(strncmp((const char *)str1, (const char *)str2, len));
  213|       |#else
  214|       |    do {
  215|       |        int tmp = *str1++ - *str2;
  216|       |        if (tmp != 0 || --len == 0) return(tmp);
  217|       |    } while (*str2++ != 0);
  218|       |    return 0;
  219|       |#endif
  220|  25.3M|}
xmlStrcasecmp:
  266|  73.9k|xmlStrcasecmp(const xmlChar *str1, const xmlChar *str2) {
  267|  73.9k|    register int tmp;
  268|       |
  269|  73.9k|    if (str1 == str2) return(0);
  ------------------
  |  Branch (269:9): [True: 0, False: 73.9k]
  ------------------
  270|  73.9k|    if (str1 == NULL) return(-1);
  ------------------
  |  Branch (270:9): [True: 0, False: 73.9k]
  ------------------
  271|  73.9k|    if (str2 == NULL) return(1);
  ------------------
  |  Branch (271:9): [True: 0, False: 73.9k]
  ------------------
  272|   178k|    do {
  273|   178k|        tmp = casemap[*str1++] - casemap[*str2];
  274|   178k|        if (tmp != 0) return(tmp);
  ------------------
  |  Branch (274:13): [True: 70.4k, False: 108k]
  ------------------
  275|   178k|    } while (*str2++ != 0);
  ------------------
  |  Branch (275:14): [True: 104k, False: 3.48k]
  ------------------
  276|  3.48k|    return 0;
  277|  73.9k|}
xmlStrchr:
  312|  81.0M|xmlStrchr(const xmlChar *str, xmlChar val) {
  313|  81.0M|    if (str == NULL) return(NULL);
  ------------------
  |  Branch (313:9): [True: 0, False: 81.0M]
  ------------------
  314|   392M|    while (*str != 0) { /* non input consuming */
  ------------------
  |  Branch (314:12): [True: 311M, False: 80.8M]
  ------------------
  315|   311M|        if (*str == val) return((xmlChar *) str);
  ------------------
  |  Branch (315:13): [True: 276k, False: 311M]
  ------------------
  316|   311M|        str++;
  317|   311M|    }
  318|  80.8M|    return(NULL);
  319|  81.0M|}
xmlStrstr:
  330|   331k|xmlStrstr(const xmlChar *str, const xmlChar *val) {
  331|   331k|    int n;
  332|       |
  333|   331k|    if (str == NULL) return(NULL);
  ------------------
  |  Branch (333:9): [True: 0, False: 331k]
  ------------------
  334|   331k|    if (val == NULL) return(NULL);
  ------------------
  |  Branch (334:9): [True: 0, False: 331k]
  ------------------
  335|   331k|    n = xmlStrlen(val);
  336|       |
  337|   331k|    if (n == 0) return(str);
  ------------------
  |  Branch (337:9): [True: 0, False: 331k]
  ------------------
  338|  2.34M|    while (*str != 0) { /* non input consuming */
  ------------------
  |  Branch (338:12): [True: 2.03M, False: 306k]
  ------------------
  339|  2.03M|        if (*str == *val) {
  ------------------
  |  Branch (339:13): [True: 33.2k, False: 2.00M]
  ------------------
  340|  33.2k|            if (!xmlStrncmp(str, val, n)) return((const xmlChar *) str);
  ------------------
  |  Branch (340:17): [True: 24.1k, False: 9.11k]
  ------------------
  341|  33.2k|        }
  342|  2.01M|        str++;
  343|  2.01M|    }
  344|   306k|    return(NULL);
  345|   331k|}
xmlStrlen:
  405|  1.74M|xmlStrlen(const xmlChar *str) {
  406|  1.74M|    size_t len = str ? strlen((const char *)str) : 0;
  ------------------
  |  Branch (406:18): [True: 1.74M, False: 1.64k]
  ------------------
  407|  1.74M|    return(len > INT_MAX ? 0 : len);
  ------------------
  |  Branch (407:12): [True: 0, False: 1.74M]
  ------------------
  408|  1.74M|}
xmlStrncat:
  423|   161k|xmlStrncat(xmlChar *cur, const xmlChar *add, int len) {
  424|   161k|    int size;
  425|   161k|    xmlChar *ret;
  426|       |
  427|   161k|    if ((add == NULL) || (len == 0))
  ------------------
  |  Branch (427:9): [True: 0, False: 161k]
  |  Branch (427:26): [True: 341, False: 161k]
  ------------------
  428|    341|        return(cur);
  429|       |
  430|   161k|    if (len < 0) {
  ------------------
  |  Branch (430:9): [True: 0, False: 161k]
  ------------------
  431|      0|        if (cur != NULL)
  ------------------
  |  Branch (431:13): [True: 0, False: 0]
  ------------------
  432|      0|            xmlFree(cur);
  433|      0|        return(NULL);
  434|      0|    }
  435|       |
  436|   161k|    if (cur == NULL)
  ------------------
  |  Branch (436:9): [True: 0, False: 161k]
  ------------------
  437|      0|        return(xmlStrndup(add, len));
  438|       |
  439|   161k|    size = xmlStrlen(cur);
  440|   161k|    if ((size < 0) || (size > INT_MAX - len)) {
  ------------------
  |  Branch (440:9): [True: 0, False: 161k]
  |  Branch (440:23): [True: 0, False: 161k]
  ------------------
  441|      0|        xmlFree(cur);
  442|      0|        return(NULL);
  443|      0|    }
  444|   161k|    ret = (xmlChar *) xmlRealloc(cur, (size_t) size + len + 1);
  445|   161k|    if (ret == NULL) {
  ------------------
  |  Branch (445:9): [True: 16, False: 161k]
  ------------------
  446|     16|        xmlFree(cur);
  447|     16|        return(NULL);
  448|     16|    }
  449|   161k|    memcpy(&ret[size], add, len);
  450|   161k|    ret[size + len] = 0;
  451|   161k|    return(ret);
  452|   161k|}
xmlStrncatNew:
  465|     22|xmlStrncatNew(const xmlChar *str1, const xmlChar *str2, int len) {
  466|     22|    int size;
  467|     22|    xmlChar *ret;
  468|       |
  469|     22|    if (len < 0) {
  ------------------
  |  Branch (469:9): [True: 0, False: 22]
  ------------------
  470|      0|        len = xmlStrlen(str2);
  471|      0|        if (len < 0)
  ------------------
  |  Branch (471:13): [True: 0, False: 0]
  ------------------
  472|      0|            return(NULL);
  473|      0|    }
  474|     22|    if (str1 == NULL)
  ------------------
  |  Branch (474:9): [True: 22, False: 0]
  ------------------
  475|     22|        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|   161k|xmlStrcat(xmlChar *cur, const xmlChar *add) {
  503|   161k|    const xmlChar *p = add;
  504|       |
  505|   161k|    if (add == NULL) return(cur);
  ------------------
  |  Branch (505:9): [True: 4, False: 161k]
  ------------------
  506|   161k|    if (cur == NULL)
  ------------------
  |  Branch (506:9): [True: 2, False: 161k]
  ------------------
  507|      2|        return(xmlStrdup(add));
  508|       |
  509|  2.88M|    while (*p != 0) p++; /* non input consuming */
  ------------------
  |  Branch (509:12): [True: 2.72M, False: 161k]
  ------------------
  510|   161k|    return(xmlStrncat(cur, add, p - add));
  511|   161k|}
xmlStrVASPrintf:
  573|  1.09M|xmlStrVASPrintf(xmlChar **out, int maxSize, const char *msg, va_list ap) {
  574|  1.09M|    char empty[1];
  575|  1.09M|    va_list copy;
  576|  1.09M|    xmlChar *buf;
  577|  1.09M|    int res, size;
  578|  1.09M|    int truncated = 0;
  579|       |
  580|  1.09M|    if (out == NULL)
  ------------------
  |  Branch (580:9): [True: 0, False: 1.09M]
  ------------------
  581|      0|        return(1);
  582|  1.09M|    *out = NULL;
  583|  1.09M|    if (msg == NULL)
  ------------------
  |  Branch (583:9): [True: 0, False: 1.09M]
  ------------------
  584|      0|        return(1);
  585|  1.09M|    if (maxSize < 32)
  ------------------
  |  Branch (585:9): [True: 0, False: 1.09M]
  ------------------
  586|      0|        maxSize = 32;
  587|       |
  588|  1.09M|    va_copy(copy, ap);
  589|  1.09M|    res = vsnprintf(empty, 1, msg, copy);
  590|  1.09M|    va_end(copy);
  591|       |
  592|  1.09M|    if (res > 0) {
  ------------------
  |  Branch (592:9): [True: 1.09M, False: 0]
  ------------------
  593|       |        /* snprintf seems to work according to C99. */
  594|       |
  595|  1.09M|        if (res < maxSize) {
  ------------------
  |  Branch (595:13): [True: 1.09M, False: 289]
  ------------------
  596|  1.09M|            size = res + 1;
  597|  1.09M|        } else {
  598|    289|            size = maxSize;
  599|    289|            truncated = 1;
  600|    289|        }
  601|  1.09M|        buf = xmlMalloc(size);
  602|  1.09M|        if (buf == NULL)
  ------------------
  |  Branch (602:13): [True: 1.23k, False: 1.09M]
  ------------------
  603|  1.23k|            return(-1);
  604|  1.09M|        if (vsnprintf((char *) buf, size, msg, ap) < 0) {
  ------------------
  |  Branch (604:13): [True: 0, False: 1.09M]
  ------------------
  605|      0|            xmlFree(buf);
  606|      0|            return(1);
  607|      0|        }
  608|  1.09M|    } 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.09M|    if (truncated != 0) {
  ------------------
  |  Branch (658:9): [True: 289, False: 1.09M]
  ------------------
  659|    289|        int i = size - 1;
  660|       |
  661|    446|        while (i > 0) {
  ------------------
  |  Branch (661:16): [True: 446, False: 0]
  ------------------
  662|       |            /* Break after ASCII */
  663|    446|            if (buf[i-1] < 0x80)
  ------------------
  |  Branch (663:17): [True: 134, False: 312]
  ------------------
  664|    134|                break;
  665|    312|            i -= 1;
  666|       |            /* Break before non-ASCII */
  667|    312|            if (buf[i] >= 0xc0)
  ------------------
  |  Branch (667:17): [True: 155, False: 157]
  ------------------
  668|    155|                break;
  669|    312|        }
  670|       |
  671|    289|        buf[i] = 0;
  672|    289|    }
  673|       |
  674|  1.09M|    *out = (xmlChar *) buf;
  675|  1.09M|    return(truncated);
  676|  1.09M|}
xmlUTF8Strlen:
  770|  11.7k|xmlUTF8Strlen(const xmlChar *utf) {
  771|  11.7k|    size_t ret = 0;
  772|       |
  773|  11.7k|    if (utf == NULL)
  ------------------
  |  Branch (773:9): [True: 4, False: 11.7k]
  ------------------
  774|      4|        return(-1);
  775|       |
  776|  1.15M|    while (*utf != 0) {
  ------------------
  |  Branch (776:12): [True: 1.14M, False: 11.7k]
  ------------------
  777|  1.14M|        if (utf[0] & 0x80) {
  ------------------
  |  Branch (777:13): [True: 13.1k, False: 1.13M]
  ------------------
  778|  13.1k|            if ((utf[1] & 0xc0) != 0x80)
  ------------------
  |  Branch (778:17): [True: 0, False: 13.1k]
  ------------------
  779|      0|                return(-1);
  780|  13.1k|            if ((utf[0] & 0xe0) == 0xe0) {
  ------------------
  |  Branch (780:17): [True: 3.78k, False: 9.32k]
  ------------------
  781|  3.78k|                if ((utf[2] & 0xc0) != 0x80)
  ------------------
  |  Branch (781:21): [True: 0, False: 3.78k]
  ------------------
  782|      0|                    return(-1);
  783|  3.78k|                if ((utf[0] & 0xf0) == 0xf0) {
  ------------------
  |  Branch (783:21): [True: 698, False: 3.08k]
  ------------------
  784|    698|                    if ((utf[0] & 0xf8) != 0xf0 || (utf[3] & 0xc0) != 0x80)
  ------------------
  |  Branch (784:25): [True: 0, False: 698]
  |  Branch (784:52): [True: 0, False: 698]
  ------------------
  785|      0|                        return(-1);
  786|    698|                    utf += 4;
  787|  3.08k|                } else {
  788|  3.08k|                    utf += 3;
  789|  3.08k|                }
  790|  9.32k|            } else {
  791|  9.32k|                utf += 2;
  792|  9.32k|            }
  793|  1.13M|        } else {
  794|  1.13M|            utf++;
  795|  1.13M|        }
  796|  1.14M|        ret++;
  797|  1.14M|    }
  798|  11.7k|    return(ret > INT_MAX ? 0 : ret);
  ------------------
  |  Branch (798:12): [True: 0, False: 11.7k]
  ------------------
  799|  11.7k|}
xmlGetUTF8Char:
  812|  18.1M|xmlGetUTF8Char(const unsigned char *utf, int *len) {
  813|  18.1M|    unsigned int c;
  814|       |
  815|  18.1M|    if (utf == NULL)
  ------------------
  |  Branch (815:9): [True: 0, False: 18.1M]
  ------------------
  816|      0|        goto error;
  817|  18.1M|    if (len == NULL)
  ------------------
  |  Branch (817:9): [True: 0, False: 18.1M]
  ------------------
  818|      0|        goto error;
  819|       |
  820|  18.1M|    c = utf[0];
  821|  18.1M|    if (c < 0x80) {
  ------------------
  |  Branch (821:9): [True: 13.9M, False: 4.13M]
  ------------------
  822|  13.9M|        if (*len < 1)
  ------------------
  |  Branch (822:13): [True: 0, False: 13.9M]
  ------------------
  823|      0|            goto error;
  824|       |        /* 1-byte code */
  825|  13.9M|        *len = 1;
  826|  13.9M|    } else {
  827|  4.13M|        if ((*len < 2) || ((utf[1] & 0xc0) != 0x80))
  ------------------
  |  Branch (827:13): [True: 78, False: 4.13M]
  |  Branch (827:27): [True: 69.6k, False: 4.06M]
  ------------------
  828|  69.7k|            goto error;
  829|  4.06M|        if (c < 0xe0) {
  ------------------
  |  Branch (829:13): [True: 114k, False: 3.95M]
  ------------------
  830|   114k|            if (c < 0xc2)
  ------------------
  |  Branch (830:17): [True: 50.8k, False: 63.9k]
  ------------------
  831|  50.8k|                goto error;
  832|       |            /* 2-byte code */
  833|  63.9k|            *len = 2;
  834|  63.9k|            c = (c & 0x1f) << 6;
  835|  63.9k|            c |= utf[1] & 0x3f;
  836|  3.95M|        } else {
  837|  3.95M|            if ((*len < 3) || ((utf[2] & 0xc0) != 0x80))
  ------------------
  |  Branch (837:17): [True: 54, False: 3.95M]
  |  Branch (837:31): [True: 122, False: 3.95M]
  ------------------
  838|    176|                goto error;
  839|  3.95M|            if (c < 0xf0) {
  ------------------
  |  Branch (839:17): [True: 3.94M, False: 3.33k]
  ------------------
  840|       |                /* 3-byte code */
  841|  3.94M|                *len = 3;
  842|  3.94M|                c = (c & 0xf) << 12;
  843|  3.94M|                c |= (utf[1] & 0x3f) << 6;
  844|  3.94M|                c |= utf[2] & 0x3f;
  845|  3.94M|                if ((c < 0x800) || ((c >= 0xd800) && (c < 0xe000)))
  ------------------
  |  Branch (845:21): [True: 237, False: 3.94M]
  |  Branch (845:37): [True: 1.87M, False: 2.07M]
  |  Branch (845:54): [True: 162, False: 1.87M]
  ------------------
  846|    399|                    goto error;
  847|  3.94M|            } else {
  848|  3.33k|                if ((*len < 4) || ((utf[3] & 0xc0) != 0x80))
  ------------------
  |  Branch (848:21): [True: 72, False: 3.26k]
  |  Branch (848:35): [True: 151, False: 3.10k]
  ------------------
  849|    223|                    goto error;
  850|  3.10k|                *len = 4;
  851|       |                /* 4-byte code */
  852|  3.10k|                c = (c & 0x7) << 18;
  853|  3.10k|                c |= (utf[1] & 0x3f) << 12;
  854|  3.10k|                c |= (utf[2] & 0x3f) << 6;
  855|  3.10k|                c |= utf[3] & 0x3f;
  856|  3.10k|                if ((c < 0x10000) || (c >= 0x110000))
  ------------------
  |  Branch (856:21): [True: 286, False: 2.82k]
  |  Branch (856:38): [True: 237, False: 2.58k]
  ------------------
  857|    523|                    goto error;
  858|  3.10k|            }
  859|  3.95M|        }
  860|  4.06M|    }
  861|  17.9M|    return(c);
  862|       |
  863|   121k|error:
  864|   121k|    if (len != NULL)
  ------------------
  |  Branch (864:9): [True: 121k, False: 0]
  ------------------
  865|   121k|	*len = 0;
  866|   121k|    return(-1);
  867|  18.1M|}
xmlUTF8Strsize:
  933|   215k|xmlUTF8Strsize(const xmlChar *utf, int len) {
  934|   215k|    const xmlChar *ptr=utf;
  935|   215k|    int ch;
  936|   215k|    size_t ret;
  937|       |
  938|   215k|    if (utf == NULL)
  ------------------
  |  Branch (938:9): [True: 0, False: 215k]
  ------------------
  939|      0|        return(0);
  940|       |
  941|   215k|    if (len <= 0)
  ------------------
  |  Branch (941:9): [True: 0, False: 215k]
  ------------------
  942|      0|        return(0);
  943|       |
  944|   436k|    while ( len-- > 0) {
  ------------------
  |  Branch (944:13): [True: 221k, False: 214k]
  ------------------
  945|   221k|        if ( !*ptr )
  ------------------
  |  Branch (945:14): [True: 1.36k, False: 220k]
  ------------------
  946|  1.36k|            break;
  947|   220k|        ch = *ptr++;
  948|   220k|        if ((ch & 0x80))
  ------------------
  |  Branch (948:13): [True: 74, False: 220k]
  ------------------
  949|    148|            while ((ch<<=1) & 0x80 ) {
  ------------------
  |  Branch (949:20): [True: 74, False: 74]
  ------------------
  950|     74|		if (*ptr == 0) break;
  ------------------
  |  Branch (950:7): [True: 0, False: 74]
  ------------------
  951|     74|                ptr++;
  952|     74|	    }
  953|   220k|    }
  954|   215k|    ret = ptr - utf;
  955|   215k|    return (ret > INT_MAX ? 0 : ret);
  ------------------
  |  Branch (955:13): [True: 0, False: 215k]
  ------------------
  956|   215k|}
xmlUTF8Strndup:
  967|  1.67k|xmlUTF8Strndup(const xmlChar *utf, int len) {
  968|  1.67k|    xmlChar *ret;
  969|  1.67k|    int i;
  970|       |
  971|  1.67k|    if ((utf == NULL) || (len < 0)) return(NULL);
  ------------------
  |  Branch (971:9): [True: 0, False: 1.67k]
  |  Branch (971:26): [True: 0, False: 1.67k]
  ------------------
  972|  1.67k|    i = xmlUTF8Strsize(utf, len);
  973|  1.67k|    ret = xmlMalloc((size_t) i + 1);
  974|  1.67k|    if (ret == NULL) {
  ------------------
  |  Branch (974:9): [True: 1, False: 1.66k]
  ------------------
  975|      1|        return(NULL);
  976|      1|    }
  977|  1.66k|    memcpy(ret, utf, i);
  978|  1.66k|    ret[i] = 0;
  979|  1.66k|    return(ret);
  980|  1.67k|}
xmlUTF8Strpos:
  991|  29.6k|xmlUTF8Strpos(const xmlChar *utf, int pos) {
  992|  29.6k|    int ch;
  993|       |
  994|  29.6k|    if (utf == NULL) return(NULL);
  ------------------
  |  Branch (994:9): [True: 0, False: 29.6k]
  ------------------
  995|  29.6k|    if (pos < 0)
  ------------------
  |  Branch (995:9): [True: 0, False: 29.6k]
  ------------------
  996|      0|        return(NULL);
  997|  4.79M|    while (pos--) {
  ------------------
  |  Branch (997:12): [True: 4.76M, False: 29.6k]
  ------------------
  998|  4.76M|        ch = *utf++;
  999|  4.76M|        if (ch == 0)
  ------------------
  |  Branch (999:13): [True: 0, False: 4.76M]
  ------------------
 1000|      0|            return(NULL);
 1001|  4.76M|        if ( ch & 0x80 ) {
  ------------------
  |  Branch (1001:14): [True: 23.2k, False: 4.73M]
  ------------------
 1002|       |            /* if not simple ascii, verify proper format */
 1003|  23.2k|            if ( (ch & 0xc0) != 0xc0 )
  ------------------
  |  Branch (1003:18): [True: 0, False: 23.2k]
  ------------------
 1004|      0|                return(NULL);
 1005|       |            /* then skip over remaining bytes for this char */
 1006|  68.0k|            while ( (ch <<= 1) & 0x80 )
  ------------------
  |  Branch (1006:21): [True: 44.8k, False: 23.2k]
  ------------------
 1007|  44.8k|                if ( (*utf++ & 0xc0) != 0x80 )
  ------------------
  |  Branch (1007:22): [True: 0, False: 44.8k]
  ------------------
 1008|      0|                    return(NULL);
 1009|  23.2k|        }
 1010|  4.76M|    }
 1011|  29.6k|    return((xmlChar *)utf);
 1012|  29.6k|}
xmlUTF8Strloc:
 1023|   112k|xmlUTF8Strloc(const xmlChar *utf, const xmlChar *utfchar) {
 1024|   112k|    size_t i;
 1025|   112k|    int size;
 1026|   112k|    int ch;
 1027|       |
 1028|   112k|    if (utf==NULL || utfchar==NULL) return -1;
  ------------------
  |  Branch (1028:9): [True: 0, False: 112k]
  |  Branch (1028:22): [True: 0, False: 112k]
  ------------------
 1029|   112k|    size = xmlUTF8Strsize(utfchar, 1);
 1030|  24.4M|        for(i=0; (ch=*utf) != 0; i++) {
  ------------------
  |  Branch (1030:18): [True: 24.4M, False: 71.7k]
  ------------------
 1031|  24.4M|            if (xmlStrncmp(utf, utfchar, size)==0)
  ------------------
  |  Branch (1031:17): [True: 40.7k, False: 24.3M]
  ------------------
 1032|  40.7k|                return(i > INT_MAX ? 0 : i);
  ------------------
  |  Branch (1032:24): [True: 0, False: 40.7k]
  ------------------
 1033|  24.3M|            utf++;
 1034|  24.3M|            if ( ch & 0x80 ) {
  ------------------
  |  Branch (1034:18): [True: 200k, False: 24.1M]
  ------------------
 1035|       |                /* if not simple ascii, verify proper format */
 1036|   200k|                if ( (ch & 0xc0) != 0xc0 )
  ------------------
  |  Branch (1036:22): [True: 0, False: 200k]
  ------------------
 1037|      0|                    return(-1);
 1038|       |                /* then skip over remaining bytes for this char */
 1039|   510k|                while ( (ch <<= 1) & 0x80 )
  ------------------
  |  Branch (1039:25): [True: 309k, False: 200k]
  ------------------
 1040|   309k|                    if ( (*utf++ & 0xc0) != 0x80 )
  ------------------
  |  Branch (1040:26): [True: 0, False: 309k]
  ------------------
 1041|      0|                        return(-1);
 1042|   200k|            }
 1043|  24.3M|        }
 1044|       |
 1045|  71.7k|    return(-1);
 1046|   112k|}
xmlUTF8Strsub:
 1060|  1.67k|xmlUTF8Strsub(const xmlChar *utf, int start, int len) {
 1061|  1.67k|    int i;
 1062|  1.67k|    int ch;
 1063|       |
 1064|  1.67k|    if (utf == NULL) return(NULL);
  ------------------
  |  Branch (1064:9): [True: 0, False: 1.67k]
  ------------------
 1065|  1.67k|    if (start < 0) return(NULL);
  ------------------
  |  Branch (1065:9): [True: 0, False: 1.67k]
  ------------------
 1066|  1.67k|    if (len < 0) return(NULL);
  ------------------
  |  Branch (1066:9): [True: 0, False: 1.67k]
  ------------------
 1067|       |
 1068|       |    /*
 1069|       |     * Skip over any leading chars
 1070|       |     */
 1071|  3.75k|    for (i = 0; i < start; i++) {
  ------------------
  |  Branch (1071:17): [True: 2.08k, False: 1.67k]
  ------------------
 1072|  2.08k|        ch = *utf++;
 1073|  2.08k|        if (ch == 0)
  ------------------
  |  Branch (1073:13): [True: 0, False: 2.08k]
  ------------------
 1074|      0|            return(NULL);
 1075|       |        /* skip over remaining bytes for this char */
 1076|  2.08k|        if (ch & 0x80) {
  ------------------
  |  Branch (1076:13): [True: 0, False: 2.08k]
  ------------------
 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|  2.08k|    }
 1085|       |
 1086|  1.67k|    return(xmlUTF8Strndup(utf, len));
 1087|  1.67k|}

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|   425k|xmlXPathIsNaN(double val) {
  251|   425k|#ifdef isnan
  252|   425k|    return isnan(val);
  253|       |#else
  254|       |    return !(val == val);
  255|       |#endif
  256|   425k|}
xmlXPathIsInf:
  265|   233k|xmlXPathIsInf(double val) {
  266|   233k|#ifdef isinf
  267|   233k|    return isinf(val) ? (val > 0 ? 1 : -1) : 0;
  ------------------
  |  Branch (267:12): [True: 11.1k, False: 221k]
  |  Branch (267:26): [True: 6.36k, False: 4.81k]
  ------------------
  268|       |#else
  269|       |    if (val >= xmlXPathPINF)
  270|       |        return 1;
  271|       |    if (val <= -xmlXPathPINF)
  272|       |        return -1;
  273|       |    return 0;
  274|       |#endif
  275|   233k|}
xmlXPathErrMemory:
  677|  2.78k|{
  678|  2.78k|    if (ctxt == NULL)
  ------------------
  |  Branch (678:9): [True: 0, False: 2.78k]
  ------------------
  679|      0|        return;
  680|  2.78k|    xmlRaiseMemoryError(ctxt->error, NULL, ctxt->userData, XML_FROM_XPATH,
  681|  2.78k|                        &ctxt->lastError);
  682|  2.78k|}
xmlXPathPErrMemory:
  691|  2.66k|{
  692|  2.66k|    if (ctxt == NULL)
  ------------------
  |  Branch (692:9): [True: 0, False: 2.66k]
  ------------------
  693|      0|        return;
  694|  2.66k|    ctxt->error = XPATH_MEMORY_ERROR;
  695|  2.66k|    xmlXPathErrMemory(ctxt->context);
  696|  2.66k|}
xmlXPathErr:
  777|  6.45k|xmlXPathErr(xmlXPathParserContext *ctxt, int code) {
  778|  6.45k|    xmlXPathErrFmt(ctxt, code, "%s\n", xmlXPathErrorMessages[code]);
  779|  6.45k|}
xmlXPathFreeCompExpr:
  971|  8.78k|{
  972|  8.78k|    xmlXPathStepOpPtr op;
  973|  8.78k|    int i;
  974|       |
  975|  8.78k|    if (comp == NULL)
  ------------------
  |  Branch (975:9): [True: 0, False: 8.78k]
  ------------------
  976|      0|        return;
  977|  8.78k|    if (comp->dict == NULL) {
  ------------------
  |  Branch (977:9): [True: 8.78k, False: 0]
  ------------------
  978|  2.96M|	for (i = 0; i < comp->nbStep; i++) {
  ------------------
  |  Branch (978:14): [True: 2.95M, False: 8.78k]
  ------------------
  979|  2.95M|	    op = &comp->steps[i];
  980|  2.95M|	    if (op->value4 != NULL) {
  ------------------
  |  Branch (980:10): [True: 52.9k, False: 2.90M]
  ------------------
  981|  52.9k|		if (op->op == XPATH_OP_VALUE)
  ------------------
  |  Branch (981:7): [True: 40.1k, False: 12.7k]
  ------------------
  982|  40.1k|		    xmlXPathFreeObject(op->value4);
  983|  12.7k|		else
  984|  12.7k|		    xmlFree(op->value4);
  985|  52.9k|	    }
  986|  2.95M|	    if (op->value5 != NULL)
  ------------------
  |  Branch (986:10): [True: 74.2k, False: 2.88M]
  ------------------
  987|  74.2k|		xmlFree(op->value5);
  988|  2.95M|	}
  989|  8.78k|    } 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|  8.78k|    if (comp->steps != NULL) {
  ------------------
  |  Branch (999:9): [True: 8.78k, False: 0]
  ------------------
 1000|  8.78k|        xmlFree(comp->steps);
 1001|  8.78k|    }
 1002|       |#ifdef XPATH_STREAMING
 1003|       |    if (comp->stream != NULL) {
 1004|       |        xmlFreePatternList(comp->stream);
 1005|       |    }
 1006|       |#endif
 1007|  8.78k|    if (comp->expr != NULL) {
  ------------------
  |  Branch (1007:9): [True: 0, False: 8.78k]
  ------------------
 1008|      0|        xmlFree(comp->expr);
 1009|      0|    }
 1010|       |
 1011|  8.78k|    xmlFree(comp);
 1012|  8.78k|}
xmlXPathValuePop:
 1979|  3.57M|{
 1980|  3.57M|    xmlXPathObjectPtr ret;
 1981|       |
 1982|  3.57M|    if ((ctxt == NULL) || (ctxt->valueNr <= 0))
  ------------------
  |  Branch (1982:9): [True: 0, False: 3.57M]
  |  Branch (1982:27): [True: 9.02k, False: 3.56M]
  ------------------
 1983|  9.02k|        return (NULL);
 1984|       |
 1985|  3.56M|    ctxt->valueNr--;
 1986|  3.56M|    if (ctxt->valueNr > 0)
  ------------------
  |  Branch (1986:9): [True: 3.04M, False: 519k]
  ------------------
 1987|  3.04M|        ctxt->value = ctxt->valueTab[ctxt->valueNr - 1];
 1988|   519k|    else
 1989|   519k|        ctxt->value = NULL;
 1990|  3.56M|    ret = ctxt->valueTab[ctxt->valueNr];
 1991|       |    ctxt->valueTab[ctxt->valueNr] = NULL;
 1992|  3.56M|    return (ret);
 1993|  3.57M|}
xmlXPathValuePush:
 2007|  3.57M|{
 2008|  3.57M|    if (ctxt == NULL) return(-1);
  ------------------
  |  Branch (2008:9): [True: 0, False: 3.57M]
  ------------------
 2009|  3.57M|    if (value == NULL) {
  ------------------
  |  Branch (2009:9): [True: 834, False: 3.57M]
  ------------------
 2010|       |        /*
 2011|       |         * A NULL value typically indicates that a memory allocation failed.
 2012|       |         */
 2013|    834|        xmlXPathPErrMemory(ctxt);
 2014|    834|        return(-1);
 2015|    834|    }
 2016|  3.57M|    if (ctxt->valueNr >= ctxt->valueMax) {
  ------------------
  |  Branch (2016:9): [True: 260, False: 3.57M]
  ------------------
 2017|    260|        xmlXPathObjectPtr *tmp;
 2018|    260|        int newSize;
 2019|       |
 2020|    260|        newSize = xmlGrowCapacity(ctxt->valueMax, sizeof(tmp[0]),
 2021|    260|                                  10, XPATH_MAX_STACK_DEPTH);
  ------------------
  |  |   96|    260|#define XPATH_MAX_STACK_DEPTH 1000000
  ------------------
 2022|    260|        if (newSize < 0) {
  ------------------
  |  Branch (2022:13): [True: 0, False: 260]
  ------------------
 2023|      0|            xmlXPathPErrMemory(ctxt);
 2024|      0|            xmlXPathFreeObject(value);
 2025|      0|            return (-1);
 2026|      0|        }
 2027|    260|        tmp = xmlRealloc(ctxt->valueTab, newSize * sizeof(tmp[0]));
 2028|    260|        if (tmp == NULL) {
  ------------------
  |  Branch (2028:13): [True: 1, False: 259]
  ------------------
 2029|      1|            xmlXPathPErrMemory(ctxt);
 2030|      1|            xmlXPathFreeObject(value);
 2031|      1|            return (-1);
 2032|      1|        }
 2033|    259|	ctxt->valueTab = tmp;
 2034|    259|        ctxt->valueMax = newSize;
 2035|    259|    }
 2036|  3.57M|    ctxt->valueTab[ctxt->valueNr] = value;
 2037|  3.57M|    ctxt->value = value;
 2038|  3.57M|    return (ctxt->valueNr++);
 2039|  3.57M|}
xmlXPathNodeSetSort:
 2552|  31.4k|xmlXPathNodeSetSort(xmlNodeSet *set) {
 2553|       |#ifndef WITH_TIM_SORT
 2554|       |    int i, j, incr, len;
 2555|       |    xmlNodePtr tmp;
 2556|       |#endif
 2557|       |
 2558|  31.4k|    if (set == NULL)
  ------------------
  |  Branch (2558:9): [True: 0, False: 31.4k]
  ------------------
 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.4k|    libxml_domnode_tim_sort(set->nodeTab, set->nodeNr);
 2590|  31.4k|#endif /* WITH_TIM_SORT */
 2591|  31.4k|}
xmlXPathNodeSetFreeNs:
 2647|  68.3k|xmlXPathNodeSetFreeNs(xmlNs *ns) {
 2648|  68.3k|    if ((ns == NULL) || (ns->type != XML_NAMESPACE_DECL))
  ------------------
  |  Branch (2648:9): [True: 0, False: 68.3k]
  |  Branch (2648:25): [True: 0, False: 68.3k]
  ------------------
 2649|      0|	return;
 2650|       |
 2651|  68.3k|    if ((ns->next != NULL) && (ns->next->type != XML_NAMESPACE_DECL)) {
  ------------------
  |  Branch (2651:9): [True: 68.3k, False: 0]
  |  Branch (2651:31): [True: 68.3k, False: 0]
  ------------------
 2652|  68.3k|	if (ns->href != NULL)
  ------------------
  |  Branch (2652:6): [True: 41.9k, False: 26.4k]
  ------------------
 2653|  41.9k|	    xmlFree((xmlChar *)ns->href);
 2654|  68.3k|	if (ns->prefix != NULL)
  ------------------
  |  Branch (2654:6): [True: 55.7k, False: 12.6k]
  ------------------
 2655|  55.7k|	    xmlFree((xmlChar *)ns->prefix);
 2656|  68.3k|	xmlFree(ns);
 2657|  68.3k|    }
 2658|  68.3k|}
xmlXPathNodeSetCreate:
 2667|  2.12M|xmlXPathNodeSetCreate(xmlNode *val) {
 2668|  2.12M|    xmlNodeSetPtr ret;
 2669|       |
 2670|  2.12M|    ret = (xmlNodeSetPtr) xmlMalloc(sizeof(xmlNodeSet));
 2671|  2.12M|    if (ret == NULL)
  ------------------
  |  Branch (2671:9): [True: 249, False: 2.12M]
  ------------------
 2672|    249|	return(NULL);
 2673|  2.12M|    memset(ret, 0 , sizeof(xmlNodeSet));
 2674|  2.12M|    if (val != NULL) {
  ------------------
  |  Branch (2674:9): [True: 1.11M, False: 1.01M]
  ------------------
 2675|  1.11M|        ret->nodeTab = (xmlNodePtr *) xmlMalloc(XML_NODESET_DEFAULT *
  ------------------
  |  | 2593|  1.11M|#define XML_NODESET_DEFAULT	10
  ------------------
 2676|  1.11M|					     sizeof(xmlNodePtr));
 2677|  1.11M|	if (ret->nodeTab == NULL) {
  ------------------
  |  Branch (2677:6): [True: 109, False: 1.10M]
  ------------------
 2678|    109|	    xmlFree(ret);
 2679|    109|	    return(NULL);
 2680|    109|	}
 2681|  1.10M|	memset(ret->nodeTab, 0 ,
 2682|  1.10M|	       XML_NODESET_DEFAULT * sizeof(xmlNodePtr));
  ------------------
  |  | 2593|  1.10M|#define XML_NODESET_DEFAULT	10
  ------------------
 2683|  1.10M|        ret->nodeMax = XML_NODESET_DEFAULT;
  ------------------
  |  | 2593|  1.10M|#define XML_NODESET_DEFAULT	10
  ------------------
 2684|  1.10M|	if (val->type == XML_NAMESPACE_DECL) {
  ------------------
  |  Branch (2684:6): [True: 27.6k, False: 1.08M]
  ------------------
 2685|  27.6k|	    xmlNsPtr ns = (xmlNsPtr) val;
 2686|  27.6k|            xmlNodePtr nsNode = xmlXPathNodeSetDupNs((xmlNodePtr) ns->next, ns);
 2687|       |
 2688|  27.6k|            if (nsNode == NULL) {
  ------------------
  |  Branch (2688:17): [True: 5, False: 27.6k]
  ------------------
 2689|      5|                xmlXPathFreeNodeSet(ret);
 2690|      5|                return(NULL);
 2691|      5|            }
 2692|  27.6k|	    ret->nodeTab[ret->nodeNr++] = nsNode;
 2693|  27.6k|	} else
 2694|  1.08M|	    ret->nodeTab[ret->nodeNr++] = val;
 2695|  1.10M|    }
 2696|  2.12M|    return(ret);
 2697|  2.12M|}
xmlXPathNodeSetAddNs:
 2761|  35.6k|xmlXPathNodeSetAddNs(xmlNodeSet *cur, xmlNode *node, xmlNs *ns) {
 2762|  35.6k|    int i;
 2763|  35.6k|    xmlNodePtr nsNode;
 2764|       |
 2765|  35.6k|    if ((cur == NULL) || (ns == NULL) || (node == NULL) ||
  ------------------
  |  Branch (2765:9): [True: 0, False: 35.6k]
  |  Branch (2765:26): [True: 0, False: 35.6k]
  |  Branch (2765:42): [True: 0, False: 35.6k]
  ------------------
 2766|  35.6k|        (ns->type != XML_NAMESPACE_DECL) ||
  ------------------
  |  Branch (2766:9): [True: 0, False: 35.6k]
  ------------------
 2767|  35.6k|	(node->type != XML_ELEMENT_NODE))
  ------------------
  |  Branch (2767:2): [True: 0, False: 35.6k]
  ------------------
 2768|      0|	return(-1);
 2769|       |
 2770|       |    /* @@ with_ns to check whether namespace nodes should be looked at @@ */
 2771|       |    /*
 2772|       |     * prevent duplicates
 2773|       |     */
 2774|  62.7k|    for (i = 0;i < cur->nodeNr;i++) {
  ------------------
  |  Branch (2774:16): [True: 27.1k, False: 35.6k]
  ------------------
 2775|  27.1k|        if ((cur->nodeTab[i] != NULL) &&
  ------------------
  |  Branch (2775:13): [True: 27.1k, False: 0]
  ------------------
 2776|  27.1k|	    (cur->nodeTab[i]->type == XML_NAMESPACE_DECL) &&
  ------------------
  |  Branch (2776:6): [True: 27.1k, False: 0]
  ------------------
 2777|  27.1k|	    (((xmlNsPtr)cur->nodeTab[i])->next == (xmlNsPtr) node) &&
  ------------------
  |  Branch (2777:6): [True: 27.1k, False: 0]
  ------------------
 2778|  27.1k|	    (xmlStrEqual(ns->prefix, ((xmlNsPtr)cur->nodeTab[i])->prefix)))
  ------------------
  |  Branch (2778:6): [True: 0, False: 27.1k]
  ------------------
 2779|      0|	    return(0);
 2780|  27.1k|    }
 2781|       |
 2782|       |    /*
 2783|       |     * grow the nodeTab if needed
 2784|       |     */
 2785|  35.6k|    if (cur->nodeNr >= cur->nodeMax) {
  ------------------
  |  Branch (2785:9): [True: 2.90k, False: 32.7k]
  ------------------
 2786|  2.90k|        if (xmlXPathNodeSetGrow(cur) < 0)
  ------------------
  |  Branch (2786:13): [True: 6, False: 2.89k]
  ------------------
 2787|      6|            return(-1);
 2788|  2.90k|    }
 2789|  35.6k|    nsNode = xmlXPathNodeSetDupNs(node, ns);
 2790|  35.6k|    if(nsNode == NULL)
  ------------------
  |  Branch (2790:8): [True: 21, False: 35.6k]
  ------------------
 2791|     21|        return(-1);
 2792|  35.6k|    cur->nodeTab[cur->nodeNr++] = nsNode;
 2793|  35.6k|    return(0);
 2794|  35.6k|}
xmlXPathNodeSetAdd:
 2804|  1.08k|xmlXPathNodeSetAdd(xmlNodeSet *cur, xmlNode *val) {
 2805|  1.08k|    int i;
 2806|       |
 2807|  1.08k|    if ((cur == NULL) || (val == NULL)) return(-1);
  ------------------
  |  Branch (2807:9): [True: 0, False: 1.08k]
  |  Branch (2807:26): [True: 0, False: 1.08k]
  ------------------
 2808|       |
 2809|       |    /* @@ with_ns to check whether namespace nodes should be looked at @@ */
 2810|       |    /*
 2811|       |     * prevent duplicates
 2812|       |     */
 2813|  1.08k|    for (i = 0;i < cur->nodeNr;i++)
  ------------------
  |  Branch (2813:16): [True: 510, False: 571]
  ------------------
 2814|    510|        if (cur->nodeTab[i] == val) return(0);
  ------------------
  |  Branch (2814:13): [True: 510, False: 0]
  ------------------
 2815|       |
 2816|       |    /*
 2817|       |     * grow the nodeTab if needed
 2818|       |     */
 2819|    571|    if (cur->nodeNr >= cur->nodeMax) {
  ------------------
  |  Branch (2819:9): [True: 571, False: 0]
  ------------------
 2820|    571|        if (xmlXPathNodeSetGrow(cur) < 0)
  ------------------
  |  Branch (2820:13): [True: 1, False: 570]
  ------------------
 2821|      1|            return(-1);
 2822|    571|    }
 2823|       |
 2824|    570|    if (val->type == XML_NAMESPACE_DECL) {
  ------------------
  |  Branch (2824:9): [True: 0, False: 570]
  ------------------
 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|    570|	cur->nodeTab[cur->nodeNr++] = val;
 2833|    570|    return(0);
 2834|    570|}
xmlXPathNodeSetAddUnique:
 2845|  4.18M|xmlXPathNodeSetAddUnique(xmlNodeSet *cur, xmlNode *val) {
 2846|  4.18M|    if ((cur == NULL) || (val == NULL)) return(-1);
  ------------------
  |  Branch (2846:9): [True: 0, False: 4.18M]
  |  Branch (2846:26): [True: 0, False: 4.18M]
  ------------------
 2847|       |
 2848|       |    /* @@ with_ns to check whether namespace nodes should be looked at @@ */
 2849|       |    /*
 2850|       |     * grow the nodeTab if needed
 2851|       |     */
 2852|  4.18M|    if (cur->nodeNr >= cur->nodeMax) {
  ------------------
  |  Branch (2852:9): [True: 1.07M, False: 3.11M]
  ------------------
 2853|  1.07M|        if (xmlXPathNodeSetGrow(cur) < 0)
  ------------------
  |  Branch (2853:13): [True: 122, False: 1.07M]
  ------------------
 2854|    122|            return(-1);
 2855|  1.07M|    }
 2856|       |
 2857|  4.18M|    if (val->type == XML_NAMESPACE_DECL) {
  ------------------
  |  Branch (2857:9): [True: 4.28k, False: 4.18M]
  ------------------
 2858|  4.28k|	xmlNsPtr ns = (xmlNsPtr) val;
 2859|  4.28k|        xmlNodePtr nsNode = xmlXPathNodeSetDupNs((xmlNodePtr) ns->next, ns);
 2860|       |
 2861|  4.28k|        if (nsNode == NULL)
  ------------------
  |  Branch (2861:13): [True: 8, False: 4.27k]
  ------------------
 2862|      8|            return(-1);
 2863|  4.27k|	cur->nodeTab[cur->nodeNr++] = nsNode;
 2864|  4.27k|    } else
 2865|  4.18M|	cur->nodeTab[cur->nodeNr++] = val;
 2866|  4.18M|    return(0);
 2867|  4.18M|}
xmlXPathNodeSetMerge:
 2880|  47.3k|xmlXPathNodeSetMerge(xmlNodeSet *val1, xmlNodeSet *val2) {
 2881|  47.3k|    int i, j, initNr, skip;
 2882|  47.3k|    xmlNodePtr n1, n2;
 2883|       |
 2884|  47.3k|    if (val1 == NULL) {
  ------------------
  |  Branch (2884:9): [True: 4, False: 47.3k]
  ------------------
 2885|      4|	val1 = xmlXPathNodeSetCreate(NULL);
 2886|      4|        if (val1 == NULL)
  ------------------
  |  Branch (2886:13): [True: 0, False: 4]
  ------------------
 2887|      0|            return (NULL);
 2888|      4|    }
 2889|  47.3k|    if (val2 == NULL)
  ------------------
  |  Branch (2889:9): [True: 26, False: 47.3k]
  ------------------
 2890|     26|        return(val1);
 2891|       |
 2892|       |    /* @@ with_ns to check whether namespace nodes should be looked at @@ */
 2893|  47.3k|    initNr = val1->nodeNr;
 2894|       |
 2895|   625k|    for (i = 0;i < val2->nodeNr;i++) {
  ------------------
  |  Branch (2895:16): [True: 578k, False: 47.3k]
  ------------------
 2896|   578k|	n2 = val2->nodeTab[i];
 2897|       |	/*
 2898|       |	 * check against duplicates
 2899|       |	 */
 2900|   578k|	skip = 0;
 2901|  10.4M|	for (j = 0; j < initNr; j++) {
  ------------------
  |  Branch (2901:14): [True: 9.92M, False: 516k]
  ------------------
 2902|  9.92M|	    n1 = val1->nodeTab[j];
 2903|  9.92M|	    if (n1 == n2) {
  ------------------
  |  Branch (2903:10): [True: 61.5k, False: 9.86M]
  ------------------
 2904|  61.5k|		skip = 1;
 2905|  61.5k|		break;
 2906|  9.86M|	    } else if ((n1->type == XML_NAMESPACE_DECL) &&
  ------------------
  |  Branch (2906:17): [True: 85, False: 9.86M]
  ------------------
 2907|     85|		       (n2->type == XML_NAMESPACE_DECL)) {
  ------------------
  |  Branch (2907:10): [True: 0, False: 85]
  ------------------
 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.92M|	}
 2917|   578k|	if (skip)
  ------------------
  |  Branch (2917:6): [True: 61.5k, False: 516k]
  ------------------
 2918|  61.5k|	    continue;
 2919|       |
 2920|       |	/*
 2921|       |	 * grow the nodeTab if needed
 2922|       |	 */
 2923|   516k|        if (val1->nodeNr >= val1->nodeMax) {
  ------------------
  |  Branch (2923:13): [True: 53.5k, False: 462k]
  ------------------
 2924|  53.5k|            if (xmlXPathNodeSetGrow(val1) < 0)
  ------------------
  |  Branch (2924:17): [True: 22, False: 53.5k]
  ------------------
 2925|     22|                goto error;
 2926|  53.5k|        }
 2927|   516k|	if (n2->type == XML_NAMESPACE_DECL) {
  ------------------
  |  Branch (2927:6): [True: 783, False: 515k]
  ------------------
 2928|    783|	    xmlNsPtr ns = (xmlNsPtr) n2;
 2929|    783|            xmlNodePtr nsNode = xmlXPathNodeSetDupNs((xmlNodePtr) ns->next, ns);
 2930|       |
 2931|    783|            if (nsNode == NULL)
  ------------------
  |  Branch (2931:17): [True: 15, False: 768]
  ------------------
 2932|     15|                goto error;
 2933|    768|	    val1->nodeTab[val1->nodeNr++] = nsNode;
 2934|    768|	} else
 2935|   515k|	    val1->nodeTab[val1->nodeNr++] = n2;
 2936|   516k|    }
 2937|       |
 2938|  47.3k|    return(val1);
 2939|       |
 2940|     37|error:
 2941|     37|    xmlXPathFreeNodeSet(val1);
 2942|       |    return(NULL);
 2943|  47.3k|}
xmlXPathFreeNodeSet:
 3101|  2.12M|xmlXPathFreeNodeSet(xmlNodeSet *obj) {
 3102|  2.12M|    if (obj == NULL) return;
  ------------------
  |  Branch (3102:9): [True: 26, False: 2.12M]
  ------------------
 3103|  2.12M|    if (obj->nodeTab != NULL) {
  ------------------
  |  Branch (3103:9): [True: 1.43M, False: 694k]
  ------------------
 3104|  1.43M|	int i;
 3105|       |
 3106|       |	/* @@ with_ns to check whether namespace nodes should be looked at @@ */
 3107|  6.88M|	for (i = 0;i < obj->nodeNr;i++)
  ------------------
  |  Branch (3107:13): [True: 5.44M, False: 1.43M]
  ------------------
 3108|  5.44M|	    if ((obj->nodeTab[i] != NULL) &&
  ------------------
  |  Branch (3108:10): [True: 5.44M, False: 0]
  ------------------
 3109|  5.44M|		(obj->nodeTab[i]->type == XML_NAMESPACE_DECL))
  ------------------
  |  Branch (3109:3): [True: 53.5k, False: 5.39M]
  ------------------
 3110|  53.5k|		xmlXPathNodeSetFreeNs((xmlNsPtr) obj->nodeTab[i]);
 3111|  1.43M|	xmlFree(obj->nodeTab);
 3112|  1.43M|    }
 3113|  2.12M|    xmlFree(obj);
 3114|  2.12M|}
xmlXPathNewNodeSet:
 3191|  1.11M|xmlXPathNewNodeSet(xmlNode *val) {
 3192|  1.11M|    xmlXPathObjectPtr ret;
 3193|       |
 3194|  1.11M|    ret = (xmlXPathObjectPtr) xmlMalloc(sizeof(xmlXPathObject));
 3195|  1.11M|    if (ret == NULL)
  ------------------
  |  Branch (3195:9): [True: 129, False: 1.11M]
  ------------------
 3196|    129|	return(NULL);
 3197|  1.11M|    memset(ret, 0 , sizeof(xmlXPathObject));
 3198|  1.11M|    ret->type = XPATH_NODESET;
 3199|  1.11M|    ret->boolval = 0;
 3200|  1.11M|    ret->nodesetval = xmlXPathNodeSetCreate(val);
 3201|  1.11M|    if (ret->nodesetval == NULL) {
  ------------------
  |  Branch (3201:9): [True: 238, False: 1.11M]
  ------------------
 3202|    238|        xmlFree(ret);
 3203|    238|        return(NULL);
 3204|    238|    }
 3205|       |    /* @@ with_ns to check whether namespace nodes should be looked at @@ */
 3206|  1.11M|    return(ret);
 3207|  1.11M|}
xmlXPathWrapNodeSet:
 3267|  1.00M|xmlXPathWrapNodeSet(xmlNodeSet *val) {
 3268|  1.00M|    xmlXPathObjectPtr ret;
 3269|       |
 3270|  1.00M|    ret = (xmlXPathObjectPtr) xmlMalloc(sizeof(xmlXPathObject));
 3271|  1.00M|    if (ret == NULL) {
  ------------------
  |  Branch (3271:9): [True: 159, False: 1.00M]
  ------------------
 3272|    159|        xmlXPathFreeNodeSet(val);
 3273|    159|	return(NULL);
 3274|    159|    }
 3275|  1.00M|    memset(ret, 0 , sizeof(xmlXPathObject));
 3276|  1.00M|    ret->type = XPATH_NODESET;
 3277|  1.00M|    ret->nodesetval = val;
 3278|  1.00M|    return(ret);
 3279|  1.00M|}
xmlXPathFunctionLookup:
 3743|  5.60k|xmlXPathFunctionLookup(xmlXPathContext *ctxt, const xmlChar *name) {
 3744|       |    return(xmlXPathFunctionLookupNS(ctxt, name, NULL));
 3745|  5.60k|}
xmlXPathFunctionLookupNS:
 3758|  5.61k|			 const xmlChar *ns_uri) {
 3759|  5.61k|    xmlXPathFunction ret;
 3760|  5.61k|    void *payload;
 3761|       |
 3762|  5.61k|    if (ctxt == NULL)
  ------------------
  |  Branch (3762:9): [True: 0, False: 5.61k]
  ------------------
 3763|      0|	return(NULL);
 3764|  5.61k|    if (name == NULL)
  ------------------
  |  Branch (3764:9): [True: 0, False: 5.61k]
  ------------------
 3765|      0|	return(NULL);
 3766|       |
 3767|  5.61k|    if (ns_uri == NULL) {
  ------------------
  |  Branch (3767:9): [True: 5.60k, False: 10]
  ------------------
 3768|  5.60k|        int bucketIndex = xmlXPathSFComputeHash(name) % SF_HASH_SIZE;
  ------------------
  |  |  168|  5.60k|#define SF_HASH_SIZE 64
  ------------------
 3769|       |
 3770|  7.74k|        while (xmlXPathSFHash[bucketIndex] != UCHAR_MAX) {
  ------------------
  |  Branch (3770:16): [True: 7.38k, False: 358]
  ------------------
 3771|  7.38k|            int funcIndex = xmlXPathSFHash[bucketIndex];
 3772|       |
 3773|  7.38k|            if (strcmp(xmlXPathStandardFunctions[funcIndex].name,
  ------------------
  |  Branch (3773:17): [True: 5.24k, False: 2.14k]
  ------------------
 3774|  7.38k|                       (char *) name) == 0)
 3775|  5.24k|                return(xmlXPathStandardFunctions[funcIndex].func);
 3776|       |
 3777|  2.14k|            bucketIndex += 1;
 3778|  2.14k|            if (bucketIndex >= SF_HASH_SIZE)
  ------------------
  |  |  168|  2.14k|#define SF_HASH_SIZE 64
  ------------------
  |  Branch (3778:17): [True: 0, False: 2.14k]
  ------------------
 3779|      0|                bucketIndex = 0;
 3780|  2.14k|        }
 3781|  5.60k|    }
 3782|       |
 3783|    368|    if (ctxt->funcLookupFunc != NULL) {
  ------------------
  |  Branch (3783:9): [True: 0, False: 368]
  ------------------
 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|    368|    if (ctxt->funcHash == NULL)
  ------------------
  |  Branch (3792:9): [True: 368, False: 0]
  ------------------
 3793|    368|	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|    368|}
xmlXPathRegisteredFuncsCleanup:
 3807|  5.38k|xmlXPathRegisteredFuncsCleanup(xmlXPathContext *ctxt) {
 3808|  5.38k|    if (ctxt == NULL)
  ------------------
  |  Branch (3808:9): [True: 0, False: 5.38k]
  ------------------
 3809|      0|	return;
 3810|       |
 3811|  5.38k|    xmlHashFree(ctxt->funcHash, NULL);
 3812|       |    ctxt->funcHash = NULL;
 3813|  5.38k|}
xmlXPathVariableLookup:
 3891|     29|xmlXPathVariableLookup(xmlXPathContext *ctxt, const xmlChar *name) {
 3892|     29|    if (ctxt == NULL)
  ------------------
  |  Branch (3892:9): [True: 0, False: 29]
  ------------------
 3893|      0|	return(NULL);
 3894|       |
 3895|     29|    if (ctxt->varLookupFunc != NULL) {
  ------------------
  |  Branch (3895:9): [True: 0, False: 29]
  ------------------
 3896|      0|	xmlXPathObjectPtr ret;
 3897|       |
 3898|      0|	ret = ((xmlXPathVariableLookupFunc)ctxt->varLookupFunc)
 3899|      0|	        (ctxt->varLookupData, name, NULL);
 3900|      0|	return(ret);
 3901|      0|    }
 3902|     29|    return(xmlXPathVariableLookupNS(ctxt, name, NULL));
 3903|     29|}
xmlXPathVariableLookupNS:
 3916|     40|			 const xmlChar *ns_uri) {
 3917|     40|    if (ctxt == NULL)
  ------------------
  |  Branch (3917:9): [True: 0, False: 40]
  ------------------
 3918|      0|	return(NULL);
 3919|       |
 3920|     40|    if (ctxt->varLookupFunc != NULL) {
  ------------------
  |  Branch (3920:9): [True: 0, False: 40]
  ------------------
 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|     40|    if (ctxt->varHash == NULL)
  ------------------
  |  Branch (3928:9): [True: 40, False: 0]
  ------------------
 3929|     40|	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|  5.38k|xmlXPathRegisteredVariablesCleanup(xmlXPathContext *ctxt) {
 3943|  5.38k|    if (ctxt == NULL)
  ------------------
  |  Branch (3943:9): [True: 0, False: 5.38k]
  ------------------
 3944|      0|	return;
 3945|       |
 3946|  5.38k|    xmlHashFree(ctxt->varHash, xmlXPathFreeObjectEntry);
 3947|       |    ctxt->varHash = NULL;
 3948|  5.38k|}
xmlXPathRegisterNs:
 3961|    373|			   const xmlChar *ns_uri) {
 3962|    373|    xmlChar *copy;
 3963|       |
 3964|    373|    if (ctxt == NULL)
  ------------------
  |  Branch (3964:9): [True: 0, False: 373]
  ------------------
 3965|      0|	return(-1);
 3966|    373|    if (prefix == NULL)
  ------------------
  |  Branch (3966:9): [True: 0, False: 373]
  ------------------
 3967|      0|	return(-1);
 3968|    373|    if (prefix[0] == 0)
  ------------------
  |  Branch (3968:9): [True: 0, False: 373]
  ------------------
 3969|      0|	return(-1);
 3970|       |
 3971|    373|    if (ctxt->nsHash == NULL)
  ------------------
  |  Branch (3971:9): [True: 29, False: 344]
  ------------------
 3972|     29|	ctxt->nsHash = xmlHashCreate(10);
 3973|    373|    if (ctxt->nsHash == NULL) {
  ------------------
  |  Branch (3973:9): [True: 2, False: 371]
  ------------------
 3974|      2|        xmlXPathErrMemory(ctxt);
 3975|      2|	return(-1);
 3976|      2|    }
 3977|    371|    if (ns_uri == NULL)
  ------------------
  |  Branch (3977:9): [True: 0, False: 371]
  ------------------
 3978|      0|        return(xmlHashRemoveEntry(ctxt->nsHash, prefix,
 3979|      0|	                          xmlHashDefaultDeallocator));
 3980|       |
 3981|    371|    copy = xmlStrdup(ns_uri);
 3982|    371|    if (copy == NULL) {
  ------------------
  |  Branch (3982:9): [True: 2, False: 369]
  ------------------
 3983|      2|        xmlXPathErrMemory(ctxt);
 3984|      2|        return(-1);
 3985|      2|    }
 3986|    369|    if (xmlHashUpdateEntry(ctxt->nsHash, prefix, copy,
  ------------------
  |  Branch (3986:9): [True: 1, False: 368]
  ------------------
 3987|    369|                           xmlHashDefaultDeallocator) < 0) {
 3988|      1|        xmlXPathErrMemory(ctxt);
 3989|      1|        xmlFree(copy);
 3990|      1|        return(-1);
 3991|      1|    }
 3992|       |
 3993|    368|    return(0);
 3994|    369|}
xmlXPathNsLookup:
 4005|  10.5k|xmlXPathNsLookup(xmlXPathContext *ctxt, const xmlChar *prefix) {
 4006|  10.5k|    if (ctxt == NULL)
  ------------------
  |  Branch (4006:9): [True: 0, False: 10.5k]
  ------------------
 4007|      0|	return(NULL);
 4008|  10.5k|    if (prefix == NULL)
  ------------------
  |  Branch (4008:9): [True: 0, False: 10.5k]
  ------------------
 4009|      0|	return(NULL);
 4010|       |
 4011|  10.5k|    if (xmlStrEqual(prefix, (const xmlChar *) "xml"))
  ------------------
  |  Branch (4011:9): [True: 10.3k, False: 212]
  ------------------
 4012|  10.3k|	return(XML_XML_NAMESPACE);
  ------------------
  |  |  146|  10.3k|    (const xmlChar *) "http://www.w3.org/XML/1998/namespace"
  ------------------
 4013|       |
 4014|    212|    if (ctxt->namespaces != NULL) {
  ------------------
  |  Branch (4014:9): [True: 0, False: 212]
  ------------------
 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|    212|    return((const xmlChar *) xmlHashLookup(ctxt->nsHash, prefix));
 4025|    212|}
xmlXPathRegisteredNsCleanup:
 4033|  5.38k|xmlXPathRegisteredNsCleanup(xmlXPathContext *ctxt) {
 4034|  5.38k|    if (ctxt == NULL)
  ------------------
  |  Branch (4034:9): [True: 0, False: 5.38k]
  ------------------
 4035|      0|	return;
 4036|       |
 4037|  5.38k|    xmlHashFree(ctxt->nsHash, xmlHashDefaultDeallocator);
 4038|       |    ctxt->nsHash = NULL;
 4039|  5.38k|}
xmlXPathNewFloat:
 4056|   353k|xmlXPathNewFloat(double val) {
 4057|   353k|    xmlXPathObjectPtr ret;
 4058|       |
 4059|   353k|    ret = (xmlXPathObjectPtr) xmlMalloc(sizeof(xmlXPathObject));
 4060|   353k|    if (ret == NULL)
  ------------------
  |  Branch (4060:9): [True: 107, False: 353k]
  ------------------
 4061|    107|	return(NULL);
 4062|   353k|    memset(ret, 0 , sizeof(xmlXPathObject));
 4063|   353k|    ret->type = XPATH_NUMBER;
 4064|   353k|    ret->floatval = val;
 4065|   353k|    return(ret);
 4066|   353k|}
xmlXPathNewBoolean:
 4075|   517k|xmlXPathNewBoolean(int val) {
 4076|   517k|    xmlXPathObjectPtr ret;
 4077|       |
 4078|   517k|    ret = (xmlXPathObjectPtr) xmlMalloc(sizeof(xmlXPathObject));
 4079|   517k|    if (ret == NULL)
  ------------------
  |  Branch (4079:9): [True: 79, False: 517k]
  ------------------
 4080|     79|	return(NULL);
 4081|   517k|    memset(ret, 0 , sizeof(xmlXPathObject));
 4082|   517k|    ret->type = XPATH_BOOLEAN;
 4083|   517k|    ret->boolval = (val != 0);
 4084|   517k|    return(ret);
 4085|   517k|}
xmlXPathNewString:
 4094|   102k|xmlXPathNewString(const xmlChar *val) {
 4095|   102k|    xmlXPathObjectPtr ret;
 4096|       |
 4097|   102k|    ret = (xmlXPathObjectPtr) xmlMalloc(sizeof(xmlXPathObject));
 4098|   102k|    if (ret == NULL)
  ------------------
  |  Branch (4098:9): [True: 16, False: 102k]
  ------------------
 4099|     16|	return(NULL);
 4100|   102k|    memset(ret, 0 , sizeof(xmlXPathObject));
 4101|   102k|    ret->type = XPATH_STRING;
 4102|   102k|    if (val == NULL)
  ------------------
  |  Branch (4102:9): [True: 1, False: 102k]
  ------------------
 4103|      1|        val = BAD_CAST "";
  ------------------
  |  |   34|      1|#define BAD_CAST (xmlChar *)
  ------------------
 4104|   102k|    ret->stringval = xmlStrdup(val);
 4105|   102k|    if (ret->stringval == NULL) {
  ------------------
  |  Branch (4105:9): [True: 29, False: 102k]
  ------------------
 4106|     29|        xmlFree(ret);
 4107|     29|        return(NULL);
 4108|     29|    }
 4109|   102k|    return(ret);
 4110|   102k|}
xmlXPathWrapString:
 4121|  45.2k|xmlXPathWrapString (xmlChar *val) {
 4122|  45.2k|    xmlXPathObjectPtr ret;
 4123|       |
 4124|  45.2k|    ret = (xmlXPathObjectPtr) xmlMalloc(sizeof(xmlXPathObject));
 4125|  45.2k|    if (ret == NULL) {
  ------------------
  |  Branch (4125:9): [True: 33, False: 45.2k]
  ------------------
 4126|     33|        xmlFree(val);
 4127|     33|	return(NULL);
 4128|     33|    }
 4129|  45.2k|    memset(ret, 0 , sizeof(xmlXPathObject));
 4130|  45.2k|    ret->type = XPATH_STRING;
 4131|  45.2k|    ret->stringval = val;
 4132|  45.2k|    return(ret);
 4133|  45.2k|}
xmlXPathObjectCopy:
 4183|   242k|xmlXPathObjectCopy(xmlXPathObject *val) {
 4184|   242k|    xmlXPathObjectPtr ret;
 4185|       |
 4186|   242k|    if (val == NULL)
  ------------------
  |  Branch (4186:9): [True: 0, False: 242k]
  ------------------
 4187|      0|	return(NULL);
 4188|       |
 4189|   242k|    ret = (xmlXPathObjectPtr) xmlMalloc(sizeof(xmlXPathObject));
 4190|   242k|    if (ret == NULL)
  ------------------
  |  Branch (4190:9): [True: 65, False: 242k]
  ------------------
 4191|     65|	return(NULL);
 4192|   242k|    memcpy(ret, val , sizeof(xmlXPathObject));
 4193|   242k|    switch (val->type) {
 4194|      0|	case XPATH_BOOLEAN:
  ------------------
  |  Branch (4194:2): [True: 0, False: 242k]
  ------------------
 4195|   218k|	case XPATH_NUMBER:
  ------------------
  |  Branch (4195:2): [True: 218k, False: 24.2k]
  ------------------
 4196|   218k|	    break;
 4197|  24.2k|	case XPATH_STRING:
  ------------------
  |  Branch (4197:2): [True: 24.2k, False: 218k]
  ------------------
 4198|  24.2k|	    ret->stringval = xmlStrdup(val->stringval);
 4199|  24.2k|            if (ret->stringval == NULL) {
  ------------------
  |  Branch (4199:17): [True: 6, False: 24.2k]
  ------------------
 4200|      6|                xmlFree(ret);
 4201|      6|                return(NULL);
 4202|      6|            }
 4203|  24.2k|	    break;
 4204|  24.2k|	case XPATH_XSLT_TREE:
  ------------------
  |  Branch (4204:2): [True: 0, False: 242k]
  ------------------
 4205|      0|	case XPATH_NODESET:
  ------------------
  |  Branch (4205:2): [True: 0, False: 242k]
  ------------------
 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: 242k]
  ------------------
 4215|      0|	    ret->user = val->user;
 4216|      0|	    break;
 4217|      0|        default:
  ------------------
  |  Branch (4217:9): [True: 0, False: 242k]
  ------------------
 4218|      0|            xmlFree(ret);
 4219|      0|            ret = NULL;
 4220|      0|	    break;
 4221|   242k|    }
 4222|   242k|    return(ret);
 4223|   242k|}
xmlXPathFreeObject:
 4231|  3.37M|xmlXPathFreeObject(xmlXPathObject *obj) {
 4232|  3.37M|    if (obj == NULL) return;
  ------------------
  |  Branch (4232:9): [True: 0, False: 3.37M]
  ------------------
 4233|  3.37M|    if ((obj->type == XPATH_NODESET) || (obj->type == XPATH_XSLT_TREE)) {
  ------------------
  |  Branch (4233:9): [True: 2.11M, False: 1.26M]
  |  Branch (4233:41): [True: 0, False: 1.26M]
  ------------------
 4234|  2.11M|        if (obj->nodesetval != NULL)
  ------------------
  |  Branch (4234:13): [True: 2.11M, False: 60]
  ------------------
 4235|  2.11M|            xmlXPathFreeNodeSet(obj->nodesetval);
 4236|  2.11M|    } else if (obj->type == XPATH_STRING) {
  ------------------
  |  Branch (4236:16): [True: 171k, False: 1.08M]
  ------------------
 4237|   171k|	if (obj->stringval != NULL)
  ------------------
  |  Branch (4237:6): [True: 171k, False: 23]
  ------------------
 4238|   171k|	    xmlFree(obj->stringval);
 4239|   171k|    }
 4240|  3.37M|    xmlFree(obj);
 4241|  3.37M|}
xmlXPathCastBooleanToString:
 4354|  4.68k|xmlXPathCastBooleanToString (int val) {
 4355|  4.68k|    xmlChar *ret;
 4356|  4.68k|    if (val)
  ------------------
  |  Branch (4356:9): [True: 1.46k, False: 3.21k]
  ------------------
 4357|  1.46k|	ret = xmlStrdup((const xmlChar *) "true");
 4358|  3.21k|    else
 4359|  3.21k|	ret = xmlStrdup((const xmlChar *) "false");
 4360|  4.68k|    return(ret);
 4361|  4.68k|}
xmlXPathCastNumberToString:
 4370|  16.7k|xmlXPathCastNumberToString (double val) {
 4371|  16.7k|    xmlChar *ret;
 4372|  16.7k|    switch (xmlXPathIsInf(val)) {
 4373|     33|    case 1:
  ------------------
  |  Branch (4373:5): [True: 33, False: 16.6k]
  ------------------
 4374|     33|	ret = xmlStrdup((const xmlChar *) "Infinity");
 4375|     33|	break;
 4376|    340|    case -1:
  ------------------
  |  Branch (4376:5): [True: 340, False: 16.3k]
  ------------------
 4377|    340|	ret = xmlStrdup((const xmlChar *) "-Infinity");
 4378|    340|	break;
 4379|  16.3k|    default:
  ------------------
  |  Branch (4379:5): [True: 16.3k, False: 373]
  ------------------
 4380|  16.3k|	if (xmlXPathIsNaN(val)) {
  ------------------
  |  Branch (4380:6): [True: 1.68k, False: 14.6k]
  ------------------
 4381|  1.68k|	    ret = xmlStrdup((const xmlChar *) "NaN");
 4382|  14.6k|	} else if (val == 0) {
  ------------------
  |  Branch (4382:13): [True: 784, False: 13.8k]
  ------------------
 4383|       |            /* Omit sign for negative zero. */
 4384|    784|	    ret = xmlStrdup((const xmlChar *) "0");
 4385|  13.8k|	} else {
 4386|       |	    /* could be improved */
 4387|  13.8k|	    char buf[100];
 4388|  13.8k|	    xmlXPathFormatNumber(val, buf, 99);
 4389|  13.8k|	    buf[99] = 0;
 4390|  13.8k|	    ret = xmlStrdup((const xmlChar *) buf);
 4391|  13.8k|	}
 4392|  16.7k|    }
 4393|  16.7k|    return(ret);
 4394|  16.7k|}
xmlXPathCastNodeToString:
 4403|   322k|xmlXPathCastNodeToString (xmlNode *node) {
 4404|   322k|    return(xmlNodeGetContent(node));
 4405|   322k|}
xmlXPathCastNodeSetToString:
 4414|   416k|xmlXPathCastNodeSetToString (xmlNodeSet *ns) {
 4415|   416k|    if ((ns == NULL) || (ns->nodeNr == 0) || (ns->nodeTab == NULL))
  ------------------
  |  Branch (4415:9): [True: 0, False: 416k]
  |  Branch (4415:25): [True: 296k, False: 119k]
  |  Branch (4415:46): [True: 0, False: 119k]
  ------------------
 4416|   296k|	return(xmlStrdup((const xmlChar *) ""));
 4417|       |
 4418|   119k|    if (ns->nodeNr > 1)
  ------------------
  |  Branch (4418:9): [True: 24.0k, False: 95.5k]
  ------------------
 4419|  24.0k|	xmlXPathNodeSetSort(ns);
 4420|   119k|    return(xmlXPathCastNodeToString(ns->nodeTab[0]));
 4421|   416k|}
xmlXPathCastToString:
 4431|  44.6k|xmlXPathCastToString(xmlXPathObject *val) {
 4432|  44.6k|    xmlChar *ret = NULL;
 4433|       |
 4434|  44.6k|    if (val == NULL)
  ------------------
  |  Branch (4434:9): [True: 0, False: 44.6k]
  ------------------
 4435|      0|	return(xmlStrdup((const xmlChar *) ""));
 4436|  44.6k|    switch (val->type) {
  ------------------
  |  Branch (4436:13): [True: 44.6k, False: 0]
  ------------------
 4437|      0|	case XPATH_UNDEFINED:
  ------------------
  |  Branch (4437:2): [True: 0, False: 44.6k]
  ------------------
 4438|      0|	    ret = xmlStrdup((const xmlChar *) "");
 4439|      0|	    break;
 4440|  22.9k|        case XPATH_NODESET:
  ------------------
  |  Branch (4440:9): [True: 22.9k, False: 21.7k]
  ------------------
 4441|  22.9k|        case XPATH_XSLT_TREE:
  ------------------
  |  Branch (4441:9): [True: 0, False: 44.6k]
  ------------------
 4442|  22.9k|	    ret = xmlXPathCastNodeSetToString(val->nodesetval);
 4443|  22.9k|	    break;
 4444|    371|	case XPATH_STRING:
  ------------------
  |  Branch (4444:2): [True: 371, False: 44.3k]
  ------------------
 4445|    371|	    return(xmlStrdup(val->stringval));
 4446|  4.68k|        case XPATH_BOOLEAN:
  ------------------
  |  Branch (4446:9): [True: 4.68k, False: 40.0k]
  ------------------
 4447|  4.68k|	    ret = xmlXPathCastBooleanToString(val->boolval);
 4448|  4.68k|	    break;
 4449|  16.7k|	case XPATH_NUMBER: {
  ------------------
  |  Branch (4449:2): [True: 16.7k, False: 27.9k]
  ------------------
 4450|  16.7k|	    ret = xmlXPathCastNumberToString(val->floatval);
 4451|  16.7k|	    break;
 4452|  22.9k|	}
 4453|      0|	case XPATH_USERS:
  ------------------
  |  Branch (4453:2): [True: 0, False: 44.6k]
  ------------------
 4454|       |	    /* TODO */
 4455|      0|	    ret = xmlStrdup((const xmlChar *) "");
 4456|      0|	    break;
 4457|  44.6k|    }
 4458|  44.3k|    return(ret);
 4459|  44.6k|}
xmlXPathCastBooleanToNumber:
 4507|  25.4k|xmlXPathCastBooleanToNumber(int val) {
 4508|  25.4k|    if (val)
  ------------------
  |  Branch (4508:9): [True: 3.06k, False: 22.3k]
  ------------------
 4509|  3.06k|	return(1.0);
 4510|  22.3k|    return(0.0);
 4511|  25.4k|}
xmlXPathCastStringToNumber:
 4520|   610k|xmlXPathCastStringToNumber(const xmlChar * val) {
 4521|   610k|    return(xmlXPathStringEvalNumber(val));
 4522|   610k|}
xmlXPathCastNumberToBoolean:
 4617|  55.6k|xmlXPathCastNumberToBoolean (double val) {
 4618|  55.6k|     if (xmlXPathIsNaN(val) || (val == 0.0))
  ------------------
  |  Branch (4618:10): [True: 43.8k, False: 11.7k]
  |  Branch (4618:32): [True: 1.58k, False: 10.2k]
  ------------------
 4619|  45.4k|	 return(0);
 4620|  10.2k|     return(1);
 4621|  55.6k|}
xmlXPathCastStringToBoolean:
 4630|     50|xmlXPathCastStringToBoolean (const xmlChar *val) {
 4631|     50|    if ((val == NULL) || (xmlStrlen(val) == 0))
  ------------------
  |  Branch (4631:9): [True: 0, False: 50]
  |  Branch (4631:26): [True: 18, False: 32]
  ------------------
 4632|     18|	return(0);
 4633|     32|    return(1);
 4634|     50|}
xmlXPathCastNodeSetToBoolean:
 4643|  8.33k|xmlXPathCastNodeSetToBoolean (xmlNodeSet *ns) {
 4644|  8.33k|    if ((ns == NULL) || (ns->nodeNr == 0))
  ------------------
  |  Branch (4644:9): [True: 0, False: 8.33k]
  |  Branch (4644:25): [True: 7.13k, False: 1.19k]
  ------------------
 4645|  7.13k|	return(0);
 4646|  1.19k|    return(1);
 4647|  8.33k|}
xmlXPathCastToBoolean:
 4656|  10.5k|xmlXPathCastToBoolean (xmlXPathObject *val) {
 4657|  10.5k|    int ret = 0;
 4658|       |
 4659|  10.5k|    if (val == NULL)
  ------------------
  |  Branch (4659:9): [True: 0, False: 10.5k]
  ------------------
 4660|      0|	return(0);
 4661|  10.5k|    switch (val->type) {
  ------------------
  |  Branch (4661:13): [True: 10.5k, False: 0]
  ------------------
 4662|      0|    case XPATH_UNDEFINED:
  ------------------
  |  Branch (4662:5): [True: 0, False: 10.5k]
  ------------------
 4663|      0|	ret = 0;
 4664|      0|	break;
 4665|  8.33k|    case XPATH_NODESET:
  ------------------
  |  Branch (4665:5): [True: 8.33k, False: 2.18k]
  ------------------
 4666|  8.33k|    case XPATH_XSLT_TREE:
  ------------------
  |  Branch (4666:5): [True: 0, False: 10.5k]
  ------------------
 4667|  8.33k|	ret = xmlXPathCastNodeSetToBoolean(val->nodesetval);
 4668|  8.33k|	break;
 4669|     50|    case XPATH_STRING:
  ------------------
  |  Branch (4669:5): [True: 50, False: 10.4k]
  ------------------
 4670|     50|	ret = xmlXPathCastStringToBoolean(val->stringval);
 4671|     50|	break;
 4672|  2.13k|    case XPATH_NUMBER:
  ------------------
  |  Branch (4672:5): [True: 2.13k, False: 8.38k]
  ------------------
 4673|  2.13k|	ret = xmlXPathCastNumberToBoolean(val->floatval);
 4674|  2.13k|	break;
 4675|      0|    case XPATH_BOOLEAN:
  ------------------
  |  Branch (4675:5): [True: 0, False: 10.5k]
  ------------------
 4676|      0|	ret = val->boolval;
 4677|      0|	break;
 4678|      0|    case XPATH_USERS:
  ------------------
  |  Branch (4678:5): [True: 0, False: 10.5k]
  ------------------
 4679|       |	/* TODO */
 4680|      0|	ret = 0;
 4681|      0|	break;
 4682|  10.5k|    }
 4683|  10.5k|    return(ret);
 4684|  10.5k|}
xmlXPathNewContext:
 4720|  5.40k|xmlXPathNewContext(xmlDoc *doc) {
 4721|  5.40k|    xmlXPathContextPtr ret;
 4722|       |
 4723|  5.40k|    ret = (xmlXPathContextPtr) xmlMalloc(sizeof(xmlXPathContext));
 4724|  5.40k|    if (ret == NULL)
  ------------------
  |  Branch (4724:9): [True: 19, False: 5.38k]
  ------------------
 4725|     19|	return(NULL);
 4726|  5.38k|    memset(ret, 0 , sizeof(xmlXPathContext));
 4727|  5.38k|    ret->doc = doc;
 4728|  5.38k|    ret->node = NULL;
 4729|       |
 4730|  5.38k|    ret->varHash = NULL;
 4731|       |
 4732|  5.38k|    ret->nb_types = 0;
 4733|  5.38k|    ret->max_types = 0;
 4734|  5.38k|    ret->types = NULL;
 4735|       |
 4736|  5.38k|    ret->nb_axis = 0;
 4737|  5.38k|    ret->max_axis = 0;
 4738|  5.38k|    ret->axis = NULL;
 4739|       |
 4740|  5.38k|    ret->nsHash = NULL;
 4741|  5.38k|    ret->user = NULL;
 4742|       |
 4743|  5.38k|    ret->contextSize = -1;
 4744|  5.38k|    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|  5.38k|    return(ret);
 4754|  5.40k|}
xmlXPathFreeContext:
 4762|  5.38k|xmlXPathFreeContext(xmlXPathContext *ctxt) {
 4763|  5.38k|    if (ctxt == NULL) return;
  ------------------
  |  Branch (4763:9): [True: 0, False: 5.38k]
  ------------------
 4764|       |
 4765|  5.38k|    if (ctxt->cache != NULL)
  ------------------
  |  Branch (4765:9): [True: 0, False: 5.38k]
  ------------------
 4766|      0|	xmlXPathFreeCache((xmlXPathContextCachePtr) ctxt->cache);
 4767|  5.38k|    xmlXPathRegisteredNsCleanup(ctxt);
 4768|  5.38k|    xmlXPathRegisteredFuncsCleanup(ctxt);
 4769|  5.38k|    xmlXPathRegisteredVariablesCleanup(ctxt);
 4770|  5.38k|    xmlResetError(&ctxt->lastError);
 4771|  5.38k|    xmlFree(ctxt);
 4772|  5.38k|}
xmlXPathSetErrorHandler:
 4785|  5.38k|                        xmlStructuredErrorFunc handler, void *data) {
 4786|  5.38k|    if (ctxt == NULL)
  ------------------
  |  Branch (4786:9): [True: 0, False: 5.38k]
  ------------------
 4787|      0|        return;
 4788|       |
 4789|  5.38k|    ctxt->error = handler;
 4790|  5.38k|    ctxt->userData = data;
 4791|  5.38k|}
xmlXPathNewParserContext:
 4807|  8.83k|xmlXPathNewParserContext(const xmlChar *str, xmlXPathContext *ctxt) {
 4808|  8.83k|    xmlXPathParserContextPtr ret;
 4809|       |
 4810|  8.83k|    ret = (xmlXPathParserContextPtr) xmlMalloc(sizeof(xmlXPathParserContext));
 4811|  8.83k|    if (ret == NULL) {
  ------------------
  |  Branch (4811:9): [True: 20, False: 8.81k]
  ------------------
 4812|     20|        xmlXPathErrMemory(ctxt);
 4813|     20|	return(NULL);
 4814|     20|    }
 4815|  8.81k|    memset(ret, 0 , sizeof(xmlXPathParserContext));
 4816|  8.81k|    ret->cur = ret->base = str;
 4817|  8.81k|    ret->context = ctxt;
 4818|       |
 4819|  8.81k|    ret->comp = xmlXPathNewCompExpr();
 4820|  8.81k|    if (ret->comp == NULL) {
  ------------------
  |  Branch (4820:9): [True: 37, False: 8.78k]
  ------------------
 4821|     37|        xmlXPathErrMemory(ctxt);
 4822|     37|	xmlFree(ret->valueTab);
 4823|     37|	xmlFree(ret);
 4824|     37|	return(NULL);
 4825|     37|    }
 4826|  8.78k|    if ((ctxt != NULL) && (ctxt->dict != NULL)) {
  ------------------
  |  Branch (4826:9): [True: 8.78k, False: 0]
  |  Branch (4826:27): [True: 0, False: 8.78k]
  ------------------
 4827|      0|        ret->comp->dict = ctxt->dict;
 4828|      0|	xmlDictReference(ret->comp->dict);
 4829|      0|    }
 4830|       |
 4831|  8.78k|    return(ret);
 4832|  8.81k|}
xmlXPathFreeParserContext:
 4879|  8.78k|xmlXPathFreeParserContext(xmlXPathParserContext *ctxt) {
 4880|  8.78k|    int i;
 4881|       |
 4882|  8.78k|    if (ctxt == NULL)
  ------------------
  |  Branch (4882:9): [True: 0, False: 8.78k]
  ------------------
 4883|      0|        return;
 4884|       |
 4885|  8.78k|    if (ctxt->valueTab != NULL) {
  ------------------
  |  Branch (4885:9): [True: 8.75k, False: 26]
  ------------------
 4886|  15.8k|        for (i = 0; i < ctxt->valueNr; i++) {
  ------------------
  |  Branch (4886:21): [True: 7.14k, False: 8.75k]
  ------------------
 4887|  7.14k|            if (ctxt->context)
  ------------------
  |  Branch (4887:17): [True: 7.14k, False: 0]
  ------------------
 4888|  7.14k|                xmlXPathReleaseObject(ctxt->context, ctxt->valueTab[i]);
 4889|      0|            else
 4890|      0|                xmlXPathFreeObject(ctxt->valueTab[i]);
 4891|  7.14k|        }
 4892|  8.75k|        xmlFree(ctxt->valueTab);
 4893|  8.75k|    }
 4894|  8.78k|    if (ctxt->comp != NULL) {
  ------------------
  |  Branch (4894:9): [True: 8.78k, 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|  8.78k|	xmlXPathFreeCompExpr(ctxt->comp);
 4902|  8.78k|    }
 4903|  8.78k|    xmlFree(ctxt);
 4904|  8.78k|}
xmlXPathEqualValues:
 5702|   328k|xmlXPathEqualValues(xmlXPathParserContext *ctxt) {
 5703|   328k|    xmlXPathObjectPtr arg1, arg2, argtmp;
 5704|   328k|    int ret = 0;
 5705|       |
 5706|   328k|    if ((ctxt == NULL) || (ctxt->context == NULL)) return(0);
  ------------------
  |  Branch (5706:9): [True: 0, False: 328k]
  |  Branch (5706:27): [True: 0, False: 328k]
  ------------------
 5707|   328k|    arg2 = xmlXPathValuePop(ctxt);
 5708|   328k|    arg1 = xmlXPathValuePop(ctxt);
 5709|   328k|    if ((arg1 == NULL) || (arg2 == NULL)) {
  ------------------
  |  Branch (5709:9): [True: 0, False: 328k]
  |  Branch (5709:27): [True: 0, False: 328k]
  ------------------
 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|   328k|    if (arg1 == arg2) {
  ------------------
  |  Branch (5717:9): [True: 0, False: 328k]
  ------------------
 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|   328k|    if ((arg2->type == XPATH_NODESET) || (arg2->type == XPATH_XSLT_TREE) ||
  ------------------
  |  Branch (5725:9): [True: 114k, False: 213k]
  |  Branch (5725:42): [True: 0, False: 213k]
  ------------------
 5726|   213k|      (arg1->type == XPATH_NODESET) || (arg1->type == XPATH_XSLT_TREE)) {
  ------------------
  |  Branch (5726:7): [True: 29.5k, False: 184k]
  |  Branch (5726:40): [True: 0, False: 184k]
  ------------------
 5727|       |	/*
 5728|       |	 *Hack it to assure arg1 is the nodeset
 5729|       |	 */
 5730|   143k|	if ((arg1->type != XPATH_NODESET) && (arg1->type != XPATH_XSLT_TREE)) {
  ------------------
  |  Branch (5730:6): [True: 88.5k, False: 55.4k]
  |  Branch (5730:39): [True: 88.5k, False: 0]
  ------------------
 5731|  88.5k|		argtmp = arg2;
 5732|  88.5k|		arg2 = arg1;
 5733|  88.5k|		arg1 = argtmp;
 5734|  88.5k|	}
 5735|   143k|	switch (arg2->type) {
  ------------------
  |  Branch (5735:10): [True: 143k, False: 0]
  ------------------
 5736|      0|	    case XPATH_UNDEFINED:
  ------------------
  |  Branch (5736:6): [True: 0, False: 143k]
  ------------------
 5737|      0|		break;
 5738|  25.9k|	    case XPATH_NODESET:
  ------------------
  |  Branch (5738:6): [True: 25.9k, False: 118k]
  ------------------
 5739|  25.9k|	    case XPATH_XSLT_TREE:
  ------------------
  |  Branch (5739:6): [True: 0, False: 143k]
  ------------------
 5740|  25.9k|		ret = xmlXPathEqualNodeSets(ctxt, arg1, arg2, 0);
 5741|  25.9k|		break;
 5742|  81.1k|	    case XPATH_BOOLEAN:
  ------------------
  |  Branch (5742:6): [True: 81.1k, False: 62.8k]
  ------------------
 5743|  81.1k|		if ((arg1->nodesetval == NULL) ||
  ------------------
  |  Branch (5743:7): [True: 0, False: 81.1k]
  ------------------
 5744|  81.1k|		  (arg1->nodesetval->nodeNr == 0)) ret = 0;
  ------------------
  |  Branch (5744:5): [True: 46.5k, False: 34.6k]
  ------------------
 5745|  34.6k|		else
 5746|  34.6k|		    ret = 1;
 5747|  81.1k|		ret = (ret == arg2->boolval);
 5748|  81.1k|		break;
 5749|  28.1k|	    case XPATH_NUMBER:
  ------------------
  |  Branch (5749:6): [True: 28.1k, False: 115k]
  ------------------
 5750|  28.1k|		ret = xmlXPathEqualNodeSetFloat(ctxt, arg1, arg2->floatval, 0);
 5751|  28.1k|		break;
 5752|  8.69k|	    case XPATH_STRING:
  ------------------
  |  Branch (5752:6): [True: 8.69k, False: 135k]
  ------------------
 5753|  8.69k|		ret = xmlXPathEqualNodeSetString(ctxt, arg1,
 5754|  8.69k|                                                 arg2->stringval, 0);
 5755|  8.69k|		break;
 5756|      0|	    case XPATH_USERS:
  ------------------
  |  Branch (5756:6): [True: 0, False: 143k]
  ------------------
 5757|       |		/* TODO */
 5758|      0|		break;
 5759|   143k|	}
 5760|   143k|	xmlXPathReleaseObject(ctxt->context, arg1);
 5761|   143k|	xmlXPathReleaseObject(ctxt->context, arg2);
 5762|   143k|	return(ret);
 5763|   143k|    }
 5764|       |
 5765|   184k|    return (xmlXPathEqualValuesCommon(ctxt, arg1, arg2));
 5766|   328k|}
xmlXPathNotEqualValues:
 5775|  4.00k|xmlXPathNotEqualValues(xmlXPathParserContext *ctxt) {
 5776|  4.00k|    xmlXPathObjectPtr arg1, arg2, argtmp;
 5777|  4.00k|    int ret = 0;
 5778|       |
 5779|  4.00k|    if ((ctxt == NULL) || (ctxt->context == NULL)) return(0);
  ------------------
  |  Branch (5779:9): [True: 0, False: 4.00k]
  |  Branch (5779:27): [True: 0, False: 4.00k]
  ------------------
 5780|  4.00k|    arg2 = xmlXPathValuePop(ctxt);
 5781|  4.00k|    arg1 = xmlXPathValuePop(ctxt);
 5782|  4.00k|    if ((arg1 == NULL) || (arg2 == NULL)) {
  ------------------
  |  Branch (5782:9): [True: 0, False: 4.00k]
  |  Branch (5782:27): [True: 0, False: 4.00k]
  ------------------
 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|  4.00k|    if (arg1 == arg2) {
  ------------------
  |  Branch (5790:9): [True: 0, False: 4.00k]
  ------------------
 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|  4.00k|    if ((arg2->type == XPATH_NODESET) || (arg2->type == XPATH_XSLT_TREE) ||
  ------------------
  |  Branch (5798:9): [True: 1.95k, False: 2.04k]
  |  Branch (5798:42): [True: 0, False: 2.04k]
  ------------------
 5799|  3.02k|      (arg1->type == XPATH_NODESET) || (arg1->type == XPATH_XSLT_TREE)) {
  ------------------
  |  Branch (5799:7): [True: 1.06k, False: 982]
  |  Branch (5799:40): [True: 0, False: 982]
  ------------------
 5800|       |	/*
 5801|       |	 *Hack it to assure arg1 is the nodeset
 5802|       |	 */
 5803|  3.02k|	if ((arg1->type != XPATH_NODESET) && (arg1->type != XPATH_XSLT_TREE)) {
  ------------------
  |  Branch (5803:6): [True: 1.18k, False: 1.84k]
  |  Branch (5803:39): [True: 1.18k, False: 0]
  ------------------
 5804|  1.18k|		argtmp = arg2;
 5805|  1.18k|		arg2 = arg1;
 5806|  1.18k|		arg1 = argtmp;
 5807|  1.18k|	}
 5808|  3.02k|	switch (arg2->type) {
  ------------------
  |  Branch (5808:10): [True: 3.02k, False: 0]
  ------------------
 5809|      0|	    case XPATH_UNDEFINED:
  ------------------
  |  Branch (5809:6): [True: 0, False: 3.02k]
  ------------------
 5810|      0|		break;
 5811|    778|	    case XPATH_NODESET:
  ------------------
  |  Branch (5811:6): [True: 778, False: 2.24k]
  ------------------
 5812|    778|	    case XPATH_XSLT_TREE:
  ------------------
  |  Branch (5812:6): [True: 0, False: 3.02k]
  ------------------
 5813|    778|		ret = xmlXPathEqualNodeSets(ctxt, arg1, arg2, 1);
 5814|    778|		break;
 5815|  1.18k|	    case XPATH_BOOLEAN:
  ------------------
  |  Branch (5815:6): [True: 1.18k, False: 1.83k]
  ------------------
 5816|  1.18k|		if ((arg1->nodesetval == NULL) ||
  ------------------
  |  Branch (5816:7): [True: 0, False: 1.18k]
  ------------------
 5817|  1.18k|		  (arg1->nodesetval->nodeNr == 0)) ret = 0;
  ------------------
  |  Branch (5817:5): [True: 661, False: 526]
  ------------------
 5818|    526|		else
 5819|    526|		    ret = 1;
 5820|  1.18k|		ret = (ret != arg2->boolval);
 5821|  1.18k|		break;
 5822|    484|	    case XPATH_NUMBER:
  ------------------
  |  Branch (5822:6): [True: 484, False: 2.54k]
  ------------------
 5823|    484|		ret = xmlXPathEqualNodeSetFloat(ctxt, arg1, arg2->floatval, 1);
 5824|    484|		break;
 5825|    575|	    case XPATH_STRING:
  ------------------
  |  Branch (5825:6): [True: 575, False: 2.44k]
  ------------------
 5826|    575|		ret = xmlXPathEqualNodeSetString(ctxt, arg1,
 5827|    575|                                                 arg2->stringval, 1);
 5828|    575|		break;
 5829|      0|	    case XPATH_USERS:
  ------------------
  |  Branch (5829:6): [True: 0, False: 3.02k]
  ------------------
 5830|       |		/* TODO */
 5831|      0|		break;
 5832|  3.02k|	}
 5833|  3.02k|	xmlXPathReleaseObject(ctxt->context, arg1);
 5834|  3.02k|	xmlXPathReleaseObject(ctxt->context, arg2);
 5835|  3.02k|	return(ret);
 5836|  3.02k|    }
 5837|       |
 5838|    982|    return (!xmlXPathEqualValuesCommon(ctxt, arg1, arg2));
 5839|  4.00k|}
xmlXPathCompareValues:
 5864|   226k|xmlXPathCompareValues(xmlXPathParserContext *ctxt, int inf, int strict) {
 5865|   226k|    int ret = 0, arg1i = 0, arg2i = 0;
 5866|   226k|    xmlXPathObjectPtr arg1, arg2;
 5867|       |
 5868|   226k|    if ((ctxt == NULL) || (ctxt->context == NULL)) return(0);
  ------------------
  |  Branch (5868:9): [True: 0, False: 226k]
  |  Branch (5868:27): [True: 0, False: 226k]
  ------------------
 5869|   226k|    arg2 = xmlXPathValuePop(ctxt);
 5870|   226k|    arg1 = xmlXPathValuePop(ctxt);
 5871|   226k|    if ((arg1 == NULL) || (arg2 == NULL)) {
  ------------------
  |  Branch (5871:9): [True: 9, False: 226k]
  |  Branch (5871:27): [True: 0, False: 226k]
  ------------------
 5872|      9|	if (arg1 != NULL)
  ------------------
  |  Branch (5872:6): [True: 0, False: 9]
  ------------------
 5873|      0|	    xmlXPathReleaseObject(ctxt->context, arg1);
 5874|      9|	else
 5875|      9|	    xmlXPathReleaseObject(ctxt->context, arg2);
 5876|      9|	XP_ERROR0(XPATH_INVALID_OPERAND);
  ------------------
  |  |  252|      9|    { xmlXPathErr(ctxt, X); return(0); }
  ------------------
 5877|      0|    }
 5878|       |
 5879|   226k|    if ((arg2->type == XPATH_NODESET) || (arg2->type == XPATH_XSLT_TREE) ||
  ------------------
  |  Branch (5879:9): [True: 141k, False: 85.1k]
  |  Branch (5879:42): [True: 0, False: 85.1k]
  ------------------
 5880|   155k|      (arg1->type == XPATH_NODESET) || (arg1->type == XPATH_XSLT_TREE)) {
  ------------------
  |  Branch (5880:7): [True: 13.9k, False: 71.1k]
  |  Branch (5880:40): [True: 0, False: 71.1k]
  ------------------
 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: 141k, False: 13.9k]
  |  Branch (5886:40): [True: 0, False: 13.9k]
  ------------------
 5887|   141k|	  ((arg1->type == XPATH_NODESET) || (arg1->type == XPATH_XSLT_TREE))){
  ------------------
  |  Branch (5887:5): [True: 89.5k, False: 52.0k]
  |  Branch (5887:38): [True: 0, False: 52.0k]
  ------------------
 5888|  89.5k|	    ret = xmlXPathCompareNodeSets(ctxt, inf, strict, arg1, arg2);
 5889|  89.5k|	} else {
 5890|  66.0k|	    if ((arg1->type == XPATH_NODESET) || (arg1->type == XPATH_XSLT_TREE)) {
  ------------------
  |  Branch (5890:10): [True: 13.9k, False: 52.0k]
  |  Branch (5890:43): [True: 0, False: 52.0k]
  ------------------
 5891|  13.9k|		ret = xmlXPathCompareNodeSetValue(ctxt, inf, strict,
 5892|  13.9k|			                          arg1, arg2);
 5893|  52.0k|	    } else {
 5894|  52.0k|		ret = xmlXPathCompareNodeSetValue(ctxt, !inf, strict,
 5895|  52.0k|			                          arg2, arg1);
 5896|  52.0k|	    }
 5897|  66.0k|	}
 5898|   155k|	return(ret);
 5899|   155k|    }
 5900|       |
 5901|  71.1k|    if (arg1->type != XPATH_NUMBER) {
  ------------------
  |  Branch (5901:9): [True: 13.5k, False: 57.6k]
  ------------------
 5902|  13.5k|	xmlXPathValuePush(ctxt, arg1);
 5903|  13.5k|	xmlXPathNumberFunction(ctxt, 1);
 5904|  13.5k|	arg1 = xmlXPathValuePop(ctxt);
 5905|  13.5k|    }
 5906|  71.1k|    if (arg2->type != XPATH_NUMBER) {
  ------------------
  |  Branch (5906:9): [True: 9.65k, False: 61.5k]
  ------------------
 5907|  9.65k|	xmlXPathValuePush(ctxt, arg2);
 5908|  9.65k|	xmlXPathNumberFunction(ctxt, 1);
 5909|  9.65k|	arg2 = xmlXPathValuePop(ctxt);
 5910|  9.65k|    }
 5911|  71.1k|    if (ctxt->error)
  ------------------
  |  Branch (5911:9): [True: 321, False: 70.8k]
  ------------------
 5912|    321|        goto error;
 5913|       |    /*
 5914|       |     * Add tests for infinity and nan
 5915|       |     * => feedback on 3.4 for Inf and NaN
 5916|       |     */
 5917|       |    /* Hand check NaN and Infinity comparisons */
 5918|  70.8k|    if (xmlXPathIsNaN(arg1->floatval) || xmlXPathIsNaN(arg2->floatval)) {
  ------------------
  |  Branch (5918:9): [True: 49.5k, False: 21.2k]
  |  Branch (5918:42): [True: 2.33k, False: 18.9k]
  ------------------
 5919|  51.8k|	ret=0;
 5920|  51.8k|    } else {
 5921|  18.9k|	arg1i=xmlXPathIsInf(arg1->floatval);
 5922|  18.9k|	arg2i=xmlXPathIsInf(arg2->floatval);
 5923|  18.9k|	if (inf && strict) {
  ------------------
  |  Branch (5923:6): [True: 11.0k, False: 7.90k]
  |  Branch (5923:13): [True: 8.81k, False: 2.24k]
  ------------------
 5924|  8.81k|	    if ((arg1i == -1 && arg2i != -1) ||
  ------------------
  |  Branch (5924:11): [True: 304, False: 8.50k]
  |  Branch (5924:26): [True: 117, False: 187]
  ------------------
 5925|  8.69k|		(arg2i == 1 && arg1i != 1)) {
  ------------------
  |  Branch (5925:4): [True: 294, False: 8.39k]
  |  Branch (5925:18): [True: 211, False: 83]
  ------------------
 5926|    328|		ret = 1;
 5927|  8.48k|	    } else if (arg1i == 0 && arg2i == 0) {
  ------------------
  |  Branch (5927:17): [True: 8.00k, False: 479]
  |  Branch (5927:31): [True: 7.84k, False: 159]
  ------------------
 5928|  7.84k|		ret = (arg1->floatval < arg2->floatval);
 5929|  7.84k|	    } else {
 5930|    638|		ret = 0;
 5931|    638|	    }
 5932|  8.81k|	}
 5933|  10.1k|	else if (inf && !strict) {
  ------------------
  |  Branch (5933:11): [True: 2.24k, False: 7.90k]
  |  Branch (5933:18): [True: 2.24k, False: 0]
  ------------------
 5934|  2.24k|	    if (arg1i == -1 || arg2i == 1) {
  ------------------
  |  Branch (5934:10): [True: 96, False: 2.15k]
  |  Branch (5934:25): [True: 212, False: 1.93k]
  ------------------
 5935|    308|		ret = 1;
 5936|  1.93k|	    } else if (arg1i == 0 && arg2i == 0) {
  ------------------
  |  Branch (5936:17): [True: 1.32k, False: 616]
  |  Branch (5936:31): [True: 474, False: 848]
  ------------------
 5937|    474|		ret = (arg1->floatval <= arg2->floatval);
 5938|  1.46k|	    } else {
 5939|  1.46k|		ret = 0;
 5940|  1.46k|	    }
 5941|  2.24k|	}
 5942|  7.90k|	else if (!inf && strict) {
  ------------------
  |  Branch (5942:11): [True: 7.90k, False: 0]
  |  Branch (5942:19): [True: 5.40k, False: 2.49k]
  ------------------
 5943|  5.40k|	    if ((arg1i == 1 && arg2i != 1) ||
  ------------------
  |  Branch (5943:11): [True: 963, False: 4.44k]
  |  Branch (5943:25): [True: 245, False: 718]
  ------------------
 5944|  5.16k|		(arg2i == -1 && arg1i != -1)) {
  ------------------
  |  Branch (5944:4): [True: 591, False: 4.57k]
  |  Branch (5944:19): [True: 219, False: 372]
  ------------------
 5945|    464|		ret = 1;
 5946|  4.94k|	    } else if (arg1i == 0 && arg2i == 0) {
  ------------------
  |  Branch (5946:17): [True: 3.66k, False: 1.27k]
  |  Branch (5946:31): [True: 3.23k, False: 434]
  ------------------
 5947|  3.23k|		ret = (arg1->floatval > arg2->floatval);
 5948|  3.23k|	    } else {
 5949|  1.71k|		ret = 0;
 5950|  1.71k|	    }
 5951|  5.40k|	}
 5952|  2.49k|	else if (!inf && !strict) {
  ------------------
  |  Branch (5952:11): [True: 2.49k, False: 0]
  |  Branch (5952:19): [True: 2.49k, False: 0]
  ------------------
 5953|  2.49k|	    if (arg1i == 1 || arg2i == -1) {
  ------------------
  |  Branch (5953:10): [True: 866, False: 1.62k]
  |  Branch (5953:24): [True: 300, False: 1.32k]
  ------------------
 5954|  1.16k|		ret = 1;
 5955|  1.32k|	    } else if (arg1i == 0 && arg2i == 0) {
  ------------------
  |  Branch (5955:17): [True: 1.17k, False: 155]
  |  Branch (5955:31): [True: 953, False: 218]
  ------------------
 5956|    953|		ret = (arg1->floatval >= arg2->floatval);
 5957|    953|	    } else {
 5958|    373|		ret = 0;
 5959|    373|	    }
 5960|  2.49k|	}
 5961|  18.9k|    }
 5962|  71.1k|error:
 5963|  71.1k|    xmlXPathReleaseObject(ctxt->context, arg1);
 5964|  71.1k|    xmlXPathReleaseObject(ctxt->context, arg2);
 5965|  71.1k|    return(ret);
 5966|  70.8k|}
xmlXPathValueFlipSign:
 5976|  80.6k|xmlXPathValueFlipSign(xmlXPathParserContext *ctxt) {
 5977|  80.6k|    if ((ctxt == NULL) || (ctxt->context == NULL)) return;
  ------------------
  |  Branch (5977:9): [True: 0, False: 80.6k]
  |  Branch (5977:27): [True: 0, False: 80.6k]
  ------------------
 5978|  80.6k|    CAST_TO_NUMBER;
  ------------------
  |  |  297|  80.6k|    if ((ctxt->value != NULL) && (ctxt->value->type != XPATH_NUMBER))	\
  |  |  ------------------
  |  |  |  Branch (297:9): [True: 80.6k, False: 0]
  |  |  |  Branch (297:34): [True: 61.5k, False: 19.1k]
  |  |  ------------------
  |  |  298|  80.6k|        xmlXPathNumberFunction(ctxt, 1);
  ------------------
 5979|  80.6k|    CHECK_TYPE(XPATH_NUMBER);
  ------------------
  |  |  261|  80.6k|    if ((ctxt->value == NULL) || (ctxt->value->type != typeval))	\
  |  |  ------------------
  |  |  |  Branch (261:9): [True: 7, False: 80.6k]
  |  |  |  Branch (261:34): [True: 9, False: 80.6k]
  |  |  ------------------
  |  |  262|  80.6k|        XP_ERROR(XPATH_INVALID_TYPE)
  |  |  ------------------
  |  |  |  |  244|     16|    { xmlXPathErr(ctxt, X); return; }
  |  |  ------------------
  ------------------
 5980|  80.6k|    ctxt->value->floatval = -ctxt->value->floatval;
 5981|  80.6k|}
xmlXPathAddValues:
 5991|  73.1k|xmlXPathAddValues(xmlXPathParserContext *ctxt) {
 5992|  73.1k|    xmlXPathObjectPtr arg;
 5993|  73.1k|    double val;
 5994|       |
 5995|  73.1k|    arg = xmlXPathValuePop(ctxt);
 5996|  73.1k|    if (arg == NULL)
  ------------------
  |  Branch (5996:9): [True: 0, False: 73.1k]
  ------------------
 5997|  73.1k|	XP_ERROR(XPATH_INVALID_OPERAND);
  ------------------
  |  |  244|      0|    { xmlXPathErr(ctxt, X); return; }
  ------------------
 5998|  73.1k|    val = xmlXPathCastToNumberInternal(ctxt, arg);
 5999|  73.1k|    xmlXPathReleaseObject(ctxt->context, arg);
 6000|  73.1k|    CAST_TO_NUMBER;
  ------------------
  |  |  297|  73.1k|    if ((ctxt->value != NULL) && (ctxt->value->type != XPATH_NUMBER))	\
  |  |  ------------------
  |  |  |  Branch (297:9): [True: 73.1k, False: 0]
  |  |  |  Branch (297:34): [True: 61.2k, False: 11.8k]
  |  |  ------------------
  |  |  298|  73.1k|        xmlXPathNumberFunction(ctxt, 1);
  ------------------
 6001|  73.1k|    CHECK_TYPE(XPATH_NUMBER);
  ------------------
  |  |  261|  73.1k|    if ((ctxt->value == NULL) || (ctxt->value->type != typeval))	\
  |  |  ------------------
  |  |  |  Branch (261:9): [True: 2, False: 73.1k]
  |  |  |  Branch (261:34): [True: 3, False: 73.1k]
  |  |  ------------------
  |  |  262|  73.1k|        XP_ERROR(XPATH_INVALID_TYPE)
  |  |  ------------------
  |  |  |  |  244|      5|    { xmlXPathErr(ctxt, X); return; }
  |  |  ------------------
  ------------------
 6002|  73.1k|    ctxt->value->floatval += val;
 6003|  73.1k|}
xmlXPathSubValues:
 6013|  45.6k|xmlXPathSubValues(xmlXPathParserContext *ctxt) {
 6014|  45.6k|    xmlXPathObjectPtr arg;
 6015|  45.6k|    double val;
 6016|       |
 6017|  45.6k|    arg = xmlXPathValuePop(ctxt);
 6018|  45.6k|    if (arg == NULL)
  ------------------
  |  Branch (6018:9): [True: 0, False: 45.6k]
  ------------------
 6019|  45.6k|	XP_ERROR(XPATH_INVALID_OPERAND);
  ------------------
  |  |  244|      0|    { xmlXPathErr(ctxt, X); return; }
  ------------------
 6020|  45.6k|    val = xmlXPathCastToNumberInternal(ctxt, arg);
 6021|  45.6k|    xmlXPathReleaseObject(ctxt->context, arg);
 6022|  45.6k|    CAST_TO_NUMBER;
  ------------------
  |  |  297|  45.6k|    if ((ctxt->value != NULL) && (ctxt->value->type != XPATH_NUMBER))	\
  |  |  ------------------
  |  |  |  Branch (297:9): [True: 45.6k, False: 0]
  |  |  |  Branch (297:34): [True: 15.5k, False: 30.1k]
  |  |  ------------------
  |  |  298|  45.6k|        xmlXPathNumberFunction(ctxt, 1);
  ------------------
 6023|  45.6k|    CHECK_TYPE(XPATH_NUMBER);
  ------------------
  |  |  261|  45.6k|    if ((ctxt->value == NULL) || (ctxt->value->type != typeval))	\
  |  |  ------------------
  |  |  |  Branch (261:9): [True: 0, False: 45.6k]
  |  |  |  Branch (261:34): [True: 4, False: 45.6k]
  |  |  ------------------
  |  |  262|  45.6k|        XP_ERROR(XPATH_INVALID_TYPE)
  |  |  ------------------
  |  |  |  |  244|      4|    { xmlXPathErr(ctxt, X); return; }
  |  |  ------------------
  ------------------
 6024|  45.6k|    ctxt->value->floatval -= val;
 6025|  45.6k|}
xmlXPathMultValues:
 6035|   137k|xmlXPathMultValues(xmlXPathParserContext *ctxt) {
 6036|   137k|    xmlXPathObjectPtr arg;
 6037|   137k|    double val;
 6038|       |
 6039|   137k|    arg = xmlXPathValuePop(ctxt);
 6040|   137k|    if (arg == NULL)
  ------------------
  |  Branch (6040:9): [True: 0, False: 137k]
  ------------------
 6041|   137k|	XP_ERROR(XPATH_INVALID_OPERAND);
  ------------------
  |  |  244|      0|    { xmlXPathErr(ctxt, X); return; }
  ------------------
 6042|   137k|    val = xmlXPathCastToNumberInternal(ctxt, arg);
 6043|   137k|    xmlXPathReleaseObject(ctxt->context, arg);
 6044|   137k|    CAST_TO_NUMBER;
  ------------------
  |  |  297|   137k|    if ((ctxt->value != NULL) && (ctxt->value->type != XPATH_NUMBER))	\
  |  |  ------------------
  |  |  |  Branch (297:9): [True: 137k, False: 0]
  |  |  |  Branch (297:34): [True: 49.3k, False: 88.1k]
  |  |  ------------------
  |  |  298|   137k|        xmlXPathNumberFunction(ctxt, 1);
  ------------------
 6045|   137k|    CHECK_TYPE(XPATH_NUMBER);
  ------------------
  |  |  261|   137k|    if ((ctxt->value == NULL) || (ctxt->value->type != typeval))	\
  |  |  ------------------
  |  |  |  Branch (261:9): [True: 5, False: 137k]
  |  |  |  Branch (261:34): [True: 2, False: 137k]
  |  |  ------------------
  |  |  262|   137k|        XP_ERROR(XPATH_INVALID_TYPE)
  |  |  ------------------
  |  |  |  |  244|      7|    { xmlXPathErr(ctxt, X); return; }
  |  |  ------------------
  ------------------
 6046|   137k|    ctxt->value->floatval *= val;
 6047|   137k|}
xmlXPathDivValues:
 6058|  2.03k|xmlXPathDivValues(xmlXPathParserContext *ctxt) {
 6059|  2.03k|    xmlXPathObjectPtr arg;
 6060|  2.03k|    double val;
 6061|       |
 6062|  2.03k|    arg = xmlXPathValuePop(ctxt);
 6063|  2.03k|    if (arg == NULL)
  ------------------
  |  Branch (6063:9): [True: 0, False: 2.03k]
  ------------------
 6064|  2.03k|	XP_ERROR(XPATH_INVALID_OPERAND);
  ------------------
  |  |  244|      0|    { xmlXPathErr(ctxt, X); return; }
  ------------------
 6065|  2.03k|    val = xmlXPathCastToNumberInternal(ctxt, arg);
 6066|  2.03k|    xmlXPathReleaseObject(ctxt->context, arg);
 6067|  2.03k|    CAST_TO_NUMBER;
  ------------------
  |  |  297|  2.03k|    if ((ctxt->value != NULL) && (ctxt->value->type != XPATH_NUMBER))	\
  |  |  ------------------
  |  |  |  Branch (297:9): [True: 2.03k, False: 0]
  |  |  |  Branch (297:34): [True: 1.17k, False: 859]
  |  |  ------------------
  |  |  298|  2.03k|        xmlXPathNumberFunction(ctxt, 1);
  ------------------
 6068|  2.03k|    CHECK_TYPE(XPATH_NUMBER);
  ------------------
  |  |  261|  2.03k|    if ((ctxt->value == NULL) || (ctxt->value->type != typeval))	\
  |  |  ------------------
  |  |  |  Branch (261:9): [True: 1, False: 2.03k]
  |  |  |  Branch (261:34): [True: 1, False: 2.03k]
  |  |  ------------------
  |  |  262|  2.03k|        XP_ERROR(XPATH_INVALID_TYPE)
  |  |  ------------------
  |  |  |  |  244|      2|    { xmlXPathErr(ctxt, X); return; }
  |  |  ------------------
  ------------------
 6069|  2.03k|    ctxt->value->floatval /= val;
 6070|  2.03k|}
xmlXPathModValues:
 6080|    737|xmlXPathModValues(xmlXPathParserContext *ctxt) {
 6081|    737|    xmlXPathObjectPtr arg;
 6082|    737|    double arg1, arg2;
 6083|       |
 6084|    737|    arg = xmlXPathValuePop(ctxt);
 6085|    737|    if (arg == NULL)
  ------------------
  |  Branch (6085:9): [True: 0, False: 737]
  ------------------
 6086|    737|	XP_ERROR(XPATH_INVALID_OPERAND);
  ------------------
  |  |  244|      0|    { xmlXPathErr(ctxt, X); return; }
  ------------------
 6087|    737|    arg2 = xmlXPathCastToNumberInternal(ctxt, arg);
 6088|    737|    xmlXPathReleaseObject(ctxt->context, arg);
 6089|    737|    CAST_TO_NUMBER;
  ------------------
  |  |  297|    737|    if ((ctxt->value != NULL) && (ctxt->value->type != XPATH_NUMBER))	\
  |  |  ------------------
  |  |  |  Branch (297:9): [True: 737, False: 0]
  |  |  |  Branch (297:34): [True: 317, False: 420]
  |  |  ------------------
  |  |  298|    737|        xmlXPathNumberFunction(ctxt, 1);
  ------------------
 6090|    737|    CHECK_TYPE(XPATH_NUMBER);
  ------------------
  |  |  261|    737|    if ((ctxt->value == NULL) || (ctxt->value->type != typeval))	\
  |  |  ------------------
  |  |  |  Branch (261:9): [True: 1, False: 736]
  |  |  |  Branch (261:34): [True: 1, False: 735]
  |  |  ------------------
  |  |  262|    737|        XP_ERROR(XPATH_INVALID_TYPE)
  |  |  ------------------
  |  |  |  |  244|      2|    { xmlXPathErr(ctxt, X); return; }
  |  |  ------------------
  ------------------
 6091|    735|    arg1 = ctxt->value->floatval;
 6092|    735|    if (arg2 == 0)
  ------------------
  |  Branch (6092:9): [True: 13, False: 722]
  ------------------
 6093|     13|	ctxt->value->floatval = xmlXPathNAN;
 6094|    722|    else {
 6095|    722|	ctxt->value->floatval = fmod(arg1, arg2);
 6096|    722|    }
 6097|    735|}
xmlXPathNextSelf:
 6138|    288|xmlXPathNextSelf(xmlXPathParserContext *ctxt, xmlNode *cur) {
 6139|    288|    if ((ctxt == NULL) || (ctxt->context == NULL)) return(NULL);
  ------------------
  |  Branch (6139:9): [True: 0, False: 288]
  |  Branch (6139:27): [True: 0, False: 288]
  ------------------
 6140|    288|    if (cur == NULL)
  ------------------
  |  Branch (6140:9): [True: 144, False: 144]
  ------------------
 6141|    144|        return(ctxt->context->node);
 6142|    144|    return(NULL);
 6143|    288|}
xmlXPathNextChild:
 6154|   121k|xmlXPathNextChild(xmlXPathParserContext *ctxt, xmlNode *cur) {
 6155|   121k|    if ((ctxt == NULL) || (ctxt->context == NULL)) return(NULL);
  ------------------
  |  Branch (6155:9): [True: 0, False: 121k]
  |  Branch (6155:27): [True: 0, False: 121k]
  ------------------
 6156|   121k|    if (cur == NULL) {
  ------------------
  |  Branch (6156:9): [True: 58.9k, False: 62.6k]
  ------------------
 6157|  58.9k|	if (ctxt->context->node == NULL) return(NULL);
  ------------------
  |  Branch (6157:6): [True: 0, False: 58.9k]
  ------------------
 6158|  58.9k|	switch (ctxt->context->node->type) {
  ------------------
  |  Branch (6158:10): [True: 58.9k, False: 0]
  ------------------
 6159|  13.5k|            case XML_ELEMENT_NODE:
  ------------------
  |  Branch (6159:13): [True: 13.5k, False: 45.4k]
  ------------------
 6160|  40.6k|            case XML_TEXT_NODE:
  ------------------
  |  Branch (6160:13): [True: 27.1k, False: 31.8k]
  ------------------
 6161|  49.4k|            case XML_CDATA_SECTION_NODE:
  ------------------
  |  Branch (6161:13): [True: 8.81k, False: 50.1k]
  ------------------
 6162|  49.4k|            case XML_ENTITY_REF_NODE:
  ------------------
  |  Branch (6162:13): [True: 0, False: 58.9k]
  ------------------
 6163|  49.4k|            case XML_ENTITY_NODE:
  ------------------
  |  Branch (6163:13): [True: 0, False: 58.9k]
  ------------------
 6164|  50.5k|            case XML_PI_NODE:
  ------------------
  |  Branch (6164:13): [True: 1.04k, False: 57.9k]
  ------------------
 6165|  58.5k|            case XML_COMMENT_NODE:
  ------------------
  |  Branch (6165:13): [True: 8.03k, False: 50.9k]
  ------------------
 6166|  58.5k|            case XML_NOTATION_NODE:
  ------------------
  |  Branch (6166:13): [True: 0, False: 58.9k]
  ------------------
 6167|  58.5k|            case XML_DTD_NODE:
  ------------------
  |  Branch (6167:13): [True: 0, False: 58.9k]
  ------------------
 6168|  58.5k|		return(ctxt->context->node->children);
 6169|    377|            case XML_DOCUMENT_NODE:
  ------------------
  |  Branch (6169:13): [True: 377, False: 58.5k]
  ------------------
 6170|    377|            case XML_DOCUMENT_TYPE_NODE:
  ------------------
  |  Branch (6170:13): [True: 0, False: 58.9k]
  ------------------
 6171|    377|            case XML_DOCUMENT_FRAG_NODE:
  ------------------
  |  Branch (6171:13): [True: 0, False: 58.9k]
  ------------------
 6172|    377|            case XML_HTML_DOCUMENT_NODE:
  ------------------
  |  Branch (6172:13): [True: 0, False: 58.9k]
  ------------------
 6173|    377|		return(((xmlDocPtr) ctxt->context->node)->children);
 6174|      0|	    case XML_ELEMENT_DECL:
  ------------------
  |  Branch (6174:6): [True: 0, False: 58.9k]
  ------------------
 6175|      0|	    case XML_ATTRIBUTE_DECL:
  ------------------
  |  Branch (6175:6): [True: 0, False: 58.9k]
  ------------------
 6176|      0|	    case XML_ENTITY_DECL:
  ------------------
  |  Branch (6176:6): [True: 0, False: 58.9k]
  ------------------
 6177|     16|            case XML_ATTRIBUTE_NODE:
  ------------------
  |  Branch (6177:13): [True: 16, False: 58.9k]
  ------------------
 6178|     16|	    case XML_NAMESPACE_DECL:
  ------------------
  |  Branch (6178:6): [True: 0, False: 58.9k]
  ------------------
 6179|     16|	    case XML_XINCLUDE_START:
  ------------------
  |  Branch (6179:6): [True: 0, False: 58.9k]
  ------------------
 6180|     16|	    case XML_XINCLUDE_END:
  ------------------
  |  Branch (6180:6): [True: 0, False: 58.9k]
  ------------------
 6181|     16|		return(NULL);
 6182|  58.9k|	}
 6183|      0|	return(NULL);
 6184|  58.9k|    }
 6185|  62.6k|    if ((cur->type == XML_DOCUMENT_NODE) ||
  ------------------
  |  Branch (6185:9): [True: 0, False: 62.6k]
  ------------------
 6186|  62.6k|        (cur->type == XML_HTML_DOCUMENT_NODE))
  ------------------
  |  Branch (6186:9): [True: 0, False: 62.6k]
  ------------------
 6187|      0|	return(NULL);
 6188|  62.6k|    return(cur->next);
 6189|  62.6k|}
xmlXPathNextDescendant:
 6271|  4.17M|xmlXPathNextDescendant(xmlXPathParserContext *ctxt, xmlNode *cur) {
 6272|  4.17M|    if ((ctxt == NULL) || (ctxt->context == NULL)) return(NULL);
  ------------------
  |  Branch (6272:9): [True: 0, False: 4.17M]
  |  Branch (6272:27): [True: 0, False: 4.17M]
  ------------------
 6273|  4.17M|    if (cur == NULL) {
  ------------------
  |  Branch (6273:9): [True: 100k, False: 4.07M]
  ------------------
 6274|   100k|	if (ctxt->context->node == NULL)
  ------------------
  |  Branch (6274:6): [True: 0, False: 100k]
  ------------------
 6275|      0|	    return(NULL);
 6276|   100k|	if ((ctxt->context->node->type == XML_ATTRIBUTE_NODE) ||
  ------------------
  |  Branch (6276:6): [True: 224, False: 100k]
  ------------------
 6277|   100k|	    (ctxt->context->node->type == XML_NAMESPACE_DECL))
  ------------------
  |  Branch (6277:6): [True: 250, False: 100k]
  ------------------
 6278|    474|	    return(NULL);
 6279|       |
 6280|   100k|        if (ctxt->context->node == (xmlNodePtr) ctxt->context->doc)
  ------------------
  |  Branch (6280:13): [True: 42.8k, False: 57.3k]
  ------------------
 6281|  42.8k|	    return(ctxt->context->doc->children);
 6282|  57.3k|        return(ctxt->context->node->children);
 6283|   100k|    }
 6284|       |
 6285|  4.07M|    if (cur->type == XML_NAMESPACE_DECL)
  ------------------
  |  Branch (6285:9): [True: 0, False: 4.07M]
  ------------------
 6286|      0|        return(NULL);
 6287|  4.07M|    if (cur->children != NULL) {
  ------------------
  |  Branch (6287:9): [True: 1.12M, False: 2.95M]
  ------------------
 6288|       |	/*
 6289|       |	 * Do not descend on entities declarations
 6290|       |	 */
 6291|  1.12M|	if (cur->children->type != XML_ENTITY_DECL) {
  ------------------
  |  Branch (6291:6): [True: 1.11M, False: 2.63k]
  ------------------
 6292|  1.11M|	    cur = cur->children;
 6293|       |	    /*
 6294|       |	     * Skip DTDs
 6295|       |	     */
 6296|  1.11M|	    if (cur->type != XML_DTD_NODE)
  ------------------
  |  Branch (6296:10): [True: 1.11M, False: 1.51k]
  ------------------
 6297|  1.11M|		return(cur);
 6298|  1.11M|	}
 6299|  1.12M|    }
 6300|       |
 6301|  2.96M|    if (cur == ctxt->context->node) return(NULL);
  ------------------
  |  Branch (6301:9): [True: 2.22k, False: 2.95M]
  ------------------
 6302|       |
 6303|  2.96M|    while (cur->next != NULL) {
  ------------------
  |  Branch (6303:12): [True: 2.48M, False: 476k]
  ------------------
 6304|  2.48M|	cur = cur->next;
 6305|  2.48M|	if ((cur->type != XML_ENTITY_DECL) &&
  ------------------
  |  Branch (6305:6): [True: 2.48M, False: 2.11k]
  ------------------
 6306|  2.48M|	    (cur->type != XML_DTD_NODE))
  ------------------
  |  Branch (6306:6): [True: 2.48M, False: 3.55k]
  ------------------
 6307|  2.48M|	    return(cur);
 6308|  2.48M|    }
 6309|       |
 6310|  1.15M|    do {
 6311|  1.15M|        cur = cur->parent;
 6312|  1.15M|	if (cur == NULL) break;
  ------------------
  |  Branch (6312:6): [True: 0, False: 1.15M]
  ------------------
 6313|  1.15M|	if (cur == ctxt->context->node) return(NULL);
  ------------------
  |  Branch (6313:6): [True: 124k, False: 1.02M]
  ------------------
 6314|  1.02M|	if (cur->next != NULL) {
  ------------------
  |  Branch (6314:6): [True: 352k, False: 676k]
  ------------------
 6315|   352k|	    cur = cur->next;
 6316|   352k|	    return(cur);
 6317|   352k|	}
 6318|  1.02M|    } while (cur != NULL);
  ------------------
  |  Branch (6318:14): [True: 676k, False: 0]
  ------------------
 6319|      0|    return(cur);
 6320|   476k|}
xmlXPathNextDescendantOrSelf:
 6334|  2.90M|xmlXPathNextDescendantOrSelf(xmlXPathParserContext *ctxt, xmlNode *cur) {
 6335|  2.90M|    if ((ctxt == NULL) || (ctxt->context == NULL)) return(NULL);
  ------------------
  |  Branch (6335:9): [True: 0, False: 2.90M]
  |  Branch (6335:27): [True: 0, False: 2.90M]
  ------------------
 6336|  2.90M|    if (cur == NULL)
  ------------------
  |  Branch (6336:9): [True: 100k, False: 2.80M]
  ------------------
 6337|   100k|        return(ctxt->context->node);
 6338|       |
 6339|  2.80M|    if (ctxt->context->node == NULL)
  ------------------
  |  Branch (6339:9): [True: 0, False: 2.80M]
  ------------------
 6340|      0|        return(NULL);
 6341|  2.80M|    if ((ctxt->context->node->type == XML_ATTRIBUTE_NODE) ||
  ------------------
  |  Branch (6341:9): [True: 864, False: 2.80M]
  ------------------
 6342|  2.80M|        (ctxt->context->node->type == XML_NAMESPACE_DECL))
  ------------------
  |  Branch (6342:9): [True: 4.27k, False: 2.79M]
  ------------------
 6343|  5.14k|        return(NULL);
 6344|       |
 6345|  2.79M|    return(xmlXPathNextDescendant(ctxt, cur));
 6346|  2.80M|}
xmlXPathNextParent:
 6357|   196k|xmlXPathNextParent(xmlXPathParserContext *ctxt, xmlNode *cur) {
 6358|   196k|    if ((ctxt == NULL) || (ctxt->context == NULL)) return(NULL);
  ------------------
  |  Branch (6358:9): [True: 0, False: 196k]
  |  Branch (6358:27): [True: 0, False: 196k]
  ------------------
 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|   196k|    if (cur == NULL) {
  ------------------
  |  Branch (6364:9): [True: 100k, False: 95.2k]
  ------------------
 6365|   100k|	if (ctxt->context->node == NULL) return(NULL);
  ------------------
  |  Branch (6365:6): [True: 0, False: 100k]
  ------------------
 6366|   100k|	switch (ctxt->context->node->type) {
  ------------------
  |  Branch (6366:10): [True: 100k, False: 0]
  ------------------
 6367|  69.1k|            case XML_ELEMENT_NODE:
  ------------------
  |  Branch (6367:13): [True: 69.1k, False: 31.6k]
  ------------------
 6368|  91.7k|            case XML_TEXT_NODE:
  ------------------
  |  Branch (6368:13): [True: 22.6k, False: 78.0k]
  ------------------
 6369|  92.2k|            case XML_CDATA_SECTION_NODE:
  ------------------
  |  Branch (6369:13): [True: 439, False: 100k]
  ------------------
 6370|  92.2k|            case XML_ENTITY_REF_NODE:
  ------------------
  |  Branch (6370:13): [True: 0, False: 100k]
  ------------------
 6371|  92.2k|            case XML_ENTITY_NODE:
  ------------------
  |  Branch (6371:13): [True: 0, False: 100k]
  ------------------
 6372|  93.7k|            case XML_PI_NODE:
  ------------------
  |  Branch (6372:13): [True: 1.48k, False: 99.2k]
  ------------------
 6373|  94.9k|            case XML_COMMENT_NODE:
  ------------------
  |  Branch (6373:13): [True: 1.24k, False: 99.5k]
  ------------------
 6374|  94.9k|            case XML_NOTATION_NODE:
  ------------------
  |  Branch (6374:13): [True: 0, False: 100k]
  ------------------
 6375|  94.9k|            case XML_DTD_NODE:
  ------------------
  |  Branch (6375:13): [True: 0, False: 100k]
  ------------------
 6376|  94.9k|	    case XML_ELEMENT_DECL:
  ------------------
  |  Branch (6376:6): [True: 0, False: 100k]
  ------------------
 6377|  94.9k|	    case XML_ATTRIBUTE_DECL:
  ------------------
  |  Branch (6377:6): [True: 0, False: 100k]
  ------------------
 6378|  94.9k|	    case XML_XINCLUDE_START:
  ------------------
  |  Branch (6378:6): [True: 0, False: 100k]
  ------------------
 6379|  94.9k|	    case XML_XINCLUDE_END:
  ------------------
  |  Branch (6379:6): [True: 0, False: 100k]
  ------------------
 6380|  94.9k|	    case XML_ENTITY_DECL:
  ------------------
  |  Branch (6380:6): [True: 0, False: 100k]
  ------------------
 6381|  94.9k|		if (ctxt->context->node->parent == NULL)
  ------------------
  |  Branch (6381:7): [True: 0, False: 94.9k]
  ------------------
 6382|      0|		    return((xmlNodePtr) ctxt->context->doc);
 6383|  94.9k|		if ((ctxt->context->node->parent->type == XML_ELEMENT_NODE) &&
  ------------------
  |  Branch (6383:7): [True: 91.1k, False: 3.81k]
  ------------------
 6384|  91.1k|		    ((ctxt->context->node->parent->name[0] == ' ') ||
  ------------------
  |  Branch (6384:8): [True: 0, False: 91.1k]
  ------------------
 6385|  91.1k|		     (xmlStrEqual(ctxt->context->node->parent->name,
  ------------------
  |  Branch (6385:8): [True: 0, False: 91.1k]
  ------------------
 6386|  91.1k|				 BAD_CAST "fake node libxslt"))))
  ------------------
  |  |   34|  91.1k|#define BAD_CAST (xmlChar *)
  ------------------
 6387|      0|		    return(NULL);
 6388|  94.9k|		return(ctxt->context->node->parent);
 6389|  1.04k|            case XML_ATTRIBUTE_NODE: {
  ------------------
  |  Branch (6389:13): [True: 1.04k, False: 99.7k]
  ------------------
 6390|  1.04k|		xmlAttrPtr att = (xmlAttrPtr) ctxt->context->node;
 6391|       |
 6392|  1.04k|		return(att->parent);
 6393|  94.9k|	    }
 6394|  4.71k|            case XML_DOCUMENT_NODE:
  ------------------
  |  Branch (6394:13): [True: 4.71k, False: 96.0k]
  ------------------
 6395|  4.71k|            case XML_DOCUMENT_TYPE_NODE:
  ------------------
  |  Branch (6395:13): [True: 0, False: 100k]
  ------------------
 6396|  4.71k|            case XML_DOCUMENT_FRAG_NODE:
  ------------------
  |  Branch (6396:13): [True: 0, False: 100k]
  ------------------
 6397|  4.71k|            case XML_HTML_DOCUMENT_NODE:
  ------------------
  |  Branch (6397:13): [True: 0, False: 100k]
  ------------------
 6398|  4.71k|                return(NULL);
 6399|     39|	    case XML_NAMESPACE_DECL: {
  ------------------
  |  Branch (6399:6): [True: 39, False: 100k]
  ------------------
 6400|     39|		xmlNsPtr ns = (xmlNsPtr) ctxt->context->node;
 6401|       |
 6402|     39|		if ((ns->next != NULL) &&
  ------------------
  |  Branch (6402:7): [True: 39, False: 0]
  ------------------
 6403|     39|		    (ns->next->type != XML_NAMESPACE_DECL))
  ------------------
  |  Branch (6403:7): [True: 39, False: 0]
  ------------------
 6404|     39|		    return((xmlNodePtr) ns->next);
 6405|      0|                return(NULL);
 6406|     39|	    }
 6407|   100k|	}
 6408|   100k|    }
 6409|  95.2k|    return(NULL);
 6410|   196k|}
xmlXPathNextAncestor:
 6425|   112k|xmlXPathNextAncestor(xmlXPathParserContext *ctxt, xmlNode *cur) {
 6426|   112k|    if ((ctxt == NULL) || (ctxt->context == NULL)) return(NULL);
  ------------------
  |  Branch (6426:9): [True: 0, False: 112k]
  |  Branch (6426:27): [True: 0, False: 112k]
  ------------------
 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|   112k|    if (cur == NULL) {
  ------------------
  |  Branch (6432:9): [True: 23.2k, False: 88.9k]
  ------------------
 6433|  23.2k|	if (ctxt->context->node == NULL) return(NULL);
  ------------------
  |  Branch (6433:6): [True: 0, False: 23.2k]
  ------------------
 6434|  23.2k|	switch (ctxt->context->node->type) {
  ------------------
  |  Branch (6434:10): [True: 23.2k, False: 0]
  ------------------
 6435|  20.7k|            case XML_ELEMENT_NODE:
  ------------------
  |  Branch (6435:13): [True: 20.7k, False: 2.55k]
  ------------------
 6436|  22.0k|            case XML_TEXT_NODE:
  ------------------
  |  Branch (6436:13): [True: 1.28k, False: 21.9k]
  ------------------
 6437|  22.0k|            case XML_CDATA_SECTION_NODE:
  ------------------
  |  Branch (6437:13): [True: 66, False: 23.2k]
  ------------------
 6438|  22.0k|            case XML_ENTITY_REF_NODE:
  ------------------
  |  Branch (6438:13): [True: 0, False: 23.2k]
  ------------------
 6439|  22.0k|            case XML_ENTITY_NODE:
  ------------------
  |  Branch (6439:13): [True: 0, False: 23.2k]
  ------------------
 6440|  22.5k|            case XML_PI_NODE:
  ------------------
  |  Branch (6440:13): [True: 489, False: 22.7k]
  ------------------
 6441|  22.7k|            case XML_COMMENT_NODE:
  ------------------
  |  Branch (6441:13): [True: 210, False: 23.0k]
  ------------------
 6442|  22.7k|	    case XML_DTD_NODE:
  ------------------
  |  Branch (6442:6): [True: 0, False: 23.2k]
  ------------------
 6443|  22.7k|	    case XML_ELEMENT_DECL:
  ------------------
  |  Branch (6443:6): [True: 0, False: 23.2k]
  ------------------
 6444|  22.7k|	    case XML_ATTRIBUTE_DECL:
  ------------------
  |  Branch (6444:6): [True: 0, False: 23.2k]
  ------------------
 6445|  22.7k|	    case XML_ENTITY_DECL:
  ------------------
  |  Branch (6445:6): [True: 0, False: 23.2k]
  ------------------
 6446|  22.7k|            case XML_NOTATION_NODE:
  ------------------
  |  Branch (6446:13): [True: 0, False: 23.2k]
  ------------------
 6447|  22.7k|	    case XML_XINCLUDE_START:
  ------------------
  |  Branch (6447:6): [True: 0, False: 23.2k]
  ------------------
 6448|  22.7k|	    case XML_XINCLUDE_END:
  ------------------
  |  Branch (6448:6): [True: 0, False: 23.2k]
  ------------------
 6449|  22.7k|		if (ctxt->context->node->parent == NULL)
  ------------------
  |  Branch (6449:7): [True: 0, False: 22.7k]
  ------------------
 6450|      0|		    return((xmlNodePtr) ctxt->context->doc);
 6451|  22.7k|		if ((ctxt->context->node->parent->type == XML_ELEMENT_NODE) &&
  ------------------
  |  Branch (6451:7): [True: 21.8k, False: 957]
  ------------------
 6452|  21.8k|		    ((ctxt->context->node->parent->name[0] == ' ') ||
  ------------------
  |  Branch (6452:8): [True: 0, False: 21.8k]
  ------------------
 6453|  21.8k|		     (xmlStrEqual(ctxt->context->node->parent->name,
  ------------------
  |  Branch (6453:8): [True: 0, False: 21.8k]
  ------------------
 6454|  21.8k|				 BAD_CAST "fake node libxslt"))))
  ------------------
  |  |   34|  21.8k|#define BAD_CAST (xmlChar *)
  ------------------
 6455|      0|		    return(NULL);
 6456|  22.7k|		return(ctxt->context->node->parent);
 6457|     22|            case XML_ATTRIBUTE_NODE: {
  ------------------
  |  Branch (6457:13): [True: 22, False: 23.2k]
  ------------------
 6458|     22|		xmlAttrPtr tmp = (xmlAttrPtr) ctxt->context->node;
 6459|       |
 6460|     22|		return(tmp->parent);
 6461|  22.7k|	    }
 6462|    485|            case XML_DOCUMENT_NODE:
  ------------------
  |  Branch (6462:13): [True: 485, False: 22.7k]
  ------------------
 6463|    485|            case XML_DOCUMENT_TYPE_NODE:
  ------------------
  |  Branch (6463:13): [True: 0, False: 23.2k]
  ------------------
 6464|    485|            case XML_DOCUMENT_FRAG_NODE:
  ------------------
  |  Branch (6464:13): [True: 0, False: 23.2k]
  ------------------
 6465|    485|            case XML_HTML_DOCUMENT_NODE:
  ------------------
  |  Branch (6465:13): [True: 0, False: 23.2k]
  ------------------
 6466|    485|                return(NULL);
 6467|      0|	    case XML_NAMESPACE_DECL: {
  ------------------
  |  Branch (6467:6): [True: 0, False: 23.2k]
  ------------------
 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|  23.2k|	}
 6477|      0|	return(NULL);
 6478|  23.2k|    }
 6479|  88.9k|    if (cur == ctxt->context->doc->children)
  ------------------
  |  Branch (6479:9): [True: 3.23k, False: 85.6k]
  ------------------
 6480|  3.23k|	return((xmlNodePtr) ctxt->context->doc);
 6481|  85.6k|    if (cur == (xmlNodePtr) ctxt->context->doc)
  ------------------
  |  Branch (6481:9): [True: 25.5k, False: 60.1k]
  ------------------
 6482|  25.5k|	return(NULL);
 6483|  60.1k|    switch (cur->type) {
  ------------------
  |  Branch (6483:13): [True: 60.1k, False: 0]
  ------------------
 6484|  58.5k|	case XML_ELEMENT_NODE:
  ------------------
  |  Branch (6484:2): [True: 58.5k, False: 1.60k]
  ------------------
 6485|  59.6k|	case XML_TEXT_NODE:
  ------------------
  |  Branch (6485:2): [True: 1.08k, False: 59.0k]
  ------------------
 6486|  59.8k|	case XML_CDATA_SECTION_NODE:
  ------------------
  |  Branch (6486:2): [True: 213, False: 59.9k]
  ------------------
 6487|  59.8k|	case XML_ENTITY_REF_NODE:
  ------------------
  |  Branch (6487:2): [True: 0, False: 60.1k]
  ------------------
 6488|  59.8k|	case XML_ENTITY_NODE:
  ------------------
  |  Branch (6488:2): [True: 0, False: 60.1k]
  ------------------
 6489|  60.1k|	case XML_PI_NODE:
  ------------------
  |  Branch (6489:2): [True: 258, False: 59.9k]
  ------------------
 6490|  60.1k|	case XML_COMMENT_NODE:
  ------------------
  |  Branch (6490:2): [True: 20, False: 60.1k]
  ------------------
 6491|  60.1k|	case XML_NOTATION_NODE:
  ------------------
  |  Branch (6491:2): [True: 0, False: 60.1k]
  ------------------
 6492|  60.1k|	case XML_DTD_NODE:
  ------------------
  |  Branch (6492:2): [True: 0, False: 60.1k]
  ------------------
 6493|  60.1k|        case XML_ELEMENT_DECL:
  ------------------
  |  Branch (6493:9): [True: 0, False: 60.1k]
  ------------------
 6494|  60.1k|        case XML_ATTRIBUTE_DECL:
  ------------------
  |  Branch (6494:9): [True: 0, False: 60.1k]
  ------------------
 6495|  60.1k|        case XML_ENTITY_DECL:
  ------------------
  |  Branch (6495:9): [True: 0, False: 60.1k]
  ------------------
 6496|  60.1k|	case XML_XINCLUDE_START:
  ------------------
  |  Branch (6496:2): [True: 0, False: 60.1k]
  ------------------
 6497|  60.1k|	case XML_XINCLUDE_END:
  ------------------
  |  Branch (6497:2): [True: 0, False: 60.1k]
  ------------------
 6498|  60.1k|	    if (cur->parent == NULL)
  ------------------
  |  Branch (6498:10): [True: 0, False: 60.1k]
  ------------------
 6499|      0|		return(NULL);
 6500|  60.1k|	    if ((cur->parent->type == XML_ELEMENT_NODE) &&
  ------------------
  |  Branch (6500:10): [True: 38.8k, False: 21.2k]
  ------------------
 6501|  38.8k|		((cur->parent->name[0] == ' ') ||
  ------------------
  |  Branch (6501:4): [True: 0, False: 38.8k]
  ------------------
 6502|  38.8k|		 (xmlStrEqual(cur->parent->name,
  ------------------
  |  Branch (6502:4): [True: 0, False: 38.8k]
  ------------------
 6503|  38.8k|			      BAD_CAST "fake node libxslt"))))
  ------------------
  |  |   34|  38.8k|#define BAD_CAST (xmlChar *)
  ------------------
 6504|      0|		return(NULL);
 6505|  60.1k|	    return(cur->parent);
 6506|     33|	case XML_ATTRIBUTE_NODE: {
  ------------------
  |  Branch (6506:2): [True: 33, False: 60.1k]
  ------------------
 6507|     33|	    xmlAttrPtr att = (xmlAttrPtr) cur;
 6508|       |
 6509|     33|	    return(att->parent);
 6510|  60.1k|	}
 6511|      0|	case XML_NAMESPACE_DECL: {
  ------------------
  |  Branch (6511:2): [True: 0, False: 60.1k]
  ------------------
 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: 60.1k]
  ------------------
 6521|      0|	case XML_DOCUMENT_TYPE_NODE:
  ------------------
  |  Branch (6521:2): [True: 0, False: 60.1k]
  ------------------
 6522|      0|	case XML_DOCUMENT_FRAG_NODE:
  ------------------
  |  Branch (6522:2): [True: 0, False: 60.1k]
  ------------------
 6523|      0|	case XML_HTML_DOCUMENT_NODE:
  ------------------
  |  Branch (6523:2): [True: 0, False: 60.1k]
  ------------------
 6524|      0|	    return(NULL);
 6525|  60.1k|    }
 6526|      0|    return(NULL);
 6527|  60.1k|}
xmlXPathNextAncestorOrSelf:
 6541|  15.7k|xmlXPathNextAncestorOrSelf(xmlXPathParserContext *ctxt, xmlNode *cur) {
 6542|  15.7k|    if ((ctxt == NULL) || (ctxt->context == NULL)) return(NULL);
  ------------------
  |  Branch (6542:9): [True: 0, False: 15.7k]
  |  Branch (6542:27): [True: 0, False: 15.7k]
  ------------------
 6543|  15.7k|    if (cur == NULL)
  ------------------
  |  Branch (6543:9): [True: 2.71k, False: 13.0k]
  ------------------
 6544|  2.71k|        return(ctxt->context->node);
 6545|  13.0k|    return(xmlXPathNextAncestor(ctxt, cur));
 6546|  15.7k|}
xmlXPathNextPrecedingSibling:
 6587|      3|xmlXPathNextPrecedingSibling(xmlXPathParserContext *ctxt, xmlNode *cur) {
 6588|      3|    if ((ctxt == NULL) || (ctxt->context == NULL)) return(NULL);
  ------------------
  |  Branch (6588:9): [True: 0, False: 3]
  |  Branch (6588:27): [True: 0, False: 3]
  ------------------
 6589|      3|    if ((ctxt->context->node->type == XML_ATTRIBUTE_NODE) ||
  ------------------
  |  Branch (6589:9): [True: 0, False: 3]
  ------------------
 6590|      3|        (ctxt->context->node->type == XML_NAMESPACE_DECL))
  ------------------
  |  Branch (6590:9): [True: 0, False: 3]
  ------------------
 6591|      0|        return(NULL);
 6592|       |
 6593|      3|    if (cur == (xmlNodePtr) ctxt->context->doc)
  ------------------
  |  Branch (6593:9): [True: 0, False: 3]
  ------------------
 6594|      0|        return(NULL);
 6595|       |
 6596|      3|    if (cur == NULL) {
  ------------------
  |  Branch (6596:9): [True: 3, False: 0]
  ------------------
 6597|      3|        cur = ctxt->context->node;
 6598|      3|    } else if ((cur->prev != NULL) && (cur->prev->type == XML_DTD_NODE)) {
  ------------------
  |  Branch (6598:16): [True: 0, False: 0]
  |  Branch (6598:39): [True: 0, False: 0]
  ------------------
 6599|      0|        cur = cur->prev;
 6600|      0|        if (cur == NULL)
  ------------------
  |  Branch (6600:13): [True: 0, False: 0]
  ------------------
 6601|      0|            cur = ctxt->context->node;
 6602|      0|    }
 6603|       |
 6604|      3|    if (cur->type == XML_DOCUMENT_NODE)
  ------------------
  |  Branch (6604:9): [True: 3, False: 0]
  ------------------
 6605|      3|        return(NULL);
 6606|       |
 6607|      0|    return(cur->prev);
 6608|      3|}
xmlXPathNextFollowing:
 6622|  25.6k|xmlXPathNextFollowing(xmlXPathParserContext *ctxt, xmlNode *cur) {
 6623|  25.6k|    if ((ctxt == NULL) || (ctxt->context == NULL)) return(NULL);
  ------------------
  |  Branch (6623:9): [True: 0, False: 25.6k]
  |  Branch (6623:27): [True: 0, False: 25.6k]
  ------------------
 6624|  25.6k|    if ((cur != NULL) && (cur->type  != XML_ATTRIBUTE_NODE) &&
  ------------------
  |  Branch (6624:9): [True: 24.9k, False: 672]
  |  Branch (6624:26): [True: 24.9k, False: 0]
  ------------------
 6625|  24.9k|        (cur->type != XML_NAMESPACE_DECL) && (cur->children != NULL))
  ------------------
  |  Branch (6625:9): [True: 24.9k, False: 0]
  |  Branch (6625:46): [True: 3.60k, False: 21.3k]
  ------------------
 6626|  3.60k|        return(cur->children);
 6627|       |
 6628|  22.0k|    if (cur == NULL) {
  ------------------
  |  Branch (6628:9): [True: 672, False: 21.3k]
  ------------------
 6629|    672|        cur = ctxt->context->node;
 6630|    672|        if (cur->type == XML_ATTRIBUTE_NODE) {
  ------------------
  |  Branch (6630:13): [True: 39, False: 633]
  ------------------
 6631|     39|            cur = cur->parent;
 6632|    633|        } else if (cur->type == XML_NAMESPACE_DECL) {
  ------------------
  |  Branch (6632:20): [True: 0, False: 633]
  ------------------
 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|    672|    }
 6641|       |
 6642|       |    /* ERROR */
 6643|  22.0k|    if (cur == NULL)
  ------------------
  |  Branch (6643:9): [True: 0, False: 22.0k]
  ------------------
 6644|      0|        return(NULL);
 6645|       |
 6646|  22.0k|    if (cur->type == XML_DOCUMENT_NODE)
  ------------------
  |  Branch (6646:9): [True: 105, False: 21.9k]
  ------------------
 6647|    105|        return(NULL);
 6648|       |
 6649|  21.9k|    if (cur->next != NULL)
  ------------------
  |  Branch (6649:9): [True: 17.7k, False: 4.16k]
  ------------------
 6650|  17.7k|        return(cur->next);
 6651|       |
 6652|  4.69k|    do {
 6653|  4.69k|        cur = cur->parent;
 6654|  4.69k|        if (cur == NULL)
  ------------------
  |  Branch (6654:13): [True: 0, False: 4.69k]
  ------------------
 6655|      0|            break;
 6656|  4.69k|        if (cur == (xmlNodePtr) ctxt->context->doc)
  ------------------
  |  Branch (6656:13): [True: 567, False: 4.12k]
  ------------------
 6657|    567|            return(NULL);
 6658|  4.12k|        if (cur->next != NULL && cur->type != XML_DOCUMENT_NODE)
  ------------------
  |  Branch (6658:13): [True: 3.60k, False: 529]
  |  Branch (6658:34): [True: 3.60k, False: 0]
  ------------------
 6659|  3.60k|            return(cur->next);
 6660|  4.12k|    } while (cur != NULL);
  ------------------
  |  Branch (6660:14): [True: 529, False: 0]
  ------------------
 6661|       |
 6662|      0|    return(cur);
 6663|  4.16k|}
xmlXPathNextNamespace:
 6814|  56.9k|xmlXPathNextNamespace(xmlXPathParserContext *ctxt, xmlNode *cur) {
 6815|  56.9k|    if ((ctxt == NULL) || (ctxt->context == NULL)) return(NULL);
  ------------------
  |  Branch (6815:9): [True: 0, False: 56.9k]
  |  Branch (6815:27): [True: 0, False: 56.9k]
  ------------------
 6816|  56.9k|    if (ctxt->context->node->type != XML_ELEMENT_NODE) return(NULL);
  ------------------
  |  Branch (6816:9): [True: 4.22k, False: 52.6k]
  ------------------
 6817|  52.6k|    if (cur == NULL) {
  ------------------
  |  Branch (6817:9): [True: 15.9k, False: 36.7k]
  ------------------
 6818|  15.9k|        if (ctxt->context->tmpNsList != NULL)
  ------------------
  |  Branch (6818:13): [True: 374, False: 15.5k]
  ------------------
 6819|    374|	    xmlFree(ctxt->context->tmpNsList);
 6820|  15.9k|	ctxt->context->tmpNsNr = 0;
 6821|  15.9k|        if (xmlGetNsListSafe(ctxt->context->doc, ctxt->context->node,
  ------------------
  |  Branch (6821:13): [True: 5, False: 15.9k]
  ------------------
 6822|  15.9k|                             &ctxt->context->tmpNsList) < 0) {
 6823|      5|            xmlXPathPErrMemory(ctxt);
 6824|      5|            return(NULL);
 6825|      5|        }
 6826|  15.9k|        if (ctxt->context->tmpNsList != NULL) {
  ------------------
  |  Branch (6826:13): [True: 15.0k, False: 927]
  ------------------
 6827|  36.5k|            while (ctxt->context->tmpNsList[ctxt->context->tmpNsNr] != NULL) {
  ------------------
  |  Branch (6827:20): [True: 21.5k, False: 15.0k]
  ------------------
 6828|  21.5k|                ctxt->context->tmpNsNr++;
 6829|  21.5k|            }
 6830|  15.0k|        }
 6831|  15.9k|	return((xmlNodePtr) xmlXPathXMLNamespace);
 6832|  15.9k|    }
 6833|  36.7k|    if (ctxt->context->tmpNsNr > 0) {
  ------------------
  |  Branch (6833:9): [True: 21.2k, False: 15.4k]
  ------------------
 6834|  21.2k|	return (xmlNodePtr)ctxt->context->tmpNsList[--ctxt->context->tmpNsNr];
 6835|  21.2k|    } else {
 6836|  15.4k|	if (ctxt->context->tmpNsList != NULL)
  ------------------
  |  Branch (6836:6): [True: 14.5k, False: 865]
  ------------------
 6837|  14.5k|	    xmlFree(ctxt->context->tmpNsList);
 6838|  15.4k|	ctxt->context->tmpNsList = NULL;
 6839|       |	return(NULL);
 6840|  15.4k|    }
 6841|  36.7k|}
xmlXPathNextAttribute:
 6852|   204k|xmlXPathNextAttribute(xmlXPathParserContext *ctxt, xmlNode *cur) {
 6853|   204k|    if ((ctxt == NULL) || (ctxt->context == NULL)) return(NULL);
  ------------------
  |  Branch (6853:9): [True: 0, False: 204k]
  |  Branch (6853:27): [True: 0, False: 204k]
  ------------------
 6854|   204k|    if (ctxt->context->node == NULL)
  ------------------
  |  Branch (6854:9): [True: 0, False: 204k]
  ------------------
 6855|      0|	return(NULL);
 6856|   204k|    if (ctxt->context->node->type != XML_ELEMENT_NODE)
  ------------------
  |  Branch (6856:9): [True: 39.0k, False: 165k]
  ------------------
 6857|  39.0k|	return(NULL);
 6858|   165k|    if (cur == NULL) {
  ------------------
  |  Branch (6858:9): [True: 154k, False: 10.6k]
  ------------------
 6859|   154k|        if (ctxt->context->node == (xmlNodePtr) ctxt->context->doc)
  ------------------
  |  Branch (6859:13): [True: 0, False: 154k]
  ------------------
 6860|      0|	    return(NULL);
 6861|   154k|        return((xmlNodePtr)ctxt->context->node->properties);
 6862|   154k|    }
 6863|  10.6k|    return((xmlNodePtr)cur->next);
 6864|   165k|}
xmlXPathRoot:
 6887|   326k|xmlXPathRoot(xmlXPathParserContext *ctxt) {
 6888|   326k|    if ((ctxt == NULL) || (ctxt->context == NULL))
  ------------------
  |  Branch (6888:9): [True: 0, False: 326k]
  |  Branch (6888:27): [True: 0, False: 326k]
  ------------------
 6889|      0|	return;
 6890|   326k|    xmlXPathValuePush(ctxt, xmlXPathCacheNewNodeSet(ctxt,
 6891|   326k|                                            (xmlNodePtr) ctxt->context->doc));
 6892|   326k|}
xmlXPathLastFunction:
 6911|    515|xmlXPathLastFunction(xmlXPathParserContext *ctxt, int nargs) {
 6912|  1.54k|    CHECK_ARITY(0);
  ------------------
  |  |  280|    515|    if (ctxt == NULL) return;						\
  |  |  ------------------
  |  |  |  Branch (280:9): [True: 0, False: 515]
  |  |  ------------------
  |  |  281|    515|    if (nargs != (x))							\
  |  |  ------------------
  |  |  |  Branch (281:9): [True: 2, False: 513]
  |  |  ------------------
  |  |  282|    515|        XP_ERROR(XPATH_INVALID_ARITY);					\
  |  |  ------------------
  |  |  |  |  244|      2|    { xmlXPathErr(ctxt, X); return; }
  |  |  ------------------
  |  |  283|    513|    if (ctxt->valueNr < (x))						\
  |  |  ------------------
  |  |  |  Branch (283:9): [True: 0, False: 513]
  |  |  ------------------
  |  |  284|    513|        XP_ERROR(XPATH_STACK_ERROR);
  |  |  ------------------
  |  |  |  |  244|      0|    { xmlXPathErr(ctxt, X); return; }
  |  |  ------------------
  ------------------
 6913|  1.54k|    if (ctxt->context->contextSize >= 0) {
  ------------------
  |  Branch (6913:9): [True: 513, False: 0]
  ------------------
 6914|    513|	xmlXPathValuePush(ctxt,
 6915|    513|	    xmlXPathCacheNewFloat(ctxt, (double) ctxt->context->contextSize));
 6916|    513|    } else {
 6917|      0|	XP_ERROR(XPATH_INVALID_CTXT_SIZE);
  ------------------
  |  |  244|      0|    { xmlXPathErr(ctxt, X); return; }
  ------------------
 6918|      0|    }
 6919|  1.54k|}
xmlXPathPositionFunction:
 6932|    762|xmlXPathPositionFunction(xmlXPathParserContext *ctxt, int nargs) {
 6933|  2.28k|    CHECK_ARITY(0);
  ------------------
  |  |  280|    762|    if (ctxt == NULL) return;						\
  |  |  ------------------
  |  |  |  Branch (280:9): [True: 0, False: 762]
  |  |  ------------------
  |  |  281|    762|    if (nargs != (x))							\
  |  |  ------------------
  |  |  |  Branch (281:9): [True: 1, False: 761]
  |  |  ------------------
  |  |  282|    762|        XP_ERROR(XPATH_INVALID_ARITY);					\
  |  |  ------------------
  |  |  |  |  244|      1|    { xmlXPathErr(ctxt, X); return; }
  |  |  ------------------
  |  |  283|    761|    if (ctxt->valueNr < (x))						\
  |  |  ------------------
  |  |  |  Branch (283:9): [True: 0, False: 761]
  |  |  ------------------
  |  |  284|    761|        XP_ERROR(XPATH_STACK_ERROR);
  |  |  ------------------
  |  |  |  |  244|      0|    { xmlXPathErr(ctxt, X); return; }
  |  |  ------------------
  ------------------
 6934|  2.28k|    if (ctxt->context->proximityPosition >= 0) {
  ------------------
  |  Branch (6934:9): [True: 761, False: 0]
  ------------------
 6935|    761|	xmlXPathValuePush(ctxt, xmlXPathCacheNewFloat(ctxt,
 6936|    761|            (double) ctxt->context->proximityPosition));
 6937|    761|    } else {
 6938|      0|	XP_ERROR(XPATH_INVALID_CTXT_POSITION);
  ------------------
  |  |  244|      0|    { xmlXPathErr(ctxt, X); return; }
  ------------------
 6939|      0|    }
 6940|  2.28k|}
xmlXPathCountFunction:
 6950|     57|xmlXPathCountFunction(xmlXPathParserContext *ctxt, int nargs) {
 6951|     57|    xmlXPathObjectPtr cur;
 6952|       |
 6953|    163|    CHECK_ARITY(1);
  ------------------
  |  |  280|     57|    if (ctxt == NULL) return;						\
  |  |  ------------------
  |  |  |  Branch (280:9): [True: 0, False: 57]
  |  |  ------------------
  |  |  281|     57|    if (nargs != (x))							\
  |  |  ------------------
  |  |  |  Branch (281:9): [True: 4, False: 53]
  |  |  ------------------
  |  |  282|     57|        XP_ERROR(XPATH_INVALID_ARITY);					\
  |  |  ------------------
  |  |  |  |  244|      4|    { xmlXPathErr(ctxt, X); return; }
  |  |  ------------------
  |  |  283|     53|    if (ctxt->valueNr < (x))						\
  |  |  ------------------
  |  |  |  Branch (283:9): [True: 0, False: 53]
  |  |  ------------------
  |  |  284|     53|        XP_ERROR(XPATH_STACK_ERROR);
  |  |  ------------------
  |  |  |  |  244|      0|    { xmlXPathErr(ctxt, X); return; }
  |  |  ------------------
  ------------------
 6954|    163|    if ((ctxt->value == NULL) ||
  ------------------
  |  Branch (6954:9): [True: 0, False: 53]
  ------------------
 6955|     53|	((ctxt->value->type != XPATH_NODESET) &&
  ------------------
  |  Branch (6955:3): [True: 3, False: 50]
  ------------------
 6956|      3|	 (ctxt->value->type != XPATH_XSLT_TREE)))
  ------------------
  |  Branch (6956:3): [True: 3, False: 0]
  ------------------
 6957|     50|	XP_ERROR(XPATH_INVALID_TYPE);
  ------------------
  |  |  244|      3|    { xmlXPathErr(ctxt, X); return; }
  ------------------
 6958|     50|    cur = xmlXPathValuePop(ctxt);
 6959|       |
 6960|     50|    if ((cur == NULL) || (cur->nodesetval == NULL))
  ------------------
  |  Branch (6960:9): [True: 0, False: 50]
  |  Branch (6960:26): [True: 0, False: 50]
  ------------------
 6961|      0|	xmlXPathValuePush(ctxt, xmlXPathCacheNewFloat(ctxt, 0.0));
 6962|     50|    else
 6963|     50|	xmlXPathValuePush(ctxt, xmlXPathCacheNewFloat(ctxt,
 6964|     50|	    (double) cur->nodesetval->nodeNr));
 6965|     50|    xmlXPathReleaseObject(ctxt->context, cur);
 6966|     50|}
xmlXPathIdFunction:
 7047|  8.89k|xmlXPathIdFunction(xmlXPathParserContext *ctxt, int nargs) {
 7048|  8.89k|    xmlChar *tokens;
 7049|  8.89k|    xmlNodeSetPtr ret;
 7050|  8.89k|    xmlXPathObjectPtr obj;
 7051|       |
 7052|  26.6k|    CHECK_ARITY(1);
  ------------------
  |  |  280|  8.89k|    if (ctxt == NULL) return;						\
  |  |  ------------------
  |  |  |  Branch (280:9): [True: 0, False: 8.89k]
  |  |  ------------------
  |  |  281|  8.89k|    if (nargs != (x))							\
  |  |  ------------------
  |  |  |  Branch (281:9): [True: 2, False: 8.89k]
  |  |  ------------------
  |  |  282|  8.89k|        XP_ERROR(XPATH_INVALID_ARITY);					\
  |  |  ------------------
  |  |  |  |  244|      2|    { xmlXPathErr(ctxt, X); return; }
  |  |  ------------------
  |  |  283|  8.89k|    if (ctxt->valueNr < (x))						\
  |  |  ------------------
  |  |  |  Branch (283:9): [True: 5, False: 8.88k]
  |  |  ------------------
  |  |  284|  8.89k|        XP_ERROR(XPATH_STACK_ERROR);
  |  |  ------------------
  |  |  |  |  244|      5|    { xmlXPathErr(ctxt, X); return; }
  |  |  ------------------
  ------------------
 7053|  26.6k|    obj = xmlXPathValuePop(ctxt);
 7054|  26.6k|    if (obj == NULL) XP_ERROR(XPATH_INVALID_OPERAND);
  ------------------
  |  |  244|      0|    { xmlXPathErr(ctxt, X); return; }
  ------------------
  |  Branch (7054:9): [True: 0, False: 8.88k]
  ------------------
 7055|  8.88k|    if ((obj->type == XPATH_NODESET) || (obj->type == XPATH_XSLT_TREE)) {
  ------------------
  |  Branch (7055:9): [True: 725, False: 8.16k]
  |  Branch (7055:41): [True: 0, False: 8.16k]
  ------------------
 7056|    725|	xmlNodeSetPtr ns;
 7057|    725|	int i;
 7058|       |
 7059|    725|	ret = xmlXPathNodeSetCreate(NULL);
 7060|    725|        if (ret == NULL)
  ------------------
  |  Branch (7060:13): [True: 4, False: 721]
  ------------------
 7061|      4|            xmlXPathPErrMemory(ctxt);
 7062|       |
 7063|    725|	if (obj->nodesetval != NULL) {
  ------------------
  |  Branch (7063:6): [True: 725, False: 0]
  ------------------
 7064|  2.71k|	    for (i = 0; i < obj->nodesetval->nodeNr; i++) {
  ------------------
  |  Branch (7064:18): [True: 1.98k, False: 725]
  ------------------
 7065|  1.98k|		tokens =
 7066|  1.98k|		    xmlXPathCastNodeToString(obj->nodesetval->nodeTab[i]);
 7067|  1.98k|                if (tokens == NULL)
  ------------------
  |  Branch (7067:21): [True: 8, False: 1.97k]
  ------------------
 7068|      8|                    xmlXPathPErrMemory(ctxt);
 7069|  1.98k|		ns = xmlXPathGetElementsByIds(ctxt->context->doc, tokens);
 7070|  1.98k|                if (ns == NULL)
  ------------------
  |  Branch (7070:21): [True: 26, False: 1.96k]
  ------------------
 7071|     26|                    xmlXPathPErrMemory(ctxt);
 7072|  1.98k|		ret = xmlXPathNodeSetMerge(ret, ns);
 7073|  1.98k|                if (ret == NULL)
  ------------------
  |  Branch (7073:21): [True: 1, False: 1.98k]
  ------------------
 7074|      1|                    xmlXPathPErrMemory(ctxt);
 7075|  1.98k|		xmlXPathFreeNodeSet(ns);
 7076|  1.98k|		if (tokens != NULL)
  ------------------
  |  Branch (7076:7): [True: 1.97k, False: 8]
  ------------------
 7077|  1.97k|		    xmlFree(tokens);
 7078|  1.98k|	    }
 7079|    725|	}
 7080|    725|	xmlXPathReleaseObject(ctxt->context, obj);
 7081|    725|	xmlXPathValuePush(ctxt, xmlXPathCacheWrapNodeSet(ctxt, ret));
 7082|    725|	return;
 7083|    725|    }
 7084|  8.16k|    tokens = xmlXPathCastToString(obj);
 7085|  8.16k|    if (tokens == NULL)
  ------------------
  |  Branch (7085:9): [True: 8, False: 8.15k]
  ------------------
 7086|      8|        xmlXPathPErrMemory(ctxt);
 7087|  8.16k|    xmlXPathReleaseObject(ctxt->context, obj);
 7088|  8.16k|    ret = xmlXPathGetElementsByIds(ctxt->context->doc, tokens);
 7089|  8.16k|    if (ret == NULL)
  ------------------
  |  Branch (7089:9): [True: 22, False: 8.14k]
  ------------------
 7090|     22|        xmlXPathPErrMemory(ctxt);
 7091|  8.16k|    xmlFree(tokens);
 7092|  8.16k|    xmlXPathValuePush(ctxt, xmlXPathCacheWrapNodeSet(ctxt, ret));
 7093|  8.16k|}
xmlXPathLocalNameFunction:
 7108|  1.77k|xmlXPathLocalNameFunction(xmlXPathParserContext *ctxt, int nargs) {
 7109|  1.77k|    xmlXPathObjectPtr cur;
 7110|       |
 7111|  1.77k|    if (ctxt == NULL) return;
  ------------------
  |  Branch (7111:9): [True: 0, False: 1.77k]
  ------------------
 7112|       |
 7113|  1.77k|    if (nargs == 0) {
  ------------------
  |  Branch (7113:9): [True: 0, False: 1.77k]
  ------------------
 7114|      0|	xmlXPathValuePush(ctxt, xmlXPathCacheNewNodeSet(ctxt, ctxt->context->node));
 7115|      0|	nargs = 1;
 7116|      0|    }
 7117|       |
 7118|  5.31k|    CHECK_ARITY(1);
  ------------------
  |  |  280|  1.77k|    if (ctxt == NULL) return;						\
  |  |  ------------------
  |  |  |  Branch (280:9): [True: 0, False: 1.77k]
  |  |  ------------------
  |  |  281|  1.77k|    if (nargs != (x))							\
  |  |  ------------------
  |  |  |  Branch (281:9): [True: 0, False: 1.77k]
  |  |  ------------------
  |  |  282|  1.77k|        XP_ERROR(XPATH_INVALID_ARITY);					\
  |  |  ------------------
  |  |  |  |  244|      0|    { xmlXPathErr(ctxt, X); return; }
  |  |  ------------------
  |  |  283|  1.77k|    if (ctxt->valueNr < (x))						\
  |  |  ------------------
  |  |  |  Branch (283:9): [True: 1, False: 1.77k]
  |  |  ------------------
  |  |  284|  1.77k|        XP_ERROR(XPATH_STACK_ERROR);
  |  |  ------------------
  |  |  |  |  244|      1|    { xmlXPathErr(ctxt, X); return; }
  |  |  ------------------
  ------------------
 7119|  5.31k|    if ((ctxt->value == NULL) ||
  ------------------
  |  Branch (7119:9): [True: 0, False: 1.77k]
  ------------------
 7120|  1.77k|	((ctxt->value->type != XPATH_NODESET) &&
  ------------------
  |  Branch (7120:3): [True: 1, False: 1.77k]
  ------------------
 7121|      1|	 (ctxt->value->type != XPATH_XSLT_TREE)))
  ------------------
  |  Branch (7121:3): [True: 1, False: 0]
  ------------------
 7122|  1.77k|	XP_ERROR(XPATH_INVALID_TYPE);
  ------------------
  |  |  244|      1|    { xmlXPathErr(ctxt, X); return; }
  ------------------
 7123|  1.77k|    cur = xmlXPathValuePop(ctxt);
 7124|       |
 7125|  1.77k|    if ((cur->nodesetval == NULL) || (cur->nodesetval->nodeNr == 0)) {
  ------------------
  |  Branch (7125:9): [True: 0, False: 1.77k]
  |  Branch (7125:38): [True: 1, False: 1.77k]
  ------------------
 7126|      1|	xmlXPathValuePush(ctxt, xmlXPathCacheNewCString(ctxt, ""));
 7127|  1.77k|    } else {
 7128|  1.77k|	int i = 0; /* Should be first in document order !!!!! */
 7129|  1.77k|	switch (cur->nodesetval->nodeTab[i]->type) {
 7130|      1|	case XML_ELEMENT_NODE:
  ------------------
  |  Branch (7130:2): [True: 1, False: 1.76k]
  ------------------
 7131|      1|	case XML_ATTRIBUTE_NODE:
  ------------------
  |  Branch (7131:2): [True: 0, False: 1.77k]
  ------------------
 7132|      1|	case XML_PI_NODE:
  ------------------
  |  Branch (7132:2): [True: 0, False: 1.77k]
  ------------------
 7133|      1|	    if (cur->nodesetval->nodeTab[i]->name[0] == ' ')
  ------------------
  |  Branch (7133:10): [True: 0, False: 1]
  ------------------
 7134|      0|		xmlXPathValuePush(ctxt, xmlXPathCacheNewCString(ctxt, ""));
 7135|      1|	    else
 7136|      1|		xmlXPathValuePush(ctxt, xmlXPathCacheNewString(ctxt,
 7137|      1|			cur->nodesetval->nodeTab[i]->name));
 7138|      1|	    break;
 7139|      0|	case XML_NAMESPACE_DECL:
  ------------------
  |  Branch (7139:2): [True: 0, False: 1.77k]
  ------------------
 7140|      0|	    xmlXPathValuePush(ctxt, xmlXPathCacheNewString(ctxt,
 7141|      0|			((xmlNsPtr)cur->nodesetval->nodeTab[i])->prefix));
 7142|      0|	    break;
 7143|  1.76k|	default:
  ------------------
  |  Branch (7143:2): [True: 1.76k, False: 1]
  ------------------
 7144|  1.76k|	    xmlXPathValuePush(ctxt, xmlXPathCacheNewCString(ctxt, ""));
 7145|  1.77k|	}
 7146|  1.77k|    }
 7147|  1.77k|    xmlXPathReleaseObject(ctxt->context, cur);
 7148|  1.77k|}
xmlXPathStringFunction:
 7312|  36.5k|xmlXPathStringFunction(xmlXPathParserContext *ctxt, int nargs) {
 7313|  36.5k|    xmlXPathObjectPtr cur;
 7314|  36.5k|    xmlChar *stringval;
 7315|       |
 7316|  36.5k|    if (ctxt == NULL) return;
  ------------------
  |  Branch (7316:9): [True: 0, False: 36.5k]
  ------------------
 7317|  36.5k|    if (nargs == 0) {
  ------------------
  |  Branch (7317:9): [True: 38, False: 36.5k]
  ------------------
 7318|     38|        stringval = xmlXPathCastNodeToString(ctxt->context->node);
 7319|     38|        if (stringval == NULL)
  ------------------
  |  Branch (7319:13): [True: 1, False: 37]
  ------------------
 7320|      1|            xmlXPathPErrMemory(ctxt);
 7321|     38|        xmlXPathValuePush(ctxt, xmlXPathCacheWrapString(ctxt, stringval));
 7322|     38|	return;
 7323|     38|    }
 7324|       |
 7325|   146k|    CHECK_ARITY(1);
  ------------------
  |  |  280|  36.5k|    if (ctxt == NULL) return;						\
  |  |  ------------------
  |  |  |  Branch (280:9): [True: 0, False: 36.5k]
  |  |  ------------------
  |  |  281|  36.5k|    if (nargs != (x))							\
  |  |  ------------------
  |  |  |  Branch (281:9): [True: 4, False: 36.5k]
  |  |  ------------------
  |  |  282|  36.5k|        XP_ERROR(XPATH_INVALID_ARITY);					\
  |  |  ------------------
  |  |  |  |  244|      4|    { xmlXPathErr(ctxt, X); return; }
  |  |  ------------------
  |  |  283|  36.5k|    if (ctxt->valueNr < (x))						\
  |  |  ------------------
  |  |  |  Branch (283:9): [True: 0, False: 36.5k]
  |  |  ------------------
  |  |  284|  36.5k|        XP_ERROR(XPATH_STACK_ERROR);
  |  |  ------------------
  |  |  |  |  244|      0|    { xmlXPathErr(ctxt, X); return; }
  |  |  ------------------
  ------------------
 7326|   146k|    cur = xmlXPathValuePop(ctxt);
 7327|   146k|    if (cur == NULL) XP_ERROR(XPATH_INVALID_OPERAND);
  ------------------
  |  |  244|      0|    { xmlXPathErr(ctxt, X); return; }
  ------------------
  |  Branch (7327:9): [True: 0, False: 36.5k]
  ------------------
 7328|  36.5k|    if (cur->type != XPATH_STRING) {
  ------------------
  |  Branch (7328:9): [True: 36.5k, False: 11]
  ------------------
 7329|  36.5k|        stringval = xmlXPathCastToString(cur);
 7330|  36.5k|        if (stringval == NULL)
  ------------------
  |  Branch (7330:13): [True: 19, False: 36.5k]
  ------------------
 7331|     19|            xmlXPathPErrMemory(ctxt);
 7332|  36.5k|        xmlXPathReleaseObject(ctxt->context, cur);
 7333|  36.5k|        cur = xmlXPathCacheWrapString(ctxt, stringval);
 7334|  36.5k|    }
 7335|  36.5k|    xmlXPathValuePush(ctxt, cur);
 7336|  36.5k|}
xmlXPathStringLengthFunction:
 7350|    122|xmlXPathStringLengthFunction(xmlXPathParserContext *ctxt, int nargs) {
 7351|    122|    xmlXPathObjectPtr cur;
 7352|       |
 7353|    122|    if (nargs == 0) {
  ------------------
  |  Branch (7353:9): [True: 7, False: 115]
  ------------------
 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|    456|    CHECK_ARITY(1);
  ------------------
  |  |  280|    115|    if (ctxt == NULL) return;						\
  |  |  ------------------
  |  |  |  Branch (280:9): [True: 0, False: 115]
  |  |  ------------------
  |  |  281|    115|    if (nargs != (x))							\
  |  |  ------------------
  |  |  |  Branch (281:9): [True: 2, False: 113]
  |  |  ------------------
  |  |  282|    115|        XP_ERROR(XPATH_INVALID_ARITY);					\
  |  |  ------------------
  |  |  |  |  244|      2|    { xmlXPathErr(ctxt, X); return; }
  |  |  ------------------
  |  |  283|    113|    if (ctxt->valueNr < (x))						\
  |  |  ------------------
  |  |  |  Branch (283:9): [True: 0, False: 113]
  |  |  ------------------
  |  |  284|    113|        XP_ERROR(XPATH_STACK_ERROR);
  |  |  ------------------
  |  |  |  |  244|      0|    { xmlXPathErr(ctxt, X); return; }
  |  |  ------------------
  ------------------
 7371|    456|    CAST_TO_STRING;
  ------------------
  |  |  290|    113|    if ((ctxt->value != NULL) && (ctxt->value->type != XPATH_STRING))	\
  |  |  ------------------
  |  |  |  Branch (290:9): [True: 113, False: 0]
  |  |  |  Branch (290:34): [True: 106, False: 7]
  |  |  ------------------
  |  |  291|    113|        xmlXPathStringFunction(ctxt, 1);
  ------------------
 7372|    456|    CHECK_TYPE(XPATH_STRING);
  ------------------
  |  |  261|    113|    if ((ctxt->value == NULL) || (ctxt->value->type != typeval))	\
  |  |  ------------------
  |  |  |  Branch (261:9): [True: 1, False: 112]
  |  |  |  Branch (261:34): [True: 1, False: 111]
  |  |  ------------------
  |  |  262|    113|        XP_ERROR(XPATH_INVALID_TYPE)
  |  |  ------------------
  |  |  |  |  244|      2|    { xmlXPathErr(ctxt, X); return; }
  |  |  ------------------
  ------------------
 7373|    111|    cur = xmlXPathValuePop(ctxt);
 7374|    111|    xmlXPathValuePush(ctxt, xmlXPathCacheNewFloat(ctxt,
 7375|    111|	xmlUTF8Strlen(cur->stringval)));
 7376|    111|    xmlXPathReleaseObject(ctxt->context, cur);
 7377|    111|}
xmlXPathConcatFunction:
 7388|    441|xmlXPathConcatFunction(xmlXPathParserContext *ctxt, int nargs) {
 7389|    441|    xmlXPathObjectPtr cur, newobj;
 7390|    441|    xmlChar *tmp;
 7391|       |
 7392|    441|    if (ctxt == NULL) return;
  ------------------
  |  Branch (7392:9): [True: 0, False: 441]
  ------------------
 7393|    441|    if (nargs < 2) {
  ------------------
  |  Branch (7393:9): [True: 3, False: 438]
  ------------------
 7394|      3|	CHECK_ARITY(2);
  ------------------
  |  |  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; }
  |  |  ------------------
  ------------------
 7395|      3|    }
 7396|       |
 7397|    438|    CAST_TO_STRING;
  ------------------
  |  |  290|    438|    if ((ctxt->value != NULL) && (ctxt->value->type != XPATH_STRING))	\
  |  |  ------------------
  |  |  |  Branch (290:9): [True: 438, False: 0]
  |  |  |  Branch (290:34): [True: 383, False: 55]
  |  |  ------------------
  |  |  291|    438|        xmlXPathStringFunction(ctxt, 1);
  ------------------
 7398|    438|    cur = xmlXPathValuePop(ctxt);
 7399|    438|    if ((cur == NULL) || (cur->type != XPATH_STRING)) {
  ------------------
  |  Branch (7399:9): [True: 0, False: 438]
  |  Branch (7399:26): [True: 2, False: 436]
  ------------------
 7400|      2|	xmlXPathReleaseObject(ctxt->context, cur);
 7401|      2|	return;
 7402|      2|    }
 7403|    436|    nargs--;
 7404|       |
 7405|  1.68k|    while (nargs > 0) {
  ------------------
  |  Branch (7405:12): [True: 1.25k, False: 433]
  ------------------
 7406|  1.25k|	CAST_TO_STRING;
  ------------------
  |  |  290|  1.25k|    if ((ctxt->value != NULL) && (ctxt->value->type != XPATH_STRING))	\
  |  |  ------------------
  |  |  |  Branch (290:9): [True: 1.25k, False: 0]
  |  |  |  Branch (290:34): [True: 1.24k, False: 6]
  |  |  ------------------
  |  |  291|  1.25k|        xmlXPathStringFunction(ctxt, 1);
  ------------------
 7407|  1.25k|	newobj = xmlXPathValuePop(ctxt);
 7408|  1.25k|	if ((newobj == NULL) || (newobj->type != XPATH_STRING)) {
  ------------------
  |  Branch (7408:6): [True: 1, False: 1.25k]
  |  Branch (7408:26): [True: 2, False: 1.24k]
  ------------------
 7409|      3|	    xmlXPathReleaseObject(ctxt->context, newobj);
 7410|      3|	    xmlXPathReleaseObject(ctxt->context, cur);
 7411|      3|	    XP_ERROR(XPATH_INVALID_TYPE);
  ------------------
  |  |  244|      3|    { xmlXPathErr(ctxt, X); return; }
  ------------------
 7412|      0|	}
 7413|  1.24k|	tmp = xmlStrcat(newobj->stringval, cur->stringval);
 7414|  1.24k|        if (tmp == NULL)
  ------------------
  |  Branch (7414:13): [True: 4, False: 1.24k]
  ------------------
 7415|      4|            xmlXPathPErrMemory(ctxt);
 7416|  1.24k|	newobj->stringval = cur->stringval;
 7417|  1.24k|	cur->stringval = tmp;
 7418|  1.24k|	xmlXPathReleaseObject(ctxt->context, newobj);
 7419|  1.24k|	nargs--;
 7420|  1.24k|    }
 7421|    433|    xmlXPathValuePush(ctxt, cur);
 7422|    433|}
xmlXPathStartsWithFunction:
 7467|    133|xmlXPathStartsWithFunction(xmlXPathParserContext *ctxt, int nargs) {
 7468|    133|    xmlXPathObjectPtr hay, needle;
 7469|    133|    int n;
 7470|       |
 7471|    397|    CHECK_ARITY(2);
  ------------------
  |  |  280|    133|    if (ctxt == NULL) return;						\
  |  |  ------------------
  |  |  |  Branch (280:9): [True: 0, False: 133]
  |  |  ------------------
  |  |  281|    133|    if (nargs != (x))							\
  |  |  ------------------
  |  |  |  Branch (281:9): [True: 1, False: 132]
  |  |  ------------------
  |  |  282|    133|        XP_ERROR(XPATH_INVALID_ARITY);					\
  |  |  ------------------
  |  |  |  |  244|      1|    { xmlXPathErr(ctxt, X); return; }
  |  |  ------------------
  |  |  283|    132|    if (ctxt->valueNr < (x))						\
  |  |  ------------------
  |  |  |  Branch (283:9): [True: 0, False: 132]
  |  |  ------------------
  |  |  284|    132|        XP_ERROR(XPATH_STACK_ERROR);
  |  |  ------------------
  |  |  |  |  244|      0|    { xmlXPathErr(ctxt, X); return; }
  |  |  ------------------
  ------------------
 7472|    397|    CAST_TO_STRING;
  ------------------
  |  |  290|    132|    if ((ctxt->value != NULL) && (ctxt->value->type != XPATH_STRING))	\
  |  |  ------------------
  |  |  |  Branch (290:9): [True: 132, False: 0]
  |  |  |  Branch (290:34): [True: 25, False: 107]
  |  |  ------------------
  |  |  291|    132|        xmlXPathStringFunction(ctxt, 1);
  ------------------
 7473|    397|    CHECK_TYPE(XPATH_STRING);
  ------------------
  |  |  261|    132|    if ((ctxt->value == NULL) || (ctxt->value->type != typeval))	\
  |  |  ------------------
  |  |  |  Branch (261:9): [True: 0, False: 132]
  |  |  |  Branch (261:34): [True: 0, False: 132]
  |  |  ------------------
  |  |  262|    132|        XP_ERROR(XPATH_INVALID_TYPE)
  |  |  ------------------
  |  |  |  |  244|      0|    { xmlXPathErr(ctxt, X); return; }
  |  |  ------------------
  ------------------
 7474|    132|    needle = xmlXPathValuePop(ctxt);
 7475|    132|    CAST_TO_STRING;
  ------------------
  |  |  290|    132|    if ((ctxt->value != NULL) && (ctxt->value->type != XPATH_STRING))	\
  |  |  ------------------
  |  |  |  Branch (290:9): [True: 132, False: 0]
  |  |  |  Branch (290:34): [True: 132, False: 0]
  |  |  ------------------
  |  |  291|    132|        xmlXPathStringFunction(ctxt, 1);
  ------------------
 7476|    132|    hay = xmlXPathValuePop(ctxt);
 7477|       |
 7478|    132|    if ((hay == NULL) || (hay->type != XPATH_STRING)) {
  ------------------
  |  Branch (7478:9): [True: 1, False: 131]
  |  Branch (7478:26): [True: 0, False: 131]
  ------------------
 7479|      1|	xmlXPathReleaseObject(ctxt->context, hay);
 7480|      1|	xmlXPathReleaseObject(ctxt->context, needle);
 7481|      1|	XP_ERROR(XPATH_INVALID_TYPE);
  ------------------
  |  |  244|      1|    { xmlXPathErr(ctxt, X); return; }
  ------------------
 7482|      0|    }
 7483|    131|    n = xmlStrlen(needle->stringval);
 7484|    131|    if (xmlStrncmp(hay->stringval, needle->stringval, n))
  ------------------
  |  Branch (7484:9): [True: 119, False: 12]
  ------------------
 7485|    119|        xmlXPathValuePush(ctxt, xmlXPathCacheNewBoolean(ctxt, 0));
 7486|     12|    else
 7487|     12|        xmlXPathValuePush(ctxt, xmlXPathCacheNewBoolean(ctxt, 1));
 7488|    131|    xmlXPathReleaseObject(ctxt->context, hay);
 7489|    131|    xmlXPathReleaseObject(ctxt->context, needle);
 7490|    131|}
xmlXPathSubstringFunction:
 7520|  3.81k|xmlXPathSubstringFunction(xmlXPathParserContext *ctxt, int nargs) {
 7521|  3.81k|    xmlXPathObjectPtr str, start, len;
 7522|  3.81k|    double le=0, in;
 7523|  3.81k|    int i = 1, j = INT_MAX;
 7524|       |
 7525|  3.81k|    if (nargs < 2) {
  ------------------
  |  Branch (7525:9): [True: 4, False: 3.81k]
  ------------------
 7526|      4|	CHECK_ARITY(2);
  ------------------
  |  |  280|      4|    if (ctxt == NULL) return;						\
  |  |  ------------------
  |  |  |  Branch (280:9): [True: 0, False: 4]
  |  |  ------------------
  |  |  281|      4|    if (nargs != (x))							\
  |  |  ------------------
  |  |  |  Branch (281:9): [True: 4, False: 0]
  |  |  ------------------
  |  |  282|      4|        XP_ERROR(XPATH_INVALID_ARITY);					\
  |  |  ------------------
  |  |  |  |  244|      4|    { 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|      4|    }
 7528|  3.81k|    if (nargs > 3) {
  ------------------
  |  Branch (7528:9): [True: 3, False: 3.80k]
  ------------------
 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|  3.80k|    if (nargs == 3) {
  ------------------
  |  Branch (7534:9): [True: 2.03k, False: 1.77k]
  ------------------
 7535|  2.03k|	CAST_TO_NUMBER;
  ------------------
  |  |  297|  2.03k|    if ((ctxt->value != NULL) && (ctxt->value->type != XPATH_NUMBER))	\
  |  |  ------------------
  |  |  |  Branch (297:9): [True: 2.03k, False: 0]
  |  |  |  Branch (297:34): [True: 399, False: 1.64k]
  |  |  ------------------
  |  |  298|  2.03k|        xmlXPathNumberFunction(ctxt, 1);
  ------------------
 7536|  2.03k|	CHECK_TYPE(XPATH_NUMBER);
  ------------------
  |  |  261|  2.03k|    if ((ctxt->value == NULL) || (ctxt->value->type != typeval))	\
  |  |  ------------------
  |  |  |  Branch (261:9): [True: 0, False: 2.03k]
  |  |  |  Branch (261:34): [True: 1, False: 2.03k]
  |  |  ------------------
  |  |  262|  2.03k|        XP_ERROR(XPATH_INVALID_TYPE)
  |  |  ------------------
  |  |  |  |  244|      1|    { xmlXPathErr(ctxt, X); return; }
  |  |  ------------------
  ------------------
 7537|  2.03k|	len = xmlXPathValuePop(ctxt);
 7538|  2.03k|	le = len->floatval;
 7539|  2.03k|	xmlXPathReleaseObject(ctxt->context, len);
 7540|  2.03k|    }
 7541|       |
 7542|  3.80k|    CAST_TO_NUMBER;
  ------------------
  |  |  297|  3.80k|    if ((ctxt->value != NULL) && (ctxt->value->type != XPATH_NUMBER))	\
  |  |  ------------------
  |  |  |  Branch (297:9): [True: 3.80k, False: 0]
  |  |  |  Branch (297:34): [True: 864, False: 2.94k]
  |  |  ------------------
  |  |  298|  3.80k|        xmlXPathNumberFunction(ctxt, 1);
  ------------------
 7543|  3.80k|    CHECK_TYPE(XPATH_NUMBER);
  ------------------
  |  |  261|  3.80k|    if ((ctxt->value == NULL) || (ctxt->value->type != typeval))	\
  |  |  ------------------
  |  |  |  Branch (261:9): [True: 0, False: 3.80k]
  |  |  |  Branch (261:34): [True: 1, False: 3.80k]
  |  |  ------------------
  |  |  262|  3.80k|        XP_ERROR(XPATH_INVALID_TYPE)
  |  |  ------------------
  |  |  |  |  244|      1|    { xmlXPathErr(ctxt, X); return; }
  |  |  ------------------
  ------------------
 7544|  3.80k|    start = xmlXPathValuePop(ctxt);
 7545|  3.80k|    in = start->floatval;
 7546|  3.80k|    xmlXPathReleaseObject(ctxt->context, start);
 7547|  3.80k|    CAST_TO_STRING;
  ------------------
  |  |  290|  3.80k|    if ((ctxt->value != NULL) && (ctxt->value->type != XPATH_STRING))	\
  |  |  ------------------
  |  |  |  Branch (290:9): [True: 3.80k, False: 1]
  |  |  |  Branch (290:34): [True: 3.80k, False: 0]
  |  |  ------------------
  |  |  291|  3.80k|        xmlXPathStringFunction(ctxt, 1);
  ------------------
 7548|  3.80k|    CHECK_TYPE(XPATH_STRING);
  ------------------
  |  |  261|  3.80k|    if ((ctxt->value == NULL) || (ctxt->value->type != typeval))	\
  |  |  ------------------
  |  |  |  Branch (261:9): [True: 4, False: 3.80k]
  |  |  |  Branch (261:34): [True: 6, False: 3.79k]
  |  |  ------------------
  |  |  262|  3.80k|        XP_ERROR(XPATH_INVALID_TYPE)
  |  |  ------------------
  |  |  |  |  244|     10|    { xmlXPathErr(ctxt, X); return; }
  |  |  ------------------
  ------------------
 7549|  3.79k|    str = xmlXPathValuePop(ctxt);
 7550|       |
 7551|  3.79k|    if (!(in < INT_MAX)) { /* Logical NOT to handle NaNs */
  ------------------
  |  Branch (7551:9): [True: 427, False: 3.37k]
  ------------------
 7552|    427|        i = INT_MAX;
 7553|  3.37k|    } else if (in >= 1.0) {
  ------------------
  |  Branch (7553:16): [True: 2.75k, False: 612]
  ------------------
 7554|  2.75k|        i = (int)in;
 7555|  2.75k|        if (in - floor(in) >= 0.5)
  ------------------
  |  Branch (7555:13): [True: 865, False: 1.89k]
  ------------------
 7556|    865|            i += 1;
 7557|  2.75k|    }
 7558|       |
 7559|  3.79k|    if (nargs == 3) {
  ------------------
  |  Branch (7559:9): [True: 2.03k, False: 1.76k]
  ------------------
 7560|  2.03k|        double rin, rle, end;
 7561|       |
 7562|  2.03k|        rin = floor(in);
 7563|  2.03k|        if (in - rin >= 0.5)
  ------------------
  |  Branch (7563:13): [True: 674, False: 1.36k]
  ------------------
 7564|    674|            rin += 1.0;
 7565|       |
 7566|  2.03k|        rle = floor(le);
 7567|  2.03k|        if (le - rle >= 0.5)
  ------------------
  |  Branch (7567:13): [True: 958, False: 1.07k]
  ------------------
 7568|    958|            rle += 1.0;
 7569|       |
 7570|  2.03k|        end = rin + rle;
 7571|  2.03k|        if (!(end >= 1.0)) { /* Logical NOT to handle NaNs */
  ------------------
  |  Branch (7571:13): [True: 660, False: 1.37k]
  ------------------
 7572|    660|            j = 1;
 7573|  1.37k|        } else if (end < INT_MAX) {
  ------------------
  |  Branch (7573:20): [True: 696, False: 678]
  ------------------
 7574|    696|            j = (int)end;
 7575|    696|        }
 7576|  2.03k|    }
 7577|       |
 7578|  3.79k|    i -= 1;
 7579|  3.79k|    j -= 1;
 7580|       |
 7581|  3.79k|    if ((i < j) && (i < xmlUTF8Strlen(str->stringval))) {
  ------------------
  |  Branch (7581:9): [True: 3.03k, False: 762]
  |  Branch (7581:20): [True: 1.67k, False: 1.36k]
  ------------------
 7582|  1.67k|        xmlChar *ret = xmlUTF8Strsub(str->stringval, i, j - i);
 7583|  1.67k|        if (ret == NULL)
  ------------------
  |  Branch (7583:13): [True: 1, False: 1.66k]
  ------------------
 7584|      1|            xmlXPathPErrMemory(ctxt);
 7585|  1.67k|	xmlXPathValuePush(ctxt, xmlXPathCacheNewString(ctxt, ret));
 7586|  1.67k|	xmlFree(ret);
 7587|  2.12k|    } else {
 7588|  2.12k|	xmlXPathValuePush(ctxt, xmlXPathCacheNewCString(ctxt, ""));
 7589|  2.12k|    }
 7590|       |
 7591|  3.79k|    xmlXPathReleaseObject(ctxt->context, str);
 7592|  3.79k|}
xmlXPathTranslateFunction:
 7762|  8.62k|xmlXPathTranslateFunction(xmlXPathParserContext *ctxt, int nargs) {
 7763|  8.62k|    xmlXPathObjectPtr str = NULL;
 7764|  8.62k|    xmlXPathObjectPtr from = NULL;
 7765|  8.62k|    xmlXPathObjectPtr to = NULL;
 7766|  8.62k|    xmlBufPtr target;
 7767|  8.62k|    int offset, max;
 7768|  8.62k|    int ch;
 7769|  8.62k|    const xmlChar *point;
 7770|  8.62k|    xmlChar *cptr, *content;
 7771|       |
 7772|  25.8k|    CHECK_ARITY(3);
  ------------------
  |  |  280|  8.62k|    if (ctxt == NULL) return;						\
  |  |  ------------------
  |  |  |  Branch (280:9): [True: 0, False: 8.62k]
  |  |  ------------------
  |  |  281|  8.62k|    if (nargs != (x))							\
  |  |  ------------------
  |  |  |  Branch (281:9): [True: 8, False: 8.61k]
  |  |  ------------------
  |  |  282|  8.62k|        XP_ERROR(XPATH_INVALID_ARITY);					\
  |  |  ------------------
  |  |  |  |  244|      8|    { xmlXPathErr(ctxt, X); return; }
  |  |  ------------------
  |  |  283|  8.61k|    if (ctxt->valueNr < (x))						\
  |  |  ------------------
  |  |  |  Branch (283:9): [True: 0, False: 8.61k]
  |  |  ------------------
  |  |  284|  8.61k|        XP_ERROR(XPATH_STACK_ERROR);
  |  |  ------------------
  |  |  |  |  244|      0|    { xmlXPathErr(ctxt, X); return; }
  |  |  ------------------
  ------------------
 7773|       |
 7774|  25.8k|    CAST_TO_STRING;
  ------------------
  |  |  290|  8.61k|    if ((ctxt->value != NULL) && (ctxt->value->type != XPATH_STRING))	\
  |  |  ------------------
  |  |  |  Branch (290:9): [True: 8.61k, False: 0]
  |  |  |  Branch (290:34): [True: 8.61k, False: 0]
  |  |  ------------------
  |  |  291|  8.61k|        xmlXPathStringFunction(ctxt, 1);
  ------------------
 7775|  25.8k|    to = xmlXPathValuePop(ctxt);
 7776|  25.8k|    CAST_TO_STRING;
  ------------------
  |  |  290|  8.61k|    if ((ctxt->value != NULL) && (ctxt->value->type != XPATH_STRING))	\
  |  |  ------------------
  |  |  |  Branch (290:9): [True: 8.61k, False: 0]
  |  |  |  Branch (290:34): [True: 8.36k, False: 251]
  |  |  ------------------
  |  |  291|  8.61k|        xmlXPathStringFunction(ctxt, 1);
  ------------------
 7777|  25.8k|    from = xmlXPathValuePop(ctxt);
 7778|  25.8k|    CAST_TO_STRING;
  ------------------
  |  |  290|  8.61k|    if ((ctxt->value != NULL) && (ctxt->value->type != XPATH_STRING))	\
  |  |  ------------------
  |  |  |  Branch (290:9): [True: 8.61k, False: 2]
  |  |  |  Branch (290:34): [True: 8.61k, False: 1]
  |  |  ------------------
  |  |  291|  8.61k|        xmlXPathStringFunction(ctxt, 1);
  ------------------
 7779|  25.8k|    str = xmlXPathValuePop(ctxt);
 7780|  25.8k|    if (ctxt->error != 0)
  ------------------
  |  Branch (7780:9): [True: 21, False: 8.59k]
  ------------------
 7781|     21|        goto error;
 7782|       |
 7783|       |    /*
 7784|       |     * Account for quadratic runtime
 7785|       |     */
 7786|  8.59k|    if (ctxt->context->opLimit != 0) {
  ------------------
  |  Branch (7786:9): [True: 8.59k, False: 0]
  ------------------
 7787|  8.59k|        unsigned long f1 = xmlStrlen(from->stringval);
 7788|  8.59k|        unsigned long f2 = xmlStrlen(str->stringval);
 7789|       |
 7790|  8.59k|        if ((f1 > 0) && (f2 > 0)) {
  ------------------
  |  Branch (7790:13): [True: 7.72k, False: 869]
  |  Branch (7790:25): [True: 7.38k, False: 337]
  ------------------
 7791|  7.38k|            unsigned long p;
 7792|       |
 7793|  7.38k|            f1 = f1 / 10 + 1;
 7794|  7.38k|            f2 = f2 / 10 + 1;
 7795|  7.38k|            p = f1 > ULONG_MAX / f2 ? ULONG_MAX : f1 * f2;
  ------------------
  |  Branch (7795:17): [True: 0, False: 7.38k]
  ------------------
 7796|  7.38k|            if (xmlXPathCheckOpLimit(ctxt, p) < 0)
  ------------------
  |  Branch (7796:17): [True: 4, False: 7.38k]
  ------------------
 7797|      4|                goto error;
 7798|  7.38k|        }
 7799|  8.59k|    }
 7800|       |
 7801|  8.59k|    target = xmlBufCreate(50);
 7802|  8.59k|    if (target == NULL) {
  ------------------
  |  Branch (7802:9): [True: 7, False: 8.58k]
  ------------------
 7803|      7|        xmlXPathPErrMemory(ctxt);
 7804|      7|        goto error;
 7805|      7|    }
 7806|       |
 7807|  8.58k|    max = xmlUTF8Strlen(to->stringval);
 7808|   121k|    for (cptr = str->stringval; (ch=*cptr); ) {
  ------------------
  |  Branch (7808:33): [True: 112k, False: 8.58k]
  ------------------
 7809|   112k|        offset = xmlUTF8Strloc(from->stringval, cptr);
 7810|   112k|        if (offset >= 0) {
  ------------------
  |  Branch (7810:13): [True: 40.7k, False: 71.7k]
  ------------------
 7811|  40.7k|            if (offset < max) {
  ------------------
  |  Branch (7811:17): [True: 29.6k, False: 11.0k]
  ------------------
 7812|  29.6k|                point = xmlUTF8Strpos(to->stringval, offset);
 7813|  29.6k|                if (point)
  ------------------
  |  Branch (7813:21): [True: 29.6k, False: 0]
  ------------------
 7814|  29.6k|                    xmlBufAdd(target, point, xmlUTF8Strsize(point, 1));
 7815|  29.6k|            }
 7816|  40.7k|        } else
 7817|  71.7k|            xmlBufAdd(target, cptr, xmlUTF8Strsize(cptr, 1));
 7818|       |
 7819|       |        /* Step to next character in input */
 7820|   112k|        cptr++;
 7821|   112k|        if ( ch & 0x80 ) {
  ------------------
  |  Branch (7821:14): [True: 0, False: 112k]
  ------------------
 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|   112k|    }
 7837|       |
 7838|  8.58k|    content = xmlBufDetach(target);
 7839|  8.58k|    if (content == NULL)
  ------------------
  |  Branch (7839:9): [True: 0, False: 8.58k]
  ------------------
 7840|      0|        xmlXPathPErrMemory(ctxt);
 7841|  8.58k|    else
 7842|  8.58k|        xmlXPathValuePush(ctxt, xmlXPathCacheWrapString(ctxt, content));
 7843|  8.58k|    xmlBufFree(target);
 7844|  8.61k|error:
 7845|  8.61k|    xmlXPathReleaseObject(ctxt->context, str);
 7846|  8.61k|    xmlXPathReleaseObject(ctxt->context, from);
 7847|  8.61k|    xmlXPathReleaseObject(ctxt->context, to);
 7848|  8.61k|}
xmlXPathBooleanFunction:
 7863|  11.9k|xmlXPathBooleanFunction(xmlXPathParserContext *ctxt, int nargs) {
 7864|  11.9k|    xmlXPathObjectPtr cur;
 7865|       |
 7866|  35.7k|    CHECK_ARITY(1);
  ------------------
  |  |  280|  11.9k|    if (ctxt == NULL) return;						\
  |  |  ------------------
  |  |  |  Branch (280:9): [True: 0, False: 11.9k]
  |  |  ------------------
  |  |  281|  11.9k|    if (nargs != (x))							\
  |  |  ------------------
  |  |  |  Branch (281:9): [True: 0, False: 11.9k]
  |  |  ------------------
  |  |  282|  11.9k|        XP_ERROR(XPATH_INVALID_ARITY);					\
  |  |  ------------------
  |  |  |  |  244|      0|    { xmlXPathErr(ctxt, X); return; }
  |  |  ------------------
  |  |  283|  11.9k|    if (ctxt->valueNr < (x))						\
  |  |  ------------------
  |  |  |  Branch (283:9): [True: 0, False: 11.9k]
  |  |  ------------------
  |  |  284|  11.9k|        XP_ERROR(XPATH_STACK_ERROR);
  |  |  ------------------
  |  |  |  |  244|      0|    { xmlXPathErr(ctxt, X); return; }
  |  |  ------------------
  ------------------
 7867|  35.7k|    cur = xmlXPathValuePop(ctxt);
 7868|  35.7k|    if (cur == NULL) XP_ERROR(XPATH_INVALID_OPERAND);
  ------------------
  |  |  244|      0|    { xmlXPathErr(ctxt, X); return; }
  ------------------
  |  Branch (7868:9): [True: 0, False: 11.9k]
  ------------------
 7869|  11.9k|    if (cur->type != XPATH_BOOLEAN) {
  ------------------
  |  Branch (7869:9): [True: 10.5k, False: 1.41k]
  ------------------
 7870|  10.5k|        int boolval = xmlXPathCastToBoolean(cur);
 7871|       |
 7872|  10.5k|        xmlXPathReleaseObject(ctxt->context, cur);
 7873|  10.5k|        cur = xmlXPathCacheNewBoolean(ctxt, boolval);
 7874|  10.5k|    }
 7875|  11.9k|    xmlXPathValuePush(ctxt, cur);
 7876|  11.9k|}
xmlXPathNotFunction:
 7888|      5|xmlXPathNotFunction(xmlXPathParserContext *ctxt, int nargs) {
 7889|     13|    CHECK_ARITY(1);
  ------------------
  |  |  280|      5|    if (ctxt == NULL) return;						\
  |  |  ------------------
  |  |  |  Branch (280:9): [True: 0, False: 5]
  |  |  ------------------
  |  |  281|      5|    if (nargs != (x))							\
  |  |  ------------------
  |  |  |  Branch (281:9): [True: 1, False: 4]
  |  |  ------------------
  |  |  282|      5|        XP_ERROR(XPATH_INVALID_ARITY);					\
  |  |  ------------------
  |  |  |  |  244|      1|    { xmlXPathErr(ctxt, X); return; }
  |  |  ------------------
  |  |  283|      4|    if (ctxt->valueNr < (x))						\
  |  |  ------------------
  |  |  |  Branch (283:9): [True: 0, False: 4]
  |  |  ------------------
  |  |  284|      4|        XP_ERROR(XPATH_STACK_ERROR);
  |  |  ------------------
  |  |  |  |  244|      0|    { xmlXPathErr(ctxt, X); return; }
  |  |  ------------------
  ------------------
 7890|     13|    CAST_TO_BOOLEAN;
  ------------------
  |  |  304|      4|    if ((ctxt->value != NULL) && (ctxt->value->type != XPATH_BOOLEAN))	\
  |  |  ------------------
  |  |  |  Branch (304:9): [True: 4, False: 0]
  |  |  |  Branch (304:34): [True: 1, False: 3]
  |  |  ------------------
  |  |  305|      4|        xmlXPathBooleanFunction(ctxt, 1);
  ------------------
 7891|     13|    CHECK_TYPE(XPATH_BOOLEAN);
  ------------------
  |  |  261|      4|    if ((ctxt->value == NULL) || (ctxt->value->type != typeval))	\
  |  |  ------------------
  |  |  |  Branch (261:9): [True: 0, False: 4]
  |  |  |  Branch (261:34): [True: 1, False: 3]
  |  |  ------------------
  |  |  262|      4|        XP_ERROR(XPATH_INVALID_TYPE)
  |  |  ------------------
  |  |  |  |  244|      1|    { xmlXPathErr(ctxt, X); return; }
  |  |  ------------------
  ------------------
 7892|      3|    ctxt->value->boolval = ! ctxt->value->boolval;
 7893|      3|}
xmlXPathTrueFunction:
 7903|     16|xmlXPathTrueFunction(xmlXPathParserContext *ctxt, int nargs) {
 7904|     44|    CHECK_ARITY(0);
  ------------------
  |  |  280|     16|    if (ctxt == NULL) return;						\
  |  |  ------------------
  |  |  |  Branch (280:9): [True: 0, False: 16]
  |  |  ------------------
  |  |  281|     16|    if (nargs != (x))							\
  |  |  ------------------
  |  |  |  Branch (281:9): [True: 2, False: 14]
  |  |  ------------------
  |  |  282|     16|        XP_ERROR(XPATH_INVALID_ARITY);					\
  |  |  ------------------
  |  |  |  |  244|      2|    { xmlXPathErr(ctxt, X); return; }
  |  |  ------------------
  |  |  283|     14|    if (ctxt->valueNr < (x))						\
  |  |  ------------------
  |  |  |  Branch (283:9): [True: 0, False: 14]
  |  |  ------------------
  |  |  284|     14|        XP_ERROR(XPATH_STACK_ERROR);
  |  |  ------------------
  |  |  |  |  244|      0|    { xmlXPathErr(ctxt, X); return; }
  |  |  ------------------
  ------------------
 7905|     44|    xmlXPathValuePush(ctxt, xmlXPathCacheNewBoolean(ctxt, 1));
 7906|     44|}
xmlXPathFalseFunction:
 7916|     21|xmlXPathFalseFunction(xmlXPathParserContext *ctxt, int nargs) {
 7917|     61|    CHECK_ARITY(0);
  ------------------
  |  |  280|     21|    if (ctxt == NULL) return;						\
  |  |  ------------------
  |  |  |  Branch (280:9): [True: 0, False: 21]
  |  |  ------------------
  |  |  281|     21|    if (nargs != (x))							\
  |  |  ------------------
  |  |  |  Branch (281:9): [True: 1, False: 20]
  |  |  ------------------
  |  |  282|     21|        XP_ERROR(XPATH_INVALID_ARITY);					\
  |  |  ------------------
  |  |  |  |  244|      1|    { xmlXPathErr(ctxt, X); return; }
  |  |  ------------------
  |  |  283|     20|    if (ctxt->valueNr < (x))						\
  |  |  ------------------
  |  |  |  Branch (283:9): [True: 0, False: 20]
  |  |  ------------------
  |  |  284|     20|        XP_ERROR(XPATH_STACK_ERROR);
  |  |  ------------------
  |  |  |  |  244|      0|    { xmlXPathErr(ctxt, X); return; }
  |  |  ------------------
  ------------------
 7918|     61|    xmlXPathValuePush(ctxt, xmlXPathCacheNewBoolean(ctxt, 0));
 7919|     61|}
xmlXPathLangFunction:
 7942|  5.23k|xmlXPathLangFunction(xmlXPathParserContext *ctxt, int nargs) {
 7943|  5.23k|    xmlXPathObjectPtr val;
 7944|  5.23k|    xmlNodePtr cur;
 7945|  5.23k|    xmlChar *theLang = NULL;
 7946|  5.23k|    const xmlChar *lang;
 7947|  5.23k|    int ret = 0;
 7948|  5.23k|    int i;
 7949|       |
 7950|  15.7k|    CHECK_ARITY(1);
  ------------------
  |  |  280|  5.23k|    if (ctxt == NULL) return;						\
  |  |  ------------------
  |  |  |  Branch (280:9): [True: 0, False: 5.23k]
  |  |  ------------------
  |  |  281|  5.23k|    if (nargs != (x))							\
  |  |  ------------------
  |  |  |  Branch (281:9): [True: 4, False: 5.23k]
  |  |  ------------------
  |  |  282|  5.23k|        XP_ERROR(XPATH_INVALID_ARITY);					\
  |  |  ------------------
  |  |  |  |  244|      4|    { xmlXPathErr(ctxt, X); return; }
  |  |  ------------------
  |  |  283|  5.23k|    if (ctxt->valueNr < (x))						\
  |  |  ------------------
  |  |  |  Branch (283:9): [True: 0, False: 5.23k]
  |  |  ------------------
  |  |  284|  5.23k|        XP_ERROR(XPATH_STACK_ERROR);
  |  |  ------------------
  |  |  |  |  244|      0|    { xmlXPathErr(ctxt, X); return; }
  |  |  ------------------
  ------------------
 7951|  15.7k|    CAST_TO_STRING;
  ------------------
  |  |  290|  5.23k|    if ((ctxt->value != NULL) && (ctxt->value->type != XPATH_STRING))	\
  |  |  ------------------
  |  |  |  Branch (290:9): [True: 5.23k, False: 0]
  |  |  |  Branch (290:34): [True: 5.22k, False: 10]
  |  |  ------------------
  |  |  291|  5.23k|        xmlXPathStringFunction(ctxt, 1);
  ------------------
 7952|  15.7k|    CHECK_TYPE(XPATH_STRING);
  ------------------
  |  |  261|  5.23k|    if ((ctxt->value == NULL) || (ctxt->value->type != typeval))	\
  |  |  ------------------
  |  |  |  Branch (261:9): [True: 1, False: 5.23k]
  |  |  |  Branch (261:34): [True: 0, False: 5.23k]
  |  |  ------------------
  |  |  262|  5.23k|        XP_ERROR(XPATH_INVALID_TYPE)
  |  |  ------------------
  |  |  |  |  244|      1|    { xmlXPathErr(ctxt, X); return; }
  |  |  ------------------
  ------------------
 7953|  5.23k|    val = xmlXPathValuePop(ctxt);
 7954|  5.23k|    lang = val->stringval;
 7955|  5.23k|    cur = ctxt->context->node;
 7956|  50.6k|    while (cur != NULL) {
  ------------------
  |  Branch (7956:12): [True: 45.4k, False: 5.23k]
  ------------------
 7957|  45.4k|        if (xmlNodeGetAttrValue(cur, BAD_CAST "lang", XML_XML_NAMESPACE,
  ------------------
  |  |   34|  45.4k|#define BAD_CAST (xmlChar *)
  ------------------
                      if (xmlNodeGetAttrValue(cur, BAD_CAST "lang", XML_XML_NAMESPACE,
  ------------------
  |  |  146|  45.4k|    (const xmlChar *) "http://www.w3.org/XML/1998/namespace"
  ------------------
  |  Branch (7957:13): [True: 0, False: 45.4k]
  ------------------
 7958|  45.4k|                                &theLang) < 0)
 7959|      0|            xmlXPathPErrMemory(ctxt);
 7960|  45.4k|        if (theLang != NULL)
  ------------------
  |  Branch (7960:13): [True: 0, False: 45.4k]
  ------------------
 7961|      0|            break;
 7962|  45.4k|        cur = cur->parent;
 7963|  45.4k|    }
 7964|  5.23k|    if ((theLang != NULL) && (lang != NULL)) {
  ------------------
  |  Branch (7964:9): [True: 0, False: 5.23k]
  |  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.23k|not_equal:
 7972|  5.23k|    if (theLang != NULL)
  ------------------
  |  Branch (7972:9): [True: 0, False: 5.23k]
  ------------------
 7973|      0|	xmlFree((void *)theLang);
 7974|       |
 7975|  5.23k|    xmlXPathReleaseObject(ctxt->context, val);
 7976|  5.23k|    xmlXPathValuePush(ctxt, xmlXPathCacheNewBoolean(ctxt, ret));
 7977|  5.23k|}
xmlXPathNumberFunction:
 7987|   312k|xmlXPathNumberFunction(xmlXPathParserContext *ctxt, int nargs) {
 7988|   312k|    xmlXPathObjectPtr cur;
 7989|   312k|    double res;
 7990|       |
 7991|   312k|    if (ctxt == NULL) return;
  ------------------
  |  Branch (7991:9): [True: 0, False: 312k]
  ------------------
 7992|   312k|    if (nargs == 0) {
  ------------------
  |  Branch (7992:9): [True: 0, False: 312k]
  ------------------
 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.25M|    CHECK_ARITY(1);
  ------------------
  |  |  280|   312k|    if (ctxt == NULL) return;						\
  |  |  ------------------
  |  |  |  Branch (280:9): [True: 0, False: 312k]
  |  |  ------------------
  |  |  281|   312k|    if (nargs != (x))							\
  |  |  ------------------
  |  |  |  Branch (281:9): [True: 0, False: 312k]
  |  |  ------------------
  |  |  282|   312k|        XP_ERROR(XPATH_INVALID_ARITY);					\
  |  |  ------------------
  |  |  |  |  244|      0|    { xmlXPathErr(ctxt, X); return; }
  |  |  ------------------
  |  |  283|   312k|    if (ctxt->valueNr < (x))						\
  |  |  ------------------
  |  |  |  Branch (283:9): [True: 7, False: 312k]
  |  |  ------------------
  |  |  284|   312k|        XP_ERROR(XPATH_STACK_ERROR);
  |  |  ------------------
  |  |  |  |  244|      7|    { xmlXPathErr(ctxt, X); return; }
  |  |  ------------------
  ------------------
 8008|  1.25M|    cur = xmlXPathValuePop(ctxt);
 8009|  1.25M|    if (cur->type != XPATH_NUMBER) {
  ------------------
  |  Branch (8009:9): [True: 312k, False: 2]
  ------------------
 8010|   312k|        double floatval;
 8011|       |
 8012|   312k|        floatval = xmlXPathCastToNumberInternal(ctxt, cur);
 8013|   312k|        xmlXPathReleaseObject(ctxt->context, cur);
 8014|   312k|        cur = xmlXPathCacheNewFloat(ctxt, floatval);
 8015|   312k|    }
 8016|  1.25M|    xmlXPathValuePush(ctxt, cur);
 8017|  1.25M|}
xmlXPathSumFunction:
 8029|     29|xmlXPathSumFunction(xmlXPathParserContext *ctxt, int nargs) {
 8030|     29|    xmlXPathObjectPtr cur;
 8031|     29|    int i;
 8032|     29|    double res = 0.0;
 8033|       |
 8034|     83|    CHECK_ARITY(1);
  ------------------
  |  |  280|     29|    if (ctxt == NULL) return;						\
  |  |  ------------------
  |  |  |  Branch (280:9): [True: 0, False: 29]
  |  |  ------------------
  |  |  281|     29|    if (nargs != (x))							\
  |  |  ------------------
  |  |  |  Branch (281:9): [True: 2, False: 27]
  |  |  ------------------
  |  |  282|     29|        XP_ERROR(XPATH_INVALID_ARITY);					\
  |  |  ------------------
  |  |  |  |  244|      2|    { xmlXPathErr(ctxt, X); return; }
  |  |  ------------------
  |  |  283|     27|    if (ctxt->valueNr < (x))						\
  |  |  ------------------
  |  |  |  Branch (283:9): [True: 0, False: 27]
  |  |  ------------------
  |  |  284|     27|        XP_ERROR(XPATH_STACK_ERROR);
  |  |  ------------------
  |  |  |  |  244|      0|    { xmlXPathErr(ctxt, X); return; }
  |  |  ------------------
  ------------------
 8035|     83|    if ((ctxt->value == NULL) ||
  ------------------
  |  Branch (8035:9): [True: 0, False: 27]
  ------------------
 8036|     27|	((ctxt->value->type != XPATH_NODESET) &&
  ------------------
  |  Branch (8036:3): [True: 3, False: 24]
  ------------------
 8037|      3|	 (ctxt->value->type != XPATH_XSLT_TREE)))
  ------------------
  |  Branch (8037:3): [True: 3, False: 0]
  ------------------
 8038|     24|	XP_ERROR(XPATH_INVALID_TYPE);
  ------------------
  |  |  244|      3|    { xmlXPathErr(ctxt, X); return; }
  ------------------
 8039|     24|    cur = xmlXPathValuePop(ctxt);
 8040|       |
 8041|     24|    if ((cur->nodesetval != NULL) && (cur->nodesetval->nodeNr != 0)) {
  ------------------
  |  Branch (8041:9): [True: 24, False: 0]
  |  Branch (8041:38): [True: 7, False: 17]
  ------------------
 8042|     24|	for (i = 0; i < cur->nodesetval->nodeNr; i++) {
  ------------------
  |  Branch (8042:14): [True: 17, False: 7]
  ------------------
 8043|     17|	    res += xmlXPathNodeToNumberInternal(ctxt,
 8044|     17|                                                cur->nodesetval->nodeTab[i]);
 8045|     17|	}
 8046|      7|    }
 8047|     24|    xmlXPathValuePush(ctxt, xmlXPathCacheNewFloat(ctxt, res));
 8048|     24|    xmlXPathReleaseObject(ctxt->context, cur);
 8049|     24|}
xmlXPathFloorFunction:
 8061|     32|xmlXPathFloorFunction(xmlXPathParserContext *ctxt, int nargs) {
 8062|     88|    CHECK_ARITY(1);
  ------------------
  |  |  280|     32|    if (ctxt == NULL) return;						\
  |  |  ------------------
  |  |  |  Branch (280:9): [True: 0, False: 32]
  |  |  ------------------
  |  |  281|     32|    if (nargs != (x))							\
  |  |  ------------------
  |  |  |  Branch (281:9): [True: 4, False: 28]
  |  |  ------------------
  |  |  282|     32|        XP_ERROR(XPATH_INVALID_ARITY);					\
  |  |  ------------------
  |  |  |  |  244|      4|    { xmlXPathErr(ctxt, X); return; }
  |  |  ------------------
  |  |  283|     28|    if (ctxt->valueNr < (x))						\
  |  |  ------------------
  |  |  |  Branch (283:9): [True: 0, False: 28]
  |  |  ------------------
  |  |  284|     28|        XP_ERROR(XPATH_STACK_ERROR);
  |  |  ------------------
  |  |  |  |  244|      0|    { xmlXPathErr(ctxt, X); return; }
  |  |  ------------------
  ------------------
 8063|     88|    CAST_TO_NUMBER;
  ------------------
  |  |  297|     28|    if ((ctxt->value != NULL) && (ctxt->value->type != XPATH_NUMBER))	\
  |  |  ------------------
  |  |  |  Branch (297:9): [True: 28, False: 0]
  |  |  |  Branch (297:34): [True: 18, False: 10]
  |  |  ------------------
  |  |  298|     28|        xmlXPathNumberFunction(ctxt, 1);
  ------------------
 8064|     88|    CHECK_TYPE(XPATH_NUMBER);
  ------------------
  |  |  261|     28|    if ((ctxt->value == NULL) || (ctxt->value->type != typeval))	\
  |  |  ------------------
  |  |  |  Branch (261:9): [True: 0, False: 28]
  |  |  |  Branch (261:34): [True: 1, False: 27]
  |  |  ------------------
  |  |  262|     28|        XP_ERROR(XPATH_INVALID_TYPE)
  |  |  ------------------
  |  |  |  |  244|      1|    { xmlXPathErr(ctxt, X); return; }
  |  |  ------------------
  ------------------
 8065|       |
 8066|     27|    ctxt->value->floatval = floor(ctxt->value->floatval);
 8067|     27|}
xmlXPathParseNCName:
 8147|  96.7k|xmlXPathParseNCName(xmlXPathParserContext *ctxt) {
 8148|  96.7k|    const xmlChar *end;
 8149|  96.7k|    xmlChar *ret;
 8150|       |
 8151|  96.7k|    if ((ctxt == NULL) || (ctxt->cur == NULL)) return(NULL);
  ------------------
  |  Branch (8151:9): [True: 0, False: 96.7k]
  |  Branch (8151:27): [True: 0, False: 96.7k]
  ------------------
 8152|       |
 8153|  96.7k|    end = xmlScanName(ctxt->cur, XML_MAX_NAME_LENGTH, XML_SCAN_NC);
  ------------------
  |  |   65|  96.7k|#define XML_MAX_NAME_LENGTH 50000
  ------------------
                  end = xmlScanName(ctxt->cur, XML_MAX_NAME_LENGTH, XML_SCAN_NC);
  ------------------
  |  |   69|  96.7k|#define XML_SCAN_NC         1
  ------------------
 8154|  96.7k|    if (end == NULL) {
  ------------------
  |  Branch (8154:9): [True: 1, False: 96.7k]
  ------------------
 8155|      1|        XP_ERRORNULL(XPATH_EXPR_ERROR);
  ------------------
  |  |  633|      1|    { xmlXPathErr(ctxt, X); return(NULL); }
  ------------------
 8156|      0|    }
 8157|  96.7k|    if (end == ctxt->cur)
  ------------------
  |  Branch (8157:9): [True: 6.43k, False: 90.3k]
  ------------------
 8158|  6.43k|        return(NULL);
 8159|       |
 8160|  90.3k|    ret = xmlStrndup(ctxt->cur, end - ctxt->cur);
 8161|  90.3k|    if (ret == NULL)
  ------------------
  |  Branch (8161:9): [True: 57, False: 90.2k]
  ------------------
 8162|     57|        xmlXPathPErrMemory(ctxt);
 8163|  90.3k|    ctxt->cur = end;
 8164|  90.3k|    return(ret);
 8165|  96.7k|}
xmlXPathParseName:
 8199|  13.6k|xmlXPathParseName(xmlXPathParserContext *ctxt) {
 8200|  13.6k|    const xmlChar *end;
 8201|  13.6k|    xmlChar *ret;
 8202|       |
 8203|  13.6k|    if ((ctxt == NULL) || (ctxt->cur == NULL)) return(NULL);
  ------------------
  |  Branch (8203:9): [True: 0, False: 13.6k]
  |  Branch (8203:27): [True: 0, False: 13.6k]
  ------------------
 8204|       |
 8205|  13.6k|    end = xmlScanName(ctxt->cur, XML_MAX_NAME_LENGTH, 0);
  ------------------
  |  |   65|  13.6k|#define XML_MAX_NAME_LENGTH 50000
  ------------------
 8206|  13.6k|    if (end == NULL) {
  ------------------
  |  Branch (8206:9): [True: 1, False: 13.6k]
  ------------------
 8207|      1|        XP_ERRORNULL(XPATH_EXPR_ERROR);
  ------------------
  |  |  633|      1|    { xmlXPathErr(ctxt, X); return(NULL); }
  ------------------
 8208|      0|    }
 8209|  13.6k|    if (end == ctxt->cur)
  ------------------
  |  Branch (8209:9): [True: 2.33k, False: 11.3k]
  ------------------
 8210|  2.33k|        return(NULL);
 8211|       |
 8212|  11.3k|    ret = xmlStrndup(ctxt->cur, end - ctxt->cur);
 8213|  11.3k|    if (ret == NULL)
  ------------------
  |  Branch (8213:9): [True: 37, False: 11.2k]
  ------------------
 8214|     37|        xmlXPathPErrMemory(ctxt);
 8215|  11.3k|    ctxt->cur = end;
 8216|  11.3k|    return(ret);
 8217|  13.6k|}
xmlXPathStringEvalNumber:
 8236|   610k|xmlXPathStringEvalNumber(const xmlChar *str) {
 8237|   610k|    const xmlChar *cur = str;
 8238|   610k|    double ret;
 8239|   610k|    int ok = 0;
 8240|   610k|    int isneg = 0;
 8241|   610k|    int exponent = 0;
 8242|   610k|    int is_exponent_negative = 0;
 8243|   610k|#ifdef __GNUC__
 8244|   610k|    unsigned long tmp = 0;
 8245|   610k|    double temp;
 8246|   610k|#endif
 8247|   610k|    if (cur == NULL) return(0);
  ------------------
  |  Branch (8247:9): [True: 0, False: 610k]
  ------------------
 8248|   610k|    while (IS_BLANK_CH(*cur)) cur++;
 8249|   610k|    if (*cur == '-') {
  ------------------
  |  Branch (8249:9): [True: 62.9k, False: 547k]
  ------------------
 8250|  62.9k|	isneg = 1;
 8251|  62.9k|	cur++;
 8252|  62.9k|    }
 8253|   610k|    if ((*cur != '.') && ((*cur < '0') || (*cur > '9'))) {
  ------------------
  |  Branch (8253:9): [True: 540k, False: 70.3k]
  |  Branch (8253:27): [True: 471k, False: 68.7k]
  |  Branch (8253:43): [True: 52.4k, False: 16.2k]
  ------------------
 8254|   524k|        return(xmlXPathNAN);
 8255|   524k|    }
 8256|       |
 8257|  86.6k|#ifdef __GNUC__
 8258|       |    /*
 8259|       |     * tmp/temp is a workaround against a gcc compiler bug
 8260|       |     * http://veillard.com/gcc.bug
 8261|       |     */
 8262|  86.6k|    ret = 0;
 8263|   133k|    while ((*cur >= '0') && (*cur <= '9')) {
  ------------------
  |  Branch (8263:12): [True: 49.2k, False: 84.5k]
  |  Branch (8263:29): [True: 47.1k, False: 2.12k]
  ------------------
 8264|  47.1k|	ret = ret * 10;
 8265|  47.1k|	tmp = (*cur - '0');
 8266|  47.1k|	ok = 1;
 8267|  47.1k|	cur++;
 8268|  47.1k|	temp = (double) tmp;
 8269|  47.1k|	ret = ret + temp;
 8270|  47.1k|    }
 8271|       |#else
 8272|       |    ret = 0;
 8273|       |    while ((*cur >= '0') && (*cur <= '9')) {
 8274|       |	ret = ret * 10 + (*cur - '0');
 8275|       |	ok = 1;
 8276|       |	cur++;
 8277|       |    }
 8278|       |#endif
 8279|       |
 8280|  86.6k|    if (*cur == '.') {
  ------------------
  |  Branch (8280:9): [True: 75.4k, False: 11.2k]
  ------------------
 8281|  75.4k|	int v, frac = 0, max;
 8282|  75.4k|	double fraction = 0;
 8283|       |
 8284|  75.4k|        cur++;
 8285|  75.4k|	if (((*cur < '0') || (*cur > '9')) && (!ok)) {
  ------------------
  |  Branch (8285:7): [True: 3.36k, False: 72.0k]
  |  Branch (8285:23): [True: 8.73k, False: 63.3k]
  |  Branch (8285:40): [True: 11.7k, False: 370]
  ------------------
 8286|  11.7k|	    return(xmlXPathNAN);
 8287|  11.7k|	}
 8288|  92.7k|        while (*cur == '0') {
  ------------------
  |  Branch (8288:16): [True: 29.0k, False: 63.6k]
  ------------------
 8289|  29.0k|	    frac = frac + 1;
 8290|  29.0k|	    cur++;
 8291|  29.0k|        }
 8292|  63.6k|        max = frac + MAX_FRAC;
  ------------------
  |  | 8219|  63.6k|#define MAX_FRAC 20
  ------------------
 8293|   193k|	while (((*cur >= '0') && (*cur <= '9')) && (frac < max)) {
  ------------------
  |  Branch (8293:10): [True: 170k, False: 22.4k]
  |  Branch (8293:27): [True: 129k, False: 40.9k]
  |  Branch (8293:45): [True: 129k, False: 334]
  ------------------
 8294|   129k|	    v = (*cur - '0');
 8295|   129k|	    fraction = fraction * 10 + v;
 8296|   129k|	    frac = frac + 1;
 8297|   129k|	    cur++;
 8298|   129k|	}
 8299|  63.6k|	fraction /= pow(10.0, frac);
 8300|  63.6k|	ret = ret + fraction;
 8301|  75.8k|	while ((*cur >= '0') && (*cur <= '9'))
  ------------------
  |  Branch (8301:9): [True: 53.4k, False: 22.4k]
  |  Branch (8301:26): [True: 12.1k, False: 41.2k]
  ------------------
 8302|  12.1k|	    cur++;
 8303|  63.6k|    }
 8304|  74.9k|    if ((*cur == 'e') || (*cur == 'E')) {
  ------------------
  |  Branch (8304:9): [True: 5.41k, False: 69.4k]
  |  Branch (8304:26): [True: 26.0k, False: 43.3k]
  ------------------
 8305|  31.5k|      cur++;
 8306|  31.5k|      if (*cur == '-') {
  ------------------
  |  Branch (8306:11): [True: 18.7k, False: 12.7k]
  ------------------
 8307|  18.7k|	is_exponent_negative = 1;
 8308|  18.7k|	cur++;
 8309|  18.7k|      } else if (*cur == '+') {
  ------------------
  |  Branch (8309:18): [True: 6.17k, False: 6.54k]
  ------------------
 8310|  6.17k|        cur++;
 8311|  6.17k|      }
 8312|   161k|      while ((*cur >= '0') && (*cur <= '9')) {
  ------------------
  |  Branch (8312:14): [True: 130k, False: 30.7k]
  |  Branch (8312:31): [True: 129k, False: 719]
  ------------------
 8313|   129k|        if (exponent < 1000000)
  ------------------
  |  Branch (8313:13): [True: 128k, False: 1.74k]
  ------------------
 8314|   128k|	  exponent = exponent * 10 + (*cur - '0');
 8315|   129k|	cur++;
 8316|   129k|      }
 8317|  31.5k|    }
 8318|   159k|    while (IS_BLANK_CH(*cur)) cur++;
 8319|  74.9k|    if (*cur != 0) return(xmlXPathNAN);
  ------------------
  |  Branch (8319:9): [True: 24.7k, False: 50.1k]
  ------------------
 8320|  50.1k|    if (isneg) ret = -ret;
  ------------------
  |  Branch (8320:9): [True: 37.2k, False: 12.9k]
  ------------------
 8321|  50.1k|    if (is_exponent_negative) exponent = -exponent;
  ------------------
  |  Branch (8321:9): [True: 18.7k, False: 31.4k]
  ------------------
 8322|  50.1k|    ret *= pow(10.0, (double)exponent);
 8323|  50.1k|    return(ret);
 8324|  74.9k|}
xmlXPathIsNodeType:
 8548|  10.5k|xmlXPathIsNodeType(const xmlChar *name) {
 8549|  10.5k|    if (name == NULL)
  ------------------
  |  Branch (8549:9): [True: 0, False: 10.5k]
  ------------------
 8550|      0|	return(0);
 8551|       |
 8552|  10.5k|    if (xmlStrEqual(name, BAD_CAST "node"))
  ------------------
  |  |   34|  10.5k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (8552:9): [True: 25, False: 10.5k]
  ------------------
 8553|     25|	return(1);
 8554|  10.5k|    if (xmlStrEqual(name, BAD_CAST "text"))
  ------------------
  |  |   34|  10.5k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (8554:9): [True: 45, False: 10.4k]
  ------------------
 8555|     45|	return(1);
 8556|  10.4k|    if (xmlStrEqual(name, BAD_CAST "comment"))
  ------------------
  |  |   34|  10.4k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (8556:9): [True: 12, False: 10.4k]
  ------------------
 8557|     12|	return(1);
 8558|  10.4k|    if (xmlStrEqual(name, BAD_CAST "processing-instruction"))
  ------------------
  |  |   34|  10.4k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (8558:9): [True: 114, False: 10.3k]
  ------------------
 8559|    114|	return(1);
 8560|  10.3k|    return(0);
 8561|  10.4k|}
xmlXPathEvaluatePredicateResult:
11626|   221k|                                xmlXPathObject *res) {
11627|   221k|    if ((ctxt == NULL) || (res == NULL)) return(0);
  ------------------
  |  Branch (11627:9): [True: 0, False: 221k]
  |  Branch (11627:27): [True: 0, False: 221k]
  ------------------
11628|   221k|    switch (res->type) {
11629|      0|        case XPATH_BOOLEAN:
  ------------------
  |  Branch (11629:9): [True: 0, False: 221k]
  ------------------
11630|      0|	    return(res->boolval);
11631|  64.5k|        case XPATH_NUMBER:
  ------------------
  |  Branch (11631:9): [True: 64.5k, False: 156k]
  ------------------
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|  64.5k|	    return(res->floatval == ctxt->context->proximityPosition);
11637|      0|#endif
11638|   153k|        case XPATH_NODESET:
  ------------------
  |  Branch (11638:9): [True: 153k, False: 67.4k]
  ------------------
11639|   153k|        case XPATH_XSLT_TREE:
  ------------------
  |  Branch (11639:9): [True: 0, False: 221k]
  ------------------
11640|   153k|	    if (res->nodesetval == NULL)
  ------------------
  |  Branch (11640:10): [True: 0, False: 153k]
  ------------------
11641|      0|		return(0);
11642|   153k|	    return(res->nodesetval->nodeNr != 0);
11643|  2.85k|        case XPATH_STRING:
  ------------------
  |  Branch (11643:9): [True: 2.85k, False: 218k]
  ------------------
11644|  2.85k|	    return((res->stringval != NULL) && (res->stringval[0] != 0));
  ------------------
  |  Branch (11644:13): [True: 2.85k, False: 0]
  |  Branch (11644:41): [True: 1.81k, False: 1.03k]
  ------------------
11645|      0|        default:
  ------------------
  |  Branch (11645:9): [True: 0, False: 221k]
  ------------------
11646|      0|	    break;
11647|   221k|    }
11648|      0|    return(0);
11649|   221k|}
xmlXPathEvalExpr:
12002|  8.96k|xmlXPathEvalExpr(xmlXPathParserContext *ctxt) {
12003|       |#ifdef XPATH_STREAMING
12004|       |    xmlXPathCompExprPtr comp;
12005|       |#endif
12006|  8.96k|    int oldDepth = 0;
12007|       |
12008|  8.96k|    if ((ctxt == NULL) || (ctxt->context == NULL))
  ------------------
  |  Branch (12008:9): [True: 0, False: 8.96k]
  |  Branch (12008:27): [True: 0, False: 8.96k]
  ------------------
12009|      0|        return;
12010|  8.96k|    if (ctxt->context->lastError.code != 0)
  ------------------
  |  Branch (12010:9): [True: 202, False: 8.75k]
  ------------------
12011|    202|        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|  8.75k|    {
12027|  8.75k|        if (ctxt->context != NULL)
  ------------------
  |  Branch (12027:13): [True: 8.75k, False: 0]
  ------------------
12028|  8.75k|            oldDepth = ctxt->context->depth;
12029|  8.75k|	xmlXPathCompileExpr(ctxt, 1);
12030|  8.75k|        if (ctxt->context != NULL)
  ------------------
  |  Branch (12030:13): [True: 8.75k, False: 0]
  ------------------
12031|  8.75k|            ctxt->context->depth = oldDepth;
12032|  8.75k|        CHECK_ERROR;
  ------------------
  |  |  230|  8.75k|    if (ctxt->error != XPATH_EXPRESSION_OK) return
  |  |  ------------------
  |  |  |  Branch (230:9): [True: 1.50k, False: 7.25k]
  |  |  ------------------
  ------------------
12033|       |
12034|       |        /* Check for trailing characters. */
12035|  7.25k|        if (*ctxt->cur != 0)
  ------------------
  |  Branch (12035:13): [True: 281, False: 6.97k]
  ------------------
12036|  6.97k|            XP_ERROR(XPATH_EXPR_ERROR);
  ------------------
  |  |  244|    281|    { xmlXPathErr(ctxt, X); return; }
  ------------------
12037|       |
12038|  6.97k|	if ((ctxt->comp->nbStep > 1) && (ctxt->comp->last >= 0)) {
  ------------------
  |  Branch (12038:6): [True: 6.95k, False: 23]
  |  Branch (12038:34): [True: 6.95k, False: 0]
  ------------------
12039|  6.95k|            if (ctxt->context != NULL)
  ------------------
  |  Branch (12039:17): [True: 6.95k, False: 0]
  ------------------
12040|  6.95k|                oldDepth = ctxt->context->depth;
12041|  6.95k|	    xmlXPathOptimizeExpression(ctxt,
12042|  6.95k|		&ctxt->comp->steps[ctxt->comp->last]);
12043|  6.95k|            if (ctxt->context != NULL)
  ------------------
  |  Branch (12043:17): [True: 6.95k, False: 0]
  ------------------
12044|  6.95k|                ctxt->context->depth = oldDepth;
12045|  6.95k|        }
12046|  6.97k|    }
12047|       |
12048|      0|    xmlXPathRunEval(ctxt, 0);
12049|  6.97k|}
xpath.c:xmlXPathNameFunction:
 7223|  5.42k|{
 7224|  5.42k|    xmlXPathObjectPtr cur;
 7225|       |
 7226|  5.42k|    if (nargs == 0) {
  ------------------
  |  Branch (7226:9): [True: 3.01k, False: 2.41k]
  ------------------
 7227|  3.01k|	xmlXPathValuePush(ctxt, xmlXPathCacheNewNodeSet(ctxt, ctxt->context->node));
 7228|  3.01k|        nargs = 1;
 7229|  3.01k|    }
 7230|       |
 7231|  16.2k|    CHECK_ARITY(1);
  ------------------
  |  |  280|  5.42k|    if (ctxt == NULL) return;						\
  |  |  ------------------
  |  |  |  Branch (280:9): [True: 0, False: 5.42k]
  |  |  ------------------
  |  |  281|  5.42k|    if (nargs != (x))							\
  |  |  ------------------
  |  |  |  Branch (281:9): [True: 3, False: 5.42k]
  |  |  ------------------
  |  |  282|  5.42k|        XP_ERROR(XPATH_INVALID_ARITY);					\
  |  |  ------------------
  |  |  |  |  244|      3|    { xmlXPathErr(ctxt, X); return; }
  |  |  ------------------
  |  |  283|  5.42k|    if (ctxt->valueNr < (x))						\
  |  |  ------------------
  |  |  |  Branch (283:9): [True: 2, False: 5.42k]
  |  |  ------------------
  |  |  284|  5.42k|        XP_ERROR(XPATH_STACK_ERROR);
  |  |  ------------------
  |  |  |  |  244|      2|    { xmlXPathErr(ctxt, X); return; }
  |  |  ------------------
  ------------------
 7232|  16.2k|    if ((ctxt->value == NULL) ||
  ------------------
  |  Branch (7232:9): [True: 0, False: 5.42k]
  ------------------
 7233|  5.42k|        ((ctxt->value->type != XPATH_NODESET) &&
  ------------------
  |  Branch (7233:10): [True: 3, False: 5.42k]
  ------------------
 7234|      3|         (ctxt->value->type != XPATH_XSLT_TREE)))
  ------------------
  |  Branch (7234:10): [True: 3, False: 0]
  ------------------
 7235|  5.42k|        XP_ERROR(XPATH_INVALID_TYPE);
  ------------------
  |  |  244|      3|    { xmlXPathErr(ctxt, X); return; }
  ------------------
 7236|  5.42k|    cur = xmlXPathValuePop(ctxt);
 7237|       |
 7238|  5.42k|    if ((cur->nodesetval == NULL) || (cur->nodesetval->nodeNr == 0)) {
  ------------------
  |  Branch (7238:9): [True: 0, False: 5.42k]
  |  Branch (7238:38): [True: 1.44k, False: 3.97k]
  ------------------
 7239|  1.44k|        xmlXPathValuePush(ctxt, xmlXPathCacheNewCString(ctxt, ""));
 7240|  3.97k|    } else {
 7241|  3.97k|        int i = 0;              /* Should be first in document order !!!!! */
 7242|       |
 7243|  3.97k|        switch (cur->nodesetval->nodeTab[i]->type) {
 7244|  2.20k|            case XML_ELEMENT_NODE:
  ------------------
  |  Branch (7244:13): [True: 2.20k, False: 1.77k]
  ------------------
 7245|  2.20k|            case XML_ATTRIBUTE_NODE:
  ------------------
  |  Branch (7245:13): [True: 0, False: 3.97k]
  ------------------
 7246|  2.20k|		if (cur->nodesetval->nodeTab[i]->name[0] == ' ')
  ------------------
  |  Branch (7246:7): [True: 0, False: 2.20k]
  ------------------
 7247|      0|		    xmlXPathValuePush(ctxt,
 7248|      0|			xmlXPathCacheNewCString(ctxt, ""));
 7249|  2.20k|		else if ((cur->nodesetval->nodeTab[i]->ns == NULL) ||
  ------------------
  |  Branch (7249:12): [True: 1.79k, False: 413]
  ------------------
 7250|  2.08k|                         (cur->nodesetval->nodeTab[i]->ns->prefix == NULL)) {
  ------------------
  |  Branch (7250:26): [True: 291, False: 122]
  ------------------
 7251|  2.08k|		    xmlXPathValuePush(ctxt, xmlXPathCacheNewString(ctxt,
 7252|  2.08k|			    cur->nodesetval->nodeTab[i]->name));
 7253|  2.08k|		} else {
 7254|    122|		    xmlChar *fullname;
 7255|       |
 7256|    122|		    fullname = xmlBuildQName(cur->nodesetval->nodeTab[i]->name,
 7257|    122|				     cur->nodesetval->nodeTab[i]->ns->prefix,
 7258|    122|				     NULL, 0);
 7259|    122|		    if (fullname == cur->nodesetval->nodeTab[i]->name)
  ------------------
  |  Branch (7259:11): [True: 0, False: 122]
  ------------------
 7260|      0|			fullname = xmlStrdup(cur->nodesetval->nodeTab[i]->name);
 7261|    122|		    if (fullname == NULL)
  ------------------
  |  Branch (7261:11): [True: 1, False: 121]
  ------------------
 7262|      1|                        xmlXPathPErrMemory(ctxt);
 7263|    122|		    xmlXPathValuePush(ctxt, xmlXPathCacheWrapString(ctxt, fullname));
 7264|    122|                }
 7265|  2.20k|                break;
 7266|  1.77k|            default:
  ------------------
  |  Branch (7266:13): [True: 1.77k, False: 2.20k]
  ------------------
 7267|  1.77k|		xmlXPathValuePush(ctxt, xmlXPathCacheNewNodeSet(ctxt,
 7268|  1.77k|		    cur->nodesetval->nodeTab[i]));
 7269|  1.77k|                xmlXPathLocalNameFunction(ctxt, 1);
 7270|  3.97k|        }
 7271|  3.97k|    }
 7272|  5.42k|    xmlXPathReleaseObject(ctxt->context, cur);
 7273|  5.42k|}
xpath.c:xmlXPathSFComputeHash:
  186|  5.65k|xmlXPathSFComputeHash(const xmlChar *name) {
  187|  5.65k|    unsigned hashValue = 5381;
  188|  5.65k|    const xmlChar *ptr;
  189|       |
  190|  34.3k|    for (ptr = name; *ptr; ptr++)
  ------------------
  |  Branch (190:22): [True: 28.6k, False: 5.65k]
  ------------------
  191|  28.6k|        hashValue = hashValue * 33 + *ptr;
  192|       |
  193|  5.65k|    return(hashValue);
  194|  5.65k|}
xpath.c:wrap_cmp:
  606|  3.16M|    {
  607|  3.16M|        int res = xmlXPathCmpNodesExt(x, y);
  608|  3.16M|        return res == -2 ? res : -res;
  ------------------
  |  Branch (608:16): [True: 0, False: 3.16M]
  ------------------
  609|  3.16M|    }
xpath.c:xmlXPathCmpNodesExt:
  309|  3.16M|xmlXPathCmpNodesExt(xmlNodePtr node1, xmlNodePtr node2) {
  310|  3.16M|    int depth1, depth2;
  311|  3.16M|    int misc = 0, precedence1 = 0, precedence2 = 0;
  312|  3.16M|    xmlNodePtr miscNode1 = NULL, miscNode2 = NULL;
  313|  3.16M|    xmlNodePtr cur, root;
  314|  3.16M|    XML_INTPTR_T l1, l2;
  ------------------
  |  |   52|  3.16M|  #define XML_INTPTR_T intptr_t
  ------------------
  315|       |
  316|  3.16M|    if ((node1 == NULL) || (node2 == NULL))
  ------------------
  |  Branch (316:9): [True: 0, False: 3.16M]
  |  Branch (316:28): [True: 0, False: 3.16M]
  ------------------
  317|      0|	return(-2);
  318|       |
  319|  3.16M|    if (node1 == node2)
  ------------------
  |  Branch (319:9): [True: 0, False: 3.16M]
  ------------------
  320|      0|	return(0);
  321|       |
  322|       |    /*
  323|       |     * a couple of optimizations which will avoid computations in most cases
  324|       |     */
  325|  3.16M|    switch (node1->type) {
  326|  2.56M|	case XML_ELEMENT_NODE:
  ------------------
  |  Branch (326:2): [True: 2.56M, False: 604k]
  ------------------
  327|  2.56M|	    if (node2->type == XML_ELEMENT_NODE) {
  ------------------
  |  Branch (327:10): [True: 2.09M, False: 472k]
  ------------------
  328|  2.09M|		if ((0 > XML_NODE_SORT_VALUE(node1)) &&
  ------------------
  |  |  295|  2.09M|#define XML_NODE_SORT_VALUE(n) XML_PTR_TO_INT((n)->content)
  |  |  ------------------
  |  |  |  |   58|  2.09M|#define XML_PTR_TO_INT(p) ((XML_INTPTR_T) (p))
  |  |  ------------------
  ------------------
  |  Branch (328:7): [True: 0, False: 2.09M]
  ------------------
  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.09M|		    goto turtle_comparison;
  340|  2.09M|	    }
  341|   472k|	    break;
  342|   472k|	case XML_ATTRIBUTE_NODE:
  ------------------
  |  Branch (342:2): [True: 6.48k, False: 3.16M]
  ------------------
  343|  6.48k|	    precedence1 = 1; /* element is owner */
  344|  6.48k|	    miscNode1 = node1;
  345|  6.48k|	    node1 = node1->parent;
  346|  6.48k|	    misc = 1;
  347|  6.48k|	    break;
  348|   508k|	case XML_TEXT_NODE:
  ------------------
  |  Branch (348:2): [True: 508k, False: 2.65M]
  ------------------
  349|   527k|	case XML_CDATA_SECTION_NODE:
  ------------------
  |  Branch (349:2): [True: 18.6k, False: 3.14M]
  ------------------
  350|   531k|	case XML_COMMENT_NODE:
  ------------------
  |  Branch (350:2): [True: 4.40k, False: 3.16M]
  ------------------
  351|   562k|	case XML_PI_NODE: {
  ------------------
  |  Branch (351:2): [True: 30.2k, False: 3.13M]
  ------------------
  352|   562k|	    miscNode1 = node1;
  353|       |	    /*
  354|       |	    * Find nearest element node.
  355|       |	    */
  356|   562k|	    if (node1->prev != NULL) {
  ------------------
  |  Branch (356:10): [True: 208k, False: 353k]
  ------------------
  357|  2.80M|		do {
  358|  2.80M|		    node1 = node1->prev;
  359|  2.80M|		    if (node1->type == XML_ELEMENT_NODE) {
  ------------------
  |  Branch (359:11): [True: 203k, False: 2.59M]
  ------------------
  360|   203k|			precedence1 = 3; /* element in prev-sibl axis */
  361|   203k|			break;
  362|   203k|		    }
  363|  2.59M|		    if (node1->prev == NULL) {
  ------------------
  |  Branch (363:11): [True: 4.49k, False: 2.59M]
  ------------------
  364|  4.49k|			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|  4.49k|			node1 = node1->parent;
  370|  4.49k|			break;
  371|  4.49k|		    }
  372|  2.59M|		} while (1);
  ------------------
  |  Branch (372:12): [True: 2.59M, Folded]
  ------------------
  373|   353k|	    } else {
  374|   353k|		precedence1 = 2; /* element is parent */
  375|   353k|		node1 = node1->parent;
  376|   353k|	    }
  377|   562k|	    if ((node1 == NULL) || (node1->type != XML_ELEMENT_NODE) ||
  ------------------
  |  Branch (377:10): [True: 0, False: 562k]
  |  Branch (377:29): [True: 622, False: 561k]
  ------------------
  378|   562k|		(0 <= XML_NODE_SORT_VALUE(node1))) {
  ------------------
  |  |  295|   561k|#define XML_NODE_SORT_VALUE(n) XML_PTR_TO_INT((n)->content)
  |  |  ------------------
  |  |  |  |   58|   561k|#define XML_PTR_TO_INT(p) ((XML_INTPTR_T) (p))
  |  |  ------------------
  ------------------
  |  Branch (378:3): [True: 561k, False: 0]
  ------------------
  379|       |		/*
  380|       |		* Fallback for whatever case.
  381|       |		*/
  382|   562k|		node1 = miscNode1;
  383|   562k|		precedence1 = 0;
  384|   562k|	    } else
  385|      0|		misc = 1;
  386|   562k|	}
  387|   562k|	    break;
  388|  14.2k|	case XML_NAMESPACE_DECL:
  ------------------
  |  Branch (388:2): [True: 14.2k, False: 3.15M]
  ------------------
  389|       |	    /*
  390|       |	    * TODO: why do we return 1 for namespace nodes?
  391|       |	    */
  392|  14.2k|	    return(1);
  393|  21.7k|	default:
  ------------------
  |  Branch (393:2): [True: 21.7k, False: 3.14M]
  ------------------
  394|  21.7k|	    break;
  395|  3.16M|    }
  396|  1.06M|    switch (node2->type) {
  397|   388k|	case XML_ELEMENT_NODE:
  ------------------
  |  Branch (397:2): [True: 388k, False: 675k]
  ------------------
  398|   388k|	    break;
  399|  6.98k|	case XML_ATTRIBUTE_NODE:
  ------------------
  |  Branch (399:2): [True: 6.98k, False: 1.05M]
  ------------------
  400|  6.98k|	    precedence2 = 1; /* element is owner */
  401|  6.98k|	    miscNode2 = node2;
  402|  6.98k|	    node2 = node2->parent;
  403|  6.98k|	    misc = 1;
  404|  6.98k|	    break;
  405|   539k|	case XML_TEXT_NODE:
  ------------------
  |  Branch (405:2): [True: 539k, False: 523k]
  ------------------
  406|   558k|	case XML_CDATA_SECTION_NODE:
  ------------------
  |  Branch (406:2): [True: 18.7k, False: 1.04M]
  ------------------
  407|   561k|	case XML_COMMENT_NODE:
  ------------------
  |  Branch (407:2): [True: 3.88k, False: 1.05M]
  ------------------
  408|   592k|	case XML_PI_NODE: {
  ------------------
  |  Branch (408:2): [True: 30.5k, False: 1.03M]
  ------------------
  409|   592k|	    miscNode2 = node2;
  410|   592k|	    if (node2->prev != NULL) {
  ------------------
  |  Branch (410:10): [True: 224k, False: 367k]
  ------------------
  411|  2.81M|		do {
  412|  2.81M|		    node2 = node2->prev;
  413|  2.81M|		    if (node2->type == XML_ELEMENT_NODE) {
  ------------------
  |  Branch (413:11): [True: 220k, False: 2.59M]
  ------------------
  414|   220k|			precedence2 = 3; /* element in prev-sibl axis */
  415|   220k|			break;
  416|   220k|		    }
  417|  2.59M|		    if (node2->prev == NULL) {
  ------------------
  |  Branch (417:11): [True: 4.22k, False: 2.59M]
  ------------------
  418|  4.22k|			precedence2 = 2; /* element is parent */
  419|  4.22k|			node2 = node2->parent;
  420|  4.22k|			break;
  421|  4.22k|		    }
  422|  2.59M|		} while (1);
  ------------------
  |  Branch (422:12): [True: 2.59M, Folded]
  ------------------
  423|   367k|	    } else {
  424|   367k|		precedence2 = 2; /* element is parent */
  425|   367k|		node2 = node2->parent;
  426|   367k|	    }
  427|   592k|	    if ((node2 == NULL) || (node2->type != XML_ELEMENT_NODE) ||
  ------------------
  |  Branch (427:10): [True: 0, False: 592k]
  |  Branch (427:29): [True: 527, False: 591k]
  ------------------
  428|   591k|		(0 <= XML_NODE_SORT_VALUE(node2)))
  ------------------
  |  |  295|   591k|#define XML_NODE_SORT_VALUE(n) XML_PTR_TO_INT((n)->content)
  |  |  ------------------
  |  |  |  |   58|   591k|#define XML_PTR_TO_INT(p) ((XML_INTPTR_T) (p))
  |  |  ------------------
  ------------------
  |  Branch (428:3): [True: 591k, False: 0]
  ------------------
  429|   592k|	    {
  430|   592k|		node2 = miscNode2;
  431|   592k|		precedence2 = 0;
  432|   592k|	    } else
  433|      0|		misc = 1;
  434|   592k|	}
  435|   592k|	    break;
  436|    221|	case XML_NAMESPACE_DECL:
  ------------------
  |  Branch (436:2): [True: 221, False: 1.06M]
  ------------------
  437|    221|	    return(1);
  438|  75.3k|	default:
  ------------------
  |  Branch (438:2): [True: 75.3k, False: 987k]
  ------------------
  439|  75.3k|	    break;
  440|  1.06M|    }
  441|  1.06M|    if (misc) {
  ------------------
  |  Branch (441:9): [True: 11.4k, False: 1.05M]
  ------------------
  442|  11.4k|	if (node1 == node2) {
  ------------------
  |  Branch (442:6): [True: 2.12k, False: 9.36k]
  ------------------
  443|  2.12k|	    if (precedence1 == precedence2) {
  ------------------
  |  Branch (443:10): [True: 896, False: 1.22k]
  ------------------
  444|       |		/*
  445|       |		* The ugly case; but normally there aren't many
  446|       |		* adjacent non-element nodes around.
  447|       |		*/
  448|    896|		cur = miscNode2->prev;
  449|    993|		while (cur != NULL) {
  ------------------
  |  Branch (449:10): [True: 491, False: 502]
  ------------------
  450|    491|		    if (cur == miscNode1)
  ------------------
  |  Branch (450:11): [True: 394, False: 97]
  ------------------
  451|    394|			return(1);
  452|     97|		    if (cur->type == XML_ELEMENT_NODE)
  ------------------
  |  Branch (452:11): [True: 0, False: 97]
  ------------------
  453|      0|			return(-1);
  454|     97|		    cur = cur->prev;
  455|     97|		}
  456|    502|		return (-1);
  457|  1.22k|	    } 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.22k|		if (precedence1 < precedence2)
  ------------------
  |  Branch (463:7): [True: 536, False: 690]
  ------------------
  464|    536|		    return(1);
  465|    690|		else
  466|    690|		    return(-1);
  467|  1.22k|	    }
  468|  2.12k|	}
  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|  9.36k|	if ((precedence2 == 3) && (precedence1 > 1)) {
  ------------------
  |  Branch (478:6): [True: 0, False: 9.36k]
  |  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|  9.36k|	if ((precedence1 == 3) && (precedence2 > 1)) {
  ------------------
  |  Branch (486:6): [True: 0, False: 9.36k]
  |  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|  9.36k|    }
  495|       |
  496|       |    /*
  497|       |     * Speedup using document order if available.
  498|       |     */
  499|  1.06M|    if ((node1->type == XML_ELEMENT_NODE) &&
  ------------------
  |  Branch (499:9): [True: 477k, False: 583k]
  ------------------
  500|   477k|	(node2->type == XML_ELEMENT_NODE) &&
  ------------------
  |  Branch (500:2): [True: 7.22k, False: 469k]
  ------------------
  501|  7.22k|	(0 > XML_NODE_SORT_VALUE(node1)) &&
  ------------------
  |  |  295|  7.22k|#define XML_NODE_SORT_VALUE(n) XML_PTR_TO_INT((n)->content)
  |  |  ------------------
  |  |  |  |   58|  7.22k|#define XML_PTR_TO_INT(p) ((XML_INTPTR_T) (p))
  |  |  ------------------
  ------------------
  |  Branch (501:2): [True: 0, False: 7.22k]
  ------------------
  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.15M|turtle_comparison:
  514|       |
  515|  3.15M|    if (node1 == node2->prev)
  ------------------
  |  Branch (515:9): [True: 955k, False: 2.19M]
  ------------------
  516|   955k|	return(1);
  517|  2.19M|    if (node1 == node2->next)
  ------------------
  |  Branch (517:9): [True: 42.3k, False: 2.15M]
  ------------------
  518|  42.3k|	return(-1);
  519|       |    /*
  520|       |     * compute depth to root
  521|       |     */
  522|  47.6M|    for (depth2 = 0, cur = node2; cur->parent != NULL; cur = cur->parent) {
  ------------------
  |  Branch (522:35): [True: 46.1M, False: 1.50M]
  ------------------
  523|  46.1M|	if (cur->parent == node1)
  ------------------
  |  Branch (523:6): [True: 643k, False: 45.4M]
  ------------------
  524|   643k|	    return(1);
  525|  45.4M|	depth2++;
  526|  45.4M|    }
  527|  1.50M|    root = cur;
  528|  40.8M|    for (depth1 = 0, cur = node1; cur->parent != NULL; cur = cur->parent) {
  ------------------
  |  Branch (528:35): [True: 39.6M, False: 1.20M]
  ------------------
  529|  39.6M|	if (cur->parent == node2)
  ------------------
  |  Branch (529:6): [True: 305k, False: 39.3M]
  ------------------
  530|   305k|	    return(-1);
  531|  39.3M|	depth1++;
  532|  39.3M|    }
  533|       |    /*
  534|       |     * Distinct document (or distinct entities :-( ) case.
  535|       |     */
  536|  1.20M|    if (root != cur) {
  ------------------
  |  Branch (536:9): [True: 0, False: 1.20M]
  ------------------
  537|      0|	return(-2);
  538|      0|    }
  539|       |    /*
  540|       |     * get the nearest common ancestor.
  541|       |     */
  542|  4.23M|    while (depth1 > depth2) {
  ------------------
  |  Branch (542:12): [True: 3.03M, False: 1.20M]
  ------------------
  543|  3.03M|	depth1--;
  544|  3.03M|	node1 = node1->parent;
  545|  3.03M|    }
  546|  5.96M|    while (depth2 > depth1) {
  ------------------
  |  Branch (546:12): [True: 4.76M, False: 1.20M]
  ------------------
  547|  4.76M|	depth2--;
  548|  4.76M|	node2 = node2->parent;
  549|  4.76M|    }
  550|  2.47M|    while (node1->parent != node2->parent) {
  ------------------
  |  Branch (550:12): [True: 1.26M, False: 1.20M]
  ------------------
  551|  1.26M|	node1 = node1->parent;
  552|  1.26M|	node2 = node2->parent;
  553|       |	/* should not happen but just in case ... */
  554|  1.26M|	if ((node1 == NULL) || (node2 == NULL))
  ------------------
  |  Branch (554:6): [True: 0, False: 1.26M]
  |  Branch (554:25): [True: 0, False: 1.26M]
  ------------------
  555|      0|	    return(-2);
  556|  1.26M|    }
  557|       |    /*
  558|       |     * Find who's first.
  559|       |     */
  560|  1.20M|    if (node1 == node2->prev)
  ------------------
  |  Branch (560:9): [True: 319k, False: 884k]
  ------------------
  561|   319k|	return(1);
  562|   884k|    if (node1 == node2->next)
  ------------------
  |  Branch (562:9): [True: 392k, False: 492k]
  ------------------
  563|   392k|	return(-1);
  564|       |    /*
  565|       |     * Speedup using document order if available.
  566|       |     */
  567|   492k|    if ((node1->type == XML_ELEMENT_NODE) &&
  ------------------
  |  Branch (567:9): [True: 487k, False: 4.93k]
  ------------------
  568|   487k|	(node2->type == XML_ELEMENT_NODE) &&
  ------------------
  |  Branch (568:2): [True: 479k, False: 7.37k]
  ------------------
  569|   479k|	(0 > XML_NODE_SORT_VALUE(node1)) &&
  ------------------
  |  |  295|   479k|#define XML_NODE_SORT_VALUE(n) XML_PTR_TO_INT((n)->content)
  |  |  ------------------
  |  |  |  |   58|   479k|#define XML_PTR_TO_INT(p) ((XML_INTPTR_T) (p))
  |  |  ------------------
  ------------------
  |  Branch (569:2): [True: 0, False: 479k]
  ------------------
  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|  3.82M|    for (cur = node1->next;cur != NULL;cur = cur->next)
  ------------------
  |  Branch (581:28): [True: 3.60M, False: 210k]
  ------------------
  582|  3.60M|	if (cur == node2)
  ------------------
  |  Branch (582:6): [True: 281k, False: 3.32M]
  ------------------
  583|   281k|	    return(1);
  584|   210k|    return(-1); /* assume there is no sibling list corruption */
  585|   492k|}
xpath.c:xmlXPathErrFmt:
  707|  7.07k|xmlXPathErrFmt(xmlXPathParserContext *ctxt, int code, const char *fmt, ...) {
  708|  7.07k|    va_list ap;
  709|  7.07k|    xmlStructuredErrorFunc schannel = NULL;
  710|  7.07k|    xmlGenericErrorFunc channel = NULL;
  711|  7.07k|    void *data = NULL;
  712|  7.07k|    xmlNodePtr node = NULL;
  713|  7.07k|    int res;
  714|       |
  715|  7.07k|    if (ctxt == NULL)
  ------------------
  |  Branch (715:9): [True: 0, False: 7.07k]
  ------------------
  716|      0|        return;
  717|  7.07k|    if ((code < 0) || (code > MAXERRNO))
  ------------------
  |  |  668|  7.07k|#define MAXERRNO ((int)(sizeof(xmlXPathErrorMessages) /	\
  |  |  669|  7.07k|		   sizeof(xmlXPathErrorMessages[0])) - 1)
  ------------------
  |  Branch (717:9): [True: 0, False: 7.07k]
  |  Branch (717:23): [True: 0, False: 7.07k]
  ------------------
  718|      0|	code = MAXERRNO;
  ------------------
  |  |  668|      0|#define MAXERRNO ((int)(sizeof(xmlXPathErrorMessages) /	\
  |  |  669|      0|		   sizeof(xmlXPathErrorMessages[0])) - 1)
  ------------------
  719|       |    /* Only report the first error */
  720|  7.07k|    if (ctxt->error != 0)
  ------------------
  |  Branch (720:9): [True: 3.19k, False: 3.87k]
  ------------------
  721|  3.19k|        return;
  722|       |
  723|  3.87k|    ctxt->error = code;
  724|       |
  725|  3.87k|    if (ctxt->context != NULL) {
  ------------------
  |  Branch (725:9): [True: 3.87k, False: 0]
  ------------------
  726|  3.87k|        xmlErrorPtr err = &ctxt->context->lastError;
  727|       |
  728|       |        /* Don't overwrite memory error. */
  729|  3.87k|        if (err->code == XML_ERR_NO_MEMORY)
  ------------------
  |  Branch (729:13): [True: 0, False: 3.87k]
  ------------------
  730|      0|            return;
  731|       |
  732|       |        /* cleanup current last error */
  733|  3.87k|        xmlResetError(err);
  734|       |
  735|  3.87k|        err->domain = XML_FROM_XPATH;
  736|  3.87k|        err->code = code + XML_XPATH_EXPRESSION_OK - XPATH_EXPRESSION_OK;
  737|  3.87k|        err->level = XML_ERR_ERROR;
  738|  3.87k|        if (ctxt->base != NULL) {
  ------------------
  |  Branch (738:13): [True: 3.87k, False: 0]
  ------------------
  739|  3.87k|            err->str1 = (char *) xmlStrdup(ctxt->base);
  740|  3.87k|            if (err->str1 == NULL) {
  ------------------
  |  Branch (740:17): [True: 19, False: 3.85k]
  ------------------
  741|     19|                xmlXPathPErrMemory(ctxt);
  742|     19|                return;
  743|     19|            }
  744|  3.87k|        }
  745|  3.85k|        err->int1 = ctxt->cur - ctxt->base;
  746|  3.85k|        err->node = ctxt->context->debugNode;
  747|       |
  748|  3.85k|        schannel = ctxt->context->error;
  749|  3.85k|        data = ctxt->context->userData;
  750|  3.85k|        node = ctxt->context->debugNode;
  751|  3.85k|    }
  752|       |
  753|  3.85k|    if (schannel == NULL) {
  ------------------
  |  Branch (753:9): [True: 0, False: 3.85k]
  ------------------
  754|      0|        channel = xmlGenericError;
  ------------------
  |  |  976|      0|  #define xmlGenericError (*__xmlGenericError())
  ------------------
  755|      0|        data = xmlGenericErrorContext;
  ------------------
  |  |  983|      0|  #define xmlGenericErrorContext (*__xmlGenericErrorContext())
  ------------------
  756|      0|    }
  757|       |
  758|  3.85k|    va_start(ap, fmt);
  759|  3.85k|    res = xmlVRaiseError(schannel, channel, data, NULL, node, XML_FROM_XPATH,
  760|  3.85k|                         code + XML_XPATH_EXPRESSION_OK - XPATH_EXPRESSION_OK,
  761|  3.85k|                         XML_ERR_ERROR, NULL, 0,
  762|  3.85k|                         (const char *) ctxt->base, NULL, NULL,
  763|  3.85k|                         ctxt->cur - ctxt->base, 0,
  764|  3.85k|                         fmt, ap);
  765|  3.85k|    va_end(ap);
  766|  3.85k|    if (res < 0)
  ------------------
  |  Branch (766:9): [True: 33, False: 3.82k]
  ------------------
  767|     33|        xmlXPathPErrMemory(ctxt);
  768|  3.85k|}
xpath.c:xmlXPathCastToNumberInternal:
 1931|   571k|                             xmlXPathObjectPtr val) {
 1932|   571k|    double ret = 0.0;
 1933|       |
 1934|   571k|    if (val == NULL)
  ------------------
  |  Branch (1934:9): [True: 0, False: 571k]
  ------------------
 1935|      0|	return(xmlXPathNAN);
 1936|   571k|    switch (val->type) {
  ------------------
  |  Branch (1936:13): [True: 571k, False: 0]
  ------------------
 1937|      0|    case XPATH_UNDEFINED:
  ------------------
  |  Branch (1937:5): [True: 0, False: 571k]
  ------------------
 1938|      0|	ret = xmlXPathNAN;
 1939|      0|	break;
 1940|   393k|    case XPATH_NODESET:
  ------------------
  |  Branch (1940:5): [True: 393k, False: 178k]
  ------------------
 1941|   393k|    case XPATH_XSLT_TREE: {
  ------------------
  |  Branch (1941:5): [True: 0, False: 571k]
  ------------------
 1942|   393k|        xmlChar *str;
 1943|       |
 1944|   393k|	str = xmlXPathCastNodeSetToString(val->nodesetval);
 1945|   393k|        if (str == NULL) {
  ------------------
  |  Branch (1945:13): [True: 61, False: 393k]
  ------------------
 1946|     61|            xmlXPathPErrMemory(ctxt);
 1947|     61|            ret = xmlXPathNAN;
 1948|   393k|        } else {
 1949|   393k|	    ret = xmlXPathCastStringToNumber(str);
 1950|   393k|            xmlFree(str);
 1951|   393k|        }
 1952|   393k|	break;
 1953|   393k|    }
 1954|   107k|    case XPATH_STRING:
  ------------------
  |  Branch (1954:5): [True: 107k, False: 464k]
  ------------------
 1955|   107k|	ret = xmlXPathCastStringToNumber(val->stringval);
 1956|   107k|	break;
 1957|  45.1k|    case XPATH_NUMBER:
  ------------------
  |  Branch (1957:5): [True: 45.1k, False: 526k]
  ------------------
 1958|  45.1k|	ret = val->floatval;
 1959|  45.1k|	break;
 1960|  25.4k|    case XPATH_BOOLEAN:
  ------------------
  |  Branch (1960:5): [True: 25.4k, False: 546k]
  ------------------
 1961|  25.4k|	ret = xmlXPathCastBooleanToNumber(val->boolval);
 1962|  25.4k|	break;
 1963|      0|    case XPATH_USERS:
  ------------------
  |  Branch (1963:5): [True: 0, False: 571k]
  ------------------
 1964|       |	/* TODO */
 1965|      0|	ret = xmlXPathNAN;
 1966|      0|	break;
 1967|   571k|    }
 1968|   571k|    return(ret);
 1969|   571k|}
xpath.c:xmlXPathNodeSetDupNs:
 2604|  68.4k|xmlXPathNodeSetDupNs(xmlNodePtr node, xmlNsPtr ns) {
 2605|  68.4k|    xmlNsPtr cur;
 2606|       |
 2607|  68.4k|    if ((ns == NULL) || (ns->type != XML_NAMESPACE_DECL))
  ------------------
  |  Branch (2607:9): [True: 0, False: 68.4k]
  |  Branch (2607:25): [True: 0, False: 68.4k]
  ------------------
 2608|      0|	return(NULL);
 2609|  68.4k|    if ((node == NULL) || (node->type == XML_NAMESPACE_DECL))
  ------------------
  |  Branch (2609:9): [True: 0, False: 68.4k]
  |  Branch (2609:27): [True: 0, False: 68.4k]
  ------------------
 2610|      0|	return((xmlNodePtr) ns);
 2611|       |
 2612|       |    /*
 2613|       |     * Allocate a new Namespace and fill the fields.
 2614|       |     */
 2615|  68.4k|    cur = (xmlNsPtr) xmlMalloc(sizeof(xmlNs));
 2616|  68.4k|    if (cur == NULL)
  ------------------
  |  Branch (2616:9): [True: 24, False: 68.3k]
  ------------------
 2617|     24|	return(NULL);
 2618|  68.3k|    memset(cur, 0, sizeof(xmlNs));
 2619|  68.3k|    cur->type = XML_NAMESPACE_DECL;
 2620|  68.3k|    if (ns->href != NULL) {
  ------------------
  |  Branch (2620:9): [True: 41.9k, False: 26.4k]
  ------------------
 2621|  41.9k|	cur->href = xmlStrdup(ns->href);
 2622|  41.9k|        if (cur->href == NULL) {
  ------------------
  |  Branch (2622:13): [True: 11, False: 41.9k]
  ------------------
 2623|     11|            xmlFree(cur);
 2624|     11|            return(NULL);
 2625|     11|        }
 2626|  41.9k|    }
 2627|  68.3k|    if (ns->prefix != NULL) {
  ------------------
  |  Branch (2627:9): [True: 55.7k, False: 12.6k]
  ------------------
 2628|  55.7k|	cur->prefix = xmlStrdup(ns->prefix);
 2629|  55.7k|        if (cur->prefix == NULL) {
  ------------------
  |  Branch (2629:13): [True: 14, False: 55.7k]
  ------------------
 2630|     14|            xmlFree((xmlChar *) cur->href);
 2631|     14|            xmlFree(cur);
 2632|     14|            return(NULL);
 2633|     14|        }
 2634|  55.7k|    }
 2635|  68.3k|    cur->next = (xmlNsPtr) node;
 2636|  68.3k|    return((xmlNodePtr) cur);
 2637|  68.3k|}
xpath.c:xmlXPathNodeSetGrow:
 2735|  1.17M|xmlXPathNodeSetGrow(xmlNodeSetPtr cur) {
 2736|  1.17M|    xmlNodePtr *temp;
 2737|  1.17M|    int newSize;
 2738|       |
 2739|  1.17M|    newSize = xmlGrowCapacity(cur->nodeMax, sizeof(temp[0]),
 2740|  1.17M|                              XML_NODESET_DEFAULT, XPATH_MAX_NODESET_LENGTH);
  ------------------
  |  | 2593|  1.17M|#define XML_NODESET_DEFAULT	10
  ------------------
                                            XML_NODESET_DEFAULT, XPATH_MAX_NODESET_LENGTH);
  ------------------
  |  |  105|  1.17M|#define XPATH_MAX_NODESET_LENGTH 10000000
  ------------------
 2741|  1.17M|    if (newSize < 0)
  ------------------
  |  Branch (2741:9): [True: 0, False: 1.17M]
  ------------------
 2742|      0|        return(-1);
 2743|  1.17M|    temp = xmlRealloc(cur->nodeTab, newSize * sizeof(temp[0]));
 2744|  1.17M|    if (temp == NULL)
  ------------------
  |  Branch (2744:9): [True: 236, False: 1.17M]
  ------------------
 2745|    236|        return(-1);
 2746|  1.17M|    cur->nodeMax = newSize;
 2747|  1.17M|    cur->nodeTab = temp;
 2748|       |
 2749|  1.17M|    return(0);
 2750|  1.17M|}
xpath.c:xmlXPathReleaseObject:
 4257|  3.14M|{
 4258|  3.14M|    if (obj == NULL)
  ------------------
  |  Branch (4258:9): [True: 11, False: 3.14M]
  ------------------
 4259|     11|	return;
 4260|  3.14M|    if ((ctxt == NULL) || (ctxt->cache == NULL)) {
  ------------------
  |  Branch (4260:9): [True: 0, False: 3.14M]
  |  Branch (4260:27): [True: 3.14M, False: 0]
  ------------------
 4261|  3.14M|	 xmlXPathFreeObject(obj);
 4262|  3.14M|    } 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.14M|}
xpath.c:xmlXPathFormatNumber:
 2229|  13.8k|{
 2230|  13.8k|    switch (xmlXPathIsInf(number)) {
 2231|      0|    case 1:
  ------------------
  |  Branch (2231:5): [True: 0, False: 13.8k]
  ------------------
 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: 13.8k]
  ------------------
 2236|      0|	if (buffersize > (int)sizeof("-Infinity"))
  ------------------
  |  Branch (2236:6): [True: 0, False: 0]
  ------------------
 2237|      0|	    snprintf(buffer, buffersize, "-Infinity");
 2238|      0|	break;
 2239|  13.8k|    default:
  ------------------
  |  Branch (2239:5): [True: 13.8k, False: 0]
  ------------------
 2240|  13.8k|	if (xmlXPathIsNaN(number)) {
  ------------------
  |  Branch (2240:6): [True: 0, False: 13.8k]
  ------------------
 2241|      0|	    if (buffersize > (int)sizeof("NaN"))
  ------------------
  |  Branch (2241:10): [True: 0, False: 0]
  ------------------
 2242|      0|		snprintf(buffer, buffersize, "NaN");
 2243|  13.8k|	} else if (number == 0) {
  ------------------
  |  Branch (2243:13): [True: 0, False: 13.8k]
  ------------------
 2244|       |            /* Omit sign for negative zero. */
 2245|      0|	    snprintf(buffer, buffersize, "0");
 2246|  13.8k|	} else if ((number > INT_MIN) && (number < INT_MAX) &&
  ------------------
  |  Branch (2246:13): [True: 8.54k, False: 5.32k]
  |  Branch (2246:35): [True: 4.05k, False: 4.49k]
  ------------------
 2247|  4.05k|                   (number == (int) number)) {
  ------------------
  |  Branch (2247:20): [True: 1.94k, False: 2.10k]
  ------------------
 2248|  1.94k|	    char work[30];
 2249|  1.94k|	    char *ptr, *cur;
 2250|  1.94k|	    int value = (int) number;
 2251|       |
 2252|  1.94k|            ptr = &buffer[0];
 2253|  1.94k|	    if (value == 0) {
  ------------------
  |  Branch (2253:10): [True: 0, False: 1.94k]
  ------------------
 2254|      0|		*ptr++ = '0';
 2255|  1.94k|	    } else {
 2256|  1.94k|		snprintf(work, 29, "%d", value);
 2257|  1.94k|		cur = &work[0];
 2258|  14.8k|		while ((*cur) && (ptr - buffer < buffersize)) {
  ------------------
  |  Branch (2258:10): [True: 12.8k, False: 1.94k]
  |  Branch (2258:20): [True: 12.8k, False: 0]
  ------------------
 2259|  12.8k|		    *ptr++ = *cur++;
 2260|  12.8k|		}
 2261|  1.94k|	    }
 2262|  1.94k|	    if (ptr - buffer < buffersize) {
  ------------------
  |  Branch (2262:10): [True: 1.94k, False: 0]
  ------------------
 2263|  1.94k|		*ptr = 0;
 2264|  1.94k|	    } else if (buffersize > 0) {
  ------------------
  |  Branch (2264:17): [True: 0, False: 0]
  ------------------
 2265|      0|		ptr--;
 2266|      0|		*ptr = 0;
 2267|      0|	    }
 2268|  11.9k|	} else {
 2269|       |	    /*
 2270|       |	      For the dimension of work,
 2271|       |	          DBL_DIG is number of significant digits
 2272|       |		  EXPONENT is only needed for "scientific notation"
 2273|       |	          3 is sign, decimal point, and terminating zero
 2274|       |		  LOWER_DOUBLE_EXP is max number of leading zeroes in fraction
 2275|       |	      Note that this dimension is slightly (a few characters)
 2276|       |	      larger than actually necessary.
 2277|       |	    */
 2278|  11.9k|	    char work[DBL_DIG + EXPONENT_DIGITS + 3 + LOWER_DOUBLE_EXP];
 2279|  11.9k|	    int integer_place, fraction_place;
 2280|  11.9k|	    char *ptr;
 2281|  11.9k|	    char *after_fraction;
 2282|  11.9k|	    double absolute_value;
 2283|  11.9k|	    int size;
 2284|       |
 2285|  11.9k|	    absolute_value = fabs(number);
 2286|       |
 2287|       |	    /*
 2288|       |	     * First choose format - scientific or regular floating point.
 2289|       |	     * In either case, result is in work, and after_fraction points
 2290|       |	     * just past the fractional part.
 2291|       |	    */
 2292|  11.9k|	    if ( ((absolute_value > UPPER_DOUBLE) ||
  ------------------
  |  | 2212|  11.9k|#define UPPER_DOUBLE 1E9
  ------------------
  |  Branch (2292:12): [True: 10.2k, False: 1.64k]
  ------------------
 2293|  1.64k|		  (absolute_value < LOWER_DOUBLE)) &&
  ------------------
  |  | 2213|  1.64k|#define LOWER_DOUBLE 1E-5
  ------------------
  |  Branch (2293:5): [True: 63, False: 1.57k]
  ------------------
 2294|  10.3k|		 (absolute_value != 0.0) ) {
  ------------------
  |  Branch (2294:4): [True: 10.3k, False: 0]
  ------------------
 2295|       |		/* Use scientific notation */
 2296|  10.3k|		integer_place = DBL_DIG + EXPONENT_DIGITS + 1;
  ------------------
  |  | 2218|  10.3k|#define EXPONENT_DIGITS (3 + 2)
  ------------------
 2297|  10.3k|		fraction_place = DBL_DIG - 1;
 2298|  10.3k|		size = snprintf(work, sizeof(work),"%*.*e",
 2299|  10.3k|			 integer_place, fraction_place, number);
 2300|  51.7k|		while ((size > 0) && (work[size] != 'e')) size--;
  ------------------
  |  Branch (2300:10): [True: 51.7k, False: 0]
  |  Branch (2300:24): [True: 41.4k, False: 10.3k]
  ------------------
 2301|       |
 2302|  10.3k|	    }
 2303|  1.57k|	    else {
 2304|       |		/* Use regular notation */
 2305|  1.57k|		if (absolute_value > 0.0) {
  ------------------
  |  Branch (2305:7): [True: 1.57k, False: 0]
  ------------------
 2306|  1.57k|		    integer_place = (int)log10(absolute_value);
 2307|  1.57k|		    if (integer_place > 0)
  ------------------
  |  Branch (2307:11): [True: 1.31k, False: 265]
  ------------------
 2308|  1.31k|		        fraction_place = DBL_DIG - integer_place - 1;
 2309|    265|		    else
 2310|    265|		        fraction_place = DBL_DIG - integer_place;
 2311|  1.57k|		} else {
 2312|      0|		    fraction_place = 1;
 2313|      0|		}
 2314|  1.57k|		size = snprintf(work, sizeof(work), "%0.*f",
 2315|  1.57k|				fraction_place, number);
 2316|  1.57k|	    }
 2317|       |
 2318|       |	    /* Remove leading spaces sometimes inserted by snprintf */
 2319|  16.8k|	    while (work[0] == ' ') {
  ------------------
  |  Branch (2319:13): [True: 4.92k, False: 11.9k]
  ------------------
 2320|   103k|	        for (ptr = &work[0];(ptr[0] = ptr[1]);ptr++);
  ------------------
  |  Branch (2320:30): [True: 98.5k, False: 4.92k]
  ------------------
 2321|  4.92k|		size--;
 2322|  4.92k|	    }
 2323|       |
 2324|       |	    /* Remove fractional trailing zeroes */
 2325|  11.9k|	    after_fraction = work + size;
 2326|  11.9k|	    ptr = after_fraction;
 2327|  43.3k|	    while (*(--ptr) == '0')
  ------------------
  |  Branch (2327:13): [True: 31.4k, False: 11.9k]
  ------------------
 2328|  31.4k|		;
 2329|  11.9k|	    if (*ptr != '.')
  ------------------
  |  Branch (2329:10): [True: 11.2k, False: 680]
  ------------------
 2330|  11.2k|	        ptr++;
 2331|  53.3k|	    while ((*ptr++ = *after_fraction++) != 0);
  ------------------
  |  Branch (2331:13): [True: 41.4k, False: 11.9k]
  ------------------
 2332|       |
 2333|       |	    /* Finally copy result back to caller */
 2334|  11.9k|	    size = strlen(work) + 1;
 2335|  11.9k|	    if (size > buffersize) {
  ------------------
  |  Branch (2335:10): [True: 0, False: 11.9k]
  ------------------
 2336|      0|		work[buffersize - 1] = 0;
 2337|      0|		size = buffersize;
 2338|      0|	    }
 2339|  11.9k|	    memmove(buffer, work, size);
 2340|  11.9k|	}
 2341|  13.8k|	break;
 2342|  13.8k|    }
 2343|  13.8k|}
xpath.c:xmlXPathNodeToNumberInternal:
 4532|   109k|xmlXPathNodeToNumberInternal(xmlXPathParserContextPtr ctxt, xmlNodePtr node) {
 4533|   109k|    xmlChar *strval;
 4534|   109k|    double ret;
 4535|       |
 4536|   109k|    if (node == NULL)
  ------------------
  |  Branch (4536:9): [True: 0, False: 109k]
  ------------------
 4537|      0|	return(xmlXPathNAN);
 4538|   109k|    strval = xmlXPathCastNodeToString(node);
 4539|   109k|    if (strval == NULL) {
  ------------------
  |  Branch (4539:9): [True: 9, False: 109k]
  ------------------
 4540|      9|        xmlXPathPErrMemory(ctxt);
 4541|      9|	return(xmlXPathNAN);
 4542|      9|    }
 4543|   109k|    ret = xmlXPathCastStringToNumber(strval);
 4544|   109k|    xmlFree(strval);
 4545|       |
 4546|   109k|    return(ret);
 4547|   109k|}
xpath.c:xmlXPathNewCompExpr:
  940|  8.81k|xmlXPathNewCompExpr(void) {
  941|  8.81k|    xmlXPathCompExprPtr cur;
  942|       |
  943|  8.81k|    cur = (xmlXPathCompExprPtr) xmlMalloc(sizeof(xmlXPathCompExpr));
  944|  8.81k|    if (cur == NULL)
  ------------------
  |  Branch (944:9): [True: 22, False: 8.79k]
  ------------------
  945|     22|	return(NULL);
  946|  8.79k|    memset(cur, 0, sizeof(xmlXPathCompExpr));
  947|  8.79k|#ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
  948|  8.79k|    cur->maxStep = 1;
  949|       |#else
  950|       |    cur->maxStep = 10;
  951|       |#endif
  952|  8.79k|    cur->nbStep = 0;
  953|  8.79k|    cur->steps = (xmlXPathStepOp *) xmlMalloc(cur->maxStep *
  954|  8.79k|	                                   sizeof(xmlXPathStepOp));
  955|  8.79k|    if (cur->steps == NULL) {
  ------------------
  |  Branch (955:9): [True: 15, False: 8.78k]
  ------------------
  956|     15|	xmlFree(cur);
  957|     15|	return(NULL);
  958|     15|    }
  959|  8.78k|    memset(cur->steps, 0, cur->maxStep * sizeof(xmlXPathStepOp));
  960|  8.78k|    cur->last = -1;
  961|  8.78k|    return(cur);
  962|  8.79k|}
xpath.c:xmlXPathEqualNodeSets:
 5433|  26.7k|                      xmlXPathObjectPtr arg2, int neq) {
 5434|  26.7k|    int i, j;
 5435|  26.7k|    unsigned int *hashs1;
 5436|  26.7k|    unsigned int *hashs2;
 5437|  26.7k|    xmlChar **values1;
 5438|  26.7k|    xmlChar **values2;
 5439|  26.7k|    int ret = 0;
 5440|  26.7k|    xmlNodeSetPtr ns1;
 5441|  26.7k|    xmlNodeSetPtr ns2;
 5442|       |
 5443|  26.7k|    if ((arg1 == NULL) ||
  ------------------
  |  Branch (5443:9): [True: 0, False: 26.7k]
  ------------------
 5444|  26.7k|	((arg1->type != XPATH_NODESET) && (arg1->type != XPATH_XSLT_TREE)))
  ------------------
  |  Branch (5444:3): [True: 0, False: 26.7k]
  |  Branch (5444:36): [True: 0, False: 0]
  ------------------
 5445|      0|        return(0);
 5446|  26.7k|    if ((arg2 == NULL) ||
  ------------------
  |  Branch (5446:9): [True: 0, False: 26.7k]
  ------------------
 5447|  26.7k|	((arg2->type != XPATH_NODESET) && (arg2->type != XPATH_XSLT_TREE)))
  ------------------
  |  Branch (5447:3): [True: 0, False: 26.7k]
  |  Branch (5447:36): [True: 0, False: 0]
  ------------------
 5448|      0|        return(0);
 5449|       |
 5450|  26.7k|    ns1 = arg1->nodesetval;
 5451|  26.7k|    ns2 = arg2->nodesetval;
 5452|       |
 5453|  26.7k|    if ((ns1 == NULL) || (ns1->nodeNr <= 0))
  ------------------
  |  Branch (5453:9): [True: 0, False: 26.7k]
  |  Branch (5453:26): [True: 10.8k, False: 15.8k]
  ------------------
 5454|  10.8k|	return(0);
 5455|  15.8k|    if ((ns2 == NULL) || (ns2->nodeNr <= 0))
  ------------------
  |  Branch (5455:9): [True: 0, False: 15.8k]
  |  Branch (5455:26): [True: 568, False: 15.2k]
  ------------------
 5456|    568|	return(0);
 5457|       |
 5458|       |    /*
 5459|       |     * for equal, check if there is a node pertaining to both sets
 5460|       |     */
 5461|  15.2k|    if (neq == 0)
  ------------------
  |  Branch (5461:9): [True: 14.7k, False: 509]
  ------------------
 5462|  31.2k|	for (i = 0;i < ns1->nodeNr;i++)
  ------------------
  |  Branch (5462:13): [True: 16.6k, False: 14.6k]
  ------------------
 5463|  52.9k|	    for (j = 0;j < ns2->nodeNr;j++)
  ------------------
  |  Branch (5463:17): [True: 36.4k, False: 16.5k]
  ------------------
 5464|  36.4k|		if (ns1->nodeTab[i] == ns2->nodeTab[j])
  ------------------
  |  Branch (5464:7): [True: 162, False: 36.2k]
  ------------------
 5465|    162|		    return(1);
 5466|       |
 5467|  15.1k|    values1 = (xmlChar **) xmlMalloc(ns1->nodeNr * sizeof(xmlChar *));
 5468|  15.1k|    if (values1 == NULL) {
  ------------------
  |  Branch (5468:9): [True: 3, False: 15.1k]
  ------------------
 5469|      3|        xmlXPathPErrMemory(ctxt);
 5470|      3|	return(0);
 5471|      3|    }
 5472|  15.1k|    hashs1 = (unsigned int *) xmlMalloc(ns1->nodeNr * sizeof(unsigned int));
 5473|  15.1k|    if (hashs1 == NULL) {
  ------------------
  |  Branch (5473:9): [True: 3, False: 15.1k]
  ------------------
 5474|      3|        xmlXPathPErrMemory(ctxt);
 5475|      3|	xmlFree(values1);
 5476|      3|	return(0);
 5477|      3|    }
 5478|  15.1k|    memset(values1, 0, ns1->nodeNr * sizeof(xmlChar *));
 5479|  15.1k|    values2 = (xmlChar **) xmlMalloc(ns2->nodeNr * sizeof(xmlChar *));
 5480|  15.1k|    if (values2 == NULL) {
  ------------------
  |  Branch (5480:9): [True: 4, False: 15.1k]
  ------------------
 5481|      4|        xmlXPathPErrMemory(ctxt);
 5482|      4|	xmlFree(hashs1);
 5483|      4|	xmlFree(values1);
 5484|      4|	return(0);
 5485|      4|    }
 5486|  15.1k|    hashs2 = (unsigned int *) xmlMalloc(ns2->nodeNr * sizeof(unsigned int));
 5487|  15.1k|    if (hashs2 == NULL) {
  ------------------
  |  Branch (5487:9): [True: 1, False: 15.1k]
  ------------------
 5488|      1|        xmlXPathPErrMemory(ctxt);
 5489|      1|	xmlFree(hashs1);
 5490|      1|	xmlFree(values1);
 5491|      1|	xmlFree(values2);
 5492|      1|	return(0);
 5493|      1|    }
 5494|  15.1k|    memset(values2, 0, ns2->nodeNr * sizeof(xmlChar *));
 5495|  30.7k|    for (i = 0;i < ns1->nodeNr;i++) {
  ------------------
  |  Branch (5495:16): [True: 16.9k, False: 13.8k]
  ------------------
 5496|  16.9k|	hashs1[i] = xmlXPathNodeValHash(ns1->nodeTab[i]);
 5497|  52.6k|	for (j = 0;j < ns2->nodeNr;j++) {
  ------------------
  |  Branch (5497:13): [True: 36.9k, False: 15.6k]
  ------------------
 5498|  36.9k|	    if (i == 0)
  ------------------
  |  Branch (5498:10): [True: 34.6k, False: 2.34k]
  ------------------
 5499|  34.6k|		hashs2[j] = xmlXPathNodeValHash(ns2->nodeTab[j]);
 5500|  36.9k|	    if (hashs1[i] != hashs2[j]) {
  ------------------
  |  Branch (5500:10): [True: 34.4k, False: 2.52k]
  ------------------
 5501|  34.4k|		if (neq) {
  ------------------
  |  Branch (5501:7): [True: 252, False: 34.1k]
  ------------------
 5502|    252|		    ret = 1;
 5503|    252|		    break;
 5504|    252|		}
 5505|  34.4k|	    }
 5506|  2.52k|	    else {
 5507|  2.52k|		if (values1[i] == NULL) {
  ------------------
  |  Branch (5507:7): [True: 1.93k, False: 594]
  ------------------
 5508|  1.93k|		    values1[i] = xmlNodeGetContent(ns1->nodeTab[i]);
 5509|  1.93k|                    if (values1[i] == NULL)
  ------------------
  |  Branch (5509:25): [True: 6, False: 1.92k]
  ------------------
 5510|      6|                        xmlXPathPErrMemory(ctxt);
 5511|  1.93k|                }
 5512|  2.52k|		if (values2[j] == NULL) {
  ------------------
  |  Branch (5512:7): [True: 1.60k, False: 918]
  ------------------
 5513|  1.60k|		    values2[j] = xmlNodeGetContent(ns2->nodeTab[j]);
 5514|  1.60k|                    if (values2[j] == NULL)
  ------------------
  |  Branch (5514:25): [True: 3, False: 1.60k]
  ------------------
 5515|      3|                        xmlXPathPErrMemory(ctxt);
 5516|  1.60k|                }
 5517|  2.52k|		ret = xmlStrEqual(values1[i], values2[j]) ^ neq;
 5518|  2.52k|		if (ret)
  ------------------
  |  Branch (5518:7): [True: 1.00k, False: 1.51k]
  ------------------
 5519|  1.00k|		    break;
 5520|  2.52k|	    }
 5521|  36.9k|	}
 5522|  16.9k|	if (ret)
  ------------------
  |  Branch (5522:6): [True: 1.26k, False: 15.6k]
  ------------------
 5523|  1.26k|	    break;
 5524|  16.9k|    }
 5525|  32.8k|    for (i = 0;i < ns1->nodeNr;i++)
  ------------------
  |  Branch (5525:16): [True: 17.7k, False: 15.1k]
  ------------------
 5526|  17.7k|	if (values1[i] != NULL)
  ------------------
  |  Branch (5526:6): [True: 1.92k, False: 15.8k]
  ------------------
 5527|  1.92k|	    xmlFree(values1[i]);
 5528|  49.8k|    for (j = 0;j < ns2->nodeNr;j++)
  ------------------
  |  Branch (5528:16): [True: 34.7k, False: 15.1k]
  ------------------
 5529|  34.7k|	if (values2[j] != NULL)
  ------------------
  |  Branch (5529:6): [True: 1.60k, False: 33.0k]
  ------------------
 5530|  1.60k|	    xmlFree(values2[j]);
 5531|  15.1k|    xmlFree(values1);
 5532|  15.1k|    xmlFree(values2);
 5533|  15.1k|    xmlFree(hashs1);
 5534|  15.1k|    xmlFree(hashs2);
 5535|  15.1k|    return(ret);
 5536|  15.1k|}
xpath.c:xmlXPathNodeValHash:
 4920|  64.1k|xmlXPathNodeValHash(xmlNodePtr node) {
 4921|  64.1k|    int len = 2;
 4922|  64.1k|    const xmlChar * string = NULL;
 4923|  64.1k|    xmlNodePtr tmp = NULL;
 4924|  64.1k|    unsigned int ret = 0;
 4925|       |
 4926|  64.1k|    if (node == NULL)
  ------------------
  |  Branch (4926:9): [True: 0, False: 64.1k]
  ------------------
 4927|      0|	return(0);
 4928|       |
 4929|  64.1k|    if (node->type == XML_DOCUMENT_NODE) {
  ------------------
  |  Branch (4929:9): [True: 15.4k, False: 48.7k]
  ------------------
 4930|  15.4k|	tmp = xmlDocGetRootElement((xmlDocPtr) node);
 4931|  15.4k|	if (tmp == NULL)
  ------------------
  |  Branch (4931:6): [True: 0, False: 15.4k]
  ------------------
 4932|      0|	    node = node->children;
 4933|  15.4k|	else
 4934|  15.4k|	    node = tmp;
 4935|       |
 4936|  15.4k|	if (node == NULL)
  ------------------
  |  Branch (4936:6): [True: 0, False: 15.4k]
  ------------------
 4937|      0|	    return(0);
 4938|  15.4k|    }
 4939|       |
 4940|  64.1k|    switch (node->type) {
 4941|    680|	case XML_COMMENT_NODE:
  ------------------
  |  Branch (4941:2): [True: 680, False: 63.5k]
  ------------------
 4942|  2.12k|	case XML_PI_NODE:
  ------------------
  |  Branch (4942:2): [True: 1.44k, False: 62.7k]
  ------------------
 4943|  2.32k|	case XML_CDATA_SECTION_NODE:
  ------------------
  |  Branch (4943:2): [True: 207, False: 63.9k]
  ------------------
 4944|  8.83k|	case XML_TEXT_NODE:
  ------------------
  |  Branch (4944:2): [True: 6.50k, False: 57.6k]
  ------------------
 4945|  8.83k|	    string = node->content;
 4946|  8.83k|	    if (string == NULL)
  ------------------
  |  Branch (4946:10): [True: 1.44k, False: 7.39k]
  ------------------
 4947|  1.44k|		return(0);
 4948|  7.39k|	    if (string[0] == 0)
  ------------------
  |  Branch (4948:10): [True: 25, False: 7.37k]
  ------------------
 4949|     25|		return(0);
 4950|  7.37k|	    return(string[0] + (string[1] << 8));
 4951|     45|	case XML_NAMESPACE_DECL:
  ------------------
  |  Branch (4951:2): [True: 45, False: 64.1k]
  ------------------
 4952|     45|	    string = ((xmlNsPtr)node)->href;
 4953|     45|	    if (string == NULL)
  ------------------
  |  Branch (4953:10): [True: 20, False: 25]
  ------------------
 4954|     20|		return(0);
 4955|     25|	    if (string[0] == 0)
  ------------------
  |  Branch (4955:10): [True: 0, False: 25]
  ------------------
 4956|      0|		return(0);
 4957|     25|	    return(string[0] + (string[1] << 8));
 4958|    643|	case XML_ATTRIBUTE_NODE:
  ------------------
  |  Branch (4958:2): [True: 643, False: 63.5k]
  ------------------
 4959|    643|	    tmp = ((xmlAttrPtr) node)->children;
 4960|    643|	    break;
 4961|  54.6k|	case XML_ELEMENT_NODE:
  ------------------
  |  Branch (4961:2): [True: 54.6k, False: 9.52k]
  ------------------
 4962|  54.6k|	    tmp = node->children;
 4963|  54.6k|	    break;
 4964|      0|	default:
  ------------------
  |  Branch (4964:2): [True: 0, False: 64.1k]
  ------------------
 4965|      0|	    return(0);
 4966|  64.1k|    }
 4967|   236k|    while (tmp != NULL) {
  ------------------
  |  Branch (4967:12): [True: 208k, False: 28.7k]
  ------------------
 4968|   208k|	switch (tmp->type) {
 4969|  11.3k|	    case XML_CDATA_SECTION_NODE:
  ------------------
  |  Branch (4969:6): [True: 11.3k, False: 196k]
  ------------------
 4970|  45.1k|	    case XML_TEXT_NODE:
  ------------------
  |  Branch (4970:6): [True: 33.8k, False: 174k]
  ------------------
 4971|  45.1k|		string = tmp->content;
 4972|  45.1k|		break;
 4973|   163k|	    default:
  ------------------
  |  Branch (4973:6): [True: 163k, False: 45.1k]
  ------------------
 4974|   163k|                string = NULL;
 4975|   163k|		break;
 4976|   208k|	}
 4977|   208k|	if ((string != NULL) && (string[0] != 0)) {
  ------------------
  |  Branch (4977:6): [True: 45.1k, False: 163k]
  |  Branch (4977:26): [True: 45.0k, False: 100]
  ------------------
 4978|  45.0k|	    if (len == 1) {
  ------------------
  |  Branch (4978:10): [True: 16.8k, False: 28.2k]
  ------------------
 4979|  16.8k|		return(ret + (string[0] << 8));
 4980|  16.8k|	    }
 4981|  28.2k|	    if (string[1] == 0) {
  ------------------
  |  Branch (4981:10): [True: 18.4k, False: 9.78k]
  ------------------
 4982|  18.4k|		len = 1;
 4983|  18.4k|		ret = string[0];
 4984|  18.4k|	    } else {
 4985|  9.78k|		return(string[0] + (string[1] << 8));
 4986|  9.78k|	    }
 4987|  28.2k|	}
 4988|       |	/*
 4989|       |	 * Skip to next node
 4990|       |	 */
 4991|   181k|        if ((tmp->children != NULL) &&
  ------------------
  |  Branch (4991:13): [True: 85.5k, False: 96.0k]
  ------------------
 4992|  85.5k|            (tmp->type != XML_DTD_NODE) &&
  ------------------
  |  Branch (4992:13): [True: 85.5k, False: 0]
  ------------------
 4993|  85.5k|            (tmp->type != XML_ENTITY_REF_NODE) &&
  ------------------
  |  Branch (4993:13): [True: 85.5k, False: 0]
  ------------------
 4994|  85.5k|            (tmp->children->type != XML_ENTITY_DECL)) {
  ------------------
  |  Branch (4994:13): [True: 85.5k, False: 0]
  ------------------
 4995|  85.5k|            tmp = tmp->children;
 4996|  85.5k|            continue;
 4997|  85.5k|	}
 4998|  96.0k|	if (tmp == node)
  ------------------
  |  Branch (4998:6): [True: 0, False: 96.0k]
  ------------------
 4999|      0|	    break;
 5000|       |
 5001|  96.0k|	if (tmp->next != NULL) {
  ------------------
  |  Branch (5001:6): [True: 91.6k, False: 4.42k]
  ------------------
 5002|  91.6k|	    tmp = tmp->next;
 5003|  91.6k|	    continue;
 5004|  91.6k|	}
 5005|       |
 5006|  8.84k|	do {
 5007|  8.84k|	    tmp = tmp->parent;
 5008|  8.84k|	    if (tmp == NULL)
  ------------------
  |  Branch (5008:10): [True: 0, False: 8.84k]
  ------------------
 5009|      0|		break;
 5010|  8.84k|	    if (tmp == node) {
  ------------------
  |  Branch (5010:10): [True: 2.04k, False: 6.80k]
  ------------------
 5011|  2.04k|		tmp = NULL;
 5012|  2.04k|		break;
 5013|  2.04k|	    }
 5014|  6.80k|	    if (tmp->next != NULL) {
  ------------------
  |  Branch (5014:10): [True: 2.37k, False: 4.42k]
  ------------------
 5015|  2.37k|		tmp = tmp->next;
 5016|  2.37k|		break;
 5017|  2.37k|	    }
 5018|  6.80k|	} while (tmp != NULL);
  ------------------
  |  Branch (5018:11): [True: 4.42k, False: 0]
  ------------------
 5019|  4.42k|    }
 5020|  28.7k|    return(ret);
 5021|  55.3k|}
xpath.c:xmlXPathEqualNodeSetFloat:
 5370|  28.6k|    xmlXPathObjectPtr arg, double f, int neq) {
 5371|  28.6k|  int i, ret=0;
 5372|  28.6k|  xmlNodeSetPtr ns;
 5373|  28.6k|  xmlChar *str2;
 5374|  28.6k|  xmlXPathObjectPtr val;
 5375|  28.6k|  double v;
 5376|       |
 5377|  28.6k|    if ((arg == NULL) ||
  ------------------
  |  Branch (5377:9): [True: 0, False: 28.6k]
  ------------------
 5378|  28.6k|	((arg->type != XPATH_NODESET) && (arg->type != XPATH_XSLT_TREE)))
  ------------------
  |  Branch (5378:3): [True: 0, False: 28.6k]
  |  Branch (5378:35): [True: 0, False: 0]
  ------------------
 5379|      0|        return(0);
 5380|       |
 5381|  28.6k|    ns = arg->nodesetval;
 5382|  28.6k|    if (ns != NULL) {
  ------------------
  |  Branch (5382:9): [True: 28.6k, False: 0]
  ------------------
 5383|  70.2k|	for (i=0;i<ns->nodeNr;i++) {
  ------------------
  |  Branch (5383:11): [True: 41.9k, False: 28.3k]
  ------------------
 5384|  41.9k|	    str2 = xmlXPathCastNodeToString(ns->nodeTab[i]);
 5385|  41.9k|	    if (str2 != NULL) {
  ------------------
  |  Branch (5385:10): [True: 41.9k, False: 8]
  ------------------
 5386|  41.9k|		xmlXPathValuePush(ctxt, xmlXPathCacheNewString(ctxt, str2));
 5387|  41.9k|		xmlFree(str2);
 5388|  41.9k|		xmlXPathNumberFunction(ctxt, 1);
 5389|  41.9k|                CHECK_ERROR0;
  ------------------
  |  |  236|  41.9k|    if (ctxt->error != XPATH_EXPRESSION_OK) return(0)
  |  |  ------------------
  |  |  |  Branch (236:9): [True: 11, False: 41.9k]
  |  |  ------------------
  ------------------
 5390|  41.9k|		val = xmlXPathValuePop(ctxt);
 5391|  41.9k|		v = val->floatval;
 5392|  41.9k|		xmlXPathReleaseObject(ctxt->context, val);
 5393|  41.9k|		if (!xmlXPathIsNaN(v)) {
  ------------------
  |  Branch (5393:7): [True: 1.15k, False: 40.7k]
  ------------------
 5394|  1.15k|		    if ((!neq) && (v==f)) {
  ------------------
  |  Branch (5394:11): [True: 1.04k, False: 115]
  |  Branch (5394:21): [True: 191, False: 853]
  ------------------
 5395|    191|			ret = 1;
 5396|    191|			break;
 5397|    968|		    } else if ((neq) && (v!=f)) {
  ------------------
  |  Branch (5397:18): [True: 115, False: 853]
  |  Branch (5397:27): [True: 97, False: 18]
  ------------------
 5398|     97|			ret = 1;
 5399|     97|			break;
 5400|     97|		    }
 5401|  40.7k|		} else {	/* NaN is unequal to any value */
 5402|  40.7k|		    if (neq)
  ------------------
  |  Branch (5402:11): [True: 921, False: 39.8k]
  ------------------
 5403|    921|			ret = 1;
 5404|  40.7k|		}
 5405|  41.9k|	    } else {
 5406|      8|                xmlXPathPErrMemory(ctxt);
 5407|      8|            }
 5408|  41.9k|	}
 5409|  28.6k|    }
 5410|       |
 5411|  28.6k|    return(ret);
 5412|  28.6k|}
xpath.c:xmlXPathEqualNodeSetString:
 5314|  9.27k|{
 5315|  9.27k|    int i;
 5316|  9.27k|    xmlNodeSetPtr ns;
 5317|  9.27k|    xmlChar *str2;
 5318|  9.27k|    unsigned int hash;
 5319|       |
 5320|  9.27k|    if ((str == NULL) || (arg == NULL) ||
  ------------------
  |  Branch (5320:9): [True: 0, False: 9.27k]
  |  Branch (5320:26): [True: 0, False: 9.27k]
  ------------------
 5321|  9.27k|        ((arg->type != XPATH_NODESET) && (arg->type != XPATH_XSLT_TREE)))
  ------------------
  |  Branch (5321:10): [True: 0, False: 9.27k]
  |  Branch (5321:42): [True: 0, False: 0]
  ------------------
 5322|      0|        return (0);
 5323|  9.27k|    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|  9.27k|    if ((ns == NULL) || (ns->nodeNr <= 0) )
  ------------------
  |  Branch (5328:9): [True: 0, False: 9.27k]
  |  Branch (5328:25): [True: 8.22k, False: 1.04k]
  ------------------
 5329|  8.22k|        return (0);
 5330|  1.04k|    hash = xmlXPathStringHash(str);
 5331|  12.9k|    for (i = 0; i < ns->nodeNr; i++) {
  ------------------
  |  Branch (5331:17): [True: 12.6k, False: 299]
  ------------------
 5332|  12.6k|        if (xmlXPathNodeValHash(ns->nodeTab[i]) == hash) {
  ------------------
  |  Branch (5332:13): [True: 1.01k, False: 11.6k]
  ------------------
 5333|  1.01k|            str2 = xmlNodeGetContent(ns->nodeTab[i]);
 5334|  1.01k|            if (str2 == NULL) {
  ------------------
  |  Branch (5334:17): [True: 2, False: 1.01k]
  ------------------
 5335|      2|                xmlXPathPErrMemory(ctxt);
 5336|      2|                return(0);
 5337|      2|            }
 5338|  1.01k|            if (xmlStrEqual(str, str2)) {
  ------------------
  |  Branch (5338:17): [True: 723, False: 291]
  ------------------
 5339|    723|                xmlFree(str2);
 5340|    723|		if (neq)
  ------------------
  |  Branch (5340:7): [True: 463, False: 260]
  ------------------
 5341|    463|		    continue;
 5342|    260|                return (1);
 5343|    723|            } else if (neq) {
  ------------------
  |  Branch (5343:24): [True: 220, False: 71]
  ------------------
 5344|    220|		xmlFree(str2);
 5345|    220|		return (1);
 5346|    220|	    }
 5347|     71|            xmlFree(str2);
 5348|  11.6k|        } else if (neq)
  ------------------
  |  Branch (5348:20): [True: 266, False: 11.3k]
  ------------------
 5349|    266|	    return (1);
 5350|  12.6k|    }
 5351|    299|    return (0);
 5352|  1.04k|}
xpath.c:xmlXPathStringHash:
 5031|  1.04k|xmlXPathStringHash(const xmlChar * string) {
 5032|  1.04k|    if (string == NULL)
  ------------------
  |  Branch (5032:9): [True: 0, False: 1.04k]
  ------------------
 5033|      0|	return(0);
 5034|  1.04k|    if (string[0] == 0)
  ------------------
  |  Branch (5034:9): [True: 297, False: 750]
  ------------------
 5035|    297|	return(0);
 5036|    750|    return(string[0] + (string[1] << 8));
 5037|  1.04k|}
xpath.c:xmlXPathEqualValuesCommon:
 5540|   185k|  xmlXPathObjectPtr arg1, xmlXPathObjectPtr arg2) {
 5541|   185k|    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|   185k|    switch (arg1->type) {
  ------------------
  |  Branch (5546:13): [True: 185k, False: 0]
  ------------------
 5547|      0|        case XPATH_UNDEFINED:
  ------------------
  |  Branch (5547:9): [True: 0, False: 185k]
  ------------------
 5548|      0|	    break;
 5549|   108k|        case XPATH_BOOLEAN:
  ------------------
  |  Branch (5549:9): [True: 108k, False: 76.9k]
  ------------------
 5550|   108k|	    switch (arg2->type) {
  ------------------
  |  Branch (5550:14): [True: 108k, False: 0]
  ------------------
 5551|      0|	        case XPATH_UNDEFINED:
  ------------------
  |  Branch (5551:10): [True: 0, False: 108k]
  ------------------
 5552|      0|		    break;
 5553|  71.0k|		case XPATH_BOOLEAN:
  ------------------
  |  Branch (5553:3): [True: 71.0k, False: 37.1k]
  ------------------
 5554|  71.0k|		    ret = (arg1->boolval == arg2->boolval);
 5555|  71.0k|		    break;
 5556|  24.2k|		case XPATH_NUMBER:
  ------------------
  |  Branch (5556:3): [True: 24.2k, False: 83.9k]
  ------------------
 5557|  24.2k|		    ret = (arg1->boolval ==
 5558|  24.2k|			   xmlXPathCastNumberToBoolean(arg2->floatval));
 5559|  24.2k|		    break;
 5560|  12.9k|		case XPATH_STRING:
  ------------------
  |  Branch (5560:3): [True: 12.9k, False: 95.2k]
  ------------------
 5561|  12.9k|		    if ((arg2->stringval == NULL) ||
  ------------------
  |  Branch (5561:11): [True: 0, False: 12.9k]
  ------------------
 5562|  12.9k|			(arg2->stringval[0] == 0)) ret = 0;
  ------------------
  |  Branch (5562:4): [True: 2.51k, False: 10.3k]
  ------------------
 5563|  10.3k|		    else
 5564|  10.3k|			ret = 1;
 5565|  12.9k|		    ret = (arg1->boolval == ret);
 5566|  12.9k|		    break;
 5567|      0|		case XPATH_USERS:
  ------------------
  |  Branch (5567:3): [True: 0, False: 108k]
  ------------------
 5568|       |		    /* TODO */
 5569|      0|		    break;
 5570|      0|		case XPATH_NODESET:
  ------------------
  |  Branch (5570:3): [True: 0, False: 108k]
  ------------------
 5571|      0|		case XPATH_XSLT_TREE:
  ------------------
  |  Branch (5571:3): [True: 0, False: 108k]
  ------------------
 5572|      0|		    break;
 5573|   108k|	    }
 5574|   108k|	    break;
 5575|   108k|        case XPATH_NUMBER:
  ------------------
  |  Branch (5575:9): [True: 75.9k, False: 109k]
  ------------------
 5576|  75.9k|	    switch (arg2->type) {
  ------------------
  |  Branch (5576:14): [True: 75.9k, False: 0]
  ------------------
 5577|      0|	        case XPATH_UNDEFINED:
  ------------------
  |  Branch (5577:10): [True: 0, False: 75.9k]
  ------------------
 5578|      0|		    break;
 5579|  29.3k|		case XPATH_BOOLEAN:
  ------------------
  |  Branch (5579:3): [True: 29.3k, False: 46.5k]
  ------------------
 5580|  29.3k|		    ret = (arg2->boolval==
 5581|  29.3k|			   xmlXPathCastNumberToBoolean(arg1->floatval));
 5582|  29.3k|		    break;
 5583|  1.10k|		case XPATH_STRING:
  ------------------
  |  Branch (5583:3): [True: 1.10k, False: 74.8k]
  ------------------
 5584|  1.10k|		    xmlXPathValuePush(ctxt, arg2);
 5585|  1.10k|		    xmlXPathNumberFunction(ctxt, 1);
 5586|  1.10k|		    arg2 = xmlXPathValuePop(ctxt);
 5587|  1.10k|                    if (ctxt->error)
  ------------------
  |  Branch (5587:25): [True: 2, False: 1.10k]
  ------------------
 5588|      2|                        break;
 5589|       |                    /* Falls through. */
 5590|  46.5k|		case XPATH_NUMBER:
  ------------------
  |  Branch (5590:3): [True: 45.4k, False: 30.4k]
  ------------------
 5591|       |		    /* Hand check NaN and Infinity equalities */
 5592|  46.5k|		    if (xmlXPathIsNaN(arg1->floatval) ||
  ------------------
  |  Branch (5592:11): [True: 4.08k, False: 42.5k]
  ------------------
 5593|  42.5k|			    xmlXPathIsNaN(arg2->floatval)) {
  ------------------
  |  Branch (5593:8): [True: 1.46k, False: 41.0k]
  ------------------
 5594|  5.55k|		        ret = 0;
 5595|  41.0k|		    } else if (xmlXPathIsInf(arg1->floatval) == 1) {
  ------------------
  |  Branch (5595:18): [True: 132, False: 40.9k]
  ------------------
 5596|    132|		        if (xmlXPathIsInf(arg2->floatval) == 1)
  ------------------
  |  Branch (5596:15): [True: 27, False: 105]
  ------------------
 5597|     27|			    ret = 1;
 5598|    105|			else
 5599|    105|			    ret = 0;
 5600|  40.9k|		    } else if (xmlXPathIsInf(arg1->floatval) == -1) {
  ------------------
  |  Branch (5600:18): [True: 150, False: 40.7k]
  ------------------
 5601|    150|			if (xmlXPathIsInf(arg2->floatval) == -1)
  ------------------
  |  Branch (5601:8): [True: 36, False: 114]
  ------------------
 5602|     36|			    ret = 1;
 5603|    114|			else
 5604|    114|			    ret = 0;
 5605|  40.7k|		    } else if (xmlXPathIsInf(arg2->floatval) == 1) {
  ------------------
  |  Branch (5605:18): [True: 1.52k, False: 39.2k]
  ------------------
 5606|  1.52k|			if (xmlXPathIsInf(arg1->floatval) == 1)
  ------------------
  |  Branch (5606:8): [True: 0, False: 1.52k]
  ------------------
 5607|      0|			    ret = 1;
 5608|  1.52k|			else
 5609|  1.52k|			    ret = 0;
 5610|  39.2k|		    } else if (xmlXPathIsInf(arg2->floatval) == -1) {
  ------------------
  |  Branch (5610:18): [True: 468, False: 38.7k]
  ------------------
 5611|    468|			if (xmlXPathIsInf(arg1->floatval) == -1)
  ------------------
  |  Branch (5611:8): [True: 0, False: 468]
  ------------------
 5612|      0|			    ret = 1;
 5613|    468|			else
 5614|    468|			    ret = 0;
 5615|  38.7k|		    } else {
 5616|  38.7k|		        ret = (arg1->floatval == arg2->floatval);
 5617|  38.7k|		    }
 5618|  46.5k|		    break;
 5619|      0|		case XPATH_USERS:
  ------------------
  |  Branch (5619:3): [True: 0, False: 75.9k]
  ------------------
 5620|       |		    /* TODO */
 5621|      0|		    break;
 5622|      0|		case XPATH_NODESET:
  ------------------
  |  Branch (5622:3): [True: 0, False: 75.9k]
  ------------------
 5623|      0|		case XPATH_XSLT_TREE:
  ------------------
  |  Branch (5623:3): [True: 0, False: 75.9k]
  ------------------
 5624|      0|		    break;
 5625|  75.9k|	    }
 5626|  75.9k|	    break;
 5627|  75.9k|        case XPATH_STRING:
  ------------------
  |  Branch (5627:9): [True: 1.07k, False: 184k]
  ------------------
 5628|  1.07k|	    switch (arg2->type) {
  ------------------
  |  Branch (5628:14): [True: 1.07k, False: 0]
  ------------------
 5629|      0|	        case XPATH_UNDEFINED:
  ------------------
  |  Branch (5629:10): [True: 0, False: 1.07k]
  ------------------
 5630|      0|		    break;
 5631|    174|		case XPATH_BOOLEAN:
  ------------------
  |  Branch (5631:3): [True: 174, False: 903]
  ------------------
 5632|    174|		    if ((arg1->stringval == NULL) ||
  ------------------
  |  Branch (5632:11): [True: 0, False: 174]
  ------------------
 5633|    174|			(arg1->stringval[0] == 0)) ret = 0;
  ------------------
  |  Branch (5633:4): [True: 72, False: 102]
  ------------------
 5634|    102|		    else
 5635|    102|			ret = 1;
 5636|    174|		    ret = (arg2->boolval == ret);
 5637|    174|		    break;
 5638|     75|		case XPATH_STRING:
  ------------------
  |  Branch (5638:3): [True: 75, False: 1.00k]
  ------------------
 5639|     75|		    ret = xmlStrEqual(arg1->stringval, arg2->stringval);
 5640|     75|		    break;
 5641|    828|		case XPATH_NUMBER:
  ------------------
  |  Branch (5641:3): [True: 828, False: 249]
  ------------------
 5642|    828|		    xmlXPathValuePush(ctxt, arg1);
 5643|    828|		    xmlXPathNumberFunction(ctxt, 1);
 5644|    828|		    arg1 = xmlXPathValuePop(ctxt);
 5645|    828|                    if (ctxt->error)
  ------------------
  |  Branch (5645:25): [True: 2, False: 826]
  ------------------
 5646|      2|                        break;
 5647|       |		    /* Hand check NaN and Infinity equalities */
 5648|    826|		    if (xmlXPathIsNaN(arg1->floatval) ||
  ------------------
  |  Branch (5648:11): [True: 520, False: 306]
  ------------------
 5649|    741|			    xmlXPathIsNaN(arg2->floatval)) {
  ------------------
  |  Branch (5649:8): [True: 221, False: 85]
  ------------------
 5650|    741|		        ret = 0;
 5651|    741|		    } else if (xmlXPathIsInf(arg1->floatval) == 1) {
  ------------------
  |  Branch (5651:18): [True: 1, False: 84]
  ------------------
 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|     84|		    } else if (xmlXPathIsInf(arg1->floatval) == -1) {
  ------------------
  |  Branch (5656:18): [True: 0, False: 84]
  ------------------
 5657|      0|			if (xmlXPathIsInf(arg2->floatval) == -1)
  ------------------
  |  Branch (5657:8): [True: 0, False: 0]
  ------------------
 5658|      0|			    ret = 1;
 5659|      0|			else
 5660|      0|			    ret = 0;
 5661|     84|		    } else if (xmlXPathIsInf(arg2->floatval) == 1) {
  ------------------
  |  Branch (5661:18): [True: 10, False: 74]
  ------------------
 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|     74|		    } else if (xmlXPathIsInf(arg2->floatval) == -1) {
  ------------------
  |  Branch (5666:18): [True: 1, False: 73]
  ------------------
 5667|      1|			if (xmlXPathIsInf(arg1->floatval) == -1)
  ------------------
  |  Branch (5667:8): [True: 0, False: 1]
  ------------------
 5668|      0|			    ret = 1;
 5669|      1|			else
 5670|      1|			    ret = 0;
 5671|     73|		    } else {
 5672|     73|		        ret = (arg1->floatval == arg2->floatval);
 5673|     73|		    }
 5674|    826|		    break;
 5675|      0|		case XPATH_USERS:
  ------------------
  |  Branch (5675:3): [True: 0, False: 1.07k]
  ------------------
 5676|       |		    /* TODO */
 5677|      0|		    break;
 5678|      0|		case XPATH_NODESET:
  ------------------
  |  Branch (5678:3): [True: 0, False: 1.07k]
  ------------------
 5679|      0|		case XPATH_XSLT_TREE:
  ------------------
  |  Branch (5679:3): [True: 0, False: 1.07k]
  ------------------
 5680|      0|		    break;
 5681|  1.07k|	    }
 5682|  1.07k|	    break;
 5683|  1.07k|        case XPATH_USERS:
  ------------------
  |  Branch (5683:9): [True: 0, False: 185k]
  ------------------
 5684|       |	    /* TODO */
 5685|      0|	    break;
 5686|      0|	case XPATH_NODESET:
  ------------------
  |  Branch (5686:2): [True: 0, False: 185k]
  ------------------
 5687|      0|	case XPATH_XSLT_TREE:
  ------------------
  |  Branch (5687:2): [True: 0, False: 185k]
  ------------------
 5688|      0|	    break;
 5689|   185k|    }
 5690|   185k|    xmlXPathReleaseObject(ctxt->context, arg1);
 5691|   185k|    xmlXPathReleaseObject(ctxt->context, arg2);
 5692|   185k|    return(ret);
 5693|   185k|}
xpath.c:xmlXPathCompareNodeSets:
 5178|  89.5k|	                xmlXPathObjectPtr arg1, xmlXPathObjectPtr arg2) {
 5179|  89.5k|    int i, j, init = 0;
 5180|  89.5k|    double val1;
 5181|  89.5k|    double *values2;
 5182|  89.5k|    int ret = 0;
 5183|  89.5k|    xmlNodeSetPtr ns1;
 5184|  89.5k|    xmlNodeSetPtr ns2;
 5185|       |
 5186|  89.5k|    if ((arg1 == NULL) ||
  ------------------
  |  Branch (5186:9): [True: 0, False: 89.5k]
  ------------------
 5187|  89.5k|	((arg1->type != XPATH_NODESET) && (arg1->type != XPATH_XSLT_TREE))) {
  ------------------
  |  Branch (5187:3): [True: 0, False: 89.5k]
  |  Branch (5187:36): [True: 0, False: 0]
  ------------------
 5188|      0|	xmlXPathFreeObject(arg2);
 5189|      0|        return(0);
 5190|      0|    }
 5191|  89.5k|    if ((arg2 == NULL) ||
  ------------------
  |  Branch (5191:9): [True: 0, False: 89.5k]
  ------------------
 5192|  89.5k|	((arg2->type != XPATH_NODESET) && (arg2->type != XPATH_XSLT_TREE))) {
  ------------------
  |  Branch (5192:3): [True: 0, False: 89.5k]
  |  Branch (5192:36): [True: 0, False: 0]
  ------------------
 5193|      0|	xmlXPathFreeObject(arg1);
 5194|      0|	xmlXPathFreeObject(arg2);
 5195|      0|        return(0);
 5196|      0|    }
 5197|       |
 5198|  89.5k|    ns1 = arg1->nodesetval;
 5199|  89.5k|    ns2 = arg2->nodesetval;
 5200|       |
 5201|  89.5k|    if ((ns1 == NULL) || (ns1->nodeNr <= 0)) {
  ------------------
  |  Branch (5201:9): [True: 0, False: 89.5k]
  |  Branch (5201:26): [True: 60.0k, False: 29.4k]
  ------------------
 5202|  60.0k|	xmlXPathFreeObject(arg1);
 5203|  60.0k|	xmlXPathFreeObject(arg2);
 5204|  60.0k|	return(0);
 5205|  60.0k|    }
 5206|  29.4k|    if ((ns2 == NULL) || (ns2->nodeNr <= 0)) {
  ------------------
  |  Branch (5206:9): [True: 0, False: 29.4k]
  |  Branch (5206:26): [True: 24.3k, False: 5.15k]
  ------------------
 5207|  24.3k|	xmlXPathFreeObject(arg1);
 5208|  24.3k|	xmlXPathFreeObject(arg2);
 5209|  24.3k|	return(0);
 5210|  24.3k|    }
 5211|       |
 5212|  5.15k|    values2 = (double *) xmlMalloc(ns2->nodeNr * sizeof(double));
 5213|  5.15k|    if (values2 == NULL) {
  ------------------
  |  Branch (5213:9): [True: 1, False: 5.15k]
  ------------------
 5214|      1|        xmlXPathPErrMemory(ctxt);
 5215|      1|	xmlXPathFreeObject(arg1);
 5216|      1|	xmlXPathFreeObject(arg2);
 5217|      1|	return(0);
 5218|      1|    }
 5219|  61.8k|    for (i = 0;i < ns1->nodeNr;i++) {
  ------------------
  |  Branch (5219:16): [True: 59.3k, False: 2.47k]
  ------------------
 5220|  59.3k|	val1 = xmlXPathNodeToNumberInternal(ctxt, ns1->nodeTab[i]);
 5221|  59.3k|	if (xmlXPathIsNaN(val1))
  ------------------
  |  Branch (5221:6): [True: 53.5k, False: 5.77k]
  ------------------
 5222|  53.5k|	    continue;
 5223|  58.7k|	for (j = 0;j < ns2->nodeNr;j++) {
  ------------------
  |  Branch (5223:13): [True: 55.6k, False: 3.09k]
  ------------------
 5224|  55.6k|	    if (init == 0) {
  ------------------
  |  Branch (5224:10): [True: 50.1k, False: 5.53k]
  ------------------
 5225|  50.1k|		values2[j] = xmlXPathNodeToNumberInternal(ctxt,
 5226|  50.1k|                                                          ns2->nodeTab[j]);
 5227|  50.1k|	    }
 5228|  55.6k|	    if (xmlXPathIsNaN(values2[j]))
  ------------------
  |  Branch (5228:10): [True: 49.2k, False: 6.42k]
  ------------------
 5229|  49.2k|		continue;
 5230|  6.42k|	    if (inf && strict)
  ------------------
  |  Branch (5230:10): [True: 543, False: 5.88k]
  |  Branch (5230:17): [True: 273, False: 270]
  ------------------
 5231|    273|		ret = (val1 < values2[j]);
 5232|  6.15k|	    else if (inf && !strict)
  ------------------
  |  Branch (5232:15): [True: 270, False: 5.88k]
  |  Branch (5232:22): [True: 270, False: 0]
  ------------------
 5233|    270|		ret = (val1 <= values2[j]);
 5234|  5.88k|	    else if (!inf && strict)
  ------------------
  |  Branch (5234:15): [True: 5.88k, False: 0]
  |  Branch (5234:23): [True: 5.01k, False: 874]
  ------------------
 5235|  5.01k|		ret = (val1 > values2[j]);
 5236|    874|	    else if (!inf && !strict)
  ------------------
  |  Branch (5236:15): [True: 874, False: 0]
  |  Branch (5236:23): [True: 874, False: 0]
  ------------------
 5237|    874|		ret = (val1 >= values2[j]);
 5238|  6.42k|	    if (ret)
  ------------------
  |  Branch (5238:10): [True: 2.67k, False: 3.74k]
  ------------------
 5239|  2.67k|		break;
 5240|  6.42k|	}
 5241|  5.77k|	if (ret)
  ------------------
  |  Branch (5241:6): [True: 2.67k, False: 3.09k]
  ------------------
 5242|  2.67k|	    break;
 5243|  3.09k|	init = 1;
 5244|  3.09k|    }
 5245|  5.15k|    xmlFree(values2);
 5246|  5.15k|    xmlXPathFreeObject(arg1);
 5247|  5.15k|    xmlXPathFreeObject(arg2);
 5248|  5.15k|    return(ret);
 5249|  5.15k|}
xpath.c:xmlXPathCompareNodeSetValue:
 5272|  66.0k|	                    xmlXPathObjectPtr arg, xmlXPathObjectPtr val) {
 5273|  66.0k|    if ((val == NULL) || (arg == NULL) ||
  ------------------
  |  Branch (5273:9): [True: 0, False: 66.0k]
  |  Branch (5273:26): [True: 0, False: 66.0k]
  ------------------
 5274|  66.0k|	((arg->type != XPATH_NODESET) && (arg->type != XPATH_XSLT_TREE)))
  ------------------
  |  Branch (5274:3): [True: 0, False: 66.0k]
  |  Branch (5274:35): [True: 0, False: 0]
  ------------------
 5275|      0|        return(0);
 5276|       |
 5277|  66.0k|    switch(val->type) {
 5278|  56.7k|        case XPATH_NUMBER:
  ------------------
  |  Branch (5278:9): [True: 56.7k, False: 9.35k]
  ------------------
 5279|  56.7k|	    return(xmlXPathCompareNodeSetFloat(ctxt, inf, strict, arg, val));
 5280|      0|        case XPATH_NODESET:
  ------------------
  |  Branch (5280:9): [True: 0, False: 66.0k]
  ------------------
 5281|      0|        case XPATH_XSLT_TREE:
  ------------------
  |  Branch (5281:9): [True: 0, False: 66.0k]
  ------------------
 5282|      0|	    return(xmlXPathCompareNodeSets(ctxt, inf, strict, arg, val));
 5283|  1.27k|        case XPATH_STRING:
  ------------------
  |  Branch (5283:9): [True: 1.27k, False: 64.8k]
  ------------------
 5284|  1.27k|	    return(xmlXPathCompareNodeSetString(ctxt, inf, strict, arg, val));
 5285|  8.08k|        case XPATH_BOOLEAN:
  ------------------
  |  Branch (5285:9): [True: 8.08k, False: 57.9k]
  ------------------
 5286|  8.08k|	    xmlXPathValuePush(ctxt, arg);
 5287|  8.08k|	    xmlXPathBooleanFunction(ctxt, 1);
 5288|  8.08k|	    xmlXPathValuePush(ctxt, val);
 5289|  8.08k|	    return(xmlXPathCompareValues(ctxt, inf, strict));
 5290|      0|	default:
  ------------------
  |  Branch (5290:2): [True: 0, False: 66.0k]
  ------------------
 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|  66.0k|    }
 5295|      0|    return(0);
 5296|  66.0k|}
xpath.c:xmlXPathCompareNodeSetFloat:
 5061|  56.7k|	                    xmlXPathObjectPtr arg, xmlXPathObjectPtr f) {
 5062|  56.7k|    int i, ret = 0;
 5063|  56.7k|    xmlNodeSetPtr ns;
 5064|  56.7k|    xmlChar *str2;
 5065|       |
 5066|  56.7k|    if ((f == NULL) || (arg == NULL) ||
  ------------------
  |  Branch (5066:9): [True: 0, False: 56.7k]
  |  Branch (5066:24): [True: 0, False: 56.7k]
  ------------------
 5067|  56.7k|	((arg->type != XPATH_NODESET) && (arg->type != XPATH_XSLT_TREE))) {
  ------------------
  |  Branch (5067:3): [True: 0, False: 56.7k]
  |  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|  56.7k|    ns = arg->nodesetval;
 5073|  56.7k|    if (ns != NULL) {
  ------------------
  |  Branch (5073:9): [True: 56.7k, False: 0]
  ------------------
 5074|   104k|	for (i = 0;i < ns->nodeNr;i++) {
  ------------------
  |  Branch (5074:13): [True: 48.2k, False: 56.0k]
  ------------------
 5075|  48.2k|	     str2 = xmlXPathCastNodeToString(ns->nodeTab[i]);
 5076|  48.2k|	     if (str2 != NULL) {
  ------------------
  |  Branch (5076:11): [True: 48.2k, False: 5]
  ------------------
 5077|  48.2k|		 xmlXPathValuePush(ctxt, xmlXPathCacheNewString(ctxt, str2));
 5078|  48.2k|		 xmlFree(str2);
 5079|  48.2k|		 xmlXPathNumberFunction(ctxt, 1);
 5080|  48.2k|		 xmlXPathValuePush(ctxt, xmlXPathCacheObjectCopy(ctxt, f));
 5081|  48.2k|		 ret = xmlXPathCompareValues(ctxt, inf, strict);
 5082|  48.2k|		 if (ret)
  ------------------
  |  Branch (5082:8): [True: 683, False: 47.5k]
  ------------------
 5083|    683|		     break;
 5084|  48.2k|	     } else {
 5085|      5|                 xmlXPathPErrMemory(ctxt);
 5086|      5|             }
 5087|  48.2k|	}
 5088|  56.7k|    }
 5089|  56.7k|    xmlXPathReleaseObject(ctxt->context, arg);
 5090|  56.7k|    xmlXPathReleaseObject(ctxt->context, f);
 5091|  56.7k|    return(ret);
 5092|  56.7k|}
xpath.c:xmlXPathCacheObjectCopy:
 1881|   242k|{
 1882|   242k|    xmlXPathObjectPtr ret;
 1883|   242k|    xmlXPathContextPtr ctxt = pctxt->context;
 1884|       |
 1885|   242k|    if (val == NULL)
  ------------------
  |  Branch (1885:9): [True: 0, False: 242k]
  ------------------
 1886|      0|	return(NULL);
 1887|       |
 1888|   242k|    if ((ctxt != NULL) && (ctxt->cache != NULL)) {
  ------------------
  |  Branch (1888:9): [True: 242k, False: 0]
  |  Branch (1888:27): [True: 0, False: 242k]
  ------------------
 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|   242k|    ret = xmlXPathObjectCopy(val);
 1911|   242k|    if (ret == NULL)
  ------------------
  |  Branch (1911:9): [True: 71, False: 242k]
  ------------------
 1912|     71|        xmlXPathPErrMemory(pctxt);
 1913|   242k|    return(ret);
 1914|   242k|}
xpath.c:xmlXPathCompareNodeSetString:
 5115|  1.27k|	                    xmlXPathObjectPtr arg, xmlXPathObjectPtr s) {
 5116|  1.27k|    int i, ret = 0;
 5117|  1.27k|    xmlNodeSetPtr ns;
 5118|  1.27k|    xmlChar *str2;
 5119|       |
 5120|  1.27k|    if ((s == NULL) || (arg == NULL) ||
  ------------------
  |  Branch (5120:9): [True: 0, False: 1.27k]
  |  Branch (5120:24): [True: 0, False: 1.27k]
  ------------------
 5121|  1.27k|	((arg->type != XPATH_NODESET) && (arg->type != XPATH_XSLT_TREE))) {
  ------------------
  |  Branch (5121:3): [True: 0, False: 1.27k]
  |  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.27k|    ns = arg->nodesetval;
 5127|  1.27k|    if (ns != NULL) {
  ------------------
  |  Branch (5127:9): [True: 1.27k, False: 0]
  ------------------
 5128|  2.50k|	for (i = 0;i < ns->nodeNr;i++) {
  ------------------
  |  Branch (5128:13): [True: 1.23k, False: 1.27k]
  ------------------
 5129|  1.23k|	     str2 = xmlXPathCastNodeToString(ns->nodeTab[i]);
 5130|  1.23k|	     if (str2 != NULL) {
  ------------------
  |  Branch (5130:11): [True: 1.23k, False: 1]
  ------------------
 5131|  1.23k|		 xmlXPathValuePush(ctxt,
 5132|  1.23k|			   xmlXPathCacheNewString(ctxt, str2));
 5133|  1.23k|		 xmlFree(str2);
 5134|  1.23k|		 xmlXPathValuePush(ctxt, xmlXPathCacheObjectCopy(ctxt, s));
 5135|  1.23k|		 ret = xmlXPathCompareValues(ctxt, inf, strict);
 5136|  1.23k|		 if (ret)
  ------------------
  |  Branch (5136:8): [True: 0, False: 1.23k]
  ------------------
 5137|      0|		     break;
 5138|  1.23k|	     } else {
 5139|      1|                 xmlXPathPErrMemory(ctxt);
 5140|      1|             }
 5141|  1.23k|	}
 5142|  1.27k|    }
 5143|  1.27k|    xmlXPathReleaseObject(ctxt->context, arg);
 5144|  1.27k|    xmlXPathReleaseObject(ctxt->context, s);
 5145|  1.27k|    return(ret);
 5146|  1.27k|}
xpath.c:xmlXPathCacheNewNodeSet:
 1689|  1.11M|{
 1690|  1.11M|    xmlXPathObjectPtr ret;
 1691|  1.11M|    xmlXPathContextPtr ctxt = pctxt->context;
 1692|       |
 1693|  1.11M|    if ((ctxt != NULL) && (ctxt->cache != NULL)) {
  ------------------
  |  Branch (1693:9): [True: 1.11M, False: 0]
  |  Branch (1693:27): [True: 0, False: 1.11M]
  ------------------
 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.11M|    ret = xmlXPathNewNodeSet(val);
 1741|  1.11M|    if (ret == NULL)
  ------------------
  |  Branch (1741:9): [True: 352, False: 1.10M]
  ------------------
 1742|    352|        xmlXPathPErrMemory(pctxt);
 1743|  1.11M|    return(ret);
 1744|  1.11M|}
xpath.c:xmlXPathCacheNewFloat:
 1847|   353k|{
 1848|   353k|    xmlXPathObjectPtr ret;
 1849|   353k|    xmlXPathContextPtr ctxt = pctxt->context;
 1850|       |
 1851|   353k|    if ((ctxt != NULL) && (ctxt->cache != NULL)) {
  ------------------
  |  Branch (1851:9): [True: 353k, False: 0]
  |  Branch (1851:27): [True: 0, False: 353k]
  ------------------
 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|   353k|    ret = xmlXPathNewFloat(val);
 1866|   353k|    if (ret == NULL)
  ------------------
  |  Branch (1866:9): [True: 107, False: 353k]
  ------------------
 1867|    107|        xmlXPathPErrMemory(pctxt);
 1868|   353k|    return(ret);
 1869|   353k|}
xpath.c:xmlXPathGetElementsByIds:
 6976|  10.1k|xmlXPathGetElementsByIds (xmlDocPtr doc, const xmlChar *ids) {
 6977|  10.1k|    xmlNodeSetPtr ret;
 6978|  10.1k|    const xmlChar *cur = ids;
 6979|  10.1k|    xmlChar *ID;
 6980|  10.1k|    xmlAttrPtr attr;
 6981|  10.1k|    xmlNodePtr elem = NULL;
 6982|       |
 6983|  10.1k|    if (ids == NULL) return(NULL);
  ------------------
  |  Branch (6983:9): [True: 16, False: 10.1k]
  ------------------
 6984|       |
 6985|  10.1k|    ret = xmlXPathNodeSetCreate(NULL);
 6986|  10.1k|    if (ret == NULL)
  ------------------
  |  Branch (6986:9): [True: 7, False: 10.1k]
  ------------------
 6987|      7|        return(ret);
 6988|       |
 6989|  10.1k|    while (IS_BLANK_CH(*cur)) cur++;
 6990|  25.6k|    while (*cur != 0) {
  ------------------
  |  Branch (6990:12): [True: 15.5k, False: 10.1k]
  ------------------
 6991|   167k|	while ((!IS_BLANK_CH(*cur)) && (*cur != 0))
  ------------------
  |  |  137|   167k|#define IS_BLANK_CH(c)  xmlIsBlank_ch(c)
  |  |  ------------------
  |  |  |  |   90|   167k|#define xmlIsBlank_ch(c)	(((c) == 0x20) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (90:27): [True: 5.30k, False: 162k]
  |  |  |  |  ------------------
  |  |  |  |   91|   167k|				 ((0x9 <= (c)) && ((c) <= 0xa)) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (91:7): [True: 153k, False: 9.32k]
  |  |  |  |  |  Branch (91:23): [True: 598, False: 152k]
  |  |  |  |  ------------------
  |  |  |  |   92|   167k|				 ((c) == 0xd))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (92:6): [True: 307, False: 161k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (6991:33): [True: 152k, False: 9.32k]
  ------------------
 6992|   152k|	    cur++;
 6993|       |
 6994|  15.5k|        ID = xmlStrndup(ids, cur - ids);
 6995|  15.5k|	if (ID == NULL) {
  ------------------
  |  Branch (6995:6): [True: 24, False: 15.5k]
  ------------------
 6996|     24|            xmlXPathFreeNodeSet(ret);
 6997|     24|            return(NULL);
 6998|     24|        }
 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|  15.5k|        attr = xmlGetID(doc, ID);
 7007|  15.5k|        xmlFree(ID);
 7008|  15.5k|        if (attr != NULL) {
  ------------------
  |  Branch (7008:13): [True: 1.08k, False: 14.4k]
  ------------------
 7009|  1.08k|            if (attr->type == XML_ATTRIBUTE_NODE)
  ------------------
  |  Branch (7009:17): [True: 1.08k, False: 0]
  ------------------
 7010|  1.08k|                elem = attr->parent;
 7011|      0|            else if (attr->type == XML_ELEMENT_NODE)
  ------------------
  |  Branch (7011:22): [True: 0, False: 0]
  ------------------
 7012|      0|                elem = (xmlNodePtr) attr;
 7013|      0|            else
 7014|      0|                elem = NULL;
 7015|  1.08k|            if (elem != NULL) {
  ------------------
  |  Branch (7015:17): [True: 1.08k, False: 0]
  ------------------
 7016|  1.08k|                if (xmlXPathNodeSetAdd(ret, elem) < 0) {
  ------------------
  |  Branch (7016:21): [True: 1, False: 1.08k]
  ------------------
 7017|      1|                    xmlXPathFreeNodeSet(ret);
 7018|      1|                    return(NULL);
 7019|      1|                }
 7020|  1.08k|            }
 7021|  1.08k|        }
 7022|       |
 7023|  16.7k|	while (IS_BLANK_CH(*cur)) cur++;
 7024|  15.5k|	ids = cur;
 7025|  15.5k|    }
 7026|  10.1k|    return(ret);
 7027|  10.1k|}
xpath.c:xmlXPathCacheWrapNodeSet:
 1620|  1.00M|{
 1621|  1.00M|    xmlXPathObjectPtr ret;
 1622|  1.00M|    xmlXPathContextPtr ctxt = pctxt->context;
 1623|       |
 1624|  1.00M|    if ((ctxt != NULL) && (ctxt->cache != NULL)) {
  ------------------
  |  Branch (1624:9): [True: 1.00M, False: 0]
  |  Branch (1624:27): [True: 0, False: 1.00M]
  ------------------
 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.00M|    ret = xmlXPathWrapNodeSet(val);
 1640|  1.00M|    if (ret == NULL)
  ------------------
  |  Branch (1640:9): [True: 159, False: 1.00M]
  ------------------
 1641|    159|        xmlXPathPErrMemory(pctxt);
 1642|  1.00M|    return(ret);
 1643|  1.00M|}
xpath.c:xmlXPathCacheNewCString:
 1799|  5.34k|{
 1800|  5.34k|    return xmlXPathCacheNewString(pctxt, BAD_CAST val);
  ------------------
  |  |   34|  5.34k|#define BAD_CAST (xmlChar *)
  ------------------
 1801|  5.34k|}
xpath.c:xmlXPathCacheNewString:
 1756|   101k|{
 1757|   101k|    xmlXPathObjectPtr ret;
 1758|   101k|    xmlXPathContextPtr ctxt = pctxt->context;
 1759|       |
 1760|   101k|    if ((ctxt != NULL) && (ctxt->cache != NULL)) {
  ------------------
  |  Branch (1760:9): [True: 101k, False: 0]
  |  Branch (1760:27): [True: 0, False: 101k]
  ------------------
 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|   101k|    ret = xmlXPathNewString(val);
 1784|   101k|    if (ret == NULL)
  ------------------
  |  Branch (1784:9): [True: 40, False: 101k]
  ------------------
 1785|     40|        xmlXPathPErrMemory(pctxt);
 1786|   101k|    return(ret);
 1787|   101k|}
xpath.c:xmlXPathCacheWrapString:
 1655|  45.2k|{
 1656|  45.2k|    xmlXPathObjectPtr ret;
 1657|  45.2k|    xmlXPathContextPtr ctxt = pctxt->context;
 1658|       |
 1659|  45.2k|    if ((ctxt != NULL) && (ctxt->cache != NULL)) {
  ------------------
  |  Branch (1659:9): [True: 45.2k, False: 0]
  |  Branch (1659:27): [True: 0, False: 45.2k]
  ------------------
 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|  45.2k|    ret = xmlXPathWrapString(val);
 1673|  45.2k|    if (ret == NULL)
  ------------------
  |  Branch (1673:9): [True: 33, False: 45.2k]
  ------------------
 1674|     33|        xmlXPathPErrMemory(pctxt);
 1675|  45.2k|    return(ret);
 1676|  45.2k|}
xpath.c:xmlXPathCacheNewBoolean:
 1813|   517k|{
 1814|   517k|    xmlXPathObjectPtr ret;
 1815|   517k|    xmlXPathContextPtr ctxt = pctxt->context;
 1816|       |
 1817|   517k|    if ((ctxt != NULL) && (ctxt->cache != NULL)) {
  ------------------
  |  Branch (1817:9): [True: 517k, False: 0]
  |  Branch (1817:27): [True: 0, False: 517k]
  ------------------
 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|   517k|    ret = xmlXPathNewBoolean(val);
 1832|   517k|    if (ret == NULL)
  ------------------
  |  Branch (1832:9): [True: 79, False: 517k]
  ------------------
 1833|     79|        xmlXPathPErrMemory(pctxt);
 1834|   517k|    return(ret);
 1835|   517k|}
xpath.c:xmlXPathCheckOpLimit:
  803|  11.8M|xmlXPathCheckOpLimit(xmlXPathParserContextPtr ctxt, unsigned long opCount) {
  804|  11.8M|    xmlXPathContextPtr xpctxt = ctxt->context;
  805|       |
  806|  11.8M|    if ((opCount > xpctxt->opLimit) ||
  ------------------
  |  Branch (806:9): [True: 0, False: 11.8M]
  ------------------
  807|  11.8M|        (xpctxt->opCount > xpctxt->opLimit - opCount)) {
  ------------------
  |  Branch (807:9): [True: 99, False: 11.8M]
  ------------------
  808|     99|        xpctxt->opCount = xpctxt->opLimit;
  809|     99|        xmlXPathErr(ctxt, XPATH_OP_LIMIT_EXCEEDED);
  810|     99|        return(-1);
  811|     99|    }
  812|       |
  813|  11.8M|    xpctxt->opCount += opCount;
  814|  11.8M|    return(0);
  815|  11.8M|}
xpath.c:xmlXPathCompileExpr:
 9088|  42.9k|xmlXPathCompileExpr(xmlXPathParserContextPtr ctxt, int sort) {
 9089|  42.9k|    xmlXPathContextPtr xpctxt = ctxt->context;
 9090|       |
 9091|  42.9k|    if (xpctxt != NULL) {
  ------------------
  |  Branch (9091:9): [True: 42.9k, False: 0]
  ------------------
 9092|  42.9k|        if (xpctxt->depth >= XPATH_MAX_RECURSION_DEPTH)
  ------------------
  |  |  112|  42.9k|#define XPATH_MAX_RECURSION_DEPTH 500
  ------------------
  |  Branch (9092:13): [True: 660, False: 42.2k]
  ------------------
 9093|  42.2k|            XP_ERROR(XPATH_RECURSION_LIMIT_EXCEEDED);
  ------------------
  |  |  244|    660|    { xmlXPathErr(ctxt, X); return; }
  ------------------
 9094|       |        /*
 9095|       |         * Parsing a single '(' pushes about 10 functions on the call stack
 9096|       |         * before recursing!
 9097|       |         */
 9098|  42.2k|        xpctxt->depth += 10;
 9099|  42.2k|    }
 9100|       |
 9101|  42.2k|    xmlXPathCompAndExpr(ctxt);
 9102|  42.2k|    CHECK_ERROR;
  ------------------
  |  |  230|  42.2k|    if (ctxt->error != XPATH_EXPRESSION_OK) return
  |  |  ------------------
  |  |  |  Branch (230:9): [True: 4.53k, False: 37.7k]
  |  |  ------------------
  ------------------
 9103|  37.7k|    SKIP_BLANKS;
  ------------------
  |  | 2199|  37.7k|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  | 2202|  42.2k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2202:15): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 9104|  39.6k|    while ((CUR == 'o') && (NXT(1) == 'r')) {
  ------------------
  |  | 2193|  39.6k|#define CUR (*ctxt->cur)
  ------------------
                  while ((CUR == 'o') && (NXT(1) == 'r')) {
  ------------------
  |  | 2195|  2.03k|#define NXT(val) ctxt->cur[(val)]
  ------------------
  |  Branch (9104:12): [True: 2.03k, False: 37.5k]
  |  Branch (9104:28): [True: 2.02k, False: 3]
  ------------------
 9105|  2.02k|	int op1 = ctxt->comp->last;
 9106|  2.02k|        SKIP(2);
  ------------------
  |  | 2194|  2.02k|#define SKIP(val) ctxt->cur += (val)
  ------------------
 9107|  2.02k|	SKIP_BLANKS;
  ------------------
  |  | 2199|  2.02k|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  | 2202|  1.85k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2202:15): [True: 1.85k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 9108|  2.02k|        xmlXPathCompAndExpr(ctxt);
 9109|  2.02k|	CHECK_ERROR;
  ------------------
  |  |  230|  2.02k|    if (ctxt->error != XPATH_EXPRESSION_OK) return
  |  |  ------------------
  |  |  |  Branch (230:9): [True: 130, False: 1.89k]
  |  |  ------------------
  ------------------
 9110|  1.89k|	PUSH_BINARY_EXPR(XPATH_OP_OR, op1, ctxt->comp->last, 0, 0);
  ------------------
  |  | 1094|  1.89k|#define PUSH_BINARY_EXPR(op, ch1, ch2, val, val2)			\
  |  | 1095|  1.89k|xmlXPathCompExprAdd(ctxt, (ch1), (ch2), (op),			\
  |  | 1096|  1.89k|			(val), (val2), 0 ,NULL ,NULL)
  ------------------
 9111|  1.89k|	SKIP_BLANKS;
  ------------------
  |  | 2199|  1.89k|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  | 2202|  1.89k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2202:15): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 9112|  1.89k|    }
 9113|  37.6k|    if ((sort) && (ctxt->comp->steps[ctxt->comp->last].op != XPATH_OP_VALUE)) {
  ------------------
  |  Branch (9113:9): [True: 31.7k, False: 5.82k]
  |  Branch (9113:19): [True: 22.2k, False: 9.54k]
  ------------------
 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|  22.2k|	PUSH_UNARY_EXPR(XPATH_OP_SORT, ctxt->comp->last , 0, 0);
  ------------------
  |  | 1091|  22.2k|#define PUSH_UNARY_EXPR(op, ch, val, val2)				\
  |  | 1092|  22.2k|xmlXPathCompExprAdd(ctxt, (ch), -1, (op), (val), (val2), 0 ,NULL ,NULL)
  ------------------
 9121|  22.2k|    }
 9122|       |
 9123|  37.6k|    if (xpctxt != NULL)
  ------------------
  |  Branch (9123:9): [True: 37.6k, False: 0]
  ------------------
 9124|  37.6k|        xpctxt->depth -= 10;
 9125|  37.6k|}
xpath.c:xmlXPathCompAndExpr:
 9062|  44.2k|xmlXPathCompAndExpr(xmlXPathParserContextPtr ctxt) {
 9063|  44.2k|    xmlXPathCompEqualityExpr(ctxt);
 9064|  44.2k|    CHECK_ERROR;
  ------------------
  |  |  230|  44.2k|    if (ctxt->error != XPATH_EXPRESSION_OK) return
  |  |  ------------------
  |  |  |  Branch (230:9): [True: 4.61k, False: 39.6k]
  |  |  ------------------
  ------------------
 9065|  39.6k|    SKIP_BLANKS;
  ------------------
  |  | 2199|  39.6k|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  | 2202|  44.2k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2202:15): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 9066|  39.8k|    while ((CUR == 'a') && (NXT(1) == 'n') && (NXT(2) == 'd')) {
  ------------------
  |  | 2193|  39.8k|#define CUR (*ctxt->cur)
  ------------------
                  while ((CUR == 'a') && (NXT(1) == 'n') && (NXT(2) == 'd')) {
  ------------------
  |  | 2195|    296|#define NXT(val) ctxt->cur[(val)]
  ------------------
                  while ((CUR == 'a') && (NXT(1) == 'n') && (NXT(2) == 'd')) {
  ------------------
  |  | 2195|    264|#define NXT(val) ctxt->cur[(val)]
  ------------------
  |  Branch (9066:12): [True: 296, False: 39.5k]
  |  Branch (9066:28): [True: 264, False: 32]
  |  Branch (9066:47): [True: 260, False: 4]
  ------------------
 9067|    260|	int op1 = ctxt->comp->last;
 9068|    260|        SKIP(3);
  ------------------
  |  | 2194|    260|#define SKIP(val) ctxt->cur += (val)
  ------------------
 9069|    260|	SKIP_BLANKS;
  ------------------
  |  | 2199|  1.94k|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  | 2202|  1.94k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2202:15): [True: 1.94k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 9070|    260|        xmlXPathCompEqualityExpr(ctxt);
 9071|    260|	CHECK_ERROR;
  ------------------
  |  |  230|    260|    if (ctxt->error != XPATH_EXPRESSION_OK) return
  |  |  ------------------
  |  |  |  Branch (230:9): [True: 44, False: 216]
  |  |  ------------------
  ------------------
 9072|    216|	PUSH_BINARY_EXPR(XPATH_OP_AND, op1, ctxt->comp->last, 0, 0);
  ------------------
  |  | 1094|    216|#define PUSH_BINARY_EXPR(op, ch1, ch2, val, val2)			\
  |  | 1095|    216|xmlXPathCompExprAdd(ctxt, (ch1), (ch2), (op),			\
  |  | 1096|    216|			(val), (val2), 0 ,NULL ,NULL)
  ------------------
 9073|    216|	SKIP_BLANKS;
  ------------------
  |  | 2199|    216|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  | 2202|    216|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2202:15): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 9074|    216|    }
 9075|  39.6k|}
xpath.c:xmlXPathCompEqualityExpr:
 9033|  44.5k|xmlXPathCompEqualityExpr(xmlXPathParserContextPtr ctxt) {
 9034|  44.5k|    xmlXPathCompRelationalExpr(ctxt);
 9035|  44.5k|    CHECK_ERROR;
  ------------------
  |  |  230|  44.5k|    if (ctxt->error != XPATH_EXPRESSION_OK) return
  |  |  ------------------
  |  |  |  Branch (230:9): [True: 4.00k, False: 40.5k]
  |  |  ------------------
  ------------------
 9036|  40.5k|    SKIP_BLANKS;
  ------------------
  |  | 2199|  40.5k|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  | 2202|  44.5k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2202:15): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 9037|  74.4k|    while ((CUR == '=') || ((CUR == '!') && (NXT(1) == '='))) {
  ------------------
  |  | 2193|  74.4k|#define CUR (*ctxt->cur)
  ------------------
                  while ((CUR == '=') || ((CUR == '!') && (NXT(1) == '='))) {
  ------------------
  |  | 2193|  41.0k|#define CUR (*ctxt->cur)
  ------------------
                  while ((CUR == '=') || ((CUR == '!') && (NXT(1) == '='))) {
  ------------------
  |  | 2195|  1.17k|#define NXT(val) ctxt->cur[(val)]
  ------------------
  |  Branch (9037:12): [True: 33.4k, False: 41.0k]
  |  Branch (9037:29): [True: 1.17k, False: 39.8k]
  |  Branch (9037:45): [True: 1.16k, False: 13]
  ------------------
 9038|  34.5k|	int eq;
 9039|  34.5k|	int op1 = ctxt->comp->last;
 9040|       |
 9041|  34.5k|        if (CUR == '=') eq = 1;
  ------------------
  |  | 2193|  34.5k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (9041:13): [True: 33.4k, False: 1.16k]
  ------------------
 9042|  1.16k|	else eq = 0;
 9043|  34.5k|	NEXT;
  ------------------
  |  | 2202|  34.5k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  ------------------
  |  |  |  Branch (2202:15): [True: 34.5k, False: 0]
  |  |  ------------------
  ------------------
 9044|  34.5k|	if (!eq) NEXT;
  ------------------
  |  | 2202|  1.16k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  ------------------
  |  |  |  Branch (2202:15): [True: 1.16k, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (9044:6): [True: 1.16k, False: 33.4k]
  ------------------
 9045|  34.5k|	SKIP_BLANKS;
  ------------------
  |  | 2199|  68.1k|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  | 2202|  68.1k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2202:15): [True: 68.1k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 9046|  34.5k|        xmlXPathCompRelationalExpr(ctxt);
 9047|  34.5k|	CHECK_ERROR;
  ------------------
  |  |  230|  34.5k|    if (ctxt->error != XPATH_EXPRESSION_OK) return
  |  |  ------------------
  |  |  |  Branch (230:9): [True: 656, False: 33.9k]
  |  |  ------------------
  ------------------
 9048|  33.9k|	PUSH_BINARY_EXPR(XPATH_OP_EQUAL, op1, ctxt->comp->last, eq, 0);
  ------------------
  |  | 1094|  33.9k|#define PUSH_BINARY_EXPR(op, ch1, ch2, val, val2)			\
  |  | 1095|  33.9k|xmlXPathCompExprAdd(ctxt, (ch1), (ch2), (op),			\
  |  | 1096|  33.9k|			(val), (val2), 0 ,NULL ,NULL)
  ------------------
 9049|  33.9k|	SKIP_BLANKS;
  ------------------
  |  | 2199|  33.9k|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  | 2202|  33.9k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2202:15): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 9050|  33.9k|    }
 9051|  40.5k|}
xpath.c:xmlXPathCompRelationalExpr:
 8996|  79.1k|xmlXPathCompRelationalExpr(xmlXPathParserContextPtr ctxt) {
 8997|  79.1k|    xmlXPathCompAdditiveExpr(ctxt);
 8998|  79.1k|    CHECK_ERROR;
  ------------------
  |  |  230|  79.1k|    if (ctxt->error != XPATH_EXPRESSION_OK) return
  |  |  ------------------
  |  |  |  Branch (230:9): [True: 4.04k, False: 75.0k]
  |  |  ------------------
  ------------------
 8999|  75.0k|    SKIP_BLANKS;
  ------------------
  |  | 2199|  75.0k|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  | 2202|  79.1k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2202:15): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 9000|  95.1k|    while ((CUR == '<') || (CUR == '>')) {
  ------------------
  |  | 2193|  95.1k|#define CUR (*ctxt->cur)
  ------------------
                  while ((CUR == '<') || (CUR == '>')) {
  ------------------
  |  | 2193|  91.0k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (9000:12): [True: 4.17k, False: 91.0k]
  |  Branch (9000:28): [True: 16.5k, False: 74.4k]
  ------------------
 9001|  20.7k|	int inf, strict;
 9002|  20.7k|	int op1 = ctxt->comp->last;
 9003|       |
 9004|  20.7k|        if (CUR == '<') inf = 1;
  ------------------
  |  | 2193|  20.7k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (9004:13): [True: 4.17k, False: 16.5k]
  ------------------
 9005|  16.5k|	else inf = 0;
 9006|  20.7k|	if (NXT(1) == '=') strict = 0;
  ------------------
  |  | 2195|  20.7k|#define NXT(val) ctxt->cur[(val)]
  ------------------
  |  Branch (9006:6): [True: 4.10k, False: 16.6k]
  ------------------
 9007|  16.6k|	else strict = 1;
 9008|  20.7k|	NEXT;
  ------------------
  |  | 2202|  20.7k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  ------------------
  |  |  |  Branch (2202:15): [True: 20.7k, False: 0]
  |  |  ------------------
  ------------------
 9009|  20.7k|	if (!strict) NEXT;
  ------------------
  |  | 2202|  4.10k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  ------------------
  |  |  |  Branch (2202:15): [True: 4.10k, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (9009:6): [True: 4.10k, False: 16.6k]
  ------------------
 9010|  20.7k|	SKIP_BLANKS;
  ------------------
  |  | 2199|  20.7k|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  | 2202|  3.78k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2202:15): [True: 3.78k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 9011|  20.7k|        xmlXPathCompAdditiveExpr(ctxt);
 9012|  20.7k|	CHECK_ERROR;
  ------------------
  |  |  230|  20.7k|    if (ctxt->error != XPATH_EXPRESSION_OK) return
  |  |  ------------------
  |  |  |  Branch (230:9): [True: 612, False: 20.1k]
  |  |  ------------------
  ------------------
 9013|  20.1k|	PUSH_BINARY_EXPR(XPATH_OP_CMP, op1, ctxt->comp->last, inf, strict);
  ------------------
  |  | 1094|  20.1k|#define PUSH_BINARY_EXPR(op, ch1, ch2, val, val2)			\
  |  | 1095|  20.1k|xmlXPathCompExprAdd(ctxt, (ch1), (ch2), (op),			\
  |  | 1096|  20.1k|			(val), (val2), 0 ,NULL ,NULL)
  ------------------
 9014|  20.1k|	SKIP_BLANKS;
  ------------------
  |  | 2199|  20.1k|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  | 2202|  20.1k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2202:15): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 9015|  20.1k|    }
 9016|  75.0k|}
xpath.c:xmlXPathCompAdditiveExpr:
 8958|  99.8k|xmlXPathCompAdditiveExpr(xmlXPathParserContextPtr ctxt) {
 8959|       |
 8960|  99.8k|    xmlXPathCompMultiplicativeExpr(ctxt);
 8961|  99.8k|    CHECK_ERROR;
  ------------------
  |  |  230|  99.8k|    if (ctxt->error != XPATH_EXPRESSION_OK) return
  |  |  ------------------
  |  |  |  Branch (230:9): [True: 3.99k, False: 95.8k]
  |  |  ------------------
  ------------------
 8962|  95.8k|    SKIP_BLANKS;
  ------------------
  |  | 2199|  95.8k|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  | 2202|  99.8k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2202:15): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 8963|   135k|    while ((CUR == '+') || (CUR == '-')) {
  ------------------
  |  | 2193|   135k|#define CUR (*ctxt->cur)
  ------------------
                  while ((CUR == '+') || (CUR == '-')) {
  ------------------
  |  | 2193|   130k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (8963:12): [True: 4.75k, False: 130k]
  |  Branch (8963:28): [True: 35.4k, False: 95.1k]
  ------------------
 8964|  40.1k|	int plus;
 8965|  40.1k|	int op1 = ctxt->comp->last;
 8966|       |
 8967|  40.1k|        if (CUR == '+') plus = 1;
  ------------------
  |  | 2193|  40.1k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (8967:13): [True: 4.75k, False: 35.4k]
  ------------------
 8968|  35.4k|	else plus = 0;
 8969|  40.1k|	NEXT;
  ------------------
  |  | 2202|  40.1k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  ------------------
  |  |  |  Branch (2202:15): [True: 40.1k, False: 0]
  |  |  ------------------
  ------------------
 8970|  40.1k|	SKIP_BLANKS;
  ------------------
  |  | 2199|  40.1k|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  | 2202|  3.70k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2202:15): [True: 3.70k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 8971|  40.1k|        xmlXPathCompMultiplicativeExpr(ctxt);
 8972|  40.1k|	CHECK_ERROR;
  ------------------
  |  |  230|  40.1k|    if (ctxt->error != XPATH_EXPRESSION_OK) return
  |  |  ------------------
  |  |  |  Branch (230:9): [True: 668, False: 39.5k]
  |  |  ------------------
  ------------------
 8973|  39.5k|	PUSH_BINARY_EXPR(XPATH_OP_PLUS, op1, ctxt->comp->last, plus, 0);
  ------------------
  |  | 1094|  39.5k|#define PUSH_BINARY_EXPR(op, ch1, ch2, val, val2)			\
  |  | 1095|  39.5k|xmlXPathCompExprAdd(ctxt, (ch1), (ch2), (op),			\
  |  | 1096|  39.5k|			(val), (val2), 0 ,NULL ,NULL)
  ------------------
 8974|  39.5k|	SKIP_BLANKS;
  ------------------
  |  | 2199|  39.5k|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  | 2202|  39.5k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2202:15): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 8975|  39.5k|    }
 8976|  95.8k|}
xpath.c:xmlXPathCompMultiplicativeExpr:
 8919|   140k|xmlXPathCompMultiplicativeExpr(xmlXPathParserContextPtr ctxt) {
 8920|   140k|    xmlXPathCompUnaryExpr(ctxt);
 8921|   140k|    CHECK_ERROR;
  ------------------
  |  |  230|   140k|    if (ctxt->error != XPATH_EXPRESSION_OK) return
  |  |  ------------------
  |  |  |  Branch (230:9): [True: 4.29k, False: 135k]
  |  |  ------------------
  ------------------
 8922|   135k|    SKIP_BLANKS;
  ------------------
  |  | 2199|   135k|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  | 2202|   140k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2202:15): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 8923|   967k|    while ((CUR == '*') ||
  ------------------
  |  | 2193|   967k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (8923:12): [True: 830k, False: 136k]
  ------------------
 8924|   136k|           ((CUR == 'd') && (NXT(1) == 'i') && (NXT(2) == 'v')) ||
  ------------------
  |  | 2193|   136k|#define CUR (*ctxt->cur)
  ------------------
                         ((CUR == 'd') && (NXT(1) == 'i') && (NXT(2) == 'v')) ||
  ------------------
  |  | 2195|  1.05k|#define NXT(val) ctxt->cur[(val)]
  ------------------
                         ((CUR == 'd') && (NXT(1) == 'i') && (NXT(2) == 'v')) ||
  ------------------
  |  | 2195|  1.03k|#define NXT(val) ctxt->cur[(val)]
  ------------------
  |  Branch (8924:13): [True: 1.05k, False: 135k]
  |  Branch (8924:29): [True: 1.03k, False: 22]
  |  Branch (8924:48): [True: 1.01k, False: 20]
  ------------------
 8925|   832k|           ((CUR == 'm') && (NXT(1) == 'o') && (NXT(2) == 'd'))) {
  ------------------
  |  | 2193|   135k|#define CUR (*ctxt->cur)
  ------------------
                         ((CUR == 'm') && (NXT(1) == 'o') && (NXT(2) == 'd'))) {
  ------------------
  |  | 2195|    121|#define NXT(val) ctxt->cur[(val)]
  ------------------
                         ((CUR == 'm') && (NXT(1) == 'o') && (NXT(2) == 'd'))) {
  ------------------
  |  | 2195|    113|#define NXT(val) ctxt->cur[(val)]
  ------------------
  |  Branch (8925:13): [True: 121, False: 135k]
  |  Branch (8925:29): [True: 113, False: 8]
  |  Branch (8925:48): [True: 109, False: 4]
  ------------------
 8926|   832k|	int op = -1;
 8927|   832k|	int op1 = ctxt->comp->last;
 8928|       |
 8929|   832k|        if (CUR == '*') {
  ------------------
  |  | 2193|   832k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (8929:13): [True: 830k, False: 1.12k]
  ------------------
 8930|   830k|	    op = 0;
 8931|   830k|	    NEXT;
  ------------------
  |  | 2202|   830k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  ------------------
  |  |  |  Branch (2202:15): [True: 830k, False: 0]
  |  |  ------------------
  ------------------
 8932|   830k|	} else if (CUR == 'd') {
  ------------------
  |  | 2193|  1.12k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (8932:13): [True: 1.01k, False: 109]
  ------------------
 8933|  1.01k|	    op = 1;
 8934|  1.01k|	    SKIP(3);
  ------------------
  |  | 2194|  1.01k|#define SKIP(val) ctxt->cur += (val)
  ------------------
 8935|  1.01k|	} else if (CUR == 'm') {
  ------------------
  |  | 2193|    109|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (8935:13): [True: 109, False: 0]
  ------------------
 8936|    109|	    op = 2;
 8937|    109|	    SKIP(3);
  ------------------
  |  | 2194|    109|#define SKIP(val) ctxt->cur += (val)
  ------------------
 8938|    109|	}
 8939|   832k|	SKIP_BLANKS;
  ------------------
  |  | 2199|   832k|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  | 2202|  8.15k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2202:15): [True: 8.15k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 8940|   832k|        xmlXPathCompUnaryExpr(ctxt);
 8941|   832k|	CHECK_ERROR;
  ------------------
  |  |  230|   832k|    if (ctxt->error != XPATH_EXPRESSION_OK) return
  |  |  ------------------
  |  |  |  Branch (230:9): [True: 368, False: 831k]
  |  |  ------------------
  ------------------
 8942|   831k|	PUSH_BINARY_EXPR(XPATH_OP_MULT, op1, ctxt->comp->last, op, 0);
  ------------------
  |  | 1094|   831k|#define PUSH_BINARY_EXPR(op, ch1, ch2, val, val2)			\
  |  | 1095|   831k|xmlXPathCompExprAdd(ctxt, (ch1), (ch2), (op),			\
  |  | 1096|   831k|			(val), (val2), 0 ,NULL ,NULL)
  ------------------
 8943|   831k|	SKIP_BLANKS;
  ------------------
  |  | 2199|   831k|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  | 2202|   831k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2202:15): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 8944|   831k|    }
 8945|   135k|}
xpath.c:xmlXPathCompUnaryExpr:
 8884|   972k|xmlXPathCompUnaryExpr(xmlXPathParserContextPtr ctxt) {
 8885|   972k|    int minus = 0;
 8886|   972k|    int found = 0;
 8887|       |
 8888|   972k|    SKIP_BLANKS;
  ------------------
  |  | 2199|   972k|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  | 2202|  12.1k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2202:15): [True: 12.1k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 8889|  1.03M|    while (CUR == '-') {
  ------------------
  |  | 2193|  1.03M|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (8889:12): [True: 61.5k, False: 972k]
  ------------------
 8890|  61.5k|        minus = 1 - minus;
 8891|  61.5k|	found = 1;
 8892|  61.5k|	NEXT;
  ------------------
  |  | 2202|  61.5k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  ------------------
  |  |  |  Branch (2202:15): [True: 61.5k, False: 0]
  |  |  ------------------
  ------------------
 8893|  61.5k|	SKIP_BLANKS;
  ------------------
  |  | 2199|  61.5k|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  | 2202|  7.32k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2202:15): [True: 7.32k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 8894|  61.5k|    }
 8895|       |
 8896|   972k|    xmlXPathCompUnionExpr(ctxt);
 8897|   972k|    CHECK_ERROR;
  ------------------
  |  |  230|   972k|    if (ctxt->error != XPATH_EXPRESSION_OK) return
  |  |  ------------------
  |  |  |  Branch (230:9): [True: 4.65k, False: 967k]
  |  |  ------------------
  ------------------
 8898|   967k|    if (found) {
  ------------------
  |  Branch (8898:9): [True: 41.6k, False: 925k]
  ------------------
 8899|  41.6k|	if (minus)
  ------------------
  |  Branch (8899:6): [True: 36.3k, False: 5.25k]
  ------------------
 8900|  36.3k|	    PUSH_UNARY_EXPR(XPATH_OP_PLUS, ctxt->comp->last, 2, 0);
  ------------------
  |  | 1091|  36.3k|#define PUSH_UNARY_EXPR(op, ch, val, val2)				\
  |  | 1092|  36.3k|xmlXPathCompExprAdd(ctxt, (ch), -1, (op), (val), (val2), 0 ,NULL ,NULL)
  ------------------
 8901|  5.25k|	else
 8902|       |	    PUSH_UNARY_EXPR(XPATH_OP_PLUS, ctxt->comp->last, 3, 0);
  ------------------
  |  | 1091|  5.25k|#define PUSH_UNARY_EXPR(op, ch, val, val2)				\
  |  | 1092|  5.25k|xmlXPathCompExprAdd(ctxt, (ch), -1, (op), (val), (val2), 0 ,NULL ,NULL)
  ------------------
 8903|  41.6k|    }
 8904|   967k|}
xpath.c:xmlXPathCompUnionExpr:
 8856|   972k|xmlXPathCompUnionExpr(xmlXPathParserContextPtr ctxt) {
 8857|   972k|    xmlXPathCompPathExpr(ctxt);
 8858|   972k|    CHECK_ERROR;
  ------------------
  |  |  230|   972k|    if (ctxt->error != XPATH_EXPRESSION_OK) return
  |  |  ------------------
  |  |  |  Branch (230:9): [True: 4.48k, False: 967k]
  |  |  ------------------
  ------------------
 8859|   967k|    SKIP_BLANKS;
  ------------------
  |  | 2199|   967k|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  | 2202|   972k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2202:15): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 8860|   976k|    while (CUR == '|') {
  ------------------
  |  | 2193|   976k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (8860:12): [True: 8.92k, False: 967k]
  ------------------
 8861|  8.92k|	int op1 = ctxt->comp->last;
 8862|  8.92k|	PUSH_LEAVE_EXPR(XPATH_OP_NODE, 0, 0);
  ------------------
  |  | 1088|  8.92k|#define PUSH_LEAVE_EXPR(op, val, val2)					\
  |  | 1089|  8.92k|xmlXPathCompExprAdd(ctxt, -1, -1, (op), (val), (val2), 0 ,NULL ,NULL)
  ------------------
 8863|       |
 8864|  8.92k|	NEXT;
  ------------------
  |  | 2202|  8.92k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  ------------------
  |  |  |  Branch (2202:15): [True: 8.92k, False: 0]
  |  |  ------------------
  ------------------
 8865|  8.92k|	SKIP_BLANKS;
  ------------------
  |  | 2199|  8.92k|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  | 2202|  3.63k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2202:15): [True: 3.63k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 8866|  8.92k|	xmlXPathCompPathExpr(ctxt);
 8867|       |
 8868|  8.92k|	PUSH_BINARY_EXPR(XPATH_OP_UNION, op1, ctxt->comp->last, 0, 0);
  ------------------
  |  | 1094|  8.92k|#define PUSH_BINARY_EXPR(op, ch1, ch2, val, val2)			\
  |  | 1095|  8.92k|xmlXPathCompExprAdd(ctxt, (ch1), (ch2), (op),			\
  |  | 1096|  8.92k|			(val), (val2), 0 ,NULL ,NULL)
  ------------------
 8869|       |
 8870|  8.92k|	SKIP_BLANKS;
  ------------------
  |  | 2199|  8.92k|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  | 2202|      0|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2202:15): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 8871|  8.92k|    }
 8872|   967k|}
xpath.c:xmlXPathCompPathExpr:
 8734|   981k|xmlXPathCompPathExpr(xmlXPathParserContextPtr ctxt) {
 8735|   981k|    int lc = 1;           /* Should we branch to LocationPath ?         */
 8736|   981k|    xmlChar *name = NULL; /* we may have to preparse a name to find out */
 8737|       |
 8738|   981k|    SKIP_BLANKS;
  ------------------
  |  | 2199|   981k|    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|   981k|    if ((CUR == '$') || (CUR == '(') ||
  ------------------
  |  | 2193|   981k|#define CUR (*ctxt->cur)
  ------------------
                  if ((CUR == '$') || (CUR == '(') ||
  ------------------
  |  | 2193|   980k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (8739:9): [True: 822, False: 980k]
  |  Branch (8739:25): [True: 3.33k, False: 976k]
  ------------------
 8740|   976k|	(IS_ASCII_DIGIT(CUR)) ||
  ------------------
  |  |  230|   976k|#define IS_ASCII_DIGIT(c)	((0x30 <= (c)) && ((c) <= 0x39))
  |  |  ------------------
  |  |  |  Branch (230:28): [True: 95.5k, False: 881k]
  |  |  |  Branch (230:45): [True: 36.1k, False: 59.4k]
  |  |  ------------------
  ------------------
 8741|   940k|        (CUR == '\'') || (CUR == '"') ||
  ------------------
  |  | 2193|   940k|#define CUR (*ctxt->cur)
  ------------------
                      (CUR == '\'') || (CUR == '"') ||
  ------------------
  |  | 2193|   939k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (8741:9): [True: 1.38k, False: 939k]
  |  Branch (8741:26): [True: 120, False: 939k]
  ------------------
 8742|   939k|	(CUR == '.' && IS_ASCII_DIGIT(NXT(1)))) {
  ------------------
  |  | 2193|   939k|#define CUR (*ctxt->cur)
  ------------------
              	(CUR == '.' && IS_ASCII_DIGIT(NXT(1)))) {
  ------------------
  |  |  230|  7.32k|#define IS_ASCII_DIGIT(c)	((0x30 <= (c)) && ((c) <= 0x39))
  |  |  ------------------
  |  |  |  Branch (230:28): [True: 4.69k, False: 2.63k]
  |  |  |  Branch (230:45): [True: 2.73k, False: 1.95k]
  |  |  ------------------
  ------------------
  |  Branch (8742:3): [True: 7.32k, False: 931k]
  ------------------
 8743|  44.5k|	lc = 0;
 8744|   936k|    } else if (CUR == '*') {
  ------------------
  |  | 2193|   936k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (8744:16): [True: 815k, False: 120k]
  ------------------
 8745|       |	/* relative or absolute location path */
 8746|   815k|	lc = 1;
 8747|   815k|    } else if (CUR == '/') {
  ------------------
  |  | 2193|   120k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (8747:16): [True: 56.1k, False: 64.3k]
  ------------------
 8748|       |	/* relative or absolute location path */
 8749|  56.1k|	lc = 1;
 8750|  64.3k|    } else if (CUR == '@') {
  ------------------
  |  | 2193|  64.3k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (8750:16): [True: 501, False: 63.8k]
  ------------------
 8751|       |	/* relative abbreviated attribute location path */
 8752|    501|	lc = 1;
 8753|  63.8k|    } else if (CUR == '.') {
  ------------------
  |  | 2193|  63.8k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (8753:16): [True: 4.58k, False: 59.2k]
  ------------------
 8754|       |	/* relative abbreviated attribute location path */
 8755|  4.58k|	lc = 1;
 8756|  59.2k|    } 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|  59.2k|	SKIP_BLANKS;
  ------------------
  |  | 2199|  59.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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 8769|  59.2k|	name = xmlXPathScanName(ctxt);
 8770|  59.2k|	if ((name != NULL) && (xmlStrstr(name, (xmlChar *) "::") != NULL)) {
  ------------------
  |  Branch (8770:6): [True: 56.7k, False: 2.51k]
  |  Branch (8770:24): [True: 378, False: 56.3k]
  ------------------
 8771|    378|	    lc = 1;
 8772|    378|	    xmlFree(name);
 8773|  58.8k|	} else if (name != NULL) {
  ------------------
  |  Branch (8773:13): [True: 56.3k, False: 2.51k]
  ------------------
 8774|  56.3k|	    int len =xmlStrlen(name);
 8775|       |
 8776|       |
 8777|   566k|	    while (NXT(len) != 0) {
  ------------------
  |  | 2195|   566k|#define NXT(val) ctxt->cur[(val)]
  ------------------
  |  Branch (8777:13): [True: 566k, False: 698]
  ------------------
 8778|   566k|		if (NXT(len) == '/') {
  ------------------
  |  | 2195|   566k|#define NXT(val) ctxt->cur[(val)]
  ------------------
  |  Branch (8778:7): [True: 3.32k, False: 562k]
  ------------------
 8779|       |		    /* element name */
 8780|  3.32k|		    lc = 1;
 8781|  3.32k|		    break;
 8782|   562k|		} else if (IS_BLANK_CH(NXT(len))) {
  ------------------
  |  |  137|   562k|#define IS_BLANK_CH(c)  xmlIsBlank_ch(c)
  |  |  ------------------
  |  |  |  |   90|   562k|#define xmlIsBlank_ch(c)	(((c) == 0x20) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (90:27): [True: 509k, False: 53.6k]
  |  |  |  |  ------------------
  |  |  |  |   91|   562k|				 ((0x9 <= (c)) && ((c) <= 0xa)) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (91:7): [True: 53.6k, False: 1]
  |  |  |  |  |  Branch (91:23): [True: 1.13k, False: 52.4k]
  |  |  |  |  ------------------
  |  |  |  |   92|   562k|				 ((c) == 0xd))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (92:6): [True: 128, False: 52.3k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 8783|       |		    /* ignore blanks */
 8784|   510k|		    ;
 8785|   510k|		} else if (NXT(len) == ':') {
  ------------------
  |  | 2195|  52.3k|#define NXT(val) ctxt->cur[(val)]
  ------------------
  |  Branch (8785:14): [True: 495, False: 51.8k]
  ------------------
 8786|    495|		    lc = 1;
 8787|    495|		    break;
 8788|  51.8k|		} else if ((NXT(len) == '(')) {
  ------------------
  |  | 2195|  51.8k|#define NXT(val) ctxt->cur[(val)]
  ------------------
  |  Branch (8788:14): [True: 10.5k, False: 41.3k]
  ------------------
 8789|       |		    /* Node Type or Function */
 8790|  10.5k|		    if (xmlXPathIsNodeType(name)) {
  ------------------
  |  Branch (8790:11): [True: 196, False: 10.3k]
  ------------------
 8791|    196|			lc = 1;
 8792|  10.3k|		    } else {
 8793|  10.3k|			lc = 0;
 8794|  10.3k|		    }
 8795|  10.5k|                    break;
 8796|  41.3k|		} else if ((NXT(len) == '[')) {
  ------------------
  |  | 2195|  41.3k|#define NXT(val) ctxt->cur[(val)]
  ------------------
  |  Branch (8796:14): [True: 1.16k, False: 40.1k]
  ------------------
 8797|       |		    /* element name */
 8798|  1.16k|		    lc = 1;
 8799|  1.16k|		    break;
 8800|  40.1k|		} else if ((NXT(len) == '<') || (NXT(len) == '>') ||
  ------------------
  |  | 2195|  40.1k|#define NXT(val) ctxt->cur[(val)]
  ------------------
              		} else if ((NXT(len) == '<') || (NXT(len) == '>') ||
  ------------------
  |  | 2195|  39.3k|#define NXT(val) ctxt->cur[(val)]
  ------------------
  |  Branch (8800:14): [True: 835, False: 39.3k]
  |  Branch (8800:35): [True: 6.31k, False: 33.0k]
  ------------------
 8801|  33.0k|			   (NXT(len) == '=')) {
  ------------------
  |  | 2195|  33.0k|#define NXT(val) ctxt->cur[(val)]
  ------------------
  |  Branch (8801:7): [True: 6.32k, False: 26.6k]
  ------------------
 8802|  13.4k|		    lc = 1;
 8803|  13.4k|		    break;
 8804|  26.6k|		} else {
 8805|  26.6k|		    lc = 1;
 8806|  26.6k|		    break;
 8807|  26.6k|		}
 8808|   510k|		len++;
 8809|   510k|	    }
 8810|  56.3k|	    if (NXT(len) == 0) {
  ------------------
  |  | 2195|  56.3k|#define NXT(val) ctxt->cur[(val)]
  ------------------
  |  Branch (8810:10): [True: 698, False: 55.6k]
  ------------------
 8811|       |		/* element name */
 8812|    698|		lc = 1;
 8813|    698|	    }
 8814|  56.3k|	    xmlFree(name);
 8815|  56.3k|	} else {
 8816|       |	    /* make sure all cases are covered explicitly */
 8817|  2.51k|	    XP_ERROR(XPATH_EXPR_ERROR);
  ------------------
  |  |  244|  2.51k|    { xmlXPathErr(ctxt, X); return; }
  ------------------
 8818|      0|	}
 8819|  59.2k|    }
 8820|       |
 8821|   978k|    if (lc) {
  ------------------
  |  Branch (8821:9): [True: 923k, False: 54.8k]
  ------------------
 8822|   923k|	if (CUR == '/') {
  ------------------
  |  | 2193|   923k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (8822:6): [True: 56.1k, False: 867k]
  ------------------
 8823|  56.1k|	    PUSH_LEAVE_EXPR(XPATH_OP_ROOT, 0, 0);
  ------------------
  |  | 1088|  56.1k|#define PUSH_LEAVE_EXPR(op, val, val2)					\
  |  | 1089|  56.1k|xmlXPathCompExprAdd(ctxt, -1, -1, (op), (val), (val2), 0 ,NULL ,NULL)
  ------------------
 8824|   867k|	} else {
 8825|   867k|	    PUSH_LEAVE_EXPR(XPATH_OP_NODE, 0, 0);
  ------------------
  |  | 1088|   867k|#define PUSH_LEAVE_EXPR(op, val, val2)					\
  |  | 1089|   867k|xmlXPathCompExprAdd(ctxt, -1, -1, (op), (val), (val2), 0 ,NULL ,NULL)
  ------------------
 8826|   867k|	}
 8827|   923k|	xmlXPathCompLocationPath(ctxt);
 8828|   923k|    } else {
 8829|  54.8k|	xmlXPathCompFilterExpr(ctxt);
 8830|  54.8k|	CHECK_ERROR;
  ------------------
  |  |  230|  54.8k|    if (ctxt->error != XPATH_EXPRESSION_OK) return
  |  |  ------------------
  |  |  |  Branch (230:9): [True: 1.82k, False: 53.0k]
  |  |  ------------------
  ------------------
 8831|  53.0k|	if ((CUR == '/') && (NXT(1) == '/')) {
  ------------------
  |  | 2193|  53.0k|#define CUR (*ctxt->cur)
  ------------------
              	if ((CUR == '/') && (NXT(1) == '/')) {
  ------------------
  |  | 2195|  2.24k|#define NXT(val) ctxt->cur[(val)]
  ------------------
  |  Branch (8831:6): [True: 2.24k, False: 50.7k]
  |  Branch (8831:22): [True: 670, False: 1.57k]
  ------------------
 8832|    670|	    SKIP(2);
  ------------------
  |  | 2194|    670|#define SKIP(val) ctxt->cur += (val)
  ------------------
 8833|    670|	    SKIP_BLANKS;
  ------------------
  |  | 2199|    827|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  | 2202|    827|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2202:15): [True: 827, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 8834|       |
 8835|    670|	    PUSH_LONG_EXPR(XPATH_OP_COLLECT, AXIS_DESCENDANT_OR_SELF,
  ------------------
  |  | 1085|    670|    xmlXPathCompExprAdd(ctxt, ctxt->comp->last, -1,		\
  |  | 1086|    670|	                (op), (val), (val2), (val3), (val4), (val5))
  ------------------
 8836|    670|		    NODE_TEST_TYPE, NODE_TYPE_NODE, NULL, NULL);
 8837|       |
 8838|    670|	    xmlXPathCompRelativeLocationPath(ctxt);
 8839|  52.3k|	} else if (CUR == '/') {
  ------------------
  |  | 2193|  52.3k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (8839:13): [True: 1.57k, False: 50.7k]
  ------------------
 8840|  1.57k|	    xmlXPathCompRelativeLocationPath(ctxt);
 8841|  1.57k|	}
 8842|  53.0k|    }
 8843|   976k|    SKIP_BLANKS;
  ------------------
  |  | 2199|   976k|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  | 2202|   983k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2202:15): [True: 4.99k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 8844|   976k|}
xpath.c:xmlXPathScanName:
 8705|  59.2k|xmlXPathScanName(xmlXPathParserContextPtr ctxt) {
 8706|  59.2k|    const xmlChar *end;
 8707|  59.2k|    xmlChar *ret;
 8708|       |
 8709|  59.2k|    end = xmlScanName(ctxt->cur, XML_MAX_NAME_LENGTH, 0);
  ------------------
  |  |   65|  59.2k|#define XML_MAX_NAME_LENGTH 50000
  ------------------
 8710|  59.2k|    if (end == NULL) {
  ------------------
  |  Branch (8710:9): [True: 1, False: 59.2k]
  ------------------
 8711|      1|        XP_ERRORNULL(XPATH_EXPR_ERROR);
  ------------------
  |  |  633|      1|    { xmlXPathErr(ctxt, X); return(NULL); }
  ------------------
 8712|      0|    }
 8713|  59.2k|    if (end == ctxt->cur)
  ------------------
  |  Branch (8713:9): [True: 2.45k, False: 56.8k]
  ------------------
 8714|  2.45k|        return(NULL);
 8715|       |
 8716|  56.8k|    ret = xmlStrndup(ctxt->cur, end - ctxt->cur);
 8717|  56.8k|    if (ret == NULL)
  ------------------
  |  Branch (8717:9): [True: 63, False: 56.7k]
  ------------------
 8718|     63|        xmlXPathPErrMemory(ctxt);
 8719|  56.8k|    return(ret);
 8720|  59.2k|}
xpath.c:xmlXPathCompLocationPath:
 9524|   923k|xmlXPathCompLocationPath(xmlXPathParserContextPtr ctxt) {
 9525|   923k|    SKIP_BLANKS;
  ------------------
  |  | 2199|   923k|    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|   923k|    if (CUR != '/') {
  ------------------
  |  | 2193|   923k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (9526:9): [True: 867k, False: 56.1k]
  ------------------
 9527|   867k|        xmlXPathCompRelativeLocationPath(ctxt);
 9528|   867k|    } else {
 9529|   115k|	while (CUR == '/') {
  ------------------
  |  | 2193|   115k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (9529:9): [True: 59.2k, False: 55.9k]
  ------------------
 9530|  59.2k|	    if ((CUR == '/') && (NXT(1) == '/')) {
  ------------------
  |  | 2193|  59.2k|#define CUR (*ctxt->cur)
  ------------------
              	    if ((CUR == '/') && (NXT(1) == '/')) {
  ------------------
  |  | 2195|  59.2k|#define NXT(val) ctxt->cur[(val)]
  ------------------
  |  Branch (9530:10): [True: 59.2k, False: 0]
  |  Branch (9530:26): [True: 9.66k, False: 49.5k]
  ------------------
 9531|  9.66k|		SKIP(2);
  ------------------
  |  | 2194|  9.66k|#define SKIP(val) ctxt->cur += (val)
  ------------------
 9532|  9.66k|		SKIP_BLANKS;
  ------------------
  |  | 2199|  9.66k|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  | 2202|  7.40k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2202:15): [True: 7.40k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 9533|  9.66k|		PUSH_LONG_EXPR(XPATH_OP_COLLECT, AXIS_DESCENDANT_OR_SELF,
  ------------------
  |  | 1085|  9.66k|    xmlXPathCompExprAdd(ctxt, ctxt->comp->last, -1,		\
  |  | 1086|  9.66k|	                (op), (val), (val2), (val3), (val4), (val5))
  ------------------
 9534|  9.66k|			     NODE_TEST_TYPE, NODE_TYPE_NODE, NULL, NULL);
 9535|  9.66k|		xmlXPathCompRelativeLocationPath(ctxt);
 9536|  49.5k|	    } else if (CUR == '/') {
  ------------------
  |  | 2193|  49.5k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (9536:17): [True: 49.5k, False: 0]
  ------------------
 9537|  49.5k|		NEXT;
  ------------------
  |  | 2202|  49.5k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  ------------------
  |  |  |  Branch (2202:15): [True: 49.5k, False: 0]
  |  |  ------------------
  ------------------
 9538|  49.5k|		SKIP_BLANKS;
  ------------------
  |  | 2199|  49.5k|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  | 2202|  35.3k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2202:15): [True: 35.3k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 9539|  49.5k|		if ((CUR != 0) &&
  ------------------
  |  | 2193|  49.5k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (9539:7): [True: 48.9k, False: 572]
  ------------------
 9540|  48.9k|		    ((IS_ASCII_LETTER(CUR)) || (CUR >= 0x80) ||
  ------------------
  |  |  222|  48.9k|#define IS_ASCII_LETTER(c)	((0x61 <= ((c) | 0x20)) && \
  |  |  ------------------
  |  |  |  Branch (222:29): [True: 9.02k, False: 39.9k]
  |  |  ------------------
  |  |  223|  48.9k|                                 (((c) | 0x20) <= 0x7a))
  |  |  ------------------
  |  |  |  Branch (223:34): [True: 6.51k, False: 2.50k]
  |  |  ------------------
  ------------------
              		    ((IS_ASCII_LETTER(CUR)) || (CUR >= 0x80) ||
  ------------------
  |  | 2193|  42.4k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (9540:34): [True: 1.36k, False: 41.0k]
  ------------------
 9541|  41.0k|                     (CUR == '_') || (CUR == '.') ||
  ------------------
  |  | 2193|  41.0k|#define CUR (*ctxt->cur)
  ------------------
                                   (CUR == '_') || (CUR == '.') ||
  ------------------
  |  | 2193|  40.5k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (9541:22): [True: 502, False: 40.5k]
  |  Branch (9541:38): [True: 3.29k, False: 37.2k]
  ------------------
 9542|  37.2k|		     (CUR == '@') || (CUR == '*')))
  ------------------
  |  | 2193|  37.2k|#define CUR (*ctxt->cur)
  ------------------
              		     (CUR == '@') || (CUR == '*')))
  ------------------
  |  | 2193|  33.9k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (9542:8): [True: 3.37k, False: 33.9k]
  |  Branch (9542:24): [True: 28.1k, False: 5.71k]
  ------------------
 9543|  43.2k|		    xmlXPathCompRelativeLocationPath(ctxt);
 9544|  49.5k|	    }
 9545|  59.2k|	    CHECK_ERROR;
  ------------------
  |  |  230|  59.2k|    if (ctxt->error != XPATH_EXPRESSION_OK) return
  |  |  ------------------
  |  |  |  Branch (230:9): [True: 267, False: 58.9k]
  |  |  ------------------
  ------------------
 9546|  59.2k|	}
 9547|  56.1k|    }
 9548|   923k|}
xpath.c:xmlXPathCompFilterExpr:
 8683|  54.8k|xmlXPathCompFilterExpr(xmlXPathParserContextPtr ctxt) {
 8684|  54.8k|    xmlXPathCompPrimaryExpr(ctxt);
 8685|  54.8k|    CHECK_ERROR;
  ------------------
  |  |  230|  54.8k|    if (ctxt->error != XPATH_EXPRESSION_OK) return
  |  |  ------------------
  |  |  |  Branch (230:9): [True: 1.43k, False: 53.4k]
  |  |  ------------------
  ------------------
 8686|  53.4k|    SKIP_BLANKS;
  ------------------
  |  | 2199|  53.4k|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  | 2202|  54.8k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2202:15): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 8687|       |
 8688|  64.3k|    while (CUR == '[') {
  ------------------
  |  | 2193|  64.3k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (8688:12): [True: 10.9k, False: 53.4k]
  ------------------
 8689|  10.9k|	xmlXPathCompPredicate(ctxt, 1);
 8690|  10.9k|	SKIP_BLANKS;
  ------------------
  |  | 2199|  10.9k|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  | 2202|      0|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2202:15): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 8691|  10.9k|    }
 8692|       |
 8693|       |
 8694|  53.4k|}
xpath.c:xmlXPathCompPrimaryExpr:
 8645|  54.8k|xmlXPathCompPrimaryExpr(xmlXPathParserContextPtr ctxt) {
 8646|  54.8k|    SKIP_BLANKS;
  ------------------
  |  | 2199|  54.8k|    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|  54.8k|    if (CUR == '$') xmlXPathCompVariableReference(ctxt);
  ------------------
  |  | 2193|  54.8k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (8647:9): [True: 822, False: 54.0k]
  ------------------
 8648|  54.0k|    else if (CUR == '(') {
  ------------------
  |  | 2193|  54.0k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (8648:14): [True: 3.33k, False: 50.6k]
  ------------------
 8649|  3.33k|	NEXT;
  ------------------
  |  | 2202|  3.33k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  ------------------
  |  |  |  Branch (2202:15): [True: 3.33k, False: 0]
  |  |  ------------------
  ------------------
 8650|  3.33k|	SKIP_BLANKS;
  ------------------
  |  | 2199|  7.67k|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  | 2202|  7.67k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2202:15): [True: 7.67k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 8651|  3.33k|	xmlXPathCompileExpr(ctxt, 1);
 8652|  3.33k|	CHECK_ERROR;
  ------------------
  |  |  230|  3.33k|    if (ctxt->error != XPATH_EXPRESSION_OK) return
  |  |  ------------------
  |  |  |  Branch (230:9): [True: 388, False: 2.94k]
  |  |  ------------------
  ------------------
 8653|  2.94k|	if (CUR != ')') {
  ------------------
  |  | 2193|  2.94k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (8653:6): [True: 33, False: 2.91k]
  ------------------
 8654|     33|	    XP_ERROR(XPATH_EXPR_ERROR);
  ------------------
  |  |  244|     33|    { xmlXPathErr(ctxt, X); return; }
  ------------------
 8655|      0|	}
 8656|  2.91k|	NEXT;
  ------------------
  |  | 2202|  2.91k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  ------------------
  |  |  |  Branch (2202:15): [True: 2.91k, False: 0]
  |  |  ------------------
  ------------------
 8657|  2.91k|	SKIP_BLANKS;
  ------------------
  |  | 2199|  13.2k|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  | 2202|  16.2k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2202:15): [True: 13.2k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 8658|  50.6k|    } else if (IS_ASCII_DIGIT(CUR) || (CUR == '.' && IS_ASCII_DIGIT(NXT(1)))) {
  ------------------
  |  |  230|   101k|#define IS_ASCII_DIGIT(c)	((0x30 <= (c)) && ((c) <= 0x39))
  |  |  ------------------
  |  |  |  Branch (230:28): [True: 46.4k, False: 4.24k]
  |  |  |  Branch (230:45): [True: 36.1k, False: 10.3k]
  |  |  ------------------
  ------------------
                  } else if (IS_ASCII_DIGIT(CUR) || (CUR == '.' && IS_ASCII_DIGIT(NXT(1)))) {
  ------------------
  |  | 2193|  14.5k|#define CUR (*ctxt->cur)
  ------------------
                  } else if (IS_ASCII_DIGIT(CUR) || (CUR == '.' && IS_ASCII_DIGIT(NXT(1)))) {
  ------------------
  |  |  230|  2.73k|#define IS_ASCII_DIGIT(c)	((0x30 <= (c)) && ((c) <= 0x39))
  |  |  ------------------
  |  |  |  Branch (230:28): [True: 2.73k, False: 0]
  |  |  |  Branch (230:45): [True: 2.73k, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (8658:40): [True: 2.73k, False: 11.8k]
  ------------------
 8659|  38.8k|	xmlXPathCompNumber(ctxt);
 8660|  38.8k|    } else if ((CUR == '\'') || (CUR == '"')) {
  ------------------
  |  | 2193|  11.8k|#define CUR (*ctxt->cur)
  ------------------
                  } else if ((CUR == '\'') || (CUR == '"')) {
  ------------------
  |  | 2193|  10.4k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (8660:16): [True: 1.38k, False: 10.4k]
  |  Branch (8660:33): [True: 120, False: 10.3k]
  ------------------
 8661|  1.50k|	xmlXPathCompLiteral(ctxt);
 8662|  10.3k|    } else {
 8663|  10.3k|	xmlXPathCompFunctionCall(ctxt);
 8664|  10.3k|    }
 8665|  54.4k|    SKIP_BLANKS;
  ------------------
  |  | 2199|  86.8k|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  | 2202|   141k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2202:15): [True: 86.8k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 8666|  54.4k|}
xpath.c:xmlXPathCompVariableReference:
 8511|    822|xmlXPathCompVariableReference(xmlXPathParserContextPtr ctxt) {
 8512|    822|    xmlChar *name;
 8513|    822|    xmlChar *prefix;
 8514|       |
 8515|    822|    SKIP_BLANKS;
  ------------------
  |  | 2199|    822|    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|    822|    if (CUR != '$') {
  ------------------
  |  | 2193|    822|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (8516:9): [True: 0, False: 822]
  ------------------
 8517|      0|	XP_ERROR(XPATH_VARIABLE_REF_ERROR);
  ------------------
  |  |  244|      0|    { xmlXPathErr(ctxt, X); return; }
  ------------------
 8518|      0|    }
 8519|    822|    NEXT;
  ------------------
  |  | 2202|    822|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  ------------------
  |  |  |  Branch (2202:15): [True: 822, False: 0]
  |  |  ------------------
  ------------------
 8520|    822|    name = xmlXPathParseQName(ctxt, &prefix);
 8521|    822|    if (name == NULL) {
  ------------------
  |  Branch (8521:9): [True: 35, False: 787]
  ------------------
 8522|     35|        xmlFree(prefix);
 8523|     35|	XP_ERROR(XPATH_VARIABLE_REF_ERROR);
  ------------------
  |  |  244|     35|    { xmlXPathErr(ctxt, X); return; }
  ------------------
 8524|      0|    }
 8525|    787|    ctxt->comp->last = -1;
 8526|    787|    if (PUSH_LONG_EXPR(XPATH_OP_VARIABLE, 0, 0, 0, name, prefix) == -1) {
  ------------------
  |  | 1085|    787|    xmlXPathCompExprAdd(ctxt, ctxt->comp->last, -1,		\
  |  | 1086|    787|	                (op), (val), (val2), (val3), (val4), (val5))
  ------------------
  |  Branch (8526:9): [True: 1, False: 786]
  ------------------
 8527|      1|        xmlFree(prefix);
 8528|      1|        xmlFree(name);
 8529|      1|    }
 8530|    787|    SKIP_BLANKS;
  ------------------
  |  | 2199|  4.76k|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  | 2202|  5.54k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2202:15): [True: 4.76k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 8531|    787|    if ((ctxt->context != NULL) && (ctxt->context->flags & XML_XPATH_NOVAR)) {
  ------------------
  |  |  241|    787|#define XML_XPATH_NOVAR	  (1<<1)
  ------------------
  |  Branch (8531:9): [True: 787, False: 0]
  |  Branch (8531:36): [True: 0, False: 787]
  ------------------
 8532|      0|	XP_ERROR(XPATH_FORBID_VARIABLE_ERROR);
  ------------------
  |  |  244|      0|    { xmlXPathErr(ctxt, X); return; }
  ------------------
 8533|      0|    }
 8534|    787|}
xpath.c:xmlXPathParseQName:
 8178|  11.1k|xmlXPathParseQName(xmlXPathParserContextPtr ctxt, xmlChar **prefix) {
 8179|  11.1k|    xmlChar *ret = NULL;
 8180|       |
 8181|  11.1k|    *prefix = NULL;
 8182|  11.1k|    ret = xmlXPathParseNCName(ctxt);
 8183|  11.1k|    if (ret && CUR == ':') {
  ------------------
  |  | 2193|  11.1k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (8183:9): [True: 11.1k, False: 45]
  |  Branch (8183:16): [True: 1.14k, False: 9.96k]
  ------------------
 8184|  1.14k|        *prefix = ret;
 8185|  1.14k|	NEXT;
  ------------------
  |  | 2202|  1.14k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  ------------------
  |  |  |  Branch (2202:15): [True: 1.14k, False: 0]
  |  |  ------------------
  ------------------
 8186|  1.14k|	ret = xmlXPathParseNCName(ctxt);
 8187|  1.14k|    }
 8188|  11.1k|    return(ret);
 8189|  11.1k|}
xpath.c:xmlXPathCompNumber:
 8337|  38.8k|{
 8338|  38.8k|    double ret = 0.0;
 8339|  38.8k|    int ok = 0;
 8340|  38.8k|    int exponent = 0;
 8341|  38.8k|    int is_exponent_negative = 0;
 8342|  38.8k|    xmlXPathObjectPtr num;
 8343|  38.8k|#ifdef __GNUC__
 8344|  38.8k|    unsigned long tmp = 0;
 8345|  38.8k|    double temp;
 8346|  38.8k|#endif
 8347|       |
 8348|  38.8k|    CHECK_ERROR;
  ------------------
  |  |  230|  38.8k|    if (ctxt->error != XPATH_EXPRESSION_OK) return
  |  |  ------------------
  |  |  |  Branch (230:9): [True: 20, False: 38.8k]
  |  |  ------------------
  ------------------
 8349|  38.8k|    if ((CUR != '.') && ((CUR < '0') || (CUR > '9'))) {
  ------------------
  |  | 2193|  38.8k|#define CUR (*ctxt->cur)
  ------------------
                  if ((CUR != '.') && ((CUR < '0') || (CUR > '9'))) {
  ------------------
  |  | 2193|  36.0k|#define CUR (*ctxt->cur)
  ------------------
                  if ((CUR != '.') && ((CUR < '0') || (CUR > '9'))) {
  ------------------
  |  | 2193|  36.0k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (8349:9): [True: 36.0k, False: 2.73k]
  |  Branch (8349:26): [True: 0, False: 36.0k]
  |  Branch (8349:41): [True: 0, False: 36.0k]
  ------------------
 8350|      0|        XP_ERROR(XPATH_NUMBER_ERROR);
  ------------------
  |  |  244|      0|    { xmlXPathErr(ctxt, X); return; }
  ------------------
 8351|      0|    }
 8352|  38.8k|#ifdef __GNUC__
 8353|       |    /*
 8354|       |     * tmp/temp is a workaround against a gcc compiler bug
 8355|       |     * http://veillard.com/gcc.bug
 8356|       |     */
 8357|  38.8k|    ret = 0;
 8358|   135k|    while ((CUR >= '0') && (CUR <= '9')) {
  ------------------
  |  | 2193|   135k|#define CUR (*ctxt->cur)
  ------------------
                  while ((CUR >= '0') && (CUR <= '9')) {
  ------------------
  |  | 2193|   110k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (8358:12): [True: 110k, False: 24.8k]
  |  Branch (8358:28): [True: 96.7k, False: 14.0k]
  ------------------
 8359|  96.7k|	ret = ret * 10;
 8360|  96.7k|	tmp = (CUR - '0');
  ------------------
  |  | 2193|  96.7k|#define CUR (*ctxt->cur)
  ------------------
 8361|  96.7k|        ok = 1;
 8362|  96.7k|        NEXT;
  ------------------
  |  | 2202|  96.7k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  ------------------
  |  |  |  Branch (2202:15): [True: 96.7k, False: 0]
  |  |  ------------------
  ------------------
 8363|  96.7k|	temp = (double) tmp;
 8364|  96.7k|	ret = ret + temp;
 8365|  96.7k|    }
 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|  38.8k|    if (CUR == '.') {
  ------------------
  |  | 2193|  38.8k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (8374:9): [True: 5.35k, False: 33.4k]
  ------------------
 8375|  5.35k|	int v, frac = 0, max;
 8376|  5.35k|	double fraction = 0;
 8377|       |
 8378|  5.35k|        NEXT;
  ------------------
  |  | 2202|  5.35k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  ------------------
  |  |  |  Branch (2202:15): [True: 5.35k, False: 0]
  |  |  ------------------
  ------------------
 8379|  5.35k|        if (((CUR < '0') || (CUR > '9')) && (!ok)) {
  ------------------
  |  | 2193|  5.35k|#define CUR (*ctxt->cur)
  ------------------
                      if (((CUR < '0') || (CUR > '9')) && (!ok)) {
  ------------------
  |  | 2193|  4.63k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (8379:14): [True: 714, False: 4.63k]
  |  Branch (8379:29): [True: 540, False: 4.09k]
  |  Branch (8379:45): [True: 0, False: 1.25k]
  ------------------
 8380|      0|            XP_ERROR(XPATH_NUMBER_ERROR);
  ------------------
  |  |  244|      0|    { xmlXPathErr(ctxt, X); return; }
  ------------------
 8381|      0|        }
 8382|  8.06k|        while (CUR == '0') {
  ------------------
  |  | 2193|  8.06k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (8382:16): [True: 2.71k, False: 5.35k]
  ------------------
 8383|  2.71k|            frac = frac + 1;
 8384|  2.71k|            NEXT;
  ------------------
  |  | 2202|  2.71k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  ------------------
  |  |  |  Branch (2202:15): [True: 2.71k, False: 0]
  |  |  ------------------
  ------------------
 8385|  2.71k|        }
 8386|  5.35k|        max = frac + MAX_FRAC;
  ------------------
  |  | 8219|  5.35k|#define MAX_FRAC 20
  ------------------
 8387|  22.7k|        while ((CUR >= '0') && (CUR <= '9') && (frac < max)) {
  ------------------
  |  | 2193|  22.7k|#define CUR (*ctxt->cur)
  ------------------
                      while ((CUR >= '0') && (CUR <= '9') && (frac < max)) {
  ------------------
  |  | 2193|  20.4k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (8387:16): [True: 20.4k, False: 2.25k]
  |  Branch (8387:32): [True: 17.4k, False: 3.04k]
  |  Branch (8387:48): [True: 17.3k, False: 54]
  ------------------
 8388|  17.3k|	    v = (CUR - '0');
  ------------------
  |  | 2193|  17.3k|#define CUR (*ctxt->cur)
  ------------------
 8389|  17.3k|	    fraction = fraction * 10 + v;
 8390|  17.3k|	    frac = frac + 1;
 8391|  17.3k|            NEXT;
  ------------------
  |  | 2202|  17.3k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  ------------------
  |  |  |  Branch (2202:15): [True: 17.3k, False: 0]
  |  |  ------------------
  ------------------
 8392|  17.3k|        }
 8393|  5.35k|        fraction /= pow(10.0, frac);
 8394|  5.35k|        ret = ret + fraction;
 8395|  5.74k|        while ((CUR >= '0') && (CUR <= '9'))
  ------------------
  |  | 2193|  5.74k|#define CUR (*ctxt->cur)
  ------------------
                      while ((CUR >= '0') && (CUR <= '9'))
  ------------------
  |  | 2193|  3.44k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (8395:16): [True: 3.44k, False: 2.29k]
  |  Branch (8395:32): [True: 392, False: 3.05k]
  ------------------
 8396|    392|            NEXT;
  ------------------
  |  | 2202|  5.74k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  ------------------
  |  |  |  Branch (2202:15): [True: 392, False: 0]
  |  |  ------------------
  ------------------
 8397|  5.35k|    }
 8398|  38.8k|    if ((CUR == 'e') || (CUR == 'E')) {
  ------------------
  |  | 2193|  38.8k|#define CUR (*ctxt->cur)
  ------------------
                  if ((CUR == 'e') || (CUR == 'E')) {
  ------------------
  |  | 2193|  38.2k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (8398:9): [True: 583, False: 38.2k]
  |  Branch (8398:25): [True: 4.45k, False: 33.7k]
  ------------------
 8399|  5.03k|        NEXT;
  ------------------
  |  | 2202|  5.03k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  ------------------
  |  |  |  Branch (2202:15): [True: 5.03k, False: 0]
  |  |  ------------------
  ------------------
 8400|  5.03k|        if (CUR == '-') {
  ------------------
  |  | 2193|  5.03k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (8400:13): [True: 853, False: 4.18k]
  ------------------
 8401|    853|            is_exponent_negative = 1;
 8402|    853|            NEXT;
  ------------------
  |  | 2202|    853|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  ------------------
  |  |  |  Branch (2202:15): [True: 853, False: 0]
  |  |  ------------------
  ------------------
 8403|  4.18k|        } else if (CUR == '+') {
  ------------------
  |  | 2193|  4.18k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (8403:20): [True: 664, False: 3.52k]
  ------------------
 8404|    664|	    NEXT;
  ------------------
  |  | 2202|    664|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  ------------------
  |  |  |  Branch (2202:15): [True: 664, False: 0]
  |  |  ------------------
  ------------------
 8405|    664|	}
 8406|  28.5k|        while ((CUR >= '0') && (CUR <= '9')) {
  ------------------
  |  | 2193|  28.5k|#define CUR (*ctxt->cur)
  ------------------
                      while ((CUR >= '0') && (CUR <= '9')) {
  ------------------
  |  | 2193|  25.5k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (8406:16): [True: 25.5k, False: 2.99k]
  |  Branch (8406:32): [True: 23.5k, False: 2.04k]
  ------------------
 8407|  23.5k|            if (exponent < 1000000)
  ------------------
  |  Branch (8407:17): [True: 20.1k, False: 3.44k]
  ------------------
 8408|  20.1k|                exponent = exponent * 10 + (CUR - '0');
  ------------------
  |  | 2193|  20.1k|#define CUR (*ctxt->cur)
  ------------------
 8409|  23.5k|            NEXT;
  ------------------
  |  | 2202|  23.5k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  ------------------
  |  |  |  Branch (2202:15): [True: 23.5k, False: 0]
  |  |  ------------------
  ------------------
 8410|  23.5k|        }
 8411|  5.03k|        if (is_exponent_negative)
  ------------------
  |  Branch (8411:13): [True: 853, False: 4.18k]
  ------------------
 8412|    853|            exponent = -exponent;
 8413|  5.03k|        ret *= pow(10.0, (double) exponent);
 8414|  5.03k|    }
 8415|  38.8k|    num = xmlXPathCacheNewFloat(ctxt, ret);
 8416|  38.8k|    if (num == NULL) {
  ------------------
  |  Branch (8416:9): [True: 22, False: 38.8k]
  ------------------
 8417|     22|	ctxt->error = XPATH_MEMORY_ERROR;
 8418|  38.8k|    } else if (PUSH_LONG_EXPR(XPATH_OP_VALUE, XPATH_NUMBER, 0, 0, num,
  ------------------
  |  | 1085|  38.8k|    xmlXPathCompExprAdd(ctxt, ctxt->comp->last, -1,		\
  |  | 1086|  38.8k|	                (op), (val), (val2), (val3), (val4), (val5))
  ------------------
  |  Branch (8418:16): [True: 12, False: 38.8k]
  ------------------
 8419|  38.8k|                              NULL) == -1) {
 8420|     12|        xmlXPathReleaseObject(ctxt->context, num);
 8421|     12|    }
 8422|  38.8k|}
xpath.c:xmlXPathCompLiteral:
 8478|  1.50k|xmlXPathCompLiteral(xmlXPathParserContextPtr ctxt) {
 8479|  1.50k|    xmlChar *ret = NULL;
 8480|  1.50k|    xmlXPathObjectPtr lit;
 8481|       |
 8482|  1.50k|    ret = xmlXPathParseLiteral(ctxt);
 8483|  1.50k|    if (ret == NULL)
  ------------------
  |  Branch (8483:9): [True: 121, False: 1.38k]
  ------------------
 8484|    121|        return;
 8485|  1.38k|    lit = xmlXPathCacheNewString(ctxt, ret);
 8486|  1.38k|    if (lit == NULL) {
  ------------------
  |  Branch (8486:9): [True: 5, False: 1.37k]
  ------------------
 8487|      5|        ctxt->error = XPATH_MEMORY_ERROR;
 8488|  1.37k|    } else if (PUSH_LONG_EXPR(XPATH_OP_VALUE, XPATH_STRING, 0, 0, lit,
  ------------------
  |  | 1085|  1.37k|    xmlXPathCompExprAdd(ctxt, ctxt->comp->last, -1,		\
  |  | 1086|  1.37k|	                (op), (val), (val2), (val3), (val4), (val5))
  ------------------
  |  Branch (8488:16): [True: 5, False: 1.37k]
  ------------------
 8489|  1.37k|                              NULL) == -1) {
 8490|      5|        xmlXPathReleaseObject(ctxt->context, lit);
 8491|      5|    }
 8492|  1.38k|    xmlFree(ret);
 8493|  1.38k|}
xpath.c:xmlXPathParseLiteral:
 8434|  1.58k|xmlXPathParseLiteral(xmlXPathParserContextPtr ctxt) {
 8435|  1.58k|    const xmlChar *q;
 8436|  1.58k|    xmlChar *ret = NULL;
 8437|  1.58k|    int quote;
 8438|       |
 8439|  1.58k|    if (CUR == '"') {
  ------------------
  |  | 2193|  1.58k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (8439:9): [True: 120, False: 1.46k]
  ------------------
 8440|    120|        quote = '"';
 8441|  1.46k|    } else if (CUR == '\'') {
  ------------------
  |  | 2193|  1.46k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (8441:16): [True: 1.46k, False: 5]
  ------------------
 8442|  1.46k|        quote = '\'';
 8443|  1.46k|    } else {
 8444|      5|	XP_ERRORNULL(XPATH_START_LITERAL_ERROR);
  ------------------
  |  |  633|      5|    { xmlXPathErr(ctxt, X); return(NULL); }
  ------------------
 8445|      0|    }
 8446|       |
 8447|  1.58k|    NEXT;
  ------------------
  |  | 2202|  1.58k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  ------------------
  |  |  |  Branch (2202:15): [True: 1.58k, False: 0]
  |  |  ------------------
  ------------------
 8448|  1.58k|    q = CUR_PTR;
  ------------------
  |  | 2196|  1.58k|#define CUR_PTR ctxt->cur
  ------------------
 8449|  64.6k|    while (CUR != quote) {
  ------------------
  |  | 2193|  64.6k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (8449:12): [True: 63.1k, False: 1.45k]
  ------------------
 8450|  63.1k|        int ch;
 8451|  63.1k|        int len = 4;
 8452|       |
 8453|  63.1k|        if (CUR == 0)
  ------------------
  |  | 2193|  63.1k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (8453:13): [True: 115, False: 63.0k]
  ------------------
 8454|  63.0k|            XP_ERRORNULL(XPATH_UNFINISHED_LITERAL_ERROR);
  ------------------
  |  |  633|    115|    { xmlXPathErr(ctxt, X); return(NULL); }
  ------------------
 8455|  63.0k|        ch = xmlGetUTF8Char(CUR_PTR, &len);
  ------------------
  |  | 2196|  63.0k|#define CUR_PTR ctxt->cur
  ------------------
 8456|  63.0k|        if ((ch < 0) || (IS_CHAR(ch) == 0))
  ------------------
  |  |  115|  63.0k|#define IS_CHAR(c)   xmlIsCharQ(c)
  |  |  ------------------
  |  |  |  |  117|  63.0k|#define xmlIsCharQ(c)		(((c) < 0x100) ? \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (117:25): [True: 62.4k, False: 573]
  |  |  |  |  ------------------
  |  |  |  |  118|  63.0k|				 xmlIsChar_ch((c)) :\
  |  |  |  |  ------------------
  |  |  |  |  |  |  108|  62.4k|#define xmlIsChar_ch(c)		(((0x9 <= (c)) && ((c) <= 0xa)) || \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (108:28): [True: 62.4k, False: 6]
  |  |  |  |  |  |  |  Branch (108:44): [True: 231, False: 62.2k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  109|  62.4k|				 ((c) == 0xd) || \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (109:6): [True: 102, False: 62.1k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  110|  62.4k|				  (0x20 <= (c)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (110:7): [True: 62.1k, False: 6]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  119|  63.0k|				(((0x100 <= (c)) && ((c) <= 0xd7ff)) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (119:7): [True: 573, False: 0]
  |  |  |  |  |  Branch (119:25): [True: 295, False: 278]
  |  |  |  |  ------------------
  |  |  |  |  120|    573|				 ((0xe000 <= (c)) && ((c) <= 0xfffd)) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (120:7): [True: 278, False: 0]
  |  |  |  |  |  Branch (120:26): [True: 28, False: 250]
  |  |  |  |  ------------------
  |  |  |  |  121|    573|				 ((0x10000 <= (c)) && ((c) <= 0x10ffff))))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (121:7): [True: 250, False: 0]
  |  |  |  |  |  Branch (121:27): [True: 250, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (8456:13): [True: 3, False: 63.0k]
  |  Branch (8456:25): [True: 6, False: 63.0k]
  ------------------
 8457|  63.0k|            XP_ERRORNULL(XPATH_INVALID_CHAR_ERROR);
  ------------------
  |  |  633|      9|    { xmlXPathErr(ctxt, X); return(NULL); }
  ------------------
 8458|  63.0k|        CUR_PTR += len;
  ------------------
  |  | 2196|  63.0k|#define CUR_PTR ctxt->cur
  ------------------
 8459|  63.0k|    }
 8460|  1.45k|    ret = xmlStrndup(q, CUR_PTR - q);
  ------------------
  |  | 2196|  1.45k|#define CUR_PTR ctxt->cur
  ------------------
 8461|  1.45k|    if (ret == NULL)
  ------------------
  |  Branch (8461:9): [True: 2, False: 1.45k]
  ------------------
 8462|      2|        xmlXPathPErrMemory(ctxt);
 8463|  1.45k|    NEXT;
  ------------------
  |  | 2202|  1.45k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  ------------------
  |  |  |  Branch (2202:15): [True: 1.45k, False: 0]
  |  |  ------------------
  ------------------
 8464|  1.45k|    return(ret);
 8465|  1.58k|}
xpath.c:xmlXPathCompFunctionCall:
 8573|  10.3k|xmlXPathCompFunctionCall(xmlXPathParserContextPtr ctxt) {
 8574|  10.3k|    xmlChar *name;
 8575|  10.3k|    xmlChar *prefix;
 8576|  10.3k|    int nbargs = 0;
 8577|  10.3k|    int sort = 1;
 8578|       |
 8579|  10.3k|    name = xmlXPathParseQName(ctxt, &prefix);
 8580|  10.3k|    if (name == NULL) {
  ------------------
  |  Branch (8580:9): [True: 10, False: 10.3k]
  ------------------
 8581|     10|	xmlFree(prefix);
 8582|     10|	XP_ERROR(XPATH_EXPR_ERROR);
  ------------------
  |  |  244|     10|    { xmlXPathErr(ctxt, X); return; }
  ------------------
 8583|      0|    }
 8584|  10.3k|    SKIP_BLANKS;
  ------------------
  |  | 2199|   316k|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  | 2202|   327k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2202:15): [True: 316k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 8585|       |
 8586|  10.3k|    if (CUR != '(') {
  ------------------
  |  | 2193|  10.3k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (8586:9): [True: 6, False: 10.3k]
  ------------------
 8587|      6|	xmlFree(name);
 8588|      6|	xmlFree(prefix);
 8589|      6|	XP_ERROR(XPATH_EXPR_ERROR);
  ------------------
  |  |  244|      6|    { xmlXPathErr(ctxt, X); return; }
  ------------------
 8590|      0|    }
 8591|  10.3k|    NEXT;
  ------------------
  |  | 2202|  10.3k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  ------------------
  |  |  |  Branch (2202:15): [True: 10.3k, False: 0]
  |  |  ------------------
  ------------------
 8592|  10.3k|    SKIP_BLANKS;
  ------------------
  |  | 2199|   103k|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  | 2202|   113k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2202:15): [True: 103k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 8593|       |
 8594|       |    /*
 8595|       |    * Optimization for count(): we don't need the node-set to be sorted.
 8596|       |    */
 8597|  10.3k|    if ((prefix == NULL) && (name[0] == 'c') &&
  ------------------
  |  Branch (8597:9): [True: 9.41k, False: 903]
  |  Branch (8597:29): [True: 865, False: 8.55k]
  ------------------
 8598|    865|	xmlStrEqual(name, BAD_CAST "count"))
  ------------------
  |  |   34|    865|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (8598:2): [True: 61, False: 804]
  ------------------
 8599|     61|    {
 8600|     61|	sort = 0;
 8601|     61|    }
 8602|  10.3k|    ctxt->comp->last = -1;
 8603|  10.3k|    if (CUR != ')') {
  ------------------
  |  | 2193|  10.3k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (8603:9): [True: 8.38k, False: 1.93k]
  ------------------
 8604|  11.9k|	while (CUR != 0) {
  ------------------
  |  | 2193|  11.9k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (8604:9): [True: 11.9k, False: 3]
  ------------------
 8605|  11.9k|	    int op1 = ctxt->comp->last;
 8606|  11.9k|	    ctxt->comp->last = -1;
 8607|  11.9k|	    xmlXPathCompileExpr(ctxt, sort);
 8608|  11.9k|	    if (ctxt->error != XPATH_EXPRESSION_OK) {
  ------------------
  |  Branch (8608:10): [True: 665, False: 11.2k]
  ------------------
 8609|    665|		xmlFree(name);
 8610|    665|		xmlFree(prefix);
 8611|    665|		return;
 8612|    665|	    }
 8613|  11.2k|	    PUSH_BINARY_EXPR(XPATH_OP_ARG, op1, ctxt->comp->last, 0, 0);
  ------------------
  |  | 1094|  11.2k|#define PUSH_BINARY_EXPR(op, ch1, ch2, val, val2)			\
  |  | 1095|  11.2k|xmlXPathCompExprAdd(ctxt, (ch1), (ch2), (op),			\
  |  | 1096|  11.2k|			(val), (val2), 0 ,NULL ,NULL)
  ------------------
 8614|  11.2k|	    nbargs++;
 8615|  11.2k|	    if (CUR == ')') break;
  ------------------
  |  | 2193|  11.2k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (8615:10): [True: 7.62k, False: 3.61k]
  ------------------
 8616|  3.61k|	    if (CUR != ',') {
  ------------------
  |  | 2193|  3.61k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (8616:10): [True: 94, False: 3.51k]
  ------------------
 8617|     94|		xmlFree(name);
 8618|     94|		xmlFree(prefix);
 8619|     94|		XP_ERROR(XPATH_EXPR_ERROR);
  ------------------
  |  |  244|     94|    { xmlXPathErr(ctxt, X); return; }
  ------------------
 8620|      0|	    }
 8621|  3.51k|	    NEXT;
  ------------------
  |  | 2202|  3.51k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  ------------------
  |  |  |  Branch (2202:15): [True: 3.51k, False: 0]
  |  |  ------------------
  ------------------
 8622|  3.51k|	    SKIP_BLANKS;
  ------------------
  |  | 2199|  3.53k|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  | 2202|  7.05k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2202:15): [True: 3.53k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 8623|  3.51k|	}
 8624|  8.38k|    }
 8625|  9.56k|    if (PUSH_LONG_EXPR(XPATH_OP_FUNCTION, nbargs, 0, 0, name, prefix) == -1) {
  ------------------
  |  | 1085|  9.56k|    xmlXPathCompExprAdd(ctxt, ctxt->comp->last, -1,		\
  |  | 1086|  9.56k|	                (op), (val), (val2), (val3), (val4), (val5))
  ------------------
  |  Branch (8625:9): [True: 4, False: 9.55k]
  ------------------
 8626|      4|        xmlFree(prefix);
 8627|      4|        xmlFree(name);
 8628|      4|    }
 8629|  9.56k|    NEXT;
  ------------------
  |  | 2202|  9.56k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  ------------------
  |  |  |  Branch (2202:15): [True: 9.55k, False: 3]
  |  |  ------------------
  ------------------
 8630|  9.56k|    SKIP_BLANKS;
  ------------------
  |  | 2199|   107k|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  | 2202|   116k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2202:15): [True: 107k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 8631|  9.56k|}
xpath.c:xmlXPathCompPredicate:
 9137|  18.9k|xmlXPathCompPredicate(xmlXPathParserContextPtr ctxt, int filter) {
 9138|  18.9k|    int op1 = ctxt->comp->last;
 9139|       |
 9140|  18.9k|    SKIP_BLANKS;
  ------------------
  |  | 2199|  18.9k|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  | 2202|      0|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2202:15): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 9141|  18.9k|    if (CUR != '[') {
  ------------------
  |  | 2193|  18.9k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (9141:9): [True: 0, False: 18.9k]
  ------------------
 9142|      0|	XP_ERROR(XPATH_INVALID_PREDICATE_ERROR);
  ------------------
  |  |  244|      0|    { xmlXPathErr(ctxt, X); return; }
  ------------------
 9143|      0|    }
 9144|  18.9k|    NEXT;
  ------------------
  |  | 2202|  18.9k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  ------------------
  |  |  |  Branch (2202:15): [True: 18.9k, False: 0]
  |  |  ------------------
  ------------------
 9145|  18.9k|    SKIP_BLANKS;
  ------------------
  |  | 2199|  18.9k|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  | 2202|  34.5k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2202:15): [True: 15.6k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 9146|       |
 9147|  18.9k|    ctxt->comp->last = -1;
 9148|       |    /*
 9149|       |    * This call to xmlXPathCompileExpr() will deactivate sorting
 9150|       |    * of the predicate result.
 9151|       |    * TODO: Sorting is still activated for filters, since I'm not
 9152|       |    *  sure if needed. Normally sorting should not be needed, since
 9153|       |    *  a filter can only diminish the number of items in a sequence,
 9154|       |    *  but won't change its order; so if the initial sequence is sorted,
 9155|       |    *  subsequent sorting is not needed.
 9156|       |    */
 9157|  18.9k|    if (! filter)
  ------------------
  |  Branch (9157:9): [True: 7.99k, False: 10.9k]
  ------------------
 9158|  7.99k|	xmlXPathCompileExpr(ctxt, 0);
 9159|  10.9k|    else
 9160|  10.9k|	xmlXPathCompileExpr(ctxt, 1);
 9161|  18.9k|    CHECK_ERROR;
  ------------------
  |  |  230|  18.9k|    if (ctxt->error != XPATH_EXPRESSION_OK) return
  |  |  ------------------
  |  |  |  Branch (230:9): [True: 2.77k, False: 16.1k]
  |  |  ------------------
  ------------------
 9162|       |
 9163|  16.1k|    if (CUR != ']') {
  ------------------
  |  | 2193|  16.1k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (9163:9): [True: 171, False: 15.9k]
  ------------------
 9164|    171|	XP_ERROR(XPATH_INVALID_PREDICATE_ERROR);
  ------------------
  |  |  244|    171|    { xmlXPathErr(ctxt, X); return; }
  ------------------
 9165|      0|    }
 9166|       |
 9167|  15.9k|    if (filter)
  ------------------
  |  Branch (9167:9): [True: 10.3k, False: 5.62k]
  ------------------
 9168|  10.3k|	PUSH_BINARY_EXPR(XPATH_OP_FILTER, op1, ctxt->comp->last, 0, 0);
  ------------------
  |  | 1094|  10.3k|#define PUSH_BINARY_EXPR(op, ch1, ch2, val, val2)			\
  |  | 1095|  10.3k|xmlXPathCompExprAdd(ctxt, (ch1), (ch2), (op),			\
  |  | 1096|  10.3k|			(val), (val2), 0 ,NULL ,NULL)
  ------------------
 9169|  5.62k|    else
 9170|  5.62k|	PUSH_BINARY_EXPR(XPATH_OP_PREDICATE, op1, ctxt->comp->last, 0, 0);
  ------------------
  |  | 1094|  5.62k|#define PUSH_BINARY_EXPR(op, ch1, ch2, val, val2)			\
  |  | 1095|  5.62k|xmlXPathCompExprAdd(ctxt, (ch1), (ch2), (op),			\
  |  | 1096|  5.62k|			(val), (val2), 0 ,NULL ,NULL)
  ------------------
 9171|       |
 9172|  15.9k|    NEXT;
  ------------------
  |  | 2202|  15.9k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  ------------------
  |  |  |  Branch (2202:15): [True: 15.9k, False: 0]
  |  |  ------------------
  ------------------
 9173|  15.9k|    SKIP_BLANKS;
  ------------------
  |  | 2199|  28.7k|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  | 2202|  44.7k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2202:15): [True: 28.7k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 9174|  15.9k|}
xpath.c:xmlXPathCompRelativeLocationPath:
 9481|   922k|(xmlXPathParserContextPtr ctxt) {
 9482|   922k|    SKIP_BLANKS;
  ------------------
  |  | 2199|   922k|    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|   922k|    if ((CUR == '/') && (NXT(1) == '/')) {
  ------------------
  |  | 2193|   922k|#define CUR (*ctxt->cur)
  ------------------
                  if ((CUR == '/') && (NXT(1) == '/')) {
  ------------------
  |  | 2195|  7.32k|#define NXT(val) ctxt->cur[(val)]
  ------------------
  |  Branch (9483:9): [True: 7.32k, False: 915k]
  |  Branch (9483:25): [True: 3.57k, False: 3.75k]
  ------------------
 9484|  3.57k|	SKIP(2);
  ------------------
  |  | 2194|  3.57k|#define SKIP(val) ctxt->cur += (val)
  ------------------
 9485|  3.57k|	SKIP_BLANKS;
  ------------------
  |  | 2199|  9.70k|    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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 9486|  3.57k|	PUSH_LONG_EXPR(XPATH_OP_COLLECT, AXIS_DESCENDANT_OR_SELF,
  ------------------
  |  | 1085|  3.57k|    xmlXPathCompExprAdd(ctxt, ctxt->comp->last, -1,		\
  |  | 1086|  3.57k|	                (op), (val), (val2), (val3), (val4), (val5))
  ------------------
 9487|  3.57k|		         NODE_TEST_TYPE, NODE_TYPE_NODE, NULL, NULL);
 9488|   919k|    } else if (CUR == '/') {
  ------------------
  |  | 2193|   919k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (9488:16): [True: 3.75k, False: 915k]
  ------------------
 9489|  3.75k|	    NEXT;
  ------------------
  |  | 2202|  3.75k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  ------------------
  |  |  |  Branch (2202:15): [True: 3.75k, False: 0]
  |  |  ------------------
  ------------------
 9490|  3.75k|	SKIP_BLANKS;
  ------------------
  |  | 2199|  10.3k|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  | 2202|  10.3k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2202:15): [True: 10.3k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 9491|  3.75k|    }
 9492|   922k|    xmlXPathCompStep(ctxt);
 9493|   922k|    CHECK_ERROR;
  ------------------
  |  |  230|   922k|    if (ctxt->error != XPATH_EXPRESSION_OK) return
  |  |  ------------------
  |  |  |  Branch (230:9): [True: 1.00k, False: 921k]
  |  |  ------------------
  ------------------
 9494|   921k|    SKIP_BLANKS;
  ------------------
  |  | 2199|   921k|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  | 2202|   922k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2202:15): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 9495|   941k|    while (CUR == '/') {
  ------------------
  |  | 2193|   941k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (9495:12): [True: 19.5k, False: 921k]
  ------------------
 9496|  19.5k|	if ((CUR == '/') && (NXT(1) == '/')) {
  ------------------
  |  | 2193|  19.5k|#define CUR (*ctxt->cur)
  ------------------
              	if ((CUR == '/') && (NXT(1) == '/')) {
  ------------------
  |  | 2195|  19.5k|#define NXT(val) ctxt->cur[(val)]
  ------------------
  |  Branch (9496:6): [True: 19.5k, False: 0]
  |  Branch (9496:22): [True: 5.80k, False: 13.7k]
  ------------------
 9497|  5.80k|	    SKIP(2);
  ------------------
  |  | 2194|  5.80k|#define SKIP(val) ctxt->cur += (val)
  ------------------
 9498|  5.80k|	    SKIP_BLANKS;
  ------------------
  |  | 2199|  7.70k|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  | 2202|  7.70k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2202:15): [True: 7.70k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 9499|  5.80k|	    PUSH_LONG_EXPR(XPATH_OP_COLLECT, AXIS_DESCENDANT_OR_SELF,
  ------------------
  |  | 1085|  5.80k|    xmlXPathCompExprAdd(ctxt, ctxt->comp->last, -1,		\
  |  | 1086|  5.80k|	                (op), (val), (val2), (val3), (val4), (val5))
  ------------------
 9500|  5.80k|			     NODE_TEST_TYPE, NODE_TYPE_NODE, NULL, NULL);
 9501|  5.80k|	    xmlXPathCompStep(ctxt);
 9502|  13.7k|	} else if (CUR == '/') {
  ------------------
  |  | 2193|  13.7k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (9502:13): [True: 13.7k, False: 0]
  ------------------
 9503|  13.7k|	    NEXT;
  ------------------
  |  | 2202|  13.7k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  ------------------
  |  |  |  Branch (2202:15): [True: 13.7k, False: 0]
  |  |  ------------------
  ------------------
 9504|  13.7k|	    SKIP_BLANKS;
  ------------------
  |  | 2199|  13.7k|    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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 9505|  13.7k|	    xmlXPathCompStep(ctxt);
 9506|  13.7k|	}
 9507|  19.5k|	SKIP_BLANKS;
  ------------------
  |  | 2199|  19.5k|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  | 2202|  1.08k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2202:15): [True: 1.08k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 9508|  19.5k|    }
 9509|   921k|}
xpath.c:xmlXPathCompStep:
 9390|   942k|xmlXPathCompStep(xmlXPathParserContextPtr ctxt) {
 9391|   942k|    SKIP_BLANKS;
  ------------------
  |  | 2199|   942k|    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|   942k|    if ((CUR == '.') && (NXT(1) == '.')) {
  ------------------
  |  | 2193|   942k|#define CUR (*ctxt->cur)
  ------------------
                  if ((CUR == '.') && (NXT(1) == '.')) {
  ------------------
  |  | 2195|  18.2k|#define NXT(val) ctxt->cur[(val)]
  ------------------
  |  Branch (9392:9): [True: 18.2k, False: 923k]
  |  Branch (9392:25): [True: 6.36k, False: 11.8k]
  ------------------
 9393|  6.36k|	SKIP(2);
  ------------------
  |  | 2194|  6.36k|#define SKIP(val) ctxt->cur += (val)
  ------------------
 9394|  6.36k|	SKIP_BLANKS;
  ------------------
  |  | 2199|  6.36k|    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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 9395|  6.36k|	PUSH_LONG_EXPR(XPATH_OP_COLLECT, AXIS_PARENT,
  ------------------
  |  | 1085|  6.36k|    xmlXPathCompExprAdd(ctxt, ctxt->comp->last, -1,		\
  |  | 1086|  6.36k|	                (op), (val), (val2), (val3), (val4), (val5))
  ------------------
 9396|  6.36k|		    NODE_TEST_TYPE, NODE_TYPE_NODE, NULL, NULL);
 9397|   935k|    } else if (CUR == '.') {
  ------------------
  |  | 2193|   935k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (9397:16): [True: 11.8k, False: 923k]
  ------------------
 9398|  11.8k|	NEXT;
  ------------------
  |  | 2202|  11.8k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  ------------------
  |  |  |  Branch (2202:15): [True: 11.8k, False: 0]
  |  |  ------------------
  ------------------
 9399|  11.8k|	SKIP_BLANKS;
  ------------------
  |  | 2199|  12.5k|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  | 2202|  12.5k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2202:15): [True: 12.5k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 9400|   923k|    } else {
 9401|   923k|	xmlChar *name = NULL;
 9402|   923k|	xmlChar *prefix = NULL;
 9403|   923k|	xmlXPathTestVal test = (xmlXPathTestVal) 0;
 9404|   923k|	xmlXPathAxisVal axis = (xmlXPathAxisVal) 0;
 9405|   923k|	xmlXPathTypeVal type = (xmlXPathTypeVal) 0;
 9406|   923k|	int op1;
 9407|       |
 9408|   923k|	if (CUR == '*') {
  ------------------
  |  | 2193|   923k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (9408:6): [True: 848k, False: 75.2k]
  ------------------
 9409|   848k|	    axis = AXIS_CHILD;
 9410|   848k|	} else {
 9411|  75.2k|	    if (name == NULL)
  ------------------
  |  Branch (9411:10): [True: 75.2k, False: 0]
  ------------------
 9412|  75.2k|		name = xmlXPathParseNCName(ctxt);
 9413|  75.2k|	    if (name != NULL) {
  ------------------
  |  Branch (9413:10): [True: 69.0k, False: 6.16k]
  ------------------
 9414|  69.0k|		axis = xmlXPathIsAxisName(name);
 9415|  69.0k|		if (axis != 0) {
  ------------------
  |  Branch (9415:7): [True: 2.94k, False: 66.1k]
  ------------------
 9416|  2.94k|		    SKIP_BLANKS;
  ------------------
  |  | 2199|  50.8k|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  | 2202|  50.8k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2202:15): [True: 50.8k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 9417|  2.94k|		    if ((CUR == ':') && (NXT(1) == ':')) {
  ------------------
  |  | 2193|  2.94k|#define CUR (*ctxt->cur)
  ------------------
              		    if ((CUR == ':') && (NXT(1) == ':')) {
  ------------------
  |  | 2195|  1.73k|#define NXT(val) ctxt->cur[(val)]
  ------------------
  |  Branch (9417:11): [True: 1.73k, False: 1.21k]
  |  Branch (9417:27): [True: 1.65k, False: 84]
  ------------------
 9418|  1.65k|			SKIP(2);
  ------------------
  |  | 2194|  1.65k|#define SKIP(val) ctxt->cur += (val)
  ------------------
 9419|  1.65k|			xmlFree(name);
 9420|  1.65k|			name = NULL;
 9421|  1.65k|		    } else {
 9422|       |			/* an element name can conflict with an axis one :-\ */
 9423|  1.29k|			axis = AXIS_CHILD;
 9424|  1.29k|		    }
 9425|  66.1k|		} else {
 9426|  66.1k|		    axis = AXIS_CHILD;
 9427|  66.1k|		}
 9428|  69.0k|	    } else if (CUR == '@') {
  ------------------
  |  | 2193|  6.16k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (9428:17): [True: 5.57k, False: 584]
  ------------------
 9429|  5.57k|		NEXT;
  ------------------
  |  | 2202|  5.57k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  ------------------
  |  |  |  Branch (2202:15): [True: 5.57k, False: 0]
  |  |  ------------------
  ------------------
 9430|  5.57k|		axis = AXIS_ATTRIBUTE;
 9431|  5.57k|	    } else {
 9432|    584|		axis = AXIS_CHILD;
 9433|    584|	    }
 9434|  75.2k|	}
 9435|       |
 9436|   923k|        if (ctxt->error != XPATH_EXPRESSION_OK) {
  ------------------
  |  Branch (9436:13): [True: 657, False: 923k]
  ------------------
 9437|    657|            xmlFree(name);
 9438|    657|            return;
 9439|    657|        }
 9440|       |
 9441|   923k|	name = xmlXPathCompNodeTest(ctxt, &test, &type, &prefix, name);
 9442|   923k|	if (test == 0)
  ------------------
  |  Branch (9442:6): [True: 286, False: 923k]
  ------------------
 9443|    286|	    return;
 9444|       |
 9445|   923k|        if ((prefix != NULL) && (ctxt->context != NULL) &&
  ------------------
  |  Branch (9445:13): [True: 2.39k, False: 920k]
  |  Branch (9445:33): [True: 2.39k, False: 0]
  ------------------
 9446|  2.39k|	    (ctxt->context->flags & XML_XPATH_CHECKNS)) {
  ------------------
  |  |  237|  2.39k|#define XML_XPATH_CHECKNS (1<<0)
  ------------------
  |  Branch (9446:6): [True: 0, False: 2.39k]
  ------------------
 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|   923k|	op1 = ctxt->comp->last;
 9454|   923k|	ctxt->comp->last = -1;
 9455|       |
 9456|   923k|	SKIP_BLANKS;
  ------------------
  |  | 2199|   923k|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  | 2202|   934k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2202:15): [True: 11.4k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 9457|   931k|	while (CUR == '[') {
  ------------------
  |  | 2193|   931k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (9457:9): [True: 7.99k, False: 923k]
  ------------------
 9458|  7.99k|	    xmlXPathCompPredicate(ctxt, 0);
 9459|  7.99k|	}
 9460|       |
 9461|   923k|        if (PUSH_FULL_EXPR(XPATH_OP_COLLECT, op1, ctxt->comp->last, axis,
  ------------------
  |  | 1082|   923k|    xmlXPathCompExprAdd(ctxt, (op1), (op2),			\
  |  | 1083|   923k|	                (op), (val), (val2), (val3), (val4), (val5))
  ------------------
  |  Branch (9461:13): [True: 19, False: 923k]
  ------------------
 9462|   923k|                           test, type, (void *)prefix, (void *)name) == -1) {
 9463|     19|            xmlFree(prefix);
 9464|     19|            xmlFree(name);
 9465|     19|        }
 9466|   923k|    }
 9467|   942k|}
xpath.c:xmlXPathIsAxisName:
 9321|  69.0k|xmlXPathIsAxisName(const xmlChar *name) {
 9322|  69.0k|    xmlXPathAxisVal ret = (xmlXPathAxisVal) 0;
 9323|  69.0k|    switch (name[0]) {
  ------------------
  |  Branch (9323:13): [True: 19.4k, False: 49.6k]
  ------------------
 9324|  7.86k|	case 'a':
  ------------------
  |  Branch (9324:2): [True: 7.86k, False: 61.1k]
  ------------------
 9325|  7.86k|	    if (xmlStrEqual(name, BAD_CAST "ancestor"))
  ------------------
  |  |   34|  7.86k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (9325:10): [True: 1.63k, False: 6.23k]
  ------------------
 9326|  1.63k|		ret = AXIS_ANCESTOR;
 9327|  7.86k|	    if (xmlStrEqual(name, BAD_CAST "ancestor-or-self"))
  ------------------
  |  |   34|  7.86k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (9327:10): [True: 95, False: 7.77k]
  ------------------
 9328|     95|		ret = AXIS_ANCESTOR_OR_SELF;
 9329|  7.86k|	    if (xmlStrEqual(name, BAD_CAST "attribute"))
  ------------------
  |  |   34|  7.86k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (9329:10): [True: 3, False: 7.86k]
  ------------------
 9330|      3|		ret = AXIS_ATTRIBUTE;
 9331|  7.86k|	    break;
 9332|  2.22k|	case 'c':
  ------------------
  |  Branch (9332:2): [True: 2.22k, False: 66.8k]
  ------------------
 9333|  2.22k|	    if (xmlStrEqual(name, BAD_CAST "child"))
  ------------------
  |  |   34|  2.22k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (9333:10): [True: 48, False: 2.17k]
  ------------------
 9334|     48|		ret = AXIS_CHILD;
 9335|  2.22k|	    break;
 9336|  1.16k|	case 'd':
  ------------------
  |  Branch (9336:2): [True: 1.16k, False: 67.8k]
  ------------------
 9337|  1.16k|	    if (xmlStrEqual(name, BAD_CAST "descendant"))
  ------------------
  |  |   34|  1.16k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (9337:10): [True: 31, False: 1.13k]
  ------------------
 9338|     31|		ret = AXIS_DESCENDANT;
 9339|  1.16k|	    if (xmlStrEqual(name, BAD_CAST "descendant-or-self"))
  ------------------
  |  |   34|  1.16k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (9339:10): [True: 10, False: 1.15k]
  ------------------
 9340|     10|		ret = AXIS_DESCENDANT_OR_SELF;
 9341|  1.16k|	    break;
 9342|  1.59k|	case 'f':
  ------------------
  |  Branch (9342:2): [True: 1.59k, False: 67.4k]
  ------------------
 9343|  1.59k|	    if (xmlStrEqual(name, BAD_CAST "following"))
  ------------------
  |  |   34|  1.59k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (9343:10): [True: 228, False: 1.36k]
  ------------------
 9344|    228|		ret = AXIS_FOLLOWING;
 9345|  1.59k|	    if (xmlStrEqual(name, BAD_CAST "following-sibling"))
  ------------------
  |  |   34|  1.59k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (9345:10): [True: 60, False: 1.53k]
  ------------------
 9346|     60|		ret = AXIS_FOLLOWING_SIBLING;
 9347|  1.59k|	    break;
 9348|  3.37k|	case 'n':
  ------------------
  |  Branch (9348:2): [True: 3.37k, False: 65.6k]
  ------------------
 9349|  3.37k|	    if (xmlStrEqual(name, BAD_CAST "namespace"))
  ------------------
  |  |   34|  3.37k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (9349:10): [True: 298, False: 3.07k]
  ------------------
 9350|    298|		ret = AXIS_NAMESPACE;
 9351|  3.37k|	    break;
 9352|    808|	case 'p':
  ------------------
  |  Branch (9352:2): [True: 808, False: 68.2k]
  ------------------
 9353|    808|	    if (xmlStrEqual(name, BAD_CAST "parent"))
  ------------------
  |  |   34|    808|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (9353:10): [True: 85, False: 723]
  ------------------
 9354|     85|		ret = AXIS_PARENT;
 9355|    808|	    if (xmlStrEqual(name, BAD_CAST "preceding"))
  ------------------
  |  |   34|    808|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (9355:10): [True: 38, False: 770]
  ------------------
 9356|     38|		ret = AXIS_PRECEDING;
 9357|    808|	    if (xmlStrEqual(name, BAD_CAST "preceding-sibling"))
  ------------------
  |  |   34|    808|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (9357:10): [True: 7, False: 801]
  ------------------
 9358|      7|		ret = AXIS_PRECEDING_SIBLING;
 9359|    808|	    break;
 9360|  2.37k|	case 's':
  ------------------
  |  Branch (9360:2): [True: 2.37k, False: 66.6k]
  ------------------
 9361|  2.37k|	    if (xmlStrEqual(name, BAD_CAST "self"))
  ------------------
  |  |   34|  2.37k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (9361:10): [True: 411, False: 1.96k]
  ------------------
 9362|    411|		ret = AXIS_SELF;
 9363|  2.37k|	    break;
 9364|  69.0k|    }
 9365|  69.0k|    return(ret);
 9366|  69.0k|}
xpath.c:xmlXPathCompNodeTest:
 9201|   923k|		     xmlChar *name) {
 9202|   923k|    int blanks;
 9203|       |
 9204|   923k|    if ((test == NULL) || (type == NULL) || (prefix == NULL)) {
  ------------------
  |  Branch (9204:9): [True: 0, False: 923k]
  |  Branch (9204:27): [True: 0, False: 923k]
  |  Branch (9204:45): [True: 0, False: 923k]
  ------------------
 9205|      0|	return(NULL);
 9206|      0|    }
 9207|   923k|    *type = (xmlXPathTypeVal) 0;
 9208|   923k|    *test = (xmlXPathTestVal) 0;
 9209|   923k|    *prefix = NULL;
 9210|   923k|    SKIP_BLANKS;
  ------------------
  |  | 2199|   923k|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  | 2202|  1.10M|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2202:15): [True: 185k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 9211|       |
 9212|   923k|    if ((name == NULL) && (CUR == '*')) {
  ------------------
  |  | 2193|   856k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (9212:9): [True: 856k, False: 67.1k]
  |  Branch (9212:27): [True: 849k, False: 6.89k]
  ------------------
 9213|       |	/*
 9214|       |	 * All elements
 9215|       |	 */
 9216|   849k|	NEXT;
  ------------------
  |  | 2202|   849k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  ------------------
  |  |  |  Branch (2202:15): [True: 849k, False: 0]
  |  |  ------------------
  ------------------
 9217|   849k|	*test = NODE_TEST_ALL;
 9218|   849k|	return(NULL);
 9219|   849k|    }
 9220|       |
 9221|  74.0k|    if (name == NULL)
  ------------------
  |  Branch (9221:9): [True: 6.89k, False: 67.1k]
  ------------------
 9222|  6.89k|	name = xmlXPathParseNCName(ctxt);
 9223|  74.0k|    if (name == NULL) {
  ------------------
  |  Branch (9223:9): [True: 244, False: 73.7k]
  ------------------
 9224|    244|	XP_ERRORNULL(XPATH_EXPR_ERROR);
  ------------------
  |  |  633|    244|    { xmlXPathErr(ctxt, X); return(NULL); }
  ------------------
 9225|      0|    }
 9226|       |
 9227|  73.7k|    blanks = IS_BLANK_CH(CUR);
  ------------------
  |  |  137|  73.7k|#define IS_BLANK_CH(c)  xmlIsBlank_ch(c)
  |  |  ------------------
  |  |  |  |   90|  73.7k|#define xmlIsBlank_ch(c)	(((c) == 0x20) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (90:27): [True: 999, False: 72.7k]
  |  |  |  |  ------------------
  |  |  |  |   91|  73.7k|				 ((0x9 <= (c)) && ((c) <= 0xa)) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (91:7): [True: 71.3k, False: 1.41k]
  |  |  |  |  |  Branch (91:23): [True: 10, False: 71.3k]
  |  |  |  |  ------------------
  |  |  |  |   92|  73.7k|				 ((c) == 0xd))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (92:6): [True: 9, False: 72.7k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 9228|  73.7k|    SKIP_BLANKS;
  ------------------
  |  | 2199|  73.7k|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  | 2202|  85.4k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2202:15): [True: 11.6k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 9229|  73.7k|    if (CUR == '(') {
  ------------------
  |  | 2193|  73.7k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (9229:9): [True: 607, False: 73.1k]
  ------------------
 9230|    607|	NEXT;
  ------------------
  |  | 2202|    607|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  ------------------
  |  |  |  Branch (2202:15): [True: 607, False: 0]
  |  |  ------------------
  ------------------
 9231|       |	/*
 9232|       |	 * NodeType or PI search
 9233|       |	 */
 9234|    607|	if (xmlStrEqual(name, BAD_CAST "comment"))
  ------------------
  |  |   34|    607|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (9234:6): [True: 16, False: 591]
  ------------------
 9235|     16|	    *type = NODE_TYPE_COMMENT;
 9236|    591|	else if (xmlStrEqual(name, BAD_CAST "node"))
  ------------------
  |  |   34|    591|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (9236:11): [True: 45, False: 546]
  ------------------
 9237|     45|	    *type = NODE_TYPE_NODE;
 9238|    546|	else if (xmlStrEqual(name, BAD_CAST "processing-instruction"))
  ------------------
  |  |   34|    546|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (9238:11): [True: 114, False: 432]
  ------------------
 9239|    114|	    *type = NODE_TYPE_PI;
 9240|    432|	else if (xmlStrEqual(name, BAD_CAST "text"))
  ------------------
  |  |   34|    432|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (9240:11): [True: 390, False: 42]
  ------------------
 9241|    390|	    *type = NODE_TYPE_TEXT;
 9242|     42|	else {
 9243|     42|	    if (name != NULL)
  ------------------
  |  Branch (9243:10): [True: 42, False: 0]
  ------------------
 9244|     42|		xmlFree(name);
 9245|     42|	    XP_ERRORNULL(XPATH_EXPR_ERROR);
  ------------------
  |  |  633|     42|    { xmlXPathErr(ctxt, X); return(NULL); }
  ------------------
 9246|      0|	}
 9247|       |
 9248|    565|	*test = NODE_TEST_TYPE;
 9249|       |
 9250|    565|	SKIP_BLANKS;
  ------------------
  |  | 2199|  1.18k|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  | 2202|  1.74k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2202:15): [True: 1.18k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 9251|    565|	if (*type == NODE_TYPE_PI) {
  ------------------
  |  Branch (9251:6): [True: 114, False: 451]
  ------------------
 9252|       |	    /*
 9253|       |	     * Specific case: search a PI by name.
 9254|       |	     */
 9255|    114|	    if (name != NULL)
  ------------------
  |  Branch (9255:10): [True: 114, False: 0]
  ------------------
 9256|    114|		xmlFree(name);
 9257|    114|	    name = NULL;
 9258|    114|	    if (CUR != ')') {
  ------------------
  |  | 2193|    114|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (9258:10): [True: 83, False: 31]
  ------------------
 9259|     83|		name = xmlXPathParseLiteral(ctxt);
 9260|     83|		*test = NODE_TEST_PI;
 9261|     83|		SKIP_BLANKS;
  ------------------
  |  | 2199|    550|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  | 2202|    550|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2202:15): [True: 550, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 9262|     83|	    }
 9263|    114|	}
 9264|    565|	if (CUR != ')') {
  ------------------
  |  | 2193|    565|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (9264:6): [True: 41, False: 524]
  ------------------
 9265|     41|	    if (name != NULL)
  ------------------
  |  Branch (9265:10): [True: 31, False: 10]
  ------------------
 9266|     31|		xmlFree(name);
 9267|     41|	    XP_ERRORNULL(XPATH_UNCLOSED_ERROR);
  ------------------
  |  |  633|     41|    { xmlXPathErr(ctxt, X); return(NULL); }
  ------------------
 9268|      0|	}
 9269|    524|	NEXT;
  ------------------
  |  | 2202|    524|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  ------------------
  |  |  |  Branch (2202:15): [True: 524, False: 0]
  |  |  ------------------
  ------------------
 9270|    524|	return(name);
 9271|    565|    }
 9272|  73.1k|    *test = NODE_TEST_NAME;
 9273|  73.1k|    if ((!blanks) && (CUR == ':')) {
  ------------------
  |  | 2193|  72.1k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (9273:9): [True: 72.1k, False: 1.01k]
  |  Branch (9273:22): [True: 2.39k, False: 69.7k]
  ------------------
 9274|  2.39k|	NEXT;
  ------------------
  |  | 2202|  2.39k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  ------------------
  |  |  |  Branch (2202:15): [True: 2.39k, 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.39k|	*prefix = name;
 9284|       |
 9285|  2.39k|	if (CUR == '*') {
  ------------------
  |  | 2193|  2.39k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (9285:6): [True: 417, False: 1.97k]
  ------------------
 9286|       |	    /*
 9287|       |	     * All elements
 9288|       |	     */
 9289|    417|	    NEXT;
  ------------------
  |  | 2202|    417|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  ------------------
  |  |  |  Branch (2202:15): [True: 417, False: 0]
  |  |  ------------------
  ------------------
 9290|    417|	    *test = NODE_TEST_ALL;
 9291|    417|	    return(NULL);
 9292|    417|	}
 9293|       |
 9294|  1.97k|	name = xmlXPathParseNCName(ctxt);
 9295|  1.97k|	if (name == NULL) {
  ------------------
  |  Branch (9295:6): [True: 35, False: 1.93k]
  ------------------
 9296|     35|	    XP_ERRORNULL(XPATH_EXPR_ERROR);
  ------------------
  |  |  633|     35|    { xmlXPathErr(ctxt, X); return(NULL); }
  ------------------
 9297|      0|	}
 9298|  1.97k|    }
 9299|  72.7k|    return(name);
 9300|  73.1k|}
xpath.c:xmlXPathCompExprAdd:
 1031|  2.95M|   int value2, int value3, void *value4, void *value5) {
 1032|  2.95M|    xmlXPathCompExprPtr comp = ctxt->comp;
 1033|  2.95M|    if (comp->nbStep >= comp->maxStep) {
  ------------------
  |  Branch (1033:9): [True: 47.7k, False: 2.91M]
  ------------------
 1034|  47.7k|	xmlXPathStepOp *real;
 1035|  47.7k|        int newSize;
 1036|       |
 1037|  47.7k|        newSize = xmlGrowCapacity(comp->maxStep, sizeof(real[0]),
 1038|  47.7k|                                  10, XPATH_MAX_STEPS);
  ------------------
  |  |   88|  47.7k|#define XPATH_MAX_STEPS 1000000
  ------------------
 1039|  47.7k|        if (newSize < 0) {
  ------------------
  |  Branch (1039:13): [True: 0, False: 47.7k]
  ------------------
 1040|      0|	    xmlXPathPErrMemory(ctxt);
 1041|      0|	    return(-1);
 1042|      0|        }
 1043|  47.7k|	real = xmlRealloc(comp->steps, newSize * sizeof(real[0]));
 1044|  47.7k|	if (real == NULL) {
  ------------------
  |  Branch (1044:6): [True: 104, False: 47.6k]
  ------------------
 1045|    104|	    xmlXPathPErrMemory(ctxt);
 1046|    104|	    return(-1);
 1047|    104|	}
 1048|  47.6k|	comp->steps = real;
 1049|  47.6k|	comp->maxStep = newSize;
 1050|  47.6k|    }
 1051|  2.95M|    comp->last = comp->nbStep;
 1052|  2.95M|    comp->steps[comp->nbStep].ch1 = ch1;
 1053|  2.95M|    comp->steps[comp->nbStep].ch2 = ch2;
 1054|  2.95M|    comp->steps[comp->nbStep].op = op;
 1055|  2.95M|    comp->steps[comp->nbStep].value = value;
 1056|  2.95M|    comp->steps[comp->nbStep].value2 = value2;
 1057|  2.95M|    comp->steps[comp->nbStep].value3 = value3;
 1058|  2.95M|    if ((comp->dict != NULL) &&
  ------------------
  |  Branch (1058:9): [True: 0, False: 2.95M]
  ------------------
 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|  2.95M|    } else {
 1074|  2.95M|	comp->steps[comp->nbStep].value4 = value4;
 1075|  2.95M|	comp->steps[comp->nbStep].value5 = value5;
 1076|  2.95M|    }
 1077|       |    comp->steps[comp->nbStep].cache = NULL;
 1078|  2.95M|    return(comp->nbStep++);
 1079|  2.95M|}
xpath.c:xmlXPathOptimizeExpression:
11740|  2.13M|{
11741|  2.13M|    xmlXPathCompExprPtr comp = pctxt->comp;
11742|  2.13M|    xmlXPathContextPtr ctxt;
11743|       |
11744|       |    /*
11745|       |    * Try to rewrite "descendant-or-self::node()/foo" to an optimized
11746|       |    * internal representation.
11747|       |    */
11748|       |
11749|  2.13M|    if ((op->op == XPATH_OP_COLLECT /* 11 */) &&
  ------------------
  |  Branch (11749:9): [True: 682k, False: 1.44M]
  ------------------
11750|   682k|        (op->ch1 != -1) &&
  ------------------
  |  Branch (11750:9): [True: 682k, False: 0]
  ------------------
11751|   682k|        (op->ch2 == -1 /* no predicate */))
  ------------------
  |  Branch (11751:9): [True: 677k, False: 5.13k]
  ------------------
11752|   677k|    {
11753|   677k|        xmlXPathStepOpPtr prevop = &comp->steps[op->ch1];
11754|       |
11755|   677k|        if ((prevop->op == XPATH_OP_COLLECT /* 11 */) &&
  ------------------
  |  Branch (11755:13): [True: 18.6k, False: 658k]
  ------------------
11756|  18.6k|            ((xmlXPathAxisVal) prevop->value ==
  ------------------
  |  Branch (11756:13): [True: 8.78k, False: 9.85k]
  ------------------
11757|  18.6k|                AXIS_DESCENDANT_OR_SELF) &&
11758|  8.78k|            (prevop->ch2 == -1) &&
  ------------------
  |  Branch (11758:13): [True: 8.78k, False: 0]
  ------------------
11759|  8.78k|            ((xmlXPathTestVal) prevop->value2 == NODE_TEST_TYPE) &&
  ------------------
  |  Branch (11759:13): [True: 8.78k, False: 0]
  ------------------
11760|  8.78k|            ((xmlXPathTypeVal) prevop->value3 == NODE_TYPE_NODE))
  ------------------
  |  Branch (11760:13): [True: 8.78k, False: 0]
  ------------------
11761|  8.78k|        {
11762|       |            /*
11763|       |            * This is a "descendant-or-self::node()" without predicates.
11764|       |            * Try to eliminate it.
11765|       |            */
11766|       |
11767|  8.78k|            switch ((xmlXPathAxisVal) op->value) {
11768|  2.25k|                case AXIS_CHILD:
  ------------------
  |  Branch (11768:17): [True: 2.25k, False: 6.52k]
  ------------------
11769|  2.25k|                case AXIS_DESCENDANT:
  ------------------
  |  Branch (11769:17): [True: 0, False: 8.78k]
  ------------------
11770|       |                    /*
11771|       |                    * Convert "descendant-or-self::node()/child::" or
11772|       |                    * "descendant-or-self::node()/descendant::" to
11773|       |                    * "descendant::"
11774|       |                    */
11775|  2.25k|                    op->ch1   = prevop->ch1;
11776|  2.25k|                    op->value = AXIS_DESCENDANT;
11777|  2.25k|                    break;
11778|      0|                case AXIS_SELF:
  ------------------
  |  Branch (11778:17): [True: 0, False: 8.78k]
  ------------------
11779|  1.88k|                case AXIS_DESCENDANT_OR_SELF:
  ------------------
  |  Branch (11779:17): [True: 1.88k, False: 6.90k]
  ------------------
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|  1.88k|                    op->ch1   = prevop->ch1;
11786|  1.88k|                    op->value = AXIS_DESCENDANT_OR_SELF;
11787|  1.88k|                    break;
11788|  4.64k|                default:
  ------------------
  |  Branch (11788:17): [True: 4.64k, False: 4.13k]
  ------------------
11789|  4.64k|                    break;
11790|  8.78k|            }
11791|  8.78k|	}
11792|   677k|    }
11793|       |
11794|       |    /* OP_VALUE has invalid ch1. */
11795|  2.13M|    if (op->op == XPATH_OP_VALUE)
  ------------------
  |  Branch (11795:9): [True: 26.5k, False: 2.10M]
  ------------------
11796|  26.5k|        return;
11797|       |
11798|       |    /* Recurse */
11799|  2.10M|    ctxt = pctxt->context;
11800|  2.10M|    if (ctxt != NULL) {
  ------------------
  |  Branch (11800:9): [True: 2.10M, False: 0]
  ------------------
11801|  2.10M|        if (ctxt->depth >= XPATH_MAX_RECURSION_DEPTH)
  ------------------
  |  |  112|  2.10M|#define XPATH_MAX_RECURSION_DEPTH 500
  ------------------
  |  Branch (11801:13): [True: 1.89k, False: 2.10M]
  ------------------
11802|  1.89k|            return;
11803|  2.10M|        ctxt->depth += 1;
11804|  2.10M|    }
11805|  2.10M|    if (op->ch1 != -1)
  ------------------
  |  Branch (11805:9): [True: 1.42M, False: 680k]
  ------------------
11806|  1.42M|        xmlXPathOptimizeExpression(pctxt, &comp->steps[op->ch1]);
11807|  2.10M|    if (op->ch2 != -1)
  ------------------
  |  Branch (11807:9): [True: 701k, False: 1.40M]
  ------------------
11808|   701k|	xmlXPathOptimizeExpression(pctxt, &comp->steps[op->ch2]);
11809|  2.10M|    if (ctxt != NULL)
  ------------------
  |  Branch (11809:9): [True: 2.10M, False: 0]
  ------------------
11810|  2.10M|        ctxt->depth -= 1;
11811|  2.10M|}
xpath.c:xmlXPathRunEval:
11496|  6.97k|{
11497|  6.97k|    xmlXPathCompExprPtr comp;
11498|  6.97k|    int oldDepth;
11499|       |
11500|  6.97k|    if ((ctxt == NULL) || (ctxt->comp == NULL))
  ------------------
  |  Branch (11500:9): [True: 0, False: 6.97k]
  |  Branch (11500:27): [True: 0, False: 6.97k]
  ------------------
11501|      0|	return(-1);
11502|       |
11503|  6.97k|    if (ctxt->valueTab == NULL) {
  ------------------
  |  Branch (11503:9): [True: 0, False: 6.97k]
  ------------------
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|  6.97k|    comp = ctxt->comp;
11553|  6.97k|    if (comp->last < 0) {
  ------------------
  |  Branch (11553:9): [True: 0, False: 6.97k]
  ------------------
11554|      0|        xmlXPathErr(ctxt, XPATH_STACK_ERROR);
11555|      0|	return(-1);
11556|      0|    }
11557|  6.97k|    oldDepth = ctxt->context->depth;
11558|  6.97k|    if (toBool)
  ------------------
  |  Branch (11558:9): [True: 0, False: 6.97k]
  ------------------
11559|      0|	return(xmlXPathCompOpEvalToBoolean(ctxt,
11560|      0|	    &comp->steps[comp->last], 0));
11561|  6.97k|    else
11562|  6.97k|	xmlXPathCompOpEval(ctxt, &comp->steps[comp->last]);
11563|  6.97k|    ctxt->context->depth = oldDepth;
11564|       |
11565|  6.97k|    return(0);
11566|  6.97k|}
xpath.c:xmlXPathCompOpEvalToBoolean:
11177|   413k|{
11178|   413k|    xmlXPathObjectPtr resObj = NULL;
11179|       |
11180|   416k|start:
11181|   416k|    if (OP_LIMIT_EXCEEDED(ctxt, 1))
  ------------------
  |  |  818|   416k|    ((ctxt->context->opLimit != 0) && (xmlXPathCheckOpLimit(ctxt, n) < 0))
  |  |  ------------------
  |  |  |  Branch (818:6): [True: 416k, False: 0]
  |  |  |  Branch (818:39): [True: 8, False: 416k]
  |  |  ------------------
  ------------------
11182|      8|        return(0);
11183|       |    /* comp = ctxt->comp; */
11184|   416k|    switch (op->op) {
11185|      0|        case XPATH_OP_END:
  ------------------
  |  Branch (11185:9): [True: 0, False: 416k]
  ------------------
11186|      0|            return (0);
11187|  23.5k|	case XPATH_OP_VALUE:
  ------------------
  |  Branch (11187:2): [True: 23.5k, False: 393k]
  ------------------
11188|  23.5k|	    resObj = (xmlXPathObjectPtr) op->value4;
11189|  23.5k|	    if (isPredicate)
  ------------------
  |  Branch (11189:10): [True: 23.5k, False: 0]
  ------------------
11190|  23.5k|		return(xmlXPathEvaluatePredicateResult(ctxt, resObj));
11191|      0|	    return(xmlXPathCastToBoolean(resObj));
11192|  3.08k|	case XPATH_OP_SORT:
  ------------------
  |  Branch (11192:2): [True: 3.08k, False: 413k]
  ------------------
11193|       |	    /*
11194|       |	    * We don't need sorting for boolean results. Skip this one.
11195|       |	    */
11196|  3.08k|            if (op->ch1 != -1) {
  ------------------
  |  Branch (11196:17): [True: 3.08k, False: 0]
  ------------------
11197|  3.08k|		op = &ctxt->comp->steps[op->ch1];
11198|  3.08k|		goto start;
11199|  3.08k|	    }
11200|      0|	    return(0);
11201|   116k|	case XPATH_OP_COLLECT:
  ------------------
  |  Branch (11201:2): [True: 116k, False: 300k]
  ------------------
11202|   116k|	    if (op->ch1 == -1)
  ------------------
  |  Branch (11202:10): [True: 0, False: 116k]
  ------------------
11203|      0|		return(0);
11204|       |
11205|   116k|            xmlXPathCompOpEval(ctxt, &ctxt->comp->steps[op->ch1]);
11206|   116k|	    if (ctxt->error != XPATH_EXPRESSION_OK)
  ------------------
  |  Branch (11206:10): [True: 116, False: 115k]
  ------------------
11207|    116|		return(-1);
11208|       |
11209|   115k|            xmlXPathNodeCollectAndTest(ctxt, op, NULL, NULL, 1);
11210|   115k|	    if (ctxt->error != XPATH_EXPRESSION_OK)
  ------------------
  |  Branch (11210:10): [True: 272, False: 115k]
  ------------------
11211|    272|		return(-1);
11212|       |
11213|   115k|	    resObj = xmlXPathValuePop(ctxt);
11214|   115k|	    if (resObj == NULL)
  ------------------
  |  Branch (11214:10): [True: 0, False: 115k]
  ------------------
11215|      0|		return(-1);
11216|   115k|	    break;
11217|   274k|	default:
  ------------------
  |  Branch (11217:2): [True: 274k, False: 142k]
  ------------------
11218|       |	    /*
11219|       |	    * Fallback to call xmlXPathCompOpEval().
11220|       |	    */
11221|   274k|	    xmlXPathCompOpEval(ctxt, op);
11222|   274k|	    if (ctxt->error != XPATH_EXPRESSION_OK)
  ------------------
  |  Branch (11222:10): [True: 1.09k, False: 273k]
  ------------------
11223|  1.09k|		return(-1);
11224|       |
11225|   273k|	    resObj = xmlXPathValuePop(ctxt);
11226|   273k|	    if (resObj == NULL)
  ------------------
  |  Branch (11226:10): [True: 0, False: 273k]
  ------------------
11227|      0|		return(-1);
11228|   273k|	    break;
11229|   416k|    }
11230|       |
11231|   388k|    if (resObj) {
  ------------------
  |  Branch (11231:9): [True: 388k, False: 0]
  ------------------
11232|   388k|	int res;
11233|       |
11234|   388k|	if (resObj->type == XPATH_BOOLEAN) {
  ------------------
  |  Branch (11234:6): [True: 190k, False: 197k]
  ------------------
11235|   190k|	    res = resObj->boolval;
11236|   197k|	} else if (isPredicate) {
  ------------------
  |  Branch (11236:13): [True: 197k, 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|   197k|	    res = xmlXPathEvaluatePredicateResult(ctxt, resObj);
11246|   197k|	} else {
11247|      0|	    res = xmlXPathCastToBoolean(resObj);
11248|      0|	}
11249|   388k|	xmlXPathReleaseObject(ctxt->context, resObj);
11250|   388k|	return(res);
11251|   388k|    }
11252|       |
11253|      0|    return(0);
11254|   388k|}
xpath.c:xmlXPathNodeCollectAndTest:
 9793|  1.06M|{
 9794|       |
 9795|  1.06M|#define XP_TEST_HIT \
 9796|  1.06M|    if (hasAxisRange != 0) { \
 9797|  1.06M|	if (++pos == maxPos) { \
 9798|  1.06M|	    if (addNode(seq, cur) < 0) \
 9799|  1.06M|	        xmlXPathPErrMemory(ctxt); \
 9800|  1.06M|	    goto axis_range_end; } \
 9801|  1.06M|    } else { \
 9802|  1.06M|	if (addNode(seq, cur) < 0) \
 9803|  1.06M|	    xmlXPathPErrMemory(ctxt); \
 9804|  1.06M|	if (breakOnFirstHit) goto first_hit; }
 9805|       |
 9806|  1.06M|#define XP_TEST_HIT_NS \
 9807|  1.06M|    if (hasAxisRange != 0) { \
 9808|  1.06M|	if (++pos == maxPos) { \
 9809|  1.06M|	    hasNsNodes = 1; \
 9810|  1.06M|	    if (xmlXPathNodeSetAddNs(seq, xpctxt->node, (xmlNsPtr) cur) < 0) \
 9811|  1.06M|	        xmlXPathPErrMemory(ctxt); \
 9812|  1.06M|	goto axis_range_end; } \
 9813|  1.06M|    } else { \
 9814|  1.06M|	hasNsNodes = 1; \
 9815|  1.06M|	if (xmlXPathNodeSetAddNs(seq, xpctxt->node, (xmlNsPtr) cur) < 0) \
 9816|  1.06M|	    xmlXPathPErrMemory(ctxt); \
 9817|  1.06M|	if (breakOnFirstHit) goto first_hit; }
 9818|       |
 9819|  1.06M|    xmlXPathAxisVal axis = (xmlXPathAxisVal) op->value;
 9820|  1.06M|    xmlXPathTestVal test = (xmlXPathTestVal) op->value2;
 9821|  1.06M|    xmlXPathTypeVal type = (xmlXPathTypeVal) op->value3;
 9822|  1.06M|    const xmlChar *prefix = op->value4;
 9823|  1.06M|    const xmlChar *name = op->value5;
 9824|  1.06M|    const xmlChar *URI = NULL;
 9825|       |
 9826|  1.06M|    int total = 0, hasNsNodes = 0;
 9827|       |    /* The popped object holding the context nodes */
 9828|  1.06M|    xmlXPathObjectPtr obj;
 9829|       |    /* The set of context nodes for the node tests */
 9830|  1.06M|    xmlNodeSetPtr contextSeq;
 9831|  1.06M|    int contextIdx;
 9832|  1.06M|    xmlNodePtr contextNode;
 9833|       |    /* The final resulting node set wrt to all context nodes */
 9834|  1.06M|    xmlNodeSetPtr outSeq;
 9835|       |    /*
 9836|       |    * The temporary resulting node set wrt 1 context node.
 9837|       |    * Used to feed predicate evaluation.
 9838|       |    */
 9839|  1.06M|    xmlNodeSetPtr seq;
 9840|  1.06M|    xmlNodePtr cur;
 9841|       |    /* First predicate operator */
 9842|  1.06M|    xmlXPathStepOpPtr predOp;
 9843|  1.06M|    int maxPos; /* The requested position() (when a "[n]" predicate) */
 9844|  1.06M|    int hasPredicateRange, hasAxisRange, pos;
 9845|  1.06M|    int breakOnFirstHit;
 9846|       |
 9847|  1.06M|    xmlXPathTraversalFunction next = NULL;
 9848|  1.06M|    int (*addNode) (xmlNodeSetPtr, xmlNodePtr);
 9849|  1.06M|    xmlXPathNodeSetMergeFunction mergeAndClear;
 9850|  1.06M|    xmlNodePtr oldContextNode;
 9851|  1.06M|    xmlXPathContextPtr xpctxt = ctxt->context;
 9852|       |
 9853|       |
 9854|  1.06M|    CHECK_TYPE0(XPATH_NODESET);
  ------------------
  |  |  271|  1.06M|    if ((ctxt->value == NULL) || (ctxt->value->type != typeval))	\
  |  |  ------------------
  |  |  |  Branch (271:9): [True: 0, False: 1.06M]
  |  |  |  Branch (271:34): [True: 92, False: 1.06M]
  |  |  ------------------
  |  |  272|  1.06M|        XP_ERROR0(XPATH_INVALID_TYPE)
  |  |  ------------------
  |  |  |  |  252|     92|    { xmlXPathErr(ctxt, X); return(0); }
  |  |  ------------------
  ------------------
 9855|  1.06M|    obj = xmlXPathValuePop(ctxt);
 9856|       |    /*
 9857|       |    * Setup namespaces.
 9858|       |    */
 9859|  1.06M|    if (prefix != NULL) {
  ------------------
  |  Branch (9859:9): [True: 10.4k, False: 1.05M]
  ------------------
 9860|  10.4k|        URI = xmlXPathNsLookup(xpctxt, prefix);
 9861|  10.4k|        if (URI == NULL) {
  ------------------
  |  Branch (9861:13): [True: 144, False: 10.3k]
  ------------------
 9862|    144|	    xmlXPathReleaseObject(xpctxt, obj);
 9863|    144|            xmlXPathErrFmt(ctxt, XPATH_UNDEF_PREFIX_ERROR,
 9864|    144|                           "Undefined namespace prefix: %s\n", prefix);
 9865|    144|            return 0;
 9866|    144|	}
 9867|  10.4k|    }
 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.06M|    mergeAndClear = xmlXPathNodeSetMergeAndClear;
 9882|  1.06M|    switch (axis) {
  ------------------
  |  Branch (9882:13): [True: 1.06M, False: 0]
  ------------------
 9883|    488|        case AXIS_ANCESTOR:
  ------------------
  |  Branch (9883:9): [True: 488, False: 1.06M]
  ------------------
 9884|    488|            first = NULL;
 9885|    488|            next = xmlXPathNextAncestor;
 9886|    488|            break;
 9887|     68|        case AXIS_ANCESTOR_OR_SELF:
  ------------------
  |  Branch (9887:9): [True: 68, False: 1.06M]
  ------------------
 9888|     68|            first = NULL;
 9889|     68|            next = xmlXPathNextAncestorOrSelf;
 9890|     68|            break;
 9891|  21.6k|        case AXIS_ATTRIBUTE:
  ------------------
  |  Branch (9891:9): [True: 21.6k, False: 1.04M]
  ------------------
 9892|  21.6k|            first = NULL;
 9893|  21.6k|	    last = NULL;
 9894|  21.6k|            next = xmlXPathNextAttribute;
 9895|  21.6k|	    mergeAndClear = xmlXPathNodeSetMergeAndClearNoDupls;
 9896|  21.6k|            break;
 9897|   841k|        case AXIS_CHILD:
  ------------------
  |  Branch (9897:9): [True: 841k, False: 228k]
  ------------------
 9898|   841k|	    last = NULL;
 9899|   841k|	    if (((test == NODE_TEST_NAME) || (test == NODE_TEST_ALL)) &&
  ------------------
  |  Branch (9899:11): [True: 663k, False: 177k]
  |  Branch (9899:39): [True: 173k, False: 4.30k]
  ------------------
 9900|   836k|		(type == NODE_TYPE_NODE))
  ------------------
  |  Branch (9900:3): [True: 836k, False: 0]
  ------------------
 9901|   836k|	    {
 9902|       |		/*
 9903|       |		* Optimization if an element node type is 'element'.
 9904|       |		*/
 9905|   836k|		next = xmlXPathNextChildElement;
 9906|   836k|	    } else
 9907|  4.30k|		next = xmlXPathNextChild;
 9908|   841k|	    mergeAndClear = xmlXPathNodeSetMergeAndClearNoDupls;
 9909|   841k|            break;
 9910|  44.2k|        case AXIS_DESCENDANT:
  ------------------
  |  Branch (9910:9): [True: 44.2k, False: 1.02M]
  ------------------
 9911|  44.2k|	    last = NULL;
 9912|  44.2k|            next = xmlXPathNextDescendant;
 9913|  44.2k|            break;
 9914|   122k|        case AXIS_DESCENDANT_OR_SELF:
  ------------------
  |  Branch (9914:9): [True: 122k, False: 947k]
  ------------------
 9915|   122k|	    last = NULL;
 9916|   122k|            next = xmlXPathNextDescendantOrSelf;
 9917|   122k|            break;
 9918|    471|        case AXIS_FOLLOWING:
  ------------------
  |  Branch (9918:9): [True: 471, False: 1.06M]
  ------------------
 9919|    471|	    last = NULL;
 9920|    471|            next = xmlXPathNextFollowing;
 9921|    471|            break;
 9922|      0|        case AXIS_FOLLOWING_SIBLING:
  ------------------
  |  Branch (9922:9): [True: 0, False: 1.06M]
  ------------------
 9923|      0|	    last = NULL;
 9924|      0|            next = xmlXPathNextFollowingSibling;
 9925|      0|            break;
 9926|  1.08k|        case AXIS_NAMESPACE:
  ------------------
  |  Branch (9926:9): [True: 1.08k, False: 1.06M]
  ------------------
 9927|  1.08k|            first = NULL;
 9928|  1.08k|	    last = NULL;
 9929|  1.08k|            next = (xmlXPathTraversalFunction) xmlXPathNextNamespace;
 9930|  1.08k|	    mergeAndClear = xmlXPathNodeSetMergeAndClearNoDupls;
 9931|  1.08k|            break;
 9932|  37.6k|        case AXIS_PARENT:
  ------------------
  |  Branch (9932:9): [True: 37.6k, False: 1.03M]
  ------------------
 9933|  37.6k|            first = NULL;
 9934|  37.6k|            next = xmlXPathNextParent;
 9935|  37.6k|            break;
 9936|     36|        case AXIS_PRECEDING:
  ------------------
  |  Branch (9936:9): [True: 36, False: 1.06M]
  ------------------
 9937|     36|            first = NULL;
 9938|     36|            next = xmlXPathNextPrecedingInternal;
 9939|     36|            break;
 9940|      3|        case AXIS_PRECEDING_SIBLING:
  ------------------
  |  Branch (9940:9): [True: 3, False: 1.06M]
  ------------------
 9941|      3|            first = NULL;
 9942|      3|            next = xmlXPathNextPrecedingSibling;
 9943|      3|            break;
 9944|    144|        case AXIS_SELF:
  ------------------
  |  Branch (9944:9): [True: 144, False: 1.06M]
  ------------------
 9945|    144|            first = NULL;
 9946|    144|	    last = NULL;
 9947|    144|            next = xmlXPathNextSelf;
 9948|    144|	    mergeAndClear = xmlXPathNodeSetMergeAndClearNoDupls;
 9949|    144|            break;
 9950|  1.06M|    }
 9951|       |
 9952|  1.06M|    if (next == NULL) {
  ------------------
  |  Branch (9952:9): [True: 0, False: 1.06M]
  ------------------
 9953|      0|	xmlXPathReleaseObject(xpctxt, obj);
 9954|      0|        return(0);
 9955|      0|    }
 9956|  1.06M|    contextSeq = obj->nodesetval;
 9957|  1.06M|    if ((contextSeq == NULL) || (contextSeq->nodeNr <= 0)) {
  ------------------
  |  Branch (9957:9): [True: 0, False: 1.06M]
  |  Branch (9957:33): [True: 78.2k, False: 991k]
  ------------------
 9958|  78.2k|        xmlXPathValuePush(ctxt, obj);
 9959|  78.2k|        return(0);
 9960|  78.2k|    }
 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|   991k|    maxPos = 0;
 9980|   991k|    predOp = NULL;
 9981|   991k|    hasPredicateRange = 0;
 9982|   991k|    hasAxisRange = 0;
 9983|   991k|    if (op->ch2 != -1) {
  ------------------
  |  Branch (9983:9): [True: 101k, False: 889k]
  ------------------
 9984|       |	/*
 9985|       |	* There's at least one predicate. 16 == XPATH_OP_PREDICATE
 9986|       |	*/
 9987|   101k|	predOp = &ctxt->comp->steps[op->ch2];
 9988|   101k|	if (xmlXPathIsPositionalPredicate(ctxt, predOp, &maxPos)) {
  ------------------
  |  Branch (9988:6): [True: 46.7k, False: 55.1k]
  ------------------
 9989|  46.7k|	    if (predOp->ch1 != -1) {
  ------------------
  |  Branch (9989:10): [True: 25.9k, False: 20.8k]
  ------------------
 9990|       |		/*
 9991|       |		* Use the next inner predicate operator.
 9992|       |		*/
 9993|  25.9k|		predOp = &ctxt->comp->steps[predOp->ch1];
 9994|  25.9k|		hasPredicateRange = 1;
 9995|  25.9k|	    } else {
 9996|       |		/*
 9997|       |		* There's no other predicate than the [n] predicate.
 9998|       |		*/
 9999|  20.8k|		predOp = NULL;
10000|  20.8k|		hasAxisRange = 1;
10001|  20.8k|	    }
10002|  46.7k|	}
10003|   101k|    }
10004|   991k|    breakOnFirstHit = ((toBool) && (predOp == NULL)) ? 1 : 0;
  ------------------
  |  Branch (10004:24): [True: 115k, False: 876k]
  |  Branch (10004:36): [True: 93.4k, False: 21.6k]
  ------------------
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|   991k|    oldContextNode = xpctxt->node;
10019|   991k|    addNode = xmlXPathNodeSetAddUnique;
10020|   991k|    outSeq = NULL;
10021|   991k|    seq = NULL;
10022|   991k|    contextNode = NULL;
10023|   991k|    contextIdx = 0;
10024|       |
10025|       |
10026|  2.86M|    while (((contextIdx < contextSeq->nodeNr) || (contextNode != NULL)) &&
  ------------------
  |  Branch (10026:13): [True: 1.93M, False: 923k]
  |  Branch (10026:50): [True: 0, False: 923k]
  ------------------
10027|  1.93M|           (ctxt->error == XPATH_EXPRESSION_OK)) {
  ------------------
  |  Branch (10027:12): [True: 1.93M, False: 83]
  ------------------
10028|  1.93M|	xpctxt->node = contextSeq->nodeTab[contextIdx++];
10029|       |
10030|  1.93M|	if (seq == NULL) {
  ------------------
  |  Branch (10030:6): [True: 1.00M, False: 932k]
  ------------------
10031|  1.00M|	    seq = xmlXPathNodeSetCreate(NULL);
10032|  1.00M|	    if (seq == NULL) {
  ------------------
  |  Branch (10032:10): [True: 113, False: 1.00M]
  ------------------
10033|    113|                xmlXPathPErrMemory(ctxt);
10034|    113|		total = 0;
10035|    113|		goto error;
10036|    113|	    }
10037|  1.00M|	}
10038|       |	/*
10039|       |	* Traverse the axis and test the nodes.
10040|       |	*/
10041|  1.93M|	pos = 0;
10042|  1.93M|	cur = NULL;
10043|  1.93M|	hasNsNodes = 0;
10044|  7.74M|        do {
10045|  7.74M|            if (OP_LIMIT_EXCEEDED(ctxt, 1))
  ------------------
  |  |  818|  7.74M|    ((ctxt->context->opLimit != 0) && (xmlXPathCheckOpLimit(ctxt, n) < 0))
  |  |  ------------------
  |  |  |  Branch (818:6): [True: 7.74M, False: 0]
  |  |  |  Branch (818:39): [True: 33, False: 7.74M]
  |  |  ------------------
  ------------------
10046|     33|                goto error;
10047|       |
10048|  7.74M|            cur = next(ctxt, cur);
10049|  7.74M|            if (cur == NULL)
  ------------------
  |  Branch (10049:17): [True: 1.88M, False: 5.85M]
  ------------------
10050|  1.88M|                break;
10051|       |
10052|       |	    /*
10053|       |	    * QUESTION TODO: What does the "first" and "last" stuff do?
10054|       |	    */
10055|  5.85M|            if ((first != NULL) && (*first != NULL)) {
  ------------------
  |  Branch (10055:17): [True: 3.65k, False: 5.85M]
  |  Branch (10055:36): [True: 1.62k, False: 2.03k]
  ------------------
10056|  1.62k|		if (*first == cur)
  ------------------
  |  Branch (10056:7): [True: 346, False: 1.27k]
  ------------------
10057|    346|		    break;
10058|  1.27k|		if (((total % 256) == 0) &&
  ------------------
  |  Branch (10058:7): [True: 1.18k, False: 91]
  ------------------
10059|  1.18k|#ifdef XP_OPTIMIZED_NON_ELEM_COMPARISON
10060|  1.18k|		    (xmlXPathCmpNodesExt(*first, cur) >= 0))
  ------------------
  |  Branch (10060:7): [True: 1.08k, False: 101]
  ------------------
10061|       |#else
10062|       |		    (xmlXPathCmpNodes(*first, cur) >= 0))
10063|       |#endif
10064|  1.08k|		{
10065|  1.08k|		    break;
10066|  1.08k|		}
10067|  1.27k|	    }
10068|  5.85M|	    if ((last != NULL) && (*last != NULL)) {
  ------------------
  |  Branch (10068:10): [True: 2.15k, False: 5.85M]
  |  Branch (10068:28): [True: 855, False: 1.30k]
  ------------------
10069|    855|		if (*last == cur)
  ------------------
  |  Branch (10069:7): [True: 119, False: 736]
  ------------------
10070|    119|		    break;
10071|    736|		if (((total % 256) == 0) &&
  ------------------
  |  Branch (10071:7): [True: 490, False: 246]
  ------------------
10072|    490|#ifdef XP_OPTIMIZED_NON_ELEM_COMPARISON
10073|    490|		    (xmlXPathCmpNodesExt(cur, *last) >= 0))
  ------------------
  |  Branch (10073:7): [True: 410, False: 80]
  ------------------
10074|       |#else
10075|       |		    (xmlXPathCmpNodes(cur, *last) >= 0))
10076|       |#endif
10077|    410|		{
10078|    410|		    break;
10079|    410|		}
10080|    736|	    }
10081|       |
10082|  5.85M|            total++;
10083|       |
10084|  5.85M|	    switch (test) {
  ------------------
  |  Branch (10084:14): [True: 5.85M, False: 0]
  ------------------
10085|      0|                case NODE_TEST_NONE:
  ------------------
  |  Branch (10085:17): [True: 0, False: 5.85M]
  ------------------
10086|      0|		    total = 0;
10087|      0|		    goto error;
10088|  2.96M|                case NODE_TEST_TYPE:
  ------------------
  |  Branch (10088:17): [True: 2.96M, False: 2.89M]
  ------------------
10089|  2.96M|		    if (type == NODE_TYPE_NODE) {
  ------------------
  |  Branch (10089:11): [True: 2.90M, False: 62.8k]
  ------------------
10090|  2.90M|			switch (cur->type) {
10091|  94.2k|			    case XML_DOCUMENT_NODE:
  ------------------
  |  Branch (10091:8): [True: 94.2k, False: 2.80M]
  ------------------
10092|  94.2k|			    case XML_HTML_DOCUMENT_NODE:
  ------------------
  |  Branch (10092:8): [True: 0, False: 2.90M]
  ------------------
10093|  2.18M|			    case XML_ELEMENT_NODE:
  ------------------
  |  Branch (10093:8): [True: 2.09M, False: 811k]
  ------------------
10094|  2.18M|			    case XML_ATTRIBUTE_NODE:
  ------------------
  |  Branch (10094:8): [True: 864, False: 2.90M]
  ------------------
10095|  2.22M|			    case XML_PI_NODE:
  ------------------
  |  Branch (10095:8): [True: 39.2k, False: 2.86M]
  ------------------
10096|  2.23M|			    case XML_COMMENT_NODE:
  ------------------
  |  Branch (10096:8): [True: 15.0k, False: 2.88M]
  ------------------
10097|  2.27M|			    case XML_CDATA_SECTION_NODE:
  ------------------
  |  Branch (10097:8): [True: 31.8k, False: 2.86M]
  ------------------
10098|  2.89M|			    case XML_TEXT_NODE:
  ------------------
  |  Branch (10098:8): [True: 624k, False: 2.27M]
  ------------------
10099|  2.89M|				XP_TEST_HIT
  ------------------
  |  | 9796|  2.89M|    if (hasAxisRange != 0) { \
  |  |  ------------------
  |  |  |  Branch (9796:9): [True: 338, False: 2.89M]
  |  |  ------------------
  |  | 9797|    338|	if (++pos == maxPos) { \
  |  |  ------------------
  |  |  |  Branch (9797:6): [True: 82, False: 256]
  |  |  ------------------
  |  | 9798|     82|	    if (addNode(seq, cur) < 0) \
  |  |  ------------------
  |  |  |  Branch (9798:10): [True: 1, False: 81]
  |  |  ------------------
  |  | 9799|     82|	        xmlXPathPErrMemory(ctxt); \
  |  | 9800|     82|	    goto axis_range_end; } \
  |  | 9801|  2.89M|    } else { \
  |  | 9802|  2.89M|	if (addNode(seq, cur) < 0) \
  |  |  ------------------
  |  |  |  Branch (9802:6): [True: 62, False: 2.89M]
  |  |  ------------------
  |  | 9803|  2.89M|	    xmlXPathPErrMemory(ctxt); \
  |  | 9804|  2.89M|	if (breakOnFirstHit) goto first_hit; }
  |  |  ------------------
  |  |  |  Branch (9804:6): [True: 4.41k, False: 2.89M]
  |  |  ------------------
  ------------------
10100|  2.89M|				break;
10101|  2.89M|			    case XML_NAMESPACE_DECL: {
  ------------------
  |  Branch (10101:8): [True: 4.28k, False: 2.89M]
  ------------------
10102|  4.28k|				if (axis == AXIS_NAMESPACE) {
  ------------------
  |  Branch (10102:9): [True: 0, False: 4.28k]
  ------------------
10103|      0|				    XP_TEST_HIT_NS
  ------------------
  |  | 9807|      0|    if (hasAxisRange != 0) { \
  |  |  ------------------
  |  |  |  Branch (9807:9): [True: 0, False: 0]
  |  |  ------------------
  |  | 9808|      0|	if (++pos == maxPos) { \
  |  |  ------------------
  |  |  |  Branch (9808:6): [True: 0, False: 0]
  |  |  ------------------
  |  | 9809|      0|	    hasNsNodes = 1; \
  |  | 9810|      0|	    if (xmlXPathNodeSetAddNs(seq, xpctxt->node, (xmlNsPtr) cur) < 0) \
  |  |  ------------------
  |  |  |  Branch (9810:10): [True: 0, False: 0]
  |  |  ------------------
  |  | 9811|      0|	        xmlXPathPErrMemory(ctxt); \
  |  | 9812|      0|	goto axis_range_end; } \
  |  | 9813|      0|    } else { \
  |  | 9814|      0|	hasNsNodes = 1; \
  |  | 9815|      0|	if (xmlXPathNodeSetAddNs(seq, xpctxt->node, (xmlNsPtr) cur) < 0) \
  |  |  ------------------
  |  |  |  Branch (9815:6): [True: 0, False: 0]
  |  |  ------------------
  |  | 9816|      0|	    xmlXPathPErrMemory(ctxt); \
  |  | 9817|      0|	if (breakOnFirstHit) goto first_hit; }
  |  |  ------------------
  |  |  |  Branch (9817:6): [True: 0, False: 0]
  |  |  ------------------
  ------------------
10104|  4.28k|				} else {
10105|  4.28k|	                            hasNsNodes = 1;
10106|  4.28k|				    XP_TEST_HIT
  ------------------
  |  | 9796|  4.28k|    if (hasAxisRange != 0) { \
  |  |  ------------------
  |  |  |  Branch (9796:9): [True: 0, False: 4.28k]
  |  |  ------------------
  |  | 9797|      0|	if (++pos == maxPos) { \
  |  |  ------------------
  |  |  |  Branch (9797:6): [True: 0, False: 0]
  |  |  ------------------
  |  | 9798|      0|	    if (addNode(seq, cur) < 0) \
  |  |  ------------------
  |  |  |  Branch (9798:10): [True: 0, False: 0]
  |  |  ------------------
  |  | 9799|      0|	        xmlXPathPErrMemory(ctxt); \
  |  | 9800|      0|	    goto axis_range_end; } \
  |  | 9801|  4.28k|    } else { \
  |  | 9802|  4.28k|	if (addNode(seq, cur) < 0) \
  |  |  ------------------
  |  |  |  Branch (9802:6): [True: 8, False: 4.27k]
  |  |  ------------------
  |  | 9803|  4.28k|	    xmlXPathPErrMemory(ctxt); \
  |  | 9804|  4.28k|	if (breakOnFirstHit) goto first_hit; }
  |  |  ------------------
  |  |  |  Branch (9804:6): [True: 0, False: 4.28k]
  |  |  ------------------
  ------------------
10107|  4.28k|				}
10108|  4.28k|				break;
10109|  4.28k|                            }
10110|  4.28k|			    default:
  ------------------
  |  Branch (10110:8): [True: 1.21k, False: 2.90M]
  ------------------
10111|  1.21k|				break;
10112|  2.90M|			}
10113|  2.90M|		    } else if (cur->type == (xmlElementType) type) {
  ------------------
  |  Branch (10113:18): [True: 31.1k, False: 31.7k]
  ------------------
10114|  31.1k|			if (cur->type == XML_NAMESPACE_DECL)
  ------------------
  |  Branch (10114:8): [True: 0, False: 31.1k]
  ------------------
10115|      0|			    XP_TEST_HIT_NS
  ------------------
  |  | 9807|      0|    if (hasAxisRange != 0) { \
  |  |  ------------------
  |  |  |  Branch (9807:9): [True: 0, False: 0]
  |  |  ------------------
  |  | 9808|      0|	if (++pos == maxPos) { \
  |  |  ------------------
  |  |  |  Branch (9808:6): [True: 0, False: 0]
  |  |  ------------------
  |  | 9809|      0|	    hasNsNodes = 1; \
  |  | 9810|      0|	    if (xmlXPathNodeSetAddNs(seq, xpctxt->node, (xmlNsPtr) cur) < 0) \
  |  |  ------------------
  |  |  |  Branch (9810:10): [True: 0, False: 0]
  |  |  ------------------
  |  | 9811|      0|	        xmlXPathPErrMemory(ctxt); \
  |  | 9812|      0|	goto axis_range_end; } \
  |  | 9813|      0|    } else { \
  |  | 9814|      0|	hasNsNodes = 1; \
  |  | 9815|      0|	if (xmlXPathNodeSetAddNs(seq, xpctxt->node, (xmlNsPtr) cur) < 0) \
  |  |  ------------------
  |  |  |  Branch (9815:6): [True: 0, False: 0]
  |  |  ------------------
  |  | 9816|      0|	    xmlXPathPErrMemory(ctxt); \
  |  | 9817|      0|	if (breakOnFirstHit) goto first_hit; }
  |  |  ------------------
  |  |  |  Branch (9817:6): [True: 0, False: 0]
  |  |  ------------------
  ------------------
10116|  31.1k|			else
10117|  31.1k|			    XP_TEST_HIT
  ------------------
  |  | 9796|  31.1k|    if (hasAxisRange != 0) { \
  |  |  ------------------
  |  |  |  Branch (9796:9): [True: 1.35k, False: 29.7k]
  |  |  ------------------
  |  | 9797|  1.35k|	if (++pos == maxPos) { \
  |  |  ------------------
  |  |  |  Branch (9797:6): [True: 167, False: 1.18k]
  |  |  ------------------
  |  | 9798|    167|	    if (addNode(seq, cur) < 0) \
  |  |  ------------------
  |  |  |  Branch (9798:10): [True: 1, False: 166]
  |  |  ------------------
  |  | 9799|    167|	        xmlXPathPErrMemory(ctxt); \
  |  | 9800|    167|	    goto axis_range_end; } \
  |  | 9801|  29.7k|    } else { \
  |  | 9802|  29.7k|	if (addNode(seq, cur) < 0) \
  |  |  ------------------
  |  |  |  Branch (9802:6): [True: 1, False: 29.7k]
  |  |  ------------------
  |  | 9803|  29.7k|	    xmlXPathPErrMemory(ctxt); \
  |  | 9804|  29.7k|	if (breakOnFirstHit) goto first_hit; }
  |  |  ------------------
  |  |  |  Branch (9804:6): [True: 287, False: 29.4k]
  |  |  ------------------
  ------------------
10118|  31.7k|		    } else if ((type == NODE_TYPE_TEXT) &&
  ------------------
  |  Branch (10118:18): [True: 31.6k, False: 32]
  ------------------
10119|  31.6k|			 (cur->type == XML_CDATA_SECTION_NODE))
  ------------------
  |  Branch (10119:5): [True: 10.1k, False: 21.5k]
  ------------------
10120|  10.1k|		    {
10121|  10.1k|			XP_TEST_HIT
  ------------------
  |  | 9796|  10.1k|    if (hasAxisRange != 0) { \
  |  |  ------------------
  |  |  |  Branch (9796:9): [True: 297, False: 9.87k]
  |  |  ------------------
  |  | 9797|    297|	if (++pos == maxPos) { \
  |  |  ------------------
  |  |  |  Branch (9797:6): [True: 42, False: 255]
  |  |  ------------------
  |  | 9798|     42|	    if (addNode(seq, cur) < 0) \
  |  |  ------------------
  |  |  |  Branch (9798:10): [True: 1, False: 41]
  |  |  ------------------
  |  | 9799|     42|	        xmlXPathPErrMemory(ctxt); \
  |  | 9800|     42|	    goto axis_range_end; } \
  |  | 9801|  9.87k|    } else { \
  |  | 9802|  9.87k|	if (addNode(seq, cur) < 0) \
  |  |  ------------------
  |  |  |  Branch (9802:6): [True: 2, False: 9.87k]
  |  |  ------------------
  |  | 9803|  9.87k|	    xmlXPathPErrMemory(ctxt); \
  |  | 9804|  9.87k|	if (breakOnFirstHit) goto first_hit; }
  |  |  ------------------
  |  |  |  Branch (9804:6): [True: 207, False: 9.66k]
  |  |  ------------------
  ------------------
10122|  10.1k|		    }
10123|  2.95M|		    break;
10124|  2.95M|                case NODE_TEST_PI:
  ------------------
  |  Branch (10124:17): [True: 119, False: 5.85M]
  ------------------
10125|    119|                    if ((cur->type == XML_PI_NODE) &&
  ------------------
  |  Branch (10125:25): [True: 36, False: 83]
  ------------------
10126|     36|                        ((name == NULL) || xmlStrEqual(name, cur->name)))
  ------------------
  |  Branch (10126:26): [True: 0, False: 36]
  |  Branch (10126:44): [True: 5, False: 31]
  ------------------
10127|      5|		    {
10128|      5|			XP_TEST_HIT
  ------------------
  |  | 9796|      5|    if (hasAxisRange != 0) { \
  |  |  ------------------
  |  |  |  Branch (9796:9): [True: 0, False: 5]
  |  |  ------------------
  |  | 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|    } else { \
  |  | 9802|      5|	if (addNode(seq, cur) < 0) \
  |  |  ------------------
  |  |  |  Branch (9802:6): [True: 0, False: 5]
  |  |  ------------------
  |  | 9803|      5|	    xmlXPathPErrMemory(ctxt); \
  |  | 9804|      5|	if (breakOnFirstHit) goto first_hit; }
  |  |  ------------------
  |  |  |  Branch (9804:6): [True: 0, False: 5]
  |  |  ------------------
  ------------------
10129|      5|                    }
10130|    119|                    break;
10131|  1.10M|                case NODE_TEST_ALL:
  ------------------
  |  Branch (10131:17): [True: 1.10M, False: 4.74M]
  ------------------
10132|  1.10M|                    if (axis == AXIS_ATTRIBUTE) {
  ------------------
  |  Branch (10132:25): [True: 11.4k, False: 1.09M]
  ------------------
10133|  11.4k|                        if (cur->type == XML_ATTRIBUTE_NODE)
  ------------------
  |  Branch (10133:29): [True: 11.4k, False: 0]
  ------------------
10134|  11.4k|			{
10135|  11.4k|                            if (prefix == NULL)
  ------------------
  |  Branch (10135:33): [True: 10.7k, False: 742]
  ------------------
10136|  10.7k|			    {
10137|  10.7k|				XP_TEST_HIT
  ------------------
  |  | 9796|  10.7k|    if (hasAxisRange != 0) { \
  |  |  ------------------
  |  |  |  Branch (9796:9): [True: 3.15k, False: 7.57k]
  |  |  ------------------
  |  | 9797|  3.15k|	if (++pos == maxPos) { \
  |  |  ------------------
  |  |  |  Branch (9797:6): [True: 777, False: 2.38k]
  |  |  ------------------
  |  | 9798|    777|	    if (addNode(seq, cur) < 0) \
  |  |  ------------------
  |  |  |  Branch (9798:10): [True: 1, False: 776]
  |  |  ------------------
  |  | 9799|    777|	        xmlXPathPErrMemory(ctxt); \
  |  | 9800|    777|	    goto axis_range_end; } \
  |  | 9801|  7.57k|    } else { \
  |  | 9802|  7.57k|	if (addNode(seq, cur) < 0) \
  |  |  ------------------
  |  |  |  Branch (9802:6): [True: 3, False: 7.56k]
  |  |  ------------------
  |  | 9803|  7.57k|	    xmlXPathPErrMemory(ctxt); \
  |  | 9804|  7.57k|	if (breakOnFirstHit) goto first_hit; }
  |  |  ------------------
  |  |  |  Branch (9804:6): [True: 3.39k, False: 4.17k]
  |  |  ------------------
  ------------------
10138|  10.7k|                            } else if ((cur->ns != NULL) &&
  ------------------
  |  Branch (10138:40): [True: 544, False: 198]
  ------------------
10139|    544|				(xmlStrEqual(URI, cur->ns->href)))
  ------------------
  |  Branch (10139:5): [True: 544, False: 0]
  ------------------
10140|    544|			    {
10141|    544|				XP_TEST_HIT
  ------------------
  |  | 9796|    544|    if (hasAxisRange != 0) { \
  |  |  ------------------
  |  |  |  Branch (9796:9): [True: 290, False: 254]
  |  |  ------------------
  |  | 9797|    290|	if (++pos == maxPos) { \
  |  |  ------------------
  |  |  |  Branch (9797:6): [True: 75, False: 215]
  |  |  ------------------
  |  | 9798|     75|	    if (addNode(seq, cur) < 0) \
  |  |  ------------------
  |  |  |  Branch (9798:10): [True: 1, False: 74]
  |  |  ------------------
  |  | 9799|     75|	        xmlXPathPErrMemory(ctxt); \
  |  | 9800|     75|	    goto axis_range_end; } \
  |  | 9801|    290|    } else { \
  |  | 9802|    254|	if (addNode(seq, cur) < 0) \
  |  |  ------------------
  |  |  |  Branch (9802:6): [True: 1, False: 253]
  |  |  ------------------
  |  | 9803|    254|	    xmlXPathPErrMemory(ctxt); \
  |  | 9804|    254|	if (breakOnFirstHit) goto first_hit; }
  |  |  ------------------
  |  |  |  Branch (9804:6): [True: 50, False: 204]
  |  |  ------------------
  ------------------
10142|    544|                            }
10143|  11.4k|                        }
10144|  1.09M|                    } else if (axis == AXIS_NAMESPACE) {
  ------------------
  |  Branch (10144:32): [True: 35.9k, False: 1.06M]
  ------------------
10145|  35.9k|                        if (cur->type == XML_NAMESPACE_DECL)
  ------------------
  |  Branch (10145:29): [True: 35.9k, False: 0]
  ------------------
10146|  35.9k|			{
10147|  35.9k|			    XP_TEST_HIT_NS
  ------------------
  |  | 9807|  35.9k|    if (hasAxisRange != 0) { \
  |  |  ------------------
  |  |  |  Branch (9807:9): [True: 1.08k, False: 34.8k]
  |  |  ------------------
  |  | 9808|  1.08k|	if (++pos == maxPos) { \
  |  |  ------------------
  |  |  |  Branch (9808:6): [True: 390, False: 697]
  |  |  ------------------
  |  | 9809|    390|	    hasNsNodes = 1; \
  |  | 9810|    390|	    if (xmlXPathNodeSetAddNs(seq, xpctxt->node, (xmlNsPtr) cur) < 0) \
  |  |  ------------------
  |  |  |  Branch (9810:10): [True: 4, False: 386]
  |  |  ------------------
  |  | 9811|    390|	        xmlXPathPErrMemory(ctxt); \
  |  | 9812|    390|	goto axis_range_end; } \
  |  | 9813|  34.8k|    } else { \
  |  | 9814|  34.8k|	hasNsNodes = 1; \
  |  | 9815|  34.8k|	if (xmlXPathNodeSetAddNs(seq, xpctxt->node, (xmlNsPtr) cur) < 0) \
  |  |  ------------------
  |  |  |  Branch (9815:6): [True: 19, False: 34.8k]
  |  |  ------------------
  |  | 9816|  34.8k|	    xmlXPathPErrMemory(ctxt); \
  |  | 9817|  34.8k|	if (breakOnFirstHit) goto first_hit; }
  |  |  ------------------
  |  |  |  Branch (9817:6): [True: 0, False: 34.8k]
  |  |  ------------------
  ------------------
10148|  35.9k|                        }
10149|  1.06M|                    } else {
10150|  1.06M|                        if (cur->type == XML_ELEMENT_NODE) {
  ------------------
  |  Branch (10150:29): [True: 984k, False: 77.6k]
  ------------------
10151|   984k|                            if (prefix == NULL)
  ------------------
  |  Branch (10151:33): [True: 978k, False: 5.20k]
  ------------------
10152|   978k|			    {
10153|   978k|				XP_TEST_HIT
  ------------------
  |  | 9796|   978k|    if (hasAxisRange != 0) { \
  |  |  ------------------
  |  |  |  Branch (9796:9): [True: 28.9k, False: 950k]
  |  |  ------------------
  |  | 9797|  28.9k|	if (++pos == maxPos) { \
  |  |  ------------------
  |  |  |  Branch (9797:6): [True: 5.94k, False: 22.9k]
  |  |  ------------------
  |  | 9798|  5.94k|	    if (addNode(seq, cur) < 0) \
  |  |  ------------------
  |  |  |  Branch (9798:10): [True: 2, False: 5.94k]
  |  |  ------------------
  |  | 9799|  5.94k|	        xmlXPathPErrMemory(ctxt); \
  |  | 9800|  5.94k|	    goto axis_range_end; } \
  |  | 9801|   950k|    } else { \
  |  | 9802|   950k|	if (addNode(seq, cur) < 0) \
  |  |  ------------------
  |  |  |  Branch (9802:6): [True: 32, False: 950k]
  |  |  ------------------
  |  | 9803|   950k|	    xmlXPathPErrMemory(ctxt); \
  |  | 9804|   950k|	if (breakOnFirstHit) goto first_hit; }
  |  |  ------------------
  |  |  |  Branch (9804:6): [True: 29.3k, False: 920k]
  |  |  ------------------
  ------------------
10154|       |
10155|   978k|                            } else if ((cur->ns != NULL) &&
  ------------------
  |  Branch (10155:40): [True: 932, False: 4.27k]
  ------------------
10156|    932|				(xmlStrEqual(URI, cur->ns->href)))
  ------------------
  |  Branch (10156:5): [True: 575, False: 357]
  ------------------
10157|    575|			    {
10158|    575|				XP_TEST_HIT
  ------------------
  |  | 9796|    575|    if (hasAxisRange != 0) { \
  |  |  ------------------
  |  |  |  Branch (9796:9): [True: 109, False: 466]
  |  |  ------------------
  |  | 9797|    109|	if (++pos == maxPos) { \
  |  |  ------------------
  |  |  |  Branch (9797:6): [True: 70, False: 39]
  |  |  ------------------
  |  | 9798|     70|	    if (addNode(seq, cur) < 0) \
  |  |  ------------------
  |  |  |  Branch (9798:10): [True: 1, False: 69]
  |  |  ------------------
  |  | 9799|     70|	        xmlXPathPErrMemory(ctxt); \
  |  | 9800|     70|	    goto axis_range_end; } \
  |  | 9801|    466|    } else { \
  |  | 9802|    466|	if (addNode(seq, cur) < 0) \
  |  |  ------------------
  |  |  |  Branch (9802:6): [True: 2, False: 464]
  |  |  ------------------
  |  | 9803|    466|	    xmlXPathPErrMemory(ctxt); \
  |  | 9804|    466|	if (breakOnFirstHit) goto first_hit; }
  |  |  ------------------
  |  |  |  Branch (9804:6): [True: 185, False: 281]
  |  |  ------------------
  ------------------
10159|    575|                            }
10160|   984k|                        }
10161|  1.06M|                    }
10162|  1.06M|                    break;
10163|  1.06M|                case NODE_TEST_NS:{
  ------------------
  |  Branch (10163:17): [True: 0, False: 5.85M]
  ------------------
10164|       |                        /* TODO */
10165|      0|                        break;
10166|  1.10M|                    }
10167|  1.78M|                case NODE_TEST_NAME:
  ------------------
  |  Branch (10167:17): [True: 1.78M, False: 4.07M]
  ------------------
10168|  1.78M|                    if (axis == AXIS_ATTRIBUTE) {
  ------------------
  |  Branch (10168:25): [True: 4.30k, False: 1.77M]
  ------------------
10169|  4.30k|                        if (cur->type != XML_ATTRIBUTE_NODE)
  ------------------
  |  Branch (10169:29): [True: 0, False: 4.30k]
  ------------------
10170|      0|			    break;
10171|  1.77M|		    } else if (axis == AXIS_NAMESPACE) {
  ------------------
  |  Branch (10171:18): [True: 1.28k, False: 1.77M]
  ------------------
10172|  1.28k|                        if (cur->type != XML_NAMESPACE_DECL)
  ------------------
  |  Branch (10172:29): [True: 0, False: 1.28k]
  ------------------
10173|      0|			    break;
10174|  1.77M|		    } else {
10175|  1.77M|		        if (cur->type != XML_ELEMENT_NODE)
  ------------------
  |  Branch (10175:15): [True: 267k, False: 1.51M]
  ------------------
10176|   267k|			    break;
10177|  1.77M|		    }
10178|  1.51M|                    switch (cur->type) {
10179|  1.51M|                        case XML_ELEMENT_NODE:
  ------------------
  |  Branch (10179:25): [True: 1.51M, False: 5.58k]
  ------------------
10180|  1.51M|                            if (xmlStrEqual(name, cur->name)) {
  ------------------
  |  Branch (10180:33): [True: 298k, False: 1.21M]
  ------------------
10181|   298k|                                if (prefix == NULL) {
  ------------------
  |  Branch (10181:37): [True: 292k, False: 6.82k]
  ------------------
10182|   292k|                                    if (cur->ns == NULL)
  ------------------
  |  Branch (10182:41): [True: 291k, False: 595]
  ------------------
10183|   291k|				    {
10184|   291k|					XP_TEST_HIT
  ------------------
  |  | 9796|   291k|    if (hasAxisRange != 0) { \
  |  |  ------------------
  |  |  |  Branch (9796:9): [True: 17.8k, False: 273k]
  |  |  ------------------
  |  | 9797|  17.8k|	if (++pos == maxPos) { \
  |  |  ------------------
  |  |  |  Branch (9797:6): [True: 7.03k, False: 10.7k]
  |  |  ------------------
  |  | 9798|  7.03k|	    if (addNode(seq, cur) < 0) \
  |  |  ------------------
  |  |  |  Branch (9798:10): [True: 1, False: 7.03k]
  |  |  ------------------
  |  | 9799|  7.03k|	        xmlXPathPErrMemory(ctxt); \
  |  | 9800|  7.03k|	    goto axis_range_end; } \
  |  | 9801|   273k|    } else { \
  |  | 9802|   273k|	if (addNode(seq, cur) < 0) \
  |  |  ------------------
  |  |  |  Branch (9802:6): [True: 7, False: 273k]
  |  |  ------------------
  |  | 9803|   273k|	    xmlXPathPErrMemory(ctxt); \
  |  | 9804|   273k|	if (breakOnFirstHit) goto first_hit; }
  |  |  ------------------
  |  |  |  Branch (9804:6): [True: 100, False: 273k]
  |  |  ------------------
  ------------------
10185|   291k|                                    }
10186|   292k|                                } else {
10187|  6.82k|                                    if ((cur->ns != NULL) &&
  ------------------
  |  Branch (10187:41): [True: 405, False: 6.41k]
  ------------------
10188|    405|                                        (xmlStrEqual(URI, cur->ns->href)))
  ------------------
  |  Branch (10188:41): [True: 87, False: 318]
  ------------------
10189|     87|				    {
10190|     87|					XP_TEST_HIT
  ------------------
  |  | 9796|     87|    if (hasAxisRange != 0) { \
  |  |  ------------------
  |  |  |  Branch (9796:9): [True: 0, False: 87]
  |  |  ------------------
  |  | 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|     87|    } else { \
  |  | 9802|     87|	if (addNode(seq, cur) < 0) \
  |  |  ------------------
  |  |  |  Branch (9802:6): [True: 1, False: 86]
  |  |  ------------------
  |  | 9803|     87|	    xmlXPathPErrMemory(ctxt); \
  |  | 9804|     87|	if (breakOnFirstHit) goto first_hit; }
  |  |  ------------------
  |  |  |  Branch (9804:6): [True: 0, False: 87]
  |  |  ------------------
  ------------------
10191|     87|                                    }
10192|  6.82k|                                }
10193|   298k|                            }
10194|  1.50M|                            break;
10195|  1.50M|                        case XML_ATTRIBUTE_NODE:{
  ------------------
  |  Branch (10195:25): [True: 4.30k, False: 1.51M]
  ------------------
10196|  4.30k|                                xmlAttrPtr attr = (xmlAttrPtr) cur;
10197|       |
10198|  4.30k|                                if (xmlStrEqual(name, attr->name)) {
  ------------------
  |  Branch (10198:37): [True: 3.03k, False: 1.26k]
  ------------------
10199|  3.03k|                                    if (prefix == NULL) {
  ------------------
  |  Branch (10199:41): [True: 2.54k, False: 496]
  ------------------
10200|  2.54k|                                        if ((attr->ns == NULL) ||
  ------------------
  |  Branch (10200:45): [True: 2.46k, False: 80]
  ------------------
10201|     80|                                            (attr->ns->prefix == NULL))
  ------------------
  |  Branch (10201:45): [True: 0, False: 80]
  ------------------
10202|  2.46k|					{
10203|  2.46k|					    XP_TEST_HIT
  ------------------
  |  | 9796|  2.46k|    if (hasAxisRange != 0) { \
  |  |  ------------------
  |  |  |  Branch (9796:9): [True: 2.02k, False: 438]
  |  |  ------------------
  |  | 9797|  2.02k|	if (++pos == maxPos) { \
  |  |  ------------------
  |  |  |  Branch (9797:6): [True: 746, False: 1.27k]
  |  |  ------------------
  |  | 9798|    746|	    if (addNode(seq, cur) < 0) \
  |  |  ------------------
  |  |  |  Branch (9798:10): [True: 1, False: 745]
  |  |  ------------------
  |  | 9799|    746|	        xmlXPathPErrMemory(ctxt); \
  |  | 9800|    746|	    goto axis_range_end; } \
  |  | 9801|  2.02k|    } else { \
  |  | 9802|    438|	if (addNode(seq, cur) < 0) \
  |  |  ------------------
  |  |  |  Branch (9802:6): [True: 1, False: 437]
  |  |  ------------------
  |  | 9803|    438|	    xmlXPathPErrMemory(ctxt); \
  |  | 9804|    438|	if (breakOnFirstHit) goto first_hit; }
  |  |  ------------------
  |  |  |  Branch (9804:6): [True: 31, False: 407]
  |  |  ------------------
  ------------------
10204|  2.46k|                                        }
10205|  2.54k|                                    } else {
10206|    496|                                        if ((attr->ns != NULL) &&
  ------------------
  |  Branch (10206:45): [True: 1, False: 495]
  ------------------
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|    496|                                    }
10213|  3.03k|                                }
10214|  3.52k|                                break;
10215|  4.30k|                            }
10216|  3.52k|                        case XML_NAMESPACE_DECL:
  ------------------
  |  Branch (10216:25): [True: 1.28k, False: 1.51M]
  ------------------
10217|  1.28k|                            if (cur->type == XML_NAMESPACE_DECL) {
  ------------------
  |  Branch (10217:33): [True: 1.28k, False: 0]
  ------------------
10218|  1.28k|                                xmlNsPtr ns = (xmlNsPtr) cur;
10219|       |
10220|  1.28k|                                if ((ns->prefix != NULL) && (name != NULL)
  ------------------
  |  Branch (10220:37): [True: 1.16k, False: 124]
  |  Branch (10220:61): [True: 1.16k, False: 0]
  ------------------
10221|  1.16k|                                    && (xmlStrEqual(ns->prefix, name)))
  ------------------
  |  Branch (10221:40): [True: 516, False: 646]
  ------------------
10222|    516|				{
10223|    516|				    XP_TEST_HIT_NS
  ------------------
  |  | 9807|    516|    if (hasAxisRange != 0) { \
  |  |  ------------------
  |  |  |  Branch (9807:9): [True: 172, False: 344]
  |  |  ------------------
  |  | 9808|    172|	if (++pos == maxPos) { \
  |  |  ------------------
  |  |  |  Branch (9808:6): [True: 93, False: 79]
  |  |  ------------------
  |  | 9809|     93|	    hasNsNodes = 1; \
  |  | 9810|     93|	    if (xmlXPathNodeSetAddNs(seq, xpctxt->node, (xmlNsPtr) cur) < 0) \
  |  |  ------------------
  |  |  |  Branch (9810:10): [True: 2, False: 91]
  |  |  ------------------
  |  | 9811|     93|	        xmlXPathPErrMemory(ctxt); \
  |  | 9812|     93|	goto axis_range_end; } \
  |  | 9813|    344|    } else { \
  |  | 9814|    344|	hasNsNodes = 1; \
  |  | 9815|    344|	if (xmlXPathNodeSetAddNs(seq, xpctxt->node, (xmlNsPtr) cur) < 0) \
  |  |  ------------------
  |  |  |  Branch (9815:6): [True: 2, False: 342]
  |  |  ------------------
  |  | 9816|    344|	    xmlXPathPErrMemory(ctxt); \
  |  | 9817|    344|	if (breakOnFirstHit) goto first_hit; }
  |  |  ------------------
  |  |  |  Branch (9817:6): [True: 0, False: 344]
  |  |  ------------------
  ------------------
10224|    516|                                }
10225|  1.28k|                            }
10226|  1.19k|                            break;
10227|  1.19k|                        default:
  ------------------
  |  Branch (10227:25): [True: 0, False: 1.51M]
  ------------------
10228|      0|                            break;
10229|  1.51M|                    }
10230|  1.50M|                    break;
10231|  5.85M|	    } /* switch(test) */
10232|  5.85M|        } while ((cur != NULL) && (ctxt->error == XPATH_EXPRESSION_OK));
  ------------------
  |  Branch (10232:18): [True: 5.80M, False: 0]
  |  Branch (10232:35): [True: 5.80M, False: 138]
  ------------------
10233|       |
10234|  1.88M|	goto apply_predicates;
10235|       |
10236|  1.88M|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|  15.4k|	if (outSeq == NULL) {
  ------------------
  |  Branch (10243:6): [True: 14.3k, False: 1.06k]
  ------------------
10244|  14.3k|	    outSeq = seq;
10245|  14.3k|	    seq = NULL;
10246|  14.3k|	} else {
10247|  1.06k|	    outSeq = mergeAndClear(outSeq, seq);
10248|  1.06k|            if (outSeq == NULL)
  ------------------
  |  Branch (10248:17): [True: 5, False: 1.06k]
  ------------------
10249|      5|                xmlXPathPErrMemory(ctxt);
10250|  1.06k|        }
10251|       |	/*
10252|       |	* Break if only a true/false result was requested.
10253|       |	*/
10254|  15.4k|	if (toBool)
  ------------------
  |  Branch (10254:6): [True: 13.5k, False: 1.90k]
  ------------------
10255|  13.5k|	    break;
10256|  1.90k|	continue;
10257|       |
10258|  38.0k|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|  38.0k|	if (outSeq == NULL) {
  ------------------
  |  Branch (10263:6): [True: 38.0k, False: 0]
  ------------------
10264|  38.0k|	    outSeq = seq;
10265|  38.0k|	    seq = NULL;
10266|  38.0k|	} 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|  38.0k|	break;
10272|       |
10273|  1.88M|apply_predicates: /* --------------------------------------------------- */
10274|  1.88M|        if (ctxt->error != XPATH_EXPRESSION_OK)
  ------------------
  |  Branch (10274:13): [True: 143, False: 1.88M]
  ------------------
10275|    143|	    goto error;
10276|       |
10277|       |        /*
10278|       |	* Apply predicates.
10279|       |	*/
10280|  1.88M|        if ((predOp != NULL) && (seq->nodeNr > 0)) {
  ------------------
  |  Branch (10280:13): [True: 522k, False: 1.36M]
  |  Branch (10280:33): [True: 116k, False: 405k]
  ------------------
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|   116k|	    if (hasPredicateRange != 0)
  ------------------
  |  Branch (10309:10): [True: 8.40k, False: 108k]
  ------------------
10310|  8.40k|		xmlXPathCompOpEvalPredicate(ctxt, predOp, seq, maxPos, maxPos,
10311|  8.40k|					    hasNsNodes);
10312|   108k|	    else
10313|   108k|		xmlXPathCompOpEvalPredicate(ctxt, predOp, seq, 1, seq->nodeNr,
10314|   108k|					    hasNsNodes);
10315|       |
10316|   116k|	    if (ctxt->error != XPATH_EXPRESSION_OK) {
  ------------------
  |  Branch (10316:10): [True: 1.44k, False: 115k]
  ------------------
10317|  1.44k|		total = 0;
10318|  1.44k|		goto error;
10319|  1.44k|	    }
10320|   116k|        }
10321|       |
10322|  1.88M|        if (seq->nodeNr > 0) {
  ------------------
  |  Branch (10322:13): [True: 452k, False: 1.43M]
  ------------------
10323|       |	    /*
10324|       |	    * Add to result set.
10325|       |	    */
10326|   452k|	    if (outSeq == NULL) {
  ------------------
  |  Branch (10326:10): [True: 215k, False: 236k]
  ------------------
10327|   215k|		outSeq = seq;
10328|   215k|		seq = NULL;
10329|   236k|	    } else {
10330|   236k|		outSeq = mergeAndClear(outSeq, seq);
10331|   236k|                if (outSeq == NULL)
  ------------------
  |  Branch (10331:21): [True: 80, False: 236k]
  ------------------
10332|     80|                    xmlXPathPErrMemory(ctxt);
10333|   236k|	    }
10334|       |
10335|   452k|            if (toBool)
  ------------------
  |  Branch (10335:17): [True: 14.0k, False: 438k]
  ------------------
10336|  14.0k|                break;
10337|   452k|	}
10338|  1.88M|    }
10339|       |
10340|   991k|error:
10341|   991k|    if ((obj->boolval) && (obj->user != NULL)) {
  ------------------
  |  Branch (10341:9): [True: 0, False: 991k]
  |  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|   991k|    xmlXPathReleaseObject(xpctxt, obj);
10353|       |
10354|       |    /*
10355|       |    * Ensure we return at least an empty set.
10356|       |    */
10357|   991k|    if (outSeq == NULL) {
  ------------------
  |  Branch (10357:9): [True: 723k, False: 268k]
  ------------------
10358|   723k|	if ((seq != NULL) && (seq->nodeNr == 0)) {
  ------------------
  |  Branch (10358:6): [True: 723k, False: 109]
  |  Branch (10358:23): [True: 723k, False: 98]
  ------------------
10359|   723k|	    outSeq = seq;
10360|   723k|        } else {
10361|    207|	    outSeq = xmlXPathNodeSetCreate(NULL);
10362|    207|            if (outSeq == NULL)
  ------------------
  |  Branch (10362:17): [True: 1, False: 206]
  ------------------
10363|      1|                xmlXPathPErrMemory(ctxt);
10364|    207|        }
10365|   723k|    }
10366|   991k|    if ((seq != NULL) && (seq != outSeq)) {
  ------------------
  |  Branch (10366:9): [True: 737k, False: 253k]
  |  Branch (10366:26): [True: 14.4k, False: 723k]
  ------------------
10367|  14.4k|	 xmlXPathFreeNodeSet(seq);
10368|  14.4k|    }
10369|       |    /*
10370|       |    * Hand over the result. Better to push the set also in
10371|       |    * case of errors.
10372|       |    */
10373|   991k|    xmlXPathValuePush(ctxt, xmlXPathCacheWrapNodeSet(ctxt, outSeq));
10374|       |    /*
10375|       |    * Reset the context node.
10376|       |    */
10377|   991k|    xpctxt->node = oldContextNode;
10378|       |    /*
10379|       |    * When traversing the namespace axis in "toBool" mode, it's
10380|       |    * possible that tmpNsList wasn't freed.
10381|       |    */
10382|   991k|    if (xpctxt->tmpNsList != NULL) {
  ------------------
  |  Branch (10382:9): [True: 68, False: 991k]
  ------------------
10383|     68|        xmlFree(xpctxt->tmpNsList);
10384|     68|        xpctxt->tmpNsList = NULL;
10385|     68|    }
10386|       |
10387|   991k|    return(total);
10388|   991k|}
xpath.c:xmlXPathNodeSetMergeAndClear:
 2958|   111k|{
 2959|   111k|    {
 2960|   111k|	int i, j, initNbSet1;
 2961|   111k|	xmlNodePtr n1, n2;
 2962|       |
 2963|   111k|	initNbSet1 = set1->nodeNr;
 2964|   277k|	for (i = 0;i < set2->nodeNr;i++) {
  ------------------
  |  Branch (2964:13): [True: 166k, False: 111k]
  ------------------
 2965|   166k|	    n2 = set2->nodeTab[i];
 2966|       |	    /*
 2967|       |	    * Skip duplicates.
 2968|       |	    */
 2969|  4.93M|	    for (j = 0; j < initNbSet1; j++) {
  ------------------
  |  Branch (2969:18): [True: 4.87M, False: 54.5k]
  ------------------
 2970|  4.87M|		n1 = set1->nodeTab[j];
 2971|  4.87M|		if (n1 == n2) {
  ------------------
  |  Branch (2971:7): [True: 111k, False: 4.76M]
  ------------------
 2972|   111k|		    goto skip_node;
 2973|  4.76M|		} else if ((n1->type == XML_NAMESPACE_DECL) &&
  ------------------
  |  Branch (2973:14): [True: 100k, False: 4.66M]
  ------------------
 2974|   100k|		    (n2->type == XML_NAMESPACE_DECL))
  ------------------
  |  Branch (2974:7): [True: 100k, False: 0]
  ------------------
 2975|   100k|		{
 2976|   100k|		    if ((((xmlNsPtr) n1)->next == ((xmlNsPtr) n2)->next) &&
  ------------------
  |  Branch (2976:11): [True: 4.06k, False: 96.1k]
  ------------------
 2977|  4.06k|			(xmlStrEqual(((xmlNsPtr) n1)->prefix,
  ------------------
  |  Branch (2977:4): [True: 0, False: 4.06k]
  ------------------
 2978|  4.06k|			((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|   100k|		}
 2987|  4.87M|	    }
 2988|       |	    /*
 2989|       |	    * grow the nodeTab if needed
 2990|       |	    */
 2991|  54.5k|            if (set1->nodeNr >= set1->nodeMax) {
  ------------------
  |  Branch (2991:17): [True: 10.2k, False: 44.2k]
  ------------------
 2992|  10.2k|                if (xmlXPathNodeSetGrow(set1) < 0)
  ------------------
  |  Branch (2992:21): [True: 33, False: 10.2k]
  ------------------
 2993|     33|                    goto error;
 2994|  10.2k|            }
 2995|  54.5k|	    set1->nodeTab[set1->nodeNr++] = n2;
 2996|   166k|skip_node:
 2997|   166k|            set2->nodeTab[i] = NULL;
 2998|   166k|	}
 2999|   111k|    }
 3000|   111k|    set2->nodeNr = 0;
 3001|   111k|    return(set1);
 3002|       |
 3003|     33|error:
 3004|     33|    xmlXPathFreeNodeSet(set1);
 3005|     33|    xmlXPathNodeSetClear(set2, 1);
 3006|       |    return(NULL);
 3007|   111k|}
xpath.c:xmlXPathNodeSetClear:
 3154|  1.68k|{
 3155|  1.68k|    xmlXPathNodeSetClearFromPos(set, 0, hasNsNodes);
 3156|  1.68k|}
xpath.c:xmlXPathNodeSetClearFromPos:
 3127|  1.77k|{
 3128|  1.77k|    if ((set == NULL) || (pos >= set->nodeNr))
  ------------------
  |  Branch (3128:9): [True: 0, False: 1.77k]
  |  Branch (3128:26): [True: 0, False: 1.77k]
  ------------------
 3129|      0|	return;
 3130|  1.77k|    else if ((hasNsNodes)) {
  ------------------
  |  Branch (3130:14): [True: 177, False: 1.59k]
  ------------------
 3131|    177|	int i;
 3132|    177|	xmlNodePtr node;
 3133|       |
 3134|  2.84k|	for (i = pos; i < set->nodeNr; i++) {
  ------------------
  |  Branch (3134:16): [True: 2.66k, False: 177]
  ------------------
 3135|  2.66k|	    node = set->nodeTab[i];
 3136|  2.66k|	    if ((node != NULL) &&
  ------------------
  |  Branch (3136:10): [True: 2.08k, False: 577]
  ------------------
 3137|  2.08k|		(node->type == XML_NAMESPACE_DECL))
  ------------------
  |  Branch (3137:3): [True: 46, False: 2.04k]
  ------------------
 3138|     46|		xmlXPathNodeSetFreeNs((xmlNsPtr) node);
 3139|  2.66k|	}
 3140|    177|    }
 3141|  1.77k|    set->nodeNr = pos;
 3142|  1.77k|}
xpath.c:xmlXPathNodeSetMergeAndClearNoDupls:
 3021|   126k|{
 3022|   126k|    {
 3023|   126k|	int i;
 3024|   126k|	xmlNodePtr n2;
 3025|       |
 3026|   386k|	for (i = 0;i < set2->nodeNr;i++) {
  ------------------
  |  Branch (3026:13): [True: 259k, False: 126k]
  ------------------
 3027|   259k|	    n2 = set2->nodeTab[i];
 3028|   259k|            if (set1->nodeNr >= set1->nodeMax) {
  ------------------
  |  Branch (3028:17): [True: 36.1k, False: 223k]
  ------------------
 3029|  36.1k|                if (xmlXPathNodeSetGrow(set1) < 0)
  ------------------
  |  Branch (3029:21): [True: 52, False: 36.1k]
  ------------------
 3030|     52|                    goto error;
 3031|  36.1k|            }
 3032|   259k|	    set1->nodeTab[set1->nodeNr++] = n2;
 3033|   259k|            set2->nodeTab[i] = NULL;
 3034|   259k|	}
 3035|   126k|    }
 3036|   126k|    set2->nodeNr = 0;
 3037|   126k|    return(set1);
 3038|       |
 3039|     52|error:
 3040|     52|    xmlXPathFreeNodeSet(set1);
 3041|     52|    xmlXPathNodeSetClear(set2, 1);
 3042|       |    return(NULL);
 3043|   126k|}
xpath.c:xmlXPathNextChildElement:
 6200|  2.72M|xmlXPathNextChildElement(xmlXPathParserContextPtr ctxt, xmlNodePtr cur) {
 6201|  2.72M|    if ((ctxt == NULL) || (ctxt->context == NULL)) return(NULL);
  ------------------
  |  Branch (6201:9): [True: 0, False: 2.72M]
  |  Branch (6201:27): [True: 0, False: 2.72M]
  ------------------
 6202|  2.72M|    if (cur == NULL) {
  ------------------
  |  Branch (6202:9): [True: 1.33M, False: 1.38M]
  ------------------
 6203|  1.33M|	cur = ctxt->context->node;
 6204|  1.33M|	if (cur == NULL) return(NULL);
  ------------------
  |  Branch (6204:6): [True: 0, False: 1.33M]
  ------------------
 6205|       |	/*
 6206|       |	* Get the first element child.
 6207|       |	*/
 6208|  1.33M|	switch (cur->type) {
 6209|  1.05M|            case XML_ELEMENT_NODE:
  ------------------
  |  Branch (6209:13): [True: 1.05M, False: 277k]
  ------------------
 6210|  1.05M|	    case XML_DOCUMENT_FRAG_NODE:
  ------------------
  |  Branch (6210:6): [True: 0, False: 1.33M]
  ------------------
 6211|  1.05M|	    case XML_ENTITY_REF_NODE: /* URGENT TODO: entify-refs as well? */
  ------------------
  |  Branch (6211:6): [True: 0, False: 1.33M]
  ------------------
 6212|  1.05M|            case XML_ENTITY_NODE:
  ------------------
  |  Branch (6212:13): [True: 0, False: 1.33M]
  ------------------
 6213|  1.05M|		cur = cur->children;
 6214|  1.05M|		if (cur != NULL) {
  ------------------
  |  Branch (6214:7): [True: 429k, False: 628k]
  ------------------
 6215|   429k|		    if (cur->type == XML_ELEMENT_NODE)
  ------------------
  |  Branch (6215:11): [True: 222k, False: 207k]
  ------------------
 6216|   222k|			return(cur);
 6217|   221k|		    do {
 6218|   221k|			cur = cur->next;
 6219|   221k|		    } while ((cur != NULL) &&
  ------------------
  |  Branch (6219:16): [True: 119k, False: 102k]
  ------------------
 6220|   119k|			(cur->type != XML_ELEMENT_NODE));
  ------------------
  |  Branch (6220:4): [True: 14.4k, False: 104k]
  ------------------
 6221|   207k|		    return(cur);
 6222|   429k|		}
 6223|   628k|		return(NULL);
 6224|   161k|            case XML_DOCUMENT_NODE:
  ------------------
  |  Branch (6224:13): [True: 161k, False: 1.17M]
  ------------------
 6225|   161k|            case XML_HTML_DOCUMENT_NODE:
  ------------------
  |  Branch (6225:13): [True: 0, False: 1.33M]
  ------------------
 6226|   161k|		return(xmlDocGetRootElement((xmlDocPtr) cur));
 6227|   115k|	    default:
  ------------------
  |  Branch (6227:6): [True: 115k, False: 1.21M]
  ------------------
 6228|   115k|		return(NULL);
 6229|  1.33M|	}
 6230|      0|	return(NULL);
 6231|  1.33M|    }
 6232|       |    /*
 6233|       |    * Get the next sibling element node.
 6234|       |    */
 6235|  1.38M|    switch (cur->type) {
 6236|  1.38M|	case XML_ELEMENT_NODE:
  ------------------
  |  Branch (6236:2): [True: 1.38M, False: 0]
  ------------------
 6237|  1.38M|	case XML_TEXT_NODE:
  ------------------
  |  Branch (6237:2): [True: 0, False: 1.38M]
  ------------------
 6238|  1.38M|	case XML_ENTITY_REF_NODE:
  ------------------
  |  Branch (6238:2): [True: 0, False: 1.38M]
  ------------------
 6239|  1.38M|	case XML_ENTITY_NODE:
  ------------------
  |  Branch (6239:2): [True: 0, False: 1.38M]
  ------------------
 6240|  1.38M|	case XML_CDATA_SECTION_NODE:
  ------------------
  |  Branch (6240:2): [True: 0, False: 1.38M]
  ------------------
 6241|  1.38M|	case XML_PI_NODE:
  ------------------
  |  Branch (6241:2): [True: 0, False: 1.38M]
  ------------------
 6242|  1.38M|	case XML_COMMENT_NODE:
  ------------------
  |  Branch (6242:2): [True: 0, False: 1.38M]
  ------------------
 6243|  1.38M|	case XML_XINCLUDE_END:
  ------------------
  |  Branch (6243:2): [True: 0, False: 1.38M]
  ------------------
 6244|  1.38M|	    break;
 6245|       |	/* case XML_DTD_NODE: */ /* URGENT TODO: DTD-node as well? */
 6246|      0|	default:
  ------------------
  |  Branch (6246:2): [True: 0, False: 1.38M]
  ------------------
 6247|      0|	    return(NULL);
 6248|  1.38M|    }
 6249|  1.38M|    if (cur->next != NULL) {
  ------------------
  |  Branch (6249:9): [True: 1.01M, False: 377k]
  ------------------
 6250|  1.01M|	if (cur->next->type == XML_ELEMENT_NODE)
  ------------------
  |  Branch (6250:6): [True: 846k, False: 164k]
  ------------------
 6251|   846k|	    return(cur->next);
 6252|   164k|	cur = cur->next;
 6253|   172k|	do {
 6254|   172k|	    cur = cur->next;
 6255|   172k|	} while ((cur != NULL) && (cur->type != XML_ELEMENT_NODE));
  ------------------
  |  Branch (6255:11): [True: 75.2k, False: 97.2k]
  |  Branch (6255:28): [True: 7.71k, False: 67.4k]
  ------------------
 6256|   164k|	return(cur);
 6257|  1.01M|    }
 6258|   377k|    return(NULL);
 6259|  1.38M|}
xpath.c:xmlXPathNextPrecedingInternal:
 6756|  13.3k|{
 6757|  13.3k|    if ((ctxt == NULL) || (ctxt->context == NULL)) return(NULL);
  ------------------
  |  Branch (6757:9): [True: 0, False: 13.3k]
  |  Branch (6757:27): [True: 0, False: 13.3k]
  ------------------
 6758|  13.3k|    if (cur == NULL) {
  ------------------
  |  Branch (6758:9): [True: 654, False: 12.6k]
  ------------------
 6759|    654|        cur = ctxt->context->node;
 6760|    654|        if (cur == NULL)
  ------------------
  |  Branch (6760:13): [True: 0, False: 654]
  ------------------
 6761|      0|            return (NULL);
 6762|    654|        if (cur->type == XML_ATTRIBUTE_NODE) {
  ------------------
  |  Branch (6762:13): [True: 0, False: 654]
  ------------------
 6763|      0|            cur = cur->parent;
 6764|    654|        } else if (cur->type == XML_NAMESPACE_DECL) {
  ------------------
  |  Branch (6764:20): [True: 0, False: 654]
  ------------------
 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|    654|        ctxt->ancestor = cur->parent;
 6773|    654|    }
 6774|       |
 6775|  13.3k|    if (cur->type == XML_NAMESPACE_DECL || cur->type == XML_DOCUMENT_NODE)
  ------------------
  |  Branch (6775:9): [True: 0, False: 13.3k]
  |  Branch (6775:44): [True: 36, False: 13.3k]
  ------------------
 6776|     36|        return(NULL);
 6777|       |
 6778|  13.3k|    if ((cur->prev != NULL) && (cur->prev->type == XML_DTD_NODE))
  ------------------
  |  Branch (6778:9): [True: 5.07k, False: 8.23k]
  |  Branch (6778:32): [True: 232, False: 4.84k]
  ------------------
 6779|    232|	cur = cur->prev;
 6780|       |
 6781|  15.4k|    while (cur->prev == NULL) {
  ------------------
  |  Branch (6781:12): [True: 9.53k, False: 5.86k]
  ------------------
 6782|  9.53k|        cur = cur->parent;
 6783|  9.53k|        if (cur == NULL)
  ------------------
  |  Branch (6783:13): [True: 332, False: 9.20k]
  ------------------
 6784|    332|            return (NULL);
 6785|  9.20k|        if (cur == ctxt->context->doc->children)
  ------------------
  |  Branch (6785:13): [True: 286, False: 8.91k]
  ------------------
 6786|    286|            return (NULL);
 6787|  8.91k|        if (cur != ctxt->ancestor)
  ------------------
  |  Branch (6787:13): [True: 6.82k, False: 2.09k]
  ------------------
 6788|  6.82k|            return (cur);
 6789|  2.09k|        ctxt->ancestor = cur->parent;
 6790|  2.09k|    }
 6791|       |
 6792|  5.86k|    if (cur->type == XML_DOCUMENT_NODE)
  ------------------
  |  Branch (6792:9): [True: 0, False: 5.86k]
  ------------------
 6793|      0|        return(NULL);
 6794|       |
 6795|  5.86k|    cur = cur->prev;
 6796|  12.6k|    while (cur->last != NULL)
  ------------------
  |  Branch (6796:12): [True: 6.82k, False: 5.86k]
  ------------------
 6797|  6.82k|        cur = cur->last;
 6798|  5.86k|    return (cur);
 6799|  5.86k|}
xpath.c:xmlXPathIsPositionalPredicate:
 9736|   101k|{
 9737|       |
 9738|   101k|    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|   101k|    if ((op->op != XPATH_OP_PREDICATE) && (op->op != XPATH_OP_FILTER))
  ------------------
  |  Branch (9753:9): [True: 0, False: 101k]
  |  Branch (9753:43): [True: 0, False: 0]
  ------------------
 9754|      0|	return(0);
 9755|       |
 9756|   101k|    if (op->ch2 != -1) {
  ------------------
  |  Branch (9756:9): [True: 101k, False: 0]
  ------------------
 9757|   101k|	exprOp = &ctxt->comp->steps[op->ch2];
 9758|   101k|    } else
 9759|      0|	return(0);
 9760|       |
 9761|   101k|    if ((exprOp != NULL) &&
  ------------------
  |  Branch (9761:9): [True: 101k, False: 0]
  ------------------
 9762|   101k|	(exprOp->op == XPATH_OP_VALUE) &&
  ------------------
  |  Branch (9762:2): [True: 49.0k, False: 52.8k]
  ------------------
 9763|  49.0k|	(exprOp->value4 != NULL) &&
  ------------------
  |  Branch (9763:2): [True: 49.0k, False: 0]
  ------------------
 9764|  49.0k|	(((xmlXPathObjectPtr) exprOp->value4)->type == XPATH_NUMBER))
  ------------------
  |  Branch (9764:2): [True: 48.6k, False: 446]
  ------------------
 9765|  48.6k|    {
 9766|  48.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|  48.6k|        if ((floatval > INT_MIN) && (floatval < INT_MAX)) {
  ------------------
  |  Branch (9779:13): [True: 48.5k, False: 40]
  |  Branch (9779:37): [True: 46.8k, False: 1.78k]
  ------------------
 9780|  46.8k|	    *maxPos = (int) floatval;
 9781|  46.8k|            if (floatval == (double) *maxPos)
  ------------------
  |  Branch (9781:17): [True: 46.7k, False: 88]
  ------------------
 9782|  46.7k|                return(1);
 9783|  46.8k|        }
 9784|  48.6k|    }
 9785|  55.1k|    return(0);
 9786|   101k|}
xpath.c:xmlXPathCompOpEvalPredicate:
 9710|   117k|{
 9711|   117k|    if (op->ch1 != -1) {
  ------------------
  |  Branch (9711:9): [True: 327, False: 116k]
  ------------------
 9712|    327|	xmlXPathCompExprPtr comp = ctxt->comp;
 9713|       |	/*
 9714|       |	* Process inner predicates first.
 9715|       |	*/
 9716|    327|	if (comp->steps[op->ch1].op != XPATH_OP_PREDICATE) {
  ------------------
  |  Branch (9716:6): [True: 0, False: 327]
  ------------------
 9717|      0|            XP_ERROR(XPATH_INVALID_OPERAND);
  ------------------
  |  |  244|      0|    { xmlXPathErr(ctxt, X); return; }
  ------------------
 9718|      0|	}
 9719|    327|        if (ctxt->context->depth >= XPATH_MAX_RECURSION_DEPTH)
  ------------------
  |  |  112|    327|#define XPATH_MAX_RECURSION_DEPTH 500
  ------------------
  |  Branch (9719:13): [True: 0, False: 327]
  ------------------
 9720|    327|            XP_ERROR(XPATH_RECURSION_LIMIT_EXCEEDED);
  ------------------
  |  |  244|      0|    { xmlXPathErr(ctxt, X); return; }
  ------------------
 9721|    327|        ctxt->context->depth += 1;
 9722|    327|	xmlXPathCompOpEvalPredicate(ctxt, &comp->steps[op->ch1], set,
 9723|    327|                                    1, set->nodeNr, hasNsNodes);
 9724|    327|        ctxt->context->depth -= 1;
 9725|    327|	CHECK_ERROR;
  ------------------
  |  |  230|    327|    if (ctxt->error != XPATH_EXPRESSION_OK) return
  |  |  ------------------
  |  |  |  Branch (230:9): [True: 77, False: 250]
  |  |  ------------------
  ------------------
 9726|    327|    }
 9727|       |
 9728|   117k|    if (op->ch2 != -1)
  ------------------
  |  Branch (9728:9): [True: 117k, False: 0]
  ------------------
 9729|   117k|        xmlXPathNodeSetFilter(ctxt, set, op->ch2, minPos, maxPos, hasNsNodes);
 9730|   117k|}
xpath.c:xmlXPathNodeSetFilter:
 9577|   120k|{
 9578|   120k|    xmlXPathContextPtr xpctxt;
 9579|   120k|    xmlNodePtr oldnode;
 9580|   120k|    xmlDocPtr olddoc;
 9581|   120k|    xmlXPathStepOpPtr filterOp;
 9582|   120k|    int oldcs, oldpp;
 9583|   120k|    int i, j, pos;
 9584|       |
 9585|   120k|    if ((set == NULL) || (set->nodeNr == 0))
  ------------------
  |  Branch (9585:9): [True: 0, False: 120k]
  |  Branch (9585:26): [True: 1.77k, False: 118k]
  ------------------
 9586|  1.77k|        return;
 9587|       |
 9588|       |    /*
 9589|       |    * Check if the node set contains a sufficient number of nodes for
 9590|       |    * the requested range.
 9591|       |    */
 9592|   118k|    if (set->nodeNr < minPos) {
  ------------------
  |  Branch (9592:9): [True: 1.59k, False: 117k]
  ------------------
 9593|  1.59k|        xmlXPathNodeSetClear(set, hasNsNodes);
 9594|  1.59k|        return;
 9595|  1.59k|    }
 9596|       |
 9597|   117k|    xpctxt = ctxt->context;
 9598|   117k|    oldnode = xpctxt->node;
 9599|   117k|    olddoc = xpctxt->doc;
 9600|   117k|    oldcs = xpctxt->contextSize;
 9601|   117k|    oldpp = xpctxt->proximityPosition;
 9602|   117k|    filterOp = &ctxt->comp->steps[filterOpIndex];
 9603|       |
 9604|   117k|    xpctxt->contextSize = set->nodeNr;
 9605|       |
 9606|   460k|    for (i = 0, j = 0, pos = 1; i < set->nodeNr; i++) {
  ------------------
  |  Branch (9606:33): [True: 413k, False: 46.3k]
  ------------------
 9607|   413k|        xmlNodePtr node = set->nodeTab[i];
 9608|   413k|        int res;
 9609|       |
 9610|   413k|        xpctxt->node = node;
 9611|   413k|        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|   413k|        if ((node->type != XML_NAMESPACE_DECL) &&
  ------------------
  |  Branch (9619:13): [True: 386k, False: 27.6k]
  ------------------
 9620|   386k|            (node->doc != NULL))
  ------------------
  |  Branch (9620:13): [True: 386k, False: 0]
  ------------------
 9621|   386k|            xpctxt->doc = node->doc;
 9622|       |
 9623|   413k|        res = xmlXPathCompOpEvalToBoolean(ctxt, filterOp, 1);
 9624|       |
 9625|   413k|        if (ctxt->error != XPATH_EXPRESSION_OK)
  ------------------
  |  Branch (9625:13): [True: 1.49k, False: 412k]
  ------------------
 9626|  1.49k|            break;
 9627|   412k|        if (res < 0) {
  ------------------
  |  Branch (9627:13): [True: 0, False: 412k]
  ------------------
 9628|       |            /* Shouldn't happen */
 9629|      0|            xmlXPathErr(ctxt, XPATH_EXPR_ERROR);
 9630|      0|            break;
 9631|      0|        }
 9632|       |
 9633|   412k|        if ((res != 0) && ((pos >= minPos) && (pos <= maxPos))) {
  ------------------
  |  Branch (9633:13): [True: 196k, False: 216k]
  |  Branch (9633:28): [True: 179k, False: 16.6k]
  |  Branch (9633:47): [True: 169k, False: 10.5k]
  ------------------
 9634|   169k|            if (i != j) {
  ------------------
  |  Branch (9634:17): [True: 5.66k, False: 163k]
  ------------------
 9635|  5.66k|                set->nodeTab[j] = node;
 9636|  5.66k|                set->nodeTab[i] = NULL;
 9637|  5.66k|            }
 9638|       |
 9639|   169k|            j += 1;
 9640|   243k|        } else {
 9641|       |            /* Remove the entry from the initial node set. */
 9642|   243k|            set->nodeTab[i] = NULL;
 9643|   243k|            if (node->type == XML_NAMESPACE_DECL)
  ------------------
  |  Branch (9643:17): [True: 14.6k, False: 228k]
  ------------------
 9644|  14.6k|                xmlXPathNodeSetFreeNs((xmlNsPtr) node);
 9645|   243k|        }
 9646|       |
 9647|   412k|        if (res != 0) {
  ------------------
  |  Branch (9647:13): [True: 196k, False: 216k]
  ------------------
 9648|   196k|            if (pos == maxPos) {
  ------------------
  |  Branch (9648:17): [True: 69.3k, False: 126k]
  ------------------
 9649|  69.3k|                i += 1;
 9650|  69.3k|                break;
 9651|  69.3k|            }
 9652|       |
 9653|   126k|            pos += 1;
 9654|   126k|        }
 9655|   412k|    }
 9656|       |
 9657|       |    /* Free remaining nodes. */
 9658|   117k|    if (hasNsNodes) {
  ------------------
  |  Branch (9658:9): [True: 13.2k, False: 103k]
  ------------------
 9659|  13.9k|        for (; i < set->nodeNr; i++) {
  ------------------
  |  Branch (9659:16): [True: 705, False: 13.2k]
  ------------------
 9660|    705|            xmlNodePtr node = set->nodeTab[i];
 9661|    705|            if ((node != NULL) && (node->type == XML_NAMESPACE_DECL))
  ------------------
  |  Branch (9661:17): [True: 705, False: 0]
  |  Branch (9661:35): [True: 34, False: 671]
  ------------------
 9662|     34|                xmlXPathNodeSetFreeNs((xmlNsPtr) node);
 9663|    705|        }
 9664|  13.2k|    }
 9665|       |
 9666|   117k|    set->nodeNr = j;
 9667|       |
 9668|       |    /* If too many elements were removed, shrink table to preserve memory. */
 9669|   117k|    if ((set->nodeMax > XML_NODESET_DEFAULT) &&
  ------------------
  |  | 2593|   117k|#define XML_NODESET_DEFAULT	10
  ------------------
  |  Branch (9669:9): [True: 14.0k, False: 103k]
  ------------------
 9670|  14.0k|        (set->nodeNr < set->nodeMax / 2)) {
  ------------------
  |  Branch (9670:9): [True: 9.48k, False: 4.56k]
  ------------------
 9671|  9.48k|        xmlNodePtr *tmp;
 9672|  9.48k|        int nodeMax = set->nodeNr;
 9673|       |
 9674|  9.48k|        if (nodeMax < XML_NODESET_DEFAULT)
  ------------------
  |  | 2593|  9.48k|#define XML_NODESET_DEFAULT	10
  ------------------
  |  Branch (9674:13): [True: 9.37k, False: 112]
  ------------------
 9675|  9.37k|            nodeMax = XML_NODESET_DEFAULT;
  ------------------
  |  | 2593|  9.37k|#define XML_NODESET_DEFAULT	10
  ------------------
 9676|  9.48k|        tmp = (xmlNodePtr *) xmlRealloc(set->nodeTab,
 9677|  9.48k|                nodeMax * sizeof(xmlNodePtr));
 9678|  9.48k|        if (tmp == NULL) {
  ------------------
  |  Branch (9678:13): [True: 1, False: 9.48k]
  ------------------
 9679|      1|            xmlXPathPErrMemory(ctxt);
 9680|  9.48k|        } else {
 9681|  9.48k|            set->nodeTab = tmp;
 9682|  9.48k|            set->nodeMax = nodeMax;
 9683|  9.48k|        }
 9684|  9.48k|    }
 9685|       |
 9686|   117k|    xpctxt->node = oldnode;
 9687|   117k|    xpctxt->doc = olddoc;
 9688|   117k|    xpctxt->contextSize = oldcs;
 9689|   117k|    xpctxt->proximityPosition = oldpp;
 9690|   117k|}
xpath.c:xmlXPathCompOpEval:
10750|  3.39M|{
10751|  3.39M|    int total = 0;
10752|  3.39M|    int equal, ret;
10753|  3.39M|    xmlXPathCompExprPtr comp;
10754|  3.39M|    xmlXPathObjectPtr arg1, arg2;
10755|       |
10756|  3.39M|    CHECK_ERROR0;
  ------------------
  |  |  236|  3.39M|    if (ctxt->error != XPATH_EXPRESSION_OK) return(0)
  |  |  ------------------
  |  |  |  Branch (236:9): [True: 2, False: 3.39M]
  |  |  ------------------
  ------------------
10757|  3.39M|    if (OP_LIMIT_EXCEEDED(ctxt, 1))
  ------------------
  |  |  818|  3.39M|    ((ctxt->context->opLimit != 0) && (xmlXPathCheckOpLimit(ctxt, n) < 0))
  |  |  ------------------
  |  |  |  Branch (818:6): [True: 3.39M, False: 0]
  |  |  |  Branch (818:39): [True: 42, False: 3.39M]
  |  |  ------------------
  ------------------
10758|     42|        return(0);
10759|  3.39M|    if (ctxt->context->depth >= XPATH_MAX_RECURSION_DEPTH)
  ------------------
  |  |  112|  3.39M|#define XPATH_MAX_RECURSION_DEPTH 500
  ------------------
  |  Branch (10759:9): [True: 28, False: 3.39M]
  ------------------
10760|  3.39M|        XP_ERROR0(XPATH_RECURSION_LIMIT_EXCEEDED);
  ------------------
  |  |  252|     28|    { xmlXPathErr(ctxt, X); return(0); }
  ------------------
10761|  3.39M|    ctxt->context->depth += 1;
10762|  3.39M|    comp = ctxt->comp;
10763|  3.39M|    switch (op->op) {
10764|      0|        case XPATH_OP_END:
  ------------------
  |  Branch (10764:9): [True: 0, False: 3.39M]
  ------------------
10765|      0|            break;
10766|  1.41k|        case XPATH_OP_AND:
  ------------------
  |  Branch (10766:9): [True: 1.41k, False: 3.39M]
  ------------------
10767|  1.41k|            total += xmlXPathCompOpEval(ctxt, &comp->steps[op->ch1]);
10768|  1.41k|	    CHECK_ERROR0;
  ------------------
  |  |  236|  1.41k|    if (ctxt->error != XPATH_EXPRESSION_OK) return(0)
  |  |  ------------------
  |  |  |  Branch (236:9): [True: 11, False: 1.40k]
  |  |  ------------------
  ------------------
10769|  1.40k|            xmlXPathBooleanFunction(ctxt, 1);
10770|  1.40k|            if ((ctxt->value == NULL) || (ctxt->value->boolval == 0))
  ------------------
  |  Branch (10770:17): [True: 1, False: 1.40k]
  |  Branch (10770:42): [True: 1.06k, False: 337]
  ------------------
10771|  1.06k|                break;
10772|    337|            arg2 = xmlXPathValuePop(ctxt);
10773|    337|            total += xmlXPathCompOpEval(ctxt, &comp->steps[op->ch2]);
10774|    337|	    if (ctxt->error) {
  ------------------
  |  Branch (10774:10): [True: 30, False: 307]
  ------------------
10775|     30|		xmlXPathFreeObject(arg2);
10776|     30|		break;
10777|     30|	    }
10778|    307|            xmlXPathBooleanFunction(ctxt, 1);
10779|    307|            if (ctxt->value != NULL)
  ------------------
  |  Branch (10779:17): [True: 305, False: 2]
  ------------------
10780|    305|                ctxt->value->boolval &= arg2->boolval;
10781|    307|	    xmlXPathReleaseObject(ctxt->context, arg2);
10782|    307|            break;
10783|  1.69k|        case XPATH_OP_OR:
  ------------------
  |  Branch (10783:9): [True: 1.69k, False: 3.39M]
  ------------------
10784|  1.69k|            total += xmlXPathCompOpEval(ctxt, &comp->steps[op->ch1]);
10785|  1.69k|	    CHECK_ERROR0;
  ------------------
  |  |  236|  1.69k|    if (ctxt->error != XPATH_EXPRESSION_OK) return(0)
  |  |  ------------------
  |  |  |  Branch (236:9): [True: 345, False: 1.34k]
  |  |  ------------------
  ------------------
10786|  1.34k|            xmlXPathBooleanFunction(ctxt, 1);
10787|  1.34k|            if ((ctxt->value == NULL) || (ctxt->value->boolval == 1))
  ------------------
  |  Branch (10787:17): [True: 1, False: 1.34k]
  |  Branch (10787:42): [True: 435, False: 909]
  ------------------
10788|    436|                break;
10789|    909|            arg2 = xmlXPathValuePop(ctxt);
10790|    909|            total += xmlXPathCompOpEval(ctxt, &comp->steps[op->ch2]);
10791|    909|	    if (ctxt->error) {
  ------------------
  |  Branch (10791:10): [True: 114, False: 795]
  ------------------
10792|    114|		xmlXPathFreeObject(arg2);
10793|    114|		break;
10794|    114|	    }
10795|    795|            xmlXPathBooleanFunction(ctxt, 1);
10796|    795|            if (ctxt->value != NULL)
  ------------------
  |  Branch (10796:17): [True: 792, False: 3]
  ------------------
10797|    792|                ctxt->value->boolval |= arg2->boolval;
10798|    795|	    xmlXPathReleaseObject(ctxt->context, arg2);
10799|    795|            break;
10800|   340k|        case XPATH_OP_EQUAL:
  ------------------
  |  Branch (10800:9): [True: 340k, False: 3.05M]
  ------------------
10801|   340k|            total += xmlXPathCompOpEval(ctxt, &comp->steps[op->ch1]);
10802|   340k|	    CHECK_ERROR0;
  ------------------
  |  |  236|   340k|    if (ctxt->error != XPATH_EXPRESSION_OK) return(0)
  |  |  ------------------
  |  |  |  Branch (236:9): [True: 6.47k, False: 333k]
  |  |  ------------------
  ------------------
10803|   333k|            total += xmlXPathCompOpEval(ctxt, &comp->steps[op->ch2]);
10804|   333k|	    CHECK_ERROR0;
  ------------------
  |  |  236|   333k|    if (ctxt->error != XPATH_EXPRESSION_OK) return(0)
  |  |  ------------------
  |  |  |  Branch (236:9): [True: 1.32k, False: 332k]
  |  |  ------------------
  ------------------
10805|   332k|	    if (op->value)
  ------------------
  |  Branch (10805:10): [True: 328k, False: 4.00k]
  ------------------
10806|   328k|		equal = xmlXPathEqualValues(ctxt);
10807|  4.00k|	    else
10808|  4.00k|		equal = xmlXPathNotEqualValues(ctxt);
10809|   332k|	    xmlXPathValuePush(ctxt, xmlXPathCacheNewBoolean(ctxt, equal));
10810|   332k|            break;
10811|   170k|        case XPATH_OP_CMP:
  ------------------
  |  Branch (10811:9): [True: 170k, False: 3.22M]
  ------------------
10812|   170k|            total += xmlXPathCompOpEval(ctxt, &comp->steps[op->ch1]);
10813|   170k|	    CHECK_ERROR0;
  ------------------
  |  |  236|   170k|    if (ctxt->error != XPATH_EXPRESSION_OK) return(0)
  |  |  ------------------
  |  |  |  Branch (236:9): [True: 987, False: 169k]
  |  |  ------------------
  ------------------
10814|   169k|            total += xmlXPathCompOpEval(ctxt, &comp->steps[op->ch2]);
10815|   169k|	    CHECK_ERROR0;
  ------------------
  |  |  236|   169k|    if (ctxt->error != XPATH_EXPRESSION_OK) return(0)
  |  |  ------------------
  |  |  |  Branch (236:9): [True: 691, False: 169k]
  |  |  ------------------
  ------------------
10816|   169k|            ret = xmlXPathCompareValues(ctxt, op->value, op->value2);
10817|   169k|	    xmlXPathValuePush(ctxt, xmlXPathCacheNewBoolean(ctxt, ret));
10818|   169k|            break;
10819|   214k|        case XPATH_OP_PLUS:
  ------------------
  |  Branch (10819:9): [True: 214k, False: 3.18M]
  ------------------
10820|   214k|            total += xmlXPathCompOpEval(ctxt, &comp->steps[op->ch1]);
10821|   214k|	    CHECK_ERROR0;
  ------------------
  |  |  236|   214k|    if (ctxt->error != XPATH_EXPRESSION_OK) return(0)
  |  |  ------------------
  |  |  |  Branch (236:9): [True: 6.41k, False: 208k]
  |  |  ------------------
  ------------------
10822|   208k|            if (op->ch2 != -1) {
  ------------------
  |  Branch (10822:17): [True: 119k, False: 88.6k]
  ------------------
10823|   119k|                total += xmlXPathCompOpEval(ctxt, &comp->steps[op->ch2]);
10824|   119k|	    }
10825|   208k|	    CHECK_ERROR0;
  ------------------
  |  |  236|   208k|    if (ctxt->error != XPATH_EXPRESSION_OK) return(0)
  |  |  ------------------
  |  |  |  Branch (236:9): [True: 891, False: 207k]
  |  |  ------------------
  ------------------
10826|   207k|            if (op->value == 0)
  ------------------
  |  Branch (10826:17): [True: 45.6k, False: 161k]
  ------------------
10827|  45.6k|                xmlXPathSubValues(ctxt);
10828|   161k|            else if (op->value == 1)
  ------------------
  |  Branch (10828:22): [True: 73.1k, False: 88.6k]
  ------------------
10829|  73.1k|                xmlXPathAddValues(ctxt);
10830|  88.6k|            else if (op->value == 2)
  ------------------
  |  Branch (10830:22): [True: 80.6k, False: 7.93k]
  ------------------
10831|  80.6k|                xmlXPathValueFlipSign(ctxt);
10832|  7.93k|            else if (op->value == 3) {
  ------------------
  |  Branch (10832:22): [True: 7.93k, False: 0]
  ------------------
10833|  7.93k|                CAST_TO_NUMBER;
  ------------------
  |  |  297|  7.93k|    if ((ctxt->value != NULL) && (ctxt->value->type != XPATH_NUMBER))	\
  |  |  ------------------
  |  |  |  Branch (297:9): [True: 7.93k, False: 0]
  |  |  |  Branch (297:34): [True: 7.23k, False: 700]
  |  |  ------------------
  |  |  298|  7.93k|        xmlXPathNumberFunction(ctxt, 1);
  ------------------
10834|  7.93k|                CHECK_TYPE0(XPATH_NUMBER);
  ------------------
  |  |  271|  7.93k|    if ((ctxt->value == NULL) || (ctxt->value->type != typeval))	\
  |  |  ------------------
  |  |  |  Branch (271:9): [True: 3, False: 7.93k]
  |  |  |  Branch (271:34): [True: 2, False: 7.93k]
  |  |  ------------------
  |  |  272|  7.93k|        XP_ERROR0(XPATH_INVALID_TYPE)
  |  |  ------------------
  |  |  |  |  252|      5|    { xmlXPathErr(ctxt, X); return(0); }
  |  |  ------------------
  ------------------
10835|  7.93k|            }
10836|   207k|            break;
10837|   207k|        case XPATH_OP_MULT:
  ------------------
  |  Branch (10837:9): [True: 149k, False: 3.24M]
  ------------------
10838|   149k|            total += xmlXPathCompOpEval(ctxt, &comp->steps[op->ch1]);
10839|   149k|	    CHECK_ERROR0;
  ------------------
  |  |  236|   149k|    if (ctxt->error != XPATH_EXPRESSION_OK) return(0)
  |  |  ------------------
  |  |  |  Branch (236:9): [True: 9.44k, False: 140k]
  |  |  ------------------
  ------------------
10840|   140k|            total += xmlXPathCompOpEval(ctxt, &comp->steps[op->ch2]);
10841|   140k|	    CHECK_ERROR0;
  ------------------
  |  |  236|   140k|    if (ctxt->error != XPATH_EXPRESSION_OK) return(0)
  |  |  ------------------
  |  |  |  Branch (236:9): [True: 340, False: 140k]
  |  |  ------------------
  ------------------
10842|   140k|            if (op->value == 0)
  ------------------
  |  Branch (10842:17): [True: 137k, False: 2.77k]
  ------------------
10843|   137k|                xmlXPathMultValues(ctxt);
10844|  2.77k|            else if (op->value == 1)
  ------------------
  |  Branch (10844:22): [True: 2.03k, False: 737]
  ------------------
10845|  2.03k|                xmlXPathDivValues(ctxt);
10846|    737|            else if (op->value == 2)
  ------------------
  |  Branch (10846:22): [True: 737, False: 0]
  ------------------
10847|    737|                xmlXPathModValues(ctxt);
10848|   140k|            break;
10849|   103k|        case XPATH_OP_UNION:
  ------------------
  |  Branch (10849:9): [True: 103k, False: 3.29M]
  ------------------
10850|   103k|            total += xmlXPathCompOpEval(ctxt, &comp->steps[op->ch1]);
10851|   103k|	    CHECK_ERROR0;
  ------------------
  |  |  236|   103k|    if (ctxt->error != XPATH_EXPRESSION_OK) return(0)
  |  |  ------------------
  |  |  |  Branch (236:9): [True: 463, False: 102k]
  |  |  ------------------
  ------------------
10852|   102k|            total += xmlXPathCompOpEval(ctxt, &comp->steps[op->ch2]);
10853|   102k|	    CHECK_ERROR0;
  ------------------
  |  |  236|   102k|    if (ctxt->error != XPATH_EXPRESSION_OK) return(0)
  |  |  ------------------
  |  |  |  Branch (236:9): [True: 329, False: 102k]
  |  |  ------------------
  ------------------
10854|       |
10855|   102k|            arg2 = xmlXPathValuePop(ctxt);
10856|   102k|            arg1 = xmlXPathValuePop(ctxt);
10857|   102k|            if ((arg1 == NULL) || (arg1->type != XPATH_NODESET) ||
  ------------------
  |  Branch (10857:17): [True: 0, False: 102k]
  |  Branch (10857:35): [True: 32, False: 102k]
  ------------------
10858|   102k|                (arg2 == NULL) || (arg2->type != XPATH_NODESET)) {
  ------------------
  |  Branch (10858:17): [True: 0, False: 102k]
  |  Branch (10858:35): [True: 6, False: 102k]
  ------------------
10859|     38|	        xmlXPathReleaseObject(ctxt->context, arg1);
10860|     38|	        xmlXPathReleaseObject(ctxt->context, arg2);
10861|     38|                XP_ERROR0(XPATH_INVALID_TYPE);
  ------------------
  |  |  252|     38|    { xmlXPathErr(ctxt, X); return(0); }
  ------------------
10862|      0|            }
10863|   102k|            if ((ctxt->context->opLimit != 0) &&
  ------------------
  |  Branch (10863:17): [True: 102k, False: 0]
  ------------------
10864|   102k|                (((arg1->nodesetval != NULL) &&
  ------------------
  |  Branch (10864:19): [True: 102k, False: 0]
  ------------------
10865|   102k|                  (xmlXPathCheckOpLimit(ctxt,
  ------------------
  |  Branch (10865:19): [True: 8, False: 102k]
  ------------------
10866|   102k|                                        arg1->nodesetval->nodeNr) < 0)) ||
10867|   102k|                 ((arg2->nodesetval != NULL) &&
  ------------------
  |  Branch (10867:19): [True: 102k, False: 0]
  ------------------
10868|   102k|                  (xmlXPathCheckOpLimit(ctxt,
  ------------------
  |  Branch (10868:19): [True: 3, False: 102k]
  ------------------
10869|   102k|                                        arg2->nodesetval->nodeNr) < 0)))) {
10870|     11|	        xmlXPathReleaseObject(ctxt->context, arg1);
10871|     11|	        xmlXPathReleaseObject(ctxt->context, arg2);
10872|     11|                break;
10873|     11|            }
10874|       |
10875|   102k|	    if (((arg2->nodesetval != NULL) &&
  ------------------
  |  Branch (10875:11): [True: 102k, False: 0]
  ------------------
10876|   102k|		 (arg2->nodesetval->nodeNr != 0)))
  ------------------
  |  Branch (10876:4): [True: 41.3k, False: 60.9k]
  ------------------
10877|  41.3k|	    {
10878|  41.3k|		arg1->nodesetval = xmlXPathNodeSetMerge(arg1->nodesetval,
10879|  41.3k|							arg2->nodesetval);
10880|  41.3k|                if (arg1->nodesetval == NULL)
  ------------------
  |  Branch (10880:21): [True: 32, False: 41.3k]
  ------------------
10881|     32|                    xmlXPathPErrMemory(ctxt);
10882|  41.3k|	    }
10883|       |
10884|   102k|            xmlXPathValuePush(ctxt, arg1);
10885|   102k|	    xmlXPathReleaseObject(ctxt->context, arg2);
10886|   102k|            break;
10887|   325k|        case XPATH_OP_ROOT:
  ------------------
  |  Branch (10887:9): [True: 325k, False: 3.07M]
  ------------------
10888|   325k|            xmlXPathRoot(ctxt);
10889|   325k|            break;
10890|   778k|        case XPATH_OP_NODE:
  ------------------
  |  Branch (10890:9): [True: 778k, False: 2.61M]
  ------------------
10891|   778k|            if (op->ch1 != -1)
  ------------------
  |  Branch (10891:17): [True: 0, False: 778k]
  ------------------
10892|      0|                total += xmlXPathCompOpEval(ctxt, &comp->steps[op->ch1]);
10893|   778k|	    CHECK_ERROR0;
  ------------------
  |  |  236|   778k|    if (ctxt->error != XPATH_EXPRESSION_OK) return(0)
  |  |  ------------------
  |  |  |  Branch (236:9): [True: 0, False: 778k]
  |  |  ------------------
  ------------------
10894|   778k|            if (op->ch2 != -1)
  ------------------
  |  Branch (10894:17): [True: 0, False: 778k]
  ------------------
10895|      0|                total += xmlXPathCompOpEval(ctxt, &comp->steps[op->ch2]);
10896|   778k|	    CHECK_ERROR0;
  ------------------
  |  |  236|   778k|    if (ctxt->error != XPATH_EXPRESSION_OK) return(0)
  |  |  ------------------
  |  |  |  Branch (236:9): [True: 0, False: 778k]
  |  |  ------------------
  ------------------
10897|   778k|	    xmlXPathValuePush(ctxt, xmlXPathCacheNewNodeSet(ctxt,
10898|   778k|                                                    ctxt->context->node));
10899|   778k|            break;
10900|   939k|        case XPATH_OP_COLLECT:{
  ------------------
  |  Branch (10900:9): [True: 939k, False: 2.45M]
  ------------------
10901|   939k|                if (op->ch1 == -1)
  ------------------
  |  Branch (10901:21): [True: 0, False: 939k]
  ------------------
10902|      0|                    break;
10903|       |
10904|   939k|                total += xmlXPathCompOpEval(ctxt, &comp->steps[op->ch1]);
10905|   939k|		CHECK_ERROR0;
  ------------------
  |  |  236|   939k|    if (ctxt->error != XPATH_EXPRESSION_OK) return(0)
  |  |  ------------------
  |  |  |  Branch (236:9): [True: 1.33k, False: 937k]
  |  |  ------------------
  ------------------
10906|       |
10907|   937k|                total += xmlXPathNodeCollectAndTest(ctxt, op, NULL, NULL, 0);
10908|   937k|                break;
10909|   939k|            }
10910|   193k|        case XPATH_OP_VALUE:
  ------------------
  |  Branch (10910:9): [True: 193k, False: 3.20M]
  ------------------
10911|   193k|            xmlXPathValuePush(ctxt, xmlXPathCacheObjectCopy(ctxt, op->value4));
10912|   193k|            break;
10913|     46|        case XPATH_OP_VARIABLE:{
  ------------------
  |  Branch (10913:9): [True: 46, False: 3.39M]
  ------------------
10914|     46|		xmlXPathObjectPtr val;
10915|       |
10916|     46|                if (op->ch1 != -1)
  ------------------
  |  Branch (10916:21): [True: 0, False: 46]
  ------------------
10917|      0|                    total +=
10918|      0|                        xmlXPathCompOpEval(ctxt, &comp->steps[op->ch1]);
10919|     46|                if (op->value5 == NULL) {
  ------------------
  |  Branch (10919:21): [True: 29, False: 17]
  ------------------
10920|     29|		    val = xmlXPathVariableLookup(ctxt->context, op->value4);
10921|     29|		    if (val == NULL) {
  ------------------
  |  Branch (10921:11): [True: 29, False: 0]
  ------------------
10922|     29|                        xmlXPathErrFmt(ctxt, XPATH_UNDEF_VARIABLE_ERROR,
10923|     29|                                       "Undefined variable: %s\n", op->value4);
10924|     29|                        return 0;
10925|     29|                    }
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|     46|            }
10949|  35.1k|        case XPATH_OP_FUNCTION:{
  ------------------
  |  Branch (10949:9): [True: 35.1k, False: 3.36M]
  ------------------
10950|  35.1k|                xmlXPathFunction func;
10951|  35.1k|                const xmlChar *oldFunc, *oldFuncURI;
10952|  35.1k|		int i;
10953|  35.1k|                int frame;
10954|       |
10955|  35.1k|                frame = ctxt->valueNr;
10956|  35.1k|                if (op->ch1 != -1) {
  ------------------
  |  Branch (10956:21): [True: 30.7k, False: 4.41k]
  ------------------
10957|  30.7k|                    total +=
10958|  30.7k|                        xmlXPathCompOpEval(ctxt, &comp->steps[op->ch1]);
10959|  30.7k|                    if (ctxt->error != XPATH_EXPRESSION_OK)
  ------------------
  |  Branch (10959:25): [True: 899, False: 29.8k]
  ------------------
10960|    899|                        break;
10961|  30.7k|                }
10962|  34.2k|		if (ctxt->valueNr < frame + op->value)
  ------------------
  |  Branch (10962:7): [True: 0, False: 34.2k]
  ------------------
10963|  34.2k|		    XP_ERROR0(XPATH_INVALID_OPERAND);
  ------------------
  |  |  252|      0|    { xmlXPathErr(ctxt, X); return(0); }
  ------------------
10964|  88.7k|		for (i = 0; i < op->value; i++) {
  ------------------
  |  Branch (10964:15): [True: 54.5k, False: 34.2k]
  ------------------
10965|  54.5k|		    if (ctxt->valueTab[(ctxt->valueNr - 1) - i] == NULL)
  ------------------
  |  Branch (10965:11): [True: 0, False: 54.5k]
  ------------------
10966|  54.5k|			XP_ERROR0(XPATH_INVALID_OPERAND);
  ------------------
  |  |  252|      0|    { xmlXPathErr(ctxt, X); return(0); }
  ------------------
10967|  54.5k|                }
10968|  34.2k|                if (op->cache != NULL)
  ------------------
  |  Branch (10968:21): [True: 28.5k, False: 5.67k]
  ------------------
10969|  28.5k|                    func = op->cache;
10970|  5.67k|                else {
10971|  5.67k|                    const xmlChar *URI = NULL;
10972|       |
10973|  5.67k|                    if (op->value5 == NULL) {
  ------------------
  |  Branch (10973:25): [True: 5.60k, False: 72]
  ------------------
10974|  5.60k|                        func = xmlXPathFunctionLookup(ctxt->context,
10975|  5.60k|                                                      op->value4);
10976|  5.60k|                        if (func == NULL) {
  ------------------
  |  Branch (10976:29): [True: 358, False: 5.24k]
  ------------------
10977|    358|                            xmlXPathErrFmt(ctxt, XPATH_UNKNOWN_FUNC_ERROR,
10978|    358|                                           "Unregistered function: %s\n",
10979|    358|                                           op->value4);
10980|    358|                            return 0;
10981|    358|                        }
10982|  5.60k|                    } else {
10983|     72|                        URI = xmlXPathNsLookup(ctxt->context, op->value5);
10984|     72|                        if (URI == NULL) {
  ------------------
  |  Branch (10984:29): [True: 62, False: 10]
  ------------------
10985|     62|                            xmlXPathErrFmt(ctxt, XPATH_UNDEF_PREFIX_ERROR,
10986|     62|                                           "Undefined namespace prefix: %s\n",
10987|     62|                                           op->value5);
10988|     62|                            return 0;
10989|     62|                        }
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|  5.24k|                    op->cache = func;
11000|  5.24k|                    op->cacheURI = (void *) URI;
11001|  5.24k|                }
11002|  33.8k|                oldFunc = ctxt->context->function;
11003|  33.8k|                oldFuncURI = ctxt->context->functionURI;
11004|  33.8k|                ctxt->context->function = op->value4;
11005|  33.8k|                ctxt->context->functionURI = op->cacheURI;
11006|  33.8k|                func(ctxt, op->value);
11007|  33.8k|                ctxt->context->function = oldFunc;
11008|  33.8k|                ctxt->context->functionURI = oldFuncURI;
11009|  33.8k|                if ((ctxt->error == XPATH_EXPRESSION_OK) &&
  ------------------
  |  Branch (11009:21): [True: 33.6k, False: 218]
  ------------------
11010|  33.6k|                    (ctxt->valueNr != frame + 1))
  ------------------
  |  Branch (11010:21): [True: 0, False: 33.6k]
  ------------------
11011|  33.8k|                    XP_ERROR0(XPATH_STACK_ERROR);
  ------------------
  |  |  252|      0|    { xmlXPathErr(ctxt, X); return(0); }
  ------------------
11012|  33.8k|                break;
11013|  33.8k|            }
11014|  56.1k|        case XPATH_OP_ARG:
  ------------------
  |  Branch (11014:9): [True: 56.1k, False: 3.34M]
  ------------------
11015|  56.1k|            if (op->ch1 != -1) {
  ------------------
  |  Branch (11015:17): [True: 25.3k, False: 30.7k]
  ------------------
11016|  25.3k|                total += xmlXPathCompOpEval(ctxt, &comp->steps[op->ch1]);
11017|  25.3k|	        CHECK_ERROR0;
  ------------------
  |  |  236|  25.3k|    if (ctxt->error != XPATH_EXPRESSION_OK) return(0)
  |  |  ------------------
  |  |  |  Branch (236:9): [True: 344, False: 25.0k]
  |  |  ------------------
  ------------------
11018|  25.3k|            }
11019|  55.7k|            if (op->ch2 != -1) {
  ------------------
  |  Branch (11019:17): [True: 55.7k, False: 0]
  ------------------
11020|  55.7k|                total += xmlXPathCompOpEval(ctxt, &comp->steps[op->ch2]);
11021|  55.7k|	        CHECK_ERROR0;
  ------------------
  |  |  236|  55.7k|    if (ctxt->error != XPATH_EXPRESSION_OK) return(0)
  |  |  ------------------
  |  |  |  Branch (236:9): [True: 899, False: 54.8k]
  |  |  ------------------
  ------------------
11022|  55.7k|	    }
11023|  54.8k|            break;
11024|  54.8k|        case XPATH_OP_PREDICATE:
  ------------------
  |  Branch (11024:9): [True: 0, False: 3.39M]
  ------------------
11025|  9.63k|        case XPATH_OP_FILTER:{
  ------------------
  |  Branch (11025:9): [True: 9.63k, False: 3.38M]
  ------------------
11026|  9.63k|                xmlXPathObjectPtr obj;
11027|  9.63k|                xmlNodeSetPtr set;
11028|       |
11029|       |                /*
11030|       |                 * Optimization for ()[1] selection i.e. the first elem
11031|       |                 */
11032|  9.63k|                if ((op->ch1 != -1) && (op->ch2 != -1) &&
  ------------------
  |  Branch (11032:21): [True: 9.63k, False: 0]
  |  Branch (11032:40): [True: 9.63k, False: 0]
  ------------------
11033|  9.63k|#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|  9.63k|                    ((comp->steps[op->ch1].op == XPATH_OP_SORT) || /* 18 */
  ------------------
  |  Branch (11043:22): [True: 4.99k, False: 4.63k]
  ------------------
11044|  4.63k|		     (comp->steps[op->ch1].op == XPATH_OP_FILTER)) && /* 17 */
  ------------------
  |  Branch (11044:8): [True: 4.58k, False: 51]
  ------------------
11045|       |#else
11046|       |		    (comp->steps[op->ch1].op == XPATH_OP_SORT) &&
11047|       |#endif
11048|  9.57k|                    (comp->steps[op->ch2].op == XPATH_OP_VALUE)) { /* 12 */
  ------------------
  |  Branch (11048:21): [True: 6.34k, False: 3.23k]
  ------------------
11049|  6.34k|                    xmlXPathObjectPtr val;
11050|       |
11051|  6.34k|                    val = comp->steps[op->ch2].value4;
11052|  6.34k|                    if ((val != NULL) && (val->type == XPATH_NUMBER) &&
  ------------------
  |  Branch (11052:25): [True: 6.34k, False: 0]
  |  Branch (11052:42): [True: 6.33k, False: 13]
  ------------------
11053|  6.33k|                        (val->floatval == 1.0)) {
  ------------------
  |  Branch (11053:25): [True: 5.74k, False: 587]
  ------------------
11054|  5.74k|                        xmlNodePtr first = NULL;
11055|       |
11056|  5.74k|                        total +=
11057|  5.74k|                            xmlXPathCompOpEvalFirst(ctxt,
11058|  5.74k|                                                    &comp->steps[op->ch1],
11059|  5.74k|                                                    &first);
11060|  5.74k|			CHECK_ERROR0;
  ------------------
  |  |  236|  5.74k|    if (ctxt->error != XPATH_EXPRESSION_OK) return(0)
  |  |  ------------------
  |  |  |  Branch (236:9): [True: 823, False: 4.92k]
  |  |  ------------------
  ------------------
11061|       |                        /*
11062|       |                         * The nodeset should be in document order,
11063|       |                         * Keep only the first value
11064|       |                         */
11065|  4.92k|                        if ((ctxt->value != NULL) &&
  ------------------
  |  Branch (11065:29): [True: 4.92k, False: 0]
  ------------------
11066|  4.92k|                            (ctxt->value->type == XPATH_NODESET) &&
  ------------------
  |  Branch (11066:29): [True: 4.84k, False: 81]
  ------------------
11067|  4.84k|                            (ctxt->value->nodesetval != NULL) &&
  ------------------
  |  Branch (11067:29): [True: 4.84k, False: 0]
  ------------------
11068|  4.84k|                            (ctxt->value->nodesetval->nodeNr > 1))
  ------------------
  |  Branch (11068:29): [True: 92, False: 4.75k]
  ------------------
11069|     92|                            xmlXPathNodeSetClearFromPos(ctxt->value->nodesetval,
11070|     92|                                                        1, 1);
11071|  4.92k|                        break;
11072|  5.74k|                    }
11073|  6.34k|                }
11074|       |                /*
11075|       |                 * Optimization for ()[last()] selection i.e. the last elem
11076|       |                 */
11077|  3.88k|                if ((op->ch1 != -1) && (op->ch2 != -1) &&
  ------------------
  |  Branch (11077:21): [True: 3.88k, False: 0]
  |  Branch (11077:40): [True: 3.88k, False: 0]
  ------------------
11078|  3.88k|                    (comp->steps[op->ch1].op == XPATH_OP_SORT) &&
  ------------------
  |  Branch (11078:21): [True: 3.13k, False: 754]
  ------------------
11079|  3.13k|                    (comp->steps[op->ch2].op == XPATH_OP_SORT)) {
  ------------------
  |  Branch (11079:21): [True: 2.97k, False: 156]
  ------------------
11080|  2.97k|                    int f = comp->steps[op->ch2].ch1;
11081|       |
11082|  2.97k|                    if ((f != -1) &&
  ------------------
  |  Branch (11082:25): [True: 2.97k, False: 0]
  ------------------
11083|  2.97k|                        (comp->steps[f].op == XPATH_OP_FUNCTION) &&
  ------------------
  |  Branch (11083:25): [True: 1.70k, False: 1.27k]
  ------------------
11084|  1.70k|                        (comp->steps[f].value5 == NULL) &&
  ------------------
  |  Branch (11084:25): [True: 1.49k, False: 203]
  ------------------
11085|  1.49k|                        (comp->steps[f].value == 0) &&
  ------------------
  |  Branch (11085:25): [True: 1.30k, False: 190]
  ------------------
11086|  1.30k|                        (comp->steps[f].value4 != NULL) &&
  ------------------
  |  Branch (11086:25): [True: 1.30k, False: 0]
  ------------------
11087|  1.30k|                        (xmlStrEqual
  ------------------
  |  Branch (11087:25): [True: 1.12k, False: 179]
  ------------------
11088|  1.30k|                         (comp->steps[f].value4, BAD_CAST "last"))) {
  ------------------
  |  |   34|  1.30k|#define BAD_CAST (xmlChar *)
  ------------------
11089|  1.12k|                        xmlNodePtr last = NULL;
11090|       |
11091|  1.12k|                        total +=
11092|  1.12k|                            xmlXPathCompOpEvalLast(ctxt,
11093|  1.12k|                                                   &comp->steps[op->ch1],
11094|  1.12k|                                                   &last);
11095|  1.12k|			CHECK_ERROR0;
  ------------------
  |  |  236|  1.12k|    if (ctxt->error != XPATH_EXPRESSION_OK) return(0)
  |  |  ------------------
  |  |  |  Branch (236:9): [True: 31, False: 1.09k]
  |  |  ------------------
  ------------------
11096|       |                        /*
11097|       |                         * The nodeset should be in document order,
11098|       |                         * Keep only the last value
11099|       |                         */
11100|  1.09k|                        if ((ctxt->value != NULL) &&
  ------------------
  |  Branch (11100:29): [True: 1.09k, False: 0]
  ------------------
11101|  1.09k|                            (ctxt->value->type == XPATH_NODESET) &&
  ------------------
  |  Branch (11101:29): [True: 1.04k, False: 55]
  ------------------
11102|  1.04k|                            (ctxt->value->nodesetval != NULL) &&
  ------------------
  |  Branch (11102:29): [True: 1.04k, False: 0]
  ------------------
11103|  1.04k|                            (ctxt->value->nodesetval->nodeTab != NULL) &&
  ------------------
  |  Branch (11103:29): [True: 969, False: 74]
  ------------------
11104|    969|                            (ctxt->value->nodesetval->nodeNr > 1))
  ------------------
  |  Branch (11104:29): [True: 325, False: 644]
  ------------------
11105|    325|                            xmlXPathNodeSetKeepLast(ctxt->value->nodesetval);
11106|  1.09k|                        break;
11107|  1.12k|                    }
11108|  2.97k|                }
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|  2.75k|                if (op->ch1 != -1)
  ------------------
  |  Branch (11120:21): [True: 2.75k, False: 0]
  ------------------
11121|  2.75k|                    total +=
11122|  2.75k|                        xmlXPathCompOpEval(ctxt, &comp->steps[op->ch1]);
11123|  2.75k|		CHECK_ERROR0;
  ------------------
  |  |  236|  2.75k|    if (ctxt->error != XPATH_EXPRESSION_OK) return(0)
  |  |  ------------------
  |  |  |  Branch (236:9): [True: 342, False: 2.41k]
  |  |  ------------------
  ------------------
11124|  2.41k|                if (op->ch2 == -1)
  ------------------
  |  Branch (11124:21): [True: 0, False: 2.41k]
  ------------------
11125|      0|                    break;
11126|  2.41k|                if (ctxt->value == NULL)
  ------------------
  |  Branch (11126:21): [True: 0, False: 2.41k]
  ------------------
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|  2.41k|                CHECK_TYPE0(XPATH_NODESET);
  ------------------
  |  |  271|  2.41k|    if ((ctxt->value == NULL) || (ctxt->value->type != typeval))	\
  |  |  ------------------
  |  |  |  Branch (271:9): [True: 0, False: 2.41k]
  |  |  |  Branch (271:34): [True: 21, False: 2.39k]
  |  |  ------------------
  |  |  272|  2.41k|        XP_ERROR0(XPATH_INVALID_TYPE)
  |  |  ------------------
  |  |  |  |  252|     21|    { xmlXPathErr(ctxt, X); return(0); }
  |  |  ------------------
  ------------------
11136|  2.39k|                obj = xmlXPathValuePop(ctxt);
11137|  2.39k|                set = obj->nodesetval;
11138|  2.39k|                if (set != NULL)
  ------------------
  |  Branch (11138:21): [True: 2.39k, False: 0]
  ------------------
11139|  2.39k|                    xmlXPathNodeSetFilter(ctxt, set, op->ch2,
11140|  2.39k|                                          1, set->nodeNr, 1);
11141|  2.39k|                xmlXPathValuePush(ctxt, obj);
11142|  2.39k|                break;
11143|  2.41k|            }
11144|  78.9k|        case XPATH_OP_SORT:
  ------------------
  |  Branch (11144:9): [True: 78.9k, False: 3.31M]
  ------------------
11145|  78.9k|            if (op->ch1 != -1)
  ------------------
  |  Branch (11145:17): [True: 78.9k, False: 0]
  ------------------
11146|  78.9k|                total += xmlXPathCompOpEval(ctxt, &comp->steps[op->ch1]);
11147|  78.9k|	    CHECK_ERROR0;
  ------------------
  |  |  236|  78.9k|    if (ctxt->error != XPATH_EXPRESSION_OK) return(0)
  |  |  ------------------
  |  |  |  Branch (236:9): [True: 3.51k, False: 75.4k]
  |  |  ------------------
  ------------------
11148|  75.4k|            if ((ctxt->value != NULL) &&
  ------------------
  |  Branch (11148:17): [True: 75.4k, False: 0]
  ------------------
11149|  75.4k|                (ctxt->value->type == XPATH_NODESET) &&
  ------------------
  |  Branch (11149:17): [True: 50.2k, False: 25.1k]
  ------------------
11150|  50.2k|                (ctxt->value->nodesetval != NULL) &&
  ------------------
  |  Branch (11150:17): [True: 50.2k, False: 0]
  ------------------
11151|  50.2k|		(ctxt->value->nodesetval->nodeNr > 1))
  ------------------
  |  Branch (11151:3): [True: 3.04k, False: 47.2k]
  ------------------
11152|  3.04k|	    {
11153|  3.04k|                xmlXPathNodeSetSort(ctxt->value->nodesetval);
11154|  3.04k|	    }
11155|  75.4k|            break;
11156|      0|        default:
  ------------------
  |  Branch (11156:9): [True: 0, False: 3.39M]
  ------------------
11157|      0|            XP_ERROR0(XPATH_INVALID_OPERAND);
  ------------------
  |  |  252|      0|    { xmlXPathErr(ctxt, X); return(0); }
  ------------------
11158|      0|            break;
11159|  3.39M|    }
11160|       |
11161|  3.36M|    ctxt->context->depth -= 1;
11162|  3.36M|    return (total);
11163|  3.39M|}
xpath.c:xmlXPathCompOpEvalFirst:
10406|  12.2k|{
10407|  12.2k|    int total = 0, cur;
10408|  12.2k|    xmlXPathCompExprPtr comp;
10409|  12.2k|    xmlXPathObjectPtr arg1, arg2;
10410|       |
10411|  12.2k|    CHECK_ERROR0;
  ------------------
  |  |  236|  12.2k|    if (ctxt->error != XPATH_EXPRESSION_OK) return(0)
  |  |  ------------------
  |  |  |  Branch (236:9): [True: 0, False: 12.2k]
  |  |  ------------------
  ------------------
10412|  12.2k|    if (OP_LIMIT_EXCEEDED(ctxt, 1))
  ------------------
  |  |  818|  12.2k|    ((ctxt->context->opLimit != 0) && (xmlXPathCheckOpLimit(ctxt, n) < 0))
  |  |  ------------------
  |  |  |  Branch (818:6): [True: 12.2k, False: 0]
  |  |  |  Branch (818:39): [True: 0, False: 12.2k]
  |  |  ------------------
  ------------------
10413|      0|        return(0);
10414|  12.2k|    if (ctxt->context->depth >= XPATH_MAX_RECURSION_DEPTH)
  ------------------
  |  |  112|  12.2k|#define XPATH_MAX_RECURSION_DEPTH 500
  ------------------
  |  Branch (10414:9): [True: 0, False: 12.2k]
  ------------------
10415|  12.2k|        XP_ERROR0(XPATH_RECURSION_LIMIT_EXCEEDED);
  ------------------
  |  |  252|      0|    { xmlXPathErr(ctxt, X); return(0); }
  ------------------
10416|  12.2k|    ctxt->context->depth += 1;
10417|  12.2k|    comp = ctxt->comp;
10418|  12.2k|    switch (op->op) {
10419|      0|        case XPATH_OP_END:
  ------------------
  |  Branch (10419:9): [True: 0, False: 12.2k]
  ------------------
10420|      0|            break;
10421|  2.52k|        case XPATH_OP_UNION:
  ------------------
  |  Branch (10421:9): [True: 2.52k, False: 9.73k]
  ------------------
10422|  2.52k|            total =
10423|  2.52k|                xmlXPathCompOpEvalFirst(ctxt, &comp->steps[op->ch1],
10424|  2.52k|                                        first);
10425|  2.52k|	    CHECK_ERROR0;
  ------------------
  |  |  236|  2.52k|    if (ctxt->error != XPATH_EXPRESSION_OK) return(0)
  |  |  ------------------
  |  |  |  Branch (236:9): [True: 428, False: 2.09k]
  |  |  ------------------
  ------------------
10426|  2.09k|            if ((ctxt->value != NULL)
  ------------------
  |  Branch (10426:17): [True: 2.09k, False: 0]
  ------------------
10427|  2.09k|                && (ctxt->value->type == XPATH_NODESET)
  ------------------
  |  Branch (10427:20): [True: 2.09k, False: 3]
  ------------------
10428|  2.09k|                && (ctxt->value->nodesetval != NULL)
  ------------------
  |  Branch (10428:20): [True: 2.09k, False: 0]
  ------------------
10429|  2.09k|                && (ctxt->value->nodesetval->nodeNr >= 1)) {
  ------------------
  |  Branch (10429:20): [True: 1.56k, False: 528]
  ------------------
10430|       |                /*
10431|       |                 * limit tree traversing to first node in the result
10432|       |                 */
10433|       |		/*
10434|       |		* OPTIMIZE TODO: This implicitly sorts
10435|       |		*  the result, even if not needed. E.g. if the argument
10436|       |		*  of the count() function, no sorting is needed.
10437|       |		* OPTIMIZE TODO: How do we know if the node-list wasn't
10438|       |		*  already sorted?
10439|       |		*/
10440|  1.56k|		if (ctxt->value->nodesetval->nodeNr > 1)
  ------------------
  |  Branch (10440:7): [True: 1.03k, False: 526]
  ------------------
10441|  1.03k|		    xmlXPathNodeSetSort(ctxt->value->nodesetval);
10442|  1.56k|                *first = ctxt->value->nodesetval->nodeTab[0];
10443|  1.56k|            }
10444|  2.09k|            cur =
10445|  2.09k|                xmlXPathCompOpEvalFirst(ctxt, &comp->steps[op->ch2],
10446|  2.09k|                                        first);
10447|  2.09k|	    CHECK_ERROR0;
  ------------------
  |  |  236|  2.09k|    if (ctxt->error != XPATH_EXPRESSION_OK) return(0)
  |  |  ------------------
  |  |  |  Branch (236:9): [True: 23, False: 2.07k]
  |  |  ------------------
  ------------------
10448|       |
10449|  2.07k|            arg2 = xmlXPathValuePop(ctxt);
10450|  2.07k|            arg1 = xmlXPathValuePop(ctxt);
10451|  2.07k|            if ((arg1 == NULL) || (arg1->type != XPATH_NODESET) ||
  ------------------
  |  Branch (10451:17): [True: 0, False: 2.07k]
  |  Branch (10451:35): [True: 3, False: 2.07k]
  ------------------
10452|  2.07k|                (arg2 == NULL) || (arg2->type != XPATH_NODESET)) {
  ------------------
  |  Branch (10452:17): [True: 0, False: 2.07k]
  |  Branch (10452:35): [True: 4, False: 2.06k]
  ------------------
10453|      7|	        xmlXPathReleaseObject(ctxt->context, arg1);
10454|      7|	        xmlXPathReleaseObject(ctxt->context, arg2);
10455|      7|                XP_ERROR0(XPATH_INVALID_TYPE);
  ------------------
  |  |  252|      7|    { xmlXPathErr(ctxt, X); return(0); }
  ------------------
10456|      0|            }
10457|  2.06k|            if ((ctxt->context->opLimit != 0) &&
  ------------------
  |  Branch (10457:17): [True: 2.06k, False: 0]
  ------------------
10458|  2.06k|                (((arg1->nodesetval != NULL) &&
  ------------------
  |  Branch (10458:19): [True: 2.06k, False: 0]
  ------------------
10459|  2.06k|                  (xmlXPathCheckOpLimit(ctxt,
  ------------------
  |  Branch (10459:19): [True: 0, False: 2.06k]
  ------------------
10460|  2.06k|                                        arg1->nodesetval->nodeNr) < 0)) ||
10461|  2.06k|                 ((arg2->nodesetval != NULL) &&
  ------------------
  |  Branch (10461:19): [True: 2.06k, False: 0]
  ------------------
10462|  2.06k|                  (xmlXPathCheckOpLimit(ctxt,
  ------------------
  |  Branch (10462:19): [True: 0, False: 2.06k]
  ------------------
10463|  2.06k|                                        arg2->nodesetval->nodeNr) < 0)))) {
10464|      0|	        xmlXPathReleaseObject(ctxt->context, arg1);
10465|      0|	        xmlXPathReleaseObject(ctxt->context, arg2);
10466|      0|                break;
10467|      0|            }
10468|       |
10469|  2.06k|            if ((arg2->nodesetval != NULL) &&
  ------------------
  |  Branch (10469:17): [True: 2.06k, False: 0]
  ------------------
10470|  2.06k|                (arg2->nodesetval->nodeNr != 0)) {
  ------------------
  |  Branch (10470:17): [True: 174, False: 1.89k]
  ------------------
10471|    174|                arg1->nodesetval = xmlXPathNodeSetMerge(arg1->nodesetval,
10472|    174|                                                        arg2->nodesetval);
10473|    174|                if (arg1->nodesetval == NULL)
  ------------------
  |  Branch (10473:21): [True: 2, False: 172]
  ------------------
10474|      2|                    xmlXPathPErrMemory(ctxt);
10475|    174|            }
10476|  2.06k|            xmlXPathValuePush(ctxt, arg1);
10477|  2.06k|	    xmlXPathReleaseObject(ctxt->context, arg2);
10478|  2.06k|            total += cur;
10479|  2.06k|            break;
10480|    288|        case XPATH_OP_ROOT:
  ------------------
  |  Branch (10480:9): [True: 288, False: 11.9k]
  ------------------
10481|    288|            xmlXPathRoot(ctxt);
10482|    288|            break;
10483|    735|        case XPATH_OP_NODE:
  ------------------
  |  Branch (10483:9): [True: 735, False: 11.5k]
  ------------------
10484|    735|            if (op->ch1 != -1)
  ------------------
  |  Branch (10484:17): [True: 0, False: 735]
  ------------------
10485|      0|                total += xmlXPathCompOpEval(ctxt, &comp->steps[op->ch1]);
10486|    735|	    CHECK_ERROR0;
  ------------------
  |  |  236|    735|    if (ctxt->error != XPATH_EXPRESSION_OK) return(0)
  |  |  ------------------
  |  |  |  Branch (236:9): [True: 0, False: 735]
  |  |  ------------------
  ------------------
10487|    735|            if (op->ch2 != -1)
  ------------------
  |  Branch (10487:17): [True: 0, False: 735]
  ------------------
10488|      0|                total += xmlXPathCompOpEval(ctxt, &comp->steps[op->ch2]);
10489|    735|	    CHECK_ERROR0;
  ------------------
  |  |  236|    735|    if (ctxt->error != XPATH_EXPRESSION_OK) return(0)
  |  |  ------------------
  |  |  |  Branch (236:9): [True: 0, False: 735]
  |  |  ------------------
  ------------------
10490|    735|	    xmlXPathValuePush(ctxt, xmlXPathCacheNewNodeSet(ctxt,
10491|    735|		ctxt->context->node));
10492|    735|            break;
10493|  2.75k|        case XPATH_OP_COLLECT:{
  ------------------
  |  Branch (10493:9): [True: 2.75k, False: 9.50k]
  ------------------
10494|  2.75k|                if (op->ch1 == -1)
  ------------------
  |  Branch (10494:21): [True: 0, False: 2.75k]
  ------------------
10495|      0|                    break;
10496|       |
10497|  2.75k|                total = xmlXPathCompOpEval(ctxt, &comp->steps[op->ch1]);
10498|  2.75k|		CHECK_ERROR0;
  ------------------
  |  |  236|  2.75k|    if (ctxt->error != XPATH_EXPRESSION_OK) return(0)
  |  |  ------------------
  |  |  |  Branch (236:9): [True: 10, False: 2.74k]
  |  |  ------------------
  ------------------
10499|       |
10500|  2.74k|                total += xmlXPathNodeCollectAndTest(ctxt, op, first, NULL, 0);
10501|  2.74k|                break;
10502|  2.75k|            }
10503|      5|        case XPATH_OP_VALUE:
  ------------------
  |  Branch (10503:9): [True: 5, False: 12.2k]
  ------------------
10504|      5|            xmlXPathValuePush(ctxt, xmlXPathCacheObjectCopy(ctxt, op->value4));
10505|      5|            break;
10506|  1.89k|        case XPATH_OP_SORT:
  ------------------
  |  Branch (10506:9): [True: 1.89k, False: 10.3k]
  ------------------
10507|  1.89k|            if (op->ch1 != -1)
  ------------------
  |  Branch (10507:17): [True: 1.89k, False: 0]
  ------------------
10508|  1.89k|                total +=
10509|  1.89k|                    xmlXPathCompOpEvalFirst(ctxt, &comp->steps[op->ch1],
10510|  1.89k|                                            first);
10511|  1.89k|	    CHECK_ERROR0;
  ------------------
  |  |  236|  1.89k|    if (ctxt->error != XPATH_EXPRESSION_OK) return(0)
  |  |  ------------------
  |  |  |  Branch (236:9): [True: 42, False: 1.85k]
  |  |  ------------------
  ------------------
10512|  1.85k|            if ((ctxt->value != NULL)
  ------------------
  |  Branch (10512:17): [True: 1.85k, False: 0]
  ------------------
10513|  1.85k|                && (ctxt->value->type == XPATH_NODESET)
  ------------------
  |  Branch (10513:20): [True: 1.77k, False: 78]
  ------------------
10514|  1.77k|                && (ctxt->value->nodesetval != NULL)
  ------------------
  |  Branch (10514:20): [True: 1.77k, False: 0]
  ------------------
10515|  1.77k|		&& (ctxt->value->nodesetval->nodeNr > 1))
  ------------------
  |  Branch (10515:6): [True: 108, False: 1.66k]
  ------------------
10516|    108|                xmlXPathNodeSetSort(ctxt->value->nodesetval);
10517|  1.85k|            break;
10518|      0|#ifdef XP_OPTIMIZED_FILTER_FIRST
10519|  3.97k|	case XPATH_OP_FILTER:
  ------------------
  |  Branch (10519:2): [True: 3.97k, False: 8.28k]
  ------------------
10520|  3.97k|                total += xmlXPathCompOpEvalFilterFirst(ctxt, op, first);
10521|  3.97k|            break;
10522|      0|#endif
10523|     81|        default:
  ------------------
  |  Branch (10523:9): [True: 81, False: 12.1k]
  ------------------
10524|     81|            total += xmlXPathCompOpEval(ctxt, op);
10525|     81|            break;
10526|  12.2k|    }
10527|       |
10528|  11.7k|    ctxt->context->depth -= 1;
10529|  11.7k|    return(total);
10530|  12.2k|}
xpath.c:xmlXPathCompOpEvalFilterFirst:
10668|  3.97k|{
10669|  3.97k|    int total = 0;
10670|  3.97k|    xmlXPathCompExprPtr comp;
10671|  3.97k|    xmlXPathObjectPtr obj;
10672|  3.97k|    xmlNodeSetPtr set;
10673|       |
10674|  3.97k|    CHECK_ERROR0;
  ------------------
  |  |  236|  3.97k|    if (ctxt->error != XPATH_EXPRESSION_OK) return(0)
  |  |  ------------------
  |  |  |  Branch (236:9): [True: 0, False: 3.97k]
  |  |  ------------------
  ------------------
10675|  3.97k|    comp = ctxt->comp;
10676|       |    /*
10677|       |    * Optimization for ()[last()] selection i.e. the last elem
10678|       |    */
10679|  3.97k|    if ((op->ch1 != -1) && (op->ch2 != -1) &&
  ------------------
  |  Branch (10679:9): [True: 3.97k, False: 0]
  |  Branch (10679:28): [True: 3.97k, False: 0]
  ------------------
10680|  3.97k|	(comp->steps[op->ch1].op == XPATH_OP_SORT) &&
  ------------------
  |  Branch (10680:2): [True: 3.03k, False: 938]
  ------------------
10681|  3.03k|	(comp->steps[op->ch2].op == XPATH_OP_SORT)) {
  ------------------
  |  Branch (10681:2): [True: 2.79k, False: 239]
  ------------------
10682|  2.79k|	int f = comp->steps[op->ch2].ch1;
10683|       |
10684|  2.79k|	if ((f != -1) &&
  ------------------
  |  Branch (10684:6): [True: 2.79k, False: 0]
  ------------------
10685|  2.79k|	    (comp->steps[f].op == XPATH_OP_FUNCTION) &&
  ------------------
  |  Branch (10685:6): [True: 2.45k, False: 347]
  ------------------
10686|  2.45k|	    (comp->steps[f].value5 == NULL) &&
  ------------------
  |  Branch (10686:6): [True: 2.44k, False: 3]
  ------------------
10687|  2.44k|	    (comp->steps[f].value == 0) &&
  ------------------
  |  Branch (10687:6): [True: 2.36k, False: 86]
  ------------------
10688|  2.36k|	    (comp->steps[f].value4 != NULL) &&
  ------------------
  |  Branch (10688:6): [True: 2.36k, False: 0]
  ------------------
10689|  2.36k|	    (xmlStrEqual
  ------------------
  |  Branch (10689:6): [True: 2.17k, False: 189]
  ------------------
10690|  2.36k|	    (comp->steps[f].value4, BAD_CAST "last"))) {
  ------------------
  |  |   34|  2.36k|#define BAD_CAST (xmlChar *)
  ------------------
10691|  2.17k|	    xmlNodePtr last = NULL;
10692|       |
10693|  2.17k|	    total +=
10694|  2.17k|		xmlXPathCompOpEvalLast(ctxt,
10695|  2.17k|		    &comp->steps[op->ch1],
10696|  2.17k|		    &last);
10697|  2.17k|	    CHECK_ERROR0;
  ------------------
  |  |  236|  2.17k|    if (ctxt->error != XPATH_EXPRESSION_OK) return(0)
  |  |  ------------------
  |  |  |  Branch (236:9): [True: 6, False: 2.16k]
  |  |  ------------------
  ------------------
10698|       |	    /*
10699|       |	    * The nodeset should be in document order,
10700|       |	    * Keep only the last value
10701|       |	    */
10702|  2.16k|	    if ((ctxt->value != NULL) &&
  ------------------
  |  Branch (10702:10): [True: 2.16k, False: 0]
  ------------------
10703|  2.16k|		(ctxt->value->type == XPATH_NODESET) &&
  ------------------
  |  Branch (10703:3): [True: 2.16k, False: 6]
  ------------------
10704|  2.16k|		(ctxt->value->nodesetval != NULL) &&
  ------------------
  |  Branch (10704:3): [True: 2.16k, False: 0]
  ------------------
10705|  2.16k|		(ctxt->value->nodesetval->nodeTab != NULL) &&
  ------------------
  |  Branch (10705:3): [True: 1.93k, False: 229]
  ------------------
10706|  1.93k|		(ctxt->value->nodesetval->nodeNr > 1)) {
  ------------------
  |  Branch (10706:3): [True: 881, False: 1.05k]
  ------------------
10707|    881|                xmlXPathNodeSetKeepLast(ctxt->value->nodesetval);
10708|    881|		*first = *(ctxt->value->nodesetval->nodeTab);
10709|    881|	    }
10710|  2.16k|	    return (total);
10711|  2.17k|	}
10712|  2.79k|    }
10713|       |
10714|  1.80k|    if (op->ch1 != -1)
  ------------------
  |  Branch (10714:9): [True: 1.80k, False: 0]
  ------------------
10715|  1.80k|	total += xmlXPathCompOpEval(ctxt, &comp->steps[op->ch1]);
10716|  1.80k|    CHECK_ERROR0;
  ------------------
  |  |  236|  1.80k|    if (ctxt->error != XPATH_EXPRESSION_OK) return(0)
  |  |  ------------------
  |  |  |  Branch (236:9): [True: 777, False: 1.02k]
  |  |  ------------------
  ------------------
10717|  1.02k|    if (op->ch2 == -1)
  ------------------
  |  Branch (10717:9): [True: 0, False: 1.02k]
  ------------------
10718|      0|	return (total);
10719|  1.02k|    if (ctxt->value == NULL)
  ------------------
  |  Branch (10719:9): [True: 0, False: 1.02k]
  ------------------
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.02k|    CHECK_TYPE0(XPATH_NODESET);
  ------------------
  |  |  271|  1.02k|    if ((ctxt->value == NULL) || (ctxt->value->type != typeval))	\
  |  |  ------------------
  |  |  |  Branch (271:9): [True: 0, False: 1.02k]
  |  |  |  Branch (271:34): [True: 4, False: 1.02k]
  |  |  ------------------
  |  |  272|  1.02k|        XP_ERROR0(XPATH_INVALID_TYPE)
  |  |  ------------------
  |  |  |  |  252|      4|    { xmlXPathErr(ctxt, X); return(0); }
  |  |  ------------------
  ------------------
10728|  1.02k|    obj = xmlXPathValuePop(ctxt);
10729|  1.02k|    set = obj->nodesetval;
10730|  1.02k|    if (set != NULL) {
  ------------------
  |  Branch (10730:9): [True: 1.02k, False: 0]
  ------------------
10731|  1.02k|        xmlXPathNodeSetFilter(ctxt, set, op->ch2, 1, 1, 1);
10732|  1.02k|        if (set->nodeNr > 0)
  ------------------
  |  Branch (10732:13): [True: 444, False: 577]
  ------------------
10733|    444|            *first = set->nodeTab[0];
10734|  1.02k|    }
10735|  1.02k|    xmlXPathValuePush(ctxt, obj);
10736|       |
10737|  1.02k|    return (total);
10738|  1.02k|}
xpath.c:xmlXPathCompOpEvalLast:
10544|  28.8k|{
10545|  28.8k|    int total = 0, cur;
10546|  28.8k|    xmlXPathCompExprPtr comp;
10547|  28.8k|    xmlXPathObjectPtr arg1, arg2;
10548|       |
10549|  28.8k|    CHECK_ERROR0;
  ------------------
  |  |  236|  28.8k|    if (ctxt->error != XPATH_EXPRESSION_OK) return(0)
  |  |  ------------------
  |  |  |  Branch (236:9): [True: 0, False: 28.8k]
  |  |  ------------------
  ------------------
10550|  28.8k|    if (OP_LIMIT_EXCEEDED(ctxt, 1))
  ------------------
  |  |  818|  28.8k|    ((ctxt->context->opLimit != 0) && (xmlXPathCheckOpLimit(ctxt, n) < 0))
  |  |  ------------------
  |  |  |  Branch (818:6): [True: 28.8k, False: 0]
  |  |  |  Branch (818:39): [True: 1, False: 28.8k]
  |  |  ------------------
  ------------------
10551|      1|        return(0);
10552|  28.8k|    if (ctxt->context->depth >= XPATH_MAX_RECURSION_DEPTH)
  ------------------
  |  |  112|  28.8k|#define XPATH_MAX_RECURSION_DEPTH 500
  ------------------
  |  Branch (10552:9): [True: 0, False: 28.8k]
  ------------------
10553|  28.8k|        XP_ERROR0(XPATH_RECURSION_LIMIT_EXCEEDED);
  ------------------
  |  |  252|      0|    { xmlXPathErr(ctxt, X); return(0); }
  ------------------
10554|  28.8k|    ctxt->context->depth += 1;
10555|  28.8k|    comp = ctxt->comp;
10556|  28.8k|    switch (op->op) {
10557|      0|        case XPATH_OP_END:
  ------------------
  |  Branch (10557:9): [True: 0, False: 28.8k]
  ------------------
10558|      0|            break;
10559|  11.1k|        case XPATH_OP_UNION:
  ------------------
  |  Branch (10559:9): [True: 11.1k, False: 17.6k]
  ------------------
10560|  11.1k|            total =
10561|  11.1k|                xmlXPathCompOpEvalLast(ctxt, &comp->steps[op->ch1], last);
10562|  11.1k|	    CHECK_ERROR0;
  ------------------
  |  |  236|  11.1k|    if (ctxt->error != XPATH_EXPRESSION_OK) return(0)
  |  |  ------------------
  |  |  |  Branch (236:9): [True: 76, False: 11.0k]
  |  |  ------------------
  ------------------
10563|  11.0k|            if ((ctxt->value != NULL)
  ------------------
  |  Branch (10563:17): [True: 11.0k, False: 0]
  ------------------
10564|  11.0k|                && (ctxt->value->type == XPATH_NODESET)
  ------------------
  |  Branch (10564:20): [True: 11.0k, False: 0]
  ------------------
10565|  11.0k|                && (ctxt->value->nodesetval != NULL)
  ------------------
  |  Branch (10565:20): [True: 11.0k, False: 0]
  ------------------
10566|  11.0k|                && (ctxt->value->nodesetval->nodeNr >= 1)) {
  ------------------
  |  Branch (10566:20): [True: 7.30k, False: 3.75k]
  ------------------
10567|       |                /*
10568|       |                 * limit tree traversing to first node in the result
10569|       |                 */
10570|  7.30k|		if (ctxt->value->nodesetval->nodeNr > 1)
  ------------------
  |  Branch (10570:7): [True: 2.03k, False: 5.26k]
  ------------------
10571|  2.03k|		    xmlXPathNodeSetSort(ctxt->value->nodesetval);
10572|  7.30k|                *last =
10573|  7.30k|                    ctxt->value->nodesetval->nodeTab[ctxt->value->
10574|  7.30k|                                                     nodesetval->nodeNr -
10575|  7.30k|                                                     1];
10576|  7.30k|            }
10577|  11.0k|            cur =
10578|  11.0k|                xmlXPathCompOpEvalLast(ctxt, &comp->steps[op->ch2], last);
10579|  11.0k|	    CHECK_ERROR0;
  ------------------
  |  |  236|  11.0k|    if (ctxt->error != XPATH_EXPRESSION_OK) return(0)
  |  |  ------------------
  |  |  |  Branch (236:9): [True: 23, False: 11.0k]
  |  |  ------------------
  ------------------
10580|  11.0k|            if ((ctxt->value != NULL)
  ------------------
  |  Branch (10580:17): [True: 11.0k, False: 0]
  ------------------
10581|  11.0k|                && (ctxt->value->type == XPATH_NODESET)
  ------------------
  |  Branch (10581:20): [True: 11.0k, False: 1]
  ------------------
10582|  11.0k|                && (ctxt->value->nodesetval != NULL)
  ------------------
  |  Branch (10582:20): [True: 11.0k, False: 0]
  ------------------
10583|  11.0k|                && (ctxt->value->nodesetval->nodeNr >= 1)) { /* TODO: NOP ? */
  ------------------
  |  Branch (10583:20): [True: 3.83k, False: 7.20k]
  ------------------
10584|  3.83k|            }
10585|       |
10586|  11.0k|            arg2 = xmlXPathValuePop(ctxt);
10587|  11.0k|            arg1 = xmlXPathValuePop(ctxt);
10588|  11.0k|            if ((arg1 == NULL) || (arg1->type != XPATH_NODESET) ||
  ------------------
  |  Branch (10588:17): [True: 0, False: 11.0k]
  |  Branch (10588:35): [True: 0, False: 11.0k]
  ------------------
10589|  11.0k|                (arg2 == NULL) || (arg2->type != XPATH_NODESET)) {
  ------------------
  |  Branch (10589:17): [True: 0, False: 11.0k]
  |  Branch (10589:35): [True: 1, False: 11.0k]
  ------------------
10590|      1|	        xmlXPathReleaseObject(ctxt->context, arg1);
10591|      1|	        xmlXPathReleaseObject(ctxt->context, arg2);
10592|      1|                XP_ERROR0(XPATH_INVALID_TYPE);
  ------------------
  |  |  252|      1|    { xmlXPathErr(ctxt, X); return(0); }
  ------------------
10593|      0|            }
10594|  11.0k|            if ((ctxt->context->opLimit != 0) &&
  ------------------
  |  Branch (10594:17): [True: 11.0k, False: 0]
  ------------------
10595|  11.0k|                (((arg1->nodesetval != NULL) &&
  ------------------
  |  Branch (10595:19): [True: 11.0k, False: 0]
  ------------------
10596|  11.0k|                  (xmlXPathCheckOpLimit(ctxt,
  ------------------
  |  Branch (10596:19): [True: 0, False: 11.0k]
  ------------------
10597|  11.0k|                                        arg1->nodesetval->nodeNr) < 0)) ||
10598|  11.0k|                 ((arg2->nodesetval != NULL) &&
  ------------------
  |  Branch (10598:19): [True: 11.0k, False: 0]
  ------------------
10599|  11.0k|                  (xmlXPathCheckOpLimit(ctxt,
  ------------------
  |  Branch (10599:19): [True: 0, False: 11.0k]
  ------------------
10600|  11.0k|                                        arg2->nodesetval->nodeNr) < 0)))) {
10601|      0|	        xmlXPathReleaseObject(ctxt->context, arg1);
10602|      0|	        xmlXPathReleaseObject(ctxt->context, arg2);
10603|      0|                break;
10604|      0|            }
10605|       |
10606|  11.0k|            if ((arg2->nodesetval != NULL) &&
  ------------------
  |  Branch (10606:17): [True: 11.0k, False: 0]
  ------------------
10607|  11.0k|                (arg2->nodesetval->nodeNr != 0)) {
  ------------------
  |  Branch (10607:17): [True: 3.83k, False: 7.20k]
  ------------------
10608|  3.83k|                arg1->nodesetval = xmlXPathNodeSetMerge(arg1->nodesetval,
10609|  3.83k|                                                        arg2->nodesetval);
10610|  3.83k|                if (arg1->nodesetval == NULL)
  ------------------
  |  Branch (10610:21): [True: 2, False: 3.83k]
  ------------------
10611|      2|                    xmlXPathPErrMemory(ctxt);
10612|  3.83k|            }
10613|  11.0k|            xmlXPathValuePush(ctxt, arg1);
10614|  11.0k|	    xmlXPathReleaseObject(ctxt->context, arg2);
10615|  11.0k|            total += cur;
10616|  11.0k|            break;
10617|    328|        case XPATH_OP_ROOT:
  ------------------
  |  Branch (10617:9): [True: 328, False: 28.4k]
  ------------------
10618|    328|            xmlXPathRoot(ctxt);
10619|    328|            break;
10620|    560|        case XPATH_OP_NODE:
  ------------------
  |  Branch (10620:9): [True: 560, False: 28.2k]
  ------------------
10621|    560|            if (op->ch1 != -1)
  ------------------
  |  Branch (10621:17): [True: 0, False: 560]
  ------------------
10622|      0|                total += xmlXPathCompOpEval(ctxt, &comp->steps[op->ch1]);
10623|    560|	    CHECK_ERROR0;
  ------------------
  |  |  236|    560|    if (ctxt->error != XPATH_EXPRESSION_OK) return(0)
  |  |  ------------------
  |  |  |  Branch (236:9): [True: 0, False: 560]
  |  |  ------------------
  ------------------
10624|    560|            if (op->ch2 != -1)
  ------------------
  |  Branch (10624:17): [True: 0, False: 560]
  ------------------
10625|      0|                total += xmlXPathCompOpEval(ctxt, &comp->steps[op->ch2]);
10626|    560|	    CHECK_ERROR0;
  ------------------
  |  |  236|    560|    if (ctxt->error != XPATH_EXPRESSION_OK) return(0)
  |  |  ------------------
  |  |  |  Branch (236:9): [True: 0, False: 560]
  |  |  ------------------
  ------------------
10627|    560|	    xmlXPathValuePush(ctxt, xmlXPathCacheNewNodeSet(ctxt,
10628|    560|		ctxt->context->node));
10629|    560|            break;
10630|  13.4k|        case XPATH_OP_COLLECT:{
  ------------------
  |  Branch (10630:9): [True: 13.4k, False: 15.3k]
  ------------------
10631|  13.4k|                if (op->ch1 == -1)
  ------------------
  |  Branch (10631:21): [True: 0, False: 13.4k]
  ------------------
10632|      0|                    break;
10633|       |
10634|  13.4k|                total += xmlXPathCompOpEval(ctxt, &comp->steps[op->ch1]);
10635|  13.4k|		CHECK_ERROR0;
  ------------------
  |  |  236|  13.4k|    if (ctxt->error != XPATH_EXPRESSION_OK) return(0)
  |  |  ------------------
  |  |  |  Branch (236:9): [True: 13, False: 13.3k]
  |  |  ------------------
  ------------------
10636|       |
10637|  13.3k|                total += xmlXPathNodeCollectAndTest(ctxt, op, NULL, last, 0);
10638|  13.3k|                break;
10639|  13.4k|            }
10640|      1|        case XPATH_OP_VALUE:
  ------------------
  |  Branch (10640:9): [True: 1, False: 28.8k]
  ------------------
10641|      1|            xmlXPathValuePush(ctxt, xmlXPathCacheObjectCopy(ctxt, op->value4));
10642|      1|            break;
10643|  3.30k|        case XPATH_OP_SORT:
  ------------------
  |  Branch (10643:9): [True: 3.30k, False: 25.5k]
  ------------------
10644|  3.30k|            if (op->ch1 != -1)
  ------------------
  |  Branch (10644:17): [True: 3.30k, False: 0]
  ------------------
10645|  3.30k|                total +=
10646|  3.30k|                    xmlXPathCompOpEvalLast(ctxt, &comp->steps[op->ch1],
10647|  3.30k|                                           last);
10648|  3.30k|	    CHECK_ERROR0;
  ------------------
  |  |  236|  3.30k|    if (ctxt->error != XPATH_EXPRESSION_OK) return(0)
  |  |  ------------------
  |  |  |  Branch (236:9): [True: 37, False: 3.26k]
  |  |  ------------------
  ------------------
10649|  3.26k|            if ((ctxt->value != NULL)
  ------------------
  |  Branch (10649:17): [True: 3.26k, False: 0]
  ------------------
10650|  3.26k|                && (ctxt->value->type == XPATH_NODESET)
  ------------------
  |  Branch (10650:20): [True: 3.20k, False: 61]
  ------------------
10651|  3.20k|                && (ctxt->value->nodesetval != NULL)
  ------------------
  |  Branch (10651:20): [True: 3.20k, False: 0]
  ------------------
10652|  3.20k|		&& (ctxt->value->nodesetval->nodeNr > 1))
  ------------------
  |  Branch (10652:6): [True: 1.20k, False: 1.99k]
  ------------------
10653|  1.20k|                xmlXPathNodeSetSort(ctxt->value->nodesetval);
10654|  3.26k|            break;
10655|     68|        default:
  ------------------
  |  Branch (10655:9): [True: 68, False: 28.7k]
  ------------------
10656|     68|            total += xmlXPathCompOpEval(ctxt, op);
10657|     68|            break;
10658|  28.8k|    }
10659|       |
10660|  28.6k|    ctxt->context->depth -= 1;
10661|  28.6k|    return (total);
10662|  28.8k|}
xpath.c:xmlXPathNodeSetKeepLast:
 3167|  1.20k|{
 3168|  1.20k|    int i;
 3169|  1.20k|    xmlNodePtr node;
 3170|       |
 3171|  1.20k|    if ((set == NULL) || (set->nodeNr <= 1))
  ------------------
  |  Branch (3171:9): [True: 0, False: 1.20k]
  |  Branch (3171:26): [True: 0, False: 1.20k]
  ------------------
 3172|      0|	return;
 3173|  5.42k|    for (i = 0; i < set->nodeNr - 1; i++) {
  ------------------
  |  Branch (3173:17): [True: 4.21k, False: 1.20k]
  ------------------
 3174|  4.21k|        node = set->nodeTab[i];
 3175|  4.21k|        if ((node != NULL) &&
  ------------------
  |  Branch (3175:13): [True: 4.21k, False: 0]
  ------------------
 3176|  4.21k|            (node->type == XML_NAMESPACE_DECL))
  ------------------
  |  Branch (3176:13): [True: 0, False: 4.21k]
  ------------------
 3177|      0|            xmlXPathNodeSetFreeNs((xmlNsPtr) node);
 3178|  4.21k|    }
 3179|  1.20k|    set->nodeTab[0] = set->nodeTab[set->nodeNr-1];
 3180|  1.20k|    set->nodeNr = 1;
 3181|  1.20k|}

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

