htmlIsBooleanAttr:
  362|  16.4k|{
  363|  16.4k|    const char *str = NULL;
  364|       |
  365|  16.4k|    if (name == NULL)
  ------------------
  |  Branch (365:9): [True: 0, False: 16.4k]
  ------------------
  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|  16.4k|    switch (name[0] | 0x20) {
  ------------------
  |  Branch (388:13): [True: 10.8k, False: 5.62k]
  ------------------
  389|  2.86k|        case 'c':
  ------------------
  |  Branch (389:9): [True: 2.86k, False: 13.5k]
  ------------------
  390|  2.86k|            name += 1;
  391|  2.86k|            switch (name[0] | 0x20) {
  ------------------
  |  Branch (391:21): [True: 290, False: 2.57k]
  ------------------
  392|     85|                case 'h': str = "ecked"; break;
  ------------------
  |  Branch (392:17): [True: 85, False: 2.78k]
  ------------------
  393|    205|                case 'o': str = "mpact"; break;
  ------------------
  |  Branch (393:17): [True: 205, False: 2.66k]
  ------------------
  394|  2.86k|            }
  395|  2.86k|            break;
  396|  3.50k|        case 'd':
  ------------------
  |  Branch (396:9): [True: 3.50k, False: 12.9k]
  ------------------
  397|  3.50k|            name += 1;
  398|  3.50k|            switch (name[0] | 0x20) {
  ------------------
  |  Branch (398:21): [True: 883, False: 2.62k]
  ------------------
  399|    611|                case 'e':
  ------------------
  |  Branch (399:17): [True: 611, False: 2.89k]
  ------------------
  400|    611|                    name += 1;
  401|    611|                    switch (name[0] | 0x20) {
  ------------------
  |  Branch (401:29): [True: 166, False: 445]
  ------------------
  402|    109|                        case 'c': str = "lare"; break;
  ------------------
  |  Branch (402:25): [True: 109, False: 502]
  ------------------
  403|     57|                        case 'f': str = "er"; break;
  ------------------
  |  Branch (403:25): [True: 57, False: 554]
  ------------------
  404|    611|                    }
  405|    611|                    break;
  406|    611|                case 'i': str = "sabled"; break;
  ------------------
  |  Branch (406:17): [True: 272, False: 3.23k]
  ------------------
  407|  3.50k|            }
  408|  3.50k|            break;
  409|  3.50k|        case 'i':
  ------------------
  |  Branch (409:9): [True: 499, False: 15.9k]
  ------------------
  410|    499|            str = "smap";
  411|    499|            break;
  412|    227|        case 'm':
  ------------------
  |  Branch (412:9): [True: 227, False: 16.2k]
  ------------------
  413|    227|            str = "ultiple";
  414|    227|            break;
  415|  3.19k|        case 'n':
  ------------------
  |  Branch (415:9): [True: 3.19k, False: 13.2k]
  ------------------
  416|  3.19k|            name += 1;
  417|  3.19k|            if ((name[0] | 0x20) != 'o')
  ------------------
  |  Branch (417:17): [True: 1.50k, False: 1.69k]
  ------------------
  418|  1.50k|                break;
  419|  1.69k|            name += 1;
  420|  1.69k|            switch (name[0] | 0x20) {
  ------------------
  |  Branch (420:21): [True: 1.44k, False: 243]
  ------------------
  421|    324|                case 'h': str = "ref"; break;
  ------------------
  |  Branch (421:17): [True: 324, False: 1.36k]
  ------------------
  422|    706|                case 'r': str = "esize"; break;
  ------------------
  |  Branch (422:17): [True: 706, False: 985]
  ------------------
  423|    213|                case 's': str = "hade"; break;
  ------------------
  |  Branch (423:17): [True: 213, False: 1.47k]
  ------------------
  424|    205|                case 'w': str = "rap"; break;
  ------------------
  |  Branch (424:17): [True: 205, False: 1.48k]
  ------------------
  425|  1.69k|            }
  426|  1.69k|            break;
  427|  1.69k|        case 'r':
  ------------------
  |  Branch (427:9): [True: 231, False: 16.2k]
  ------------------
  428|    231|            str = "eadonly";
  429|    231|            break;
  430|    312|        case 's':
  ------------------
  |  Branch (430:9): [True: 312, False: 16.1k]
  ------------------
  431|    312|            str = "elected";
  432|    312|            break;
  433|  16.4k|    }
  434|       |
  435|  16.4k|    if (str == NULL)
  ------------------
  |  Branch (435:9): [True: 13.0k, False: 3.44k]
  ------------------
  436|  13.0k|        return(0);
  437|       |
  438|  3.44k|    return(xmlStrcasecmp(name + 1, BAD_CAST str) == 0);
  ------------------
  |  |   34|  3.44k|#define BAD_CAST (xmlChar *)
  ------------------
  439|  16.4k|}

xmlSAX2InternalSubset:
  242|  18.4k|{
  243|  18.4k|    xmlParserCtxtPtr ctxt = (xmlParserCtxtPtr) ctx;
  244|  18.4k|    xmlDtdPtr dtd;
  245|  18.4k|    if (ctx == NULL) return;
  ------------------
  |  Branch (245:9): [True: 0, False: 18.4k]
  ------------------
  246|       |
  247|  18.4k|    if (ctxt->myDoc == NULL)
  ------------------
  |  Branch (247:9): [True: 0, False: 18.4k]
  ------------------
  248|      0|	return;
  249|  18.4k|    if ((ctxt->html) && (ctxt->instate != XML_PARSER_MISC))
  ------------------
  |  Branch (249:9): [True: 0, False: 18.4k]
  |  Branch (249:25): [True: 0, False: 0]
  ------------------
  250|      0|        return;
  251|  18.4k|    dtd = xmlGetIntSubset(ctxt->myDoc);
  252|  18.4k|    if (dtd != NULL) {
  ------------------
  |  Branch (252:9): [True: 0, False: 18.4k]
  ------------------
  253|      0|	xmlUnlinkNode((xmlNodePtr) dtd);
  254|      0|	xmlFreeDtd(dtd);
  255|      0|	ctxt->myDoc->intSubset = NULL;
  256|      0|    }
  257|  18.4k|    ctxt->myDoc->intSubset =
  258|  18.4k|	xmlCreateIntSubset(ctxt->myDoc, name, publicId, systemId);
  259|  18.4k|    if (ctxt->myDoc->intSubset == NULL)
  ------------------
  |  Branch (259:9): [True: 8, False: 18.4k]
  ------------------
  260|      8|        xmlSAX2ErrMemory(ctxt);
  261|  18.4k|}
xmlSAX2ExternalSubset:
  274|  16.1k|{
  275|  16.1k|    xmlParserCtxtPtr ctxt = (xmlParserCtxtPtr) ctx;
  276|  16.1k|    if (ctx == NULL) return;
  ------------------
  |  Branch (276:9): [True: 0, False: 16.1k]
  ------------------
  277|  16.1k|    if ((systemId != NULL) &&
  ------------------
  |  Branch (277:9): [True: 2.72k, False: 13.3k]
  ------------------
  278|  2.72k|        ((ctxt->options & XML_PARSE_NO_XXE) == 0) &&
  ------------------
  |  Branch (278:9): [True: 2.45k, False: 268]
  ------------------
  279|  2.45k|        (((ctxt->validate) || (ctxt->loadsubset & ~XML_SKIP_IDS)) &&
  ------------------
  |  |  210|    950|#define XML_SKIP_IDS		8
  ------------------
  |  Branch (279:11): [True: 1.50k, False: 950]
  |  Branch (279:31): [True: 762, False: 188]
  ------------------
  280|  2.26k|	 (ctxt->wellFormed && ctxt->myDoc))) {
  ------------------
  |  Branch (280:4): [True: 2.20k, False: 61]
  |  Branch (280:24): [True: 2.20k, False: 0]
  ------------------
  281|       |	/*
  282|       |	 * Try to fetch and parse the external subset.
  283|       |	 */
  284|  2.20k|	xmlParserInputPtr oldinput;
  285|  2.20k|	int oldinputNr;
  286|  2.20k|	int oldinputMax;
  287|  2.20k|	xmlParserInputPtr *oldinputTab;
  288|  2.20k|	xmlParserInputPtr input = NULL;
  289|  2.20k|	xmlChar *oldencoding;
  290|  2.20k|        unsigned long consumed;
  291|  2.20k|        size_t buffered;
  292|  2.20k|#ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
  293|  2.20k|        int inputMax = 1;
  294|       |#else
  295|       |        int inputMax = 5;
  296|       |#endif
  297|       |
  298|       |	/*
  299|       |	 * Ask the Entity resolver to load the damn thing
  300|       |	 */
  301|  2.20k|	if ((ctxt->sax != NULL) && (ctxt->sax->resolveEntity != NULL))
  ------------------
  |  Branch (301:6): [True: 2.20k, False: 0]
  |  Branch (301:29): [True: 2.20k, False: 0]
  ------------------
  302|  2.20k|	    input = ctxt->sax->resolveEntity(ctxt->userData, publicId,
  303|  2.20k|	                                     systemId);
  304|  2.20k|	if (input == NULL) {
  ------------------
  |  Branch (304:6): [True: 762, False: 1.44k]
  ------------------
  305|    762|	    return;
  306|    762|	}
  307|       |
  308|  1.44k|	if (xmlNewDtd(ctxt->myDoc, name, publicId, systemId) == NULL) {
  ------------------
  |  Branch (308:6): [True: 4, False: 1.43k]
  ------------------
  309|      4|            xmlSAX2ErrMemory(ctxt);
  310|      4|            xmlFreeInputStream(input);
  311|      4|            return;
  312|      4|        }
  313|       |
  314|       |	/*
  315|       |	 * make sure we won't destroy the main document context
  316|       |	 */
  317|  1.43k|	oldinput = ctxt->input;
  318|  1.43k|	oldinputNr = ctxt->inputNr;
  319|  1.43k|	oldinputMax = ctxt->inputMax;
  320|  1.43k|	oldinputTab = ctxt->inputTab;
  321|  1.43k|	oldencoding = ctxt->encoding;
  322|  1.43k|	ctxt->encoding = NULL;
  323|       |
  324|  1.43k|	ctxt->inputTab = xmlMalloc(inputMax * sizeof(xmlParserInputPtr));
  325|  1.43k|	if (ctxt->inputTab == NULL) {
  ------------------
  |  Branch (325:6): [True: 2, False: 1.43k]
  ------------------
  326|      2|	    xmlSAX2ErrMemory(ctxt);
  327|      2|            goto error;
  328|      2|	}
  329|  1.43k|	ctxt->inputNr = 0;
  330|  1.43k|	ctxt->inputMax = inputMax;
  331|  1.43k|	ctxt->input = NULL;
  332|  1.43k|	if (xmlCtxtPushInput(ctxt, input) < 0)
  ------------------
  |  Branch (332:6): [True: 1, False: 1.43k]
  ------------------
  333|      1|            goto error;
  334|       |
  335|  1.43k|	if (input->filename == NULL)
  ------------------
  |  Branch (335:6): [True: 0, False: 1.43k]
  ------------------
  336|      0|	    input->filename = (char *) xmlCanonicPath(systemId);
  337|  1.43k|	input->line = 1;
  338|  1.43k|	input->col = 1;
  339|  1.43k|	input->base = ctxt->input->cur;
  340|  1.43k|	input->cur = ctxt->input->cur;
  341|  1.43k|	input->free = NULL;
  342|       |
  343|       |	/*
  344|       |	 * let's parse that entity knowing it's an external subset.
  345|       |	 */
  346|  1.43k|	xmlParseExternalSubset(ctxt, publicId, systemId);
  347|       |
  348|       |        /*
  349|       |	 * Free up the external entities
  350|       |	 */
  351|       |
  352|  1.50k|	while (ctxt->inputNr > 1)
  ------------------
  |  Branch (352:9): [True: 68, False: 1.43k]
  ------------------
  353|     68|	    xmlFreeInputStream(xmlCtxtPopInput(ctxt));
  354|       |
  355|  1.43k|        consumed = ctxt->input->consumed;
  356|  1.43k|        buffered = ctxt->input->cur - ctxt->input->base;
  357|  1.43k|        if (buffered > ULONG_MAX - consumed)
  ------------------
  |  Branch (357:13): [True: 0, False: 1.43k]
  ------------------
  358|      0|            consumed = ULONG_MAX;
  359|  1.43k|        else
  360|  1.43k|            consumed += buffered;
  361|  1.43k|        if (consumed > ULONG_MAX - ctxt->sizeentities)
  ------------------
  |  Branch (361:13): [True: 0, False: 1.43k]
  ------------------
  362|      0|            ctxt->sizeentities = ULONG_MAX;
  363|  1.43k|        else
  364|  1.43k|            ctxt->sizeentities += consumed;
  365|       |
  366|  1.43k|error:
  367|  1.43k|	xmlFreeInputStream(input);
  368|  1.43k|        xmlFree(ctxt->inputTab);
  369|       |
  370|       |	/*
  371|       |	 * Restore the parsing context of the main entity
  372|       |	 */
  373|  1.43k|	ctxt->input = oldinput;
  374|  1.43k|	ctxt->inputNr = oldinputNr;
  375|  1.43k|	ctxt->inputMax = oldinputMax;
  376|  1.43k|	ctxt->inputTab = oldinputTab;
  377|  1.43k|	if (ctxt->encoding != NULL)
  ------------------
  |  Branch (377:6): [True: 70, False: 1.36k]
  ------------------
  378|     70|	    xmlFree(ctxt->encoding);
  379|  1.43k|	ctxt->encoding = oldencoding;
  380|       |	/* ctxt->wellFormed = oldwellFormed; */
  381|  1.43k|    }
  382|  16.1k|}
xmlSAX2ResolveEntity:
  396|  2.20k|{
  397|  2.20k|    xmlParserCtxtPtr ctxt = (xmlParserCtxtPtr) ctx;
  398|  2.20k|    xmlParserInputPtr ret = NULL;
  399|  2.20k|    xmlChar *URI = NULL;
  400|       |
  401|  2.20k|    if (ctx == NULL) return(NULL);
  ------------------
  |  Branch (401:9): [True: 0, False: 2.20k]
  ------------------
  402|       |
  403|  2.20k|    if (systemId != NULL) {
  ------------------
  |  Branch (403:9): [True: 2.20k, False: 0]
  ------------------
  404|  2.20k|        const xmlChar *base = NULL;
  405|  2.20k|        int res;
  406|       |
  407|  2.20k|        if (ctxt->input != NULL)
  ------------------
  |  Branch (407:13): [True: 2.20k, False: 0]
  ------------------
  408|  2.20k|            base = BAD_CAST ctxt->input->filename;
  ------------------
  |  |   34|  2.20k|#define BAD_CAST (xmlChar *)
  ------------------
  409|       |
  410|       |        /*
  411|       |         * We don't really need the 'directory' struct member, but some
  412|       |         * users set it manually to a base URI for memory streams.
  413|       |         */
  414|  2.20k|        if (base == NULL)
  ------------------
  |  Branch (414:13): [True: 1.95k, False: 244]
  ------------------
  415|  1.95k|            base = BAD_CAST ctxt->directory;
  ------------------
  |  |   34|  1.95k|#define BAD_CAST (xmlChar *)
  ------------------
  416|       |
  417|  2.20k|        if ((xmlStrlen(systemId) > XML_MAX_URI_LENGTH) ||
  ------------------
  |  |   11|  2.20k|#define XML_MAX_URI_LENGTH 2000
  ------------------
  |  Branch (417:13): [True: 1, False: 2.20k]
  ------------------
  418|  2.20k|            (xmlStrlen(base) > XML_MAX_URI_LENGTH)) {
  ------------------
  |  |   11|  2.20k|#define XML_MAX_URI_LENGTH 2000
  ------------------
  |  Branch (418:13): [True: 0, False: 2.20k]
  ------------------
  419|      1|            xmlFatalErr(ctxt, XML_ERR_RESOURCE_LIMIT, "URI too long");
  420|      1|            return(NULL);
  421|      1|        }
  422|  2.20k|        res = xmlBuildURISafe(systemId, base, &URI);
  423|  2.20k|        if (URI == NULL) {
  ------------------
  |  Branch (423:13): [True: 8, False: 2.19k]
  ------------------
  424|      8|            if (res < 0)
  ------------------
  |  Branch (424:17): [True: 1, False: 7]
  ------------------
  425|      1|                xmlSAX2ErrMemory(ctxt);
  426|      7|            else
  427|      7|                xmlWarnMsg(ctxt, XML_ERR_INVALID_URI,
  428|      7|                           "Can't resolve URI: %s\n", systemId);
  429|      8|            return(NULL);
  430|      8|        }
  431|  2.19k|        if (xmlStrlen(URI) > XML_MAX_URI_LENGTH) {
  ------------------
  |  |   11|  2.19k|#define XML_MAX_URI_LENGTH 2000
  ------------------
  |  Branch (431:13): [True: 0, False: 2.19k]
  ------------------
  432|      0|            xmlFatalErr(ctxt, XML_ERR_RESOURCE_LIMIT, "URI too long");
  433|      0|            xmlFree(URI);
  434|      0|            return(NULL);
  435|      0|        }
  436|  2.19k|    }
  437|       |
  438|  2.19k|    ret = xmlLoadResource(ctxt, (const char *) URI,
  439|  2.19k|                          (const char *) publicId, XML_RESOURCE_DTD);
  440|       |
  441|  2.19k|    xmlFree(URI);
  442|  2.19k|    return(ret);
  443|  2.20k|}
xmlSAX2GetEntity:
  454|  2.84M|{
  455|  2.84M|    xmlParserCtxtPtr ctxt = (xmlParserCtxtPtr) ctx;
  456|  2.84M|    xmlEntityPtr ret = NULL;
  457|       |
  458|  2.84M|    if (ctx == NULL) return(NULL);
  ------------------
  |  Branch (458:9): [True: 0, False: 2.84M]
  ------------------
  459|       |
  460|  2.84M|    if (ctxt->inSubset == 0) {
  ------------------
  |  Branch (460:9): [True: 2.44M, False: 390k]
  ------------------
  461|  2.44M|	ret = xmlGetPredefinedEntity(name);
  462|  2.44M|	if (ret != NULL)
  ------------------
  |  Branch (462:6): [True: 487k, False: 1.96M]
  ------------------
  463|   487k|	    return(ret);
  464|  2.44M|    }
  465|  2.35M|    if ((ctxt->myDoc != NULL) && (ctxt->myDoc->standalone == 1)) {
  ------------------
  |  Branch (465:9): [True: 2.35M, False: 208]
  |  Branch (465:34): [True: 1.10k, False: 2.35M]
  ------------------
  466|  1.10k|	if (ctxt->inSubset == 2) {
  ------------------
  |  Branch (466:6): [True: 218, False: 885]
  ------------------
  467|    218|	    ctxt->myDoc->standalone = 0;
  468|    218|	    ret = xmlGetDocEntity(ctxt->myDoc, name);
  469|    218|	    ctxt->myDoc->standalone = 1;
  470|    885|	} else {
  471|    885|	    ret = xmlGetDocEntity(ctxt->myDoc, name);
  472|    885|	    if (ret == NULL) {
  ------------------
  |  Branch (472:10): [True: 681, False: 204]
  ------------------
  473|    681|		ctxt->myDoc->standalone = 0;
  474|    681|		ret = xmlGetDocEntity(ctxt->myDoc, name);
  475|    681|		if (ret != NULL) {
  ------------------
  |  Branch (475:7): [True: 351, False: 330]
  ------------------
  476|    351|		    xmlFatalErrMsg(ctxt, XML_ERR_NOT_STANDALONE,
  477|    351|	 "Entity(%s) document marked standalone but requires external subset\n",
  478|    351|				   name, NULL);
  479|    351|		}
  480|    681|		ctxt->myDoc->standalone = 1;
  481|    681|	    }
  482|    885|	}
  483|  2.35M|    } else {
  484|  2.35M|	ret = xmlGetDocEntity(ctxt->myDoc, name);
  485|  2.35M|    }
  486|  2.35M|    return(ret);
  487|  2.84M|}
xmlSAX2GetParameterEntity:
  498|   398k|{
  499|   398k|    xmlParserCtxtPtr ctxt = (xmlParserCtxtPtr) ctx;
  500|   398k|    xmlEntityPtr ret;
  501|       |
  502|   398k|    if (ctx == NULL) return(NULL);
  ------------------
  |  Branch (502:9): [True: 0, False: 398k]
  ------------------
  503|       |
  504|   398k|    ret = xmlGetParameterEntity(ctxt->myDoc, name);
  505|   398k|    return(ret);
  506|   398k|}
xmlSAX2EntityDecl:
  522|   124k|{
  523|   124k|    xmlEntityPtr ent;
  524|   124k|    xmlParserCtxtPtr ctxt = (xmlParserCtxtPtr) ctx;
  525|   124k|    int extSubset;
  526|   124k|    int res;
  527|       |
  528|   124k|    if ((ctxt == NULL) || (ctxt->myDoc == NULL))
  ------------------
  |  Branch (528:9): [True: 0, False: 124k]
  |  Branch (528:27): [True: 0, False: 124k]
  ------------------
  529|      0|        return;
  530|       |
  531|   124k|    extSubset = ctxt->inSubset == 2;
  532|   124k|    res = xmlAddEntity(ctxt->myDoc, extSubset, name, type, publicId, systemId,
  533|   124k|                       content, &ent);
  534|   124k|    switch (res) {
  535|  20.2k|        case XML_ERR_OK:
  ------------------
  |  Branch (535:9): [True: 20.2k, False: 104k]
  ------------------
  536|  20.2k|            break;
  537|     29|        case XML_ERR_NO_MEMORY:
  ------------------
  |  Branch (537:9): [True: 29, False: 124k]
  ------------------
  538|     29|            xmlSAX2ErrMemory(ctxt);
  539|     29|            return;
  540|   100k|        case XML_WAR_ENTITY_REDEFINED:
  ------------------
  |  Branch (540:9): [True: 100k, False: 23.6k]
  ------------------
  541|   100k|            if (ctxt->pedantic) {
  ------------------
  |  Branch (541:17): [True: 8.07k, False: 92.5k]
  ------------------
  542|  8.07k|                if (extSubset)
  ------------------
  |  Branch (542:21): [True: 650, False: 7.42k]
  ------------------
  543|    650|                    xmlWarnMsg(ctxt, res, "Entity(%s) already defined in the"
  544|    650|                               " external subset\n", name);
  545|  7.42k|                else
  546|  7.42k|                    xmlWarnMsg(ctxt, res, "Entity(%s) already defined in the"
  547|  7.42k|                               " internal subset\n", name);
  548|  8.07k|            }
  549|   100k|            return;
  550|  3.39k|        case XML_ERR_REDECL_PREDEF_ENTITY:
  ------------------
  |  Branch (550:9): [True: 3.39k, False: 120k]
  ------------------
  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|  3.39k|            xmlWarnMsg(ctxt, res, "Invalid redeclaration of predefined"
  556|  3.39k|                       " entity '%s'", name);
  557|  3.39k|            return;
  558|      0|        default:
  ------------------
  |  Branch (558:9): [True: 0, False: 124k]
  ------------------
  559|      0|            xmlFatalErrMsg(ctxt, XML_ERR_INTERNAL_ERROR,
  560|      0|                           "Unexpected error code from xmlAddEntity\n",
  561|      0|                           NULL, NULL);
  562|      0|            return;
  563|   124k|    }
  564|       |
  565|  20.2k|    if ((ent->URI == NULL) && (systemId != NULL)) {
  ------------------
  |  Branch (565:9): [True: 20.2k, False: 0]
  |  Branch (565:31): [True: 7.42k, False: 12.8k]
  ------------------
  566|  7.42k|        xmlChar *URI;
  567|  7.42k|        const char *base = NULL;
  568|  7.42k|        int i;
  569|       |
  570|  14.2k|        for (i = ctxt->inputNr - 1; i >= 0; i--) {
  ------------------
  |  Branch (570:37): [True: 7.50k, False: 6.79k]
  ------------------
  571|  7.50k|            if (ctxt->inputTab[i]->filename != NULL) {
  ------------------
  |  Branch (571:17): [True: 632, False: 6.86k]
  ------------------
  572|    632|                base = ctxt->inputTab[i]->filename;
  573|    632|                break;
  574|    632|            }
  575|  7.50k|        }
  576|       |
  577|       |        /*
  578|       |         * We don't really need the 'directory' struct member, but some
  579|       |         * users set it manually to a base URI for memory streams.
  580|       |         */
  581|  7.42k|        if (base == NULL)
  ------------------
  |  Branch (581:13): [True: 6.79k, False: 632]
  ------------------
  582|  6.79k|            base = ctxt->directory;
  583|       |
  584|  7.42k|        res = xmlBuildURISafe(systemId, (const xmlChar *) base, &URI);
  585|       |
  586|  7.42k|        if (URI == NULL) {
  ------------------
  |  Branch (586:13): [True: 92, False: 7.33k]
  ------------------
  587|     92|            if (res < 0) {
  ------------------
  |  Branch (587:17): [True: 1, False: 91]
  ------------------
  588|      1|                xmlSAX2ErrMemory(ctxt);
  589|     91|            } else {
  590|     91|                xmlWarnMsg(ctxt, XML_ERR_INVALID_URI,
  591|     91|                           "Can't resolve URI: %s\n", systemId);
  592|     91|            }
  593|  7.33k|        } else if (xmlStrlen(URI) > XML_MAX_URI_LENGTH) {
  ------------------
  |  |   11|  7.33k|#define XML_MAX_URI_LENGTH 2000
  ------------------
  |  Branch (593:20): [True: 3, False: 7.32k]
  ------------------
  594|      3|            xmlFatalErr(ctxt, XML_ERR_RESOURCE_LIMIT, "URI too long");
  595|      3|            xmlFree(URI);
  596|  7.32k|        } else {
  597|  7.32k|            ent->URI = URI;
  598|  7.32k|        }
  599|  7.42k|    }
  600|  20.2k|}
xmlSAX2AttributeDecl:
  617|  58.5k|{
  618|  58.5k|    xmlParserCtxtPtr ctxt = (xmlParserCtxtPtr) ctx;
  619|  58.5k|    xmlAttributePtr attr;
  620|  58.5k|    const xmlChar *name = NULL;
  621|  58.5k|    xmlChar *prefix = NULL;
  622|       |
  623|       |    /* Avoid unused variable warning if features are disabled. */
  624|  58.5k|    (void) attr;
  625|       |
  626|  58.5k|    if ((ctxt == NULL) || (ctxt->myDoc == NULL))
  ------------------
  |  Branch (626:9): [True: 0, False: 58.5k]
  |  Branch (626:27): [True: 0, False: 58.5k]
  ------------------
  627|      0|        return;
  628|       |
  629|  58.5k|    if ((xmlStrEqual(fullname, BAD_CAST "xml:id")) &&
  ------------------
  |  |   34|  58.5k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (629:9): [True: 636, False: 57.9k]
  ------------------
  630|    636|        (type != XML_ATTRIBUTE_ID)) {
  ------------------
  |  Branch (630:9): [True: 353, False: 283]
  ------------------
  631|    353|	xmlErrId(ctxt, XML_DTD_XMLID_TYPE,
  632|    353|	      "xml:id : attribute type should be ID\n", NULL);
  633|    353|    }
  634|  58.5k|    name = xmlSplitQName4(fullname, &prefix);
  635|  58.5k|    if (name == NULL)
  ------------------
  |  Branch (635:9): [True: 8, False: 58.5k]
  ------------------
  636|      8|        xmlSAX2ErrMemory(ctxt);
  637|  58.5k|    ctxt->vctxt.valid = 1;
  638|  58.5k|    if (ctxt->inSubset == 1)
  ------------------
  |  Branch (638:9): [True: 39.0k, False: 19.5k]
  ------------------
  639|  39.0k|	attr = xmlAddAttributeDecl(&ctxt->vctxt, ctxt->myDoc->intSubset, elem,
  640|  39.0k|	       name, prefix, (xmlAttributeType) type,
  641|  39.0k|	       (xmlAttributeDefault) def, defaultValue, tree);
  642|  19.5k|    else if (ctxt->inSubset == 2)
  ------------------
  |  Branch (642:14): [True: 19.5k, False: 0]
  ------------------
  643|  19.5k|	attr = xmlAddAttributeDecl(&ctxt->vctxt, ctxt->myDoc->extSubset, elem,
  644|  19.5k|	   name, prefix, (xmlAttributeType) type,
  645|  19.5k|	   (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|  58.5k|#ifdef LIBXML_VALID_ENABLED
  655|  58.5k|    if (ctxt->vctxt.valid == 0)
  ------------------
  |  Branch (655:9): [True: 9.08k, False: 49.4k]
  ------------------
  656|  9.08k|	ctxt->valid = 0;
  657|  58.5k|    if ((attr != NULL) && (ctxt->validate) && (ctxt->wellFormed) &&
  ------------------
  |  Branch (657:9): [True: 27.0k, False: 31.5k]
  |  Branch (657:27): [True: 20.9k, False: 6.05k]
  |  Branch (657:47): [True: 16.0k, False: 4.94k]
  ------------------
  658|  16.0k|        (ctxt->myDoc->intSubset != NULL))
  ------------------
  |  Branch (658:9): [True: 16.0k, False: 0]
  ------------------
  659|  16.0k|	ctxt->valid &= xmlValidateAttributeDecl(&ctxt->vctxt, ctxt->myDoc,
  660|  16.0k|	                                        attr);
  661|  58.5k|#endif /* LIBXML_VALID_ENABLED */
  662|  58.5k|    if (prefix != NULL)
  ------------------
  |  Branch (662:9): [True: 4.87k, False: 53.6k]
  ------------------
  663|  4.87k|	xmlFree(prefix);
  664|  58.5k|}
xmlSAX2ElementDecl:
  677|  17.4k|{
  678|  17.4k|    xmlParserCtxtPtr ctxt = (xmlParserCtxtPtr) ctx;
  679|  17.4k|    xmlElementPtr elem = NULL;
  680|       |
  681|       |    /* Avoid unused variable warning if features are disabled. */
  682|  17.4k|    (void) elem;
  683|       |
  684|  17.4k|    if ((ctxt == NULL) || (ctxt->myDoc == NULL))
  ------------------
  |  Branch (684:9): [True: 0, False: 17.4k]
  |  Branch (684:27): [True: 0, False: 17.4k]
  ------------------
  685|      0|        return;
  686|       |
  687|  17.4k|    if (ctxt->inSubset == 1)
  ------------------
  |  Branch (687:9): [True: 12.8k, False: 4.59k]
  ------------------
  688|  12.8k|        elem = xmlAddElementDecl(&ctxt->vctxt, ctxt->myDoc->intSubset,
  689|  12.8k|                                 name, (xmlElementTypeVal) type, content);
  690|  4.59k|    else if (ctxt->inSubset == 2)
  ------------------
  |  Branch (690:14): [True: 4.59k, False: 0]
  ------------------
  691|  4.59k|        elem = xmlAddElementDecl(&ctxt->vctxt, ctxt->myDoc->extSubset,
  692|  4.59k|                                 name, (xmlElementTypeVal) type, content);
  693|      0|    else {
  694|      0|        xmlFatalErrMsg(ctxt, XML_ERR_INTERNAL_ERROR,
  695|      0|	     "SAX.xmlSAX2ElementDecl(%s) called while not in subset\n",
  696|      0|	               name, NULL);
  697|      0|        return;
  698|      0|    }
  699|  17.4k|#ifdef LIBXML_VALID_ENABLED
  700|  17.4k|    if (elem == NULL)
  ------------------
  |  Branch (700:9): [True: 6.06k, False: 11.3k]
  ------------------
  701|  6.06k|        ctxt->valid = 0;
  702|  17.4k|    if (ctxt->validate && ctxt->wellFormed &&
  ------------------
  |  Branch (702:9): [True: 13.6k, False: 3.76k]
  |  Branch (702:27): [True: 8.72k, False: 4.92k]
  ------------------
  703|  8.72k|        ctxt->myDoc && ctxt->myDoc->intSubset)
  ------------------
  |  Branch (703:9): [True: 8.72k, False: 0]
  |  Branch (703:24): [True: 8.72k, False: 0]
  ------------------
  704|  8.72k|        ctxt->valid &=
  705|  8.72k|            xmlValidateElementDecl(&ctxt->vctxt, ctxt->myDoc, elem);
  706|  17.4k|#endif /* LIBXML_VALID_ENABLED */
  707|  17.4k|}
xmlSAX2NotationDecl:
  720|  2.29k|{
  721|  2.29k|    xmlParserCtxtPtr ctxt = (xmlParserCtxtPtr) ctx;
  722|  2.29k|    xmlNotationPtr nota = NULL;
  723|       |
  724|       |    /* Avoid unused variable warning if features are disabled. */
  725|  2.29k|    (void) nota;
  726|       |
  727|  2.29k|    if ((ctxt == NULL) || (ctxt->myDoc == NULL))
  ------------------
  |  Branch (727:9): [True: 0, False: 2.29k]
  |  Branch (727:27): [True: 0, False: 2.29k]
  ------------------
  728|      0|        return;
  729|       |
  730|  2.29k|    if ((publicId == NULL) && (systemId == NULL)) {
  ------------------
  |  Branch (730:9): [True: 1.20k, False: 1.08k]
  |  Branch (730:31): [True: 236, False: 973]
  ------------------
  731|    236|	xmlFatalErrMsg(ctxt, XML_ERR_NOTATION_PROCESSING,
  732|    236|	     "SAX.xmlSAX2NotationDecl(%s) externalID or PublicID missing\n",
  733|    236|	               name, NULL);
  734|    236|	return;
  735|  2.05k|    } else if (ctxt->inSubset == 1)
  ------------------
  |  Branch (735:16): [True: 1.50k, False: 547]
  ------------------
  736|  1.50k|	nota = xmlAddNotationDecl(&ctxt->vctxt, ctxt->myDoc->intSubset, name,
  737|  1.50k|                              publicId, systemId);
  738|    547|    else if (ctxt->inSubset == 2)
  ------------------
  |  Branch (738:14): [True: 547, False: 0]
  ------------------
  739|    547|	nota = xmlAddNotationDecl(&ctxt->vctxt, ctxt->myDoc->extSubset, name,
  740|    547|                              publicId, systemId);
  741|      0|    else {
  742|      0|	xmlFatalErrMsg(ctxt, XML_ERR_NOTATION_PROCESSING,
  743|      0|	     "SAX.xmlSAX2NotationDecl(%s) called while not in subset\n",
  744|      0|	               name, NULL);
  745|      0|	return;
  746|      0|    }
  747|  2.05k|#ifdef LIBXML_VALID_ENABLED
  748|  2.05k|    if (nota == NULL) ctxt->valid = 0;
  ------------------
  |  Branch (748:9): [True: 1.80k, False: 248]
  ------------------
  749|  2.05k|    if ((ctxt->validate) && (ctxt->wellFormed) &&
  ------------------
  |  Branch (749:9): [True: 1.30k, False: 755]
  |  Branch (749:29): [True: 508, False: 793]
  ------------------
  750|    508|        (ctxt->myDoc->intSubset != NULL))
  ------------------
  |  Branch (750:9): [True: 508, False: 0]
  ------------------
  751|    508|	ctxt->valid &= xmlValidateNotationDecl(&ctxt->vctxt, ctxt->myDoc,
  752|    508|	                                       nota);
  753|  2.05k|#endif /* LIBXML_VALID_ENABLED */
  754|  2.05k|}
xmlSAX2UnparsedEntityDecl:
  769|    649|{
  770|    649|    xmlSAX2EntityDecl(ctx, name, XML_EXTERNAL_GENERAL_UNPARSED_ENTITY,
  771|    649|                      publicId, systemId, (xmlChar *) notationName);
  772|    649|}
xmlSAX2SetDocumentLocator:
  783|  43.4k|{
  784|  43.4k|}
xmlSAX2StartDocument:
  793|  43.0k|{
  794|  43.0k|    xmlParserCtxtPtr ctxt = (xmlParserCtxtPtr) ctx;
  795|  43.0k|    xmlDocPtr doc;
  796|       |
  797|  43.0k|    if (ctx == NULL) return;
  ------------------
  |  Branch (797:9): [True: 0, False: 43.0k]
  ------------------
  798|       |
  799|  43.0k|#ifdef LIBXML_HTML_ENABLED
  800|  43.0k|    if (ctxt->html) {
  ------------------
  |  Branch (800:9): [True: 0, False: 43.0k]
  ------------------
  801|      0|	if (ctxt->myDoc == NULL)
  ------------------
  |  Branch (801:6): [True: 0, False: 0]
  ------------------
  802|      0|	    ctxt->myDoc = htmlNewDocNoDtD(NULL, NULL);
  803|      0|	if (ctxt->myDoc == NULL) {
  ------------------
  |  Branch (803:6): [True: 0, False: 0]
  ------------------
  804|      0|	    xmlSAX2ErrMemory(ctxt);
  805|      0|	    return;
  806|      0|	}
  807|      0|	ctxt->myDoc->properties = XML_DOC_HTML;
  808|      0|	ctxt->myDoc->parseFlags = ctxt->options;
  809|      0|    } else
  810|  43.0k|#endif
  811|  43.0k|    {
  812|  43.0k|	doc = ctxt->myDoc = xmlNewDoc(ctxt->version);
  813|  43.0k|	if (doc != NULL) {
  ------------------
  |  Branch (813:6): [True: 43.0k, False: 17]
  ------------------
  814|  43.0k|	    doc->properties = 0;
  815|  43.0k|	    if (ctxt->options & XML_PARSE_OLD10)
  ------------------
  |  Branch (815:10): [True: 16.2k, False: 26.8k]
  ------------------
  816|  16.2k|	        doc->properties |= XML_DOC_OLD10;
  817|  43.0k|	    doc->parseFlags = ctxt->options;
  818|  43.0k|	    doc->standalone = ctxt->standalone;
  819|  43.0k|	} else {
  820|     17|	    xmlSAX2ErrMemory(ctxt);
  821|     17|	    return;
  822|     17|	}
  823|  43.0k|	if ((ctxt->dictNames) && (doc != NULL)) {
  ------------------
  |  Branch (823:6): [True: 24.6k, False: 18.4k]
  |  Branch (823:27): [True: 24.6k, False: 0]
  ------------------
  824|  24.6k|	    doc->dict = ctxt->dict;
  825|  24.6k|	    xmlDictReference(doc->dict);
  826|  24.6k|	}
  827|  43.0k|    }
  828|  43.0k|    if ((ctxt->myDoc != NULL) && (ctxt->myDoc->URL == NULL) &&
  ------------------
  |  Branch (828:9): [True: 43.0k, False: 0]
  |  Branch (828:34): [True: 43.0k, False: 0]
  ------------------
  829|  43.0k|	(ctxt->input != NULL) && (ctxt->input->filename != NULL)) {
  ------------------
  |  Branch (829:2): [True: 43.0k, False: 0]
  |  Branch (829:27): [True: 7.61k, False: 35.4k]
  ------------------
  830|  7.61k|	ctxt->myDoc->URL = xmlPathToURI((const xmlChar *)ctxt->input->filename);
  831|  7.61k|	if (ctxt->myDoc->URL == NULL)
  ------------------
  |  Branch (831:6): [True: 10, False: 7.60k]
  ------------------
  832|     10|	    xmlSAX2ErrMemory(ctxt);
  833|  7.61k|    }
  834|  43.0k|}
xmlSAX2EndDocument:
  843|  23.6k|{
  844|  23.6k|    xmlParserCtxtPtr ctxt = (xmlParserCtxtPtr) ctx;
  845|  23.6k|    xmlDocPtr doc;
  846|       |
  847|  23.6k|    if (ctx == NULL) return;
  ------------------
  |  Branch (847:9): [True: 0, False: 23.6k]
  ------------------
  848|  23.6k|#ifdef LIBXML_VALID_ENABLED
  849|  23.6k|    if (ctxt->validate && ctxt->wellFormed &&
  ------------------
  |  Branch (849:9): [True: 3.92k, False: 19.7k]
  |  Branch (849:27): [True: 523, False: 3.39k]
  ------------------
  850|    523|        ctxt->myDoc && ctxt->myDoc->intSubset)
  ------------------
  |  Branch (850:9): [True: 523, False: 0]
  |  Branch (850:24): [True: 523, False: 0]
  ------------------
  851|    523|	ctxt->valid &= xmlValidateDocumentFinal(&ctxt->vctxt, ctxt->myDoc);
  852|  23.6k|#endif /* LIBXML_VALID_ENABLED */
  853|       |
  854|  23.6k|    doc = ctxt->myDoc;
  855|  23.6k|    if (doc == NULL)
  ------------------
  |  Branch (855:9): [True: 70, False: 23.5k]
  ------------------
  856|     70|        return;
  857|       |
  858|  23.5k|    if (doc->encoding == NULL) {
  ------------------
  |  Branch (858:9): [True: 23.5k, False: 0]
  ------------------
  859|  23.5k|        const xmlChar *encoding = xmlGetActualEncoding(ctxt);
  860|       |
  861|  23.5k|        if (encoding != NULL) {
  ------------------
  |  Branch (861:13): [True: 311, False: 23.2k]
  ------------------
  862|    311|            doc->encoding = xmlStrdup(encoding);
  863|    311|            if (doc->encoding == NULL)
  ------------------
  |  Branch (863:17): [True: 2, False: 309]
  ------------------
  864|      2|                xmlSAX2ErrMemory(ctxt);
  865|    311|        }
  866|  23.5k|    }
  867|       |
  868|  23.5k|#ifdef LIBXML_HTML_ENABLED
  869|  23.5k|    if (ctxt->html) {
  ------------------
  |  Branch (869:9): [True: 0, False: 23.5k]
  ------------------
  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|  23.5k|#endif /* LIBXML_HTML_ENABLED */
  880|  23.5k|    {
  881|  23.5k|        if (ctxt->wellFormed) {
  ------------------
  |  Branch (881:13): [True: 11.1k, False: 12.4k]
  ------------------
  882|  11.1k|            doc->properties |= XML_DOC_WELLFORMED;
  883|  11.1k|            if (ctxt->valid)
  ------------------
  |  Branch (883:17): [True: 6.41k, False: 4.73k]
  ------------------
  884|  6.41k|                doc->properties |= XML_DOC_DTDVALID;
  885|  11.1k|            if (ctxt->nsWellFormed)
  ------------------
  |  Branch (885:17): [True: 8.82k, False: 2.31k]
  ------------------
  886|  8.82k|                doc->properties |= XML_DOC_NSVALID;
  887|  11.1k|        }
  888|       |
  889|  23.5k|        if (ctxt->options & XML_PARSE_OLD10)
  ------------------
  |  Branch (889:13): [True: 9.34k, False: 14.2k]
  ------------------
  890|  9.34k|            doc->properties |= XML_DOC_OLD10;
  891|  23.5k|    }
  892|  23.5k|}
xmlSAX2StartElement:
 1713|   296k|xmlSAX2StartElement(void *ctx, const xmlChar *fullname, const xmlChar **atts) {
 1714|   296k|    xmlParserCtxtPtr ctxt = (xmlParserCtxtPtr) ctx;
 1715|       |
 1716|   296k|    (void) atts;
 1717|       |
 1718|   296k|    if ((ctxt == NULL) || (fullname == NULL) || (ctxt->myDoc == NULL))
  ------------------
  |  Branch (1718:9): [True: 0, False: 296k]
  |  Branch (1718:27): [True: 0, False: 296k]
  |  Branch (1718:49): [True: 0, False: 296k]
  ------------------
 1719|      0|        return;
 1720|       |
 1721|   296k|#ifdef LIBXML_SAX1_ENABLED
 1722|   296k|    if (!ctxt->html) {
  ------------------
  |  Branch (1722:9): [True: 296k, False: 0]
  ------------------
 1723|   296k|        xmlSAX1StartElement(ctxt, fullname, atts);
 1724|   296k|        return;
 1725|   296k|    }
 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|   175k|{
 1749|   175k|    xmlParserCtxtPtr ctxt = (xmlParserCtxtPtr) ctx;
 1750|       |
 1751|   175k|    if (ctxt == NULL)
  ------------------
  |  Branch (1751:9): [True: 0, False: 175k]
  ------------------
 1752|      0|        return;
 1753|       |
 1754|   175k|#if defined(LIBXML_SAX1_ENABLED) && defined(LIBXML_VALID_ENABLED)
 1755|   175k|    if (!ctxt->html && ctxt->validate && ctxt->wellFormed &&
  ------------------
  |  Branch (1755:9): [True: 175k, False: 0]
  |  Branch (1755:24): [True: 39.7k, False: 135k]
  |  Branch (1755:42): [True: 32.6k, False: 7.05k]
  ------------------
 1756|  32.6k|        ctxt->myDoc && ctxt->myDoc->intSubset)
  ------------------
  |  Branch (1756:9): [True: 32.6k, False: 0]
  |  Branch (1756:24): [True: 32.6k, False: 0]
  ------------------
 1757|  32.6k|        ctxt->valid &= xmlValidateOneElement(&ctxt->vctxt, ctxt->myDoc,
 1758|  32.6k|					     ctxt->node);
 1759|   175k|#endif /* LIBXML_VALID_ENABLED */
 1760|       |
 1761|   175k|#if defined(LIBXML_SAX1_ENABLED) || defined(LIBXML_HTML_ENABLED)
 1762|   175k|    ctxt->nodemem = -1;
 1763|       |
 1764|       |    /*
 1765|       |     * end of parsing of this node.
 1766|       |     */
 1767|   175k|    nodePop(ctxt);
 1768|   175k|#endif
 1769|   175k|}
xmlSAX2StartElementNs:
 2155|   479k|{
 2156|   479k|    xmlParserCtxtPtr ctxt = (xmlParserCtxtPtr) ctx;
 2157|   479k|    xmlNodePtr ret;
 2158|   479k|    xmlNsPtr last = NULL, ns;
 2159|   479k|    const xmlChar *uri, *pref;
 2160|   479k|    xmlChar *lname = NULL;
 2161|   479k|    int i, j;
 2162|       |
 2163|   479k|    if (ctx == NULL) return;
  ------------------
  |  Branch (2163:9): [True: 0, False: 479k]
  ------------------
 2164|       |
 2165|   479k|#ifdef LIBXML_VALID_ENABLED
 2166|       |    /*
 2167|       |     * First check on validity:
 2168|       |     */
 2169|   479k|    if (ctxt->validate &&
  ------------------
  |  Branch (2169:9): [True: 155k, False: 323k]
  ------------------
 2170|   155k|        ((ctxt->myDoc == NULL) ||
  ------------------
  |  Branch (2170:10): [True: 0, False: 155k]
  ------------------
 2171|   155k|         ((ctxt->myDoc->extSubset == NULL) &&
  ------------------
  |  Branch (2171:11): [True: 150k, False: 4.75k]
  ------------------
 2172|   150k|          ((ctxt->myDoc->intSubset == NULL) ||
  ------------------
  |  Branch (2172:12): [True: 4.33k, False: 146k]
  ------------------
 2173|   146k|	   ((ctxt->myDoc->intSubset->notations == NULL) &&
  ------------------
  |  Branch (2173:6): [True: 145k, False: 1.13k]
  ------------------
 2174|   145k|	    (ctxt->myDoc->intSubset->elements == NULL) &&
  ------------------
  |  Branch (2174:6): [True: 8.57k, False: 136k]
  ------------------
 2175|  8.57k|	    (ctxt->myDoc->intSubset->attributes == NULL) &&
  ------------------
  |  Branch (2175:6): [True: 8.57k, False: 0]
  ------------------
 2176|  8.57k|	    (ctxt->myDoc->intSubset->entities == NULL)))))) {
  ------------------
  |  Branch (2176:6): [True: 660, False: 7.91k]
  ------------------
 2177|  4.99k|	xmlErrValid(ctxt, XML_DTD_NO_DTD,
 2178|  4.99k|	  "Validation failed: no DTD found !", NULL, NULL);
 2179|  4.99k|	ctxt->validate = 0;
 2180|  4.99k|    }
 2181|   479k|#endif /* LIBXML_VALID_ENABLED */
 2182|       |
 2183|       |    /*
 2184|       |     * Take care of the rare case of an undefined namespace prefix
 2185|       |     */
 2186|   479k|    if ((prefix != NULL) && (URI == NULL)) {
  ------------------
  |  Branch (2186:9): [True: 41.9k, False: 437k]
  |  Branch (2186:29): [True: 18.8k, False: 23.0k]
  ------------------
 2187|  18.8k|        if (ctxt->dictNames) {
  ------------------
  |  Branch (2187:13): [True: 12.0k, False: 6.77k]
  ------------------
 2188|  12.0k|	    const xmlChar *fullname;
 2189|       |
 2190|  12.0k|	    fullname = xmlDictQLookup(ctxt->dict, prefix, localname);
 2191|  12.0k|	    if (fullname == NULL) {
  ------------------
  |  Branch (2191:10): [True: 2, False: 12.0k]
  ------------------
 2192|      2|                xmlSAX2ErrMemory(ctxt);
 2193|      2|                return;
 2194|      2|            }
 2195|  12.0k|	    localname = fullname;
 2196|  12.0k|	} else {
 2197|  6.77k|	    lname = xmlBuildQName(localname, prefix, NULL, 0);
 2198|  6.77k|            if (lname == NULL) {
  ------------------
  |  Branch (2198:17): [True: 1, False: 6.77k]
  ------------------
 2199|      1|                xmlSAX2ErrMemory(ctxt);
 2200|      1|                return;
 2201|      1|            }
 2202|  6.77k|	}
 2203|  18.8k|    }
 2204|       |    /*
 2205|       |     * allocate the node
 2206|       |     */
 2207|   479k|    if (ctxt->freeElems != NULL) {
  ------------------
  |  Branch (2207:9): [True: 2.41k, False: 476k]
  ------------------
 2208|  2.41k|        ret = ctxt->freeElems;
 2209|  2.41k|	ctxt->freeElems = ret->next;
 2210|  2.41k|	ctxt->freeElemsNr--;
 2211|  2.41k|	memset(ret, 0, sizeof(xmlNode));
 2212|  2.41k|        ret->doc = ctxt->myDoc;
 2213|  2.41k|	ret->type = XML_ELEMENT_NODE;
 2214|       |
 2215|  2.41k|	if (ctxt->dictNames)
  ------------------
  |  Branch (2215:6): [True: 1.12k, False: 1.28k]
  ------------------
 2216|  1.12k|	    ret->name = localname;
 2217|  1.28k|	else {
 2218|  1.28k|	    if (lname == NULL)
  ------------------
  |  Branch (2218:10): [True: 1.03k, False: 251]
  ------------------
 2219|  1.03k|		ret->name = xmlStrdup(localname);
 2220|    251|	    else
 2221|    251|	        ret->name = lname;
 2222|  1.28k|	    if (ret->name == NULL) {
  ------------------
  |  Branch (2222:10): [True: 4, False: 1.28k]
  ------------------
 2223|      4|	        xmlSAX2ErrMemory(ctxt);
 2224|      4|                xmlFree(ret);
 2225|      4|		return;
 2226|      4|	    }
 2227|  1.28k|	}
 2228|  2.40k|	if ((xmlRegisterCallbacks) && (xmlRegisterNodeDefaultValue))
  ------------------
  |  |  932|      0|    (*__xmlRegisterNodeDefaultValue())
  ------------------
  |  Branch (2228:6): [True: 0, False: 2.40k]
  |  Branch (2228:32): [True: 0, False: 0]
  ------------------
 2229|      0|	    xmlRegisterNodeDefaultValue(ret);
  ------------------
  |  |  932|      0|    (*__xmlRegisterNodeDefaultValue())
  ------------------
 2230|   476k|    } else {
 2231|   476k|	if (ctxt->dictNames)
  ------------------
  |  Branch (2231:6): [True: 246k, False: 230k]
  ------------------
 2232|   246k|	    ret = xmlNewDocNodeEatName(ctxt->myDoc, NULL,
 2233|   246k|	                               (xmlChar *) localname, NULL);
 2234|   230k|	else if (lname == NULL)
  ------------------
  |  Branch (2234:11): [True: 224k, False: 6.52k]
  ------------------
 2235|   224k|	    ret = xmlNewDocNode(ctxt->myDoc, NULL, localname, NULL);
 2236|  6.52k|	else
 2237|  6.52k|	    ret = xmlNewDocNodeEatName(ctxt->myDoc, NULL, lname, NULL);
 2238|   476k|	if (ret == NULL) {
  ------------------
  |  Branch (2238:6): [True: 60, False: 476k]
  ------------------
 2239|     60|	    xmlSAX2ErrMemory(ctxt);
 2240|     60|	    return;
 2241|     60|	}
 2242|   476k|    }
 2243|       |
 2244|       |    /*
 2245|       |     * Build the namespace list
 2246|       |     */
 2247|   620k|    for (i = 0,j = 0;j < nb_namespaces;j++) {
  ------------------
  |  Branch (2247:22): [True: 141k, False: 479k]
  ------------------
 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: 54]
  ------------------
 2252|   141k|	    if (last == NULL) {
  ------------------
  |  Branch (2252:10): [True: 52.8k, False: 88.4k]
  ------------------
 2253|  52.8k|	        ret->nsDef = last = ns;
 2254|  88.4k|	    } else {
 2255|  88.4k|	        last->next = ns;
 2256|  88.4k|		last = ns;
 2257|  88.4k|	    }
 2258|   141k|	    if ((URI != NULL) && (prefix == pref))
  ------------------
  |  Branch (2258:10): [True: 107k, False: 33.5k]
  |  Branch (2258:27): [True: 28.9k, False: 78.8k]
  ------------------
 2259|  28.9k|		ret->ns = ns;
 2260|   141k|	} else {
 2261|     54|            xmlSAX2ErrMemory(ctxt);
 2262|     54|	    continue;
 2263|     54|	}
 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: 59.2k, False: 82.0k]
  |  Branch (2268:41): [True: 6.53k, False: 52.7k]
  ------------------
 2269|  6.53k|	    ctxt->myDoc && ctxt->myDoc->intSubset) {
  ------------------
  |  Branch (2269:6): [True: 6.53k, False: 0]
  |  Branch (2269:21): [True: 6.53k, False: 0]
  ------------------
 2270|  6.53k|	    ctxt->valid &= xmlValidateOneNamespace(&ctxt->vctxt, ctxt->myDoc,
 2271|  6.53k|	                                           ret, prefix, ns, uri);
 2272|  6.53k|	}
 2273|   141k|#endif /* LIBXML_VALID_ENABLED */
 2274|   141k|    }
 2275|   479k|    ctxt->nodemem = -1;
 2276|       |
 2277|       |    /*
 2278|       |     * Link the child element
 2279|       |     */
 2280|   479k|    xmlSAX2AppendChild(ctxt, ret);
 2281|       |
 2282|       |    /*
 2283|       |     * We are parsing a new node.
 2284|       |     */
 2285|   479k|    if (nodePush(ctxt, ret) < 0) {
  ------------------
  |  Branch (2285:9): [True: 29, False: 479k]
  ------------------
 2286|     29|        xmlUnlinkNode(ret);
 2287|     29|        xmlFreeNode(ret);
 2288|     29|        return;
 2289|     29|    }
 2290|       |
 2291|       |    /*
 2292|       |     * Insert the defaulted attributes from the DTD only if requested:
 2293|       |     */
 2294|   479k|    if ((nb_defaulted != 0) &&
  ------------------
  |  Branch (2294:9): [True: 67.2k, False: 411k]
  ------------------
 2295|  67.2k|        ((ctxt->loadsubset & XML_COMPLETE_ATTRS) == 0))
  ------------------
  |  |  209|  67.2k|#define XML_COMPLETE_ATTRS	4
  ------------------
  |  Branch (2295:9): [True: 8.40k, False: 58.8k]
  ------------------
 2296|  8.40k|	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|   479k|    if ((URI != NULL) && (ret->ns == NULL)) {
  ------------------
  |  Branch (2302:9): [True: 58.2k, False: 420k]
  |  Branch (2302:26): [True: 29.3k, False: 28.9k]
  ------------------
 2303|  29.3k|        ret->ns = xmlParserNsLookupSax(ctxt, prefix);
 2304|  29.3k|	if ((ret->ns == NULL) && (xmlStrEqual(prefix, BAD_CAST "xml"))) {
  ------------------
  |  |   34|    567|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (2304:6): [True: 567, False: 28.7k]
  |  Branch (2304:27): [True: 544, False: 23]
  ------------------
 2305|    544|            int res;
 2306|       |
 2307|    544|	    res = xmlSearchNsSafe(ret, prefix, &ret->ns);
 2308|    544|            if (res < 0)
  ------------------
  |  Branch (2308:17): [True: 4, False: 540]
  ------------------
 2309|      4|                xmlSAX2ErrMemory(ctxt);
 2310|    544|	}
 2311|  29.3k|	if (ret->ns == NULL) {
  ------------------
  |  Branch (2311:6): [True: 27, False: 29.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: 8, False: 19]
  ------------------
 2319|      8|                xmlNsWarnMsg(ctxt, XML_NS_ERR_UNDEFINED_NAMESPACE,
 2320|      8|                             "Namespace prefix %s was not found\n",
 2321|      8|                             prefix, NULL);
 2322|     19|            else
 2323|     19|                xmlNsWarnMsg(ctxt, XML_NS_ERR_UNDEFINED_NAMESPACE,
 2324|     19|                             "Namespace default prefix was not found\n",
 2325|     19|                             NULL, NULL);
 2326|     27|	}
 2327|  29.3k|    }
 2328|       |
 2329|       |    /*
 2330|       |     * process all the other attributes
 2331|       |     */
 2332|   479k|    if (nb_attributes > 0) {
  ------------------
  |  Branch (2332:9): [True: 95.3k, False: 383k]
  ------------------
 2333|  95.3k|        xmlAttrPtr prev = NULL;
 2334|       |
 2335|   366k|        for (j = 0,i = 0;i < nb_attributes;i++,j+=5) {
  ------------------
  |  Branch (2335:26): [True: 270k, False: 95.3k]
  ------------------
 2336|   270k|            xmlAttrPtr attr = NULL;
 2337|       |
 2338|       |	    /*
 2339|       |	     * Handle the rare case of an undefined attribute prefix
 2340|       |	     */
 2341|   270k|	    if ((attributes[j+1] != NULL) && (attributes[j+2] == NULL)) {
  ------------------
  |  Branch (2341:10): [True: 140k, False: 130k]
  |  Branch (2341:39): [True: 51.6k, False: 89.1k]
  ------------------
 2342|  51.6k|		if (ctxt->dictNames) {
  ------------------
  |  Branch (2342:7): [True: 22.7k, False: 28.9k]
  ------------------
 2343|  22.7k|		    const xmlChar *fullname;
 2344|       |
 2345|  22.7k|		    fullname = xmlDictQLookup(ctxt->dict, attributes[j+1],
 2346|  22.7k|		                              attributes[j]);
 2347|  22.7k|		    if (fullname == NULL) {
  ------------------
  |  Branch (2347:11): [True: 1, False: 22.7k]
  ------------------
 2348|      1|                        xmlSAX2ErrMemory(ctxt);
 2349|      1|                        return;
 2350|      1|                    }
 2351|  22.7k|                    attr = xmlSAX2AttributeNs(ctxt, fullname, NULL,
 2352|  22.7k|                                              attributes[j+3],
 2353|  22.7k|                                              attributes[j+4]);
 2354|  22.7k|                    goto have_attr;
 2355|  28.9k|		} else {
 2356|  28.9k|		    lname = xmlBuildQName(attributes[j], attributes[j+1],
 2357|  28.9k|		                          NULL, 0);
 2358|  28.9k|		    if (lname == NULL) {
  ------------------
  |  Branch (2358:11): [True: 1, False: 28.9k]
  ------------------
 2359|      1|                        xmlSAX2ErrMemory(ctxt);
 2360|      1|                        return;
 2361|      1|                    }
 2362|  28.9k|                    attr = xmlSAX2AttributeNs(ctxt, lname, NULL,
 2363|  28.9k|                                              attributes[j+3],
 2364|  28.9k|                                              attributes[j+4]);
 2365|  28.9k|                    xmlFree(lname);
 2366|  28.9k|                    goto have_attr;
 2367|  28.9k|		}
 2368|  51.6k|	    }
 2369|   219k|            attr = xmlSAX2AttributeNs(ctxt, attributes[j], attributes[j+1],
 2370|   219k|                                      attributes[j+3], attributes[j+4]);
 2371|   270k|have_attr:
 2372|   270k|            if (attr == NULL)
  ------------------
  |  Branch (2372:17): [True: 22, False: 270k]
  ------------------
 2373|     22|                continue;
 2374|       |
 2375|       |            /* link at the end to preserve order */
 2376|   270k|            if (prev == NULL) {
  ------------------
  |  Branch (2376:17): [True: 95.3k, False: 175k]
  ------------------
 2377|  95.3k|                ctxt->node->properties = attr;
 2378|   175k|            } else {
 2379|   175k|                prev->next = attr;
 2380|   175k|                attr->prev = prev;
 2381|   175k|            }
 2382|       |
 2383|   270k|            prev = attr;
 2384|   270k|	}
 2385|  95.3k|    }
 2386|       |
 2387|   479k|#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|   479k|    if ((ctxt->validate) &&
  ------------------
  |  Branch (2392:9): [True: 150k, False: 328k]
  ------------------
 2393|   150k|        ((ctxt->vctxt.flags & XML_VCTXT_DTD_VALIDATED) == 0)) {
  ------------------
  |  |   16|   150k|#define XML_VCTXT_DTD_VALIDATED (1u << 0)
  ------------------
  |  Branch (2393:9): [True: 3.53k, False: 146k]
  ------------------
 2394|  3.53k|	int chk;
 2395|       |
 2396|  3.53k|	chk = xmlValidateDtdFinal(&ctxt->vctxt, ctxt->myDoc);
 2397|  3.53k|	if (chk <= 0)
  ------------------
  |  Branch (2397:6): [True: 60, False: 3.47k]
  ------------------
 2398|     60|	    ctxt->valid = 0;
 2399|  3.53k|	if (chk < 0)
  ------------------
  |  Branch (2399:6): [True: 0, False: 3.53k]
  ------------------
 2400|      0|	    ctxt->wellFormed = 0;
 2401|  3.53k|	ctxt->valid &= xmlValidateRoot(&ctxt->vctxt, ctxt->myDoc);
 2402|  3.53k|	ctxt->vctxt.flags |= XML_VCTXT_DTD_VALIDATED;
  ------------------
  |  |   16|  3.53k|#define XML_VCTXT_DTD_VALIDATED (1u << 0)
  ------------------
 2403|  3.53k|    }
 2404|   479k|#endif /* LIBXML_VALID_ENABLED */
 2405|   479k|}
xmlSAX2EndElementNs:
 2421|   320k|{
 2422|   320k|    xmlParserCtxtPtr ctxt = (xmlParserCtxtPtr) ctx;
 2423|       |
 2424|   320k|    if (ctx == NULL) return;
  ------------------
  |  Branch (2424:9): [True: 0, False: 320k]
  ------------------
 2425|   320k|    ctxt->nodemem = -1;
 2426|       |
 2427|   320k|#ifdef LIBXML_VALID_ENABLED
 2428|   320k|    if (ctxt->validate && ctxt->wellFormed &&
  ------------------
  |  Branch (2428:9): [True: 92.7k, False: 227k]
  |  Branch (2428:27): [True: 76.7k, False: 16.0k]
  ------------------
 2429|  76.7k|        ctxt->myDoc && ctxt->myDoc->intSubset)
  ------------------
  |  Branch (2429:9): [True: 76.7k, False: 0]
  |  Branch (2429:24): [True: 76.7k, False: 0]
  ------------------
 2430|  76.7k|        ctxt->valid &= xmlValidateOneElement(&ctxt->vctxt, ctxt->myDoc,
 2431|  76.7k|                                             ctxt->node);
 2432|   320k|#endif /* LIBXML_VALID_ENABLED */
 2433|       |
 2434|       |    /*
 2435|       |     * end of parsing of this node.
 2436|       |     */
 2437|   320k|    nodePop(ctxt);
 2438|   320k|}
xmlSAX2Reference:
 2448|  32.4k|{
 2449|  32.4k|    xmlParserCtxtPtr ctxt = (xmlParserCtxtPtr) ctx;
 2450|  32.4k|    xmlNodePtr ret;
 2451|       |
 2452|  32.4k|    if (ctx == NULL) return;
  ------------------
  |  Branch (2452:9): [True: 0, False: 32.4k]
  ------------------
 2453|  32.4k|    ret = xmlNewReference(ctxt->myDoc, name);
 2454|  32.4k|    if (ret == NULL) {
  ------------------
  |  Branch (2454:9): [True: 9, False: 32.4k]
  ------------------
 2455|      9|        xmlSAX2ErrMemory(ctxt);
 2456|      9|        return;
 2457|      9|    }
 2458|       |
 2459|  32.4k|    xmlSAX2AppendChild(ctxt, ret);
 2460|  32.4k|}
xmlSAX2Characters:
 2606|   746k|{
 2607|   746k|    xmlSAX2Text((xmlParserCtxtPtr) ctx, ch, len, XML_TEXT_NODE);
 2608|   746k|}
xmlSAX2ProcessingInstruction:
 2633|   120k|{
 2634|   120k|    xmlParserCtxtPtr ctxt = (xmlParserCtxtPtr) ctx;
 2635|   120k|    xmlNodePtr ret;
 2636|       |
 2637|   120k|    if (ctx == NULL) return;
  ------------------
  |  Branch (2637:9): [True: 0, False: 120k]
  ------------------
 2638|       |
 2639|   120k|    ret = xmlNewDocPI(ctxt->myDoc, target, data);
 2640|   120k|    if (ret == NULL) {
  ------------------
  |  Branch (2640:9): [True: 7, False: 120k]
  ------------------
 2641|      7|        xmlSAX2ErrMemory(ctxt);
 2642|      7|        return;
 2643|      7|    }
 2644|       |
 2645|   120k|    xmlSAX2AppendChild(ctxt, ret);
 2646|   120k|}
xmlSAX2Comment:
 2656|   476k|{
 2657|   476k|    xmlParserCtxtPtr ctxt = (xmlParserCtxtPtr) ctx;
 2658|   476k|    xmlNodePtr ret;
 2659|       |
 2660|   476k|    if (ctx == NULL) return;
  ------------------
  |  Branch (2660:9): [True: 0, False: 476k]
  ------------------
 2661|       |
 2662|   476k|    ret = xmlNewDocComment(ctxt->myDoc, value);
 2663|   476k|    if (ret == NULL) {
  ------------------
  |  Branch (2663:9): [True: 10, False: 476k]
  ------------------
 2664|     10|        xmlSAX2ErrMemory(ctxt);
 2665|     10|        return;
 2666|     10|    }
 2667|       |
 2668|   476k|    xmlSAX2AppendChild(ctxt, ret);
 2669|   476k|}
xmlSAX2CDataBlock:
 2680|  34.0k|{
 2681|  34.0k|    xmlSAX2Text((xmlParserCtxtPtr) ctx, value, len, XML_CDATA_SECTION_NODE);
 2682|  34.0k|}
xmlSAXVersion:
 2711|  81.3k|{
 2712|  81.3k|    if (hdlr == NULL) return(-1);
  ------------------
  |  Branch (2712:9): [True: 0, False: 81.3k]
  ------------------
 2713|  81.3k|    if (version == 2) {
  ------------------
  |  Branch (2713:9): [True: 81.3k, False: 0]
  ------------------
 2714|  81.3k|	hdlr->startElementNs = xmlSAX2StartElementNs;
 2715|  81.3k|	hdlr->endElementNs = xmlSAX2EndElementNs;
 2716|  81.3k|	hdlr->serror = NULL;
 2717|  81.3k|	hdlr->initialized = XML_SAX2_MAGIC;
  ------------------
  |  |  953|  81.3k|#define XML_SAX2_MAGIC 0xDEEDBEAF
  ------------------
 2718|  81.3k|#ifdef LIBXML_SAX1_ENABLED
 2719|  81.3k|    } 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|  81.3k|#ifdef LIBXML_SAX1_ENABLED
 2725|  81.3k|    hdlr->startElement = xmlSAX2StartElement;
 2726|  81.3k|    hdlr->endElement = xmlSAX2EndElement;
 2727|       |#else
 2728|       |    hdlr->startElement = NULL;
 2729|       |    hdlr->endElement = NULL;
 2730|       |#endif /* LIBXML_SAX1_ENABLED */
 2731|  81.3k|    hdlr->internalSubset = xmlSAX2InternalSubset;
 2732|  81.3k|    hdlr->externalSubset = xmlSAX2ExternalSubset;
 2733|  81.3k|    hdlr->isStandalone = xmlSAX2IsStandalone;
 2734|  81.3k|    hdlr->hasInternalSubset = xmlSAX2HasInternalSubset;
 2735|  81.3k|    hdlr->hasExternalSubset = xmlSAX2HasExternalSubset;
 2736|  81.3k|    hdlr->resolveEntity = xmlSAX2ResolveEntity;
 2737|  81.3k|    hdlr->getEntity = xmlSAX2GetEntity;
 2738|  81.3k|    hdlr->getParameterEntity = xmlSAX2GetParameterEntity;
 2739|  81.3k|    hdlr->entityDecl = xmlSAX2EntityDecl;
 2740|  81.3k|    hdlr->attributeDecl = xmlSAX2AttributeDecl;
 2741|  81.3k|    hdlr->elementDecl = xmlSAX2ElementDecl;
 2742|  81.3k|    hdlr->notationDecl = xmlSAX2NotationDecl;
 2743|  81.3k|    hdlr->unparsedEntityDecl = xmlSAX2UnparsedEntityDecl;
 2744|  81.3k|    hdlr->setDocumentLocator = xmlSAX2SetDocumentLocator;
 2745|  81.3k|    hdlr->startDocument = xmlSAX2StartDocument;
 2746|  81.3k|    hdlr->endDocument = xmlSAX2EndDocument;
 2747|  81.3k|    hdlr->reference = xmlSAX2Reference;
 2748|  81.3k|    hdlr->characters = xmlSAX2Characters;
 2749|  81.3k|    hdlr->cdataBlock = xmlSAX2CDataBlock;
 2750|  81.3k|    hdlr->ignorableWhitespace = xmlSAX2Characters;
 2751|  81.3k|    hdlr->processingInstruction = xmlSAX2ProcessingInstruction;
 2752|  81.3k|    hdlr->comment = xmlSAX2Comment;
 2753|  81.3k|    hdlr->warning = xmlParserWarning;
 2754|  81.3k|    hdlr->error = xmlParserError;
 2755|  81.3k|    hdlr->fatalError = xmlParserError;
 2756|       |
 2757|  81.3k|    return(0);
 2758|  81.3k|}
SAX2.c:xmlSAX2ErrMemory:
   42|    753|xmlSAX2ErrMemory(xmlParserCtxtPtr ctxt) {
   43|    753|    xmlCtxtErrMemory(ctxt);
   44|    753|}
SAX2.c:xmlWarnMsg:
  111|  11.5k|{
  112|  11.5k|    xmlCtxtErr(ctxt, NULL, XML_FROM_PARSER, error, XML_ERR_WARNING,
  113|  11.5k|               str1, NULL, NULL, 0, msg, str1);
  114|  11.5k|}
SAX2.c:xmlFatalErrMsg:
   79|    587|{
   80|    587|    xmlCtxtErr(ctxt, NULL, XML_FROM_PARSER, error, XML_ERR_FATAL,
   81|       |               str1, str2, NULL, 0, msg, str1, str2);
   82|    587|}
SAX2.c:xmlErrId:
   95|  2.30k|{
   96|  2.30k|    xmlCtxtErr(ctxt, NULL, XML_FROM_PARSER, error, XML_ERR_ERROR,
   97|  2.30k|               str1, NULL, NULL, 0, msg, str1);
   98|  2.30k|}
SAX2.c:xmlSAX1StartElement:
 1422|   296k|{
 1423|   296k|    xmlParserCtxtPtr ctxt = (xmlParserCtxtPtr) ctx;
 1424|   296k|    xmlNodePtr ret;
 1425|   296k|    xmlNodePtr parent;
 1426|   296k|    xmlNsPtr ns;
 1427|   296k|    const xmlChar *name;
 1428|   296k|    xmlChar *prefix;
 1429|   296k|    const xmlChar *att;
 1430|   296k|    const xmlChar *value;
 1431|   296k|    int i, res;
 1432|       |
 1433|   296k|    if ((ctx == NULL) || (fullname == NULL) || (ctxt->myDoc == NULL)) return;
  ------------------
  |  Branch (1433:9): [True: 0, False: 296k]
  |  Branch (1433:26): [True: 0, False: 296k]
  |  Branch (1433:48): [True: 0, False: 296k]
  ------------------
 1434|       |
 1435|   296k|#ifdef LIBXML_VALID_ENABLED
 1436|       |    /*
 1437|       |     * First check on validity:
 1438|       |     */
 1439|   296k|    if (ctxt->validate && (ctxt->myDoc->extSubset == NULL) &&
  ------------------
  |  Branch (1439:9): [True: 91.2k, False: 205k]
  |  Branch (1439:27): [True: 72.8k, False: 18.4k]
  ------------------
 1440|  72.8k|        ((ctxt->myDoc->intSubset == NULL) ||
  ------------------
  |  Branch (1440:10): [True: 4.26k, False: 68.5k]
  ------------------
 1441|  68.5k|	 ((ctxt->myDoc->intSubset->notations == NULL) &&
  ------------------
  |  Branch (1441:4): [True: 68.0k, False: 554]
  ------------------
 1442|  68.0k|	  (ctxt->myDoc->intSubset->elements == NULL) &&
  ------------------
  |  Branch (1442:4): [True: 10.6k, False: 57.3k]
  ------------------
 1443|  10.6k|	  (ctxt->myDoc->intSubset->attributes == NULL) &&
  ------------------
  |  Branch (1443:4): [True: 10.6k, False: 0]
  ------------------
 1444|  10.6k|	  (ctxt->myDoc->intSubset->entities == NULL)))) {
  ------------------
  |  Branch (1444:4): [True: 903, False: 9.77k]
  ------------------
 1445|  5.16k|	xmlErrValid(ctxt, XML_ERR_NO_DTD,
 1446|  5.16k|	  "Validation failed: no DTD found !", NULL, NULL);
 1447|  5.16k|	ctxt->validate = 0;
 1448|  5.16k|    }
 1449|   296k|#endif
 1450|       |
 1451|       |    /*
 1452|       |     * Split the full name into a namespace prefix and the tag name
 1453|       |     */
 1454|   296k|    name = xmlSplitQName4(fullname, &prefix);
 1455|   296k|    if (name == NULL) {
  ------------------
  |  Branch (1455:9): [True: 5, False: 296k]
  ------------------
 1456|      5|        xmlSAX2ErrMemory(ctxt);
 1457|      5|        return;
 1458|      5|    }
 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|   296k|    ret = xmlNewDocNode(ctxt->myDoc, NULL, name, NULL);
 1466|   296k|    if (ret == NULL) {
  ------------------
  |  Branch (1466:9): [True: 47, False: 296k]
  ------------------
 1467|     47|	xmlFree(prefix);
 1468|     47|	xmlSAX2ErrMemory(ctxt);
 1469|     47|        return;
 1470|     47|    }
 1471|   296k|    ctxt->nodemem = -1;
 1472|       |
 1473|       |    /* Initialize parent before pushing node */
 1474|   296k|    parent = ctxt->node;
 1475|   296k|    if (parent == NULL)
  ------------------
  |  Branch (1475:9): [True: 15.6k, False: 281k]
  ------------------
 1476|  15.6k|        parent = (xmlNodePtr) ctxt->myDoc;
 1477|       |
 1478|       |    /*
 1479|       |     * Link the child element
 1480|       |     */
 1481|   296k|    xmlSAX2AppendChild(ctxt, ret);
 1482|       |
 1483|       |    /*
 1484|       |     * We are parsing a new node.
 1485|       |     */
 1486|   296k|    if (nodePush(ctxt, ret) < 0) {
  ------------------
  |  Branch (1486:9): [True: 38, False: 296k]
  ------------------
 1487|     38|        xmlUnlinkNode(ret);
 1488|     38|        xmlFreeNode(ret);
 1489|     38|        if (prefix != NULL)
  ------------------
  |  Branch (1489:13): [True: 4, False: 34]
  ------------------
 1490|      4|            xmlFree(prefix);
 1491|     38|        return;
 1492|     38|    }
 1493|       |
 1494|       |    /*
 1495|       |     * Insert all the defaulted attributes from the DTD especially
 1496|       |     * namespaces
 1497|       |     */
 1498|   296k|    if ((ctxt->myDoc->intSubset != NULL) ||
  ------------------
  |  Branch (1498:9): [True: 140k, False: 155k]
  ------------------
 1499|   155k|        (ctxt->myDoc->extSubset != NULL)) {
  ------------------
  |  Branch (1499:9): [True: 0, False: 155k]
  ------------------
 1500|   140k|        xmlCheckDefaultedAttributes(ctxt, name, prefix, atts);
 1501|   140k|    }
 1502|       |
 1503|       |    /*
 1504|       |     * process all the attributes whose name start with "xmlns"
 1505|       |     */
 1506|   296k|    if (atts != NULL) {
  ------------------
  |  Branch (1506:9): [True: 90.7k, False: 205k]
  ------------------
 1507|  90.7k|        i = 0;
 1508|  90.7k|        att = atts[i++];
 1509|  90.7k|        value = atts[i++];
 1510|   200k|        while ((att != NULL) && (value != NULL)) {
  ------------------
  |  Branch (1510:16): [True: 109k, False: 90.7k]
  |  Branch (1510:33): [True: 109k, False: 0]
  ------------------
 1511|   109k|            if ((att[0] == 'x') && (att[1] == 'm') && (att[2] == 'l') &&
  ------------------
  |  Branch (1511:17): [True: 85.7k, False: 24.0k]
  |  Branch (1511:36): [True: 77.9k, False: 7.82k]
  |  Branch (1511:55): [True: 76.5k, False: 1.31k]
  ------------------
 1512|  76.5k|                (att[3] == 'n') && (att[4] == 's'))
  ------------------
  |  Branch (1512:17): [True: 61.5k, False: 15.0k]
  |  Branch (1512:36): [True: 61.2k, False: 279]
  ------------------
 1513|  61.2k|                xmlSAX1Attribute(ctxt, att, value, prefix);
 1514|       |
 1515|   109k|            att = atts[i++];
 1516|   109k|            value = atts[i++];
 1517|   109k|        }
 1518|  90.7k|    }
 1519|       |
 1520|       |    /*
 1521|       |     * Search the namespace, note that since the attributes have been
 1522|       |     * processed, the local namespaces are available.
 1523|       |     */
 1524|   296k|    res = xmlSearchNsSafe(ret, prefix, &ns);
 1525|   296k|    if (res < 0)
  ------------------
  |  Branch (1525:9): [True: 3, False: 296k]
  ------------------
 1526|      3|        xmlSAX2ErrMemory(ctxt);
 1527|   296k|    if ((ns == NULL) && (parent != NULL)) {
  ------------------
  |  Branch (1527:9): [True: 209k, False: 86.8k]
  |  Branch (1527:25): [True: 209k, False: 0]
  ------------------
 1528|   209k|        res = xmlSearchNsSafe(parent, prefix, &ns);
 1529|   209k|        if (res < 0)
  ------------------
  |  Branch (1529:13): [True: 0, False: 209k]
  ------------------
 1530|      0|            xmlSAX2ErrMemory(ctxt);
 1531|   209k|    }
 1532|   296k|    if ((prefix != NULL) && (ns == NULL)) {
  ------------------
  |  Branch (1532:9): [True: 66.9k, False: 229k]
  |  Branch (1532:29): [True: 12.6k, False: 54.3k]
  ------------------
 1533|  12.6k|        xmlNsWarnMsg(ctxt, XML_NS_ERR_UNDEFINED_NAMESPACE,
 1534|  12.6k|                     "Namespace prefix %s is not defined\n",
 1535|  12.6k|                     prefix, NULL);
 1536|  12.6k|        ns = xmlNewNs(ret, NULL, prefix);
 1537|  12.6k|        if (ns == NULL)
  ------------------
  |  Branch (1537:13): [True: 9, False: 12.6k]
  ------------------
 1538|      9|            xmlSAX2ErrMemory(ctxt);
 1539|  12.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|   296k|    if ((ns != NULL) && (ns->href != NULL) &&
  ------------------
  |  Branch (1545:9): [True: 99.4k, False: 197k]
  |  Branch (1545:25): [True: 86.8k, False: 12.6k]
  ------------------
 1546|  86.8k|        ((ns->href[0] != 0) || (ns->prefix != NULL)))
  ------------------
  |  Branch (1546:10): [True: 78.3k, False: 8.51k]
  |  Branch (1546:32): [True: 265, False: 8.25k]
  ------------------
 1547|  78.6k|        xmlSetNs(ret, ns);
 1548|       |
 1549|       |    /*
 1550|       |     * process all the other attributes
 1551|       |     */
 1552|   296k|    if (atts != NULL) {
  ------------------
  |  Branch (1552:9): [True: 90.7k, False: 205k]
  ------------------
 1553|  90.7k|        i = 0;
 1554|  90.7k|	att = atts[i++];
 1555|  90.7k|	value = atts[i++];
 1556|   200k|        while ((att != NULL) && (value != NULL)) {
  ------------------
  |  Branch (1556:16): [True: 109k, False: 90.7k]
  |  Branch (1556:33): [True: 109k, False: 0]
  ------------------
 1557|   109k|            if ((att[0] != 'x') || (att[1] != 'm') || (att[2] != 'l') ||
  ------------------
  |  Branch (1557:17): [True: 24.0k, False: 85.7k]
  |  Branch (1557:36): [True: 7.82k, False: 77.9k]
  |  Branch (1557:55): [True: 1.31k, False: 76.5k]
  ------------------
 1558|  76.5k|                (att[3] != 'n') || (att[4] != 's'))
  ------------------
  |  Branch (1558:17): [True: 15.0k, False: 61.5k]
  |  Branch (1558:36): [True: 279, False: 61.2k]
  ------------------
 1559|  48.4k|                xmlSAX1Attribute(ctxt, att, value, NULL);
 1560|       |
 1561|       |            /*
 1562|       |             * Next ones
 1563|       |             */
 1564|   109k|            att = atts[i++];
 1565|   109k|            value = atts[i++];
 1566|   109k|        }
 1567|  90.7k|    }
 1568|       |
 1569|   296k|#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|   296k|    if ((ctxt->validate) &&
  ------------------
  |  Branch (1574:9): [True: 86.0k, False: 210k]
  ------------------
 1575|  86.0k|        ((ctxt->vctxt.flags & XML_VCTXT_DTD_VALIDATED) == 0)) {
  ------------------
  |  |   16|  86.0k|#define XML_VCTXT_DTD_VALIDATED (1u << 0)
  ------------------
  |  Branch (1575:9): [True: 2.38k, False: 83.6k]
  ------------------
 1576|  2.38k|	int chk;
 1577|       |
 1578|  2.38k|	chk = xmlValidateDtdFinal(&ctxt->vctxt, ctxt->myDoc);
 1579|  2.38k|	if (chk <= 0)
  ------------------
  |  Branch (1579:6): [True: 39, False: 2.34k]
  ------------------
 1580|     39|	    ctxt->valid = 0;
 1581|  2.38k|	if (chk < 0)
  ------------------
  |  Branch (1581:6): [True: 0, False: 2.38k]
  ------------------
 1582|      0|	    ctxt->wellFormed = 0;
 1583|  2.38k|	ctxt->valid &= xmlValidateRoot(&ctxt->vctxt, ctxt->myDoc);
 1584|  2.38k|	ctxt->vctxt.flags |= XML_VCTXT_DTD_VALIDATED;
  ------------------
  |  |   16|  2.38k|#define XML_VCTXT_DTD_VALIDATED (1u << 0)
  ------------------
 1585|  2.38k|    }
 1586|   296k|#endif /* LIBXML_VALID_ENABLED */
 1587|       |
 1588|   296k|    if (prefix != NULL)
  ------------------
  |  Branch (1588:9): [True: 66.9k, False: 229k]
  ------------------
 1589|  66.9k|	xmlFree(prefix);
 1590|       |
 1591|   296k|}
SAX2.c:xmlCheckDefaultedAttributes:
 1257|   140k|	const xmlChar *prefix, const xmlChar **atts) {
 1258|   140k|    xmlElementPtr elemDecl;
 1259|   140k|    const xmlChar *att;
 1260|   140k|    int internal = 1;
 1261|   140k|    int i;
 1262|       |
 1263|   140k|    elemDecl = xmlGetDtdQElementDesc(ctxt->myDoc->intSubset, name, prefix);
 1264|   140k|    if (elemDecl == NULL) {
  ------------------
  |  Branch (1264:9): [True: 93.5k, False: 47.4k]
  ------------------
 1265|  93.5k|	elemDecl = xmlGetDtdQElementDesc(ctxt->myDoc->extSubset, name, prefix);
 1266|  93.5k|	internal = 0;
 1267|  93.5k|    }
 1268|       |
 1269|   188k|process_external_subset:
 1270|       |
 1271|   188k|    if (elemDecl != NULL) {
  ------------------
  |  Branch (1271:9): [True: 50.6k, False: 137k]
  ------------------
 1272|  50.6k|	xmlAttributePtr attr = elemDecl->attributes;
 1273|       |
 1274|  50.6k|#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|  50.6k|	if ((ctxt->myDoc->standalone == 1) &&
  ------------------
  |  Branch (1282:6): [True: 1.72k, False: 48.9k]
  ------------------
 1283|  1.72k|	    (ctxt->myDoc->extSubset != NULL) &&
  ------------------
  |  Branch (1283:6): [True: 1.48k, False: 240]
  ------------------
 1284|  1.48k|	    (ctxt->validate)) {
  ------------------
  |  Branch (1284:6): [True: 1.28k, False: 199]
  ------------------
 1285|  2.58k|	    while (attr != NULL) {
  ------------------
  |  Branch (1285:13): [True: 1.30k, False: 1.28k]
  ------------------
 1286|  1.30k|		if ((attr->defaultValue != NULL) &&
  ------------------
  |  Branch (1286:7): [True: 915, False: 389]
  ------------------
 1287|    915|		    (xmlGetDtdQAttrDesc(ctxt->myDoc->extSubset,
  ------------------
  |  Branch (1287:7): [True: 837, False: 78]
  ------------------
 1288|    915|					attr->elem, attr->name,
 1289|    915|					attr->prefix) == attr) &&
 1290|    837|		    (xmlGetDtdQAttrDesc(ctxt->myDoc->intSubset,
  ------------------
  |  Branch (1290:7): [True: 837, False: 0]
  ------------------
 1291|    837|					attr->elem, attr->name,
 1292|    837|					attr->prefix) == NULL)) {
 1293|    837|		    xmlChar *fulln;
 1294|       |
 1295|    837|		    if (attr->prefix != NULL) {
  ------------------
  |  Branch (1295:11): [True: 74, False: 763]
  ------------------
 1296|     74|			fulln = xmlStrdup(attr->prefix);
 1297|     74|                        if (fulln != NULL)
  ------------------
  |  Branch (1297:29): [True: 73, False: 1]
  ------------------
 1298|     73|			    fulln = xmlStrcat(fulln, BAD_CAST ":");
  ------------------
  |  |   34|     73|#define BAD_CAST (xmlChar *)
  ------------------
 1299|     74|                        if (fulln != NULL)
  ------------------
  |  Branch (1299:29): [True: 73, False: 1]
  ------------------
 1300|     73|			    fulln = xmlStrcat(fulln, attr->name);
 1301|    763|		    } else {
 1302|    763|			fulln = xmlStrdup(attr->name);
 1303|    763|		    }
 1304|    837|                    if (fulln == NULL) {
  ------------------
  |  Branch (1304:25): [True: 4, False: 833]
  ------------------
 1305|      4|                        xmlSAX2ErrMemory(ctxt);
 1306|      4|                        break;
 1307|      4|                    }
 1308|       |
 1309|       |		    /*
 1310|       |		     * Check that the attribute is not declared in the
 1311|       |		     * serialization
 1312|       |		     */
 1313|    833|		    att = NULL;
 1314|    833|		    if (atts != NULL) {
  ------------------
  |  Branch (1314:11): [True: 376, False: 457]
  ------------------
 1315|    376|			i = 0;
 1316|    376|			att = atts[i];
 1317|    719|			while (att != NULL) {
  ------------------
  |  Branch (1317:11): [True: 410, False: 309]
  ------------------
 1318|    410|			    if (xmlStrEqual(att, fulln))
  ------------------
  |  Branch (1318:12): [True: 67, False: 343]
  ------------------
 1319|     67|				break;
 1320|    343|			    i += 2;
 1321|    343|			    att = atts[i];
 1322|    343|			}
 1323|    376|		    }
 1324|    833|		    if (att == NULL) {
  ------------------
  |  Branch (1324:11): [True: 766, False: 67]
  ------------------
 1325|    766|		        xmlErrValid(ctxt, XML_DTD_STANDALONE_DEFAULTED,
 1326|    766|      "standalone: attribute %s on %s defaulted from external subset\n",
 1327|    766|				    fulln,
 1328|    766|				    attr->elem);
 1329|    766|		    }
 1330|    833|                    xmlFree(fulln);
 1331|    833|		}
 1332|  1.30k|		attr = attr->nexth;
 1333|  1.30k|	    }
 1334|  1.28k|	}
 1335|  50.6k|#endif
 1336|       |
 1337|       |	/*
 1338|       |	 * Actually insert defaulted values when needed
 1339|       |	 */
 1340|  50.6k|	attr = elemDecl->attributes;
 1341|   108k|	while (attr != NULL) {
  ------------------
  |  Branch (1341:9): [True: 58.2k, False: 50.6k]
  ------------------
 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|  58.2k|	    if (attr->defaultValue != NULL) {
  ------------------
  |  Branch (1347:10): [True: 50.6k, False: 7.63k]
  ------------------
 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|  50.6k|		if (((attr->prefix != NULL) &&
  ------------------
  |  Branch (1356:8): [True: 20.6k, False: 29.9k]
  ------------------
 1357|  20.6k|		     (xmlStrEqual(attr->prefix, BAD_CAST "xmlns"))) ||
  ------------------
  |  |   34|  20.6k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (1357:8): [True: 11.3k, False: 9.34k]
  ------------------
 1358|  39.3k|		    ((attr->prefix == NULL) &&
  ------------------
  |  Branch (1358:8): [True: 29.9k, False: 9.34k]
  ------------------
 1359|  29.9k|		     (xmlStrEqual(attr->name, BAD_CAST "xmlns"))) ||
  ------------------
  |  |   34|  29.9k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (1359:8): [True: 3.08k, False: 26.8k]
  ------------------
 1360|  41.3k|		    (ctxt->loadsubset & XML_COMPLETE_ATTRS)) {
  ------------------
  |  |  209|  36.2k|#define XML_COMPLETE_ATTRS	4
  ------------------
  |  Branch (1360:7): [True: 26.9k, False: 9.33k]
  ------------------
 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.1k, False: 2.13k]
  |  Branch (1366:28): [True: 2.13k, 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: 4, False: 41.3k]
  ------------------
 1372|      4|			    xmlSAX2ErrMemory(ctxt);
 1373|      4|			    return;
 1374|      4|			}
 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: 2.23k, False: 39.0k]
  ------------------
 1382|  2.23k|			    i = 0;
 1383|  2.23k|			    att = atts[i];
 1384|  5.30k|			    while (att != NULL) {
  ------------------
  |  Branch (1384:15): [True: 3.48k, False: 1.82k]
  ------------------
 1385|  3.48k|				if (xmlStrEqual(att, fulln))
  ------------------
  |  Branch (1385:9): [True: 415, False: 3.06k]
  ------------------
 1386|    415|				    break;
 1387|  3.06k|				i += 2;
 1388|  3.06k|				att = atts[i];
 1389|  3.06k|			    }
 1390|  2.23k|			}
 1391|  41.3k|			if (att == NULL) {
  ------------------
  |  Branch (1391:8): [True: 40.8k, False: 415]
  ------------------
 1392|  40.8k|			    xmlSAX1Attribute(ctxt, fulln,
 1393|  40.8k|					     attr->defaultValue, prefix);
 1394|  40.8k|			}
 1395|  41.3k|			if ((fulln != fn) && (fulln != attr->name))
  ------------------
  |  Branch (1395:8): [True: 39.2k, False: 2.01k]
  |  Branch (1395:25): [True: 15.5k, False: 23.7k]
  ------------------
 1396|  15.5k|			    xmlFree(fulln);
 1397|  41.3k|		    }
 1398|  41.3k|		}
 1399|  50.6k|	    }
 1400|  58.2k|	    attr = attr->nexth;
 1401|  58.2k|	}
 1402|  50.6k|	if (internal == 1) {
  ------------------
  |  Branch (1402:6): [True: 47.4k, False: 3.25k]
  ------------------
 1403|  47.4k|	    elemDecl = xmlGetDtdQElementDesc(ctxt->myDoc->extSubset,
 1404|  47.4k|		                             name, prefix);
 1405|  47.4k|	    internal = 0;
 1406|  47.4k|	    goto process_external_subset;
 1407|  47.4k|	}
 1408|  50.6k|    }
 1409|   188k|}
SAX2.c:xmlSAX1Attribute:
  960|   150k|{
  961|   150k|    xmlAttrPtr ret;
  962|   150k|    const xmlChar *name;
  963|   150k|    xmlChar *ns;
  964|   150k|    xmlNsPtr namespace;
  965|       |
  966|       |    /*
  967|       |     * Split the full name into a namespace prefix and the tag name
  968|       |     */
  969|   150k|    name = xmlSplitQName4(fullname, &ns);
  970|   150k|    if (name == NULL) {
  ------------------
  |  Branch (970:9): [True: 7, False: 150k]
  ------------------
  971|      7|        xmlSAX2ErrMemory(ctxt);
  972|      7|        return;
  973|      7|    }
  974|       |
  975|       |    /*
  976|       |     * Check whether it's a namespace definition
  977|       |     */
  978|   150k|    if ((ns == NULL) &&
  ------------------
  |  Branch (978:9): [True: 62.1k, False: 88.5k]
  ------------------
  979|  62.1k|        (name[0] == 'x') && (name[1] == 'm') && (name[2] == 'l') &&
  ------------------
  |  Branch (979:9): [True: 25.0k, False: 37.0k]
  |  Branch (979:29): [True: 17.0k, False: 8.04k]
  |  Branch (979:49): [True: 16.4k, False: 567]
  ------------------
  980|  16.4k|        (name[3] == 'n') && (name[4] == 's') && (name[5] == 0)) {
  ------------------
  |  Branch (980:9): [True: 15.1k, False: 1.28k]
  |  Branch (980:29): [True: 14.6k, False: 549]
  |  Branch (980:49): [True: 14.3k, False: 287]
  ------------------
  981|  14.3k|	xmlNsPtr nsret;
  982|  14.3k|	xmlChar *val;
  983|       |
  984|       |        /* Avoid unused variable warning if features are disabled. */
  985|  14.3k|        (void) nsret;
  986|       |
  987|  14.3k|        if (!ctxt->replaceEntities) {
  ------------------
  |  Branch (987:13): [True: 7.59k, False: 6.73k]
  ------------------
  988|       |            /* TODO: normalize if needed */
  989|  7.59k|	    val = xmlExpandEntitiesInAttValue(ctxt, value, /* normalize */ 0);
  990|  7.59k|	    if (val == NULL) {
  ------------------
  |  Branch (990:10): [True: 8, False: 7.59k]
  ------------------
  991|      8|	        xmlSAX2ErrMemory(ctxt);
  992|      8|		return;
  993|      8|	    }
  994|  7.59k|	} else {
  995|  6.73k|	    val = (xmlChar *) value;
  996|  6.73k|	}
  997|       |
  998|  14.3k|	if (val[0] != 0) {
  ------------------
  |  Branch (998:6): [True: 8.14k, False: 6.17k]
  ------------------
  999|  8.14k|	    xmlURIPtr uri;
 1000|       |
 1001|  8.14k|	    if (xmlParseURISafe((const char *)val, &uri) < 0)
  ------------------
  |  Branch (1001:10): [True: 17, False: 8.12k]
  ------------------
 1002|     17|                xmlSAX2ErrMemory(ctxt);
 1003|  8.14k|	    if (uri == NULL) {
  ------------------
  |  Branch (1003:10): [True: 1.59k, False: 6.54k]
  ------------------
 1004|  1.59k|                xmlNsWarnMsg(ctxt, XML_WAR_NS_URI,
 1005|  1.59k|                             "xmlns:%s: %s not a valid URI\n", name, value);
 1006|  6.54k|	    } else {
 1007|  6.54k|		if (uri->scheme == NULL) {
  ------------------
  |  Branch (1007:7): [True: 5.73k, False: 807]
  ------------------
 1008|  5.73k|                    xmlNsWarnMsg(ctxt, XML_WAR_NS_URI_RELATIVE,
 1009|  5.73k|                                 "xmlns:%s: URI %s is not absolute\n",
 1010|  5.73k|                                 name, value);
 1011|  5.73k|		}
 1012|  6.54k|		xmlFreeURI(uri);
 1013|  6.54k|	    }
 1014|  8.14k|	}
 1015|       |
 1016|       |	/* a default namespace definition */
 1017|  14.3k|	nsret = xmlNewNs(ctxt->node, val, NULL);
 1018|  14.3k|        if (nsret == NULL) {
  ------------------
  |  Branch (1018:13): [True: 11, False: 14.3k]
  ------------------
 1019|     11|            xmlSAX2ErrMemory(ctxt);
 1020|     11|        }
 1021|  14.3k|#ifdef LIBXML_VALID_ENABLED
 1022|       |	/*
 1023|       |	 * Validate also for namespace decls, they are attributes from
 1024|       |	 * an XML-1.0 perspective
 1025|       |	 */
 1026|  14.3k|        else if (ctxt->validate && ctxt->wellFormed &&
  ------------------
  |  Branch (1026:18): [True: 4.90k, False: 9.40k]
  |  Branch (1026:36): [True: 3.37k, False: 1.53k]
  ------------------
 1027|  3.37k|                 ctxt->myDoc && ctxt->myDoc->intSubset) {
  ------------------
  |  Branch (1027:18): [True: 3.37k, False: 0]
  |  Branch (1027:33): [True: 3.37k, False: 0]
  ------------------
 1028|  3.37k|	    ctxt->valid &= xmlValidateOneNamespace(&ctxt->vctxt, ctxt->myDoc,
 1029|  3.37k|					   ctxt->node, prefix, nsret, val);
 1030|  3.37k|        }
 1031|  14.3k|#endif /* LIBXML_VALID_ENABLED */
 1032|  14.3k|	if (val != value)
  ------------------
  |  Branch (1032:6): [True: 7.59k, False: 6.73k]
  ------------------
 1033|  7.59k|	    xmlFree(val);
 1034|  14.3k|	return;
 1035|  14.3k|    }
 1036|   136k|    if ((ns != NULL) && (ns[0] == 'x') && (ns[1] == 'm') && (ns[2] == 'l') &&
  ------------------
  |  Branch (1036:9): [True: 88.5k, False: 47.7k]
  |  Branch (1036:25): [True: 81.5k, False: 6.95k]
  |  Branch (1036:43): [True: 80.1k, False: 1.43k]
  |  Branch (1036:61): [True: 78.6k, False: 1.43k]
  ------------------
 1037|  78.6k|        (ns[3] == 'n') && (ns[4] == 's') && (ns[5] == 0)) {
  ------------------
  |  Branch (1037:9): [True: 62.5k, False: 16.0k]
  |  Branch (1037:27): [True: 62.2k, False: 367]
  |  Branch (1037:45): [True: 61.1k, False: 1.01k]
  ------------------
 1038|  61.1k|	xmlNsPtr nsret;
 1039|  61.1k|	xmlChar *val;
 1040|       |
 1041|       |        /* Avoid unused variable warning if features are disabled. */
 1042|  61.1k|        (void) nsret;
 1043|       |
 1044|  61.1k|        if (!ctxt->replaceEntities) {
  ------------------
  |  Branch (1044:13): [True: 10.7k, False: 50.4k]
  ------------------
 1045|       |            /* TODO: normalize if needed */
 1046|  10.7k|	    val = xmlExpandEntitiesInAttValue(ctxt, value, /* normalize */ 0);
 1047|  10.7k|	    if (val == NULL) {
  ------------------
  |  Branch (1047:10): [True: 3, False: 10.7k]
  ------------------
 1048|      3|	        xmlSAX2ErrMemory(ctxt);
 1049|      3|	        xmlFree(ns);
 1050|      3|		return;
 1051|      3|	    }
 1052|  50.4k|	} else {
 1053|  50.4k|	    val = (xmlChar *) value;
 1054|  50.4k|	}
 1055|       |
 1056|  61.1k|	if (val[0] == 0) {
  ------------------
  |  Branch (1056:6): [True: 550, False: 60.6k]
  ------------------
 1057|    550|	    xmlNsErrMsg(ctxt, XML_NS_ERR_EMPTY,
 1058|    550|		        "Empty namespace name for prefix %s\n", name, NULL);
 1059|    550|	}
 1060|  61.1k|	if ((ctxt->pedantic != 0) && (val[0] != 0)) {
  ------------------
  |  Branch (1060:6): [True: 45.2k, False: 15.9k]
  |  Branch (1060:31): [True: 44.8k, False: 410]
  ------------------
 1061|  44.8k|	    xmlURIPtr uri;
 1062|       |
 1063|  44.8k|	    if (xmlParseURISafe((const char *)val, &uri) < 0)
  ------------------
  |  Branch (1063:10): [True: 4, False: 44.8k]
  ------------------
 1064|      4|                xmlSAX2ErrMemory(ctxt);
 1065|  44.8k|	    if (uri == NULL) {
  ------------------
  |  Branch (1065:10): [True: 2.50k, False: 42.3k]
  ------------------
 1066|  2.50k|	        xmlNsWarnMsg(ctxt, XML_WAR_NS_URI,
 1067|  2.50k|			 "xmlns:%s: %s not a valid URI\n", name, value);
 1068|  42.3k|	    } else {
 1069|  42.3k|		if (uri->scheme == NULL) {
  ------------------
  |  Branch (1069:7): [True: 40.5k, False: 1.74k]
  ------------------
 1070|  40.5k|		    xmlNsWarnMsg(ctxt, XML_WAR_NS_URI_RELATIVE,
 1071|  40.5k|			   "xmlns:%s: URI %s is not absolute\n", name, value);
 1072|  40.5k|		}
 1073|  42.3k|		xmlFreeURI(uri);
 1074|  42.3k|	    }
 1075|  44.8k|	}
 1076|       |
 1077|       |	/* a standard namespace definition */
 1078|  61.1k|	nsret = xmlNewNs(ctxt->node, val, name);
 1079|  61.1k|	xmlFree(ns);
 1080|       |
 1081|  61.1k|        if (nsret == NULL) {
  ------------------
  |  Branch (1081:13): [True: 8, False: 61.1k]
  ------------------
 1082|      8|            xmlSAX2ErrMemory(ctxt);
 1083|      8|        }
 1084|  61.1k|#ifdef LIBXML_VALID_ENABLED
 1085|       |	/*
 1086|       |	 * Validate also for namespace decls, they are attributes from
 1087|       |	 * an XML-1.0 perspective
 1088|       |	 */
 1089|  61.1k|        else if (ctxt->validate && ctxt->wellFormed &&
  ------------------
  |  Branch (1089:18): [True: 6.05k, False: 55.1k]
  |  Branch (1089:36): [True: 3.42k, False: 2.62k]
  ------------------
 1090|  3.42k|	         ctxt->myDoc && ctxt->myDoc->intSubset) {
  ------------------
  |  Branch (1090:11): [True: 3.42k, False: 0]
  |  Branch (1090:26): [True: 3.42k, False: 0]
  ------------------
 1091|  3.42k|	    ctxt->valid &= xmlValidateOneNamespace(&ctxt->vctxt, ctxt->myDoc,
 1092|  3.42k|					   ctxt->node, prefix, nsret, value);
 1093|  3.42k|        }
 1094|  61.1k|#endif /* LIBXML_VALID_ENABLED */
 1095|  61.1k|	if (val != value)
  ------------------
  |  Branch (1095:6): [True: 10.7k, False: 50.4k]
  ------------------
 1096|  10.7k|	    xmlFree(val);
 1097|  61.1k|	return;
 1098|  61.1k|    }
 1099|       |
 1100|  75.0k|    if (ns != NULL) {
  ------------------
  |  Branch (1100:9): [True: 27.3k, False: 47.7k]
  ------------------
 1101|  27.3k|        int res;
 1102|       |
 1103|  27.3k|	res = xmlSearchNsSafe(ctxt->node, ns, &namespace);
 1104|  27.3k|        if (res < 0)
  ------------------
  |  Branch (1104:13): [True: 6, False: 27.3k]
  ------------------
 1105|      6|            xmlSAX2ErrMemory(ctxt);
 1106|       |
 1107|  27.3k|	if (namespace == NULL) {
  ------------------
  |  Branch (1107:6): [True: 9.16k, False: 18.1k]
  ------------------
 1108|  9.16k|	    xmlNsErrMsg(ctxt, XML_NS_ERR_UNDEFINED_NAMESPACE,
 1109|  9.16k|		    "Namespace prefix %s of attribute %s is not defined\n",
 1110|  9.16k|		             ns, name);
 1111|  18.1k|	} else {
 1112|  18.1k|            xmlAttrPtr prop;
 1113|       |
 1114|  18.1k|            prop = ctxt->node->properties;
 1115|  41.4k|            while (prop != NULL) {
  ------------------
  |  Branch (1115:20): [True: 23.4k, False: 17.9k]
  ------------------
 1116|  23.4k|                if (prop->ns != NULL) {
  ------------------
  |  Branch (1116:21): [True: 11.3k, False: 12.1k]
  ------------------
 1117|  11.3k|                    if ((xmlStrEqual(name, prop->name)) &&
  ------------------
  |  Branch (1117:25): [True: 441, False: 10.9k]
  ------------------
 1118|    441|                        ((namespace == prop->ns) ||
  ------------------
  |  Branch (1118:26): [True: 0, False: 441]
  ------------------
 1119|    441|                         (xmlStrEqual(namespace->href, prop->ns->href)))) {
  ------------------
  |  Branch (1119:26): [True: 207, False: 234]
  ------------------
 1120|    207|                        xmlCtxtErr(ctxt, NULL, XML_FROM_PARSER,
 1121|    207|                                   XML_ERR_ATTRIBUTE_REDEFINED, XML_ERR_FATAL,
 1122|    207|                                   name, NULL, NULL, 0,
 1123|    207|                                   "Attribute %s in %s redefined\n",
 1124|    207|                                   name, namespace->href);
 1125|    207|                        goto error;
 1126|    207|                    }
 1127|  11.3k|                }
 1128|  23.2k|                prop = prop->next;
 1129|  23.2k|            }
 1130|  18.1k|        }
 1131|  47.7k|    } else {
 1132|  47.7k|	namespace = NULL;
 1133|  47.7k|    }
 1134|       |
 1135|       |    /* !!!!!! <a toto:arg="" xmlns:toto="http://toto.com"> */
 1136|  74.8k|    ret = xmlNewNsProp(ctxt->node, namespace, name, NULL);
 1137|  74.8k|    if (ret == NULL) {
  ------------------
  |  Branch (1137:9): [True: 33, False: 74.8k]
  ------------------
 1138|     33|        xmlSAX2ErrMemory(ctxt);
 1139|     33|        goto error;
 1140|     33|    }
 1141|       |
 1142|  74.8k|    if (ctxt->replaceEntities == 0) {
  ------------------
  |  Branch (1142:9): [True: 37.8k, False: 36.9k]
  ------------------
 1143|  37.8k|        if (xmlNodeParseAttValue(ret->doc, ret, value, SIZE_MAX, NULL) < 0)
  ------------------
  |  Branch (1143:13): [True: 47, False: 37.8k]
  ------------------
 1144|     47|            xmlSAX2ErrMemory(ctxt);
 1145|  37.8k|    } else if (value != NULL) {
  ------------------
  |  Branch (1145:16): [True: 36.9k, False: 0]
  ------------------
 1146|  36.9k|        ret->children = xmlNewDocText(ctxt->myDoc, value);
 1147|  36.9k|        if (ret->children == NULL) {
  ------------------
  |  Branch (1147:13): [True: 31, False: 36.9k]
  ------------------
 1148|     31|            xmlSAX2ErrMemory(ctxt);
 1149|  36.9k|        } else {
 1150|  36.9k|            ret->last = ret->children;
 1151|  36.9k|            ret->children->parent = (xmlNodePtr) ret;
 1152|  36.9k|        }
 1153|  36.9k|    }
 1154|       |
 1155|  74.8k|#ifdef LIBXML_VALID_ENABLED
 1156|  74.8k|    if (ctxt->validate && ctxt->wellFormed &&
  ------------------
  |  Branch (1156:9): [True: 21.3k, False: 53.5k]
  |  Branch (1156:27): [True: 11.0k, False: 10.2k]
  ------------------
 1157|  11.0k|        ctxt->myDoc && ctxt->myDoc->intSubset) {
  ------------------
  |  Branch (1157:9): [True: 11.0k, False: 0]
  |  Branch (1157:24): [True: 11.0k, 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|  11.0k|        if (!ctxt->replaceEntities) {
  ------------------
  |  Branch (1163:13): [True: 3.91k, False: 7.15k]
  ------------------
 1164|  3.91k|	    xmlChar *val;
 1165|       |
 1166|       |            /* TODO: normalize if needed */
 1167|  3.91k|	    val = xmlExpandEntitiesInAttValue(ctxt, value, /* normalize */ 0);
 1168|       |
 1169|  3.91k|	    if (val == NULL)
  ------------------
  |  Branch (1169:10): [True: 2, False: 3.91k]
  ------------------
 1170|      2|		ctxt->valid &= xmlValidateOneAttribute(&ctxt->vctxt,
 1171|      2|				ctxt->myDoc, ctxt->node, ret, value);
 1172|  3.91k|	    else {
 1173|  3.91k|		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.91k|                nvalnorm = xmlValidCtxtNormalizeAttributeValue(
 1181|  3.91k|                                 &ctxt->vctxt, ctxt->myDoc,
 1182|  3.91k|                                 ctxt->node, fullname, val);
 1183|  3.91k|		if (nvalnorm != NULL) {
  ------------------
  |  Branch (1183:7): [True: 1.96k, False: 1.94k]
  ------------------
 1184|  1.96k|		    xmlFree(val);
 1185|  1.96k|		    val = nvalnorm;
 1186|  1.96k|		}
 1187|       |
 1188|  3.91k|		ctxt->valid &= xmlValidateOneAttribute(&ctxt->vctxt,
 1189|  3.91k|			        ctxt->myDoc, ctxt->node, ret, val);
 1190|  3.91k|                xmlFree(val);
 1191|  3.91k|	    }
 1192|  7.15k|	} 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|  7.15k|            if (ctxt->input->entity != NULL)
  ------------------
  |  Branch (1199:17): [True: 430, False: 6.72k]
  ------------------
 1200|    430|                ctxt->vctxt.flags |= XML_VCTXT_IN_ENTITY;
  ------------------
  |  |   28|    430|#define XML_VCTXT_IN_ENTITY (1u << 3)
  ------------------
 1201|       |
 1202|  7.15k|	    ctxt->valid &= xmlValidateOneAttribute(&ctxt->vctxt, ctxt->myDoc,
 1203|  7.15k|					       ctxt->node, ret, value);
 1204|       |
 1205|  7.15k|            ctxt->vctxt.flags &= ~XML_VCTXT_IN_ENTITY;
  ------------------
  |  |   28|  7.15k|#define XML_VCTXT_IN_ENTITY (1u << 3)
  ------------------
 1206|  7.15k|	}
 1207|  11.0k|    } else
 1208|  63.7k|#endif /* LIBXML_VALID_ENABLED */
 1209|  63.7k|           if (((ctxt->loadsubset & XML_SKIP_IDS) == 0) &&
  ------------------
  |  |  210|  63.7k|#define XML_SKIP_IDS		8
  ------------------
  |  Branch (1209:16): [True: 40.2k, False: 23.5k]
  ------------------
 1210|  40.2k|               (ctxt->input->entity == NULL) &&
  ------------------
  |  Branch (1210:16): [True: 38.4k, False: 1.78k]
  ------------------
 1211|       |               /* Don't create IDs containing entity references */
 1212|  38.4k|               (ret->children != NULL) &&
  ------------------
  |  Branch (1212:16): [True: 35.5k, False: 2.91k]
  ------------------
 1213|  35.5k|               (ret->children->type == XML_TEXT_NODE) &&
  ------------------
  |  Branch (1213:16): [True: 35.2k, False: 286]
  ------------------
 1214|  35.2k|               (ret->children->next == NULL)) {
  ------------------
  |  Branch (1214:16): [True: 34.9k, False: 291]
  ------------------
 1215|  34.9k|        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|  34.9k|	if (xmlStrEqual(fullname, BAD_CAST "xml:id")) {
  ------------------
  |  |   34|  34.9k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (1220:6): [True: 1.77k, False: 33.1k]
  ------------------
 1221|       |	    /*
 1222|       |	     * Add the xml:id value
 1223|       |	     *
 1224|       |	     * Open issue: normalization of the value.
 1225|       |	     */
 1226|  1.77k|	    if (xmlValidateNCName(content, 1) != 0) {
  ------------------
  |  Branch (1226:10): [True: 1.26k, False: 510]
  ------------------
 1227|  1.26k|	        xmlErrId(ctxt, XML_DTD_XMLID_VALUE,
 1228|  1.26k|		         "xml:id : attribute value %s is not an NCName\n",
 1229|  1.26k|		         content);
 1230|  1.26k|	    }
 1231|  1.77k|	    xmlAddID(&ctxt->vctxt, ctxt->myDoc, content, ret);
 1232|  33.1k|	} else {
 1233|  33.1k|            int res = xmlIsID(ctxt->myDoc, ctxt->node, ret);
 1234|       |
 1235|  33.1k|            if (res < 0)
  ------------------
  |  Branch (1235:17): [True: 1, False: 33.1k]
  ------------------
 1236|      1|                xmlCtxtErrMemory(ctxt);
 1237|  33.1k|            else if (res > 0)
  ------------------
  |  Branch (1237:22): [True: 2.09k, False: 31.0k]
  ------------------
 1238|  2.09k|                xmlAddID(&ctxt->vctxt, ctxt->myDoc, content, ret);
 1239|  31.0k|            else if (xmlIsRef(ctxt->myDoc, ctxt->node, ret))
  ------------------
  |  Branch (1239:22): [True: 9.29k, False: 21.7k]
  ------------------
 1240|  9.29k|                xmlAddRef(&ctxt->vctxt, ctxt->myDoc, content, ret);
 1241|  33.1k|        }
 1242|  34.9k|    }
 1243|       |
 1244|  75.0k|error:
 1245|  75.0k|    if (ns != NULL)
  ------------------
  |  Branch (1245:9): [True: 27.3k, False: 47.7k]
  ------------------
 1246|  27.3k|	xmlFree(ns);
 1247|  75.0k|}
SAX2.c:xmlNsErrMsg:
  942|  9.71k|{
  943|  9.71k|    xmlCtxtErr(ctxt, NULL, XML_FROM_NAMESPACE, error, XML_ERR_ERROR,
  944|       |               str1, str2, NULL, 0, msg, str1, str2);
  945|  9.71k|}
SAX2.c:xmlErrValid:
   59|  10.9k|{
   60|  10.9k|    xmlCtxtErr(ctxt, NULL, XML_FROM_DTD, error, XML_ERR_ERROR,
   61|  10.9k|               str1, str2, NULL, 0, msg, str1, str2);
   62|  10.9k|    if (ctxt != NULL)
  ------------------
  |  Branch (62:9): [True: 10.9k, False: 0]
  ------------------
   63|  10.9k|	ctxt->valid = 0;
   64|  10.9k|}
SAX2.c:xmlSAX2AppendChild:
  895|  1.82M|xmlSAX2AppendChild(xmlParserCtxtPtr ctxt, xmlNodePtr node) {
  896|  1.82M|    xmlNodePtr parent;
  897|  1.82M|    xmlNodePtr last;
  898|       |
  899|  1.82M|    if (ctxt->inSubset == 1) {
  ------------------
  |  Branch (899:9): [True: 142k, False: 1.67M]
  ------------------
  900|   142k|	parent = (xmlNodePtr) ctxt->myDoc->intSubset;
  901|  1.67M|    } else if (ctxt->inSubset == 2) {
  ------------------
  |  Branch (901:16): [True: 200k, False: 1.47M]
  ------------------
  902|   200k|	parent = (xmlNodePtr) ctxt->myDoc->extSubset;
  903|  1.47M|    } else {
  904|  1.47M|        parent = ctxt->node;
  905|  1.47M|        if (parent == NULL)
  ------------------
  |  Branch (905:13): [True: 130k, False: 1.34M]
  ------------------
  906|   130k|            parent = (xmlNodePtr) ctxt->myDoc;
  907|  1.47M|    }
  908|       |
  909|  1.82M|    last = parent->last;
  910|  1.82M|    if (last == NULL) {
  ------------------
  |  Branch (910:9): [True: 293k, False: 1.52M]
  ------------------
  911|   293k|        parent->children = node;
  912|  1.52M|    } else {
  913|  1.52M|        last->next = node;
  914|  1.52M|        node->prev = last;
  915|  1.52M|    }
  916|       |
  917|  1.82M|    parent->last = node;
  918|  1.82M|    node->parent = parent;
  919|       |
  920|  1.82M|    if ((node->type != XML_TEXT_NODE) &&
  ------------------
  |  Branch (920:9): [True: 1.43M, False: 381k]
  ------------------
  921|  1.43M|	(ctxt->input != NULL)) {
  ------------------
  |  Branch (921:2): [True: 1.43M, False: 0]
  ------------------
  922|  1.43M|        if ((unsigned) ctxt->input->line < (unsigned) USHRT_MAX)
  ------------------
  |  Branch (922:13): [True: 1.37M, False: 67.5k]
  ------------------
  923|  1.37M|            node->line = ctxt->input->line;
  924|  67.5k|        else
  925|  67.5k|            node->line = USHRT_MAX;
  926|  1.43M|    }
  927|  1.82M|}
SAX2.c:xmlNsWarnMsg:
  128|  63.1k|{
  129|  63.1k|    xmlCtxtErr(ctxt, NULL, XML_FROM_NAMESPACE, error, XML_ERR_WARNING,
  130|       |               str1, str2, NULL, 0, msg, str1, str2);
  131|  63.1k|}
SAX2.c:xmlSAX2AttributeNs:
 1908|   270k|{
 1909|   270k|    xmlAttrPtr ret;
 1910|   270k|    xmlNsPtr namespace = NULL;
 1911|   270k|    xmlChar *dup = NULL;
 1912|       |
 1913|       |    /*
 1914|       |     * Note: if prefix == NULL, the attribute is not in the default namespace
 1915|       |     */
 1916|   270k|    if (prefix != NULL) {
  ------------------
  |  Branch (1916:9): [True: 89.1k, False: 181k]
  ------------------
 1917|  89.1k|	namespace = xmlParserNsLookupSax(ctxt, prefix);
 1918|  89.1k|	if ((namespace == NULL) && (xmlStrEqual(prefix, BAD_CAST "xml"))) {
  ------------------
  |  |   34|  76.2k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (1918:6): [True: 76.2k, False: 12.9k]
  |  Branch (1918:29): [True: 76.2k, False: 36]
  ------------------
 1919|  76.2k|            int res;
 1920|       |
 1921|  76.2k|	    res = xmlSearchNsSafe(ctxt->node, prefix, &namespace);
 1922|  76.2k|            if (res < 0)
  ------------------
  |  Branch (1922:17): [True: 8, False: 76.2k]
  ------------------
 1923|      8|                xmlSAX2ErrMemory(ctxt);
 1924|  76.2k|	}
 1925|  89.1k|    }
 1926|       |
 1927|       |    /*
 1928|       |     * allocate the node
 1929|       |     */
 1930|   270k|    if (ctxt->freeAttrs != NULL) {
  ------------------
  |  Branch (1930:9): [True: 1.51k, False: 269k]
  ------------------
 1931|  1.51k|        ret = ctxt->freeAttrs;
 1932|  1.51k|	ctxt->freeAttrs = ret->next;
 1933|  1.51k|	ctxt->freeAttrsNr--;
 1934|   269k|    } else {
 1935|   269k|        ret = xmlMalloc(sizeof(*ret));
 1936|   269k|        if (ret == NULL) {
  ------------------
  |  Branch (1936:13): [True: 22, False: 269k]
  ------------------
 1937|     22|            xmlSAX2ErrMemory(ctxt);
 1938|     22|            return(NULL);
 1939|     22|        }
 1940|   269k|    }
 1941|       |
 1942|   270k|    memset(ret, 0, sizeof(xmlAttr));
 1943|   270k|    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|   270k|    ret->parent = ctxt->node;
 1955|   270k|    ret->doc = ctxt->node->doc;
 1956|   270k|    ret->ns = namespace;
 1957|       |
 1958|   270k|    if (ctxt->dictNames) {
  ------------------
  |  Branch (1958:9): [True: 171k, False: 99.8k]
  ------------------
 1959|   171k|        ret->name = localname;
 1960|   171k|    } else {
 1961|  99.8k|        ret->name = xmlStrdup(localname);
 1962|  99.8k|        if (ret->name == NULL)
  ------------------
  |  Branch (1962:13): [True: 54, False: 99.7k]
  ------------------
 1963|     54|            xmlSAX2ErrMemory(ctxt);
 1964|  99.8k|    }
 1965|       |
 1966|   270k|    if ((xmlRegisterCallbacks) && (xmlRegisterNodeDefaultValue))
  ------------------
  |  |  932|      0|    (*__xmlRegisterNodeDefaultValue())
  ------------------
  |  Branch (1966:9): [True: 0, False: 270k]
  |  Branch (1966:35): [True: 0, False: 0]
  ------------------
 1967|      0|        xmlRegisterNodeDefaultValue((xmlNodePtr)ret);
  ------------------
  |  |  932|      0|    (*__xmlRegisterNodeDefaultValue())
  ------------------
 1968|       |
 1969|   270k|    if ((ctxt->replaceEntities == 0) && (!ctxt->html)) {
  ------------------
  |  Branch (1969:9): [True: 78.0k, False: 192k]
  |  Branch (1969:41): [True: 78.0k, False: 0]
  ------------------
 1970|  78.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|  78.0k|	if (*valueend != 0) {
  ------------------
  |  Branch (1977:6): [True: 26.2k, False: 51.8k]
  ------------------
 1978|  26.2k|	    tmp = xmlSAX2TextNode(ctxt, ret->doc, value, valueend - value);
 1979|  26.2k|	    ret->children = tmp;
 1980|  26.2k|	    ret->last = tmp;
 1981|  26.2k|	    if (tmp != NULL) {
  ------------------
  |  Branch (1981:10): [True: 26.2k, False: 17]
  ------------------
 1982|  26.2k|		tmp->parent = (xmlNodePtr) ret;
 1983|  26.2k|	    }
 1984|  51.8k|	} else if (valueend > value) {
  ------------------
  |  Branch (1984:13): [True: 51.1k, False: 645]
  ------------------
 1985|  51.1k|            if (xmlNodeParseAttValue(ret->doc, ret, value, valueend - value,
  ------------------
  |  Branch (1985:17): [True: 34, False: 51.1k]
  ------------------
 1986|  51.1k|                                     NULL) < 0)
 1987|     34|                xmlSAX2ErrMemory(ctxt);
 1988|  51.1k|	}
 1989|   192k|    } else if (value != NULL) {
  ------------------
  |  Branch (1989:16): [True: 192k, False: 0]
  ------------------
 1990|   192k|	xmlNodePtr tmp;
 1991|       |
 1992|   192k|	tmp = xmlSAX2TextNode(ctxt, ret->doc, value, valueend - value);
 1993|   192k|	ret->children = tmp;
 1994|   192k|	ret->last = tmp;
 1995|   192k|	if (tmp != NULL) {
  ------------------
  |  Branch (1995:6): [True: 192k, False: 20]
  ------------------
 1996|   192k|	    tmp->parent = (xmlNodePtr) ret;
 1997|   192k|	}
 1998|   192k|    }
 1999|       |
 2000|   270k|#ifdef LIBXML_VALID_ENABLED
 2001|   270k|    if ((!ctxt->html) && ctxt->validate && ctxt->wellFormed &&
  ------------------
  |  Branch (2001:9): [True: 270k, False: 0]
  |  Branch (2001:26): [True: 117k, False: 153k]
  |  Branch (2001:44): [True: 51.2k, False: 66.0k]
  ------------------
 2002|  51.2k|        ctxt->myDoc && ctxt->myDoc->intSubset) {
  ------------------
  |  Branch (2002:9): [True: 51.2k, False: 0]
  |  Branch (2002:24): [True: 51.2k, 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|  51.2k|        if (!ctxt->replaceEntities) {
  ------------------
  |  Branch (2007:13): [True: 7.20k, False: 44.0k]
  ------------------
 2008|  7.20k|	    dup = xmlSAX2DecodeAttrEntities(ctxt, value, valueend);
 2009|  7.20k|	    if (dup == NULL) {
  ------------------
  |  Branch (2009:10): [True: 4.99k, False: 2.21k]
  ------------------
 2010|  4.99k|	        if (*valueend == 0) {
  ------------------
  |  Branch (2010:14): [True: 2.78k, False: 2.20k]
  ------------------
 2011|  2.78k|		    ctxt->valid &= xmlValidateOneAttribute(&ctxt->vctxt,
 2012|  2.78k|				    ctxt->myDoc, ctxt->node, ret, value);
 2013|  2.78k|		} 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|  2.20k|		    dup = xmlStrndup(value, valueend - value);
 2020|  2.20k|                    if (dup == NULL)
  ------------------
  |  Branch (2020:25): [True: 2, False: 2.20k]
  ------------------
 2021|      2|                        xmlSAX2ErrMemory(ctxt);
 2022|       |
 2023|  2.20k|		    ctxt->valid &= xmlValidateOneAttribute(&ctxt->vctxt,
 2024|  2.20k|				    ctxt->myDoc, ctxt->node, ret, dup);
 2025|  2.20k|		}
 2026|  4.99k|	    } 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.21k|		if (ctxt->attsSpecial != NULL) {
  ------------------
  |  Branch (2034:7): [True: 1.93k, False: 284]
  ------------------
 2035|  1.93k|		    xmlChar *nvalnorm;
 2036|  1.93k|		    xmlChar fn[50];
 2037|  1.93k|		    xmlChar *fullname;
 2038|       |
 2039|  1.93k|		    fullname = xmlBuildQName(localname, prefix, fn, 50);
 2040|  1.93k|                    if (fullname == NULL) {
  ------------------
  |  Branch (2040:25): [True: 1, False: 1.93k]
  ------------------
 2041|      1|                        xmlSAX2ErrMemory(ctxt);
 2042|  1.93k|                    } else {
 2043|  1.93k|			ctxt->vctxt.valid = 1;
 2044|  1.93k|		        nvalnorm = xmlValidCtxtNormalizeAttributeValue(
 2045|  1.93k|			                 &ctxt->vctxt, ctxt->myDoc,
 2046|  1.93k|					 ctxt->node, fullname, dup);
 2047|  1.93k|			if (ctxt->vctxt.valid != 1)
  ------------------
  |  Branch (2047:8): [True: 18, False: 1.91k]
  ------------------
 2048|     18|			    ctxt->valid = 0;
 2049|       |
 2050|  1.93k|			if ((fullname != fn) && (fullname != localname))
  ------------------
  |  Branch (2050:8): [True: 1.86k, False: 73]
  |  Branch (2050:28): [True: 755, False: 1.10k]
  ------------------
 2051|    755|			    xmlFree(fullname);
 2052|  1.93k|			if (nvalnorm != NULL) {
  ------------------
  |  Branch (2052:8): [True: 1.86k, False: 73]
  ------------------
 2053|  1.86k|			    xmlFree(dup);
 2054|  1.86k|			    dup = nvalnorm;
 2055|  1.86k|			}
 2056|  1.93k|		    }
 2057|  1.93k|		}
 2058|       |
 2059|  2.21k|		ctxt->valid &= xmlValidateOneAttribute(&ctxt->vctxt,
 2060|  2.21k|			        ctxt->myDoc, ctxt->node, ret, dup);
 2061|  2.21k|	    }
 2062|  44.0k|	} else {
 2063|       |	    /*
 2064|       |	     * if entities already have been substituted, then
 2065|       |	     * the attribute as passed is already normalized
 2066|       |	     */
 2067|  44.0k|	    dup = xmlStrndup(value, valueend - value);
 2068|  44.0k|            if (dup == NULL)
  ------------------
  |  Branch (2068:17): [True: 10, False: 43.9k]
  ------------------
 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|  44.0k|            if (ctxt->input->entity != NULL)
  ------------------
  |  Branch (2077:17): [True: 539, False: 43.4k]
  ------------------
 2078|    539|                ctxt->vctxt.flags |= XML_VCTXT_IN_ENTITY;
  ------------------
  |  |   28|    539|#define XML_VCTXT_IN_ENTITY (1u << 3)
  ------------------
 2079|       |
 2080|  44.0k|	    ctxt->valid &= xmlValidateOneAttribute(&ctxt->vctxt,
 2081|  44.0k|	                             ctxt->myDoc, ctxt->node, ret, dup);
 2082|       |
 2083|  44.0k|            ctxt->vctxt.flags &= ~XML_VCTXT_IN_ENTITY;
  ------------------
  |  |   28|  44.0k|#define XML_VCTXT_IN_ENTITY (1u << 3)
  ------------------
 2084|  44.0k|	}
 2085|  51.2k|    } else
 2086|   219k|#endif /* LIBXML_VALID_ENABLED */
 2087|   219k|           if (((ctxt->loadsubset & XML_SKIP_IDS) == 0) &&
  ------------------
  |  |  210|   219k|#define XML_SKIP_IDS		8
  ------------------
  |  Branch (2087:16): [True: 113k, False: 106k]
  ------------------
 2088|   113k|               (ctxt->input->entity == NULL) &&
  ------------------
  |  Branch (2088:16): [True: 108k, False: 4.69k]
  ------------------
 2089|       |               /* Don't create IDs containing entity references */
 2090|   108k|               (ret->children != NULL) &&
  ------------------
  |  Branch (2090:16): [True: 108k, False: 315]
  ------------------
 2091|   108k|               (ret->children->type == XML_TEXT_NODE) &&
  ------------------
  |  Branch (2091:16): [True: 107k, False: 560]
  ------------------
 2092|   107k|               (ret->children->next == NULL)) {
  ------------------
  |  Branch (2092:16): [True: 107k, False: 253]
  ------------------
 2093|   107k|        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|   107k|        if ((prefix == ctxt->str_xml) &&
  ------------------
  |  Branch (2098:13): [True: 22.7k, False: 84.8k]
  ------------------
 2099|  22.7k|	           (localname[0] == 'i') && (localname[1] == 'd') &&
  ------------------
  |  Branch (2099:13): [True: 1.59k, False: 21.1k]
  |  Branch (2099:38): [True: 1.30k, False: 292]
  ------------------
 2100|  1.30k|		   (localname[2] == 0)) {
  ------------------
  |  Branch (2100:6): [True: 1.03k, False: 272]
  ------------------
 2101|       |	    /*
 2102|       |	     * Add the xml:id value
 2103|       |	     *
 2104|       |	     * Open issue: normalization of the value.
 2105|       |	     */
 2106|  1.03k|	    if (xmlValidateNCName(content, 1) != 0) {
  ------------------
  |  Branch (2106:10): [True: 691, False: 341]
  ------------------
 2107|    691|	        xmlErrId(ctxt, XML_DTD_XMLID_VALUE,
 2108|    691|                         "xml:id : attribute value %s is not an NCName\n",
 2109|    691|                         content);
 2110|    691|	    }
 2111|  1.03k|	    xmlAddID(&ctxt->vctxt, ctxt->myDoc, content, ret);
 2112|   106k|	} else {
 2113|   106k|            int res = xmlIsID(ctxt->myDoc, ctxt->node, ret);
 2114|       |
 2115|   106k|            if (res < 0)
  ------------------
  |  Branch (2115:17): [True: 2, False: 106k]
  ------------------
 2116|      2|                xmlCtxtErrMemory(ctxt);
 2117|   106k|            else if (res > 0)
  ------------------
  |  Branch (2117:22): [True: 3.15k, False: 103k]
  ------------------
 2118|  3.15k|                xmlAddID(&ctxt->vctxt, ctxt->myDoc, content, ret);
 2119|   103k|            else if (xmlIsRef(ctxt->myDoc, ctxt->node, ret))
  ------------------
  |  Branch (2119:22): [True: 25.7k, False: 77.7k]
  ------------------
 2120|  25.7k|                xmlAddRef(&ctxt->vctxt, ctxt->myDoc, content, ret);
 2121|   106k|	}
 2122|   107k|    }
 2123|   270k|    if (dup != NULL)
  ------------------
  |  Branch (2123:9): [True: 48.4k, False: 222k]
  ------------------
 2124|  48.4k|	xmlFree(dup);
 2125|       |
 2126|   270k|    return(ret);
 2127|   270k|}
SAX2.c:xmlSAX2TextNode:
 1783|   736k|                int len) {
 1784|   736k|    xmlNodePtr ret;
 1785|   736k|    const xmlChar *intern = NULL;
 1786|       |
 1787|       |    /*
 1788|       |     * Allocate
 1789|       |     */
 1790|   736k|    if (ctxt->freeElems != NULL) {
  ------------------
  |  Branch (1790:9): [True: 2.53k, False: 733k]
  ------------------
 1791|  2.53k|	ret = ctxt->freeElems;
 1792|  2.53k|	ctxt->freeElems = ret->next;
 1793|  2.53k|	ctxt->freeElemsNr--;
 1794|   733k|    } else {
 1795|   733k|	ret = (xmlNodePtr) xmlMalloc(sizeof(xmlNode));
 1796|   733k|    }
 1797|   736k|    if (ret == NULL) {
  ------------------
  |  Branch (1797:9): [True: 64, False: 736k]
  ------------------
 1798|     64|        xmlCtxtErrMemory(ctxt);
 1799|     64|	return(NULL);
 1800|     64|    }
 1801|   736k|    memset(ret, 0, sizeof(xmlNode));
 1802|       |    /*
 1803|       |     * intern the formatting blanks found between tags, or the
 1804|       |     * very short strings
 1805|       |     */
 1806|   736k|    if ((!ctxt->html) && (ctxt->dictNames)) {
  ------------------
  |  Branch (1806:9): [True: 736k, False: 0]
  |  Branch (1806:26): [True: 361k, False: 375k]
  ------------------
 1807|   361k|        xmlChar cur = str[len];
 1808|       |
 1809|   361k|	if ((len < (int) (2 * sizeof(void *))) &&
  ------------------
  |  Branch (1809:6): [True: 298k, False: 62.8k]
  ------------------
 1810|   298k|	    (ctxt->options & XML_PARSE_COMPACT)) {
  ------------------
  |  Branch (1810:6): [True: 298k, False: 0]
  ------------------
 1811|       |	    /* store the string in the node overriding properties and nsDef */
 1812|   298k|	    xmlChar *tmp = (xmlChar *) &(ret->properties);
 1813|   298k|	    memcpy(tmp, str, len);
 1814|   298k|	    tmp[len] = 0;
 1815|   298k|	    intern = tmp;
 1816|   298k|	} else if ((len <= 3) && ((cur == '"') || (cur == '\'') ||
  ------------------
  |  Branch (1816:13): [True: 0, False: 62.8k]
  |  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|  62.8k|	} else if (IS_BLANK_CH(*str) && (len < 60) && (cur == '<') &&
  ------------------
  |  |  137|  62.8k|#define IS_BLANK_CH(c)  xmlIsBlank_ch(c)
  |  |  ------------------
  |  |  |  |   90|   125k|#define xmlIsBlank_ch(c)	(((c) == 0x20) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (90:27): [True: 3.71k, False: 59.1k]
  |  |  |  |  ------------------
  |  |  |  |   91|  62.8k|				 ((0x9 <= (c)) && ((c) <= 0xa)) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (91:7): [True: 58.9k, False: 208]
  |  |  |  |  |  Branch (91:23): [True: 4.29k, False: 54.6k]
  |  |  |  |  ------------------
  |  |  |  |   92|   125k|				 ((c) == 0xd))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (92:6): [True: 204, False: 54.6k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (1824:34): [True: 6.91k, False: 1.29k]
  |  Branch (1824:48): [True: 5.96k, False: 947]
  ------------------
 1825|  5.96k|	           (str[len + 1] != '!')) {
  ------------------
  |  Branch (1825:13): [True: 4.82k, False: 1.13k]
  ------------------
 1826|  4.82k|	    int i;
 1827|       |
 1828|  58.9k|	    for (i = 1;i < len;i++) {
  ------------------
  |  Branch (1828:17): [True: 56.7k, False: 2.24k]
  ------------------
 1829|  56.7k|		if (!IS_BLANK_CH(str[i])) goto skip;
  ------------------
  |  |  137|  56.7k|#define IS_BLANK_CH(c)  xmlIsBlank_ch(c)
  |  |  ------------------
  |  |  |  |   90|  56.7k|#define xmlIsBlank_ch(c)	(((c) == 0x20) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (90:27): [True: 34.6k, False: 22.0k]
  |  |  |  |  ------------------
  |  |  |  |   91|  56.7k|				 ((0x9 <= (c)) && ((c) <= 0xa)) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (91:7): [True: 22.0k, False: 0]
  |  |  |  |  |  Branch (91:23): [True: 19.4k, False: 2.58k]
  |  |  |  |  ------------------
  |  |  |  |   92|  56.7k|				 ((c) == 0xd))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (92:6): [True: 0, False: 2.58k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1830|  56.7k|	    }
 1831|  2.24k|	    intern = xmlDictLookup(ctxt->dict, str, len);
 1832|  2.24k|            if (intern == NULL) {
  ------------------
  |  Branch (1832:17): [True: 1, False: 2.24k]
  ------------------
 1833|      1|                xmlSAX2ErrMemory(ctxt);
 1834|      1|                xmlFree(ret);
 1835|      1|                return(NULL);
 1836|      1|            }
 1837|  2.24k|	}
 1838|   361k|    }
 1839|   736k|skip:
 1840|   736k|    ret->type = XML_TEXT_NODE;
 1841|   736k|    ret->doc = doc;
 1842|       |
 1843|   736k|    ret->name = xmlStringText;
 1844|   736k|    if (intern == NULL) {
  ------------------
  |  Branch (1844:9): [True: 435k, False: 300k]
  ------------------
 1845|   435k|	ret->content = xmlStrndup(str, len);
 1846|   435k|	if (ret->content == NULL) {
  ------------------
  |  Branch (1846:6): [True: 43, False: 435k]
  ------------------
 1847|     43|	    xmlSAX2ErrMemory(ctxt);
 1848|     43|	    xmlFree(ret);
 1849|     43|	    return(NULL);
 1850|     43|	}
 1851|   435k|    } else
 1852|   300k|	ret->content = (xmlChar *) intern;
 1853|       |
 1854|   736k|    if ((xmlRegisterCallbacks) && (xmlRegisterNodeDefaultValue))
  ------------------
  |  |  932|      0|    (*__xmlRegisterNodeDefaultValue())
  ------------------
  |  Branch (1854:9): [True: 0, False: 736k]
  |  Branch (1854:35): [True: 0, False: 0]
  ------------------
 1855|      0|	xmlRegisterNodeDefaultValue(ret);
  ------------------
  |  |  932|      0|    (*__xmlRegisterNodeDefaultValue())
  ------------------
 1856|   736k|    return(ret);
 1857|   736k|}
SAX2.c:xmlSAX2DecodeAttrEntities:
 1871|  7.20k|                          const xmlChar *end) {
 1872|  7.20k|    const xmlChar *in;
 1873|       |
 1874|  7.20k|    in = str;
 1875|  62.8k|    while (in < end)
  ------------------
  |  Branch (1875:12): [True: 57.9k, False: 4.98k]
  ------------------
 1876|  57.9k|        if (*in++ == '&')
  ------------------
  |  Branch (1876:13): [True: 2.21k, False: 55.6k]
  ------------------
 1877|  2.21k|	    goto decode;
 1878|  4.98k|    return(NULL);
 1879|  2.21k|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.21k|    return(xmlExpandEntitiesInAttValue(ctxt, str, /* normalize */ 0));
 1886|  7.20k|}
SAX2.c:xmlSAX2Text:
 2473|   780k|{
 2474|   780k|    xmlNodePtr lastChild;
 2475|   780k|    xmlNodePtr parent;
 2476|       |
 2477|   780k|    if (ctxt == NULL)
  ------------------
  |  Branch (2477:9): [True: 0, False: 780k]
  ------------------
 2478|      0|        return;
 2479|       |
 2480|   780k|    parent = ctxt->node;
 2481|   780k|    if (parent == NULL)
  ------------------
  |  Branch (2481:9): [True: 0, False: 780k]
  ------------------
 2482|      0|        return;
 2483|   780k|    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|   780k|    if ((lastChild == NULL) ||
  ------------------
  |  Branch (2492:9): [True: 135k, False: 644k]
  ------------------
 2493|   644k|        (lastChild->type != type) ||
  ------------------
  |  Branch (2493:9): [True: 414k, False: 229k]
  ------------------
 2494|   551k|        ((!ctxt->html) && (type != XML_TEXT_NODE))) {
  ------------------
  |  Branch (2494:10): [True: 229k, False: 0]
  |  Branch (2494:27): [True: 563, False: 229k]
  ------------------
 2495|   551k|        xmlNode *node;
 2496|       |
 2497|   551k|        if (type == XML_TEXT_NODE)
  ------------------
  |  Branch (2497:13): [True: 517k, False: 34.0k]
  ------------------
 2498|   517k|            node = xmlSAX2TextNode(ctxt, parent->doc, ch, len);
 2499|  34.0k|        else
 2500|  34.0k|            node = xmlNewCDataBlock(parent->doc, ch, len);
 2501|   551k|	if (node == NULL) {
  ------------------
  |  Branch (2501:6): [True: 76, False: 551k]
  ------------------
 2502|     76|	    xmlSAX2ErrMemory(ctxt);
 2503|     76|	    return;
 2504|     76|	}
 2505|       |
 2506|   551k|        if (lastChild == NULL) {
  ------------------
  |  Branch (2506:13): [True: 135k, False: 415k]
  ------------------
 2507|   135k|            parent->children = node;
 2508|   135k|            parent->last = node;
 2509|   135k|            node->parent = parent;
 2510|   415k|        } else {
 2511|   415k|            xmlSAX2AppendChild(ctxt, node);
 2512|   415k|        }
 2513|       |
 2514|   551k|        ctxt->nodelen = len;
 2515|   551k|        ctxt->nodemem = len + 1;
 2516|   551k|        lastChild = node;
 2517|   551k|    } else {
 2518|   229k|        xmlChar *content;
 2519|   229k|        int oldSize, newSize, capacity;
 2520|   229k|        int maxSize = (ctxt->options & XML_PARSE_HUGE) ?
  ------------------
  |  Branch (2520:23): [True: 113k, False: 115k]
  ------------------
 2521|   113k|                      XML_MAX_HUGE_LENGTH :
  ------------------
  |  |   55|   113k|#define XML_MAX_HUGE_LENGTH 1000000000
  ------------------
 2522|   229k|                      XML_MAX_TEXT_LENGTH;
  ------------------
  |  |   50|   115k|#define XML_MAX_TEXT_LENGTH 10000000
  ------------------
 2523|       |
 2524|   229k|        content = lastChild->content;
 2525|   229k|        oldSize = ctxt->nodelen;
 2526|   229k|        capacity = ctxt->nodemem;
 2527|       |
 2528|       |        /* Shouldn't happen */
 2529|   229k|        if ((content == NULL) || (capacity <= 0)) {
  ------------------
  |  Branch (2529:13): [True: 0, False: 229k]
  |  Branch (2529:34): [True: 0, False: 229k]
  ------------------
 2530|      0|            xmlFatalErr(ctxt, XML_ERR_INTERNAL_ERROR,
 2531|      0|                        "xmlSAX2Text: no content");
 2532|      0|            return;
 2533|      0|        }
 2534|       |
 2535|   229k|        if ((len > maxSize) || (oldSize > maxSize - len)) {
  ------------------
  |  Branch (2535:13): [True: 0, False: 229k]
  |  Branch (2535:32): [True: 0, False: 229k]
  ------------------
 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|   229k|        newSize = oldSize + len;
 2542|       |
 2543|   229k|        if (newSize >= capacity) {
  ------------------
  |  Branch (2543:13): [True: 85.1k, False: 143k]
  ------------------
 2544|  85.1k|            if (newSize <= 20)
  ------------------
  |  Branch (2544:17): [True: 46.2k, False: 38.8k]
  ------------------
 2545|  46.2k|                capacity = 40;
 2546|  38.8k|            else
 2547|  38.8k|                capacity = newSize > INT_MAX / 2 ? INT_MAX : newSize * 2;
  ------------------
  |  Branch (2547:28): [True: 0, False: 38.8k]
  ------------------
 2548|       |
 2549|       |            /*
 2550|       |             * If the content was stored in properties or in
 2551|       |             * the dictionary, don't realloc.
 2552|       |             */
 2553|  85.1k|            if ((content == (xmlChar *) &lastChild->properties) ||
  ------------------
  |  Branch (2553:17): [True: 21.4k, False: 63.6k]
  ------------------
 2554|  63.6k|                ((ctxt->nodemem == oldSize + 1) &&
  ------------------
  |  Branch (2554:18): [True: 44.1k, False: 19.5k]
  ------------------
 2555|  44.1k|                 (xmlDictOwns(ctxt->dict, content)))) {
  ------------------
  |  Branch (2555:18): [True: 385, False: 43.7k]
  ------------------
 2556|  21.8k|                xmlChar *newContent;
 2557|       |
 2558|  21.8k|                newContent = xmlMalloc(capacity);
 2559|  21.8k|                if (newContent == NULL) {
  ------------------
  |  Branch (2559:21): [True: 10, False: 21.8k]
  ------------------
 2560|     10|                    xmlSAX2ErrMemory(ctxt);
 2561|     10|                    return;
 2562|     10|                }
 2563|       |
 2564|  21.8k|                memcpy(newContent, content, oldSize);
 2565|  21.8k|                lastChild->properties = NULL;
 2566|  21.8k|                content = newContent;
 2567|  63.2k|            } else {
 2568|  63.2k|                content = xmlRealloc(content, capacity);
 2569|  63.2k|                if (content == NULL) {
  ------------------
  |  Branch (2569:21): [True: 10, False: 63.2k]
  ------------------
 2570|     10|                    xmlSAX2ErrMemory(ctxt);
 2571|     10|                    return;
 2572|     10|                }
 2573|  63.2k|            }
 2574|       |
 2575|  85.0k|            ctxt->nodemem = capacity;
 2576|  85.0k|            lastChild->content = content;
 2577|  85.0k|        }
 2578|       |
 2579|   229k|        memcpy(&content[oldSize], ch, len);
 2580|   229k|        content[newSize] = 0;
 2581|   229k|        ctxt->nodelen = newSize;
 2582|   229k|    }
 2583|       |
 2584|   780k|    if ((lastChild != NULL) &&
  ------------------
  |  Branch (2584:9): [True: 780k, False: 0]
  ------------------
 2585|   780k|        (type == XML_TEXT_NODE) &&
  ------------------
  |  Branch (2585:9): [True: 746k, False: 34.0k]
  ------------------
 2586|   746k|        (ctxt->input != NULL)) {
  ------------------
  |  Branch (2586:9): [True: 746k, False: 0]
  ------------------
 2587|   746k|        if ((unsigned) ctxt->input->line < (unsigned) USHRT_MAX)
  ------------------
  |  Branch (2587:13): [True: 695k, False: 50.4k]
  ------------------
 2588|   695k|            lastChild->line = ctxt->input->line;
 2589|  50.4k|        else {
 2590|  50.4k|            lastChild->line = USHRT_MAX;
 2591|  50.4k|            if (ctxt->options & XML_PARSE_BIG_LINES)
  ------------------
  |  Branch (2591:17): [True: 20.7k, False: 29.6k]
  ------------------
 2592|  20.7k|                lastChild->psvi = XML_INT_TO_PTR(ctxt->input->line);
  ------------------
  |  |   59|  20.7k|#define XML_INT_TO_PTR(i) ((void *) (XML_INTPTR_T) (i))
  ------------------
 2593|  50.4k|        }
 2594|   746k|    }
 2595|   780k|}

xmlBufCreate:
   85|   373k|xmlBufCreate(size_t size) {
   86|   373k|    xmlBufPtr ret;
   87|       |
   88|   373k|    if (size == SIZE_MAX)
  ------------------
  |  Branch (88:9): [True: 0, False: 373k]
  ------------------
   89|      0|        return(NULL);
   90|       |
   91|   373k|    ret = xmlMalloc(sizeof(*ret));
   92|   373k|    if (ret == NULL)
  ------------------
  |  Branch (92:9): [True: 97, False: 373k]
  ------------------
   93|     97|        return(NULL);
   94|       |
   95|   373k|    ret->use = 0;
   96|   373k|    ret->flags = 0;
   97|   373k|    ret->size = size;
   98|   373k|    ret->maxSize = SIZE_MAX - 1;
   99|       |
  100|   373k|    ret->mem = xmlMalloc(ret->size + 1);
  101|   373k|    if (ret->mem == NULL) {
  ------------------
  |  Branch (101:9): [True: 94, False: 373k]
  ------------------
  102|     94|        xmlFree(ret);
  103|     94|        return(NULL);
  104|     94|    }
  105|   373k|    ret->content = ret->mem;
  106|   373k|    ret->content[0] = 0;
  107|       |
  108|   373k|    return(ret);
  109|   373k|}
xmlBufCreateMem:
  125|   296k|xmlBufCreateMem(const xmlChar *mem, size_t size, int isStatic) {
  126|   296k|    xmlBufPtr ret;
  127|       |
  128|   296k|    if (mem == NULL)
  ------------------
  |  Branch (128:9): [True: 0, False: 296k]
  ------------------
  129|      0|        return(NULL);
  130|       |
  131|   296k|    ret = xmlMalloc(sizeof(*ret));
  132|   296k|    if (ret == NULL)
  ------------------
  |  Branch (132:9): [True: 26, False: 296k]
  ------------------
  133|     26|        return(NULL);
  134|       |
  135|   296k|    if (isStatic) {
  ------------------
  |  Branch (135:9): [True: 260k, False: 36.4k]
  ------------------
  136|       |        /* Check that memory is zero-terminated */
  137|   260k|        if (mem[size] != 0) {
  ------------------
  |  Branch (137:13): [True: 0, False: 260k]
  ------------------
  138|      0|            xmlFree(ret);
  139|      0|            return(NULL);
  140|      0|        }
  141|   260k|        ret->flags = BUF_FLAG_STATIC;
  ------------------
  |  |   32|   260k|#define BUF_FLAG_STATIC     (1u << 2)
  ------------------
  142|   260k|        ret->mem = (xmlChar *) mem;
  143|   260k|    } else {
  144|  36.4k|        ret->flags = 0;
  145|  36.4k|        ret->mem = xmlMalloc(size + 1);
  146|  36.4k|        if (ret->mem == NULL) {
  ------------------
  |  Branch (146:13): [True: 5, False: 36.4k]
  ------------------
  147|      5|            xmlFree(ret);
  148|      5|            return(NULL);
  149|      5|        }
  150|  36.4k|        memcpy(ret->mem, mem, size);
  151|  36.4k|        ret->mem[size] = 0;
  152|  36.4k|    }
  153|       |
  154|   296k|    ret->use = size;
  155|   296k|    ret->size = size;
  156|   296k|    ret->maxSize = SIZE_MAX - 1;
  157|   296k|    ret->content = ret->mem;
  158|       |
  159|   296k|    return(ret);
  160|   296k|}
xmlBufDetach:
  174|   297k|xmlBufDetach(xmlBuf *buf) {
  175|   297k|    xmlChar *ret;
  176|       |
  177|   297k|    if ((buf == NULL) || (BUF_ERROR(buf)) || (BUF_STATIC(buf)))
  ------------------
  |  |   34|   297k|#define BUF_ERROR(buf) ((buf)->flags & (BUF_FLAG_OOM | BUF_FLAG_OVERFLOW))
  |  |  ------------------
  |  |  |  |   30|   297k|#define BUF_FLAG_OOM        (1u << 0)
  |  |  ------------------
  |  |               #define BUF_ERROR(buf) ((buf)->flags & (BUF_FLAG_OOM | BUF_FLAG_OVERFLOW))
  |  |  ------------------
  |  |  |  |   31|   297k|#define BUF_FLAG_OVERFLOW   (1u << 1)
  |  |  ------------------
  ------------------
                  if ((buf == NULL) || (BUF_ERROR(buf)) || (BUF_STATIC(buf)))
  ------------------
  |  |   35|   297k|#define BUF_STATIC(buf) ((buf)->flags & BUF_FLAG_STATIC)
  |  |  ------------------
  |  |  |  |   32|   297k|#define BUF_FLAG_STATIC     (1u << 2)
  |  |  ------------------
  ------------------
  |  Branch (177:9): [True: 0, False: 297k]
  |  Branch (177:26): [True: 36, False: 297k]
  |  Branch (177:46): [True: 0, False: 297k]
  ------------------
  178|     36|        return(NULL);
  179|       |
  180|   297k|    if (buf->content != buf->mem) {
  ------------------
  |  Branch (180:9): [True: 0, False: 297k]
  ------------------
  181|      0|        ret = xmlStrndup(buf->content, buf->use);
  182|      0|        xmlFree(buf->mem);
  183|   297k|    } else {
  184|   297k|        ret = buf->mem;
  185|   297k|    }
  186|       |
  187|   297k|    buf->content = NULL;
  188|   297k|    buf->mem = NULL;
  189|   297k|    buf->size = 0;
  190|   297k|    buf->use = 0;
  191|       |
  192|   297k|    return ret;
  193|   297k|}
xmlBufFree:
  201|   670k|xmlBufFree(xmlBuf *buf) {
  202|   670k|    if (buf == NULL)
  ------------------
  |  Branch (202:9): [True: 0, False: 670k]
  ------------------
  203|      0|	return;
  204|       |
  205|   670k|    if (!BUF_STATIC(buf))
  ------------------
  |  |   35|   670k|#define BUF_STATIC(buf) ((buf)->flags & BUF_FLAG_STATIC)
  |  |  ------------------
  |  |  |  |   32|   670k|#define BUF_FLAG_STATIC     (1u << 2)
  |  |  ------------------
  ------------------
  |  Branch (205:9): [True: 410k, False: 260k]
  ------------------
  206|   410k|        xmlFree(buf->mem);
  207|   670k|    xmlFree(buf);
  208|   670k|}
xmlBufEmpty:
  216|    815|xmlBufEmpty(xmlBuf *buf) {
  217|    815|    if ((buf == NULL) || (BUF_ERROR(buf)) || (BUF_STATIC(buf)))
  ------------------
  |  |   34|    815|#define BUF_ERROR(buf) ((buf)->flags & (BUF_FLAG_OOM | BUF_FLAG_OVERFLOW))
  |  |  ------------------
  |  |  |  |   30|    815|#define BUF_FLAG_OOM        (1u << 0)
  |  |  ------------------
  |  |               #define BUF_ERROR(buf) ((buf)->flags & (BUF_FLAG_OOM | BUF_FLAG_OVERFLOW))
  |  |  ------------------
  |  |  |  |   31|    815|#define BUF_FLAG_OVERFLOW   (1u << 1)
  |  |  ------------------
  ------------------
                  if ((buf == NULL) || (BUF_ERROR(buf)) || (BUF_STATIC(buf)))
  ------------------
  |  |   35|    815|#define BUF_STATIC(buf) ((buf)->flags & BUF_FLAG_STATIC)
  |  |  ------------------
  |  |  |  |   32|    815|#define BUF_FLAG_STATIC     (1u << 2)
  |  |  ------------------
  ------------------
  |  Branch (217:9): [True: 0, False: 815]
  |  Branch (217:26): [True: 0, False: 815]
  |  Branch (217:46): [True: 0, False: 815]
  ------------------
  218|      0|        return;
  219|    815|    if (buf->mem == NULL)
  ------------------
  |  Branch (219:9): [True: 0, False: 815]
  ------------------
  220|      0|        return;
  221|       |
  222|    815|    buf->use = 0;
  223|    815|    buf->size += buf->content - buf->mem;
  224|    815|    buf->content = buf->mem;
  225|    815|    buf->content[0] = 0;
  226|    815|}
xmlBufShrink:
  242|  7.38M|xmlBufShrink(xmlBuf *buf, size_t len) {
  243|  7.38M|    if ((buf == NULL) || (BUF_ERROR(buf)))
  ------------------
  |  |   34|  7.38M|#define BUF_ERROR(buf) ((buf)->flags & (BUF_FLAG_OOM | BUF_FLAG_OVERFLOW))
  |  |  ------------------
  |  |  |  |   30|  7.38M|#define BUF_FLAG_OOM        (1u << 0)
  |  |  ------------------
  |  |               #define BUF_ERROR(buf) ((buf)->flags & (BUF_FLAG_OOM | BUF_FLAG_OVERFLOW))
  |  |  ------------------
  |  |  |  |   31|  7.38M|#define BUF_FLAG_OVERFLOW   (1u << 1)
  |  |  ------------------
  ------------------
  |  Branch (243:9): [True: 0, False: 7.38M]
  |  Branch (243:26): [True: 224, False: 7.38M]
  ------------------
  244|    224|        return(0);
  245|  7.38M|    if (len == 0)
  ------------------
  |  Branch (245:9): [True: 92.4k, False: 7.29M]
  ------------------
  246|  92.4k|        return(0);
  247|       |
  248|  7.29M|    if (len > buf->use)
  ------------------
  |  Branch (248:9): [True: 0, False: 7.29M]
  ------------------
  249|      0|        return(0);
  250|       |
  251|  7.29M|    buf->use -= len;
  252|  7.29M|    buf->content += len;
  253|  7.29M|    buf->size -= len;
  254|       |
  255|  7.29M|    return(len);
  256|  7.29M|}
xmlBufGrow:
  339|  4.18k|xmlBufGrow(xmlBuf *buf, size_t len) {
  340|  4.18k|    if ((buf == NULL) || (BUF_ERROR(buf)) || (BUF_STATIC(buf)))
  ------------------
  |  |   34|  4.18k|#define BUF_ERROR(buf) ((buf)->flags & (BUF_FLAG_OOM | BUF_FLAG_OVERFLOW))
  |  |  ------------------
  |  |  |  |   30|  4.18k|#define BUF_FLAG_OOM        (1u << 0)
  |  |  ------------------
  |  |               #define BUF_ERROR(buf) ((buf)->flags & (BUF_FLAG_OOM | BUF_FLAG_OVERFLOW))
  |  |  ------------------
  |  |  |  |   31|  4.18k|#define BUF_FLAG_OVERFLOW   (1u << 1)
  |  |  ------------------
  ------------------
                  if ((buf == NULL) || (BUF_ERROR(buf)) || (BUF_STATIC(buf)))
  ------------------
  |  |   35|  4.18k|#define BUF_STATIC(buf) ((buf)->flags & BUF_FLAG_STATIC)
  |  |  ------------------
  |  |  |  |   32|  4.18k|#define BUF_FLAG_STATIC     (1u << 2)
  |  |  ------------------
  ------------------
  |  Branch (340:9): [True: 0, False: 4.18k]
  |  Branch (340:26): [True: 0, False: 4.18k]
  |  Branch (340:46): [True: 0, False: 4.18k]
  ------------------
  341|      0|        return(-1);
  342|       |
  343|  4.18k|    if (len <= buf->size - buf->use)
  ------------------
  |  Branch (343:9): [True: 0, False: 4.18k]
  ------------------
  344|      0|        return(0);
  345|       |
  346|  4.18k|    if (xmlBufGrowInternal(buf, len) < 0)
  ------------------
  |  Branch (346:9): [True: 10, False: 4.17k]
  ------------------
  347|     10|        return(-1);
  348|       |
  349|  4.17k|    return(0);
  350|  4.18k|}
xmlBufContent:
  360|   738k|{
  361|   738k|    if ((!buf) || (BUF_ERROR(buf)))
  ------------------
  |  |   34|   738k|#define BUF_ERROR(buf) ((buf)->flags & (BUF_FLAG_OOM | BUF_FLAG_OVERFLOW))
  |  |  ------------------
  |  |  |  |   30|   738k|#define BUF_FLAG_OOM        (1u << 0)
  |  |  ------------------
  |  |               #define BUF_ERROR(buf) ((buf)->flags & (BUF_FLAG_OOM | BUF_FLAG_OVERFLOW))
  |  |  ------------------
  |  |  |  |   31|   738k|#define BUF_FLAG_OVERFLOW   (1u << 1)
  |  |  ------------------
  ------------------
  |  Branch (361:9): [True: 0, False: 738k]
  |  Branch (361:19): [True: 1, False: 738k]
  ------------------
  362|      1|        return NULL;
  363|       |
  364|   738k|    return(buf->content);
  365|   738k|}
xmlBufEnd:
  375|   156k|{
  376|   156k|    if ((!buf) || (BUF_ERROR(buf)))
  ------------------
  |  |   34|   156k|#define BUF_ERROR(buf) ((buf)->flags & (BUF_FLAG_OOM | BUF_FLAG_OVERFLOW))
  |  |  ------------------
  |  |  |  |   30|   156k|#define BUF_FLAG_OOM        (1u << 0)
  |  |  ------------------
  |  |               #define BUF_ERROR(buf) ((buf)->flags & (BUF_FLAG_OOM | BUF_FLAG_OVERFLOW))
  |  |  ------------------
  |  |  |  |   31|   156k|#define BUF_FLAG_OVERFLOW   (1u << 1)
  |  |  ------------------
  ------------------
  |  Branch (376:9): [True: 0, False: 156k]
  |  Branch (376:19): [True: 0, False: 156k]
  ------------------
  377|      0|        return NULL;
  378|       |
  379|   156k|    return(&buf->content[buf->use]);
  380|   156k|}
xmlBufAddLen:
  393|   156k|xmlBufAddLen(xmlBuf *buf, size_t len) {
  394|   156k|    if ((buf == NULL) || (BUF_ERROR(buf)) || (BUF_STATIC(buf)))
  ------------------
  |  |   34|   156k|#define BUF_ERROR(buf) ((buf)->flags & (BUF_FLAG_OOM | BUF_FLAG_OVERFLOW))
  |  |  ------------------
  |  |  |  |   30|   156k|#define BUF_FLAG_OOM        (1u << 0)
  |  |  ------------------
  |  |               #define BUF_ERROR(buf) ((buf)->flags & (BUF_FLAG_OOM | BUF_FLAG_OVERFLOW))
  |  |  ------------------
  |  |  |  |   31|   156k|#define BUF_FLAG_OVERFLOW   (1u << 1)
  |  |  ------------------
  ------------------
                  if ((buf == NULL) || (BUF_ERROR(buf)) || (BUF_STATIC(buf)))
  ------------------
  |  |   35|   156k|#define BUF_STATIC(buf) ((buf)->flags & BUF_FLAG_STATIC)
  |  |  ------------------
  |  |  |  |   32|   156k|#define BUF_FLAG_STATIC     (1u << 2)
  |  |  ------------------
  ------------------
  |  Branch (394:9): [True: 0, False: 156k]
  |  Branch (394:26): [True: 0, False: 156k]
  |  Branch (394:46): [True: 0, False: 156k]
  ------------------
  395|      0|        return(-1);
  396|   156k|    if (len > buf->size - buf->use)
  ------------------
  |  Branch (396:9): [True: 0, False: 156k]
  ------------------
  397|      0|        return(-1);
  398|   156k|    buf->use += len;
  399|   156k|    buf->content[buf->use] = 0;
  400|   156k|    return(0);
  401|   156k|}
xmlBufUse:
  411|  1.51M|{
  412|  1.51M|    if ((!buf) || (BUF_ERROR(buf)))
  ------------------
  |  |   34|  1.51M|#define BUF_ERROR(buf) ((buf)->flags & (BUF_FLAG_OOM | BUF_FLAG_OVERFLOW))
  |  |  ------------------
  |  |  |  |   30|  1.51M|#define BUF_FLAG_OOM        (1u << 0)
  |  |  ------------------
  |  |               #define BUF_ERROR(buf) ((buf)->flags & (BUF_FLAG_OOM | BUF_FLAG_OVERFLOW))
  |  |  ------------------
  |  |  |  |   31|  1.51M|#define BUF_FLAG_OVERFLOW   (1u << 1)
  |  |  ------------------
  ------------------
  |  Branch (412:9): [True: 12, False: 1.51M]
  |  Branch (412:19): [True: 0, False: 1.51M]
  ------------------
  413|     12|        return 0;
  414|       |
  415|  1.51M|    return(buf->use);
  416|  1.51M|}
xmlBufAvail:
  426|   156k|{
  427|   156k|    if ((!buf) || (BUF_ERROR(buf)))
  ------------------
  |  |   34|   156k|#define BUF_ERROR(buf) ((buf)->flags & (BUF_FLAG_OOM | BUF_FLAG_OVERFLOW))
  |  |  ------------------
  |  |  |  |   30|   156k|#define BUF_FLAG_OOM        (1u << 0)
  |  |  ------------------
  |  |               #define BUF_ERROR(buf) ((buf)->flags & (BUF_FLAG_OOM | BUF_FLAG_OVERFLOW))
  |  |  ------------------
  |  |  |  |   31|   156k|#define BUF_FLAG_OVERFLOW   (1u << 1)
  |  |  ------------------
  ------------------
  |  Branch (427:9): [True: 0, False: 156k]
  |  Branch (427:19): [True: 0, False: 156k]
  ------------------
  428|      0|        return 0;
  429|       |
  430|   156k|    return(buf->size - buf->use);
  431|   156k|}
xmlBufIsEmpty:
  441|   103k|{
  442|   103k|    if ((!buf) || (BUF_ERROR(buf)))
  ------------------
  |  |   34|   103k|#define BUF_ERROR(buf) ((buf)->flags & (BUF_FLAG_OOM | BUF_FLAG_OVERFLOW))
  |  |  ------------------
  |  |  |  |   30|   103k|#define BUF_FLAG_OOM        (1u << 0)
  |  |  ------------------
  |  |               #define BUF_ERROR(buf) ((buf)->flags & (BUF_FLAG_OOM | BUF_FLAG_OVERFLOW))
  |  |  ------------------
  |  |  |  |   31|   103k|#define BUF_FLAG_OVERFLOW   (1u << 1)
  |  |  ------------------
  ------------------
  |  Branch (442:9): [True: 0, False: 103k]
  |  Branch (442:19): [True: 0, False: 103k]
  ------------------
  443|      0|        return(-1);
  444|       |
  445|   103k|    return(buf->use == 0);
  446|   103k|}
xmlBufAdd:
  459|  23.4M|xmlBufAdd(xmlBuf *buf, const xmlChar *str, size_t len) {
  460|  23.4M|    if ((buf == NULL) || (BUF_ERROR(buf)) || (BUF_STATIC(buf)))
  ------------------
  |  |   34|  23.4M|#define BUF_ERROR(buf) ((buf)->flags & (BUF_FLAG_OOM | BUF_FLAG_OVERFLOW))
  |  |  ------------------
  |  |  |  |   30|  23.4M|#define BUF_FLAG_OOM        (1u << 0)
  |  |  ------------------
  |  |               #define BUF_ERROR(buf) ((buf)->flags & (BUF_FLAG_OOM | BUF_FLAG_OVERFLOW))
  |  |  ------------------
  |  |  |  |   31|  23.4M|#define BUF_FLAG_OVERFLOW   (1u << 1)
  |  |  ------------------
  ------------------
                  if ((buf == NULL) || (BUF_ERROR(buf)) || (BUF_STATIC(buf)))
  ------------------
  |  |   35|  23.4M|#define BUF_STATIC(buf) ((buf)->flags & BUF_FLAG_STATIC)
  |  |  ------------------
  |  |  |  |   32|  23.4M|#define BUF_FLAG_STATIC     (1u << 2)
  |  |  ------------------
  ------------------
  |  Branch (460:9): [True: 0, False: 23.4M]
  |  Branch (460:26): [True: 258, False: 23.4M]
  |  Branch (460:46): [True: 0, False: 23.4M]
  ------------------
  461|    258|        return(-1);
  462|  23.4M|    if (len == 0)
  ------------------
  |  Branch (462:9): [True: 27.9k, False: 23.4M]
  ------------------
  463|  27.9k|        return(0);
  464|  23.4M|    if (str == NULL)
  ------------------
  |  Branch (464:9): [True: 0, False: 23.4M]
  ------------------
  465|      0|	return(-1);
  466|       |
  467|  23.4M|    if (len > buf->size - buf->use) {
  ------------------
  |  Branch (467:9): [True: 94.7k, False: 23.3M]
  ------------------
  468|  94.7k|        if (xmlBufGrowInternal(buf, len) < 0)
  ------------------
  |  Branch (468:13): [True: 46, False: 94.7k]
  ------------------
  469|     46|            return(-1);
  470|  94.7k|    }
  471|       |
  472|  23.4M|    memmove(&buf->content[buf->use], str, len);
  473|  23.4M|    buf->use += len;
  474|  23.4M|    buf->content[buf->use] = 0;
  475|       |
  476|  23.4M|    return(0);
  477|  23.4M|}
xmlBufCat:
  487|  4.28M|xmlBufCat(xmlBuf *buf, const xmlChar *str) {
  488|  4.28M|    if (str == NULL)
  ------------------
  |  Branch (488:9): [True: 220, False: 4.28M]
  ------------------
  489|    220|        return(0);
  490|  4.28M|    return(xmlBufAdd(buf, str, strlen((const char *) str)));
  491|  4.28M|}
xmlBufResetInput:
  588|   620k|xmlBufResetInput(xmlBuf *buf, xmlParserInput *input) {
  589|   620k|    return(xmlBufUpdateInput(buf, input, 0));
  590|   620k|}
xmlBufUpdateInput:
  605|  8.37M|xmlBufUpdateInput(xmlBuf *buf, xmlParserInput *input, size_t pos) {
  606|  8.37M|    if ((buf == NULL) || (input == NULL))
  ------------------
  |  Branch (606:9): [True: 0, False: 8.37M]
  |  Branch (606:26): [True: 0, False: 8.37M]
  ------------------
  607|      0|        return(-1);
  608|  8.37M|    input->base = buf->content;
  609|  8.37M|    input->cur = input->base + pos;
  610|  8.37M|    input->end = &buf->content[buf->use];
  611|  8.37M|    return(0);
  612|  8.37M|}
buf.c:xmlBufGrowInternal:
  271|  98.9k|xmlBufGrowInternal(xmlBufPtr buf, size_t len) {
  272|  98.9k|    size_t size;
  273|  98.9k|    size_t start;
  274|  98.9k|    xmlChar *newbuf;
  275|       |
  276|       |    /*
  277|       |     * If there's enough space at the start of the buffer,
  278|       |     * move the contents.
  279|       |     */
  280|  98.9k|    start = buf->content - buf->mem;
  281|  98.9k|    if (len <= start + buf->size - buf->use) {
  ------------------
  |  Branch (281:9): [True: 6.02k, False: 92.9k]
  ------------------
  282|  6.02k|        memmove(buf->mem, buf->content, buf->use + 1);
  283|  6.02k|        buf->size += start;
  284|  6.02k|        buf->content = buf->mem;
  285|  6.02k|        return(0);
  286|  6.02k|    }
  287|       |
  288|  92.9k|    if (len > buf->maxSize - buf->use) {
  ------------------
  |  Branch (288:9): [True: 0, False: 92.9k]
  ------------------
  289|      0|        xmlBufOverflowError(buf);
  290|      0|        return(-1);
  291|      0|    }
  292|       |
  293|  92.9k|    if (buf->size > (size_t) len) {
  ------------------
  |  Branch (293:9): [True: 61.1k, False: 31.7k]
  ------------------
  294|  61.1k|        if (buf->size <= buf->maxSize / 2)
  ------------------
  |  Branch (294:13): [True: 61.1k, False: 0]
  ------------------
  295|  61.1k|            size = buf->size * 2;
  296|      0|        else
  297|      0|            size = buf->maxSize;
  298|  61.1k|    } else {
  299|  31.7k|        size = buf->use + len;
  300|  31.7k|        if (size <= buf->maxSize - 100)
  ------------------
  |  Branch (300:13): [True: 31.7k, False: 0]
  ------------------
  301|  31.7k|            size += 100;
  302|  31.7k|    }
  303|       |
  304|  92.9k|    if (buf->content == buf->mem) {
  ------------------
  |  Branch (304:9): [True: 91.9k, False: 1.02k]
  ------------------
  305|  91.9k|        newbuf = xmlRealloc(buf->mem, size + 1);
  306|  91.9k|        if (newbuf == NULL) {
  ------------------
  |  Branch (306:13): [True: 48, False: 91.8k]
  ------------------
  307|     48|            xmlBufMemoryError(buf);
  308|     48|            return(-1);
  309|     48|        }
  310|  91.9k|    } else {
  311|  1.02k|        newbuf = xmlMalloc(size + 1);
  312|  1.02k|        if (newbuf == NULL) {
  ------------------
  |  Branch (312:13): [True: 8, False: 1.01k]
  ------------------
  313|      8|            xmlBufMemoryError(buf);
  314|      8|            return(-1);
  315|      8|        }
  316|  1.01k|        if (buf->content != NULL)
  ------------------
  |  Branch (316:13): [True: 1.01k, False: 0]
  ------------------
  317|  1.01k|            memcpy(newbuf, buf->content, buf->use + 1);
  318|  1.01k|        xmlFree(buf->mem);
  319|  1.01k|    }
  320|       |
  321|  92.8k|    buf->mem = newbuf;
  322|  92.8k|    buf->content = newbuf;
  323|  92.8k|    buf->size = size;
  324|       |
  325|  92.8k|    return(0);
  326|  92.9k|}
buf.c:xmlBufMemoryError:
   60|     56|{
   61|     56|    if (!BUF_ERROR(buf))
  ------------------
  |  |   34|     56|#define BUF_ERROR(buf) ((buf)->flags & (BUF_FLAG_OOM | BUF_FLAG_OVERFLOW))
  |  |  ------------------
  |  |  |  |   30|     56|#define BUF_FLAG_OOM        (1u << 0)
  |  |  ------------------
  |  |               #define BUF_ERROR(buf) ((buf)->flags & (BUF_FLAG_OOM | BUF_FLAG_OVERFLOW))
  |  |  ------------------
  |  |  |  |   31|     56|#define BUF_FLAG_OVERFLOW   (1u << 1)
  |  |  ------------------
  ------------------
  |  Branch (61:9): [True: 56, False: 0]
  ------------------
   62|     56|        buf->flags |= BUF_FLAG_OOM;
  ------------------
  |  |   30|     56|#define BUF_FLAG_OOM        (1u << 0)
  ------------------
   63|     56|}

xmlInitCatalogInternal:
 3186|      2|xmlInitCatalogInternal(void) {
 3187|      2|    if (getenv("XML_DEBUG_CATALOG"))
  ------------------
  |  Branch (3187:9): [True: 0, False: 2]
  ------------------
 3188|      0|	xmlDebugCatalogs = 1;
 3189|      2|    xmlInitRMutex(&xmlCatalogMutex);
 3190|      2|}
xmlInitializeCatalog:
 3196|      2|xmlInitializeCatalog(void) {
 3197|      2|    if (xmlCatalogInitialized != 0)
  ------------------
  |  Branch (3197:9): [True: 0, False: 2]
  ------------------
 3198|      0|	return;
 3199|       |
 3200|      2|    xmlInitParser();
 3201|       |
 3202|      2|    xmlRMutexLock(&xmlCatalogMutex);
 3203|       |
 3204|      2|    if (xmlDefaultCatalog == NULL) {
  ------------------
  |  Branch (3204:9): [True: 2, False: 0]
  ------------------
 3205|      2|	const char *catalogs;
 3206|      2|	char *path;
 3207|      2|	const char *cur, *paths;
 3208|      2|	xmlCatalogPtr catal;
 3209|      2|	xmlCatalogEntryPtr *nextent;
 3210|       |
 3211|      2|	catalogs = (const char *) getenv("XML_CATALOG_FILES");
 3212|      2|	if (catalogs == NULL)
  ------------------
  |  Branch (3212:6): [True: 2, False: 0]
  ------------------
 3213|      2|	    catalogs = XML_XML_DEFAULT_CATALOG;
  ------------------
  |  |   58|      2|#define XML_XML_DEFAULT_CATALOG "file://" XML_SYSCONFDIR "/xml/catalog"
  ------------------
 3214|       |
 3215|      2|	catal = xmlCreateNewCatalog(XML_XML_CATALOG_TYPE,
 3216|      2|		xmlCatalogDefaultPrefer);
 3217|      2|	if (catal != NULL) {
  ------------------
  |  Branch (3217:6): [True: 2, False: 0]
  ------------------
 3218|       |	    /* the XML_CATALOG_FILES envvar is allowed to contain a
 3219|       |	       space-separated list of entries. */
 3220|      2|	    cur = catalogs;
 3221|      2|	    nextent = &catal->xml;
 3222|      4|	    while (*cur != '\0') {
  ------------------
  |  Branch (3222:13): [True: 2, False: 2]
  ------------------
 3223|      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]
  |  |  ------------------
  ------------------
 3224|      0|		    cur++;
 3225|      2|		if (*cur != 0) {
  ------------------
  |  Branch (3225:7): [True: 2, False: 0]
  ------------------
 3226|      2|		    paths = cur;
 3227|     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 (3227:14): [True: 66, False: 2]
  ------------------
 3228|     66|			cur++;
 3229|      2|		    path = (char *) xmlStrndup((const xmlChar *)paths, cur - paths);
 3230|      2|		    if (path != NULL) {
  ------------------
  |  Branch (3230:11): [True: 2, False: 0]
  ------------------
 3231|      2|			*nextent = xmlNewCatalogEntry(XML_CATA_CATALOG, NULL,
 3232|      2|				NULL, BAD_CAST path, xmlCatalogDefaultPrefer, NULL);
  ------------------
  |  |   34|      2|#define BAD_CAST (xmlChar *)
  ------------------
 3233|      2|			if (*nextent != NULL)
  ------------------
  |  Branch (3233:8): [True: 2, False: 0]
  ------------------
 3234|      2|			    nextent = &((*nextent)->next);
 3235|      2|			xmlFree(path);
 3236|      2|		    }
 3237|      2|		}
 3238|      2|	    }
 3239|      2|	    xmlDefaultCatalog = catal;
 3240|      2|	}
 3241|      2|    }
 3242|       |
 3243|      2|    xmlRMutexUnlock(&xmlCatalogMutex);
 3244|       |
 3245|      2|    xmlCatalogInitialized = 1;
 3246|      2|}
xmlCatalogGetDefaults:
 3561|   254k|xmlCatalogGetDefaults(void) {
 3562|   254k|    return(xmlCatalogDefaultAllow);
 3563|   254k|}
xmlCatalogSetDefaults:
 3575|      2|xmlCatalogSetDefaults(xmlCatalogAllow allow) {
 3576|      2|    if (xmlDebugCatalogs) {
  ------------------
  |  Branch (3576:9): [True: 0, False: 2]
  ------------------
 3577|      0|	switch (allow) {
  ------------------
  |  Branch (3577:10): [True: 0, False: 0]
  ------------------
 3578|      0|	    case XML_CATA_ALLOW_NONE:
  ------------------
  |  Branch (3578:6): [True: 0, False: 0]
  ------------------
 3579|      0|		xmlCatalogPrintDebug(
 3580|      0|			"Disabling catalog usage\n");
 3581|      0|		break;
 3582|      0|	    case XML_CATA_ALLOW_GLOBAL:
  ------------------
  |  Branch (3582:6): [True: 0, False: 0]
  ------------------
 3583|      0|		xmlCatalogPrintDebug(
 3584|      0|			"Allowing only global catalogs\n");
 3585|      0|		break;
 3586|      0|	    case XML_CATA_ALLOW_DOCUMENT:
  ------------------
  |  Branch (3586:6): [True: 0, False: 0]
  ------------------
 3587|      0|		xmlCatalogPrintDebug(
 3588|      0|			"Allowing only catalogs from the document\n");
 3589|      0|		break;
 3590|      0|	    case XML_CATA_ALLOW_ALL:
  ------------------
  |  Branch (3590:6): [True: 0, False: 0]
  ------------------
 3591|      0|		xmlCatalogPrintDebug(
 3592|      0|			"Allowing all catalogs\n");
 3593|      0|		break;
 3594|      0|	}
 3595|      0|    }
 3596|      2|    xmlCatalogDefaultAllow = allow;
 3597|      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|   469k|xmlCharInRange (unsigned int val, const xmlChRangeGroup *rptr) {
   33|   469k|    int low, high, mid;
   34|   469k|    const xmlChSRange *sptr;
   35|   469k|    const xmlChLRange *lptr;
   36|       |
   37|   469k|    if (rptr == NULL) return(0);
  ------------------
  |  Branch (37:9): [True: 0, False: 469k]
  ------------------
   38|   469k|    if (val < 0x10000) {	/* is val in 'short' or 'long'  array? */
  ------------------
  |  Branch (38:9): [True: 429k, False: 40.2k]
  ------------------
   39|   429k|	if (rptr->nbShortRange == 0)
  ------------------
  |  Branch (39:6): [True: 0, False: 429k]
  ------------------
   40|      0|	    return 0;
   41|   429k|	low = 0;
   42|   429k|	high = rptr->nbShortRange - 1;
   43|   429k|	sptr = rptr->shortRange;
   44|  3.17M|	while (low <= high) {
  ------------------
  |  Branch (44:9): [True: 3.15M, False: 14.9k]
  ------------------
   45|  3.15M|	    mid = (low + high) / 2;
   46|  3.15M|	    if ((unsigned short) val < sptr[mid].low) {
  ------------------
  |  Branch (46:10): [True: 2.18M, False: 974k]
  ------------------
   47|  2.18M|		high = mid - 1;
   48|  2.18M|	    } else {
   49|   974k|		if ((unsigned short) val > sptr[mid].high) {
  ------------------
  |  Branch (49:7): [True: 560k, False: 414k]
  ------------------
   50|   560k|		    low = mid + 1;
   51|   560k|		} else {
   52|   414k|		    return 1;
   53|   414k|		}
   54|   974k|	    }
   55|  3.15M|	}
   56|   429k|    } else {
   57|  40.2k|	if (rptr->nbLongRange == 0) {
  ------------------
  |  Branch (57:6): [True: 40.2k, False: 0]
  ------------------
   58|  40.2k|	    return 0;
   59|  40.2k|	}
   60|      0|	low = 0;
   61|      0|	high = rptr->nbLongRange - 1;
   62|      0|	lptr = rptr->longRange;
   63|      0|	while (low <= high) {
  ------------------
  |  Branch (63:9): [True: 0, False: 0]
  ------------------
   64|      0|	    mid = (low + high) / 2;
   65|      0|	    if (val < lptr[mid].low) {
  ------------------
  |  Branch (65:10): [True: 0, False: 0]
  ------------------
   66|      0|		high = mid - 1;
   67|      0|	    } else {
   68|      0|		if (val > lptr[mid].high) {
  ------------------
  |  Branch (68:7): [True: 0, False: 0]
  ------------------
   69|      0|		    low = mid + 1;
   70|      0|		} else {
   71|      0|		    return 1;
   72|      0|		}
   73|      0|	    }
   74|      0|	}
   75|      0|    }
   76|  14.9k|    return 0;
   77|   469k|}

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

xmlGetEncodingAlias:
  473|  11.4k|xmlGetEncodingAlias(const char *alias) {
  474|  11.4k|    int i;
  475|  11.4k|    char upper[100];
  476|       |
  477|  11.4k|    if (alias == NULL)
  ------------------
  |  Branch (477:9): [True: 0, False: 11.4k]
  ------------------
  478|      0|	return(NULL);
  479|       |
  480|  11.4k|    if (xmlCharEncodingAliases == NULL)
  ------------------
  |  Branch (480:9): [True: 11.4k, False: 0]
  ------------------
  481|  11.4k|	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.49k|                           xmlCharEncodingHandler **out) {
  771|  7.49k|    xmlCharEncodingHandler *handler;
  772|       |
  773|  7.49k|    if (out == NULL)
  ------------------
  |  Branch (773:9): [True: 0, False: 7.49k]
  ------------------
  774|      0|        return(XML_ERR_ARGUMENT);
  775|       |
  776|  7.49k|    handler = xmlMalloc(sizeof(*handler));
  777|  7.49k|    if (handler == NULL)
  ------------------
  |  Branch (777:9): [True: 5, False: 7.49k]
  ------------------
  778|      5|        goto error;
  779|  7.49k|    memset(handler, 0, sizeof(*handler));
  780|       |
  781|  7.49k|    if (name != NULL) {
  ------------------
  |  Branch (781:9): [True: 7.49k, False: 0]
  ------------------
  782|  7.49k|        handler->name = xmlMemStrdup(name);
  783|  7.49k|        if (handler->name == NULL)
  ------------------
  |  Branch (783:13): [True: 7, False: 7.48k]
  ------------------
  784|      7|            goto error;
  785|  7.49k|    }
  786|       |
  787|  7.48k|    handler->input.func = input;
  788|  7.48k|    handler->output.func = output;
  789|  7.48k|    handler->ctxtDtor = ctxtDtor;
  790|  7.48k|    handler->inputCtxt = inputCtxt;
  791|  7.48k|    handler->outputCtxt = outputCtxt;
  792|       |
  793|  7.48k|    *out = handler;
  794|  7.48k|    return(XML_ERR_OK);
  795|       |
  796|     12|error:
  797|     12|    xmlFree(handler);
  798|       |
  799|     12|    if (ctxtDtor != NULL) {
  ------------------
  |  Branch (799:9): [True: 12, False: 0]
  ------------------
  800|     12|        if (inputCtxt != NULL)
  ------------------
  |  Branch (800:13): [True: 12, False: 0]
  ------------------
  801|     12|            ctxtDtor(inputCtxt);
  802|     12|        if (outputCtxt != NULL)
  ------------------
  |  Branch (802:13): [True: 3, False: 9]
  ------------------
  803|      3|            ctxtDtor(outputCtxt);
  804|     12|    }
  805|       |
  806|     12|    return(XML_ERR_NO_MEMORY);
  807|  7.49k|}
xmlInitEncodingInternal:
  821|      2|xmlInitEncodingInternal(void) {
  822|      2|    unsigned short int tst = 0x1234;
  823|      2|    unsigned char *ptr = (unsigned char *) &tst;
  824|       |
  825|      2|    if (*ptr == 0x12) xmlLittleEndian = 0;
  ------------------
  |  Branch (825:9): [True: 0, False: 2]
  ------------------
  826|      2|    else xmlLittleEndian = 1;
  827|      2|}
xmlLookupCharEncodingHandler:
  986|  6.72k|                             xmlCharEncodingHandler **out) {
  987|  6.72k|    const xmlCharEncodingHandler *handler;
  988|       |
  989|  6.72k|    if (out == NULL)
  ------------------
  |  Branch (989:9): [True: 0, False: 6.72k]
  ------------------
  990|      0|        return(XML_ERR_ARGUMENT);
  991|  6.72k|    *out = NULL;
  992|       |
  993|  6.72k|    if ((enc <= 0) || ((size_t) enc >= NUM_DEFAULT_HANDLERS))
  ------------------
  |  |  355|  6.72k|    (sizeof(defaultHandlers) / sizeof(defaultHandlers[0]))
  ------------------
  |  Branch (993:9): [True: 0, False: 6.72k]
  |  Branch (993:23): [True: 0, False: 6.72k]
  ------------------
  994|      0|        return(XML_ERR_UNSUPPORTED_ENCODING);
  995|       |
  996|       |    /* Return NULL handler for UTF-8 */
  997|  6.72k|    if ((enc == XML_CHAR_ENCODING_UTF8) ||
  ------------------
  |  Branch (997:9): [True: 79, False: 6.64k]
  ------------------
  998|  6.64k|        (enc == XML_CHAR_ENCODING_NONE))
  ------------------
  |  Branch (998:9): [True: 0, False: 6.64k]
  ------------------
  999|     79|        return(XML_ERR_OK);
 1000|       |
 1001|  6.64k|    handler = &defaultHandlers[enc];
 1002|  6.64k|    if ((handler->input.func != NULL) || (handler->output.func != NULL)) {
  ------------------
  |  Branch (1002:9): [True: 5.91k, False: 731]
  |  Branch (1002:42): [True: 0, False: 731]
  ------------------
 1003|  5.91k|        *out = (xmlCharEncodingHandler *) handler;
 1004|  5.91k|        return(XML_ERR_OK);
 1005|  5.91k|    }
 1006|       |
 1007|    731|    if (handler->name != NULL) {
  ------------------
  |  Branch (1007:9): [True: 731, False: 0]
  ------------------
 1008|    731|        xmlCharEncFlags flags = XML_ENC_INPUT;
 1009|       |
 1010|    731|#ifdef LIBXML_OUTPUT_ENABLED
 1011|    731|        flags |= XML_ENC_OUTPUT;
 1012|    731|#endif
 1013|    731|        return(xmlFindExtraHandler(handler->name, handler->name, flags,
 1014|    731|                                   NULL, NULL, out));
 1015|    731|    }
 1016|       |
 1017|      0|    return(XML_ERR_UNSUPPORTED_ENCODING);
 1018|    731|}
xmlCreateCharEncodingHandler:
 1066|  11.4k|                             xmlCharEncodingHandler **out) {
 1067|  11.4k|    const xmlCharEncodingHandler *handler;
 1068|  11.4k|    const char *norig, *nalias;
 1069|  11.4k|    xmlCharEncoding enc;
 1070|       |
 1071|  11.4k|    if (out == NULL)
  ------------------
  |  Branch (1071:9): [True: 0, False: 11.4k]
  ------------------
 1072|      0|        return(XML_ERR_ARGUMENT);
 1073|  11.4k|    *out = NULL;
 1074|       |
 1075|  11.4k|    if ((name == NULL) || (flags == 0))
  ------------------
  |  Branch (1075:9): [True: 0, False: 11.4k]
  |  Branch (1075:27): [True: 0, False: 11.4k]
  ------------------
 1076|      0|        return(XML_ERR_ARGUMENT);
 1077|       |
 1078|  11.4k|    norig = name;
 1079|  11.4k|    nalias = xmlGetEncodingAlias(name);
 1080|  11.4k|    if (nalias != NULL)
  ------------------
  |  Branch (1080:9): [True: 0, False: 11.4k]
  ------------------
 1081|      0|	name = nalias;
 1082|       |
 1083|  11.4k|    enc = xmlParseCharEncodingInternal(name);
 1084|       |
 1085|       |    /* Return NULL handler for UTF-8 */
 1086|  11.4k|    if (enc == XML_CHAR_ENCODING_UTF8)
  ------------------
  |  Branch (1086:9): [True: 364, False: 11.0k]
  ------------------
 1087|    364|        return(XML_ERR_OK);
 1088|       |
 1089|  11.0k|    if ((enc > 0) && ((size_t) enc < NUM_DEFAULT_HANDLERS)) {
  ------------------
  |  |  355|  4.00k|    (sizeof(defaultHandlers) / sizeof(defaultHandlers[0]))
  ------------------
  |  Branch (1089:9): [True: 4.00k, False: 7.08k]
  |  Branch (1089:22): [True: 4.00k, False: 0]
  ------------------
 1090|  4.00k|        if (flags & XML_ENC_HTML) {
  ------------------
  |  Branch (1090:13): [True: 0, False: 4.00k]
  ------------------
 1091|       |            /*
 1092|       |             * TODO: HTML5 only allows a fixed set of charset
 1093|       |             * labels. We should add an option to enable or
 1094|       |             * disable this restriction.
 1095|       |             *
 1096|       |             * TODO: Map ISO-8859-9 to windows-1254.
 1097|       |             */
 1098|      0|            switch (enc) {
 1099|      0|                case XML_CHAR_ENCODING_ASCII:
  ------------------
  |  Branch (1099:17): [True: 0, False: 0]
  ------------------
 1100|      0|                case XML_CHAR_ENCODING_8859_1:
  ------------------
  |  Branch (1100:17): [True: 0, False: 0]
  ------------------
 1101|      0|                    enc = XML_CHAR_ENCODING_WINDOWS_1252;
 1102|      0|                    break;
 1103|      0|                case XML_CHAR_ENCODING_UCS2:
  ------------------
  |  Branch (1103:17): [True: 0, False: 0]
  ------------------
 1104|      0|                case XML_CHAR_ENCODING_UTF16:
  ------------------
  |  Branch (1104:17): [True: 0, False: 0]
  ------------------
 1105|      0|                    enc = XML_CHAR_ENCODING_UTF16LE;
 1106|      0|                    break;
 1107|      0|                default:
  ------------------
  |  Branch (1107:17): [True: 0, False: 0]
  ------------------
 1108|      0|                    break;
 1109|      0|            }
 1110|      0|        }
 1111|       |
 1112|  4.00k|        handler = &defaultHandlers[enc];
 1113|  4.00k|        if ((((flags & XML_ENC_INPUT) == 0) || (handler->input.func)) &&
  ------------------
  |  Branch (1113:14): [True: 0, False: 4.00k]
  |  Branch (1113:48): [True: 3.54k, False: 458]
  ------------------
 1114|  3.54k|            (((flags & XML_ENC_OUTPUT) == 0) || (handler->output.func))) {
  ------------------
  |  Branch (1114:14): [True: 3.54k, False: 0]
  |  Branch (1114:49): [True: 0, False: 0]
  ------------------
 1115|  3.54k|            xmlCharEncodingHandler *ret;
 1116|       |
 1117|       |            /*
 1118|       |             * Return a copy of the handler with the original name.
 1119|       |             */
 1120|       |
 1121|  3.54k|            ret = xmlMalloc(sizeof(*ret));
 1122|  3.54k|            if (ret == NULL)
  ------------------
  |  Branch (1122:17): [True: 4, False: 3.54k]
  ------------------
 1123|      4|                return(XML_ERR_NO_MEMORY);
 1124|  3.54k|            memset(ret, 0, sizeof(*ret));
 1125|       |
 1126|  3.54k|            ret->name = xmlMemStrdup(norig);
 1127|  3.54k|            if (ret->name == NULL) {
  ------------------
  |  Branch (1127:17): [True: 3, False: 3.54k]
  ------------------
 1128|      3|                xmlFree(ret);
 1129|      3|                return(XML_ERR_NO_MEMORY);
 1130|      3|            }
 1131|  3.54k|            ret->input = handler->input;
 1132|  3.54k|            ret->output = handler->output;
 1133|  3.54k|            ret->inputCtxt = handler->inputCtxt;
 1134|  3.54k|            ret->outputCtxt = handler->outputCtxt;
 1135|  3.54k|            ret->ctxtDtor = handler->ctxtDtor;
 1136|       |
 1137|  3.54k|            *out = ret;
 1138|  3.54k|            return(XML_ERR_OK);
 1139|  3.54k|        }
 1140|  4.00k|    }
 1141|       |
 1142|  7.54k|    return(xmlFindExtraHandler(norig, name, flags, impl, implCtxt, out));
 1143|  11.0k|}
xmlOpenCharEncodingHandler:
 1169|     26|                           xmlCharEncodingHandler **out) {
 1170|     26|    xmlCharEncFlags flags = output ? XML_ENC_OUTPUT : XML_ENC_INPUT;
  ------------------
  |  Branch (1170:29): [True: 0, False: 26]
  ------------------
 1171|       |
 1172|     26|    return(xmlCreateCharEncodingHandler(name, flags, NULL, NULL, out));
 1173|     26|}
xmlEncInputChunk:
 1685|   159k|                 int flush) {
 1686|   159k|    xmlCharEncError ret;
 1687|       |
 1688|   159k|    if (handler->flags & XML_HANDLER_LEGACY) {
  ------------------
  |  |   54|   159k|#define XML_HANDLER_LEGACY (1 << 1)
  ------------------
  |  Branch (1688:9): [True: 0, False: 159k]
  ------------------
 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|   159k|    } else {
 1699|   159k|        xmlCharEncConvFunc func = handler->input.func;
 1700|   159k|        int oldInlen;
 1701|       |
 1702|   159k|        if (func == NULL) {
  ------------------
  |  Branch (1702:13): [True: 0, False: 159k]
  ------------------
 1703|      0|            *outlen = 0;
 1704|      0|            *inlen = 0;
 1705|      0|            return(XML_ENC_ERR_INTERNAL);
 1706|      0|        }
 1707|       |
 1708|   159k|        oldInlen = *inlen;
 1709|   159k|        ret = func(handler->inputCtxt, out, outlen, in, inlen, flush);
 1710|       |
 1711|       |        /*
 1712|       |         * Check for truncated multi-byte sequence.
 1713|       |         */
 1714|   159k|        if ((flush) && (ret == XML_ENC_ERR_SUCCESS) && (*inlen != oldInlen))
  ------------------
  |  Branch (1714:13): [True: 10, False: 159k]
  |  Branch (1714:24): [True: 10, False: 0]
  |  Branch (1714:56): [True: 1, False: 9]
  ------------------
 1715|      1|            ret = XML_ENC_ERR_INPUT;
 1716|   159k|    }
 1717|       |
 1718|   159k|    if (ret > 0)
  ------------------
  |  Branch (1718:9): [True: 22.7k, False: 136k]
  ------------------
 1719|  22.7k|        ret = XML_ENC_ERR_SUCCESS;
 1720|       |
 1721|   159k|    return(ret);
 1722|   159k|}
xmlCharEncInput:
 1795|   344k|{
 1796|   344k|    xmlBufPtr out, in;
 1797|   344k|    const xmlChar *dataIn;
 1798|   344k|    size_t availIn;
 1799|   344k|    size_t maxOut;
 1800|   344k|    size_t totalIn, totalOut;
 1801|   344k|    xmlCharEncError ret;
 1802|       |
 1803|   344k|    out = input->buffer;
 1804|   344k|    in = input->raw;
 1805|       |
 1806|   344k|    maxOut = *sizeOut;
 1807|   344k|    totalOut = 0;
 1808|       |
 1809|   344k|    *sizeOut = 0;
 1810|       |
 1811|   344k|    availIn = xmlBufUse(in);
 1812|   344k|    if ((availIn == 0) && (!flush))
  ------------------
  |  Branch (1812:9): [True: 192k, False: 151k]
  |  Branch (1812:27): [True: 192k, False: 9]
  ------------------
 1813|   192k|        return(0);
 1814|   151k|    dataIn = xmlBufContent(in);
 1815|   151k|    totalIn = 0;
 1816|       |
 1817|   156k|    while (1) {
  ------------------
  |  Branch (1817:12): [True: 156k, Folded]
  ------------------
 1818|   156k|        size_t availOut;
 1819|   156k|        int completeOut, completeIn;
 1820|   156k|        int c_out, c_in;
 1821|       |
 1822|   156k|        availOut = xmlBufAvail(out);
 1823|   156k|        if (availOut > INT_MAX / 2)
  ------------------
  |  Branch (1823:13): [True: 0, False: 156k]
  ------------------
 1824|      0|            availOut = INT_MAX / 2;
 1825|       |
 1826|   156k|        if (availOut < maxOut) {
  ------------------
  |  Branch (1826:13): [True: 95.7k, False: 60.3k]
  ------------------
 1827|  95.7k|            c_out = availOut;
 1828|  95.7k|            completeOut = 0;
 1829|  95.7k|        } else {
 1830|  60.3k|            c_out = maxOut;
 1831|  60.3k|            completeOut = 1;
 1832|  60.3k|        }
 1833|       |
 1834|   156k|        if (availIn > INT_MAX / 2) {
  ------------------
  |  Branch (1834:13): [True: 0, False: 156k]
  ------------------
 1835|      0|            c_in = INT_MAX / 2;
 1836|      0|            completeIn = 0;
 1837|   156k|        } else {
 1838|   156k|            c_in = availIn;
 1839|   156k|            completeIn = 1;
 1840|   156k|        }
 1841|       |
 1842|   156k|        ret = xmlEncInputChunk(input->encoder, xmlBufEnd(out), &c_out,
 1843|   156k|                               dataIn, &c_in, flush && completeIn);
  ------------------
  |  Branch (1843:47): [True: 10, False: 156k]
  |  Branch (1843:56): [True: 10, False: 0]
  ------------------
 1844|       |
 1845|   156k|        totalIn += c_in;
 1846|   156k|        dataIn += c_in;
 1847|   156k|        availIn -= c_in;
 1848|       |
 1849|   156k|        totalOut += c_out;
 1850|   156k|        maxOut -= c_out;
 1851|   156k|        xmlBufAddLen(out, c_out);
 1852|       |
 1853|   156k|        if ((ret != XML_ENC_ERR_SUCCESS) && (ret != XML_ENC_ERR_SPACE)) {
  ------------------
  |  Branch (1853:13): [True: 40.6k, False: 115k]
  |  Branch (1853:45): [True: 3.74k, False: 36.8k]
  ------------------
 1854|  3.74k|            input->error = xmlEncConvertError(ret);
 1855|  3.74k|            return(ret);
 1856|  3.74k|        }
 1857|       |
 1858|   152k|        if ((completeOut) && (completeIn))
  ------------------
  |  Branch (1858:13): [True: 57.3k, False: 94.9k]
  |  Branch (1858:30): [True: 57.3k, False: 0]
  ------------------
 1859|  57.3k|            break;
 1860|  94.9k|        if ((completeOut) && (ret == XML_ENC_ERR_SPACE))
  ------------------
  |  Branch (1860:13): [True: 0, False: 94.9k]
  |  Branch (1860:30): [True: 0, False: 0]
  ------------------
 1861|      0|            break;
 1862|  94.9k|        if ((completeIn) && (ret == XML_ENC_ERR_SUCCESS))
  ------------------
  |  Branch (1862:13): [True: 94.9k, False: 0]
  |  Branch (1862:29): [True: 90.7k, False: 4.18k]
  ------------------
 1863|  90.7k|            break;
 1864|       |
 1865|  4.18k|        if (ret == XML_ENC_ERR_SPACE) {
  ------------------
  |  Branch (1865:13): [True: 4.18k, False: 0]
  ------------------
 1866|  4.18k|            if (xmlBufGrow(out, 4096) < 0) {
  ------------------
  |  Branch (1866:17): [True: 10, False: 4.17k]
  ------------------
 1867|     10|                input->error = XML_ERR_NO_MEMORY;
 1868|     10|                return(XML_ENC_ERR_MEMORY);
 1869|     10|            }
 1870|  4.18k|        }
 1871|  4.18k|    }
 1872|       |
 1873|   148k|    xmlBufShrink(in, totalIn);
 1874|       |
 1875|   148k|    if (input->rawconsumed > ULONG_MAX - (unsigned long) totalIn)
  ------------------
  |  Branch (1875:9): [True: 0, False: 148k]
  ------------------
 1876|      0|        input->rawconsumed = ULONG_MAX;
 1877|   148k|    else
 1878|   148k|        input->rawconsumed += totalIn;
 1879|       |
 1880|   148k|    *sizeOut = totalOut;
 1881|   148k|    return(XML_ENC_ERR_SUCCESS);
 1882|   151k|}
xmlCharEncCloseFunc:
 2192|  17.0k|xmlCharEncCloseFunc(xmlCharEncodingHandler *handler) {
 2193|  17.0k|    if (handler == NULL)
  ------------------
  |  Branch (2193:9): [True: 151, False: 16.9k]
  ------------------
 2194|    151|        return(0);
 2195|       |
 2196|  16.9k|    if (handler->flags & XML_HANDLER_STATIC)
  ------------------
  |  |   53|  16.9k|#define XML_HANDLER_STATIC (1 << 0)
  ------------------
  |  Branch (2196:9): [True: 5.91k, False: 11.0k]
  ------------------
 2197|  5.91k|        return(0);
 2198|       |
 2199|  11.0k|    xmlFree(handler->name);
 2200|  11.0k|    if (handler->ctxtDtor != NULL) {
  ------------------
  |  Branch (2200:9): [True: 7.48k, False: 3.54k]
  ------------------
 2201|  7.48k|        handler->ctxtDtor(handler->inputCtxt);
 2202|  7.48k|        handler->ctxtDtor(handler->outputCtxt);
 2203|  7.48k|    }
 2204|  11.0k|    xmlFree(handler);
 2205|  11.0k|    return(0);
 2206|  16.9k|}
encoding.c:xmlParseCharEncodingInternal:
  618|  11.4k|{
  619|  11.4k|    const xmlEncTableEntry *entry;
  620|       |
  621|  11.4k|    if (name == NULL)
  ------------------
  |  Branch (621:9): [True: 0, False: 11.4k]
  ------------------
  622|      0|       return(XML_CHAR_ENCODING_NONE);
  623|       |
  624|  11.4k|    entry = bsearch(name, xmlEncTable,
  625|  11.4k|                    sizeof(xmlEncTable) / sizeof(xmlEncTable[0]),
  626|  11.4k|                    sizeof(xmlEncTable[0]), xmlCompareEncTableEntries);
  627|  11.4k|    if (entry != NULL)
  ------------------
  |  Branch (627:9): [True: 4.37k, False: 7.08k]
  ------------------
  628|  4.37k|        return(entry->enc);
  629|       |
  630|  7.08k|    return(XML_CHAR_ENCODING_ERROR);
  631|  11.4k|}
encoding.c:xmlCompareEncTableEntries:
  609|  67.2k|xmlCompareEncTableEntries(const void *vkey, const void *ventry) {
  610|  67.2k|    const char *key = vkey;
  611|  67.2k|    const xmlEncTableEntry *entry = ventry;
  612|       |
  613|  67.2k|    return(xmlStrcasecmp(BAD_CAST key, BAD_CAST entry->name));
  ------------------
  |  |   34|  67.2k|#define BAD_CAST (xmlChar *)
  ------------------
                  return(xmlStrcasecmp(BAD_CAST key, BAD_CAST entry->name));
  ------------------
  |  |   34|  67.2k|#define BAD_CAST (xmlChar *)
  ------------------
  614|  67.2k|}
encoding.c:UTF16LEToUTF8:
 2492|  77.5k|              int flush ATTRIBUTE_UNUSED) {
 2493|  77.5k|    const unsigned char *instart = in;
 2494|  77.5k|    const unsigned char *inend = in + (*inlen & ~1);
 2495|  77.5k|    unsigned char *outstart = out;
 2496|  77.5k|    unsigned char *outend = out + *outlen;
 2497|  77.5k|    unsigned c, d;
 2498|  77.5k|    int ret = XML_ENC_ERR_SPACE;
 2499|       |
 2500|  5.74M|    while (in < inend) {
  ------------------
  |  Branch (2500:12): [True: 5.67M, False: 71.7k]
  ------------------
 2501|  5.67M|        c = in[0] | (in[1] << 8);
 2502|       |
 2503|  5.67M|        if (c < 0x80) {
  ------------------
  |  Branch (2503:13): [True: 30.0k, False: 5.64M]
  ------------------
 2504|  30.0k|            if (out >= outend)
  ------------------
  |  Branch (2504:17): [True: 227, False: 29.8k]
  ------------------
 2505|    227|                goto done;
 2506|  29.8k|            out[0] = c;
 2507|  29.8k|            in += 2;
 2508|  29.8k|            out += 1;
 2509|  5.64M|        } else if (c < 0x800) {
  ------------------
  |  Branch (2509:20): [True: 13.3k, False: 5.63M]
  ------------------
 2510|  13.3k|            if (outend - out < 2)
  ------------------
  |  Branch (2510:17): [True: 298, False: 13.0k]
  ------------------
 2511|    298|                goto done;
 2512|  13.0k|            out[0] = (c >> 6)   | 0xC0;
 2513|  13.0k|            out[1] = (c & 0x3F) | 0x80;
 2514|  13.0k|            in += 2;
 2515|  13.0k|            out += 2;
 2516|  5.63M|        } else if ((c & 0xF800) != 0xD800) {
  ------------------
  |  Branch (2516:20): [True: 5.63M, False: 2.70k]
  ------------------
 2517|  5.63M|            if (outend - out < 3)
  ------------------
  |  Branch (2517:17): [True: 3.41k, False: 5.62M]
  ------------------
 2518|  3.41k|                goto done;
 2519|  5.62M|            out[0] =  (c >> 12)         | 0xE0;
 2520|  5.62M|            out[1] = ((c >>  6) & 0x3F) | 0x80;
 2521|  5.62M|            out[2] =  (c        & 0x3F) | 0x80;
 2522|  5.62M|            in += 2;
 2523|  5.62M|            out += 3;
 2524|  5.62M|        } else {
 2525|       |            /* Surrogate pair */
 2526|  2.70k|            if ((c & 0xFC00) != 0xD800) {
  ------------------
  |  Branch (2526:17): [True: 506, False: 2.19k]
  ------------------
 2527|    506|                ret = XML_ENC_ERR_INPUT;
 2528|    506|                goto done;
 2529|    506|            }
 2530|  2.19k|	    if (inend - in < 4)
  ------------------
  |  Branch (2530:10): [True: 255, False: 1.94k]
  ------------------
 2531|    255|		break;
 2532|  1.94k|            d = in[2] | (in[3] << 8);
 2533|  1.94k|            if ((d & 0xFC00) != 0xDC00) {
  ------------------
  |  Branch (2533:17): [True: 832, False: 1.11k]
  ------------------
 2534|    832|                ret = XML_ENC_ERR_INPUT;
 2535|    832|                goto done;
 2536|    832|            }
 2537|  1.11k|	    if (outend - out < 4)
  ------------------
  |  Branch (2537:10): [True: 266, False: 844]
  ------------------
 2538|    266|		goto done;
 2539|    844|            c = (c << 10) + d - ((0xD800 << 10) + 0xDC00 - 0x10000);
 2540|    844|            out[0] =  (c >> 18)         | 0xF0;
 2541|    844|            out[1] = ((c >> 12) & 0x3F) | 0x80;
 2542|    844|            out[2] = ((c >>  6) & 0x3F) | 0x80;
 2543|    844|            out[3] =  (c        & 0x3F) | 0x80;
 2544|    844|            in += 4;
 2545|    844|            out += 4;
 2546|    844|        }
 2547|  5.67M|    }
 2548|       |
 2549|  71.9k|    ret = out - outstart;
 2550|       |
 2551|  77.5k|done:
 2552|  77.5k|    *outlen = out - outstart;
 2553|  77.5k|    *inlen = in - instart;
 2554|  77.5k|    return(ret);
 2555|  71.9k|}
encoding.c:UTF16BEToUTF8:
 2689|  28.9k|              int flush ATTRIBUTE_UNUSED) {
 2690|  28.9k|    const unsigned char *instart = in;
 2691|  28.9k|    const unsigned char *inend = in + (*inlen & ~1);
 2692|  28.9k|    unsigned char *outstart = out;
 2693|  28.9k|    unsigned char *outend = out + *outlen;
 2694|  28.9k|    unsigned c, d;
 2695|  28.9k|    int ret = XML_ENC_ERR_SPACE;
 2696|       |
 2697|  23.8M|    while (in < inend) {
  ------------------
  |  Branch (2697:12): [True: 23.8M, False: 10.0k]
  ------------------
 2698|  23.8M|        c = (in[0] << 8) | in[1];
 2699|       |
 2700|  23.8M|        if (c < 0x80) {
  ------------------
  |  Branch (2700:13): [True: 23.6k, False: 23.7M]
  ------------------
 2701|  23.6k|            if (out >= outend)
  ------------------
  |  Branch (2701:17): [True: 269, False: 23.4k]
  ------------------
 2702|    269|                goto done;
 2703|  23.4k|            out[0] = c;
 2704|  23.4k|            in += 2;
 2705|  23.4k|            out += 1;
 2706|  23.7M|        } else if (c < 0x800) {
  ------------------
  |  Branch (2706:20): [True: 50.6k, False: 23.7M]
  ------------------
 2707|  50.6k|            if (outend - out < 2)
  ------------------
  |  Branch (2707:17): [True: 278, False: 50.3k]
  ------------------
 2708|    278|                goto done;
 2709|  50.3k|            out[0] = (c >> 6)   | 0xC0;
 2710|  50.3k|            out[1] = (c & 0x3F) | 0x80;
 2711|  50.3k|            in += 2;
 2712|  50.3k|            out += 2;
 2713|  23.7M|        } else if ((c & 0xF800) != 0xD800) {
  ------------------
  |  Branch (2713:20): [True: 23.7M, False: 1.70k]
  ------------------
 2714|  23.7M|            if (outend - out < 3)
  ------------------
  |  Branch (2714:17): [True: 16.9k, False: 23.7M]
  ------------------
 2715|  16.9k|                goto done;
 2716|  23.7M|            out[0] =  (c >> 12)         | 0xE0;
 2717|  23.7M|            out[1] = ((c >>  6) & 0x3F) | 0x80;
 2718|  23.7M|            out[2] =  (c        & 0x3F) | 0x80;
 2719|  23.7M|            in += 2;
 2720|  23.7M|            out += 3;
 2721|  23.7M|        } else {
 2722|       |            /* Surrogate pair */
 2723|  1.70k|            if ((c & 0xFC00) != 0xD800) {
  ------------------
  |  Branch (2723:17): [True: 673, False: 1.03k]
  ------------------
 2724|    673|                ret = XML_ENC_ERR_INPUT;
 2725|    673|                goto done;
 2726|    673|            }
 2727|  1.03k|	    if (inend - in < 4)
  ------------------
  |  Branch (2727:10): [True: 299, False: 735]
  ------------------
 2728|    299|		break;
 2729|    735|            d = (in[2] << 8) | in[3];
 2730|    735|            if ((d & 0xFC00) != 0xDC00) {
  ------------------
  |  Branch (2730:17): [True: 231, False: 504]
  ------------------
 2731|    231|                ret = XML_ENC_ERR_INPUT;
 2732|    231|                goto done;
 2733|    231|            }
 2734|    504|	    if (outend - out < 4)
  ------------------
  |  Branch (2734:10): [True: 119, False: 385]
  ------------------
 2735|    119|		goto done;
 2736|    385|            c = (c << 10) + d - ((0xD800 << 10) + 0xDC00 - 0x10000);
 2737|    385|            out[0] =  (c >> 18)         | 0xF0;
 2738|    385|            out[1] = ((c >> 12) & 0x3F) | 0x80;
 2739|    385|            out[2] = ((c >>  6) & 0x3F) | 0x80;
 2740|    385|            out[3] =  (c        & 0x3F) | 0x80;
 2741|    385|            in += 4;
 2742|    385|            out += 4;
 2743|    385|        }
 2744|  23.8M|    }
 2745|       |
 2746|  10.3k|    ret = out - outstart;
 2747|       |
 2748|  28.9k|done:
 2749|  28.9k|    *outlen = out - outstart;
 2750|  28.9k|    *inlen = in - instart;
 2751|  28.9k|    return(ret);
 2752|  10.3k|}
encoding.c:asciiToAscii:
 2278|  1.23k|             int flush ATTRIBUTE_UNUSED) {
 2279|  1.23k|    const unsigned char *inend;
 2280|  1.23k|    const unsigned char *instart = in;
 2281|  1.23k|    int inlen, outlen, ret;
 2282|       |
 2283|  1.23k|    if (in == NULL) {
  ------------------
  |  Branch (2283:9): [True: 0, False: 1.23k]
  ------------------
 2284|      0|        *pinlen = 0;
 2285|      0|        *poutlen = 0;
 2286|      0|        return(XML_ENC_ERR_SUCCESS);
 2287|      0|    }
 2288|       |
 2289|  1.23k|    inlen = *pinlen;
 2290|  1.23k|    outlen = *poutlen;
 2291|       |
 2292|  1.23k|    if (outlen < inlen) {
  ------------------
  |  Branch (2292:9): [True: 155, False: 1.08k]
  ------------------
 2293|    155|        inlen = outlen;
 2294|    155|        ret = XML_ENC_ERR_SPACE;
 2295|  1.08k|    } else {
 2296|  1.08k|        ret = inlen;
 2297|  1.08k|    }
 2298|       |
 2299|  1.23k|    inend = in + inlen;
 2300|  1.23k|    *poutlen = inlen;
 2301|  1.23k|    *pinlen = inlen;
 2302|       |
 2303|  55.8k|    while (in < inend) {
  ------------------
  |  Branch (2303:12): [True: 55.5k, False: 283]
  ------------------
 2304|  55.5k|	unsigned c = *in;
 2305|       |
 2306|  55.5k|        if (c >= 0x80) {
  ------------------
  |  Branch (2306:13): [True: 956, False: 54.5k]
  ------------------
 2307|    956|	    *poutlen = in - instart;
 2308|    956|	    *pinlen = in - instart;
 2309|    956|	    return(XML_ENC_ERR_INPUT);
 2310|    956|	}
 2311|       |
 2312|  54.5k|        in++;
 2313|  54.5k|	*out++ = c;
 2314|  54.5k|    }
 2315|       |
 2316|    283|    return(ret);
 2317|  1.23k|}
encoding.c:xmlFindExtraHandler:
  908|  8.27k|                    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|  8.27k|    if (impl != NULL)
  ------------------
  |  Branch (915:9): [True: 0, False: 8.27k]
  ------------------
  916|      0|        return(impl(implCtxt, norig, flags, out));
  917|       |
  918|       |    /*
  919|       |     * Deprecated
  920|       |     */
  921|  8.27k|    if (globalHandlers != NULL) {
  ------------------
  |  Branch (921:9): [True: 0, False: 8.27k]
  ------------------
  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|  8.27k|#ifdef LIBXML_ICONV_ENABLED
  939|  8.27k|    {
  940|  8.27k|        int ret = xmlCharEncIconv(name, flags, out);
  941|       |
  942|  8.27k|        if (ret == XML_ERR_OK)
  ------------------
  |  Branch (942:13): [True: 7.48k, False: 788]
  ------------------
  943|  7.48k|            return(XML_ERR_OK);
  944|    788|        if (ret != XML_ERR_UNSUPPORTED_ENCODING)
  ------------------
  |  Branch (944:13): [True: 20, False: 768]
  ------------------
  945|     20|            return(ret);
  946|    788|    }
  947|    768|#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|    768|    return(XML_ERR_UNSUPPORTED_ENCODING);
  961|    788|}
encoding.c:xmlCharEncIconv:
 1319|  8.27k|                xmlCharEncodingHandler **out) {
 1320|  8.27k|    xmlCharEncConvFunc inFunc = NULL, outFunc = NULL;
 1321|  8.27k|    xmlIconvCtxt *inputCtxt = NULL, *outputCtxt = NULL;
 1322|  8.27k|    iconv_t icv_in;
 1323|  8.27k|    iconv_t icv_out;
 1324|  8.27k|    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|  8.27k|    if (strstr(name, "//") != NULL) {
  ------------------
  |  Branch (1353:9): [True: 6, False: 8.26k]
  ------------------
 1354|      6|        ret = XML_ERR_UNSUPPORTED_ENCODING;
 1355|      6|        goto error;
 1356|      6|    }
 1357|       |
 1358|  8.26k|#if defined(FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION) && \
 1359|  8.26k|    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|  8.26k|    if ((xmlEncodingMatch(name, "TSCII")) ||
  ------------------
  |  Branch (1366:9): [True: 236, False: 8.02k]
  ------------------
 1367|  8.02k|        (xmlEncodingMatch(name, "BIG5-HKSCS"))) {
  ------------------
  |  Branch (1367:9): [True: 0, False: 8.02k]
  ------------------
 1368|    236|        ret = XML_ERR_UNSUPPORTED_ENCODING;
 1369|    236|        goto error;
 1370|    236|    }
 1371|  8.02k|#endif
 1372|       |
 1373|  8.02k|    if (flags & XML_ENC_INPUT) {
  ------------------
  |  Branch (1373:9): [True: 8.02k, False: 0]
  ------------------
 1374|  8.02k|        inputCtxt = xmlMalloc(sizeof(xmlIconvCtxt));
 1375|  8.02k|        if (inputCtxt == NULL) {
  ------------------
  |  Branch (1375:13): [True: 7, False: 8.02k]
  ------------------
 1376|      7|            ret = XML_ERR_NO_MEMORY;
 1377|      7|            goto error;
 1378|      7|        }
 1379|  8.02k|        inputCtxt->cd = (iconv_t) -1;
 1380|       |
 1381|  8.02k|        icv_in = iconv_open("UTF-8", name);
 1382|  8.02k|        if (icv_in == (iconv_t) -1) {
  ------------------
  |  Branch (1382:13): [True: 526, False: 7.49k]
  ------------------
 1383|    526|            if (errno == EINVAL)
  ------------------
  |  Branch (1383:17): [True: 526, False: 0]
  ------------------
 1384|    526|                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|    526|            goto error;
 1390|    526|        }
 1391|  7.49k|        inputCtxt->cd = icv_in;
 1392|       |
 1393|  7.49k|        inFunc = xmlIconvConvert;
 1394|  7.49k|    }
 1395|       |
 1396|  7.49k|    if (flags & XML_ENC_OUTPUT) {
  ------------------
  |  Branch (1396:9): [True: 731, False: 6.76k]
  ------------------
 1397|    731|        outputCtxt = xmlMalloc(sizeof(xmlIconvCtxt));
 1398|    731|        if (outputCtxt == NULL) {
  ------------------
  |  Branch (1398:13): [True: 1, False: 730]
  ------------------
 1399|      1|            ret = XML_ERR_NO_MEMORY;
 1400|      1|            goto error;
 1401|      1|        }
 1402|    730|        outputCtxt->cd = (iconv_t) -1;
 1403|       |
 1404|    730|        icv_out = iconv_open(name, "UTF-8");
 1405|    730|        if (icv_out == (iconv_t) -1) {
  ------------------
  |  Branch (1405:13): [True: 0, False: 730]
  ------------------
 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|    730|        outputCtxt->cd = icv_out;
 1415|       |
 1416|    730|        outFunc = xmlIconvConvert;
 1417|    730|    }
 1418|       |
 1419|  7.49k|    return(xmlCharEncNewCustomHandler(name, inFunc, outFunc, xmlIconvFree,
 1420|  7.49k|                                      inputCtxt, outputCtxt, out));
 1421|       |
 1422|    776|error:
 1423|    776|    if (inputCtxt != NULL)
  ------------------
  |  Branch (1423:9): [True: 527, False: 249]
  ------------------
 1424|    527|        xmlIconvFree(inputCtxt);
 1425|    776|    if (outputCtxt != NULL)
  ------------------
  |  Branch (1425:9): [True: 0, False: 776]
  ------------------
 1426|      0|        xmlIconvFree(outputCtxt);
 1427|    776|    return(ret);
 1428|  7.49k|}
encoding.c:xmlEncodingMatch:
 1295|  16.2k|xmlEncodingMatch(const char *name1, const char *name2) {
 1296|       |    /*
 1297|       |     * Fuzzy match for encoding names
 1298|       |     */
 1299|  17.7k|    while (1) {
  ------------------
  |  Branch (1299:12): [True: 17.7k, Folded]
  ------------------
 1300|  19.1k|        while ((*name1 != 0) && (!IS_ASCII_LETTER(*name1)))
  ------------------
  |  |  222|  18.7k|#define IS_ASCII_LETTER(c)	((0x61 <= ((c) | 0x20)) && \
  |  |  ------------------
  |  |  |  Branch (222:29): [True: 17.9k, False: 822]
  |  |  ------------------
  |  |  223|  18.7k|                                 (((c) | 0x20) <= 0x7a))
  |  |  ------------------
  |  |  |  Branch (223:34): [True: 17.3k, False: 606]
  |  |  ------------------
  ------------------
  |  Branch (1300:16): [True: 18.7k, False: 414]
  ------------------
 1301|  1.42k|            name1 += 1;
 1302|  17.7k|        while ((*name2 != 0) && (!IS_ASCII_LETTER(*name2)))
  ------------------
  |  |  222|  17.4k|#define IS_ASCII_LETTER(c)	((0x61 <= ((c) | 0x20)) && \
  |  |  ------------------
  |  |  |  Branch (222:29): [True: 17.4k, False: 0]
  |  |  ------------------
  |  |  223|  17.4k|                                 (((c) | 0x20) <= 0x7a))
  |  |  ------------------
  |  |  |  Branch (223:34): [True: 17.4k, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (1302:16): [True: 17.4k, False: 236]
  ------------------
 1303|      0|            name2 += 1;
 1304|  17.7k|        if ((*name1 == 0) || (*name2 == 0))
  ------------------
  |  Branch (1304:13): [True: 414, False: 17.3k]
  |  Branch (1304:30): [True: 218, False: 17.0k]
  ------------------
 1305|    632|            break;
 1306|  17.0k|        if ((*name1 | 0x20) != (*name2 | 0x20))
  ------------------
  |  Branch (1306:13): [True: 15.6k, False: 1.42k]
  ------------------
 1307|  15.6k|            return(0);
 1308|  1.42k|        name1 += 1;
 1309|  1.42k|        name2 += 1;
 1310|  1.42k|    }
 1311|       |
 1312|       |    /* Only check whether name1 starts with name2 */
 1313|    632|    return(*name2 == 0);
 1314|  16.2k|}
encoding.c:xmlIconvConvert:
 1234|  28.5k|                int flush ATTRIBUTE_UNUSED) {
 1235|  28.5k|    xmlIconvCtxt *ctxt = vctxt;
 1236|  28.5k|    size_t icv_inlen, icv_outlen;
 1237|  28.5k|    const char *icv_in = (const char *) in;
 1238|  28.5k|    char *icv_out = (char *) out;
 1239|  28.5k|    size_t ret;
 1240|       |
 1241|  28.5k|    if ((out == NULL) || (outlen == NULL) || (inlen == NULL) || (in == NULL)) {
  ------------------
  |  Branch (1241:9): [True: 0, False: 28.5k]
  |  Branch (1241:26): [True: 0, False: 28.5k]
  |  Branch (1241:46): [True: 0, False: 28.5k]
  |  Branch (1241:65): [True: 0, False: 28.5k]
  ------------------
 1242|      0|        if (outlen != NULL) *outlen = 0;
  ------------------
  |  Branch (1242:13): [True: 0, False: 0]
  ------------------
 1243|      0|        return(XML_ENC_ERR_INTERNAL);
 1244|      0|    }
 1245|  28.5k|    icv_inlen = *inlen;
 1246|  28.5k|    icv_outlen = *outlen;
 1247|       |    /*
 1248|       |     * Some versions take const, other versions take non-const input.
 1249|       |     */
 1250|  28.5k|    ret = iconv(ctxt->cd, (void *) &icv_in, &icv_inlen, &icv_out, &icv_outlen);
 1251|  28.5k|    *inlen -= icv_inlen;
 1252|  28.5k|    *outlen -= icv_outlen;
 1253|  28.5k|    if (ret == (size_t) -1) {
  ------------------
  |  Branch (1253:9): [True: 10.7k, False: 17.7k]
  ------------------
 1254|  10.7k|        if (errno == EILSEQ)
  ------------------
  |  Branch (1254:13): [True: 543, False: 10.2k]
  ------------------
 1255|    543|            return(XML_ENC_ERR_INPUT);
 1256|  10.2k|        if (errno == E2BIG)
  ------------------
  |  Branch (1256:13): [True: 8.95k, False: 1.27k]
  ------------------
 1257|  8.95k|            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|  1.27k|        if (errno == EINVAL)
  ------------------
  |  Branch (1262:13): [True: 1.27k, False: 0]
  ------------------
 1263|  1.27k|            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|  1.27k|    }
 1274|  17.7k|    return(XML_ENC_ERR_SUCCESS);
 1275|  28.5k|}
encoding.c:xmlIconvFree:
 1278|  15.5k|xmlIconvFree(void *vctxt) {
 1279|  15.5k|    xmlIconvCtxt *ctxt = vctxt;
 1280|       |
 1281|  15.5k|    if (ctxt == NULL)
  ------------------
  |  Branch (1281:9): [True: 6.75k, False: 8.75k]
  ------------------
 1282|  6.75k|        return;
 1283|       |
 1284|  8.75k|    if (ctxt->cd != (iconv_t) -1)
  ------------------
  |  Branch (1284:9): [True: 8.22k, False: 526]
  ------------------
 1285|  8.22k|        iconv_close(ctxt->cd);
 1286|       |
 1287|  8.75k|    xmlFree(ctxt);
 1288|  8.75k|}
encoding.c:xmlEncConvertError:
 1649|  3.74k|xmlEncConvertError(xmlCharEncError code) {
 1650|  3.74k|    xmlParserErrors ret;
 1651|       |
 1652|  3.74k|    switch (code) {
 1653|      0|        case XML_ENC_ERR_SUCCESS:
  ------------------
  |  Branch (1653:9): [True: 0, False: 3.74k]
  ------------------
 1654|      0|            ret = XML_ERR_OK;
 1655|      0|            break;
 1656|  3.74k|        case XML_ENC_ERR_INPUT:
  ------------------
  |  Branch (1656:9): [True: 3.74k, False: 0]
  ------------------
 1657|  3.74k|            ret = XML_ERR_INVALID_ENCODING;
 1658|  3.74k|            break;
 1659|      0|        case XML_ENC_ERR_MEMORY:
  ------------------
  |  Branch (1659:9): [True: 0, False: 3.74k]
  ------------------
 1660|      0|            ret = XML_ERR_NO_MEMORY;
 1661|      0|            break;
 1662|      0|        default:
  ------------------
  |  Branch (1662:9): [True: 0, False: 3.74k]
  ------------------
 1663|      0|            ret = XML_ERR_INTERNAL_ERROR;
 1664|      0|            break;
 1665|  3.74k|    }
 1666|       |
 1667|  3.74k|    return(ret);
 1668|  3.74k|}
encoding.c:latin1ToUTF8:
 2323|  23.0k|             int flush ATTRIBUTE_UNUSED) {
 2324|  23.0k|    unsigned char* outstart = out;
 2325|  23.0k|    const unsigned char* instart = in;
 2326|  23.0k|    unsigned char* outend;
 2327|  23.0k|    const unsigned char* inend;
 2328|  23.0k|    int ret = XML_ENC_ERR_SPACE;
 2329|       |
 2330|  23.0k|    if ((out == NULL) || (in == NULL) || (outlen == NULL) || (inlen == NULL))
  ------------------
  |  Branch (2330:9): [True: 0, False: 23.0k]
  |  Branch (2330:26): [True: 0, False: 23.0k]
  |  Branch (2330:42): [True: 0, False: 23.0k]
  |  Branch (2330:62): [True: 0, False: 23.0k]
  ------------------
 2331|      0|	return(XML_ENC_ERR_INTERNAL);
 2332|       |
 2333|  23.0k|    outend = out + *outlen;
 2334|  23.0k|    inend = in + *inlen;
 2335|       |
 2336|  21.3M|    while (in < inend) {
  ------------------
  |  Branch (2336:12): [True: 21.2M, False: 16.1k]
  ------------------
 2337|  21.2M|        unsigned c = *in;
 2338|       |
 2339|  21.2M|	if (c < 0x80) {
  ------------------
  |  Branch (2339:6): [True: 5.97M, False: 15.3M]
  ------------------
 2340|  5.97M|            if (out >= outend)
  ------------------
  |  Branch (2340:17): [True: 2.58k, False: 5.97M]
  ------------------
 2341|  2.58k|                goto done;
 2342|  5.97M|            *out++ = c;
 2343|  15.3M|	} else {
 2344|  15.3M|            if (outend - out < 2)
  ------------------
  |  Branch (2344:17): [True: 4.28k, False: 15.3M]
  ------------------
 2345|  4.28k|                goto done;
 2346|  15.3M|	    *out++ = (c >> 6) | 0xC0;
 2347|  15.3M|            *out++ = (c & 0x3F) | 0x80;
 2348|  15.3M|        }
 2349|       |
 2350|  21.2M|        in++;
 2351|  21.2M|    }
 2352|       |
 2353|  16.1k|    ret = out - outstart;
 2354|       |
 2355|  23.0k|done:
 2356|  23.0k|    *outlen = out - outstart;
 2357|  23.0k|    *inlen = in - instart;
 2358|  23.0k|    return(ret);
 2359|  16.1k|}

xmlFreeEntity:
   85|   121k|{
   86|   121k|    xmlDictPtr dict = NULL;
   87|       |
   88|   121k|    if (entity == NULL)
  ------------------
  |  Branch (88:9): [True: 0, False: 121k]
  ------------------
   89|      0|        return;
   90|       |
   91|   121k|    if (entity->doc != NULL)
  ------------------
  |  Branch (91:9): [True: 121k, False: 0]
  ------------------
   92|   121k|        dict = entity->doc->dict;
   93|       |
   94|       |
   95|   121k|    if ((entity->children) &&
  ------------------
  |  Branch (95:9): [True: 2.82k, False: 118k]
  ------------------
   96|  2.82k|        (entity == (xmlEntityPtr) entity->children->parent))
  ------------------
  |  Branch (96:9): [True: 2.82k, False: 0]
  ------------------
   97|  2.82k|        xmlFreeNodeList(entity->children);
   98|   121k|    if ((entity->name != NULL) &&
  ------------------
  |  Branch (98:9): [True: 121k, False: 4]
  ------------------
   99|   121k|        ((dict == NULL) || (!xmlDictOwns(dict, entity->name))))
  ------------------
  |  Branch (99:10): [True: 81.9k, False: 39.0k]
  |  Branch (99:28): [True: 0, False: 39.0k]
  ------------------
  100|  81.9k|        xmlFree((char *) entity->name);
  101|   121k|    if (entity->ExternalID != NULL)
  ------------------
  |  Branch (101:9): [True: 4.44k, False: 116k]
  ------------------
  102|  4.44k|        xmlFree((char *) entity->ExternalID);
  103|   121k|    if (entity->SystemID != NULL)
  ------------------
  |  Branch (103:9): [True: 13.7k, False: 107k]
  ------------------
  104|  13.7k|        xmlFree((char *) entity->SystemID);
  105|   121k|    if (entity->URI != NULL)
  ------------------
  |  Branch (105:9): [True: 7.42k, False: 113k]
  ------------------
  106|  7.42k|        xmlFree((char *) entity->URI);
  107|   121k|    if (entity->content != NULL)
  ------------------
  |  Branch (107:9): [True: 102k, False: 18.1k]
  ------------------
  108|   102k|        xmlFree((char *) entity->content);
  109|   121k|    if (entity->orig != NULL)
  ------------------
  |  Branch (109:9): [True: 12.5k, False: 108k]
  ------------------
  110|  12.5k|        xmlFree((char *) entity->orig);
  111|   121k|    xmlFree(entity);
  112|   121k|}
xmlAddEntity:
  188|   124k|	  const xmlChar *content, xmlEntity **out) {
  189|   124k|    xmlDtdPtr dtd;
  190|   124k|    xmlDictPtr dict = NULL;
  191|   124k|    xmlEntitiesTablePtr table = NULL;
  192|   124k|    xmlEntityPtr ret, predef;
  193|   124k|    int res;
  194|       |
  195|   124k|    if (out != NULL)
  ------------------
  |  Branch (195:9): [True: 124k, False: 0]
  ------------------
  196|   124k|        *out = NULL;
  197|   124k|    if ((doc == NULL) || (name == NULL))
  ------------------
  |  Branch (197:9): [True: 0, False: 124k]
  |  Branch (197:26): [True: 0, False: 124k]
  ------------------
  198|      0|	return(XML_ERR_ARGUMENT);
  199|   124k|    dict = doc->dict;
  200|       |
  201|   124k|    if (extSubset)
  ------------------
  |  Branch (201:9): [True: 13.3k, False: 111k]
  ------------------
  202|  13.3k|        dtd = doc->extSubset;
  203|   111k|    else
  204|   111k|        dtd = doc->intSubset;
  205|   124k|    if (dtd == NULL)
  ------------------
  |  Branch (205:9): [True: 0, False: 124k]
  ------------------
  206|      0|        return(XML_DTD_NO_DTD);
  207|       |
  208|   124k|    switch (type) {
  209|  53.8k|        case XML_INTERNAL_GENERAL_ENTITY:
  ------------------
  |  Branch (209:9): [True: 53.8k, False: 70.5k]
  ------------------
  210|  65.8k|        case XML_EXTERNAL_GENERAL_PARSED_ENTITY:
  ------------------
  |  Branch (210:9): [True: 11.9k, False: 112k]
  ------------------
  211|  66.5k|        case XML_EXTERNAL_GENERAL_UNPARSED_ENTITY:
  ------------------
  |  Branch (211:9): [True: 649, False: 123k]
  ------------------
  212|  66.5k|            predef = xmlGetPredefinedEntity(name);
  213|  66.5k|            if (predef != NULL) {
  ------------------
  |  Branch (213:17): [True: 4.99k, False: 61.5k]
  ------------------
  214|  4.99k|                int valid = 0;
  215|       |
  216|       |                /* 4.6 Predefined Entities */
  217|  4.99k|                if ((type == XML_INTERNAL_GENERAL_ENTITY) &&
  ------------------
  |  Branch (217:21): [True: 4.39k, False: 592]
  ------------------
  218|  4.39k|                    (content != NULL)) {
  ------------------
  |  Branch (218:21): [True: 3.51k, False: 886]
  ------------------
  219|  3.51k|                    int c = predef->content[0];
  220|       |
  221|  3.51k|                    if (((content[0] == c) && (content[1] == 0)) &&
  ------------------
  |  Branch (221:26): [True: 2.61k, False: 896]
  |  Branch (221:47): [True: 1.74k, False: 876]
  ------------------
  222|  1.74k|                        ((c == '>') || (c == '\'') || (c == '"'))) {
  ------------------
  |  Branch (222:26): [True: 483, False: 1.25k]
  |  Branch (222:40): [True: 243, False: 1.01k]
  |  Branch (222:55): [True: 599, False: 415]
  ------------------
  223|  1.32k|                        valid = 1;
  224|  2.18k|                    } else if ((content[0] == '&') && (content[1] == '#')) {
  ------------------
  |  Branch (224:32): [True: 1.49k, False: 691]
  |  Branch (224:55): [True: 1.06k, False: 433]
  ------------------
  225|  1.06k|                        if (content[2] == 'x') {
  ------------------
  |  Branch (225:29): [True: 96, False: 967]
  ------------------
  226|     96|                            xmlChar *hex = BAD_CAST "0123456789ABCDEF";
  ------------------
  |  |   34|     96|#define BAD_CAST (xmlChar *)
  ------------------
  227|     96|                            xmlChar ref[] = "00;";
  228|       |
  229|     96|                            ref[0] = hex[c / 16 % 16];
  230|     96|                            ref[1] = hex[c % 16];
  231|     96|                            if (xmlStrcasecmp(&content[3], ref) == 0)
  ------------------
  |  Branch (231:33): [True: 19, False: 77]
  ------------------
  232|     19|                                valid = 1;
  233|    967|                        } else {
  234|    967|                            xmlChar ref[] = "00;";
  235|       |
  236|    967|                            ref[0] = '0' + c / 10 % 10;
  237|    967|                            ref[1] = '0' + c % 10;
  238|    967|                            if (xmlStrEqual(&content[2], ref))
  ------------------
  |  Branch (238:33): [True: 253, False: 714]
  ------------------
  239|    253|                                valid = 1;
  240|    967|                        }
  241|  1.06k|                    }
  242|  3.51k|                }
  243|  4.99k|                if (!valid)
  ------------------
  |  Branch (243:21): [True: 3.39k, False: 1.59k]
  ------------------
  244|  3.39k|                    return(XML_ERR_REDECL_PREDEF_ENTITY);
  245|  4.99k|            }
  246|  63.1k|	    if (dtd->entities == NULL) {
  ------------------
  |  Branch (246:10): [True: 4.58k, False: 58.5k]
  ------------------
  247|  4.58k|		dtd->entities = xmlHashCreateDict(0, dict);
  248|  4.58k|                if (dtd->entities == NULL)
  ------------------
  |  Branch (248:21): [True: 3, False: 4.57k]
  ------------------
  249|      3|                    return(XML_ERR_NO_MEMORY);
  250|  4.58k|            }
  251|  63.1k|	    table = dtd->entities;
  252|  63.1k|	    break;
  253|  51.6k|        case XML_INTERNAL_PARAMETER_ENTITY:
  ------------------
  |  Branch (253:9): [True: 51.6k, False: 72.8k]
  ------------------
  254|  57.9k|        case XML_EXTERNAL_PARAMETER_ENTITY:
  ------------------
  |  Branch (254:9): [True: 6.29k, False: 118k]
  ------------------
  255|  57.9k|	    if (dtd->pentities == NULL) {
  ------------------
  |  Branch (255:10): [True: 3.20k, False: 54.7k]
  ------------------
  256|  3.20k|		dtd->pentities = xmlHashCreateDict(0, dict);
  257|  3.20k|                if (dtd->pentities == NULL)
  ------------------
  |  Branch (257:21): [True: 1, False: 3.20k]
  ------------------
  258|      1|                    return(XML_ERR_NO_MEMORY);
  259|  3.20k|            }
  260|  57.9k|	    table = dtd->pentities;
  261|  57.9k|	    break;
  262|      0|        default:
  ------------------
  |  Branch (262:9): [True: 0, False: 124k]
  ------------------
  263|      0|	    return(XML_ERR_ARGUMENT);
  264|   124k|    }
  265|   121k|    ret = xmlCreateEntity(dtd->doc, name, type, publicId, systemId, content);
  266|   121k|    if (ret == NULL)
  ------------------
  |  Branch (266:9): [True: 22, False: 121k]
  ------------------
  267|     22|        return(XML_ERR_NO_MEMORY);
  268|       |
  269|   121k|    res = xmlHashAdd(table, name, ret);
  270|   121k|    if (res < 0) {
  ------------------
  |  Branch (270:9): [True: 5, False: 121k]
  ------------------
  271|      5|        xmlFreeEntity(ret);
  272|      5|        return(XML_ERR_NO_MEMORY);
  273|   121k|    } else if (res == 0) {
  ------------------
  |  Branch (273:16): [True: 100k, False: 20.4k]
  ------------------
  274|       |	/*
  275|       |	 * entity was already defined at another level.
  276|       |	 */
  277|   100k|        xmlFreeEntity(ret);
  278|   100k|	return(XML_WAR_ENTITY_REDEFINED);
  279|   100k|    }
  280|       |
  281|       |    /*
  282|       |     * Link it to the DTD
  283|       |     */
  284|  20.4k|    ret->parent = dtd;
  285|  20.4k|    ret->doc = dtd->doc;
  286|  20.4k|    if (dtd->last == NULL) {
  ------------------
  |  Branch (286:9): [True: 5.31k, False: 15.1k]
  ------------------
  287|  5.31k|	dtd->children = dtd->last = (xmlNodePtr) ret;
  288|  15.1k|    } else {
  289|  15.1k|	dtd->last->next = (xmlNodePtr) ret;
  290|  15.1k|	ret->prev = dtd->last;
  291|  15.1k|	dtd->last = (xmlNodePtr) ret;
  292|  15.1k|    }
  293|       |
  294|  20.4k|    if (out != NULL)
  ------------------
  |  Branch (294:9): [True: 20.4k, False: 0]
  ------------------
  295|  20.4k|        *out = ret;
  296|  20.4k|    return(0);
  297|   121k|}
xmlGetPredefinedEntity:
  306|  4.97M|xmlGetPredefinedEntity(const xmlChar *name) {
  307|  4.97M|    if (name == NULL) return(NULL);
  ------------------
  |  Branch (307:9): [True: 4, False: 4.97M]
  ------------------
  308|  4.97M|    switch (name[0]) {
  309|   210k|        case 'l':
  ------------------
  |  Branch (309:9): [True: 210k, False: 4.76M]
  ------------------
  310|   210k|	    if (xmlStrEqual(name, BAD_CAST "lt"))
  ------------------
  |  |   34|   210k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (310:10): [True: 11.1k, False: 199k]
  ------------------
  311|  11.1k|	        return(&xmlEntityLt);
  312|   199k|	    break;
  313|  1.26M|        case 'g':
  ------------------
  |  Branch (313:9): [True: 1.26M, False: 3.70M]
  ------------------
  314|  1.26M|	    if (xmlStrEqual(name, BAD_CAST "gt"))
  ------------------
  |  |   34|  1.26M|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (314:10): [True: 1.24M, False: 19.8k]
  ------------------
  315|  1.24M|	        return(&xmlEntityGt);
  316|  19.8k|	    break;
  317|  72.4k|        case 'a':
  ------------------
  |  Branch (317:9): [True: 72.4k, False: 4.90M]
  ------------------
  318|  72.4k|	    if (xmlStrEqual(name, BAD_CAST "amp"))
  ------------------
  |  |   34|  72.4k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (318:10): [True: 8.76k, False: 63.6k]
  ------------------
  319|  8.76k|	        return(&xmlEntityAmp);
  320|  63.6k|	    if (xmlStrEqual(name, BAD_CAST "apos"))
  ------------------
  |  |   34|  63.6k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (320:10): [True: 4.97k, False: 58.7k]
  ------------------
  321|  4.97k|	        return(&xmlEntityApos);
  322|  58.7k|	    break;
  323|  62.2k|        case 'q':
  ------------------
  |  Branch (323:9): [True: 62.2k, False: 4.91M]
  ------------------
  324|  62.2k|	    if (xmlStrEqual(name, BAD_CAST "quot"))
  ------------------
  |  |   34|  62.2k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (324:10): [True: 61.4k, False: 785]
  ------------------
  325|  61.4k|	        return(&xmlEntityQuot);
  326|    785|	    break;
  327|  3.36M|	default:
  ------------------
  |  Branch (327:2): [True: 3.36M, False: 1.61M]
  ------------------
  328|  3.36M|	    break;
  329|  4.97M|    }
  330|  3.63M|    return(NULL);
  331|  4.97M|}
xmlAddDocEntity:
  372|    140|	        const xmlChar *content) {
  373|    140|    xmlEntityPtr ret;
  374|       |
  375|    140|    xmlAddEntity(doc, 0, name, type, publicId, systemId, content, &ret);
  376|    140|    return(ret);
  377|    140|}
xmlGetParameterEntity:
  428|   398k|xmlGetParameterEntity(xmlDoc *doc, const xmlChar *name) {
  429|   398k|    xmlEntitiesTablePtr table;
  430|   398k|    xmlEntityPtr ret;
  431|       |
  432|   398k|    if (doc == NULL)
  ------------------
  |  Branch (432:9): [True: 40, False: 398k]
  ------------------
  433|     40|	return(NULL);
  434|   398k|    if ((doc->intSubset != NULL) && (doc->intSubset->pentities != NULL)) {
  ------------------
  |  Branch (434:9): [True: 398k, False: 37]
  |  Branch (434:37): [True: 385k, False: 12.3k]
  ------------------
  435|   385k|	table = (xmlEntitiesTablePtr) doc->intSubset->pentities;
  436|   385k|	ret = xmlGetEntityFromTable(table, name);
  437|   385k|	if (ret != NULL)
  ------------------
  |  Branch (437:6): [True: 296k, False: 89.1k]
  ------------------
  438|   296k|	    return(ret);
  439|   385k|    }
  440|   101k|    if ((doc->extSubset != NULL) && (doc->extSubset->pentities != NULL)) {
  ------------------
  |  Branch (440:9): [True: 13.4k, False: 88.0k]
  |  Branch (440:37): [True: 13.2k, False: 259]
  ------------------
  441|  13.2k|	table = (xmlEntitiesTablePtr) doc->extSubset->pentities;
  442|  13.2k|	return(xmlGetEntityFromTable(table, name));
  443|  13.2k|    }
  444|  88.3k|    return(NULL);
  445|   101k|}
xmlGetDocEntity:
  476|  2.41M|xmlGetDocEntity(const xmlDoc *doc, const xmlChar *name) {
  477|  2.41M|    xmlEntityPtr cur;
  478|  2.41M|    xmlEntitiesTablePtr table;
  479|       |
  480|  2.41M|    if (doc != NULL) {
  ------------------
  |  Branch (480:9): [True: 2.41M, False: 208]
  ------------------
  481|  2.41M|	if ((doc->intSubset != NULL) && (doc->intSubset->entities != NULL)) {
  ------------------
  |  Branch (481:6): [True: 2.40M, False: 8.24k]
  |  Branch (481:34): [True: 2.31M, False: 87.2k]
  ------------------
  482|  2.31M|	    table = (xmlEntitiesTablePtr) doc->intSubset->entities;
  483|  2.31M|	    cur = xmlGetEntityFromTable(table, name);
  484|  2.31M|	    if (cur != NULL)
  ------------------
  |  Branch (484:10): [True: 1.98M, False: 336k]
  ------------------
  485|  1.98M|		return(cur);
  486|  2.31M|	}
  487|   431k|	if (doc->standalone != 1) {
  ------------------
  |  Branch (487:6): [True: 430k, False: 737]
  ------------------
  488|   430k|	    if ((doc->extSubset != NULL) &&
  ------------------
  |  Branch (488:10): [True: 12.3k, False: 418k]
  ------------------
  489|  12.3k|		(doc->extSubset->entities != NULL)) {
  ------------------
  |  Branch (489:3): [True: 11.0k, False: 1.29k]
  ------------------
  490|  11.0k|		table = (xmlEntitiesTablePtr) doc->extSubset->entities;
  491|  11.0k|		cur = xmlGetEntityFromTable(table, name);
  492|  11.0k|		if (cur != NULL)
  ------------------
  |  Branch (492:7): [True: 9.76k, False: 1.29k]
  ------------------
  493|  9.76k|		    return(cur);
  494|  11.0k|	    }
  495|   430k|	}
  496|   431k|    }
  497|   422k|    return(xmlGetPredefinedEntity(name));
  498|  2.41M|}
xmlFreeEntitiesTable:
  588|  7.78k|xmlFreeEntitiesTable(xmlEntitiesTable *table) {
  589|  7.78k|    xmlHashFree(table, xmlFreeEntityWrapper);
  590|  7.78k|}
entities.c:xmlCreateEntity:
  120|   121k|	        const xmlChar *content) {
  121|   121k|    xmlEntityPtr ret;
  122|       |
  123|   121k|    ret = (xmlEntityPtr) xmlMalloc(sizeof(xmlEntity));
  124|   121k|    if (ret == NULL)
  ------------------
  |  Branch (124:9): [True: 8, False: 121k]
  ------------------
  125|      8|	return(NULL);
  126|   121k|    memset(ret, 0, sizeof(xmlEntity));
  127|   121k|    ret->doc = doc;
  128|   121k|    ret->type = XML_ENTITY_DECL;
  129|       |
  130|       |    /*
  131|       |     * fill the structure.
  132|       |     */
  133|   121k|    ret->etype = (xmlEntityType) type;
  134|   121k|    if ((doc == NULL) || (doc->dict == NULL))
  ------------------
  |  Branch (134:9): [True: 0, False: 121k]
  |  Branch (134:26): [True: 81.9k, False: 39.0k]
  ------------------
  135|  81.9k|	ret->name = xmlStrdup(name);
  136|  39.0k|    else
  137|  39.0k|        ret->name = xmlDictLookup(doc->dict, name, -1);
  138|   121k|    if (ret->name == NULL)
  ------------------
  |  Branch (138:9): [True: 4, False: 121k]
  ------------------
  139|      4|        goto error;
  140|   121k|    if (publicId != NULL) {
  ------------------
  |  Branch (140:9): [True: 4.44k, False: 116k]
  ------------------
  141|  4.44k|        ret->ExternalID = xmlStrdup(publicId);
  142|  4.44k|        if (ret->ExternalID == NULL)
  ------------------
  |  Branch (142:13): [True: 2, False: 4.44k]
  ------------------
  143|      2|            goto error;
  144|  4.44k|    }
  145|   121k|    if (systemId != NULL) {
  ------------------
  |  Branch (145:9): [True: 13.7k, False: 107k]
  ------------------
  146|  13.7k|        ret->SystemID = xmlStrdup(systemId);
  147|  13.7k|        if (ret->SystemID == NULL)
  ------------------
  |  Branch (147:13): [True: 2, False: 13.7k]
  ------------------
  148|      2|            goto error;
  149|  13.7k|    }
  150|   121k|    if (content != NULL) {
  ------------------
  |  Branch (150:9): [True: 102k, False: 18.3k]
  ------------------
  151|   102k|        ret->length = xmlStrlen(content);
  152|   102k|	ret->content = xmlStrndup(content, ret->length);
  153|   102k|        if (ret->content == NULL)
  ------------------
  |  Branch (153:13): [True: 6, False: 102k]
  ------------------
  154|      6|            goto error;
  155|   102k|     } else {
  156|  18.3k|        ret->length = 0;
  157|  18.3k|        ret->content = NULL;
  158|  18.3k|    }
  159|   121k|    ret->URI = NULL; /* to be computed by the layer knowing
  160|       |			the defining entity */
  161|   121k|    ret->orig = NULL;
  162|       |
  163|   121k|    return(ret);
  164|       |
  165|     14|error:
  166|     14|    xmlFreeEntity(ret);
  167|       |    return(NULL);
  168|   121k|}
entities.c:xmlGetEntityFromTable:
  415|  2.72M|xmlGetEntityFromTable(xmlEntitiesTablePtr table, const xmlChar *name) {
  416|  2.72M|    return((xmlEntityPtr) xmlHashLookup(table, name));
  417|  2.72M|}
entities.c:xmlFreeEntityWrapper:
  575|  20.4k|xmlFreeEntityWrapper(void *entity, const xmlChar *name ATTRIBUTE_UNUSED) {
  576|  20.4k|    if (entity != NULL)
  ------------------
  |  Branch (576:9): [True: 20.4k, False: 0]
  ------------------
  577|  20.4k|	xmlFreeEntity((xmlEntityPtr) entity);
  578|  20.4k|}

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

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

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|  36.5k|LLVMFuzzerTestOneInput(const char *data, size_t size) {
  105|  36.5k|    xmlTextReaderPtr reader;
  106|  36.5k|    xmlDocPtr doc = NULL;
  107|  36.5k|    const xmlError *error;
  108|  36.5k|    const char *docBuffer;
  109|  36.5k|    const unsigned char *program;
  110|  36.5k|    size_t failurePos, docSize, programSize, i;
  111|  36.5k|    size_t totalStringSize = 0;
  112|  36.5k|    int opts;
  113|  36.5k|    int oomReport = 0;
  114|       |
  115|  36.5k|    xmlFuzzDataInit(data, size);
  116|  36.5k|    opts = (int) xmlFuzzReadInt(4);
  117|  36.5k|    failurePos = xmlFuzzReadInt(4) % (size + 100);
  118|       |
  119|  36.5k|    program = (const unsigned char *) xmlFuzzReadString(&programSize);
  120|  36.5k|    if (programSize > 1000)
  ------------------
  |  Branch (120:9): [True: 37, False: 36.5k]
  ------------------
  121|     37|        programSize = 1000;
  122|       |
  123|  36.5k|    xmlFuzzReadEntities();
  124|  36.5k|    docBuffer = xmlFuzzMainEntity(&docSize);
  125|  36.5k|    if (docBuffer == NULL)
  ------------------
  |  Branch (125:9): [True: 112, False: 36.4k]
  ------------------
  126|    112|        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|  36.4k|    xmlFuzzInjectFailure(failurePos);
  142|  36.4k|    reader = xmlReaderForMemory(docBuffer, docSize, NULL, NULL, opts);
  143|  36.4k|    if (reader == NULL)
  ------------------
  |  Branch (143:9): [True: 66, False: 36.4k]
  ------------------
  144|     66|        goto exit;
  145|       |
  146|  36.4k|    xmlTextReaderSetStructuredErrorHandler(reader, xmlFuzzSErrorFunc, NULL);
  147|  36.4k|    xmlTextReaderSetResourceLoader(reader, xmlFuzzResourceLoader, NULL);
  148|       |
  149|  36.4k|    i = 0;
  150|   767k|    while (i < programSize) {
  ------------------
  |  Branch (150:12): [True: 732k, False: 35.2k]
  ------------------
  151|   732k|        int op = program[i++];
  152|       |
  153|   732k|#define READ_BYTE() (i < programSize ? program[i++] : 0)
  154|   732k|#define FREE_STRING(str) \
  155|   732k|    do { \
  156|   732k|        if (str != NULL) { \
  157|   732k|            totalStringSize += strlen((char *) str); \
  158|   732k|            xmlFree(str); \
  159|   732k|        } \
  160|   732k|    } while (0)
  161|       |
  162|   732k|        switch (op & 0x3F) {
  163|  49.7k|            case OP_READ:
  ------------------
  |  Branch (163:13): [True: 49.7k, False: 682k]
  ------------------
  164|   244k|            default:
  ------------------
  |  Branch (164:13): [True: 195k, False: 537k]
  ------------------
  165|   244k|                startOp("Read");
  166|   244k|                xmlTextReaderRead(reader);
  167|   244k|                break;
  168|       |
  169|  13.2k|            case OP_READ_INNER_XML: {
  ------------------
  |  Branch (169:13): [True: 13.2k, False: 719k]
  ------------------
  170|  13.2k|                xmlChar *result;
  171|       |
  172|  13.2k|                startOp("ReadInnerXml");
  173|  13.2k|                result = xmlTextReaderReadInnerXml(reader);
  174|  13.2k|                FREE_STRING(result);
  ------------------
  |  |  155|  13.2k|    do { \
  |  |  156|  13.2k|        if (str != NULL) { \
  |  |  ------------------
  |  |  |  Branch (156:13): [True: 7.54k, False: 5.67k]
  |  |  ------------------
  |  |  157|  7.54k|            totalStringSize += strlen((char *) str); \
  |  |  158|  7.54k|            xmlFree(str); \
  |  |  159|  7.54k|        } \
  |  |  160|  13.2k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (160:14): [Folded, False: 13.2k]
  |  |  ------------------
  ------------------
  175|  13.2k|                break;
  176|  49.7k|            }
  177|       |
  178|  29.7k|            case OP_READ_OUTER_XML: {
  ------------------
  |  Branch (178:13): [True: 29.7k, False: 702k]
  ------------------
  179|  29.7k|                xmlChar *result;
  180|       |
  181|  29.7k|                startOp("ReadOuterXml");
  182|  29.7k|                result = xmlTextReaderReadOuterXml(reader);
  183|  29.7k|                FREE_STRING(result);
  ------------------
  |  |  155|  29.7k|    do { \
  |  |  156|  29.7k|        if (str != NULL) { \
  |  |  ------------------
  |  |  |  Branch (156:13): [True: 22.3k, False: 7.38k]
  |  |  ------------------
  |  |  157|  22.3k|            totalStringSize += strlen((char *) str); \
  |  |  158|  22.3k|            xmlFree(str); \
  |  |  159|  22.3k|        } \
  |  |  160|  29.7k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (160:14): [Folded, False: 29.7k]
  |  |  ------------------
  ------------------
  184|  29.7k|                break;
  185|  49.7k|            }
  186|       |
  187|  8.80k|            case OP_READ_STRING: {
  ------------------
  |  Branch (187:13): [True: 8.80k, False: 723k]
  ------------------
  188|  8.80k|                xmlChar *result;
  189|       |
  190|  8.80k|                startOp("ReadString");
  191|  8.80k|                result = xmlTextReaderReadString(reader);
  192|  8.80k|                FREE_STRING(result);
  ------------------
  |  |  155|  8.80k|    do { \
  |  |  156|  8.80k|        if (str != NULL) { \
  |  |  ------------------
  |  |  |  Branch (156:13): [True: 2.29k, False: 6.51k]
  |  |  ------------------
  |  |  157|  2.29k|            totalStringSize += strlen((char *) str); \
  |  |  158|  2.29k|            xmlFree(str); \
  |  |  159|  2.29k|        } \
  |  |  160|  8.80k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (160:14): [Folded, False: 8.80k]
  |  |  ------------------
  ------------------
  193|  8.80k|                break;
  194|  49.7k|            }
  195|       |
  196|  10.1k|            case OP_READ_ATTRIBUTE_VALUE:
  ------------------
  |  Branch (196:13): [True: 10.1k, False: 722k]
  ------------------
  197|  10.1k|                startOp("ReadAttributeValue");
  198|  10.1k|                xmlTextReaderReadAttributeValue(reader);
  199|  10.1k|                break;
  200|       |
  201|  8.96k|            case OP_ATTRIBUTE_COUNT:
  ------------------
  |  Branch (201:13): [True: 8.96k, False: 723k]
  ------------------
  202|  8.96k|                startOp("AttributeCount");
  203|  8.96k|                xmlTextReaderAttributeCount(reader);
  204|  8.96k|                break;
  205|       |
  206|  3.69k|            case OP_DEPTH:
  ------------------
  |  Branch (206:13): [True: 3.69k, False: 728k]
  ------------------
  207|  3.69k|                startOp("Depth");
  208|  3.69k|                xmlTextReaderDepth(reader);
  209|  3.69k|                break;
  210|       |
  211|  3.45k|            case OP_HAS_ATTRIBUTES:
  ------------------
  |  Branch (211:13): [True: 3.45k, False: 728k]
  ------------------
  212|  3.45k|                startOp("HasAttributes");
  213|  3.45k|                xmlTextReaderHasAttributes(reader);
  214|  3.45k|                break;
  215|       |
  216|  11.5k|            case OP_HAS_VALUE:
  ------------------
  |  Branch (216:13): [True: 11.5k, False: 720k]
  ------------------
  217|  11.5k|                startOp("HasValue");
  218|  11.5k|                xmlTextReaderHasValue(reader);
  219|  11.5k|                break;
  220|       |
  221|  6.56k|            case OP_IS_DEFAULT:
  ------------------
  |  Branch (221:13): [True: 6.56k, False: 725k]
  ------------------
  222|  6.56k|                startOp("IsDefault");
  223|  6.56k|                xmlTextReaderIsDefault(reader);
  224|  6.56k|                break;
  225|       |
  226|  9.95k|            case OP_IS_EMPTY_ELEMENT:
  ------------------
  |  Branch (226:13): [True: 9.95k, False: 722k]
  ------------------
  227|  9.95k|                startOp("IsEmptyElement");
  228|  9.95k|                xmlTextReaderIsEmptyElement(reader);
  229|  9.95k|                break;
  230|       |
  231|  10.2k|            case OP_NODE_TYPE:
  ------------------
  |  Branch (231:13): [True: 10.2k, False: 722k]
  ------------------
  232|  10.2k|                startOp("NodeType");
  233|  10.2k|                xmlTextReaderNodeType(reader);
  234|  10.2k|                break;
  235|       |
  236|  3.69k|            case OP_QUOTE_CHAR:
  ------------------
  |  Branch (236:13): [True: 3.69k, False: 728k]
  ------------------
  237|  3.69k|                startOp("QuoteChar");
  238|  3.69k|                xmlTextReaderQuoteChar(reader);
  239|  3.69k|                break;
  240|       |
  241|  5.59k|            case OP_READ_STATE:
  ------------------
  |  Branch (241:13): [True: 5.59k, False: 726k]
  ------------------
  242|  5.59k|                startOp("ReadState");
  243|  5.59k|                xmlTextReaderReadState(reader);
  244|  5.59k|                break;
  245|       |
  246|  3.57k|            case OP_IS_NAMESPACE_DECL:
  ------------------
  |  Branch (246:13): [True: 3.57k, False: 728k]
  ------------------
  247|  3.57k|                startOp("IsNamespaceDecl");
  248|  3.57k|                xmlTextReaderIsNamespaceDecl(reader);
  249|  3.57k|                break;
  250|       |
  251|  45.5k|            case OP_CONST_BASE_URI:
  ------------------
  |  Branch (251:13): [True: 45.5k, False: 686k]
  ------------------
  252|  45.5k|                startOp("ConstBaseUri");
  253|  45.5k|                xmlTextReaderConstBaseUri(reader);
  254|  45.5k|                break;
  255|       |
  256|  1.88k|            case OP_CONST_LOCAL_NAME:
  ------------------
  |  Branch (256:13): [True: 1.88k, False: 730k]
  ------------------
  257|  1.88k|                startOp("ConstLocalName");
  258|  1.88k|                xmlTextReaderConstLocalName(reader);
  259|  1.88k|                break;
  260|       |
  261|  3.40k|            case OP_CONST_NAME:
  ------------------
  |  Branch (261:13): [True: 3.40k, False: 728k]
  ------------------
  262|  3.40k|                startOp("ConstName");
  263|  3.40k|                xmlTextReaderConstName(reader);
  264|  3.40k|                break;
  265|       |
  266|  5.28k|            case OP_CONST_NAMESPACE_URI:
  ------------------
  |  Branch (266:13): [True: 5.28k, False: 727k]
  ------------------
  267|  5.28k|                startOp("ConstNamespaceUri");
  268|  5.28k|                xmlTextReaderConstNamespaceUri(reader);
  269|  5.28k|                break;
  270|       |
  271|  12.1k|            case OP_CONST_PREFIX:
  ------------------
  |  Branch (271:13): [True: 12.1k, False: 720k]
  ------------------
  272|  12.1k|                startOp("ConstPrefix");
  273|  12.1k|                xmlTextReaderConstPrefix(reader);
  274|  12.1k|                break;
  275|       |
  276|  7.09k|            case OP_CONST_XML_LANG:
  ------------------
  |  Branch (276:13): [True: 7.09k, False: 725k]
  ------------------
  277|  7.09k|                startOp("ConstXmlLang");
  278|  7.09k|                xmlTextReaderConstXmlLang(reader);
  279|  7.09k|                oomReport = -1;
  280|  7.09k|                break;
  281|       |
  282|  6.02k|            case OP_CONST_VALUE:
  ------------------
  |  Branch (282:13): [True: 6.02k, False: 726k]
  ------------------
  283|  6.02k|                startOp("ConstValue");
  284|  6.02k|                xmlTextReaderConstValue(reader);
  285|  6.02k|                break;
  286|       |
  287|  8.49k|            case OP_BASE_URI: {
  ------------------
  |  Branch (287:13): [True: 8.49k, False: 723k]
  ------------------
  288|  8.49k|                xmlChar *result;
  289|       |
  290|  8.49k|                startOp("BaseUri");
  291|  8.49k|                result = xmlTextReaderBaseUri(reader);
  292|  8.49k|                FREE_STRING(result);
  ------------------
  |  |  155|  8.49k|    do { \
  |  |  156|  8.49k|        if (str != NULL) { \
  |  |  ------------------
  |  |  |  Branch (156:13): [True: 2.41k, False: 6.07k]
  |  |  ------------------
  |  |  157|  2.41k|            totalStringSize += strlen((char *) str); \
  |  |  158|  2.41k|            xmlFree(str); \
  |  |  159|  2.41k|        } \
  |  |  160|  8.49k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (160:14): [Folded, False: 8.49k]
  |  |  ------------------
  ------------------
  293|  8.49k|                break;
  294|  49.7k|            }
  295|       |
  296|  5.43k|            case OP_LOCAL_NAME: {
  ------------------
  |  Branch (296:13): [True: 5.43k, False: 726k]
  ------------------
  297|  5.43k|                xmlChar *result;
  298|       |
  299|  5.43k|                startOp("LocalName");
  300|  5.43k|                result = xmlTextReaderLocalName(reader);
  301|  5.43k|                FREE_STRING(result);
  ------------------
  |  |  155|  5.43k|    do { \
  |  |  156|  5.43k|        if (str != NULL) { \
  |  |  ------------------
  |  |  |  Branch (156:13): [True: 3.31k, False: 2.12k]
  |  |  ------------------
  |  |  157|  3.31k|            totalStringSize += strlen((char *) str); \
  |  |  158|  3.31k|            xmlFree(str); \
  |  |  159|  3.31k|        } \
  |  |  160|  5.43k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (160:14): [Folded, False: 5.43k]
  |  |  ------------------
  ------------------
  302|  5.43k|                break;
  303|  49.7k|            }
  304|       |
  305|  5.77k|            case OP_NAME: {
  ------------------
  |  Branch (305:13): [True: 5.77k, False: 726k]
  ------------------
  306|  5.77k|                xmlChar *result;
  307|       |
  308|  5.77k|                startOp("Name");
  309|  5.77k|                result = xmlTextReaderName(reader);
  310|  5.77k|                FREE_STRING(result);
  ------------------
  |  |  155|  5.77k|    do { \
  |  |  156|  5.77k|        if (str != NULL) { \
  |  |  ------------------
  |  |  |  Branch (156:13): [True: 3.91k, False: 1.85k]
  |  |  ------------------
  |  |  157|  3.91k|            totalStringSize += strlen((char *) str); \
  |  |  158|  3.91k|            xmlFree(str); \
  |  |  159|  3.91k|        } \
  |  |  160|  5.77k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (160:14): [Folded, False: 5.77k]
  |  |  ------------------
  ------------------
  311|  5.77k|                break;
  312|  49.7k|            }
  313|       |
  314|  3.23k|            case OP_NAMESPACE_URI: {
  ------------------
  |  Branch (314:13): [True: 3.23k, False: 729k]
  ------------------
  315|  3.23k|                xmlChar *result;
  316|       |
  317|  3.23k|                startOp("NamespaceUri");
  318|  3.23k|                result = xmlTextReaderNamespaceUri(reader);
  319|  3.23k|                FREE_STRING(result);
  ------------------
  |  |  155|  3.23k|    do { \
  |  |  156|  3.23k|        if (str != NULL) { \
  |  |  ------------------
  |  |  |  Branch (156:13): [True: 474, False: 2.76k]
  |  |  ------------------
  |  |  157|    474|            totalStringSize += strlen((char *) str); \
  |  |  158|    474|            xmlFree(str); \
  |  |  159|    474|        } \
  |  |  160|  3.23k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (160:14): [Folded, False: 3.23k]
  |  |  ------------------
  ------------------
  320|  3.23k|                break;
  321|  49.7k|            }
  322|       |
  323|  4.43k|            case OP_PREFIX: {
  ------------------
  |  Branch (323:13): [True: 4.43k, False: 727k]
  ------------------
  324|  4.43k|                xmlChar *result;
  325|       |
  326|  4.43k|                startOp("Prefix");
  327|  4.43k|                result = xmlTextReaderPrefix(reader);
  328|  4.43k|                FREE_STRING(result);
  ------------------
  |  |  155|  4.43k|    do { \
  |  |  156|  4.43k|        if (str != NULL) { \
  |  |  ------------------
  |  |  |  Branch (156:13): [True: 608, False: 3.83k]
  |  |  ------------------
  |  |  157|    608|            totalStringSize += strlen((char *) str); \
  |  |  158|    608|            xmlFree(str); \
  |  |  159|    608|        } \
  |  |  160|  4.43k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (160:14): [Folded, False: 4.43k]
  |  |  ------------------
  ------------------
  329|  4.43k|                break;
  330|  49.7k|            }
  331|       |
  332|  3.27k|            case OP_XML_LANG: {
  ------------------
  |  Branch (332:13): [True: 3.27k, False: 729k]
  ------------------
  333|  3.27k|                xmlChar *result;
  334|       |
  335|  3.27k|                startOp("XmlLang");
  336|  3.27k|                result = xmlTextReaderXmlLang(reader);
  337|  3.27k|                oomReport = -1;
  338|  3.27k|                FREE_STRING(result);
  ------------------
  |  |  155|  3.27k|    do { \
  |  |  156|  3.27k|        if (str != NULL) { \
  |  |  ------------------
  |  |  |  Branch (156:13): [True: 211, False: 3.06k]
  |  |  ------------------
  |  |  157|    211|            totalStringSize += strlen((char *) str); \
  |  |  158|    211|            xmlFree(str); \
  |  |  159|    211|        } \
  |  |  160|  3.27k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (160:14): [Folded, False: 3.27k]
  |  |  ------------------
  ------------------
  339|  3.27k|                break;
  340|  49.7k|            }
  341|       |
  342|  9.16k|            case OP_VALUE: {
  ------------------
  |  Branch (342:13): [True: 9.16k, False: 723k]
  ------------------
  343|  9.16k|                xmlChar *result;
  344|       |
  345|  9.16k|                startOp("Value");
  346|  9.16k|                result = xmlTextReaderValue(reader);
  347|  9.16k|                FREE_STRING(result);
  ------------------
  |  |  155|  9.16k|    do { \
  |  |  156|  9.16k|        if (str != NULL) { \
  |  |  ------------------
  |  |  |  Branch (156:13): [True: 2.81k, False: 6.35k]
  |  |  ------------------
  |  |  157|  2.81k|            totalStringSize += strlen((char *) str); \
  |  |  158|  2.81k|            xmlFree(str); \
  |  |  159|  2.81k|        } \
  |  |  160|  9.16k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (160:14): [Folded, False: 9.16k]
  |  |  ------------------
  ------------------
  348|  9.16k|                break;
  349|  49.7k|            }
  350|       |
  351|  1.64k|            case OP_CLOSE:
  ------------------
  |  Branch (351:13): [True: 1.64k, False: 730k]
  ------------------
  352|  1.64k|                startOp("Close");
  353|  1.64k|                if (doc == NULL)
  ------------------
  |  Branch (353:21): [True: 552, False: 1.09k]
  ------------------
  354|    552|                    doc = xmlTextReaderCurrentDoc(reader);
  355|  1.64k|                xmlTextReaderClose(reader);
  356|  1.64k|                break;
  357|       |
  358|  5.51k|            case OP_GET_ATTRIBUTE_NO: {
  ------------------
  |  Branch (358:13): [True: 5.51k, False: 726k]
  ------------------
  359|  5.51k|                xmlChar *result;
  360|  5.51k|                int no = READ_BYTE();
  ------------------
  |  |  153|  5.51k|#define READ_BYTE() (i < programSize ? program[i++] : 0)
  |  |  ------------------
  |  |  |  Branch (153:22): [True: 5.42k, False: 95]
  |  |  ------------------
  ------------------
  361|       |
  362|  5.51k|                startOp("GetAttributeNo");
  363|  5.51k|                result = xmlTextReaderGetAttributeNo(reader, no);
  364|  5.51k|                FREE_STRING(result);
  ------------------
  |  |  155|  5.51k|    do { \
  |  |  156|  5.51k|        if (str != NULL) { \
  |  |  ------------------
  |  |  |  Branch (156:13): [True: 458, False: 5.06k]
  |  |  ------------------
  |  |  157|    458|            totalStringSize += strlen((char *) str); \
  |  |  158|    458|            xmlFree(str); \
  |  |  159|    458|        } \
  |  |  160|  5.51k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (160:14): [Folded, False: 5.51k]
  |  |  ------------------
  ------------------
  365|  5.51k|                break;
  366|  49.7k|            }
  367|       |
  368|  27.7k|            case OP_GET_ATTRIBUTE: {
  ------------------
  |  Branch (368:13): [True: 27.7k, False: 704k]
  ------------------
  369|  27.7k|                const xmlChar *name = xmlTextReaderConstName(reader);
  370|  27.7k|                xmlChar *result;
  371|       |
  372|  27.7k|                startOp("GetAttribute");
  373|  27.7k|                result = xmlTextReaderGetAttribute(reader, name);
  374|  27.7k|                FREE_STRING(result);
  ------------------
  |  |  155|  27.7k|    do { \
  |  |  156|  27.7k|        if (str != NULL) { \
  |  |  ------------------
  |  |  |  Branch (156:13): [True: 867, False: 26.9k]
  |  |  ------------------
  |  |  157|    867|            totalStringSize += strlen((char *) str); \
  |  |  158|    867|            xmlFree(str); \
  |  |  159|    867|        } \
  |  |  160|  27.7k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (160:14): [Folded, False: 27.7k]
  |  |  ------------------
  ------------------
  375|  27.7k|                break;
  376|  49.7k|            }
  377|       |
  378|  26.7k|            case OP_GET_ATTRIBUTE_NS: {
  ------------------
  |  Branch (378:13): [True: 26.7k, False: 705k]
  ------------------
  379|  26.7k|                const xmlChar *localName, *namespaceUri;
  380|  26.7k|                xmlChar *result;
  381|       |
  382|  26.7k|                startOp("GetAttributeNs");
  383|  26.7k|                localName = xmlTextReaderConstLocalName(reader);
  384|  26.7k|                namespaceUri = xmlTextReaderConstNamespaceUri(reader);
  385|  26.7k|                result = xmlTextReaderGetAttributeNs(reader, localName,
  386|  26.7k|                                                     namespaceUri);
  387|  26.7k|                FREE_STRING(result);
  ------------------
  |  |  155|  26.7k|    do { \
  |  |  156|  26.7k|        if (str != NULL) { \
  |  |  ------------------
  |  |  |  Branch (156:13): [True: 1.03k, False: 25.7k]
  |  |  ------------------
  |  |  157|  1.03k|            totalStringSize += strlen((char *) str); \
  |  |  158|  1.03k|            xmlFree(str); \
  |  |  159|  1.03k|        } \
  |  |  160|  26.7k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (160:14): [Folded, False: 26.7k]
  |  |  ------------------
  ------------------
  388|  26.7k|                break;
  389|  49.7k|            }
  390|       |
  391|  3.50k|            case OP_GET_REMAINDER:
  ------------------
  |  Branch (391:13): [True: 3.50k, False: 728k]
  ------------------
  392|  3.50k|                startOp("GetRemainder");
  393|  3.50k|                if (doc == NULL)
  ------------------
  |  Branch (393:21): [True: 1.76k, False: 1.74k]
  ------------------
  394|  1.76k|                    doc = xmlTextReaderCurrentDoc(reader);
  395|  3.50k|                xmlFreeParserInputBuffer(xmlTextReaderGetRemainder(reader));
  396|  3.50k|                break;
  397|       |
  398|  7.54k|            case OP_LOOKUP_NAMESPACE: {
  ------------------
  |  Branch (398:13): [True: 7.54k, False: 724k]
  ------------------
  399|  7.54k|                const xmlChar *prefix = xmlTextReaderConstPrefix(reader);
  400|  7.54k|                xmlChar *result;
  401|       |
  402|  7.54k|                startOp("LookupNamespace");
  403|  7.54k|                result = xmlTextReaderLookupNamespace(reader, prefix);
  404|  7.54k|                FREE_STRING(result);
  ------------------
  |  |  155|  7.54k|    do { \
  |  |  156|  7.54k|        if (str != NULL) { \
  |  |  ------------------
  |  |  |  Branch (156:13): [True: 912, False: 6.63k]
  |  |  ------------------
  |  |  157|    912|            totalStringSize += strlen((char *) str); \
  |  |  158|    912|            xmlFree(str); \
  |  |  159|    912|        } \
  |  |  160|  7.54k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (160:14): [Folded, False: 7.54k]
  |  |  ------------------
  ------------------
  405|  7.54k|                break;
  406|  49.7k|            }
  407|       |
  408|  7.27k|            case OP_MOVE_TO_ATTRIBUTE_NO: {
  ------------------
  |  Branch (408:13): [True: 7.27k, False: 725k]
  ------------------
  409|  7.27k|                int no = READ_BYTE();
  ------------------
  |  |  153|  7.27k|#define READ_BYTE() (i < programSize ? program[i++] : 0)
  |  |  ------------------
  |  |  |  Branch (153:22): [True: 7.19k, False: 87]
  |  |  ------------------
  ------------------
  410|       |
  411|  7.27k|                startOp("MoveToAttributeNo");
  412|  7.27k|                xmlTextReaderMoveToAttributeNo(reader, no);
  413|  7.27k|                break;
  414|  49.7k|            }
  415|       |
  416|  12.0k|            case OP_MOVE_TO_ATTRIBUTE: {
  ------------------
  |  Branch (416:13): [True: 12.0k, False: 720k]
  ------------------
  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|  49.7k|            }
  423|       |
  424|  11.5k|            case OP_MOVE_TO_ATTRIBUTE_NS: {
  ------------------
  |  Branch (424:13): [True: 11.5k, False: 720k]
  ------------------
  425|  11.5k|                const xmlChar *localName, *namespaceUri;
  426|       |
  427|  11.5k|                startOp("MoveToAttributeNs");
  428|  11.5k|                localName = xmlTextReaderConstLocalName(reader);
  429|  11.5k|                namespaceUri = xmlTextReaderConstNamespaceUri(reader);
  430|  11.5k|                xmlTextReaderMoveToAttributeNs(reader, localName,
  431|  11.5k|                                               namespaceUri);
  432|  11.5k|                break;
  433|  49.7k|            }
  434|       |
  435|  11.9k|            case OP_MOVE_TO_FIRST_ATTRIBUTE:
  ------------------
  |  Branch (435:13): [True: 11.9k, False: 720k]
  ------------------
  436|  11.9k|                startOp("MoveToFirstAttribute");
  437|  11.9k|                xmlTextReaderMoveToFirstAttribute(reader);
  438|  11.9k|                break;
  439|       |
  440|  7.88k|            case OP_MOVE_TO_NEXT_ATTRIBUTE:
  ------------------
  |  Branch (440:13): [True: 7.88k, False: 724k]
  ------------------
  441|  7.88k|                startOp("MoveToNextAttribute");
  442|  7.88k|                xmlTextReaderMoveToNextAttribute(reader);
  443|  7.88k|                break;
  444|       |
  445|  5.08k|            case OP_MOVE_TO_ELEMENT:
  ------------------
  |  Branch (445:13): [True: 5.08k, False: 727k]
  ------------------
  446|  5.08k|                startOp("MoveToElement");
  447|  5.08k|                xmlTextReaderMoveToElement(reader);
  448|  5.08k|                break;
  449|       |
  450|  1.85k|            case OP_NORMALIZATION:
  ------------------
  |  Branch (450:13): [True: 1.85k, False: 730k]
  ------------------
  451|  1.85k|                startOp("Normalization");
  452|  1.85k|                xmlTextReaderNormalization(reader);
  453|  1.85k|                break;
  454|       |
  455|  3.67k|            case OP_CONST_ENCODING:
  ------------------
  |  Branch (455:13): [True: 3.67k, False: 728k]
  ------------------
  456|  3.67k|                startOp("ConstEncoding");
  457|  3.67k|                xmlTextReaderConstEncoding(reader);
  458|  3.67k|                break;
  459|       |
  460|  7.83k|            case OP_GET_PARSER_PROP: {
  ------------------
  |  Branch (460:13): [True: 7.83k, False: 724k]
  ------------------
  461|  7.83k|                int prop = READ_BYTE();
  ------------------
  |  |  153|  7.83k|#define READ_BYTE() (i < programSize ? program[i++] : 0)
  |  |  ------------------
  |  |  |  Branch (153:22): [True: 7.64k, False: 188]
  |  |  ------------------
  ------------------
  462|       |
  463|  7.83k|                startOp("GetParserProp");
  464|  7.83k|                xmlTextReaderGetParserProp(reader, prop);
  465|  7.83k|                break;
  466|  49.7k|            }
  467|       |
  468|  12.0k|            case OP_CURRENT_NODE:
  ------------------
  |  Branch (468:13): [True: 12.0k, False: 720k]
  ------------------
  469|  12.0k|                startOp("CurrentNode");
  470|  12.0k|                xmlTextReaderCurrentNode(reader);
  471|  12.0k|                break;
  472|       |
  473|  5.57k|            case OP_GET_PARSER_LINE_NUMBER:
  ------------------
  |  Branch (473:13): [True: 5.57k, False: 726k]
  ------------------
  474|  5.57k|                startOp("GetParserLineNumber");
  475|  5.57k|                xmlTextReaderGetParserLineNumber(reader);
  476|  5.57k|                break;
  477|       |
  478|  8.91k|            case OP_GET_PARSER_COLUMN_NUMBER:
  ------------------
  |  Branch (478:13): [True: 8.91k, False: 723k]
  ------------------
  479|  8.91k|                startOp("GetParserColumnNumber");
  480|  8.91k|                xmlTextReaderGetParserColumnNumber(reader);
  481|  8.91k|                break;
  482|       |
  483|  7.44k|            case OP_PRESERVE:
  ------------------
  |  Branch (483:13): [True: 7.44k, False: 724k]
  ------------------
  484|  7.44k|                startOp("Preserve");
  485|  7.44k|                xmlTextReaderPreserve(reader);
  486|  7.44k|                break;
  487|       |
  488|  6.68k|            case OP_CURRENT_DOC: {
  ------------------
  |  Branch (488:13): [True: 6.68k, False: 725k]
  ------------------
  489|  6.68k|                xmlDocPtr result;
  490|       |
  491|  6.68k|                startOp("CurrentDoc");
  492|  6.68k|                result = xmlTextReaderCurrentDoc(reader);
  493|  6.68k|                if (doc == NULL)
  ------------------
  |  Branch (493:21): [True: 2.68k, False: 3.99k]
  ------------------
  494|  2.68k|                    doc = result;
  495|  6.68k|                break;
  496|  49.7k|            }
  497|       |
  498|  8.27k|            case OP_EXPAND:
  ------------------
  |  Branch (498:13): [True: 8.27k, False: 724k]
  ------------------
  499|  8.27k|                startOp("Expand");
  500|  8.27k|                xmlTextReaderExpand(reader);
  501|  8.27k|                break;
  502|       |
  503|  21.2k|            case OP_NEXT:
  ------------------
  |  Branch (503:13): [True: 21.2k, False: 711k]
  ------------------
  504|  21.2k|                startOp("Next");
  505|  21.2k|                xmlTextReaderNext(reader);
  506|  21.2k|                break;
  507|       |
  508|  7.66k|            case OP_NEXT_SIBLING:
  ------------------
  |  Branch (508:13): [True: 7.66k, False: 724k]
  ------------------
  509|  7.66k|                startOp("NextSibling");
  510|  7.66k|                xmlTextReaderNextSibling(reader);
  511|  7.66k|                break;
  512|       |
  513|  3.53k|            case OP_IS_VALID:
  ------------------
  |  Branch (513:13): [True: 3.53k, False: 728k]
  ------------------
  514|  3.53k|                startOp("IsValid");
  515|  3.53k|                xmlTextReaderIsValid(reader);
  516|  3.53k|                break;
  517|       |
  518|  3.92k|            case OP_CONST_XML_VERSION:
  ------------------
  |  Branch (518:13): [True: 3.92k, False: 728k]
  ------------------
  519|  3.92k|                startOp("ConstXmlVersion");
  520|  3.92k|                xmlTextReaderConstXmlVersion(reader);
  521|  3.92k|                break;
  522|       |
  523|  3.94k|            case OP_STANDALONE:
  ------------------
  |  Branch (523:13): [True: 3.94k, False: 728k]
  ------------------
  524|  3.94k|                startOp("Standalone");
  525|  3.94k|                xmlTextReaderStandalone(reader);
  526|  3.94k|                break;
  527|       |
  528|  5.60k|            case OP_BYTE_CONSUMED:
  ------------------
  |  Branch (528:13): [True: 5.60k, False: 726k]
  ------------------
  529|  5.60k|                startOp("ByteConsumed");
  530|  5.60k|                xmlTextReaderByteConsumed(reader);
  531|  5.60k|                oomReport = -1;
  532|  5.60k|                break;
  533|   732k|        }
  534|       |
  535|   732k|        if (totalStringSize > docSize * 2)
  ------------------
  |  Branch (535:13): [True: 1.10k, False: 731k]
  ------------------
  536|  1.10k|            break;
  537|   732k|    }
  538|       |
  539|  36.4k|    error = xmlTextReaderGetLastError(reader);
  540|  36.4k|    if (error->code == XML_ERR_NO_MEMORY)
  ------------------
  |  Branch (540:9): [True: 8.72k, False: 27.6k]
  ------------------
  541|  8.72k|        oomReport = 1;
  542|  36.4k|    xmlFuzzCheckFailureReport("reader", oomReport, error->code == XML_IO_EIO);
  543|       |
  544|  36.4k|    xmlFreeTextReader(reader);
  545|       |
  546|  36.4k|    if (doc != NULL)
  ------------------
  |  Branch (546:9): [True: 3.54k, False: 32.8k]
  ------------------
  547|  3.54k|        xmlFreeDoc(doc);
  548|       |
  549|  36.5k|exit:
  550|  36.5k|    xmlFuzzInjectFailure(0);
  551|  36.5k|    xmlFuzzDataCleanup();
  552|  36.5k|    xmlResetLastError();
  553|  36.5k|    return(0);
  554|  36.4k|}
reader.c:startOp:
   83|   732k|startOp(const char *name) {
   84|   732k|    (void) name;
   85|       |#ifdef DEBUG
   86|       |    fprintf(stderr, "%s\n", name);
   87|       |#endif
   88|   732k|}

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|  44.9k|__xmlDoValidityCheckingDefaultValue(void) {
  634|  44.9k|    return(&xmlGetThreadLocalStorage(0)->doValidityCheckingDefaultValue);
  635|  44.9k|}
__xmlGetWarningsDefaultValue:
  638|   681k|__xmlGetWarningsDefaultValue(void) {
  639|   681k|    return(&xmlGetThreadLocalStorage(0)->getWarningsDefaultValue);
  640|   681k|}
__xmlKeepBlanksDefaultValue:
  643|  44.9k|__xmlKeepBlanksDefaultValue(void) {
  644|  44.9k|    return(&xmlGetThreadLocalStorage(0)->keepBlanksDefaultValue);
  645|  44.9k|}
__xmlLoadExtDtdDefaultValue:
  653|  44.9k|__xmlLoadExtDtdDefaultValue(void) {
  654|  44.9k|    return(&xmlGetThreadLocalStorage(0)->loadExtDtdDefaultValue);
  655|  44.9k|}
__xmlPedanticParserDefaultValue:
  658|  44.9k|__xmlPedanticParserDefaultValue(void) {
  659|  44.9k|    return(&xmlGetThreadLocalStorage(0)->pedanticParserDefaultValue);
  660|  44.9k|}
__xmlSubstituteEntitiesDefaultValue:
  663|  44.9k|__xmlSubstituteEntitiesDefaultValue(void) {
  664|  44.9k|    return(&xmlGetThreadLocalStorage(0)->substituteEntitiesDefaultValue);
  665|  44.9k|}
__xmlTreeIndentString:
  674|  30.6k|__xmlTreeIndentString(void) {
  675|  30.6k|    return(&xmlGetThreadLocalStorage(0)->treeIndentString);
  676|  30.6k|}
__xmlSaveNoEmptyTags:
  679|  30.6k|__xmlSaveNoEmptyTags(void) {
  680|  30.6k|    return(&xmlGetThreadLocalStorage(0)->saveNoEmptyTags);
  681|  30.6k|}
__xmlStructuredError:
  695|   391k|__xmlStructuredError(void) {
  696|   391k|    return(&xmlGetThreadLocalStorage(0)->structuredError);
  697|   391k|}
xmlGetLocalRngState:
  755|   108k|xmlGetLocalRngState(void) {
  756|   108k|    return(xmlGetThreadLocalStorage(0)->localRngState);
  757|   108k|}
xmlGetLastErrorInternal:
  785|   709k|xmlGetLastErrorInternal(void) {
  786|   709k|    return(&xmlGetThreadLocalStorage(0)->lastError);
  787|   709k|}
globals.c:xmlPosixStrdup:
  200|   444k|xmlPosixStrdup(const char *cur) {
  201|   444k|    return((char*) xmlCharStrdup(cur));
  202|   444k|}
globals.c:xmlGetThreadLocalStorage:
  525|  2.17M|xmlGetThreadLocalStorage(int allowFailure) {
  526|  2.17M|    xmlGlobalState *gs;
  527|       |
  528|  2.17M|    (void) allowFailure;
  529|       |
  530|  2.17M|    xmlInitParser();
  531|       |
  532|       |#ifdef USE_TLS
  533|       |    gs = &globalState;
  534|       |    if (gs->initialized == 0)
  535|       |        xmlInitGlobalState(gs);
  536|       |#elif defined(HAVE_POSIX_THREADS)
  537|       |    gs = (xmlGlobalState *) pthread_getspecific(globalkey);
  538|  2.17M|    if (gs == NULL)
  ------------------
  |  Branch (538:9): [True: 1, False: 2.17M]
  ------------------
  539|      1|        gs = xmlNewGlobalState(allowFailure);
  540|       |#elif defined(HAVE_WIN32_THREADS)
  541|       |    gs = (xmlGlobalState *) TlsGetValue(globalkey);
  542|       |    if (gs == NULL)
  543|       |        gs = xmlNewGlobalState(allowFailure);
  544|       |#else
  545|       |    gs = NULL;
  546|       |#endif
  547|       |
  548|  2.17M|    return(gs);
  549|  2.17M|}
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|  63.5k|xmlHashCreate(int size) {
  159|  63.5k|    xmlHashTablePtr hash;
  160|       |
  161|  63.5k|    xmlInitParser();
  162|       |
  163|  63.5k|    hash = xmlMalloc(sizeof(*hash));
  164|  63.5k|    if (hash == NULL)
  ------------------
  |  Branch (164:9): [True: 18, False: 63.5k]
  ------------------
  165|     18|        return(NULL);
  166|  63.5k|    hash->dict = NULL;
  167|  63.5k|    hash->size = 0;
  168|  63.5k|    hash->table = NULL;
  169|  63.5k|    hash->nbElems = 0;
  170|  63.5k|    hash->randomSeed = xmlRandom();
  171|  63.5k|#ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
  172|  63.5k|    hash->randomSeed = 0;
  173|  63.5k|#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|  63.5k|    if (size > MIN_HASH_SIZE) {
  ------------------
  |  |   30|  63.5k|#define MIN_HASH_SIZE 8
  ------------------
  |  Branch (180:9): [True: 5.52k, False: 58.0k]
  ------------------
  181|  5.52k|        unsigned newSize = MIN_HASH_SIZE * 2;
  ------------------
  |  |   30|  5.52k|#define MIN_HASH_SIZE 8
  ------------------
  182|       |
  183|  5.52k|        while ((newSize < (unsigned) size) && (newSize < MAX_HASH_SIZE))
  ------------------
  |  |   31|      0|#define MAX_HASH_SIZE (1u << 31)
  ------------------
  |  Branch (183:16): [True: 0, False: 5.52k]
  |  Branch (183:47): [True: 0, False: 0]
  ------------------
  184|      0|            newSize *= 2;
  185|       |
  186|  5.52k|        if (xmlHashGrow(hash, newSize) != 0) {
  ------------------
  |  Branch (186:13): [True: 5, False: 5.51k]
  ------------------
  187|      5|            xmlFree(hash);
  188|      5|            return(NULL);
  189|      5|        }
  190|  5.52k|    }
  191|       |
  192|  63.5k|    return(hash);
  193|  63.5k|}
xmlHashCreateDict:
  205|  25.6k|xmlHashCreateDict(int size, xmlDict *dict) {
  206|  25.6k|    xmlHashTablePtr hash;
  207|       |
  208|  25.6k|    hash = xmlHashCreate(size);
  209|  25.6k|    if (hash != NULL) {
  ------------------
  |  Branch (209:9): [True: 25.6k, False: 17]
  ------------------
  210|  25.6k|        hash->dict = dict;
  211|  25.6k|        xmlDictReference(dict);
  212|  25.6k|    }
  213|  25.6k|    return(hash);
  214|  25.6k|}
xmlHashFree:
  224|  82.3k|xmlHashFree(xmlHashTable *hash, xmlHashDeallocator dealloc) {
  225|  82.3k|    if (hash == NULL)
  ------------------
  |  Branch (225:9): [True: 18.7k, False: 63.5k]
  ------------------
  226|  18.7k|        return;
  227|       |
  228|  63.5k|    if (hash->table) {
  ------------------
  |  Branch (228:9): [True: 63.3k, False: 194]
  ------------------
  229|  63.3k|        const xmlHashEntry *end = &hash->table[hash->size];
  230|  63.3k|        const xmlHashEntry *entry;
  231|       |
  232|   687k|        for (entry = hash->table; entry < end; entry++) {
  ------------------
  |  Branch (232:35): [True: 624k, False: 63.3k]
  ------------------
  233|   624k|            if (entry->hashValue == 0)
  ------------------
  |  Branch (233:17): [True: 488k, False: 136k]
  ------------------
  234|   488k|                continue;
  235|   136k|            if ((dealloc != NULL) && (entry->payload != NULL))
  ------------------
  |  Branch (235:17): [True: 117k, False: 18.2k]
  |  Branch (235:38): [True: 117k, False: 0]
  ------------------
  236|   117k|                dealloc(entry->payload, entry->key);
  237|   136k|            if (hash->dict == NULL) {
  ------------------
  |  Branch (237:17): [True: 77.7k, False: 58.4k]
  ------------------
  238|  77.7k|                if (entry->key)
  ------------------
  |  Branch (238:21): [True: 77.7k, False: 0]
  ------------------
  239|  77.7k|                    xmlFree(entry->key);
  240|  77.7k|                if (entry->key2)
  ------------------
  |  Branch (240:21): [True: 1.95k, False: 75.7k]
  ------------------
  241|  1.95k|                    xmlFree(entry->key2);
  242|  77.7k|                if (entry->key3)
  ------------------
  |  Branch (242:21): [True: 11.6k, False: 66.0k]
  ------------------
  243|  11.6k|                    xmlFree(entry->key3);
  244|  77.7k|            }
  245|   136k|        }
  246|       |
  247|  63.3k|        xmlFree(hash->table);
  248|  63.3k|    }
  249|       |
  250|  63.5k|    if (hash->dict)
  ------------------
  |  Branch (250:9): [True: 17.1k, False: 46.3k]
  ------------------
  251|  17.1k|        xmlDictFree(hash->dict);
  252|       |
  253|  63.5k|    xmlFree(hash);
  254|  63.5k|}
xmlHashDefaultDeallocator:
  592|  53.2k|xmlHashDefaultDeallocator(void *entry, const xmlChar *key ATTRIBUTE_UNUSED) {
  593|  53.2k|    xmlFree(entry);
  594|  53.2k|}
xmlHashAdd:
  610|   123k|xmlHashAdd(xmlHashTable *hash, const xmlChar *key, void *payload) {
  611|   123k|    return(xmlHashUpdateInternal(hash, key, NULL, NULL, payload, NULL, 0));
  612|   123k|}
xmlHashAdd2:
  629|  60.1k|                 const xmlChar *key2, void *payload) {
  630|  60.1k|    return(xmlHashUpdateInternal(hash, key, key2, NULL, payload, NULL, 0));
  631|  60.1k|}
xmlHashAdd3:
  650|  56.7k|                 void *payload) {
  651|       |    return(xmlHashUpdateInternal(hash, key, key2, key3, payload, NULL, 0));
  652|  56.7k|}
xmlHashAddEntry:
  669|  52.8k|xmlHashAddEntry(xmlHashTable *hash, const xmlChar *key, void *payload) {
  670|  52.8k|    int res = xmlHashUpdateInternal(hash, key, NULL, NULL, payload, NULL, 0);
  671|       |
  672|  52.8k|    if (res == 0)
  ------------------
  |  Branch (672:9): [True: 0, False: 52.8k]
  ------------------
  673|      0|        res = -1;
  674|  52.8k|    else if (res == 1)
  ------------------
  |  Branch (674:14): [True: 52.8k, False: 5]
  ------------------
  675|  52.8k|        res = 0;
  676|       |
  677|  52.8k|    return(res);
  678|  52.8k|}
xmlHashUpdateEntry:
  742|    480|                   void *payload, xmlHashDeallocator dealloc) {
  743|    480|    int res = xmlHashUpdateInternal(hash, key, NULL, NULL, payload,
  744|    480|                                    dealloc, 1);
  745|       |
  746|    480|    if (res == 1)
  ------------------
  |  Branch (746:9): [True: 45, False: 435]
  ------------------
  747|     45|        res = 0;
  748|       |
  749|    480|    return(res);
  750|    480|}
xmlHashUpdateEntry2:
  767|  3.48k|                   xmlHashDeallocator dealloc) {
  768|  3.48k|    int res = xmlHashUpdateInternal(hash, key, key2, NULL, payload,
  769|  3.48k|                                    dealloc, 1);
  770|       |
  771|  3.48k|    if (res == 1)
  ------------------
  |  Branch (771:9): [True: 2.90k, False: 583]
  ------------------
  772|  2.90k|        res = 0;
  773|       |
  774|  3.48k|    return(res);
  775|  3.48k|}
xmlHashLookup:
  811|  3.09M|xmlHashLookup(xmlHashTable *hash, const xmlChar *key) {
  812|  3.09M|    return(xmlHashLookup3(hash, key, NULL, NULL));
  813|  3.09M|}
xmlHashLookup2:
  825|   952k|              const xmlChar *key2) {
  826|       |    return(xmlHashLookup3(hash, key, key2, NULL));
  827|   952k|}
xmlHashQLookup2:
  856|  32.1k|                const xmlChar *name2) {
  857|  32.1k|    return(xmlHashQLookup3(hash, prefix, name, prefix2, name2, NULL, NULL));
  858|  32.1k|}
xmlHashLookup3:
  871|  4.43M|               const xmlChar *key2, const xmlChar *key3) {
  872|  4.43M|    const xmlHashEntry *entry;
  873|  4.43M|    unsigned hashValue;
  874|  4.43M|    int found;
  875|       |
  876|  4.43M|    if ((hash == NULL) || (hash->size == 0) || (key == NULL))
  ------------------
  |  Branch (876:9): [True: 12.9k, False: 4.42M]
  |  Branch (876:27): [True: 48.1k, False: 4.37M]
  |  Branch (876:48): [True: 10, False: 4.37M]
  ------------------
  877|  61.1k|        return(NULL);
  878|  4.37M|    hashValue = xmlHashValue(hash->randomSeed, key, key2, key3, NULL);
  879|  4.37M|    entry = xmlHashFindEntry(hash, key, key2, key3, hashValue, &found);
  880|  4.37M|    if (found)
  ------------------
  |  Branch (880:9): [True: 3.46M, False: 905k]
  ------------------
  881|  3.46M|        return(entry->payload);
  882|   905k|    return(NULL);
  883|  4.37M|}
xmlHashQLookup3:
  902|  32.1k|                const xmlChar *prefix3, const xmlChar *name3) {
  903|  32.1k|    const xmlHashEntry *entry;
  904|  32.1k|    unsigned hashValue, mask, pos, displ;
  905|       |
  906|  32.1k|    if ((hash == NULL) || (hash->size == 0) || (name == NULL))
  ------------------
  |  Branch (906:9): [True: 0, False: 32.1k]
  |  Branch (906:27): [True: 0, False: 32.1k]
  |  Branch (906:48): [True: 0, False: 32.1k]
  ------------------
  907|      0|        return(NULL);
  908|       |
  909|  32.1k|    hashValue = xmlHashQNameValue(hash->randomSeed, prefix, name, prefix2,
  910|  32.1k|                                  name2, prefix3, name3);
  911|  32.1k|    mask = hash->size - 1;
  912|  32.1k|    pos = hashValue & mask;
  913|  32.1k|    entry = &hash->table[pos];
  914|       |
  915|  32.1k|    if (entry->hashValue != 0) {
  ------------------
  |  Branch (915:9): [True: 8.26k, False: 23.9k]
  ------------------
  916|  8.26k|        displ = 0;
  917|  8.26k|        hashValue |= MAX_HASH_SIZE;
  ------------------
  |  |   31|  8.26k|#define MAX_HASH_SIZE (1u << 31)
  ------------------
  918|       |
  919|  9.32k|        do {
  920|  9.32k|            if ((hashValue == entry->hashValue) &&
  ------------------
  |  Branch (920:17): [True: 4.45k, False: 4.87k]
  ------------------
  921|  4.45k|                (xmlStrQEqual(prefix, name, entry->key)) &&
  ------------------
  |  Branch (921:17): [True: 4.45k, False: 0]
  ------------------
  922|  4.45k|                (xmlStrQEqual(prefix2, name2, entry->key2)) &&
  ------------------
  |  Branch (922:17): [True: 4.45k, False: 0]
  ------------------
  923|  4.45k|                (xmlStrQEqual(prefix3, name3, entry->key3)))
  ------------------
  |  Branch (923:17): [True: 4.45k, False: 0]
  ------------------
  924|  4.45k|                return(entry->payload);
  925|       |
  926|  4.87k|            displ++;
  927|  4.87k|            pos++;
  928|  4.87k|            entry++;
  929|  4.87k|            if ((pos & mask) == 0)
  ------------------
  |  Branch (929:17): [True: 362, False: 4.51k]
  ------------------
  930|    362|                entry = hash->table;
  931|  4.87k|        } while ((entry->hashValue != 0) &&
  ------------------
  |  Branch (931:18): [True: 1.71k, False: 3.16k]
  ------------------
  932|  1.71k|                 (((pos - entry->hashValue) & mask) >= displ));
  ------------------
  |  Branch (932:18): [True: 1.06k, False: 644]
  ------------------
  933|  8.26k|    }
  934|       |
  935|  27.7k|    return(NULL);
  936|  32.1k|}
xmlHashScan:
  959|  6.49k|xmlHashScan(xmlHashTable *hash, xmlHashScanner scan, void *data) {
  960|  6.49k|    stubData sdata;
  961|  6.49k|    sdata.data = data;
  962|  6.49k|    sdata.scan = scan;
  963|  6.49k|    xmlHashScanFull(hash, stubHashScannerFull, &sdata);
  964|  6.49k|}
xmlHashScanFull:
  974|  9.55k|xmlHashScanFull(xmlHashTable *hash, xmlHashScannerFull scan, void *data) {
  975|  9.55k|    const xmlHashEntry *entry, *end;
  976|  9.55k|    xmlHashEntry old;
  977|  9.55k|    unsigned i;
  978|       |
  979|  9.55k|    if ((hash == NULL) || (hash->size == 0) || (scan == NULL))
  ------------------
  |  Branch (979:9): [True: 375, False: 9.17k]
  |  Branch (979:27): [True: 0, False: 9.17k]
  |  Branch (979:48): [True: 0, False: 9.17k]
  ------------------
  980|    375|        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|  9.17k|    entry = hash->table;
  990|  9.17k|    end = &hash->table[hash->size];
  991|  12.3k|    while (entry->hashValue != 0) {
  ------------------
  |  Branch (991:12): [True: 3.13k, False: 9.17k]
  ------------------
  992|  3.13k|        if (++entry >= end)
  ------------------
  |  Branch (992:13): [True: 0, False: 3.13k]
  ------------------
  993|      0|            entry = hash->table;
  994|  3.13k|    }
  995|       |
  996|   140k|    for (i = 0; i < hash->size; i++) {
  ------------------
  |  Branch (996:17): [True: 131k, False: 9.17k]
  ------------------
  997|   131k|        if ((entry->hashValue != 0) && (entry->payload != NULL)) {
  ------------------
  |  Branch (997:13): [True: 35.3k, False: 96.1k]
  |  Branch (997:40): [True: 35.3k, False: 0]
  ------------------
  998|       |            /*
  999|       |             * Make sure to rescan after a possible deletion.
 1000|       |             */
 1001|  35.9k|            do {
 1002|  35.9k|                old = *entry;
 1003|  35.9k|                scan(entry->payload, data, entry->key, entry->key2, entry->key3);
 1004|  35.9k|            } while ((entry->hashValue != 0) &&
  ------------------
  |  Branch (1004:22): [True: 34.5k, False: 1.36k]
  ------------------
 1005|  34.5k|                     (entry->payload != NULL) &&
  ------------------
  |  Branch (1005:22): [True: 34.5k, False: 0]
  ------------------
 1006|  34.5k|                     ((entry->key != old.key) ||
  ------------------
  |  Branch (1006:23): [True: 547, False: 33.9k]
  ------------------
 1007|  33.9k|                      (entry->key2 != old.key2) ||
  ------------------
  |  Branch (1007:23): [True: 56, False: 33.9k]
  ------------------
 1008|  33.9k|                      (entry->key3 != old.key3)));
  ------------------
  |  Branch (1008:23): [True: 0, False: 33.9k]
  ------------------
 1009|  35.3k|        }
 1010|   131k|        if (++entry >= end)
  ------------------
  |  Branch (1010:13): [True: 9.17k, False: 122k]
  ------------------
 1011|  9.17k|            entry = hash->table;
 1012|   131k|    }
 1013|  9.17k|}
xmlHashScan3:
 1030|    976|             xmlHashScanner scan, void *data) {
 1031|    976|    stubData sdata;
 1032|    976|    sdata.data = data;
 1033|    976|    sdata.scan = scan;
 1034|    976|    xmlHashScanFull3(hash, key, key2, key3, stubHashScannerFull, &sdata);
 1035|    976|}
xmlHashScanFull3:
 1052|    976|                 xmlHashScannerFull scan, void *data) {
 1053|    976|    const xmlHashEntry *entry, *end;
 1054|    976|    xmlHashEntry old;
 1055|    976|    unsigned i;
 1056|       |
 1057|    976|    if ((hash == NULL) || (hash->size == 0) || (scan == NULL))
  ------------------
  |  Branch (1057:9): [True: 340, False: 636]
  |  Branch (1057:27): [True: 0, False: 636]
  |  Branch (1057:48): [True: 0, False: 636]
  ------------------
 1058|    340|        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|    636|    entry = hash->table;
 1068|    636|    end = &hash->table[hash->size];
 1069|  1.62k|    while (entry->hashValue != 0) {
  ------------------
  |  Branch (1069:12): [True: 985, False: 636]
  ------------------
 1070|    985|        if (++entry >= end)
  ------------------
  |  Branch (1070:13): [True: 0, False: 985]
  ------------------
 1071|      0|            entry = hash->table;
 1072|    985|    }
 1073|       |
 1074|   200k|    for (i = 0; i < hash->size; i++) {
  ------------------
  |  Branch (1074:17): [True: 200k, False: 636]
  ------------------
 1075|   200k|        if ((entry->hashValue != 0) && (entry->payload != NULL)) {
  ------------------
  |  Branch (1075:13): [True: 111k, False: 88.7k]
  |  Branch (1075:40): [True: 111k, False: 0]
  ------------------
 1076|       |            /*
 1077|       |             * Make sure to rescan after a possible deletion.
 1078|       |             */
 1079|   111k|            do {
 1080|   111k|                if (((key != NULL) && (strcmp((const char *) key,
  ------------------
  |  Branch (1080:22): [True: 0, False: 111k]
  |  Branch (1080:39): [True: 0, False: 0]
  ------------------
 1081|      0|                                              (const char *) entry->key) != 0)) ||
 1082|   111k|                    ((key2 != NULL) && (!xmlFastStrEqual(key2, entry->key2))) ||
  ------------------
  |  Branch (1082:22): [True: 0, False: 111k]
  |  Branch (1082:40): [True: 0, False: 0]
  ------------------
 1083|   111k|                    ((key3 != NULL) && (!xmlFastStrEqual(key3, entry->key3))))
  ------------------
  |  Branch (1083:22): [True: 111k, False: 0]
  |  Branch (1083:40): [True: 111k, False: 73]
  ------------------
 1084|   111k|                    break;
 1085|     73|                old = *entry;
 1086|     73|                scan(entry->payload, data, entry->key, entry->key2, entry->key3);
 1087|     73|            } while ((entry->hashValue != 0) &&
  ------------------
  |  Branch (1087:22): [True: 73, False: 0]
  ------------------
 1088|     73|                     (entry->payload != NULL) &&
  ------------------
  |  Branch (1088:22): [True: 73, False: 0]
  ------------------
 1089|     73|                     ((entry->key != old.key) ||
  ------------------
  |  Branch (1089:23): [True: 0, False: 73]
  ------------------
 1090|     73|                      (entry->key2 != old.key2) ||
  ------------------
  |  Branch (1090:23): [True: 0, False: 73]
  ------------------
 1091|     73|                      (entry->key3 != old.key3)));
  ------------------
  |  Branch (1091:23): [True: 0, False: 73]
  ------------------
 1092|   111k|        }
 1093|   200k|        if (++entry >= end)
  ------------------
  |  Branch (1093:13): [True: 636, False: 199k]
  ------------------
 1094|    636|            entry = hash->table;
 1095|   200k|    }
 1096|    636|}
xmlHashSize:
 1173|  3.05k|xmlHashSize(xmlHashTable *hash) {
 1174|  3.05k|    if (hash == NULL)
  ------------------
  |  Branch (1174:9): [True: 0, False: 3.05k]
  ------------------
 1175|      0|        return(-1);
 1176|  3.05k|    return(hash->nbElems);
 1177|  3.05k|}
xmlHashRemoveEntry:
 1189|  1.96k|                       xmlHashDeallocator dealloc) {
 1190|  1.96k|    return(xmlHashRemoveEntry3(hash, key, NULL, NULL, dealloc));
 1191|  1.96k|}
xmlHashRemoveEntry2:
 1206|  2.16k|                    const xmlChar *key2, xmlHashDeallocator dealloc) {
 1207|       |    return(xmlHashRemoveEntry3(hash, key, key2, NULL, dealloc));
 1208|  2.16k|}
xmlHashRemoveEntry3:
 1226|  4.13k|                    xmlHashDeallocator dealloc) {
 1227|  4.13k|    xmlHashEntry *entry, *cur, *next;
 1228|  4.13k|    unsigned hashValue, mask, pos, nextpos;
 1229|  4.13k|    int found;
 1230|       |
 1231|  4.13k|    if ((hash == NULL) || (hash->size == 0) || (key == NULL))
  ------------------
  |  Branch (1231:9): [True: 0, False: 4.13k]
  |  Branch (1231:27): [True: 0, False: 4.13k]
  |  Branch (1231:48): [True: 0, False: 4.13k]
  ------------------
 1232|      0|        return(-1);
 1233|       |
 1234|  4.13k|    hashValue = xmlHashValue(hash->randomSeed, key, key2, key3, NULL);
 1235|  4.13k|    entry = xmlHashFindEntry(hash, key, key2, key3, hashValue, &found);
 1236|  4.13k|    if (!found)
  ------------------
  |  Branch (1236:9): [True: 0, False: 4.13k]
  ------------------
 1237|      0|        return(-1);
 1238|       |
 1239|  4.13k|    if ((dealloc != NULL) && (entry->payload != NULL))
  ------------------
  |  Branch (1239:9): [True: 1.96k, False: 2.16k]
  |  Branch (1239:30): [True: 1.96k, False: 0]
  ------------------
 1240|  1.96k|        dealloc(entry->payload, entry->key);
 1241|  4.13k|    if (hash->dict == NULL) {
  ------------------
  |  Branch (1241:9): [True: 2.04k, False: 2.08k]
  ------------------
 1242|  2.04k|        if (entry->key)
  ------------------
  |  Branch (1242:13): [True: 2.04k, False: 0]
  ------------------
 1243|  2.04k|            xmlFree(entry->key);
 1244|  2.04k|        if (entry->key2)
  ------------------
  |  Branch (1244:13): [True: 6, False: 2.04k]
  ------------------
 1245|      6|            xmlFree(entry->key2);
 1246|  2.04k|        if (entry->key3)
  ------------------
  |  Branch (1246:13): [True: 0, False: 2.04k]
  ------------------
 1247|      0|            xmlFree(entry->key3);
 1248|  2.04k|    }
 1249|       |
 1250|       |    /*
 1251|       |     * Find end of probe sequence. Entries at their initial probe
 1252|       |     * position start a new sequence.
 1253|       |     */
 1254|  4.13k|    mask = hash->size - 1;
 1255|  4.13k|    pos = entry - hash->table;
 1256|  4.13k|    cur = entry;
 1257|       |
 1258|  7.63k|    while (1) {
  ------------------
  |  Branch (1258:12): [True: 7.63k, Folded]
  ------------------
 1259|  7.63k|        nextpos = pos + 1;
 1260|  7.63k|        next = cur + 1;
 1261|  7.63k|        if ((nextpos & mask) == 0)
  ------------------
  |  Branch (1261:13): [True: 663, False: 6.96k]
  ------------------
 1262|    663|            next = hash->table;
 1263|       |
 1264|  7.63k|        if ((next->hashValue == 0) ||
  ------------------
  |  Branch (1264:13): [True: 2.77k, False: 4.85k]
  ------------------
 1265|  4.85k|            (((next->hashValue - nextpos) & mask) == 0))
  ------------------
  |  Branch (1265:13): [True: 1.36k, False: 3.49k]
  ------------------
 1266|  4.13k|            break;
 1267|       |
 1268|  3.49k|        cur = next;
 1269|  3.49k|        pos = nextpos;
 1270|  3.49k|    }
 1271|       |
 1272|       |    /*
 1273|       |     * Backward shift
 1274|       |     */
 1275|  4.13k|    next = entry + 1;
 1276|       |
 1277|  4.13k|    if (cur < entry) {
  ------------------
  |  Branch (1277:9): [True: 256, False: 3.88k]
  ------------------
 1278|    256|        xmlHashEntry *end = &hash->table[hash->size];
 1279|       |
 1280|    256|        memmove(entry, next, (char *) end - (char *) next);
 1281|    256|        entry = hash->table;
 1282|    256|        end[-1] = *entry;
 1283|    256|        next = entry + 1;
 1284|    256|    }
 1285|       |
 1286|  4.13k|    memmove(entry, next, (char *) cur - (char *) entry);
 1287|       |
 1288|       |    /*
 1289|       |     * Update entry
 1290|       |     */
 1291|  4.13k|    cur->hashValue = 0;
 1292|       |
 1293|  4.13k|    hash->nbElems--;
 1294|       |
 1295|  4.13k|    return(0);
 1296|  4.13k|}
hash.c:xmlHashGrow:
  345|  65.6k|xmlHashGrow(xmlHashTablePtr hash, unsigned size) {
  346|  65.6k|    const xmlHashEntry *oldentry, *oldend, *end;
  347|  65.6k|    xmlHashEntry *table;
  348|  65.6k|    unsigned oldsize, i;
  349|       |
  350|       |    /* Add 0 to avoid spurious -Wtype-limits warning on 64-bit GCC */
  351|  65.6k|    if ((size_t) size + 0 > SIZE_MAX / sizeof(table[0]))
  ------------------
  |  Branch (351:9): [True: 0, False: 65.6k]
  ------------------
  352|      0|        return(-1);
  353|  65.6k|    table = xmlMalloc(size * sizeof(table[0]));
  354|  65.6k|    if (table == NULL)
  ------------------
  |  Branch (354:9): [True: 19, False: 65.6k]
  ------------------
  355|     19|        return(-1);
  356|  65.6k|    memset(table, 0, size * sizeof(table[0]));
  357|       |
  358|  65.6k|    oldsize = hash->size;
  359|  65.6k|    if (oldsize == 0)
  ------------------
  |  Branch (359:9): [True: 63.3k, False: 2.32k]
  ------------------
  360|  63.3k|        goto done;
  361|       |
  362|  2.32k|    oldend = &hash->table[oldsize];
  363|  2.32k|    end = &table[size];
  364|       |
  365|       |    /*
  366|       |     * Robin Hood sorting order is maintained if we
  367|       |     *
  368|       |     * - compute hash indices with modulo
  369|       |     * - resize by an integer factor
  370|       |     * - start to copy from the beginning of a probe sequence
  371|       |     */
  372|  2.32k|    oldentry = hash->table;
  373|  15.7k|    while (oldentry->hashValue != 0) {
  ------------------
  |  Branch (373:12): [True: 13.3k, False: 2.32k]
  ------------------
  374|  13.3k|        if (++oldentry >= oldend)
  ------------------
  |  Branch (374:13): [True: 0, False: 13.3k]
  ------------------
  375|      0|            oldentry = hash->table;
  376|  13.3k|    }
  377|       |
  378|  75.6k|    for (i = 0; i < oldsize; i++) {
  ------------------
  |  Branch (378:17): [True: 73.3k, False: 2.32k]
  ------------------
  379|  73.3k|        if (oldentry->hashValue != 0) {
  ------------------
  |  Branch (379:13): [True: 64.1k, False: 9.16k]
  ------------------
  380|  64.1k|            xmlHashEntry *entry = &table[oldentry->hashValue & (size - 1)];
  381|       |
  382|  87.1k|            while (entry->hashValue != 0) {
  ------------------
  |  Branch (382:20): [True: 23.0k, False: 64.1k]
  ------------------
  383|  23.0k|                if (++entry >= end)
  ------------------
  |  Branch (383:21): [True: 359, False: 22.6k]
  ------------------
  384|    359|                    entry = table;
  385|  23.0k|            }
  386|  64.1k|            *entry = *oldentry;
  387|  64.1k|        }
  388|       |
  389|  73.3k|        if (++oldentry >= oldend)
  ------------------
  |  Branch (389:13): [True: 2.32k, False: 71.0k]
  ------------------
  390|  2.32k|            oldentry = hash->table;
  391|  73.3k|    }
  392|       |
  393|  2.32k|    xmlFree(hash->table);
  394|       |
  395|  65.6k|done:
  396|  65.6k|    hash->table = table;
  397|  65.6k|    hash->size = size;
  398|       |
  399|  65.6k|    return(0);
  400|  2.32k|}
hash.c:xmlHashUpdateInternal:
  417|   297k|                      void *payload, xmlHashDeallocator dealloc, int update) {
  418|   297k|    xmlChar *copy, *copy2, *copy3;
  419|   297k|    xmlHashEntry *entry = NULL;
  420|   297k|    size_t lengths[3] = {0, 0, 0};
  421|   297k|    unsigned hashValue, newSize;
  422|       |
  423|   297k|    if ((hash == NULL) || (key == NULL))
  ------------------
  |  Branch (423:9): [True: 0, False: 297k]
  |  Branch (423:27): [True: 0, False: 297k]
  ------------------
  424|      0|        return(-1);
  425|       |
  426|   297k|    hashValue = xmlHashValue(hash->randomSeed, key, key2, key3, lengths);
  427|       |
  428|       |    /*
  429|       |     * Check for an existing entry
  430|       |     */
  431|   297k|    if (hash->size == 0) {
  ------------------
  |  Branch (431:9): [True: 57.8k, False: 239k]
  ------------------
  432|  57.8k|        newSize = MIN_HASH_SIZE;
  ------------------
  |  |   30|  57.8k|#define MIN_HASH_SIZE 8
  ------------------
  433|   239k|    } else {
  434|   239k|        int found = 0;
  435|       |
  436|   239k|        entry = xmlHashFindEntry(hash, key, key2, key3, hashValue, &found);
  437|       |
  438|   239k|        if (found) {
  ------------------
  |  Branch (438:13): [True: 157k, False: 82.4k]
  ------------------
  439|   157k|            if (update) {
  ------------------
  |  Branch (439:17): [True: 1.01k, False: 156k]
  ------------------
  440|  1.01k|                if (dealloc)
  ------------------
  |  Branch (440:21): [True: 433, False: 583]
  ------------------
  441|    433|                    dealloc(entry->payload, entry->key);
  442|  1.01k|                entry->payload = payload;
  443|  1.01k|            }
  444|       |
  445|   157k|            return(0);
  446|   157k|        }
  447|       |
  448|  82.4k|        if (hash->nbElems + 1 > hash->size / MAX_FILL_DENOM * MAX_FILL_NUM) {
  ------------------
  |  |   29|  82.4k|#define MAX_FILL_DENOM 8
  ------------------
                      if (hash->nbElems + 1 > hash->size / MAX_FILL_DENOM * MAX_FILL_NUM) {
  ------------------
  |  |   28|  82.4k|#define MAX_FILL_NUM 7
  ------------------
  |  Branch (448:13): [True: 2.32k, False: 80.1k]
  ------------------
  449|       |            /* This guarantees that nbElems < INT_MAX */
  450|  2.32k|            if (hash->size >= MAX_HASH_SIZE)
  ------------------
  |  |   31|  2.32k|#define MAX_HASH_SIZE (1u << 31)
  ------------------
  |  Branch (450:17): [True: 0, False: 2.32k]
  ------------------
  451|      0|                return(-1);
  452|  2.32k|            newSize = hash->size * 2;
  453|  80.1k|        } else {
  454|  80.1k|            newSize = 0;
  455|  80.1k|        }
  456|  82.4k|    }
  457|       |
  458|       |    /*
  459|       |     * Grow the hash table if needed
  460|       |     */
  461|   140k|    if (newSize > 0) {
  ------------------
  |  Branch (461:9): [True: 60.1k, False: 80.1k]
  ------------------
  462|  60.1k|        unsigned mask, displ, pos;
  463|       |
  464|  60.1k|        if (xmlHashGrow(hash, newSize) != 0)
  ------------------
  |  Branch (464:13): [True: 14, False: 60.1k]
  ------------------
  465|     14|            return(-1);
  466|       |
  467|       |        /*
  468|       |         * Find new entry
  469|       |         */
  470|  60.1k|        mask = hash->size - 1;
  471|  60.1k|        displ = 0;
  472|  60.1k|        pos = hashValue & mask;
  473|  60.1k|        entry = &hash->table[pos];
  474|       |
  475|  60.1k|        if (entry->hashValue != 0) {
  ------------------
  |  Branch (475:13): [True: 990, False: 59.1k]
  ------------------
  476|  1.35k|            do {
  477|  1.35k|                displ++;
  478|  1.35k|                pos++;
  479|  1.35k|                entry++;
  480|  1.35k|                if ((pos & mask) == 0)
  ------------------
  |  Branch (480:21): [True: 59, False: 1.29k]
  ------------------
  481|     59|                    entry = hash->table;
  482|  1.35k|            } while ((entry->hashValue != 0) &&
  ------------------
  |  Branch (482:22): [True: 780, False: 576]
  ------------------
  483|    780|                     ((pos - entry->hashValue) & mask) >= displ);
  ------------------
  |  Branch (483:22): [True: 366, False: 414]
  ------------------
  484|    990|        }
  485|  60.1k|    }
  486|       |
  487|       |    /*
  488|       |     * Copy keys
  489|       |     */
  490|   140k|    if (hash->dict != NULL) {
  ------------------
  |  Branch (490:9): [True: 60.5k, False: 79.7k]
  ------------------
  491|  60.5k|        if (xmlDictOwns(hash->dict, key)) {
  ------------------
  |  Branch (491:13): [True: 60.5k, False: 0]
  ------------------
  492|  60.5k|            copy = (xmlChar *) key;
  493|  60.5k|        } 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|  60.5k|        if ((key2 == NULL) || (xmlDictOwns(hash->dict, key2))) {
  ------------------
  |  Branch (499:13): [True: 37.4k, False: 23.0k]
  |  Branch (499:31): [True: 22.5k, False: 554]
  ------------------
  500|  59.9k|            copy2 = (xmlChar *) key2;
  501|  59.9k|        } else {
  502|    554|            copy2 = (xmlChar *) xmlDictLookup(hash->dict, key2, -1);
  503|    554|            if (copy2 == NULL)
  ------------------
  |  Branch (503:17): [True: 1, False: 553]
  ------------------
  504|      1|                return(-1);
  505|    554|        }
  506|  60.5k|        if ((key3 == NULL) || (xmlDictOwns(hash->dict, key3))) {
  ------------------
  |  Branch (506:13): [True: 45.2k, False: 15.3k]
  |  Branch (506:31): [True: 15.3k, False: 0]
  ------------------
  507|  60.5k|            copy3 = (xmlChar *) key3;
  508|  60.5k|        } 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|  79.7k|    } else {
  514|  79.7k|        copy = xmlMalloc(lengths[0] + 1);
  515|  79.7k|        if (copy == NULL)
  ------------------
  |  Branch (515:13): [True: 13, False: 79.7k]
  ------------------
  516|     13|            return(-1);
  517|  79.7k|        memcpy(copy, key, lengths[0] + 1);
  518|       |
  519|  79.7k|        if (key2 != NULL) {
  ------------------
  |  Branch (519:13): [True: 1.96k, False: 77.8k]
  ------------------
  520|  1.96k|            copy2 = xmlMalloc(lengths[1] + 1);
  521|  1.96k|            if (copy2 == NULL) {
  ------------------
  |  Branch (521:17): [True: 3, False: 1.95k]
  ------------------
  522|      3|                xmlFree(copy);
  523|      3|                return(-1);
  524|      3|            }
  525|  1.95k|            memcpy(copy2, key2, lengths[1] + 1);
  526|  77.8k|        } else {
  527|  77.8k|            copy2 = NULL;
  528|  77.8k|        }
  529|       |
  530|  79.7k|        if (key3 != NULL) {
  ------------------
  |  Branch (530:13): [True: 11.7k, False: 68.0k]
  ------------------
  531|  11.7k|            copy3 = xmlMalloc(lengths[2] + 1);
  532|  11.7k|            if (copy3 == NULL) {
  ------------------
  |  Branch (532:17): [True: 4, False: 11.6k]
  ------------------
  533|      4|                xmlFree(copy);
  534|      4|                xmlFree(copy2);
  535|      4|                return(-1);
  536|      4|            }
  537|  11.6k|            memcpy(copy3, key3, lengths[2] + 1);
  538|  68.0k|        } else {
  539|  68.0k|            copy3 = NULL;
  540|  68.0k|        }
  541|  79.7k|    }
  542|       |
  543|       |    /*
  544|       |     * Shift the remainder of the probe sequence to the right
  545|       |     */
  546|   140k|    if (entry->hashValue != 0) {
  ------------------
  |  Branch (546:9): [True: 18.4k, False: 121k]
  ------------------
  547|  18.4k|        const xmlHashEntry *end = &hash->table[hash->size];
  548|  18.4k|        const xmlHashEntry *cur = entry;
  549|       |
  550|  88.8k|        do {
  551|  88.8k|            cur++;
  552|  88.8k|            if (cur >= end)
  ------------------
  |  Branch (552:17): [True: 2.36k, False: 86.4k]
  ------------------
  553|  2.36k|                cur = hash->table;
  554|  88.8k|        } while (cur->hashValue != 0);
  ------------------
  |  Branch (554:18): [True: 70.4k, False: 18.4k]
  ------------------
  555|       |
  556|  18.4k|        if (cur < entry) {
  ------------------
  |  Branch (556:13): [True: 2.36k, False: 16.0k]
  ------------------
  557|       |            /*
  558|       |             * If we traversed the end of the buffer, handle the part
  559|       |             * at the start of the buffer.
  560|       |             */
  561|  2.36k|            memmove(&hash->table[1], hash->table,
  562|  2.36k|                    (char *) cur - (char *) hash->table);
  563|  2.36k|            cur = end - 1;
  564|  2.36k|            hash->table[0] = *cur;
  565|  2.36k|        }
  566|       |
  567|  18.4k|        memmove(&entry[1], entry, (char *) cur - (char *) entry);
  568|  18.4k|    }
  569|       |
  570|       |    /*
  571|       |     * Populate entry
  572|       |     */
  573|   140k|    entry->key = copy;
  574|   140k|    entry->key2 = copy2;
  575|   140k|    entry->key3 = copy3;
  576|   140k|    entry->payload = payload;
  577|       |    /* OR with MAX_HASH_SIZE to make sure that the value is non-zero */
  578|   140k|    entry->hashValue = hashValue | MAX_HASH_SIZE;
  ------------------
  |  |   31|   140k|#define MAX_HASH_SIZE (1u << 31)
  ------------------
  579|       |
  580|   140k|    hash->nbElems++;
  581|       |
  582|   140k|    return(1);
  583|   140k|}
hash.c:xmlHashValue:
   62|  4.67M|             const xmlChar *key3, size_t *lengths) {
   63|  4.67M|    unsigned h1, h2;
   64|  4.67M|    size_t i;
   65|       |
   66|  4.67M|    HASH_INIT(h1, h2, seed);
  ------------------
  |  |   23|  4.67M|    do { \
  |  |   24|  4.67M|        h1 = seed ^ 0x3b00; \
  |  |   25|  4.67M|        h2 = HASH_ROL(seed, 15); \
  |  |  ------------------
  |  |  |  |   12|  4.67M|#define HASH_ROL(x,n) ((x) << (n) | ((x) & 0xFFFFFFFF) >> (32 - (n)))
  |  |  ------------------
  |  |   26|  4.67M|    } while (0)
  |  |  ------------------
  |  |  |  Branch (26:14): [Folded, False: 4.67M]
  |  |  ------------------
  ------------------
   67|       |
   68|  30.1M|    for (i = 0; key[i] != 0; i++) {
  ------------------
  |  Branch (68:17): [True: 25.4M, False: 4.67M]
  ------------------
   69|  25.4M|        HASH_UPDATE(h1, h2, key[i]);
  ------------------
  |  |   29|  25.4M|    do { \
  |  |   30|  25.4M|        h1 += ch; \
  |  |   31|  25.4M|        h1 += h1 << 3; \
  |  |   32|  25.4M|        h2 += h1; \
  |  |   33|  25.4M|        h2 = HASH_ROL(h2, 7); \
  |  |  ------------------
  |  |  |  |   12|  25.4M|#define HASH_ROL(x,n) ((x) << (n) | ((x) & 0xFFFFFFFF) >> (32 - (n)))
  |  |  ------------------
  |  |   34|  25.4M|        h2 += h2 << 2; \
  |  |   35|  25.4M|    } while (0)
  |  |  ------------------
  |  |  |  Branch (35:14): [Folded, False: 25.4M]
  |  |  ------------------
  ------------------
   70|  25.4M|    }
   71|  4.67M|    if (lengths)
  ------------------
  |  Branch (71:9): [True: 297k, False: 4.37M]
  ------------------
   72|   297k|        lengths[0] = i;
   73|       |
   74|  4.67M|    HASH_UPDATE(h1, h2, 0);
  ------------------
  |  |   29|  4.67M|    do { \
  |  |   30|  4.67M|        h1 += ch; \
  |  |   31|  4.67M|        h1 += h1 << 3; \
  |  |   32|  4.67M|        h2 += h1; \
  |  |   33|  4.67M|        h2 = HASH_ROL(h2, 7); \
  |  |  ------------------
  |  |  |  |   12|  4.67M|#define HASH_ROL(x,n) ((x) << (n) | ((x) & 0xFFFFFFFF) >> (32 - (n)))
  |  |  ------------------
  |  |   34|  4.67M|        h2 += h2 << 2; \
  |  |   35|  4.67M|    } while (0)
  |  |  ------------------
  |  |  |  Branch (35:14): [Folded, False: 4.67M]
  |  |  ------------------
  ------------------
   75|       |
   76|  4.67M|    if (key2 != NULL) {
  ------------------
  |  Branch (76:9): [True: 198k, False: 4.47M]
  ------------------
   77|   933k|        for (i = 0; key2[i] != 0; i++) {
  ------------------
  |  Branch (77:21): [True: 735k, False: 198k]
  ------------------
   78|   735k|            HASH_UPDATE(h1, h2, key2[i]);
  ------------------
  |  |   29|   735k|    do { \
  |  |   30|   735k|        h1 += ch; \
  |  |   31|   735k|        h1 += h1 << 3; \
  |  |   32|   735k|        h2 += h1; \
  |  |   33|   735k|        h2 = HASH_ROL(h2, 7); \
  |  |  ------------------
  |  |  |  |   12|   735k|#define HASH_ROL(x,n) ((x) << (n) | ((x) & 0xFFFFFFFF) >> (32 - (n)))
  |  |  ------------------
  |  |   34|   735k|        h2 += h2 << 2; \
  |  |   35|   735k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (35:14): [Folded, False: 735k]
  |  |  ------------------
  ------------------
   79|   735k|        }
   80|   198k|        if (lengths)
  ------------------
  |  Branch (80:13): [True: 50.4k, False: 148k]
  ------------------
   81|  50.4k|            lengths[1] = i;
   82|   198k|    }
   83|       |
   84|  4.67M|    HASH_UPDATE(h1, h2, 0);
  ------------------
  |  |   29|  4.67M|    do { \
  |  |   30|  4.67M|        h1 += ch; \
  |  |   31|  4.67M|        h1 += h1 << 3; \
  |  |   32|  4.67M|        h2 += h1; \
  |  |   33|  4.67M|        h2 = HASH_ROL(h2, 7); \
  |  |  ------------------
  |  |  |  |   12|  4.67M|#define HASH_ROL(x,n) ((x) << (n) | ((x) & 0xFFFFFFFF) >> (32 - (n)))
  |  |  ------------------
  |  |   34|  4.67M|        h2 += h2 << 2; \
  |  |   35|  4.67M|    } while (0)
  |  |  ------------------
  |  |  |  Branch (35:14): [Folded, False: 4.67M]
  |  |  ------------------
  ------------------
   85|       |
   86|  4.67M|    if (key3 != NULL) {
  ------------------
  |  Branch (86:9): [True: 446k, False: 4.23M]
  ------------------
   87|  1.77M|        for (i = 0; key3[i] != 0; i++) {
  ------------------
  |  Branch (87:21): [True: 1.32M, False: 446k]
  ------------------
   88|  1.32M|            HASH_UPDATE(h1, h2, key3[i]);
  ------------------
  |  |   29|  1.32M|    do { \
  |  |   30|  1.32M|        h1 += ch; \
  |  |   31|  1.32M|        h1 += h1 << 3; \
  |  |   32|  1.32M|        h2 += h1; \
  |  |   33|  1.32M|        h2 = HASH_ROL(h2, 7); \
  |  |  ------------------
  |  |  |  |   12|  1.32M|#define HASH_ROL(x,n) ((x) << (n) | ((x) & 0xFFFFFFFF) >> (32 - (n)))
  |  |  ------------------
  |  |   34|  1.32M|        h2 += h2 << 2; \
  |  |   35|  1.32M|    } while (0)
  |  |  ------------------
  |  |  |  Branch (35:14): [Folded, False: 1.32M]
  |  |  ------------------
  ------------------
   89|  1.32M|        }
   90|   446k|        if (lengths)
  ------------------
  |  Branch (90:13): [True: 56.7k, False: 390k]
  ------------------
   91|  56.7k|            lengths[2] = i;
   92|   446k|    }
   93|       |
   94|  4.67M|    HASH_FINISH(h1, h2);
  ------------------
  |  |   39|  4.67M|    do { \
  |  |   40|  4.67M|        h1 ^= h2; \
  |  |   41|  4.67M|        h1 += HASH_ROL(h2, 14); \
  |  |  ------------------
  |  |  |  |   12|  4.67M|#define HASH_ROL(x,n) ((x) << (n) | ((x) & 0xFFFFFFFF) >> (32 - (n)))
  |  |  ------------------
  |  |   42|  4.67M|        h2 ^= h1; h2 += HASH_ROR(h1, 6); \
  |  |  ------------------
  |  |  |  |   13|  4.67M|#define HASH_ROR(x,n) (((x) & 0xFFFFFFFF) >> (n) | (x) << (32 - (n)))
  |  |  ------------------
  |  |   43|  4.67M|        h1 ^= h2; h1 += HASH_ROL(h2, 5); \
  |  |  ------------------
  |  |  |  |   12|  4.67M|#define HASH_ROL(x,n) ((x) << (n) | ((x) & 0xFFFFFFFF) >> (32 - (n)))
  |  |  ------------------
  |  |   44|  4.67M|        h2 ^= h1; h2 += HASH_ROR(h1, 8); \
  |  |  ------------------
  |  |  |  |   13|  4.67M|#define HASH_ROR(x,n) (((x) & 0xFFFFFFFF) >> (n) | (x) << (32 - (n)))
  |  |  ------------------
  |  |   45|  4.67M|        h2 &= 0xFFFFFFFF; \
  |  |   46|  4.67M|    } while (0)
  |  |  ------------------
  |  |  |  Branch (46:14): [Folded, False: 4.67M]
  |  |  ------------------
  ------------------
   95|       |
   96|  4.67M|    return(h2);
   97|  4.67M|}
hash.c:xmlHashFindEntry:
  287|  4.61M|                 unsigned hashValue, int *pfound) {
  288|  4.61M|    xmlHashEntry *entry;
  289|  4.61M|    unsigned mask, pos, displ;
  290|  4.61M|    int found = 0;
  291|       |
  292|  4.61M|    mask = hash->size - 1;
  293|  4.61M|    pos = hashValue & mask;
  294|  4.61M|    entry = &hash->table[pos];
  295|       |
  296|  4.61M|    if (entry->hashValue != 0) {
  ------------------
  |  Branch (296:9): [True: 3.96M, False: 657k]
  ------------------
  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.96M|        displ = 0;
  303|  3.96M|        hashValue |= MAX_HASH_SIZE;
  ------------------
  |  |   31|  3.96M|#define MAX_HASH_SIZE (1u << 31)
  ------------------
  304|       |
  305|  4.43M|        do {
  306|  4.43M|            if (entry->hashValue == hashValue) {
  ------------------
  |  Branch (306:17): [True: 3.63M, False: 808k]
  ------------------
  307|  3.63M|                if (hash->dict) {
  ------------------
  |  Branch (307:21): [True: 2.15M, False: 1.48M]
  ------------------
  308|  2.15M|                    if ((entry->key == key) &&
  ------------------
  |  Branch (308:25): [True: 1.16M, False: 986k]
  ------------------
  309|  1.16M|                        (entry->key2 == key2) &&
  ------------------
  |  Branch (309:25): [True: 1.14M, False: 19.9k]
  ------------------
  310|  1.14M|                        (entry->key3 == key3)) {
  ------------------
  |  Branch (310:25): [True: 1.14M, False: 761]
  ------------------
  311|  1.14M|                        found = 1;
  312|  1.14M|                        break;
  313|  1.14M|                    }
  314|  2.15M|                }
  315|  2.48M|                if ((strcmp((const char *) entry->key,
  ------------------
  |  Branch (315:21): [True: 2.48M, False: 203]
  ------------------
  316|  2.48M|                            (const char *) key) == 0) &&
  317|  2.48M|                    (xmlFastStrEqual(entry->key2, key2)) &&
  ------------------
  |  Branch (317:21): [True: 2.48M, False: 0]
  ------------------
  318|  2.48M|                    (xmlFastStrEqual(entry->key3, key3))) {
  ------------------
  |  Branch (318:21): [True: 2.48M, False: 0]
  ------------------
  319|  2.48M|                    found = 1;
  320|  2.48M|                    break;
  321|  2.48M|                }
  322|  2.48M|            }
  323|       |
  324|   808k|            displ++;
  325|   808k|            pos++;
  326|   808k|            entry++;
  327|   808k|            if ((pos & mask) == 0)
  ------------------
  |  Branch (327:17): [True: 35.3k, False: 773k]
  ------------------
  328|  35.3k|                entry = hash->table;
  329|   808k|        } while ((entry->hashValue != 0) &&
  ------------------
  |  Branch (329:18): [True: 587k, False: 221k]
  ------------------
  330|   587k|                 (((pos - entry->hashValue) & mask) >= displ));
  ------------------
  |  Branch (330:18): [True: 477k, False: 110k]
  ------------------
  331|  3.96M|    }
  332|       |
  333|  4.61M|    *pfound = found;
  334|  4.61M|    return(entry);
  335|  4.61M|}
hash.c:xmlHashQNameValue:
  104|  32.1k|                  const xmlChar *prefix3, const xmlChar *name3) {
  105|  32.1k|    unsigned h1, h2, ch;
  106|       |
  107|  32.1k|    HASH_INIT(h1, h2, seed);
  ------------------
  |  |   23|  32.1k|    do { \
  |  |   24|  32.1k|        h1 = seed ^ 0x3b00; \
  |  |   25|  32.1k|        h2 = HASH_ROL(seed, 15); \
  |  |  ------------------
  |  |  |  |   12|  32.1k|#define HASH_ROL(x,n) ((x) << (n) | ((x) & 0xFFFFFFFF) >> (32 - (n)))
  |  |  ------------------
  |  |   26|  32.1k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (26:14): [Folded, False: 32.1k]
  |  |  ------------------
  ------------------
  108|       |
  109|  32.1k|    if (prefix != NULL) {
  ------------------
  |  Branch (109:9): [True: 8.85k, False: 23.3k]
  ------------------
  110|  26.3k|        while ((ch = *prefix++) != 0) {
  ------------------
  |  Branch (110:16): [True: 17.4k, False: 8.85k]
  ------------------
  111|  17.4k|            HASH_UPDATE(h1, h2, ch);
  ------------------
  |  |   29|  17.4k|    do { \
  |  |   30|  17.4k|        h1 += ch; \
  |  |   31|  17.4k|        h1 += h1 << 3; \
  |  |   32|  17.4k|        h2 += h1; \
  |  |   33|  17.4k|        h2 = HASH_ROL(h2, 7); \
  |  |  ------------------
  |  |  |  |   12|  17.4k|#define HASH_ROL(x,n) ((x) << (n) | ((x) & 0xFFFFFFFF) >> (32 - (n)))
  |  |  ------------------
  |  |   34|  17.4k|        h2 += h2 << 2; \
  |  |   35|  17.4k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (35:14): [Folded, False: 17.4k]
  |  |  ------------------
  ------------------
  112|  17.4k|        }
  113|  8.85k|        HASH_UPDATE(h1, h2, ':');
  ------------------
  |  |   29|  8.85k|    do { \
  |  |   30|  8.85k|        h1 += ch; \
  |  |   31|  8.85k|        h1 += h1 << 3; \
  |  |   32|  8.85k|        h2 += h1; \
  |  |   33|  8.85k|        h2 = HASH_ROL(h2, 7); \
  |  |  ------------------
  |  |  |  |   12|  8.85k|#define HASH_ROL(x,n) ((x) << (n) | ((x) & 0xFFFFFFFF) >> (32 - (n)))
  |  |  ------------------
  |  |   34|  8.85k|        h2 += h2 << 2; \
  |  |   35|  8.85k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (35:14): [Folded, False: 8.85k]
  |  |  ------------------
  ------------------
  114|  8.85k|    }
  115|  32.1k|    if (name != NULL) {
  ------------------
  |  Branch (115:9): [True: 32.1k, False: 0]
  ------------------
  116|  3.38M|        while ((ch = *name++) != 0) {
  ------------------
  |  Branch (116:16): [True: 3.35M, False: 32.1k]
  ------------------
  117|  3.35M|            HASH_UPDATE(h1, h2, ch);
  ------------------
  |  |   29|  3.35M|    do { \
  |  |   30|  3.35M|        h1 += ch; \
  |  |   31|  3.35M|        h1 += h1 << 3; \
  |  |   32|  3.35M|        h2 += h1; \
  |  |   33|  3.35M|        h2 = HASH_ROL(h2, 7); \
  |  |  ------------------
  |  |  |  |   12|  3.35M|#define HASH_ROL(x,n) ((x) << (n) | ((x) & 0xFFFFFFFF) >> (32 - (n)))
  |  |  ------------------
  |  |   34|  3.35M|        h2 += h2 << 2; \
  |  |   35|  3.35M|    } while (0)
  |  |  ------------------
  |  |  |  Branch (35:14): [Folded, False: 3.35M]
  |  |  ------------------
  ------------------
  118|  3.35M|        }
  119|  32.1k|    }
  120|  32.1k|    HASH_UPDATE(h1, h2, 0);
  ------------------
  |  |   29|  32.1k|    do { \
  |  |   30|  32.1k|        h1 += ch; \
  |  |   31|  32.1k|        h1 += h1 << 3; \
  |  |   32|  32.1k|        h2 += h1; \
  |  |   33|  32.1k|        h2 = HASH_ROL(h2, 7); \
  |  |  ------------------
  |  |  |  |   12|  32.1k|#define HASH_ROL(x,n) ((x) << (n) | ((x) & 0xFFFFFFFF) >> (32 - (n)))
  |  |  ------------------
  |  |   34|  32.1k|        h2 += h2 << 2; \
  |  |   35|  32.1k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (35:14): [Folded, False: 32.1k]
  |  |  ------------------
  ------------------
  121|  32.1k|    if (prefix2 != NULL) {
  ------------------
  |  Branch (121:9): [True: 8.61k, False: 23.5k]
  ------------------
  122|  46.2k|        while ((ch = *prefix2++) != 0) {
  ------------------
  |  Branch (122:16): [True: 37.6k, False: 8.61k]
  ------------------
  123|  37.6k|            HASH_UPDATE(h1, h2, ch);
  ------------------
  |  |   29|  37.6k|    do { \
  |  |   30|  37.6k|        h1 += ch; \
  |  |   31|  37.6k|        h1 += h1 << 3; \
  |  |   32|  37.6k|        h2 += h1; \
  |  |   33|  37.6k|        h2 = HASH_ROL(h2, 7); \
  |  |  ------------------
  |  |  |  |   12|  37.6k|#define HASH_ROL(x,n) ((x) << (n) | ((x) & 0xFFFFFFFF) >> (32 - (n)))
  |  |  ------------------
  |  |   34|  37.6k|        h2 += h2 << 2; \
  |  |   35|  37.6k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (35:14): [Folded, False: 37.6k]
  |  |  ------------------
  ------------------
  124|  37.6k|        }
  125|  8.61k|        HASH_UPDATE(h1, h2, ':');
  ------------------
  |  |   29|  8.61k|    do { \
  |  |   30|  8.61k|        h1 += ch; \
  |  |   31|  8.61k|        h1 += h1 << 3; \
  |  |   32|  8.61k|        h2 += h1; \
  |  |   33|  8.61k|        h2 = HASH_ROL(h2, 7); \
  |  |  ------------------
  |  |  |  |   12|  8.61k|#define HASH_ROL(x,n) ((x) << (n) | ((x) & 0xFFFFFFFF) >> (32 - (n)))
  |  |  ------------------
  |  |   34|  8.61k|        h2 += h2 << 2; \
  |  |   35|  8.61k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (35:14): [Folded, False: 8.61k]
  |  |  ------------------
  ------------------
  126|  8.61k|    }
  127|  32.1k|    if (name2 != NULL) {
  ------------------
  |  Branch (127:9): [True: 32.1k, False: 0]
  ------------------
  128|   558k|        while ((ch = *name2++) != 0) {
  ------------------
  |  Branch (128:16): [True: 525k, False: 32.1k]
  ------------------
  129|   525k|            HASH_UPDATE(h1, h2, ch);
  ------------------
  |  |   29|   525k|    do { \
  |  |   30|   525k|        h1 += ch; \
  |  |   31|   525k|        h1 += h1 << 3; \
  |  |   32|   525k|        h2 += h1; \
  |  |   33|   525k|        h2 = HASH_ROL(h2, 7); \
  |  |  ------------------
  |  |  |  |   12|   525k|#define HASH_ROL(x,n) ((x) << (n) | ((x) & 0xFFFFFFFF) >> (32 - (n)))
  |  |  ------------------
  |  |   34|   525k|        h2 += h2 << 2; \
  |  |   35|   525k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (35:14): [Folded, False: 525k]
  |  |  ------------------
  ------------------
  130|   525k|        }
  131|  32.1k|    }
  132|  32.1k|    HASH_UPDATE(h1, h2, 0);
  ------------------
  |  |   29|  32.1k|    do { \
  |  |   30|  32.1k|        h1 += ch; \
  |  |   31|  32.1k|        h1 += h1 << 3; \
  |  |   32|  32.1k|        h2 += h1; \
  |  |   33|  32.1k|        h2 = HASH_ROL(h2, 7); \
  |  |  ------------------
  |  |  |  |   12|  32.1k|#define HASH_ROL(x,n) ((x) << (n) | ((x) & 0xFFFFFFFF) >> (32 - (n)))
  |  |  ------------------
  |  |   34|  32.1k|        h2 += h2 << 2; \
  |  |   35|  32.1k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (35:14): [Folded, False: 32.1k]
  |  |  ------------------
  ------------------
  133|  32.1k|    if (prefix3 != NULL) {
  ------------------
  |  Branch (133:9): [True: 0, False: 32.1k]
  ------------------
  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|  32.1k|    if (name3 != NULL) {
  ------------------
  |  Branch (139:9): [True: 0, False: 32.1k]
  ------------------
  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|  32.1k|    HASH_FINISH(h1, h2);
  ------------------
  |  |   39|  32.1k|    do { \
  |  |   40|  32.1k|        h1 ^= h2; \
  |  |   41|  32.1k|        h1 += HASH_ROL(h2, 14); \
  |  |  ------------------
  |  |  |  |   12|  32.1k|#define HASH_ROL(x,n) ((x) << (n) | ((x) & 0xFFFFFFFF) >> (32 - (n)))
  |  |  ------------------
  |  |   42|  32.1k|        h2 ^= h1; h2 += HASH_ROR(h1, 6); \
  |  |  ------------------
  |  |  |  |   13|  32.1k|#define HASH_ROR(x,n) (((x) & 0xFFFFFFFF) >> (n) | (x) << (32 - (n)))
  |  |  ------------------
  |  |   43|  32.1k|        h1 ^= h2; h1 += HASH_ROL(h2, 5); \
  |  |  ------------------
  |  |  |  |   12|  32.1k|#define HASH_ROL(x,n) ((x) << (n) | ((x) & 0xFFFFFFFF) >> (32 - (n)))
  |  |  ------------------
  |  |   44|  32.1k|        h2 ^= h1; h2 += HASH_ROR(h1, 8); \
  |  |  ------------------
  |  |  |  |   13|  32.1k|#define HASH_ROR(x,n) (((x) & 0xFFFFFFFF) >> (n) | (x) << (32 - (n)))
  |  |  ------------------
  |  |   45|  32.1k|        h2 &= 0xFFFFFFFF; \
  |  |   46|  32.1k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (46:14): [Folded, False: 32.1k]
  |  |  ------------------
  ------------------
  146|       |
  147|  32.1k|    return(h2);
  148|  32.1k|}
hash.c:stubHashScannerFull:
  946|  15.7k|                    const xmlChar *key3 ATTRIBUTE_UNUSED) {
  947|  15.7k|    stubData *sdata = (stubData *) data;
  948|  15.7k|    sdata->scan(payload, sdata->data, key);
  949|  15.7k|}
hash.c:xmlFastStrEqual:
  263|  5.08M|xmlFastStrEqual(const xmlChar *s1, const xmlChar *s2) {
  264|  5.08M|    if (s1 == NULL)
  ------------------
  |  Branch (264:9): [True: 4.69M, False: 390k]
  ------------------
  265|  4.69M|        return(s2 == NULL);
  266|   390k|    else
  267|   390k|        return((s2 != NULL) &&
  ------------------
  |  Branch (267:16): [True: 390k, False: 0]
  ------------------
  268|   390k|               (strcmp((const char *) s1, (const char *) s2) == 0));
  ------------------
  |  Branch (268:16): [True: 278k, False: 111k]
  ------------------
  269|  5.08M|}

tree.c:xmlGrowCapacity:
   32|  31.3k|xmlGrowCapacity(int capacity, size_t elemSize, int min, int max) {
   33|  31.3k|    int extra;
   34|       |
   35|  31.3k|    if (capacity <= 0) {
  ------------------
  |  Branch (35:9): [True: 31.0k, False: 329]
  ------------------
   36|  31.0k|#ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
   37|  31.0k|        (void) min;
   38|  31.0k|        return(1);
   39|       |#else
   40|       |        return(min);
   41|       |#endif
   42|  31.0k|    }
   43|       |
   44|    329|    if ((capacity >= max) ||
  ------------------
  |  Branch (44:9): [True: 0, False: 329]
  ------------------
   45|    329|        ((size_t) capacity > SIZE_MAX / 2 / elemSize))
  ------------------
  |  Branch (45:9): [True: 0, False: 329]
  ------------------
   46|      0|        return(-1);
   47|       |
   48|       |    /* Grow by 50% */
   49|    329|    extra = (capacity + 1) / 2;
   50|       |
   51|    329|    if (capacity > max - extra)
  ------------------
  |  Branch (51:9): [True: 0, False: 329]
  ------------------
   52|      0|        return(max);
   53|       |
   54|    329|    return(capacity + extra);
   55|    329|}
uri.c:xmlGrowCapacity:
   32|  8.44k|xmlGrowCapacity(int capacity, size_t elemSize, int min, int max) {
   33|  8.44k|    int extra;
   34|       |
   35|  8.44k|    if (capacity <= 0) {
  ------------------
  |  Branch (35:9): [True: 0, False: 8.44k]
  ------------------
   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.44k|    if ((capacity >= max) ||
  ------------------
  |  Branch (44:9): [True: 26, False: 8.42k]
  ------------------
   45|  8.42k|        ((size_t) capacity > SIZE_MAX / 2 / elemSize))
  ------------------
  |  Branch (45:9): [True: 0, False: 8.42k]
  ------------------
   46|     26|        return(-1);
   47|       |
   48|       |    /* Grow by 50% */
   49|  8.42k|    extra = (capacity + 1) / 2;
   50|       |
   51|  8.42k|    if (capacity > max - extra)
  ------------------
  |  Branch (51:9): [True: 43, False: 8.37k]
  ------------------
   52|     43|        return(max);
   53|       |
   54|  8.37k|    return(capacity + extra);
   55|  8.42k|}
valid.c:xmlGrowCapacity:
   32|  8.98k|xmlGrowCapacity(int capacity, size_t elemSize, int min, int max) {
   33|  8.98k|    int extra;
   34|       |
   35|  8.98k|    if (capacity <= 0) {
  ------------------
  |  Branch (35:9): [True: 3.29k, False: 5.68k]
  ------------------
   36|  3.29k|#ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
   37|  3.29k|        (void) min;
   38|  3.29k|        return(1);
   39|       |#else
   40|       |        return(min);
   41|       |#endif
   42|  3.29k|    }
   43|       |
   44|  5.68k|    if ((capacity >= max) ||
  ------------------
  |  Branch (44:9): [True: 0, False: 5.68k]
  ------------------
   45|  5.68k|        ((size_t) capacity > SIZE_MAX / 2 / elemSize))
  ------------------
  |  Branch (45:9): [True: 0, False: 5.68k]
  ------------------
   46|      0|        return(-1);
   47|       |
   48|       |    /* Grow by 50% */
   49|  5.68k|    extra = (capacity + 1) / 2;
   50|       |
   51|  5.68k|    if (capacity > max - extra)
  ------------------
  |  Branch (51:9): [True: 0, False: 5.68k]
  ------------------
   52|      0|        return(max);
   53|       |
   54|  5.68k|    return(capacity + extra);
   55|  5.68k|}
xmlreader.c:xmlGrowCapacity:
   32|    463|xmlGrowCapacity(int capacity, size_t elemSize, int min, int max) {
   33|    463|    int extra;
   34|       |
   35|    463|    if (capacity <= 0) {
  ------------------
  |  Branch (35:9): [True: 216, False: 247]
  ------------------
   36|    216|#ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
   37|    216|        (void) min;
   38|    216|        return(1);
   39|       |#else
   40|       |        return(min);
   41|       |#endif
   42|    216|    }
   43|       |
   44|    247|    if ((capacity >= max) ||
  ------------------
  |  Branch (44:9): [True: 0, False: 247]
  ------------------
   45|    247|        ((size_t) capacity > SIZE_MAX / 2 / elemSize))
  ------------------
  |  Branch (45:9): [True: 0, False: 247]
  ------------------
   46|      0|        return(-1);
   47|       |
   48|       |    /* Grow by 50% */
   49|    247|    extra = (capacity + 1) / 2;
   50|       |
   51|    247|    if (capacity > max - extra)
  ------------------
  |  Branch (51:9): [True: 0, False: 247]
  ------------------
   52|      0|        return(max);
   53|       |
   54|    247|    return(capacity + extra);
   55|    247|}
xmlregexp.c:xmlGrowCapacity:
   32|  1.40M|xmlGrowCapacity(int capacity, size_t elemSize, int min, int max) {
   33|  1.40M|    int extra;
   34|       |
   35|  1.40M|    if (capacity <= 0) {
  ------------------
  |  Branch (35:9): [True: 648k, False: 757k]
  ------------------
   36|   648k|#ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
   37|   648k|        (void) min;
   38|   648k|        return(1);
   39|       |#else
   40|       |        return(min);
   41|       |#endif
   42|   648k|    }
   43|       |
   44|   757k|    if ((capacity >= max) ||
  ------------------
  |  Branch (44:9): [True: 0, False: 757k]
  ------------------
   45|   757k|        ((size_t) capacity > SIZE_MAX / 2 / elemSize))
  ------------------
  |  Branch (45:9): [True: 0, False: 757k]
  ------------------
   46|      0|        return(-1);
   47|       |
   48|       |    /* Grow by 50% */
   49|   757k|    extra = (capacity + 1) / 2;
   50|       |
   51|   757k|    if (capacity > max - extra)
  ------------------
  |  Branch (51:9): [True: 0, False: 757k]
  ------------------
   52|      0|        return(max);
   53|       |
   54|   757k|    return(capacity + extra);
   55|   757k|}
xinclude.c:xmlGrowCapacity:
   32|  20.3k|xmlGrowCapacity(int capacity, size_t elemSize, int min, int max) {
   33|  20.3k|    int extra;
   34|       |
   35|  20.3k|    if (capacity <= 0) {
  ------------------
  |  Branch (35:9): [True: 18.3k, False: 2.04k]
  ------------------
   36|  18.3k|#ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
   37|  18.3k|        (void) min;
   38|  18.3k|        return(1);
   39|       |#else
   40|       |        return(min);
   41|       |#endif
   42|  18.3k|    }
   43|       |
   44|  2.04k|    if ((capacity >= max) ||
  ------------------
  |  Branch (44:9): [True: 0, False: 2.04k]
  ------------------
   45|  2.04k|        ((size_t) capacity > SIZE_MAX / 2 / elemSize))
  ------------------
  |  Branch (45:9): [True: 0, False: 2.04k]
  ------------------
   46|      0|        return(-1);
   47|       |
   48|       |    /* Grow by 50% */
   49|  2.04k|    extra = (capacity + 1) / 2;
   50|       |
   51|  2.04k|    if (capacity > max - extra)
  ------------------
  |  Branch (51:9): [True: 0, False: 2.04k]
  ------------------
   52|      0|        return(max);
   53|       |
   54|  2.04k|    return(capacity + extra);
   55|  2.04k|}
xpath.c:xmlGrowCapacity:
   32|  1.43M|xmlGrowCapacity(int capacity, size_t elemSize, int min, int max) {
   33|  1.43M|    int extra;
   34|       |
   35|  1.43M|    if (capacity <= 0) {
  ------------------
  |  Branch (35:9): [True: 371k, False: 1.06M]
  ------------------
   36|   371k|#ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
   37|   371k|        (void) min;
   38|   371k|        return(1);
   39|       |#else
   40|       |        return(min);
   41|       |#endif
   42|   371k|    }
   43|       |
   44|  1.06M|    if ((capacity >= max) ||
  ------------------
  |  Branch (44:9): [True: 0, False: 1.06M]
  ------------------
   45|  1.06M|        ((size_t) capacity > SIZE_MAX / 2 / elemSize))
  ------------------
  |  Branch (45:9): [True: 0, False: 1.06M]
  ------------------
   46|      0|        return(-1);
   47|       |
   48|       |    /* Grow by 50% */
   49|  1.06M|    extra = (capacity + 1) / 2;
   50|       |
   51|  1.06M|    if (capacity > max - extra)
  ------------------
  |  Branch (51:9): [True: 1, False: 1.06M]
  ------------------
   52|      1|        return(max);
   53|       |
   54|  1.06M|    return(capacity + extra);
   55|  1.06M|}
parser.c:xmlGrowCapacity:
   32|   314k|xmlGrowCapacity(int capacity, size_t elemSize, int min, int max) {
   33|   314k|    int extra;
   34|       |
   35|   314k|    if (capacity <= 0) {
  ------------------
  |  Branch (35:9): [True: 32.1k, False: 282k]
  ------------------
   36|  32.1k|#ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
   37|  32.1k|        (void) min;
   38|  32.1k|        return(1);
   39|       |#else
   40|       |        return(min);
   41|       |#endif
   42|  32.1k|    }
   43|       |
   44|   282k|    if ((capacity >= max) ||
  ------------------
  |  Branch (44:9): [True: 218, False: 282k]
  ------------------
   45|   282k|        ((size_t) capacity > SIZE_MAX / 2 / elemSize))
  ------------------
  |  Branch (45:9): [True: 0, False: 282k]
  ------------------
   46|    218|        return(-1);
   47|       |
   48|       |    /* Grow by 50% */
   49|   282k|    extra = (capacity + 1) / 2;
   50|       |
   51|   282k|    if (capacity > max - extra)
  ------------------
  |  Branch (51:9): [True: 405, False: 281k]
  ------------------
   52|    405|        return(max);
   53|       |
   54|   281k|    return(capacity + extra);
   55|   282k|}

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

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

xmlWarningMsg:
  276|  57.3k|{
  277|  57.3k|    xmlCtxtErr(ctxt, NULL, XML_FROM_PARSER, error, XML_ERR_WARNING,
  278|       |               str1, str2, NULL, 0, msg, str1, str2);
  279|  57.3k|}
xmlCheckLanguageID:
 1267|  62.7k|{
 1268|  62.7k|    const xmlChar *cur = lang, *nxt;
 1269|       |
 1270|  62.7k|    if (cur == NULL)
  ------------------
  |  Branch (1270:9): [True: 321, False: 62.3k]
  ------------------
 1271|    321|        return (0);
 1272|  62.3k|    if (((cur[0] == 'i') && (cur[1] == '-')) ||
  ------------------
  |  Branch (1272:10): [True: 600, False: 61.7k]
  |  Branch (1272:29): [True: 134, False: 466]
  ------------------
 1273|  62.2k|        ((cur[0] == 'I') && (cur[1] == '-')) ||
  ------------------
  |  Branch (1273:10): [True: 34.0k, False: 28.2k]
  |  Branch (1273:29): [True: 1.87k, False: 32.1k]
  ------------------
 1274|  60.3k|        ((cur[0] == 'x') && (cur[1] == '-')) ||
  ------------------
  |  Branch (1274:10): [True: 523, False: 59.8k]
  |  Branch (1274:29): [True: 35, False: 488]
  ------------------
 1275|  60.3k|        ((cur[0] == 'X') && (cur[1] == '-'))) {
  ------------------
  |  Branch (1275:10): [True: 121, False: 60.2k]
  |  Branch (1275:29): [True: 44, False: 77]
  ------------------
 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|  2.08k|        cur += 2;
 1282|  5.20k|        while (((cur[0] >= 'A') && (cur[0] <= 'Z')) ||
  ------------------
  |  Branch (1282:17): [True: 3.22k, False: 1.97k]
  |  Branch (1282:36): [True: 2.88k, False: 343]
  ------------------
 1283|  2.32k|               ((cur[0] >= 'a') && (cur[0] <= 'z')))
  ------------------
  |  Branch (1283:17): [True: 343, False: 1.97k]
  |  Branch (1283:36): [True: 235, False: 108]
  ------------------
 1284|  3.12k|            cur++;
 1285|  2.08k|        return(cur[0] == 0);
 1286|  2.08k|    }
 1287|  60.3k|    nxt = cur;
 1288|   292k|    while (((nxt[0] >= 'A') && (nxt[0] <= 'Z')) ||
  ------------------
  |  Branch (1288:13): [True: 233k, False: 58.8k]
  |  Branch (1288:32): [True: 224k, False: 9.13k]
  ------------------
 1289|  67.9k|           ((nxt[0] >= 'a') && (nxt[0] <= 'z')))
  ------------------
  |  Branch (1289:13): [True: 9.13k, False: 58.8k]
  |  Branch (1289:32): [True: 7.64k, False: 1.48k]
  ------------------
 1290|   232k|           nxt++;
 1291|  60.3k|    if (nxt - cur >= 4) {
  ------------------
  |  Branch (1291:9): [True: 2.85k, False: 57.4k]
  ------------------
 1292|       |        /*
 1293|       |         * Reserved
 1294|       |         */
 1295|  2.85k|        if ((nxt - cur > 8) || (nxt[0] != 0))
  ------------------
  |  Branch (1295:13): [True: 1.59k, False: 1.25k]
  |  Branch (1295:32): [True: 690, False: 563]
  ------------------
 1296|  2.28k|            return(0);
 1297|    563|        return(1);
 1298|  2.85k|    }
 1299|  57.4k|    if (nxt - cur < 2)
  ------------------
  |  Branch (1299:9): [True: 2.74k, False: 54.7k]
  ------------------
 1300|  2.74k|        return(0);
 1301|       |    /* we got an ISO 639 code */
 1302|  54.7k|    if (nxt[0] == 0)
  ------------------
  |  Branch (1302:9): [True: 2.29k, False: 52.4k]
  ------------------
 1303|  2.29k|        return(1);
 1304|  52.4k|    if (nxt[0] != '-')
  ------------------
  |  Branch (1304:9): [True: 3.46k, False: 48.9k]
  ------------------
 1305|  3.46k|        return(0);
 1306|       |
 1307|  48.9k|    nxt++;
 1308|  48.9k|    cur = nxt;
 1309|       |    /* now we can have extlang or script or region or variant */
 1310|  48.9k|    if ((nxt[0] >= '0') && (nxt[0] <= '9'))
  ------------------
  |  Branch (1310:9): [True: 46.0k, False: 2.86k]
  |  Branch (1310:28): [True: 13.9k, False: 32.1k]
  ------------------
 1311|  13.9k|        goto region_m49;
 1312|       |
 1313|   131k|    while (((nxt[0] >= 'A') && (nxt[0] <= 'Z')) ||
  ------------------
  |  Branch (1313:13): [True: 98.6k, False: 33.2k]
  |  Branch (1313:32): [True: 93.8k, False: 4.77k]
  ------------------
 1314|  37.9k|           ((nxt[0] >= 'a') && (nxt[0] <= 'z')))
  ------------------
  |  Branch (1314:13): [True: 4.43k, False: 33.5k]
  |  Branch (1314:32): [True: 2.98k, False: 1.44k]
  ------------------
 1315|  96.8k|           nxt++;
 1316|  34.9k|    if (nxt - cur == 4)
  ------------------
  |  Branch (1316:9): [True: 1.45k, False: 33.5k]
  ------------------
 1317|  1.45k|        goto script;
 1318|  33.5k|    if (nxt - cur == 2)
  ------------------
  |  Branch (1318:9): [True: 1.51k, False: 32.0k]
  ------------------
 1319|  1.51k|        goto region;
 1320|  32.0k|    if ((nxt - cur >= 5) && (nxt - cur <= 8))
  ------------------
  |  Branch (1320:9): [True: 757, False: 31.2k]
  |  Branch (1320:29): [True: 448, False: 309]
  ------------------
 1321|    448|        goto variant;
 1322|  31.5k|    if (nxt - cur != 3)
  ------------------
  |  Branch (1322:9): [True: 4.38k, False: 27.1k]
  ------------------
 1323|  4.38k|        return(0);
 1324|       |    /* we parsed an extlang */
 1325|  27.1k|    if (nxt[0] == 0)
  ------------------
  |  Branch (1325:9): [True: 207, False: 26.9k]
  ------------------
 1326|    207|        return(1);
 1327|  26.9k|    if (nxt[0] != '-')
  ------------------
  |  Branch (1327:9): [True: 9.40k, False: 17.5k]
  ------------------
 1328|  9.40k|        return(0);
 1329|       |
 1330|  17.5k|    nxt++;
 1331|  17.5k|    cur = nxt;
 1332|       |    /* now we can have script or region or variant */
 1333|  17.5k|    if ((nxt[0] >= '0') && (nxt[0] <= '9'))
  ------------------
  |  Branch (1333:9): [True: 17.1k, False: 405]
  |  Branch (1333:28): [True: 860, False: 16.3k]
  ------------------
 1334|    860|        goto region_m49;
 1335|       |
 1336|  64.4k|    while (((nxt[0] >= 'A') && (nxt[0] <= 'Z')) ||
  ------------------
  |  Branch (1336:13): [True: 48.7k, False: 15.6k]
  |  Branch (1336:32): [True: 42.0k, False: 6.77k]
  ------------------
 1337|  22.4k|           ((nxt[0] >= 'a') && (nxt[0] <= 'z')))
  ------------------
  |  Branch (1337:13): [True: 6.74k, False: 15.6k]
  |  Branch (1337:32): [True: 5.67k, False: 1.06k]
  ------------------
 1338|  47.6k|           nxt++;
 1339|  16.7k|    if (nxt - cur == 2)
  ------------------
  |  Branch (1339:9): [True: 11.5k, False: 5.14k]
  ------------------
 1340|  11.5k|        goto region;
 1341|  5.14k|    if ((nxt - cur >= 5) && (nxt - cur <= 8))
  ------------------
  |  Branch (1341:9): [True: 1.51k, False: 3.63k]
  |  Branch (1341:29): [True: 1.20k, False: 303]
  ------------------
 1342|  1.20k|        goto variant;
 1343|  3.93k|    if (nxt - cur != 4)
  ------------------
  |  Branch (1343:9): [True: 962, False: 2.97k]
  ------------------
 1344|    962|        return(0);
 1345|       |    /* we parsed a script */
 1346|  4.42k|script:
 1347|  4.42k|    if (nxt[0] == 0)
  ------------------
  |  Branch (1347:9): [True: 2.27k, False: 2.15k]
  ------------------
 1348|  2.27k|        return(1);
 1349|  2.15k|    if (nxt[0] != '-')
  ------------------
  |  Branch (1349:9): [True: 374, False: 1.77k]
  ------------------
 1350|    374|        return(0);
 1351|       |
 1352|  1.77k|    nxt++;
 1353|  1.77k|    cur = nxt;
 1354|       |    /* now we can have region or variant */
 1355|  1.77k|    if ((nxt[0] >= '0') && (nxt[0] <= '9'))
  ------------------
  |  Branch (1355:9): [True: 1.53k, False: 247]
  |  Branch (1355:28): [True: 215, False: 1.31k]
  ------------------
 1356|    215|        goto region_m49;
 1357|       |
 1358|  21.1k|    while (((nxt[0] >= 'A') && (nxt[0] <= 'Z')) ||
  ------------------
  |  Branch (1358:13): [True: 20.0k, False: 1.15k]
  |  Branch (1358:32): [True: 18.1k, False: 1.89k]
  ------------------
 1359|  3.05k|           ((nxt[0] >= 'a') && (nxt[0] <= 'z')))
  ------------------
  |  Branch (1359:13): [True: 1.82k, False: 1.22k]
  |  Branch (1359:32): [True: 1.48k, False: 339]
  ------------------
 1360|  19.6k|           nxt++;
 1361|       |
 1362|  1.56k|    if ((nxt - cur >= 5) && (nxt - cur <= 8))
  ------------------
  |  Branch (1362:9): [True: 494, False: 1.06k]
  |  Branch (1362:29): [True: 268, False: 226]
  ------------------
 1363|    268|        goto variant;
 1364|  1.29k|    if (nxt - cur != 2)
  ------------------
  |  Branch (1364:9): [True: 774, False: 521]
  ------------------
 1365|    774|        return(0);
 1366|       |    /* we parsed a region */
 1367|  13.8k|region:
 1368|  13.8k|    if (nxt[0] == 0)
  ------------------
  |  Branch (1368:9): [True: 505, False: 13.3k]
  ------------------
 1369|    505|        return(1);
 1370|  13.3k|    if (nxt[0] != '-')
  ------------------
  |  Branch (1370:9): [True: 11.6k, False: 1.70k]
  ------------------
 1371|  11.6k|        return(0);
 1372|       |
 1373|  1.70k|    nxt++;
 1374|  1.70k|    cur = nxt;
 1375|       |    /* now we can just have a variant */
 1376|  9.26k|    while (((nxt[0] >= 'A') && (nxt[0] <= 'Z')) ||
  ------------------
  |  Branch (1376:13): [True: 7.65k, False: 1.61k]
  |  Branch (1376:32): [True: 3.20k, False: 4.45k]
  ------------------
 1377|  6.06k|           ((nxt[0] >= 'a') && (nxt[0] <= 'z')))
  ------------------
  |  Branch (1377:13): [True: 4.44k, False: 1.61k]
  |  Branch (1377:32): [True: 4.36k, False: 88]
  ------------------
 1378|  7.56k|           nxt++;
 1379|       |
 1380|  1.70k|    if ((nxt - cur < 5) || (nxt - cur > 8))
  ------------------
  |  Branch (1380:9): [True: 1.05k, False: 652]
  |  Branch (1380:28): [True: 287, False: 365]
  ------------------
 1381|  1.33k|        return(0);
 1382|       |
 1383|       |    /* we parsed a variant */
 1384|  2.28k|variant:
 1385|  2.28k|    if (nxt[0] == 0)
  ------------------
  |  Branch (1385:9): [True: 470, False: 1.81k]
  ------------------
 1386|    470|        return(1);
 1387|  1.81k|    if (nxt[0] != '-')
  ------------------
  |  Branch (1387:9): [True: 1.09k, False: 722]
  ------------------
 1388|  1.09k|        return(0);
 1389|       |    /* extensions and private use subtags not checked */
 1390|    722|    return (1);
 1391|       |
 1392|  15.0k|region_m49:
 1393|  15.0k|    if (((nxt[1] >= '0') && (nxt[1] <= '9')) &&
  ------------------
  |  Branch (1393:10): [True: 12.4k, False: 2.57k]
  |  Branch (1393:29): [True: 10.1k, False: 2.31k]
  ------------------
 1394|  10.1k|        ((nxt[2] >= '0') && (nxt[2] <= '9'))) {
  ------------------
  |  Branch (1394:10): [True: 7.07k, False: 3.05k]
  |  Branch (1394:29): [True: 248, False: 6.82k]
  ------------------
 1395|    248|        nxt += 3;
 1396|    248|        goto region;
 1397|    248|    }
 1398|  14.7k|    return(0);
 1399|  15.0k|}
xmlParserNsCreate:
 1416|  44.9k|xmlParserNsCreate(void) {
 1417|  44.9k|    xmlParserNsData *nsdb = xmlMalloc(sizeof(*nsdb));
 1418|       |
 1419|  44.9k|    if (nsdb == NULL)
  ------------------
  |  Branch (1419:9): [True: 1, False: 44.9k]
  ------------------
 1420|      1|        return(NULL);
 1421|  44.9k|    memset(nsdb, 0, sizeof(*nsdb));
 1422|  44.9k|    nsdb->defaultNsIndex = INT_MAX;
 1423|       |
 1424|  44.9k|    return(nsdb);
 1425|  44.9k|}
xmlParserNsFree:
 1433|  44.9k|xmlParserNsFree(xmlParserNsData *nsdb) {
 1434|  44.9k|    if (nsdb == NULL)
  ------------------
  |  Branch (1434:9): [True: 0, False: 44.9k]
  ------------------
 1435|      0|        return;
 1436|       |
 1437|  44.9k|    xmlFree(nsdb->extra);
 1438|  44.9k|    xmlFree(nsdb->hash);
 1439|  44.9k|    xmlFree(nsdb);
 1440|  44.9k|}
xmlParserNsLookupSax:
 1566|   118k|xmlParserNsLookupSax(xmlParserCtxt *ctxt, const xmlChar *prefix) {
 1567|   118k|    xmlHashedString hprefix;
 1568|   118k|    int nsIndex;
 1569|       |
 1570|   118k|    if (prefix == ctxt->str_xml)
  ------------------
  |  Branch (1570:9): [True: 76.7k, False: 41.7k]
  ------------------
 1571|  76.7k|        return(NULL);
 1572|       |
 1573|  41.7k|    hprefix.name = prefix;
 1574|  41.7k|    if (prefix != NULL)
  ------------------
  |  Branch (1574:9): [True: 27.4k, False: 14.3k]
  ------------------
 1575|  27.4k|        hprefix.hashValue = xmlDictComputeHash(ctxt->dict, prefix);
 1576|  14.3k|    else
 1577|  14.3k|        hprefix.hashValue = 0;
 1578|  41.7k|    nsIndex = xmlParserNsLookup(ctxt, &hprefix, NULL);
 1579|  41.7k|    if ((nsIndex == INT_MAX) || (nsIndex < ctxt->nsdb->minNsIndex))
  ------------------
  |  Branch (1579:9): [True: 0, False: 41.7k]
  |  Branch (1579:33): [True: 0, False: 41.7k]
  ------------------
 1580|      0|        return(NULL);
 1581|       |
 1582|  41.7k|    return(ctxt->nsdb->extra[nsIndex].saxData);
 1583|  41.7k|}
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.2k]
  ------------------
 1606|   115k|        hprefix.hashValue = xmlDictComputeHash(ctxt->dict, prefix);
 1607|  26.2k|    else
 1608|  26.2k|        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|   298k|{
 1893|   298k|    char *directory = NULL;
 1894|   298k|    int maxDepth;
 1895|       |
 1896|   298k|    if ((ctxt == NULL) || (value == NULL))
  ------------------
  |  Branch (1896:9): [True: 0, False: 298k]
  |  Branch (1896:27): [True: 1.83k, False: 296k]
  ------------------
 1897|  1.83k|        return(-1);
 1898|       |
 1899|   296k|    maxDepth = (ctxt->options & XML_PARSE_HUGE) ? 40 : 20;
  ------------------
  |  Branch (1899:16): [True: 97.7k, False: 198k]
  ------------------
 1900|       |
 1901|   296k|    if (ctxt->inputNr >= ctxt->inputMax) {
  ------------------
  |  Branch (1901:9): [True: 7.38k, False: 288k]
  ------------------
 1902|  7.38k|        xmlParserInputPtr *tmp;
 1903|  7.38k|        int newSize;
 1904|       |
 1905|  7.38k|        newSize = xmlGrowCapacity(ctxt->inputMax, sizeof(tmp[0]),
 1906|  7.38k|                                  5, maxDepth);
 1907|  7.38k|        if (newSize < 0) {
  ------------------
  |  Branch (1907:13): [True: 1, False: 7.38k]
  ------------------
 1908|      1|            xmlFatalErrMsg(ctxt, XML_ERR_RESOURCE_LIMIT,
 1909|      1|                           "Maximum entity nesting depth exceeded");
 1910|      1|            return(-1);
 1911|      1|        }
 1912|  7.38k|        tmp = xmlRealloc(ctxt->inputTab, newSize * sizeof(tmp[0]));
 1913|  7.38k|        if (tmp == NULL) {
  ------------------
  |  Branch (1913:13): [True: 1, False: 7.38k]
  ------------------
 1914|      1|            xmlErrMemory(ctxt);
 1915|      1|            return(-1);
 1916|      1|        }
 1917|  7.38k|        ctxt->inputTab = tmp;
 1918|  7.38k|        ctxt->inputMax = newSize;
 1919|  7.38k|    }
 1920|       |
 1921|   296k|    if ((ctxt->inputNr == 0) && (value->filename != NULL)) {
  ------------------
  |  Branch (1921:9): [True: 183k, False: 113k]
  |  Branch (1921:33): [True: 146k, False: 36.4k]
  ------------------
 1922|   146k|        directory = xmlParserGetDirectory(value->filename);
 1923|   146k|        if (directory == NULL) {
  ------------------
  |  Branch (1923:13): [True: 6, False: 146k]
  ------------------
 1924|      6|            xmlErrMemory(ctxt);
 1925|      6|            return(-1);
 1926|      6|        }
 1927|   146k|    }
 1928|       |
 1929|   296k|    if (ctxt->input_id >= INT_MAX) {
  ------------------
  |  Branch (1929:9): [True: 0, False: 296k]
  ------------------
 1930|      0|        xmlFatalErrMsg(ctxt, XML_ERR_RESOURCE_LIMIT, "Input ID overflow\n");
 1931|      0|        return(-1);
 1932|      0|    }
 1933|       |
 1934|   296k|    ctxt->inputTab[ctxt->inputNr] = value;
 1935|   296k|    ctxt->input = value;
 1936|       |
 1937|   296k|    if (ctxt->inputNr == 0) {
  ------------------
  |  Branch (1937:9): [True: 183k, False: 113k]
  ------------------
 1938|   183k|        xmlFree(ctxt->directory);
 1939|   183k|        ctxt->directory = directory;
 1940|   183k|    }
 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|   296k|    value->id = ctxt->input_id++;
 1948|       |
 1949|   296k|    return(ctxt->inputNr++);
 1950|   296k|}
xmlCtxtPopInput:
 1960|   384k|{
 1961|   384k|    xmlParserInputPtr ret;
 1962|       |
 1963|   384k|    if (ctxt == NULL)
  ------------------
  |  Branch (1963:9): [True: 0, False: 384k]
  ------------------
 1964|      0|        return(NULL);
 1965|   384k|    if (ctxt->inputNr <= 0)
  ------------------
  |  Branch (1965:9): [True: 89.9k, False: 294k]
  ------------------
 1966|  89.9k|        return (NULL);
 1967|   294k|    ctxt->inputNr--;
 1968|   294k|    if (ctxt->inputNr > 0)
  ------------------
  |  Branch (1968:9): [True: 113k, False: 181k]
  ------------------
 1969|   113k|        ctxt->input = ctxt->inputTab[ctxt->inputNr - 1];
 1970|   181k|    else
 1971|   181k|        ctxt->input = NULL;
 1972|   294k|    ret = ctxt->inputTab[ctxt->inputNr];
 1973|       |    ctxt->inputTab[ctxt->inputNr] = NULL;
 1974|   294k|    return (ret);
 1975|   384k|}
nodePush:
 1988|   781k|{
 1989|   781k|    if (ctxt == NULL)
  ------------------
  |  Branch (1989:9): [True: 0, False: 781k]
  ------------------
 1990|      0|        return(0);
 1991|       |
 1992|   781k|    if (ctxt->nodeNr >= ctxt->nodeMax) {
  ------------------
  |  Branch (1992:9): [True: 47.3k, False: 733k]
  ------------------
 1993|  47.3k|        int maxDepth = (ctxt->options & XML_PARSE_HUGE) ? 2048 : 256;
  ------------------
  |  Branch (1993:24): [True: 23.7k, False: 23.5k]
  ------------------
 1994|  47.3k|        xmlNodePtr *tmp;
 1995|  47.3k|        int newSize;
 1996|       |
 1997|  47.3k|        newSize = xmlGrowCapacity(ctxt->nodeMax, sizeof(tmp[0]),
 1998|  47.3k|                                  10, maxDepth);
 1999|  47.3k|        if (newSize < 0) {
  ------------------
  |  Branch (1999:13): [True: 50, False: 47.2k]
  ------------------
 2000|     50|            xmlFatalErrMsgInt(ctxt, XML_ERR_RESOURCE_LIMIT,
 2001|     50|                    "Excessive depth in document: %d,"
 2002|     50|                    " use XML_PARSE_HUGE option\n",
 2003|     50|                    ctxt->nodeNr);
 2004|     50|            return(-1);
 2005|     50|        }
 2006|       |
 2007|  47.2k|	tmp = xmlRealloc(ctxt->nodeTab, newSize * sizeof(tmp[0]));
 2008|  47.2k|        if (tmp == NULL) {
  ------------------
  |  Branch (2008:13): [True: 18, False: 47.2k]
  ------------------
 2009|     18|            xmlErrMemory(ctxt);
 2010|     18|            return (-1);
 2011|     18|        }
 2012|  47.2k|        ctxt->nodeTab = tmp;
 2013|  47.2k|	ctxt->nodeMax = newSize;
 2014|  47.2k|    }
 2015|       |
 2016|   780k|    ctxt->nodeTab[ctxt->nodeNr] = value;
 2017|   780k|    ctxt->node = value;
 2018|   780k|    return (ctxt->nodeNr++);
 2019|   781k|}
nodePop:
 2031|   750k|{
 2032|   750k|    xmlNodePtr ret;
 2033|       |
 2034|   750k|    if (ctxt == NULL) return(NULL);
  ------------------
  |  Branch (2034:9): [True: 0, False: 750k]
  ------------------
 2035|   750k|    if (ctxt->nodeNr <= 0)
  ------------------
  |  Branch (2035:9): [True: 106k, False: 643k]
  ------------------
 2036|   106k|        return (NULL);
 2037|   643k|    ctxt->nodeNr--;
 2038|   643k|    if (ctxt->nodeNr > 0)
  ------------------
  |  Branch (2038:9): [True: 628k, False: 15.5k]
  ------------------
 2039|   628k|        ctxt->node = ctxt->nodeTab[ctxt->nodeNr - 1];
 2040|  15.5k|    else
 2041|  15.5k|        ctxt->node = NULL;
 2042|   643k|    ret = ctxt->nodeTab[ctxt->nodeNr];
 2043|       |    ctxt->nodeTab[ctxt->nodeNr] = NULL;
 2044|   643k|    return (ret);
 2045|   750k|}
xmlSkipBlankChars:
 2318|  4.54M|xmlSkipBlankChars(xmlParserCtxt *ctxt) {
 2319|  4.54M|    const xmlChar *cur;
 2320|  4.54M|    int res = 0;
 2321|       |
 2322|  4.54M|    cur = ctxt->input->cur;
 2323|  4.54M|    while (IS_BLANK_CH(*cur)) {
 2324|  1.93M|        if (*cur == '\n') {
  ------------------
  |  Branch (2324:13): [True: 671k, False: 1.26M]
  ------------------
 2325|   671k|            ctxt->input->line++; ctxt->input->col = 1;
 2326|  1.26M|        } else {
 2327|  1.26M|            ctxt->input->col++;
 2328|  1.26M|        }
 2329|  1.93M|        cur++;
 2330|  1.93M|        if (res < INT_MAX)
  ------------------
  |  Branch (2330:13): [True: 1.93M, False: 0]
  ------------------
 2331|  1.93M|            res++;
 2332|  1.93M|        if (*cur == 0) {
  ------------------
  |  Branch (2332:13): [True: 25.8k, False: 1.91M]
  ------------------
 2333|  25.8k|            ctxt->input->cur = cur;
 2334|  25.8k|            xmlParserGrow(ctxt);
 2335|  25.8k|            cur = ctxt->input->cur;
 2336|  25.8k|        }
 2337|  1.93M|    }
 2338|  4.54M|    ctxt->input->cur = cur;
 2339|       |
 2340|  4.54M|    if (res > 4)
  ------------------
  |  Branch (2340:9): [True: 37.7k, False: 4.51M]
  ------------------
 2341|  37.7k|        GROW;
  ------------------
  |  | 2271|  37.7k|    if ((!PARSER_PROGRESSIVE(ctxt)) && \
  |  |  ------------------
  |  |  |  |   47|  37.7k|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|  37.7k|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2271:9): [True: 35.3k, False: 2.42k]
  |  |  ------------------
  |  | 2272|  37.7k|        (ctxt->input->end - ctxt->input->cur < INPUT_CHUNK)) \
  |  |  ------------------
  |  |  |  |   63|  35.3k|#define INPUT_CHUNK	250
  |  |  ------------------
  |  |  |  Branch (2272:9): [True: 2.51k, False: 32.8k]
  |  |  ------------------
  |  | 2273|  37.7k|	xmlParserGrow(ctxt);
  ------------------
 2342|       |
 2343|  4.54M|    return(res);
 2344|  4.54M|}
xmlParseCharRef:
 2529|  76.5k|xmlParseCharRef(xmlParserCtxt *ctxt) {
 2530|  76.5k|    int val = 0;
 2531|  76.5k|    int count = 0;
 2532|       |
 2533|       |    /*
 2534|       |     * Using RAW/CUR/NEXT is okay since we are working on ASCII range here
 2535|       |     */
 2536|  76.5k|    if ((RAW == '&') && (NXT(1) == '#') &&
  ------------------
  |  | 2224|  76.5k|#define RAW (*ctxt->input->cur)
  ------------------
                  if ((RAW == '&') && (NXT(1) == '#') &&
  ------------------
  |  | 2226|  76.5k|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
  |  Branch (2536:9): [True: 76.5k, False: 0]
  |  Branch (2536:25): [True: 76.5k, False: 0]
  ------------------
 2537|  76.5k|        (NXT(2) == 'x')) {
  ------------------
  |  | 2226|  76.5k|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
  |  Branch (2537:9): [True: 18.5k, False: 57.9k]
  ------------------
 2538|  18.5k|	SKIP(3);
  ------------------
  |  | 2248|  18.5k|#define SKIP(val) do {							\
  |  | 2249|  18.5k|    ctxt->input->cur += (val),ctxt->input->col+=(val);			\
  |  | 2250|  18.5k|    if (*ctxt->input->cur == 0)						\
  |  |  ------------------
  |  |  |  Branch (2250:9): [True: 284, False: 18.2k]
  |  |  ------------------
  |  | 2251|  18.5k|        xmlParserGrow(ctxt);						\
  |  | 2252|  18.5k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2252:12): [Folded, False: 18.5k]
  |  |  ------------------
  ------------------
 2539|  18.5k|	GROW;
  ------------------
  |  | 2271|  18.5k|    if ((!PARSER_PROGRESSIVE(ctxt)) && \
  |  |  ------------------
  |  |  |  |   47|  18.5k|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|  18.5k|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2271:9): [True: 10.2k, False: 8.30k]
  |  |  ------------------
  |  | 2272|  18.5k|        (ctxt->input->end - ctxt->input->cur < INPUT_CHUNK)) \
  |  |  ------------------
  |  |  |  |   63|  10.2k|#define INPUT_CHUNK	250
  |  |  ------------------
  |  |  |  Branch (2272:9): [True: 1.57k, False: 8.70k]
  |  |  ------------------
  |  | 2273|  18.5k|	xmlParserGrow(ctxt);
  ------------------
 2540|  89.2k|	while ((RAW != ';') && (PARSER_STOPPED(ctxt) == 0)) {
  ------------------
  |  | 2224|  89.2k|#define RAW (*ctxt->input->cur)
  ------------------
              	while ((RAW != ';') && (PARSER_STOPPED(ctxt) == 0)) {
  ------------------
  |  |   44|  74.2k|#define PARSER_STOPPED(ctxt) ((ctxt)->disableSAX > 1)
  ------------------
  |  Branch (2540:9): [True: 74.2k, False: 15.0k]
  |  Branch (2540:25): [True: 74.2k, False: 0]
  ------------------
 2541|  74.2k|	    if (count++ > 20) {
  ------------------
  |  Branch (2541:10): [True: 2.98k, False: 71.2k]
  ------------------
 2542|  2.98k|		count = 0;
 2543|  2.98k|		GROW;
  ------------------
  |  | 2271|  2.98k|    if ((!PARSER_PROGRESSIVE(ctxt)) && \
  |  |  ------------------
  |  |  |  |   47|  2.98k|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|  2.98k|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2271:9): [True: 2.72k, False: 255]
  |  |  ------------------
  |  | 2272|  2.98k|        (ctxt->input->end - ctxt->input->cur < INPUT_CHUNK)) \
  |  |  ------------------
  |  |  |  |   63|  2.72k|#define INPUT_CHUNK	250
  |  |  ------------------
  |  |  |  Branch (2272:9): [True: 1.85k, False: 873]
  |  |  ------------------
  |  | 2273|  2.98k|	xmlParserGrow(ctxt);
  ------------------
 2544|  2.98k|	    }
 2545|  74.2k|	    if ((RAW >= '0') && (RAW <= '9'))
  ------------------
  |  | 2224|  74.2k|#define RAW (*ctxt->input->cur)
  ------------------
              	    if ((RAW >= '0') && (RAW <= '9'))
  ------------------
  |  | 2224|  73.3k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (2545:10): [True: 73.3k, False: 870]
  |  Branch (2545:26): [True: 55.9k, False: 17.3k]
  ------------------
 2546|  55.9k|	        val = val * 16 + (CUR - '0');
  ------------------
  |  | 2225|  55.9k|#define CUR (*ctxt->input->cur)
  ------------------
 2547|  18.2k|	    else if ((RAW >= 'a') && (RAW <= 'f') && (count < 20))
  ------------------
  |  | 2224|  18.2k|#define RAW (*ctxt->input->cur)
  ------------------
              	    else if ((RAW >= 'a') && (RAW <= 'f') && (count < 20))
  ------------------
  |  | 2224|  10.7k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (2547:15): [True: 10.7k, False: 7.53k]
  |  Branch (2547:31): [True: 9.22k, False: 1.49k]
  |  Branch (2547:47): [True: 9.01k, False: 211]
  ------------------
 2548|  9.01k|	        val = val * 16 + (CUR - 'a') + 10;
  ------------------
  |  | 2225|  9.01k|#define CUR (*ctxt->input->cur)
  ------------------
 2549|  9.24k|	    else if ((RAW >= 'A') && (RAW <= 'F') && (count < 20))
  ------------------
  |  | 2224|  9.24k|#define RAW (*ctxt->input->cur)
  ------------------
              	    else if ((RAW >= 'A') && (RAW <= 'F') && (count < 20))
  ------------------
  |  | 2224|  7.95k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (2549:15): [True: 7.95k, False: 1.28k]
  |  Branch (2549:31): [True: 6.00k, False: 1.94k]
  |  Branch (2549:47): [True: 5.69k, False: 310]
  ------------------
 2550|  5.69k|	        val = val * 16 + (CUR - 'A') + 10;
  ------------------
  |  | 2225|  5.69k|#define CUR (*ctxt->input->cur)
  ------------------
 2551|  3.54k|	    else {
 2552|  3.54k|		xmlFatalErr(ctxt, XML_ERR_INVALID_HEX_CHARREF, NULL);
 2553|  3.54k|		val = 0;
 2554|  3.54k|		break;
 2555|  3.54k|	    }
 2556|  70.6k|	    if (val > 0x110000)
  ------------------
  |  Branch (2556:10): [True: 17.9k, False: 52.7k]
  ------------------
 2557|  17.9k|	        val = 0x110000;
 2558|       |
 2559|  70.6k|	    NEXT;
  ------------------
  |  | 2279|  70.6k|#define NEXT xmlNextChar(ctxt)
  ------------------
 2560|  70.6k|	    count++;
 2561|  70.6k|	}
 2562|  18.5k|	if (RAW == ';') {
  ------------------
  |  | 2224|  18.5k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (2562:6): [True: 15.0k, False: 3.54k]
  ------------------
 2563|       |	    /* on purpose to avoid reentrancy problems with NEXT and SKIP */
 2564|  15.0k|	    ctxt->input->col++;
 2565|  15.0k|	    ctxt->input->cur++;
 2566|  15.0k|	}
 2567|  57.9k|    } else if  ((RAW == '&') && (NXT(1) == '#')) {
  ------------------
  |  | 2224|  57.9k|#define RAW (*ctxt->input->cur)
  ------------------
                  } else if  ((RAW == '&') && (NXT(1) == '#')) {
  ------------------
  |  | 2226|  57.9k|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
  |  Branch (2567:17): [True: 57.9k, False: 0]
  |  Branch (2567:33): [True: 57.9k, False: 0]
  ------------------
 2568|  57.9k|	SKIP(2);
  ------------------
  |  | 2248|  57.9k|#define SKIP(val) do {							\
  |  | 2249|  57.9k|    ctxt->input->cur += (val),ctxt->input->col+=(val);			\
  |  | 2250|  57.9k|    if (*ctxt->input->cur == 0)						\
  |  |  ------------------
  |  |  |  Branch (2250:9): [True: 448, False: 57.5k]
  |  |  ------------------
  |  | 2251|  57.9k|        xmlParserGrow(ctxt);						\
  |  | 2252|  57.9k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2252:12): [Folded, False: 57.9k]
  |  |  ------------------
  ------------------
 2569|  57.9k|	GROW;
  ------------------
  |  | 2271|  57.9k|    if ((!PARSER_PROGRESSIVE(ctxt)) && \
  |  |  ------------------
  |  |  |  |   47|  57.9k|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|  57.9k|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2271:9): [True: 39.8k, False: 18.1k]
  |  |  ------------------
  |  | 2272|  57.9k|        (ctxt->input->end - ctxt->input->cur < INPUT_CHUNK)) \
  |  |  ------------------
  |  |  |  |   63|  39.8k|#define INPUT_CHUNK	250
  |  |  ------------------
  |  |  |  Branch (2272:9): [True: 8.43k, False: 31.3k]
  |  |  ------------------
  |  | 2273|  57.9k|	xmlParserGrow(ctxt);
  ------------------
 2570|   183k|	while (RAW != ';') { /* loop blocked by count */
  ------------------
  |  | 2224|   183k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (2570:9): [True: 130k, False: 53.6k]
  ------------------
 2571|   130k|	    if (count++ > 20) {
  ------------------
  |  Branch (2571:10): [True: 1.23k, False: 128k]
  ------------------
 2572|  1.23k|		count = 0;
 2573|  1.23k|		GROW;
  ------------------
  |  | 2271|  1.23k|    if ((!PARSER_PROGRESSIVE(ctxt)) && \
  |  |  ------------------
  |  |  |  |   47|  1.23k|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|  1.23k|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2271:9): [True: 961, False: 273]
  |  |  ------------------
  |  | 2272|  1.23k|        (ctxt->input->end - ctxt->input->cur < INPUT_CHUNK)) \
  |  |  ------------------
  |  |  |  |   63|    961|#define INPUT_CHUNK	250
  |  |  ------------------
  |  |  |  Branch (2272:9): [True: 395, False: 566]
  |  |  ------------------
  |  | 2273|  1.23k|	xmlParserGrow(ctxt);
  ------------------
 2574|  1.23k|	    }
 2575|   130k|	    if ((RAW >= '0') && (RAW <= '9'))
  ------------------
  |  | 2224|   130k|#define RAW (*ctxt->input->cur)
  ------------------
              	    if ((RAW >= '0') && (RAW <= '9'))
  ------------------
  |  | 2224|   128k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (2575:10): [True: 128k, False: 1.50k]
  |  Branch (2575:26): [True: 125k, False: 2.81k]
  ------------------
 2576|   125k|	        val = val * 10 + (CUR - '0');
  ------------------
  |  | 2225|   125k|#define CUR (*ctxt->input->cur)
  ------------------
 2577|  4.32k|	    else {
 2578|  4.32k|		xmlFatalErr(ctxt, XML_ERR_INVALID_DEC_CHARREF, NULL);
 2579|  4.32k|		val = 0;
 2580|  4.32k|		break;
 2581|  4.32k|	    }
 2582|   125k|	    if (val > 0x110000)
  ------------------
  |  Branch (2582:10): [True: 11.5k, False: 114k]
  ------------------
 2583|  11.5k|	        val = 0x110000;
 2584|       |
 2585|   125k|	    NEXT;
  ------------------
  |  | 2279|   125k|#define NEXT xmlNextChar(ctxt)
  ------------------
 2586|   125k|	    count++;
 2587|   125k|	}
 2588|  57.9k|	if (RAW == ';') {
  ------------------
  |  | 2224|  57.9k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (2588:6): [True: 53.6k, False: 4.32k]
  ------------------
 2589|       |	    /* on purpose to avoid reentrancy problems with NEXT and SKIP */
 2590|  53.6k|	    ctxt->input->col++;
 2591|  53.6k|	    ctxt->input->cur++;
 2592|  53.6k|	}
 2593|  57.9k|    } 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|  76.5k|    if (val >= 0x110000) {
  ------------------
  |  Branch (2604:9): [True: 634, False: 75.9k]
  ------------------
 2605|    634|        xmlFatalErrMsgInt(ctxt, XML_ERR_INVALID_CHAR,
 2606|    634|                "xmlParseCharRef: character reference out of bounds\n",
 2607|    634|	        val);
 2608|    634|        val = 0xFFFD;
 2609|  75.9k|    } else if (!IS_CHAR(val)) {
  ------------------
  |  |  115|  75.9k|#define IS_CHAR(c)   xmlIsCharQ(c)
  |  |  ------------------
  |  |  |  |  117|  75.9k|#define xmlIsCharQ(c)		(((c) < 0x100) ? \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (117:25): [True: 74.5k, False: 1.42k]
  |  |  |  |  ------------------
  |  |  |  |  118|  75.9k|				 xmlIsChar_ch((c)) :\
  |  |  |  |  ------------------
  |  |  |  |  |  |  108|  74.5k|#define xmlIsChar_ch(c)		(((0x9 <= (c)) && ((c) <= 0xa)) || \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (108:28): [True: 65.4k, False: 9.10k]
  |  |  |  |  |  |  |  Branch (108:44): [True: 18.0k, False: 47.3k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  109|  74.5k|				 ((c) == 0xd) || \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (109:6): [True: 15.6k, False: 40.7k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  110|  74.5k|				  (0x20 <= (c)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (110:7): [True: 30.6k, False: 10.1k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  119|  75.9k|				(((0x100 <= (c)) && ((c) <= 0xd7ff)) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (119:7): [True: 1.42k, False: 0]
  |  |  |  |  |  Branch (119:25): [True: 425, False: 995]
  |  |  |  |  ------------------
  |  |  |  |  120|  1.42k|				 ((0xe000 <= (c)) && ((c) <= 0xfffd)) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (120:7): [True: 791, False: 204]
  |  |  |  |  |  Branch (120:26): [True: 117, False: 674]
  |  |  |  |  ------------------
  |  |  |  |  121|  1.42k|				 ((0x10000 <= (c)) && ((c) <= 0x10ffff))))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (121:7): [True: 587, False: 291]
  |  |  |  |  |  Branch (121:27): [True: 587, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (2609:16): [True: 10.4k, False: 65.5k]
  ------------------
 2610|  10.4k|        xmlFatalErrMsgInt(ctxt, XML_ERR_INVALID_CHAR,
 2611|  10.4k|                          "xmlParseCharRef: invalid xmlChar value %d\n",
 2612|  10.4k|	                  val);
 2613|  10.4k|    }
 2614|  76.5k|    return(val);
 2615|  76.5k|}
xmlScanName:
 3051|  3.17M|xmlScanName(const xmlChar *ptr, size_t maxSize, int flags) {
 3052|  3.17M|    int stop = flags & XML_SCAN_NC ? ':' : 0;
  ------------------
  |  |   69|  3.17M|#define XML_SCAN_NC         1
  ------------------
  |  Branch (3052:16): [True: 105k, False: 3.06M]
  ------------------
 3053|  3.17M|    int old10 = flags & XML_SCAN_OLD10 ? 1 : 0;
  ------------------
  |  |   71|  3.17M|#define XML_SCAN_OLD10      4
  ------------------
  |  Branch (3053:17): [True: 1.07M, False: 2.09M]
  ------------------
 3054|       |
 3055|  12.1M|    while (1) {
  ------------------
  |  Branch (3055:12): [True: 12.1M, Folded]
  ------------------
 3056|  12.1M|        int c, len;
 3057|       |
 3058|  12.1M|        c = *ptr;
 3059|  12.1M|        if (c < 0x80) {
  ------------------
  |  Branch (3059:13): [True: 10.0M, False: 2.17M]
  ------------------
 3060|  10.0M|            if (c == stop)
  ------------------
  |  Branch (3060:17): [True: 66.1k, False: 9.94M]
  ------------------
 3061|  66.1k|                break;
 3062|  9.94M|            len = 1;
 3063|  9.94M|        } else {
 3064|  2.17M|            len = 4;
 3065|  2.17M|            c = xmlGetUTF8Char(ptr, &len);
 3066|  2.17M|            if (c < 0)
  ------------------
  |  Branch (3066:17): [True: 5.24k, False: 2.17M]
  ------------------
 3067|  5.24k|                break;
 3068|  2.17M|        }
 3069|       |
 3070|  12.1M|        if (flags & XML_SCAN_NMTOKEN ?
  ------------------
  |  |   70|  12.1M|#define XML_SCAN_NMTOKEN    2
  ------------------
  |  Branch (3070:13): [True: 8.99M, False: 3.11M]
  |  Branch (3070:13): [True: 3.10M, False: 9.01M]
  ------------------
 3071|  8.99M|                !xmlIsNameChar(c, old10) :
 3072|  12.1M|                !xmlIsNameStartChar(c, old10))
 3073|  3.10M|            break;
 3074|       |
 3075|  9.01M|        if ((size_t) len > maxSize)
  ------------------
  |  Branch (3075:13): [True: 59, False: 9.01M]
  ------------------
 3076|     59|            return(NULL);
 3077|  9.01M|        ptr += len;
 3078|  9.01M|        maxSize -= len;
 3079|  9.01M|        flags |= XML_SCAN_NMTOKEN;
  ------------------
  |  |   70|  9.01M|#define XML_SCAN_NMTOKEN    2
  ------------------
 3080|  9.01M|    }
 3081|       |
 3082|  3.17M|    return(ptr);
 3083|  3.17M|}
xmlParseName:
 3150|  2.54M|xmlParseName(xmlParserCtxt *ctxt) {
 3151|  2.54M|    const xmlChar *in;
 3152|  2.54M|    const xmlChar *ret;
 3153|  2.54M|    size_t count = 0;
 3154|  2.54M|    size_t maxLength = (ctxt->options & XML_PARSE_HUGE) ?
  ------------------
  |  Branch (3154:24): [True: 1.03M, False: 1.51M]
  ------------------
 3155|  1.03M|                       XML_MAX_TEXT_LENGTH :
  ------------------
  |  |   50|  1.03M|#define XML_MAX_TEXT_LENGTH 10000000
  ------------------
 3156|  2.54M|                       XML_MAX_NAME_LENGTH;
  ------------------
  |  |   65|  4.05M|#define XML_MAX_NAME_LENGTH 50000
  ------------------
 3157|       |
 3158|  2.54M|    GROW;
  ------------------
  |  | 2271|  2.54M|    if ((!PARSER_PROGRESSIVE(ctxt)) && \
  |  |  ------------------
  |  |  |  |   47|  2.54M|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|  2.54M|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2271:9): [True: 1.43M, False: 1.11M]
  |  |  ------------------
  |  | 2272|  2.54M|        (ctxt->input->end - ctxt->input->cur < INPUT_CHUNK)) \
  |  |  ------------------
  |  |  |  |   63|  1.43M|#define INPUT_CHUNK	250
  |  |  ------------------
  |  |  |  Branch (2272:9): [True: 562k, False: 870k]
  |  |  ------------------
  |  | 2273|  2.54M|	xmlParserGrow(ctxt);
  ------------------
 3159|       |
 3160|       |    /*
 3161|       |     * Accelerator for simple ASCII names
 3162|       |     */
 3163|  2.54M|    in = ctxt->input->cur;
 3164|  2.54M|    if (((*in >= 0x61) && (*in <= 0x7A)) ||
  ------------------
  |  Branch (3164:10): [True: 2.29M, False: 253k]
  |  Branch (3164:27): [True: 2.25M, False: 36.8k]
  ------------------
 3165|   290k|	((*in >= 0x41) && (*in <= 0x5A)) ||
  ------------------
  |  Branch (3165:3): [True: 128k, False: 162k]
  |  Branch (3165:20): [True: 86.9k, False: 41.2k]
  ------------------
 3166|  2.35M|	(*in == '_') || (*in == ':')) {
  ------------------
  |  Branch (3166:2): [True: 1.62k, False: 201k]
  |  Branch (3166:18): [True: 7.37k, False: 194k]
  ------------------
 3167|  2.35M|	in++;
 3168|  14.6M|	while (((*in >= 0x61) && (*in <= 0x7A)) ||
  ------------------
  |  Branch (3168:10): [True: 4.07M, False: 10.5M]
  |  Branch (3168:27): [True: 4.02M, False: 49.0k]
  ------------------
 3169|  10.6M|	       ((*in >= 0x41) && (*in <= 0x5A)) ||
  ------------------
  |  Branch (3169:10): [True: 5.60M, False: 5.01M]
  |  Branch (3169:27): [True: 5.53M, False: 65.9k]
  ------------------
 3170|  5.08M|	       ((*in >= 0x30) && (*in <= 0x39)) ||
  ------------------
  |  Branch (3170:10): [True: 4.20M, False: 879k]
  |  Branch (3170:27): [True: 2.42M, False: 1.77M]
  ------------------
 3171|  2.65M|	       (*in == '_') || (*in == '-') ||
  ------------------
  |  Branch (3171:9): [True: 7.23k, False: 2.65M]
  |  Branch (3171:25): [True: 89.7k, False: 2.56M]
  ------------------
 3172|  2.56M|	       (*in == ':') || (*in == '.'))
  ------------------
  |  Branch (3172:9): [True: 190k, False: 2.37M]
  |  Branch (3172:25): [True: 16.2k, False: 2.35M]
  ------------------
 3173|  12.2M|	    in++;
 3174|  2.35M|	if ((*in > 0) && (*in < 0x80)) {
  ------------------
  |  Branch (3174:6): [True: 2.32M, False: 30.3k]
  |  Branch (3174:19): [True: 2.30M, False: 17.4k]
  ------------------
 3175|  2.30M|	    count = in - ctxt->input->cur;
 3176|  2.30M|            if (count > maxLength) {
  ------------------
  |  Branch (3176:17): [True: 86, False: 2.30M]
  ------------------
 3177|     86|                xmlFatalErr(ctxt, XML_ERR_NAME_TOO_LONG, "Name");
 3178|     86|                return(NULL);
 3179|     86|            }
 3180|  2.30M|	    ret = xmlDictLookup(ctxt->dict, ctxt->input->cur, count);
 3181|  2.30M|	    ctxt->input->cur = in;
 3182|  2.30M|	    ctxt->input->col += count;
 3183|  2.30M|	    if (ret == NULL)
  ------------------
  |  Branch (3183:10): [True: 3, False: 2.30M]
  ------------------
 3184|      3|	        xmlErrMemory(ctxt);
 3185|  2.30M|	    return(ret);
 3186|  2.30M|	}
 3187|  2.35M|    }
 3188|       |    /* accelerator for special cases */
 3189|   242k|    return(xmlParseNameComplex(ctxt));
 3190|  2.54M|}
xmlParseNmtoken:
 3380|  34.5k|xmlParseNmtoken(xmlParserCtxt *ctxt) {
 3381|  34.5k|    xmlChar buf[XML_MAX_NAMELEN + 5];
 3382|  34.5k|    xmlChar *ret;
 3383|  34.5k|    int len = 0, l;
 3384|  34.5k|    int c;
 3385|  34.5k|    int maxLength = (ctxt->options & XML_PARSE_HUGE) ?
  ------------------
  |  Branch (3385:21): [True: 14.8k, False: 19.6k]
  ------------------
 3386|  14.8k|                    XML_MAX_TEXT_LENGTH :
  ------------------
  |  |   50|  14.8k|#define XML_MAX_TEXT_LENGTH 10000000
  ------------------
 3387|  34.5k|                    XML_MAX_NAME_LENGTH;
  ------------------
  |  |   65|  19.6k|#define XML_MAX_NAME_LENGTH 50000
  ------------------
 3388|  34.5k|    int old10 = (ctxt->options & XML_PARSE_OLD10) ? 1 : 0;
  ------------------
  |  Branch (3388:17): [True: 12.2k, False: 22.2k]
  ------------------
 3389|       |
 3390|  34.5k|    c = xmlCurrentChar(ctxt, &l);
 3391|       |
 3392|   165k|    while (xmlIsNameChar(c, old10)) {
  ------------------
  |  Branch (3392:12): [True: 131k, False: 33.7k]
  ------------------
 3393|   131k|	COPY_BUF(buf, len, c);
  ------------------
  |  | 2296|   131k|    if (v < 0x80) b[i++] = v;						\
  |  |  ------------------
  |  |  |  Branch (2296:9): [True: 105k, False: 26.0k]
  |  |  ------------------
  |  | 2297|   131k|    else i += xmlCopyCharMultiByte(&b[i],v)
  ------------------
 3394|   131k|	NEXTL(l);
  ------------------
  |  | 2288|   131k|#define NEXTL(l) do {							\
  |  | 2289|   131k|    if (*(ctxt->input->cur) == '\n') {					\
  |  |  ------------------
  |  |  |  Branch (2289:9): [True: 0, False: 131k]
  |  |  ------------------
  |  | 2290|      0|	ctxt->input->line++; ctxt->input->col = 1;			\
  |  | 2291|   131k|    } else ctxt->input->col++;						\
  |  | 2292|   131k|    ctxt->input->cur += l;				\
  |  | 2293|   131k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2293:12): [Folded, False: 131k]
  |  |  ------------------
  ------------------
 3395|   131k|	c = xmlCurrentChar(ctxt, &l);
 3396|   131k|	if (len >= XML_MAX_NAMELEN) {
  ------------------
  |  |   87|   131k|#define XML_MAX_NAMELEN 100
  ------------------
  |  Branch (3396:6): [True: 821, False: 130k]
  ------------------
 3397|       |	    /*
 3398|       |	     * Okay someone managed to make a huge token, so he's ready to pay
 3399|       |	     * for the processing speed.
 3400|       |	     */
 3401|    821|	    xmlChar *buffer;
 3402|    821|	    int max = len * 2;
 3403|       |
 3404|    821|	    buffer = xmlMalloc(max);
 3405|    821|	    if (buffer == NULL) {
  ------------------
  |  Branch (3405:10): [True: 1, False: 820]
  ------------------
 3406|      1|	        xmlErrMemory(ctxt);
 3407|      1|		return(NULL);
 3408|      1|	    }
 3409|    820|	    memcpy(buffer, buf, len);
 3410|  2.57M|	    while (xmlIsNameChar(c, old10)) {
  ------------------
  |  Branch (3410:13): [True: 2.57M, False: 764]
  ------------------
 3411|  2.57M|		if (len + 10 > max) {
  ------------------
  |  Branch (3411:7): [True: 2.29k, False: 2.57M]
  ------------------
 3412|  2.29k|		    xmlChar *tmp;
 3413|  2.29k|                    int newSize;
 3414|       |
 3415|  2.29k|                    newSize = xmlGrowCapacity(max, 1, 1, maxLength);
 3416|  2.29k|                    if (newSize < 0) {
  ------------------
  |  Branch (3416:25): [True: 55, False: 2.24k]
  ------------------
 3417|     55|                        xmlFatalErr(ctxt, XML_ERR_NAME_TOO_LONG, "NmToken");
 3418|     55|                        xmlFree(buffer);
 3419|     55|                        return(NULL);
 3420|     55|                    }
 3421|  2.24k|		    tmp = xmlRealloc(buffer, newSize);
 3422|  2.24k|		    if (tmp == NULL) {
  ------------------
  |  Branch (3422:11): [True: 1, False: 2.24k]
  ------------------
 3423|      1|			xmlErrMemory(ctxt);
 3424|      1|			xmlFree(buffer);
 3425|      1|			return(NULL);
 3426|      1|		    }
 3427|  2.24k|		    buffer = tmp;
 3428|  2.24k|                    max = newSize;
 3429|  2.24k|		}
 3430|  2.57M|		COPY_BUF(buffer, len, c);
  ------------------
  |  | 2296|  2.57M|    if (v < 0x80) b[i++] = v;						\
  |  |  ------------------
  |  |  |  Branch (2296:9): [True: 628k, False: 1.94M]
  |  |  ------------------
  |  | 2297|  2.57M|    else i += xmlCopyCharMultiByte(&b[i],v)
  ------------------
 3431|  2.57M|		NEXTL(l);
  ------------------
  |  | 2288|  2.57M|#define NEXTL(l) do {							\
  |  | 2289|  2.57M|    if (*(ctxt->input->cur) == '\n') {					\
  |  |  ------------------
  |  |  |  Branch (2289:9): [True: 0, False: 2.57M]
  |  |  ------------------
  |  | 2290|      0|	ctxt->input->line++; ctxt->input->col = 1;			\
  |  | 2291|  2.57M|    } else ctxt->input->col++;						\
  |  | 2292|  2.57M|    ctxt->input->cur += l;				\
  |  | 2293|  2.57M|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2293:12): [Folded, False: 2.57M]
  |  |  ------------------
  ------------------
 3432|  2.57M|		c = xmlCurrentChar(ctxt, &l);
 3433|  2.57M|	    }
 3434|    764|	    buffer[len] = 0;
 3435|    764|	    return(buffer);
 3436|    820|	}
 3437|   131k|    }
 3438|  33.7k|    if (len == 0)
  ------------------
  |  Branch (3438:9): [True: 4.40k, False: 29.3k]
  ------------------
 3439|  4.40k|        return(NULL);
 3440|  29.3k|    if (len > maxLength) {
  ------------------
  |  Branch (3440:9): [True: 0, False: 29.3k]
  ------------------
 3441|      0|        xmlFatalErr(ctxt, XML_ERR_NAME_TOO_LONG, "NmToken");
 3442|      0|        return(NULL);
 3443|      0|    }
 3444|  29.3k|    ret = xmlStrndup(buf, len);
 3445|  29.3k|    if (ret == NULL)
  ------------------
  |  Branch (3445:9): [True: 4, False: 29.3k]
  ------------------
 3446|      4|        xmlErrMemory(ctxt);
 3447|  29.3k|    return(ret);
 3448|  29.3k|}
xmlParseEntityValue:
 3610|   111k|xmlParseEntityValue(xmlParserCtxt *ctxt, xmlChar **orig) {
 3611|   111k|    unsigned maxLength = (ctxt->options & XML_PARSE_HUGE) ?
  ------------------
  |  Branch (3611:26): [True: 34.4k, False: 77.5k]
  ------------------
 3612|  34.4k|                         XML_MAX_HUGE_LENGTH :
  ------------------
  |  |   55|  34.4k|#define XML_MAX_HUGE_LENGTH 1000000000
  ------------------
 3613|   111k|                         XML_MAX_TEXT_LENGTH;
  ------------------
  |  |   50|   189k|#define XML_MAX_TEXT_LENGTH 10000000
  ------------------
 3614|   111k|    xmlSBuf buf;
 3615|   111k|    const xmlChar *start;
 3616|   111k|    int quote, length;
 3617|       |
 3618|   111k|    xmlSBufInit(&buf, maxLength);
 3619|       |
 3620|   111k|    GROW;
  ------------------
  |  | 2271|   111k|    if ((!PARSER_PROGRESSIVE(ctxt)) && \
  |  |  ------------------
  |  |  |  |   47|   111k|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|   111k|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2271:9): [True: 102k, False: 9.98k]
  |  |  ------------------
  |  | 2272|   111k|        (ctxt->input->end - ctxt->input->cur < INPUT_CHUNK)) \
  |  |  ------------------
  |  |  |  |   63|   102k|#define INPUT_CHUNK	250
  |  |  ------------------
  |  |  |  Branch (2272:9): [True: 24.6k, False: 77.3k]
  |  |  ------------------
  |  | 2273|   111k|	xmlParserGrow(ctxt);
  ------------------
 3621|       |
 3622|   111k|    quote = CUR;
  ------------------
  |  | 2225|   111k|#define CUR (*ctxt->input->cur)
  ------------------
 3623|   111k|    if ((quote != '"') && (quote != '\'')) {
  ------------------
  |  Branch (3623:9): [True: 7.84k, False: 104k]
  |  Branch (3623:27): [True: 0, False: 7.84k]
  ------------------
 3624|      0|	xmlFatalErr(ctxt, XML_ERR_ATTRIBUTE_NOT_STARTED, NULL);
 3625|      0|	return(NULL);
 3626|      0|    }
 3627|   111k|    CUR_PTR++;
  ------------------
  |  | 2227|   111k|#define CUR_PTR ctxt->input->cur
  ------------------
 3628|       |
 3629|   111k|    length = 0;
 3630|       |
 3631|       |    /*
 3632|       |     * Copy raw content of the entity into a buffer
 3633|       |     */
 3634|  46.1M|    while (1) {
  ------------------
  |  Branch (3634:12): [True: 46.1M, Folded]
  ------------------
 3635|  46.1M|        int c;
 3636|       |
 3637|  46.1M|        if (PARSER_STOPPED(ctxt))
  ------------------
  |  |   44|  46.1M|#define PARSER_STOPPED(ctxt) ((ctxt)->disableSAX > 1)
  |  |  ------------------
  |  |  |  Branch (44:30): [True: 3, False: 46.1M]
  |  |  ------------------
  ------------------
 3638|      3|            goto error;
 3639|       |
 3640|  46.1M|        if (CUR_PTR >= ctxt->input->end) {
  ------------------
  |  | 2227|  46.1M|#define CUR_PTR ctxt->input->cur
  ------------------
  |  Branch (3640:13): [True: 2.87k, False: 46.1M]
  ------------------
 3641|  2.87k|            xmlFatalErrMsg(ctxt, XML_ERR_ENTITY_NOT_FINISHED, NULL);
 3642|  2.87k|            goto error;
 3643|  2.87k|        }
 3644|       |
 3645|  46.1M|        c = CUR;
  ------------------
  |  | 2225|  46.1M|#define CUR (*ctxt->input->cur)
  ------------------
 3646|       |
 3647|  46.1M|        if (c == 0) {
  ------------------
  |  Branch (3647:13): [True: 293, False: 46.1M]
  ------------------
 3648|    293|            xmlFatalErrMsg(ctxt, XML_ERR_INVALID_CHAR,
 3649|    293|                    "invalid character in entity value\n");
 3650|    293|            goto error;
 3651|    293|        }
 3652|  46.1M|        if (c == quote)
  ------------------
  |  Branch (3652:13): [True: 108k, False: 46.0M]
  ------------------
 3653|   108k|            break;
 3654|  46.0M|        NEXTL(1);
  ------------------
  |  | 2288|  46.0M|#define NEXTL(l) do {							\
  |  | 2289|  46.0M|    if (*(ctxt->input->cur) == '\n') {					\
  |  |  ------------------
  |  |  |  Branch (2289:9): [True: 2.42M, False: 43.5M]
  |  |  ------------------
  |  | 2290|  2.42M|	ctxt->input->line++; ctxt->input->col = 1;			\
  |  | 2291|  43.5M|    } else ctxt->input->col++;						\
  |  | 2292|  46.0M|    ctxt->input->cur += l;				\
  |  | 2293|  46.0M|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2293:12): [Folded, False: 46.0M]
  |  |  ------------------
  ------------------
 3655|  46.0M|        length += 1;
 3656|       |
 3657|       |        /*
 3658|       |         * TODO: Check growth threshold
 3659|       |         */
 3660|  46.0M|        if (ctxt->input->end - CUR_PTR < 10)
  ------------------
  |  | 2227|  46.0M|#define CUR_PTR ctxt->input->cur
  ------------------
  |  Branch (3660:13): [True: 65.4k, False: 45.9M]
  ------------------
 3661|  65.4k|            GROW;
  ------------------
  |  | 2271|  65.4k|    if ((!PARSER_PROGRESSIVE(ctxt)) && \
  |  |  ------------------
  |  |  |  |   47|  65.4k|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|  65.4k|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2271:9): [True: 62.7k, False: 2.73k]
  |  |  ------------------
  |  | 2272|  65.4k|        (ctxt->input->end - ctxt->input->cur < INPUT_CHUNK)) \
  |  |  ------------------
  |  |  |  |   63|  62.7k|#define INPUT_CHUNK	250
  |  |  ------------------
  |  |  |  Branch (2272:9): [True: 62.7k, False: 0]
  |  |  ------------------
  |  | 2273|  65.4k|	xmlParserGrow(ctxt);
  ------------------
 3662|  46.0M|    }
 3663|       |
 3664|   108k|    start = CUR_PTR - length;
  ------------------
  |  | 2227|   108k|#define CUR_PTR ctxt->input->cur
  ------------------
 3665|       |
 3666|   108k|    if (orig != NULL) {
  ------------------
  |  Branch (3666:9): [True: 108k, False: 0]
  ------------------
 3667|   108k|        *orig = xmlStrndup(start, length);
 3668|   108k|        if (*orig == NULL)
  ------------------
  |  Branch (3668:13): [True: 3, False: 108k]
  ------------------
 3669|      3|            xmlErrMemory(ctxt);
 3670|   108k|    }
 3671|       |
 3672|   108k|    xmlExpandPEsInEntityValue(ctxt, &buf, start, length, ctxt->inputNr);
 3673|       |
 3674|   108k|    NEXTL(1);
  ------------------
  |  | 2288|   108k|#define NEXTL(l) do {							\
  |  | 2289|   108k|    if (*(ctxt->input->cur) == '\n') {					\
  |  |  ------------------
  |  |  |  Branch (2289:9): [True: 0, False: 108k]
  |  |  ------------------
  |  | 2290|      0|	ctxt->input->line++; ctxt->input->col = 1;			\
  |  | 2291|   108k|    } else ctxt->input->col++;						\
  |  | 2292|   108k|    ctxt->input->cur += l;				\
  |  | 2293|   108k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2293:12): [Folded, False: 108k]
  |  |  ------------------
  ------------------
 3675|       |
 3676|   108k|    return(xmlSBufFinish(&buf, NULL, ctxt, "entity length too long"));
 3677|       |
 3678|  3.17k|error:
 3679|  3.17k|    xmlSBufCleanup(&buf, ctxt, "entity length too long");
 3680|       |    return(NULL);
 3681|   111k|}
xmlExpandEntitiesInAttValue:
 3963|  24.5k|                            int normalize) {
 3964|  24.5k|    unsigned maxLength = (ctxt->options & XML_PARSE_HUGE) ?
  ------------------
  |  Branch (3964:26): [True: 15.6k, False: 8.85k]
  ------------------
 3965|  15.6k|                         XML_MAX_HUGE_LENGTH :
  ------------------
  |  |   55|  15.6k|#define XML_MAX_HUGE_LENGTH 1000000000
  ------------------
 3966|  24.5k|                         XML_MAX_TEXT_LENGTH;
  ------------------
  |  |   50|  33.3k|#define XML_MAX_TEXT_LENGTH 10000000
  ------------------
 3967|  24.5k|    xmlSBuf buf;
 3968|  24.5k|    int inSpace = 1;
 3969|       |
 3970|  24.5k|    xmlSBufInit(&buf, maxLength);
 3971|       |
 3972|  24.5k|    xmlExpandEntityInAttValue(ctxt, &buf, str, NULL, normalize, &inSpace,
 3973|  24.5k|                              ctxt->inputNr, /* check */ 0);
 3974|       |
 3975|  24.5k|    if ((normalize) && (inSpace) && (buf.size > 0))
  ------------------
  |  Branch (3975:9): [True: 0, False: 24.5k]
  |  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|  24.5k|}
xmlParseAttValue:
 4296|   210k|xmlParseAttValue(xmlParserCtxt *ctxt) {
 4297|   210k|    if ((ctxt == NULL) || (ctxt->input == NULL)) return(NULL);
  ------------------
  |  Branch (4297:9): [True: 0, False: 210k]
  |  Branch (4297:27): [True: 0, False: 210k]
  ------------------
 4298|   210k|    return(xmlParseAttValueInternal(ctxt, NULL, NULL, 0, 0));
 4299|   210k|}
xmlParseSystemLiteral:
 4313|  23.2k|xmlParseSystemLiteral(xmlParserCtxt *ctxt) {
 4314|  23.2k|    xmlChar *buf = NULL;
 4315|  23.2k|    int len = 0;
 4316|  23.2k|    int size = XML_PARSER_BUFFER_SIZE;
  ------------------
  |  |  172|  23.2k|#define XML_PARSER_BUFFER_SIZE 100
  ------------------
 4317|  23.2k|    int cur, l;
 4318|  23.2k|    int maxLength = (ctxt->options & XML_PARSE_HUGE) ?
  ------------------
  |  Branch (4318:21): [True: 9.91k, False: 13.3k]
  ------------------
 4319|  9.91k|                    XML_MAX_TEXT_LENGTH :
  ------------------
  |  |   50|  9.91k|#define XML_MAX_TEXT_LENGTH 10000000
  ------------------
 4320|  23.2k|                    XML_MAX_NAME_LENGTH;
  ------------------
  |  |   65|  13.3k|#define XML_MAX_NAME_LENGTH 50000
  ------------------
 4321|  23.2k|    xmlChar stop;
 4322|       |
 4323|  23.2k|    if (RAW == '"') {
  ------------------
  |  | 2224|  23.2k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (4323:9): [True: 10.9k, False: 12.3k]
  ------------------
 4324|  10.9k|        NEXT;
  ------------------
  |  | 2279|  10.9k|#define NEXT xmlNextChar(ctxt)
  ------------------
 4325|  10.9k|	stop = '"';
 4326|  12.3k|    } else if (RAW == '\'') {
  ------------------
  |  | 2224|  12.3k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (4326:16): [True: 8.77k, False: 3.54k]
  ------------------
 4327|  8.77k|        NEXT;
  ------------------
  |  | 2279|  8.77k|#define NEXT xmlNextChar(ctxt)
  ------------------
 4328|  8.77k|	stop = '\'';
 4329|  8.77k|    } else {
 4330|  3.54k|	xmlFatalErr(ctxt, XML_ERR_LITERAL_NOT_STARTED, NULL);
 4331|  3.54k|	return(NULL);
 4332|  3.54k|    }
 4333|       |
 4334|  19.7k|    buf = xmlMalloc(size);
 4335|  19.7k|    if (buf == NULL) {
  ------------------
  |  Branch (4335:9): [True: 4, False: 19.7k]
  ------------------
 4336|      4|        xmlErrMemory(ctxt);
 4337|      4|	return(NULL);
 4338|      4|    }
 4339|  19.7k|    cur = xmlCurrentCharRecover(ctxt, &l);
 4340|  4.23M|    while ((IS_CHAR(cur)) && (cur != stop)) { /* checked */
  ------------------
  |  |  115|  4.23M|#define IS_CHAR(c)   xmlIsCharQ(c)
  |  |  ------------------
  |  |  |  |  117|  4.23M|#define xmlIsCharQ(c)		(((c) < 0x100) ? \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (117:25): [True: 573k, False: 3.66M]
  |  |  |  |  ------------------
  |  |  |  |  118|  4.23M|				 xmlIsChar_ch((c)) :\
  |  |  |  |  ------------------
  |  |  |  |  |  |  108|   573k|#define xmlIsChar_ch(c)		(((0x9 <= (c)) && ((c) <= 0xa)) || \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (108:28): [True: 571k, False: 1.99k]
  |  |  |  |  |  |  |  Branch (108:44): [True: 2.02k, False: 569k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  109|   573k|				 ((c) == 0xd) || \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (109:6): [True: 0, False: 571k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  110|   573k|				  (0x20 <= (c)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (110:7): [True: 569k, False: 1.99k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  119|  4.23M|				(((0x100 <= (c)) && ((c) <= 0xd7ff)) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (119:7): [True: 3.66M, False: 0]
  |  |  |  |  |  Branch (119:25): [True: 4.00k, False: 3.66M]
  |  |  |  |  ------------------
  |  |  |  |  120|  3.66M|				 ((0xe000 <= (c)) && ((c) <= 0xfffd)) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (120:7): [True: 3.66M, False: 0]
  |  |  |  |  |  Branch (120:26): [True: 3.65M, False: 1.13k]
  |  |  |  |  ------------------
  |  |  |  |  121|  3.66M|				 ((0x10000 <= (c)) && ((c) <= 0x10ffff))))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (121:7): [True: 1.13k, False: 1]
  |  |  |  |  |  Branch (121:27): [True: 1.13k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (4340:12): [True: 4.23M, False: 1.99k]
  |  Branch (4340:30): [True: 4.21M, False: 17.5k]
  ------------------
 4341|  4.21M|	if (len + 5 >= size) {
  ------------------
  |  Branch (4341:6): [True: 5.15k, False: 4.21M]
  ------------------
 4342|  5.15k|	    xmlChar *tmp;
 4343|  5.15k|            int newSize;
 4344|       |
 4345|  5.15k|            newSize = xmlGrowCapacity(size, 1, 1, maxLength);
 4346|  5.15k|            if (newSize < 0) {
  ------------------
  |  Branch (4346:17): [True: 109, False: 5.04k]
  ------------------
 4347|    109|                xmlFatalErr(ctxt, XML_ERR_NAME_TOO_LONG, "SystemLiteral");
 4348|    109|                xmlFree(buf);
 4349|    109|                return(NULL);
 4350|    109|            }
 4351|  5.04k|	    tmp = xmlRealloc(buf, newSize);
 4352|  5.04k|	    if (tmp == NULL) {
  ------------------
  |  Branch (4352:10): [True: 2, False: 5.04k]
  ------------------
 4353|      2|	        xmlFree(buf);
 4354|      2|		xmlErrMemory(ctxt);
 4355|      2|		return(NULL);
 4356|      2|	    }
 4357|  5.04k|	    buf = tmp;
 4358|  5.04k|            size = newSize;
 4359|  5.04k|	}
 4360|  4.21M|	COPY_BUF(buf, len, cur);
  ------------------
  |  | 2296|  4.21M|    if (v < 0x80) b[i++] = v;						\
  |  |  ------------------
  |  |  |  Branch (2296:9): [True: 144k, False: 4.07M]
  |  |  ------------------
  |  | 2297|  4.21M|    else i += xmlCopyCharMultiByte(&b[i],v)
  ------------------
 4361|  4.21M|	NEXTL(l);
  ------------------
  |  | 2288|  4.21M|#define NEXTL(l) do {							\
  |  | 2289|  4.21M|    if (*(ctxt->input->cur) == '\n') {					\
  |  |  ------------------
  |  |  |  Branch (2289:9): [True: 1.64k, False: 4.21M]
  |  |  ------------------
  |  | 2290|  1.64k|	ctxt->input->line++; ctxt->input->col = 1;			\
  |  | 2291|  4.21M|    } else ctxt->input->col++;						\
  |  | 2292|  4.21M|    ctxt->input->cur += l;				\
  |  | 2293|  4.21M|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2293:12): [Folded, False: 4.21M]
  |  |  ------------------
  ------------------
 4362|  4.21M|	cur = xmlCurrentCharRecover(ctxt, &l);
 4363|  4.21M|    }
 4364|  19.5k|    buf[len] = 0;
 4365|  19.5k|    if (!IS_CHAR(cur)) {
  ------------------
  |  |  115|  19.5k|#define IS_CHAR(c)   xmlIsCharQ(c)
  |  |  ------------------
  |  |  |  |  117|  19.5k|#define xmlIsCharQ(c)		(((c) < 0x100) ? \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (117:25): [True: 19.5k, False: 1]
  |  |  |  |  ------------------
  |  |  |  |  118|  19.5k|				 xmlIsChar_ch((c)) :\
  |  |  |  |  ------------------
  |  |  |  |  |  |  108|  19.5k|#define xmlIsChar_ch(c)		(((0x9 <= (c)) && ((c) <= 0xa)) || \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (108:28): [True: 17.6k, False: 1.99k]
  |  |  |  |  |  |  |  Branch (108:44): [True: 0, False: 17.6k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  109|  19.5k|				 ((c) == 0xd) || \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (109:6): [True: 0, False: 19.5k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  110|  19.5k|				  (0x20 <= (c)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (110:7): [True: 17.5k, False: 1.99k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  119|  19.5k|				(((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.99k, False: 17.5k]
  ------------------
 4366|  1.99k|	xmlFatalErr(ctxt, XML_ERR_LITERAL_NOT_FINISHED, NULL);
 4367|  17.5k|    } else {
 4368|  17.5k|	NEXT;
  ------------------
  |  | 2279|  17.5k|#define NEXT xmlNextChar(ctxt)
  ------------------
 4369|  17.5k|    }
 4370|  19.5k|    return(buf);
 4371|  19.7k|}
xmlParsePubidLiteral:
 4385|  10.3k|xmlParsePubidLiteral(xmlParserCtxt *ctxt) {
 4386|  10.3k|    xmlChar *buf = NULL;
 4387|  10.3k|    int len = 0;
 4388|  10.3k|    int size = XML_PARSER_BUFFER_SIZE;
  ------------------
  |  |  172|  10.3k|#define XML_PARSER_BUFFER_SIZE 100
  ------------------
 4389|  10.3k|    int maxLength = (ctxt->options & XML_PARSE_HUGE) ?
  ------------------
  |  Branch (4389:21): [True: 3.18k, False: 7.12k]
  ------------------
 4390|  3.18k|                    XML_MAX_TEXT_LENGTH :
  ------------------
  |  |   50|  3.18k|#define XML_MAX_TEXT_LENGTH 10000000
  ------------------
 4391|  10.3k|                    XML_MAX_NAME_LENGTH;
  ------------------
  |  |   65|  7.12k|#define XML_MAX_NAME_LENGTH 50000
  ------------------
 4392|  10.3k|    xmlChar cur;
 4393|  10.3k|    xmlChar stop;
 4394|       |
 4395|  10.3k|    if (RAW == '"') {
  ------------------
  |  | 2224|  10.3k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (4395:9): [True: 1.02k, False: 9.27k]
  ------------------
 4396|  1.02k|        NEXT;
  ------------------
  |  | 2279|  1.02k|#define NEXT xmlNextChar(ctxt)
  ------------------
 4397|  1.02k|	stop = '"';
 4398|  9.27k|    } else if (RAW == '\'') {
  ------------------
  |  | 2224|  9.27k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (4398:16): [True: 6.75k, False: 2.51k]
  ------------------
 4399|  6.75k|        NEXT;
  ------------------
  |  | 2279|  6.75k|#define NEXT xmlNextChar(ctxt)
  ------------------
 4400|  6.75k|	stop = '\'';
 4401|  6.75k|    } else {
 4402|  2.51k|	xmlFatalErr(ctxt, XML_ERR_LITERAL_NOT_STARTED, NULL);
 4403|  2.51k|	return(NULL);
 4404|  2.51k|    }
 4405|  7.78k|    buf = xmlMalloc(size);
 4406|  7.78k|    if (buf == NULL) {
  ------------------
  |  Branch (4406:9): [True: 2, False: 7.78k]
  ------------------
 4407|      2|	xmlErrMemory(ctxt);
 4408|      2|	return(NULL);
 4409|      2|    }
 4410|  7.78k|    cur = CUR;
  ------------------
  |  | 2225|  7.78k|#define CUR (*ctxt->input->cur)
  ------------------
 4411|   618k|    while ((IS_PUBIDCHAR_CH(cur)) && (cur != stop) &&
  ------------------
  |  |  246|   618k|#define IS_PUBIDCHAR_CH(c) xmlIsPubidChar_ch(c)
  |  |  ------------------
  |  |  |  |  180|   618k|#define xmlIsPubidChar_ch(c)	(xmlIsPubidChar_tab[(c)])
  |  |  ------------------
  ------------------
  |  Branch (4411:12): [True: 616k, False: 1.35k]
  |  Branch (4411:38): [True: 610k, False: 6.42k]
  ------------------
 4412|   610k|           (PARSER_STOPPED(ctxt) == 0)) { /* checked */
  ------------------
  |  |   44|   610k|#define PARSER_STOPPED(ctxt) ((ctxt)->disableSAX > 1)
  ------------------
  |  Branch (4412:12): [True: 610k, False: 1]
  ------------------
 4413|   610k|	if (len + 1 >= size) {
  ------------------
  |  Branch (4413:6): [True: 978, False: 609k]
  ------------------
 4414|    978|	    xmlChar *tmp;
 4415|    978|            int newSize;
 4416|       |
 4417|    978|	    newSize = xmlGrowCapacity(size, 1, 1, maxLength);
 4418|    978|            if (newSize < 0) {
  ------------------
  |  Branch (4418:17): [True: 1, False: 977]
  ------------------
 4419|      1|                xmlFatalErr(ctxt, XML_ERR_NAME_TOO_LONG, "Public ID");
 4420|      1|                xmlFree(buf);
 4421|      1|                return(NULL);
 4422|      1|            }
 4423|    977|	    tmp = xmlRealloc(buf, newSize);
 4424|    977|	    if (tmp == NULL) {
  ------------------
  |  Branch (4424:10): [True: 1, False: 976]
  ------------------
 4425|      1|		xmlErrMemory(ctxt);
 4426|      1|		xmlFree(buf);
 4427|      1|		return(NULL);
 4428|      1|	    }
 4429|    976|	    buf = tmp;
 4430|    976|            size = newSize;
 4431|    976|	}
 4432|   610k|	buf[len++] = cur;
 4433|   610k|	NEXT;
  ------------------
  |  | 2279|   610k|#define NEXT xmlNextChar(ctxt)
  ------------------
 4434|   610k|	cur = CUR;
  ------------------
  |  | 2225|   610k|#define CUR (*ctxt->input->cur)
  ------------------
 4435|   610k|    }
 4436|  7.78k|    buf[len] = 0;
 4437|  7.78k|    if (cur != stop) {
  ------------------
  |  Branch (4437:9): [True: 642, False: 7.14k]
  ------------------
 4438|    642|	xmlFatalErr(ctxt, XML_ERR_LITERAL_NOT_FINISHED, NULL);
 4439|  7.14k|    } else {
 4440|  7.14k|	NEXTL(1);
  ------------------
  |  | 2288|  7.14k|#define NEXTL(l) do {							\
  |  | 2289|  7.14k|    if (*(ctxt->input->cur) == '\n') {					\
  |  |  ------------------
  |  |  |  Branch (2289:9): [True: 0, False: 7.14k]
  |  |  ------------------
  |  | 2290|      0|	ctxt->input->line++; ctxt->input->col = 1;			\
  |  | 2291|  7.14k|    } else ctxt->input->col++;						\
  |  | 2292|  7.14k|    ctxt->input->cur += l;				\
  |  | 2293|  7.14k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2293:12): [Folded, False: 7.14k]
  |  |  ------------------
  ------------------
 4441|  7.14k|    }
 4442|  7.78k|    return(buf);
 4443|  7.78k|}
xmlParseExternalID:
 4755|  44.5k|xmlParseExternalID(xmlParserCtxt *ctxt, xmlChar **publicId, int strict) {
 4756|  44.5k|    xmlChar *URI = NULL;
 4757|       |
 4758|  44.5k|    *publicId = NULL;
 4759|  44.5k|    if (CMP6(CUR_PTR, 'S', 'Y', 'S', 'T', 'E', 'M')) {
  ------------------
  |  | 2236|  44.5k|  ( CMP5( s, c1, c2, c3, c4, c5 ) && ((unsigned char *) s)[ 5 ] == c6 )
  |  |  ------------------
  |  |  |  | 2234|  89.0k|  ( CMP4( s, c1, c2, c3, c4 ) && ((unsigned char *) s)[ 4 ] == c5 )
  |  |  |  |  ------------------
  |  |  |  |  |  | 2231|  89.0k|  ( ((unsigned char *) s)[ 0 ] == c1 && ((unsigned char *) s)[ 1 ] == c2 && \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (2231:5): [True: 14.8k, False: 29.6k]
  |  |  |  |  |  |  |  Branch (2231:41): [True: 14.8k, False: 5]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 2232|  44.5k|    ((unsigned char *) s)[ 2 ] == c3 && ((unsigned char *) s)[ 3 ] == c4 )
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (2232:5): [True: 14.8k, False: 2]
  |  |  |  |  |  |  |  Branch (2232:41): [True: 14.8k, False: 4]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2234:34): [True: 14.8k, False: 10]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2236:38): [True: 14.8k, False: 6]
  |  |  ------------------
  ------------------
 4760|  14.8k|        SKIP(6);
  ------------------
  |  | 2248|  14.8k|#define SKIP(val) do {							\
  |  | 2249|  14.8k|    ctxt->input->cur += (val),ctxt->input->col+=(val);			\
  |  | 2250|  14.8k|    if (*ctxt->input->cur == 0)						\
  |  |  ------------------
  |  |  |  Branch (2250:9): [True: 339, False: 14.5k]
  |  |  ------------------
  |  | 2251|  14.8k|        xmlParserGrow(ctxt);						\
  |  | 2252|  14.8k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2252:12): [Folded, False: 14.8k]
  |  |  ------------------
  ------------------
 4761|  14.8k|	if (SKIP_BLANKS == 0) {
  ------------------
  |  | 2275|  14.8k|#define SKIP_BLANKS xmlSkipBlankChars(ctxt)
  ------------------
  |  Branch (4761:6): [True: 663, False: 14.2k]
  ------------------
 4762|    663|	    xmlFatalErrMsg(ctxt, XML_ERR_SPACE_REQUIRED,
 4763|    663|	                   "Space required after 'SYSTEM'\n");
 4764|    663|	}
 4765|  14.8k|	URI = xmlParseSystemLiteral(ctxt);
 4766|  14.8k|	if (URI == NULL) {
  ------------------
  |  Branch (4766:6): [True: 823, False: 14.0k]
  ------------------
 4767|    823|	    xmlFatalErr(ctxt, XML_ERR_URI_REQUIRED, NULL);
 4768|    823|        }
 4769|  29.6k|    } else if (CMP6(CUR_PTR, 'P', 'U', 'B', 'L', 'I', 'C')) {
  ------------------
  |  | 2236|  29.6k|  ( CMP5( s, c1, c2, c3, c4, c5 ) && ((unsigned char *) s)[ 5 ] == c6 )
  |  |  ------------------
  |  |  |  | 2234|  59.3k|  ( CMP4( s, c1, c2, c3, c4 ) && ((unsigned char *) s)[ 4 ] == c5 )
  |  |  |  |  ------------------
  |  |  |  |  |  | 2231|  59.3k|  ( ((unsigned char *) s)[ 0 ] == c1 && ((unsigned char *) s)[ 1 ] == c2 && \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (2231:5): [True: 10.3k, False: 19.3k]
  |  |  |  |  |  |  |  Branch (2231:41): [True: 10.3k, False: 7]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 2232|  29.6k|    ((unsigned char *) s)[ 2 ] == c3 && ((unsigned char *) s)[ 3 ] == c4 )
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (2232:5): [True: 10.3k, False: 2]
  |  |  |  |  |  |  |  Branch (2232:41): [True: 10.3k, False: 5]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2234:34): [True: 10.3k, False: 5]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2236:38): [True: 10.3k, False: 1]
  |  |  ------------------
  ------------------
 4770|  10.3k|        SKIP(6);
  ------------------
  |  | 2248|  10.3k|#define SKIP(val) do {							\
  |  | 2249|  10.3k|    ctxt->input->cur += (val),ctxt->input->col+=(val);			\
  |  | 2250|  10.3k|    if (*ctxt->input->cur == 0)						\
  |  |  ------------------
  |  |  |  Branch (2250:9): [True: 98, False: 10.2k]
  |  |  ------------------
  |  | 2251|  10.3k|        xmlParserGrow(ctxt);						\
  |  | 2252|  10.3k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2252:12): [Folded, False: 10.3k]
  |  |  ------------------
  ------------------
 4771|  10.3k|	if (SKIP_BLANKS == 0) {
  ------------------
  |  | 2275|  10.3k|#define SKIP_BLANKS xmlSkipBlankChars(ctxt)
  ------------------
  |  Branch (4771:6): [True: 3.62k, False: 6.67k]
  ------------------
 4772|  3.62k|	    xmlFatalErrMsg(ctxt, XML_ERR_SPACE_REQUIRED,
 4773|  3.62k|		    "Space required after 'PUBLIC'\n");
 4774|  3.62k|	}
 4775|  10.3k|	*publicId = xmlParsePubidLiteral(ctxt);
 4776|  10.3k|	if (*publicId == NULL) {
  ------------------
  |  Branch (4776:6): [True: 2.51k, False: 7.78k]
  ------------------
 4777|  2.51k|	    xmlFatalErr(ctxt, XML_ERR_PUBID_REQUIRED, NULL);
 4778|  2.51k|	}
 4779|  10.3k|	if (strict) {
  ------------------
  |  Branch (4779:6): [True: 8.32k, False: 1.97k]
  ------------------
 4780|       |	    /*
 4781|       |	     * We don't handle [83] so "S SystemLiteral" is required.
 4782|       |	     */
 4783|  8.32k|	    if (SKIP_BLANKS == 0) {
  ------------------
  |  | 2275|  8.32k|#define SKIP_BLANKS xmlSkipBlankChars(ctxt)
  ------------------
  |  Branch (4783:10): [True: 4.28k, False: 4.04k]
  ------------------
 4784|  4.28k|		xmlFatalErrMsg(ctxt, XML_ERR_SPACE_REQUIRED,
 4785|  4.28k|			"Space required after the Public Identifier\n");
 4786|  4.28k|	    }
 4787|  8.32k|	} 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|  1.97k|	    if (SKIP_BLANKS == 0) return(NULL);
  ------------------
  |  | 2275|  1.97k|#define SKIP_BLANKS xmlSkipBlankChars(ctxt)
  ------------------
  |  Branch (4794:10): [True: 1.48k, False: 484]
  ------------------
 4795|    484|	    if ((CUR != '\'') && (CUR != '"')) return(NULL);
  ------------------
  |  | 2225|    484|#define CUR (*ctxt->input->cur)
  ------------------
              	    if ((CUR != '\'') && (CUR != '"')) return(NULL);
  ------------------
  |  | 2225|    445|#define CUR (*ctxt->input->cur)
  ------------------
  |  Branch (4795:10): [True: 445, False: 39]
  |  Branch (4795:27): [True: 430, False: 15]
  ------------------
 4796|    484|	}
 4797|  8.38k|	URI = xmlParseSystemLiteral(ctxt);
 4798|  8.38k|	if (URI == NULL) {
  ------------------
  |  Branch (4798:6): [True: 2.83k, False: 5.54k]
  ------------------
 4799|  2.83k|	    xmlFatalErr(ctxt, XML_ERR_URI_REQUIRED, NULL);
 4800|  2.83k|        }
 4801|  8.38k|    }
 4802|  42.6k|    return(URI);
 4803|  44.5k|}
xmlParseComment:
 4932|   514k|xmlParseComment(xmlParserCtxt *ctxt) {
 4933|   514k|    xmlChar *buf = NULL;
 4934|   514k|    size_t size = XML_PARSER_BUFFER_SIZE;
  ------------------
  |  |  172|   514k|#define XML_PARSER_BUFFER_SIZE 100
  ------------------
 4935|   514k|    size_t len = 0;
 4936|   514k|    size_t maxLength = (ctxt->options & XML_PARSE_HUGE) ?
  ------------------
  |  Branch (4936:24): [True: 140k, False: 373k]
  ------------------
 4937|   140k|                       XML_MAX_HUGE_LENGTH :
  ------------------
  |  |   55|   140k|#define XML_MAX_HUGE_LENGTH 1000000000
  ------------------
 4938|   514k|                       XML_MAX_TEXT_LENGTH;
  ------------------
  |  |   50|   888k|#define XML_MAX_TEXT_LENGTH 10000000
  ------------------
 4939|   514k|    const xmlChar *in;
 4940|   514k|    size_t nbchar = 0;
 4941|   514k|    int ccol;
 4942|       |
 4943|       |    /*
 4944|       |     * Check that there is a comment right here.
 4945|       |     */
 4946|   514k|    if ((RAW != '<') || (NXT(1) != '!'))
  ------------------
  |  | 2224|   514k|#define RAW (*ctxt->input->cur)
  ------------------
                  if ((RAW != '<') || (NXT(1) != '!'))
  ------------------
  |  | 2226|   514k|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
  |  Branch (4946:9): [True: 0, False: 514k]
  |  Branch (4946:25): [True: 0, False: 514k]
  ------------------
 4947|      0|        return;
 4948|   514k|    SKIP(2);
  ------------------
  |  | 2248|   514k|#define SKIP(val) do {							\
  |  | 2249|   514k|    ctxt->input->cur += (val),ctxt->input->col+=(val);			\
  |  | 2250|   514k|    if (*ctxt->input->cur == 0)						\
  |  |  ------------------
  |  |  |  Branch (2250:9): [True: 0, False: 514k]
  |  |  ------------------
  |  | 2251|   514k|        xmlParserGrow(ctxt);						\
  |  | 2252|   514k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2252:12): [Folded, False: 514k]
  |  |  ------------------
  ------------------
 4949|   514k|    if ((RAW != '-') || (NXT(1) != '-'))
  ------------------
  |  | 2224|   514k|#define RAW (*ctxt->input->cur)
  ------------------
                  if ((RAW != '-') || (NXT(1) != '-'))
  ------------------
  |  | 2226|   514k|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
  |  Branch (4949:9): [True: 0, False: 514k]
  |  Branch (4949:25): [True: 13, False: 514k]
  ------------------
 4950|     13|        return;
 4951|   514k|    SKIP(2);
  ------------------
  |  | 2248|   514k|#define SKIP(val) do {							\
  |  | 2249|   514k|    ctxt->input->cur += (val),ctxt->input->col+=(val);			\
  |  | 2250|   514k|    if (*ctxt->input->cur == 0)						\
  |  |  ------------------
  |  |  |  Branch (2250:9): [True: 185, False: 513k]
  |  |  ------------------
  |  | 2251|   514k|        xmlParserGrow(ctxt);						\
  |  | 2252|   514k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2252:12): [Folded, False: 514k]
  |  |  ------------------
  ------------------
 4952|   514k|    GROW;
  ------------------
  |  | 2271|   514k|    if ((!PARSER_PROGRESSIVE(ctxt)) && \
  |  |  ------------------
  |  |  |  |   47|   514k|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|   514k|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2271:9): [True: 375k, False: 138k]
  |  |  ------------------
  |  | 2272|   514k|        (ctxt->input->end - ctxt->input->cur < INPUT_CHUNK)) \
  |  |  ------------------
  |  |  |  |   63|   375k|#define INPUT_CHUNK	250
  |  |  ------------------
  |  |  |  Branch (2272:9): [True: 131k, False: 244k]
  |  |  ------------------
  |  | 2273|   514k|	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|   514k|    in = ctxt->input->cur;
 4959|   514k|    do {
 4960|   514k|	if (*in == 0xA) {
  ------------------
  |  Branch (4960:6): [True: 881, False: 513k]
  ------------------
 4961|  4.82k|	    do {
 4962|  4.82k|		ctxt->input->line++; ctxt->input->col = 1;
 4963|  4.82k|		in++;
 4964|  4.82k|	    } while (*in == 0xA);
  ------------------
  |  Branch (4964:15): [True: 3.94k, False: 881]
  ------------------
 4965|    881|	}
 4966|   913k|get_more:
 4967|   913k|        ccol = ctxt->input->col;
 4968|  6.14M|	while (((*in > '-') && (*in <= 0x7F)) ||
  ------------------
  |  Branch (4968:10): [True: 4.23M, False: 1.91M]
  |  Branch (4968:25): [True: 4.16M, False: 61.9k]
  ------------------
 4969|  1.97M|	       ((*in >= 0x20) && (*in < '-')) ||
  ------------------
  |  Branch (4969:10): [True: 1.83M, False: 146k]
  |  Branch (4969:27): [True: 1.05M, False: 778k]
  ------------------
 4970|  5.23M|	       (*in == 0x09)) {
  ------------------
  |  Branch (4970:9): [True: 11.3k, False: 913k]
  ------------------
 4971|  5.23M|		    in++;
 4972|  5.23M|		    ccol++;
 4973|  5.23M|	}
 4974|   913k|	ctxt->input->col = ccol;
 4975|   913k|	if (*in == 0xA) {
  ------------------
  |  Branch (4975:6): [True: 29.5k, False: 883k]
  ------------------
 4976|   314k|	    do {
 4977|   314k|		ctxt->input->line++; ctxt->input->col = 1;
 4978|   314k|		in++;
 4979|   314k|	    } while (*in == 0xA);
  ------------------
  |  Branch (4979:15): [True: 285k, False: 29.5k]
  ------------------
 4980|  29.5k|	    goto get_more;
 4981|  29.5k|	}
 4982|   883k|	nbchar = in - ctxt->input->cur;
 4983|       |	/*
 4984|       |	 * save current set of data
 4985|       |	 */
 4986|   883k|	if (nbchar > 0) {
  ------------------
  |  Branch (4986:6): [True: 529k, False: 354k]
  ------------------
 4987|   529k|            if (nbchar > maxLength - len) {
  ------------------
  |  Branch (4987:17): [True: 0, False: 529k]
  ------------------
 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|   529k|            if (buf == NULL) {
  ------------------
  |  Branch (4993:17): [True: 190k, False: 338k]
  ------------------
 4994|   190k|                if ((*in == '-') && (in[1] == '-'))
  ------------------
  |  Branch (4994:21): [True: 95.7k, False: 94.8k]
  |  Branch (4994:37): [True: 69.3k, False: 26.4k]
  ------------------
 4995|  69.3k|                    size = nbchar + 1;
 4996|   121k|                else
 4997|   121k|                    size = XML_PARSER_BUFFER_SIZE + nbchar;
  ------------------
  |  |  172|   121k|#define XML_PARSER_BUFFER_SIZE 100
  ------------------
 4998|   190k|                buf = xmlMalloc(size);
 4999|   190k|                if (buf == NULL) {
  ------------------
  |  Branch (4999:21): [True: 3, False: 190k]
  ------------------
 5000|      3|                    xmlErrMemory(ctxt);
 5001|      3|                    return;
 5002|      3|                }
 5003|   190k|                len = 0;
 5004|   338k|            } else if (len + nbchar + 1 >= size) {
  ------------------
  |  Branch (5004:24): [True: 13.7k, False: 324k]
  ------------------
 5005|  13.7k|                xmlChar *new_buf;
 5006|  13.7k|                size += len + nbchar + XML_PARSER_BUFFER_SIZE;
  ------------------
  |  |  172|  13.7k|#define XML_PARSER_BUFFER_SIZE 100
  ------------------
 5007|  13.7k|                new_buf = xmlRealloc(buf, size);
 5008|  13.7k|                if (new_buf == NULL) {
  ------------------
  |  Branch (5008:21): [True: 1, False: 13.7k]
  ------------------
 5009|      1|                    xmlErrMemory(ctxt);
 5010|      1|                    xmlFree(buf);
 5011|      1|                    return;
 5012|      1|                }
 5013|  13.7k|                buf = new_buf;
 5014|  13.7k|            }
 5015|   529k|            memcpy(&buf[len], ctxt->input->cur, nbchar);
 5016|   529k|            len += nbchar;
 5017|   529k|            buf[len] = 0;
 5018|   529k|	}
 5019|   883k|	ctxt->input->cur = in;
 5020|   883k|	if (*in == 0xA) {
  ------------------
  |  Branch (5020:6): [True: 0, False: 883k]
  ------------------
 5021|      0|	    in++;
 5022|      0|	    ctxt->input->line++; ctxt->input->col = 1;
 5023|      0|	}
 5024|   883k|	if (*in == 0xD) {
  ------------------
  |  Branch (5024:6): [True: 103k, False: 780k]
  ------------------
 5025|   103k|	    in++;
 5026|   103k|	    if (*in == 0xA) {
  ------------------
  |  Branch (5026:10): [True: 16.0k, False: 87.7k]
  ------------------
 5027|  16.0k|		ctxt->input->cur = in;
 5028|  16.0k|		in++;
 5029|  16.0k|		ctxt->input->line++; ctxt->input->col = 1;
 5030|  16.0k|		goto get_more;
 5031|  16.0k|	    }
 5032|  87.7k|	    in--;
 5033|  87.7k|	}
 5034|   867k|	SHRINK;
  ------------------
  |  | 2267|   867k|    if (!PARSER_PROGRESSIVE(ctxt)) \
  |  |  ------------------
  |  |  |  |   47|   867k|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|   867k|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2267:9): [True: 720k, False: 147k]
  |  |  ------------------
  |  | 2268|   867k|	xmlParserShrink(ctxt);
  ------------------
 5035|   867k|	GROW;
  ------------------
  |  | 2271|   867k|    if ((!PARSER_PROGRESSIVE(ctxt)) && \
  |  |  ------------------
  |  |  |  |   47|   867k|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|   867k|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2271:9): [True: 720k, False: 147k]
  |  |  ------------------
  |  | 2272|   867k|        (ctxt->input->end - ctxt->input->cur < INPUT_CHUNK)) \
  |  |  ------------------
  |  |  |  |   63|   720k|#define INPUT_CHUNK	250
  |  |  ------------------
  |  |  |  Branch (2272:9): [True: 144k, False: 575k]
  |  |  ------------------
  |  | 2273|   867k|	xmlParserGrow(ctxt);
  ------------------
 5036|   867k|	in = ctxt->input->cur;
 5037|   867k|	if (*in == '-') {
  ------------------
  |  Branch (5037:6): [True: 716k, False: 151k]
  ------------------
 5038|   716k|	    if (in[1] == '-') {
  ------------------
  |  Branch (5038:10): [True: 539k, False: 176k]
  ------------------
 5039|   539k|	        if (in[2] == '>') {
  ------------------
  |  Branch (5039:14): [True: 363k, False: 176k]
  ------------------
 5040|   363k|		    SKIP(3);
  ------------------
  |  | 2248|   363k|#define SKIP(val) do {							\
  |  | 2249|   363k|    ctxt->input->cur += (val),ctxt->input->col+=(val);			\
  |  | 2250|   363k|    if (*ctxt->input->cur == 0)						\
  |  |  ------------------
  |  |  |  Branch (2250:9): [True: 619, False: 362k]
  |  |  ------------------
  |  | 2251|   363k|        xmlParserGrow(ctxt);						\
  |  | 2252|   363k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2252:12): [Folded, False: 363k]
  |  |  ------------------
  ------------------
 5041|   363k|		    if ((ctxt->sax != NULL) && (ctxt->sax->comment != NULL) &&
  ------------------
  |  Branch (5041:11): [True: 363k, False: 0]
  |  Branch (5041:34): [True: 363k, False: 0]
  ------------------
 5042|   363k|		        (!ctxt->disableSAX)) {
  ------------------
  |  Branch (5042:11): [True: 345k, False: 17.5k]
  ------------------
 5043|   345k|			if (buf != NULL)
  ------------------
  |  Branch (5043:8): [True: 59.2k, False: 286k]
  ------------------
 5044|  59.2k|			    ctxt->sax->comment(ctxt->userData, buf);
 5045|   286k|			else
 5046|   286k|			    ctxt->sax->comment(ctxt->userData, BAD_CAST "");
  ------------------
  |  |   34|   286k|#define BAD_CAST (xmlChar *)
  ------------------
 5047|   345k|		    }
 5048|   363k|		    if (buf != NULL)
  ------------------
  |  Branch (5048:11): [True: 67.7k, False: 295k]
  ------------------
 5049|  67.7k|		        xmlFree(buf);
 5050|   363k|		    return;
 5051|   363k|		}
 5052|   176k|		if (buf != NULL) {
  ------------------
  |  Branch (5052:7): [True: 151k, False: 25.2k]
  ------------------
 5053|   151k|		    xmlFatalErrMsgStr(ctxt, XML_ERR_HYPHEN_IN_COMMENT,
 5054|   151k|		                      "Double hyphen within comment: "
 5055|   151k|                                      "<!--%.50s\n",
 5056|   151k|				      buf);
 5057|   151k|		} else
 5058|  25.2k|		    xmlFatalErrMsgStr(ctxt, XML_ERR_HYPHEN_IN_COMMENT,
 5059|  25.2k|		                      "Double hyphen within comment\n", NULL);
 5060|   176k|		in++;
 5061|   176k|		ctxt->input->col++;
 5062|   176k|	    }
 5063|   353k|	    in++;
 5064|   353k|	    ctxt->input->col++;
 5065|   353k|	    goto get_more;
 5066|   716k|	}
 5067|   867k|    } while (((*in >= 0x20) && (*in <= 0x7F)) || (*in == 0x09) || (*in == 0x0a));
  ------------------
  |  Branch (5067:15): [True: 62.2k, False: 89.5k]
  |  Branch (5067:32): [True: 295, False: 61.9k]
  |  Branch (5067:50): [True: 278, False: 151k]
  |  Branch (5067:67): [True: 0, False: 151k]
  ------------------
 5068|   151k|    xmlParseCommentComplex(ctxt, buf, len, size);
 5069|   151k|}
xmlParsePITarget:
 5084|   134k|xmlParsePITarget(xmlParserCtxt *ctxt) {
 5085|   134k|    const xmlChar *name;
 5086|       |
 5087|   134k|    name = xmlParseName(ctxt);
 5088|   134k|    if ((name != NULL) &&
  ------------------
  |  Branch (5088:9): [True: 129k, False: 5.02k]
  ------------------
 5089|   129k|        ((name[0] == 'x') || (name[0] == 'X')) &&
  ------------------
  |  Branch (5089:10): [True: 17.5k, False: 112k]
  |  Branch (5089:30): [True: 434, False: 111k]
  ------------------
 5090|  18.0k|        ((name[1] == 'm') || (name[1] == 'M')) &&
  ------------------
  |  Branch (5090:10): [True: 15.9k, False: 2.05k]
  |  Branch (5090:30): [True: 289, False: 1.77k]
  ------------------
 5091|  16.2k|        ((name[2] == 'l') || (name[2] == 'L'))) {
  ------------------
  |  Branch (5091:10): [True: 11.6k, False: 4.62k]
  |  Branch (5091:30): [True: 210, False: 4.41k]
  ------------------
 5092|  11.8k|	int i;
 5093|  11.8k|	if ((name[0] == 'x') && (name[1] == 'm') &&
  ------------------
  |  Branch (5093:6): [True: 11.5k, False: 264]
  |  Branch (5093:26): [True: 11.4k, False: 151]
  ------------------
 5094|  11.4k|	    (name[2] == 'l') && (name[3] == 0)) {
  ------------------
  |  Branch (5094:6): [True: 11.2k, False: 197]
  |  Branch (5094:26): [True: 10.6k, False: 572]
  ------------------
 5095|  10.6k|	    xmlFatalErrMsg(ctxt, XML_ERR_RESERVED_XML_NAME,
 5096|  10.6k|		 "XML declaration allowed only at the start of the document\n");
 5097|  10.6k|	    return(name);
 5098|  10.6k|	} else if (name[3] == 0) {
  ------------------
  |  Branch (5098:13): [True: 421, False: 763]
  ------------------
 5099|    421|	    xmlFatalErr(ctxt, XML_ERR_RESERVED_XML_NAME, NULL);
 5100|    421|	    return(name);
 5101|    421|	}
 5102|  2.19k|	for (i = 0;;i++) {
 5103|  2.19k|	    if (xmlW3CPIs[i] == NULL) break;
  ------------------
  |  Branch (5103:10): [True: 683, False: 1.50k]
  ------------------
 5104|  1.50k|	    if (xmlStrEqual(name, (const xmlChar *)xmlW3CPIs[i]))
  ------------------
  |  Branch (5104:10): [True: 80, False: 1.42k]
  ------------------
 5105|     80|	        return(name);
 5106|  1.50k|	}
 5107|    683|	xmlWarningMsg(ctxt, XML_ERR_RESERVED_XML_NAME,
 5108|    683|		      "xmlParsePITarget: invalid name prefix 'xml'\n",
 5109|    683|		      NULL, NULL);
 5110|    683|    }
 5111|   123k|    if ((name != NULL) && (xmlStrchr(name, ':') != NULL)) {
  ------------------
  |  Branch (5111:9): [True: 118k, False: 5.02k]
  |  Branch (5111:27): [True: 492, False: 118k]
  ------------------
 5112|    492|	xmlNsErr(ctxt, XML_NS_ERR_COLON,
 5113|    492|		 "colons are forbidden from PI names '%s'\n", name, NULL, NULL);
 5114|    492|    }
 5115|   123k|    return(name);
 5116|   134k|}
xmlParsePI:
 5198|   134k|xmlParsePI(xmlParserCtxt *ctxt) {
 5199|   134k|    xmlChar *buf = NULL;
 5200|   134k|    size_t len = 0;
 5201|   134k|    size_t size = XML_PARSER_BUFFER_SIZE;
  ------------------
  |  |  172|   134k|#define XML_PARSER_BUFFER_SIZE 100
  ------------------
 5202|   134k|    size_t maxLength = (ctxt->options & XML_PARSE_HUGE) ?
  ------------------
  |  Branch (5202:24): [True: 44.9k, False: 90.0k]
  ------------------
 5203|  44.9k|                       XML_MAX_HUGE_LENGTH :
  ------------------
  |  |   55|  44.9k|#define XML_MAX_HUGE_LENGTH 1000000000
  ------------------
 5204|   134k|                       XML_MAX_TEXT_LENGTH;
  ------------------
  |  |   50|   225k|#define XML_MAX_TEXT_LENGTH 10000000
  ------------------
 5205|   134k|    int cur, l;
 5206|   134k|    const xmlChar *target;
 5207|       |
 5208|   134k|    if ((RAW == '<') && (NXT(1) == '?')) {
  ------------------
  |  | 2224|   134k|#define RAW (*ctxt->input->cur)
  ------------------
                  if ((RAW == '<') && (NXT(1) == '?')) {
  ------------------
  |  | 2226|   134k|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
  |  Branch (5208:9): [True: 134k, False: 0]
  |  Branch (5208:25): [True: 134k, False: 0]
  ------------------
 5209|       |	/*
 5210|       |	 * this is a Processing Instruction.
 5211|       |	 */
 5212|   134k|	SKIP(2);
  ------------------
  |  | 2248|   134k|#define SKIP(val) do {							\
  |  | 2249|   134k|    ctxt->input->cur += (val),ctxt->input->col+=(val);			\
  |  | 2250|   134k|    if (*ctxt->input->cur == 0)						\
  |  |  ------------------
  |  |  |  Branch (2250:9): [True: 975, False: 134k]
  |  |  ------------------
  |  | 2251|   134k|        xmlParserGrow(ctxt);						\
  |  | 2252|   134k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2252:12): [Folded, False: 134k]
  |  |  ------------------
  ------------------
 5213|       |
 5214|       |	/*
 5215|       |	 * Parse the target name and check for special support like
 5216|       |	 * namespace.
 5217|       |	 */
 5218|   134k|        target = xmlParsePITarget(ctxt);
 5219|   134k|	if (target != NULL) {
  ------------------
  |  Branch (5219:6): [True: 129k, False: 5.02k]
  ------------------
 5220|   129k|	    if ((RAW == '?') && (NXT(1) == '>')) {
  ------------------
  |  | 2224|   129k|#define RAW (*ctxt->input->cur)
  ------------------
              	    if ((RAW == '?') && (NXT(1) == '>')) {
  ------------------
  |  | 2226|   105k|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
  |  Branch (5220:10): [True: 105k, False: 24.3k]
  |  Branch (5220:26): [True: 105k, False: 561]
  ------------------
 5221|   105k|		SKIP(2);
  ------------------
  |  | 2248|   105k|#define SKIP(val) do {							\
  |  | 2249|   105k|    ctxt->input->cur += (val),ctxt->input->col+=(val);			\
  |  | 2250|   105k|    if (*ctxt->input->cur == 0)						\
  |  |  ------------------
  |  |  |  Branch (2250:9): [True: 451, False: 104k]
  |  |  ------------------
  |  | 2251|   105k|        xmlParserGrow(ctxt);						\
  |  | 2252|   105k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2252:12): [Folded, False: 105k]
  |  |  ------------------
  ------------------
 5222|       |
 5223|       |		/*
 5224|       |		 * SAX: PI detected.
 5225|       |		 */
 5226|   105k|		if ((ctxt->sax) && (!ctxt->disableSAX) &&
  ------------------
  |  Branch (5226:7): [True: 105k, False: 0]
  |  Branch (5226:22): [True: 104k, False: 604]
  ------------------
 5227|   104k|		    (ctxt->sax->processingInstruction != NULL))
  ------------------
  |  Branch (5227:7): [True: 104k, False: 0]
  ------------------
 5228|   104k|		    ctxt->sax->processingInstruction(ctxt->userData,
 5229|   104k|		                                     target, NULL);
 5230|   105k|		return;
 5231|   105k|	    }
 5232|  24.9k|	    buf = xmlMalloc(size);
 5233|  24.9k|	    if (buf == NULL) {
  ------------------
  |  Branch (5233:10): [True: 4, False: 24.9k]
  ------------------
 5234|      4|		xmlErrMemory(ctxt);
 5235|      4|		return;
 5236|      4|	    }
 5237|  24.9k|	    if (SKIP_BLANKS == 0) {
  ------------------
  |  | 2275|  24.9k|#define SKIP_BLANKS xmlSkipBlankChars(ctxt)
  ------------------
  |  Branch (5237:10): [True: 7.56k, False: 17.3k]
  ------------------
 5238|  7.56k|		xmlFatalErrMsgStr(ctxt, XML_ERR_SPACE_REQUIRED,
 5239|  7.56k|			  "ParsePI: PI %s space expected\n", target);
 5240|  7.56k|	    }
 5241|  24.9k|	    cur = xmlCurrentCharRecover(ctxt, &l);
 5242|  4.97M|	    while (IS_CHAR(cur) && /* checked */
  ------------------
  |  |  115|  4.97M|#define IS_CHAR(c)   xmlIsCharQ(c)
  |  |  ------------------
  |  |  |  |  117|  9.94M|#define xmlIsCharQ(c)		(((c) < 0x100) ? \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (117:24): [True: 4.96M, False: 8.39k]
  |  |  |  |  |  Branch (117:25): [True: 1.19M, False: 3.77M]
  |  |  |  |  ------------------
  |  |  |  |  118|  9.94M|				 xmlIsChar_ch((c)) :\
  |  |  |  |  ------------------
  |  |  |  |  |  |  108|  1.19M|#define xmlIsChar_ch(c)		(((0x9 <= (c)) && ((c) <= 0xa)) || \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (108:28): [True: 1.18M, False: 8.06k]
  |  |  |  |  |  |  |  Branch (108:44): [True: 130k, False: 1.05M]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  109|  1.19M|				 ((c) == 0xd) || \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (109:6): [True: 0, False: 1.06M]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  110|  1.19M|				  (0x20 <= (c)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (110:7): [True: 1.05M, False: 8.18k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  119|  9.94M|				(((0x100 <= (c)) && ((c) <= 0xd7ff)) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (119:7): [True: 3.77M, False: 0]
  |  |  |  |  |  Branch (119:25): [True: 2.66M, False: 1.11M]
  |  |  |  |  ------------------
  |  |  |  |  120|  3.77M|				 ((0xe000 <= (c)) && ((c) <= 0xfffd)) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (120:7): [True: 1.11M, False: 0]
  |  |  |  |  |  Branch (120:26): [True: 1.10M, False: 1.04k]
  |  |  |  |  ------------------
  |  |  |  |  121|  3.77M|				 ((0x10000 <= (c)) && ((c) <= 0x10ffff))))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (121:7): [True: 833, False: 209]
  |  |  |  |  |  Branch (121:27): [True: 833, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 5243|  4.96M|		   ((cur != '?') || (NXT(1) != '>'))) {
  ------------------
  |  | 2226|  27.3k|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
  |  Branch (5243:7): [True: 4.93M, False: 27.3k]
  |  Branch (5243:23): [True: 10.8k, False: 16.5k]
  ------------------
 5244|  4.94M|		if (len + 5 >= size) {
  ------------------
  |  Branch (5244:7): [True: 18.1k, False: 4.92M]
  ------------------
 5245|  18.1k|		    xmlChar *tmp;
 5246|  18.1k|                    int newSize;
 5247|       |
 5248|  18.1k|                    newSize = xmlGrowCapacity(size, 1, 1, maxLength);
 5249|  18.1k|                    if (newSize < 0) {
  ------------------
  |  Branch (5249:25): [True: 0, False: 18.1k]
  ------------------
 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|  18.1k|		    tmp = xmlRealloc(buf, newSize);
 5256|  18.1k|		    if (tmp == NULL) {
  ------------------
  |  Branch (5256:11): [True: 9, False: 18.1k]
  ------------------
 5257|      9|			xmlErrMemory(ctxt);
 5258|      9|			xmlFree(buf);
 5259|      9|			return;
 5260|      9|		    }
 5261|  18.1k|		    buf = tmp;
 5262|  18.1k|                    size = newSize;
 5263|  18.1k|		}
 5264|  4.94M|		COPY_BUF(buf, len, cur);
  ------------------
  |  | 2296|  4.94M|    if (v < 0x80) b[i++] = v;						\
  |  |  ------------------
  |  |  |  Branch (2296:9): [True: 1.15M, False: 3.79M]
  |  |  ------------------
  |  | 2297|  4.94M|    else i += xmlCopyCharMultiByte(&b[i],v)
  ------------------
 5265|  4.94M|		NEXTL(l);
  ------------------
  |  | 2288|  4.94M|#define NEXTL(l) do {							\
  |  | 2289|  4.94M|    if (*(ctxt->input->cur) == '\n') {					\
  |  |  ------------------
  |  |  |  Branch (2289:9): [True: 130k, False: 4.81M]
  |  |  ------------------
  |  | 2290|   130k|	ctxt->input->line++; ctxt->input->col = 1;			\
  |  | 2291|  4.81M|    } else ctxt->input->col++;						\
  |  | 2292|  4.94M|    ctxt->input->cur += l;				\
  |  | 2293|  4.94M|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2293:12): [Folded, False: 4.94M]
  |  |  ------------------
  ------------------
 5266|  4.94M|		cur = xmlCurrentCharRecover(ctxt, &l);
 5267|  4.94M|	    }
 5268|  24.9k|	    buf[len] = 0;
 5269|  24.9k|	    if (cur != '?') {
  ------------------
  |  Branch (5269:10): [True: 8.39k, False: 16.5k]
  ------------------
 5270|  8.39k|		xmlFatalErrMsgStr(ctxt, XML_ERR_PI_NOT_FINISHED,
 5271|  8.39k|		      "ParsePI: PI %s never end ...\n", target);
 5272|  16.5k|	    } else {
 5273|  16.5k|		SKIP(2);
  ------------------
  |  | 2248|  16.5k|#define SKIP(val) do {							\
  |  | 2249|  16.5k|    ctxt->input->cur += (val),ctxt->input->col+=(val);			\
  |  | 2250|  16.5k|    if (*ctxt->input->cur == 0)						\
  |  |  ------------------
  |  |  |  Branch (2250:9): [True: 401, False: 16.1k]
  |  |  ------------------
  |  | 2251|  16.5k|        xmlParserGrow(ctxt);						\
  |  | 2252|  16.5k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2252:12): [Folded, False: 16.5k]
  |  |  ------------------
  ------------------
 5274|       |
 5275|  16.5k|#ifdef LIBXML_CATALOG_ENABLED
 5276|  16.5k|		if ((ctxt->inSubset == 0) &&
  ------------------
  |  Branch (5276:7): [True: 8.01k, False: 8.51k]
  ------------------
 5277|  8.01k|		    (xmlStrEqual(target, XML_CATALOG_PI))) {
  ------------------
  |  |   44|  8.01k|    (const xmlChar *) "oasis-xml-catalog"
  ------------------
  |  Branch (5277:7): [True: 391, False: 7.62k]
  ------------------
 5278|    391|		    xmlCatalogAllow allow = xmlCatalogGetDefaults();
 5279|       |
 5280|    391|		    if ((ctxt->options & XML_PARSE_CATALOG_PI) &&
  ------------------
  |  Branch (5280:11): [True: 194, False: 197]
  ------------------
 5281|    194|                        ((allow == XML_CATA_ALLOW_DOCUMENT) ||
  ------------------
  |  Branch (5281:26): [True: 0, False: 194]
  ------------------
 5282|    194|			 (allow == XML_CATA_ALLOW_ALL)))
  ------------------
  |  Branch (5282:5): [True: 0, False: 194]
  ------------------
 5283|      0|			xmlParseCatalogPI(ctxt, buf);
 5284|    391|		}
 5285|  16.5k|#endif
 5286|       |
 5287|       |		/*
 5288|       |		 * SAX: PI detected.
 5289|       |		 */
 5290|  16.5k|		if ((ctxt->sax) && (!ctxt->disableSAX) &&
  ------------------
  |  Branch (5290:7): [True: 16.5k, False: 0]
  |  Branch (5290:22): [True: 15.7k, False: 829]
  ------------------
 5291|  15.7k|		    (ctxt->sax->processingInstruction != NULL))
  ------------------
  |  Branch (5291:7): [True: 15.7k, False: 0]
  ------------------
 5292|  15.7k|		    ctxt->sax->processingInstruction(ctxt->userData,
 5293|  15.7k|		                                     target, buf);
 5294|  16.5k|	    }
 5295|  24.9k|	    xmlFree(buf);
 5296|  24.9k|	} else {
 5297|       |	    xmlFatalErr(ctxt, XML_ERR_PI_NOT_STARTED, NULL);
 5298|  5.02k|	}
 5299|   134k|    }
 5300|   134k|}
xmlParseNotationDecl:
 5322|  5.63k|xmlParseNotationDecl(xmlParserCtxt *ctxt) {
 5323|  5.63k|    const xmlChar *name;
 5324|  5.63k|    xmlChar *Pubid;
 5325|  5.63k|    xmlChar *Systemid;
 5326|       |
 5327|  5.63k|    if ((CUR != '<') || (NXT(1) != '!'))
  ------------------
  |  | 2225|  5.63k|#define CUR (*ctxt->input->cur)
  ------------------
                  if ((CUR != '<') || (NXT(1) != '!'))
  ------------------
  |  | 2226|  5.63k|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
  |  Branch (5327:9): [True: 0, False: 5.63k]
  |  Branch (5327:25): [True: 0, False: 5.63k]
  ------------------
 5328|      0|        return;
 5329|  5.63k|    SKIP(2);
  ------------------
  |  | 2248|  5.63k|#define SKIP(val) do {							\
  |  | 2249|  5.63k|    ctxt->input->cur += (val),ctxt->input->col+=(val);			\
  |  | 2250|  5.63k|    if (*ctxt->input->cur == 0)						\
  |  |  ------------------
  |  |  |  Branch (2250:9): [True: 0, False: 5.63k]
  |  |  ------------------
  |  | 2251|  5.63k|        xmlParserGrow(ctxt);						\
  |  | 2252|  5.63k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2252:12): [Folded, False: 5.63k]
  |  |  ------------------
  ------------------
 5330|       |
 5331|  5.63k|    if (CMP8(CUR_PTR, 'N', 'O', 'T', 'A', 'T', 'I', 'O', 'N')) {
  ------------------
  |  | 2240|  5.63k|  ( CMP7( s, c1, c2, c3, c4, c5, c6, c7 ) && ((unsigned char *) s)[ 7 ] == c8 )
  |  |  ------------------
  |  |  |  | 2238|  11.2k|  ( CMP6( s, c1, c2, c3, c4, c5, c6 ) && ((unsigned char *) s)[ 6 ] == c7 )
  |  |  |  |  ------------------
  |  |  |  |  |  | 2236|  11.2k|  ( CMP5( s, c1, c2, c3, c4, c5 ) && ((unsigned char *) s)[ 5 ] == c6 )
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  | 2234|  11.2k|  ( CMP4( s, c1, c2, c3, c4 ) && ((unsigned char *) s)[ 4 ] == c5 )
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  | 2231|  11.2k|  ( ((unsigned char *) s)[ 0 ] == c1 && ((unsigned char *) s)[ 1 ] == c2 && \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (2231:5): [True: 5.63k, False: 0]
  |  |  |  |  |  |  |  |  |  |  |  Branch (2231:41): [True: 5.62k, False: 16]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  | 2232|  5.63k|    ((unsigned char *) s)[ 2 ] == c3 && ((unsigned char *) s)[ 3 ] == c4 )
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (2232:5): [True: 5.61k, False: 3]
  |  |  |  |  |  |  |  |  |  |  |  Branch (2232:41): [True: 5.61k, False: 7]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (2234:34): [True: 5.60k, False: 2]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (2236:38): [True: 5.60k, False: 5]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2238:42): [True: 5.60k, False: 1]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2240:46): [True: 5.60k, False: 2]
  |  |  ------------------
  ------------------
 5332|  5.60k|#ifdef LIBXML_VALID_ENABLED
 5333|  5.60k|	int oldInputNr = ctxt->inputNr;
 5334|  5.60k|#endif
 5335|       |
 5336|  5.60k|	SKIP(8);
  ------------------
  |  | 2248|  5.60k|#define SKIP(val) do {							\
  |  | 2249|  5.60k|    ctxt->input->cur += (val),ctxt->input->col+=(val);			\
  |  | 2250|  5.60k|    if (*ctxt->input->cur == 0)						\
  |  |  ------------------
  |  |  |  Branch (2250:9): [True: 74, False: 5.52k]
  |  |  ------------------
  |  | 2251|  5.60k|        xmlParserGrow(ctxt);						\
  |  | 2252|  5.60k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2252:12): [Folded, False: 5.60k]
  |  |  ------------------
  ------------------
 5337|  5.60k|	if (SKIP_BLANKS_PE == 0) {
  ------------------
  |  | 2277|  5.60k|#define SKIP_BLANKS_PE xmlSkipBlankCharsPE(ctxt)
  ------------------
  |  Branch (5337:6): [True: 706, False: 4.89k]
  ------------------
 5338|    706|	    xmlFatalErrMsg(ctxt, XML_ERR_SPACE_REQUIRED,
 5339|    706|			   "Space required after '<!NOTATION'\n");
 5340|    706|	    return;
 5341|    706|	}
 5342|       |
 5343|  4.89k|        name = xmlParseName(ctxt);
 5344|  4.89k|	if (name == NULL) {
  ------------------
  |  Branch (5344:6): [True: 353, False: 4.54k]
  ------------------
 5345|    353|	    xmlFatalErr(ctxt, XML_ERR_NOTATION_NOT_STARTED, NULL);
 5346|    353|	    return;
 5347|    353|	}
 5348|  4.54k|	if (xmlStrchr(name, ':') != NULL) {
  ------------------
  |  Branch (5348:6): [True: 279, False: 4.26k]
  ------------------
 5349|    279|	    xmlNsErr(ctxt, XML_NS_ERR_COLON,
 5350|    279|		     "colons are forbidden from notation names '%s'\n",
 5351|    279|		     name, NULL, NULL);
 5352|    279|	}
 5353|  4.54k|	if (SKIP_BLANKS_PE == 0) {
  ------------------
  |  | 2277|  4.54k|#define SKIP_BLANKS_PE xmlSkipBlankCharsPE(ctxt)
  ------------------
  |  Branch (5353:6): [True: 304, False: 4.23k]
  ------------------
 5354|    304|	    xmlFatalErrMsg(ctxt, XML_ERR_SPACE_REQUIRED,
 5355|    304|		     "Space required after the NOTATION name'\n");
 5356|    304|	    return;
 5357|    304|	}
 5358|       |
 5359|       |	/*
 5360|       |	 * Parse the IDs.
 5361|       |	 */
 5362|  4.23k|	Systemid = xmlParseExternalID(ctxt, &Pubid, 0);
 5363|  4.23k|	SKIP_BLANKS_PE;
  ------------------
  |  | 2277|  4.23k|#define SKIP_BLANKS_PE xmlSkipBlankCharsPE(ctxt)
  ------------------
 5364|       |
 5365|  4.23k|	if (RAW == '>') {
  ------------------
  |  | 2224|  4.23k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (5365:6): [True: 3.40k, False: 834]
  ------------------
 5366|  3.40k|#ifdef LIBXML_VALID_ENABLED
 5367|  3.40k|	    if ((ctxt->validate) && (ctxt->inputNr > oldInputNr)) {
  ------------------
  |  Branch (5367:10): [True: 1.98k, False: 1.41k]
  |  Branch (5367:30): [True: 10, False: 1.97k]
  ------------------
 5368|     10|		xmlValidityError(ctxt, XML_ERR_ENTITY_BOUNDARY,
 5369|     10|	                         "Notation declaration doesn't start and stop"
 5370|     10|                                 " in the same entity\n",
 5371|     10|                                 NULL, NULL);
 5372|     10|	    }
 5373|  3.40k|#endif
 5374|  3.40k|	    NEXT;
  ------------------
  |  | 2279|  3.40k|#define NEXT xmlNextChar(ctxt)
  ------------------
 5375|  3.40k|	    if ((ctxt->sax != NULL) && (!ctxt->disableSAX) &&
  ------------------
  |  Branch (5375:10): [True: 3.40k, False: 0]
  |  Branch (5375:33): [True: 2.29k, False: 1.11k]
  ------------------
 5376|  2.29k|		(ctxt->sax->notationDecl != NULL))
  ------------------
  |  Branch (5376:3): [True: 2.29k, False: 0]
  ------------------
 5377|  2.29k|		ctxt->sax->notationDecl(ctxt->userData, name, Pubid, Systemid);
 5378|  3.40k|	} else {
 5379|    834|	    xmlFatalErr(ctxt, XML_ERR_NOTATION_NOT_FINISHED, NULL);
 5380|    834|	}
 5381|  4.23k|	if (Systemid != NULL) xmlFree(Systemid);
  ------------------
  |  Branch (5381:6): [True: 2.04k, False: 2.19k]
  ------------------
 5382|  4.23k|	if (Pubid != NULL) xmlFree(Pubid);
  ------------------
  |  Branch (5382:6): [True: 1.71k, False: 2.51k]
  ------------------
 5383|  4.23k|    }
 5384|  5.63k|}
xmlParseEntityDecl:
 5410|   161k|xmlParseEntityDecl(xmlParserCtxt *ctxt) {
 5411|   161k|    const xmlChar *name = NULL;
 5412|   161k|    xmlChar *value = NULL;
 5413|   161k|    xmlChar *URI = NULL, *literal = NULL;
 5414|   161k|    const xmlChar *ndata = NULL;
 5415|   161k|    int isParameter = 0;
 5416|   161k|    xmlChar *orig = NULL;
 5417|       |
 5418|   161k|    if ((CUR != '<') || (NXT(1) != '!'))
  ------------------
  |  | 2225|   161k|#define CUR (*ctxt->input->cur)
  ------------------
                  if ((CUR != '<') || (NXT(1) != '!'))
  ------------------
  |  | 2226|   161k|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
  |  Branch (5418:9): [True: 0, False: 161k]
  |  Branch (5418:25): [True: 0, False: 161k]
  ------------------
 5419|      0|        return;
 5420|   161k|    SKIP(2);
  ------------------
  |  | 2248|   161k|#define SKIP(val) do {							\
  |  | 2249|   161k|    ctxt->input->cur += (val),ctxt->input->col+=(val);			\
  |  | 2250|   161k|    if (*ctxt->input->cur == 0)						\
  |  |  ------------------
  |  |  |  Branch (2250:9): [True: 0, False: 161k]
  |  |  ------------------
  |  | 2251|   161k|        xmlParserGrow(ctxt);						\
  |  | 2252|   161k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2252:12): [Folded, False: 161k]
  |  |  ------------------
  ------------------
 5421|       |
 5422|       |    /* GROW; done in the caller */
 5423|   161k|    if (CMP6(CUR_PTR, 'E', 'N', 'T', 'I', 'T', 'Y')) {
  ------------------
  |  | 2236|   161k|  ( CMP5( s, c1, c2, c3, c4, c5 ) && ((unsigned char *) s)[ 5 ] == c6 )
  |  |  ------------------
  |  |  |  | 2234|   323k|  ( CMP4( s, c1, c2, c3, c4 ) && ((unsigned char *) s)[ 4 ] == c5 )
  |  |  |  |  ------------------
  |  |  |  |  |  | 2231|   323k|  ( ((unsigned char *) s)[ 0 ] == c1 && ((unsigned char *) s)[ 1 ] == c2 && \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (2231:5): [True: 161k, False: 0]
  |  |  |  |  |  |  |  Branch (2231:41): [True: 161k, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 2232|   161k|    ((unsigned char *) s)[ 2 ] == c3 && ((unsigned char *) s)[ 3 ] == c4 )
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (2232:5): [True: 161k, False: 22]
  |  |  |  |  |  |  |  Branch (2232:41): [True: 161k, False: 15]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2234:34): [True: 161k, False: 6]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2236:38): [True: 161k, False: 6]
  |  |  ------------------
  ------------------
 5424|   161k|#ifdef LIBXML_VALID_ENABLED
 5425|   161k|	int oldInputNr = ctxt->inputNr;
 5426|   161k|#endif
 5427|       |
 5428|   161k|	SKIP(6);
  ------------------
  |  | 2248|   161k|#define SKIP(val) do {							\
  |  | 2249|   161k|    ctxt->input->cur += (val),ctxt->input->col+=(val);			\
  |  | 2250|   161k|    if (*ctxt->input->cur == 0)						\
  |  |  ------------------
  |  |  |  Branch (2250:9): [True: 205, False: 161k]
  |  |  ------------------
  |  | 2251|   161k|        xmlParserGrow(ctxt);						\
  |  | 2252|   161k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2252:12): [Folded, False: 161k]
  |  |  ------------------
  ------------------
 5429|   161k|	if (SKIP_BLANKS_PE == 0) {
  ------------------
  |  | 2277|   161k|#define SKIP_BLANKS_PE xmlSkipBlankCharsPE(ctxt)
  ------------------
  |  Branch (5429:6): [True: 2.94k, False: 159k]
  ------------------
 5430|  2.94k|	    xmlFatalErrMsg(ctxt, XML_ERR_SPACE_REQUIRED,
 5431|  2.94k|			   "Space required after '<!ENTITY'\n");
 5432|  2.94k|	}
 5433|       |
 5434|   161k|	if (RAW == '%') {
  ------------------
  |  | 2224|   161k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (5434:6): [True: 64.6k, False: 97.2k]
  ------------------
 5435|  64.6k|	    NEXT;
  ------------------
  |  | 2279|  64.6k|#define NEXT xmlNextChar(ctxt)
  ------------------
 5436|  64.6k|	    if (SKIP_BLANKS_PE == 0) {
  ------------------
  |  | 2277|  64.6k|#define SKIP_BLANKS_PE xmlSkipBlankCharsPE(ctxt)
  ------------------
  |  Branch (5436:10): [True: 702, False: 63.9k]
  ------------------
 5437|    702|		xmlFatalErrMsg(ctxt, XML_ERR_SPACE_REQUIRED,
 5438|    702|			       "Space required after '%%'\n");
 5439|    702|	    }
 5440|  64.6k|	    isParameter = 1;
 5441|  64.6k|	}
 5442|       |
 5443|   161k|        name = xmlParseName(ctxt);
 5444|   161k|	if (name == NULL) {
  ------------------
  |  Branch (5444:6): [True: 28.2k, False: 133k]
  ------------------
 5445|  28.2k|	    xmlFatalErrMsg(ctxt, XML_ERR_NAME_REQUIRED,
 5446|  28.2k|	                   "xmlParseEntityDecl: no name\n");
 5447|  28.2k|            return;
 5448|  28.2k|	}
 5449|   133k|	if (xmlStrchr(name, ':') != NULL) {
  ------------------
  |  Branch (5449:6): [True: 1.68k, False: 131k]
  ------------------
 5450|  1.68k|	    xmlNsErr(ctxt, XML_NS_ERR_COLON,
 5451|  1.68k|		     "colons are forbidden from entities names '%s'\n",
 5452|  1.68k|		     name, NULL, NULL);
 5453|  1.68k|	}
 5454|   133k|	if (SKIP_BLANKS_PE == 0) {
  ------------------
  |  | 2277|   133k|#define SKIP_BLANKS_PE xmlSkipBlankCharsPE(ctxt)
  ------------------
  |  Branch (5454:6): [True: 3.35k, False: 130k]
  ------------------
 5455|  3.35k|	    xmlFatalErrMsg(ctxt, XML_ERR_SPACE_REQUIRED,
 5456|  3.35k|			   "Space required after the entity name\n");
 5457|  3.35k|	}
 5458|       |
 5459|       |	/*
 5460|       |	 * handle the various case of definitions...
 5461|       |	 */
 5462|   133k|	if (isParameter) {
  ------------------
  |  Branch (5462:6): [True: 63.7k, False: 69.8k]
  ------------------
 5463|  63.7k|	    if ((RAW == '"') || (RAW == '\'')) {
  ------------------
  |  | 2224|  63.7k|#define RAW (*ctxt->input->cur)
  ------------------
              	    if ((RAW == '"') || (RAW == '\'')) {
  ------------------
  |  | 2224|  9.35k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (5463:10): [True: 54.3k, False: 9.35k]
  |  Branch (5463:26): [True: 1.63k, False: 7.72k]
  ------------------
 5464|  56.0k|	        value = xmlParseEntityValue(ctxt, &orig);
 5465|  56.0k|		if (value) {
  ------------------
  |  Branch (5465:7): [True: 54.6k, False: 1.40k]
  ------------------
 5466|  54.6k|		    if ((ctxt->sax != NULL) &&
  ------------------
  |  Branch (5466:11): [True: 54.6k, False: 0]
  ------------------
 5467|  54.6k|			(!ctxt->disableSAX) && (ctxt->sax->entityDecl != NULL))
  ------------------
  |  Branch (5467:4): [True: 51.6k, False: 2.96k]
  |  Branch (5467:27): [True: 51.6k, False: 0]
  ------------------
 5468|  51.6k|			ctxt->sax->entityDecl(ctxt->userData, name,
 5469|  51.6k|		                    XML_INTERNAL_PARAMETER_ENTITY,
 5470|  51.6k|				    NULL, NULL, value);
 5471|  54.6k|		}
 5472|  56.0k|	    } else {
 5473|  7.72k|	        URI = xmlParseExternalID(ctxt, &literal, 1);
 5474|  7.72k|		if ((URI == NULL) && (literal == NULL)) {
  ------------------
  |  Branch (5474:7): [True: 792, False: 6.93k]
  |  Branch (5474:24): [True: 693, False: 99]
  ------------------
 5475|    693|		    xmlFatalErr(ctxt, XML_ERR_VALUE_REQUIRED, NULL);
 5476|    693|		}
 5477|  7.72k|		if (URI) {
  ------------------
  |  Branch (5477:7): [True: 6.93k, False: 792]
  ------------------
 5478|  6.93k|                    if (xmlStrchr(URI, '#')) {
  ------------------
  |  Branch (5478:25): [True: 348, False: 6.58k]
  ------------------
 5479|    348|                        xmlFatalErr(ctxt, XML_ERR_URI_FRAGMENT, NULL);
 5480|  6.58k|                    } else {
 5481|  6.58k|                        if ((ctxt->sax != NULL) &&
  ------------------
  |  Branch (5481:29): [True: 6.58k, False: 0]
  ------------------
 5482|  6.58k|                            (!ctxt->disableSAX) &&
  ------------------
  |  Branch (5482:29): [True: 6.29k, False: 283]
  ------------------
 5483|  6.29k|                            (ctxt->sax->entityDecl != NULL))
  ------------------
  |  Branch (5483:29): [True: 6.29k, False: 0]
  ------------------
 5484|  6.29k|                            ctxt->sax->entityDecl(ctxt->userData, name,
 5485|  6.29k|                                        XML_EXTERNAL_PARAMETER_ENTITY,
 5486|  6.29k|                                        literal, URI, NULL);
 5487|  6.58k|                    }
 5488|  6.93k|		}
 5489|  7.72k|	    }
 5490|  69.8k|	} else {
 5491|  69.8k|	    if ((RAW == '"') || (RAW == '\'')) {
  ------------------
  |  | 2224|  69.8k|#define RAW (*ctxt->input->cur)
  ------------------
              	    if ((RAW == '"') || (RAW == '\'')) {
  ------------------
  |  | 2224|  20.1k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (5491:10): [True: 49.7k, False: 20.1k]
  |  Branch (5491:26): [True: 6.20k, False: 13.9k]
  ------------------
 5492|  55.9k|	        value = xmlParseEntityValue(ctxt, &orig);
 5493|  55.9k|		if ((ctxt->sax != NULL) &&
  ------------------
  |  Branch (5493:7): [True: 55.9k, False: 0]
  ------------------
 5494|  55.9k|		    (!ctxt->disableSAX) && (ctxt->sax->entityDecl != NULL))
  ------------------
  |  Branch (5494:7): [True: 53.7k, False: 2.17k]
  |  Branch (5494:30): [True: 53.7k, False: 0]
  ------------------
 5495|  53.7k|		    ctxt->sax->entityDecl(ctxt->userData, name,
 5496|  53.7k|				XML_INTERNAL_GENERAL_ENTITY,
 5497|  53.7k|				NULL, NULL, value);
 5498|       |		/*
 5499|       |		 * For expat compatibility in SAX mode.
 5500|       |		 */
 5501|  55.9k|		if ((ctxt->myDoc == NULL) ||
  ------------------
  |  Branch (5501:7): [True: 13, False: 55.9k]
  ------------------
 5502|  55.9k|		    (xmlStrEqual(ctxt->myDoc->version, SAX_COMPAT_MODE))) {
  ------------------
  |  |  173|  55.9k|#define SAX_COMPAT_MODE BAD_CAST "SAX compatibility mode document"
  |  |  ------------------
  |  |  |  |   34|  55.9k|#define BAD_CAST (xmlChar *)
  |  |  ------------------
  ------------------
  |  Branch (5502:7): [True: 70, False: 55.8k]
  ------------------
 5503|     83|		    if (ctxt->myDoc == NULL) {
  ------------------
  |  Branch (5503:11): [True: 13, False: 70]
  ------------------
 5504|     13|			ctxt->myDoc = xmlNewDoc(SAX_COMPAT_MODE);
  ------------------
  |  |  173|     13|#define SAX_COMPAT_MODE BAD_CAST "SAX compatibility mode document"
  |  |  ------------------
  |  |  |  |   34|     13|#define BAD_CAST (xmlChar *)
  |  |  ------------------
  ------------------
 5505|     13|			if (ctxt->myDoc == NULL) {
  ------------------
  |  Branch (5505:8): [True: 1, False: 12]
  ------------------
 5506|      1|			    xmlErrMemory(ctxt);
 5507|      1|			    goto done;
 5508|      1|			}
 5509|     12|			ctxt->myDoc->properties = XML_DOC_INTERNAL;
 5510|     12|		    }
 5511|     82|		    if (ctxt->myDoc->intSubset == NULL) {
  ------------------
  |  Branch (5511:11): [True: 12, False: 70]
  ------------------
 5512|     12|			ctxt->myDoc->intSubset = xmlNewDtd(ctxt->myDoc,
 5513|     12|					    BAD_CAST "fake", NULL, NULL);
  ------------------
  |  |   34|     12|#define BAD_CAST (xmlChar *)
  ------------------
 5514|     12|                        if (ctxt->myDoc->intSubset == NULL) {
  ------------------
  |  Branch (5514:29): [True: 1, False: 11]
  ------------------
 5515|      1|                            xmlErrMemory(ctxt);
 5516|      1|                            goto done;
 5517|      1|                        }
 5518|     12|                    }
 5519|       |
 5520|     81|		    xmlSAX2EntityDecl(ctxt, name, XML_INTERNAL_GENERAL_ENTITY,
 5521|     81|			              NULL, NULL, value);
 5522|     81|		}
 5523|  55.9k|	    } else {
 5524|  13.9k|	        URI = xmlParseExternalID(ctxt, &literal, 1);
 5525|  13.9k|		if ((URI == NULL) && (literal == NULL)) {
  ------------------
  |  Branch (5525:7): [True: 6.11k, False: 7.82k]
  |  Branch (5525:24): [True: 5.65k, False: 455]
  ------------------
 5526|  5.65k|		    xmlFatalErr(ctxt, XML_ERR_VALUE_REQUIRED, NULL);
 5527|  5.65k|		}
 5528|  13.9k|		if (URI) {
  ------------------
  |  Branch (5528:7): [True: 7.82k, False: 6.11k]
  ------------------
 5529|  7.82k|                    if (xmlStrchr(URI, '#')) {
  ------------------
  |  Branch (5529:25): [True: 162, False: 7.66k]
  ------------------
 5530|    162|                        xmlFatalErr(ctxt, XML_ERR_URI_FRAGMENT, NULL);
 5531|    162|                    }
 5532|  7.82k|		}
 5533|  13.9k|		if ((RAW != '>') && (SKIP_BLANKS_PE == 0)) {
  ------------------
  |  | 2224|  13.9k|#define RAW (*ctxt->input->cur)
  ------------------
              		if ((RAW != '>') && (SKIP_BLANKS_PE == 0)) {
  ------------------
  |  | 2277|  8.12k|#define SKIP_BLANKS_PE xmlSkipBlankCharsPE(ctxt)
  ------------------
  |  Branch (5533:7): [True: 8.12k, False: 5.80k]
  |  Branch (5533:23): [True: 5.42k, False: 2.70k]
  ------------------
 5534|  5.42k|		    xmlFatalErrMsg(ctxt, XML_ERR_SPACE_REQUIRED,
 5535|  5.42k|				   "Space required before 'NDATA'\n");
 5536|  5.42k|		}
 5537|  13.9k|		if (CMP5(CUR_PTR, 'N', 'D', 'A', 'T', 'A')) {
  ------------------
  |  | 2234|  13.9k|  ( CMP4( s, c1, c2, c3, c4 ) && ((unsigned char *) s)[ 4 ] == c5 )
  |  |  ------------------
  |  |  |  | 2231|  27.8k|  ( ((unsigned char *) s)[ 0 ] == c1 && ((unsigned char *) s)[ 1 ] == c2 && \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2231:5): [True: 974, False: 12.9k]
  |  |  |  |  |  Branch (2231:41): [True: 970, False: 4]
  |  |  |  |  ------------------
  |  |  |  | 2232|  13.9k|    ((unsigned char *) s)[ 2 ] == c3 && ((unsigned char *) s)[ 3 ] == c4 )
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2232:5): [True: 968, False: 2]
  |  |  |  |  |  Branch (2232:41): [True: 967, False: 1]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2234:34): [True: 966, False: 1]
  |  |  ------------------
  ------------------
 5538|    966|		    SKIP(5);
  ------------------
  |  | 2248|    966|#define SKIP(val) do {							\
  |  | 2249|    966|    ctxt->input->cur += (val),ctxt->input->col+=(val);			\
  |  | 2250|    966|    if (*ctxt->input->cur == 0)						\
  |  |  ------------------
  |  |  |  Branch (2250:9): [True: 73, False: 893]
  |  |  ------------------
  |  | 2251|    966|        xmlParserGrow(ctxt);						\
  |  | 2252|    966|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2252:12): [Folded, False: 966]
  |  |  ------------------
  ------------------
 5539|    966|		    if (SKIP_BLANKS_PE == 0) {
  ------------------
  |  | 2277|    966|#define SKIP_BLANKS_PE xmlSkipBlankCharsPE(ctxt)
  ------------------
  |  Branch (5539:11): [True: 248, False: 718]
  ------------------
 5540|    248|			xmlFatalErrMsg(ctxt, XML_ERR_SPACE_REQUIRED,
 5541|    248|				       "Space required after 'NDATA'\n");
 5542|    248|		    }
 5543|    966|		    ndata = xmlParseName(ctxt);
 5544|    966|		    if ((ctxt->sax != NULL) && (!ctxt->disableSAX) &&
  ------------------
  |  Branch (5544:11): [True: 966, False: 0]
  |  Branch (5544:34): [True: 649, False: 317]
  ------------------
 5545|    649|		        (ctxt->sax->unparsedEntityDecl != NULL))
  ------------------
  |  Branch (5545:11): [True: 649, False: 0]
  ------------------
 5546|    649|			ctxt->sax->unparsedEntityDecl(ctxt->userData, name,
 5547|    649|				    literal, URI, ndata);
 5548|  12.9k|		} else {
 5549|  12.9k|		    if ((ctxt->sax != NULL) &&
  ------------------
  |  Branch (5549:11): [True: 12.9k, False: 0]
  ------------------
 5550|  12.9k|		        (!ctxt->disableSAX) && (ctxt->sax->entityDecl != NULL))
  ------------------
  |  Branch (5550:11): [True: 11.6k, False: 1.32k]
  |  Branch (5550:34): [True: 11.6k, False: 0]
  ------------------
 5551|  11.6k|			ctxt->sax->entityDecl(ctxt->userData, name,
 5552|  11.6k|				    XML_EXTERNAL_GENERAL_PARSED_ENTITY,
 5553|  11.6k|				    literal, URI, NULL);
 5554|       |		    /*
 5555|       |		     * For expat compatibility in SAX mode.
 5556|       |		     * assuming the entity replacement was asked for
 5557|       |		     */
 5558|  12.9k|		    if ((ctxt->replaceEntities != 0) &&
  ------------------
  |  Branch (5558:11): [True: 4.73k, False: 8.23k]
  ------------------
 5559|  4.73k|			((ctxt->myDoc == NULL) ||
  ------------------
  |  Branch (5559:5): [True: 9, False: 4.72k]
  ------------------
 5560|  4.72k|			(xmlStrEqual(ctxt->myDoc->version, SAX_COMPAT_MODE)))) {
  ------------------
  |  |  173|  4.72k|#define SAX_COMPAT_MODE BAD_CAST "SAX compatibility mode document"
  |  |  ------------------
  |  |  |  |   34|  4.72k|#define BAD_CAST (xmlChar *)
  |  |  ------------------
  ------------------
  |  Branch (5560:4): [True: 214, False: 4.50k]
  ------------------
 5561|    223|			if (ctxt->myDoc == NULL) {
  ------------------
  |  Branch (5561:8): [True: 9, False: 214]
  ------------------
 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|    222|			if (ctxt->myDoc->intSubset == NULL) {
  ------------------
  |  Branch (5570:8): [True: 8, False: 214]
  ------------------
 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: 1, False: 7]
  ------------------
 5574|      1|                                xmlErrMemory(ctxt);
 5575|      1|                                goto done;
 5576|      1|                            }
 5577|      8|                        }
 5578|    221|			xmlSAX2EntityDecl(ctxt, name,
 5579|    221|				          XML_EXTERNAL_GENERAL_PARSED_ENTITY,
 5580|    221|				          literal, URI, NULL);
 5581|    221|		    }
 5582|  12.9k|		}
 5583|  13.9k|	    }
 5584|  69.8k|	}
 5585|   133k|	SKIP_BLANKS_PE;
  ------------------
  |  | 2277|   133k|#define SKIP_BLANKS_PE xmlSkipBlankCharsPE(ctxt)
  ------------------
 5586|   133k|	if (RAW != '>') {
  ------------------
  |  | 2224|   133k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (5586:6): [True: 12.3k, False: 121k]
  ------------------
 5587|  12.3k|	    xmlFatalErrMsgStr(ctxt, XML_ERR_ENTITY_NOT_FINISHED,
 5588|  12.3k|	            "xmlParseEntityDecl: entity %s not terminated\n", name);
 5589|   121k|	} else {
 5590|   121k|#ifdef LIBXML_VALID_ENABLED
 5591|   121k|	    if ((ctxt->validate) && (ctxt->inputNr > oldInputNr)) {
  ------------------
  |  Branch (5591:10): [True: 88.0k, False: 33.2k]
  |  Branch (5591:30): [True: 21, False: 88.0k]
  ------------------
 5592|     21|		xmlValidityError(ctxt, XML_ERR_ENTITY_BOUNDARY,
 5593|     21|	                         "Entity declaration doesn't start and stop in"
 5594|     21|                                 " the same entity\n",
 5595|     21|                                 NULL, NULL);
 5596|     21|	    }
 5597|   121k|#endif
 5598|   121k|	    NEXT;
  ------------------
  |  | 2279|   121k|#define NEXT xmlNextChar(ctxt)
  ------------------
 5599|   121k|	}
 5600|   133k|	if (orig != NULL) {
  ------------------
  |  Branch (5600:6): [True: 108k, False: 24.8k]
  ------------------
 5601|       |	    /*
 5602|       |	     * Ugly mechanism to save the raw entity value.
 5603|       |	     */
 5604|   108k|	    xmlEntityPtr cur = NULL;
 5605|       |
 5606|   108k|	    if (isParameter) {
  ------------------
  |  Branch (5606:10): [True: 54.6k, False: 54.1k]
  ------------------
 5607|  54.6k|	        if ((ctxt->sax != NULL) &&
  ------------------
  |  Branch (5607:14): [True: 54.6k, False: 0]
  ------------------
 5608|  54.6k|		    (ctxt->sax->getParameterEntity != NULL))
  ------------------
  |  Branch (5608:7): [True: 54.6k, False: 0]
  ------------------
 5609|  54.6k|		    cur = ctxt->sax->getParameterEntity(ctxt->userData, name);
 5610|  54.6k|	    } else {
 5611|  54.1k|	        if ((ctxt->sax != NULL) &&
  ------------------
  |  Branch (5611:14): [True: 54.1k, False: 0]
  ------------------
 5612|  54.1k|		    (ctxt->sax->getEntity != NULL))
  ------------------
  |  Branch (5612:7): [True: 54.1k, False: 0]
  ------------------
 5613|  54.1k|		    cur = ctxt->sax->getEntity(ctxt->userData, name);
 5614|  54.1k|		if ((cur == NULL) && (ctxt->userData==ctxt)) {
  ------------------
  |  Branch (5614:7): [True: 1.80k, False: 52.3k]
  |  Branch (5614:24): [True: 1.80k, False: 0]
  ------------------
 5615|  1.80k|		    cur = xmlSAX2GetEntity(ctxt, name);
 5616|  1.80k|		}
 5617|  54.1k|	    }
 5618|   108k|            if ((cur != NULL) && (cur->orig == NULL)) {
  ------------------
  |  Branch (5618:17): [True: 104k, False: 4.16k]
  |  Branch (5618:34): [True: 12.5k, False: 92.0k]
  ------------------
 5619|  12.5k|		cur->orig = orig;
 5620|  12.5k|                orig = NULL;
 5621|  12.5k|	    }
 5622|   108k|	}
 5623|       |
 5624|   133k|done:
 5625|   133k|	if (value != NULL) xmlFree(value);
  ------------------
  |  Branch (5625:6): [True: 108k, False: 24.8k]
  ------------------
 5626|   133k|	if (URI != NULL) xmlFree(URI);
  ------------------
  |  Branch (5626:6): [True: 14.7k, False: 118k]
  ------------------
 5627|   133k|	if (literal != NULL) xmlFree(literal);
  ------------------
  |  Branch (5627:6): [True: 5.27k, False: 128k]
  ------------------
 5628|   133k|        if (orig != NULL) xmlFree(orig);
  ------------------
  |  Branch (5628:13): [True: 96.2k, False: 37.3k]
  ------------------
 5629|   133k|    }
 5630|   161k|}
xmlParseDefaultDecl:
 5662|   100k|xmlParseDefaultDecl(xmlParserCtxt *ctxt, xmlChar **value) {
 5663|   100k|    int val;
 5664|   100k|    xmlChar *ret;
 5665|       |
 5666|   100k|    *value = NULL;
 5667|   100k|    if (CMP9(CUR_PTR, '#', 'R', 'E', 'Q', 'U', 'I', 'R', 'E', 'D')) {
  ------------------
  |  | 2242|   100k|  ( CMP8( s, c1, c2, c3, c4, c5, c6, c7, c8 ) && \
  |  |  ------------------
  |  |  |  | 2240|   201k|  ( CMP7( s, c1, c2, c3, c4, c5, c6, c7 ) && ((unsigned char *) s)[ 7 ] == c8 )
  |  |  |  |  ------------------
  |  |  |  |  |  | 2238|   201k|  ( CMP6( s, c1, c2, c3, c4, c5, c6 ) && ((unsigned char *) s)[ 6 ] == c7 )
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  | 2236|   201k|  ( CMP5( s, c1, c2, c3, c4, c5 ) && ((unsigned char *) s)[ 5 ] == c6 )
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  | 2234|   201k|  ( CMP4( s, c1, c2, c3, c4 ) && ((unsigned char *) s)[ 4 ] == c5 )
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  | 2231|   201k|  ( ((unsigned char *) s)[ 0 ] == c1 && ((unsigned char *) s)[ 1 ] == c2 && \
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  Branch (2231:5): [True: 38.4k, False: 62.3k]
  |  |  |  |  |  |  |  |  |  |  |  |  |  Branch (2231:41): [True: 7.98k, False: 30.4k]
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  | 2232|   100k|    ((unsigned char *) s)[ 2 ] == c3 && ((unsigned char *) s)[ 3 ] == c4 )
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  Branch (2232:5): [True: 7.98k, False: 1]
  |  |  |  |  |  |  |  |  |  |  |  |  |  Branch (2232:41): [True: 7.97k, False: 4]
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (2234:34): [True: 7.97k, False: 7]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (2236:38): [True: 7.97k, False: 1]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (2238:42): [True: 7.96k, False: 2]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2240:46): [True: 7.96k, False: 4]
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 2243|   100k|    ((unsigned char *) s)[ 8 ] == c9 )
  |  |  ------------------
  |  |  |  Branch (2243:5): [True: 7.96k, False: 1]
  |  |  ------------------
  ------------------
 5668|  7.96k|	SKIP(9);
  ------------------
  |  | 2248|  7.96k|#define SKIP(val) do {							\
  |  | 2249|  7.96k|    ctxt->input->cur += (val),ctxt->input->col+=(val);			\
  |  | 2250|  7.96k|    if (*ctxt->input->cur == 0)						\
  |  |  ------------------
  |  |  |  Branch (2250:9): [True: 46, False: 7.91k]
  |  |  ------------------
  |  | 2251|  7.96k|        xmlParserGrow(ctxt);						\
  |  | 2252|  7.96k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2252:12): [Folded, False: 7.96k]
  |  |  ------------------
  ------------------
 5669|  7.96k|	return(XML_ATTRIBUTE_REQUIRED);
 5670|  7.96k|    }
 5671|  92.7k|    if (CMP8(CUR_PTR, '#', 'I', 'M', 'P', 'L', 'I', 'E', 'D')) {
  ------------------
  |  | 2240|  92.7k|  ( CMP7( s, c1, c2, c3, c4, c5, c6, c7 ) && ((unsigned char *) s)[ 7 ] == c8 )
  |  |  ------------------
  |  |  |  | 2238|   185k|  ( CMP6( s, c1, c2, c3, c4, c5, c6 ) && ((unsigned char *) s)[ 6 ] == c7 )
  |  |  |  |  ------------------
  |  |  |  |  |  | 2236|   185k|  ( CMP5( s, c1, c2, c3, c4, c5 ) && ((unsigned char *) s)[ 5 ] == c6 )
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  | 2234|   185k|  ( CMP4( s, c1, c2, c3, c4 ) && ((unsigned char *) s)[ 4 ] == c5 )
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  | 2231|   185k|  ( ((unsigned char *) s)[ 0 ] == c1 && ((unsigned char *) s)[ 1 ] == c2 && \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (2231:5): [True: 30.4k, False: 62.3k]
  |  |  |  |  |  |  |  |  |  |  |  Branch (2231:41): [True: 21.4k, False: 9.04k]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  | 2232|  92.7k|    ((unsigned char *) s)[ 2 ] == c3 && ((unsigned char *) s)[ 3 ] == c4 )
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (2232:5): [True: 21.3k, False: 8]
  |  |  |  |  |  |  |  |  |  |  |  Branch (2232:41): [True: 21.3k, False: 4]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (2234:34): [True: 21.3k, False: 2]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (2236:38): [True: 21.3k, False: 2]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2238:42): [True: 21.3k, False: 1]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2240:46): [True: 21.3k, False: 1]
  |  |  ------------------
  ------------------
 5672|  21.3k|	SKIP(8);
  ------------------
  |  | 2248|  21.3k|#define SKIP(val) do {							\
  |  | 2249|  21.3k|    ctxt->input->cur += (val),ctxt->input->col+=(val);			\
  |  | 2250|  21.3k|    if (*ctxt->input->cur == 0)						\
  |  |  ------------------
  |  |  |  Branch (2250:9): [True: 667, False: 20.7k]
  |  |  ------------------
  |  | 2251|  21.3k|        xmlParserGrow(ctxt);						\
  |  | 2252|  21.3k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2252:12): [Folded, False: 21.3k]
  |  |  ------------------
  ------------------
 5673|  21.3k|	return(XML_ATTRIBUTE_IMPLIED);
 5674|  21.3k|    }
 5675|  71.3k|    val = XML_ATTRIBUTE_NONE;
 5676|  71.3k|    if (CMP6(CUR_PTR, '#', 'F', 'I', 'X', 'E', 'D')) {
  ------------------
  |  | 2236|  71.3k|  ( CMP5( s, c1, c2, c3, c4, c5 ) && ((unsigned char *) s)[ 5 ] == c6 )
  |  |  ------------------
  |  |  |  | 2234|   142k|  ( CMP4( s, c1, c2, c3, c4 ) && ((unsigned char *) s)[ 4 ] == c5 )
  |  |  |  |  ------------------
  |  |  |  |  |  | 2231|   142k|  ( ((unsigned char *) s)[ 0 ] == c1 && ((unsigned char *) s)[ 1 ] == c2 && \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (2231:5): [True: 9.05k, False: 62.3k]
  |  |  |  |  |  |  |  Branch (2231:41): [True: 9.00k, False: 52]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 2232|  71.3k|    ((unsigned char *) s)[ 2 ] == c3 && ((unsigned char *) s)[ 3 ] == c4 )
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (2232:5): [True: 9.00k, False: 2]
  |  |  |  |  |  |  |  Branch (2232:41): [True: 8.99k, False: 8]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2234:34): [True: 8.99k, False: 1]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2236:38): [True: 8.99k, False: 3]
  |  |  ------------------
  ------------------
 5677|  8.99k|	SKIP(6);
  ------------------
  |  | 2248|  8.99k|#define SKIP(val) do {							\
  |  | 2249|  8.99k|    ctxt->input->cur += (val),ctxt->input->col+=(val);			\
  |  | 2250|  8.99k|    if (*ctxt->input->cur == 0)						\
  |  |  ------------------
  |  |  |  Branch (2250:9): [True: 76, False: 8.91k]
  |  |  ------------------
  |  | 2251|  8.99k|        xmlParserGrow(ctxt);						\
  |  | 2252|  8.99k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2252:12): [Folded, False: 8.99k]
  |  |  ------------------
  ------------------
 5678|  8.99k|	val = XML_ATTRIBUTE_FIXED;
 5679|  8.99k|	if (SKIP_BLANKS_PE == 0) {
  ------------------
  |  | 2277|  8.99k|#define SKIP_BLANKS_PE xmlSkipBlankCharsPE(ctxt)
  ------------------
  |  Branch (5679:6): [True: 372, False: 8.62k]
  ------------------
 5680|    372|	    xmlFatalErrMsg(ctxt, XML_ERR_SPACE_REQUIRED,
 5681|    372|			   "Space required after '#FIXED'\n");
 5682|    372|	}
 5683|  8.99k|    }
 5684|  71.3k|    ret = xmlParseAttValue(ctxt);
 5685|  71.3k|    if (ret == NULL) {
  ------------------
  |  Branch (5685:9): [True: 39.3k, False: 32.0k]
  ------------------
 5686|  39.3k|	xmlFatalErrMsg(ctxt, (xmlParserErrors)ctxt->errNo,
 5687|  39.3k|		       "Attribute default value declaration error\n");
 5688|  39.3k|    } else
 5689|  32.0k|        *value = ret;
 5690|  71.3k|    return(val);
 5691|  92.7k|}
xmlParseNotationType:
 5711|  2.72k|xmlParseNotationType(xmlParserCtxt *ctxt) {
 5712|  2.72k|    const xmlChar *name;
 5713|  2.72k|    xmlEnumerationPtr ret = NULL, last = NULL, cur, tmp;
 5714|       |
 5715|  2.72k|    if (RAW != '(') {
  ------------------
  |  | 2224|  2.72k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (5715:9): [True: 340, False: 2.38k]
  ------------------
 5716|    340|	xmlFatalErr(ctxt, XML_ERR_NOTATION_NOT_STARTED, NULL);
 5717|    340|	return(NULL);
 5718|    340|    }
 5719|  3.16k|    do {
 5720|  3.16k|        NEXT;
  ------------------
  |  | 2279|  3.16k|#define NEXT xmlNextChar(ctxt)
  ------------------
 5721|  3.16k|	SKIP_BLANKS_PE;
  ------------------
  |  | 2277|  3.16k|#define SKIP_BLANKS_PE xmlSkipBlankCharsPE(ctxt)
  ------------------
 5722|  3.16k|        name = xmlParseName(ctxt);
 5723|  3.16k|	if (name == NULL) {
  ------------------
  |  Branch (5723:6): [True: 221, False: 2.93k]
  ------------------
 5724|    221|	    xmlFatalErrMsg(ctxt, XML_ERR_NAME_REQUIRED,
 5725|    221|			   "Name expected in NOTATION declaration\n");
 5726|    221|            xmlFreeEnumeration(ret);
 5727|    221|	    return(NULL);
 5728|    221|	}
 5729|  2.93k|        tmp = NULL;
 5730|  2.93k|#ifdef LIBXML_VALID_ENABLED
 5731|  2.93k|        if (ctxt->validate) {
  ------------------
  |  Branch (5731:13): [True: 1.63k, False: 1.30k]
  ------------------
 5732|  1.63k|            tmp = ret;
 5733|  4.30k|            while (tmp != NULL) {
  ------------------
  |  Branch (5733:20): [True: 2.96k, False: 1.34k]
  ------------------
 5734|  2.96k|                if (xmlStrEqual(name, tmp->name)) {
  ------------------
  |  Branch (5734:21): [True: 294, False: 2.66k]
  ------------------
 5735|    294|                    xmlValidityError(ctxt, XML_DTD_DUP_TOKEN,
 5736|    294|              "standalone: attribute notation value token %s duplicated\n",
 5737|    294|                                     name, NULL);
 5738|    294|                    if (!xmlDictOwns(ctxt->dict, name))
  ------------------
  |  Branch (5738:25): [True: 0, False: 294]
  ------------------
 5739|      0|                        xmlFree((xmlChar *) name);
 5740|    294|                    break;
 5741|    294|                }
 5742|  2.66k|                tmp = tmp->next;
 5743|  2.66k|            }
 5744|  1.63k|        }
 5745|  2.93k|#endif /* LIBXML_VALID_ENABLED */
 5746|  2.93k|	if (tmp == NULL) {
  ------------------
  |  Branch (5746:6): [True: 2.64k, False: 294]
  ------------------
 5747|  2.64k|	    cur = xmlCreateEnumeration(name);
 5748|  2.64k|	    if (cur == NULL) {
  ------------------
  |  Branch (5748:10): [True: 2, False: 2.64k]
  ------------------
 5749|      2|                xmlErrMemory(ctxt);
 5750|      2|                xmlFreeEnumeration(ret);
 5751|      2|                return(NULL);
 5752|      2|            }
 5753|  2.64k|	    if (last == NULL) ret = last = cur;
  ------------------
  |  Branch (5753:10): [True: 2.16k, False: 481]
  ------------------
 5754|    481|	    else {
 5755|    481|		last->next = cur;
 5756|    481|		last = cur;
 5757|    481|	    }
 5758|  2.64k|	}
 5759|  2.93k|	SKIP_BLANKS_PE;
  ------------------
  |  | 2277|  2.93k|#define SKIP_BLANKS_PE xmlSkipBlankCharsPE(ctxt)
  ------------------
 5760|  2.93k|    } while (RAW == '|');
  ------------------
  |  | 2224|  2.93k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (5760:14): [True: 779, False: 2.15k]
  ------------------
 5761|  2.15k|    if (RAW != ')') {
  ------------------
  |  | 2224|  2.15k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (5761:9): [True: 366, False: 1.79k]
  ------------------
 5762|    366|	xmlFatalErr(ctxt, XML_ERR_NOTATION_NOT_FINISHED, NULL);
 5763|    366|        xmlFreeEnumeration(ret);
 5764|    366|	return(NULL);
 5765|    366|    }
 5766|  1.79k|    NEXT;
  ------------------
  |  | 2279|  1.79k|#define NEXT xmlNextChar(ctxt)
  ------------------
 5767|  1.79k|    return(ret);
 5768|  2.15k|}
xmlParseEnumerationType:
 5786|  19.1k|xmlParseEnumerationType(xmlParserCtxt *ctxt) {
 5787|  19.1k|    xmlChar *name;
 5788|  19.1k|    xmlEnumerationPtr ret = NULL, last = NULL, cur, tmp;
 5789|       |
 5790|  19.1k|    if (RAW != '(') {
  ------------------
  |  | 2224|  19.1k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (5790:9): [True: 4.26k, False: 14.8k]
  ------------------
 5791|  4.26k|	xmlFatalErr(ctxt, XML_ERR_ATTLIST_NOT_STARTED, NULL);
 5792|  4.26k|	return(NULL);
 5793|  4.26k|    }
 5794|  24.0k|    do {
 5795|  24.0k|        NEXT;
  ------------------
  |  | 2279|  24.0k|#define NEXT xmlNextChar(ctxt)
  ------------------
 5796|  24.0k|	SKIP_BLANKS_PE;
  ------------------
  |  | 2277|  24.0k|#define SKIP_BLANKS_PE xmlSkipBlankCharsPE(ctxt)
  ------------------
 5797|  24.0k|        name = xmlParseNmtoken(ctxt);
 5798|  24.0k|	if (name == NULL) {
  ------------------
  |  Branch (5798:6): [True: 246, False: 23.7k]
  ------------------
 5799|    246|	    xmlFatalErr(ctxt, XML_ERR_NMTOKEN_REQUIRED, NULL);
 5800|    246|	    return(ret);
 5801|    246|	}
 5802|  23.7k|        tmp = NULL;
 5803|  23.7k|#ifdef LIBXML_VALID_ENABLED
 5804|  23.7k|        if (ctxt->validate) {
  ------------------
  |  Branch (5804:13): [True: 16.6k, False: 7.11k]
  ------------------
 5805|  16.6k|            tmp = ret;
 5806|  42.2k|            while (tmp != NULL) {
  ------------------
  |  Branch (5806:20): [True: 26.0k, False: 16.2k]
  ------------------
 5807|  26.0k|                if (xmlStrEqual(name, tmp->name)) {
  ------------------
  |  Branch (5807:21): [True: 394, False: 25.6k]
  ------------------
 5808|    394|                    xmlValidityError(ctxt, XML_DTD_DUP_TOKEN,
 5809|    394|              "standalone: attribute enumeration value token %s duplicated\n",
 5810|    394|                                     name, NULL);
 5811|    394|                    if (!xmlDictOwns(ctxt->dict, name))
  ------------------
  |  Branch (5811:25): [True: 394, False: 0]
  ------------------
 5812|    394|                        xmlFree(name);
 5813|    394|                    break;
 5814|    394|                }
 5815|  25.6k|                tmp = tmp->next;
 5816|  25.6k|            }
 5817|  16.6k|        }
 5818|  23.7k|#endif /* LIBXML_VALID_ENABLED */
 5819|  23.7k|	if (tmp == NULL) {
  ------------------
  |  Branch (5819:6): [True: 23.3k, False: 394]
  ------------------
 5820|  23.3k|	    cur = xmlCreateEnumeration(name);
 5821|  23.3k|	    if (!xmlDictOwns(ctxt->dict, name))
  ------------------
  |  Branch (5821:10): [True: 23.3k, False: 0]
  ------------------
 5822|  23.3k|		xmlFree(name);
 5823|  23.3k|	    if (cur == NULL) {
  ------------------
  |  Branch (5823:10): [True: 3, False: 23.3k]
  ------------------
 5824|      3|                xmlErrMemory(ctxt);
 5825|      3|                xmlFreeEnumeration(ret);
 5826|      3|                return(NULL);
 5827|      3|            }
 5828|  23.3k|	    if (last == NULL) ret = last = cur;
  ------------------
  |  Branch (5828:10): [True: 14.6k, False: 8.71k]
  ------------------
 5829|  8.71k|	    else {
 5830|  8.71k|		last->next = cur;
 5831|  8.71k|		last = cur;
 5832|  8.71k|	    }
 5833|  23.3k|	}
 5834|  23.7k|	SKIP_BLANKS_PE;
  ------------------
  |  | 2277|  23.7k|#define SKIP_BLANKS_PE xmlSkipBlankCharsPE(ctxt)
  ------------------
 5835|  23.7k|    } while (RAW == '|');
  ------------------
  |  | 2224|  23.7k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (5835:14): [True: 9.13k, False: 14.6k]
  ------------------
 5836|  14.6k|    if (RAW != ')') {
  ------------------
  |  | 2224|  14.6k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (5836:9): [True: 756, False: 13.8k]
  ------------------
 5837|    756|	xmlFatalErr(ctxt, XML_ERR_ATTLIST_NOT_FINISHED, NULL);
 5838|    756|	return(ret);
 5839|    756|    }
 5840|  13.8k|    NEXT;
  ------------------
  |  | 2279|  13.8k|#define NEXT xmlNextChar(ctxt)
  ------------------
 5841|  13.8k|    return(ret);
 5842|  14.6k|}
xmlParseEnumeratedType:
 5859|  22.1k|xmlParseEnumeratedType(xmlParserCtxt *ctxt, xmlEnumeration **tree) {
 5860|  22.1k|    if (CMP8(CUR_PTR, 'N', 'O', 'T', 'A', 'T', 'I', 'O', 'N')) {
  ------------------
  |  | 2240|  22.1k|  ( CMP7( s, c1, c2, c3, c4, c5, c6, c7 ) && ((unsigned char *) s)[ 7 ] == c8 )
  |  |  ------------------
  |  |  |  | 2238|  44.2k|  ( CMP6( s, c1, c2, c3, c4, c5, c6 ) && ((unsigned char *) s)[ 6 ] == c7 )
  |  |  |  |  ------------------
  |  |  |  |  |  | 2236|  44.2k|  ( CMP5( s, c1, c2, c3, c4, c5 ) && ((unsigned char *) s)[ 5 ] == c6 )
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  | 2234|  44.2k|  ( CMP4( s, c1, c2, c3, c4 ) && ((unsigned char *) s)[ 4 ] == c5 )
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  | 2231|  44.2k|  ( ((unsigned char *) s)[ 0 ] == c1 && ((unsigned char *) s)[ 1 ] == c2 && \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (2231:5): [True: 3.00k, False: 19.1k]
  |  |  |  |  |  |  |  |  |  |  |  Branch (2231:41): [True: 2.99k, False: 13]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  | 2232|  22.1k|    ((unsigned char *) s)[ 2 ] == c3 && ((unsigned char *) s)[ 3 ] == c4 )
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (2232:5): [True: 2.98k, False: 7]
  |  |  |  |  |  |  |  |  |  |  |  Branch (2232:41): [True: 2.97k, False: 8]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (2234:34): [True: 2.97k, False: 2]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (2236:38): [True: 2.97k, False: 2]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2238:42): [True: 2.97k, False: 2]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2240:46): [True: 2.97k, False: 1]
  |  |  ------------------
  ------------------
 5861|  2.97k|	SKIP(8);
  ------------------
  |  | 2248|  2.97k|#define SKIP(val) do {							\
  |  | 2249|  2.97k|    ctxt->input->cur += (val),ctxt->input->col+=(val);			\
  |  | 2250|  2.97k|    if (*ctxt->input->cur == 0)						\
  |  |  ------------------
  |  |  |  Branch (2250:9): [True: 212, False: 2.76k]
  |  |  ------------------
  |  | 2251|  2.97k|        xmlParserGrow(ctxt);						\
  |  | 2252|  2.97k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2252:12): [Folded, False: 2.97k]
  |  |  ------------------
  ------------------
 5862|  2.97k|	if (SKIP_BLANKS_PE == 0) {
  ------------------
  |  | 2277|  2.97k|#define SKIP_BLANKS_PE xmlSkipBlankCharsPE(ctxt)
  ------------------
  |  Branch (5862:6): [True: 251, False: 2.72k]
  ------------------
 5863|    251|	    xmlFatalErrMsg(ctxt, XML_ERR_SPACE_REQUIRED,
 5864|    251|			   "Space required after 'NOTATION'\n");
 5865|    251|	    return(0);
 5866|    251|	}
 5867|  2.72k|	*tree = xmlParseNotationType(ctxt);
 5868|  2.72k|	if (*tree == NULL) return(0);
  ------------------
  |  Branch (5868:6): [True: 929, False: 1.79k]
  ------------------
 5869|  1.79k|	return(XML_ATTRIBUTE_NOTATION);
 5870|  2.72k|    }
 5871|  19.1k|    *tree = xmlParseEnumerationType(ctxt);
 5872|  19.1k|    if (*tree == NULL) return(0);
  ------------------
  |  Branch (5872:9): [True: 4.49k, False: 14.6k]
  ------------------
 5873|  14.6k|    return(XML_ATTRIBUTE_ENUMERATION);
 5874|  19.1k|}
xmlParseAttributeType:
 5922|   108k|xmlParseAttributeType(xmlParserCtxt *ctxt, xmlEnumeration **tree) {
 5923|   108k|    if (CMP5(CUR_PTR, 'C', 'D', 'A', 'T', 'A')) {
  ------------------
  |  | 2234|   108k|  ( CMP4( s, c1, c2, c3, c4 ) && ((unsigned char *) s)[ 4 ] == c5 )
  |  |  ------------------
  |  |  |  | 2231|   217k|  ( ((unsigned char *) s)[ 0 ] == c1 && ((unsigned char *) s)[ 1 ] == c2 && \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2231:5): [True: 16.4k, False: 92.4k]
  |  |  |  |  |  Branch (2231:41): [True: 16.4k, False: 2]
  |  |  |  |  ------------------
  |  |  |  | 2232|   108k|    ((unsigned char *) s)[ 2 ] == c3 && ((unsigned char *) s)[ 3 ] == c4 )
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2232:5): [True: 16.4k, False: 2]
  |  |  |  |  |  Branch (2232:41): [True: 16.4k, False: 1]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2234:34): [True: 16.4k, False: 2]
  |  |  ------------------
  ------------------
 5924|  16.4k|	SKIP(5);
  ------------------
  |  | 2248|  16.4k|#define SKIP(val) do {							\
  |  | 2249|  16.4k|    ctxt->input->cur += (val),ctxt->input->col+=(val);			\
  |  | 2250|  16.4k|    if (*ctxt->input->cur == 0)						\
  |  |  ------------------
  |  |  |  Branch (2250:9): [True: 227, False: 16.2k]
  |  |  ------------------
  |  | 2251|  16.4k|        xmlParserGrow(ctxt);						\
  |  | 2252|  16.4k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2252:12): [Folded, False: 16.4k]
  |  |  ------------------
  ------------------
 5925|  16.4k|	return(XML_ATTRIBUTE_CDATA);
 5926|  92.4k|     } else if (CMP6(CUR_PTR, 'I', 'D', 'R', 'E', 'F', 'S')) {
  ------------------
  |  | 2236|  92.4k|  ( CMP5( s, c1, c2, c3, c4, c5 ) && ((unsigned char *) s)[ 5 ] == c6 )
  |  |  ------------------
  |  |  |  | 2234|   184k|  ( CMP4( s, c1, c2, c3, c4 ) && ((unsigned char *) s)[ 4 ] == c5 )
  |  |  |  |  ------------------
  |  |  |  |  |  | 2231|   184k|  ( ((unsigned char *) s)[ 0 ] == c1 && ((unsigned char *) s)[ 1 ] == c2 && \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (2231:5): [True: 18.2k, False: 74.1k]
  |  |  |  |  |  |  |  Branch (2231:41): [True: 18.2k, False: 5]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 2232|  92.4k|    ((unsigned char *) s)[ 2 ] == c3 && ((unsigned char *) s)[ 3 ] == c4 )
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (2232:5): [True: 6.43k, False: 11.8k]
  |  |  |  |  |  |  |  Branch (2232:41): [True: 6.43k, False: 2]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2234:34): [True: 6.43k, False: 3]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2236:38): [True: 1.58k, False: 4.85k]
  |  |  ------------------
  ------------------
 5927|  1.58k|	SKIP(6);
  ------------------
  |  | 2248|  1.58k|#define SKIP(val) do {							\
  |  | 2249|  1.58k|    ctxt->input->cur += (val),ctxt->input->col+=(val);			\
  |  | 2250|  1.58k|    if (*ctxt->input->cur == 0)						\
  |  |  ------------------
  |  |  |  Branch (2250:9): [True: 67, False: 1.51k]
  |  |  ------------------
  |  | 2251|  1.58k|        xmlParserGrow(ctxt);						\
  |  | 2252|  1.58k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2252:12): [Folded, False: 1.58k]
  |  |  ------------------
  ------------------
 5928|  1.58k|	return(XML_ATTRIBUTE_IDREFS);
 5929|  90.8k|     } else if (CMP5(CUR_PTR, 'I', 'D', 'R', 'E', 'F')) {
  ------------------
  |  | 2234|  90.8k|  ( CMP4( s, c1, c2, c3, c4 ) && ((unsigned char *) s)[ 4 ] == c5 )
  |  |  ------------------
  |  |  |  | 2231|   181k|  ( ((unsigned char *) s)[ 0 ] == c1 && ((unsigned char *) s)[ 1 ] == c2 && \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2231:5): [True: 16.7k, False: 74.1k]
  |  |  |  |  |  Branch (2231:41): [True: 16.7k, False: 5]
  |  |  |  |  ------------------
  |  |  |  | 2232|  90.8k|    ((unsigned char *) s)[ 2 ] == c3 && ((unsigned char *) s)[ 3 ] == c4 )
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2232:5): [True: 4.85k, False: 11.8k]
  |  |  |  |  |  Branch (2232:41): [True: 4.85k, False: 2]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2234:34): [True: 4.85k, False: 3]
  |  |  ------------------
  ------------------
 5930|  4.85k|	SKIP(5);
  ------------------
  |  | 2248|  4.85k|#define SKIP(val) do {							\
  |  | 2249|  4.85k|    ctxt->input->cur += (val),ctxt->input->col+=(val);			\
  |  | 2250|  4.85k|    if (*ctxt->input->cur == 0)						\
  |  |  ------------------
  |  |  |  Branch (2250:9): [True: 255, False: 4.59k]
  |  |  ------------------
  |  | 2251|  4.85k|        xmlParserGrow(ctxt);						\
  |  | 2252|  4.85k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2252:12): [Folded, False: 4.85k]
  |  |  ------------------
  ------------------
 5931|  4.85k|	return(XML_ATTRIBUTE_IDREF);
 5932|  86.0k|     } else if ((RAW == 'I') && (NXT(1) == 'D')) {
  ------------------
  |  | 2224|  86.0k|#define RAW (*ctxt->input->cur)
  ------------------
                   } else if ((RAW == 'I') && (NXT(1) == 'D')) {
  ------------------
  |  | 2226|  11.8k|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
  |  Branch (5932:17): [True: 11.8k, False: 74.1k]
  |  Branch (5932:33): [True: 11.8k, False: 5]
  ------------------
 5933|  11.8k|        SKIP(2);
  ------------------
  |  | 2248|  11.8k|#define SKIP(val) do {							\
  |  | 2249|  11.8k|    ctxt->input->cur += (val),ctxt->input->col+=(val);			\
  |  | 2250|  11.8k|    if (*ctxt->input->cur == 0)						\
  |  |  ------------------
  |  |  |  Branch (2250:9): [True: 215, False: 11.6k]
  |  |  ------------------
  |  | 2251|  11.8k|        xmlParserGrow(ctxt);						\
  |  | 2252|  11.8k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2252:12): [Folded, False: 11.8k]
  |  |  ------------------
  ------------------
 5934|  11.8k|	return(XML_ATTRIBUTE_ID);
 5935|  74.1k|     } else if (CMP6(CUR_PTR, 'E', 'N', 'T', 'I', 'T', 'Y')) {
  ------------------
  |  | 2236|  74.1k|  ( CMP5( s, c1, c2, c3, c4, c5 ) && ((unsigned char *) s)[ 5 ] == c6 )
  |  |  ------------------
  |  |  |  | 2234|   148k|  ( CMP4( s, c1, c2, c3, c4 ) && ((unsigned char *) s)[ 4 ] == c5 )
  |  |  |  |  ------------------
  |  |  |  |  |  | 2231|   148k|  ( ((unsigned char *) s)[ 0 ] == c1 && ((unsigned char *) s)[ 1 ] == c2 && \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (2231:5): [True: 9.92k, False: 64.2k]
  |  |  |  |  |  |  |  Branch (2231:41): [True: 9.92k, False: 3]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 2232|  74.1k|    ((unsigned char *) s)[ 2 ] == c3 && ((unsigned char *) s)[ 3 ] == c4 )
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (2232:5): [True: 9.92k, False: 2]
  |  |  |  |  |  |  |  Branch (2232:41): [True: 9.91k, False: 3]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2234:34): [True: 9.91k, False: 8]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2236:38): [True: 8.34k, False: 1.56k]
  |  |  ------------------
  ------------------
 5936|  8.34k|	SKIP(6);
  ------------------
  |  | 2248|  8.34k|#define SKIP(val) do {							\
  |  | 2249|  8.34k|    ctxt->input->cur += (val),ctxt->input->col+=(val);			\
  |  | 2250|  8.34k|    if (*ctxt->input->cur == 0)						\
  |  |  ------------------
  |  |  |  Branch (2250:9): [True: 98, False: 8.24k]
  |  |  ------------------
  |  | 2251|  8.34k|        xmlParserGrow(ctxt);						\
  |  | 2252|  8.34k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2252:12): [Folded, False: 8.34k]
  |  |  ------------------
  ------------------
 5937|  8.34k|	return(XML_ATTRIBUTE_ENTITY);
 5938|  65.8k|     } else if (CMP8(CUR_PTR, 'E', 'N', 'T', 'I', 'T', 'I', 'E', 'S')) {
  ------------------
  |  | 2240|  65.8k|  ( CMP7( s, c1, c2, c3, c4, c5, c6, c7 ) && ((unsigned char *) s)[ 7 ] == c8 )
  |  |  ------------------
  |  |  |  | 2238|   131k|  ( CMP6( s, c1, c2, c3, c4, c5, c6 ) && ((unsigned char *) s)[ 6 ] == c7 )
  |  |  |  |  ------------------
  |  |  |  |  |  | 2236|   131k|  ( 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: 1.58k, False: 64.2k]
  |  |  |  |  |  |  |  |  |  |  |  Branch (2231:41): [True: 1.58k, False: 3]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  | 2232|  65.8k|    ((unsigned char *) s)[ 2 ] == c3 && ((unsigned char *) s)[ 3 ] == c4 )
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (2232:5): [True: 1.57k, False: 2]
  |  |  |  |  |  |  |  |  |  |  |  Branch (2232:41): [True: 1.57k, False: 3]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (2234:34): [True: 1.56k, False: 8]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (2236:38): [True: 1.56k, False: 2]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2238:42): [True: 1.55k, False: 7]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2240:46): [True: 1.55k, False: 2]
  |  |  ------------------
  ------------------
 5939|  1.55k|	SKIP(8);
  ------------------
  |  | 2248|  1.55k|#define SKIP(val) do {							\
  |  | 2249|  1.55k|    ctxt->input->cur += (val),ctxt->input->col+=(val);			\
  |  | 2250|  1.55k|    if (*ctxt->input->cur == 0)						\
  |  |  ------------------
  |  |  |  Branch (2250:9): [True: 207, False: 1.35k]
  |  |  ------------------
  |  | 2251|  1.55k|        xmlParserGrow(ctxt);						\
  |  | 2252|  1.55k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2252:12): [Folded, False: 1.55k]
  |  |  ------------------
  ------------------
 5940|  1.55k|	return(XML_ATTRIBUTE_ENTITIES);
 5941|  64.2k|     } else if (CMP8(CUR_PTR, 'N', 'M', 'T', 'O', 'K', 'E', 'N', 'S')) {
  ------------------
  |  | 2240|  64.2k|  ( CMP7( s, c1, c2, c3, c4, c5, c6, c7 ) && ((unsigned char *) s)[ 7 ] == c8 )
  |  |  ------------------
  |  |  |  | 2238|   128k|  ( CMP6( s, c1, c2, c3, c4, c5, c6 ) && ((unsigned char *) s)[ 6 ] == c7 )
  |  |  |  |  ------------------
  |  |  |  |  |  | 2236|   128k|  ( CMP5( s, c1, c2, c3, c4, c5 ) && ((unsigned char *) s)[ 5 ] == c6 )
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  | 2234|   128k|  ( CMP4( s, c1, c2, c3, c4 ) && ((unsigned char *) s)[ 4 ] == c5 )
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  | 2231|   128k|  ( ((unsigned char *) s)[ 0 ] == c1 && ((unsigned char *) s)[ 1 ] == c2 && \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (2231:5): [True: 45.1k, False: 19.1k]
  |  |  |  |  |  |  |  |  |  |  |  Branch (2231:41): [True: 42.1k, False: 2.99k]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  | 2232|  64.2k|    ((unsigned char *) s)[ 2 ] == c3 && ((unsigned char *) s)[ 3 ] == c4 )
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (2232:5): [True: 42.1k, False: 2]
  |  |  |  |  |  |  |  |  |  |  |  Branch (2232:41): [True: 42.1k, False: 3]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (2234:34): [True: 42.1k, False: 1]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (2236:38): [True: 42.1k, False: 2]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2238:42): [True: 42.1k, False: 3]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2240:46): [True: 34.8k, False: 7.29k]
  |  |  ------------------
  ------------------
 5942|  34.8k|	SKIP(8);
  ------------------
  |  | 2248|  34.8k|#define SKIP(val) do {							\
  |  | 2249|  34.8k|    ctxt->input->cur += (val),ctxt->input->col+=(val);			\
  |  | 2250|  34.8k|    if (*ctxt->input->cur == 0)						\
  |  |  ------------------
  |  |  |  Branch (2250:9): [True: 289, False: 34.5k]
  |  |  ------------------
  |  | 2251|  34.8k|        xmlParserGrow(ctxt);						\
  |  | 2252|  34.8k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2252:12): [Folded, False: 34.8k]
  |  |  ------------------
  ------------------
 5943|  34.8k|	return(XML_ATTRIBUTE_NMTOKENS);
 5944|  34.8k|     } else if (CMP7(CUR_PTR, 'N', 'M', 'T', 'O', 'K', 'E', 'N')) {
  ------------------
  |  | 2238|  29.4k|  ( CMP6( s, c1, c2, c3, c4, c5, c6 ) && ((unsigned char *) s)[ 6 ] == c7 )
  |  |  ------------------
  |  |  |  | 2236|  58.8k|  ( CMP5( s, c1, c2, c3, c4, c5 ) && ((unsigned char *) s)[ 5 ] == c6 )
  |  |  |  |  ------------------
  |  |  |  |  |  | 2234|  58.8k|  ( CMP4( s, c1, c2, c3, c4 ) && ((unsigned char *) s)[ 4 ] == c5 )
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  | 2231|  58.8k|  ( ((unsigned char *) s)[ 0 ] == c1 && ((unsigned char *) s)[ 1 ] == c2 && \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (2231:5): [True: 10.3k, False: 19.1k]
  |  |  |  |  |  |  |  |  |  Branch (2231:41): [True: 7.30k, False: 2.99k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  | 2232|  29.4k|    ((unsigned char *) s)[ 2 ] == c3 && ((unsigned char *) s)[ 3 ] == c4 )
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (2232:5): [True: 7.30k, False: 2]
  |  |  |  |  |  |  |  |  |  Branch (2232:41): [True: 7.30k, False: 3]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (2234:34): [True: 7.29k, False: 1]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2236:38): [True: 7.29k, False: 2]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2238:42): [True: 7.29k, False: 3]
  |  |  ------------------
  ------------------
 5945|  7.29k|	SKIP(7);
  ------------------
  |  | 2248|  7.29k|#define SKIP(val) do {							\
  |  | 2249|  7.29k|    ctxt->input->cur += (val),ctxt->input->col+=(val);			\
  |  | 2250|  7.29k|    if (*ctxt->input->cur == 0)						\
  |  |  ------------------
  |  |  |  Branch (2250:9): [True: 205, False: 7.08k]
  |  |  ------------------
  |  | 2251|  7.29k|        xmlParserGrow(ctxt);						\
  |  | 2252|  7.29k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2252:12): [Folded, False: 7.29k]
  |  |  ------------------
  ------------------
 5946|  7.29k|	return(XML_ATTRIBUTE_NMTOKEN);
 5947|  7.29k|     }
 5948|  22.1k|     return(xmlParseEnumeratedType(ctxt, tree));
 5949|   108k|}
xmlParseAttributeListDecl:
 5962|  94.2k|xmlParseAttributeListDecl(xmlParserCtxt *ctxt) {
 5963|  94.2k|    const xmlChar *elemName;
 5964|  94.2k|    const xmlChar *attrName;
 5965|  94.2k|    xmlEnumerationPtr tree;
 5966|       |
 5967|  94.2k|    if ((CUR != '<') || (NXT(1) != '!'))
  ------------------
  |  | 2225|  94.2k|#define CUR (*ctxt->input->cur)
  ------------------
                  if ((CUR != '<') || (NXT(1) != '!'))
  ------------------
  |  | 2226|  94.2k|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
  |  Branch (5967:9): [True: 0, False: 94.2k]
  |  Branch (5967:25): [True: 0, False: 94.2k]
  ------------------
 5968|      0|        return;
 5969|  94.2k|    SKIP(2);
  ------------------
  |  | 2248|  94.2k|#define SKIP(val) do {							\
  |  | 2249|  94.2k|    ctxt->input->cur += (val),ctxt->input->col+=(val);			\
  |  | 2250|  94.2k|    if (*ctxt->input->cur == 0)						\
  |  |  ------------------
  |  |  |  Branch (2250:9): [True: 0, False: 94.2k]
  |  |  ------------------
  |  | 2251|  94.2k|        xmlParserGrow(ctxt);						\
  |  | 2252|  94.2k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2252:12): [Folded, False: 94.2k]
  |  |  ------------------
  ------------------
 5970|       |
 5971|  94.2k|    if (CMP7(CUR_PTR, 'A', 'T', 'T', 'L', 'I', 'S', 'T')) {
  ------------------
  |  | 2238|  94.2k|  ( CMP6( s, c1, c2, c3, c4, c5, c6 ) && ((unsigned char *) s)[ 6 ] == c7 )
  |  |  ------------------
  |  |  |  | 2236|   188k|  ( CMP5( s, c1, c2, c3, c4, c5 ) && ((unsigned char *) s)[ 5 ] == c6 )
  |  |  |  |  ------------------
  |  |  |  |  |  | 2234|   188k|  ( CMP4( s, c1, c2, c3, c4 ) && ((unsigned char *) s)[ 4 ] == c5 )
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  | 2231|   188k|  ( ((unsigned char *) s)[ 0 ] == c1 && ((unsigned char *) s)[ 1 ] == c2 && \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (2231:5): [True: 94.2k, False: 0]
  |  |  |  |  |  |  |  |  |  Branch (2231:41): [True: 94.2k, False: 16]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  | 2232|  94.2k|    ((unsigned char *) s)[ 2 ] == c3 && ((unsigned char *) s)[ 3 ] == c4 )
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (2232:5): [True: 94.2k, False: 8]
  |  |  |  |  |  |  |  |  |  Branch (2232:41): [True: 94.2k, False: 4]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (2234:34): [True: 94.2k, False: 10]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2236:38): [True: 94.2k, False: 4]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2238:42): [True: 94.2k, False: 14]
  |  |  ------------------
  ------------------
 5972|  94.2k|#ifdef LIBXML_VALID_ENABLED
 5973|  94.2k|	int oldInputNr = ctxt->inputNr;
 5974|  94.2k|#endif
 5975|       |
 5976|  94.2k|	SKIP(7);
  ------------------
  |  | 2248|  94.2k|#define SKIP(val) do {							\
  |  | 2249|  94.2k|    ctxt->input->cur += (val),ctxt->input->col+=(val);			\
  |  | 2250|  94.2k|    if (*ctxt->input->cur == 0)						\
  |  |  ------------------
  |  |  |  Branch (2250:9): [True: 221, False: 93.9k]
  |  |  ------------------
  |  | 2251|  94.2k|        xmlParserGrow(ctxt);						\
  |  | 2252|  94.2k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2252:12): [Folded, False: 94.2k]
  |  |  ------------------
  ------------------
 5977|  94.2k|	if (SKIP_BLANKS_PE == 0) {
  ------------------
  |  | 2277|  94.2k|#define SKIP_BLANKS_PE xmlSkipBlankCharsPE(ctxt)
  ------------------
  |  Branch (5977:6): [True: 2.39k, False: 91.8k]
  ------------------
 5978|  2.39k|	    xmlFatalErrMsg(ctxt, XML_ERR_SPACE_REQUIRED,
 5979|  2.39k|		                 "Space required after '<!ATTLIST'\n");
 5980|  2.39k|	}
 5981|  94.2k|        elemName = xmlParseName(ctxt);
 5982|  94.2k|	if (elemName == NULL) {
  ------------------
  |  Branch (5982:6): [True: 2.66k, False: 91.5k]
  ------------------
 5983|  2.66k|	    xmlFatalErrMsg(ctxt, XML_ERR_NAME_REQUIRED,
 5984|  2.66k|			   "ATTLIST: no name for Element\n");
 5985|  2.66k|	    return;
 5986|  2.66k|	}
 5987|  91.5k|	SKIP_BLANKS_PE;
  ------------------
  |  | 2277|  91.5k|#define SKIP_BLANKS_PE xmlSkipBlankCharsPE(ctxt)
  ------------------
 5988|  91.5k|	GROW;
  ------------------
  |  | 2271|  91.5k|    if ((!PARSER_PROGRESSIVE(ctxt)) && \
  |  |  ------------------
  |  |  |  |   47|  91.5k|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|  91.5k|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2271:9): [True: 86.1k, False: 5.39k]
  |  |  ------------------
  |  | 2272|  91.5k|        (ctxt->input->end - ctxt->input->cur < INPUT_CHUNK)) \
  |  |  ------------------
  |  |  |  |   63|  86.1k|#define INPUT_CHUNK	250
  |  |  ------------------
  |  |  |  Branch (2272:9): [True: 39.9k, False: 46.1k]
  |  |  ------------------
  |  | 2273|  91.5k|	xmlParserGrow(ctxt);
  ------------------
 5989|   153k|	while ((RAW != '>') && (PARSER_STOPPED(ctxt) == 0)) {
  ------------------
  |  | 2224|   153k|#define RAW (*ctxt->input->cur)
  ------------------
              	while ((RAW != '>') && (PARSER_STOPPED(ctxt) == 0)) {
  ------------------
  |  |   44|   118k|#define PARSER_STOPPED(ctxt) ((ctxt)->disableSAX > 1)
  ------------------
  |  Branch (5989:9): [True: 118k, False: 34.7k]
  |  Branch (5989:25): [True: 118k, False: 22]
  ------------------
 5990|   118k|	    int type;
 5991|   118k|	    int def;
 5992|   118k|	    xmlChar *defaultValue = NULL;
 5993|       |
 5994|   118k|	    GROW;
  ------------------
  |  | 2271|   118k|    if ((!PARSER_PROGRESSIVE(ctxt)) && \
  |  |  ------------------
  |  |  |  |   47|   118k|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|   118k|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2271:9): [True: 106k, False: 12.0k]
  |  |  ------------------
  |  | 2272|   118k|        (ctxt->input->end - ctxt->input->cur < INPUT_CHUNK)) \
  |  |  ------------------
  |  |  |  |   63|   106k|#define INPUT_CHUNK	250
  |  |  ------------------
  |  |  |  Branch (2272:9): [True: 51.2k, False: 55.2k]
  |  |  ------------------
  |  | 2273|   118k|	xmlParserGrow(ctxt);
  ------------------
 5995|   118k|            tree = NULL;
 5996|   118k|	    attrName = xmlParseName(ctxt);
 5997|   118k|	    if (attrName == NULL) {
  ------------------
  |  Branch (5997:10): [True: 5.98k, False: 112k]
  ------------------
 5998|  5.98k|		xmlFatalErrMsg(ctxt, XML_ERR_NAME_REQUIRED,
 5999|  5.98k|			       "ATTLIST: no name for Attribute\n");
 6000|  5.98k|		break;
 6001|  5.98k|	    }
 6002|   112k|	    GROW;
  ------------------
  |  | 2271|   112k|    if ((!PARSER_PROGRESSIVE(ctxt)) && \
  |  |  ------------------
  |  |  |  |   47|   112k|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|   112k|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2271:9): [True: 100k, False: 11.9k]
  |  |  ------------------
  |  | 2272|   112k|        (ctxt->input->end - ctxt->input->cur < INPUT_CHUNK)) \
  |  |  ------------------
  |  |  |  |   63|   100k|#define INPUT_CHUNK	250
  |  |  ------------------
  |  |  |  Branch (2272:9): [True: 48.8k, False: 51.8k]
  |  |  ------------------
  |  | 2273|   112k|	xmlParserGrow(ctxt);
  ------------------
 6003|   112k|	    if (SKIP_BLANKS_PE == 0) {
  ------------------
  |  | 2277|   112k|#define SKIP_BLANKS_PE xmlSkipBlankCharsPE(ctxt)
  ------------------
  |  Branch (6003:10): [True: 3.66k, False: 108k]
  ------------------
 6004|  3.66k|		xmlFatalErrMsg(ctxt, XML_ERR_SPACE_REQUIRED,
 6005|  3.66k|		        "Space required after the attribute name\n");
 6006|  3.66k|		break;
 6007|  3.66k|	    }
 6008|       |
 6009|   108k|	    type = xmlParseAttributeType(ctxt, &tree);
 6010|   108k|	    if (type <= 0) {
  ------------------
  |  Branch (6010:10): [True: 5.67k, False: 103k]
  ------------------
 6011|  5.67k|	        break;
 6012|  5.67k|	    }
 6013|       |
 6014|   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: 91.6k, False: 11.5k]
  |  |  ------------------
  |  | 2272|   103k|        (ctxt->input->end - ctxt->input->cur < INPUT_CHUNK)) \
  |  |  ------------------
  |  |  |  |   63|  91.6k|#define INPUT_CHUNK	250
  |  |  ------------------
  |  |  |  Branch (2272:9): [True: 44.0k, False: 47.6k]
  |  |  ------------------
  |  | 2273|   103k|	xmlParserGrow(ctxt);
  ------------------
 6015|   103k|	    if (SKIP_BLANKS_PE == 0) {
  ------------------
  |  | 2277|   103k|#define SKIP_BLANKS_PE xmlSkipBlankCharsPE(ctxt)
  ------------------
  |  Branch (6015:10): [True: 2.48k, False: 100k]
  ------------------
 6016|  2.48k|		xmlFatalErrMsg(ctxt, XML_ERR_SPACE_REQUIRED,
 6017|  2.48k|			       "Space required after the attribute type\n");
 6018|  2.48k|	        if (tree != NULL)
  ------------------
  |  Branch (6018:14): [True: 890, False: 1.59k]
  ------------------
 6019|    890|		    xmlFreeEnumeration(tree);
 6020|  2.48k|		break;
 6021|  2.48k|	    }
 6022|       |
 6023|   100k|	    def = xmlParseDefaultDecl(ctxt, &defaultValue);
 6024|   100k|	    if (def <= 0) {
  ------------------
  |  Branch (6024:10): [True: 0, False: 100k]
  ------------------
 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|   100k|	    if ((type != XML_ATTRIBUTE_CDATA) && (defaultValue != NULL))
  ------------------
  |  Branch (6031:10): [True: 84.5k, False: 16.2k]
  |  Branch (6031:43): [True: 28.8k, False: 55.6k]
  ------------------
 6032|  28.8k|	        xmlAttrNormalizeSpace(defaultValue, defaultValue);
 6033|       |
 6034|   100k|	    GROW;
  ------------------
  |  | 2271|   100k|    if ((!PARSER_PROGRESSIVE(ctxt)) && \
  |  |  ------------------
  |  |  |  |   47|   100k|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|   100k|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2271:9): [True: 89.3k, False: 11.4k]
  |  |  ------------------
  |  | 2272|   100k|        (ctxt->input->end - ctxt->input->cur < INPUT_CHUNK)) \
  |  |  ------------------
  |  |  |  |   63|  89.3k|#define INPUT_CHUNK	250
  |  |  ------------------
  |  |  |  Branch (2272:9): [True: 60.0k, False: 29.2k]
  |  |  ------------------
  |  | 2273|   100k|	xmlParserGrow(ctxt);
  ------------------
 6035|   100k|            if (RAW != '>') {
  ------------------
  |  | 2224|   100k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (6035:17): [True: 73.0k, False: 27.6k]
  ------------------
 6036|  73.0k|		if (SKIP_BLANKS_PE == 0) {
  ------------------
  |  | 2277|  73.0k|#define SKIP_BLANKS_PE xmlSkipBlankCharsPE(ctxt)
  ------------------
  |  Branch (6036:7): [True: 38.9k, False: 34.0k]
  ------------------
 6037|  38.9k|		    xmlFatalErrMsg(ctxt, XML_ERR_SPACE_REQUIRED,
 6038|  38.9k|			"Space required after the attribute default value\n");
 6039|  38.9k|		    if (defaultValue != NULL)
  ------------------
  |  Branch (6039:11): [True: 536, False: 38.4k]
  ------------------
 6040|    536|			xmlFree(defaultValue);
 6041|  38.9k|		    if (tree != NULL)
  ------------------
  |  Branch (6041:11): [True: 1.70k, False: 37.2k]
  ------------------
 6042|  1.70k|			xmlFreeEnumeration(tree);
 6043|  38.9k|		    break;
 6044|  38.9k|		}
 6045|  73.0k|	    }
 6046|  61.7k|	    if ((ctxt->sax != NULL) && (!ctxt->disableSAX) &&
  ------------------
  |  Branch (6046:10): [True: 61.7k, False: 0]
  |  Branch (6046:33): [True: 58.5k, False: 3.22k]
  ------------------
 6047|  58.5k|		(ctxt->sax->attributeDecl != NULL))
  ------------------
  |  Branch (6047:3): [True: 58.5k, False: 0]
  ------------------
 6048|  58.5k|		ctxt->sax->attributeDecl(ctxt->userData, elemName, attrName,
 6049|  58.5k|	                        type, def, defaultValue, tree);
 6050|  3.22k|	    else if (tree != NULL)
  ------------------
  |  Branch (6050:15): [True: 1.03k, False: 2.18k]
  ------------------
 6051|  1.03k|		xmlFreeEnumeration(tree);
 6052|       |
 6053|  61.7k|	    if ((ctxt->sax2) && (defaultValue != NULL) &&
  ------------------
  |  Branch (6053:10): [True: 44.3k, False: 17.4k]
  |  Branch (6053:26): [True: 22.7k, False: 21.5k]
  ------------------
 6054|  22.7k|	        (def != XML_ATTRIBUTE_IMPLIED) &&
  ------------------
  |  Branch (6054:10): [True: 22.7k, False: 0]
  ------------------
 6055|  22.7k|		(def != XML_ATTRIBUTE_REQUIRED)) {
  ------------------
  |  Branch (6055:3): [True: 22.7k, False: 0]
  ------------------
 6056|  22.7k|		xmlAddDefAttrs(ctxt, elemName, attrName, defaultValue);
 6057|  22.7k|	    }
 6058|  61.7k|	    if (ctxt->sax2) {
  ------------------
  |  Branch (6058:10): [True: 44.3k, False: 17.4k]
  ------------------
 6059|  44.3k|		xmlAddSpecialAttr(ctxt, elemName, attrName, type);
 6060|  44.3k|	    }
 6061|  61.7k|	    if (defaultValue != NULL)
  ------------------
  |  Branch (6061:10): [True: 31.5k, False: 30.2k]
  ------------------
 6062|  31.5k|	        xmlFree(defaultValue);
 6063|  61.7k|	    GROW;
  ------------------
  |  | 2271|  61.7k|    if ((!PARSER_PROGRESSIVE(ctxt)) && \
  |  |  ------------------
  |  |  |  |   47|  61.7k|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|  61.7k|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2271:9): [True: 50.6k, False: 11.0k]
  |  |  ------------------
  |  | 2272|  61.7k|        (ctxt->input->end - ctxt->input->cur < INPUT_CHUNK)) \
  |  |  ------------------
  |  |  |  |   63|  50.6k|#define INPUT_CHUNK	250
  |  |  ------------------
  |  |  |  Branch (2272:9): [True: 22.3k, False: 28.3k]
  |  |  ------------------
  |  | 2273|  61.7k|	xmlParserGrow(ctxt);
  ------------------
 6064|  61.7k|	}
 6065|  91.5k|	if (RAW == '>') {
  ------------------
  |  | 2224|  91.5k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (6065:6): [True: 35.7k, False: 55.7k]
  ------------------
 6066|  35.7k|#ifdef LIBXML_VALID_ENABLED
 6067|  35.7k|	    if ((ctxt->validate) && (ctxt->inputNr > oldInputNr)) {
  ------------------
  |  Branch (6067:10): [True: 27.4k, False: 8.26k]
  |  Branch (6067:30): [True: 313, False: 27.1k]
  ------------------
 6068|    313|		xmlValidityError(ctxt, XML_ERR_ENTITY_BOUNDARY,
 6069|    313|                                 "Attribute list declaration doesn't start and"
 6070|    313|                                 " stop in the same entity\n",
 6071|    313|                                 NULL, NULL);
 6072|    313|	    }
 6073|  35.7k|#endif
 6074|  35.7k|	    NEXT;
  ------------------
  |  | 2279|  35.7k|#define NEXT xmlNextChar(ctxt)
  ------------------
 6075|  35.7k|	}
 6076|  91.5k|    }
 6077|  94.2k|}
xmlParseElementMixedContentDecl:
 6142|  7.69k|xmlParseElementMixedContentDecl(xmlParserCtxt *ctxt, int openInputNr) {
 6143|  7.69k|    xmlElementContentPtr ret = NULL, cur = NULL, n;
 6144|  7.69k|    const xmlChar *elem = NULL;
 6145|       |
 6146|  7.69k|    GROW;
  ------------------
  |  | 2271|  7.69k|    if ((!PARSER_PROGRESSIVE(ctxt)) && \
  |  |  ------------------
  |  |  |  |   47|  7.69k|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|  7.69k|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2271:9): [True: 6.15k, False: 1.53k]
  |  |  ------------------
  |  | 2272|  7.69k|        (ctxt->input->end - ctxt->input->cur < INPUT_CHUNK)) \
  |  |  ------------------
  |  |  |  |   63|  6.15k|#define INPUT_CHUNK	250
  |  |  ------------------
  |  |  |  Branch (2272:9): [True: 2.67k, False: 3.47k]
  |  |  ------------------
  |  | 2273|  7.69k|	xmlParserGrow(ctxt);
  ------------------
 6147|  7.69k|    if (CMP7(CUR_PTR, '#', 'P', 'C', 'D', 'A', 'T', 'A')) {
  ------------------
  |  | 2238|  7.69k|  ( CMP6( s, c1, c2, c3, c4, c5, c6 ) && ((unsigned char *) s)[ 6 ] == c7 )
  |  |  ------------------
  |  |  |  | 2236|  15.3k|  ( CMP5( s, c1, c2, c3, c4, c5 ) && ((unsigned char *) s)[ 5 ] == c6 )
  |  |  |  |  ------------------
  |  |  |  |  |  | 2234|  15.3k|  ( CMP4( s, c1, c2, c3, c4 ) && ((unsigned char *) s)[ 4 ] == c5 )
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  | 2231|  15.3k|  ( ((unsigned char *) s)[ 0 ] == c1 && ((unsigned char *) s)[ 1 ] == c2 && \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (2231:5): [True: 7.69k, False: 0]
  |  |  |  |  |  |  |  |  |  Branch (2231:41): [True: 7.69k, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  | 2232|  7.69k|    ((unsigned char *) s)[ 2 ] == c3 && ((unsigned char *) s)[ 3 ] == c4 )
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (2232:5): [True: 7.69k, False: 0]
  |  |  |  |  |  |  |  |  |  Branch (2232:41): [True: 7.69k, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (2234:34): [True: 7.69k, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2236:38): [True: 7.69k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2238:42): [True: 7.69k, False: 0]
  |  |  ------------------
  ------------------
 6148|  7.69k|	SKIP(7);
  ------------------
  |  | 2248|  7.69k|#define SKIP(val) do {							\
  |  | 2249|  7.69k|    ctxt->input->cur += (val),ctxt->input->col+=(val);			\
  |  | 2250|  7.69k|    if (*ctxt->input->cur == 0)						\
  |  |  ------------------
  |  |  |  Branch (2250:9): [True: 202, False: 7.48k]
  |  |  ------------------
  |  | 2251|  7.69k|        xmlParserGrow(ctxt);						\
  |  | 2252|  7.69k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2252:12): [Folded, False: 7.69k]
  |  |  ------------------
  ------------------
 6149|  7.69k|        xmlSkipBlankCharsPEBalanced(ctxt, openInputNr);
 6150|  7.69k|	if (RAW == ')') {
  ------------------
  |  | 2224|  7.69k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (6150:6): [True: 4.03k, False: 3.66k]
  ------------------
 6151|  4.03k|#ifdef LIBXML_VALID_ENABLED
 6152|  4.03k|	    if ((ctxt->validate) && (ctxt->inputNr > openInputNr)) {
  ------------------
  |  Branch (6152:10): [True: 2.97k, False: 1.05k]
  |  Branch (6152:30): [True: 10, False: 2.96k]
  ------------------
 6153|     10|		xmlValidityError(ctxt, XML_ERR_ENTITY_BOUNDARY,
 6154|     10|                                 "Element content declaration doesn't start "
 6155|     10|                                 "and stop in the same entity\n",
 6156|     10|                                 NULL, NULL);
 6157|     10|	    }
 6158|  4.03k|#endif
 6159|  4.03k|	    NEXT;
  ------------------
  |  | 2279|  4.03k|#define NEXT xmlNextChar(ctxt)
  ------------------
 6160|  4.03k|	    ret = xmlNewDocElementContent(ctxt->myDoc, NULL, XML_ELEMENT_CONTENT_PCDATA);
 6161|  4.03k|	    if (ret == NULL)
  ------------------
  |  Branch (6161:10): [True: 2, False: 4.02k]
  ------------------
 6162|      2|                goto mem_error;
 6163|  4.02k|	    if (RAW == '*') {
  ------------------
  |  | 2224|  4.02k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (6163:10): [True: 281, False: 3.74k]
  ------------------
 6164|    281|		ret->ocur = XML_ELEMENT_CONTENT_MULT;
 6165|    281|		NEXT;
  ------------------
  |  | 2279|    281|#define NEXT xmlNextChar(ctxt)
  ------------------
 6166|    281|	    }
 6167|  4.02k|	    return(ret);
 6168|  4.03k|	}
 6169|  3.66k|	if ((RAW == '(') || (RAW == '|')) {
  ------------------
  |  | 2224|  3.66k|#define RAW (*ctxt->input->cur)
  ------------------
              	if ((RAW == '(') || (RAW == '|')) {
  ------------------
  |  | 2224|  3.65k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (6169:6): [True: 1, False: 3.65k]
  |  Branch (6169:22): [True: 2.59k, False: 1.06k]
  ------------------
 6170|  2.59k|	    ret = cur = xmlNewDocElementContent(ctxt->myDoc, NULL, XML_ELEMENT_CONTENT_PCDATA);
 6171|  2.59k|	    if (ret == NULL)
  ------------------
  |  Branch (6171:10): [True: 1, False: 2.59k]
  ------------------
 6172|      1|                goto mem_error;
 6173|  2.59k|	}
 6174|  23.1k|	while ((RAW == '|') && (PARSER_STOPPED(ctxt) == 0)) {
  ------------------
  |  | 2224|  23.1k|#define RAW (*ctxt->input->cur)
  ------------------
              	while ((RAW == '|') && (PARSER_STOPPED(ctxt) == 0)) {
  ------------------
  |  |   44|  19.5k|#define PARSER_STOPPED(ctxt) ((ctxt)->disableSAX > 1)
  ------------------
  |  Branch (6174:9): [True: 19.5k, False: 3.56k]
  |  Branch (6174:25): [True: 19.5k, False: 0]
  ------------------
 6175|  19.5k|	    NEXT;
  ------------------
  |  | 2279|  19.5k|#define NEXT xmlNextChar(ctxt)
  ------------------
 6176|  19.5k|            n = xmlNewDocElementContent(ctxt->myDoc, NULL, XML_ELEMENT_CONTENT_OR);
 6177|  19.5k|            if (n == NULL)
  ------------------
  |  Branch (6177:17): [True: 3, False: 19.5k]
  ------------------
 6178|      3|                goto mem_error;
 6179|  19.5k|	    if (elem == NULL) {
  ------------------
  |  Branch (6179:10): [True: 2.58k, False: 16.9k]
  ------------------
 6180|  2.58k|		n->c1 = cur;
 6181|  2.58k|		if (cur != NULL)
  ------------------
  |  Branch (6181:7): [True: 2.58k, False: 0]
  ------------------
 6182|  2.58k|		    cur->parent = n;
 6183|  2.58k|		ret = cur = n;
 6184|  16.9k|	    } else {
 6185|  16.9k|	        cur->c2 = n;
 6186|  16.9k|		n->parent = cur;
 6187|  16.9k|		n->c1 = xmlNewDocElementContent(ctxt->myDoc, elem, XML_ELEMENT_CONTENT_ELEMENT);
 6188|  16.9k|                if (n->c1 == NULL)
  ------------------
  |  Branch (6188:21): [True: 1, False: 16.9k]
  ------------------
 6189|      1|                    goto mem_error;
 6190|  16.9k|		n->c1->parent = n;
 6191|  16.9k|		cur = n;
 6192|  16.9k|	    }
 6193|  19.5k|            xmlSkipBlankCharsPEBalanced(ctxt, openInputNr);
 6194|  19.5k|	    elem = xmlParseName(ctxt);
 6195|  19.5k|	    if (elem == NULL) {
  ------------------
  |  Branch (6195:10): [True: 88, False: 19.4k]
  ------------------
 6196|     88|		xmlFatalErrMsg(ctxt, XML_ERR_NAME_REQUIRED,
 6197|     88|			"xmlParseElementMixedContentDecl : Name expected\n");
 6198|     88|		xmlFreeDocElementContent(ctxt->myDoc, ret);
 6199|     88|		return(NULL);
 6200|     88|	    }
 6201|  19.4k|            xmlSkipBlankCharsPEBalanced(ctxt, openInputNr);
 6202|  19.4k|	}
 6203|  3.56k|	if ((RAW == ')') && (NXT(1) == '*')) {
  ------------------
  |  | 2224|  3.56k|#define RAW (*ctxt->input->cur)
  ------------------
              	if ((RAW == ')') && (NXT(1) == '*')) {
  ------------------
  |  | 2226|  2.32k|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
  |  Branch (6203:6): [True: 2.32k, False: 1.24k]
  |  Branch (6203:22): [True: 2.31k, False: 3]
  ------------------
 6204|  2.31k|	    if (elem != NULL) {
  ------------------
  |  Branch (6204:10): [True: 2.31k, False: 0]
  ------------------
 6205|  2.31k|		cur->c2 = xmlNewDocElementContent(ctxt->myDoc, elem,
 6206|  2.31k|		                               XML_ELEMENT_CONTENT_ELEMENT);
 6207|  2.31k|		if (cur->c2 == NULL)
  ------------------
  |  Branch (6207:7): [True: 1, False: 2.31k]
  ------------------
 6208|      1|                    goto mem_error;
 6209|  2.31k|		cur->c2->parent = cur;
 6210|  2.31k|            }
 6211|  2.31k|            if (ret != NULL)
  ------------------
  |  Branch (6211:17): [True: 2.31k, False: 0]
  ------------------
 6212|  2.31k|                ret->ocur = XML_ELEMENT_CONTENT_MULT;
 6213|  2.31k|#ifdef LIBXML_VALID_ENABLED
 6214|  2.31k|	    if ((ctxt->validate) && (ctxt->inputNr > openInputNr)) {
  ------------------
  |  Branch (6214:10): [True: 1.87k, False: 441]
  |  Branch (6214:30): [True: 3, False: 1.87k]
  ------------------
 6215|      3|		xmlValidityError(ctxt, XML_ERR_ENTITY_BOUNDARY,
 6216|      3|                                 "Element content declaration doesn't start "
 6217|      3|                                 "and stop in the same entity\n",
 6218|      3|                                 NULL, NULL);
 6219|      3|	    }
 6220|  2.31k|#endif
 6221|  2.31k|	    SKIP(2);
  ------------------
  |  | 2248|  2.31k|#define SKIP(val) do {							\
  |  | 2249|  2.31k|    ctxt->input->cur += (val),ctxt->input->col+=(val);			\
  |  | 2250|  2.31k|    if (*ctxt->input->cur == 0)						\
  |  |  ------------------
  |  |  |  Branch (2250:9): [True: 252, False: 2.06k]
  |  |  ------------------
  |  | 2251|  2.31k|        xmlParserGrow(ctxt);						\
  |  | 2252|  2.31k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2252:12): [Folded, False: 2.31k]
  |  |  ------------------
  ------------------
 6222|  2.31k|	} else {
 6223|  1.24k|	    xmlFreeDocElementContent(ctxt->myDoc, ret);
 6224|  1.24k|	    xmlFatalErr(ctxt, XML_ERR_MIXED_NOT_STARTED, NULL);
 6225|  1.24k|	    return(NULL);
 6226|  1.24k|	}
 6227|       |
 6228|  3.56k|    } else {
 6229|      0|	xmlFatalErr(ctxt, XML_ERR_PCDATA_REQUIRED, NULL);
 6230|      0|    }
 6231|  2.31k|    return(ret);
 6232|       |
 6233|      8|mem_error:
 6234|      8|    xmlErrMemory(ctxt);
 6235|      8|    xmlFreeDocElementContent(ctxt->myDoc, ret);
 6236|       |    return(NULL);
 6237|  7.69k|}
xmlParseElementContentDecl:
 6592|  17.0k|                           xmlElementContent **result) {
 6593|       |
 6594|  17.0k|    xmlElementContentPtr tree = NULL;
 6595|  17.0k|    int openInputNr = ctxt->inputNr;
 6596|  17.0k|    int res;
 6597|       |
 6598|  17.0k|    *result = NULL;
 6599|       |
 6600|  17.0k|    if (RAW != '(') {
  ------------------
  |  | 2224|  17.0k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (6600:9): [True: 0, False: 17.0k]
  ------------------
 6601|      0|	xmlFatalErrMsgStr(ctxt, XML_ERR_ELEMCONTENT_NOT_STARTED,
 6602|      0|		"xmlParseElementContentDecl : %s '(' expected\n", name);
 6603|      0|	return(-1);
 6604|      0|    }
 6605|  17.0k|    NEXT;
  ------------------
  |  | 2279|  17.0k|#define NEXT xmlNextChar(ctxt)
  ------------------
 6606|  17.0k|    xmlSkipBlankCharsPEBalanced(ctxt, openInputNr);
 6607|  17.0k|    if (CMP7(CUR_PTR, '#', 'P', 'C', 'D', 'A', 'T', 'A')) {
  ------------------
  |  | 2238|  17.0k|  ( CMP6( s, c1, c2, c3, c4, c5, c6 ) && ((unsigned char *) s)[ 6 ] == c7 )
  |  |  ------------------
  |  |  |  | 2236|  34.0k|  ( CMP5( s, c1, c2, c3, c4, c5 ) && ((unsigned char *) s)[ 5 ] == c6 )
  |  |  |  |  ------------------
  |  |  |  |  |  | 2234|  34.0k|  ( CMP4( s, c1, c2, c3, c4 ) && ((unsigned char *) s)[ 4 ] == c5 )
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  | 2231|  34.0k|  ( ((unsigned char *) s)[ 0 ] == c1 && ((unsigned char *) s)[ 1 ] == c2 && \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (2231:5): [True: 7.70k, False: 9.31k]
  |  |  |  |  |  |  |  |  |  Branch (2231:41): [True: 7.70k, False: 2]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  | 2232|  17.0k|    ((unsigned char *) s)[ 2 ] == c3 && ((unsigned char *) s)[ 3 ] == c4 )
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (2232:5): [True: 7.70k, False: 3]
  |  |  |  |  |  |  |  |  |  Branch (2232:41): [True: 7.69k, False: 6]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (2234:34): [True: 7.69k, False: 2]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2236:38): [True: 7.69k, False: 5]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2238:42): [True: 7.69k, False: 1]
  |  |  ------------------
  ------------------
 6608|  7.69k|        tree = xmlParseElementMixedContentDecl(ctxt, openInputNr);
 6609|  7.69k|	res = XML_ELEMENT_TYPE_MIXED;
 6610|  9.33k|    } else {
 6611|  9.33k|        tree = xmlParseElementChildrenContentDeclPriv(ctxt, openInputNr, 1);
 6612|  9.33k|	res = XML_ELEMENT_TYPE_ELEMENT;
 6613|  9.33k|    }
 6614|  17.0k|    if (tree == NULL)
  ------------------
  |  Branch (6614:9): [True: 3.69k, False: 13.3k]
  ------------------
 6615|  3.69k|        return(-1);
 6616|  13.3k|    SKIP_BLANKS_PE;
  ------------------
  |  | 2277|  13.3k|#define SKIP_BLANKS_PE xmlSkipBlankCharsPE(ctxt)
  ------------------
 6617|  13.3k|    *result = tree;
 6618|  13.3k|    return(res);
 6619|  17.0k|}
xmlParseElementDecl:
 6635|  24.8k|xmlParseElementDecl(xmlParserCtxt *ctxt) {
 6636|  24.8k|    const xmlChar *name;
 6637|  24.8k|    int ret = -1;
 6638|  24.8k|    xmlElementContentPtr content  = NULL;
 6639|       |
 6640|  24.8k|    if ((CUR != '<') || (NXT(1) != '!'))
  ------------------
  |  | 2225|  24.8k|#define CUR (*ctxt->input->cur)
  ------------------
                  if ((CUR != '<') || (NXT(1) != '!'))
  ------------------
  |  | 2226|  24.8k|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
  |  Branch (6640:9): [True: 0, False: 24.8k]
  |  Branch (6640:25): [True: 0, False: 24.8k]
  ------------------
 6641|      0|        return(ret);
 6642|  24.8k|    SKIP(2);
  ------------------
  |  | 2248|  24.8k|#define SKIP(val) do {							\
  |  | 2249|  24.8k|    ctxt->input->cur += (val),ctxt->input->col+=(val);			\
  |  | 2250|  24.8k|    if (*ctxt->input->cur == 0)						\
  |  |  ------------------
  |  |  |  Branch (2250:9): [True: 0, False: 24.8k]
  |  |  ------------------
  |  | 2251|  24.8k|        xmlParserGrow(ctxt);						\
  |  | 2252|  24.8k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2252:12): [Folded, False: 24.8k]
  |  |  ------------------
  ------------------
 6643|       |
 6644|       |    /* GROW; done in the caller */
 6645|  24.8k|    if (CMP7(CUR_PTR, 'E', 'L', 'E', 'M', 'E', 'N', 'T')) {
  ------------------
  |  | 2238|  24.8k|  ( CMP6( s, c1, c2, c3, c4, c5, c6 ) && ((unsigned char *) s)[ 6 ] == c7 )
  |  |  ------------------
  |  |  |  | 2236|  49.7k|  ( CMP5( s, c1, c2, c3, c4, c5 ) && ((unsigned char *) s)[ 5 ] == c6 )
  |  |  |  |  ------------------
  |  |  |  |  |  | 2234|  49.7k|  ( CMP4( s, c1, c2, c3, c4 ) && ((unsigned char *) s)[ 4 ] == c5 )
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  | 2231|  49.7k|  ( ((unsigned char *) s)[ 0 ] == c1 && ((unsigned char *) s)[ 1 ] == c2 && \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (2231:5): [True: 24.8k, False: 0]
  |  |  |  |  |  |  |  |  |  Branch (2231:41): [True: 24.8k, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  | 2232|  24.8k|    ((unsigned char *) s)[ 2 ] == c3 && ((unsigned char *) s)[ 3 ] == c4 )
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (2232:5): [True: 24.8k, False: 10]
  |  |  |  |  |  |  |  |  |  Branch (2232:41): [True: 24.8k, False: 5]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (2234:34): [True: 24.8k, False: 11]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2236:38): [True: 24.8k, False: 5]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2238:42): [True: 24.8k, False: 4]
  |  |  ------------------
  ------------------
 6646|  24.8k|#ifdef LIBXML_VALID_ENABLED
 6647|  24.8k|	int oldInputNr = ctxt->inputNr;
 6648|  24.8k|#endif
 6649|       |
 6650|  24.8k|	SKIP(7);
  ------------------
  |  | 2248|  24.8k|#define SKIP(val) do {							\
  |  | 2249|  24.8k|    ctxt->input->cur += (val),ctxt->input->col+=(val);			\
  |  | 2250|  24.8k|    if (*ctxt->input->cur == 0)						\
  |  |  ------------------
  |  |  |  Branch (2250:9): [True: 76, False: 24.7k]
  |  |  ------------------
  |  | 2251|  24.8k|        xmlParserGrow(ctxt);						\
  |  | 2252|  24.8k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2252:12): [Folded, False: 24.8k]
  |  |  ------------------
  ------------------
 6651|  24.8k|	if (SKIP_BLANKS_PE == 0) {
  ------------------
  |  | 2277|  24.8k|#define SKIP_BLANKS_PE xmlSkipBlankCharsPE(ctxt)
  ------------------
  |  Branch (6651:6): [True: 128, False: 24.7k]
  ------------------
 6652|    128|	    xmlFatalErrMsg(ctxt, XML_ERR_SPACE_REQUIRED,
 6653|    128|		           "Space required after 'ELEMENT'\n");
 6654|    128|	    return(-1);
 6655|    128|	}
 6656|  24.7k|        name = xmlParseName(ctxt);
 6657|  24.7k|	if (name == NULL) {
  ------------------
  |  Branch (6657:6): [True: 399, False: 24.3k]
  ------------------
 6658|    399|	    xmlFatalErrMsg(ctxt, XML_ERR_NAME_REQUIRED,
 6659|    399|			   "xmlParseElementDecl: no name for Element\n");
 6660|    399|	    return(-1);
 6661|    399|	}
 6662|  24.3k|	if (SKIP_BLANKS_PE == 0) {
  ------------------
  |  | 2277|  24.3k|#define SKIP_BLANKS_PE xmlSkipBlankCharsPE(ctxt)
  ------------------
  |  Branch (6662:6): [True: 1.60k, False: 22.7k]
  ------------------
 6663|  1.60k|	    xmlFatalErrMsg(ctxt, XML_ERR_SPACE_REQUIRED,
 6664|  1.60k|			   "Space required after the element name\n");
 6665|  1.60k|	}
 6666|  24.3k|	if (CMP5(CUR_PTR, 'E', 'M', 'P', 'T', 'Y')) {
  ------------------
  |  | 2234|  24.3k|  ( CMP4( s, c1, c2, c3, c4 ) && ((unsigned char *) s)[ 4 ] == c5 )
  |  |  ------------------
  |  |  |  | 2231|  48.6k|  ( ((unsigned char *) s)[ 0 ] == c1 && ((unsigned char *) s)[ 1 ] == c2 && \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2231:5): [True: 5.14k, False: 19.1k]
  |  |  |  |  |  Branch (2231:41): [True: 5.14k, False: 4]
  |  |  |  |  ------------------
  |  |  |  | 2232|  24.3k|    ((unsigned char *) s)[ 2 ] == c3 && ((unsigned char *) s)[ 3 ] == c4 )
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2232:5): [True: 5.14k, False: 1]
  |  |  |  |  |  Branch (2232:41): [True: 5.14k, False: 1]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2234:34): [True: 5.14k, False: 1]
  |  |  ------------------
  ------------------
 6667|  5.14k|	    SKIP(5);
  ------------------
  |  | 2248|  5.14k|#define SKIP(val) do {							\
  |  | 2249|  5.14k|    ctxt->input->cur += (val),ctxt->input->col+=(val);			\
  |  | 2250|  5.14k|    if (*ctxt->input->cur == 0)						\
  |  |  ------------------
  |  |  |  Branch (2250:9): [True: 90, False: 5.05k]
  |  |  ------------------
  |  | 2251|  5.14k|        xmlParserGrow(ctxt);						\
  |  | 2252|  5.14k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2252:12): [Folded, False: 5.14k]
  |  |  ------------------
  ------------------
 6668|       |	    /*
 6669|       |	     * Element must always be empty.
 6670|       |	     */
 6671|  5.14k|	    ret = XML_ELEMENT_TYPE_EMPTY;
 6672|  19.1k|	} else if ((RAW == 'A') && (NXT(1) == 'N') &&
  ------------------
  |  | 2224|  19.1k|#define RAW (*ctxt->input->cur)
  ------------------
              	} else if ((RAW == 'A') && (NXT(1) == 'N') &&
  ------------------
  |  | 2226|  1.28k|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
  |  Branch (6672:13): [True: 1.28k, False: 17.8k]
  |  Branch (6672:29): [True: 1.28k, False: 2]
  ------------------
 6673|  1.28k|	           (NXT(2) == 'Y')) {
  ------------------
  |  | 2226|  1.28k|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
  |  Branch (6673:13): [True: 1.28k, False: 1]
  ------------------
 6674|  1.28k|	    SKIP(3);
  ------------------
  |  | 2248|  1.28k|#define SKIP(val) do {							\
  |  | 2249|  1.28k|    ctxt->input->cur += (val),ctxt->input->col+=(val);			\
  |  | 2250|  1.28k|    if (*ctxt->input->cur == 0)						\
  |  |  ------------------
  |  |  |  Branch (2250:9): [True: 261, False: 1.02k]
  |  |  ------------------
  |  | 2251|  1.28k|        xmlParserGrow(ctxt);						\
  |  | 2252|  1.28k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2252:12): [Folded, False: 1.28k]
  |  |  ------------------
  ------------------
 6675|       |	    /*
 6676|       |	     * Element is a generic container.
 6677|       |	     */
 6678|  1.28k|	    ret = XML_ELEMENT_TYPE_ANY;
 6679|  17.9k|	} else if (RAW == '(') {
  ------------------
  |  | 2224|  17.9k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (6679:13): [True: 17.0k, False: 877]
  ------------------
 6680|  17.0k|	    ret = xmlParseElementContentDecl(ctxt, name, &content);
 6681|  17.0k|            if (ret <= 0)
  ------------------
  |  Branch (6681:17): [True: 3.69k, False: 13.3k]
  ------------------
 6682|  3.69k|                return(-1);
 6683|  17.0k|	} else {
 6684|       |	    /*
 6685|       |	     * [ WFC: PEs in Internal Subset ] error handling.
 6686|       |	     */
 6687|    877|            xmlFatalErrMsg(ctxt, XML_ERR_ELEMCONTENT_NOT_STARTED,
 6688|    877|                  "xmlParseElementDecl: 'EMPTY', 'ANY' or '(' expected\n");
 6689|    877|	    return(-1);
 6690|    877|	}
 6691|       |
 6692|  19.7k|	SKIP_BLANKS_PE;
  ------------------
  |  | 2277|  19.7k|#define SKIP_BLANKS_PE xmlSkipBlankCharsPE(ctxt)
  ------------------
 6693|       |
 6694|  19.7k|	if (RAW != '>') {
  ------------------
  |  | 2224|  19.7k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (6694:6): [True: 1.45k, False: 18.3k]
  ------------------
 6695|  1.45k|	    xmlFatalErr(ctxt, XML_ERR_GT_REQUIRED, NULL);
 6696|  1.45k|	    if (content != NULL) {
  ------------------
  |  Branch (6696:10): [True: 993, False: 465]
  ------------------
 6697|    993|		xmlFreeDocElementContent(ctxt->myDoc, content);
 6698|    993|	    }
 6699|  18.3k|	} else {
 6700|  18.3k|#ifdef LIBXML_VALID_ENABLED
 6701|  18.3k|	    if ((ctxt->validate) && (ctxt->inputNr > oldInputNr)) {
  ------------------
  |  Branch (6701:10): [True: 13.8k, False: 4.42k]
  |  Branch (6701:30): [True: 72, False: 13.8k]
  ------------------
 6702|     72|		xmlValidityError(ctxt, XML_ERR_ENTITY_BOUNDARY,
 6703|     72|                                 "Element declaration doesn't start and stop in"
 6704|     72|                                 " the same entity\n",
 6705|     72|                                 NULL, NULL);
 6706|     72|	    }
 6707|  18.3k|#endif
 6708|       |
 6709|  18.3k|	    NEXT;
  ------------------
  |  | 2279|  18.3k|#define NEXT xmlNextChar(ctxt)
  ------------------
 6710|  18.3k|	    if ((ctxt->sax != NULL) && (!ctxt->disableSAX) &&
  ------------------
  |  Branch (6710:10): [True: 18.3k, False: 0]
  |  Branch (6710:33): [True: 17.4k, False: 888]
  ------------------
 6711|  17.4k|		(ctxt->sax->elementDecl != NULL)) {
  ------------------
  |  Branch (6711:3): [True: 17.4k, False: 0]
  ------------------
 6712|  17.4k|		if (content != NULL)
  ------------------
  |  Branch (6712:7): [True: 11.8k, False: 5.60k]
  ------------------
 6713|  11.8k|		    content->parent = NULL;
 6714|  17.4k|	        ctxt->sax->elementDecl(ctxt->userData, name, ret,
 6715|  17.4k|		                       content);
 6716|  17.4k|		if ((content != NULL) && (content->parent == NULL)) {
  ------------------
  |  Branch (6716:7): [True: 11.8k, False: 5.60k]
  |  Branch (6716:28): [True: 3.37k, False: 8.43k]
  ------------------
 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|  3.37k|		    xmlFreeDocElementContent(ctxt->myDoc, content);
 6724|  3.37k|		}
 6725|  17.4k|	    } else if (content != NULL) {
  ------------------
  |  Branch (6725:17): [True: 529, False: 359]
  ------------------
 6726|    529|		xmlFreeDocElementContent(ctxt->myDoc, content);
 6727|    529|	    }
 6728|  18.3k|	}
 6729|  19.7k|    }
 6730|  19.7k|    return(ret);
 6731|  24.8k|}
xmlParseMarkupDecl:
 6906|   656k|xmlParseMarkupDecl(xmlParserCtxt *ctxt) {
 6907|   656k|    GROW;
  ------------------
  |  | 2271|   656k|    if ((!PARSER_PROGRESSIVE(ctxt)) && \
  |  |  ------------------
  |  |  |  |   47|   656k|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|   656k|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2271:9): [True: 625k, False: 30.5k]
  |  |  ------------------
  |  | 2272|   656k|        (ctxt->input->end - ctxt->input->cur < INPUT_CHUNK)) \
  |  |  ------------------
  |  |  |  |   63|   625k|#define INPUT_CHUNK	250
  |  |  ------------------
  |  |  |  Branch (2272:9): [True: 236k, False: 389k]
  |  |  ------------------
  |  | 2273|   656k|	xmlParserGrow(ctxt);
  ------------------
 6908|   656k|    if (CUR == '<') {
  ------------------
  |  | 2225|   656k|#define CUR (*ctxt->input->cur)
  ------------------
  |  Branch (6908:9): [True: 656k, False: 0]
  ------------------
 6909|   656k|        if (NXT(1) == '!') {
  ------------------
  |  | 2226|   656k|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
  |  Branch (6909:13): [True: 636k, False: 19.3k]
  ------------------
 6910|   636k|	    switch (NXT(2)) {
  ------------------
  |  | 2226|   636k|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
 6911|   186k|	        case 'E':
  ------------------
  |  Branch (6911:10): [True: 186k, False: 449k]
  ------------------
 6912|   186k|		    if (NXT(3) == 'L')
  ------------------
  |  | 2226|   186k|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
  |  Branch (6912:11): [True: 24.8k, False: 162k]
  ------------------
 6913|  24.8k|			xmlParseElementDecl(ctxt);
 6914|   162k|		    else if (NXT(3) == 'N')
  ------------------
  |  | 2226|   162k|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
  |  Branch (6914:16): [True: 161k, False: 25]
  ------------------
 6915|   161k|			xmlParseEntityDecl(ctxt);
 6916|     25|                    else
 6917|     25|                        SKIP(2);
  ------------------
  |  | 2248|     25|#define SKIP(val) do {							\
  |  | 2249|     25|    ctxt->input->cur += (val),ctxt->input->col+=(val);			\
  |  | 2250|     25|    if (*ctxt->input->cur == 0)						\
  |  |  ------------------
  |  |  |  Branch (2250:9): [True: 0, False: 25]
  |  |  ------------------
  |  | 2251|     25|        xmlParserGrow(ctxt);						\
  |  | 2252|     25|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2252:12): [Folded, False: 25]
  |  |  ------------------
  ------------------
 6918|   186k|		    break;
 6919|  94.2k|	        case 'A':
  ------------------
  |  Branch (6919:10): [True: 94.2k, False: 542k]
  ------------------
 6920|  94.2k|		    xmlParseAttributeListDecl(ctxt);
 6921|  94.2k|		    break;
 6922|  5.63k|	        case 'N':
  ------------------
  |  Branch (6922:10): [True: 5.63k, False: 631k]
  ------------------
 6923|  5.63k|		    xmlParseNotationDecl(ctxt);
 6924|  5.63k|		    break;
 6925|   341k|	        case '-':
  ------------------
  |  Branch (6925:10): [True: 341k, False: 295k]
  ------------------
 6926|   341k|		    xmlParseComment(ctxt);
 6927|   341k|		    break;
 6928|  8.42k|		default:
  ------------------
  |  Branch (6928:3): [True: 8.42k, False: 628k]
  ------------------
 6929|  8.42k|                    xmlFatalErr(ctxt,
 6930|  8.42k|                                ctxt->inSubset == 2 ?
  ------------------
  |  Branch (6930:33): [True: 816, False: 7.61k]
  ------------------
 6931|    816|                                    XML_ERR_EXT_SUBSET_NOT_FINISHED :
 6932|  8.42k|                                    XML_ERR_INT_SUBSET_NOT_FINISHED,
 6933|  8.42k|                                NULL);
 6934|  8.42k|                    SKIP(2);
  ------------------
  |  | 2248|  8.42k|#define SKIP(val) do {							\
  |  | 2249|  8.42k|    ctxt->input->cur += (val),ctxt->input->col+=(val);			\
  |  | 2250|  8.42k|    if (*ctxt->input->cur == 0)						\
  |  |  ------------------
  |  |  |  Branch (2250:9): [True: 294, False: 8.13k]
  |  |  ------------------
  |  | 2251|  8.42k|        xmlParserGrow(ctxt);						\
  |  | 2252|  8.42k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2252:12): [Folded, False: 8.42k]
  |  |  ------------------
  ------------------
 6935|  8.42k|		    break;
 6936|   636k|	    }
 6937|   636k|	} else if (NXT(1) == '?') {
  ------------------
  |  | 2226|  19.3k|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
  |  Branch (6937:13): [True: 19.3k, False: 0]
  ------------------
 6938|  19.3k|	    xmlParsePI(ctxt);
 6939|  19.3k|	}
 6940|   656k|    }
 6941|   656k|}
xmlParseTextDecl:
 6953|   170k|xmlParseTextDecl(xmlParserCtxt *ctxt) {
 6954|   170k|    xmlChar *version;
 6955|       |
 6956|       |    /*
 6957|       |     * We know that '<?xml' is here.
 6958|       |     */
 6959|   170k|    if ((CMP5(CUR_PTR, '<', '?', 'x', 'm', 'l')) && (IS_BLANK_CH(NXT(5)))) {
  ------------------
  |  | 2234|   170k|  ( CMP4( s, c1, c2, c3, c4 ) && ((unsigned char *) s)[ 4 ] == c5 )
  |  |  ------------------
  |  |  |  | 2231|   341k|  ( ((unsigned char *) s)[ 0 ] == c1 && ((unsigned char *) s)[ 1 ] == c2 && \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2231:5): [True: 170k, False: 0]
  |  |  |  |  |  Branch (2231:41): [True: 170k, False: 0]
  |  |  |  |  ------------------
  |  |  |  | 2232|   170k|    ((unsigned char *) s)[ 2 ] == c3 && ((unsigned char *) s)[ 3 ] == c4 )
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2232:5): [True: 170k, False: 0]
  |  |  |  |  |  Branch (2232:41): [True: 170k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2234:34): [True: 170k, False: 0]
  |  |  ------------------
  ------------------
                  if ((CMP5(CUR_PTR, '<', '?', 'x', 'm', 'l')) && (IS_BLANK_CH(NXT(5)))) {
  ------------------
  |  |  137|   170k|#define IS_BLANK_CH(c)  xmlIsBlank_ch(c)
  |  |  ------------------
  |  |  |  |   90|   170k|#define xmlIsBlank_ch(c)	(((c) == 0x20) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (90:27): [True: 167k, False: 3.51k]
  |  |  |  |  ------------------
  |  |  |  |   91|   170k|				 ((0x9 <= (c)) && ((c) <= 0xa)) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (91:7): [True: 3.51k, False: 1]
  |  |  |  |  |  Branch (91:23): [True: 1.18k, False: 2.32k]
  |  |  |  |  ------------------
  |  |  |  |   92|   170k|				 ((c) == 0xd))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (92:6): [True: 2.32k, False: 4]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 6960|   170k|	SKIP(5);
  ------------------
  |  | 2248|   170k|#define SKIP(val) do {							\
  |  | 2249|   170k|    ctxt->input->cur += (val),ctxt->input->col+=(val);			\
  |  | 2250|   170k|    if (*ctxt->input->cur == 0)						\
  |  |  ------------------
  |  |  |  Branch (2250:9): [True: 0, False: 170k]
  |  |  ------------------
  |  | 2251|   170k|        xmlParserGrow(ctxt);						\
  |  | 2252|   170k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2252:12): [Folded, False: 170k]
  |  |  ------------------
  ------------------
 6961|   170k|    } else {
 6962|      4|	xmlFatalErr(ctxt, XML_ERR_XMLDECL_NOT_STARTED, NULL);
 6963|      4|	return;
 6964|      4|    }
 6965|       |
 6966|   170k|    if (SKIP_BLANKS == 0) {
  ------------------
  |  | 2275|   170k|#define SKIP_BLANKS xmlSkipBlankChars(ctxt)
  ------------------
  |  Branch (6966:9): [True: 0, False: 170k]
  ------------------
 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|   170k|    version = xmlParseVersionInfo(ctxt);
 6975|   170k|    if (version == NULL) {
  ------------------
  |  Branch (6975:9): [True: 163k, False: 7.08k]
  ------------------
 6976|   163k|	version = xmlCharStrdup(XML_DEFAULT_VERSION);
  ------------------
  |  |   42|   163k|#define XML_DEFAULT_VERSION	"1.0"
  ------------------
 6977|   163k|        if (version == NULL) {
  ------------------
  |  Branch (6977:13): [True: 8, False: 163k]
  ------------------
 6978|      8|            xmlErrMemory(ctxt);
 6979|      8|            return;
 6980|      8|        }
 6981|   163k|    } else {
 6982|  7.08k|	if (SKIP_BLANKS == 0) {
  ------------------
  |  | 2275|  7.08k|#define SKIP_BLANKS xmlSkipBlankChars(ctxt)
  ------------------
  |  Branch (6982:6): [True: 446, False: 6.63k]
  ------------------
 6983|    446|	    xmlFatalErrMsg(ctxt, XML_ERR_SPACE_REQUIRED,
 6984|    446|		           "Space needed here\n");
 6985|    446|	}
 6986|  7.08k|    }
 6987|   170k|    ctxt->input->version = version;
 6988|       |
 6989|       |    /*
 6990|       |     * We must have the encoding declaration
 6991|       |     */
 6992|   170k|    xmlParseEncodingDecl(ctxt);
 6993|       |
 6994|   170k|    SKIP_BLANKS;
  ------------------
  |  | 2275|   170k|#define SKIP_BLANKS xmlSkipBlankChars(ctxt)
  ------------------
 6995|   170k|    if ((RAW == '?') && (NXT(1) == '>')) {
  ------------------
  |  | 2224|   170k|#define RAW (*ctxt->input->cur)
  ------------------
                  if ((RAW == '?') && (NXT(1) == '>')) {
  ------------------
  |  | 2226|  3.43k|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
  |  Branch (6995:9): [True: 3.43k, False: 167k]
  |  Branch (6995:25): [True: 2.59k, False: 847]
  ------------------
 6996|  2.59k|        SKIP(2);
  ------------------
  |  | 2248|  2.59k|#define SKIP(val) do {							\
  |  | 2249|  2.59k|    ctxt->input->cur += (val),ctxt->input->col+=(val);			\
  |  | 2250|  2.59k|    if (*ctxt->input->cur == 0)						\
  |  |  ------------------
  |  |  |  Branch (2250:9): [True: 404, False: 2.18k]
  |  |  ------------------
  |  | 2251|  2.59k|        xmlParserGrow(ctxt);						\
  |  | 2252|  2.59k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2252:12): [Folded, False: 2.59k]
  |  |  ------------------
  ------------------
 6997|   168k|    } else if (RAW == '>') {
  ------------------
  |  | 2224|   168k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (6997:16): [True: 220, False: 167k]
  ------------------
 6998|       |        /* Deprecated old WD ... */
 6999|    220|	xmlFatalErr(ctxt, XML_ERR_XMLDECL_NOT_FINISHED, NULL);
 7000|    220|	NEXT;
  ------------------
  |  | 2279|    220|#define NEXT xmlNextChar(ctxt)
  ------------------
 7001|   167k|    } else {
 7002|   167k|        int c;
 7003|       |
 7004|   167k|	xmlFatalErr(ctxt, XML_ERR_XMLDECL_NOT_FINISHED, NULL);
 7005|   337M|        while ((PARSER_STOPPED(ctxt) == 0) && ((c = CUR) != 0)) {
  ------------------
  |  |   44|   337M|#define PARSER_STOPPED(ctxt) ((ctxt)->disableSAX > 1)
  ------------------
                      while ((PARSER_STOPPED(ctxt) == 0) && ((c = CUR) != 0)) {
  ------------------
  |  | 2225|   337M|#define CUR (*ctxt->input->cur)
  ------------------
  |  Branch (7005:16): [True: 337M, False: 45]
  |  Branch (7005:47): [True: 337M, False: 9.49k]
  ------------------
 7006|   337M|            NEXT;
  ------------------
  |  | 2279|   337M|#define NEXT xmlNextChar(ctxt)
  ------------------
 7007|   337M|            if (c == '>')
  ------------------
  |  Branch (7007:17): [True: 158k, False: 337M]
  ------------------
 7008|   158k|                break;
 7009|   337M|        }
 7010|   167k|    }
 7011|   170k|}
xmlParseExternalSubset:
 7028|  1.43k|                       const xmlChar *systemId) {
 7029|  1.43k|    int oldInputNr;
 7030|       |
 7031|  1.43k|    xmlCtxtInitializeLate(ctxt);
 7032|       |
 7033|  1.43k|    xmlDetectEncoding(ctxt);
 7034|       |
 7035|  1.43k|    if (CMP5(CUR_PTR, '<', '?', 'x', 'm', 'l')) {
  ------------------
  |  | 2234|  1.43k|  ( CMP4( s, c1, c2, c3, c4 ) && ((unsigned char *) s)[ 4 ] == c5 )
  |  |  ------------------
  |  |  |  | 2231|  2.86k|  ( ((unsigned char *) s)[ 0 ] == c1 && ((unsigned char *) s)[ 1 ] == c2 && \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2231:5): [True: 1.32k, False: 113]
  |  |  |  |  |  Branch (2231:41): [True: 142, False: 1.17k]
  |  |  |  |  ------------------
  |  |  |  | 2232|  1.43k|    ((unsigned char *) s)[ 2 ] == c3 && ((unsigned char *) s)[ 3 ] == c4 )
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2232:5): [True: 112, False: 30]
  |  |  |  |  |  Branch (2232:41): [True: 109, False: 3]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2234:34): [True: 100, False: 9]
  |  |  ------------------
  ------------------
 7036|    100|	xmlParseTextDecl(ctxt);
 7037|    100|    }
 7038|  1.43k|    if (ctxt->myDoc == NULL) {
  ------------------
  |  Branch (7038:9): [True: 0, False: 1.43k]
  ------------------
 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.43k|    if ((ctxt->myDoc->intSubset == NULL) &&
  ------------------
  |  Branch (7046:9): [True: 0, False: 1.43k]
  ------------------
 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.43k|    ctxt->inSubset = 2;
 7052|  1.43k|    oldInputNr = ctxt->inputNr;
 7053|       |
 7054|  1.43k|    SKIP_BLANKS;
  ------------------
  |  | 2275|  1.43k|#define SKIP_BLANKS xmlSkipBlankChars(ctxt)
  ------------------
 7055|   256k|    while (!PARSER_STOPPED(ctxt)) {
  ------------------
  |  |   44|   256k|#define PARSER_STOPPED(ctxt) ((ctxt)->disableSAX > 1)
  ------------------
  |  Branch (7055:12): [True: 256k, False: 144]
  ------------------
 7056|   256k|        if (ctxt->input->cur >= ctxt->input->end) {
  ------------------
  |  Branch (7056:13): [True: 1.57k, False: 254k]
  ------------------
 7057|  1.57k|            if (ctxt->inputNr <= oldInputNr) {
  ------------------
  |  Branch (7057:17): [True: 634, False: 944]
  ------------------
 7058|    634|                xmlParserCheckEOF(ctxt, XML_ERR_EXT_SUBSET_NOT_FINISHED);
 7059|    634|                break;
 7060|    634|            }
 7061|       |
 7062|    944|            xmlPopPE(ctxt);
 7063|   254k|        } else if ((RAW == '<') && (NXT(1) == '!') && (NXT(2) == '[')) {
  ------------------
  |  | 2224|   254k|#define RAW (*ctxt->input->cur)
  ------------------
                      } else if ((RAW == '<') && (NXT(1) == '!') && (NXT(2) == '[')) {
  ------------------
  |  | 2226|   252k|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
                      } else if ((RAW == '<') && (NXT(1) == '!') && (NXT(2) == '[')) {
  ------------------
  |  | 2226|   241k|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
  |  Branch (7063:20): [True: 252k, False: 2.47k]
  |  Branch (7063:36): [True: 241k, False: 10.6k]
  |  Branch (7063:55): [True: 966, False: 240k]
  ------------------
 7064|    966|            xmlParseConditionalSections(ctxt);
 7065|   253k|        } else if ((RAW == '<') && ((NXT(1) == '!') || (NXT(1) == '?'))) {
  ------------------
  |  | 2224|   253k|#define RAW (*ctxt->input->cur)
  ------------------
                      } else if ((RAW == '<') && ((NXT(1) == '!') || (NXT(1) == '?'))) {
  ------------------
  |  | 2226|   251k|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
                      } else if ((RAW == '<') && ((NXT(1) == '!') || (NXT(1) == '?'))) {
  ------------------
  |  | 2226|  10.6k|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
  |  Branch (7065:20): [True: 251k, False: 2.47k]
  |  Branch (7065:37): [True: 240k, False: 10.6k]
  |  Branch (7065:56): [True: 10.6k, False: 44]
  ------------------
 7066|   251k|            xmlParseMarkupDecl(ctxt);
 7067|   251k|        } else if (RAW == '%') {
  ------------------
  |  | 2224|  2.52k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (7067:20): [True: 1.86k, False: 656]
  ------------------
 7068|  1.86k|            xmlParsePERefInternal(ctxt, 1);
 7069|  1.86k|        } else {
 7070|    656|            xmlFatalErr(ctxt, XML_ERR_EXT_SUBSET_NOT_FINISHED, NULL);
 7071|       |
 7072|    799|            while (ctxt->inputNr > oldInputNr)
  ------------------
  |  Branch (7072:20): [True: 143, False: 656]
  ------------------
 7073|    143|                xmlPopPE(ctxt);
 7074|    656|            break;
 7075|    656|        }
 7076|   254k|        SKIP_BLANKS;
  ------------------
  |  | 2275|   254k|#define SKIP_BLANKS xmlSkipBlankChars(ctxt)
  ------------------
 7077|   254k|        SHRINK;
  ------------------
  |  | 2267|   254k|    if (!PARSER_PROGRESSIVE(ctxt)) \
  |  |  ------------------
  |  |  |  |   47|   254k|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|   254k|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2267:9): [True: 254k, False: 0]
  |  |  ------------------
  |  | 2268|   254k|	xmlParserShrink(ctxt);
  ------------------
 7078|   254k|        GROW;
  ------------------
  |  | 2271|   254k|    if ((!PARSER_PROGRESSIVE(ctxt)) && \
  |  |  ------------------
  |  |  |  |   47|   254k|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|   254k|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2271:9): [True: 254k, False: 0]
  |  |  ------------------
  |  | 2272|   254k|        (ctxt->input->end - ctxt->input->cur < INPUT_CHUNK)) \
  |  |  ------------------
  |  |  |  |   63|   254k|#define INPUT_CHUNK	250
  |  |  ------------------
  |  |  |  Branch (2272:9): [True: 9.83k, False: 245k]
  |  |  ------------------
  |  | 2273|   254k|	xmlParserGrow(ctxt);
  ------------------
 7079|   254k|    }
 7080|  1.43k|}
xmlParseReference:
 7096|   103k|xmlParseReference(xmlParserCtxt *ctxt) {
 7097|   103k|    xmlEntityPtr ent = NULL;
 7098|   103k|    const xmlChar *name;
 7099|   103k|    xmlChar *val;
 7100|       |
 7101|   103k|    if (RAW != '&')
  ------------------
  |  | 2224|   103k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (7101:9): [True: 0, False: 103k]
  ------------------
 7102|      0|        return;
 7103|       |
 7104|       |    /*
 7105|       |     * Simple case of a CharRef
 7106|       |     */
 7107|   103k|    if (NXT(1) == '#') {
  ------------------
  |  | 2226|   103k|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
  |  Branch (7107:9): [True: 25.8k, False: 77.8k]
  ------------------
 7108|  25.8k|	int i = 0;
 7109|  25.8k|	xmlChar out[16];
 7110|  25.8k|	int value = xmlParseCharRef(ctxt);
 7111|       |
 7112|  25.8k|	if (value == 0)
  ------------------
  |  Branch (7112:6): [True: 6.81k, False: 19.0k]
  ------------------
 7113|  6.81k|	    return;
 7114|       |
 7115|       |        /*
 7116|       |         * Just encode the value in UTF-8
 7117|       |         */
 7118|  19.0k|        COPY_BUF(out, i, value);
  ------------------
  |  | 2296|  19.0k|    if (v < 0x80) b[i++] = v;						\
  |  |  ------------------
  |  |  |  Branch (2296:9): [True: 18.2k, False: 840]
  |  |  ------------------
  |  | 2297|  19.0k|    else i += xmlCopyCharMultiByte(&b[i],v)
  ------------------
 7119|  19.0k|        out[i] = 0;
 7120|  19.0k|        if ((ctxt->sax != NULL) && (ctxt->sax->characters != NULL) &&
  ------------------
  |  Branch (7120:13): [True: 19.0k, False: 0]
  |  Branch (7120:36): [True: 19.0k, False: 0]
  ------------------
 7121|  19.0k|            (!ctxt->disableSAX))
  ------------------
  |  Branch (7121:13): [True: 7.52k, False: 11.5k]
  ------------------
 7122|  7.52k|            ctxt->sax->characters(ctxt->userData, out, i);
 7123|  19.0k|	return;
 7124|  25.8k|    }
 7125|       |
 7126|       |    /*
 7127|       |     * We are seeing an entity reference
 7128|       |     */
 7129|  77.8k|    name = xmlParseEntityRefInternal(ctxt);
 7130|  77.8k|    if (name == NULL)
  ------------------
  |  Branch (7130:9): [True: 18.4k, False: 59.3k]
  ------------------
 7131|  18.4k|        return;
 7132|  59.3k|    ent = xmlLookupGeneralEntity(ctxt, name, /* isAttr */ 0);
 7133|  59.3k|    if (ent == NULL) {
  ------------------
  |  Branch (7133:9): [True: 33.7k, False: 25.6k]
  ------------------
 7134|       |        /*
 7135|       |         * Create a reference for undeclared entities.
 7136|       |         */
 7137|  33.7k|        if ((ctxt->replaceEntities == 0) &&
  ------------------
  |  Branch (7137:13): [True: 27.5k, False: 6.17k]
  ------------------
 7138|  27.5k|            (ctxt->sax != NULL) &&
  ------------------
  |  Branch (7138:13): [True: 27.5k, False: 0]
  ------------------
 7139|  27.5k|            (ctxt->disableSAX == 0) &&
  ------------------
  |  Branch (7139:13): [True: 26.8k, False: 693]
  ------------------
 7140|  26.8k|            (ctxt->sax->reference != NULL)) {
  ------------------
  |  Branch (7140:13): [True: 26.8k, False: 0]
  ------------------
 7141|  26.8k|            ctxt->sax->reference(ctxt->userData, name);
 7142|  26.8k|        }
 7143|  33.7k|        return;
 7144|  33.7k|    }
 7145|  25.6k|    if (!ctxt->wellFormed)
  ------------------
  |  Branch (7145:9): [True: 5.29k, False: 20.3k]
  ------------------
 7146|  5.29k|	return;
 7147|       |
 7148|       |    /* special case of predefined entities */
 7149|  20.3k|    if ((ent->name == NULL) ||
  ------------------
  |  Branch (7149:9): [True: 0, False: 20.3k]
  ------------------
 7150|  20.3k|        (ent->etype == XML_INTERNAL_PREDEFINED_ENTITY)) {
  ------------------
  |  Branch (7150:9): [True: 1.34k, False: 18.9k]
  ------------------
 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|  18.9k|    if (((ent->flags & XML_ENT_PARSED) == 0) && (ent->children != NULL))
  ------------------
  |  |   19|  18.9k|#define XML_ENT_PARSED      (1u << 0)
  ------------------
  |  Branch (7167:9): [True: 4.11k, False: 14.8k]
  |  Branch (7167:49): [True: 0, False: 4.11k]
  ------------------
 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|  18.9k|    if ((ent->etype == XML_INTERNAL_GENERAL_ENTITY) ||
  ------------------
  |  Branch (7210:9): [True: 8.85k, False: 10.1k]
  ------------------
 7211|  10.1k|        (((ctxt->options & XML_PARSE_NO_XXE) == 0) &&
  ------------------
  |  Branch (7211:10): [True: 9.89k, False: 247]
  ------------------
 7212|  9.89k|         ((ctxt->replaceEntities) ||
  ------------------
  |  Branch (7212:11): [True: 7.58k, False: 2.31k]
  ------------------
 7213|  18.3k|          (ctxt->validate)))) {
  ------------------
  |  Branch (7213:11): [True: 1.92k, False: 391]
  ------------------
 7214|  18.3k|        if ((ent->flags & XML_ENT_PARSED) == 0) {
  ------------------
  |  |   19|  18.3k|#define XML_ENT_PARSED      (1u << 0)
  ------------------
  |  Branch (7214:13): [True: 3.47k, False: 14.8k]
  ------------------
 7215|  3.47k|            xmlCtxtParseEntity(ctxt, ent);
 7216|  14.8k|        } else if (ent->children == NULL) {
  ------------------
  |  Branch (7216:20): [True: 3.65k, False: 11.2k]
  ------------------
 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.65k|            xmlCtxtParseEntity(ctxt, ent);
 7227|  3.65k|        }
 7228|  18.3k|    }
 7229|       |
 7230|       |    /*
 7231|       |     * We also check for amplification if entities aren't substituted.
 7232|       |     * They might be expanded later.
 7233|       |     */
 7234|  18.9k|    if (xmlParserEntityCheck(ctxt, ent->expandedSize))
  ------------------
  |  Branch (7234:9): [True: 39, False: 18.9k]
  ------------------
 7235|     39|        return;
 7236|       |
 7237|  18.9k|    if ((ctxt->sax == NULL) || (ctxt->disableSAX))
  ------------------
  |  Branch (7237:9): [True: 0, False: 18.9k]
  |  Branch (7237:32): [True: 826, False: 18.1k]
  ------------------
 7238|    826|        return;
 7239|       |
 7240|  18.1k|    if (ctxt->replaceEntities == 0) {
  ------------------
  |  Branch (7240:9): [True: 5.64k, False: 12.4k]
  ------------------
 7241|       |	/*
 7242|       |	 * Create a reference
 7243|       |	 */
 7244|  5.64k|        if (ctxt->sax->reference != NULL)
  ------------------
  |  Branch (7244:13): [True: 5.64k, False: 0]
  ------------------
 7245|  5.64k|	    ctxt->sax->reference(ctxt->userData, ent->name);
 7246|  12.4k|    } else if ((ent->children != NULL) && (ctxt->node != NULL)) {
  ------------------
  |  Branch (7246:16): [True: 8.96k, False: 3.52k]
  |  Branch (7246:43): [True: 8.96k, False: 0]
  ------------------
 7247|  8.96k|        xmlNodePtr copy, cur;
 7248|       |
 7249|       |        /*
 7250|       |         * Seems we are generating the DOM content, copy the tree
 7251|       |	 */
 7252|  8.96k|        cur = ent->children;
 7253|       |
 7254|       |        /*
 7255|       |         * Handle first text node with SAX to coalesce text efficiently
 7256|       |         */
 7257|  8.96k|        if ((cur->type == XML_TEXT_NODE) ||
  ------------------
  |  Branch (7257:13): [True: 6.86k, False: 2.10k]
  ------------------
 7258|  7.04k|            (cur->type == XML_CDATA_SECTION_NODE)) {
  ------------------
  |  Branch (7258:13): [True: 188, False: 1.91k]
  ------------------
 7259|  7.04k|            int len = xmlStrlen(cur->content);
 7260|       |
 7261|  7.04k|            if ((cur->type == XML_TEXT_NODE) ||
  ------------------
  |  Branch (7261:17): [True: 6.86k, False: 188]
  ------------------
 7262|  6.86k|                (ctxt->options & XML_PARSE_NOCDATA)) {
  ------------------
  |  Branch (7262:17): [True: 0, False: 188]
  ------------------
 7263|  6.86k|                if (ctxt->sax->characters != NULL)
  ------------------
  |  Branch (7263:21): [True: 6.86k, False: 0]
  ------------------
 7264|  6.86k|                    ctxt->sax->characters(ctxt->userData, cur->content, len);
 7265|  6.86k|            } else {
 7266|    188|                if (ctxt->sax->cdataBlock != NULL)
  ------------------
  |  Branch (7266:21): [True: 188, False: 0]
  ------------------
 7267|    188|                    ctxt->sax->cdataBlock(ctxt->userData, cur->content, len);
 7268|    188|            }
 7269|       |
 7270|  7.04k|            cur = cur->next;
 7271|  7.04k|        }
 7272|       |
 7273|  58.1k|        while (cur != NULL) {
  ------------------
  |  Branch (7273:16): [True: 51.2k, False: 6.92k]
  ------------------
 7274|  51.2k|            xmlNodePtr last;
 7275|       |
 7276|       |            /*
 7277|       |             * Handle last text node with SAX to coalesce text efficiently
 7278|       |             */
 7279|  51.2k|            if ((cur->next == NULL) &&
  ------------------
  |  Branch (7279:17): [True: 4.55k, False: 46.6k]
  ------------------
 7280|  4.55k|                ((cur->type == XML_TEXT_NODE) ||
  ------------------
  |  Branch (7280:18): [True: 1.78k, False: 2.77k]
  ------------------
 7281|  2.77k|                 (cur->type == XML_CDATA_SECTION_NODE))) {
  ------------------
  |  Branch (7281:18): [True: 214, False: 2.55k]
  ------------------
 7282|  2.00k|                int len = xmlStrlen(cur->content);
 7283|       |
 7284|  2.00k|                if ((cur->type == XML_TEXT_NODE) ||
  ------------------
  |  Branch (7284:21): [True: 1.78k, False: 214]
  ------------------
 7285|  1.78k|                    (ctxt->options & XML_PARSE_NOCDATA)) {
  ------------------
  |  Branch (7285:21): [True: 0, False: 214]
  ------------------
 7286|  1.78k|                    if (ctxt->sax->characters != NULL)
  ------------------
  |  Branch (7286:25): [True: 1.78k, False: 0]
  ------------------
 7287|  1.78k|                        ctxt->sax->characters(ctxt->userData, cur->content,
 7288|  1.78k|                                              len);
 7289|  1.78k|                } else {
 7290|    214|                    if (ctxt->sax->cdataBlock != NULL)
  ------------------
  |  Branch (7290:25): [True: 214, False: 0]
  ------------------
 7291|    214|                        ctxt->sax->cdataBlock(ctxt->userData, cur->content,
 7292|    214|                                              len);
 7293|    214|                }
 7294|       |
 7295|  2.00k|                break;
 7296|  2.00k|            }
 7297|       |
 7298|       |            /*
 7299|       |             * Reset coalesce buffer stats only for non-text nodes.
 7300|       |             */
 7301|  49.2k|            ctxt->nodemem = 0;
 7302|  49.2k|            ctxt->nodelen = 0;
 7303|       |
 7304|  49.2k|            copy = xmlDocCopyNode(cur, ctxt->myDoc, 1);
 7305|       |
 7306|  49.2k|            if (copy == NULL) {
  ------------------
  |  Branch (7306:17): [True: 40, False: 49.1k]
  ------------------
 7307|     40|                xmlErrMemory(ctxt);
 7308|     40|                break;
 7309|     40|            }
 7310|       |
 7311|  49.1k|            if (ctxt->parseMode == XML_PARSE_READER) {
  ------------------
  |  Branch (7311:17): [True: 48.1k, False: 1.07k]
  ------------------
 7312|       |                /* Needed for reader */
 7313|  48.1k|                copy->extra = cur->extra;
 7314|       |                /* Maybe needed for reader */
 7315|  48.1k|                copy->_private = cur->_private;
 7316|  48.1k|            }
 7317|       |
 7318|  49.1k|            copy->parent = ctxt->node;
 7319|  49.1k|            last = ctxt->node->last;
 7320|  49.1k|            if (last == NULL) {
  ------------------
  |  Branch (7320:17): [True: 752, False: 48.4k]
  ------------------
 7321|    752|                ctxt->node->children = copy;
 7322|  48.4k|            } else {
 7323|  48.4k|                last->next = copy;
 7324|  48.4k|                copy->prev = last;
 7325|  48.4k|            }
 7326|  49.1k|            ctxt->node->last = copy;
 7327|       |
 7328|  49.1k|            cur = cur->next;
 7329|  49.1k|        }
 7330|  8.96k|    }
 7331|  18.1k|}
xmlParseDocTypeDecl:
 7934|  18.6k|xmlParseDocTypeDecl(xmlParserCtxt *ctxt) {
 7935|  18.6k|    const xmlChar *name = NULL;
 7936|  18.6k|    xmlChar *publicId = NULL;
 7937|  18.6k|    xmlChar *URI = NULL;
 7938|       |
 7939|       |    /*
 7940|       |     * We know that '<!DOCTYPE' has been detected.
 7941|       |     */
 7942|  18.6k|    SKIP(9);
  ------------------
  |  | 2248|  18.6k|#define SKIP(val) do {							\
  |  | 2249|  18.6k|    ctxt->input->cur += (val),ctxt->input->col+=(val);			\
  |  | 2250|  18.6k|    if (*ctxt->input->cur == 0)						\
  |  |  ------------------
  |  |  |  Branch (2250:9): [True: 7, False: 18.6k]
  |  |  ------------------
  |  | 2251|  18.6k|        xmlParserGrow(ctxt);						\
  |  | 2252|  18.6k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2252:12): [Folded, False: 18.6k]
  |  |  ------------------
  ------------------
 7943|       |
 7944|  18.6k|    if (SKIP_BLANKS == 0) {
  ------------------
  |  | 2275|  18.6k|#define SKIP_BLANKS xmlSkipBlankChars(ctxt)
  ------------------
  |  Branch (7944:9): [True: 1.17k, False: 17.4k]
  ------------------
 7945|  1.17k|        xmlFatalErrMsg(ctxt, XML_ERR_SPACE_REQUIRED,
 7946|  1.17k|                       "Space required after 'DOCTYPE'\n");
 7947|  1.17k|    }
 7948|       |
 7949|       |    /*
 7950|       |     * Parse the DOCTYPE name.
 7951|       |     */
 7952|  18.6k|    name = xmlParseName(ctxt);
 7953|  18.6k|    if (name == NULL) {
  ------------------
  |  Branch (7953:9): [True: 956, False: 17.6k]
  ------------------
 7954|    956|	xmlFatalErrMsg(ctxt, XML_ERR_NAME_REQUIRED,
 7955|    956|		       "xmlParseDocTypeDecl : no DOCTYPE name !\n");
 7956|    956|    }
 7957|  18.6k|    ctxt->intSubName = name;
 7958|       |
 7959|  18.6k|    SKIP_BLANKS;
  ------------------
  |  | 2275|  18.6k|#define SKIP_BLANKS xmlSkipBlankChars(ctxt)
  ------------------
 7960|       |
 7961|       |    /*
 7962|       |     * Check for public and system identifier (URI)
 7963|       |     */
 7964|  18.6k|    URI = xmlParseExternalID(ctxt, &publicId, 1);
 7965|       |
 7966|  18.6k|    if ((URI != NULL) || (publicId != NULL)) {
  ------------------
  |  Branch (7966:9): [True: 2.79k, False: 15.8k]
  |  Branch (7966:26): [True: 20, False: 15.8k]
  ------------------
 7967|  2.81k|        ctxt->hasExternalSubset = 1;
 7968|  2.81k|    }
 7969|  18.6k|    ctxt->extSubURI = URI;
 7970|  18.6k|    ctxt->extSubSystem = publicId;
 7971|       |
 7972|  18.6k|    SKIP_BLANKS;
  ------------------
  |  | 2275|  18.6k|#define SKIP_BLANKS xmlSkipBlankChars(ctxt)
  ------------------
 7973|       |
 7974|       |    /*
 7975|       |     * Create and update the internal subset.
 7976|       |     */
 7977|  18.6k|    if ((ctxt->sax != NULL) && (ctxt->sax->internalSubset != NULL) &&
  ------------------
  |  Branch (7977:9): [True: 18.6k, False: 0]
  |  Branch (7977:32): [True: 18.6k, False: 0]
  ------------------
 7978|  18.6k|	(!ctxt->disableSAX))
  ------------------
  |  Branch (7978:2): [True: 18.4k, False: 142]
  ------------------
 7979|  18.4k|	ctxt->sax->internalSubset(ctxt->userData, name, publicId, URI);
 7980|       |
 7981|  18.6k|    if ((RAW != '[') && (RAW != '>')) {
  ------------------
  |  | 2224|  18.6k|#define RAW (*ctxt->input->cur)
  ------------------
                  if ((RAW != '[') && (RAW != '>')) {
  ------------------
  |  | 2224|  5.49k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (7981:9): [True: 5.49k, False: 13.1k]
  |  Branch (7981:25): [True: 229, False: 5.26k]
  ------------------
 7982|       |	xmlFatalErr(ctxt, XML_ERR_DOCTYPE_NOT_FINISHED, NULL);
 7983|    229|    }
 7984|  18.6k|}
xmlParseAttribute:
 8090|   210k|xmlParseAttribute(xmlParserCtxt *ctxt, xmlChar **value) {
 8091|   210k|    const xmlChar *name;
 8092|   210k|    xmlChar *val;
 8093|       |
 8094|   210k|    *value = NULL;
 8095|   210k|    GROW;
  ------------------
  |  | 2271|   210k|    if ((!PARSER_PROGRESSIVE(ctxt)) && \
  |  |  ------------------
  |  |  |  |   47|   210k|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|   210k|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2271:9): [True: 123k, False: 87.3k]
  |  |  ------------------
  |  | 2272|   210k|        (ctxt->input->end - ctxt->input->cur < INPUT_CHUNK)) \
  |  |  ------------------
  |  |  |  |   63|   123k|#define INPUT_CHUNK	250
  |  |  ------------------
  |  |  |  Branch (2272:9): [True: 9.94k, False: 113k]
  |  |  ------------------
  |  | 2273|   210k|	xmlParserGrow(ctxt);
  ------------------
 8096|   210k|    name = xmlParseName(ctxt);
 8097|   210k|    if (name == NULL) {
  ------------------
  |  Branch (8097:9): [True: 56.4k, False: 154k]
  ------------------
 8098|  56.4k|	xmlFatalErrMsg(ctxt, XML_ERR_NAME_REQUIRED,
 8099|  56.4k|	               "error parsing attribute name\n");
 8100|  56.4k|        return(NULL);
 8101|  56.4k|    }
 8102|       |
 8103|       |    /*
 8104|       |     * read the value
 8105|       |     */
 8106|   154k|    SKIP_BLANKS;
  ------------------
  |  | 2275|   154k|#define SKIP_BLANKS xmlSkipBlankChars(ctxt)
  ------------------
 8107|   154k|    if (RAW == '=') {
  ------------------
  |  | 2224|   154k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (8107:9): [True: 139k, False: 15.1k]
  ------------------
 8108|   139k|        NEXT;
  ------------------
  |  | 2279|   139k|#define NEXT xmlNextChar(ctxt)
  ------------------
 8109|   139k|	SKIP_BLANKS;
  ------------------
  |  | 2275|   139k|#define SKIP_BLANKS xmlSkipBlankChars(ctxt)
  ------------------
 8110|   139k|	val = xmlParseAttValue(ctxt);
 8111|   139k|    } else {
 8112|  15.1k|	xmlFatalErrMsgStr(ctxt, XML_ERR_ATTRIBUTE_WITHOUT_VALUE,
 8113|  15.1k|	       "Specification mandates value for attribute %s\n", name);
 8114|  15.1k|	return(name);
 8115|  15.1k|    }
 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|   139k|    if ((ctxt->pedantic) && (xmlStrEqual(name, BAD_CAST "xml:lang"))) {
  ------------------
  |  |   34|  72.1k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (8122:9): [True: 72.1k, False: 67.1k]
  |  Branch (8122:29): [True: 13.3k, False: 58.8k]
  ------------------
 8123|  13.3k|	if (!xmlCheckLanguageID(val)) {
  ------------------
  |  Branch (8123:6): [True: 9.14k, False: 4.20k]
  ------------------
 8124|  9.14k|	    xmlWarningMsg(ctxt, XML_WAR_LANG_VALUE,
 8125|  9.14k|		          "Malformed value for xml:lang : %s\n",
 8126|  9.14k|			  val, NULL);
 8127|  9.14k|	}
 8128|  13.3k|    }
 8129|       |
 8130|       |    /*
 8131|       |     * Check that xml:space conforms to the specification
 8132|       |     */
 8133|   139k|    if (xmlStrEqual(name, BAD_CAST "xml:space")) {
  ------------------
  |  |   34|   139k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (8133:9): [True: 859, False: 138k]
  ------------------
 8134|    859|	if (xmlStrEqual(val, BAD_CAST "default"))
  ------------------
  |  |   34|    859|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (8134:6): [True: 113, False: 746]
  ------------------
 8135|    113|	    *(ctxt->space) = 0;
 8136|    746|	else if (xmlStrEqual(val, BAD_CAST "preserve"))
  ------------------
  |  |   34|    746|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (8136:11): [True: 466, False: 280]
  ------------------
 8137|    466|	    *(ctxt->space) = 1;
 8138|    280|	else {
 8139|    280|		xmlWarningMsg(ctxt, XML_WAR_SPACE_VALUE,
 8140|    280|"Invalid value \"%s\" for xml:space : \"default\" or \"preserve\" expected\n",
 8141|    280|                                 val, NULL);
 8142|    280|	}
 8143|    859|    }
 8144|       |
 8145|   139k|    *value = val;
 8146|   139k|    return(name);
 8147|   154k|}
xmlParseStartTag:
 8177|   355k|xmlParseStartTag(xmlParserCtxt *ctxt) {
 8178|   355k|    const xmlChar *name;
 8179|   355k|    const xmlChar *attname;
 8180|   355k|    xmlChar *attvalue;
 8181|   355k|    const xmlChar **atts = ctxt->atts;
 8182|   355k|    int nbatts = 0;
 8183|   355k|    int maxatts = ctxt->maxatts;
 8184|   355k|    int i;
 8185|       |
 8186|   355k|    if (RAW != '<') return(NULL);
  ------------------
  |  | 2224|   355k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (8186:9): [True: 0, False: 355k]
  ------------------
 8187|   355k|    NEXT1;
  ------------------
  |  | 2281|   355k|#define NEXT1 {								\
  |  | 2282|   355k|	ctxt->input->col++;						\
  |  | 2283|   355k|	ctxt->input->cur++;						\
  |  | 2284|   355k|	if (*ctxt->input->cur == 0)					\
  |  |  ------------------
  |  |  |  Branch (2284:6): [True: 561, False: 354k]
  |  |  ------------------
  |  | 2285|   355k|	    xmlParserGrow(ctxt);						\
  |  | 2286|   355k|    }
  ------------------
 8188|       |
 8189|   355k|    name = xmlParseName(ctxt);
 8190|   355k|    if (name == NULL) {
  ------------------
  |  Branch (8190:9): [True: 12.4k, False: 342k]
  ------------------
 8191|  12.4k|	xmlFatalErrMsg(ctxt, XML_ERR_NAME_REQUIRED,
 8192|  12.4k|	     "xmlParseStartTag: invalid element name\n");
 8193|  12.4k|        return(NULL);
 8194|  12.4k|    }
 8195|       |
 8196|       |    /*
 8197|       |     * Now parse the attributes, it ends up with the ending
 8198|       |     *
 8199|       |     * (S Attribute)* S?
 8200|       |     */
 8201|   342k|    SKIP_BLANKS;
  ------------------
  |  | 2275|   342k|#define SKIP_BLANKS xmlSkipBlankChars(ctxt)
  ------------------
 8202|   342k|    GROW;
  ------------------
  |  | 2271|   342k|    if ((!PARSER_PROGRESSIVE(ctxt)) && \
  |  |  ------------------
  |  |  |  |   47|   342k|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|   342k|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2271:9): [True: 212k, False: 129k]
  |  |  ------------------
  |  | 2272|   342k|        (ctxt->input->end - ctxt->input->cur < INPUT_CHUNK)) \
  |  |  ------------------
  |  |  |  |   63|   212k|#define INPUT_CHUNK	250
  |  |  ------------------
  |  |  |  Branch (2272:9): [True: 24.6k, False: 188k]
  |  |  ------------------
  |  | 2273|   342k|	xmlParserGrow(ctxt);
  ------------------
 8203|       |
 8204|   415k|    while (((RAW != '>') &&
  ------------------
  |  | 2224|   415k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (8204:13): [True: 297k, False: 117k]
  ------------------
 8205|   297k|	   ((RAW != '/') || (NXT(1) != '>')) &&
  ------------------
  |  | 2224|   297k|#define RAW (*ctxt->input->cur)
  ------------------
              	   ((RAW != '/') || (NXT(1) != '>')) &&
  ------------------
  |  | 2226|  85.8k|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
  |  Branch (8205:6): [True: 212k, False: 85.8k]
  |  Branch (8205:22): [True: 4.82k, False: 80.9k]
  ------------------
 8206|   216k|	   (IS_BYTE_CHAR(RAW))) && (PARSER_STOPPED(ctxt) == 0)) {
  ------------------
  |  |  103|   216k|#define IS_BYTE_CHAR(c)	 xmlIsChar_ch(c)
  |  |  ------------------
  |  |  |  |  108|   216k|#define xmlIsChar_ch(c)		(((0x9 <= (c)) && ((c) <= 0xa)) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (108:28): [True: 212k, False: 4.90k]
  |  |  |  |  |  Branch (108:44): [True: 0, False: 212k]
  |  |  |  |  ------------------
  |  |  |  |  109|   216k|				 ((c) == 0xd) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (109:6): [True: 0, False: 216k]
  |  |  |  |  ------------------
  |  |  |  |  110|   216k|				  (0x20 <= (c)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (110:7): [True: 210k, False: 5.91k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
              	   (IS_BYTE_CHAR(RAW))) && (PARSER_STOPPED(ctxt) == 0)) {
  ------------------
  |  |   44|   210k|#define PARSER_STOPPED(ctxt) ((ctxt)->disableSAX > 1)
  ------------------
  |  Branch (8206:29): [True: 210k, False: 101]
  ------------------
 8207|   210k|	attname = xmlParseAttribute(ctxt, &attvalue);
 8208|   210k|        if (attname == NULL)
  ------------------
  |  Branch (8208:13): [True: 56.4k, False: 154k]
  ------------------
 8209|  56.4k|	    break;
 8210|   154k|        if (attvalue != NULL) {
  ------------------
  |  Branch (8210:13): [True: 135k, False: 18.8k]
  ------------------
 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|   307k|	    for (i = 0; i < nbatts;i += 2) {
  ------------------
  |  Branch (8216:18): [True: 187k, False: 120k]
  ------------------
 8217|   187k|	        if (xmlStrEqual(atts[i], attname)) {
  ------------------
  |  Branch (8217:14): [True: 14.9k, False: 172k]
  ------------------
 8218|  14.9k|		    xmlErrAttributeDup(ctxt, NULL, attname);
 8219|  14.9k|		    goto failed;
 8220|  14.9k|		}
 8221|   187k|	    }
 8222|       |	    /*
 8223|       |	     * Add the pair to atts
 8224|       |	     */
 8225|   120k|	    if (nbatts + 4 > maxatts) {
  ------------------
  |  Branch (8225:10): [True: 18.2k, False: 102k]
  ------------------
 8226|  18.2k|	        const xmlChar **n;
 8227|  18.2k|                int newSize;
 8228|       |
 8229|  18.2k|                newSize = xmlGrowCapacity(maxatts, sizeof(n[0]) * 2,
 8230|  18.2k|                                          11, XML_MAX_ATTRS);
  ------------------
  |  |   93|  18.2k|#define XML_MAX_ATTRS 100000000 /* 100 million */
  ------------------
 8231|  18.2k|                if (newSize < 0) {
  ------------------
  |  Branch (8231:21): [True: 0, False: 18.2k]
  ------------------
 8232|      0|		    xmlErrMemory(ctxt);
 8233|      0|		    goto failed;
 8234|      0|		}
 8235|  18.2k|#ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
 8236|  18.2k|                if (newSize < 2)
  ------------------
  |  Branch (8236:21): [True: 11.3k, False: 6.91k]
  ------------------
 8237|  11.3k|                    newSize = 2;
 8238|  18.2k|#endif
 8239|  18.2k|	        n = xmlRealloc(atts, newSize * sizeof(n[0]) * 2);
 8240|  18.2k|		if (n == NULL) {
  ------------------
  |  Branch (8240:7): [True: 3, False: 18.2k]
  ------------------
 8241|      3|		    xmlErrMemory(ctxt);
 8242|      3|		    goto failed;
 8243|      3|		}
 8244|  18.2k|		atts = n;
 8245|  18.2k|                maxatts = newSize * 2;
 8246|  18.2k|		ctxt->atts = atts;
 8247|  18.2k|		ctxt->maxatts = maxatts;
 8248|  18.2k|	    }
 8249|       |
 8250|   120k|	    atts[nbatts++] = attname;
 8251|   120k|	    atts[nbatts++] = attvalue;
 8252|   120k|	    atts[nbatts] = NULL;
 8253|   120k|	    atts[nbatts + 1] = NULL;
 8254|       |
 8255|   120k|            attvalue = NULL;
 8256|   120k|	}
 8257|       |
 8258|   154k|failed:
 8259|       |
 8260|   154k|        if (attvalue != NULL)
  ------------------
  |  Branch (8260:13): [True: 14.9k, False: 139k]
  ------------------
 8261|  14.9k|            xmlFree(attvalue);
 8262|       |
 8263|   154k|	GROW
  ------------------
  |  | 2271|   154k|    if ((!PARSER_PROGRESSIVE(ctxt)) && \
  |  |  ------------------
  |  |  |  |   47|   154k|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|   154k|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2271:9): [True: 82.2k, False: 72.1k]
  |  |  ------------------
  |  | 2272|   154k|        (ctxt->input->end - ctxt->input->cur < INPUT_CHUNK)) \
  |  |  ------------------
  |  |  |  |   63|  82.2k|#define INPUT_CHUNK	250
  |  |  ------------------
  |  |  |  Branch (2272:9): [True: 9.24k, False: 73.0k]
  |  |  ------------------
  |  | 2273|   154k|	xmlParserGrow(ctxt);
  ------------------
 8264|   154k|	if ((RAW == '>') || (((RAW == '/') && (NXT(1) == '>'))))
  ------------------
  |  | 2224|   154k|#define RAW (*ctxt->input->cur)
  ------------------
              	if ((RAW == '>') || (((RAW == '/') && (NXT(1) == '>'))))
  ------------------
  |  | 2224|   120k|#define RAW (*ctxt->input->cur)
  ------------------
              	if ((RAW == '>') || (((RAW == '/') && (NXT(1) == '>'))))
  ------------------
  |  | 2226|  48.9k|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
  |  Branch (8264:6): [True: 33.9k, False: 120k]
  |  Branch (8264:24): [True: 48.9k, False: 71.5k]
  |  Branch (8264:40): [True: 48.1k, False: 786]
  ------------------
 8265|  82.1k|	    break;
 8266|  72.3k|	if (SKIP_BLANKS == 0) {
  ------------------
  |  | 2275|  72.3k|#define SKIP_BLANKS xmlSkipBlankChars(ctxt)
  ------------------
  |  Branch (8266:6): [True: 25.4k, False: 46.8k]
  ------------------
 8267|  25.4k|	    xmlFatalErrMsg(ctxt, XML_ERR_SPACE_REQUIRED,
 8268|  25.4k|			   "attributes construct error\n");
 8269|  25.4k|	}
 8270|  72.3k|	SHRINK;
  ------------------
  |  | 2267|  72.3k|    if (!PARSER_PROGRESSIVE(ctxt)) \
  |  |  ------------------
  |  |  |  |   47|  72.3k|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|  72.3k|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2267:9): [True: 27.8k, False: 44.4k]
  |  |  ------------------
  |  | 2268|  72.3k|	xmlParserShrink(ctxt);
  ------------------
 8271|  72.3k|        GROW;
  ------------------
  |  | 2271|  72.3k|    if ((!PARSER_PROGRESSIVE(ctxt)) && \
  |  |  ------------------
  |  |  |  |   47|  72.3k|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|  72.3k|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2271:9): [True: 27.8k, False: 44.4k]
  |  |  ------------------
  |  | 2272|  72.3k|        (ctxt->input->end - ctxt->input->cur < INPUT_CHUNK)) \
  |  |  ------------------
  |  |  |  |   63|  27.8k|#define INPUT_CHUNK	250
  |  |  ------------------
  |  |  |  Branch (2272:9): [True: 5.00k, False: 22.8k]
  |  |  ------------------
  |  | 2273|  72.3k|	xmlParserGrow(ctxt);
  ------------------
 8272|  72.3k|    }
 8273|       |
 8274|       |    /*
 8275|       |     * SAX: Start of Element !
 8276|       |     */
 8277|   342k|    if ((ctxt->sax != NULL) && (ctxt->sax->startElement != NULL) &&
  ------------------
  |  Branch (8277:9): [True: 342k, False: 0]
  |  Branch (8277:32): [True: 342k, False: 0]
  ------------------
 8278|   342k|	(!ctxt->disableSAX)) {
  ------------------
  |  Branch (8278:2): [True: 296k, False: 45.8k]
  ------------------
 8279|   296k|	if (nbatts > 0)
  ------------------
  |  Branch (8279:6): [True: 90.8k, False: 206k]
  ------------------
 8280|  90.8k|	    ctxt->sax->startElement(ctxt->userData, name, atts);
 8281|   206k|	else
 8282|   206k|	    ctxt->sax->startElement(ctxt->userData, name, NULL);
 8283|   296k|    }
 8284|       |
 8285|   342k|    if (atts != NULL) {
  ------------------
  |  Branch (8285:9): [True: 258k, False: 84.4k]
  ------------------
 8286|       |        /* Free only the content strings */
 8287|   378k|        for (i = 1;i < nbatts;i+=2)
  ------------------
  |  Branch (8287:20): [True: 120k, False: 258k]
  ------------------
 8288|   120k|	    if (atts[i] != NULL)
  ------------------
  |  Branch (8288:10): [True: 120k, False: 0]
  ------------------
 8289|   120k|	       xmlFree((xmlChar *) atts[i]);
 8290|   258k|    }
 8291|   342k|    return(name);
 8292|   342k|}
xmlParseCDSect:
 9443|  58.3k|xmlParseCDSect(xmlParserCtxt *ctxt) {
 9444|  58.3k|    xmlChar *buf = NULL;
 9445|  58.3k|    int len = 0;
 9446|  58.3k|    int size = XML_PARSER_BUFFER_SIZE;
  ------------------
  |  |  172|  58.3k|#define XML_PARSER_BUFFER_SIZE 100
  ------------------
 9447|  58.3k|    int r, rl;
 9448|  58.3k|    int	s, sl;
 9449|  58.3k|    int cur, l;
 9450|  58.3k|    int maxLength = (ctxt->options & XML_PARSE_HUGE) ?
  ------------------
  |  Branch (9450:21): [True: 10.1k, False: 48.1k]
  ------------------
 9451|  10.1k|                    XML_MAX_HUGE_LENGTH :
  ------------------
  |  |   55|  10.1k|#define XML_MAX_HUGE_LENGTH 1000000000
  ------------------
 9452|  58.3k|                    XML_MAX_TEXT_LENGTH;
  ------------------
  |  |   50|  48.1k|#define XML_MAX_TEXT_LENGTH 10000000
  ------------------
 9453|       |
 9454|  58.3k|    if ((CUR != '<') || (NXT(1) != '!') || (NXT(2) != '['))
  ------------------
  |  | 2225|  58.3k|#define CUR (*ctxt->input->cur)
  ------------------
                  if ((CUR != '<') || (NXT(1) != '!') || (NXT(2) != '['))
  ------------------
  |  | 2226|  58.3k|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
                  if ((CUR != '<') || (NXT(1) != '!') || (NXT(2) != '['))
  ------------------
  |  | 2226|  58.3k|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
  |  Branch (9454:9): [True: 0, False: 58.3k]
  |  Branch (9454:25): [True: 0, False: 58.3k]
  |  Branch (9454:44): [True: 0, False: 58.3k]
  ------------------
 9455|      0|        return;
 9456|  58.3k|    SKIP(3);
  ------------------
  |  | 2248|  58.3k|#define SKIP(val) do {							\
  |  | 2249|  58.3k|    ctxt->input->cur += (val),ctxt->input->col+=(val);			\
  |  | 2250|  58.3k|    if (*ctxt->input->cur == 0)						\
  |  |  ------------------
  |  |  |  Branch (2250:9): [True: 0, False: 58.3k]
  |  |  ------------------
  |  | 2251|  58.3k|        xmlParserGrow(ctxt);						\
  |  | 2252|  58.3k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2252:12): [Folded, False: 58.3k]
  |  |  ------------------
  ------------------
 9457|       |
 9458|  58.3k|    if (!CMP6(CUR_PTR, 'C', 'D', 'A', 'T', 'A', '['))
  ------------------
  |  | 2236|  58.3k|  ( 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: 58.3k, False: 0]
  |  |  |  |  |  |  |  Branch (2231:41): [True: 58.3k, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 2232|  58.3k|    ((unsigned char *) s)[ 2 ] == c3 && ((unsigned char *) s)[ 3 ] == c4 )
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (2232:5): [True: 58.3k, False: 0]
  |  |  |  |  |  |  |  Branch (2232:41): [True: 58.3k, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2234:34): [True: 58.3k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2236:38): [True: 58.3k, False: 0]
  |  |  ------------------
  ------------------
 9459|      0|        return;
 9460|  58.3k|    SKIP(6);
  ------------------
  |  | 2248|  58.3k|#define SKIP(val) do {							\
  |  | 2249|  58.3k|    ctxt->input->cur += (val),ctxt->input->col+=(val);			\
  |  | 2250|  58.3k|    if (*ctxt->input->cur == 0)						\
  |  |  ------------------
  |  |  |  Branch (2250:9): [True: 90, False: 58.2k]
  |  |  ------------------
  |  | 2251|  58.3k|        xmlParserGrow(ctxt);						\
  |  | 2252|  58.3k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2252:12): [Folded, False: 58.3k]
  |  |  ------------------
  ------------------
 9461|       |
 9462|  58.3k|    r = xmlCurrentCharRecover(ctxt, &rl);
 9463|  58.3k|    if (!IS_CHAR(r)) {
  ------------------
  |  |  115|  58.3k|#define IS_CHAR(c)   xmlIsCharQ(c)
  |  |  ------------------
  |  |  |  |  117|  58.3k|#define xmlIsCharQ(c)		(((c) < 0x100) ? \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (117:25): [True: 53.2k, False: 5.02k]
  |  |  |  |  ------------------
  |  |  |  |  118|  58.3k|				 xmlIsChar_ch((c)) :\
  |  |  |  |  ------------------
  |  |  |  |  |  |  108|  53.2k|#define xmlIsChar_ch(c)		(((0x9 <= (c)) && ((c) <= 0xa)) || \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (108:28): [True: 53.1k, False: 134]
  |  |  |  |  |  |  |  Branch (108:44): [True: 1.24k, False: 51.9k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  109|  53.2k|				 ((c) == 0xd) || \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (109:6): [True: 0, False: 52.0k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  110|  53.2k|				  (0x20 <= (c)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (110:7): [True: 51.8k, False: 200]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  119|  58.3k|				(((0x100 <= (c)) && ((c) <= 0xd7ff)) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (119:7): [True: 5.02k, False: 0]
  |  |  |  |  |  Branch (119:25): [True: 1.97k, False: 3.04k]
  |  |  |  |  ------------------
  |  |  |  |  120|  5.02k|				 ((0xe000 <= (c)) && ((c) <= 0xfffd)) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (120:7): [True: 3.04k, False: 0]
  |  |  |  |  |  Branch (120:26): [True: 2.58k, False: 465]
  |  |  |  |  ------------------
  |  |  |  |  121|  5.02k|				 ((0x10000 <= (c)) && ((c) <= 0x10ffff))))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (121:7): [True: 398, False: 67]
  |  |  |  |  |  Branch (121:27): [True: 398, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (9463:9): [True: 267, False: 58.0k]
  ------------------
 9464|    267|	xmlFatalErr(ctxt, XML_ERR_CDATA_NOT_FINISHED, NULL);
 9465|    267|        goto out;
 9466|    267|    }
 9467|  58.0k|    NEXTL(rl);
  ------------------
  |  | 2288|  58.0k|#define NEXTL(l) do {							\
  |  | 2289|  58.0k|    if (*(ctxt->input->cur) == '\n') {					\
  |  |  ------------------
  |  |  |  Branch (2289:9): [True: 1.22k, False: 56.8k]
  |  |  ------------------
  |  | 2290|  1.22k|	ctxt->input->line++; ctxt->input->col = 1;			\
  |  | 2291|  56.8k|    } else ctxt->input->col++;						\
  |  | 2292|  58.0k|    ctxt->input->cur += l;				\
  |  | 2293|  58.0k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2293:12): [Folded, False: 58.0k]
  |  |  ------------------
  ------------------
 9468|  58.0k|    s = xmlCurrentCharRecover(ctxt, &sl);
 9469|  58.0k|    if (!IS_CHAR(s)) {
  ------------------
  |  |  115|  58.0k|#define IS_CHAR(c)   xmlIsCharQ(c)
  |  |  ------------------
  |  |  |  |  117|  58.0k|#define xmlIsCharQ(c)		(((c) < 0x100) ? \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (117:25): [True: 55.5k, False: 2.54k]
  |  |  |  |  ------------------
  |  |  |  |  118|  58.0k|				 xmlIsChar_ch((c)) :\
  |  |  |  |  ------------------
  |  |  |  |  |  |  108|  55.5k|#define xmlIsChar_ch(c)		(((0x9 <= (c)) && ((c) <= 0xa)) || \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (108:28): [True: 51.8k, False: 3.68k]
  |  |  |  |  |  |  |  Branch (108:44): [True: 330, False: 51.4k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  109|  55.5k|				 ((c) == 0xd) || \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (109:6): [True: 0, False: 55.1k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  110|  55.5k|				  (0x20 <= (c)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (110:7): [True: 51.3k, False: 3.83k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  119|  58.0k|				(((0x100 <= (c)) && ((c) <= 0xd7ff)) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (119:7): [True: 2.54k, False: 0]
  |  |  |  |  |  Branch (119:25): [True: 616, False: 1.92k]
  |  |  |  |  ------------------
  |  |  |  |  120|  2.54k|				 ((0xe000 <= (c)) && ((c) <= 0xfffd)) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (120:7): [True: 1.92k, False: 0]
  |  |  |  |  |  Branch (120:26): [True: 1.49k, False: 428]
  |  |  |  |  ------------------
  |  |  |  |  121|  2.54k|				 ((0x10000 <= (c)) && ((c) <= 0x10ffff))))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (121:7): [True: 226, False: 202]
  |  |  |  |  |  Branch (121:27): [True: 226, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (9469:9): [True: 4.03k, False: 54.0k]
  ------------------
 9470|  4.03k|	xmlFatalErr(ctxt, XML_ERR_CDATA_NOT_FINISHED, NULL);
 9471|  4.03k|        goto out;
 9472|  4.03k|    }
 9473|  54.0k|    NEXTL(sl);
  ------------------
  |  | 2288|  54.0k|#define NEXTL(l) do {							\
  |  | 2289|  54.0k|    if (*(ctxt->input->cur) == '\n') {					\
  |  |  ------------------
  |  |  |  Branch (2289:9): [True: 313, False: 53.6k]
  |  |  ------------------
  |  | 2290|    313|	ctxt->input->line++; ctxt->input->col = 1;			\
  |  | 2291|  53.6k|    } else ctxt->input->col++;						\
  |  | 2292|  54.0k|    ctxt->input->cur += l;				\
  |  | 2293|  54.0k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2293:12): [Folded, False: 54.0k]
  |  |  ------------------
  ------------------
 9474|  54.0k|    cur = xmlCurrentCharRecover(ctxt, &l);
 9475|  54.0k|    buf = xmlMalloc(size);
 9476|  54.0k|    if (buf == NULL) {
  ------------------
  |  Branch (9476:9): [True: 2, False: 54.0k]
  ------------------
 9477|      2|	xmlErrMemory(ctxt);
 9478|      2|        goto out;
 9479|      2|    }
 9480|  1.27M|    while (IS_CHAR(cur) &&
  ------------------
  |  |  115|  1.27M|#define IS_CHAR(c)   xmlIsCharQ(c)
  |  |  ------------------
  |  |  |  |  117|  2.55M|#define xmlIsCharQ(c)		(((c) < 0x100) ? \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (117:24): [True: 1.27M, False: 4.26k]
  |  |  |  |  |  Branch (117:25): [True: 1.23M, False: 37.8k]
  |  |  |  |  ------------------
  |  |  |  |  118|  2.55M|				 xmlIsChar_ch((c)) :\
  |  |  |  |  ------------------
  |  |  |  |  |  |  108|  1.23M|#define xmlIsChar_ch(c)		(((0x9 <= (c)) && ((c) <= 0xa)) || \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (108:28): [True: 1.23M, False: 2.57k]
  |  |  |  |  |  |  |  Branch (108:44): [True: 4.12k, False: 1.23M]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  109|  1.23M|				 ((c) == 0xd) || \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (109:6): [True: 0, False: 1.23M]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  110|  1.23M|				  (0x20 <= (c)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (110:7): [True: 1.22M, False: 4.06k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  119|  2.55M|				(((0x100 <= (c)) && ((c) <= 0xd7ff)) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (119:7): [True: 37.8k, False: 0]
  |  |  |  |  |  Branch (119:25): [True: 3.70k, False: 34.1k]
  |  |  |  |  ------------------
  |  |  |  |  120|  37.8k|				 ((0xe000 <= (c)) && ((c) <= 0xfffd)) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (120:7): [True: 34.1k, False: 0]
  |  |  |  |  |  Branch (120:26): [True: 33.5k, False: 611]
  |  |  |  |  ------------------
  |  |  |  |  121|  37.8k|				 ((0x10000 <= (c)) && ((c) <= 0x10ffff))))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (121:7): [True: 408, False: 203]
  |  |  |  |  |  Branch (121:27): [True: 408, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 9481|  1.27M|           ((r != ']') || (s != ']') || (cur != '>'))) {
  ------------------
  |  Branch (9481:13): [True: 1.21M, False: 52.6k]
  |  Branch (9481:27): [True: 1.30k, False: 51.3k]
  |  Branch (9481:41): [True: 1.62k, False: 49.7k]
  ------------------
 9482|  1.22M|	if (len + 5 >= size) {
  ------------------
  |  Branch (9482:6): [True: 1.61k, False: 1.21M]
  ------------------
 9483|  1.61k|	    xmlChar *tmp;
 9484|  1.61k|            int newSize;
 9485|       |
 9486|  1.61k|            newSize = xmlGrowCapacity(size, 1, 1, maxLength);
 9487|  1.61k|            if (newSize < 0) {
  ------------------
  |  Branch (9487:17): [True: 0, False: 1.61k]
  ------------------
 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.61k|	    tmp = xmlRealloc(buf, newSize);
 9493|  1.61k|	    if (tmp == NULL) {
  ------------------
  |  Branch (9493:10): [True: 1, False: 1.61k]
  ------------------
 9494|      1|		xmlErrMemory(ctxt);
 9495|      1|                goto out;
 9496|      1|	    }
 9497|  1.61k|	    buf = tmp;
 9498|  1.61k|	    size = newSize;
 9499|  1.61k|	}
 9500|  1.22M|	COPY_BUF(buf, len, r);
  ------------------
  |  | 2296|  1.22M|    if (v < 0x80) b[i++] = v;						\
  |  |  ------------------
  |  |  |  Branch (2296:9): [True: 186k, False: 1.03M]
  |  |  ------------------
  |  | 2297|  1.22M|    else i += xmlCopyCharMultiByte(&b[i],v)
  ------------------
 9501|  1.22M|	r = s;
 9502|  1.22M|	rl = sl;
 9503|  1.22M|	s = cur;
 9504|  1.22M|	sl = l;
 9505|  1.22M|	NEXTL(l);
  ------------------
  |  | 2288|  1.22M|#define NEXTL(l) do {							\
  |  | 2289|  1.22M|    if (*(ctxt->input->cur) == '\n') {					\
  |  |  ------------------
  |  |  |  Branch (2289:9): [True: 3.76k, False: 1.21M]
  |  |  ------------------
  |  | 2290|  3.76k|	ctxt->input->line++; ctxt->input->col = 1;			\
  |  | 2291|  1.21M|    } else ctxt->input->col++;						\
  |  | 2292|  1.22M|    ctxt->input->cur += l;				\
  |  | 2293|  1.22M|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2293:12): [Folded, False: 1.22M]
  |  |  ------------------
  ------------------
 9506|  1.22M|	cur = xmlCurrentCharRecover(ctxt, &l);
 9507|  1.22M|    }
 9508|  54.0k|    buf[len] = 0;
 9509|  54.0k|    if (cur != '>') {
  ------------------
  |  Branch (9509:9): [True: 4.26k, False: 49.7k]
  ------------------
 9510|  4.26k|	xmlFatalErrMsgStr(ctxt, XML_ERR_CDATA_NOT_FINISHED,
 9511|  4.26k|	                     "CData section not finished\n%.50s\n", buf);
 9512|  4.26k|        goto out;
 9513|  4.26k|    }
 9514|  49.7k|    NEXTL(l);
  ------------------
  |  | 2288|  49.7k|#define NEXTL(l) do {							\
  |  | 2289|  49.7k|    if (*(ctxt->input->cur) == '\n') {					\
  |  |  ------------------
  |  |  |  Branch (2289:9): [True: 0, False: 49.7k]
  |  |  ------------------
  |  | 2290|      0|	ctxt->input->line++; ctxt->input->col = 1;			\
  |  | 2291|  49.7k|    } else ctxt->input->col++;						\
  |  | 2292|  49.7k|    ctxt->input->cur += l;				\
  |  | 2293|  49.7k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2293:12): [Folded, False: 49.7k]
  |  |  ------------------
  ------------------
 9515|       |
 9516|       |    /*
 9517|       |     * OK the buffer is to be consumed as cdata.
 9518|       |     */
 9519|  49.7k|    if ((ctxt->sax != NULL) && (!ctxt->disableSAX)) {
  ------------------
  |  Branch (9519:9): [True: 49.7k, False: 0]
  |  Branch (9519:32): [True: 49.4k, False: 305]
  ------------------
 9520|  49.4k|        if ((ctxt->sax->cdataBlock != NULL) &&
  ------------------
  |  Branch (9520:13): [True: 49.4k, False: 0]
  ------------------
 9521|  49.4k|            ((ctxt->options & XML_PARSE_NOCDATA) == 0)) {
  ------------------
  |  Branch (9521:13): [True: 33.6k, False: 15.8k]
  ------------------
 9522|  33.6k|            ctxt->sax->cdataBlock(ctxt->userData, buf, len);
 9523|  33.6k|        } else if (ctxt->sax->characters != NULL) {
  ------------------
  |  Branch (9523:20): [True: 15.8k, False: 0]
  ------------------
 9524|  15.8k|            ctxt->sax->characters(ctxt->userData, buf, len);
 9525|  15.8k|        }
 9526|  49.4k|    }
 9527|       |
 9528|  58.3k|out:
 9529|  58.3k|    xmlFree(buf);
 9530|  58.3k|}
xmlParseElement:
 9670|  7.57k|xmlParseElement(xmlParserCtxt *ctxt) {
 9671|  7.57k|    if (xmlParseElementStart(ctxt) != 0)
  ------------------
  |  Branch (9671:9): [True: 3.06k, False: 4.50k]
  ------------------
 9672|  3.06k|        return;
 9673|       |
 9674|  4.50k|    xmlParseContentInternal(ctxt);
 9675|       |
 9676|  4.50k|    if (ctxt->input->cur >= ctxt->input->end) {
  ------------------
  |  Branch (9676:9): [True: 419, False: 4.08k]
  ------------------
 9677|    419|        if (ctxt->wellFormed) {
  ------------------
  |  Branch (9677:13): [True: 2, False: 417]
  ------------------
 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|    419|        return;
 9685|    419|    }
 9686|       |
 9687|  4.08k|    xmlParseElementEnd(ctxt);
 9688|  4.08k|}
xmlParseVersionNum:
 9868|  13.2k|xmlParseVersionNum(xmlParserCtxt *ctxt) {
 9869|  13.2k|    xmlChar *buf = NULL;
 9870|  13.2k|    int len = 0;
 9871|  13.2k|    int size = 10;
 9872|  13.2k|    int maxLength = (ctxt->options & XML_PARSE_HUGE) ?
  ------------------
  |  Branch (9872:21): [True: 4.94k, False: 8.29k]
  ------------------
 9873|  4.94k|                    XML_MAX_TEXT_LENGTH :
  ------------------
  |  |   50|  4.94k|#define XML_MAX_TEXT_LENGTH 10000000
  ------------------
 9874|  13.2k|                    XML_MAX_NAME_LENGTH;
  ------------------
  |  |   65|  8.29k|#define XML_MAX_NAME_LENGTH 50000
  ------------------
 9875|  13.2k|    xmlChar cur;
 9876|       |
 9877|  13.2k|    buf = xmlMalloc(size);
 9878|  13.2k|    if (buf == NULL) {
  ------------------
  |  Branch (9878:9): [True: 3, False: 13.2k]
  ------------------
 9879|      3|	xmlErrMemory(ctxt);
 9880|      3|	return(NULL);
 9881|      3|    }
 9882|  13.2k|    cur = CUR;
  ------------------
  |  | 2225|  13.2k|#define CUR (*ctxt->input->cur)
  ------------------
 9883|  13.2k|    if (!((cur >= '0') && (cur <= '9'))) {
  ------------------
  |  Branch (9883:11): [True: 12.6k, False: 542]
  |  Branch (9883:27): [True: 12.4k, False: 226]
  ------------------
 9884|    768|	xmlFree(buf);
 9885|    768|	return(NULL);
 9886|    768|    }
 9887|  12.4k|    buf[len++] = cur;
 9888|  12.4k|    NEXT;
  ------------------
  |  | 2279|  12.4k|#define NEXT xmlNextChar(ctxt)
  ------------------
 9889|  12.4k|    cur=CUR;
  ------------------
  |  | 2225|  12.4k|#define CUR (*ctxt->input->cur)
  ------------------
 9890|  12.4k|    if (cur != '.') {
  ------------------
  |  Branch (9890:9): [True: 2.78k, False: 9.68k]
  ------------------
 9891|  2.78k|	xmlFree(buf);
 9892|  2.78k|	return(NULL);
 9893|  2.78k|    }
 9894|  9.68k|    buf[len++] = cur;
 9895|  9.68k|    NEXT;
  ------------------
  |  | 2279|  9.68k|#define NEXT xmlNextChar(ctxt)
  ------------------
 9896|  9.68k|    cur=CUR;
  ------------------
  |  | 2225|  9.68k|#define CUR (*ctxt->input->cur)
  ------------------
 9897|  1.29M|    while ((cur >= '0') && (cur <= '9')) {
  ------------------
  |  Branch (9897:12): [True: 1.28M, False: 9.40k]
  |  Branch (9897:28): [True: 1.28M, False: 279]
  ------------------
 9898|  1.28M|	if (len + 1 >= size) {
  ------------------
  |  Branch (9898:6): [True: 587, False: 1.28M]
  ------------------
 9899|    587|	    xmlChar *tmp;
 9900|    587|            int newSize;
 9901|       |
 9902|    587|            newSize = xmlGrowCapacity(size, 1, 1, maxLength);
 9903|    587|            if (newSize < 0) {
  ------------------
  |  Branch (9903:17): [True: 1, False: 586]
  ------------------
 9904|      1|                xmlFatalErr(ctxt, XML_ERR_NAME_TOO_LONG, "VersionNum");
 9905|      1|                xmlFree(buf);
 9906|      1|                return(NULL);
 9907|      1|            }
 9908|    586|	    tmp = xmlRealloc(buf, newSize);
 9909|    586|	    if (tmp == NULL) {
  ------------------
  |  Branch (9909:10): [True: 1, False: 585]
  ------------------
 9910|      1|		xmlErrMemory(ctxt);
 9911|      1|	        xmlFree(buf);
 9912|      1|		return(NULL);
 9913|      1|	    }
 9914|    585|	    buf = tmp;
 9915|    585|            size = newSize;
 9916|    585|	}
 9917|  1.28M|	buf[len++] = cur;
 9918|  1.28M|	NEXT;
  ------------------
  |  | 2279|  1.28M|#define NEXT xmlNextChar(ctxt)
  ------------------
 9919|  1.28M|	cur=CUR;
  ------------------
  |  | 2225|  1.28M|#define CUR (*ctxt->input->cur)
  ------------------
 9920|  1.28M|    }
 9921|  9.68k|    buf[len] = 0;
 9922|  9.68k|    return(buf);
 9923|  9.68k|}
xmlParseVersionInfo:
 9939|   174k|xmlParseVersionInfo(xmlParserCtxt *ctxt) {
 9940|   174k|    xmlChar *version = NULL;
 9941|       |
 9942|   174k|    if (CMP7(CUR_PTR, 'v', 'e', 'r', 's', 'i', 'o', 'n')) {
  ------------------
  |  | 2238|   174k|  ( CMP6( s, c1, c2, c3, c4, c5, c6 ) && ((unsigned char *) s)[ 6 ] == c7 )
  |  |  ------------------
  |  |  |  | 2236|   348k|  ( CMP5( s, c1, c2, c3, c4, c5 ) && ((unsigned char *) s)[ 5 ] == c6 )
  |  |  |  |  ------------------
  |  |  |  |  |  | 2234|   348k|  ( CMP4( s, c1, c2, c3, c4 ) && ((unsigned char *) s)[ 4 ] == c5 )
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  | 2231|   348k|  ( ((unsigned char *) s)[ 0 ] == c1 && ((unsigned char *) s)[ 1 ] == c2 && \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (2231:5): [True: 17.4k, False: 156k]
  |  |  |  |  |  |  |  |  |  Branch (2231:41): [True: 16.9k, False: 568]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  | 2232|   174k|    ((unsigned char *) s)[ 2 ] == c3 && ((unsigned char *) s)[ 3 ] == c4 )
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (2232:5): [True: 16.0k, False: 860]
  |  |  |  |  |  |  |  |  |  Branch (2232:41): [True: 15.5k, False: 525]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (2234:34): [True: 15.1k, False: 408]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2236:38): [True: 14.5k, False: 522]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2238:42): [True: 14.3k, False: 299]
  |  |  ------------------
  ------------------
 9943|  14.3k|	SKIP(7);
  ------------------
  |  | 2248|  14.3k|#define SKIP(val) do {							\
  |  | 2249|  14.3k|    ctxt->input->cur += (val),ctxt->input->col+=(val);			\
  |  | 2250|  14.3k|    if (*ctxt->input->cur == 0)						\
  |  |  ------------------
  |  |  |  Branch (2250:9): [True: 250, False: 14.0k]
  |  |  ------------------
  |  | 2251|  14.3k|        xmlParserGrow(ctxt);						\
  |  | 2252|  14.3k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2252:12): [Folded, False: 14.3k]
  |  |  ------------------
  ------------------
 9944|  14.3k|	SKIP_BLANKS;
  ------------------
  |  | 2275|  14.3k|#define SKIP_BLANKS xmlSkipBlankChars(ctxt)
  ------------------
 9945|  14.3k|	if (RAW != '=') {
  ------------------
  |  | 2224|  14.3k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (9945:6): [True: 611, False: 13.6k]
  ------------------
 9946|    611|	    xmlFatalErr(ctxt, XML_ERR_EQUAL_REQUIRED, NULL);
 9947|    611|	    return(NULL);
 9948|    611|        }
 9949|  13.6k|	NEXT;
  ------------------
  |  | 2279|  13.6k|#define NEXT xmlNextChar(ctxt)
  ------------------
 9950|  13.6k|	SKIP_BLANKS;
  ------------------
  |  | 2275|  13.6k|#define SKIP_BLANKS xmlSkipBlankChars(ctxt)
  ------------------
 9951|  13.6k|	if (RAW == '"') {
  ------------------
  |  | 2224|  13.6k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (9951:6): [True: 3.12k, False: 10.5k]
  ------------------
 9952|  3.12k|	    NEXT;
  ------------------
  |  | 2279|  3.12k|#define NEXT xmlNextChar(ctxt)
  ------------------
 9953|  3.12k|	    version = xmlParseVersionNum(ctxt);
 9954|  3.12k|	    if (RAW != '"') {
  ------------------
  |  | 2224|  3.12k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (9954:10): [True: 394, False: 2.72k]
  ------------------
 9955|    394|		xmlFatalErr(ctxt, XML_ERR_STRING_NOT_CLOSED, NULL);
 9956|    394|	    } else
 9957|  2.72k|	        NEXT;
  ------------------
  |  | 2279|  2.72k|#define NEXT xmlNextChar(ctxt)
  ------------------
 9958|  10.5k|	} else if (RAW == '\''){
  ------------------
  |  | 2224|  10.5k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (9958:13): [True: 10.1k, False: 446]
  ------------------
 9959|  10.1k|	    NEXT;
  ------------------
  |  | 2279|  10.1k|#define NEXT xmlNextChar(ctxt)
  ------------------
 9960|  10.1k|	    version = xmlParseVersionNum(ctxt);
 9961|  10.1k|	    if (RAW != '\'') {
  ------------------
  |  | 2224|  10.1k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (9961:10): [True: 3.47k, False: 6.64k]
  ------------------
 9962|  3.47k|		xmlFatalErr(ctxt, XML_ERR_STRING_NOT_CLOSED, NULL);
 9963|  3.47k|	    } else
 9964|  6.64k|	        NEXT;
  ------------------
  |  | 2279|  6.64k|#define NEXT xmlNextChar(ctxt)
  ------------------
 9965|  10.1k|	} else {
 9966|    446|	    xmlFatalErr(ctxt, XML_ERR_STRING_NOT_STARTED, NULL);
 9967|    446|	}
 9968|  13.6k|    }
 9969|   173k|    return(version);
 9970|   174k|}
xmlParseEncName:
 9983|  7.84k|xmlParseEncName(xmlParserCtxt *ctxt) {
 9984|  7.84k|    xmlChar *buf = NULL;
 9985|  7.84k|    int len = 0;
 9986|  7.84k|    int size = 10;
 9987|  7.84k|    int maxLength = (ctxt->options & XML_PARSE_HUGE) ?
  ------------------
  |  Branch (9987:21): [True: 2.94k, False: 4.90k]
  ------------------
 9988|  2.94k|                    XML_MAX_TEXT_LENGTH :
  ------------------
  |  |   50|  2.94k|#define XML_MAX_TEXT_LENGTH 10000000
  ------------------
 9989|  7.84k|                    XML_MAX_NAME_LENGTH;
  ------------------
  |  |   65|  4.90k|#define XML_MAX_NAME_LENGTH 50000
  ------------------
 9990|  7.84k|    xmlChar cur;
 9991|       |
 9992|  7.84k|    cur = CUR;
  ------------------
  |  | 2225|  7.84k|#define CUR (*ctxt->input->cur)
  ------------------
 9993|  7.84k|    if (((cur >= 'a') && (cur <= 'z')) ||
  ------------------
  |  Branch (9993:10): [True: 1.17k, False: 6.66k]
  |  Branch (9993:26): [True: 905, False: 270]
  ------------------
 9994|  7.32k|        ((cur >= 'A') && (cur <= 'Z'))) {
  ------------------
  |  Branch (9994:10): [True: 6.68k, False: 247]
  |  Branch (9994:26): [True: 6.41k, False: 273]
  ------------------
 9995|  7.32k|	buf = xmlMalloc(size);
 9996|  7.32k|	if (buf == NULL) {
  ------------------
  |  Branch (9996:6): [True: 4, False: 7.31k]
  ------------------
 9997|      4|	    xmlErrMemory(ctxt);
 9998|      4|	    return(NULL);
 9999|      4|	}
10000|       |
10001|  7.31k|	buf[len++] = cur;
10002|  7.31k|	NEXT;
  ------------------
  |  | 2279|  7.31k|#define NEXT xmlNextChar(ctxt)
  ------------------
10003|  7.31k|	cur = CUR;
  ------------------
  |  | 2225|  7.31k|#define CUR (*ctxt->input->cur)
  ------------------
10004|  1.04M|	while (((cur >= 'a') && (cur <= 'z')) ||
  ------------------
  |  Branch (10004:10): [True: 118k, False: 923k]
  |  Branch (10004:26): [True: 117k, False: 517]
  ------------------
10005|   924k|	       ((cur >= 'A') && (cur <= 'Z')) ||
  ------------------
  |  Branch (10005:10): [True: 17.9k, False: 906k]
  |  Branch (10005:26): [True: 17.2k, False: 738]
  ------------------
10006|   906k|	       ((cur >= '0') && (cur <= '9')) ||
  ------------------
  |  Branch (10006:10): [True: 21.0k, False: 885k]
  |  Branch (10006:26): [True: 20.0k, False: 1.06k]
  ------------------
10007|   886k|	       (cur == '.') || (cur == '_') ||
  ------------------
  |  Branch (10007:9): [True: 1.03k, False: 885k]
  |  Branch (10007:25): [True: 220, False: 885k]
  ------------------
10008|  1.03M|	       (cur == '-')) {
  ------------------
  |  Branch (10008:9): [True: 878k, False: 7.31k]
  ------------------
10009|  1.03M|	    if (len + 1 >= size) {
  ------------------
  |  Branch (10009:10): [True: 3.94k, False: 1.03M]
  ------------------
10010|  3.94k|	        xmlChar *tmp;
10011|  3.94k|                int newSize;
10012|       |
10013|  3.94k|                newSize = xmlGrowCapacity(size, 1, 1, maxLength);
10014|  3.94k|                if (newSize < 0) {
  ------------------
  |  Branch (10014:21): [True: 1, False: 3.94k]
  ------------------
10015|      1|                    xmlFatalErr(ctxt, XML_ERR_NAME_TOO_LONG, "EncName");
10016|      1|                    xmlFree(buf);
10017|      1|                    return(NULL);
10018|      1|                }
10019|  3.94k|		tmp = xmlRealloc(buf, newSize);
10020|  3.94k|		if (tmp == NULL) {
  ------------------
  |  Branch (10020:7): [True: 5, False: 3.93k]
  ------------------
10021|      5|		    xmlErrMemory(ctxt);
10022|      5|		    xmlFree(buf);
10023|      5|		    return(NULL);
10024|      5|		}
10025|  3.93k|		buf = tmp;
10026|  3.93k|                size = newSize;
10027|  3.93k|	    }
10028|  1.03M|	    buf[len++] = cur;
10029|  1.03M|	    NEXT;
  ------------------
  |  | 2279|  1.03M|#define NEXT xmlNextChar(ctxt)
  ------------------
10030|  1.03M|	    cur = CUR;
  ------------------
  |  | 2225|  1.03M|#define CUR (*ctxt->input->cur)
  ------------------
10031|  1.03M|        }
10032|  7.31k|	buf[len] = 0;
10033|  7.31k|    } else {
10034|    520|	xmlFatalErr(ctxt, XML_ERR_ENCODING_NAME, NULL);
10035|    520|    }
10036|  7.83k|    return(buf);
10037|  7.84k|}
xmlParseEncodingDecl:
10054|   172k|xmlParseEncodingDecl(xmlParserCtxt *ctxt) {
10055|   172k|    xmlChar *encoding = NULL;
10056|       |
10057|   172k|    SKIP_BLANKS;
  ------------------
  |  | 2275|   172k|#define SKIP_BLANKS xmlSkipBlankChars(ctxt)
  ------------------
10058|   172k|    if (CMP8(CUR_PTR, 'e', 'n', 'c', 'o', 'd', 'i', 'n', 'g') == 0)
  ------------------
  |  | 2240|   172k|  ( CMP7( s, c1, c2, c3, c4, c5, c6, c7 ) && ((unsigned char *) s)[ 7 ] == c8 )
  |  |  ------------------
  |  |  |  | 2238|   345k|  ( CMP6( s, c1, c2, c3, c4, c5, c6 ) && ((unsigned char *) s)[ 6 ] == c7 )
  |  |  |  |  ------------------
  |  |  |  |  |  | 2236|   345k|  ( CMP5( s, c1, c2, c3, c4, c5 ) && ((unsigned char *) s)[ 5 ] == c6 )
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  | 2234|   345k|  ( CMP4( s, c1, c2, c3, c4 ) && ((unsigned char *) s)[ 4 ] == c5 )
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  | 2231|   345k|  ( ((unsigned char *) s)[ 0 ] == c1 && ((unsigned char *) s)[ 1 ] == c2 && \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (2231:5): [True: 10.9k, False: 161k]
  |  |  |  |  |  |  |  |  |  |  |  Branch (2231:41): [True: 10.4k, False: 484]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  | 2232|   172k|    ((unsigned char *) s)[ 2 ] == c3 && ((unsigned char *) s)[ 3 ] == c4 )
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (2232:5): [True: 10.2k, False: 222]
  |  |  |  |  |  |  |  |  |  |  |  Branch (2232:41): [True: 9.88k, False: 341]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (2234:34): [True: 9.54k, False: 340]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (2236:38): [True: 9.18k, False: 358]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2238:42): [True: 8.74k, False: 437]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2240:46): [True: 8.51k, False: 232]
  |  |  ------------------
  ------------------
  |  Branch (10058:9): [True: 164k, False: 8.51k]
  ------------------
10059|   164k|        return(NULL);
10060|       |
10061|  8.51k|    SKIP(8);
  ------------------
  |  | 2248|  8.51k|#define SKIP(val) do {							\
  |  | 2249|  8.51k|    ctxt->input->cur += (val),ctxt->input->col+=(val);			\
  |  | 2250|  8.51k|    if (*ctxt->input->cur == 0)						\
  |  |  ------------------
  |  |  |  Branch (2250:9): [True: 219, False: 8.29k]
  |  |  ------------------
  |  | 2251|  8.51k|        xmlParserGrow(ctxt);						\
  |  | 2252|  8.51k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2252:12): [Folded, False: 8.51k]
  |  |  ------------------
  ------------------
10062|  8.51k|    SKIP_BLANKS;
  ------------------
  |  | 2275|  8.51k|#define SKIP_BLANKS xmlSkipBlankChars(ctxt)
  ------------------
10063|  8.51k|    if (RAW != '=') {
  ------------------
  |  | 2224|  8.51k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (10063:9): [True: 256, False: 8.25k]
  ------------------
10064|    256|        xmlFatalErr(ctxt, XML_ERR_EQUAL_REQUIRED, NULL);
10065|    256|        return(NULL);
10066|    256|    }
10067|  8.25k|    NEXT;
  ------------------
  |  | 2279|  8.25k|#define NEXT xmlNextChar(ctxt)
  ------------------
10068|  8.25k|    SKIP_BLANKS;
  ------------------
  |  | 2275|  8.25k|#define SKIP_BLANKS xmlSkipBlankChars(ctxt)
  ------------------
10069|  8.25k|    if (RAW == '"') {
  ------------------
  |  | 2224|  8.25k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (10069:9): [True: 1.70k, False: 6.55k]
  ------------------
10070|  1.70k|        NEXT;
  ------------------
  |  | 2279|  1.70k|#define NEXT xmlNextChar(ctxt)
  ------------------
10071|  1.70k|        encoding = xmlParseEncName(ctxt);
10072|  1.70k|        if (RAW != '"') {
  ------------------
  |  | 2224|  1.70k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (10072:13): [True: 719, False: 986]
  ------------------
10073|    719|            xmlFatalErr(ctxt, XML_ERR_STRING_NOT_CLOSED, NULL);
10074|    719|            xmlFree(encoding);
10075|    719|            return(NULL);
10076|    719|        } else
10077|    986|            NEXT;
  ------------------
  |  | 2279|    986|#define NEXT xmlNextChar(ctxt)
  ------------------
10078|  6.55k|    } else if (RAW == '\''){
  ------------------
  |  | 2224|  6.55k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (10078:16): [True: 6.13k, False: 417]
  ------------------
10079|  6.13k|        NEXT;
  ------------------
  |  | 2279|  6.13k|#define NEXT xmlNextChar(ctxt)
  ------------------
10080|  6.13k|        encoding = xmlParseEncName(ctxt);
10081|  6.13k|        if (RAW != '\'') {
  ------------------
  |  | 2224|  6.13k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (10081:13): [True: 836, False: 5.30k]
  ------------------
10082|    836|            xmlFatalErr(ctxt, XML_ERR_STRING_NOT_CLOSED, NULL);
10083|    836|            xmlFree(encoding);
10084|    836|            return(NULL);
10085|    836|        } else
10086|  5.30k|            NEXT;
  ------------------
  |  | 2279|  5.30k|#define NEXT xmlNextChar(ctxt)
  ------------------
10087|  6.13k|    } else {
10088|    417|        xmlFatalErr(ctxt, XML_ERR_STRING_NOT_STARTED, NULL);
10089|    417|    }
10090|       |
10091|  6.70k|    if (encoding == NULL)
  ------------------
  |  Branch (10091:9): [True: 426, False: 6.27k]
  ------------------
10092|    426|        return(NULL);
10093|       |
10094|  6.27k|    xmlSetDeclaredEncoding(ctxt, encoding);
10095|       |
10096|  6.27k|    return(ctxt->encoding);
10097|  6.70k|}
xmlParseSDDecl:
10131|  1.22k|xmlParseSDDecl(xmlParserCtxt *ctxt) {
10132|  1.22k|    int standalone = -2;
10133|       |
10134|  1.22k|    SKIP_BLANKS;
  ------------------
  |  | 2275|  1.22k|#define SKIP_BLANKS xmlSkipBlankChars(ctxt)
  ------------------
10135|  1.22k|    if (CMP10(CUR_PTR, 's', 't', 'a', 'n', 'd', 'a', 'l', 'o', 'n', 'e')) {
  ------------------
  |  | 2245|  1.22k|  ( CMP9( s, c1, c2, c3, c4, c5, c6, c7, c8, c9 ) && \
  |  |  ------------------
  |  |  |  | 2242|  2.45k|  ( CMP8( s, c1, c2, c3, c4, c5, c6, c7, c8 ) && \
  |  |  |  |  ------------------
  |  |  |  |  |  | 2240|  2.45k|  ( CMP7( s, c1, c2, c3, c4, c5, c6, c7 ) && ((unsigned char *) s)[ 7 ] == c8 )
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  | 2238|  2.45k|  ( CMP6( s, c1, c2, c3, c4, c5, c6 ) && ((unsigned char *) s)[ 6 ] == c7 )
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  | 2236|  2.45k|  ( CMP5( s, c1, c2, c3, c4, c5 ) && ((unsigned char *) s)[ 5 ] == c6 )
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  | 2234|  2.45k|  ( CMP4( s, c1, c2, c3, c4 ) && ((unsigned char *) s)[ 4 ] == c5 )
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  | 2231|  2.45k|  ( ((unsigned char *) s)[ 0 ] == c1 && ((unsigned char *) s)[ 1 ] == c2 && \
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  Branch (2231:5): [True: 319, False: 908]
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  Branch (2231:41): [True: 315, False: 4]
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  | 2232|  1.22k|    ((unsigned char *) s)[ 2 ] == c3 && ((unsigned char *) s)[ 3 ] == c4 )
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  Branch (2232:5): [True: 306, False: 9]
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  Branch (2232:41): [True: 304, False: 2]
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  Branch (2234:34): [True: 299, False: 5]
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (2236:38): [True: 297, False: 2]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (2238:42): [True: 296, False: 1]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (2240:46): [True: 295, False: 1]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 2243|  2.45k|    ((unsigned char *) s)[ 8 ] == c9 )
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2243:5): [True: 288, False: 7]
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 2246|  1.22k|    ((unsigned char *) s)[ 9 ] == c10 )
  |  |  ------------------
  |  |  |  Branch (2246:5): [True: 286, False: 2]
  |  |  ------------------
  ------------------
10136|    286|	SKIP(10);
  ------------------
  |  | 2248|    286|#define SKIP(val) do {							\
  |  | 2249|    286|    ctxt->input->cur += (val),ctxt->input->col+=(val);			\
  |  | 2250|    286|    if (*ctxt->input->cur == 0)						\
  |  |  ------------------
  |  |  |  Branch (2250:9): [True: 2, False: 284]
  |  |  ------------------
  |  | 2251|    286|        xmlParserGrow(ctxt);						\
  |  | 2252|    286|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2252:12): [Folded, False: 286]
  |  |  ------------------
  ------------------
10137|    286|        SKIP_BLANKS;
  ------------------
  |  | 2275|    286|#define SKIP_BLANKS xmlSkipBlankChars(ctxt)
  ------------------
10138|    286|	if (RAW != '=') {
  ------------------
  |  | 2224|    286|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (10138:6): [True: 3, False: 283]
  ------------------
10139|      3|	    xmlFatalErr(ctxt, XML_ERR_EQUAL_REQUIRED, NULL);
10140|      3|	    return(standalone);
10141|      3|        }
10142|    283|	NEXT;
  ------------------
  |  | 2279|    283|#define NEXT xmlNextChar(ctxt)
  ------------------
10143|    283|	SKIP_BLANKS;
  ------------------
  |  | 2275|    283|#define SKIP_BLANKS xmlSkipBlankChars(ctxt)
  ------------------
10144|    283|        if (RAW == '\''){
  ------------------
  |  | 2224|    283|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (10144:13): [True: 274, False: 9]
  ------------------
10145|    274|	    NEXT;
  ------------------
  |  | 2279|    274|#define NEXT xmlNextChar(ctxt)
  ------------------
10146|    274|	    if ((RAW == 'n') && (NXT(1) == 'o')) {
  ------------------
  |  | 2224|    274|#define RAW (*ctxt->input->cur)
  ------------------
              	    if ((RAW == 'n') && (NXT(1) == 'o')) {
  ------------------
  |  | 2226|     10|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
  |  Branch (10146:10): [True: 10, False: 264]
  |  Branch (10146:26): [True: 8, False: 2]
  ------------------
10147|      8|	        standalone = 0;
10148|      8|                SKIP(2);
  ------------------
  |  | 2248|      8|#define SKIP(val) do {							\
  |  | 2249|      8|    ctxt->input->cur += (val),ctxt->input->col+=(val);			\
  |  | 2250|      8|    if (*ctxt->input->cur == 0)						\
  |  |  ------------------
  |  |  |  Branch (2250:9): [True: 1, False: 7]
  |  |  ------------------
  |  | 2251|      8|        xmlParserGrow(ctxt);						\
  |  | 2252|      8|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2252:12): [Folded, False: 8]
  |  |  ------------------
  ------------------
10149|    266|	    } else if ((RAW == 'y') && (NXT(1) == 'e') &&
  ------------------
  |  | 2224|    266|#define RAW (*ctxt->input->cur)
  ------------------
              	    } else if ((RAW == 'y') && (NXT(1) == 'e') &&
  ------------------
  |  | 2226|    258|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
  |  Branch (10149:17): [True: 258, False: 8]
  |  Branch (10149:33): [True: 255, False: 3]
  ------------------
10150|    255|	               (NXT(2) == 's')) {
  ------------------
  |  | 2226|    255|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
  |  Branch (10150:17): [True: 254, False: 1]
  ------------------
10151|    254|	        standalone = 1;
10152|    254|		SKIP(3);
  ------------------
  |  | 2248|    254|#define SKIP(val) do {							\
  |  | 2249|    254|    ctxt->input->cur += (val),ctxt->input->col+=(val);			\
  |  | 2250|    254|    if (*ctxt->input->cur == 0)						\
  |  |  ------------------
  |  |  |  Branch (2250:9): [True: 1, False: 253]
  |  |  ------------------
  |  | 2251|    254|        xmlParserGrow(ctxt);						\
  |  | 2252|    254|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2252:12): [Folded, False: 254]
  |  |  ------------------
  ------------------
10153|    254|            } else {
10154|     12|		xmlFatalErr(ctxt, XML_ERR_STANDALONE_VALUE, NULL);
10155|     12|	    }
10156|    274|	    if (RAW != '\'') {
  ------------------
  |  | 2224|    274|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (10156:10): [True: 22, False: 252]
  ------------------
10157|     22|		xmlFatalErr(ctxt, XML_ERR_STRING_NOT_CLOSED, NULL);
10158|     22|	    } else
10159|    252|	        NEXT;
  ------------------
  |  | 2279|    252|#define NEXT xmlNextChar(ctxt)
  ------------------
10160|    274|	} else if (RAW == '"'){
  ------------------
  |  | 2224|      9|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (10160:13): [True: 8, False: 1]
  ------------------
10161|      8|	    NEXT;
  ------------------
  |  | 2279|      8|#define NEXT xmlNextChar(ctxt)
  ------------------
10162|      8|	    if ((RAW == 'n') && (NXT(1) == 'o')) {
  ------------------
  |  | 2224|      8|#define RAW (*ctxt->input->cur)
  ------------------
              	    if ((RAW == 'n') && (NXT(1) == 'o')) {
  ------------------
  |  | 2226|      3|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
  |  Branch (10162:10): [True: 3, False: 5]
  |  Branch (10162:26): [True: 2, False: 1]
  ------------------
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|      6|	    } else if ((RAW == 'y') && (NXT(1) == 'e') &&
  ------------------
  |  | 2224|      6|#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: 2]
  |  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|      4|            } else {
10170|      4|		xmlFatalErr(ctxt, XML_ERR_STANDALONE_VALUE, NULL);
10171|      4|	    }
10172|      8|	    if (RAW != '"') {
  ------------------
  |  | 2224|      8|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (10172:10): [True: 7, False: 1]
  ------------------
10173|      7|		xmlFatalErr(ctxt, XML_ERR_STRING_NOT_CLOSED, NULL);
10174|      7|	    } else
10175|      1|	        NEXT;
  ------------------
  |  | 2279|      1|#define NEXT xmlNextChar(ctxt)
  ------------------
10176|      8|	} else {
10177|      1|	    xmlFatalErr(ctxt, XML_ERR_STRING_NOT_STARTED, NULL);
10178|      1|        }
10179|    283|    }
10180|  1.22k|    return(standalone);
10181|  1.22k|}
xmlParseXMLDecl:
10193|  3.44k|xmlParseXMLDecl(xmlParserCtxt *ctxt) {
10194|  3.44k|    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.44k|    ctxt->standalone = -2;
10203|       |
10204|       |    /*
10205|       |     * We know that '<?xml' is here.
10206|       |     */
10207|  3.44k|    SKIP(5);
  ------------------
  |  | 2248|  3.44k|#define SKIP(val) do {							\
  |  | 2249|  3.44k|    ctxt->input->cur += (val),ctxt->input->col+=(val);			\
  |  | 2250|  3.44k|    if (*ctxt->input->cur == 0)						\
  |  |  ------------------
  |  |  |  Branch (2250:9): [True: 0, False: 3.44k]
  |  |  ------------------
  |  | 2251|  3.44k|        xmlParserGrow(ctxt);						\
  |  | 2252|  3.44k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2252:12): [Folded, False: 3.44k]
  |  |  ------------------
  ------------------
10208|       |
10209|  3.44k|    if (!IS_BLANK_CH(RAW)) {
  ------------------
  |  |  137|  3.44k|#define IS_BLANK_CH(c)  xmlIsBlank_ch(c)
  |  |  ------------------
  |  |  |  |   90|  3.44k|#define xmlIsBlank_ch(c)	(((c) == 0x20) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (90:27): [True: 3.39k, False: 46]
  |  |  |  |  ------------------
  |  |  |  |   91|  3.44k|				 ((0x9 <= (c)) && ((c) <= 0xa)) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (91:7): [True: 46, False: 0]
  |  |  |  |  |  Branch (91:23): [True: 35, False: 11]
  |  |  |  |  ------------------
  |  |  |  |   92|  3.44k|				 ((c) == 0xd))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (92:6): [True: 11, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
10210|      0|	xmlFatalErrMsg(ctxt, XML_ERR_SPACE_REQUIRED,
10211|      0|	               "Blank needed after '<?xml'\n");
10212|      0|    }
10213|  3.44k|    SKIP_BLANKS;
  ------------------
  |  | 2275|  3.44k|#define SKIP_BLANKS xmlSkipBlankChars(ctxt)
  ------------------
10214|       |
10215|       |    /*
10216|       |     * We must have the VersionInfo here.
10217|       |     */
10218|  3.44k|    version = xmlParseVersionInfo(ctxt);
10219|  3.44k|    if (version == NULL) {
  ------------------
  |  Branch (10219:9): [True: 843, False: 2.59k]
  ------------------
10220|    843|	xmlFatalErr(ctxt, XML_ERR_VERSION_MISSING, NULL);
10221|  2.59k|    } else {
10222|  2.59k|	if (!xmlStrEqual(version, (const xmlChar *) XML_DEFAULT_VERSION)) {
  ------------------
  |  |   42|  2.59k|#define XML_DEFAULT_VERSION	"1.0"
  ------------------
  |  Branch (10222:6): [True: 228, False: 2.37k]
  ------------------
10223|       |	    /*
10224|       |	     * Changed here for XML-1.0 5th edition
10225|       |	     */
10226|    228|	    if (ctxt->options & XML_PARSE_OLD10) {
  ------------------
  |  Branch (10226:10): [True: 30, False: 198]
  ------------------
10227|     30|		xmlFatalErrMsgStr(ctxt, XML_ERR_UNKNOWN_VERSION,
10228|     30|			          "Unsupported version '%s'\n",
10229|     30|			          version);
10230|    198|	    } else {
10231|    198|	        if ((version[0] == '1') && ((version[1] == '.'))) {
  ------------------
  |  Branch (10231:14): [True: 160, False: 38]
  |  Branch (10231:37): [True: 160, False: 0]
  ------------------
10232|    160|		    xmlWarningMsg(ctxt, XML_WAR_UNKNOWN_VERSION,
10233|    160|		                  "Unsupported version '%s'\n",
10234|    160|				  version, NULL);
10235|    160|		} else {
10236|     38|		    xmlFatalErrMsgStr(ctxt, XML_ERR_UNKNOWN_VERSION,
10237|     38|				      "Unsupported version '%s'\n",
10238|     38|				      version);
10239|     38|		}
10240|    198|	    }
10241|    228|	}
10242|  2.59k|	if (ctxt->version != NULL)
  ------------------
  |  Branch (10242:6): [True: 0, False: 2.59k]
  ------------------
10243|      0|	    xmlFree(ctxt->version);
10244|  2.59k|	ctxt->version = version;
10245|  2.59k|    }
10246|       |
10247|       |    /*
10248|       |     * We may have the encoding declaration
10249|       |     */
10250|  3.44k|    if (!IS_BLANK_CH(RAW)) {
  ------------------
  |  |  137|  3.44k|#define IS_BLANK_CH(c)  xmlIsBlank_ch(c)
  |  |  ------------------
  |  |  |  |   90|  3.44k|#define xmlIsBlank_ch(c)	(((c) == 0x20) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (90:27): [True: 1.07k, False: 2.36k]
  |  |  |  |  ------------------
  |  |  |  |   91|  3.44k|				 ((0x9 <= (c)) && ((c) <= 0xa)) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (91:7): [True: 2.34k, False: 24]
  |  |  |  |  |  Branch (91:23): [True: 7, False: 2.33k]
  |  |  |  |  ------------------
  |  |  |  |   92|  3.44k|				 ((c) == 0xd))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (92:6): [True: 15, False: 2.34k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
10251|  2.34k|        if ((RAW == '?') && (NXT(1) == '>')) {
  ------------------
  |  | 2224|  2.34k|#define RAW (*ctxt->input->cur)
  ------------------
                      if ((RAW == '?') && (NXT(1) == '>')) {
  ------------------
  |  | 2226|  1.48k|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
  |  Branch (10251:13): [True: 1.48k, False: 865]
  |  Branch (10251:29): [True: 1.47k, False: 9]
  ------------------
10252|  1.47k|	    SKIP(2);
  ------------------
  |  | 2248|  1.47k|#define SKIP(val) do {							\
  |  | 2249|  1.47k|    ctxt->input->cur += (val),ctxt->input->col+=(val);			\
  |  | 2250|  1.47k|    if (*ctxt->input->cur == 0)						\
  |  |  ------------------
  |  |  |  Branch (2250:9): [True: 1, False: 1.47k]
  |  |  ------------------
  |  | 2251|  1.47k|        xmlParserGrow(ctxt);						\
  |  | 2252|  1.47k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2252:12): [Folded, False: 1.47k]
  |  |  ------------------
  ------------------
10253|  1.47k|	    return;
10254|  1.47k|	}
10255|    874|	xmlFatalErrMsg(ctxt, XML_ERR_SPACE_REQUIRED, "Blank needed here\n");
10256|    874|    }
10257|  1.96k|    xmlParseEncodingDecl(ctxt);
10258|       |
10259|       |    /*
10260|       |     * We may have the standalone status.
10261|       |     */
10262|  1.96k|    if ((ctxt->encoding != NULL) && (!IS_BLANK_CH(RAW))) {
  ------------------
  |  |  137|    877|#define IS_BLANK_CH(c)  xmlIsBlank_ch(c)
  |  |  ------------------
  |  |  |  |   90|    877|#define xmlIsBlank_ch(c)	(((c) == 0x20) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (90:27): [True: 54, False: 823]
  |  |  |  |  ------------------
  |  |  |  |   91|    877|				 ((0x9 <= (c)) && ((c) <= 0xa)) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (91:7): [True: 815, False: 8]
  |  |  |  |  |  Branch (91:23): [True: 13, False: 802]
  |  |  |  |  ------------------
  |  |  |  |   92|    877|				 ((c) == 0xd))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (92:6): [True: 1, False: 809]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (10262:9): [True: 877, False: 1.09k]
  ------------------
10263|    809|        if ((RAW == '?') && (NXT(1) == '>')) {
  ------------------
  |  | 2224|    809|#define RAW (*ctxt->input->cur)
  ------------------
                      if ((RAW == '?') && (NXT(1) == '>')) {
  ------------------
  |  | 2226|    756|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
  |  Branch (10263:13): [True: 756, False: 53]
  |  Branch (10263:29): [True: 742, False: 14]
  ------------------
10264|    742|	    SKIP(2);
  ------------------
  |  | 2248|    742|#define SKIP(val) do {							\
  |  | 2249|    742|    ctxt->input->cur += (val),ctxt->input->col+=(val);			\
  |  | 2250|    742|    if (*ctxt->input->cur == 0)						\
  |  |  ------------------
  |  |  |  Branch (2250:9): [True: 2, False: 740]
  |  |  ------------------
  |  | 2251|    742|        xmlParserGrow(ctxt);						\
  |  | 2252|    742|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2252:12): [Folded, False: 742]
  |  |  ------------------
  ------------------
10265|    742|	    return;
10266|    742|	}
10267|     67|	xmlFatalErrMsg(ctxt, XML_ERR_SPACE_REQUIRED, "Blank needed here\n");
10268|     67|    }
10269|       |
10270|       |    /*
10271|       |     * We can grow the input buffer freely at that point
10272|       |     */
10273|  1.22k|    GROW;
  ------------------
  |  | 2271|  1.22k|    if ((!PARSER_PROGRESSIVE(ctxt)) && \
  |  |  ------------------
  |  |  |  |   47|  1.22k|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|  1.22k|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2271:9): [True: 47, False: 1.18k]
  |  |  ------------------
  |  | 2272|  1.22k|        (ctxt->input->end - ctxt->input->cur < INPUT_CHUNK)) \
  |  |  ------------------
  |  |  |  |   63|     47|#define INPUT_CHUNK	250
  |  |  ------------------
  |  |  |  Branch (2272:9): [True: 32, False: 15]
  |  |  ------------------
  |  | 2273|  1.22k|	xmlParserGrow(ctxt);
  ------------------
10274|       |
10275|  1.22k|    SKIP_BLANKS;
  ------------------
  |  | 2275|  1.22k|#define SKIP_BLANKS xmlSkipBlankChars(ctxt)
  ------------------
10276|  1.22k|    ctxt->standalone = xmlParseSDDecl(ctxt);
10277|       |
10278|  1.22k|    SKIP_BLANKS;
  ------------------
  |  | 2275|  1.22k|#define SKIP_BLANKS xmlSkipBlankChars(ctxt)
  ------------------
10279|  1.22k|    if ((RAW == '?') && (NXT(1) == '>')) {
  ------------------
  |  | 2224|  1.22k|#define RAW (*ctxt->input->cur)
  ------------------
                  if ((RAW == '?') && (NXT(1) == '>')) {
  ------------------
  |  | 2226|    335|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
  |  Branch (10279:9): [True: 335, False: 892]
  |  Branch (10279:25): [True: 309, False: 26]
  ------------------
10280|    309|        SKIP(2);
  ------------------
  |  | 2248|    309|#define SKIP(val) do {							\
  |  | 2249|    309|    ctxt->input->cur += (val),ctxt->input->col+=(val);			\
  |  | 2250|    309|    if (*ctxt->input->cur == 0)						\
  |  |  ------------------
  |  |  |  Branch (2250:9): [True: 1, False: 308]
  |  |  ------------------
  |  | 2251|    309|        xmlParserGrow(ctxt);						\
  |  | 2252|    309|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2252:12): [Folded, False: 309]
  |  |  ------------------
  ------------------
10281|    918|    } else if (RAW == '>') {
  ------------------
  |  | 2224|    918|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (10281:16): [True: 26, False: 892]
  ------------------
10282|       |        /* Deprecated old WD ... */
10283|     26|	xmlFatalErr(ctxt, XML_ERR_XMLDECL_NOT_FINISHED, NULL);
10284|     26|	NEXT;
  ------------------
  |  | 2279|     26|#define NEXT xmlNextChar(ctxt)
  ------------------
10285|    892|    } else {
10286|    892|        int c;
10287|       |
10288|    892|	xmlFatalErr(ctxt, XML_ERR_XMLDECL_NOT_FINISHED, NULL);
10289|   207k|        while ((PARSER_STOPPED(ctxt) == 0) &&
  ------------------
  |  |   44|   207k|#define PARSER_STOPPED(ctxt) ((ctxt)->disableSAX > 1)
  ------------------
  |  Branch (10289:16): [True: 207k, False: 32]
  ------------------
10290|   207k|               ((c = CUR) != 0)) {
  ------------------
  |  | 2225|   207k|#define CUR (*ctxt->input->cur)
  ------------------
  |  Branch (10290:16): [True: 207k, False: 378]
  ------------------
10291|   207k|            NEXT;
  ------------------
  |  | 2279|   207k|#define NEXT xmlNextChar(ctxt)
  ------------------
10292|   207k|            if (c == '>')
  ------------------
  |  Branch (10292:17): [True: 482, False: 206k]
  ------------------
10293|    482|                break;
10294|   207k|        }
10295|    892|    }
10296|  1.22k|}
xmlParseMisc:
10336|  17.6k|xmlParseMisc(xmlParserCtxt *ctxt) {
10337|  19.6k|    while (PARSER_STOPPED(ctxt) == 0) {
  ------------------
  |  |   44|  19.6k|#define PARSER_STOPPED(ctxt) ((ctxt)->disableSAX > 1)
  ------------------
  |  Branch (10337:12): [True: 19.5k, False: 168]
  ------------------
10338|  19.5k|        SKIP_BLANKS;
  ------------------
  |  | 2275|  19.5k|#define SKIP_BLANKS xmlSkipBlankChars(ctxt)
  ------------------
10339|  19.5k|        GROW;
  ------------------
  |  | 2271|  19.5k|    if ((!PARSER_PROGRESSIVE(ctxt)) && \
  |  |  ------------------
  |  |  |  |   47|  19.5k|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|  19.5k|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2271:9): [True: 19.5k, False: 0]
  |  |  ------------------
  |  | 2272|  19.5k|        (ctxt->input->end - ctxt->input->cur < INPUT_CHUNK)) \
  |  |  ------------------
  |  |  |  |   63|  19.5k|#define INPUT_CHUNK	250
  |  |  ------------------
  |  |  |  Branch (2272:9): [True: 15.3k, False: 4.20k]
  |  |  ------------------
  |  | 2273|  19.5k|	xmlParserGrow(ctxt);
  ------------------
10340|  19.5k|        if ((RAW == '<') && (NXT(1) == '?')) {
  ------------------
  |  | 2224|  19.5k|#define RAW (*ctxt->input->cur)
  ------------------
                      if ((RAW == '<') && (NXT(1) == '?')) {
  ------------------
  |  | 2226|  12.3k|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
  |  Branch (10340:13): [True: 12.3k, False: 7.13k]
  |  Branch (10340:29): [True: 1.02k, False: 11.3k]
  ------------------
10341|  1.02k|	    xmlParsePI(ctxt);
10342|  18.4k|        } else if (CMP4(CUR_PTR, '<', '!', '-', '-')) {
  ------------------
  |  | 2231|  18.4k|  ( ((unsigned char *) s)[ 0 ] == c1 && ((unsigned char *) s)[ 1 ] == c2 && \
  |  |  ------------------
  |  |  |  Branch (2231:5): [True: 11.3k, False: 7.13k]
  |  |  |  Branch (2231:41): [True: 3.46k, False: 7.88k]
  |  |  ------------------
  |  | 2232|  18.4k|    ((unsigned char *) s)[ 2 ] == c3 && ((unsigned char *) s)[ 3 ] == c4 )
  |  |  ------------------
  |  |  |  Branch (2232:5): [True: 1.03k, False: 2.43k]
  |  |  |  Branch (2232:41): [True: 1.03k, False: 1]
  |  |  ------------------
  ------------------
10343|  1.03k|	    xmlParseComment(ctxt);
10344|  17.4k|        } else {
10345|  17.4k|            break;
10346|  17.4k|        }
10347|  19.5k|    }
10348|  17.6k|}
xmlParseDocument:
10381|  7.67k|xmlParseDocument(xmlParserCtxt *ctxt) {
10382|  7.67k|    if ((ctxt == NULL) || (ctxt->input == NULL))
  ------------------
  |  Branch (10382:9): [True: 0, False: 7.67k]
  |  Branch (10382:27): [True: 0, False: 7.67k]
  ------------------
10383|      0|        return(-1);
10384|       |
10385|  7.67k|    GROW;
  ------------------
  |  | 2271|  7.67k|    if ((!PARSER_PROGRESSIVE(ctxt)) && \
  |  |  ------------------
  |  |  |  |   47|  7.67k|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|  7.67k|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2271:9): [True: 7.67k, False: 0]
  |  |  ------------------
  |  | 2272|  7.67k|        (ctxt->input->end - ctxt->input->cur < INPUT_CHUNK)) \
  |  |  ------------------
  |  |  |  |   63|  7.67k|#define INPUT_CHUNK	250
  |  |  ------------------
  |  |  |  Branch (2272:9): [True: 5.42k, False: 2.25k]
  |  |  ------------------
  |  | 2273|  7.67k|	xmlParserGrow(ctxt);
  ------------------
10386|       |
10387|       |    /*
10388|       |     * SAX: detecting the level.
10389|       |     */
10390|  7.67k|    xmlCtxtInitializeLate(ctxt);
10391|       |
10392|  7.67k|    if ((ctxt->sax) && (ctxt->sax->setDocumentLocator)) {
  ------------------
  |  Branch (10392:9): [True: 7.67k, False: 0]
  |  Branch (10392:24): [True: 7.67k, False: 0]
  ------------------
10393|  7.67k|        ctxt->sax->setDocumentLocator(ctxt->userData,
10394|  7.67k|                (xmlSAXLocator *) &xmlDefaultSAXLocator);
10395|  7.67k|    }
10396|       |
10397|  7.67k|    xmlDetectEncoding(ctxt);
10398|       |
10399|  7.67k|    if (CUR == 0) {
  ------------------
  |  | 2225|  7.67k|#define CUR (*ctxt->input->cur)
  ------------------
  |  Branch (10399:9): [True: 6, False: 7.67k]
  ------------------
10400|      6|	xmlFatalErr(ctxt, XML_ERR_DOCUMENT_EMPTY, NULL);
10401|      6|	return(-1);
10402|      6|    }
10403|       |
10404|  7.67k|    GROW;
  ------------------
  |  | 2271|  7.67k|    if ((!PARSER_PROGRESSIVE(ctxt)) && \
  |  |  ------------------
  |  |  |  |   47|  7.67k|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|  7.67k|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2271:9): [True: 7.67k, False: 0]
  |  |  ------------------
  |  | 2272|  7.67k|        (ctxt->input->end - ctxt->input->cur < INPUT_CHUNK)) \
  |  |  ------------------
  |  |  |  |   63|  7.67k|#define INPUT_CHUNK	250
  |  |  ------------------
  |  |  |  Branch (2272:9): [True: 5.42k, False: 2.25k]
  |  |  ------------------
  |  | 2273|  7.67k|	xmlParserGrow(ctxt);
  ------------------
10405|  7.67k|    if ((CMP5(CUR_PTR, '<', '?', 'x', 'm', 'l')) && (IS_BLANK_CH(NXT(5)))) {
  ------------------
  |  | 2234|  7.67k|  ( CMP4( s, c1, c2, c3, c4 ) && ((unsigned char *) s)[ 4 ] == c5 )
  |  |  ------------------
  |  |  |  | 2231|  15.3k|  ( ((unsigned char *) s)[ 0 ] == c1 && ((unsigned char *) s)[ 1 ] == c2 && \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2231:5): [True: 7.58k, False: 89]
  |  |  |  |  |  Branch (2231:41): [True: 597, False: 6.98k]
  |  |  |  |  ------------------
  |  |  |  | 2232|  7.67k|    ((unsigned char *) s)[ 2 ] == c3 && ((unsigned char *) s)[ 3 ] == c4 )
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2232:5): [True: 341, False: 256]
  |  |  |  |  |  Branch (2232:41): [True: 170, False: 171]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2234:34): [True: 162, False: 8]
  |  |  ------------------
  ------------------
                  if ((CMP5(CUR_PTR, '<', '?', 'x', 'm', 'l')) && (IS_BLANK_CH(NXT(5)))) {
  ------------------
  |  |  137|    162|#define IS_BLANK_CH(c)  xmlIsBlank_ch(c)
  |  |  ------------------
  |  |  |  |   90|    162|#define xmlIsBlank_ch(c)	(((c) == 0x20) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (90:27): [True: 151, False: 11]
  |  |  |  |  ------------------
  |  |  |  |   91|    162|				 ((0x9 <= (c)) && ((c) <= 0xa)) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (91:7): [True: 10, False: 1]
  |  |  |  |  |  Branch (91:23): [True: 2, False: 8]
  |  |  |  |  ------------------
  |  |  |  |   92|    162|				 ((c) == 0xd))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (92:6): [True: 4, False: 5]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
10406|       |
10407|       |	/*
10408|       |	 * Note that we will switch encoding on the fly.
10409|       |	 */
10410|    157|	xmlParseXMLDecl(ctxt);
10411|    157|	SKIP_BLANKS;
  ------------------
  |  | 2275|    157|#define SKIP_BLANKS xmlSkipBlankChars(ctxt)
  ------------------
10412|  7.51k|    } else {
10413|  7.51k|	ctxt->version = xmlCharStrdup(XML_DEFAULT_VERSION);
  ------------------
  |  |   42|  7.51k|#define XML_DEFAULT_VERSION	"1.0"
  ------------------
10414|  7.51k|        if (ctxt->version == NULL) {
  ------------------
  |  Branch (10414:13): [True: 1, False: 7.51k]
  ------------------
10415|      1|            xmlErrMemory(ctxt);
10416|      1|            return(-1);
10417|      1|        }
10418|  7.51k|    }
10419|  7.67k|    if ((ctxt->sax) && (ctxt->sax->startDocument) && (!ctxt->disableSAX))
  ------------------
  |  Branch (10419:9): [True: 7.67k, False: 0]
  |  Branch (10419:24): [True: 7.67k, False: 0]
  |  Branch (10419:54): [True: 7.61k, False: 54]
  ------------------
10420|  7.61k|        ctxt->sax->startDocument(ctxt->userData);
10421|  7.67k|    if ((ctxt->myDoc != NULL) && (ctxt->input != NULL) &&
  ------------------
  |  Branch (10421:9): [True: 7.61k, False: 59]
  |  Branch (10421:34): [True: 7.61k, False: 0]
  ------------------
10422|  7.61k|        (ctxt->input->buf != NULL) && (ctxt->input->buf->compressed >= 0)) {
  ------------------
  |  Branch (10422:9): [True: 7.61k, False: 0]
  |  Branch (10422:39): [True: 0, False: 7.61k]
  ------------------
10423|      0|	ctxt->myDoc->compression = ctxt->input->buf->compressed;
10424|      0|    }
10425|       |
10426|       |    /*
10427|       |     * The Misc part of the Prolog
10428|       |     */
10429|  7.67k|    xmlParseMisc(ctxt);
10430|       |
10431|       |    /*
10432|       |     * Then possibly doc type declaration(s) and more Misc
10433|       |     * (doctypedecl Misc*)?
10434|       |     */
10435|  7.67k|    GROW;
  ------------------
  |  | 2271|  7.67k|    if ((!PARSER_PROGRESSIVE(ctxt)) && \
  |  |  ------------------
  |  |  |  |   47|  7.67k|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|  7.67k|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2271:9): [True: 7.67k, False: 0]
  |  |  ------------------
  |  | 2272|  7.67k|        (ctxt->input->end - ctxt->input->cur < INPUT_CHUNK)) \
  |  |  ------------------
  |  |  |  |   63|  7.67k|#define INPUT_CHUNK	250
  |  |  ------------------
  |  |  |  Branch (2272:9): [True: 5.44k, False: 2.22k]
  |  |  ------------------
  |  | 2273|  7.67k|	xmlParserGrow(ctxt);
  ------------------
10436|  7.67k|    if (CMP9(CUR_PTR, '<', '!', 'D', 'O', 'C', 'T', 'Y', 'P', 'E')) {
  ------------------
  |  | 2242|  7.67k|  ( CMP8( s, c1, c2, c3, c4, c5, c6, c7, c8 ) && \
  |  |  ------------------
  |  |  |  | 2240|  15.3k|  ( CMP7( s, c1, c2, c3, c4, c5, c6, c7 ) && ((unsigned char *) s)[ 7 ] == c8 )
  |  |  |  |  ------------------
  |  |  |  |  |  | 2238|  15.3k|  ( CMP6( s, c1, c2, c3, c4, c5, c6 ) && ((unsigned char *) s)[ 6 ] == c7 )
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  | 2236|  15.3k|  ( CMP5( s, c1, c2, c3, c4, c5 ) && ((unsigned char *) s)[ 5 ] == c6 )
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  | 2234|  15.3k|  ( CMP4( s, c1, c2, c3, c4 ) && ((unsigned char *) s)[ 4 ] == c5 )
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  | 2231|  15.3k|  ( ((unsigned char *) s)[ 0 ] == c1 && ((unsigned char *) s)[ 1 ] == c2 && \
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  Branch (2231:5): [True: 7.65k, False: 13]
  |  |  |  |  |  |  |  |  |  |  |  |  |  Branch (2231:41): [True: 2.41k, False: 5.24k]
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  | 2232|  7.67k|    ((unsigned char *) s)[ 2 ] == c3 && ((unsigned char *) s)[ 3 ] == c4 )
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  Branch (2232:5): [True: 2.40k, False: 10]
  |  |  |  |  |  |  |  |  |  |  |  |  |  Branch (2232:41): [True: 2.39k, False: 3]
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (2234:34): [True: 2.39k, False: 3]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (2236:38): [True: 2.39k, False: 3]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (2238:42): [True: 2.38k, False: 8]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2240:46): [True: 2.38k, False: 2]
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 2243|  7.67k|    ((unsigned char *) s)[ 8 ] == c9 )
  |  |  ------------------
  |  |  |  Branch (2243:5): [True: 2.37k, False: 7]
  |  |  ------------------
  ------------------
10437|       |
10438|  2.37k|	ctxt->inSubset = 1;
10439|  2.37k|	xmlParseDocTypeDecl(ctxt);
10440|  2.37k|	if (RAW == '[') {
  ------------------
  |  | 2224|  2.37k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (10440:6): [True: 709, False: 1.66k]
  ------------------
10441|    709|	    xmlParseInternalSubset(ctxt);
10442|  1.66k|	} else if (RAW == '>') {
  ------------------
  |  | 2224|  1.66k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (10442:13): [True: 1.63k, False: 28]
  ------------------
10443|  1.63k|            NEXT;
  ------------------
  |  | 2279|  1.63k|#define NEXT xmlNextChar(ctxt)
  ------------------
10444|  1.63k|        }
10445|       |
10446|       |	/*
10447|       |	 * Create and update the external subset.
10448|       |	 */
10449|  2.37k|	ctxt->inSubset = 2;
10450|  2.37k|	if ((ctxt->sax != NULL) && (ctxt->sax->externalSubset != NULL) &&
  ------------------
  |  Branch (10450:6): [True: 2.37k, False: 0]
  |  Branch (10450:29): [True: 2.37k, False: 0]
  ------------------
10451|  2.37k|	    (!ctxt->disableSAX))
  ------------------
  |  Branch (10451:6): [True: 2.28k, False: 96]
  ------------------
10452|  2.28k|	    ctxt->sax->externalSubset(ctxt->userData, ctxt->intSubName,
10453|  2.28k|	                              ctxt->extSubSystem, ctxt->extSubURI);
10454|  2.37k|	ctxt->inSubset = 0;
10455|       |
10456|  2.37k|        xmlCleanSpecialAttr(ctxt);
10457|       |
10458|  2.37k|	xmlParseMisc(ctxt);
10459|  2.37k|    }
10460|       |
10461|       |    /*
10462|       |     * Time to start parsing the tree itself
10463|       |     */
10464|  7.67k|    GROW;
  ------------------
  |  | 2271|  7.67k|    if ((!PARSER_PROGRESSIVE(ctxt)) && \
  |  |  ------------------
  |  |  |  |   47|  7.67k|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|  7.67k|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2271:9): [True: 7.67k, False: 0]
  |  |  ------------------
  |  | 2272|  7.67k|        (ctxt->input->end - ctxt->input->cur < INPUT_CHUNK)) \
  |  |  ------------------
  |  |  |  |   63|  7.67k|#define INPUT_CHUNK	250
  |  |  ------------------
  |  |  |  Branch (2272:9): [True: 5.61k, False: 2.06k]
  |  |  ------------------
  |  | 2273|  7.67k|	xmlParserGrow(ctxt);
  ------------------
10465|  7.67k|    if (RAW != '<') {
  ------------------
  |  | 2224|  7.67k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (10465:9): [True: 100, False: 7.57k]
  ------------------
10466|    100|        if (ctxt->wellFormed)
  ------------------
  |  Branch (10466:13): [True: 4, False: 96]
  ------------------
10467|      4|            xmlFatalErrMsg(ctxt, XML_ERR_DOCUMENT_EMPTY,
10468|      4|                           "Start tag expected, '<' not found\n");
10469|  7.57k|    } else {
10470|  7.57k|	xmlParseElement(ctxt);
10471|       |
10472|       |	/*
10473|       |	 * The Misc part at the end
10474|       |	 */
10475|  7.57k|	xmlParseMisc(ctxt);
10476|       |
10477|  7.57k|        xmlParserCheckEOF(ctxt, XML_ERR_DOCUMENT_END);
10478|  7.57k|    }
10479|       |
10480|  7.67k|    ctxt->instate = XML_PARSER_EOF;
10481|  7.67k|    xmlFinishDocument(ctxt);
10482|       |
10483|  7.67k|    if (! ctxt->wellFormed) {
  ------------------
  |  Branch (10483:9): [True: 797, False: 6.87k]
  ------------------
10484|    797|	ctxt->valid = 0;
10485|    797|	return(-1);
10486|    797|    }
10487|       |
10488|  6.87k|    return(0);
10489|  7.67k|}
xmlParseChunk:
11238|   415k|              int terminate) {
11239|   415k|    size_t curBase;
11240|   415k|    size_t maxLength;
11241|   415k|    size_t pos;
11242|   415k|    int end_in_lf = 0;
11243|   415k|    int res;
11244|       |
11245|   415k|    if ((ctxt == NULL) || (size < 0))
  ------------------
  |  Branch (11245:9): [True: 0, False: 415k]
  |  Branch (11245:27): [True: 0, False: 415k]
  ------------------
11246|      0|        return(XML_ERR_ARGUMENT);
11247|   415k|    if ((chunk == NULL) && (size > 0))
  ------------------
  |  Branch (11247:9): [True: 0, False: 415k]
  |  Branch (11247:28): [True: 0, False: 0]
  ------------------
11248|      0|        return(XML_ERR_ARGUMENT);
11249|   415k|    if ((ctxt->input == NULL) || (ctxt->input->buf == NULL))
  ------------------
  |  Branch (11249:9): [True: 0, False: 415k]
  |  Branch (11249:34): [True: 0, False: 415k]
  ------------------
11250|      0|        return(XML_ERR_ARGUMENT);
11251|   415k|    if (ctxt->disableSAX != 0)
  ------------------
  |  Branch (11251:9): [True: 3.57k, False: 411k]
  ------------------
11252|  3.57k|        return(ctxt->errNo);
11253|       |
11254|   411k|    ctxt->input->flags |= XML_INPUT_PROGRESSIVE;
  ------------------
  |  |   41|   411k|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  ------------------
11255|   411k|    if (ctxt->instate == XML_PARSER_START)
  ------------------
  |  Branch (11255:9): [True: 36.6k, False: 375k]
  ------------------
11256|  36.6k|        xmlCtxtInitializeLate(ctxt);
11257|   411k|    if ((size > 0) && (chunk != NULL) && (!terminate) &&
  ------------------
  |  Branch (11257:9): [True: 384k, False: 27.6k]
  |  Branch (11257:23): [True: 384k, False: 0]
  |  Branch (11257:42): [True: 384k, False: 0]
  ------------------
11258|   384k|        (chunk[size - 1] == '\r')) {
  ------------------
  |  Branch (11258:9): [True: 2.58k, False: 381k]
  ------------------
11259|  2.58k|	end_in_lf = 1;
11260|  2.58k|	size--;
11261|  2.58k|    }
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|   411k|    pos = ctxt->input->cur - ctxt->input->base;
11268|   411k|    res = xmlParserInputBufferPush(ctxt->input->buf, size, chunk);
11269|   411k|    xmlBufUpdateInput(ctxt->input->buf->buffer, ctxt->input, pos);
11270|   411k|    if (res < 0) {
  ------------------
  |  Branch (11270:9): [True: 241, False: 411k]
  ------------------
11271|    241|        xmlCtxtErrIO(ctxt, ctxt->input->buf->error, NULL);
11272|    241|        return(ctxt->errNo);
11273|    241|    }
11274|       |
11275|   411k|    xmlParseTryOrFinish(ctxt, terminate);
11276|       |
11277|   411k|    curBase = ctxt->input->cur - ctxt->input->base;
11278|   411k|    maxLength = (ctxt->options & XML_PARSE_HUGE) ?
  ------------------
  |  Branch (11278:17): [True: 191k, False: 220k]
  ------------------
11279|   191k|                XML_MAX_HUGE_LENGTH :
  ------------------
  |  |   55|   191k|#define XML_MAX_HUGE_LENGTH 1000000000
  ------------------
11280|   411k|                XML_MAX_LOOKUP_LIMIT;
  ------------------
  |  |   81|   631k|#define XML_MAX_LOOKUP_LIMIT 10000000
  ------------------
11281|   411k|    if (curBase > maxLength) {
  ------------------
  |  Branch (11281:9): [True: 0, False: 411k]
  ------------------
11282|      0|        xmlFatalErr(ctxt, XML_ERR_RESOURCE_LIMIT,
11283|      0|                    "Buffer size limit exceeded, try XML_PARSE_HUGE\n");
11284|      0|    }
11285|       |
11286|   411k|    if ((ctxt->errNo != XML_ERR_OK) && (ctxt->disableSAX != 0))
  ------------------
  |  Branch (11286:9): [True: 83.0k, False: 328k]
  |  Branch (11286:40): [True: 11.1k, False: 71.9k]
  ------------------
11287|  11.1k|        return(ctxt->errNo);
11288|       |
11289|   400k|    if (end_in_lf == 1) {
  ------------------
  |  Branch (11289:9): [True: 2.58k, False: 397k]
  ------------------
11290|  2.58k|	pos = ctxt->input->cur - ctxt->input->base;
11291|  2.58k|	res = xmlParserInputBufferPush(ctxt->input->buf, 1, "\r");
11292|  2.58k|	xmlBufUpdateInput(ctxt->input->buf->buffer, ctxt->input, pos);
11293|  2.58k|        if (res < 0) {
  ------------------
  |  Branch (11293:13): [True: 3, False: 2.58k]
  ------------------
11294|      3|            xmlCtxtErrIO(ctxt, ctxt->input->buf->error, NULL);
11295|      3|            return(ctxt->errNo);
11296|      3|        }
11297|  2.58k|    }
11298|   400k|    if (terminate) {
  ------------------
  |  Branch (11298:9): [True: 18.8k, False: 381k]
  ------------------
11299|       |	/*
11300|       |	 * Check for termination
11301|       |	 */
11302|  18.8k|        if ((ctxt->instate != XML_PARSER_EOF) &&
  ------------------
  |  Branch (11302:13): [True: 10.3k, False: 8.51k]
  ------------------
11303|  10.3k|            (ctxt->instate != XML_PARSER_EPILOG)) {
  ------------------
  |  Branch (11303:13): [True: 5.20k, False: 5.13k]
  ------------------
11304|  5.20k|            if (ctxt->nameNr > 0) {
  ------------------
  |  Branch (11304:17): [True: 3.89k, False: 1.30k]
  ------------------
11305|  3.89k|                const xmlChar *name = ctxt->nameTab[ctxt->nameNr - 1];
11306|  3.89k|                int line = ctxt->pushTab[ctxt->nameNr - 1].line;
11307|  3.89k|                xmlFatalErrMsgStrIntStr(ctxt, XML_ERR_TAG_NOT_FINISHED,
11308|  3.89k|                        "Premature end of data in tag %s line %d\n",
11309|  3.89k|                        name, line, NULL);
11310|  3.89k|            } else if (ctxt->instate == XML_PARSER_START) {
  ------------------
  |  Branch (11310:24): [True: 24, False: 1.28k]
  ------------------
11311|     24|                xmlFatalErr(ctxt, XML_ERR_DOCUMENT_EMPTY, NULL);
11312|  1.28k|            } else {
11313|  1.28k|                xmlFatalErrMsg(ctxt, XML_ERR_DOCUMENT_EMPTY,
11314|  1.28k|                               "Start tag expected, '<' not found\n");
11315|  1.28k|            }
11316|  13.6k|        } else {
11317|  13.6k|            xmlParserCheckEOF(ctxt, XML_ERR_DOCUMENT_END);
11318|  13.6k|        }
11319|  18.8k|	if (ctxt->instate != XML_PARSER_EOF) {
  ------------------
  |  Branch (11319:6): [True: 10.1k, False: 8.74k]
  ------------------
11320|  10.1k|            ctxt->instate = XML_PARSER_EOF;
11321|  10.1k|            xmlFinishDocument(ctxt);
11322|  10.1k|	}
11323|  18.8k|    }
11324|   400k|    if (ctxt->wellFormed == 0)
  ------------------
  |  Branch (11324:9): [True: 20.1k, False: 380k]
  ------------------
11325|  20.1k|	return((xmlParserErrors) ctxt->errNo);
11326|   380k|    else
11327|   380k|        return(0);
11328|   400k|}
xmlCreatePushParserCtxt:
11359|  36.4k|                        const char *chunk, int size, const char *filename) {
11360|  36.4k|    xmlParserCtxtPtr ctxt;
11361|  36.4k|    xmlParserInputPtr input;
11362|       |
11363|  36.4k|    ctxt = xmlNewSAXParserCtxt(sax, user_data);
11364|  36.4k|    if (ctxt == NULL)
  ------------------
  |  Branch (11364:9): [True: 23, False: 36.4k]
  ------------------
11365|     23|	return(NULL);
11366|       |
11367|  36.4k|    ctxt->options &= ~XML_PARSE_NODICT;
11368|  36.4k|    ctxt->dictNames = 1;
11369|       |
11370|  36.4k|    input = xmlNewPushInput(filename, chunk, size);
11371|  36.4k|    if (input == NULL) {
  ------------------
  |  Branch (11371:9): [True: 12, False: 36.4k]
  ------------------
11372|     12|	xmlFreeParserCtxt(ctxt);
11373|     12|	return(NULL);
11374|     12|    }
11375|  36.4k|    if (xmlCtxtPushInput(ctxt, input) < 0) {
  ------------------
  |  Branch (11375:9): [True: 0, False: 36.4k]
  ------------------
11376|      0|        xmlFreeInputStream(input);
11377|      0|        xmlFreeParserCtxt(ctxt);
11378|      0|        return(NULL);
11379|      0|    }
11380|       |
11381|  36.4k|    return(ctxt);
11382|  36.4k|}
xmlStopParser:
11391|  38.7k|xmlStopParser(xmlParserCtxt *ctxt) {
11392|  38.7k|    if (ctxt == NULL)
  ------------------
  |  Branch (11392:9): [True: 0, False: 38.7k]
  ------------------
11393|      0|        return;
11394|       |
11395|       |    /* This stops the parser */
11396|  38.7k|    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|  38.7k|    if (ctxt->errNo == XML_ERR_OK) {
  ------------------
  |  Branch (11404:9): [True: 3.32k, False: 35.3k]
  ------------------
11405|  3.32k|        ctxt->errNo = XML_ERR_USER_STOP;
11406|  3.32k|        ctxt->lastError.code = XML_ERR_USER_STOP;
11407|  3.32k|        ctxt->wellFormed = 0;
11408|  3.32k|    }
11409|  38.7k|}
xmlCtxtUseOptions:
13268|  44.8k|{
13269|  44.8k|    int keepMask;
13270|       |
13271|  44.8k|#ifdef LIBXML_HTML_ENABLED
13272|  44.8k|    if ((ctxt != NULL) && (ctxt->html))
  ------------------
  |  Branch (13272:9): [True: 44.8k, False: 0]
  |  Branch (13272:27): [True: 0, False: 44.8k]
  ------------------
13273|      0|        return(htmlCtxtUseOptions(ctxt, options));
13274|  44.8k|#endif
13275|       |
13276|       |    /*
13277|       |     * For historic reasons, some options can only be enabled.
13278|       |     */
13279|  44.8k|    keepMask = XML_PARSE_NOERROR |
13280|  44.8k|               XML_PARSE_NOWARNING |
13281|  44.8k|               XML_PARSE_NONET |
13282|  44.8k|               XML_PARSE_NSCLEAN |
13283|  44.8k|               XML_PARSE_NOCDATA |
13284|  44.8k|               XML_PARSE_COMPACT |
13285|  44.8k|               XML_PARSE_OLD10 |
13286|  44.8k|               XML_PARSE_HUGE |
13287|  44.8k|               XML_PARSE_OLDSAX |
13288|  44.8k|               XML_PARSE_IGNORE_ENC |
13289|  44.8k|               XML_PARSE_BIG_LINES;
13290|       |
13291|  44.8k|    return(xmlCtxtSetOptionsInternal(ctxt, options, keepMask));
13292|  44.8k|}
parser.c:xmlParserNsLookup:
 1488|  1.32M|                  xmlParserNsBucket **bucketPtr) {
 1489|  1.32M|    xmlParserNsBucket *bucket, *tombstone;
 1490|  1.32M|    unsigned index, hashValue;
 1491|       |
 1492|  1.32M|    if (prefix->name == NULL)
  ------------------
  |  Branch (1492:9): [True: 629k, False: 697k]
  ------------------
 1493|   629k|        return(ctxt->nsdb->defaultNsIndex);
 1494|       |
 1495|   697k|    if (ctxt->nsdb->hashSize == 0)
  ------------------
  |  Branch (1495:9): [True: 26.6k, False: 670k]
  ------------------
 1496|  26.6k|        return(INT_MAX);
 1497|       |
 1498|   670k|    hashValue = prefix->hashValue;
 1499|   670k|    index = hashValue & (ctxt->nsdb->hashSize - 1);
 1500|   670k|    bucket = &ctxt->nsdb->hash[index];
 1501|   670k|    tombstone = NULL;
 1502|       |
 1503|   947k|    while (bucket->hashValue) {
  ------------------
  |  Branch (1503:12): [True: 837k, False: 109k]
  ------------------
 1504|   837k|        if (bucket->index == INT_MAX) {
  ------------------
  |  Branch (1504:13): [True: 55.1k, False: 782k]
  ------------------
 1505|  55.1k|            if (tombstone == NULL)
  ------------------
  |  Branch (1505:17): [True: 45.0k, False: 10.1k]
  ------------------
 1506|  45.0k|                tombstone = bucket;
 1507|   782k|        } else if (bucket->hashValue == hashValue) {
  ------------------
  |  Branch (1507:20): [True: 560k, False: 221k]
  ------------------
 1508|   560k|            if (ctxt->nsTab[bucket->index * 2] == prefix->name) {
  ------------------
  |  Branch (1508:17): [True: 560k, False: 0]
  ------------------
 1509|   560k|                if (bucketPtr != NULL)
  ------------------
  |  Branch (1509:21): [True: 375k, False: 185k]
  ------------------
 1510|   375k|                    *bucketPtr = bucket;
 1511|   560k|                return(bucket->index);
 1512|   560k|            }
 1513|   560k|        }
 1514|       |
 1515|   276k|        index++;
 1516|   276k|        bucket++;
 1517|   276k|        if (index == ctxt->nsdb->hashSize) {
  ------------------
  |  Branch (1517:13): [True: 70.3k, False: 206k]
  ------------------
 1518|  70.3k|            index = 0;
 1519|  70.3k|            bucket = ctxt->nsdb->hash;
 1520|  70.3k|        }
 1521|   276k|    }
 1522|       |
 1523|   109k|    if (bucketPtr != NULL)
  ------------------
  |  Branch (1523:9): [True: 34.0k, False: 75.8k]
  ------------------
 1524|  34.0k|        *bucketPtr = tombstone ? tombstone : bucket;
  ------------------
  |  Branch (1524:22): [True: 30.8k, False: 3.26k]
  ------------------
 1525|       |    return(INT_MAX);
 1526|   670k|}
parser.c:xmlFatalErrMsg:
  259|  37.5M|{
  260|  37.5M|    xmlCtxtErr(ctxt, NULL, XML_FROM_PARSER, error, XML_ERR_FATAL,
  261|  37.5M|               NULL, NULL, NULL, 0, "%s", msg);
  262|  37.5M|}
parser.c:xmlErrMemory:
  224|    389|xmlErrMemory(xmlParserCtxtPtr ctxt) {
  225|    389|    xmlCtxtErrMemory(ctxt);
  226|    389|}
parser.c:xmlFatalErrMsgInt:
  313|  7.65M|{
  314|  7.65M|    xmlCtxtErr(ctxt, NULL, XML_FROM_PARSER, error, XML_ERR_FATAL,
  315|  7.65M|               NULL, NULL, NULL, val, msg, val);
  316|  7.65M|}
parser.c:xmlIsNameChar:
 3031|  22.0M|xmlIsNameChar(int c, int old10) {
 3032|  22.0M|    if (!old10)
  ------------------
  |  Branch (3032:9): [True: 18.4M, False: 3.52M]
  ------------------
 3033|  18.4M|        return(xmlIsNameCharNew(c));
 3034|  3.52M|    else
 3035|  3.52M|        return(xmlIsNameCharOld(c));
 3036|  22.0M|}
parser.c:xmlIsNameCharNew:
 2973|  18.4M|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|  18.4M|    if ((c != ' ') && (c != '>') && (c != '/') && /* accelerators */
  ------------------
  |  Branch (2978:9): [True: 18.4M, False: 81.9k]
  |  Branch (2978:23): [True: 18.3M, False: 21.4k]
  |  Branch (2978:37): [True: 18.3M, False: 10.0k]
  ------------------
 2979|  18.3M|        (((c >= 'a') && (c <= 'z')) ||
  ------------------
  |  Branch (2979:11): [True: 13.3M, False: 5.04M]
  |  Branch (2979:25): [True: 2.48M, False: 10.8M]
  ------------------
 2980|  15.8M|         ((c >= 'A') && (c <= 'Z')) ||
  ------------------
  |  Branch (2980:11): [True: 13.2M, False: 2.60M]
  |  Branch (2980:25): [True: 2.41M, False: 10.8M]
  ------------------
 2981|  13.4M|         ((c >= '0') && (c <= '9')) || /* !start */
  ------------------
  |  Branch (2981:11): [True: 13.2M, False: 190k]
  |  Branch (2981:25): [True: 549k, False: 12.7M]
  ------------------
 2982|  12.9M|         (c == '_') || (c == ':') ||
  ------------------
  |  Branch (2982:10): [True: 20.6k, False: 12.9M]
  |  Branch (2982:24): [True: 17.3k, False: 12.8M]
  ------------------
 2983|  12.8M|         (c == '-') || (c == '.') || (c == 0xB7) || /* !start */
  ------------------
  |  Branch (2983:10): [True: 58.7k, False: 12.8M]
  |  Branch (2983:24): [True: 20.1k, False: 12.8M]
  |  Branch (2983:38): [True: 414, False: 12.8M]
  ------------------
 2984|  12.8M|         ((c >= 0xC0) && (c <= 0xD6)) ||
  ------------------
  |  Branch (2984:11): [True: 10.8M, False: 1.97M]
  |  Branch (2984:26): [True: 3.67M, False: 7.15M]
  ------------------
 2985|  9.13M|         ((c >= 0xD8) && (c <= 0xF6)) ||
  ------------------
  |  Branch (2985:11): [True: 7.15M, False: 1.97M]
  |  Branch (2985:26): [True: 9.11k, False: 7.15M]
  ------------------
 2986|  9.12M|         ((c >= 0xF8) && (c <= 0x2FF)) ||
  ------------------
  |  Branch (2986:11): [True: 7.15M, False: 1.97M]
  |  Branch (2986:26): [True: 2.26M, False: 4.88M]
  ------------------
 2987|  6.85M|         ((c >= 0x300) && (c <= 0x36F)) || /* !start */
  ------------------
  |  Branch (2987:11): [True: 4.88M, False: 1.97M]
  |  Branch (2987:27): [True: 1.25k, False: 4.87M]
  ------------------
 2988|  6.85M|         ((c >= 0x370) && (c <= 0x37D)) ||
  ------------------
  |  Branch (2988:11): [True: 4.87M, False: 1.97M]
  |  Branch (2988:27): [True: 314, False: 4.87M]
  ------------------
 2989|  6.85M|         ((c >= 0x37F) && (c <= 0x1FFF)) ||
  ------------------
  |  Branch (2989:11): [True: 4.87M, False: 1.97M]
  |  Branch (2989:27): [True: 1.31M, False: 3.56M]
  ------------------
 2990|  5.54M|         ((c >= 0x200C) && (c <= 0x200D)) ||
  ------------------
  |  Branch (2990:11): [True: 3.56M, False: 1.97M]
  |  Branch (2990:28): [True: 277, False: 3.56M]
  ------------------
 2991|  5.54M|         ((c >= 0x203F) && (c <= 0x2040)) || /* !start */
  ------------------
  |  Branch (2991:11): [True: 3.56M, False: 1.97M]
  |  Branch (2991:28): [True: 229, False: 3.56M]
  ------------------
 2992|  5.54M|         ((c >= 0x2070) && (c <= 0x218F)) ||
  ------------------
  |  Branch (2992:11): [True: 3.56M, False: 1.97M]
  |  Branch (2992:28): [True: 1.71k, False: 3.56M]
  ------------------
 2993|  5.54M|         ((c >= 0x2C00) && (c <= 0x2FEF)) ||
  ------------------
  |  Branch (2993:11): [True: 3.56M, False: 1.97M]
  |  Branch (2993:28): [True: 2.74k, False: 3.56M]
  ------------------
 2994|  5.53M|         ((c >= 0x3001) && (c <= 0xD7FF)) ||
  ------------------
  |  Branch (2994:11): [True: 3.56M, False: 1.97M]
  |  Branch (2994:28): [True: 34.4k, False: 3.52M]
  ------------------
 2995|  5.50M|         ((c >= 0xF900) && (c <= 0xFDCF)) ||
  ------------------
  |  Branch (2995:11): [True: 3.52M, False: 1.97M]
  |  Branch (2995:28): [True: 391, False: 3.52M]
  ------------------
 2996|  5.50M|         ((c >= 0xFDF0) && (c <= 0xFFFD)) ||
  ------------------
  |  Branch (2996:11): [True: 3.52M, False: 1.97M]
  |  Branch (2996:28): [True: 3.50M, False: 16.2k]
  ------------------
 2997|  1.99M|         ((c >= 0x10000) && (c <= 0xEFFFF))))
  ------------------
  |  Branch (2997:11): [True: 16.2k, False: 1.97M]
  |  Branch (2997:29): [True: 2.75k, False: 13.4k]
  ------------------
 2998|  16.3M|         return(1);
 2999|  2.10M|    return(0);
 3000|  18.4M|}
parser.c:xmlIsNameCharOld:
 3011|  3.52M|xmlIsNameCharOld(int c) {
 3012|  3.52M|    if ((c != ' ') && (c != '>') && (c != '/') && /* accelerators */
  ------------------
  |  Branch (3012:9): [True: 3.52M, False: 2.53k]
  |  Branch (3012:23): [True: 3.52M, False: 1.91k]
  |  Branch (3012:37): [True: 3.52M, False: 711]
  ------------------
 3013|  3.52M|        ((IS_LETTER(c)) || (IS_DIGIT(c)) ||
  ------------------
  |  |  208|  3.52M|#define IS_LETTER(c) (IS_BASECHAR(c) || IS_IDEOGRAPHIC(c))
  |  |  ------------------
  |  |  |  |  145|  3.52M|#define IS_BASECHAR(c) xmlIsBaseCharQ(c)
  |  |  |  |  ------------------
  |  |  |  |  |  |   81|  7.04M|#define xmlIsBaseCharQ(c)	(((c) < 0x100) ? \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (81:27): [True: 2.15M, False: 1.36M]
  |  |  |  |  |  |  |  Branch (81:28): [True: 3.09M, False: 424k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   82|  7.04M|				 xmlIsBaseChar_ch((c)) : \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|  3.09M|#define xmlIsBaseChar_ch(c)	(((0x41 <= (c)) && ((c) <= 0x5a)) || \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (70:31): [True: 1.75M, False: 1.34M]
  |  |  |  |  |  |  |  |  |  Branch (70:48): [True: 259k, False: 1.49M]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   71|  3.09M|				 ((0x61 <= (c)) && ((c) <= 0x7a)) || \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (71:7): [True: 1.48M, False: 1.34M]
  |  |  |  |  |  |  |  |  |  Branch (71:24): [True: 753k, False: 736k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   72|  3.09M|				 ((0xc0 <= (c)) && ((c) <= 0xd6)) || \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (72:7): [True: 734k, False: 1.34M]
  |  |  |  |  |  |  |  |  |  Branch (72:24): [True: 725k, False: 8.25k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   73|  3.09M|				 ((0xd8 <= (c)) && ((c) <= 0xf6)) || \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (73:7): [True: 8.25k, False: 1.34M]
  |  |  |  |  |  |  |  |  |  Branch (73:24): [True: 1.72k, False: 6.53k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   74|  3.09M|				  (0xf8 <= (c)))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (74:7): [True: 6.53k, False: 1.34M]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   83|  7.04M|				 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: 3.29k, False: 1.35M]
  |  |  |  |  |  |  |  Branch (169:31): [True: 1.34M, False: 13.8k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  170|  1.36M|				 0 :\
  |  |  |  |  |  |  171|  1.36M|				(((0x4e00 <= (c)) && ((c) <= 0x9fa5)) || \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (171:7): [True: 10.6k, False: 3.22k]
  |  |  |  |  |  |  |  Branch (171:26): [True: 2.43k, False: 8.17k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  172|  13.8k|				 ((c) == 0x3007) || \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (172:6): [True: 535, False: 10.8k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  173|  13.8k|				 ((0x3021 <= (c)) && ((c) <= 0x3029))))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (173:7): [True: 8.78k, False: 2.08k]
  |  |  |  |  |  |  |  Branch (173:26): [True: 334, False: 8.45k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                      ((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.5k]
  |  |  |  |  ------------------
  |  |  |  |  145|  1.35M|				 xmlIsDigit_ch((c)) : \
  |  |  |  |  ------------------
  |  |  |  |  |  |  137|  1.34M|#define xmlIsDigit_ch(c)	(((0x30 <= (c)) && ((c) <= 0x39)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (137:28): [True: 1.32M, False: 19.4k]
  |  |  |  |  |  |  |  Branch (137:45): [True: 259k, False: 1.07M]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  146|  1.35M|				 xmlCharInRange((c), &xmlIsDigitGroup))
  |  |  ------------------
  ------------------
  |  Branch (3013:28): [True: 259k, False: 1.09M]
  ------------------
 3014|  1.09M|         (c == '.') || (c == '-') ||
  ------------------
  |  Branch (3014:10): [True: 893, False: 1.09M]
  |  Branch (3014:24): [True: 2.53k, False: 1.09M]
  ------------------
 3015|  1.09M|         (c == '_') || (c == ':') ||
  ------------------
  |  Branch (3015:10): [True: 1.79k, False: 1.09M]
  |  Branch (3015:24): [True: 5.53k, False: 1.08M]
  ------------------
 3016|  1.08M|         (IS_COMBINING(c)) ||
  ------------------
  |  |  168|  1.08M|#define IS_COMBINING(c) xmlIsCombiningQ(c)
  |  |  ------------------
  |  |  |  |  128|  1.08M|#define xmlIsCombiningQ(c)	(((c) < 0x100) ? \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (128:29): [True: 1.07M, False: 10.0k]
  |  |  |  |  ------------------
  |  |  |  |  129|  1.08M|				 0 : \
  |  |  |  |  130|  1.08M|				 xmlCharInRange((c), &xmlIsCombiningGroup))
  |  |  ------------------
  ------------------
  |  Branch (3016:10): [True: 1.12k, False: 1.08M]
  ------------------
 3017|  1.08M|         (IS_EXTENDER(c))))
  ------------------
  |  |  185|  1.08M|#define IS_EXTENDER(c) xmlIsExtenderQ(c)
  |  |  ------------------
  |  |  |  |  160|  1.08M|#define xmlIsExtenderQ(c)	(((c) < 0x100) ? \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (160:28): [True: 1.07M, False: 8.95k]
  |  |  |  |  ------------------
  |  |  |  |  161|  1.08M|				 xmlIsExtender_ch((c)) : \
  |  |  |  |  ------------------
  |  |  |  |  |  |  153|  1.07M|#define xmlIsExtender_ch(c)	(((c) == 0xb7))
  |  |  |  |  ------------------
  |  |  |  |  162|  1.08M|				 xmlCharInRange((c), &xmlIsExtenderGroup))
  |  |  ------------------
  ------------------
  |  Branch (3017:10): [True: 924, False: 1.08M]
  ------------------
 3018|  2.43M|        return(1);
 3019|  1.09M|    return(0);
 3020|  3.52M|}
parser.c:xmlIsNameStartChar:
 3023|  3.49M|xmlIsNameStartChar(int c, int old10) {
 3024|  3.49M|    if (!old10)
  ------------------
  |  Branch (3024:9): [True: 2.26M, False: 1.22M]
  ------------------
 3025|  2.26M|        return(xmlIsNameStartCharNew(c));
 3026|  1.22M|    else
 3027|  1.22M|        return(xmlIsNameStartCharOld(c));
 3028|  3.49M|}
parser.c:xmlIsNameStartCharNew:
 2947|  2.26M|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|  2.26M|    if ((c != ' ') && (c != '>') && (c != '/') && /* accelerators */
  ------------------
  |  Branch (2952:9): [True: 2.26M, False: 2.10k]
  |  Branch (2952:23): [True: 2.26M, False: 4.24k]
  |  Branch (2952:37): [True: 2.25M, False: 4.30k]
  ------------------
 2953|  2.25M|        (((c >= 'a') && (c <= 'z')) ||
  ------------------
  |  Branch (2953:11): [True: 2.05M, False: 198k]
  |  Branch (2953:25): [True: 2.01M, False: 42.5k]
  ------------------
 2954|   241k|         ((c >= 'A') && (c <= 'Z')) ||
  ------------------
  |  Branch (2954:11): [True: 104k, False: 136k]
  |  Branch (2954:25): [True: 52.8k, False: 52.0k]
  ------------------
 2955|   188k|         (c == '_') || (c == ':') ||
  ------------------
  |  Branch (2955:10): [True: 5.60k, False: 182k]
  |  Branch (2955:24): [True: 2.68k, False: 180k]
  ------------------
 2956|   180k|         ((c >= 0xC0) && (c <= 0xD6)) ||
  ------------------
  |  Branch (2956:11): [True: 39.8k, False: 140k]
  |  Branch (2956:26): [True: 431, False: 39.4k]
  ------------------
 2957|   179k|         ((c >= 0xD8) && (c <= 0xF6)) ||
  ------------------
  |  Branch (2957:11): [True: 39.4k, False: 140k]
  |  Branch (2957:26): [True: 940, False: 38.4k]
  ------------------
 2958|   178k|         ((c >= 0xF8) && (c <= 0x2FF)) ||
  ------------------
  |  Branch (2958:11): [True: 38.4k, False: 140k]
  |  Branch (2958:26): [True: 1.75k, False: 36.7k]
  ------------------
 2959|   176k|         ((c >= 0x370) && (c <= 0x37D)) ||
  ------------------
  |  Branch (2959:11): [True: 36.7k, False: 140k]
  |  Branch (2959:27): [True: 504, False: 36.1k]
  ------------------
 2960|   176k|         ((c >= 0x37F) && (c <= 0x1FFF)) ||
  ------------------
  |  Branch (2960:11): [True: 36.1k, False: 140k]
  |  Branch (2960:27): [True: 3.67k, False: 32.5k]
  ------------------
 2961|   172k|         ((c >= 0x200C) && (c <= 0x200D)) ||
  ------------------
  |  Branch (2961:11): [True: 32.5k, False: 140k]
  |  Branch (2961:28): [True: 72, False: 32.4k]
  ------------------
 2962|   172k|         ((c >= 0x2070) && (c <= 0x218F)) ||
  ------------------
  |  Branch (2962:11): [True: 32.2k, False: 140k]
  |  Branch (2962:28): [True: 304, False: 31.9k]
  ------------------
 2963|   172k|         ((c >= 0x2C00) && (c <= 0x2FEF)) ||
  ------------------
  |  Branch (2963:11): [True: 31.9k, False: 140k]
  |  Branch (2963:28): [True: 307, False: 31.5k]
  ------------------
 2964|   172k|         ((c >= 0x3001) && (c <= 0xD7FF)) ||
  ------------------
  |  Branch (2964:11): [True: 31.5k, False: 140k]
  |  Branch (2964:28): [True: 2.67k, False: 28.9k]
  ------------------
 2965|   169k|         ((c >= 0xF900) && (c <= 0xFDCF)) ||
  ------------------
  |  Branch (2965:11): [True: 28.8k, False: 140k]
  |  Branch (2965:28): [True: 261, False: 28.6k]
  ------------------
 2966|   169k|         ((c >= 0xFDF0) && (c <= 0xFFFD)) ||
  ------------------
  |  Branch (2966:11): [True: 28.6k, False: 140k]
  |  Branch (2966:28): [True: 9.11k, False: 19.5k]
  ------------------
 2967|   160k|         ((c >= 0x10000) && (c <= 0xEFFFF))))
  ------------------
  |  Branch (2967:11): [True: 19.5k, False: 140k]
  |  Branch (2967:29): [True: 978, False: 18.5k]
  ------------------
 2968|  2.09M|        return(1);
 2969|   169k|    return(0);
 2970|  2.26M|}
parser.c:xmlIsNameStartCharOld:
 3003|  1.22M|xmlIsNameStartCharOld(int c) {
 3004|  1.22M|    if ((c != ' ') && (c != '>') && (c != '/') && /* accelerators */
  ------------------
  |  Branch (3004:9): [True: 1.22M, False: 2.67k]
  |  Branch (3004:23): [True: 1.22M, False: 2.68k]
  |  Branch (3004:37): [True: 1.22M, False: 1.97k]
  ------------------
 3005|  1.22M|        ((IS_LETTER(c) || (c == '_') || (c == ':'))))
  ------------------
  |  |  208|  2.44M|#define IS_LETTER(c) (IS_BASECHAR(c) || IS_IDEOGRAPHIC(c))
  |  |  ------------------
  |  |  |  |  145|  1.22M|#define IS_BASECHAR(c) xmlIsBaseCharQ(c)
  |  |  |  |  ------------------
  |  |  |  |  |  |   81|  2.44M|#define xmlIsBaseCharQ(c)	(((c) < 0x100) ? \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (81:27): [True: 1.08M, False: 139k]
  |  |  |  |  |  |  |  Branch (81:28): [True: 1.20M, False: 15.0k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   82|  2.44M|				 xmlIsBaseChar_ch((c)) : \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|  1.20M|#define xmlIsBaseChar_ch(c)	(((0x41 <= (c)) && ((c) <= 0x5a)) || \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (70:31): [True: 1.08M, False: 122k]
  |  |  |  |  |  |  |  |  |  Branch (70:48): [True: 3.92k, False: 1.07M]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   71|  1.20M|				 ((0x61 <= (c)) && ((c) <= 0x7a)) || \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (71:7): [True: 1.07M, False: 124k]
  |  |  |  |  |  |  |  |  |  Branch (71:24): [True: 1.07M, False: 2.52k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   72|  1.20M|				 ((0xc0 <= (c)) && ((c) <= 0xd6)) || \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (72:7): [True: 1.39k, False: 125k]
  |  |  |  |  |  |  |  |  |  Branch (72:24): [True: 504, False: 887]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   73|  1.20M|				 ((0xd8 <= (c)) && ((c) <= 0xf6)) || \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (73:7): [True: 887, False: 125k]
  |  |  |  |  |  |  |  |  |  Branch (73:24): [True: 491, False: 396]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   74|  1.20M|				  (0xf8 <= (c)))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (74:7): [True: 396, False: 125k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   83|  2.44M|				 xmlCharInRange((c), &xmlIsBaseCharGroup))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define IS_LETTER(c) (IS_BASECHAR(c) || IS_IDEOGRAPHIC(c))
  |  |  ------------------
  |  |  |  |  200|   139k|#define IS_IDEOGRAPHIC(c) xmlIsIdeographicQ(c)
  |  |  |  |  ------------------
  |  |  |  |  |  |  169|   139k|#define xmlIsIdeographicQ(c)	(((c) < 0x100) ? \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (169:30): [True: 1.52k, False: 137k]
  |  |  |  |  |  |  |  Branch (169:31): [True: 125k, False: 13.5k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  170|   139k|				 0 :\
  |  |  |  |  |  |  171|   139k|				(((0x4e00 <= (c)) && ((c) <= 0x9fa5)) || \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (171:7): [True: 11.0k, False: 2.45k]
  |  |  |  |  |  |  |  Branch (171:26): [True: 666, False: 10.4k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  172|  13.5k|				 ((c) == 0x3007) || \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (172:6): [True: 540, False: 12.3k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  173|  13.5k|				 ((0x3021 <= (c)) && ((c) <= 0x3029))))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (173:7): [True: 10.7k, False: 1.57k]
  |  |  |  |  |  |  |  Branch (173:26): [True: 316, False: 10.4k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (3005:27): [True: 523, False: 137k]
  |  Branch (3005:41): [True: 2.88k, False: 134k]
  ------------------
 3006|  1.08M|        return(1);
 3007|   141k|    return(0);
 3008|  1.22M|}
parser.c:xmlParseNameComplex:
 3086|   242k|xmlParseNameComplex(xmlParserCtxtPtr ctxt) {
 3087|   242k|    const xmlChar *ret;
 3088|   242k|    int len = 0, l;
 3089|   242k|    int c;
 3090|   242k|    int maxLength = (ctxt->options & XML_PARSE_HUGE) ?
  ------------------
  |  Branch (3090:21): [True: 120k, False: 122k]
  ------------------
 3091|   120k|                    XML_MAX_TEXT_LENGTH :
  ------------------
  |  |   50|   120k|#define XML_MAX_TEXT_LENGTH 10000000
  ------------------
 3092|   242k|                    XML_MAX_NAME_LENGTH;
  ------------------
  |  |   65|   122k|#define XML_MAX_NAME_LENGTH 50000
  ------------------
 3093|   242k|    int old10 = (ctxt->options & XML_PARSE_OLD10) ? 1 : 0;
  ------------------
  |  Branch (3093:17): [True: 64.1k, False: 177k]
  ------------------
 3094|       |
 3095|       |    /*
 3096|       |     * Handler for more complex cases
 3097|       |     */
 3098|   242k|    c = xmlCurrentChar(ctxt, &l);
 3099|   242k|    if (!xmlIsNameStartChar(c, old10))
  ------------------
  |  Branch (3099:9): [True: 180k, False: 61.7k]
  ------------------
 3100|   180k|        return(NULL);
 3101|  61.7k|    len += l;
 3102|  61.7k|    NEXTL(l);
  ------------------
  |  | 2288|  61.7k|#define NEXTL(l) do {							\
  |  | 2289|  61.7k|    if (*(ctxt->input->cur) == '\n') {					\
  |  |  ------------------
  |  |  |  Branch (2289:9): [True: 0, False: 61.7k]
  |  |  ------------------
  |  | 2290|      0|	ctxt->input->line++; ctxt->input->col = 1;			\
  |  | 2291|  61.7k|    } else ctxt->input->col++;						\
  |  | 2292|  61.7k|    ctxt->input->cur += l;				\
  |  | 2293|  61.7k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2293:12): [Folded, False: 61.7k]
  |  |  ------------------
  ------------------
 3103|  61.7k|    c = xmlCurrentChar(ctxt, &l);
 3104|  5.48M|    while (xmlIsNameChar(c, old10)) {
  ------------------
  |  Branch (3104:12): [True: 5.42M, False: 61.7k]
  ------------------
 3105|  5.42M|        if (len <= INT_MAX - l)
  ------------------
  |  Branch (3105:13): [True: 5.42M, False: 0]
  ------------------
 3106|  5.42M|            len += l;
 3107|  5.42M|        NEXTL(l);
  ------------------
  |  | 2288|  5.42M|#define NEXTL(l) do {							\
  |  | 2289|  5.42M|    if (*(ctxt->input->cur) == '\n') {					\
  |  |  ------------------
  |  |  |  Branch (2289:9): [True: 0, False: 5.42M]
  |  |  ------------------
  |  | 2290|      0|	ctxt->input->line++; ctxt->input->col = 1;			\
  |  | 2291|  5.42M|    } else ctxt->input->col++;						\
  |  | 2292|  5.42M|    ctxt->input->cur += l;				\
  |  | 2293|  5.42M|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2293:12): [Folded, False: 5.42M]
  |  |  ------------------
  ------------------
 3108|  5.42M|        c = xmlCurrentChar(ctxt, &l);
 3109|  5.42M|    }
 3110|  61.7k|    if (len > maxLength) {
  ------------------
  |  Branch (3110:9): [True: 58, False: 61.6k]
  ------------------
 3111|     58|        xmlFatalErr(ctxt, XML_ERR_NAME_TOO_LONG, "Name");
 3112|     58|        return(NULL);
 3113|     58|    }
 3114|  61.6k|    if (ctxt->input->cur - ctxt->input->base < len) {
  ------------------
  |  Branch (3114:9): [True: 0, False: 61.6k]
  ------------------
 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|  61.6k|    if ((*ctxt->input->cur == '\n') && (ctxt->input->cur[-1] == '\r'))
  ------------------
  |  Branch (3124:9): [True: 6.72k, False: 54.9k]
  |  Branch (3124:40): [True: 387, False: 6.33k]
  ------------------
 3125|    387|        ret = xmlDictLookup(ctxt->dict, ctxt->input->cur - (len + 1), len);
 3126|  61.2k|    else
 3127|  61.2k|        ret = xmlDictLookup(ctxt->dict, ctxt->input->cur - len, len);
 3128|  61.6k|    if (ret == NULL)
  ------------------
  |  Branch (3128:9): [True: 1, False: 61.6k]
  ------------------
 3129|      1|        xmlErrMemory(ctxt);
 3130|  61.6k|    return(ret);
 3131|  61.6k|}
parser.c:xmlSBufInit:
  682|   514k|xmlSBufInit(xmlSBuf *buf, unsigned max) {
  683|       |    buf->mem = NULL;
  684|   514k|    buf->size = 0;
  685|   514k|    buf->cap = 0;
  686|   514k|    buf->max = max;
  687|   514k|    buf->code = XML_ERR_OK;
  688|   514k|}
parser.c:xmlExpandPEsInEntityValue:
 3461|   254k|                          const xmlChar *str, int length, int depth) {
 3462|   254k|    int maxDepth = (ctxt->options & XML_PARSE_HUGE) ? 40 : 20;
  ------------------
  |  Branch (3462:20): [True: 80.4k, False: 174k]
  ------------------
 3463|   254k|    const xmlChar *end, *chunk;
 3464|   254k|    int c, l;
 3465|       |
 3466|   254k|    if (str == NULL)
  ------------------
  |  Branch (3466:9): [True: 138k, False: 116k]
  ------------------
 3467|   138k|        return;
 3468|       |
 3469|   116k|    depth += 1;
 3470|   116k|    if (depth > maxDepth) {
  ------------------
  |  Branch (3470:9): [True: 0, False: 116k]
  ------------------
 3471|      0|	xmlFatalErrMsg(ctxt, XML_ERR_RESOURCE_LIMIT,
 3472|      0|                       "Maximum entity nesting depth exceeded");
 3473|      0|	return;
 3474|      0|    }
 3475|       |
 3476|   116k|    end = str + length;
 3477|   116k|    chunk = str;
 3478|       |
 3479|  91.1M|    while ((str < end) && (!PARSER_STOPPED(ctxt))) {
  ------------------
  |  |   44|  91.0M|#define PARSER_STOPPED(ctxt) ((ctxt)->disableSAX > 1)
  ------------------
  |  Branch (3479:12): [True: 91.0M, False: 54.7k]
  |  Branch (3479:27): [True: 91.0M, False: 123]
  ------------------
 3480|  91.0M|        c = *str;
 3481|       |
 3482|  91.0M|        if (c >= 0x80) {
  ------------------
  |  Branch (3482:13): [True: 44.2M, False: 46.7M]
  ------------------
 3483|  44.2M|            l = xmlUTF8MultibyteLen(ctxt, str,
 3484|  44.2M|                    "invalid character in entity value\n");
 3485|  44.2M|            if (l == 0) {
  ------------------
  |  Branch (3485:17): [True: 18.0M, False: 26.2M]
  ------------------
 3486|  18.0M|                if (chunk < str)
  ------------------
  |  Branch (3486:21): [True: 95.4k, False: 17.9M]
  ------------------
 3487|  95.4k|                    xmlSBufAddString(buf, chunk, str - chunk);
 3488|  18.0M|                xmlSBufAddReplChar(buf);
 3489|  18.0M|                str += 1;
 3490|  18.0M|                chunk = str;
 3491|  26.2M|            } else {
 3492|  26.2M|                str += l;
 3493|  26.2M|            }
 3494|  46.7M|        } else if (c == '&') {
  ------------------
  |  Branch (3494:20): [True: 94.2k, False: 46.6M]
  ------------------
 3495|  94.2k|            if (str[1] == '#') {
  ------------------
  |  Branch (3495:17): [True: 23.3k, False: 70.8k]
  ------------------
 3496|  23.3k|                if (chunk < str)
  ------------------
  |  Branch (3496:21): [True: 16.7k, False: 6.59k]
  ------------------
 3497|  16.7k|                    xmlSBufAddString(buf, chunk, str - chunk);
 3498|       |
 3499|  23.3k|                c = xmlParseStringCharRef(ctxt, &str);
 3500|  23.3k|                if (c == 0)
  ------------------
  |  Branch (3500:21): [True: 2.06k, False: 21.2k]
  ------------------
 3501|  2.06k|                    return;
 3502|       |
 3503|  21.2k|                xmlSBufAddChar(buf, c);
 3504|       |
 3505|  21.2k|                chunk = str;
 3506|  70.8k|            } else {
 3507|  70.8k|                xmlChar *name;
 3508|       |
 3509|       |                /*
 3510|       |                 * General entity references are checked for
 3511|       |                 * syntactic validity.
 3512|       |                 */
 3513|  70.8k|                str++;
 3514|  70.8k|                name = xmlParseStringName(ctxt, &str);
 3515|       |
 3516|  70.8k|                if ((name == NULL) || (*str++ != ';')) {
  ------------------
  |  Branch (3516:21): [True: 2.74k, False: 68.1k]
  |  Branch (3516:39): [True: 7.72k, False: 60.4k]
  ------------------
 3517|  10.4k|                    xmlFatalErrMsg(ctxt, XML_ERR_ENTITY_CHAR_ERROR,
 3518|  10.4k|                            "EntityValue: '&' forbidden except for entities "
 3519|  10.4k|                            "references\n");
 3520|  10.4k|                    xmlFree(name);
 3521|  10.4k|                    return;
 3522|  10.4k|                }
 3523|       |
 3524|  60.4k|                xmlFree(name);
 3525|  60.4k|            }
 3526|  46.6M|        } else if (c == '%') {
  ------------------
  |  Branch (3526:20): [True: 194k, False: 46.4M]
  ------------------
 3527|   194k|            xmlEntityPtr ent;
 3528|       |
 3529|   194k|            if (chunk < str)
  ------------------
  |  Branch (3529:17): [True: 87.8k, False: 106k]
  ------------------
 3530|  87.8k|                xmlSBufAddString(buf, chunk, str - chunk);
 3531|       |
 3532|   194k|            ent = xmlParseStringPEReference(ctxt, &str);
 3533|   194k|            if (ent == NULL)
  ------------------
  |  Branch (3533:17): [True: 48.7k, False: 146k]
  ------------------
 3534|  48.7k|                return;
 3535|       |
 3536|   146k|            if (!PARSER_EXTERNAL(ctxt)) {
  ------------------
  |  |   55|   146k|    (((ctxt)->inSubset == 2) || \
  |  |  ------------------
  |  |  |  Branch (55:6): [True: 6.49k, False: 139k]
  |  |  ------------------
  |  |   56|   146k|     (((ctxt)->input->entity != NULL) && \
  |  |  ------------------
  |  |  |  Branch (56:7): [True: 139k, False: 34]
  |  |  ------------------
  |  |   57|   139k|      ((ctxt)->input->entity->etype == XML_EXTERNAL_PARAMETER_ENTITY)))
  |  |  ------------------
  |  |  |  Branch (57:7): [True: 139k, False: 0]
  |  |  ------------------
  ------------------
 3537|     34|                xmlFatalErr(ctxt, XML_ERR_ENTITY_PE_INTERNAL, NULL);
 3538|     34|                return;
 3539|     34|            }
 3540|       |
 3541|   146k|            if (ent->content == NULL) {
  ------------------
  |  Branch (3541:17): [True: 138k, False: 7.40k]
  ------------------
 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|   138k|                if (((ctxt->options & XML_PARSE_NO_XXE) == 0) &&
  ------------------
  |  Branch (3548:21): [True: 138k, False: 0]
  ------------------
 3549|   138k|                    ((ctxt->replaceEntities) ||
  ------------------
  |  Branch (3549:22): [True: 128k, False: 10.4k]
  ------------------
 3550|   138k|                     (ctxt->validate))) {
  ------------------
  |  Branch (3550:22): [True: 10.0k, False: 396]
  ------------------
 3551|   138k|                    xmlLoadEntityContent(ctxt, ent);
 3552|   138k|                } else {
 3553|    396|                    xmlWarningMsg(ctxt, XML_ERR_ENTITY_PROCESSING,
 3554|    396|                                  "not validating will not read content for "
 3555|    396|                                  "PE entity %s\n", ent->name, NULL);
 3556|    396|                }
 3557|   138k|            }
 3558|       |
 3559|       |            /*
 3560|       |             * TODO: Skip if ent->content is still NULL.
 3561|       |             */
 3562|       |
 3563|   146k|            if (xmlParserEntityCheck(ctxt, ent->length))
  ------------------
  |  Branch (3563:17): [True: 20, False: 145k]
  ------------------
 3564|     20|                return;
 3565|       |
 3566|   145k|            if (ent->flags & XML_ENT_EXPANDING) {
  ------------------
  |  |   22|   145k|#define XML_ENT_EXPANDING   (1u << 3)
  ------------------
  |  Branch (3566:17): [True: 74, False: 145k]
  ------------------
 3567|     74|                xmlFatalErr(ctxt, XML_ERR_ENTITY_LOOP, NULL);
 3568|     74|                return;
 3569|     74|            }
 3570|       |
 3571|   145k|            ent->flags |= XML_ENT_EXPANDING;
  ------------------
  |  |   22|   145k|#define XML_ENT_EXPANDING   (1u << 3)
  ------------------
 3572|   145k|            xmlExpandPEsInEntityValue(ctxt, buf, ent->content, ent->length,
 3573|   145k|                                      depth);
 3574|   145k|            ent->flags &= ~XML_ENT_EXPANDING;
  ------------------
  |  |   22|   145k|#define XML_ENT_EXPANDING   (1u << 3)
  ------------------
 3575|       |
 3576|   145k|            chunk = str;
 3577|  46.4M|        } else {
 3578|       |            /* Normal ASCII char */
 3579|  46.4M|            if (!IS_BYTE_CHAR(c)) {
  ------------------
  |  |  103|  46.4M|#define IS_BYTE_CHAR(c)	 xmlIsChar_ch(c)
  |  |  ------------------
  |  |  |  |  108|  46.4M|#define xmlIsChar_ch(c)		(((0x9 <= (c)) && ((c) <= 0xa)) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (108:28): [True: 45.5M, False: 883k]
  |  |  |  |  |  Branch (108:44): [True: 5.64M, False: 39.9M]
  |  |  |  |  ------------------
  |  |  |  |  109|  46.4M|				 ((c) == 0xd) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (109:6): [True: 32.2k, False: 40.8M]
  |  |  |  |  ------------------
  |  |  |  |  110|  46.4M|				  (0x20 <= (c)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (110:7): [True: 39.7M, False: 1.02M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3580|  1.02M|                xmlFatalErrMsg(ctxt, XML_ERR_INVALID_CHAR,
 3581|  1.02M|                        "invalid character in entity value\n");
 3582|  1.02M|                if (chunk < str)
  ------------------
  |  Branch (3582:21): [True: 10.6k, False: 1.01M]
  ------------------
 3583|  10.6k|                    xmlSBufAddString(buf, chunk, str - chunk);
 3584|  1.02M|                xmlSBufAddReplChar(buf);
 3585|  1.02M|                str += 1;
 3586|  1.02M|                chunk = str;
 3587|  45.4M|            } else {
 3588|  45.4M|                str += 1;
 3589|  45.4M|            }
 3590|  46.4M|        }
 3591|  91.0M|    }
 3592|       |
 3593|  54.9k|    if (chunk < str)
  ------------------
  |  Branch (3593:9): [True: 49.8k, False: 5.07k]
  ------------------
 3594|  49.8k|        xmlSBufAddString(buf, chunk, str - chunk);
 3595|  54.9k|}
parser.c:xmlUTF8MultibyteLen:
  817|  96.7M|                    const char *errMsg) {
  818|  96.7M|    int c = str[0];
  819|  96.7M|    int c1 = str[1];
  820|       |
  821|  96.7M|    if ((c1 & 0xC0) != 0x80)
  ------------------
  |  Branch (821:9): [True: 44.2M, False: 52.4M]
  ------------------
  822|  44.2M|        goto encoding_error;
  823|       |
  824|  52.4M|    if (c < 0xE0) {
  ------------------
  |  Branch (824:9): [True: 21.6M, False: 30.8M]
  ------------------
  825|       |        /* 2-byte sequence */
  826|  21.6M|        if (c < 0xC2)
  ------------------
  |  Branch (826:13): [True: 20.4M, False: 1.16M]
  ------------------
  827|  20.4M|            goto encoding_error;
  828|       |
  829|  1.16M|        return(2);
  830|  30.8M|    } else {
  831|  30.8M|        int c2 = str[2];
  832|       |
  833|  30.8M|        if ((c2 & 0xC0) != 0x80)
  ------------------
  |  Branch (833:13): [True: 9.26k, False: 30.8M]
  ------------------
  834|  9.26k|            goto encoding_error;
  835|       |
  836|  30.8M|        if (c < 0xF0) {
  ------------------
  |  Branch (836:13): [True: 30.7M, False: 36.3k]
  ------------------
  837|       |            /* 3-byte sequence */
  838|  30.7M|            if (c == 0xE0) {
  ------------------
  |  Branch (838:17): [True: 4.58M, False: 26.2M]
  ------------------
  839|       |                /* overlong */
  840|  4.58M|                if (c1 < 0xA0)
  ------------------
  |  Branch (840:21): [True: 1.10k, False: 4.58M]
  ------------------
  841|  1.10k|                    goto encoding_error;
  842|  26.2M|            } else if (c == 0xED) {
  ------------------
  |  Branch (842:24): [True: 612, False: 26.2M]
  ------------------
  843|       |                /* surrogate */
  844|    612|                if (c1 >= 0xA0)
  ------------------
  |  Branch (844:21): [True: 216, False: 396]
  ------------------
  845|    216|                    goto encoding_error;
  846|  26.2M|            } else if (c == 0xEF) {
  ------------------
  |  Branch (846:24): [True: 21.7M, False: 4.50M]
  ------------------
  847|       |                /* U+FFFE and U+FFFF are invalid Chars */
  848|  21.7M|                if ((c1 == 0xBF) && (c2 >= 0xBE))
  ------------------
  |  Branch (848:21): [True: 21.7M, False: 2.02k]
  |  Branch (848:37): [True: 212, False: 21.7M]
  ------------------
  849|    212|                    xmlFatalErrMsg(ctxt, XML_ERR_INVALID_CHAR, errMsg);
  850|  21.7M|            }
  851|       |
  852|  30.7M|            return(3);
  853|  30.7M|        } else {
  854|       |            /* 4-byte sequence */
  855|  36.3k|            if ((str[3] & 0xC0) != 0x80)
  ------------------
  |  Branch (855:17): [True: 2.50k, False: 33.8k]
  ------------------
  856|  2.50k|                goto encoding_error;
  857|  33.8k|            if (c == 0xF0) {
  ------------------
  |  Branch (857:17): [True: 1.44k, False: 32.4k]
  ------------------
  858|       |                /* overlong */
  859|  1.44k|                if (c1 < 0x90)
  ------------------
  |  Branch (859:21): [True: 833, False: 611]
  ------------------
  860|    833|                    goto encoding_error;
  861|  32.4k|            } else if (c >= 0xF4) {
  ------------------
  |  Branch (861:24): [True: 4.15k, False: 28.2k]
  ------------------
  862|       |                /* greater than 0x10FFFF */
  863|  4.15k|                if ((c > 0xF4) || (c1 >= 0x90))
  ------------------
  |  Branch (863:21): [True: 3.67k, False: 483]
  |  Branch (863:35): [True: 238, False: 245]
  ------------------
  864|  3.91k|                    goto encoding_error;
  865|  4.15k|            }
  866|       |
  867|  29.1k|            return(4);
  868|  33.8k|        }
  869|  30.8M|    }
  870|       |
  871|  64.7M|encoding_error:
  872|       |    /* Only report the first error */
  873|  64.7M|    if ((ctxt->input->flags & XML_INPUT_ENCODING_ERROR) == 0) {
  ------------------
  |  |   40|  64.7M|#define XML_INPUT_ENCODING_ERROR    (1u << 5)
  ------------------
  |  Branch (873:9): [True: 19.6k, False: 64.7M]
  ------------------
  874|  19.6k|        xmlCtxtErrIO(ctxt, XML_ERR_INVALID_ENCODING, NULL);
  875|  19.6k|        ctxt->input->flags |= XML_INPUT_ENCODING_ERROR;
  ------------------
  |  |   40|  19.6k|#define XML_INPUT_ENCODING_ERROR    (1u << 5)
  ------------------
  876|  19.6k|    }
  877|       |
  878|  64.7M|    return(0);
  879|  52.4M|}
parser.c:xmlSBufAddString:
  718|   119M|xmlSBufAddString(xmlSBuf *buf, const xmlChar *str, unsigned len) {
  719|   119M|    if (buf->max - buf->size < len) {
  ------------------
  |  Branch (719:9): [True: 0, False: 119M]
  ------------------
  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|   119M|    if (buf->cap - buf->size <= len) {
  ------------------
  |  Branch (725:9): [True: 436k, False: 118M]
  ------------------
  726|   436k|        if (xmlSBufGrow(buf, len) < 0)
  ------------------
  |  Branch (726:13): [True: 80, False: 436k]
  ------------------
  727|     80|            return;
  728|   436k|    }
  729|       |
  730|   119M|    if (len > 0)
  ------------------
  |  Branch (730:9): [True: 119M, False: 0]
  ------------------
  731|   119M|        memcpy(buf->mem + buf->size, str, len);
  732|   119M|    buf->size += len;
  733|   119M|}
parser.c:xmlSBufGrow:
  691|   443k|xmlSBufGrow(xmlSBuf *buf, unsigned len) {
  692|   443k|    xmlChar *mem;
  693|   443k|    unsigned cap;
  694|       |
  695|   443k|    if (len >= UINT_MAX / 2 - buf->size) {
  ------------------
  |  Branch (695:9): [True: 0, False: 443k]
  ------------------
  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|   443k|    cap = (buf->size + len) * 2;
  702|   443k|    if (cap < 240)
  ------------------
  |  Branch (702:9): [True: 326k, False: 116k]
  ------------------
  703|   326k|        cap = 240;
  704|       |
  705|   443k|    mem = xmlRealloc(buf->mem, cap);
  706|   443k|    if (mem == NULL) {
  ------------------
  |  Branch (706:9): [True: 87, False: 443k]
  ------------------
  707|     87|        buf->code = XML_ERR_NO_MEMORY;
  708|     87|        return(-1);
  709|     87|    }
  710|       |
  711|   443k|    buf->mem = mem;
  712|   443k|    buf->cap = cap;
  713|       |
  714|   443k|    return(0);
  715|   443k|}
parser.c:xmlSBufAddReplChar:
  766|   101M|xmlSBufAddReplChar(xmlSBuf *buf) {
  767|   101M|    xmlSBufAddCString(buf, "\xEF\xBF\xBD", 3);
  768|   101M|}
parser.c:xmlSBufAddCString:
  736|   111M|xmlSBufAddCString(xmlSBuf *buf, const char *str, unsigned len) {
  737|   111M|    xmlSBufAddString(buf, (const xmlChar *) str, len);
  738|   111M|}
parser.c:xmlParseStringCharRef:
 2634|  1.15M|xmlParseStringCharRef(xmlParserCtxtPtr ctxt, const xmlChar **str) {
 2635|  1.15M|    const xmlChar *ptr;
 2636|  1.15M|    xmlChar cur;
 2637|  1.15M|    int val = 0;
 2638|       |
 2639|  1.15M|    if ((str == NULL) || (*str == NULL)) return(0);
  ------------------
  |  Branch (2639:9): [True: 0, False: 1.15M]
  |  Branch (2639:26): [True: 0, False: 1.15M]
  ------------------
 2640|  1.15M|    ptr = *str;
 2641|  1.15M|    cur = *ptr;
 2642|  1.15M|    if ((cur == '&') && (ptr[1] == '#') && (ptr[2] == 'x')) {
  ------------------
  |  Branch (2642:9): [True: 1.15M, False: 0]
  |  Branch (2642:25): [True: 1.15M, False: 0]
  |  Branch (2642:44): [True: 15.6k, False: 1.14M]
  ------------------
 2643|  15.6k|	ptr += 3;
 2644|  15.6k|	cur = *ptr;
 2645|  61.4k|	while (cur != ';') { /* Non input consuming loop */
  ------------------
  |  Branch (2645:9): [True: 46.6k, False: 14.7k]
  ------------------
 2646|  46.6k|	    if ((cur >= '0') && (cur <= '9'))
  ------------------
  |  Branch (2646:10): [True: 46.2k, False: 390]
  |  Branch (2646:26): [True: 31.7k, False: 14.4k]
  ------------------
 2647|  31.7k|	        val = val * 16 + (cur - '0');
 2648|  14.8k|	    else if ((cur >= 'a') && (cur <= 'f'))
  ------------------
  |  Branch (2648:15): [True: 4.87k, False: 9.98k]
  |  Branch (2648:31): [True: 4.66k, False: 207]
  ------------------
 2649|  4.66k|	        val = val * 16 + (cur - 'a') + 10;
 2650|  10.1k|	    else if ((cur >= 'A') && (cur <= 'F'))
  ------------------
  |  Branch (2650:15): [True: 9.76k, False: 427]
  |  Branch (2650:31): [True: 9.38k, False: 386]
  ------------------
 2651|  9.38k|	        val = val * 16 + (cur - 'A') + 10;
 2652|    813|	    else {
 2653|    813|		xmlFatalErr(ctxt, XML_ERR_INVALID_HEX_CHARREF, NULL);
 2654|    813|		val = 0;
 2655|    813|		break;
 2656|    813|	    }
 2657|  45.8k|	    if (val > 0x110000)
  ------------------
  |  Branch (2657:10): [True: 9.86k, False: 35.9k]
  ------------------
 2658|  9.86k|	        val = 0x110000;
 2659|       |
 2660|  45.8k|	    ptr++;
 2661|  45.8k|	    cur = *ptr;
 2662|  45.8k|	}
 2663|  15.6k|	if (cur == ';')
  ------------------
  |  Branch (2663:6): [True: 14.7k, False: 813]
  ------------------
 2664|  14.7k|	    ptr++;
 2665|  1.14M|    } else if  ((cur == '&') && (ptr[1] == '#')){
  ------------------
  |  Branch (2665:17): [True: 1.14M, False: 0]
  |  Branch (2665:33): [True: 1.14M, False: 0]
  ------------------
 2666|  1.14M|	ptr += 2;
 2667|  1.14M|	cur = *ptr;
 2668|  3.42M|	while (cur != ';') { /* Non input consuming loops */
  ------------------
  |  Branch (2668:9): [True: 2.28M, False: 1.13M]
  ------------------
 2669|  2.28M|	    if ((cur >= '0') && (cur <= '9'))
  ------------------
  |  Branch (2669:10): [True: 2.28M, False: 236]
  |  Branch (2669:26): [True: 2.28M, False: 316]
  ------------------
 2670|  2.28M|	        val = val * 10 + (cur - '0');
 2671|    552|	    else {
 2672|    552|		xmlFatalErr(ctxt, XML_ERR_INVALID_DEC_CHARREF, NULL);
 2673|    552|		val = 0;
 2674|    552|		break;
 2675|    552|	    }
 2676|  2.28M|	    if (val > 0x110000)
  ------------------
  |  Branch (2676:10): [True: 1.86k, False: 2.28M]
  ------------------
 2677|  1.86k|	        val = 0x110000;
 2678|       |
 2679|  2.28M|	    ptr++;
 2680|  2.28M|	    cur = *ptr;
 2681|  2.28M|	}
 2682|  1.14M|	if (cur == ';')
  ------------------
  |  Branch (2682:6): [True: 1.13M, False: 552]
  ------------------
 2683|  1.13M|	    ptr++;
 2684|  1.14M|    } else {
 2685|      0|	xmlFatalErr(ctxt, XML_ERR_INVALID_CHARREF, NULL);
 2686|      0|	return(0);
 2687|      0|    }
 2688|  1.15M|    *str = ptr;
 2689|       |
 2690|       |    /*
 2691|       |     * [ WFC: Legal Character ]
 2692|       |     * Characters referred to using character references must match the
 2693|       |     * production for Char.
 2694|       |     */
 2695|  1.15M|    if (val >= 0x110000) {
  ------------------
  |  Branch (2695:9): [True: 216, False: 1.15M]
  ------------------
 2696|    216|        xmlFatalErrMsgInt(ctxt, XML_ERR_INVALID_CHAR,
 2697|    216|                "xmlParseStringCharRef: character reference out of bounds\n",
 2698|    216|                val);
 2699|  1.15M|    } else if (IS_CHAR(val)) {
  ------------------
  |  |  115|  1.15M|#define IS_CHAR(c)   xmlIsCharQ(c)
  |  |  ------------------
  |  |  |  |  117|  1.15M|#define xmlIsCharQ(c)		(((c) < 0x100) ? \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (117:24): [True: 1.15M, False: 1.85k]
  |  |  |  |  |  Branch (117:25): [True: 1.14M, False: 7.13k]
  |  |  |  |  ------------------
  |  |  |  |  118|  1.15M|				 xmlIsChar_ch((c)) :\
  |  |  |  |  ------------------
  |  |  |  |  |  |  108|  1.14M|#define xmlIsChar_ch(c)		(((0x9 <= (c)) && ((c) <= 0xa)) || \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (108:28): [True: 1.14M, False: 1.70k]
  |  |  |  |  |  |  |  Branch (108:44): [True: 1.59k, False: 1.14M]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  109|  1.14M|				 ((c) == 0xd) || \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (109:6): [True: 988, False: 1.14M]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  110|  1.14M|				  (0x20 <= (c)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (110:7): [True: 1.14M, False: 1.72k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  119|  1.15M|				(((0x100 <= (c)) && ((c) <= 0xd7ff)) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (119:7): [True: 7.13k, False: 0]
  |  |  |  |  |  Branch (119:25): [True: 6.10k, False: 1.03k]
  |  |  |  |  ------------------
  |  |  |  |  120|  7.13k|				 ((0xe000 <= (c)) && ((c) <= 0xfffd)) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (120:7): [True: 920, False: 113]
  |  |  |  |  |  Branch (120:26): [True: 233, False: 687]
  |  |  |  |  ------------------
  |  |  |  |  121|  7.13k|				 ((0x10000 <= (c)) && ((c) <= 0x10ffff))))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (121:7): [True: 678, False: 122]
  |  |  |  |  |  Branch (121:27): [True: 678, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2700|  1.15M|        return(val);
 2701|  1.15M|    } else {
 2702|  1.85k|        xmlFatalErrMsgInt(ctxt, XML_ERR_INVALID_CHAR,
 2703|  1.85k|			  "xmlParseStringCharRef: invalid xmlChar value %d\n",
 2704|  1.85k|			  val);
 2705|  1.85k|    }
 2706|  2.06k|    return(0);
 2707|  1.15M|}
parser.c:xmlSBufAddChar:
  741|  1.18M|xmlSBufAddChar(xmlSBuf *buf, int c) {
  742|  1.18M|    xmlChar *end;
  743|       |
  744|  1.18M|    if (buf->max - buf->size < 4) {
  ------------------
  |  Branch (744:9): [True: 0, False: 1.18M]
  ------------------
  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|  1.18M|    if (buf->cap - buf->size <= 4) {
  ------------------
  |  Branch (750:9): [True: 7.07k, False: 1.18M]
  ------------------
  751|  7.07k|        if (xmlSBufGrow(buf, 4) < 0)
  ------------------
  |  Branch (751:13): [True: 7, False: 7.06k]
  ------------------
  752|      7|            return;
  753|  7.07k|    }
  754|       |
  755|  1.18M|    end = buf->mem + buf->size;
  756|       |
  757|  1.18M|    if (c < 0x80) {
  ------------------
  |  Branch (757:9): [True: 1.18M, False: 4.99k]
  ------------------
  758|  1.18M|        *end = (xmlChar) c;
  759|  1.18M|        buf->size += 1;
  760|  1.18M|    } else {
  761|  4.99k|        buf->size += xmlCopyCharMultiByte(end, c);
  762|  4.99k|    }
  763|  1.18M|}
parser.c:xmlParseStringName:
 3340|  2.89M|xmlParseStringName(xmlParserCtxtPtr ctxt, const xmlChar** str) {
 3341|  2.89M|    xmlChar *ret;
 3342|  2.89M|    const xmlChar *cur = *str;
 3343|  2.89M|    int flags = 0;
 3344|  2.89M|    int maxLength = (ctxt->options & XML_PARSE_HUGE) ?
  ------------------
  |  Branch (3344:21): [True: 1.17M, False: 1.72M]
  ------------------
 3345|  1.17M|                    XML_MAX_TEXT_LENGTH :
  ------------------
  |  |   50|  1.17M|#define XML_MAX_TEXT_LENGTH 10000000
  ------------------
 3346|  2.89M|                    XML_MAX_NAME_LENGTH;
  ------------------
  |  |   65|  1.72M|#define XML_MAX_NAME_LENGTH 50000
  ------------------
 3347|       |
 3348|  2.89M|    if (ctxt->options & XML_PARSE_OLD10)
  ------------------
  |  Branch (3348:9): [True: 1.05M, False: 1.84M]
  ------------------
 3349|  1.05M|        flags |= XML_SCAN_OLD10;
  ------------------
  |  |   71|  1.05M|#define XML_SCAN_OLD10      4
  ------------------
 3350|       |
 3351|  2.89M|    cur = xmlScanName(*str, maxLength, flags);
 3352|  2.89M|    if (cur == NULL) {
  ------------------
  |  Branch (3352:9): [True: 56, False: 2.89M]
  ------------------
 3353|     56|        xmlFatalErr(ctxt, XML_ERR_NAME_TOO_LONG, "NCName");
 3354|     56|        return(NULL);
 3355|     56|    }
 3356|  2.89M|    if (cur == *str)
  ------------------
  |  Branch (3356:9): [True: 4.69k, False: 2.89M]
  ------------------
 3357|  4.69k|        return(NULL);
 3358|       |
 3359|  2.89M|    ret = xmlStrndup(*str, cur - *str);
 3360|  2.89M|    if (ret == NULL)
  ------------------
  |  Branch (3360:9): [True: 27, False: 2.89M]
  ------------------
 3361|     27|        xmlErrMemory(ctxt);
 3362|  2.89M|    *str = cur;
 3363|  2.89M|    return(ret);
 3364|  2.89M|}
parser.c:xmlParseStringPEReference:
 7861|   194k|xmlParseStringPEReference(xmlParserCtxtPtr ctxt, const xmlChar **str) {
 7862|   194k|    const xmlChar *ptr;
 7863|   194k|    xmlChar cur;
 7864|   194k|    xmlChar *name;
 7865|   194k|    xmlEntityPtr entity = NULL;
 7866|       |
 7867|   194k|    if ((str == NULL) || (*str == NULL)) return(NULL);
  ------------------
  |  Branch (7867:9): [True: 0, False: 194k]
  |  Branch (7867:26): [True: 0, False: 194k]
  ------------------
 7868|   194k|    ptr = *str;
 7869|   194k|    cur = *ptr;
 7870|   194k|    if (cur != '%')
  ------------------
  |  Branch (7870:9): [True: 0, False: 194k]
  ------------------
 7871|      0|        return(NULL);
 7872|   194k|    ptr++;
 7873|   194k|    name = xmlParseStringName(ctxt, &ptr);
 7874|   194k|    if (name == NULL) {
  ------------------
  |  Branch (7874:9): [True: 2.00k, False: 192k]
  ------------------
 7875|  2.00k|	xmlFatalErrMsg(ctxt, XML_ERR_NAME_REQUIRED,
 7876|  2.00k|		       "xmlParseStringPEReference: no name\n");
 7877|  2.00k|	*str = ptr;
 7878|  2.00k|	return(NULL);
 7879|  2.00k|    }
 7880|   192k|    cur = *ptr;
 7881|   192k|    if (cur != ';') {
  ------------------
  |  Branch (7881:9): [True: 5.69k, False: 187k]
  ------------------
 7882|  5.69k|	xmlFatalErr(ctxt, XML_ERR_ENTITYREF_SEMICOL_MISSING, NULL);
 7883|  5.69k|	xmlFree(name);
 7884|  5.69k|	*str = ptr;
 7885|  5.69k|	return(NULL);
 7886|  5.69k|    }
 7887|   187k|    ptr++;
 7888|       |
 7889|       |    /* Must be set before xmlHandleUndeclaredEntity */
 7890|   187k|    ctxt->hasPErefs = 1;
 7891|       |
 7892|       |    /*
 7893|       |     * Request the entity from SAX
 7894|       |     */
 7895|   187k|    if ((ctxt->sax != NULL) &&
  ------------------
  |  Branch (7895:9): [True: 187k, False: 0]
  ------------------
 7896|   187k|	(ctxt->sax->getParameterEntity != NULL))
  ------------------
  |  Branch (7896:2): [True: 187k, False: 0]
  ------------------
 7897|   187k|	entity = ctxt->sax->getParameterEntity(ctxt->userData, name);
 7898|       |
 7899|   187k|    if (entity == NULL) {
  ------------------
  |  Branch (7899:9): [True: 41.0k, False: 146k]
  ------------------
 7900|  41.0k|        xmlHandleUndeclaredEntity(ctxt, name);
 7901|   146k|    } else {
 7902|       |	/*
 7903|       |	 * Internal checking in case the entity quest barfed
 7904|       |	 */
 7905|   146k|	if ((entity->etype != XML_INTERNAL_PARAMETER_ENTITY) &&
  ------------------
  |  Branch (7905:6): [True: 139k, False: 6.72k]
  ------------------
 7906|   139k|	    (entity->etype != XML_EXTERNAL_PARAMETER_ENTITY)) {
  ------------------
  |  Branch (7906:6): [True: 0, False: 139k]
  ------------------
 7907|      0|	    xmlWarningMsg(ctxt, XML_WAR_UNDECLARED_ENTITY,
 7908|      0|			  "%%%s; is not a parameter entity\n",
 7909|      0|			  name, NULL);
 7910|      0|	}
 7911|   146k|    }
 7912|       |
 7913|   187k|    xmlFree(name);
 7914|   187k|    *str = ptr;
 7915|   187k|    return(entity);
 7916|   192k|}
parser.c:xmlHandleUndeclaredEntity:
 7334|   394k|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|   394k|    if ((ctxt->standalone == 1) ||
  ------------------
  |  Branch (7356:9): [True: 488, False: 394k]
  ------------------
 7357|   394k|        ((ctxt->hasExternalSubset == 0) &&
  ------------------
  |  Branch (7357:10): [True: 388k, False: 5.26k]
  ------------------
 7358|   388k|         (ctxt->hasPErefs == 0))) {
  ------------------
  |  Branch (7358:10): [True: 140k, False: 248k]
  ------------------
 7359|   140k|        xmlFatalErrMsgStr(ctxt, XML_ERR_UNDECLARED_ENTITY,
 7360|   140k|                          "Entity '%s' not defined\n", name);
 7361|   140k|#ifdef LIBXML_VALID_ENABLED
 7362|   253k|    } else if (ctxt->validate) {
  ------------------
  |  Branch (7362:16): [True: 211k, False: 42.6k]
  ------------------
 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|   211k|        xmlValidityError(ctxt, XML_ERR_UNDECLARED_ENTITY,
 7371|   211k|                         "Entity '%s' not defined\n", name, NULL);
 7372|   211k|#endif
 7373|   211k|    } else if ((ctxt->loadsubset & ~XML_SKIP_IDS) ||
  ------------------
  |  |  210|  42.6k|#define XML_SKIP_IDS		8
  ------------------
  |  Branch (7373:16): [True: 33.8k, False: 8.72k]
  ------------------
 7374|  8.72k|               ((ctxt->replaceEntities) &&
  ------------------
  |  Branch (7374:17): [True: 7.74k, False: 982]
  ------------------
 7375|  40.9k|                ((ctxt->options & XML_PARSE_NO_XXE) == 0))) {
  ------------------
  |  Branch (7375:17): [True: 7.05k, False: 689]
  ------------------
 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|  40.9k|        xmlErrMsgStr(ctxt, XML_WAR_UNDECLARED_ENTITY,
 7385|  40.9k|                     "Entity '%s' not defined\n", name);
 7386|  40.9k|    } else {
 7387|  1.67k|        xmlWarningMsg(ctxt, XML_WAR_UNDECLARED_ENTITY,
 7388|  1.67k|                      "Entity '%s' not defined\n", name, NULL);
 7389|  1.67k|    }
 7390|       |
 7391|   394k|    ctxt->valid = 0;
 7392|   394k|}
parser.c:xmlErrMsgStr:
  364|  40.9k|{
  365|  40.9k|    xmlCtxtErr(ctxt, NULL, XML_FROM_PARSER, error, XML_ERR_ERROR,
  366|  40.9k|               val, NULL, NULL, 0, msg, val);
  367|  40.9k|}
parser.c:xmlLoadEntityContent:
 7698|   138k|xmlLoadEntityContent(xmlParserCtxtPtr ctxt, xmlEntityPtr entity) {
 7699|   138k|    xmlParserInputPtr oldinput, input = NULL;
 7700|   138k|    xmlParserInputPtr *oldinputTab;
 7701|   138k|    xmlChar *oldencoding;
 7702|   138k|    xmlChar *content = NULL;
 7703|   138k|    xmlResourceType rtype;
 7704|   138k|    size_t length, i;
 7705|   138k|    int oldinputNr, oldinputMax;
 7706|   138k|    int ret = -1;
 7707|   138k|    int res;
 7708|       |
 7709|   138k|    if ((ctxt == NULL) || (entity == NULL) ||
  ------------------
  |  Branch (7709:9): [True: 0, False: 138k]
  |  Branch (7709:27): [True: 0, False: 138k]
  ------------------
 7710|   138k|        ((entity->etype != XML_EXTERNAL_PARAMETER_ENTITY) &&
  ------------------
  |  Branch (7710:10): [True: 0, False: 138k]
  ------------------
 7711|      0|	 (entity->etype != XML_EXTERNAL_GENERAL_PARSED_ENTITY)) ||
  ------------------
  |  Branch (7711:3): [True: 0, False: 0]
  ------------------
 7712|   138k|	(entity->content != NULL)) {
  ------------------
  |  Branch (7712:2): [True: 0, False: 138k]
  ------------------
 7713|      0|	xmlFatalErr(ctxt, XML_ERR_ARGUMENT,
 7714|      0|	            "xmlLoadEntityContent parameter error");
 7715|      0|        return(-1);
 7716|      0|    }
 7717|       |
 7718|   138k|    if (entity->etype == XML_EXTERNAL_PARAMETER_ENTITY)
  ------------------
  |  Branch (7718:9): [True: 138k, False: 0]
  ------------------
 7719|   138k|        rtype = XML_RESOURCE_PARAMETER_ENTITY;
 7720|      0|    else
 7721|      0|        rtype = XML_RESOURCE_GENERAL_ENTITY;
 7722|       |
 7723|   138k|    input = xmlLoadResource(ctxt, (char *) entity->URI,
 7724|   138k|                            (char *) entity->ExternalID, rtype);
 7725|   138k|    if (input == NULL)
  ------------------
  |  Branch (7725:9): [True: 684, False: 137k]
  ------------------
 7726|    684|        return(-1);
 7727|       |
 7728|   137k|    oldinput = ctxt->input;
 7729|   137k|    oldinputNr = ctxt->inputNr;
 7730|   137k|    oldinputMax = ctxt->inputMax;
 7731|   137k|    oldinputTab = ctxt->inputTab;
 7732|   137k|    oldencoding = ctxt->encoding;
 7733|       |
 7734|   137k|    ctxt->input = NULL;
 7735|   137k|    ctxt->inputNr = 0;
 7736|   137k|    ctxt->inputMax = 1;
 7737|   137k|    ctxt->encoding = NULL;
 7738|   137k|    ctxt->inputTab = xmlMalloc(sizeof(xmlParserInputPtr));
 7739|   137k|    if (ctxt->inputTab == NULL) {
  ------------------
  |  Branch (7739:9): [True: 3, False: 137k]
  ------------------
 7740|      3|        xmlErrMemory(ctxt);
 7741|      3|        xmlFreeInputStream(input);
 7742|      3|        goto error;
 7743|      3|    }
 7744|       |
 7745|   137k|    xmlBufResetInput(input->buf->buffer, input);
 7746|       |
 7747|   137k|    if (xmlCtxtPushInput(ctxt, input) < 0) {
  ------------------
  |  Branch (7747:9): [True: 4, False: 137k]
  ------------------
 7748|      4|        xmlFreeInputStream(input);
 7749|      4|        goto error;
 7750|      4|    }
 7751|       |
 7752|   137k|    xmlDetectEncoding(ctxt);
 7753|       |
 7754|       |    /*
 7755|       |     * Parse a possible text declaration first
 7756|       |     */
 7757|   137k|    if ((CMP5(CUR_PTR, '<', '?', 'x', 'm', 'l')) && (IS_BLANK_CH(NXT(5)))) {
  ------------------
  |  | 2234|   137k|  ( CMP4( s, c1, c2, c3, c4 ) && ((unsigned char *) s)[ 4 ] == c5 )
  |  |  ------------------
  |  |  |  | 2231|   275k|  ( ((unsigned char *) s)[ 0 ] == c1 && ((unsigned char *) s)[ 1 ] == c2 && \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2231:5): [True: 132k, False: 4.92k]
  |  |  |  |  |  Branch (2231:41): [True: 130k, False: 1.75k]
  |  |  |  |  ------------------
  |  |  |  | 2232|   137k|    ((unsigned char *) s)[ 2 ] == c3 && ((unsigned char *) s)[ 3 ] == c4 )
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2232:5): [True: 130k, False: 336]
  |  |  |  |  |  Branch (2232:41): [True: 130k, False: 218]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2234:34): [True: 129k, False: 537]
  |  |  ------------------
  ------------------
                  if ((CMP5(CUR_PTR, '<', '?', 'x', 'm', 'l')) && (IS_BLANK_CH(NXT(5)))) {
  ------------------
  |  |  137|   129k|#define IS_BLANK_CH(c)  xmlIsBlank_ch(c)
  |  |  ------------------
  |  |  |  |   90|   129k|#define xmlIsBlank_ch(c)	(((c) == 0x20) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (90:27): [True: 127k, False: 2.32k]
  |  |  |  |  ------------------
  |  |  |  |   91|   129k|				 ((0x9 <= (c)) && ((c) <= 0xa)) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (91:7): [True: 2.11k, False: 211]
  |  |  |  |  |  Branch (91:23): [True: 280, False: 1.83k]
  |  |  |  |  ------------------
  |  |  |  |   92|   129k|				 ((c) == 0xd))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (92:6): [True: 1.65k, False: 391]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 7758|   129k|	xmlParseTextDecl(ctxt);
 7759|       |        /*
 7760|       |         * An XML-1.0 document can't reference an entity not XML-1.0
 7761|       |         */
 7762|   129k|        if ((xmlStrEqual(ctxt->version, BAD_CAST "1.0")) &&
  ------------------
  |  |   34|   129k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (7762:13): [True: 2.15k, False: 127k]
  ------------------
 7763|  2.15k|            (!xmlStrEqual(ctxt->input->version, BAD_CAST "1.0"))) {
  ------------------
  |  |   34|  2.15k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (7763:13): [True: 523, False: 1.63k]
  ------------------
 7764|    523|            xmlFatalErrMsg(ctxt, XML_ERR_VERSION_MISMATCH,
 7765|    523|                           "Version mismatch between document and entity\n");
 7766|    523|        }
 7767|   129k|    }
 7768|       |
 7769|   137k|    length = input->cur - input->base;
 7770|   137k|    xmlBufShrink(input->buf->buffer, length);
 7771|   137k|    xmlSaturatedAdd(&ctxt->sizeentities, length);
 7772|       |
 7773|   157k|    while ((res = xmlParserInputBufferGrow(input->buf, 4096)) > 0)
  ------------------
  |  Branch (7773:12): [True: 19.7k, False: 137k]
  ------------------
 7774|  19.7k|        ;
 7775|       |
 7776|   137k|    xmlBufResetInput(input->buf->buffer, input);
 7777|       |
 7778|   137k|    if (res < 0) {
  ------------------
  |  Branch (7778:9): [True: 1.29k, False: 136k]
  ------------------
 7779|  1.29k|        xmlCtxtErrIO(ctxt, input->buf->error, NULL);
 7780|  1.29k|        goto error;
 7781|  1.29k|    }
 7782|       |
 7783|   136k|    length = xmlBufUse(input->buf->buffer);
 7784|   136k|    if (length > INT_MAX) {
  ------------------
  |  Branch (7784:9): [True: 0, False: 136k]
  ------------------
 7785|      0|        xmlErrMemory(ctxt);
 7786|      0|        goto error;
 7787|      0|    }
 7788|       |
 7789|   136k|    content = xmlStrndup(xmlBufContent(input->buf->buffer), length);
 7790|   136k|    if (content == NULL) {
  ------------------
  |  Branch (7790:9): [True: 6, False: 136k]
  ------------------
 7791|      6|        xmlErrMemory(ctxt);
 7792|      6|        goto error;
 7793|      6|    }
 7794|       |
 7795|  16.0M|    for (i = 0; i < length; ) {
  ------------------
  |  Branch (7795:17): [True: 16.0M, False: 167]
  ------------------
 7796|  16.0M|        int clen = length - i;
 7797|  16.0M|        int c = xmlGetUTF8Char(content + i, &clen);
 7798|       |
 7799|  16.0M|        if ((c < 0) || (!IS_CHAR(c))) {
  ------------------
  |  |  115|  15.9M|#define IS_CHAR(c)   xmlIsCharQ(c)
  |  |  ------------------
  |  |  |  |  117|  15.9M|#define xmlIsCharQ(c)		(((c) < 0x100) ? \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (117:25): [True: 13.7M, False: 2.22M]
  |  |  |  |  ------------------
  |  |  |  |  118|  15.9M|				 xmlIsChar_ch((c)) :\
  |  |  |  |  ------------------
  |  |  |  |  |  |  108|  13.7M|#define xmlIsChar_ch(c)		(((0x9 <= (c)) && ((c) <= 0xa)) || \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (108:28): [True: 13.7M, False: 4.59k]
  |  |  |  |  |  |  |  Branch (108:44): [True: 234k, False: 13.4M]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  109|  13.7M|				 ((c) == 0xd) || \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (109:6): [True: 150k, False: 13.3M]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  110|  13.7M|				  (0x20 <= (c)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (110:7): [True: 13.3M, False: 10.4k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  119|  15.9M|				(((0x100 <= (c)) && ((c) <= 0xd7ff)) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (119:7): [True: 2.22M, False: 0]
  |  |  |  |  |  Branch (119:25): [True: 2.21M, False: 8.19k]
  |  |  |  |  ------------------
  |  |  |  |  120|  2.22M|				 ((0xe000 <= (c)) && ((c) <= 0xfffd)) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (120:7): [True: 8.19k, False: 0]
  |  |  |  |  |  Branch (120:26): [True: 5.47k, False: 2.72k]
  |  |  |  |  ------------------
  |  |  |  |  121|  2.22M|				 ((0x10000 <= (c)) && ((c) <= 0x10ffff))))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (121:7): [True: 1.78k, False: 936]
  |  |  |  |  |  Branch (121:27): [True: 1.78k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (7799:13): [True: 124k, False: 15.9M]
  |  Branch (7799:24): [True: 11.3k, False: 15.9M]
  ------------------
 7800|   136k|            xmlFatalErrMsgInt(ctxt, XML_ERR_INVALID_CHAR,
 7801|   136k|                              "xmlLoadEntityContent: invalid char value %d\n",
 7802|   136k|                              content[i]);
 7803|   136k|            goto error;
 7804|   136k|        }
 7805|  15.9M|        i += clen;
 7806|  15.9M|    }
 7807|       |
 7808|    167|    xmlSaturatedAdd(&ctxt->sizeentities, length);
 7809|    167|    entity->content = content;
 7810|    167|    entity->length = length;
 7811|    167|    content = NULL;
 7812|    167|    ret = 0;
 7813|       |
 7814|   137k|error:
 7815|   275k|    while (ctxt->inputNr > 0)
  ------------------
  |  Branch (7815:12): [True: 137k, False: 137k]
  ------------------
 7816|   137k|        xmlFreeInputStream(xmlCtxtPopInput(ctxt));
 7817|   137k|    xmlFree(ctxt->inputTab);
 7818|   137k|    xmlFree(ctxt->encoding);
 7819|       |
 7820|   137k|    ctxt->input = oldinput;
 7821|   137k|    ctxt->inputNr = oldinputNr;
 7822|   137k|    ctxt->inputMax = oldinputMax;
 7823|   137k|    ctxt->inputTab = oldinputTab;
 7824|   137k|    ctxt->encoding = oldencoding;
 7825|       |
 7826|   137k|    xmlFree(content);
 7827|       |
 7828|   137k|    return(ret);
 7829|    167|}
parser.c:xmlSBufFinish:
  780|   329k|              const char *errMsg) {
  781|   329k|    if (buf->mem == NULL) {
  ------------------
  |  Branch (781:9): [True: 29.0k, False: 300k]
  ------------------
  782|  29.0k|        buf->mem = xmlMalloc(1);
  783|  29.0k|        if (buf->mem == NULL) {
  ------------------
  |  Branch (783:13): [True: 6, False: 29.0k]
  ------------------
  784|      6|            buf->code = XML_ERR_NO_MEMORY;
  785|  29.0k|        } else {
  786|  29.0k|            buf->mem[0] = 0;
  787|  29.0k|        }
  788|   300k|    } else {
  789|   300k|        buf->mem[buf->size] = 0;
  790|   300k|    }
  791|       |
  792|   329k|    if (buf->code == XML_ERR_OK) {
  ------------------
  |  Branch (792:9): [True: 329k, False: 58]
  ------------------
  793|   329k|        if (sizeOut != NULL)
  ------------------
  |  Branch (793:13): [True: 28.1k, False: 300k]
  ------------------
  794|  28.1k|            *sizeOut = buf->size;
  795|   329k|        return(buf->mem);
  796|   329k|    }
  797|       |
  798|     58|    xmlSBufReportError(buf, ctxt, errMsg);
  799|       |
  800|     58|    xmlFree(buf->mem);
  801|       |
  802|     58|    if (sizeOut != NULL)
  ------------------
  |  Branch (802:9): [True: 10, False: 48]
  ------------------
  803|     10|        *sizeOut = 0;
  804|       |    return(NULL);
  805|   329k|}
parser.c:xmlSBufReportError:
  771|     93|xmlSBufReportError(xmlSBuf *buf, xmlParserCtxtPtr ctxt, const char *errMsg) {
  772|     93|    if (buf->code == XML_ERR_NO_MEMORY)
  ------------------
  |  Branch (772:9): [True: 93, False: 0]
  ------------------
  773|     93|        xmlCtxtErrMemory(ctxt);
  774|      0|    else
  775|      0|        xmlFatalErr(ctxt, buf->code, errMsg);
  776|     93|}
parser.c:xmlSBufCleanup:
  808|   175k|xmlSBufCleanup(xmlSBuf *buf, xmlParserCtxtPtr ctxt, const char *errMsg) {
  809|   175k|    if (buf->code != XML_ERR_OK)
  ------------------
  |  Branch (809:9): [True: 35, False: 175k]
  ------------------
  810|     35|        xmlSBufReportError(buf, ctxt, errMsg);
  811|       |
  812|   175k|    xmlFree(buf->mem);
  813|   175k|}
parser.c:xmlExpandEntityInAttValue:
 3802|  1.84M|                          int *inSpace, int depth, int check) {
 3803|  1.84M|    int maxDepth = (ctxt->options & XML_PARSE_HUGE) ? 40 : 20;
  ------------------
  |  Branch (3803:20): [True: 730k, False: 1.11M]
  ------------------
 3804|  1.84M|    int c, chunkSize;
 3805|  1.84M|    int normChange = 0;
 3806|       |
 3807|  1.84M|    if (str == NULL)
  ------------------
  |  Branch (3807:9): [True: 113, False: 1.84M]
  ------------------
 3808|    113|        return(0);
 3809|       |
 3810|  1.84M|    depth += 1;
 3811|  1.84M|    if (depth > maxDepth) {
  ------------------
  |  Branch (3811:9): [True: 1, False: 1.84M]
  ------------------
 3812|      1|	xmlFatalErrMsg(ctxt, XML_ERR_RESOURCE_LIMIT,
 3813|      1|                       "Maximum entity nesting depth exceeded");
 3814|      1|	return(0);
 3815|      1|    }
 3816|       |
 3817|  1.84M|    if (pent != NULL) {
  ------------------
  |  Branch (3817:9): [True: 1.82M, False: 24.5k]
  ------------------
 3818|  1.82M|        if (pent->flags & XML_ENT_EXPANDING) {
  ------------------
  |  |   22|  1.82M|#define XML_ENT_EXPANDING   (1u << 3)
  ------------------
  |  Branch (3818:13): [True: 3, False: 1.82M]
  ------------------
 3819|      3|            xmlFatalErr(ctxt, XML_ERR_ENTITY_LOOP, NULL);
 3820|      3|            return(0);
 3821|      3|        }
 3822|       |
 3823|  1.82M|        if (check) {
  ------------------
  |  Branch (3823:13): [True: 1.81M, False: 2.15k]
  ------------------
 3824|  1.81M|            if (xmlParserEntityCheck(ctxt, pent->length))
  ------------------
  |  Branch (3824:17): [True: 38, False: 1.81M]
  ------------------
 3825|     38|                return(0);
 3826|  1.81M|        }
 3827|  1.82M|    }
 3828|       |
 3829|  1.84M|    chunkSize = 0;
 3830|       |
 3831|       |    /*
 3832|       |     * Note that entity values are already validated. No special
 3833|       |     * handling for multi-byte characters is needed.
 3834|       |     */
 3835|   235M|    while (!PARSER_STOPPED(ctxt)) {
  ------------------
  |  |   44|   235M|#define PARSER_STOPPED(ctxt) ((ctxt)->disableSAX > 1)
  ------------------
  |  Branch (3835:12): [True: 235M, False: 257]
  ------------------
 3836|   235M|        c = *str;
 3837|       |
 3838|   235M|	if (c != '&') {
  ------------------
  |  Branch (3838:6): [True: 231M, False: 3.74M]
  ------------------
 3839|   231M|            if (c == 0)
  ------------------
  |  Branch (3839:17): [True: 1.76M, False: 230M]
  ------------------
 3840|  1.76M|                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|   230M|            if ((pent != NULL) && (c == '<')) {
  ------------------
  |  Branch (3847:17): [True: 227M, False: 2.20M]
  |  Branch (3847:35): [True: 84.3k, False: 227M]
  ------------------
 3848|  84.3k|                xmlFatalErrMsgStr(ctxt, XML_ERR_LT_IN_ATTRIBUTE,
 3849|  84.3k|                        "'<' in entity '%s' is not allowed in attributes "
 3850|  84.3k|                        "values\n", pent->name);
 3851|  84.3k|                break;
 3852|  84.3k|            }
 3853|       |
 3854|   229M|            if (c <= 0x20) {
  ------------------
  |  Branch (3854:17): [True: 14.8M, False: 215M]
  ------------------
 3855|  14.8M|                if ((normalize) && (*inSpace)) {
  ------------------
  |  Branch (3855:21): [True: 54.6k, False: 14.7M]
  |  Branch (3855:36): [True: 21.4k, False: 33.2k]
  ------------------
 3856|       |                    /* Skip char */
 3857|  21.4k|                    if (chunkSize > 0) {
  ------------------
  |  Branch (3857:25): [True: 13.4k, False: 7.96k]
  ------------------
 3858|  13.4k|                        xmlSBufAddString(buf, str - chunkSize, chunkSize);
 3859|  13.4k|                        chunkSize = 0;
 3860|  13.4k|                    }
 3861|  21.4k|                    normChange = 1;
 3862|  14.7M|                } else if (c < 0x20) {
  ------------------
  |  Branch (3862:28): [True: 5.12M, False: 9.66M]
  ------------------
 3863|  5.12M|                    if (chunkSize > 0) {
  ------------------
  |  Branch (3863:25): [True: 1.02M, False: 4.09M]
  ------------------
 3864|  1.02M|                        xmlSBufAddString(buf, str - chunkSize, chunkSize);
 3865|  1.02M|                        chunkSize = 0;
 3866|  1.02M|                    }
 3867|       |
 3868|  5.12M|                    xmlSBufAddCString(buf, " ", 1);
 3869|  9.66M|                } else {
 3870|  9.66M|                    chunkSize += 1;
 3871|  9.66M|                }
 3872|       |
 3873|  14.8M|                *inSpace = 1;
 3874|   215M|            } else {
 3875|   215M|                chunkSize += 1;
 3876|   215M|                *inSpace = 0;
 3877|   215M|            }
 3878|       |
 3879|   229M|            str += 1;
 3880|   229M|        } else if (str[1] == '#') {
  ------------------
  |  Branch (3880:20): [True: 1.12M, False: 2.62M]
  ------------------
 3881|  1.12M|            int val;
 3882|       |
 3883|  1.12M|            if (chunkSize > 0) {
  ------------------
  |  Branch (3883:17): [True: 1.12M, False: 2.33k]
  ------------------
 3884|  1.12M|                xmlSBufAddString(buf, str - chunkSize, chunkSize);
 3885|  1.12M|                chunkSize = 0;
 3886|  1.12M|            }
 3887|       |
 3888|  1.12M|	    val = xmlParseStringCharRef(ctxt, &str);
 3889|  1.12M|	    if (val == 0) {
  ------------------
  |  Branch (3889:10): [True: 4, False: 1.12M]
  ------------------
 3890|      4|                if (pent != NULL)
  ------------------
  |  Branch (3890:21): [True: 4, False: 0]
  ------------------
 3891|      4|                    pent->content[0] = 0;
 3892|      4|                break;
 3893|      4|            }
 3894|       |
 3895|  1.12M|            if (val == ' ') {
  ------------------
  |  Branch (3895:17): [True: 3.94k, False: 1.12M]
  ------------------
 3896|  3.94k|                if ((normalize) && (*inSpace))
  ------------------
  |  Branch (3896:21): [True: 1.82k, False: 2.12k]
  |  Branch (3896:36): [True: 1.13k, False: 687]
  ------------------
 3897|  1.13k|                    normChange = 1;
 3898|  2.80k|                else
 3899|  2.80k|                    xmlSBufAddCString(buf, " ", 1);
 3900|  3.94k|                *inSpace = 1;
 3901|  1.12M|            } else {
 3902|  1.12M|                xmlSBufAddChar(buf, val);
 3903|  1.12M|                *inSpace = 0;
 3904|  1.12M|            }
 3905|  2.62M|	} else {
 3906|  2.62M|            xmlChar *name;
 3907|  2.62M|            xmlEntityPtr ent;
 3908|       |
 3909|  2.62M|            if (chunkSize > 0) {
  ------------------
  |  Branch (3909:17): [True: 1.36M, False: 1.25M]
  ------------------
 3910|  1.36M|                xmlSBufAddString(buf, str - chunkSize, chunkSize);
 3911|  1.36M|                chunkSize = 0;
 3912|  1.36M|            }
 3913|       |
 3914|  2.62M|	    name = xmlParseStringEntityRef(ctxt, &str);
 3915|  2.62M|            if (name == NULL) {
  ------------------
  |  Branch (3915:17): [True: 23, False: 2.62M]
  ------------------
 3916|     23|                if (pent != NULL)
  ------------------
  |  Branch (3916:21): [True: 22, False: 1]
  ------------------
 3917|     22|                    pent->content[0] = 0;
 3918|     23|                break;
 3919|     23|            }
 3920|       |
 3921|  2.62M|            ent = xmlLookupGeneralEntity(ctxt, name, /* inAttr */ 1);
 3922|  2.62M|            xmlFree(name);
 3923|       |
 3924|  2.62M|	    if ((ent != NULL) &&
  ------------------
  |  Branch (3924:10): [True: 2.55M, False: 68.5k]
  ------------------
 3925|  2.55M|		(ent->etype == XML_INTERNAL_PREDEFINED_ENTITY)) {
  ------------------
  |  Branch (3925:3): [True: 1.30M, False: 1.24M]
  ------------------
 3926|  1.30M|		if (ent->content == NULL) {
  ------------------
  |  Branch (3926:7): [True: 0, False: 1.30M]
  ------------------
 3927|      0|		    xmlFatalErrMsg(ctxt, XML_ERR_INTERNAL_ERROR,
 3928|      0|			    "predefined entity has no content\n");
 3929|      0|                    break;
 3930|      0|                }
 3931|       |
 3932|  1.30M|                xmlSBufAddString(buf, ent->content, ent->length);
 3933|       |
 3934|  1.30M|                *inSpace = 0;
 3935|  1.31M|	    } else if ((ent != NULL) && (ent->content != NULL)) {
  ------------------
  |  Branch (3935:17): [True: 1.24M, False: 68.5k]
  |  Branch (3935:34): [True: 1.24M, False: 175]
  ------------------
 3936|  1.24M|                if (pent != NULL)
  ------------------
  |  Branch (3936:21): [True: 1.24M, False: 656]
  ------------------
 3937|  1.24M|                    pent->flags |= XML_ENT_EXPANDING;
  ------------------
  |  |   22|  1.24M|#define XML_ENT_EXPANDING   (1u << 3)
  ------------------
 3938|  1.24M|		normChange |= xmlExpandEntityInAttValue(ctxt, buf,
 3939|  1.24M|                        ent->content, ent, normalize, inSpace, depth, check);
 3940|  1.24M|                if (pent != NULL)
  ------------------
  |  Branch (3940:21): [True: 1.24M, False: 656]
  ------------------
 3941|  1.24M|                    pent->flags &= ~XML_ENT_EXPANDING;
  ------------------
  |  |   22|  1.24M|#define XML_ENT_EXPANDING   (1u << 3)
  ------------------
 3942|  1.24M|	    }
 3943|  2.62M|        }
 3944|   235M|    }
 3945|       |
 3946|  1.84M|    if (chunkSize > 0)
  ------------------
  |  Branch (3946:9): [True: 1.18M, False: 659k]
  ------------------
 3947|  1.18M|        xmlSBufAddString(buf, str - chunkSize, chunkSize);
 3948|       |
 3949|  1.84M|    return(normChange);
 3950|  1.84M|}
parser.c:xmlParseStringEntityRef:
 7536|  2.63M|xmlParseStringEntityRef(xmlParserCtxtPtr ctxt, const xmlChar ** str) {
 7537|  2.63M|    xmlChar *name;
 7538|  2.63M|    const xmlChar *ptr;
 7539|  2.63M|    xmlChar cur;
 7540|       |
 7541|  2.63M|    if ((str == NULL) || (*str == NULL))
  ------------------
  |  Branch (7541:9): [True: 0, False: 2.63M]
  |  Branch (7541:26): [True: 0, False: 2.63M]
  ------------------
 7542|      0|        return(NULL);
 7543|  2.63M|    ptr = *str;
 7544|  2.63M|    cur = *ptr;
 7545|  2.63M|    if (cur != '&')
  ------------------
  |  Branch (7545:9): [True: 0, False: 2.63M]
  ------------------
 7546|      0|	return(NULL);
 7547|       |
 7548|  2.63M|    ptr++;
 7549|  2.63M|    name = xmlParseStringName(ctxt, &ptr);
 7550|  2.63M|    if (name == NULL) {
  ------------------
  |  Branch (7550:9): [True: 23, False: 2.63M]
  ------------------
 7551|     23|	xmlFatalErrMsg(ctxt, XML_ERR_NAME_REQUIRED,
 7552|     23|		       "xmlParseStringEntityRef: no name\n");
 7553|     23|	*str = ptr;
 7554|     23|	return(NULL);
 7555|     23|    }
 7556|  2.63M|    if (*ptr != ';') {
  ------------------
  |  Branch (7556:9): [True: 10, False: 2.63M]
  ------------------
 7557|     10|	xmlFatalErr(ctxt, XML_ERR_ENTITYREF_SEMICOL_MISSING, NULL);
 7558|     10|        xmlFree(name);
 7559|     10|	*str = ptr;
 7560|     10|	return(NULL);
 7561|     10|    }
 7562|  2.63M|    ptr++;
 7563|       |
 7564|  2.63M|    *str = ptr;
 7565|  2.63M|    return(name);
 7566|  2.63M|}
parser.c:xmlParseAttValueInternal:
 4019|   377k|                         int special, int isNamespace) {
 4020|   377k|    unsigned maxLength = (ctxt->options & XML_PARSE_HUGE) ?
  ------------------
  |  Branch (4020:26): [True: 194k, False: 183k]
  ------------------
 4021|   194k|                         XML_MAX_HUGE_LENGTH :
  ------------------
  |  |   55|   194k|#define XML_MAX_HUGE_LENGTH 1000000000
  ------------------
 4022|   377k|                         XML_MAX_TEXT_LENGTH;
  ------------------
  |  |   50|   561k|#define XML_MAX_TEXT_LENGTH 10000000
  ------------------
 4023|   377k|    xmlSBuf buf;
 4024|   377k|    xmlChar *ret;
 4025|   377k|    int c, l, quote, entFlags, chunkSize;
 4026|   377k|    int inSpace = 1;
 4027|   377k|    int replaceEntities;
 4028|   377k|    int normalize = (special & XML_SPECIAL_TYPE_MASK) > XML_ATTRIBUTE_CDATA;
  ------------------
  |  |   96|   377k|#define XML_SPECIAL_TYPE_MASK   (XML_SPECIAL_EXTERNAL - 1)
  |  |  ------------------
  |  |  |  |   95|   377k|#define XML_SPECIAL_EXTERNAL    (1 << 20)
  |  |  ------------------
  ------------------
 4029|   377k|    int attvalFlags = 0;
 4030|       |
 4031|       |    /* Always expand namespace URIs */
 4032|   377k|    replaceEntities = (ctxt->replaceEntities) || (isNamespace);
  ------------------
  |  Branch (4032:23): [True: 247k, False: 130k]
  |  Branch (4032:50): [True: 16.7k, False: 113k]
  ------------------
 4033|       |
 4034|   377k|    xmlSBufInit(&buf, maxLength);
 4035|       |
 4036|   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: 183k, False: 193k]
  |  |  ------------------
  |  | 2272|   377k|        (ctxt->input->end - ctxt->input->cur < INPUT_CHUNK)) \
  |  |  ------------------
  |  |  |  |   63|   183k|#define INPUT_CHUNK	250
  |  |  ------------------
  |  |  |  Branch (2272:9): [True: 44.1k, False: 139k]
  |  |  ------------------
  |  | 2273|   377k|	xmlParserGrow(ctxt);
  ------------------
 4037|       |
 4038|   377k|    quote = CUR;
  ------------------
  |  | 2225|   377k|#define CUR (*ctxt->input->cur)
  ------------------
 4039|   377k|    if ((quote != '"') && (quote != '\'')) {
  ------------------
  |  Branch (4039:9): [True: 222k, False: 154k]
  |  Branch (4039:27): [True: 9.49k, False: 213k]
  ------------------
 4040|  9.49k|	xmlFatalErr(ctxt, XML_ERR_ATTRIBUTE_NOT_STARTED, NULL);
 4041|  9.49k|	return(NULL);
 4042|  9.49k|    }
 4043|   368k|    NEXTL(1);
  ------------------
  |  | 2288|   368k|#define NEXTL(l) do {							\
  |  | 2289|   368k|    if (*(ctxt->input->cur) == '\n') {					\
  |  |  ------------------
  |  |  |  Branch (2289:9): [True: 0, False: 368k]
  |  |  ------------------
  |  | 2290|      0|	ctxt->input->line++; ctxt->input->col = 1;			\
  |  | 2291|   368k|    } else ctxt->input->col++;						\
  |  | 2292|   368k|    ctxt->input->cur += l;				\
  |  | 2293|   368k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2293:12): [Folded, False: 368k]
  |  |  ------------------
  ------------------
 4044|       |
 4045|   368k|    if (ctxt->inSubset == 0)
  ------------------
  |  Branch (4045:9): [True: 302k, False: 65.9k]
  ------------------
 4046|   302k|        entFlags = XML_ENT_CHECKED | XML_ENT_VALIDATED;
  ------------------
  |  |   20|   302k|#define XML_ENT_CHECKED     (1u << 1)
  ------------------
                      entFlags = XML_ENT_CHECKED | XML_ENT_VALIDATED;
  ------------------
  |  |   21|   302k|#define XML_ENT_VALIDATED   (1u << 2)
  ------------------
 4047|  65.9k|    else
 4048|  65.9k|        entFlags = XML_ENT_VALIDATED;
  ------------------
  |  |   21|  65.9k|#define XML_ENT_VALIDATED   (1u << 2)
  ------------------
 4049|       |
 4050|   368k|    inSpace = 1;
 4051|   368k|    chunkSize = 0;
 4052|       |
 4053|   153M|    while (1) {
  ------------------
  |  Branch (4053:12): [True: 153M, Folded]
  ------------------
 4054|   153M|        if (PARSER_STOPPED(ctxt))
  ------------------
  |  |   44|   153M|#define PARSER_STOPPED(ctxt) ((ctxt)->disableSAX > 1)
  |  |  ------------------
  |  |  |  Branch (44:30): [True: 115, False: 153M]
  |  |  ------------------
  ------------------
 4055|    115|            goto error;
 4056|       |
 4057|   153M|        if (CUR_PTR >= ctxt->input->end) {
  ------------------
  |  | 2227|   153M|#define CUR_PTR ctxt->input->cur
  ------------------
  |  Branch (4057:13): [True: 34.5k, False: 153M]
  ------------------
 4058|  34.5k|            xmlFatalErrMsg(ctxt, XML_ERR_ATTRIBUTE_NOT_FINISHED,
 4059|  34.5k|                           "AttValue: ' expected\n");
 4060|  34.5k|            goto error;
 4061|  34.5k|        }
 4062|       |
 4063|       |        /*
 4064|       |         * TODO: Check growth threshold
 4065|       |         */
 4066|   153M|        if (ctxt->input->end - CUR_PTR < 10)
  ------------------
  |  | 2227|   153M|#define CUR_PTR ctxt->input->cur
  ------------------
  |  Branch (4066:13): [True: 376k, False: 153M]
  ------------------
 4067|   376k|            GROW;
  ------------------
  |  | 2271|   376k|    if ((!PARSER_PROGRESSIVE(ctxt)) && \
  |  |  ------------------
  |  |  |  |   47|   376k|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|   376k|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2271:9): [True: 326k, False: 49.8k]
  |  |  ------------------
  |  | 2272|   376k|        (ctxt->input->end - ctxt->input->cur < INPUT_CHUNK)) \
  |  |  ------------------
  |  |  |  |   63|   326k|#define INPUT_CHUNK	250
  |  |  ------------------
  |  |  |  Branch (2272:9): [True: 326k, False: 0]
  |  |  ------------------
  |  | 2273|   376k|	xmlParserGrow(ctxt);
  ------------------
 4068|       |
 4069|   153M|        c = CUR;
  ------------------
  |  | 2225|   153M|#define CUR (*ctxt->input->cur)
  ------------------
 4070|       |
 4071|   153M|        if (c >= 0x80) {
  ------------------
  |  Branch (4071:13): [True: 52.4M, False: 101M]
  ------------------
 4072|  52.4M|            l = xmlUTF8MultibyteLen(ctxt, CUR_PTR,
  ------------------
  |  | 2227|  52.4M|#define CUR_PTR ctxt->input->cur
  ------------------
 4073|  52.4M|                    "invalid character in attribute value\n");
 4074|  52.4M|            if (l == 0) {
  ------------------
  |  Branch (4074:17): [True: 46.7M, False: 5.70M]
  ------------------
 4075|  46.7M|                if (chunkSize > 0) {
  ------------------
  |  Branch (4075:21): [True: 269k, False: 46.4M]
  ------------------
 4076|   269k|                    xmlSBufAddString(&buf, CUR_PTR - chunkSize, chunkSize);
  ------------------
  |  | 2227|   269k|#define CUR_PTR ctxt->input->cur
  ------------------
 4077|   269k|                    chunkSize = 0;
 4078|   269k|                }
 4079|  46.7M|                xmlSBufAddReplChar(&buf);
 4080|  46.7M|                NEXTL(1);
  ------------------
  |  | 2288|  46.7M|#define NEXTL(l) do {							\
  |  | 2289|  46.7M|    if (*(ctxt->input->cur) == '\n') {					\
  |  |  ------------------
  |  |  |  Branch (2289:9): [True: 0, False: 46.7M]
  |  |  ------------------
  |  | 2290|      0|	ctxt->input->line++; ctxt->input->col = 1;			\
  |  | 2291|  46.7M|    } else ctxt->input->col++;						\
  |  | 2292|  46.7M|    ctxt->input->cur += l;				\
  |  | 2293|  46.7M|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2293:12): [Folded, False: 46.7M]
  |  |  ------------------
  ------------------
 4081|  46.7M|            } else {
 4082|  5.70M|                chunkSize += l;
 4083|  5.70M|                NEXTL(l);
  ------------------
  |  | 2288|  5.70M|#define NEXTL(l) do {							\
  |  | 2289|  5.70M|    if (*(ctxt->input->cur) == '\n') {					\
  |  |  ------------------
  |  |  |  Branch (2289:9): [True: 0, False: 5.70M]
  |  |  ------------------
  |  | 2290|      0|	ctxt->input->line++; ctxt->input->col = 1;			\
  |  | 2291|  5.70M|    } else ctxt->input->col++;						\
  |  | 2292|  5.70M|    ctxt->input->cur += l;				\
  |  | 2293|  5.70M|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2293:12): [Folded, False: 5.70M]
  |  |  ------------------
  ------------------
 4084|  5.70M|            }
 4085|       |
 4086|  52.4M|            inSpace = 0;
 4087|   101M|        } else if (c != '&') {
  ------------------
  |  Branch (4087:20): [True: 100M, False: 1.02M]
  ------------------
 4088|   100M|            if (c > 0x20) {
  ------------------
  |  Branch (4088:17): [True: 57.6M, False: 42.7M]
  ------------------
 4089|  57.6M|                if (c == quote)
  ------------------
  |  Branch (4089:21): [True: 331k, False: 57.3M]
  ------------------
 4090|   331k|                    break;
 4091|       |
 4092|  57.3M|                if (c == '<')
  ------------------
  |  Branch (4092:21): [True: 786k, False: 56.5M]
  ------------------
 4093|   786k|                    xmlFatalErr(ctxt, XML_ERR_LT_IN_ATTRIBUTE, NULL);
 4094|       |
 4095|  57.3M|                chunkSize += 1;
 4096|  57.3M|                inSpace = 0;
 4097|  57.3M|            } else if (!IS_BYTE_CHAR(c)) {
  ------------------
  |  |  103|  42.7M|#define IS_BYTE_CHAR(c)	 xmlIsChar_ch(c)
  |  |  ------------------
  |  |  |  |  108|  42.7M|#define xmlIsChar_ch(c)		(((0x9 <= (c)) && ((c) <= 0xa)) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (108:28): [True: 7.05M, False: 35.7M]
  |  |  |  |  |  Branch (108:44): [True: 3.72M, False: 3.32M]
  |  |  |  |  ------------------
  |  |  |  |  109|  42.7M|				 ((c) == 0xd) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (109:6): [True: 601k, False: 38.4M]
  |  |  |  |  ------------------
  |  |  |  |  110|  42.7M|				  (0x20 <= (c)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (110:7): [True: 2.45M, False: 35.9M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 4098|  35.9M|                xmlFatalErrMsg(ctxt, XML_ERR_INVALID_CHAR,
 4099|  35.9M|                        "invalid character in attribute value\n");
 4100|  35.9M|                if (chunkSize > 0) {
  ------------------
  |  Branch (4100:21): [True: 82.4k, False: 35.9M]
  ------------------
 4101|  82.4k|                    xmlSBufAddString(&buf, CUR_PTR - chunkSize, chunkSize);
  ------------------
  |  | 2227|  82.4k|#define CUR_PTR ctxt->input->cur
  ------------------
 4102|  82.4k|                    chunkSize = 0;
 4103|  82.4k|                }
 4104|  35.9M|                xmlSBufAddReplChar(&buf);
 4105|  35.9M|                inSpace = 0;
 4106|  35.9M|            } else {
 4107|       |                /* Whitespace */
 4108|  6.78M|                if ((normalize) && (inSpace)) {
  ------------------
  |  Branch (4108:21): [True: 121k, False: 6.66M]
  |  Branch (4108:36): [True: 64.8k, False: 56.4k]
  ------------------
 4109|       |                    /* Skip char */
 4110|  64.8k|                    if (chunkSize > 0) {
  ------------------
  |  Branch (4110:25): [True: 32.6k, False: 32.1k]
  ------------------
 4111|  32.6k|                        xmlSBufAddString(&buf, CUR_PTR - chunkSize, chunkSize);
  ------------------
  |  | 2227|  32.6k|#define CUR_PTR ctxt->input->cur
  ------------------
 4112|  32.6k|                        chunkSize = 0;
 4113|  32.6k|                    }
 4114|  64.8k|                    attvalFlags |= XML_ATTVAL_NORM_CHANGE;
  ------------------
  |  |   99|  64.8k|#define XML_ATTVAL_NORM_CHANGE  (1 << 1)
  ------------------
 4115|  6.72M|                } else if (c < 0x20) {
  ------------------
  |  Branch (4115:28): [True: 4.31M, False: 2.40M]
  ------------------
 4116|       |                    /* Convert to space */
 4117|  4.31M|                    if (chunkSize > 0) {
  ------------------
  |  Branch (4117:25): [True: 195k, False: 4.11M]
  ------------------
 4118|   195k|                        xmlSBufAddString(&buf, CUR_PTR - chunkSize, chunkSize);
  ------------------
  |  | 2227|   195k|#define CUR_PTR ctxt->input->cur
  ------------------
 4119|   195k|                        chunkSize = 0;
 4120|   195k|                    }
 4121|       |
 4122|  4.31M|                    xmlSBufAddCString(&buf, " ", 1);
 4123|  4.31M|                } else {
 4124|  2.40M|                    chunkSize += 1;
 4125|  2.40M|                }
 4126|       |
 4127|  6.78M|                inSpace = 1;
 4128|       |
 4129|  6.78M|                if ((c == 0xD) && (NXT(1) == 0xA))
  ------------------
  |  | 2226|   601k|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
  |  Branch (4129:21): [True: 601k, False: 6.18M]
  |  Branch (4129:35): [True: 48.4k, False: 552k]
  ------------------
 4130|  48.4k|                    CUR_PTR++;
  ------------------
  |  | 2227|  48.4k|#define CUR_PTR ctxt->input->cur
  ------------------
 4131|  6.78M|            }
 4132|       |
 4133|   100M|            NEXTL(1);
  ------------------
  |  | 2288|   100M|#define NEXTL(l) do {							\
  |  | 2289|   100M|    if (*(ctxt->input->cur) == '\n') {					\
  |  |  ------------------
  |  |  |  Branch (2289:9): [True: 3.73M, False: 96.3M]
  |  |  ------------------
  |  | 2290|  3.73M|	ctxt->input->line++; ctxt->input->col = 1;			\
  |  | 2291|  96.3M|    } else ctxt->input->col++;						\
  |  | 2292|   100M|    ctxt->input->cur += l;				\
  |  | 2293|   100M|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2293:12): [Folded, False: 100M]
  |  |  ------------------
  ------------------
 4134|   100M|        } else if (NXT(1) == '#') {
  ------------------
  |  | 2226|  1.02M|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
  |  Branch (4134:20): [True: 50.6k, False: 973k]
  ------------------
 4135|  50.6k|            int val;
 4136|       |
 4137|  50.6k|            if (chunkSize > 0) {
  ------------------
  |  Branch (4137:17): [True: 38.6k, False: 12.0k]
  ------------------
 4138|  38.6k|                xmlSBufAddString(&buf, CUR_PTR - chunkSize, chunkSize);
  ------------------
  |  | 2227|  38.6k|#define CUR_PTR ctxt->input->cur
  ------------------
 4139|  38.6k|                chunkSize = 0;
 4140|  38.6k|            }
 4141|       |
 4142|  50.6k|            val = xmlParseCharRef(ctxt);
 4143|  50.6k|            if (val == 0)
  ------------------
  |  Branch (4143:17): [True: 2.08k, False: 48.6k]
  ------------------
 4144|  2.08k|                goto error;
 4145|       |
 4146|  48.6k|            if ((val == '&') && (!replaceEntities)) {
  ------------------
  |  Branch (4146:17): [True: 6.69k, False: 41.9k]
  |  Branch (4146:33): [True: 3.78k, False: 2.90k]
  ------------------
 4147|       |                /*
 4148|       |                 * The reparsing will be done in xmlNodeParseContent()
 4149|       |                 * called from SAX2.c
 4150|       |                 */
 4151|  3.78k|                xmlSBufAddCString(&buf, "&#38;", 5);
 4152|  3.78k|                inSpace = 0;
 4153|  44.8k|            } else if (val == ' ') {
  ------------------
  |  Branch (4153:24): [True: 1.81k, False: 43.0k]
  ------------------
 4154|  1.81k|                if ((normalize) && (inSpace))
  ------------------
  |  Branch (4154:21): [True: 429, False: 1.38k]
  |  Branch (4154:36): [True: 200, False: 229]
  ------------------
 4155|    200|                    attvalFlags |= XML_ATTVAL_NORM_CHANGE;
  ------------------
  |  |   99|    200|#define XML_ATTVAL_NORM_CHANGE  (1 << 1)
  ------------------
 4156|  1.61k|                else
 4157|  1.61k|                    xmlSBufAddCString(&buf, " ", 1);
 4158|  1.81k|                inSpace = 1;
 4159|  43.0k|            } else {
 4160|  43.0k|                xmlSBufAddChar(&buf, val);
 4161|  43.0k|                inSpace = 0;
 4162|  43.0k|            }
 4163|   973k|        } else {
 4164|   973k|            const xmlChar *name;
 4165|   973k|            xmlEntityPtr ent;
 4166|       |
 4167|   973k|            if (chunkSize > 0) {
  ------------------
  |  Branch (4167:17): [True: 611k, False: 361k]
  ------------------
 4168|   611k|                xmlSBufAddString(&buf, CUR_PTR - chunkSize, chunkSize);
  ------------------
  |  | 2227|   611k|#define CUR_PTR ctxt->input->cur
  ------------------
 4169|   611k|                chunkSize = 0;
 4170|   611k|            }
 4171|       |
 4172|   973k|            name = xmlParseEntityRefInternal(ctxt);
 4173|   973k|            if (name == NULL) {
  ------------------
  |  Branch (4173:17): [True: 113k, False: 860k]
  ------------------
 4174|       |                /*
 4175|       |                 * Probably a literal '&' which wasn't escaped.
 4176|       |                 * TODO: Handle gracefully in recovery mode.
 4177|       |                 */
 4178|   113k|                continue;
 4179|   113k|            }
 4180|       |
 4181|   860k|            ent = xmlLookupGeneralEntity(ctxt, name, /* isAttr */ 1);
 4182|   860k|            if (ent == NULL)
  ------------------
  |  Branch (4182:17): [True: 200k, False: 659k]
  ------------------
 4183|   200k|                continue;
 4184|       |
 4185|   659k|            if (ent->etype == XML_INTERNAL_PREDEFINED_ENTITY) {
  ------------------
  |  Branch (4185:17): [True: 19.7k, False: 639k]
  ------------------
 4186|  19.7k|                if ((ent->content[0] == '&') && (!replaceEntities))
  ------------------
  |  Branch (4186:21): [True: 3.60k, False: 16.1k]
  |  Branch (4186:49): [True: 2.46k, False: 1.13k]
  ------------------
 4187|  2.46k|                    xmlSBufAddCString(&buf, "&#38;", 5);
 4188|  17.2k|                else
 4189|  17.2k|                    xmlSBufAddString(&buf, ent->content, ent->length);
 4190|  19.7k|                inSpace = 0;
 4191|   639k|            } else if (replaceEntities) {
  ------------------
  |  Branch (4191:24): [True: 571k, False: 67.9k]
  ------------------
 4192|   571k|                if (xmlExpandEntityInAttValue(ctxt, &buf,
  ------------------
  |  Branch (4192:21): [True: 5.21k, False: 566k]
  ------------------
 4193|   571k|                        ent->content, ent, normalize, &inSpace, ctxt->inputNr,
 4194|   571k|                        /* check */ 1) > 0)
 4195|  5.21k|                    attvalFlags |= XML_ATTVAL_NORM_CHANGE;
  ------------------
  |  |   99|  5.21k|#define XML_ATTVAL_NORM_CHANGE  (1 << 1)
  ------------------
 4196|   571k|            } else {
 4197|  67.9k|                if ((ent->flags & entFlags) != entFlags)
  ------------------
  |  Branch (4197:21): [True: 862, False: 67.0k]
  ------------------
 4198|    862|                    xmlCheckEntityInAttValue(ctxt, ent, ctxt->inputNr);
 4199|       |
 4200|  67.9k|                if (xmlParserEntityCheck(ctxt, ent->expandedSize)) {
  ------------------
  |  Branch (4200:21): [True: 93, False: 67.8k]
  ------------------
 4201|     93|                    ent->content[0] = 0;
 4202|     93|                    goto error;
 4203|     93|                }
 4204|       |
 4205|       |                /*
 4206|       |                 * Just output the reference
 4207|       |                 */
 4208|  67.8k|                xmlSBufAddCString(&buf, "&", 1);
 4209|  67.8k|                xmlSBufAddString(&buf, ent->name, xmlStrlen(ent->name));
 4210|  67.8k|                xmlSBufAddCString(&buf, ";", 1);
 4211|       |
 4212|  67.8k|                inSpace = 0;
 4213|  67.8k|            }
 4214|   659k|	}
 4215|   153M|    }
 4216|       |
 4217|   331k|    if ((buf.mem == NULL) && (outFlags != NULL)) {
  ------------------
  |  Branch (4217:9): [True: 272k, False: 59.3k]
  |  Branch (4217:30): [True: 135k, False: 136k]
  ------------------
 4218|   135k|        ret = (xmlChar *) CUR_PTR - chunkSize;
  ------------------
  |  | 2227|   135k|#define CUR_PTR ctxt->input->cur
  ------------------
 4219|       |
 4220|   135k|        if (attlen != NULL)
  ------------------
  |  Branch (4220:13): [True: 135k, False: 0]
  ------------------
 4221|   135k|            *attlen = chunkSize;
 4222|   135k|        if ((normalize) && (inSpace) && (chunkSize > 0)) {
  ------------------
  |  Branch (4222:13): [True: 1.82k, False: 133k]
  |  Branch (4222:28): [True: 525, False: 1.30k]
  |  Branch (4222:41): [True: 87, False: 438]
  ------------------
 4223|     87|            attvalFlags |= XML_ATTVAL_NORM_CHANGE;
  ------------------
  |  |   99|     87|#define XML_ATTVAL_NORM_CHANGE  (1 << 1)
  ------------------
 4224|     87|            *attlen -= 1;
 4225|     87|        }
 4226|       |
 4227|       |        /* Report potential error */
 4228|   135k|        xmlSBufCleanup(&buf, ctxt, "AttValue length too long");
 4229|   195k|    } else {
 4230|   195k|        if (chunkSize > 0)
  ------------------
  |  Branch (4230:13): [True: 168k, False: 26.9k]
  ------------------
 4231|   168k|            xmlSBufAddString(&buf, CUR_PTR - chunkSize, chunkSize);
  ------------------
  |  | 2227|   168k|#define CUR_PTR ctxt->input->cur
  ------------------
 4232|       |
 4233|   195k|        if ((normalize) && (inSpace) && (buf.size > 0)) {
  ------------------
  |  Branch (4233:13): [True: 2.19k, False: 193k]
  |  Branch (4233:28): [True: 424, False: 1.76k]
  |  Branch (4233:41): [True: 424, False: 0]
  ------------------
 4234|    424|            attvalFlags |= XML_ATTVAL_NORM_CHANGE;
  ------------------
  |  |   99|    424|#define XML_ATTVAL_NORM_CHANGE  (1 << 1)
  ------------------
 4235|    424|            buf.size--;
 4236|    424|        }
 4237|       |
 4238|   195k|        ret = xmlSBufFinish(&buf, attlen, ctxt, "AttValue length too long");
 4239|   195k|        attvalFlags |= XML_ATTVAL_ALLOC;
  ------------------
  |  |   98|   195k|#define XML_ATTVAL_ALLOC        (1 << 0)
  ------------------
 4240|       |
 4241|   195k|        if (ret != NULL) {
  ------------------
  |  Branch (4241:13): [True: 195k, False: 17]
  ------------------
 4242|   195k|            if (attlen != NULL)
  ------------------
  |  Branch (4242:17): [True: 28.1k, False: 167k]
  ------------------
 4243|  28.1k|                *attlen = buf.size;
 4244|   195k|        }
 4245|   195k|    }
 4246|       |
 4247|   331k|    if (outFlags != NULL)
  ------------------
  |  Branch (4247:9): [True: 163k, False: 167k]
  ------------------
 4248|   163k|        *outFlags = attvalFlags;
 4249|       |
 4250|   331k|    NEXTL(1);
  ------------------
  |  | 2288|   331k|#define NEXTL(l) do {							\
  |  | 2289|   331k|    if (*(ctxt->input->cur) == '\n') {					\
  |  |  ------------------
  |  |  |  Branch (2289:9): [True: 0, False: 331k]
  |  |  ------------------
  |  | 2290|      0|	ctxt->input->line++; ctxt->input->col = 1;			\
  |  | 2291|   331k|    } else ctxt->input->col++;						\
  |  | 2292|   331k|    ctxt->input->cur += l;				\
  |  | 2293|   331k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2293:12): [Folded, False: 331k]
  |  |  ------------------
  ------------------
 4251|       |
 4252|   331k|    return(ret);
 4253|       |
 4254|  36.8k|error:
 4255|  36.8k|    xmlSBufCleanup(&buf, ctxt, "AttValue length too long");
 4256|       |    return(NULL);
 4257|   368k|}
parser.c:xmlCheckEntityInAttValue:
 3692|  4.29k|xmlCheckEntityInAttValue(xmlParserCtxtPtr ctxt, xmlEntityPtr pent, int depth) {
 3693|  4.29k|    int maxDepth = (ctxt->options & XML_PARSE_HUGE) ? 40 : 20;
  ------------------
  |  Branch (3693:20): [True: 3.33k, False: 953]
  ------------------
 3694|  4.29k|    const xmlChar *str;
 3695|  4.29k|    unsigned long expandedSize = pent->length;
 3696|  4.29k|    int c, flags;
 3697|       |
 3698|  4.29k|    depth += 1;
 3699|  4.29k|    if (depth > maxDepth) {
  ------------------
  |  Branch (3699:9): [True: 1, False: 4.29k]
  ------------------
 3700|      1|	xmlFatalErrMsg(ctxt, XML_ERR_RESOURCE_LIMIT,
 3701|      1|                       "Maximum entity nesting depth exceeded");
 3702|      1|	return;
 3703|      1|    }
 3704|       |
 3705|  4.29k|    if (pent->flags & XML_ENT_EXPANDING) {
  ------------------
  |  |   22|  4.29k|#define XML_ENT_EXPANDING   (1u << 3)
  ------------------
  |  Branch (3705:9): [True: 10, False: 4.28k]
  ------------------
 3706|     10|        xmlFatalErr(ctxt, XML_ERR_ENTITY_LOOP, NULL);
 3707|     10|        return;
 3708|     10|    }
 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|  4.28k|    if (ctxt->inSubset == 0)
  ------------------
  |  Branch (3715:9): [True: 4.10k, False: 178]
  ------------------
 3716|  4.10k|        flags = XML_ENT_CHECKED | XML_ENT_VALIDATED;
  ------------------
  |  |   20|  4.10k|#define XML_ENT_CHECKED     (1u << 1)
  ------------------
                      flags = XML_ENT_CHECKED | XML_ENT_VALIDATED;
  ------------------
  |  |   21|  4.10k|#define XML_ENT_VALIDATED   (1u << 2)
  ------------------
 3717|    178|    else
 3718|    178|        flags = XML_ENT_VALIDATED;
  ------------------
  |  |   21|    178|#define XML_ENT_VALIDATED   (1u << 2)
  ------------------
 3719|       |
 3720|  4.28k|    str = pent->content;
 3721|  4.28k|    if (str == NULL)
  ------------------
  |  Branch (3721:9): [True: 2, False: 4.27k]
  ------------------
 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|  19.3M|    while (!PARSER_STOPPED(ctxt)) {
  ------------------
  |  |   44|  19.3M|#define PARSER_STOPPED(ctxt) ((ctxt)->disableSAX > 1)
  ------------------
  |  Branch (3730:12): [True: 19.3M, False: 100]
  ------------------
 3731|  19.3M|        c = *str;
 3732|       |
 3733|  19.3M|	if (c != '&') {
  ------------------
  |  Branch (3733:6): [True: 19.3M, False: 17.1k]
  ------------------
 3734|  19.3M|            if (c == 0)
  ------------------
  |  Branch (3734:17): [True: 4.16k, False: 19.3M]
  ------------------
 3735|  4.16k|                break;
 3736|       |
 3737|  19.3M|            if (c == '<')
  ------------------
  |  Branch (3737:17): [True: 1.45k, False: 19.3M]
  ------------------
 3738|  1.45k|                xmlFatalErrMsgStr(ctxt, XML_ERR_LT_IN_ATTRIBUTE,
 3739|  1.45k|                        "'<' in entity '%s' is not allowed in attributes "
 3740|  1.45k|                        "values\n", pent->name);
 3741|       |
 3742|  19.3M|            str += 1;
 3743|  19.3M|        } else if (str[1] == '#') {
  ------------------
  |  Branch (3743:20): [True: 4.31k, False: 12.8k]
  ------------------
 3744|  4.31k|            int val;
 3745|       |
 3746|  4.31k|	    val = xmlParseStringCharRef(ctxt, &str);
 3747|  4.31k|	    if (val == 0) {
  ------------------
  |  Branch (3747:10): [True: 3, False: 4.30k]
  ------------------
 3748|      3|                pent->content[0] = 0;
 3749|      3|                break;
 3750|      3|            }
 3751|  12.8k|	} else {
 3752|  12.8k|            xmlChar *name;
 3753|  12.8k|            xmlEntityPtr ent;
 3754|       |
 3755|  12.8k|	    name = xmlParseStringEntityRef(ctxt, &str);
 3756|  12.8k|	    if (name == NULL) {
  ------------------
  |  Branch (3756:10): [True: 10, False: 12.8k]
  ------------------
 3757|     10|                pent->content[0] = 0;
 3758|     10|                break;
 3759|     10|            }
 3760|       |
 3761|  12.8k|            ent = xmlLookupGeneralEntity(ctxt, name, /* inAttr */ 1);
 3762|  12.8k|            xmlFree(name);
 3763|       |
 3764|  12.8k|            if ((ent != NULL) &&
  ------------------
  |  Branch (3764:17): [True: 7.54k, False: 5.26k]
  ------------------
 3765|  7.54k|                (ent->etype != XML_INTERNAL_PREDEFINED_ENTITY)) {
  ------------------
  |  Branch (3765:17): [True: 6.76k, False: 773]
  ------------------
 3766|  6.76k|                if ((ent->flags & flags) != flags) {
  ------------------
  |  Branch (3766:21): [True: 3.42k, False: 3.33k]
  ------------------
 3767|  3.42k|                    pent->flags |= XML_ENT_EXPANDING;
  ------------------
  |  |   22|  3.42k|#define XML_ENT_EXPANDING   (1u << 3)
  ------------------
 3768|  3.42k|                    xmlCheckEntityInAttValue(ctxt, ent, depth);
 3769|  3.42k|                    pent->flags &= ~XML_ENT_EXPANDING;
  ------------------
  |  |   22|  3.42k|#define XML_ENT_EXPANDING   (1u << 3)
  ------------------
 3770|  3.42k|                }
 3771|       |
 3772|  6.76k|                xmlSaturatedAdd(&expandedSize, ent->expandedSize);
 3773|  6.76k|                xmlSaturatedAdd(&expandedSize, XML_ENT_FIXED_COST);
  ------------------
  |  |  169|  6.76k|#define XML_ENT_FIXED_COST 20
  ------------------
 3774|  6.76k|            }
 3775|  12.8k|        }
 3776|  19.3M|    }
 3777|       |
 3778|  4.28k|done:
 3779|  4.28k|    if (ctxt->inSubset == 0)
  ------------------
  |  Branch (3779:9): [True: 4.10k, False: 178]
  ------------------
 3780|  4.10k|        pent->expandedSize = expandedSize;
 3781|       |
 3782|  4.28k|    pent->flags |= flags;
 3783|  4.28k|}
parser.c:xmlCurrentCharRecover:
 2300|  44.4M|xmlCurrentCharRecover(xmlParserCtxtPtr ctxt, int *len) {
 2301|  44.4M|    int c = xmlCurrentChar(ctxt, len);
 2302|       |
 2303|  44.4M|    if (c == XML_INVALID_CHAR)
  ------------------
  |  |    9|  44.4M|#define XML_INVALID_CHAR 0x200000
  ------------------
  |  Branch (2303:9): [True: 8.40M, False: 36.0M]
  ------------------
 2304|  8.40M|        c = 0xFFFD; /* replacement character */
 2305|       |
 2306|  44.4M|    return(c);
 2307|  44.4M|}
parser.c:xmlParseCharDataInternal:
 4533|  8.16M|xmlParseCharDataInternal(xmlParserCtxtPtr ctxt, int partial) {
 4534|  8.16M|    const xmlChar *in;
 4535|  8.16M|    int line = ctxt->input->line;
 4536|  8.16M|    int col = ctxt->input->col;
 4537|  8.16M|    int ccol;
 4538|  8.16M|    int terminate = 0;
 4539|       |
 4540|  8.16M|    GROW;
  ------------------
  |  | 2271|  8.16M|    if ((!PARSER_PROGRESSIVE(ctxt)) && \
  |  |  ------------------
  |  |  |  |   47|  8.16M|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|  8.16M|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2271:9): [True: 4.62M, False: 3.53M]
  |  |  ------------------
  |  | 2272|  8.16M|        (ctxt->input->end - ctxt->input->cur < INPUT_CHUNK)) \
  |  |  ------------------
  |  |  |  |   63|  4.62M|#define INPUT_CHUNK	250
  |  |  ------------------
  |  |  |  Branch (2272:9): [True: 38.5k, False: 4.59M]
  |  |  ------------------
  |  | 2273|  8.16M|	xmlParserGrow(ctxt);
  ------------------
 4541|       |    /*
 4542|       |     * Accelerated common case where input don't need to be
 4543|       |     * modified before passing it to the handler.
 4544|       |     */
 4545|  8.16M|    in = ctxt->input->cur;
 4546|  8.17M|    do {
 4547|  8.31M|get_more_space:
 4548|  8.50M|        while (*in == 0x20) { in++; ctxt->input->col++; }
  ------------------
  |  Branch (4548:16): [True: 187k, False: 8.31M]
  ------------------
 4549|  8.31M|        if (*in == 0xA) {
  ------------------
  |  Branch (4549:13): [True: 138k, False: 8.17M]
  ------------------
 4550|  4.00M|            do {
 4551|  4.00M|                ctxt->input->line++; ctxt->input->col = 1;
 4552|  4.00M|                in++;
 4553|  4.00M|            } while (*in == 0xA);
  ------------------
  |  Branch (4553:22): [True: 3.87M, False: 138k]
  ------------------
 4554|   138k|            goto get_more_space;
 4555|   138k|        }
 4556|  8.17M|        if (*in == '<') {
  ------------------
  |  Branch (4556:13): [True: 110k, False: 8.06M]
  ------------------
 4557|   220k|            while (in > ctxt->input->cur) {
  ------------------
  |  Branch (4557:20): [True: 110k, False: 110k]
  ------------------
 4558|   110k|                const xmlChar *tmp = ctxt->input->cur;
 4559|   110k|                size_t nbchar = in - tmp;
 4560|       |
 4561|   110k|                if (nbchar > XML_MAX_ITEMS)
  ------------------
  |  |   13|   110k|#define XML_MAX_ITEMS 1000000000 /* 1 billion */
  ------------------
  |  Branch (4561:21): [True: 0, False: 110k]
  ------------------
 4562|      0|                    nbchar = XML_MAX_ITEMS;
  ------------------
  |  |   13|      0|#define XML_MAX_ITEMS 1000000000 /* 1 billion */
  ------------------
 4563|   110k|                ctxt->input->cur += nbchar;
 4564|       |
 4565|   110k|                xmlCharacters(ctxt, tmp, nbchar, 1);
 4566|   110k|            }
 4567|   110k|            return;
 4568|   110k|        }
 4569|       |
 4570|  8.51M|get_more:
 4571|  8.51M|        ccol = ctxt->input->col;
 4572|  16.7M|        while (test_char_data[*in]) {
  ------------------
  |  Branch (4572:16): [True: 8.19M, False: 8.51M]
  ------------------
 4573|  8.19M|            in++;
 4574|  8.19M|            ccol++;
 4575|  8.19M|        }
 4576|  8.51M|        ctxt->input->col = ccol;
 4577|  8.51M|        if (*in == 0xA) {
  ------------------
  |  Branch (4577:13): [True: 54.3k, False: 8.46M]
  ------------------
 4578|  3.18M|            do {
 4579|  3.18M|                ctxt->input->line++; ctxt->input->col = 1;
 4580|  3.18M|                in++;
 4581|  3.18M|            } while (*in == 0xA);
  ------------------
  |  Branch (4581:22): [True: 3.13M, False: 54.3k]
  ------------------
 4582|  54.3k|            goto get_more;
 4583|  54.3k|        }
 4584|  8.46M|        if (*in == ']') {
  ------------------
  |  Branch (4584:13): [True: 393k, False: 8.06M]
  ------------------
 4585|   393k|            size_t avail = ctxt->input->end - in;
 4586|       |
 4587|   393k|            if (partial && avail < 2) {
  ------------------
  |  Branch (4587:17): [True: 331k, False: 61.5k]
  |  Branch (4587:28): [True: 72, False: 331k]
  ------------------
 4588|     72|                terminate = 1;
 4589|     72|                goto invoke_callback;
 4590|     72|            }
 4591|   393k|            if (in[1] == ']') {
  ------------------
  |  Branch (4591:17): [True: 295k, False: 98.2k]
  ------------------
 4592|   295k|                if (partial && avail < 3) {
  ------------------
  |  Branch (4592:21): [True: 290k, False: 4.21k]
  |  Branch (4592:32): [True: 404, False: 290k]
  ------------------
 4593|    404|                    terminate = 1;
 4594|    404|                    goto invoke_callback;
 4595|    404|                }
 4596|   294k|                if (in[2] == '>')
  ------------------
  |  Branch (4596:21): [True: 2.99k, False: 291k]
  ------------------
 4597|  2.99k|                    xmlFatalErr(ctxt, XML_ERR_MISPLACED_CDATA_END, NULL);
 4598|   294k|            }
 4599|       |
 4600|   392k|            in++;
 4601|   392k|            ctxt->input->col++;
 4602|   392k|            goto get_more;
 4603|   393k|        }
 4604|       |
 4605|  8.06M|invoke_callback:
 4606|  8.64M|        while (in > ctxt->input->cur) {
  ------------------
  |  Branch (4606:16): [True: 579k, False: 8.06M]
  ------------------
 4607|   579k|            const xmlChar *tmp = ctxt->input->cur;
 4608|   579k|            size_t nbchar = in - tmp;
 4609|       |
 4610|   579k|            if (nbchar > XML_MAX_ITEMS)
  ------------------
  |  |   13|   579k|#define XML_MAX_ITEMS 1000000000 /* 1 billion */
  ------------------
  |  Branch (4610:17): [True: 0, False: 579k]
  ------------------
 4611|      0|                nbchar = XML_MAX_ITEMS;
  ------------------
  |  |   13|      0|#define XML_MAX_ITEMS 1000000000 /* 1 billion */
  ------------------
 4612|   579k|            ctxt->input->cur += nbchar;
 4613|       |
 4614|   579k|            xmlCharacters(ctxt, tmp, nbchar, 0);
 4615|       |
 4616|   579k|            line = ctxt->input->line;
 4617|   579k|            col = ctxt->input->col;
 4618|   579k|        }
 4619|  8.06M|        ctxt->input->cur = in;
 4620|  8.06M|        if (*in == 0xD) {
  ------------------
  |  Branch (4620:13): [True: 16.8k, False: 8.05M]
  ------------------
 4621|  16.8k|            in++;
 4622|  16.8k|            if (*in == 0xA) {
  ------------------
  |  Branch (4622:17): [True: 9.62k, False: 7.26k]
  ------------------
 4623|  9.62k|                ctxt->input->cur = in;
 4624|  9.62k|                in++;
 4625|  9.62k|                ctxt->input->line++; ctxt->input->col = 1;
 4626|  9.62k|                continue; /* while */
 4627|  9.62k|            }
 4628|  7.26k|            in--;
 4629|  7.26k|        }
 4630|  8.05M|        if (*in == '<') {
  ------------------
  |  Branch (4630:13): [True: 447k, False: 7.61M]
  ------------------
 4631|   447k|            return;
 4632|   447k|        }
 4633|  7.61M|        if (*in == '&') {
  ------------------
  |  Branch (4633:13): [True: 36.5k, False: 7.57M]
  ------------------
 4634|  36.5k|            return;
 4635|  36.5k|        }
 4636|  7.57M|        if (terminate) {
  ------------------
  |  Branch (4636:13): [True: 476, False: 7.57M]
  ------------------
 4637|    476|            return;
 4638|    476|        }
 4639|  7.57M|        SHRINK;
  ------------------
  |  | 2267|  7.57M|    if (!PARSER_PROGRESSIVE(ctxt)) \
  |  |  ------------------
  |  |  |  |   47|  7.57M|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|  7.57M|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2267:9): [True: 4.21M, False: 3.36M]
  |  |  ------------------
  |  | 2268|  7.57M|	xmlParserShrink(ctxt);
  ------------------
 4640|  7.57M|        GROW;
  ------------------
  |  | 2271|  7.57M|    if ((!PARSER_PROGRESSIVE(ctxt)) && \
  |  |  ------------------
  |  |  |  |   47|  7.57M|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|  7.57M|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2271:9): [True: 4.21M, False: 3.36M]
  |  |  ------------------
  |  | 2272|  7.57M|        (ctxt->input->end - ctxt->input->cur < INPUT_CHUNK)) \
  |  |  ------------------
  |  |  |  |   63|  4.21M|#define INPUT_CHUNK	250
  |  |  ------------------
  |  |  |  Branch (2272:9): [True: 16.9k, False: 4.19M]
  |  |  ------------------
  |  | 2273|  7.57M|	xmlParserGrow(ctxt);
  ------------------
 4641|  7.57M|        in = ctxt->input->cur;
 4642|  7.58M|    } while (((*in >= 0x20) && (*in <= 0x7F)) ||
  ------------------
  |  Branch (4642:15): [True: 99.0k, False: 7.48M]
  |  Branch (4642:32): [True: 2.06k, False: 96.9k]
  ------------------
 4643|  7.58M|             (*in == 0x09) || (*in == 0x0a));
  ------------------
  |  Branch (4643:14): [True: 4.61k, False: 7.57M]
  |  Branch (4643:31): [True: 2.30k, False: 7.57M]
  ------------------
 4644|  7.57M|    ctxt->input->line = line;
 4645|  7.57M|    ctxt->input->col = col;
 4646|  7.57M|    xmlParseCharDataComplex(ctxt, partial);
 4647|  7.57M|}
parser.c:xmlCharacters:
 4487|   863k|              int isBlank) {
 4488|   863k|    int checkBlanks;
 4489|       |
 4490|   863k|    if ((ctxt->sax == NULL) || (ctxt->disableSAX))
  ------------------
  |  Branch (4490:9): [True: 0, False: 863k]
  |  Branch (4490:32): [True: 135k, False: 727k]
  ------------------
 4491|   135k|        return;
 4492|       |
 4493|   727k|    checkBlanks = (!ctxt->keepBlanks) ||
  ------------------
  |  Branch (4493:19): [True: 382k, False: 345k]
  ------------------
 4494|   345k|                  (ctxt->sax->ignorableWhitespace != ctxt->sax->characters);
  ------------------
  |  Branch (4494:19): [True: 0, False: 345k]
  ------------------
 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|   727k|    if ((checkBlanks) &&
  ------------------
  |  Branch (4501:9): [True: 382k, False: 345k]
  ------------------
 4502|   382k|        (areBlanks(ctxt, buf, size, isBlank))) {
  ------------------
  |  Branch (4502:9): [True: 14.2k, False: 367k]
  ------------------
 4503|  14.2k|        if ((ctxt->sax->ignorableWhitespace != NULL) &&
  ------------------
  |  Branch (4503:13): [True: 14.2k, False: 0]
  ------------------
 4504|  14.2k|            (ctxt->keepBlanks))
  ------------------
  |  Branch (4504:13): [True: 0, False: 14.2k]
  ------------------
 4505|      0|            ctxt->sax->ignorableWhitespace(ctxt->userData, buf, size);
 4506|   713k|    } else {
 4507|   713k|        if (ctxt->sax->characters != NULL)
  ------------------
  |  Branch (4507:13): [True: 713k, False: 0]
  ------------------
 4508|   713k|            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|   713k|        if ((checkBlanks) && (*ctxt->space == -1))
  ------------------
  |  Branch (4514:13): [True: 367k, False: 345k]
  |  Branch (4514:30): [True: 132k, False: 235k]
  ------------------
 4515|   132k|            *ctxt->space = -2;
 4516|   713k|    }
 4517|   727k|}
parser.c:areBlanks:
 2815|   382k|                     int blank_chars) {
 2816|   382k|    int i;
 2817|   382k|    xmlNodePtr lastChild;
 2818|       |
 2819|       |    /*
 2820|       |     * Check for xml:space value.
 2821|       |     */
 2822|   382k|    if ((ctxt->space == NULL) || (*(ctxt->space) == 1) ||
  ------------------
  |  Branch (2822:9): [True: 0, False: 382k]
  |  Branch (2822:34): [True: 570, False: 381k]
  ------------------
 2823|   381k|        (*(ctxt->space) == -2))
  ------------------
  |  Branch (2823:9): [True: 233k, False: 147k]
  ------------------
 2824|   234k|	return(0);
 2825|       |
 2826|       |    /*
 2827|       |     * Check that the string is made of blanks
 2828|       |     */
 2829|   147k|    if (blank_chars == 0) {
  ------------------
  |  Branch (2829:9): [True: 136k, False: 10.5k]
  ------------------
 2830|   218k|	for (i = 0;i < len;i++)
  ------------------
  |  Branch (2830:13): [True: 211k, False: 6.80k]
  ------------------
 2831|   211k|	    if (!(IS_BLANK_CH(str[i]))) return(0);
  ------------------
  |  |  137|   211k|#define IS_BLANK_CH(c)  xmlIsBlank_ch(c)
  |  |  ------------------
  |  |  |  |   90|   211k|#define xmlIsBlank_ch(c)	(((c) == 0x20) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (90:27): [True: 14.0k, False: 197k]
  |  |  |  |  ------------------
  |  |  |  |   91|   211k|				 ((0x9 <= (c)) && ((c) <= 0xa)) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (91:7): [True: 197k, False: 0]
  |  |  |  |  |  Branch (91:23): [True: 67.5k, False: 130k]
  |  |  |  |  ------------------
  |  |  |  |   92|   211k|				 ((c) == 0xd))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (92:6): [True: 0, False: 130k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2832|   136k|    }
 2833|       |
 2834|       |    /*
 2835|       |     * Look if the element is mixed content in the DTD if available
 2836|       |     */
 2837|  17.3k|    if (ctxt->node == NULL) return(0);
  ------------------
  |  Branch (2837:9): [True: 0, False: 17.3k]
  ------------------
 2838|  17.3k|    if (ctxt->myDoc != NULL) {
  ------------------
  |  Branch (2838:9): [True: 17.3k, False: 0]
  ------------------
 2839|  17.3k|        xmlElementPtr elemDecl = NULL;
 2840|  17.3k|        xmlDocPtr doc = ctxt->myDoc;
 2841|  17.3k|        const xmlChar *prefix = NULL;
 2842|       |
 2843|  17.3k|        if (ctxt->node->ns)
  ------------------
  |  Branch (2843:13): [True: 2.65k, False: 14.6k]
  ------------------
 2844|  2.65k|            prefix = ctxt->node->ns->prefix;
 2845|  17.3k|        if (doc->intSubset != NULL)
  ------------------
  |  Branch (2845:13): [True: 11.9k, False: 5.38k]
  ------------------
 2846|  11.9k|            elemDecl = xmlHashLookup2(doc->intSubset->elements, ctxt->node->name,
 2847|  11.9k|                                      prefix);
 2848|  17.3k|        if ((elemDecl == NULL) && (doc->extSubset != NULL))
  ------------------
  |  Branch (2848:13): [True: 13.1k, False: 4.19k]
  |  Branch (2848:35): [True: 296, False: 12.8k]
  ------------------
 2849|    296|            elemDecl = xmlHashLookup2(doc->extSubset->elements, ctxt->node->name,
 2850|    296|                                      prefix);
 2851|  17.3k|        if (elemDecl != NULL) {
  ------------------
  |  Branch (2851:13): [True: 4.26k, False: 13.0k]
  ------------------
 2852|  4.26k|            if (elemDecl->etype == XML_ELEMENT_TYPE_ELEMENT)
  ------------------
  |  Branch (2852:17): [True: 2.97k, False: 1.29k]
  ------------------
 2853|  2.97k|                return(1);
 2854|  1.29k|            if ((elemDecl->etype == XML_ELEMENT_TYPE_ANY) ||
  ------------------
  |  Branch (2854:17): [True: 291, False: 1.00k]
  ------------------
 2855|  1.00k|                (elemDecl->etype == XML_ELEMENT_TYPE_MIXED))
  ------------------
  |  Branch (2855:17): [True: 265, False: 738]
  ------------------
 2856|    556|                return(0);
 2857|  1.29k|        }
 2858|  17.3k|    }
 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|  13.7k|    if ((RAW != '<') && (RAW != 0xD)) return(0);
  ------------------
  |  | 2224|  13.7k|#define RAW (*ctxt->input->cur)
  ------------------
                  if ((RAW != '<') && (RAW != 0xD)) return(0);
  ------------------
  |  | 2224|  4.64k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (2867:9): [True: 4.64k, False: 9.14k]
  |  Branch (2867:25): [True: 1.56k, False: 3.08k]
  ------------------
 2868|  12.2k|    if ((ctxt->node->children == NULL) &&
  ------------------
  |  Branch (2868:9): [True: 9.90k, False: 2.31k]
  ------------------
 2869|  9.90k|	(RAW == '<') && (NXT(1) == '/')) return(0);
  ------------------
  |  | 2224|  9.90k|#define RAW (*ctxt->input->cur)
  ------------------
              	(RAW == '<') && (NXT(1) == '/')) return(0);
  ------------------
  |  | 2226|  6.99k|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
  |  Branch (2869:2): [True: 6.99k, False: 2.91k]
  |  Branch (2869:18): [True: 389, False: 6.60k]
  ------------------
 2870|       |
 2871|  11.8k|    lastChild = xmlGetLastChild(ctxt->node);
 2872|  11.8k|    if (lastChild == NULL) {
  ------------------
  |  Branch (2872:9): [True: 9.51k, False: 2.31k]
  ------------------
 2873|  9.51k|        if ((ctxt->node->type != XML_ELEMENT_NODE) &&
  ------------------
  |  Branch (2873:13): [True: 0, False: 9.51k]
  ------------------
 2874|      0|            (ctxt->node->content != NULL)) return(0);
  ------------------
  |  Branch (2874:13): [True: 0, False: 0]
  ------------------
 2875|  9.51k|    } else if (xmlNodeIsText(lastChild))
  ------------------
  |  Branch (2875:16): [True: 325, False: 1.98k]
  ------------------
 2876|    325|        return(0);
 2877|  1.98k|    else if ((ctxt->node->children != NULL) &&
  ------------------
  |  Branch (2877:14): [True: 1.98k, False: 0]
  ------------------
 2878|  1.98k|             (xmlNodeIsText(ctxt->node->children)))
  ------------------
  |  Branch (2878:14): [True: 217, False: 1.77k]
  ------------------
 2879|    217|        return(0);
 2880|  11.2k|    return(1);
 2881|  11.8k|}
parser.c:xmlParseCharDataComplex:
 4660|  7.57M|xmlParseCharDataComplex(xmlParserCtxtPtr ctxt, int partial) {
 4661|  7.57M|    xmlChar buf[XML_PARSER_BIG_BUFFER_SIZE + 5];
 4662|  7.57M|    int nbchar = 0;
 4663|  7.57M|    int cur, l;
 4664|       |
 4665|  7.57M|    cur = xmlCurrentCharRecover(ctxt, &l);
 4666|  19.9M|    while ((cur != '<') && /* checked */
  ------------------
  |  Branch (4666:12): [True: 19.9M, False: 57.3k]
  ------------------
 4667|  19.9M|           (cur != '&') &&
  ------------------
  |  Branch (4667:12): [True: 19.9M, False: 5.33k]
  ------------------
 4668|  19.9M|	   (IS_CHAR(cur))) {
  ------------------
  |  |  115|  19.9M|#define IS_CHAR(c)   xmlIsCharQ(c)
  |  |  ------------------
  |  |  |  |  117|  19.9M|#define xmlIsCharQ(c)		(((c) < 0x100) ? \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (117:25): [True: 14.9M, False: 4.96M]
  |  |  |  |  ------------------
  |  |  |  |  118|  19.9M|				 xmlIsChar_ch((c)) :\
  |  |  |  |  ------------------
  |  |  |  |  |  |  108|  14.9M|#define xmlIsChar_ch(c)		(((0x9 <= (c)) && ((c) <= 0xa)) || \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (108:28): [True: 7.51M, False: 7.42M]
  |  |  |  |  |  |  |  Branch (108:44): [True: 2.92M, False: 4.58M]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  109|  14.9M|				 ((c) == 0xd) || \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (109:6): [True: 0, False: 12.0M]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  110|  14.9M|				  (0x20 <= (c)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (110:7): [True: 4.50M, False: 7.50M]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  119|  19.9M|				(((0x100 <= (c)) && ((c) <= 0xd7ff)) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (119:7): [True: 4.96M, False: 0]
  |  |  |  |  |  Branch (119:25): [True: 1.57M, False: 3.38M]
  |  |  |  |  ------------------
  |  |  |  |  120|  4.96M|				 ((0xe000 <= (c)) && ((c) <= 0xfffd)) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (120:7): [True: 3.38M, False: 0]
  |  |  |  |  |  Branch (120:26): [True: 3.38M, False: 7.67k]
  |  |  |  |  ------------------
  |  |  |  |  121|  4.96M|				 ((0x10000 <= (c)) && ((c) <= 0x10ffff))))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (121:7): [True: 5.48k, False: 2.18k]
  |  |  |  |  |  Branch (121:27): [True: 5.48k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (4668:5): [True: 12.3M, False: 7.51M]
  ------------------
 4669|  12.3M|        if (cur == ']') {
  ------------------
  |  Branch (4669:13): [True: 524k, False: 11.8M]
  ------------------
 4670|   524k|            size_t avail = ctxt->input->end - ctxt->input->cur;
 4671|       |
 4672|   524k|            if (partial && avail < 2)
  ------------------
  |  Branch (4672:17): [True: 517k, False: 7.58k]
  |  Branch (4672:28): [True: 41, False: 517k]
  ------------------
 4673|     41|                break;
 4674|   524k|            if (NXT(1) == ']') {
  ------------------
  |  | 2226|   524k|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
  |  Branch (4674:17): [True: 506k, False: 18.3k]
  ------------------
 4675|   506k|                if (partial && avail < 3)
  ------------------
  |  Branch (4675:21): [True: 504k, False: 1.72k]
  |  Branch (4675:32): [True: 1.16k, False: 503k]
  ------------------
 4676|  1.16k|                    break;
 4677|   505k|                if (NXT(2) == '>')
  ------------------
  |  | 2226|   505k|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
  |  Branch (4677:21): [True: 880, False: 504k]
  ------------------
 4678|    880|                    xmlFatalErr(ctxt, XML_ERR_MISPLACED_CDATA_END, NULL);
 4679|   505k|            }
 4680|   524k|        }
 4681|       |
 4682|  12.3M|	COPY_BUF(buf, nbchar, cur);
  ------------------
  |  | 2296|  12.3M|    if (v < 0x80) b[i++] = v;						\
  |  |  ------------------
  |  |  |  Branch (2296:9): [True: 4.95M, False: 7.43M]
  |  |  ------------------
  |  | 2297|  12.3M|    else i += xmlCopyCharMultiByte(&b[i],v)
  ------------------
 4683|       |	/* move current position before possible calling of ctxt->sax->characters */
 4684|  12.3M|	NEXTL(l);
  ------------------
  |  | 2288|  12.3M|#define NEXTL(l) do {							\
  |  | 2289|  12.3M|    if (*(ctxt->input->cur) == '\n') {					\
  |  |  ------------------
  |  |  |  Branch (2289:9): [True: 2.88M, False: 9.51M]
  |  |  ------------------
  |  | 2290|  2.88M|	ctxt->input->line++; ctxt->input->col = 1;			\
  |  | 2291|  9.51M|    } else ctxt->input->col++;						\
  |  | 2292|  12.3M|    ctxt->input->cur += l;				\
  |  | 2293|  12.3M|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2293:12): [Folded, False: 12.3M]
  |  |  ------------------
  ------------------
 4685|  12.3M|	if (nbchar >= XML_PARSER_BIG_BUFFER_SIZE) {
  ------------------
  |  |  171|  12.3M|#define XML_PARSER_BIG_BUFFER_SIZE 300
  ------------------
  |  Branch (4685:6): [True: 70.8k, False: 12.3M]
  ------------------
 4686|  70.8k|	    buf[nbchar] = 0;
 4687|       |
 4688|  70.8k|            xmlCharacters(ctxt, buf, nbchar, 0);
 4689|  70.8k|	    nbchar = 0;
 4690|  70.8k|            SHRINK;
  ------------------
  |  | 2267|  70.8k|    if (!PARSER_PROGRESSIVE(ctxt)) \
  |  |  ------------------
  |  |  |  |   47|  70.8k|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|  70.8k|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2267:9): [True: 55.7k, False: 15.0k]
  |  |  ------------------
  |  | 2268|  70.8k|	xmlParserShrink(ctxt);
  ------------------
 4691|  70.8k|	}
 4692|  12.3M|	cur = xmlCurrentCharRecover(ctxt, &l);
 4693|  12.3M|    }
 4694|  7.57M|    if (nbchar != 0) {
  ------------------
  |  Branch (4694:9): [True: 102k, False: 7.47M]
  ------------------
 4695|   102k|        buf[nbchar] = 0;
 4696|       |
 4697|   102k|        xmlCharacters(ctxt, buf, nbchar, 0);
 4698|   102k|    }
 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.57M|    if (ctxt->input->cur < ctxt->input->end) {
  ------------------
  |  Branch (4706:9): [True: 7.56M, False: 4.12k]
  ------------------
 4707|  7.56M|        if ((cur == 0) && (CUR != 0)) {
  ------------------
  |  | 2225|  7.33M|#define CUR (*ctxt->input->cur)
  ------------------
  |  Branch (4707:13): [True: 7.33M, False: 237k]
  |  Branch (4707:27): [True: 527, False: 7.33M]
  ------------------
 4708|    527|            if (partial == 0) {
  ------------------
  |  Branch (4708:17): [True: 426, False: 101]
  ------------------
 4709|    426|                xmlFatalErrMsgInt(ctxt, XML_ERR_INVALID_CHAR,
 4710|    426|                        "Incomplete UTF-8 sequence starting with %02X\n", CUR);
  ------------------
  |  | 2225|    426|#define CUR (*ctxt->input->cur)
  ------------------
 4711|    426|                NEXTL(1);
  ------------------
  |  | 2288|    426|#define NEXTL(l) do {							\
  |  | 2289|    426|    if (*(ctxt->input->cur) == '\n') {					\
  |  |  ------------------
  |  |  |  Branch (2289:9): [True: 0, False: 426]
  |  |  ------------------
  |  | 2290|      0|	ctxt->input->line++; ctxt->input->col = 1;			\
  |  | 2291|    426|    } else ctxt->input->col++;						\
  |  | 2292|    426|    ctxt->input->cur += l;				\
  |  | 2293|    426|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2293:12): [Folded, False: 426]
  |  |  ------------------
  ------------------
 4712|    426|            }
 4713|  7.56M|        } else if ((cur != '<') && (cur != '&') && (cur != ']')) {
  ------------------
  |  Branch (4713:20): [True: 7.51M, False: 57.3k]
  |  Branch (4713:36): [True: 7.50M, False: 5.33k]
  |  Branch (4713:52): [True: 7.50M, False: 1.20k]
  ------------------
 4714|       |            /* Generate the error and skip the offending character */
 4715|  7.50M|            xmlFatalErrMsgInt(ctxt, XML_ERR_INVALID_CHAR,
 4716|  7.50M|                              "PCDATA invalid Char value %d\n", cur);
 4717|  7.50M|            NEXTL(l);
  ------------------
  |  | 2288|  7.50M|#define NEXTL(l) do {							\
  |  | 2289|  7.50M|    if (*(ctxt->input->cur) == '\n') {					\
  |  |  ------------------
  |  |  |  Branch (2289:9): [True: 0, False: 7.50M]
  |  |  ------------------
  |  | 2290|      0|	ctxt->input->line++; ctxt->input->col = 1;			\
  |  | 2291|  7.50M|    } else ctxt->input->col++;						\
  |  | 2292|  7.50M|    ctxt->input->cur += l;				\
  |  | 2293|  7.50M|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2293:12): [Folded, False: 7.50M]
  |  |  ------------------
  ------------------
 4718|  7.50M|        }
 4719|  7.56M|    }
 4720|  7.57M|}
parser.c:xmlFatalErrMsgStr:
  348|   523k|{
  349|   523k|    xmlCtxtErr(ctxt, NULL, XML_FROM_PARSER, error, XML_ERR_FATAL,
  350|   523k|               val, NULL, NULL, 0, msg, val);
  351|   523k|}
parser.c:xmlParseCommentComplex:
 4819|   151k|                       size_t len, size_t size) {
 4820|   151k|    int q, ql;
 4821|   151k|    int r, rl;
 4822|   151k|    int cur, l;
 4823|   151k|    int maxLength = (ctxt->options & XML_PARSE_HUGE) ?
  ------------------
  |  Branch (4823:21): [True: 53.7k, False: 97.4k]
  ------------------
 4824|  53.7k|                    XML_MAX_HUGE_LENGTH :
  ------------------
  |  |   55|  53.7k|#define XML_MAX_HUGE_LENGTH 1000000000
  ------------------
 4825|   151k|                    XML_MAX_TEXT_LENGTH;
  ------------------
  |  |   50|  97.4k|#define XML_MAX_TEXT_LENGTH 10000000
  ------------------
 4826|       |
 4827|   151k|    if (buf == NULL) {
  ------------------
  |  Branch (4827:9): [True: 28.2k, False: 122k]
  ------------------
 4828|  28.2k|        len = 0;
 4829|  28.2k|	size = XML_PARSER_BUFFER_SIZE;
  ------------------
  |  |  172|  28.2k|#define XML_PARSER_BUFFER_SIZE 100
  ------------------
 4830|  28.2k|	buf = xmlMalloc(size);
 4831|  28.2k|	if (buf == NULL) {
  ------------------
  |  Branch (4831:6): [True: 1, False: 28.2k]
  ------------------
 4832|      1|	    xmlErrMemory(ctxt);
 4833|      1|	    return;
 4834|      1|	}
 4835|  28.2k|    }
 4836|   151k|    q = xmlCurrentCharRecover(ctxt, &ql);
 4837|   151k|    if (q == 0)
  ------------------
  |  Branch (4837:9): [True: 1.03k, False: 150k]
  ------------------
 4838|  1.03k|        goto not_terminated;
 4839|   150k|    if (!IS_CHAR(q)) {
  ------------------
  |  |  115|   150k|#define IS_CHAR(c)   xmlIsCharQ(c)
  |  |  ------------------
  |  |  |  |  117|   150k|#define xmlIsCharQ(c)		(((c) < 0x100) ? \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (117:25): [True: 91.7k, False: 58.3k]
  |  |  |  |  ------------------
  |  |  |  |  118|   150k|				 xmlIsChar_ch((c)) :\
  |  |  |  |  ------------------
  |  |  |  |  |  |  108|  91.7k|#define xmlIsChar_ch(c)		(((0x9 <= (c)) && ((c) <= 0xa)) || \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (108:28): [True: 91.3k, False: 382]
  |  |  |  |  |  |  |  Branch (108:44): [True: 87.7k, False: 3.65k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  109|  91.7k|				 ((c) == 0xd) || \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (109:6): [True: 0, False: 4.04k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  110|  91.7k|				  (0x20 <= (c)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (110:7): [True: 3.55k, False: 482]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  119|   150k|				(((0x100 <= (c)) && ((c) <= 0xd7ff)) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (119:7): [True: 58.3k, False: 0]
  |  |  |  |  |  Branch (119:25): [True: 2.38k, False: 55.9k]
  |  |  |  |  ------------------
  |  |  |  |  120|  58.3k|				 ((0xe000 <= (c)) && ((c) <= 0xfffd)) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (120:7): [True: 55.9k, False: 0]
  |  |  |  |  |  Branch (120:26): [True: 55.4k, False: 465]
  |  |  |  |  ------------------
  |  |  |  |  121|  58.3k|				 ((0x10000 <= (c)) && ((c) <= 0x10ffff))))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (121:7): [True: 267, False: 198]
  |  |  |  |  |  Branch (121:27): [True: 267, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (4839:9): [True: 680, False: 149k]
  ------------------
 4840|    680|        xmlFatalErrMsgInt(ctxt, XML_ERR_INVALID_CHAR,
 4841|    680|                          "xmlParseComment: invalid xmlChar value %d\n",
 4842|    680|	                  q);
 4843|    680|	xmlFree (buf);
 4844|    680|	return;
 4845|    680|    }
 4846|   149k|    NEXTL(ql);
  ------------------
  |  | 2288|   149k|#define NEXTL(l) do {							\
  |  | 2289|   149k|    if (*(ctxt->input->cur) == '\n') {					\
  |  |  ------------------
  |  |  |  Branch (2289:9): [True: 284, False: 149k]
  |  |  ------------------
  |  | 2290|    284|	ctxt->input->line++; ctxt->input->col = 1;			\
  |  | 2291|   149k|    } else ctxt->input->col++;						\
  |  | 2292|   149k|    ctxt->input->cur += l;				\
  |  | 2293|   149k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2293:12): [Folded, False: 149k]
  |  |  ------------------
  ------------------
 4847|   149k|    r = xmlCurrentCharRecover(ctxt, &rl);
 4848|   149k|    if (r == 0)
  ------------------
  |  Branch (4848:9): [True: 340, False: 149k]
  ------------------
 4849|    340|        goto not_terminated;
 4850|   149k|    if (!IS_CHAR(r)) {
  ------------------
  |  |  115|   149k|#define IS_CHAR(c)   xmlIsCharQ(c)
  |  |  ------------------
  |  |  |  |  117|   149k|#define xmlIsCharQ(c)		(((c) < 0x100) ? \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (117:25): [True: 110k, False: 38.1k]
  |  |  |  |  ------------------
  |  |  |  |  118|   149k|				 xmlIsChar_ch((c)) :\
  |  |  |  |  ------------------
  |  |  |  |  |  |  108|   110k|#define xmlIsChar_ch(c)		(((0x9 <= (c)) && ((c) <= 0xa)) || \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (108:28): [True: 110k, False: 267]
  |  |  |  |  |  |  |  Branch (108:44): [True: 96.0k, False: 14.5k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  109|   110k|				 ((c) == 0xd) || \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (109:6): [True: 0, False: 14.8k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  110|   110k|				  (0x20 <= (c)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (110:7): [True: 14.2k, False: 546]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  119|   149k|				(((0x100 <= (c)) && ((c) <= 0xd7ff)) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (119:7): [True: 38.1k, False: 0]
  |  |  |  |  |  Branch (119:25): [True: 1.33k, False: 36.8k]
  |  |  |  |  ------------------
  |  |  |  |  120|  38.1k|				 ((0xe000 <= (c)) && ((c) <= 0xfffd)) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (120:7): [True: 36.8k, False: 0]
  |  |  |  |  |  Branch (120:26): [True: 36.4k, False: 408]
  |  |  |  |  ------------------
  |  |  |  |  121|  38.1k|				 ((0x10000 <= (c)) && ((c) <= 0x10ffff))))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (121:7): [True: 193, False: 215]
  |  |  |  |  |  Branch (121:27): [True: 193, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (4850:9): [True: 761, False: 148k]
  ------------------
 4851|    761|        xmlFatalErrMsgInt(ctxt, XML_ERR_INVALID_CHAR,
 4852|    761|                          "xmlParseComment: invalid xmlChar value %d\n",
 4853|    761|	                  r);
 4854|    761|	xmlFree (buf);
 4855|    761|	return;
 4856|    761|    }
 4857|   148k|    NEXTL(rl);
  ------------------
  |  | 2288|   148k|#define NEXTL(l) do {							\
  |  | 2289|   148k|    if (*(ctxt->input->cur) == '\n') {					\
  |  |  ------------------
  |  |  |  Branch (2289:9): [True: 15.7k, False: 132k]
  |  |  ------------------
  |  | 2290|  15.7k|	ctxt->input->line++; ctxt->input->col = 1;			\
  |  | 2291|   132k|    } else ctxt->input->col++;						\
  |  | 2292|   148k|    ctxt->input->cur += l;				\
  |  | 2293|   148k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2293:12): [Folded, False: 148k]
  |  |  ------------------
  ------------------
 4858|   148k|    cur = xmlCurrentCharRecover(ctxt, &l);
 4859|   148k|    if (cur == 0)
  ------------------
  |  Branch (4859:9): [True: 717, False: 147k]
  ------------------
 4860|    717|        goto not_terminated;
 4861|  13.5M|    while (IS_CHAR(cur) && /* checked */
  ------------------
  |  |  115|  13.5M|#define IS_CHAR(c)   xmlIsCharQ(c)
  |  |  ------------------
  |  |  |  |  117|  27.0M|#define xmlIsCharQ(c)		(((c) < 0x100) ? \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (117:24): [True: 13.5M, False: 5.90k]
  |  |  |  |  |  Branch (117:25): [True: 11.5M, False: 2.00M]
  |  |  |  |  ------------------
  |  |  |  |  118|  27.0M|				 xmlIsChar_ch((c)) :\
  |  |  |  |  ------------------
  |  |  |  |  |  |  108|  11.5M|#define xmlIsChar_ch(c)		(((0x9 <= (c)) && ((c) <= 0xa)) || \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (108:28): [True: 11.5M, False: 5.60k]
  |  |  |  |  |  |  |  Branch (108:44): [True: 2.01M, False: 9.51M]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  109|  11.5M|				 ((c) == 0xd) || \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (109:6): [True: 0, False: 9.52M]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  110|  11.5M|				  (0x20 <= (c)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (110:7): [True: 9.51M, False: 5.67k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  119|  27.0M|				(((0x100 <= (c)) && ((c) <= 0xd7ff)) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (119:7): [True: 2.00M, False: 0]
  |  |  |  |  |  Branch (119:25): [True: 19.2k, False: 1.98M]
  |  |  |  |  ------------------
  |  |  |  |  120|  2.00M|				 ((0xe000 <= (c)) && ((c) <= 0xfffd)) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (120:7): [True: 1.98M, False: 0]
  |  |  |  |  |  Branch (120:26): [True: 1.98M, False: 527]
  |  |  |  |  ------------------
  |  |  |  |  121|  2.00M|				 ((0x10000 <= (c)) && ((c) <= 0x10ffff))))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (121:7): [True: 300, False: 227]
  |  |  |  |  |  Branch (121:27): [True: 300, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 4862|  13.5M|           ((cur != '>') ||
  ------------------
  |  Branch (4862:13): [True: 13.0M, False: 502k]
  ------------------
 4863|  13.3M|	    (r != '-') || (q != '-'))) {
  ------------------
  |  Branch (4863:6): [True: 337k, False: 165k]
  |  Branch (4863:20): [True: 23.4k, False: 141k]
  ------------------
 4864|  13.3M|	if ((r == '-') && (q == '-')) {
  ------------------
  |  Branch (4864:6): [True: 947k, False: 12.4M]
  |  Branch (4864:20): [True: 493k, False: 454k]
  ------------------
 4865|   493k|	    xmlFatalErr(ctxt, XML_ERR_HYPHEN_IN_COMMENT, NULL);
 4866|   493k|	}
 4867|  13.3M|	if (len + 5 >= size) {
  ------------------
  |  Branch (4867:6): [True: 48.7k, False: 13.3M]
  ------------------
 4868|  48.7k|	    xmlChar *tmp;
 4869|  48.7k|            int newSize;
 4870|       |
 4871|  48.7k|	    newSize = xmlGrowCapacity(size, 1, 1, maxLength);
 4872|  48.7k|            if (newSize < 0) {
  ------------------
  |  Branch (4872:17): [True: 0, False: 48.7k]
  ------------------
 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.7k|	    tmp = xmlRealloc(buf, newSize);
 4879|  48.7k|	    if (tmp == NULL) {
  ------------------
  |  Branch (4879:10): [True: 10, False: 48.7k]
  ------------------
 4880|     10|		xmlErrMemory(ctxt);
 4881|     10|		xmlFree(buf);
 4882|     10|		return;
 4883|     10|	    }
 4884|  48.7k|	    buf = tmp;
 4885|  48.7k|            size = newSize;
 4886|  48.7k|	}
 4887|  13.3M|	COPY_BUF(buf, len, q);
  ------------------
  |  | 2296|  13.3M|    if (v < 0x80) b[i++] = v;						\
  |  |  ------------------
  |  |  |  Branch (2296:9): [True: 10.9M, False: 2.40M]
  |  |  ------------------
  |  | 2297|  13.3M|    else i += xmlCopyCharMultiByte(&b[i],v)
  ------------------
 4888|       |
 4889|  13.3M|	q = r;
 4890|  13.3M|	ql = rl;
 4891|  13.3M|	r = cur;
 4892|  13.3M|	rl = l;
 4893|       |
 4894|  13.3M|	NEXTL(l);
  ------------------
  |  | 2288|  13.3M|#define NEXTL(l) do {							\
  |  | 2289|  13.3M|    if (*(ctxt->input->cur) == '\n') {					\
  |  |  ------------------
  |  |  |  Branch (2289:9): [True: 1.30M, False: 12.0M]
  |  |  ------------------
  |  | 2290|  1.30M|	ctxt->input->line++; ctxt->input->col = 1;			\
  |  | 2291|  12.0M|    } else ctxt->input->col++;						\
  |  | 2292|  13.3M|    ctxt->input->cur += l;				\
  |  | 2293|  13.3M|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2293:12): [Folded, False: 13.3M]
  |  |  ------------------
  ------------------
 4895|  13.3M|	cur = xmlCurrentCharRecover(ctxt, &l);
 4896|       |
 4897|  13.3M|    }
 4898|   147k|    buf[len] = 0;
 4899|   147k|    if (cur == 0) {
  ------------------
  |  Branch (4899:9): [True: 5.25k, False: 142k]
  ------------------
 4900|  5.25k|	xmlFatalErrMsgStr(ctxt, XML_ERR_COMMENT_NOT_FINISHED,
 4901|  5.25k|	                     "Comment not terminated \n<!--%.50s\n", buf);
 4902|   142k|    } else if (!IS_CHAR(cur)) {
  ------------------
  |  |  115|   142k|#define IS_CHAR(c)   xmlIsCharQ(c)
  |  |  ------------------
  |  |  |  |  117|   142k|#define xmlIsCharQ(c)		(((c) < 0x100) ? \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (117:25): [True: 142k, False: 227]
  |  |  |  |  ------------------
  |  |  |  |  118|   142k|				 xmlIsChar_ch((c)) :\
  |  |  |  |  ------------------
  |  |  |  |  |  |  108|   142k|#define xmlIsChar_ch(c)		(((0x9 <= (c)) && ((c) <= 0xa)) || \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (108:28): [True: 141k, False: 343]
  |  |  |  |  |  |  |  Branch (108:44): [True: 0, False: 141k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  109|   142k|				 ((c) == 0xd) || \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (109:6): [True: 0, False: 142k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  110|   142k|				  (0x20 <= (c)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (110:7): [True: 141k, False: 417]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  119|   142k|				(((0x100 <= (c)) && ((c) <= 0xd7ff)) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (119:7): [True: 227, False: 0]
  |  |  |  |  |  Branch (119:25): [True: 0, False: 227]
  |  |  |  |  ------------------
  |  |  |  |  120|    227|				 ((0xe000 <= (c)) && ((c) <= 0xfffd)) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (120:7): [True: 227, False: 0]
  |  |  |  |  |  Branch (120:26): [True: 0, False: 227]
  |  |  |  |  ------------------
  |  |  |  |  121|    227|				 ((0x10000 <= (c)) && ((c) <= 0x10ffff))))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (121:7): [True: 0, False: 227]
  |  |  |  |  |  Branch (121:27): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (4902:16): [True: 644, False: 141k]
  ------------------
 4903|    644|        xmlFatalErrMsgInt(ctxt, XML_ERR_INVALID_CHAR,
 4904|    644|                          "xmlParseComment: invalid xmlChar value %d\n",
 4905|    644|	                  cur);
 4906|   141k|    } else {
 4907|   141k|        NEXT;
  ------------------
  |  | 2279|   141k|#define NEXT xmlNextChar(ctxt)
  ------------------
 4908|   141k|	if ((ctxt->sax != NULL) && (ctxt->sax->comment != NULL) &&
  ------------------
  |  Branch (4908:6): [True: 141k, False: 0]
  |  Branch (4908:29): [True: 141k, False: 0]
  ------------------
 4909|   141k|	    (!ctxt->disableSAX))
  ------------------
  |  Branch (4909:6): [True: 131k, False: 10.5k]
  ------------------
 4910|   131k|	    ctxt->sax->comment(ctxt->userData, buf);
 4911|   141k|    }
 4912|   147k|    xmlFree(buf);
 4913|   147k|    return;
 4914|  2.08k|not_terminated:
 4915|  2.08k|    xmlFatalErrMsgStr(ctxt, XML_ERR_COMMENT_NOT_FINISHED,
 4916|       |			 "Comment not terminated\n", NULL);
 4917|  2.08k|    xmlFree(buf);
 4918|  2.08k|}
parser.c:xmlNsErr:
  384|   125k|{
  385|   125k|    ctxt->nsWellFormed = 0;
  386|       |
  387|       |    xmlCtxtErr(ctxt, NULL, XML_FROM_NAMESPACE, error, XML_ERR_ERROR,
  388|   125k|               info1, info2, info3, 0, msg, info1, info2, info3);
  389|   125k|}
parser.c:xmlSkipBlankCharsPE:
 2400|  1.14M|xmlSkipBlankCharsPE(xmlParserCtxtPtr ctxt) {
 2401|  1.14M|    int res = 0;
 2402|  1.14M|    int inParam;
 2403|  1.14M|    int expandParam;
 2404|       |
 2405|  1.14M|    inParam = PARSER_IN_PE(ctxt);
  ------------------
  |  |   50|  1.14M|    (((ctxt)->input->entity != NULL) && \
  |  |  ------------------
  |  |  |  Branch (50:6): [True: 961k, False: 187k]
  |  |  ------------------
  |  |   51|  1.14M|     (((ctxt)->input->entity->etype == XML_INTERNAL_PARAMETER_ENTITY) || \
  |  |  ------------------
  |  |  |  Branch (51:7): [True: 207k, False: 753k]
  |  |  ------------------
  |  |   52|   961k|      ((ctxt)->input->entity->etype == XML_EXTERNAL_PARAMETER_ENTITY)))
  |  |  ------------------
  |  |  |  Branch (52:7): [True: 753k, False: 0]
  |  |  ------------------
  ------------------
 2406|  1.14M|    expandParam = PARSER_EXTERNAL(ctxt);
  ------------------
  |  |   55|  1.14M|    (((ctxt)->inSubset == 2) || \
  |  |  ------------------
  |  |  |  Branch (55:6): [True: 204k, False: 943k]
  |  |  ------------------
  |  |   56|  1.14M|     (((ctxt)->input->entity != NULL) && \
  |  |  ------------------
  |  |  |  Branch (56:7): [True: 793k, False: 150k]
  |  |  ------------------
  |  |   57|   943k|      ((ctxt)->input->entity->etype == XML_EXTERNAL_PARAMETER_ENTITY)))
  |  |  ------------------
  |  |  |  Branch (57:7): [True: 751k, False: 42.1k]
  |  |  ------------------
  ------------------
 2407|       |
 2408|  1.14M|    if (!inParam && !expandParam)
  ------------------
  |  Branch (2408:9): [True: 187k, False: 961k]
  |  Branch (2408:21): [True: 150k, False: 37.2k]
  ------------------
 2409|   150k|        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|  2.42M|    while (PARSER_STOPPED(ctxt) == 0) {
  ------------------
  |  |   44|  2.42M|#define PARSER_STOPPED(ctxt) ((ctxt)->disableSAX > 1)
  ------------------
  |  Branch (2415:12): [True: 2.42M, False: 391]
  ------------------
 2416|  2.42M|        if (IS_BLANK_CH(CUR)) { /* CHECKED tstblanks.xml */
  ------------------
  |  |  137|  2.42M|#define IS_BLANK_CH(c)  xmlIsBlank_ch(c)
  |  |  ------------------
  |  |  |  |   90|  2.42M|#define xmlIsBlank_ch(c)	(((c) == 0x20) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (90:27): [True: 720k, False: 1.69M]
  |  |  |  |  ------------------
  |  |  |  |   91|  2.42M|				 ((0x9 <= (c)) && ((c) <= 0xa)) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (91:7): [True: 1.64M, False: 56.8k]
  |  |  |  |  |  Branch (91:23): [True: 633k, False: 1.00M]
  |  |  |  |  ------------------
  |  |  |  |   92|  2.42M|				 ((c) == 0xd))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (92:6): [True: 43.1k, False: 1.02M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2417|  1.39M|            NEXT;
  ------------------
  |  | 2279|  1.39M|#define NEXT xmlNextChar(ctxt)
  ------------------
 2418|  1.39M|        } else if (CUR == '%') {
  ------------------
  |  | 2225|  1.02M|#define CUR (*ctxt->input->cur)
  ------------------
  |  Branch (2418:20): [True: 80.0k, False: 942k]
  ------------------
 2419|  80.0k|            if ((expandParam == 0) ||
  ------------------
  |  Branch (2419:17): [True: 73, False: 79.9k]
  ------------------
 2420|  79.9k|                (IS_BLANK_CH(NXT(1))) || (NXT(1) == 0))
  ------------------
  |  |  137|  79.9k|#define IS_BLANK_CH(c)  xmlIsBlank_ch(c)
  |  |  ------------------
  |  |  |  |   90|  79.9k|#define xmlIsBlank_ch(c)	(((c) == 0x20) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (90:27): [True: 57.5k, False: 22.3k]
  |  |  |  |  ------------------
  |  |  |  |   91|  79.9k|				 ((0x9 <= (c)) && ((c) <= 0xa)) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (91:7): [True: 19.3k, False: 3.05k]
  |  |  |  |  |  Branch (91:23): [True: 757, False: 18.5k]
  |  |  |  |  ------------------
  |  |  |  |   92|  79.9k|				 ((c) == 0xd))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (92:6): [True: 325, False: 21.3k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                              (IS_BLANK_CH(NXT(1))) || (NXT(1) == 0))
  ------------------
  |  | 2226|  21.3k|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
  |  Branch (2420:42): [True: 3.05k, False: 18.2k]
  ------------------
 2421|  61.7k|                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|  18.2k|            xmlParsePERefInternal(ctxt, 0);
 2430|       |
 2431|  18.2k|            inParam = PARSER_IN_PE(ctxt);
  ------------------
  |  |   50|  18.2k|    (((ctxt)->input->entity != NULL) && \
  |  |  ------------------
  |  |  |  Branch (50:6): [True: 17.3k, False: 859]
  |  |  ------------------
  |  |   51|  18.2k|     (((ctxt)->input->entity->etype == XML_INTERNAL_PARAMETER_ENTITY) || \
  |  |  ------------------
  |  |  |  Branch (51:7): [True: 4.92k, False: 12.4k]
  |  |  ------------------
  |  |   52|  17.3k|      ((ctxt)->input->entity->etype == XML_EXTERNAL_PARAMETER_ENTITY)))
  |  |  ------------------
  |  |  |  Branch (52:7): [True: 12.4k, False: 0]
  |  |  ------------------
  ------------------
 2432|  18.2k|            expandParam = PARSER_EXTERNAL(ctxt);
  ------------------
  |  |   55|  18.2k|    (((ctxt)->inSubset == 2) || \
  |  |  ------------------
  |  |  |  Branch (55:6): [True: 3.88k, False: 14.3k]
  |  |  ------------------
  |  |   56|  18.2k|     (((ctxt)->input->entity != NULL) && \
  |  |  ------------------
  |  |  |  Branch (56:7): [True: 14.3k, False: 0]
  |  |  ------------------
  |  |   57|  14.3k|      ((ctxt)->input->entity->etype == XML_EXTERNAL_PARAMETER_ENTITY)))
  |  |  ------------------
  |  |  |  Branch (57:7): [True: 11.5k, False: 2.85k]
  |  |  ------------------
  ------------------
 2433|   942k|        } else if (CUR == 0) {
  ------------------
  |  | 2225|   942k|#define CUR (*ctxt->input->cur)
  ------------------
  |  Branch (2433:20): [True: 56.8k, False: 886k]
  ------------------
 2434|  56.8k|            if (inParam == 0)
  ------------------
  |  Branch (2434:17): [True: 108, False: 56.7k]
  ------------------
 2435|    108|                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|  56.7k|            if (ctxt->input->flags & XML_INPUT_MARKUP_DECL)
  ------------------
  |  |   42|  56.7k|#define XML_INPUT_MARKUP_DECL       (1u << 7)
  ------------------
  |  Branch (2442:17): [True: 50.1k, False: 6.63k]
  ------------------
 2443|  50.1k|                break;
 2444|       |
 2445|  6.63k|            xmlPopPE(ctxt);
 2446|       |
 2447|  6.63k|            inParam = PARSER_IN_PE(ctxt);
  ------------------
  |  |   50|  6.63k|    (((ctxt)->input->entity != NULL) && \
  |  |  ------------------
  |  |  |  Branch (50:6): [True: 4.56k, False: 2.07k]
  |  |  ------------------
  |  |   51|  6.63k|     (((ctxt)->input->entity->etype == XML_INTERNAL_PARAMETER_ENTITY) || \
  |  |  ------------------
  |  |  |  Branch (51:7): [True: 6, False: 4.55k]
  |  |  ------------------
  |  |   52|  4.56k|      ((ctxt)->input->entity->etype == XML_EXTERNAL_PARAMETER_ENTITY)))
  |  |  ------------------
  |  |  |  Branch (52:7): [True: 4.55k, False: 0]
  |  |  ------------------
  ------------------
 2448|  6.63k|            expandParam = PARSER_EXTERNAL(ctxt);
  ------------------
  |  |   55|  6.63k|    (((ctxt)->inSubset == 2) || \
  |  |  ------------------
  |  |  |  Branch (55:6): [True: 2.42k, False: 4.21k]
  |  |  ------------------
  |  |   56|  6.63k|     (((ctxt)->input->entity != NULL) && \
  |  |  ------------------
  |  |  |  Branch (56:7): [True: 4.21k, False: 1]
  |  |  ------------------
  |  |   57|  4.21k|      ((ctxt)->input->entity->etype == XML_EXTERNAL_PARAMETER_ENTITY)))
  |  |  ------------------
  |  |  |  Branch (57:7): [True: 4.21k, False: 0]
  |  |  ------------------
  ------------------
 2449|   886k|        } else {
 2450|   886k|            break;
 2451|   886k|        }
 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.42M|        if (res < INT_MAX)
  ------------------
  |  Branch (2460:13): [True: 1.42M, False: 0]
  ------------------
 2461|  1.42M|            res++;
 2462|  1.42M|    }
 2463|       |
 2464|   998k|    return(res);
 2465|  1.14M|}
parser.c:xmlValidityError:
  294|   214k|{
  295|   214k|    ctxt->valid = 0;
  296|       |
  297|   214k|    xmlCtxtErr(ctxt, NULL, XML_FROM_DTD, error, XML_ERR_ERROR,
  298|       |               str1, str2, NULL, 0, msg, str1, str2);
  299|   214k|}
parser.c:xmlAttrNormalizeSpace:
  988|  28.8k|{
  989|  28.8k|    if ((src == NULL) || (dst == NULL))
  ------------------
  |  Branch (989:9): [True: 0, False: 28.8k]
  |  Branch (989:26): [True: 0, False: 28.8k]
  ------------------
  990|      0|        return(NULL);
  991|       |
  992|  41.0k|    while (*src == 0x20) src++;
  ------------------
  |  Branch (992:12): [True: 12.2k, False: 28.8k]
  ------------------
  993|  3.08M|    while (*src != 0) {
  ------------------
  |  Branch (993:12): [True: 3.05M, False: 28.8k]
  ------------------
  994|  3.05M|	if (*src == 0x20) {
  ------------------
  |  Branch (994:6): [True: 35.4k, False: 3.01M]
  ------------------
  995|   355k|	    while (*src == 0x20) src++;
  ------------------
  |  Branch (995:13): [True: 319k, False: 35.4k]
  ------------------
  996|  35.4k|	    if (*src != 0)
  ------------------
  |  Branch (996:10): [True: 34.9k, False: 561]
  ------------------
  997|  34.9k|		*dst++ = 0x20;
  998|  3.01M|	} else {
  999|  3.01M|	    *dst++ = *src++;
 1000|  3.01M|	}
 1001|  3.05M|    }
 1002|  28.8k|    *dst = 0;
 1003|  28.8k|    if (dst == src)
  ------------------
  |  Branch (1003:9): [True: 23.6k, False: 5.21k]
  ------------------
 1004|  23.6k|       return(NULL);
 1005|  5.21k|    return(dst);
 1006|  28.8k|}
parser.c:xmlAddDefAttrs:
 1020|  22.7k|               const xmlChar *value) {
 1021|  22.7k|    xmlDefAttrsPtr defaults;
 1022|  22.7k|    xmlDefAttr *attr;
 1023|  22.7k|    int len, expandedSize;
 1024|  22.7k|    xmlHashedString name;
 1025|  22.7k|    xmlHashedString prefix;
 1026|  22.7k|    xmlHashedString hvalue;
 1027|  22.7k|    const xmlChar *localname;
 1028|       |
 1029|       |    /*
 1030|       |     * Allows to detect attribute redefinitions
 1031|       |     */
 1032|  22.7k|    if (ctxt->attsSpecial != NULL) {
  ------------------
  |  Branch (1032:9): [True: 20.4k, False: 2.32k]
  ------------------
 1033|  20.4k|        if (xmlHashLookup2(ctxt->attsSpecial, fullname, fullattr) != NULL)
  ------------------
  |  Branch (1033:13): [True: 14.1k, False: 6.31k]
  ------------------
 1034|  14.1k|	    return;
 1035|  20.4k|    }
 1036|       |
 1037|  8.64k|    if (ctxt->attsDefault == NULL) {
  ------------------
  |  Branch (1037:9): [True: 2.42k, False: 6.21k]
  ------------------
 1038|  2.42k|        ctxt->attsDefault = xmlHashCreateDict(10, ctxt->dict);
 1039|  2.42k|	if (ctxt->attsDefault == NULL)
  ------------------
  |  Branch (1039:6): [True: 3, False: 2.42k]
  ------------------
 1040|      3|	    goto mem_error;
 1041|  2.42k|    }
 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.64k|    localname = xmlSplitQName3(fullname, &len);
 1048|  8.64k|    if (localname == NULL) {
  ------------------
  |  Branch (1048:9): [True: 8.13k, False: 501]
  ------------------
 1049|  8.13k|        name = xmlDictLookupHashed(ctxt->dict, fullname, -1);
 1050|  8.13k|	prefix.name = NULL;
 1051|  8.13k|    } else {
 1052|    501|        name = xmlDictLookupHashed(ctxt->dict, localname, -1);
 1053|    501|	prefix = xmlDictLookupHashed(ctxt->dict, fullname, len);
 1054|    501|        if (prefix.name == NULL)
  ------------------
  |  Branch (1054:13): [True: 1, False: 500]
  ------------------
 1055|      1|            goto mem_error;
 1056|    501|    }
 1057|  8.63k|    if (name.name == NULL)
  ------------------
  |  Branch (1057:9): [True: 2, False: 8.63k]
  ------------------
 1058|      2|        goto mem_error;
 1059|       |
 1060|       |    /*
 1061|       |     * make sure there is some storage
 1062|       |     */
 1063|  8.63k|    defaults = xmlHashLookup2(ctxt->attsDefault, name.name, prefix.name);
 1064|  8.63k|    if ((defaults == NULL) ||
  ------------------
  |  Branch (1064:9): [True: 2.90k, False: 5.73k]
  ------------------
 1065|  5.73k|        (defaults->nbAttrs >= defaults->maxAttrs)) {
  ------------------
  |  Branch (1065:9): [True: 584, False: 5.15k]
  ------------------
 1066|  3.48k|        xmlDefAttrsPtr temp;
 1067|  3.48k|        int newSize;
 1068|       |
 1069|  3.48k|        if (defaults == NULL) {
  ------------------
  |  Branch (1069:13): [True: 2.90k, False: 584]
  ------------------
 1070|  2.90k|            newSize = 4;
 1071|  2.90k|        } else {
 1072|    584|            if ((defaults->maxAttrs >= XML_MAX_ATTRS) ||
  ------------------
  |  |   93|    584|#define XML_MAX_ATTRS 100000000 /* 100 million */
  ------------------
  |  Branch (1072:17): [True: 0, False: 584]
  ------------------
 1073|    584|                ((size_t) defaults->maxAttrs >
  ------------------
  |  Branch (1073:17): [True: 0, False: 584]
  ------------------
 1074|    584|                     SIZE_MAX / 2 / sizeof(temp[0]) - sizeof(*defaults)))
 1075|      0|                goto mem_error;
 1076|       |
 1077|    584|            if (defaults->maxAttrs > XML_MAX_ATTRS / 2)
  ------------------
  |  |   93|    584|#define XML_MAX_ATTRS 100000000 /* 100 million */
  ------------------
  |  Branch (1077:17): [True: 0, False: 584]
  ------------------
 1078|      0|                newSize = XML_MAX_ATTRS;
  ------------------
  |  |   93|      0|#define XML_MAX_ATTRS 100000000 /* 100 million */
  ------------------
 1079|    584|            else
 1080|    584|                newSize = defaults->maxAttrs * 2;
 1081|    584|        }
 1082|  3.48k|        temp = xmlRealloc(defaults,
 1083|  3.48k|                          sizeof(*defaults) + newSize * sizeof(xmlDefAttr));
 1084|  3.48k|	if (temp == NULL)
  ------------------
  |  Branch (1084:6): [True: 2, False: 3.48k]
  ------------------
 1085|      2|	    goto mem_error;
 1086|  3.48k|        if (defaults == NULL)
  ------------------
  |  Branch (1086:13): [True: 2.90k, False: 583]
  ------------------
 1087|  2.90k|            temp->nbAttrs = 0;
 1088|  3.48k|	temp->maxAttrs = newSize;
 1089|  3.48k|        defaults = temp;
 1090|  3.48k|	if (xmlHashUpdateEntry2(ctxt->attsDefault, name.name, prefix.name,
  ------------------
  |  Branch (1090:6): [True: 0, False: 3.48k]
  ------------------
 1091|  3.48k|	                        defaults, NULL) < 0) {
 1092|      0|	    xmlFree(defaults);
 1093|      0|	    goto mem_error;
 1094|      0|	}
 1095|  3.48k|    }
 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.63k|    localname = xmlSplitQName3(fullattr, &len);
 1102|  8.63k|    if (localname == NULL) {
  ------------------
  |  Branch (1102:9): [True: 6.08k, False: 2.55k]
  ------------------
 1103|  6.08k|        name = xmlDictLookupHashed(ctxt->dict, fullattr, -1);
 1104|  6.08k|	prefix.name = NULL;
 1105|  6.08k|    } else {
 1106|  2.55k|        name = xmlDictLookupHashed(ctxt->dict, localname, -1);
 1107|  2.55k|	prefix = xmlDictLookupHashed(ctxt->dict, fullattr, len);
 1108|  2.55k|        if (prefix.name == NULL)
  ------------------
  |  Branch (1108:13): [True: 1, False: 2.55k]
  ------------------
 1109|      1|            goto mem_error;
 1110|  2.55k|    }
 1111|  8.63k|    if (name.name == NULL)
  ------------------
  |  Branch (1111:9): [True: 1, False: 8.63k]
  ------------------
 1112|      1|        goto mem_error;
 1113|       |
 1114|       |    /* intern the string and precompute the end */
 1115|  8.63k|    len = strlen((const char *) value);
 1116|  8.63k|    hvalue = xmlDictLookupHashed(ctxt->dict, value, len);
 1117|  8.63k|    if (hvalue.name == NULL)
  ------------------
  |  Branch (1117:9): [True: 1, False: 8.63k]
  ------------------
 1118|      1|        goto mem_error;
 1119|       |
 1120|  8.63k|    expandedSize = strlen((const char *) name.name);
 1121|  8.63k|    if (prefix.name != NULL)
  ------------------
  |  Branch (1121:9): [True: 2.55k, False: 6.08k]
  ------------------
 1122|  2.55k|        expandedSize += strlen((const char *) prefix.name);
 1123|  8.63k|    expandedSize += len;
 1124|       |
 1125|  8.63k|    attr = &defaults->attrs[defaults->nbAttrs++];
 1126|  8.63k|    attr->name = name;
 1127|  8.63k|    attr->prefix = prefix;
 1128|  8.63k|    attr->value = hvalue;
 1129|  8.63k|    attr->valueEnd = hvalue.name + len;
 1130|  8.63k|    attr->external = PARSER_EXTERNAL(ctxt);
  ------------------
  |  |   55|  8.63k|    (((ctxt)->inSubset == 2) || \
  |  |  ------------------
  |  |  |  Branch (55:6): [True: 446, False: 8.18k]
  |  |  ------------------
  |  |   56|  8.63k|     (((ctxt)->input->entity != NULL) && \
  |  |  ------------------
  |  |  |  Branch (56:7): [True: 662, False: 7.52k]
  |  |  ------------------
  |  |   57|  8.18k|      ((ctxt)->input->entity->etype == XML_EXTERNAL_PARAMETER_ENTITY)))
  |  |  ------------------
  |  |  |  Branch (57:7): [True: 548, False: 114]
  |  |  ------------------
  ------------------
 1131|  8.63k|    attr->expandedSize = expandedSize;
 1132|       |
 1133|  8.63k|    return;
 1134|       |
 1135|     11|mem_error:
 1136|     11|    xmlErrMemory(ctxt);
 1137|     11|}
parser.c:xmlAddSpecialAttr:
 1152|  44.3k|{
 1153|  44.3k|    if (ctxt->attsSpecial == NULL) {
  ------------------
  |  Branch (1153:9): [True: 3.06k, False: 41.2k]
  ------------------
 1154|  3.06k|        ctxt->attsSpecial = xmlHashCreateDict(10, ctxt->dict);
 1155|  3.06k|	if (ctxt->attsSpecial == NULL)
  ------------------
  |  Branch (1155:6): [True: 4, False: 3.05k]
  ------------------
 1156|      4|	    goto mem_error;
 1157|  3.06k|    }
 1158|       |
 1159|  44.3k|    if (PARSER_EXTERNAL(ctxt))
  ------------------
  |  |   55|  44.3k|    (((ctxt)->inSubset == 2) || \
  |  |  ------------------
  |  |  |  Branch (55:6): [True: 16.3k, False: 27.9k]
  |  |  ------------------
  |  |   56|  44.3k|     (((ctxt)->input->entity != NULL) && \
  |  |  ------------------
  |  |  |  Branch (56:7): [True: 18.9k, False: 8.99k]
  |  |  ------------------
  |  |   57|  27.9k|      ((ctxt)->input->entity->etype == XML_EXTERNAL_PARAMETER_ENTITY)))
  |  |  ------------------
  |  |  |  Branch (57:7): [True: 13.5k, False: 5.44k]
  |  |  ------------------
  ------------------
 1160|  29.8k|        type |= XML_SPECIAL_EXTERNAL;
  ------------------
  |  |   95|  29.8k|#define XML_SPECIAL_EXTERNAL    (1 << 20)
  ------------------
 1161|       |
 1162|  44.3k|    if (xmlHashAdd2(ctxt->attsSpecial, fullname, fullattr,
  ------------------
  |  Branch (1162:9): [True: 1, False: 44.3k]
  ------------------
 1163|  44.3k|                    XML_INT_TO_PTR(type)) < 0)
  ------------------
  |  |   59|  44.3k|#define XML_INT_TO_PTR(i) ((void *) (XML_INTPTR_T) (i))
  ------------------
 1164|      1|        goto mem_error;
 1165|  44.3k|    return;
 1166|       |
 1167|  44.3k|mem_error:
 1168|      5|    xmlErrMemory(ctxt);
 1169|      5|}
parser.c:xmlSkipBlankCharsPEBalanced:
 6087|   443k|xmlSkipBlankCharsPEBalanced(xmlParserCtxt *ctxt, int openInputNr) {
 6088|   443k|    SKIP_BLANKS;
  ------------------
  |  | 2275|   443k|#define SKIP_BLANKS xmlSkipBlankChars(ctxt)
  ------------------
 6089|   443k|    GROW;
  ------------------
  |  | 2271|   443k|    if ((!PARSER_PROGRESSIVE(ctxt)) && \
  |  |  ------------------
  |  |  |  |   47|   443k|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|   443k|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2271:9): [True: 87.1k, False: 356k]
  |  |  ------------------
  |  | 2272|   443k|        (ctxt->input->end - ctxt->input->cur < INPUT_CHUNK)) \
  |  |  ------------------
  |  |  |  |   63|  87.1k|#define INPUT_CHUNK	250
  |  |  ------------------
  |  |  |  Branch (2272:9): [True: 59.1k, False: 27.9k]
  |  |  ------------------
  |  | 2273|   443k|	xmlParserGrow(ctxt);
  ------------------
 6090|       |
 6091|   443k|    (void) openInputNr;
 6092|       |
 6093|   443k|    if (!PARSER_EXTERNAL(ctxt) && !PARSER_IN_PE(ctxt))
  ------------------
  |  |   55|   887k|    (((ctxt)->inSubset == 2) || \
  |  |  ------------------
  |  |  |  Branch (55:6): [True: 20.6k, False: 423k]
  |  |  ------------------
  |  |   56|   887k|     (((ctxt)->input->entity != NULL) && \
  |  |  ------------------
  |  |  |  Branch (56:7): [True: 64.7k, False: 358k]
  |  |  ------------------
  |  |   57|   423k|      ((ctxt)->input->entity->etype == XML_EXTERNAL_PARAMETER_ENTITY)))
  |  |  ------------------
  |  |  |  Branch (57:7): [True: 37.8k, False: 26.8k]
  |  |  ------------------
  ------------------
                  if (!PARSER_EXTERNAL(ctxt) && !PARSER_IN_PE(ctxt))
  ------------------
  |  |   50|   385k|    (((ctxt)->input->entity != NULL) && \
  |  |  ------------------
  |  |  |  Branch (50:6): [True: 26.8k, False: 358k]
  |  |  ------------------
  |  |   51|   385k|     (((ctxt)->input->entity->etype == XML_INTERNAL_PARAMETER_ENTITY) || \
  |  |  ------------------
  |  |  |  Branch (51:7): [True: 26.8k, False: 0]
  |  |  ------------------
  |  |   52|  26.8k|      ((ctxt)->input->entity->etype == XML_EXTERNAL_PARAMETER_ENTITY)))
  |  |  ------------------
  |  |  |  Branch (52:7): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 6094|   358k|        return;
 6095|       |
 6096|  91.7k|    while (!PARSER_STOPPED(ctxt)) {
  ------------------
  |  |   44|  91.7k|#define PARSER_STOPPED(ctxt) ((ctxt)->disableSAX > 1)
  ------------------
  |  Branch (6096:12): [True: 91.3k, False: 397]
  ------------------
 6097|  91.3k|        if (ctxt->input->cur >= ctxt->input->end) {
  ------------------
  |  Branch (6097:13): [True: 2.48k, False: 88.8k]
  ------------------
 6098|  2.48k|#ifdef LIBXML_VALID_ENABLED
 6099|  2.48k|            if ((ctxt->validate) && (ctxt->inputNr <= openInputNr)) {
  ------------------
  |  Branch (6099:17): [True: 1.81k, False: 678]
  |  Branch (6099:37): [True: 630, False: 1.18k]
  ------------------
 6100|    630|                xmlValidityError(ctxt, XML_ERR_ENTITY_BOUNDARY,
 6101|    630|                                 "Element content declaration doesn't start "
 6102|    630|                                 "and stop in the same entity\n",
 6103|    630|                                 NULL, NULL);
 6104|    630|            }
 6105|  2.48k|#endif
 6106|  2.48k|            if (PARSER_IN_PE(ctxt))
  ------------------
  |  |   50|  2.48k|    (((ctxt)->input->entity != NULL) && \
  |  |  ------------------
  |  |  |  Branch (50:6): [True: 2.44k, False: 40]
  |  |  ------------------
  |  |   51|  2.48k|     (((ctxt)->input->entity->etype == XML_INTERNAL_PARAMETER_ENTITY) || \
  |  |  ------------------
  |  |  |  Branch (51:7): [True: 1.15k, False: 1.29k]
  |  |  ------------------
  |  |   52|  2.44k|      ((ctxt)->input->entity->etype == XML_EXTERNAL_PARAMETER_ENTITY)))
  |  |  ------------------
  |  |  |  Branch (52:7): [True: 1.29k, False: 0]
  |  |  ------------------
  ------------------
 6107|  2.44k|                xmlPopPE(ctxt);
 6108|     40|            else
 6109|     40|                break;
 6110|  88.8k|        } else if (RAW == '%') {
  ------------------
  |  | 2224|  88.8k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (6110:20): [True: 3.86k, False: 84.9k]
  ------------------
 6111|  3.86k|            xmlParsePERefInternal(ctxt, 0);
 6112|  84.9k|        } else {
 6113|  84.9k|            break;
 6114|  84.9k|        }
 6115|       |
 6116|  6.31k|        SKIP_BLANKS;
  ------------------
  |  | 2275|  6.31k|#define SKIP_BLANKS xmlSkipBlankChars(ctxt)
  ------------------
 6117|  6.31k|        GROW;
  ------------------
  |  | 2271|  6.31k|    if ((!PARSER_PROGRESSIVE(ctxt)) && \
  |  |  ------------------
  |  |  |  |   47|  6.31k|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|  6.31k|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2271:9): [True: 5.88k, False: 425]
  |  |  ------------------
  |  | 2272|  6.31k|        (ctxt->input->end - ctxt->input->cur < INPUT_CHUNK)) \
  |  |  ------------------
  |  |  |  |   63|  5.88k|#define INPUT_CHUNK	250
  |  |  ------------------
  |  |  |  Branch (2272:9): [True: 4.42k, False: 1.46k]
  |  |  ------------------
  |  | 2273|  6.31k|	xmlParserGrow(ctxt);
  ------------------
 6118|  6.31k|    }
 6119|  85.4k|}
parser.c:xmlParseElementChildrenContentDeclPriv:
 6271|  68.9k|                                       int depth) {
 6272|  68.9k|    int maxDepth = (ctxt->options & XML_PARSE_HUGE) ? 2048 : 256;
  ------------------
  |  Branch (6272:20): [True: 57.3k, False: 11.5k]
  ------------------
 6273|  68.9k|    xmlElementContentPtr ret = NULL, cur = NULL, last = NULL, op = NULL;
 6274|  68.9k|    const xmlChar *elem;
 6275|  68.9k|    xmlChar type = 0;
 6276|       |
 6277|  68.9k|    if (depth > maxDepth) {
  ------------------
  |  Branch (6277:9): [True: 2, False: 68.9k]
  ------------------
 6278|      2|        xmlFatalErrMsgInt(ctxt, XML_ERR_RESOURCE_LIMIT,
 6279|      2|                "xmlParseElementChildrenContentDecl : depth %d too deep, "
 6280|      2|                "use XML_PARSE_HUGE\n", depth);
 6281|      2|	return(NULL);
 6282|      2|    }
 6283|  68.9k|    xmlSkipBlankCharsPEBalanced(ctxt, openInputNr);
 6284|  68.9k|    if (RAW == '(') {
  ------------------
  |  | 2224|  68.9k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (6284:9): [True: 30.9k, False: 37.9k]
  ------------------
 6285|  30.9k|        int newInputNr = ctxt->inputNr;
 6286|       |
 6287|       |        /* Recurse on first child */
 6288|  30.9k|	NEXT;
  ------------------
  |  | 2279|  30.9k|#define NEXT xmlNextChar(ctxt)
  ------------------
 6289|  30.9k|        cur = ret = xmlParseElementChildrenContentDeclPriv(ctxt, newInputNr,
 6290|  30.9k|                                                           depth + 1);
 6291|  30.9k|        if (cur == NULL)
  ------------------
  |  Branch (6291:13): [True: 28.1k, False: 2.82k]
  ------------------
 6292|  28.1k|            return(NULL);
 6293|  37.9k|    } else {
 6294|  37.9k|	elem = xmlParseName(ctxt);
 6295|  37.9k|	if (elem == NULL) {
  ------------------
  |  Branch (6295:6): [True: 407, False: 37.5k]
  ------------------
 6296|    407|	    xmlFatalErr(ctxt, XML_ERR_ELEMCONTENT_NOT_STARTED, NULL);
 6297|    407|	    return(NULL);
 6298|    407|	}
 6299|  37.5k|        cur = ret = xmlNewDocElementContent(ctxt->myDoc, elem, XML_ELEMENT_CONTENT_ELEMENT);
 6300|  37.5k|	if (cur == NULL) {
  ------------------
  |  Branch (6300:6): [True: 4, False: 37.5k]
  ------------------
 6301|      4|	    xmlErrMemory(ctxt);
 6302|      4|	    return(NULL);
 6303|      4|	}
 6304|  37.5k|	GROW;
  ------------------
  |  | 2271|  37.5k|    if ((!PARSER_PROGRESSIVE(ctxt)) && \
  |  |  ------------------
  |  |  |  |   47|  37.5k|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|  37.5k|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2271:9): [True: 6.74k, False: 30.7k]
  |  |  ------------------
  |  | 2272|  37.5k|        (ctxt->input->end - ctxt->input->cur < INPUT_CHUNK)) \
  |  |  ------------------
  |  |  |  |   63|  6.74k|#define INPUT_CHUNK	250
  |  |  ------------------
  |  |  |  Branch (2272:9): [True: 3.87k, False: 2.87k]
  |  |  ------------------
  |  | 2273|  37.5k|	xmlParserGrow(ctxt);
  ------------------
 6305|  37.5k|	if (RAW == '?') {
  ------------------
  |  | 2224|  37.5k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (6305:6): [True: 1.39k, False: 36.1k]
  ------------------
 6306|  1.39k|	    cur->ocur = XML_ELEMENT_CONTENT_OPT;
 6307|  1.39k|	    NEXT;
  ------------------
  |  | 2279|  1.39k|#define NEXT xmlNextChar(ctxt)
  ------------------
 6308|  36.1k|	} else if (RAW == '*') {
  ------------------
  |  | 2224|  36.1k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (6308:13): [True: 1.31k, False: 34.8k]
  ------------------
 6309|  1.31k|	    cur->ocur = XML_ELEMENT_CONTENT_MULT;
 6310|  1.31k|	    NEXT;
  ------------------
  |  | 2279|  1.31k|#define NEXT xmlNextChar(ctxt)
  ------------------
 6311|  34.8k|	} else if (RAW == '+') {
  ------------------
  |  | 2224|  34.8k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (6311:13): [True: 457, False: 34.3k]
  ------------------
 6312|    457|	    cur->ocur = XML_ELEMENT_CONTENT_PLUS;
 6313|    457|	    NEXT;
  ------------------
  |  | 2279|    457|#define NEXT xmlNextChar(ctxt)
  ------------------
 6314|  34.3k|	} else {
 6315|  34.3k|	    cur->ocur = XML_ELEMENT_CONTENT_ONCE;
 6316|  34.3k|	}
 6317|  37.5k|	GROW;
  ------------------
  |  | 2271|  37.5k|    if ((!PARSER_PROGRESSIVE(ctxt)) && \
  |  |  ------------------
  |  |  |  |   47|  37.5k|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|  37.5k|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2271:9): [True: 6.74k, False: 30.7k]
  |  |  ------------------
  |  | 2272|  37.5k|        (ctxt->input->end - ctxt->input->cur < INPUT_CHUNK)) \
  |  |  ------------------
  |  |  |  |   63|  6.74k|#define INPUT_CHUNK	250
  |  |  ------------------
  |  |  |  Branch (2272:9): [True: 3.87k, False: 2.87k]
  |  |  ------------------
  |  | 2273|  37.5k|	xmlParserGrow(ctxt);
  ------------------
 6318|  37.5k|    }
 6319|   176k|    while (!PARSER_STOPPED(ctxt)) {
  ------------------
  |  |   44|   176k|#define PARSER_STOPPED(ctxt) ((ctxt)->disableSAX > 1)
  ------------------
  |  Branch (6319:12): [True: 174k, False: 2.57k]
  ------------------
 6320|   174k|        xmlSkipBlankCharsPEBalanced(ctxt, openInputNr);
 6321|   174k|        if (RAW == ')')
  ------------------
  |  | 2224|   174k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (6321:13): [True: 35.5k, False: 138k]
  ------------------
 6322|  35.5k|            break;
 6323|       |        /*
 6324|       |	 * Each loop we parse one separator and one element.
 6325|       |	 */
 6326|   138k|        if (RAW == ',') {
  ------------------
  |  | 2224|   138k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (6326:13): [True: 77.8k, False: 60.9k]
  ------------------
 6327|  77.8k|	    if (type == 0) type = CUR;
  ------------------
  |  | 2225|  8.32k|#define CUR (*ctxt->input->cur)
  ------------------
  |  Branch (6327:10): [True: 8.32k, False: 69.5k]
  ------------------
 6328|       |
 6329|       |	    /*
 6330|       |	     * Detect "Name | Name , Name" error
 6331|       |	     */
 6332|  69.5k|	    else if (type != CUR) {
  ------------------
  |  | 2225|  69.5k|#define CUR (*ctxt->input->cur)
  ------------------
  |  Branch (6332:15): [True: 2, False: 69.5k]
  ------------------
 6333|      2|		xmlFatalErrMsgInt(ctxt, XML_ERR_SEPARATOR_REQUIRED,
 6334|      2|		    "xmlParseElementChildrenContentDecl : '%c' expected\n",
 6335|      2|		                  type);
 6336|      2|		if ((last != NULL) && (last != ret))
  ------------------
  |  Branch (6336:7): [True: 2, False: 0]
  |  Branch (6336:25): [True: 2, False: 0]
  ------------------
 6337|      2|		    xmlFreeDocElementContent(ctxt->myDoc, last);
 6338|      2|		if (ret != NULL)
  ------------------
  |  Branch (6338:7): [True: 2, False: 0]
  ------------------
 6339|      2|		    xmlFreeDocElementContent(ctxt->myDoc, ret);
 6340|      2|		return(NULL);
 6341|      2|	    }
 6342|  77.8k|	    NEXT;
  ------------------
  |  | 2279|  77.8k|#define NEXT xmlNextChar(ctxt)
  ------------------
 6343|       |
 6344|  77.8k|	    op = xmlNewDocElementContent(ctxt->myDoc, NULL, XML_ELEMENT_CONTENT_SEQ);
 6345|  77.8k|	    if (op == NULL) {
  ------------------
  |  Branch (6345:10): [True: 3, False: 77.8k]
  ------------------
 6346|      3|                xmlErrMemory(ctxt);
 6347|      3|		if ((last != NULL) && (last != ret))
  ------------------
  |  Branch (6347:7): [True: 2, False: 1]
  |  Branch (6347:25): [True: 2, False: 0]
  ------------------
 6348|      2|		    xmlFreeDocElementContent(ctxt->myDoc, last);
 6349|      3|	        xmlFreeDocElementContent(ctxt->myDoc, ret);
 6350|      3|		return(NULL);
 6351|      3|	    }
 6352|  77.8k|	    if (last == NULL) {
  ------------------
  |  Branch (6352:10): [True: 8.32k, False: 69.5k]
  ------------------
 6353|  8.32k|		op->c1 = ret;
 6354|  8.32k|		if (ret != NULL)
  ------------------
  |  Branch (6354:7): [True: 8.32k, False: 0]
  ------------------
 6355|  8.32k|		    ret->parent = op;
 6356|  8.32k|		ret = cur = op;
 6357|  69.5k|	    } else {
 6358|  69.5k|	        cur->c2 = op;
 6359|  69.5k|		if (op != NULL)
  ------------------
  |  Branch (6359:7): [True: 69.5k, False: 0]
  ------------------
 6360|  69.5k|		    op->parent = cur;
 6361|  69.5k|		op->c1 = last;
 6362|  69.5k|		if (last != NULL)
  ------------------
  |  Branch (6362:7): [True: 69.5k, False: 0]
  ------------------
 6363|  69.5k|		    last->parent = op;
 6364|  69.5k|		cur =op;
 6365|  69.5k|		last = NULL;
 6366|  69.5k|	    }
 6367|  77.8k|	} else if (RAW == '|') {
  ------------------
  |  | 2224|  60.9k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (6367:13): [True: 59.1k, False: 1.77k]
  ------------------
 6368|  59.1k|	    if (type == 0) type = CUR;
  ------------------
  |  | 2225|  19.9k|#define CUR (*ctxt->input->cur)
  ------------------
  |  Branch (6368:10): [True: 19.9k, 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|  59.1k|	    NEXT;
  ------------------
  |  | 2279|  59.1k|#define NEXT xmlNextChar(ctxt)
  ------------------
 6384|       |
 6385|  59.1k|	    op = xmlNewDocElementContent(ctxt->myDoc, NULL, XML_ELEMENT_CONTENT_OR);
 6386|  59.1k|	    if (op == NULL) {
  ------------------
  |  Branch (6386:10): [True: 2, False: 59.1k]
  ------------------
 6387|      2|                xmlErrMemory(ctxt);
 6388|      2|		if ((last != NULL) && (last != ret))
  ------------------
  |  Branch (6388:7): [True: 1, False: 1]
  |  Branch (6388:25): [True: 1, False: 0]
  ------------------
 6389|      1|		    xmlFreeDocElementContent(ctxt->myDoc, last);
 6390|      2|		if (ret != NULL)
  ------------------
  |  Branch (6390:7): [True: 2, False: 0]
  ------------------
 6391|      2|		    xmlFreeDocElementContent(ctxt->myDoc, ret);
 6392|      2|		return(NULL);
 6393|      2|	    }
 6394|  59.1k|	    if (last == NULL) {
  ------------------
  |  Branch (6394:10): [True: 19.9k, False: 39.1k]
  ------------------
 6395|  19.9k|		op->c1 = ret;
 6396|  19.9k|		if (ret != NULL)
  ------------------
  |  Branch (6396:7): [True: 19.9k, False: 0]
  ------------------
 6397|  19.9k|		    ret->parent = op;
 6398|  19.9k|		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|  59.1k|	} else {
 6410|  1.77k|	    xmlFatalErr(ctxt, XML_ERR_ELEMCONTENT_NOT_FINISHED, NULL);
 6411|  1.77k|	    if ((last != NULL) && (last != ret))
  ------------------
  |  Branch (6411:10): [True: 779, False: 997]
  |  Branch (6411:28): [True: 779, False: 0]
  ------------------
 6412|    779|	        xmlFreeDocElementContent(ctxt->myDoc, last);
 6413|  1.77k|	    if (ret != NULL)
  ------------------
  |  Branch (6413:10): [True: 1.77k, False: 0]
  ------------------
 6414|  1.77k|		xmlFreeDocElementContent(ctxt->myDoc, ret);
 6415|  1.77k|	    return(NULL);
 6416|  1.77k|	}
 6417|   136k|        xmlSkipBlankCharsPEBalanced(ctxt, openInputNr);
 6418|   136k|        if (RAW == '(') {
  ------------------
  |  | 2224|   136k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (6418:13): [True: 28.5k, False: 108k]
  ------------------
 6419|  28.5k|            int newInputNr = ctxt->inputNr;
 6420|       |
 6421|       |	    /* Recurse on second child */
 6422|  28.5k|	    NEXT;
  ------------------
  |  | 2279|  28.5k|#define NEXT xmlNextChar(ctxt)
  ------------------
 6423|  28.5k|	    last = xmlParseElementChildrenContentDeclPriv(ctxt, newInputNr,
 6424|  28.5k|                                                          depth + 1);
 6425|  28.5k|            if (last == NULL) {
  ------------------
  |  Branch (6425:17): [True: 316, False: 28.2k]
  ------------------
 6426|    316|		if (ret != NULL)
  ------------------
  |  Branch (6426:7): [True: 316, False: 0]
  ------------------
 6427|    316|		    xmlFreeDocElementContent(ctxt->myDoc, ret);
 6428|    316|		return(NULL);
 6429|    316|            }
 6430|   108k|	} else {
 6431|   108k|	    elem = xmlParseName(ctxt);
 6432|   108k|	    if (elem == NULL) {
  ------------------
  |  Branch (6432:10): [True: 150, False: 108k]
  ------------------
 6433|    150|		xmlFatalErr(ctxt, XML_ERR_ELEMCONTENT_NOT_STARTED, NULL);
 6434|    150|		if (ret != NULL)
  ------------------
  |  Branch (6434:7): [True: 150, False: 0]
  ------------------
 6435|    150|		    xmlFreeDocElementContent(ctxt->myDoc, ret);
 6436|    150|		return(NULL);
 6437|    150|	    }
 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: 12.7k, False: 95.4k]
  ------------------
 6446|  12.7k|		last->ocur = XML_ELEMENT_CONTENT_OPT;
 6447|  12.7k|		NEXT;
  ------------------
  |  | 2279|  12.7k|#define NEXT xmlNextChar(ctxt)
  ------------------
 6448|  95.4k|	    } else if (RAW == '*') {
  ------------------
  |  | 2224|  95.4k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (6448:17): [True: 9.25k, False: 86.2k]
  ------------------
 6449|  9.25k|		last->ocur = XML_ELEMENT_CONTENT_MULT;
 6450|  9.25k|		NEXT;
  ------------------
  |  | 2279|  9.25k|#define NEXT xmlNextChar(ctxt)
  ------------------
 6451|  86.2k|	    } else if (RAW == '+') {
  ------------------
  |  | 2224|  86.2k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (6451:17): [True: 8.58k, False: 77.6k]
  ------------------
 6452|  8.58k|		last->ocur = XML_ELEMENT_CONTENT_PLUS;
 6453|  8.58k|		NEXT;
  ------------------
  |  | 2279|  8.58k|#define NEXT xmlNextChar(ctxt)
  ------------------
 6454|  77.6k|	    } else {
 6455|  77.6k|		last->ocur = XML_ELEMENT_CONTENT_ONCE;
 6456|  77.6k|	    }
 6457|   108k|	}
 6458|   136k|    }
 6459|  38.0k|    if ((cur != NULL) && (last != NULL)) {
  ------------------
  |  Branch (6459:9): [True: 38.0k, False: 0]
  |  Branch (6459:26): [True: 27.0k, False: 11.0k]
  ------------------
 6460|  27.0k|        cur->c2 = last;
 6461|  27.0k|	if (last != NULL)
  ------------------
  |  Branch (6461:6): [True: 27.0k, False: 0]
  ------------------
 6462|  27.0k|	    last->parent = cur;
 6463|  27.0k|    }
 6464|  38.0k|#ifdef LIBXML_VALID_ENABLED
 6465|  38.0k|    if ((ctxt->validate) && (ctxt->inputNr > openInputNr)) {
  ------------------
  |  Branch (6465:9): [True: 34.1k, False: 3.90k]
  |  Branch (6465:29): [True: 82, False: 34.0k]
  ------------------
 6466|     82|        xmlValidityError(ctxt, XML_ERR_ENTITY_BOUNDARY,
 6467|     82|                         "Element content declaration doesn't start "
 6468|     82|                         "and stop in the same entity\n",
 6469|     82|                         NULL, NULL);
 6470|     82|    }
 6471|  38.0k|#endif
 6472|  38.0k|    NEXT;
  ------------------
  |  | 2279|  38.0k|#define NEXT xmlNextChar(ctxt)
  ------------------
 6473|  38.0k|    if (RAW == '?') {
  ------------------
  |  | 2224|  38.0k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (6473:9): [True: 6.27k, False: 31.8k]
  ------------------
 6474|  6.27k|	if (ret != NULL) {
  ------------------
  |  Branch (6474:6): [True: 6.27k, False: 0]
  ------------------
 6475|  6.27k|	    if ((ret->ocur == XML_ELEMENT_CONTENT_PLUS) ||
  ------------------
  |  Branch (6475:10): [True: 100, False: 6.17k]
  ------------------
 6476|  6.17k|	        (ret->ocur == XML_ELEMENT_CONTENT_MULT))
  ------------------
  |  Branch (6476:10): [True: 72, False: 6.10k]
  ------------------
 6477|    172|	        ret->ocur = XML_ELEMENT_CONTENT_MULT;
 6478|  6.10k|	    else
 6479|  6.10k|	        ret->ocur = XML_ELEMENT_CONTENT_OPT;
 6480|  6.27k|	}
 6481|  6.27k|	NEXT;
  ------------------
  |  | 2279|  6.27k|#define NEXT xmlNextChar(ctxt)
  ------------------
 6482|  31.8k|    } else if (RAW == '*') {
  ------------------
  |  | 2224|  31.8k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (6482:16): [True: 14.5k, False: 17.2k]
  ------------------
 6483|  14.5k|	if (ret != NULL) {
  ------------------
  |  Branch (6483:6): [True: 14.5k, False: 0]
  ------------------
 6484|  14.5k|	    ret->ocur = XML_ELEMENT_CONTENT_MULT;
 6485|  14.5k|	    cur = ret;
 6486|       |	    /*
 6487|       |	     * Some normalization:
 6488|       |	     * (a | b* | c?)* == (a | b | c)*
 6489|       |	     */
 6490|  51.9k|	    while ((cur != NULL) && (cur->type == XML_ELEMENT_CONTENT_OR)) {
  ------------------
  |  Branch (6490:13): [True: 51.9k, False: 0]
  |  Branch (6490:30): [True: 37.3k, False: 14.5k]
  ------------------
 6491|  37.3k|		if ((cur->c1 != NULL) &&
  ------------------
  |  Branch (6491:7): [True: 37.3k, False: 0]
  ------------------
 6492|  37.3k|	            ((cur->c1->ocur == XML_ELEMENT_CONTENT_OPT) ||
  ------------------
  |  Branch (6492:15): [True: 605, False: 36.7k]
  ------------------
 6493|  36.7k|		     (cur->c1->ocur == XML_ELEMENT_CONTENT_MULT)))
  ------------------
  |  Branch (6493:8): [True: 1.46k, False: 35.2k]
  ------------------
 6494|  2.07k|		    cur->c1->ocur = XML_ELEMENT_CONTENT_ONCE;
 6495|  37.3k|		if ((cur->c2 != NULL) &&
  ------------------
  |  Branch (6495:7): [True: 37.3k, False: 0]
  ------------------
 6496|  37.3k|	            ((cur->c2->ocur == XML_ELEMENT_CONTENT_OPT) ||
  ------------------
  |  Branch (6496:15): [True: 285, False: 37.0k]
  ------------------
 6497|  37.0k|		     (cur->c2->ocur == XML_ELEMENT_CONTENT_MULT)))
  ------------------
  |  Branch (6497:8): [True: 50, False: 37.0k]
  ------------------
 6498|    335|		    cur->c2->ocur = XML_ELEMENT_CONTENT_ONCE;
 6499|  37.3k|		cur = cur->c2;
 6500|  37.3k|	    }
 6501|  14.5k|	}
 6502|  14.5k|	NEXT;
  ------------------
  |  | 2279|  14.5k|#define NEXT xmlNextChar(ctxt)
  ------------------
 6503|  17.2k|    } else if (RAW == '+') {
  ------------------
  |  | 2224|  17.2k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (6503:16): [True: 5.56k, False: 11.6k]
  ------------------
 6504|  5.56k|	if (ret != NULL) {
  ------------------
  |  Branch (6504:6): [True: 5.56k, False: 0]
  ------------------
 6505|  5.56k|	    int found = 0;
 6506|       |
 6507|  5.56k|	    if ((ret->ocur == XML_ELEMENT_CONTENT_OPT) ||
  ------------------
  |  Branch (6507:10): [True: 285, False: 5.27k]
  ------------------
 6508|  5.27k|	        (ret->ocur == XML_ELEMENT_CONTENT_MULT))
  ------------------
  |  Branch (6508:10): [True: 74, False: 5.20k]
  ------------------
 6509|    359|	        ret->ocur = XML_ELEMENT_CONTENT_MULT;
 6510|  5.20k|	    else
 6511|  5.20k|	        ret->ocur = XML_ELEMENT_CONTENT_PLUS;
 6512|       |	    /*
 6513|       |	     * Some normalization:
 6514|       |	     * (a | b*)+ == (a | b)*
 6515|       |	     * (a | b?)+ == (a | b)*
 6516|       |	     */
 6517|  9.89k|	    while ((cur != NULL) && (cur->type == XML_ELEMENT_CONTENT_OR)) {
  ------------------
  |  Branch (6517:13): [True: 9.89k, False: 0]
  |  Branch (6517:30): [True: 4.33k, False: 5.56k]
  ------------------
 6518|  4.33k|		if ((cur->c1 != NULL) &&
  ------------------
  |  Branch (6518:7): [True: 4.33k, False: 0]
  ------------------
 6519|  4.33k|	            ((cur->c1->ocur == XML_ELEMENT_CONTENT_OPT) ||
  ------------------
  |  Branch (6519:15): [True: 77, False: 4.26k]
  ------------------
 6520|  4.26k|		     (cur->c1->ocur == XML_ELEMENT_CONTENT_MULT))) {
  ------------------
  |  Branch (6520:8): [True: 136, False: 4.12k]
  ------------------
 6521|    213|		    cur->c1->ocur = XML_ELEMENT_CONTENT_ONCE;
 6522|    213|		    found = 1;
 6523|    213|		}
 6524|  4.33k|		if ((cur->c2 != NULL) &&
  ------------------
  |  Branch (6524:7): [True: 4.33k, False: 0]
  ------------------
 6525|  4.33k|	            ((cur->c2->ocur == XML_ELEMENT_CONTENT_OPT) ||
  ------------------
  |  Branch (6525:15): [True: 38, False: 4.29k]
  ------------------
 6526|  4.29k|		     (cur->c2->ocur == XML_ELEMENT_CONTENT_MULT))) {
  ------------------
  |  Branch (6526:8): [True: 18, False: 4.28k]
  ------------------
 6527|     56|		    cur->c2->ocur = XML_ELEMENT_CONTENT_ONCE;
 6528|     56|		    found = 1;
 6529|     56|		}
 6530|  4.33k|		cur = cur->c2;
 6531|  4.33k|	    }
 6532|  5.56k|	    if (found)
  ------------------
  |  Branch (6532:10): [True: 148, False: 5.41k]
  ------------------
 6533|    148|		ret->ocur = XML_ELEMENT_CONTENT_MULT;
 6534|  5.56k|	}
 6535|  5.56k|	NEXT;
  ------------------
  |  | 2279|  5.56k|#define NEXT xmlNextChar(ctxt)
  ------------------
 6536|  5.56k|    }
 6537|  38.0k|    return(ret);
 6538|  40.3k|}
parser.c:xmlCtxtInitializeLate:
  896|  45.7k|xmlCtxtInitializeLate(xmlParserCtxtPtr ctxt) {
  897|  45.7k|    xmlSAXHandlerPtr sax;
  898|       |
  899|       |    /* Avoid unused variable warning if features are disabled. */
  900|  45.7k|    (void) sax;
  901|       |
  902|       |    /*
  903|       |     * Changing the SAX struct directly is still widespread practice
  904|       |     * in internal and external code.
  905|       |     */
  906|  45.7k|    if (ctxt == NULL) return;
  ------------------
  |  Branch (906:9): [True: 0, False: 45.7k]
  ------------------
  907|  45.7k|    sax = ctxt->sax;
  908|  45.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|  45.7k|    if (((ctxt->options & XML_PARSE_SAX1) == 0) &&
  ------------------
  |  Branch (913:9): [True: 26.0k, False: 19.7k]
  ------------------
  914|  26.0k|        (sax) &&
  ------------------
  |  Branch (914:9): [True: 26.0k, False: 0]
  ------------------
  915|  26.0k|        (sax->initialized == XML_SAX2_MAGIC) &&
  ------------------
  |  |  953|  26.0k|#define XML_SAX2_MAGIC 0xDEEDBEAF
  ------------------
  |  Branch (915:9): [True: 26.0k, False: 0]
  ------------------
  916|  26.0k|        ((sax->startElementNs != NULL) ||
  ------------------
  |  Branch (916:10): [True: 26.0k, 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|  26.0k|        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|  45.7k|    ctxt->str_xml = xmlDictLookup(ctxt->dict, BAD_CAST "xml", 3);
  ------------------
  |  |   34|  45.7k|#define BAD_CAST (xmlChar *)
  ------------------
  929|  45.7k|    ctxt->str_xmlns = xmlDictLookup(ctxt->dict, BAD_CAST "xmlns", 5);
  ------------------
  |  |   34|  45.7k|#define BAD_CAST (xmlChar *)
  ------------------
  930|  45.7k|    ctxt->str_xml_ns = xmlDictLookup(ctxt->dict, XML_XML_NAMESPACE, 36);
  ------------------
  |  |  146|  45.7k|    (const xmlChar *) "http://www.w3.org/XML/1998/namespace"
  ------------------
  931|  45.7k|    if ((ctxt->str_xml==NULL) || (ctxt->str_xmlns==NULL) ||
  ------------------
  |  Branch (931:9): [True: 13, False: 45.7k]
  |  Branch (931:34): [True: 0, False: 45.7k]
  ------------------
  932|  45.7k|		(ctxt->str_xml_ns == NULL)) {
  ------------------
  |  Branch (932:3): [True: 0, False: 45.7k]
  ------------------
  933|     13|        xmlErrMemory(ctxt);
  934|     13|    }
  935|       |
  936|  45.7k|    xmlDictSetLimit(ctxt->dict,
  937|  45.7k|                    (ctxt->options & XML_PARSE_HUGE) ?
  ------------------
  |  Branch (937:21): [True: 22.7k, False: 23.0k]
  ------------------
  938|  22.7k|                        0 :
  939|  45.7k|                        XML_MAX_DICTIONARY_LIMIT);
  ------------------
  |  |   73|  68.8k|#define XML_MAX_DICTIONARY_LIMIT 100000000
  ------------------
  940|       |
  941|  45.7k|#ifdef LIBXML_VALID_ENABLED
  942|  45.7k|    if (ctxt->validate)
  ------------------
  |  Branch (942:9): [True: 21.6k, False: 24.1k]
  ------------------
  943|  21.6k|        ctxt->vctxt.flags |= XML_VCTXT_VALIDATE;
  ------------------
  |  |   24|  21.6k|#define XML_VCTXT_VALIDATE (1u << 2)
  ------------------
  944|  24.1k|    else
  945|  24.1k|        ctxt->vctxt.flags &= ~XML_VCTXT_VALIDATE;
  ------------------
  |  |   24|  24.1k|#define XML_VCTXT_VALIDATE (1u << 2)
  ------------------
  946|  45.7k|#endif /* LIBXML_VALID_ENABLED */
  947|  45.7k|}
parser.c:xmlPopPE:
 2347|   107k|xmlPopPE(xmlParserCtxtPtr ctxt) {
 2348|   107k|    unsigned long consumed;
 2349|   107k|    xmlEntityPtr ent;
 2350|       |
 2351|   107k|    ent = ctxt->input->entity;
 2352|       |
 2353|   107k|    ent->flags &= ~XML_ENT_EXPANDING;
  ------------------
  |  |   22|   107k|#define XML_ENT_EXPANDING   (1u << 3)
  ------------------
 2354|       |
 2355|   107k|    if ((ent->flags & XML_ENT_CHECKED) == 0) {
  ------------------
  |  |   20|   107k|#define XML_ENT_CHECKED     (1u << 1)
  ------------------
  |  Branch (2355:9): [True: 4.78k, False: 102k]
  ------------------
 2356|  4.78k|        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|  5.35k|        do {
 2363|  5.35k|            ctxt->input->cur = ctxt->input->end;
 2364|  5.35k|            xmlParserShrink(ctxt);
 2365|  5.35k|            result = xmlParserGrow(ctxt);
 2366|  5.35k|        } while (result > 0);
  ------------------
  |  Branch (2366:18): [True: 571, False: 4.78k]
  ------------------
 2367|       |
 2368|  4.78k|        consumed = ctxt->input->consumed;
 2369|  4.78k|        xmlSaturatedAddSizeT(&consumed,
 2370|  4.78k|                             ctxt->input->end - ctxt->input->base);
 2371|       |
 2372|  4.78k|        xmlSaturatedAdd(&ent->expandedSize, consumed);
 2373|       |
 2374|       |        /*
 2375|       |         * Add to sizeentities when parsing an external entity
 2376|       |         * for the first time.
 2377|       |         */
 2378|  4.78k|        if (ent->etype == XML_EXTERNAL_PARAMETER_ENTITY) {
  ------------------
  |  Branch (2378:13): [True: 3.56k, False: 1.21k]
  ------------------
 2379|  3.56k|            xmlSaturatedAdd(&ctxt->sizeentities, consumed);
 2380|  3.56k|        }
 2381|       |
 2382|  4.78k|        ent->flags |= XML_ENT_CHECKED;
  ------------------
  |  |   20|  4.78k|#define XML_ENT_CHECKED     (1u << 1)
  ------------------
 2383|  4.78k|    }
 2384|       |
 2385|   107k|    xmlFreeInputStream(xmlCtxtPopInput(ctxt));
 2386|       |
 2387|   107k|    xmlParserEntityCheck(ctxt, ent->expandedSize);
 2388|       |
 2389|   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: 96.3k, False: 10.9k]
  |  |  ------------------
  |  | 2272|   107k|        (ctxt->input->end - ctxt->input->cur < INPUT_CHUNK)) \
  |  |  ------------------
  |  |  |  |   63|  96.3k|#define INPUT_CHUNK	250
  |  |  ------------------
  |  |  |  Branch (2272:9): [True: 72.4k, False: 23.9k]
  |  |  ------------------
  |  | 2273|   107k|	xmlParserGrow(ctxt);
  ------------------
 2390|   107k|}
parser.c:xmlParseConditionalSections:
 6746|  4.23k|xmlParseConditionalSections(xmlParserCtxtPtr ctxt) {
 6747|  4.23k|    size_t depth = 0;
 6748|  4.23k|    int isFreshPE = 0;
 6749|  4.23k|    int oldInputNr = ctxt->inputNr;
 6750|  4.23k|    int declInputNr = ctxt->inputNr;
 6751|       |
 6752|  8.52k|    while (!PARSER_STOPPED(ctxt)) {
  ------------------
  |  |   44|  8.52k|#define PARSER_STOPPED(ctxt) ((ctxt)->disableSAX > 1)
  ------------------
  |  Branch (6752:12): [True: 8.51k, False: 6]
  ------------------
 6753|  8.51k|        if (ctxt->input->cur >= ctxt->input->end) {
  ------------------
  |  Branch (6753:13): [True: 513, False: 8.00k]
  ------------------
 6754|    513|            if (ctxt->inputNr <= oldInputNr) {
  ------------------
  |  Branch (6754:17): [True: 202, False: 311]
  ------------------
 6755|    202|                xmlFatalErr(ctxt, XML_ERR_EXT_SUBSET_NOT_FINISHED, NULL);
 6756|    202|                return;
 6757|    202|            }
 6758|       |
 6759|    311|            xmlPopPE(ctxt);
 6760|    311|            declInputNr = ctxt->inputNr;
 6761|  8.00k|        } else if ((RAW == '<') && (NXT(1) == '!') && (NXT(2) == '[')) {
  ------------------
  |  | 2224|  8.00k|#define RAW (*ctxt->input->cur)
  ------------------
                      } else if ((RAW == '<') && (NXT(1) == '!') && (NXT(2) == '[')) {
  ------------------
  |  | 2226|  5.76k|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
                      } else if ((RAW == '<') && (NXT(1) == '!') && (NXT(2) == '[')) {
  ------------------
  |  | 2226|  5.43k|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
  |  Branch (6761:20): [True: 5.76k, False: 2.24k]
  |  Branch (6761:36): [True: 5.43k, False: 327]
  |  Branch (6761:55): [True: 4.40k, False: 1.02k]
  ------------------
 6762|  4.40k|            SKIP(3);
  ------------------
  |  | 2248|  4.40k|#define SKIP(val) do {							\
  |  | 2249|  4.40k|    ctxt->input->cur += (val),ctxt->input->col+=(val);			\
  |  | 2250|  4.40k|    if (*ctxt->input->cur == 0)						\
  |  |  ------------------
  |  |  |  Branch (2250:9): [True: 245, False: 4.16k]
  |  |  ------------------
  |  | 2251|  4.40k|        xmlParserGrow(ctxt);						\
  |  | 2252|  4.40k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2252:12): [Folded, False: 4.40k]
  |  |  ------------------
  ------------------
 6763|  4.40k|            SKIP_BLANKS_PE;
  ------------------
  |  | 2277|  4.40k|#define SKIP_BLANKS_PE xmlSkipBlankCharsPE(ctxt)
  ------------------
 6764|       |
 6765|  4.40k|            isFreshPE = 0;
 6766|       |
 6767|  4.40k|            if (CMP7(CUR_PTR, 'I', 'N', 'C', 'L', 'U', 'D', 'E')) {
  ------------------
  |  | 2238|  4.40k|  ( CMP6( s, c1, c2, c3, c4, c5, c6 ) && ((unsigned char *) s)[ 6 ] == c7 )
  |  |  ------------------
  |  |  |  | 2236|  8.81k|  ( CMP5( s, c1, c2, c3, c4, c5 ) && ((unsigned char *) s)[ 5 ] == c6 )
  |  |  |  |  ------------------
  |  |  |  |  |  | 2234|  8.81k|  ( CMP4( s, c1, c2, c3, c4 ) && ((unsigned char *) s)[ 4 ] == c5 )
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  | 2231|  8.81k|  ( ((unsigned char *) s)[ 0 ] == c1 && ((unsigned char *) s)[ 1 ] == c2 && \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (2231:5): [True: 4.07k, False: 337]
  |  |  |  |  |  |  |  |  |  Branch (2231:41): [True: 1.59k, False: 2.47k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  | 2232|  4.40k|    ((unsigned char *) s)[ 2 ] == c3 && ((unsigned char *) s)[ 3 ] == c4 )
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (2232:5): [True: 1.59k, False: 2]
  |  |  |  |  |  |  |  |  |  Branch (2232:41): [True: 1.59k, False: 1]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (2234:34): [True: 1.58k, False: 5]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2236:38): [True: 1.58k, False: 3]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2238:42): [True: 1.58k, False: 1]
  |  |  ------------------
  ------------------
 6768|  1.58k|                SKIP(7);
  ------------------
  |  | 2248|  1.58k|#define SKIP(val) do {							\
  |  | 2249|  1.58k|    ctxt->input->cur += (val),ctxt->input->col+=(val);			\
  |  | 2250|  1.58k|    if (*ctxt->input->cur == 0)						\
  |  |  ------------------
  |  |  |  Branch (2250:9): [True: 34, False: 1.54k]
  |  |  ------------------
  |  | 2251|  1.58k|        xmlParserGrow(ctxt);						\
  |  | 2252|  1.58k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2252:12): [Folded, False: 1.58k]
  |  |  ------------------
  ------------------
 6769|  1.58k|                SKIP_BLANKS_PE;
  ------------------
  |  | 2277|  1.58k|#define SKIP_BLANKS_PE xmlSkipBlankCharsPE(ctxt)
  ------------------
 6770|  1.58k|                if (RAW != '[') {
  ------------------
  |  | 2224|  1.58k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (6770:21): [True: 246, False: 1.33k]
  ------------------
 6771|    246|                    xmlFatalErr(ctxt, XML_ERR_CONDSEC_INVALID, NULL);
 6772|    246|                    return;
 6773|    246|                }
 6774|  1.33k|#ifdef LIBXML_VALID_ENABLED
 6775|  1.33k|                if ((ctxt->validate) && (ctxt->inputNr > declInputNr)) {
  ------------------
  |  Branch (6775:21): [True: 657, False: 679]
  |  Branch (6775:41): [True: 33, False: 624]
  ------------------
 6776|     33|		    xmlValidityError(ctxt, XML_ERR_ENTITY_BOUNDARY,
 6777|     33|                                     "All markup of the conditional section is"
 6778|     33|                                     " not in the same entity\n",
 6779|     33|                                     NULL, NULL);
 6780|     33|                }
 6781|  1.33k|#endif
 6782|  1.33k|                NEXT;
  ------------------
  |  | 2279|  1.33k|#define NEXT xmlNextChar(ctxt)
  ------------------
 6783|       |
 6784|  1.33k|                depth++;
 6785|  2.82k|            } else if (CMP6(CUR_PTR, 'I', 'G', 'N', 'O', 'R', 'E')) {
  ------------------
  |  | 2236|  2.82k|  ( CMP5( s, c1, c2, c3, c4, c5 ) && ((unsigned char *) s)[ 5 ] == c6 )
  |  |  ------------------
  |  |  |  | 2234|  5.65k|  ( CMP4( s, c1, c2, c3, c4 ) && ((unsigned char *) s)[ 4 ] == c5 )
  |  |  |  |  ------------------
  |  |  |  |  |  | 2231|  5.65k|  ( ((unsigned char *) s)[ 0 ] == c1 && ((unsigned char *) s)[ 1 ] == c2 && \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (2231:5): [True: 2.49k, False: 337]
  |  |  |  |  |  |  |  Branch (2231:41): [True: 2.47k, False: 16]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 2232|  2.82k|    ((unsigned char *) s)[ 2 ] == c3 && ((unsigned char *) s)[ 3 ] == c4 )
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (2232:5): [True: 2.47k, False: 3]
  |  |  |  |  |  |  |  Branch (2232:41): [True: 2.47k, False: 1]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2234:34): [True: 2.46k, False: 2]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2236:38): [True: 2.46k, False: 1]
  |  |  ------------------
  ------------------
 6786|  2.46k|                size_t ignoreDepth = 0;
 6787|       |
 6788|  2.46k|                SKIP(6);
  ------------------
  |  | 2248|  2.46k|#define SKIP(val) do {							\
  |  | 2249|  2.46k|    ctxt->input->cur += (val),ctxt->input->col+=(val);			\
  |  | 2250|  2.46k|    if (*ctxt->input->cur == 0)						\
  |  |  ------------------
  |  |  |  Branch (2250:9): [True: 234, False: 2.23k]
  |  |  ------------------
  |  | 2251|  2.46k|        xmlParserGrow(ctxt);						\
  |  | 2252|  2.46k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2252:12): [Folded, False: 2.46k]
  |  |  ------------------
  ------------------
 6789|  2.46k|                SKIP_BLANKS_PE;
  ------------------
  |  | 2277|  2.46k|#define SKIP_BLANKS_PE xmlSkipBlankCharsPE(ctxt)
  ------------------
 6790|  2.46k|                if (RAW != '[') {
  ------------------
  |  | 2224|  2.46k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (6790:21): [True: 469, False: 1.99k]
  ------------------
 6791|    469|                    xmlFatalErr(ctxt, XML_ERR_CONDSEC_INVALID, NULL);
 6792|    469|                    return;
 6793|    469|                }
 6794|  1.99k|#ifdef LIBXML_VALID_ENABLED
 6795|  1.99k|                if ((ctxt->validate) && (ctxt->inputNr > declInputNr)) {
  ------------------
  |  Branch (6795:21): [True: 1.35k, False: 640]
  |  Branch (6795:41): [True: 6, False: 1.35k]
  ------------------
 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.99k|#endif
 6802|  1.99k|                NEXT;
  ------------------
  |  | 2279|  1.99k|#define NEXT xmlNextChar(ctxt)
  ------------------
 6803|       |
 6804|  57.1k|                while (PARSER_STOPPED(ctxt) == 0) {
  ------------------
  |  |   44|  57.1k|#define PARSER_STOPPED(ctxt) ((ctxt)->disableSAX > 1)
  ------------------
  |  Branch (6804:24): [True: 57.1k, False: 2]
  ------------------
 6805|  57.1k|                    if (RAW == 0) {
  ------------------
  |  | 2224|  57.1k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (6805:25): [True: 1.23k, False: 55.9k]
  ------------------
 6806|  1.23k|                        xmlFatalErr(ctxt, XML_ERR_CONDSEC_NOT_FINISHED, NULL);
 6807|  1.23k|                        return;
 6808|  1.23k|                    }
 6809|  55.9k|                    if ((RAW == '<') && (NXT(1) == '!') && (NXT(2) == '[')) {
  ------------------
  |  | 2224|  55.9k|#define RAW (*ctxt->input->cur)
  ------------------
                                  if ((RAW == '<') && (NXT(1) == '!') && (NXT(2) == '[')) {
  ------------------
  |  | 2226|  2.49k|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
                                  if ((RAW == '<') && (NXT(1) == '!') && (NXT(2) == '[')) {
  ------------------
  |  | 2226|  1.74k|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
  |  Branch (6809:25): [True: 2.49k, False: 53.4k]
  |  Branch (6809:41): [True: 1.74k, False: 750]
  |  Branch (6809:60): [True: 1.03k, False: 708]
  ------------------
 6810|  1.03k|                        SKIP(3);
  ------------------
  |  | 2248|  1.03k|#define SKIP(val) do {							\
  |  | 2249|  1.03k|    ctxt->input->cur += (val),ctxt->input->col+=(val);			\
  |  | 2250|  1.03k|    if (*ctxt->input->cur == 0)						\
  |  |  ------------------
  |  |  |  Branch (2250:9): [True: 122, False: 913]
  |  |  ------------------
  |  | 2251|  1.03k|        xmlParserGrow(ctxt);						\
  |  | 2252|  1.03k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2252:12): [Folded, False: 1.03k]
  |  |  ------------------
  ------------------
 6811|  1.03k|                        ignoreDepth++;
 6812|       |                        /* Check for integer overflow */
 6813|  1.03k|                        if (ignoreDepth == 0) {
  ------------------
  |  Branch (6813:29): [True: 0, False: 1.03k]
  ------------------
 6814|      0|                            xmlErrMemory(ctxt);
 6815|      0|                            return;
 6816|      0|                        }
 6817|  54.9k|                    } else if ((RAW == ']') && (NXT(1) == ']') &&
  ------------------
  |  | 2224|  54.9k|#define RAW (*ctxt->input->cur)
  ------------------
                                  } else if ((RAW == ']') && (NXT(1) == ']') &&
  ------------------
  |  | 2226|  3.04k|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
  |  Branch (6817:32): [True: 3.04k, False: 51.8k]
  |  Branch (6817:48): [True: 1.68k, False: 1.36k]
  ------------------
 6818|  1.68k|                               (NXT(2) == '>')) {
  ------------------
  |  | 2226|  1.68k|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
  |  Branch (6818:32): [True: 1.27k, False: 409]
  ------------------
 6819|  1.27k|                        SKIP(3);
  ------------------
  |  | 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: 276, False: 1.00k]
  |  |  ------------------
  |  | 2251|  1.27k|        xmlParserGrow(ctxt);						\
  |  | 2252|  1.27k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2252:12): [Folded, False: 1.27k]
  |  |  ------------------
  ------------------
 6820|  1.27k|                        if (ignoreDepth == 0)
  ------------------
  |  Branch (6820:29): [True: 762, False: 515]
  ------------------
 6821|    762|                            break;
 6822|    515|                        ignoreDepth--;
 6823|  53.6k|                    } else {
 6824|  53.6k|                        NEXT;
  ------------------
  |  | 2279|  53.6k|#define NEXT xmlNextChar(ctxt)
  ------------------
 6825|  53.6k|                    }
 6826|  55.9k|                }
 6827|       |
 6828|    764|#ifdef LIBXML_VALID_ENABLED
 6829|    764|                if ((ctxt->validate) && (ctxt->inputNr > declInputNr)) {
  ------------------
  |  Branch (6829:21): [True: 518, False: 246]
  |  Branch (6829:41): [True: 6, False: 512]
  ------------------
 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|    764|#endif
 6836|    764|            } else {
 6837|    360|                xmlFatalErr(ctxt, XML_ERR_CONDSEC_INVALID_KEYWORD, NULL);
 6838|    360|                return;
 6839|    360|            }
 6840|  4.40k|        } else if ((depth > 0) &&
  ------------------
  |  Branch (6840:20): [True: 3.59k, False: 0]
  ------------------
 6841|  3.59k|                   (RAW == ']') && (NXT(1) == ']') && (NXT(2) == '>')) {
  ------------------
  |  | 2224|  3.59k|#define RAW (*ctxt->input->cur)
  ------------------
                                 (RAW == ']') && (NXT(1) == ']') && (NXT(2) == '>')) {
  ------------------
  |  | 2226|    934|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
                                 (RAW == ']') && (NXT(1) == ']') && (NXT(2) == '>')) {
  ------------------
  |  | 2226|    930|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
  |  Branch (6841:20): [True: 934, False: 2.65k]
  |  Branch (6841:36): [True: 930, False: 4]
  |  Branch (6841:55): [True: 929, False: 1]
  ------------------
 6842|    929|            if (isFreshPE) {
  ------------------
  |  Branch (6842:17): [True: 1, False: 928]
  ------------------
 6843|      1|                xmlFatalErrMsg(ctxt, XML_ERR_CONDSEC_INVALID,
 6844|      1|                               "Parameter entity must match "
 6845|      1|                               "extSubsetDecl\n");
 6846|      1|                return;
 6847|      1|            }
 6848|       |
 6849|    928|            depth--;
 6850|    928|#ifdef LIBXML_VALID_ENABLED
 6851|    928|            if ((ctxt->validate) && (ctxt->inputNr > declInputNr)) {
  ------------------
  |  Branch (6851:17): [True: 379, False: 549]
  |  Branch (6851:37): [True: 19, False: 360]
  ------------------
 6852|     19|		xmlValidityError(ctxt, XML_ERR_ENTITY_BOUNDARY,
 6853|     19|                                 "All markup of the conditional section is not"
 6854|     19|                                 " in the same entity\n",
 6855|     19|                                 NULL, NULL);
 6856|     19|            }
 6857|    928|#endif
 6858|    928|            SKIP(3);
  ------------------
  |  | 2248|    928|#define SKIP(val) do {							\
  |  | 2249|    928|    ctxt->input->cur += (val),ctxt->input->col+=(val);			\
  |  | 2250|    928|    if (*ctxt->input->cur == 0)						\
  |  |  ------------------
  |  |  |  Branch (2250:9): [True: 455, False: 473]
  |  |  ------------------
  |  | 2251|    928|        xmlParserGrow(ctxt);						\
  |  | 2252|    928|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2252:12): [Folded, False: 928]
  |  |  ------------------
  ------------------
 6859|  2.66k|        } else if ((RAW == '<') && ((NXT(1) == '!') || (NXT(1) == '?'))) {
  ------------------
  |  | 2224|  2.66k|#define RAW (*ctxt->input->cur)
  ------------------
                      } else if ((RAW == '<') && ((NXT(1) == '!') || (NXT(1) == '?'))) {
  ------------------
  |  | 2226|  1.35k|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
                      } else if ((RAW == '<') && ((NXT(1) == '!') || (NXT(1) == '?'))) {
  ------------------
  |  | 2226|    327|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
  |  Branch (6859:20): [True: 1.35k, False: 1.31k]
  |  Branch (6859:37): [True: 1.02k, False: 327]
  |  Branch (6859:56): [True: 323, False: 4]
  ------------------
 6860|  1.34k|            isFreshPE = 0;
 6861|  1.34k|            xmlParseMarkupDecl(ctxt);
 6862|  1.34k|        } else if (RAW == '%') {
  ------------------
  |  | 2224|  1.31k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (6862:20): [True: 1.26k, False: 50]
  ------------------
 6863|  1.26k|            xmlParsePERefInternal(ctxt, 1);
 6864|  1.26k|            if (ctxt->inputNr > declInputNr) {
  ------------------
  |  Branch (6864:17): [True: 313, False: 953]
  ------------------
 6865|    313|                isFreshPE = 1;
 6866|    313|                declInputNr = ctxt->inputNr;
 6867|    313|            }
 6868|  1.26k|        } else {
 6869|     50|            xmlFatalErr(ctxt, XML_ERR_EXT_SUBSET_NOT_FINISHED, NULL);
 6870|     50|            return;
 6871|     50|        }
 6872|       |
 6873|  5.95k|        if (depth == 0)
  ------------------
  |  Branch (6873:13): [True: 1.66k, False: 4.29k]
  ------------------
 6874|  1.66k|            break;
 6875|       |
 6876|  4.29k|        SKIP_BLANKS;
  ------------------
  |  | 2275|  4.29k|#define SKIP_BLANKS xmlSkipBlankChars(ctxt)
  ------------------
 6877|  4.29k|        SHRINK;
  ------------------
  |  | 2267|  4.29k|    if (!PARSER_PROGRESSIVE(ctxt)) \
  |  |  ------------------
  |  |  |  |   47|  4.29k|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|  4.29k|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2267:9): [True: 3.93k, False: 353]
  |  |  ------------------
  |  | 2268|  4.29k|	xmlParserShrink(ctxt);
  ------------------
 6878|  4.29k|        GROW;
  ------------------
  |  | 2271|  4.29k|    if ((!PARSER_PROGRESSIVE(ctxt)) && \
  |  |  ------------------
  |  |  |  |   47|  4.29k|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|  4.29k|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2271:9): [True: 3.93k, False: 353]
  |  |  ------------------
  |  | 2272|  4.29k|        (ctxt->input->end - ctxt->input->cur < INPUT_CHUNK)) \
  |  |  ------------------
  |  |  |  |   63|  3.93k|#define INPUT_CHUNK	250
  |  |  ------------------
  |  |  |  Branch (2272:9): [True: 3.08k, False: 848]
  |  |  ------------------
  |  | 2273|  4.29k|	xmlParserGrow(ctxt);
  ------------------
 6879|  4.29k|    }
 6880|  4.23k|}
parser.c:xmlParserEntityCheck:
  435|  2.60M|{
  436|  2.60M|    unsigned long consumed;
  437|  2.60M|    unsigned long *expandedSize;
  438|  2.60M|    xmlParserInputPtr input = ctxt->input;
  439|  2.60M|    xmlEntityPtr entity = input->entity;
  440|       |
  441|  2.60M|    if ((entity) && (entity->flags & XML_ENT_CHECKED))
  ------------------
  |  |   20|   470k|#define XML_ENT_CHECKED     (1u << 1)
  ------------------
  |  Branch (441:9): [True: 470k, False: 2.13M]
  |  Branch (441:21): [True: 318k, False: 152k]
  ------------------
  442|   318k|        return(0);
  443|       |
  444|       |    /*
  445|       |     * Compute total consumed bytes so far, including input streams of
  446|       |     * external entities.
  447|       |     */
  448|  2.29M|    consumed = input->consumed;
  449|  2.29M|    xmlSaturatedAddSizeT(&consumed, input->cur - input->base);
  450|  2.29M|    xmlSaturatedAdd(&consumed, ctxt->sizeentities);
  451|       |
  452|  2.29M|    if (entity)
  ------------------
  |  Branch (452:9): [True: 152k, False: 2.13M]
  ------------------
  453|   152k|        expandedSize = &entity->expandedSize;
  454|  2.13M|    else
  455|  2.13M|        expandedSize = &ctxt->sizeentcopy;
  456|       |
  457|       |    /*
  458|       |     * Add extra cost and some fixed cost.
  459|       |     */
  460|  2.29M|    xmlSaturatedAdd(expandedSize, extra);
  461|  2.29M|    xmlSaturatedAdd(expandedSize, XML_ENT_FIXED_COST);
  ------------------
  |  |  169|  2.29M|#define XML_ENT_FIXED_COST 20
  ------------------
  462|       |
  463|       |    /*
  464|       |     * It's important to always use saturation arithmetic when tracking
  465|       |     * entity sizes to make the size checks reliable. If "sizeentcopy"
  466|       |     * overflows, we have to abort.
  467|       |     */
  468|  2.29M|    if ((*expandedSize > XML_PARSER_ALLOWED_EXPANSION) &&
  ------------------
  |  |  162|  2.29M|#define XML_PARSER_ALLOWED_EXPANSION 1000000
  ------------------
  |  Branch (468:9): [True: 691k, False: 1.59M]
  ------------------
  469|   691k|        ((*expandedSize >= ULONG_MAX) ||
  ------------------
  |  Branch (469:10): [True: 0, False: 691k]
  ------------------
  470|   691k|         (*expandedSize / ctxt->maxAmpl > consumed))) {
  ------------------
  |  Branch (470:10): [True: 238, False: 691k]
  ------------------
  471|    238|        xmlFatalErrMsg(ctxt, XML_ERR_RESOURCE_LIMIT,
  472|    238|                       "Maximum entity amplification factor exceeded, see "
  473|    238|                       "xmlCtxtSetMaxAmplification.\n");
  474|    238|        return(1);
  475|    238|    }
  476|       |
  477|  2.29M|    return(0);
  478|  2.29M|}
parser.c:xmlLookupGeneralEntity:
 7395|  3.55M|xmlLookupGeneralEntity(xmlParserCtxtPtr ctxt, const xmlChar *name, int inAttr) {
 7396|  3.55M|    xmlEntityPtr ent = NULL;
 7397|       |
 7398|       |    /*
 7399|       |     * Predefined entities override any extra definition
 7400|       |     */
 7401|  3.55M|    if ((ctxt->options & XML_PARSE_OLDSAX) == 0) {
  ------------------
  |  Branch (7401:9): [True: 2.03M, False: 1.51M]
  ------------------
 7402|  2.03M|        ent = xmlGetPredefinedEntity(name);
 7403|  2.03M|        if (ent != NULL)
  ------------------
  |  Branch (7403:13): [True: 771k, False: 1.26M]
  ------------------
 7404|   771k|            return(ent);
 7405|  2.03M|    }
 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.78M|    if (ctxt->sax != NULL) {
  ------------------
  |  Branch (7411:9): [True: 2.78M, False: 0]
  ------------------
 7412|  2.78M|	if (ctxt->sax->getEntity != NULL)
  ------------------
  |  Branch (7412:6): [True: 2.78M, False: 0]
  ------------------
 7413|  2.78M|	    ent = ctxt->sax->getEntity(ctxt->userData, name);
 7414|  2.78M|	if ((ctxt->wellFormed == 1 ) && (ent == NULL) &&
  ------------------
  |  Branch (7414:6): [True: 32.3k, False: 2.74M]
  |  Branch (7414:34): [True: 2.67k, False: 29.6k]
  ------------------
 7415|  2.67k|	    (ctxt->options & XML_PARSE_OLDSAX))
  ------------------
  |  Branch (7415:6): [True: 936, False: 1.73k]
  ------------------
 7416|    936|	    ent = xmlGetPredefinedEntity(name);
 7417|  2.78M|	if ((ctxt->wellFormed == 1 ) && (ent == NULL) &&
  ------------------
  |  Branch (7417:6): [True: 32.3k, False: 2.74M]
  |  Branch (7417:34): [True: 2.67k, False: 29.6k]
  ------------------
 7418|  2.67k|	    (ctxt->userData==ctxt)) {
  ------------------
  |  Branch (7418:6): [True: 2.67k, False: 0]
  ------------------
 7419|  2.67k|	    ent = xmlSAX2GetEntity(ctxt, name);
 7420|  2.67k|	}
 7421|  2.78M|    }
 7422|       |
 7423|  2.78M|    if (ent == NULL) {
  ------------------
  |  Branch (7423:9): [True: 307k, False: 2.47M]
  ------------------
 7424|   307k|        xmlHandleUndeclaredEntity(ctxt, name);
 7425|   307k|    }
 7426|       |
 7427|       |    /*
 7428|       |     * [ WFC: Parsed Entity ]
 7429|       |     * An entity reference must not contain the name of an
 7430|       |     * unparsed entity
 7431|       |     */
 7432|  2.47M|    else if (ent->etype == XML_EXTERNAL_GENERAL_UNPARSED_ENTITY) {
  ------------------
  |  Branch (7432:14): [True: 230, False: 2.47M]
  ------------------
 7433|    230|	xmlFatalErrMsgStr(ctxt, XML_ERR_UNPARSED_ENTITY,
 7434|    230|		 "Entity reference to unparsed entity %s\n", name);
 7435|    230|        ent = NULL;
 7436|    230|    }
 7437|       |
 7438|       |    /*
 7439|       |     * [ WFC: No External Entity References ]
 7440|       |     * Attribute values cannot contain direct or indirect
 7441|       |     * entity references to external entities.
 7442|       |     */
 7443|  2.47M|    else if (ent->etype == XML_EXTERNAL_GENERAL_PARSED_ENTITY) {
  ------------------
  |  Branch (7443:14): [True: 13.1k, False: 2.46M]
  ------------------
 7444|  13.1k|        if (inAttr) {
  ------------------
  |  Branch (7444:13): [True: 574, False: 12.6k]
  ------------------
 7445|    574|            xmlFatalErrMsgStr(ctxt, XML_ERR_ENTITY_IS_EXTERNAL,
 7446|    574|                 "Attribute references external entity '%s'\n", name);
 7447|    574|            ent = NULL;
 7448|    574|        }
 7449|  13.1k|    }
 7450|       |
 7451|  2.78M|    return(ent);
 7452|  3.55M|}
parser.c:xmlParseEntityRefInternal:
 7463|  1.05M|xmlParseEntityRefInternal(xmlParserCtxtPtr ctxt) {
 7464|  1.05M|    const xmlChar *name;
 7465|       |
 7466|  1.05M|    GROW;
  ------------------
  |  | 2271|  1.05M|    if ((!PARSER_PROGRESSIVE(ctxt)) && \
  |  |  ------------------
  |  |  |  |   47|  1.05M|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|  1.05M|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2271:9): [True: 415k, False: 635k]
  |  |  ------------------
  |  | 2272|  1.05M|        (ctxt->input->end - ctxt->input->cur < INPUT_CHUNK)) \
  |  |  ------------------
  |  |  |  |   63|   415k|#define INPUT_CHUNK	250
  |  |  ------------------
  |  |  |  Branch (2272:9): [True: 220k, False: 195k]
  |  |  ------------------
  |  | 2273|  1.05M|	xmlParserGrow(ctxt);
  ------------------
 7467|       |
 7468|  1.05M|    if (RAW != '&')
  ------------------
  |  | 2224|  1.05M|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (7468:9): [True: 0, False: 1.05M]
  ------------------
 7469|      0|        return(NULL);
 7470|  1.05M|    NEXT;
  ------------------
  |  | 2279|  1.05M|#define NEXT xmlNextChar(ctxt)
  ------------------
 7471|  1.05M|    name = xmlParseName(ctxt);
 7472|  1.05M|    if (name == NULL) {
  ------------------
  |  Branch (7472:9): [True: 47.9k, False: 1.00M]
  ------------------
 7473|  47.9k|	xmlFatalErrMsg(ctxt, XML_ERR_NAME_REQUIRED,
 7474|  47.9k|		       "xmlParseEntityRef: no name\n");
 7475|  47.9k|        return(NULL);
 7476|  47.9k|    }
 7477|  1.00M|    if (RAW != ';') {
  ------------------
  |  | 2224|  1.00M|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (7477:9): [True: 83.6k, False: 919k]
  ------------------
 7478|  83.6k|	xmlFatalErr(ctxt, XML_ERR_ENTITYREF_SEMICOL_MISSING, NULL);
 7479|  83.6k|	return(NULL);
 7480|  83.6k|    }
 7481|   919k|    NEXT;
  ------------------
  |  | 2279|   919k|#define NEXT xmlNextChar(ctxt)
  ------------------
 7482|       |
 7483|   919k|    return(name);
 7484|  1.00M|}
parser.c:xmlParsePERefInternal:
 7599|   184k|xmlParsePERefInternal(xmlParserCtxt *ctxt, int markupDecl) {
 7600|   184k|    const xmlChar *name;
 7601|   184k|    xmlEntityPtr entity = NULL;
 7602|   184k|    xmlParserInputPtr input;
 7603|       |
 7604|   184k|    if (RAW != '%')
  ------------------
  |  | 2224|   184k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (7604:9): [True: 0, False: 184k]
  ------------------
 7605|      0|        return;
 7606|   184k|    NEXT;
  ------------------
  |  | 2279|   184k|#define NEXT xmlNextChar(ctxt)
  ------------------
 7607|   184k|    name = xmlParseName(ctxt);
 7608|   184k|    if (name == NULL) {
  ------------------
  |  Branch (7608:9): [True: 14.1k, False: 170k]
  ------------------
 7609|  14.1k|	xmlFatalErrMsg(ctxt, XML_ERR_PEREF_NO_NAME, "PEReference: no name\n");
 7610|  14.1k|	return;
 7611|  14.1k|    }
 7612|   170k|    if (RAW != ';') {
  ------------------
  |  | 2224|   170k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (7612:9): [True: 13.8k, False: 156k]
  ------------------
 7613|  13.8k|	xmlFatalErr(ctxt, XML_ERR_PEREF_SEMICOL_MISSING, NULL);
 7614|  13.8k|        return;
 7615|  13.8k|    }
 7616|       |
 7617|   156k|    NEXT;
  ------------------
  |  | 2279|   156k|#define NEXT xmlNextChar(ctxt)
  ------------------
 7618|       |
 7619|       |    /* Must be set before xmlHandleUndeclaredEntity */
 7620|   156k|    ctxt->hasPErefs = 1;
 7621|       |
 7622|       |    /*
 7623|       |     * Request the entity from SAX
 7624|       |     */
 7625|   156k|    if ((ctxt->sax != NULL) &&
  ------------------
  |  Branch (7625:9): [True: 156k, False: 0]
  ------------------
 7626|   156k|	(ctxt->sax->getParameterEntity != NULL))
  ------------------
  |  Branch (7626:2): [True: 156k, False: 0]
  ------------------
 7627|   156k|	entity = ctxt->sax->getParameterEntity(ctxt->userData, name);
 7628|       |
 7629|   156k|    if (entity == NULL) {
  ------------------
  |  Branch (7629:9): [True: 46.2k, False: 110k]
  ------------------
 7630|  46.2k|        xmlHandleUndeclaredEntity(ctxt, name);
 7631|   110k|    } else {
 7632|       |	/*
 7633|       |	 * Internal checking in case the entity quest barfed
 7634|       |	 */
 7635|   110k|	if ((entity->etype != XML_INTERNAL_PARAMETER_ENTITY) &&
  ------------------
  |  Branch (7635:6): [True: 101k, False: 8.66k]
  ------------------
 7636|   101k|	    (entity->etype != XML_EXTERNAL_PARAMETER_ENTITY)) {
  ------------------
  |  Branch (7636:6): [True: 0, False: 101k]
  ------------------
 7637|      0|	    xmlWarningMsg(ctxt, XML_WAR_UNDECLARED_ENTITY,
 7638|      0|		  "Internal: %%%s; is not a parameter entity\n",
 7639|      0|			  name, NULL);
 7640|   110k|	} else {
 7641|   110k|	    if ((entity->etype == XML_EXTERNAL_PARAMETER_ENTITY) &&
  ------------------
  |  Branch (7641:10): [True: 101k, False: 8.66k]
  ------------------
 7642|   101k|                ((ctxt->options & XML_PARSE_NO_XXE) ||
  ------------------
  |  Branch (7642:18): [True: 196, False: 101k]
  ------------------
 7643|   101k|		 (((ctxt->loadsubset & ~XML_SKIP_IDS) == 0) &&
  ------------------
  |  |  210|   101k|#define XML_SKIP_IDS		8
  ------------------
  |  Branch (7643:5): [True: 28.0k, False: 73.5k]
  ------------------
 7644|  28.0k|		  (ctxt->replaceEntities == 0) &&
  ------------------
  |  Branch (7644:5): [True: 9.91k, False: 18.1k]
  ------------------
 7645|  9.91k|		  (ctxt->validate == 0))))
  ------------------
  |  Branch (7645:5): [True: 199, False: 9.71k]
  ------------------
 7646|    395|		return;
 7647|       |
 7648|   110k|            if (entity->flags & XML_ENT_EXPANDING) {
  ------------------
  |  |   22|   110k|#define XML_ENT_EXPANDING   (1u << 3)
  ------------------
  |  Branch (7648:17): [True: 11, False: 110k]
  ------------------
 7649|     11|                xmlFatalErr(ctxt, XML_ERR_ENTITY_LOOP, NULL);
 7650|     11|                return;
 7651|     11|            }
 7652|       |
 7653|   110k|	    input = xmlNewEntityInputStream(ctxt, entity);
 7654|   110k|	    if (xmlCtxtPushInput(ctxt, input) < 0) {
  ------------------
  |  Branch (7654:10): [True: 1.83k, False: 108k]
  ------------------
 7655|  1.83k|                xmlFreeInputStream(input);
 7656|  1.83k|		return;
 7657|  1.83k|            }
 7658|       |
 7659|   108k|            entity->flags |= XML_ENT_EXPANDING;
  ------------------
  |  |   22|   108k|#define XML_ENT_EXPANDING   (1u << 3)
  ------------------
 7660|       |
 7661|   108k|            if (markupDecl)
  ------------------
  |  Branch (7661:17): [True: 99.0k, False: 9.18k]
  ------------------
 7662|  99.0k|                input->flags |= XML_INPUT_MARKUP_DECL;
  ------------------
  |  |   42|  99.0k|#define XML_INPUT_MARKUP_DECL       (1u << 7)
  ------------------
 7663|       |
 7664|   108k|            GROW;
  ------------------
  |  | 2271|   108k|    if ((!PARSER_PROGRESSIVE(ctxt)) && \
  |  |  ------------------
  |  |  |  |   47|   108k|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|   108k|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2271:9): [True: 108k, False: 0]
  |  |  ------------------
  |  | 2272|   108k|        (ctxt->input->end - ctxt->input->cur < INPUT_CHUNK)) \
  |  |  ------------------
  |  |  |  |   63|   108k|#define INPUT_CHUNK	250
  |  |  ------------------
  |  |  |  Branch (2272:9): [True: 70.0k, False: 38.1k]
  |  |  ------------------
  |  | 2273|   108k|	xmlParserGrow(ctxt);
  ------------------
 7665|       |
 7666|   108k|	    if (entity->etype == XML_EXTERNAL_PARAMETER_ENTITY) {
  ------------------
  |  Branch (7666:10): [True: 99.5k, False: 8.65k]
  ------------------
 7667|  99.5k|                xmlDetectEncoding(ctxt);
 7668|       |
 7669|  99.5k|                if ((CMP5(CUR_PTR, '<', '?', 'x', 'm', 'l')) &&
  ------------------
  |  | 2234|  99.5k|  ( CMP4( s, c1, c2, c3, c4 ) && ((unsigned char *) s)[ 4 ] == c5 )
  |  |  ------------------
  |  |  |  | 2231|   199k|  ( ((unsigned char *) s)[ 0 ] == c1 && ((unsigned char *) s)[ 1 ] == c2 && \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2231:5): [True: 79.4k, False: 20.0k]
  |  |  |  |  |  Branch (2231:41): [True: 47.7k, False: 31.7k]
  |  |  |  |  ------------------
  |  |  |  | 2232|  99.5k|    ((unsigned char *) s)[ 2 ] == c3 && ((unsigned char *) s)[ 3 ] == c4 )
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2232:5): [True: 43.5k, False: 4.23k]
  |  |  |  |  |  Branch (2232:41): [True: 42.8k, False: 642]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2234:34): [True: 41.7k, False: 1.15k]
  |  |  ------------------
  ------------------
 7670|  41.7k|                    (IS_BLANK_CH(NXT(5)))) {
  ------------------
  |  |  137|  41.7k|#define IS_BLANK_CH(c)  xmlIsBlank_ch(c)
  |  |  ------------------
  |  |  |  |   90|  41.7k|#define xmlIsBlank_ch(c)	(((c) == 0x20) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (90:27): [True: 39.3k, False: 2.35k]
  |  |  |  |  ------------------
  |  |  |  |   91|  41.7k|				 ((0x9 <= (c)) && ((c) <= 0xa)) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (91:7): [True: 2.15k, False: 201]
  |  |  |  |  |  Branch (91:23): [True: 858, False: 1.29k]
  |  |  |  |  ------------------
  |  |  |  |   92|  41.7k|				 ((c) == 0xd))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (92:6): [True: 628, False: 871]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 7671|  40.8k|                    xmlParseTextDecl(ctxt);
 7672|  40.8k|                }
 7673|  99.5k|            }
 7674|   108k|	}
 7675|   110k|    }
 7676|   156k|}
parser.c:xmlErrAttributeDup:
  238|  72.3k|{
  239|  72.3k|    if (prefix == NULL)
  ------------------
  |  Branch (239:9): [True: 19.0k, False: 53.3k]
  ------------------
  240|  19.0k|        xmlCtxtErr(ctxt, NULL, XML_FROM_PARSER, XML_ERR_ATTRIBUTE_REDEFINED,
  241|  19.0k|                   XML_ERR_FATAL, localname, NULL, NULL, 0,
  242|  19.0k|                   "Attribute %s redefined\n", localname);
  243|  53.3k|    else
  244|  53.3k|        xmlCtxtErr(ctxt, NULL, XML_FROM_PARSER, XML_ERR_ATTRIBUTE_REDEFINED,
  245|       |                   XML_ERR_FATAL, prefix, localname, NULL, 0,
  246|  53.3k|                   "Attribute %s:%s redefined\n", prefix, localname);
  247|  72.3k|}
parser.c:xmlParseEndTag1:
 8307|  61.3k|xmlParseEndTag1(xmlParserCtxtPtr ctxt, int line) {
 8308|  61.3k|    const xmlChar *name;
 8309|       |
 8310|  61.3k|    GROW;
  ------------------
  |  | 2271|  61.3k|    if ((!PARSER_PROGRESSIVE(ctxt)) && \
  |  |  ------------------
  |  |  |  |   47|  61.3k|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|  61.3k|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2271:9): [True: 47.2k, False: 14.0k]
  |  |  ------------------
  |  | 2272|  61.3k|        (ctxt->input->end - ctxt->input->cur < INPUT_CHUNK)) \
  |  |  ------------------
  |  |  |  |   63|  47.2k|#define INPUT_CHUNK	250
  |  |  ------------------
  |  |  |  Branch (2272:9): [True: 9.85k, False: 37.4k]
  |  |  ------------------
  |  | 2273|  61.3k|	xmlParserGrow(ctxt);
  ------------------
 8311|  61.3k|    if ((RAW != '<') || (NXT(1) != '/')) {
  ------------------
  |  | 2224|  61.3k|#define RAW (*ctxt->input->cur)
  ------------------
                  if ((RAW != '<') || (NXT(1) != '/')) {
  ------------------
  |  | 2226|  61.3k|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
  |  Branch (8311:9): [True: 16, False: 61.3k]
  |  Branch (8311:25): [True: 20, False: 61.2k]
  ------------------
 8312|     36|	xmlFatalErrMsg(ctxt, XML_ERR_LTSLASH_REQUIRED,
 8313|     36|		       "xmlParseEndTag: '</' not found\n");
 8314|     36|	return;
 8315|     36|    }
 8316|  61.2k|    SKIP(2);
  ------------------
  |  | 2248|  61.2k|#define SKIP(val) do {							\
  |  | 2249|  61.2k|    ctxt->input->cur += (val),ctxt->input->col+=(val);			\
  |  | 2250|  61.2k|    if (*ctxt->input->cur == 0)						\
  |  |  ------------------
  |  |  |  Branch (2250:9): [True: 587, False: 60.6k]
  |  |  ------------------
  |  | 2251|  61.2k|        xmlParserGrow(ctxt);						\
  |  | 2252|  61.2k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2252:12): [Folded, False: 61.2k]
  |  |  ------------------
  ------------------
 8317|       |
 8318|  61.2k|    name = xmlParseNameAndCompare(ctxt,ctxt->name);
 8319|       |
 8320|       |    /*
 8321|       |     * We should definitely be at the ending "S? '>'" part
 8322|       |     */
 8323|  61.2k|    GROW;
  ------------------
  |  | 2271|  61.2k|    if ((!PARSER_PROGRESSIVE(ctxt)) && \
  |  |  ------------------
  |  |  |  |   47|  61.2k|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|  61.2k|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2271:9): [True: 47.2k, False: 14.0k]
  |  |  ------------------
  |  | 2272|  61.2k|        (ctxt->input->end - ctxt->input->cur < INPUT_CHUNK)) \
  |  |  ------------------
  |  |  |  |   63|  47.2k|#define INPUT_CHUNK	250
  |  |  ------------------
  |  |  |  Branch (2272:9): [True: 9.89k, False: 37.3k]
  |  |  ------------------
  |  | 2273|  61.2k|	xmlParserGrow(ctxt);
  ------------------
 8324|  61.2k|    SKIP_BLANKS;
  ------------------
  |  | 2275|  61.2k|#define SKIP_BLANKS xmlSkipBlankChars(ctxt)
  ------------------
 8325|  61.2k|    if ((!IS_BYTE_CHAR(RAW)) || (RAW != '>')) {
  ------------------
  |  |  103|  61.2k|#define IS_BYTE_CHAR(c)	 xmlIsChar_ch(c)
  |  |  ------------------
  |  |  |  |  108|  61.2k|#define xmlIsChar_ch(c)		(((0x9 <= (c)) && ((c) <= 0xa)) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (108:28): [True: 58.4k, False: 2.78k]
  |  |  |  |  |  Branch (108:44): [True: 0, False: 58.4k]
  |  |  |  |  ------------------
  |  |  |  |  109|  61.2k|				 ((c) == 0xd) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (109:6): [True: 0, False: 61.2k]
  |  |  |  |  ------------------
  |  |  |  |  110|  61.2k|				  (0x20 <= (c)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (110:7): [True: 58.4k, False: 2.84k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                  if ((!IS_BYTE_CHAR(RAW)) || (RAW != '>')) {
  ------------------
  |  | 2224|  58.4k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (8325:33): [True: 4.31k, False: 54.1k]
  ------------------
 8326|  7.16k|	xmlFatalErr(ctxt, XML_ERR_GT_REQUIRED, NULL);
 8327|  7.16k|    } else
 8328|  54.1k|	NEXT1;
  ------------------
  |  | 2281|  54.1k|#define NEXT1 {								\
  |  | 2282|  54.1k|	ctxt->input->col++;						\
  |  | 2283|  54.1k|	ctxt->input->cur++;						\
  |  | 2284|  54.1k|	if (*ctxt->input->cur == 0)					\
  |  |  ------------------
  |  |  |  Branch (2284:6): [True: 1.44k, False: 52.6k]
  |  |  ------------------
  |  | 2285|  54.1k|	    xmlParserGrow(ctxt);						\
  |  | 2286|  54.1k|    }
  ------------------
 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|  61.2k|    if (name != (xmlChar*)1) {
  ------------------
  |  Branch (8336:9): [True: 5.66k, False: 55.6k]
  ------------------
 8337|  5.66k|        if (name == NULL) name = BAD_CAST "unparsable";
  ------------------
  |  |   34|  1.82k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (8337:13): [True: 1.82k, False: 3.83k]
  ------------------
 8338|  5.66k|        xmlFatalErrMsgStrIntStr(ctxt, XML_ERR_TAG_NAME_MISMATCH,
 8339|  5.66k|		     "Opening and ending tag mismatch: %s line %d and %s\n",
 8340|  5.66k|		                ctxt->name, line, name);
 8341|  5.66k|    }
 8342|       |
 8343|       |    /*
 8344|       |     * SAX: End of Tag
 8345|       |     */
 8346|  61.2k|    if ((ctxt->sax != NULL) && (ctxt->sax->endElement != NULL) &&
  ------------------
  |  Branch (8346:9): [True: 61.2k, False: 0]
  |  Branch (8346:32): [True: 61.2k, False: 0]
  ------------------
 8347|  61.2k|	(!ctxt->disableSAX))
  ------------------
  |  Branch (8347:2): [True: 58.3k, False: 2.98k]
  ------------------
 8348|  58.3k|        ctxt->sax->endElement(ctxt->userData, ctxt->name);
 8349|       |
 8350|  61.2k|    namePop(ctxt);
 8351|  61.2k|    spacePop(ctxt);
 8352|  61.2k|}
parser.c:xmlParseNameAndCompare:
 3303|   269k|xmlParseNameAndCompare(xmlParserCtxtPtr ctxt, xmlChar const *other) {
 3304|   269k|    register const xmlChar *cmp = other;
 3305|   269k|    register const xmlChar *in;
 3306|   269k|    const xmlChar *ret;
 3307|       |
 3308|   269k|    GROW;
  ------------------
  |  | 2271|   269k|    if ((!PARSER_PROGRESSIVE(ctxt)) && \
  |  |  ------------------
  |  |  |  |   47|   269k|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|   269k|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2271:9): [True: 229k, False: 40.1k]
  |  |  ------------------
  |  | 2272|   269k|        (ctxt->input->end - ctxt->input->cur < INPUT_CHUNK)) \
  |  |  ------------------
  |  |  |  |   63|   229k|#define INPUT_CHUNK	250
  |  |  ------------------
  |  |  |  Branch (2272:9): [True: 19.0k, False: 210k]
  |  |  ------------------
  |  | 2273|   269k|	xmlParserGrow(ctxt);
  ------------------
 3309|       |
 3310|   269k|    in = ctxt->input->cur;
 3311|   603k|    while (*in != 0 && *in == *cmp) {
  ------------------
  |  Branch (3311:12): [True: 600k, False: 3.58k]
  |  Branch (3311:24): [True: 334k, False: 265k]
  ------------------
 3312|   334k|	++in;
 3313|   334k|	++cmp;
 3314|   334k|    }
 3315|   269k|    if (*cmp == 0 && (*in == '>' || IS_BLANK_CH (*in))) {
  ------------------
  |  |  137|  9.55k|#define IS_BLANK_CH(c)  xmlIsBlank_ch(c)
  |  |  ------------------
  |  |  |  |   90|  9.55k|#define xmlIsBlank_ch(c)	(((c) == 0x20) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (90:27): [True: 463, False: 9.09k]
  |  |  |  |  ------------------
  |  |  |  |   91|  9.55k|				 ((0x9 <= (c)) && ((c) <= 0xa)) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (91:7): [True: 6.57k, False: 2.51k]
  |  |  |  |  |  Branch (91:23): [True: 2.46k, False: 4.11k]
  |  |  |  |  ------------------
  |  |  |  |   92|  9.55k|				 ((c) == 0xd))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (92:6): [True: 863, False: 5.76k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (3315:9): [True: 256k, False: 12.8k]
  |  Branch (3315:23): [True: 247k, False: 9.55k]
  ------------------
 3316|       |	/* success */
 3317|   250k|	ctxt->input->col += in - ctxt->input->cur;
 3318|   250k|	ctxt->input->cur = in;
 3319|   250k|	return (const xmlChar*) 1;
 3320|   250k|    }
 3321|       |    /* failure (or end of input buffer), check with full function */
 3322|  18.6k|    ret = xmlParseName (ctxt);
 3323|       |    /* strings coming from the dictionary direct compare possible */
 3324|  18.6k|    if (ret == other) {
  ------------------
  |  Branch (3324:9): [True: 4.71k, False: 13.9k]
  ------------------
 3325|  4.71k|	return (const xmlChar*) 1;
 3326|  4.71k|    }
 3327|  13.9k|    return ret;
 3328|  18.6k|}
parser.c:namePop:
 2138|   634k|{
 2139|   634k|    const xmlChar *ret;
 2140|       |
 2141|   634k|    if ((ctxt == NULL) || (ctxt->nameNr <= 0))
  ------------------
  |  Branch (2141:9): [True: 0, False: 634k]
  |  Branch (2141:27): [True: 2, False: 634k]
  ------------------
 2142|      2|        return (NULL);
 2143|   634k|    ctxt->nameNr--;
 2144|   634k|    if (ctxt->nameNr > 0)
  ------------------
  |  Branch (2144:9): [True: 626k, False: 8.23k]
  ------------------
 2145|   626k|        ctxt->name = ctxt->nameTab[ctxt->nameNr - 1];
 2146|  8.23k|    else
 2147|  8.23k|        ctxt->name = NULL;
 2148|   634k|    ret = ctxt->nameTab[ctxt->nameNr];
 2149|       |    ctxt->nameTab[ctxt->nameNr] = NULL;
 2150|   634k|    return (ret);
 2151|   634k|}
parser.c:spacePop:
 2179|   878k|static int spacePop(xmlParserCtxtPtr ctxt) {
 2180|   878k|    int ret;
 2181|   878k|    if (ctxt->spaceNr <= 0) return(0);
  ------------------
  |  Branch (2181:9): [True: 0, False: 878k]
  ------------------
 2182|   878k|    ctxt->spaceNr--;
 2183|   878k|    if (ctxt->spaceNr > 0)
  ------------------
  |  Branch (2183:9): [True: 878k, False: 14]
  ------------------
 2184|   878k|	ctxt->space = &ctxt->spaceTab[ctxt->spaceNr - 1];
 2185|     14|    else
 2186|     14|        ctxt->space = &ctxt->spaceTab[0];
 2187|   878k|    ret = ctxt->spaceTab[ctxt->spaceNr];
 2188|   878k|    ctxt->spaceTab[ctxt->spaceNr] = -1;
 2189|   878k|    return(ret);
 2190|   878k|}
parser.c:xmlParseContentInternal:
 9540|  9.53k|xmlParseContentInternal(xmlParserCtxtPtr ctxt) {
 9541|  9.53k|    int oldNameNr = ctxt->nameNr;
 9542|  9.53k|    int oldSpaceNr = ctxt->spaceNr;
 9543|  9.53k|    int oldNodeNr = ctxt->nodeNr;
 9544|       |
 9545|  9.53k|    GROW;
  ------------------
  |  | 2271|  9.53k|    if ((!PARSER_PROGRESSIVE(ctxt)) && \
  |  |  ------------------
  |  |  |  |   47|  9.53k|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|  9.53k|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2271:9): [True: 9.53k, False: 0]
  |  |  ------------------
  |  | 2272|  9.53k|        (ctxt->input->end - ctxt->input->cur < INPUT_CHUNK)) \
  |  |  ------------------
  |  |  |  |   63|  9.53k|#define INPUT_CHUNK	250
  |  |  ------------------
  |  |  |  Branch (2272:9): [True: 7.38k, False: 2.14k]
  |  |  ------------------
  |  | 2273|  9.53k|	xmlParserGrow(ctxt);
  ------------------
 9546|  5.73M|    while ((ctxt->input->cur < ctxt->input->end) &&
  ------------------
  |  Branch (9546:12): [True: 5.72M, False: 5.09k]
  ------------------
 9547|  5.72M|	   (PARSER_STOPPED(ctxt) == 0)) {
  ------------------
  |  |   44|  5.72M|#define PARSER_STOPPED(ctxt) ((ctxt)->disableSAX > 1)
  ------------------
  |  Branch (9547:5): [True: 5.72M, False: 399]
  ------------------
 9548|  5.72M|	const xmlChar *cur = ctxt->input->cur;
 9549|       |
 9550|       |	/*
 9551|       |	 * First case : a Processing Instruction.
 9552|       |	 */
 9553|  5.72M|	if ((*cur == '<') && (cur[1] == '?')) {
  ------------------
  |  Branch (9553:6): [True: 1.02M, False: 4.70M]
  |  Branch (9553:23): [True: 66.4k, False: 954k]
  ------------------
 9554|  66.4k|	    xmlParsePI(ctxt);
 9555|  66.4k|	}
 9556|       |
 9557|       |	/*
 9558|       |	 * Second case : a CDSection
 9559|       |	 */
 9560|       |	/* 2.6.0 test was *cur not RAW */
 9561|  5.66M|	else if (CMP9(CUR_PTR, '<', '!', '[', 'C', 'D', 'A', 'T', 'A', '[')) {
  ------------------
  |  | 2242|  5.66M|  ( CMP8( s, c1, c2, c3, c4, c5, c6, c7, c8 ) && \
  |  |  ------------------
  |  |  |  | 2240|  11.3M|  ( CMP7( s, c1, c2, c3, c4, c5, c6, c7 ) && ((unsigned char *) s)[ 7 ] == c8 )
  |  |  |  |  ------------------
  |  |  |  |  |  | 2238|  11.3M|  ( CMP6( s, c1, c2, c3, c4, c5, c6 ) && ((unsigned char *) s)[ 6 ] == c7 )
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  | 2236|  11.3M|  ( CMP5( s, c1, c2, c3, c4, c5 ) && ((unsigned char *) s)[ 5 ] == c6 )
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  | 2234|  11.3M|  ( CMP4( s, c1, c2, c3, c4 ) && ((unsigned char *) s)[ 4 ] == c5 )
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  | 2231|  11.3M|  ( ((unsigned char *) s)[ 0 ] == c1 && ((unsigned char *) s)[ 1 ] == c2 && \
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  Branch (2231:5): [True: 954k, False: 4.70M]
  |  |  |  |  |  |  |  |  |  |  |  |  |  Branch (2231:41): [True: 99.5k, False: 855k]
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  | 2232|  5.66M|    ((unsigned char *) s)[ 2 ] == c3 && ((unsigned char *) s)[ 3 ] == c4 )
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  Branch (2232:5): [True: 50.5k, False: 49.0k]
  |  |  |  |  |  |  |  |  |  |  |  |  |  Branch (2232:41): [True: 49.4k, False: 1.07k]
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (2234:34): [True: 48.9k, False: 449]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (2236:38): [True: 48.5k, False: 484]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (2238:42): [True: 48.2k, False: 288]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2240:46): [True: 47.9k, False: 230]
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 2243|  5.66M|    ((unsigned char *) s)[ 8 ] == c9 )
  |  |  ------------------
  |  |  |  Branch (2243:5): [True: 47.6k, False: 362]
  |  |  ------------------
  ------------------
 9562|  47.6k|	    xmlParseCDSect(ctxt);
 9563|  47.6k|	}
 9564|       |
 9565|       |	/*
 9566|       |	 * Third case :  a comment
 9567|       |	 */
 9568|  5.61M|	else if ((*cur == '<') && (NXT(1) == '!') &&
  ------------------
  |  | 2226|   907k|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
  |  Branch (9568:11): [True: 907k, False: 4.70M]
  |  Branch (9568:28): [True: 51.9k, False: 855k]
  ------------------
 9569|  51.9k|		 (NXT(2) == '-') && (NXT(3) == '-')) {
  ------------------
  |  | 2226|  51.9k|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
              		 (NXT(2) == '-') && (NXT(3) == '-')) {
  ------------------
  |  | 2226|  33.9k|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
  |  Branch (9569:4): [True: 33.9k, False: 17.9k]
  |  Branch (9569:23): [True: 33.6k, False: 280]
  ------------------
 9570|  33.6k|	    xmlParseComment(ctxt);
 9571|  33.6k|	}
 9572|       |
 9573|       |	/*
 9574|       |	 * Fourth case :  a sub-element.
 9575|       |	 */
 9576|  5.58M|	else if (*cur == '<') {
  ------------------
  |  Branch (9576:11): [True: 873k, False: 4.70M]
  ------------------
 9577|   873k|            if (NXT(1) == '/') {
  ------------------
  |  | 2226|   873k|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
  |  Branch (9577:17): [True: 236k, False: 637k]
  ------------------
 9578|   236k|                if (ctxt->nameNr <= oldNameNr)
  ------------------
  |  Branch (9578:21): [True: 4.03k, False: 232k]
  ------------------
 9579|  4.03k|                    break;
 9580|   232k|	        xmlParseElementEnd(ctxt);
 9581|   637k|            } else {
 9582|   637k|	        xmlParseElementStart(ctxt);
 9583|   637k|            }
 9584|   873k|	}
 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.70M|	else if (*cur == '&') {
  ------------------
  |  Branch (9591:11): [True: 78.3k, False: 4.62M]
  ------------------
 9592|  78.3k|	    xmlParseReference(ctxt);
 9593|  78.3k|	}
 9594|       |
 9595|       |	/*
 9596|       |	 * Last case, text. Note that References are handled directly.
 9597|       |	 */
 9598|  4.62M|	else {
 9599|  4.62M|	    xmlParseCharDataInternal(ctxt, 0);
 9600|  4.62M|	}
 9601|       |
 9602|  5.72M|	SHRINK;
  ------------------
  |  | 2267|  5.72M|    if (!PARSER_PROGRESSIVE(ctxt)) \
  |  |  ------------------
  |  |  |  |   47|  5.72M|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|  5.72M|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2267:9): [True: 5.72M, False: 0]
  |  |  ------------------
  |  | 2268|  5.72M|	xmlParserShrink(ctxt);
  ------------------
 9603|  5.72M|	GROW;
  ------------------
  |  | 2271|  5.72M|    if ((!PARSER_PROGRESSIVE(ctxt)) && \
  |  |  ------------------
  |  |  |  |   47|  5.72M|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|  5.72M|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2271:9): [True: 5.72M, False: 0]
  |  |  ------------------
  |  | 2272|  5.72M|        (ctxt->input->end - ctxt->input->cur < INPUT_CHUNK)) \
  |  |  ------------------
  |  |  |  |   63|  5.72M|#define INPUT_CHUNK	250
  |  |  ------------------
  |  |  |  Branch (2272:9): [True: 125k, False: 5.59M]
  |  |  ------------------
  |  | 2273|  5.72M|	xmlParserGrow(ctxt);
  ------------------
 9604|  5.72M|    }
 9605|       |
 9606|  9.53k|    if ((ctxt->nameNr > oldNameNr) &&
  ------------------
  |  Branch (9606:9): [True: 1.42k, False: 8.11k]
  ------------------
 9607|  1.42k|        (ctxt->input->cur >= ctxt->input->end) &&
  ------------------
  |  Branch (9607:9): [True: 1.26k, False: 159]
  ------------------
 9608|  1.26k|        (ctxt->wellFormed)) {
  ------------------
  |  Branch (9608:9): [True: 39, False: 1.22k]
  ------------------
 9609|     39|        const xmlChar *name = ctxt->nameTab[ctxt->nameNr - 1];
 9610|     39|        int line = ctxt->pushTab[ctxt->nameNr - 1].line;
 9611|     39|        xmlFatalErrMsgStrIntStr(ctxt, XML_ERR_TAG_NOT_FINISHED,
 9612|     39|                "Premature end of data in tag %s line %d\n",
 9613|     39|                name, line, NULL);
 9614|     39|    }
 9615|       |
 9616|       |    /*
 9617|       |     * Clean up in error case
 9618|       |     */
 9619|       |
 9620|  62.9k|    while (ctxt->nodeNr > oldNodeNr)
  ------------------
  |  Branch (9620:12): [True: 53.3k, False: 9.53k]
  ------------------
 9621|  53.3k|        nodePop(ctxt);
 9622|       |
 9623|  82.7k|    while (ctxt->nameNr > oldNameNr) {
  ------------------
  |  Branch (9623:12): [True: 73.1k, False: 9.53k]
  ------------------
 9624|  73.1k|        xmlStartTag *tag = &ctxt->pushTab[ctxt->nameNr - 1];
 9625|       |
 9626|  73.1k|        if (tag->nsNr != 0)
  ------------------
  |  Branch (9626:13): [True: 14.1k, False: 58.9k]
  ------------------
 9627|  14.1k|            xmlParserNsPop(ctxt, tag->nsNr);
 9628|       |
 9629|  73.1k|        namePop(ctxt);
 9630|  73.1k|    }
 9631|       |
 9632|  82.7k|    while (ctxt->spaceNr > oldSpaceNr)
  ------------------
  |  Branch (9632:12): [True: 73.1k, False: 9.53k]
  ------------------
 9633|  73.1k|        spacePop(ctxt);
 9634|  9.53k|}
parser.c:xmlFatalErrMsgStrIntStr:
  332|   168k|{
  333|   168k|    xmlCtxtErr(ctxt, NULL, XML_FROM_PARSER, error, XML_ERR_FATAL,
  334|       |               str1, str2, NULL, val, msg, str1, val, str2);
  335|   168k|}
parser.c:xmlParseElementStart:
 9699|   644k|xmlParseElementStart(xmlParserCtxtPtr ctxt) {
 9700|   644k|    int maxDepth = (ctxt->options & XML_PARSE_HUGE) ? 2048 : 256;
  ------------------
  |  Branch (9700:20): [True: 386k, False: 257k]
  ------------------
 9701|   644k|    const xmlChar *name;
 9702|   644k|    const xmlChar *prefix = NULL;
 9703|   644k|    const xmlChar *URI = NULL;
 9704|   644k|    xmlParserNodeInfo node_info;
 9705|   644k|    int line;
 9706|   644k|    xmlNodePtr cur;
 9707|   644k|    int nbNs = 0;
 9708|       |
 9709|   644k|    if (ctxt->nameNr > maxDepth) {
  ------------------
  |  Branch (9709:9): [True: 16, False: 644k]
  ------------------
 9710|     16|        xmlFatalErrMsgInt(ctxt, XML_ERR_RESOURCE_LIMIT,
 9711|     16|                "Excessive depth in document: %d use XML_PARSE_HUGE option\n",
 9712|     16|                ctxt->nameNr);
 9713|     16|	return(-1);
 9714|     16|    }
 9715|       |
 9716|       |    /* Capture start position */
 9717|   644k|    if (ctxt->record_info) {
  ------------------
  |  Branch (9717:9): [True: 0, False: 644k]
  ------------------
 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|   644k|    if (ctxt->spaceNr == 0)
  ------------------
  |  Branch (9723:9): [True: 0, False: 644k]
  ------------------
 9724|      0|	spacePush(ctxt, -1);
 9725|   644k|    else if (*ctxt->space == -2)
  ------------------
  |  Branch (9725:14): [True: 105k, False: 539k]
  ------------------
 9726|   105k|	spacePush(ctxt, -1);
 9727|   539k|    else
 9728|   539k|	spacePush(ctxt, *ctxt->space);
 9729|       |
 9730|   644k|    line = ctxt->input->line;
 9731|   644k|#ifdef LIBXML_SAX1_ENABLED
 9732|   644k|    if (ctxt->sax2)
  ------------------
  |  Branch (9732:9): [True: 420k, False: 224k]
  ------------------
 9733|   420k|#endif /* LIBXML_SAX1_ENABLED */
 9734|   420k|        name = xmlParseStartTag2(ctxt, &prefix, &URI, &nbNs);
 9735|   224k|#ifdef LIBXML_SAX1_ENABLED
 9736|   224k|    else
 9737|   224k|	name = xmlParseStartTag(ctxt);
 9738|   644k|#endif /* LIBXML_SAX1_ENABLED */
 9739|   644k|    if (name == NULL) {
  ------------------
  |  Branch (9739:9): [True: 28.7k, False: 616k]
  ------------------
 9740|  28.7k|	spacePop(ctxt);
 9741|  28.7k|        return(-1);
 9742|  28.7k|    }
 9743|   616k|    nameNsPush(ctxt, name, prefix, URI, line, nbNs);
 9744|   616k|    cur = ctxt->node;
 9745|       |
 9746|   616k|#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|   616k|    if (ctxt->validate && ctxt->wellFormed && ctxt->myDoc &&
  ------------------
  |  Branch (9752:9): [True: 84.1k, False: 531k]
  |  Branch (9752:27): [True: 8.61k, False: 75.5k]
  |  Branch (9752:47): [True: 8.61k, False: 0]
  ------------------
 9753|  8.61k|        ctxt->node && (ctxt->node == ctxt->myDoc->children))
  ------------------
  |  Branch (9753:9): [True: 8.61k, False: 0]
  |  Branch (9753:23): [True: 0, False: 8.61k]
  ------------------
 9754|      0|        ctxt->valid &= xmlValidateRoot(&ctxt->vctxt, ctxt->myDoc);
 9755|   616k|#endif /* LIBXML_VALID_ENABLED */
 9756|       |
 9757|       |    /*
 9758|       |     * Check for an Empty Element.
 9759|       |     */
 9760|   616k|    if ((RAW == '/') && (NXT(1) == '>')) {
  ------------------
  |  | 2224|   616k|#define RAW (*ctxt->input->cur)
  ------------------
                  if ((RAW == '/') && (NXT(1) == '>')) {
  ------------------
  |  | 2226|   167k|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
  |  Branch (9760:9): [True: 167k, False: 448k]
  |  Branch (9760:25): [True: 159k, False: 8.11k]
  ------------------
 9761|   159k|        SKIP(2);
  ------------------
  |  | 2248|   159k|#define SKIP(val) do {							\
  |  | 2249|   159k|    ctxt->input->cur += (val),ctxt->input->col+=(val);			\
  |  | 2250|   159k|    if (*ctxt->input->cur == 0)						\
  |  |  ------------------
  |  |  |  Branch (2250:9): [True: 888, False: 158k]
  |  |  ------------------
  |  | 2251|   159k|        xmlParserGrow(ctxt);						\
  |  | 2252|   159k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2252:12): [Folded, False: 159k]
  |  |  ------------------
  ------------------
 9762|   159k|	if (ctxt->sax2) {
  ------------------
  |  Branch (9762:6): [True: 64.6k, False: 94.9k]
  ------------------
 9763|  64.6k|	    if ((ctxt->sax != NULL) && (ctxt->sax->endElementNs != NULL) &&
  ------------------
  |  Branch (9763:10): [True: 64.6k, False: 0]
  |  Branch (9763:33): [True: 64.6k, False: 0]
  ------------------
 9764|  64.6k|		(!ctxt->disableSAX))
  ------------------
  |  Branch (9764:3): [True: 42.4k, False: 22.1k]
  ------------------
 9765|  42.4k|		ctxt->sax->endElementNs(ctxt->userData, name, prefix, URI);
 9766|  64.6k|#ifdef LIBXML_SAX1_ENABLED
 9767|  94.9k|	} else {
 9768|  94.9k|	    if ((ctxt->sax != NULL) && (ctxt->sax->endElement != NULL) &&
  ------------------
  |  Branch (9768:10): [True: 94.9k, False: 0]
  |  Branch (9768:33): [True: 94.9k, False: 0]
  ------------------
 9769|  94.9k|		(!ctxt->disableSAX))
  ------------------
  |  Branch (9769:3): [True: 83.1k, False: 11.7k]
  ------------------
 9770|  83.1k|		ctxt->sax->endElement(ctxt->userData, name);
 9771|  94.9k|#endif /* LIBXML_SAX1_ENABLED */
 9772|  94.9k|	}
 9773|   159k|	namePop(ctxt);
 9774|   159k|	spacePop(ctxt);
 9775|   159k|	if (nbNs > 0)
  ------------------
  |  Branch (9775:6): [True: 7.77k, False: 151k]
  ------------------
 9776|  7.77k|	    xmlParserNsPop(ctxt, nbNs);
 9777|   159k|	if (cur != NULL && ctxt->record_info) {
  ------------------
  |  Branch (9777:6): [True: 126k, False: 33.2k]
  |  Branch (9777:21): [True: 0, False: 126k]
  ------------------
 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|   159k|	return(1);
 9785|   159k|    }
 9786|   456k|    if (RAW == '>') {
  ------------------
  |  | 2224|   456k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (9786:9): [True: 309k, False: 146k]
  ------------------
 9787|   309k|        NEXT1;
  ------------------
  |  | 2281|   309k|#define NEXT1 {								\
  |  | 2282|   309k|	ctxt->input->col++;						\
  |  | 2283|   309k|	ctxt->input->cur++;						\
  |  | 2284|   309k|	if (*ctxt->input->cur == 0)					\
  |  |  ------------------
  |  |  |  Branch (2284:6): [True: 502, False: 309k]
  |  |  ------------------
  |  | 2285|   309k|	    xmlParserGrow(ctxt);						\
  |  | 2286|   309k|    }
  ------------------
 9788|   309k|        if (cur != NULL && ctxt->record_info) {
  ------------------
  |  Branch (9788:13): [True: 254k, False: 55.7k]
  |  Branch (9788:28): [True: 0, False: 254k]
  ------------------
 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|   309k|    } else {
 9795|   146k|        xmlFatalErrMsgStrIntStr(ctxt, XML_ERR_GT_REQUIRED,
 9796|   146k|		     "Couldn't find end of Start Tag %s line %d\n",
 9797|   146k|		                name, line, NULL);
 9798|       |
 9799|       |	/*
 9800|       |	 * end of parsing of this node.
 9801|       |	 */
 9802|   146k|	nodePop(ctxt);
 9803|   146k|	namePop(ctxt);
 9804|   146k|	spacePop(ctxt);
 9805|   146k|	if (nbNs > 0)
  ------------------
  |  Branch (9805:6): [True: 70.6k, False: 75.9k]
  ------------------
 9806|  70.6k|	    xmlParserNsPop(ctxt, nbNs);
 9807|   146k|	return(-1);
 9808|   146k|    }
 9809|       |
 9810|   309k|    return(0);
 9811|   456k|}
parser.c:spacePush:
 2153|  1.01M|static int spacePush(xmlParserCtxtPtr ctxt, int val) {
 2154|  1.01M|    if (ctxt->spaceNr >= ctxt->spaceMax) {
  ------------------
  |  Branch (2154:9): [True: 80.6k, False: 935k]
  ------------------
 2155|  80.6k|        int *tmp;
 2156|  80.6k|        int newSize;
 2157|       |
 2158|  80.6k|        newSize = xmlGrowCapacity(ctxt->spaceMax, sizeof(tmp[0]),
 2159|  80.6k|                                  10, XML_MAX_ITEMS);
  ------------------
  |  |   13|  80.6k|#define XML_MAX_ITEMS 1000000000 /* 1 billion */
  ------------------
 2160|  80.6k|        if (newSize < 0) {
  ------------------
  |  Branch (2160:13): [True: 0, False: 80.6k]
  ------------------
 2161|      0|	    xmlErrMemory(ctxt);
 2162|      0|	    return(-1);
 2163|      0|        }
 2164|       |
 2165|  80.6k|        tmp = xmlRealloc(ctxt->spaceTab, newSize * sizeof(tmp[0]));
 2166|  80.6k|        if (tmp == NULL) {
  ------------------
  |  Branch (2166:13): [True: 35, False: 80.6k]
  ------------------
 2167|     35|	    xmlErrMemory(ctxt);
 2168|     35|	    return(-1);
 2169|     35|	}
 2170|  80.6k|	ctxt->spaceTab = tmp;
 2171|       |
 2172|  80.6k|        ctxt->spaceMax = newSize;
 2173|  80.6k|    }
 2174|  1.01M|    ctxt->spaceTab[ctxt->spaceNr] = val;
 2175|  1.01M|    ctxt->space = &ctxt->spaceTab[ctxt->spaceNr];
 2176|  1.01M|    return(ctxt->spaceNr++);
 2177|  1.01M|}
parser.c:xmlParseStartTag2:
 8751|   655k|                  const xmlChar **URI, int *nbNsPtr) {
 8752|   655k|    xmlHashedString hlocalname;
 8753|   655k|    xmlHashedString hprefix;
 8754|   655k|    xmlHashedString hattname;
 8755|   655k|    xmlHashedString haprefix;
 8756|   655k|    const xmlChar *localname;
 8757|   655k|    const xmlChar *prefix;
 8758|   655k|    const xmlChar *attname;
 8759|   655k|    const xmlChar *aprefix;
 8760|   655k|    const xmlChar *uri;
 8761|   655k|    xmlChar *attvalue = NULL;
 8762|   655k|    const xmlChar **atts = ctxt->atts;
 8763|   655k|    unsigned attrHashSize = 0;
 8764|   655k|    int maxatts = ctxt->maxatts;
 8765|   655k|    int nratts, nbatts, nbdef;
 8766|   655k|    int i, j, nbNs, nbTotalDef, attval, nsIndex, maxAtts;
 8767|   655k|    int alloc = 0;
 8768|   655k|    int numNsErr = 0;
 8769|   655k|    int numDupErr = 0;
 8770|       |
 8771|   655k|    if (RAW != '<') return(NULL);
  ------------------
  |  | 2224|   655k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (8771:9): [True: 0, False: 655k]
  ------------------
 8772|   655k|    NEXT1;
  ------------------
  |  | 2281|   655k|#define NEXT1 {								\
  |  | 2282|   655k|	ctxt->input->col++;						\
  |  | 2283|   655k|	ctxt->input->cur++;						\
  |  | 2284|   655k|	if (*ctxt->input->cur == 0)					\
  |  |  ------------------
  |  |  |  Branch (2284:6): [True: 821, False: 654k]
  |  |  ------------------
  |  | 2285|   655k|	    xmlParserGrow(ctxt);						\
  |  | 2286|   655k|    }
  ------------------
 8773|       |
 8774|   655k|    nbatts = 0;
 8775|   655k|    nratts = 0;
 8776|   655k|    nbdef = 0;
 8777|   655k|    nbNs = 0;
 8778|   655k|    nbTotalDef = 0;
 8779|   655k|    attval = 0;
 8780|       |
 8781|   655k|    if (xmlParserNsStartElement(ctxt->nsdb) < 0) {
  ------------------
  |  Branch (8781:9): [True: 0, False: 655k]
  ------------------
 8782|      0|        xmlErrMemory(ctxt);
 8783|      0|        return(NULL);
 8784|      0|    }
 8785|       |
 8786|   655k|    hlocalname = xmlParseQNameHashed(ctxt, &hprefix);
 8787|   655k|    if (hlocalname.name == NULL) {
  ------------------
  |  Branch (8787:9): [True: 17.9k, False: 637k]
  ------------------
 8788|  17.9k|	xmlFatalErrMsg(ctxt, XML_ERR_NAME_REQUIRED,
 8789|  17.9k|		       "StartTag: invalid element name\n");
 8790|  17.9k|        return(NULL);
 8791|  17.9k|    }
 8792|   637k|    localname = hlocalname.name;
 8793|   637k|    prefix = hprefix.name;
 8794|       |
 8795|       |    /*
 8796|       |     * Now parse the attributes, it ends up with the ending
 8797|       |     *
 8798|       |     * (S Attribute)* S?
 8799|       |     */
 8800|   637k|    SKIP_BLANKS;
  ------------------
  |  | 2275|   637k|#define SKIP_BLANKS xmlSkipBlankChars(ctxt)
  ------------------
 8801|   637k|    GROW;
  ------------------
  |  | 2271|   637k|    if ((!PARSER_PROGRESSIVE(ctxt)) && \
  |  |  ------------------
  |  |  |  |   47|   637k|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|   637k|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2271:9): [True: 403k, False: 234k]
  |  |  ------------------
  |  | 2272|   637k|        (ctxt->input->end - ctxt->input->cur < INPUT_CHUNK)) \
  |  |  ------------------
  |  |  |  |   63|   403k|#define INPUT_CHUNK	250
  |  |  ------------------
  |  |  |  Branch (2272:9): [True: 28.7k, False: 374k]
  |  |  ------------------
  |  | 2273|   637k|	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|   742k|    while (((RAW != '>') &&
  ------------------
  |  | 2224|   742k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (8827:13): [True: 440k, False: 302k]
  ------------------
 8828|   440k|	   ((RAW != '/') || (NXT(1) != '>')) &&
  ------------------
  |  | 2224|   440k|#define RAW (*ctxt->input->cur)
  ------------------
              	   ((RAW != '/') || (NXT(1) != '>')) &&
  ------------------
  |  | 2226|   154k|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
  |  Branch (8828:6): [True: 285k, False: 154k]
  |  Branch (8828:22): [True: 5.76k, False: 148k]
  ------------------
 8829|   291k|	   (IS_BYTE_CHAR(RAW))) && (PARSER_STOPPED(ctxt) == 0)) {
  ------------------
  |  |  103|   291k|#define IS_BYTE_CHAR(c)	 xmlIsChar_ch(c)
  |  |  ------------------
  |  |  |  |  108|   291k|#define xmlIsChar_ch(c)		(((0x9 <= (c)) && ((c) <= 0xa)) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (108:28): [True: 283k, False: 7.66k]
  |  |  |  |  |  Branch (108:44): [True: 0, False: 283k]
  |  |  |  |  ------------------
  |  |  |  |  109|   291k|				 ((c) == 0xd) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (109:6): [True: 0, False: 291k]
  |  |  |  |  ------------------
  |  |  |  |  110|   291k|				  (0x20 <= (c)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (110:7): [True: 283k, False: 8.20k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
              	   (IS_BYTE_CHAR(RAW))) && (PARSER_STOPPED(ctxt) == 0)) {
  ------------------
  |  |   44|   283k|#define PARSER_STOPPED(ctxt) ((ctxt)->disableSAX > 1)
  ------------------
  |  Branch (8829:29): [True: 283k, False: 33]
  ------------------
 8830|   283k|	int len = -1;
 8831|       |
 8832|   283k|	hattname = xmlParseAttribute2(ctxt, prefix, localname,
 8833|   283k|                                          &haprefix, &attvalue, &len,
 8834|   283k|                                          &alloc);
 8835|   283k|        if (hattname.name == NULL)
  ------------------
  |  Branch (8835:13): [True: 101k, False: 181k]
  ------------------
 8836|   101k|	    break;
 8837|   181k|        if (attvalue == NULL)
  ------------------
  |  Branch (8837:13): [True: 18.2k, False: 163k]
  ------------------
 8838|  18.2k|            goto next_attr;
 8839|   163k|        attname = hattname.name;
 8840|   163k|        aprefix = haprefix.name;
 8841|   163k|	if (len < 0) len = xmlStrlen(attvalue);
  ------------------
  |  Branch (8841:6): [True: 0, False: 163k]
  ------------------
 8842|       |
 8843|   163k|        if ((attname == ctxt->str_xmlns) && (aprefix == NULL)) {
  ------------------
  |  Branch (8843:13): [True: 15.2k, False: 148k]
  |  Branch (8843:45): [True: 15.0k, False: 263]
  ------------------
 8844|  15.0k|            xmlHashedString huri;
 8845|  15.0k|            xmlURIPtr parsedUri;
 8846|       |
 8847|  15.0k|            huri = xmlDictLookupHashed(ctxt->dict, attvalue, len);
 8848|  15.0k|            uri = huri.name;
 8849|  15.0k|            if (uri == NULL) {
  ------------------
  |  Branch (8849:17): [True: 1, False: 15.0k]
  ------------------
 8850|      1|                xmlErrMemory(ctxt);
 8851|      1|                goto next_attr;
 8852|      1|            }
 8853|  15.0k|            if (*uri != 0) {
  ------------------
  |  Branch (8853:17): [True: 6.54k, False: 8.49k]
  ------------------
 8854|  6.54k|                if (xmlParseURISafe((const char *) uri, &parsedUri) < 0) {
  ------------------
  |  Branch (8854:21): [True: 16, False: 6.52k]
  ------------------
 8855|     16|                    xmlErrMemory(ctxt);
 8856|     16|                    goto next_attr;
 8857|     16|                }
 8858|  6.52k|                if (parsedUri == NULL) {
  ------------------
  |  Branch (8858:21): [True: 1.81k, False: 4.71k]
  ------------------
 8859|  1.81k|                    xmlNsErr(ctxt, XML_WAR_NS_URI,
 8860|  1.81k|                             "xmlns: '%s' is not a valid URI\n",
 8861|  1.81k|                                       uri, NULL, NULL);
 8862|  4.71k|                } else {
 8863|  4.71k|                    if (parsedUri->scheme == NULL) {
  ------------------
  |  Branch (8863:25): [True: 2.81k, False: 1.89k]
  ------------------
 8864|  2.81k|                        xmlNsWarn(ctxt, XML_WAR_NS_URI_RELATIVE,
 8865|  2.81k|                                  "xmlns: URI %s is not absolute\n",
 8866|  2.81k|                                  uri, NULL, NULL);
 8867|  2.81k|                    }
 8868|  4.71k|                    xmlFreeURI(parsedUri);
 8869|  4.71k|                }
 8870|  6.52k|                if (uri == ctxt->str_xml_ns) {
  ------------------
  |  Branch (8870:21): [True: 196, False: 6.32k]
  ------------------
 8871|    196|                    if (attname != ctxt->str_xml) {
  ------------------
  |  Branch (8871:25): [True: 196, False: 0]
  ------------------
 8872|    196|                        xmlNsErr(ctxt, XML_NS_ERR_XML_NAMESPACE,
 8873|    196|                     "xml namespace URI cannot be the default namespace\n",
 8874|    196|                                 NULL, NULL, NULL);
 8875|    196|                    }
 8876|    196|                    goto next_attr;
 8877|    196|                }
 8878|  6.32k|                if ((len == 29) &&
  ------------------
  |  Branch (8878:21): [True: 888, False: 5.44k]
  ------------------
 8879|    888|                    (xmlStrEqual(uri,
  ------------------
  |  Branch (8879:21): [True: 397, False: 491]
  ------------------
 8880|    888|                             BAD_CAST "http://www.w3.org/2000/xmlns/"))) {
  ------------------
  |  |   34|    888|#define BAD_CAST (xmlChar *)
  ------------------
 8881|    397|                    xmlNsErr(ctxt, XML_NS_ERR_XML_NAMESPACE,
 8882|    397|                         "reuse of the xmlns namespace name is forbidden\n",
 8883|    397|                             NULL, NULL, NULL);
 8884|    397|                    goto next_attr;
 8885|    397|                }
 8886|  6.32k|            }
 8887|       |
 8888|  14.4k|            if (xmlParserNsPush(ctxt, NULL, &huri, NULL, 0) > 0)
  ------------------
  |  Branch (8888:17): [True: 10.5k, False: 3.90k]
  ------------------
 8889|  10.5k|                nbNs++;
 8890|   148k|        } else if (aprefix == ctxt->str_xmlns) {
  ------------------
  |  Branch (8890:20): [True: 25.1k, False: 123k]
  ------------------
 8891|  25.1k|            xmlHashedString huri;
 8892|  25.1k|            xmlURIPtr parsedUri;
 8893|       |
 8894|  25.1k|            huri = xmlDictLookupHashed(ctxt->dict, attvalue, len);
 8895|  25.1k|            uri = huri.name;
 8896|  25.1k|            if (uri == NULL) {
  ------------------
  |  Branch (8896:17): [True: 1, False: 25.1k]
  ------------------
 8897|      1|                xmlErrMemory(ctxt);
 8898|      1|                goto next_attr;
 8899|      1|            }
 8900|       |
 8901|  25.1k|            if (attname == ctxt->str_xml) {
  ------------------
  |  Branch (8901:17): [True: 608, False: 24.5k]
  ------------------
 8902|    608|                if (uri != ctxt->str_xml_ns) {
  ------------------
  |  Branch (8902:21): [True: 338, False: 270]
  ------------------
 8903|    338|                    xmlNsErr(ctxt, XML_NS_ERR_XML_NAMESPACE,
 8904|    338|                             "xml namespace prefix mapped to wrong URI\n",
 8905|    338|                             NULL, NULL, NULL);
 8906|    338|                }
 8907|       |                /*
 8908|       |                 * Do not keep a namespace definition node
 8909|       |                 */
 8910|    608|                goto next_attr;
 8911|    608|            }
 8912|  24.5k|            if (uri == ctxt->str_xml_ns) {
  ------------------
  |  Branch (8912:17): [True: 268, False: 24.2k]
  ------------------
 8913|    268|                if (attname != ctxt->str_xml) {
  ------------------
  |  Branch (8913:21): [True: 268, False: 0]
  ------------------
 8914|    268|                    xmlNsErr(ctxt, XML_NS_ERR_XML_NAMESPACE,
 8915|    268|                             "xml namespace URI mapped to wrong prefix\n",
 8916|    268|                             NULL, NULL, NULL);
 8917|    268|                }
 8918|    268|                goto next_attr;
 8919|    268|            }
 8920|  24.2k|            if (attname == ctxt->str_xmlns) {
  ------------------
  |  Branch (8920:17): [True: 227, False: 24.0k]
  ------------------
 8921|    227|                xmlNsErr(ctxt, XML_NS_ERR_XML_NAMESPACE,
 8922|    227|                         "redefinition of the xmlns prefix is forbidden\n",
 8923|    227|                         NULL, NULL, NULL);
 8924|    227|                goto next_attr;
 8925|    227|            }
 8926|  24.0k|            if ((len == 29) &&
  ------------------
  |  Branch (8926:17): [True: 390, False: 23.6k]
  ------------------
 8927|    390|                (xmlStrEqual(uri,
  ------------------
  |  Branch (8927:17): [True: 226, False: 164]
  ------------------
 8928|    390|                             BAD_CAST "http://www.w3.org/2000/xmlns/"))) {
  ------------------
  |  |   34|    390|#define BAD_CAST (xmlChar *)
  ------------------
 8929|    226|                xmlNsErr(ctxt, XML_NS_ERR_XML_NAMESPACE,
 8930|    226|                         "reuse of the xmlns namespace name is forbidden\n",
 8931|    226|                         NULL, NULL, NULL);
 8932|    226|                goto next_attr;
 8933|    226|            }
 8934|  23.8k|            if ((uri == NULL) || (uri[0] == 0)) {
  ------------------
  |  Branch (8934:17): [True: 0, False: 23.8k]
  |  Branch (8934:34): [True: 210, False: 23.5k]
  ------------------
 8935|    210|                xmlNsErr(ctxt, XML_NS_ERR_XML_NAMESPACE,
 8936|    210|                         "xmlns:%s: Empty XML namespace is not allowed\n",
 8937|    210|                              attname, NULL, NULL);
 8938|    210|                goto next_attr;
 8939|  23.5k|            } else {
 8940|  23.5k|                if (xmlParseURISafe((const char *) uri, &parsedUri) < 0) {
  ------------------
  |  Branch (8940:21): [True: 6, False: 23.5k]
  ------------------
 8941|      6|                    xmlErrMemory(ctxt);
 8942|      6|                    goto next_attr;
 8943|      6|                }
 8944|  23.5k|                if (parsedUri == NULL) {
  ------------------
  |  Branch (8944:21): [True: 6.43k, False: 17.1k]
  ------------------
 8945|  6.43k|                    xmlNsErr(ctxt, XML_WAR_NS_URI,
 8946|  6.43k|                         "xmlns:%s: '%s' is not a valid URI\n",
 8947|  6.43k|                                       attname, uri, NULL);
 8948|  17.1k|                } else {
 8949|  17.1k|                    if ((ctxt->pedantic) && (parsedUri->scheme == NULL)) {
  ------------------
  |  Branch (8949:25): [True: 7.01k, False: 10.1k]
  |  Branch (8949:45): [True: 5.45k, False: 1.56k]
  ------------------
 8950|  5.45k|                        xmlNsWarn(ctxt, XML_WAR_NS_URI_RELATIVE,
 8951|  5.45k|                                  "xmlns:%s: URI %s is not absolute\n",
 8952|  5.45k|                                  attname, uri, NULL);
 8953|  5.45k|                    }
 8954|  17.1k|                    xmlFreeURI(parsedUri);
 8955|  17.1k|                }
 8956|  23.5k|            }
 8957|       |
 8958|  23.5k|            if (xmlParserNsPush(ctxt, &hattname, &huri, NULL, 0) > 0)
  ------------------
  |  Branch (8958:17): [True: 21.5k, False: 2.04k]
  ------------------
 8959|  21.5k|                nbNs++;
 8960|   123k|        } else {
 8961|       |            /*
 8962|       |             * Populate attributes array, see above for repurposing
 8963|       |             * of xmlChar pointers.
 8964|       |             */
 8965|   123k|            if ((atts == NULL) || (nbatts + 5 > maxatts)) {
  ------------------
  |  Branch (8965:17): [True: 11.0k, False: 112k]
  |  Branch (8965:35): [True: 9.07k, False: 103k]
  ------------------
 8966|  20.1k|                int res = xmlCtxtGrowAttrs(ctxt);
 8967|       |
 8968|  20.1k|                maxatts = ctxt->maxatts;
 8969|  20.1k|                atts = ctxt->atts;
 8970|       |
 8971|  20.1k|                if (res < 0)
  ------------------
  |  Branch (8971:21): [True: 6, False: 20.1k]
  ------------------
 8972|      6|                    goto next_attr;
 8973|  20.1k|            }
 8974|   123k|            ctxt->attallocs[nratts++] = (hattname.hashValue & 0x7FFFFFFF) |
 8975|   123k|                                        ((unsigned) alloc << 31);
 8976|   123k|            atts[nbatts++] = attname;
 8977|   123k|            atts[nbatts++] = aprefix;
 8978|   123k|            atts[nbatts++] = XML_INT_TO_PTR(haprefix.hashValue);
  ------------------
  |  |   59|   123k|#define XML_INT_TO_PTR(i) ((void *) (XML_INTPTR_T) (i))
  ------------------
 8979|   123k|            if (alloc) {
  ------------------
  |  Branch (8979:17): [True: 22.1k, False: 101k]
  ------------------
 8980|  22.1k|                atts[nbatts++] = attvalue;
 8981|  22.1k|                attvalue += len;
 8982|  22.1k|                atts[nbatts++] = attvalue;
 8983|   101k|            } 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|   101k|                atts[nbatts++] = XML_INT_TO_PTR(attvalue - BASE_PTR);
  ------------------
  |  |   59|   101k|#define XML_INT_TO_PTR(i) ((void *) (XML_INTPTR_T) (i))
  ------------------
 8990|   101k|                attvalue += len;
 8991|   101k|                atts[nbatts++] = XML_INT_TO_PTR(attvalue - BASE_PTR);
  ------------------
  |  |   59|   101k|#define XML_INT_TO_PTR(i) ((void *) (XML_INTPTR_T) (i))
  ------------------
 8992|   101k|            }
 8993|       |            /*
 8994|       |             * tag if some deallocation is needed
 8995|       |             */
 8996|   123k|            if (alloc != 0) attval = 1;
  ------------------
  |  Branch (8996:17): [True: 22.1k, False: 101k]
  ------------------
 8997|   123k|            attvalue = NULL; /* moved into atts */
 8998|   123k|        }
 8999|       |
 9000|   181k|next_attr:
 9001|   181k|        if ((attvalue != NULL) && (alloc != 0)) {
  ------------------
  |  Branch (9001:13): [True: 40.1k, False: 141k]
  |  Branch (9001:35): [True: 5.98k, False: 34.1k]
  ------------------
 9002|  5.98k|            xmlFree(attvalue);
 9003|  5.98k|            attvalue = NULL;
 9004|  5.98k|        }
 9005|       |
 9006|   181k|	GROW
  ------------------
  |  | 2271|   181k|    if ((!PARSER_PROGRESSIVE(ctxt)) && \
  |  |  ------------------
  |  |  |  |   47|   181k|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|   181k|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2271:9): [True: 56.8k, False: 125k]
  |  |  ------------------
  |  | 2272|   181k|        (ctxt->input->end - ctxt->input->cur < INPUT_CHUNK)) \
  |  |  ------------------
  |  |  |  |   63|  56.8k|#define INPUT_CHUNK	250
  |  |  ------------------
  |  |  |  Branch (2272:9): [True: 9.92k, False: 46.9k]
  |  |  ------------------
  |  | 2273|   181k|	xmlParserGrow(ctxt);
  ------------------
 9007|   181k|	if ((RAW == '>') || (((RAW == '/') && (NXT(1) == '>'))))
  ------------------
  |  | 2224|   181k|#define RAW (*ctxt->input->cur)
  ------------------
              	if ((RAW == '>') || (((RAW == '/') && (NXT(1) == '>'))))
  ------------------
  |  | 2224|   142k|#define RAW (*ctxt->input->cur)
  ------------------
              	if ((RAW == '>') || (((RAW == '/') && (NXT(1) == '>'))))
  ------------------
  |  | 2226|  13.8k|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
  |  Branch (9007:6): [True: 39.6k, False: 142k]
  |  Branch (9007:24): [True: 13.8k, False: 128k]
  |  Branch (9007:40): [True: 13.1k, False: 710]
  ------------------
 9008|  52.8k|	    break;
 9009|   129k|	if (SKIP_BLANKS == 0) {
  ------------------
  |  | 2275|   129k|#define SKIP_BLANKS xmlSkipBlankChars(ctxt)
  ------------------
  |  Branch (9009:6): [True: 24.1k, False: 104k]
  ------------------
 9010|  24.1k|	    xmlFatalErrMsg(ctxt, XML_ERR_SPACE_REQUIRED,
 9011|  24.1k|			   "attributes construct error\n");
 9012|  24.1k|	    break;
 9013|  24.1k|	}
 9014|   104k|        GROW;
  ------------------
  |  | 2271|   104k|    if ((!PARSER_PROGRESSIVE(ctxt)) && \
  |  |  ------------------
  |  |  |  |   47|   104k|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|   104k|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2271:9): [True: 21.2k, False: 83.6k]
  |  |  ------------------
  |  | 2272|   104k|        (ctxt->input->end - ctxt->input->cur < INPUT_CHUNK)) \
  |  |  ------------------
  |  |  |  |   63|  21.2k|#define INPUT_CHUNK	250
  |  |  ------------------
  |  |  |  Branch (2272:9): [True: 4.63k, False: 16.5k]
  |  |  ------------------
  |  | 2273|   104k|	xmlParserGrow(ctxt);
  ------------------
 9015|   104k|    }
 9016|       |
 9017|       |    /*
 9018|       |     * Namespaces from default attributes
 9019|       |     */
 9020|   637k|    if (ctxt->attsDefault != NULL) {
  ------------------
  |  Branch (9020:9): [True: 243k, False: 393k]
  ------------------
 9021|   243k|        xmlDefAttrsPtr defaults;
 9022|       |
 9023|   243k|	defaults = xmlHashLookup2(ctxt->attsDefault, localname, prefix);
 9024|   243k|	if (defaults != NULL) {
  ------------------
  |  Branch (9024:6): [True: 189k, False: 54.5k]
  ------------------
 9025|   640k|	    for (i = 0; i < defaults->nbAttrs; i++) {
  ------------------
  |  Branch (9025:18): [True: 451k, False: 189k]
  ------------------
 9026|   451k|                xmlDefAttr *attr = &defaults->attrs[i];
 9027|       |
 9028|   451k|	        attname = attr->name.name;
 9029|   451k|		aprefix = attr->prefix.name;
 9030|       |
 9031|   451k|		if ((attname == ctxt->str_xmlns) && (aprefix == NULL)) {
  ------------------
  |  Branch (9031:7): [True: 19.1k, False: 432k]
  |  Branch (9031:39): [True: 18.5k, False: 532]
  ------------------
 9032|  18.5k|                    xmlParserEntityCheck(ctxt, attr->expandedSize);
 9033|       |
 9034|  18.5k|                    if (xmlParserNsPush(ctxt, NULL, &attr->value, NULL, 1) > 0)
  ------------------
  |  Branch (9034:25): [True: 17.6k, False: 967]
  ------------------
 9035|  17.6k|                        nbNs++;
 9036|   432k|		} else if (aprefix == ctxt->str_xmlns) {
  ------------------
  |  Branch (9036:14): [True: 206k, False: 225k]
  ------------------
 9037|   206k|                    xmlParserEntityCheck(ctxt, attr->expandedSize);
 9038|       |
 9039|   206k|                    if (xmlParserNsPush(ctxt, &attr->name, &attr->value,
  ------------------
  |  Branch (9039:25): [True: 203k, False: 3.35k]
  ------------------
 9040|   206k|                                      NULL, 1) > 0)
 9041|   203k|                        nbNs++;
 9042|   225k|		} else {
 9043|   225k|                    if (nratts + nbTotalDef >= XML_MAX_ATTRS) {
  ------------------
  |  |   93|   225k|#define XML_MAX_ATTRS 100000000 /* 100 million */
  ------------------
  |  Branch (9043:25): [True: 0, False: 225k]
  ------------------
 9044|      0|                        xmlFatalErr(ctxt, XML_ERR_RESOURCE_LIMIT,
 9045|      0|                                    "Maximum number of attributes exceeded");
 9046|      0|                        break;
 9047|      0|                    }
 9048|   225k|                    nbTotalDef += 1;
 9049|   225k|                }
 9050|   451k|	    }
 9051|   189k|	}
 9052|   243k|    }
 9053|       |
 9054|       |    /*
 9055|       |     * Resolve attribute namespaces
 9056|       |     */
 9057|   761k|    for (i = 0; i < nbatts; i += 5) {
  ------------------
  |  Branch (9057:17): [True: 123k, False: 637k]
  ------------------
 9058|   123k|        attname = atts[i];
 9059|   123k|        aprefix = atts[i+1];
 9060|       |
 9061|       |        /*
 9062|       |	* The default namespace does not apply to attribute names.
 9063|       |	*/
 9064|   123k|	if (aprefix == NULL) {
  ------------------
  |  Branch (9064:6): [True: 49.1k, False: 74.3k]
  ------------------
 9065|  49.1k|            nsIndex = NS_INDEX_EMPTY;
  ------------------
  |  |   80|  49.1k|#define NS_INDEX_EMPTY  INT_MAX
  ------------------
 9066|  74.3k|        } else if (aprefix == ctxt->str_xml) {
  ------------------
  |  Branch (9066:20): [True: 56.5k, False: 17.8k]
  ------------------
 9067|  56.5k|            nsIndex = NS_INDEX_XML;
  ------------------
  |  |   81|  56.5k|#define NS_INDEX_XML    (INT_MAX - 1)
  ------------------
 9068|  56.5k|        } else {
 9069|  17.8k|            haprefix.name = aprefix;
 9070|  17.8k|            haprefix.hashValue = (size_t) atts[i+2];
 9071|  17.8k|            nsIndex = xmlParserNsLookup(ctxt, &haprefix, NULL);
 9072|       |
 9073|  17.8k|	    if ((nsIndex == INT_MAX) || (nsIndex < ctxt->nsdb->minNsIndex)) {
  ------------------
  |  Branch (9073:10): [True: 11.7k, False: 6.09k]
  |  Branch (9073:34): [True: 216, False: 5.87k]
  ------------------
 9074|  11.9k|                xmlNsErr(ctxt, XML_NS_ERR_UNDEFINED_NAMESPACE,
 9075|  11.9k|		    "Namespace prefix %s for %s on %s is not defined\n",
 9076|  11.9k|		    aprefix, attname, localname);
 9077|  11.9k|                nsIndex = NS_INDEX_EMPTY;
  ------------------
  |  |   80|  11.9k|#define NS_INDEX_EMPTY  INT_MAX
  ------------------
 9078|  11.9k|            }
 9079|  17.8k|        }
 9080|       |
 9081|   123k|        atts[i+2] = XML_INT_TO_PTR(nsIndex);
  ------------------
  |  |   59|   123k|#define XML_INT_TO_PTR(i) ((void *) (XML_INTPTR_T) (i))
  ------------------
 9082|   123k|    }
 9083|       |
 9084|       |    /*
 9085|       |     * Maximum number of attributes including default attributes.
 9086|       |     */
 9087|   637k|    maxAtts = nratts + nbTotalDef;
 9088|       |
 9089|       |    /*
 9090|       |     * Verify that attribute names are unique.
 9091|       |     */
 9092|   637k|    if (maxAtts > 1) {
  ------------------
  |  Branch (9092:9): [True: 37.3k, False: 600k]
  ------------------
 9093|  37.3k|        attrHashSize = 4;
 9094|  86.0k|        while (attrHashSize / 2 < (unsigned) maxAtts)
  ------------------
  |  Branch (9094:16): [True: 48.6k, False: 37.3k]
  ------------------
 9095|  48.6k|            attrHashSize *= 2;
 9096|       |
 9097|  37.3k|        if (attrHashSize > ctxt->attrHashMax) {
  ------------------
  |  Branch (9097:13): [True: 6.22k, False: 31.1k]
  ------------------
 9098|  6.22k|            xmlAttrHashBucket *tmp;
 9099|       |
 9100|  6.22k|            tmp = xmlRealloc(ctxt->attrHash, attrHashSize * sizeof(tmp[0]));
 9101|  6.22k|            if (tmp == NULL) {
  ------------------
  |  Branch (9101:17): [True: 3, False: 6.22k]
  ------------------
 9102|      3|                xmlErrMemory(ctxt);
 9103|      3|                goto done;
 9104|      3|            }
 9105|       |
 9106|  6.22k|            ctxt->attrHash = tmp;
 9107|  6.22k|            ctxt->attrHashMax = attrHashSize;
 9108|  6.22k|        }
 9109|       |
 9110|  37.3k|        memset(ctxt->attrHash, -1, attrHashSize * sizeof(ctxt->attrHash[0]));
 9111|       |
 9112|   129k|        for (i = 0, j = 0; j < nratts; i += 5, j++) {
  ------------------
  |  Branch (9112:28): [True: 91.8k, False: 37.3k]
  ------------------
 9113|  91.8k|            const xmlChar *nsuri;
 9114|  91.8k|            unsigned hashValue, nameHashValue, uriHashValue;
 9115|  91.8k|            int res;
 9116|       |
 9117|  91.8k|            attname = atts[i];
 9118|  91.8k|            aprefix = atts[i+1];
 9119|  91.8k|            nsIndex = XML_PTR_TO_INT(atts[i+2]);
  ------------------
  |  |   58|  91.8k|#define XML_PTR_TO_INT(p) ((XML_INTPTR_T) (p))
  ------------------
 9120|       |            /* Hash values always have bit 31 set, see dict.c */
 9121|  91.8k|            nameHashValue = ctxt->attallocs[j] | 0x80000000;
 9122|       |
 9123|  91.8k|            if (nsIndex == NS_INDEX_EMPTY) {
  ------------------
  |  |   80|  91.8k|#define NS_INDEX_EMPTY  INT_MAX
  ------------------
  |  Branch (9123:17): [True: 34.8k, False: 56.9k]
  ------------------
 9124|       |                /*
 9125|       |                 * Prefix with empty namespace means an undeclared
 9126|       |                 * prefix which was already reported above.
 9127|       |                 */
 9128|  34.8k|                if (aprefix != NULL)
  ------------------
  |  Branch (9128:21): [True: 9.28k, False: 25.6k]
  ------------------
 9129|  9.28k|                    continue;
 9130|  25.6k|                nsuri = NULL;
 9131|  25.6k|                uriHashValue = URI_HASH_EMPTY;
  ------------------
  |  |   82|  25.6k|#define URI_HASH_EMPTY  0xD943A04E
  ------------------
 9132|  56.9k|            } else if (nsIndex == NS_INDEX_XML) {
  ------------------
  |  |   81|  56.9k|#define NS_INDEX_XML    (INT_MAX - 1)
  ------------------
  |  Branch (9132:24): [True: 51.3k, False: 5.53k]
  ------------------
 9133|  51.3k|                nsuri = ctxt->str_xml_ns;
 9134|  51.3k|                uriHashValue = URI_HASH_XML;
  ------------------
  |  |   83|  51.3k|#define URI_HASH_XML    0xF0451F02
  ------------------
 9135|  51.3k|            } else {
 9136|  5.53k|                nsuri = ctxt->nsTab[nsIndex * 2 + 1];
 9137|  5.53k|                uriHashValue = ctxt->nsdb->extra[nsIndex].uriHashValue;
 9138|  5.53k|            }
 9139|       |
 9140|  82.5k|            hashValue = xmlDictCombineHash(nameHashValue, uriHashValue);
 9141|  82.5k|            res = xmlAttrHashInsert(ctxt, attrHashSize, attname, nsuri,
 9142|  82.5k|                                    hashValue, i);
 9143|  82.5k|            if (res < 0)
  ------------------
  |  Branch (9143:17): [True: 0, False: 82.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|  82.5k|            if (res < INT_MAX) {
  ------------------
  |  Branch (9152:17): [True: 56.8k, False: 25.6k]
  ------------------
 9153|  56.8k|                if (aprefix == atts[res+1]) {
  ------------------
  |  Branch (9153:21): [True: 54.4k, False: 2.41k]
  ------------------
 9154|  54.4k|                    xmlErrAttributeDup(ctxt, aprefix, attname);
 9155|  54.4k|                    numDupErr += 1;
 9156|  54.4k|                } else {
 9157|  2.41k|                    xmlNsErr(ctxt, XML_NS_ERR_ATTRIBUTE_REDEFINED,
 9158|  2.41k|                             "Namespaced Attribute %s in '%s' redefined\n",
 9159|  2.41k|                             attname, nsuri, NULL);
 9160|  2.41k|                    numNsErr += 1;
 9161|  2.41k|                }
 9162|  56.8k|            }
 9163|  82.5k|        }
 9164|  37.3k|    }
 9165|       |
 9166|       |    /*
 9167|       |     * Default attributes
 9168|       |     */
 9169|   637k|    if (ctxt->attsDefault != NULL) {
  ------------------
  |  Branch (9169:9): [True: 243k, False: 393k]
  ------------------
 9170|   243k|        xmlDefAttrsPtr defaults;
 9171|       |
 9172|   243k|	defaults = xmlHashLookup2(ctxt->attsDefault, localname, prefix);
 9173|   243k|	if (defaults != NULL) {
  ------------------
  |  Branch (9173:6): [True: 189k, False: 54.5k]
  ------------------
 9174|   640k|	    for (i = 0; i < defaults->nbAttrs; i++) {
  ------------------
  |  Branch (9174:18): [True: 451k, False: 189k]
  ------------------
 9175|   451k|                xmlDefAttr *attr = &defaults->attrs[i];
 9176|   451k|                const xmlChar *nsuri = NULL;
 9177|   451k|                unsigned hashValue, uriHashValue = 0;
 9178|   451k|                int res;
 9179|       |
 9180|   451k|	        attname = attr->name.name;
 9181|   451k|		aprefix = attr->prefix.name;
 9182|       |
 9183|   451k|		if ((attname == ctxt->str_xmlns) && (aprefix == NULL))
  ------------------
  |  Branch (9183:7): [True: 19.1k, False: 432k]
  |  Branch (9183:39): [True: 18.5k, False: 532]
  ------------------
 9184|  18.5k|                    continue;
 9185|   432k|		if (aprefix == ctxt->str_xmlns)
  ------------------
  |  Branch (9185:7): [True: 206k, False: 225k]
  ------------------
 9186|   206k|                    continue;
 9187|       |
 9188|   225k|                if (aprefix == NULL) {
  ------------------
  |  Branch (9188:21): [True: 125k, False: 100k]
  ------------------
 9189|   125k|                    nsIndex = NS_INDEX_EMPTY;
  ------------------
  |  |   80|   125k|#define NS_INDEX_EMPTY  INT_MAX
  ------------------
 9190|   125k|                    nsuri = NULL;
 9191|   125k|                    uriHashValue = URI_HASH_EMPTY;
  ------------------
  |  |   82|   125k|#define URI_HASH_EMPTY  0xD943A04E
  ------------------
 9192|   125k|                } else if (aprefix == ctxt->str_xml) {
  ------------------
  |  Branch (9192:28): [True: 28.6k, False: 71.9k]
  ------------------
 9193|  28.6k|                    nsIndex = NS_INDEX_XML;
  ------------------
  |  |   81|  28.6k|#define NS_INDEX_XML    (INT_MAX - 1)
  ------------------
 9194|  28.6k|                    nsuri = ctxt->str_xml_ns;
 9195|  28.6k|                    uriHashValue = URI_HASH_XML;
  ------------------
  |  |   83|  28.6k|#define URI_HASH_XML    0xF0451F02
  ------------------
 9196|  71.9k|                } else {
 9197|  71.9k|                    nsIndex = xmlParserNsLookup(ctxt, &attr->prefix, NULL);
 9198|  71.9k|                    if ((nsIndex == INT_MAX) ||
  ------------------
  |  Branch (9198:25): [True: 60.1k, False: 11.7k]
  ------------------
 9199|  60.3k|                        (nsIndex < ctxt->nsdb->minNsIndex)) {
  ------------------
  |  Branch (9199:25): [True: 203, False: 11.5k]
  ------------------
 9200|  60.3k|                        xmlNsErr(ctxt, XML_NS_ERR_UNDEFINED_NAMESPACE,
 9201|  60.3k|                                 "Namespace prefix %s for %s on %s is not "
 9202|  60.3k|                                 "defined\n",
 9203|  60.3k|                                 aprefix, attname, localname);
 9204|  60.3k|                        nsIndex = NS_INDEX_EMPTY;
  ------------------
  |  |   80|  60.3k|#define NS_INDEX_EMPTY  INT_MAX
  ------------------
 9205|  60.3k|                        nsuri = NULL;
 9206|  60.3k|                        uriHashValue = URI_HASH_EMPTY;
  ------------------
  |  |   82|  60.3k|#define URI_HASH_EMPTY  0xD943A04E
  ------------------
 9207|  60.3k|                    } else {
 9208|  11.5k|                        nsuri = ctxt->nsTab[nsIndex * 2 + 1];
 9209|  11.5k|                        uriHashValue = ctxt->nsdb->extra[nsIndex].uriHashValue;
 9210|  11.5k|                    }
 9211|  71.9k|                }
 9212|       |
 9213|       |                /*
 9214|       |                 * Check whether the attribute exists
 9215|       |                 */
 9216|   225k|                if (maxAtts > 1) {
  ------------------
  |  Branch (9216:21): [True: 182k, False: 43.4k]
  ------------------
 9217|   182k|                    hashValue = xmlDictCombineHash(attr->name.hashValue,
 9218|   182k|                                                   uriHashValue);
 9219|   182k|                    res = xmlAttrHashInsert(ctxt, attrHashSize, attname, nsuri,
 9220|   182k|                                            hashValue, nbatts);
 9221|   182k|                    if (res < 0)
  ------------------
  |  Branch (9221:25): [True: 0, False: 182k]
  ------------------
 9222|      0|                        continue;
 9223|   182k|                    if (res < INT_MAX) {
  ------------------
  |  Branch (9223:25): [True: 4.86k, False: 177k]
  ------------------
 9224|  4.86k|                        if (aprefix == atts[res+1])
  ------------------
  |  Branch (9224:29): [True: 943, False: 3.92k]
  ------------------
 9225|    943|                            continue;
 9226|  3.92k|                        xmlNsErr(ctxt, XML_NS_ERR_ATTRIBUTE_REDEFINED,
 9227|  3.92k|                                 "Namespaced Attribute %s in '%s' redefined\n",
 9228|  3.92k|                                 attname, nsuri, NULL);
 9229|  3.92k|                    }
 9230|   182k|                }
 9231|       |
 9232|   224k|                xmlParserEntityCheck(ctxt, attr->expandedSize);
 9233|       |
 9234|   224k|                if ((atts == NULL) || (nbatts + 5 > maxatts)) {
  ------------------
  |  Branch (9234:21): [True: 1.16k, False: 223k]
  |  Branch (9234:39): [True: 804, False: 222k]
  ------------------
 9235|  1.96k|                    res = xmlCtxtGrowAttrs(ctxt);
 9236|       |
 9237|  1.96k|                    maxatts = ctxt->maxatts;
 9238|  1.96k|                    atts = ctxt->atts;
 9239|       |
 9240|  1.96k|                    if (res < 0) {
  ------------------
  |  Branch (9240:25): [True: 3, False: 1.96k]
  ------------------
 9241|      3|                        localname = NULL;
 9242|      3|                        goto done;
 9243|      3|                    }
 9244|  1.96k|                }
 9245|       |
 9246|   224k|                atts[nbatts++] = attname;
 9247|   224k|                atts[nbatts++] = aprefix;
 9248|   224k|                atts[nbatts++] = XML_INT_TO_PTR(nsIndex);
  ------------------
  |  |   59|   224k|#define XML_INT_TO_PTR(i) ((void *) (XML_INTPTR_T) (i))
  ------------------
 9249|   224k|                atts[nbatts++] = attr->value.name;
 9250|   224k|                atts[nbatts++] = attr->valueEnd;
 9251|       |
 9252|   224k|#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|   224k|                if ((ctxt->validate) &&
  ------------------
  |  Branch (9257:21): [True: 111k, False: 113k]
  ------------------
 9258|   111k|                    (ctxt->standalone == 1) &&
  ------------------
  |  Branch (9258:21): [True: 1.02k, False: 110k]
  ------------------
 9259|  1.02k|                    (attr->external != 0)) {
  ------------------
  |  Branch (9259:21): [True: 822, False: 199]
  ------------------
 9260|    822|                    xmlValidityError(ctxt, XML_DTD_STANDALONE_DEFAULTED,
 9261|    822|                            "standalone: attribute %s on %s defaulted "
 9262|    822|                            "from external subset\n",
 9263|    822|                            attname, localname);
 9264|    822|                }
 9265|   224k|#endif
 9266|   224k|                nbdef++;
 9267|   224k|	    }
 9268|   189k|	}
 9269|   243k|    }
 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|   637k|    if ((numDupErr == 0) && (numNsErr > 1)) {
  ------------------
  |  Branch (9283:9): [True: 636k, False: 855]
  |  Branch (9283:29): [True: 648, False: 636k]
  ------------------
 9284|    648|        memset(ctxt->attrHash, -1,
 9285|    648|               attrHashSize * sizeof(ctxt->attrHash[0]));
 9286|       |
 9287|  4.82k|        for (i = 0, j = 0; j < nratts; i += 5, j++) {
  ------------------
  |  Branch (9287:28): [True: 4.17k, False: 648]
  ------------------
 9288|  4.17k|            unsigned hashValue, nameHashValue, prefixHashValue;
 9289|  4.17k|            int res;
 9290|       |
 9291|  4.17k|            aprefix = atts[i+1];
 9292|  4.17k|            if (aprefix == NULL)
  ------------------
  |  Branch (9292:17): [True: 168, False: 4.00k]
  ------------------
 9293|    168|                continue;
 9294|       |
 9295|  4.00k|            attname = atts[i];
 9296|       |            /* Hash values always have bit 31 set, see dict.c */
 9297|  4.00k|            nameHashValue = ctxt->attallocs[j] | 0x80000000;
 9298|  4.00k|            prefixHashValue = xmlDictComputeHash(ctxt->dict, aprefix);
 9299|       |
 9300|  4.00k|            hashValue = xmlDictCombineHash(nameHashValue, prefixHashValue);
 9301|  4.00k|            res = xmlAttrHashInsertQName(ctxt, attrHashSize, attname,
 9302|  4.00k|                                         aprefix, hashValue, i);
 9303|  4.00k|            if (res < INT_MAX)
  ------------------
  |  Branch (9303:17): [True: 1.90k, False: 2.10k]
  ------------------
 9304|  1.90k|                xmlErrAttributeDup(ctxt, aprefix, attname);
 9305|  4.00k|        }
 9306|    648|    }
 9307|       |
 9308|       |    /*
 9309|       |     * Reconstruct attribute pointers
 9310|       |     */
 9311|   985k|    for (i = 0, j = 0; i < nbatts; i += 5, j++) {
  ------------------
  |  Branch (9311:24): [True: 348k, False: 637k]
  ------------------
 9312|       |        /* namespace URI */
 9313|   348k|        nsIndex = XML_PTR_TO_INT(atts[i+2]);
  ------------------
  |  |   58|   348k|#define XML_PTR_TO_INT(p) ((XML_INTPTR_T) (p))
  ------------------
 9314|   348k|        if (nsIndex == INT_MAX)
  ------------------
  |  Branch (9314:13): [True: 245k, False: 102k]
  ------------------
 9315|   245k|            atts[i+2] = NULL;
 9316|   102k|        else if (nsIndex == INT_MAX - 1)
  ------------------
  |  Branch (9316:18): [True: 85.0k, False: 17.4k]
  ------------------
 9317|  85.0k|            atts[i+2] = ctxt->str_xml_ns;
 9318|  17.4k|        else
 9319|  17.4k|            atts[i+2] = ctxt->nsTab[nsIndex * 2 + 1];
 9320|       |
 9321|   348k|        if ((j < nratts) && (ctxt->attallocs[j] & 0x80000000) == 0) {
  ------------------
  |  Branch (9321:13): [True: 123k, False: 224k]
  |  Branch (9321:29): [True: 101k, False: 22.1k]
  ------------------
 9322|   101k|            atts[i+3] = BASE_PTR + XML_PTR_TO_INT(atts[i+3]);  /* value */
  ------------------
  |  | 2228|   101k|#define BASE_PTR ctxt->input->base
  ------------------
                          atts[i+3] = BASE_PTR + XML_PTR_TO_INT(atts[i+3]);  /* value */
  ------------------
  |  |   58|   101k|#define XML_PTR_TO_INT(p) ((XML_INTPTR_T) (p))
  ------------------
 9323|   101k|            atts[i+4] = BASE_PTR + XML_PTR_TO_INT(atts[i+4]);  /* valuend */
  ------------------
  |  | 2228|   101k|#define BASE_PTR ctxt->input->base
  ------------------
                          atts[i+4] = BASE_PTR + XML_PTR_TO_INT(atts[i+4]);  /* valuend */
  ------------------
  |  |   58|   101k|#define XML_PTR_TO_INT(p) ((XML_INTPTR_T) (p))
  ------------------
 9324|   101k|        }
 9325|   348k|    }
 9326|       |
 9327|   637k|    uri = xmlParserNsLookupUri(ctxt, &hprefix);
 9328|   637k|    if ((prefix != NULL) && (uri == NULL)) {
  ------------------
  |  Branch (9328:9): [True: 48.7k, False: 588k]
  |  Branch (9328:29): [True: 23.3k, False: 25.4k]
  ------------------
 9329|  23.3k|	xmlNsErr(ctxt, XML_NS_ERR_UNDEFINED_NAMESPACE,
 9330|  23.3k|	         "Namespace prefix %s on %s is not defined\n",
 9331|  23.3k|		 prefix, localname, NULL);
 9332|  23.3k|    }
 9333|   637k|    *pref = prefix;
 9334|   637k|    *URI = uri;
 9335|       |
 9336|       |    /*
 9337|       |     * SAX callback
 9338|       |     */
 9339|   637k|    if ((ctxt->sax != NULL) && (ctxt->sax->startElementNs != NULL) &&
  ------------------
  |  Branch (9339:9): [True: 637k, False: 0]
  |  Branch (9339:32): [True: 637k, False: 0]
  ------------------
 9340|   637k|	(!ctxt->disableSAX)) {
  ------------------
  |  Branch (9340:2): [True: 479k, False: 158k]
  ------------------
 9341|   479k|	if (nbNs > 0)
  ------------------
  |  Branch (9341:6): [True: 52.8k, False: 426k]
  ------------------
 9342|  52.8k|	    ctxt->sax->startElementNs(ctxt->userData, localname, prefix, uri,
 9343|  52.8k|                          nbNs, ctxt->nsTab + 2 * (ctxt->nsNr - nbNs),
 9344|  52.8k|			  nbatts / 5, nbdef, atts);
 9345|   426k|	else
 9346|   426k|	    ctxt->sax->startElementNs(ctxt->userData, localname, prefix, uri,
 9347|   426k|                          0, NULL, nbatts / 5, nbdef, atts);
 9348|   479k|    }
 9349|       |
 9350|   637k|done:
 9351|       |    /*
 9352|       |     * Free allocated attribute values
 9353|       |     */
 9354|   637k|    if (attval != 0) {
  ------------------
  |  Branch (9354:9): [True: 10.7k, False: 626k]
  ------------------
 9355|  82.5k|	for (i = 0, j = 0; j < nratts; i += 5, j++)
  ------------------
  |  Branch (9355:21): [True: 71.8k, False: 10.7k]
  ------------------
 9356|  71.8k|	    if (ctxt->attallocs[j] & 0x80000000)
  ------------------
  |  Branch (9356:10): [True: 22.1k, False: 49.6k]
  ------------------
 9357|  22.1k|	        xmlFree((xmlChar *) atts[i+3]);
 9358|  10.7k|    }
 9359|       |
 9360|   637k|    *nbNsPtr = nbNs;
 9361|   637k|    return(localname);
 9362|   637k|}
parser.c:xmlParserNsStartElement:
 1467|   655k|xmlParserNsStartElement(xmlParserNsData *nsdb) {
 1468|   655k|    if (nsdb->elementId == UINT_MAX)
  ------------------
  |  Branch (1468:9): [True: 0, False: 655k]
  ------------------
 1469|      0|        return(-1);
 1470|   655k|    nsdb->elementId++;
 1471|       |
 1472|   655k|    return(0);
 1473|   655k|}
parser.c:xmlParseQNameHashed:
 8392|   944k|xmlParseQNameHashed(xmlParserCtxtPtr ctxt, xmlHashedString *prefix) {
 8393|   944k|    xmlHashedString l, p;
 8394|   944k|    int start, isNCName = 0;
 8395|       |
 8396|   944k|    l.name = NULL;
 8397|   944k|    p.name = NULL;
 8398|       |
 8399|   944k|    GROW;
  ------------------
  |  | 2271|   944k|    if ((!PARSER_PROGRESSIVE(ctxt)) && \
  |  |  ------------------
  |  |  |  |   47|   944k|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|   944k|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2271:9): [True: 566k, False: 377k]
  |  |  ------------------
  |  | 2272|   944k|        (ctxt->input->end - ctxt->input->cur < INPUT_CHUNK)) \
  |  |  ------------------
  |  |  |  |   63|   566k|#define INPUT_CHUNK	250
  |  |  ------------------
  |  |  |  Branch (2272:9): [True: 43.1k, False: 523k]
  |  |  ------------------
  |  | 2273|   944k|	xmlParserGrow(ctxt);
  ------------------
 8400|   944k|    start = CUR_PTR - BASE_PTR;
  ------------------
  |  | 2227|   944k|#define CUR_PTR ctxt->input->cur
  ------------------
                  start = CUR_PTR - BASE_PTR;
  ------------------
  |  | 2228|   944k|#define BASE_PTR ctxt->input->base
  ------------------
 8401|       |
 8402|   944k|    l = xmlParseNCName(ctxt);
 8403|   944k|    if (l.name != NULL) {
  ------------------
  |  Branch (8403:9): [True: 820k, False: 123k]
  ------------------
 8404|   820k|        isNCName = 1;
 8405|   820k|        if (CUR == ':') {
  ------------------
  |  | 2225|   820k|#define CUR (*ctxt->input->cur)
  ------------------
  |  Branch (8405:13): [True: 159k, False: 661k]
  ------------------
 8406|   159k|            NEXT;
  ------------------
  |  | 2279|   159k|#define NEXT xmlNextChar(ctxt)
  ------------------
 8407|   159k|            p = l;
 8408|   159k|            l = xmlParseNCName(ctxt);
 8409|   159k|        }
 8410|   820k|    }
 8411|   944k|    if ((l.name == NULL) || (CUR == ':')) {
  ------------------
  |  | 2225|   815k|#define CUR (*ctxt->input->cur)
  ------------------
  |  Branch (8411:9): [True: 128k, False: 815k]
  |  Branch (8411:29): [True: 2.07k, False: 813k]
  ------------------
 8412|   130k|        xmlChar *tmp;
 8413|       |
 8414|   130k|        l.name = NULL;
 8415|   130k|        p.name = NULL;
 8416|   130k|        if ((isNCName == 0) && (CUR != ':'))
  ------------------
  |  | 2225|   123k|#define CUR (*ctxt->input->cur)
  ------------------
  |  Branch (8416:13): [True: 123k, False: 7.05k]
  |  Branch (8416:32): [True: 119k, False: 3.45k]
  ------------------
 8417|   119k|            return(l);
 8418|  10.5k|        tmp = xmlParseNmtoken(ctxt);
 8419|  10.5k|        if (tmp != NULL)
  ------------------
  |  Branch (8419:13): [True: 6.29k, False: 4.22k]
  ------------------
 8420|  6.29k|            xmlFree(tmp);
 8421|  10.5k|        l = xmlDictLookupHashed(ctxt->dict, BASE_PTR + start,
  ------------------
  |  | 2228|  10.5k|#define BASE_PTR ctxt->input->base
  ------------------
 8422|  10.5k|                                CUR_PTR - (BASE_PTR + start));
  ------------------
  |  | 2227|  10.5k|#define CUR_PTR ctxt->input->cur
  ------------------
                                              CUR_PTR - (BASE_PTR + start));
  ------------------
  |  | 2228|  10.5k|#define BASE_PTR ctxt->input->base
  ------------------
 8423|  10.5k|        if (l.name == NULL) {
  ------------------
  |  Branch (8423:13): [True: 1, False: 10.5k]
  ------------------
 8424|      1|            xmlErrMemory(ctxt);
 8425|      1|            return(l);
 8426|      1|        }
 8427|  10.5k|        xmlNsErr(ctxt, XML_NS_ERR_QNAME,
 8428|  10.5k|                 "Failed to parse QName '%s'\n", l.name, NULL, NULL);
 8429|  10.5k|    }
 8430|       |
 8431|   824k|    *prefix = p;
 8432|   824k|    return(l);
 8433|   944k|}
parser.c:xmlParseNCName:
 3246|  1.10M|xmlParseNCName(xmlParserCtxtPtr ctxt) {
 3247|  1.10M|    const xmlChar *in, *e;
 3248|  1.10M|    xmlHashedString ret;
 3249|  1.10M|    size_t count = 0;
 3250|  1.10M|    size_t maxLength = (ctxt->options & XML_PARSE_HUGE) ?
  ------------------
  |  Branch (3250:24): [True: 701k, False: 402k]
  ------------------
 3251|   701k|                       XML_MAX_TEXT_LENGTH :
  ------------------
  |  |   50|   701k|#define XML_MAX_TEXT_LENGTH 10000000
  ------------------
 3252|  1.10M|                       XML_MAX_NAME_LENGTH;
  ------------------
  |  |   65|  1.50M|#define XML_MAX_NAME_LENGTH 50000
  ------------------
 3253|       |
 3254|  1.10M|    ret.name = NULL;
 3255|       |
 3256|       |    /*
 3257|       |     * Accelerator for simple ASCII names
 3258|       |     */
 3259|  1.10M|    in = ctxt->input->cur;
 3260|  1.10M|    e = ctxt->input->end;
 3261|  1.10M|    if ((((*in >= 0x61) && (*in <= 0x7A)) ||
  ------------------
  |  Branch (3261:11): [True: 968k, False: 135k]
  |  Branch (3261:28): [True: 954k, False: 13.8k]
  ------------------
 3262|   149k|	 ((*in >= 0x41) && (*in <= 0x5A)) ||
  ------------------
  |  Branch (3262:4): [True: 32.4k, False: 116k]
  |  Branch (3262:21): [True: 15.8k, False: 16.6k]
  ------------------
 3263|   971k|	 (*in == '_')) && (in < e)) {
  ------------------
  |  Branch (3263:3): [True: 1.41k, False: 131k]
  |  Branch (3263:20): [True: 971k, False: 0]
  ------------------
 3264|   971k|	in++;
 3265|  3.19M|	while ((((*in >= 0x61) && (*in <= 0x7A)) ||
  ------------------
  |  Branch (3265:11): [True: 1.52M, False: 1.66M]
  |  Branch (3265:28): [True: 1.52M, False: 8.77k]
  ------------------
 3266|  1.67M|	        ((*in >= 0x41) && (*in <= 0x5A)) ||
  ------------------
  |  Branch (3266:11): [True: 384k, False: 1.28M]
  |  Branch (3266:28): [True: 370k, False: 13.2k]
  ------------------
 3267|  1.30M|	        ((*in >= 0x30) && (*in <= 0x39)) ||
  ------------------
  |  Branch (3267:11): [True: 1.03M, False: 269k]
  |  Branch (3267:28): [True: 317k, False: 714k]
  ------------------
 3268|   984k|	        (*in == '_') || (*in == '-') ||
  ------------------
  |  Branch (3268:10): [True: 3.25k, False: 980k]
  |  Branch (3268:26): [True: 7.27k, False: 973k]
  ------------------
 3269|  2.22M|	        (*in == '.')) && (in < e))
  ------------------
  |  Branch (3269:10): [True: 1.81k, False: 971k]
  |  Branch (3269:27): [True: 2.22M, False: 0]
  ------------------
 3270|  2.22M|	    in++;
 3271|   971k|	if (in >= e)
  ------------------
  |  Branch (3271:6): [True: 514, False: 971k]
  ------------------
 3272|    514|	    goto complex;
 3273|   971k|	if ((*in > 0) && (*in < 0x80)) {
  ------------------
  |  Branch (3273:6): [True: 966k, False: 5.07k]
  |  Branch (3273:19): [True: 958k, False: 8.21k]
  ------------------
 3274|   958k|	    count = in - ctxt->input->cur;
 3275|   958k|            if (count > maxLength) {
  ------------------
  |  Branch (3275:17): [True: 12, False: 958k]
  ------------------
 3276|     12|                xmlFatalErr(ctxt, XML_ERR_NAME_TOO_LONG, "NCName");
 3277|     12|                return(ret);
 3278|     12|            }
 3279|   958k|	    ret = xmlDictLookupHashed(ctxt->dict, ctxt->input->cur, count);
 3280|   958k|	    ctxt->input->cur = in;
 3281|   958k|	    ctxt->input->col += count;
 3282|   958k|	    if (ret.name == NULL) {
  ------------------
  |  Branch (3282:10): [True: 2, False: 958k]
  ------------------
 3283|      2|	        xmlErrMemory(ctxt);
 3284|      2|	    }
 3285|   958k|	    return(ret);
 3286|   958k|	}
 3287|   971k|    }
 3288|   145k|complex:
 3289|   145k|    return(xmlParseNCNameComplex(ctxt));
 3290|  1.10M|}
parser.c:xmlParseNCNameComplex:
 3193|   145k|xmlParseNCNameComplex(xmlParserCtxtPtr ctxt) {
 3194|   145k|    xmlHashedString ret;
 3195|   145k|    int len = 0, l;
 3196|   145k|    int c;
 3197|   145k|    int maxLength = (ctxt->options & XML_PARSE_HUGE) ?
  ------------------
  |  Branch (3197:21): [True: 116k, False: 29.1k]
  ------------------
 3198|   116k|                    XML_MAX_TEXT_LENGTH :
  ------------------
  |  |   50|   116k|#define XML_MAX_TEXT_LENGTH 10000000
  ------------------
 3199|   145k|                    XML_MAX_NAME_LENGTH;
  ------------------
  |  |   65|  29.1k|#define XML_MAX_NAME_LENGTH 50000
  ------------------
 3200|   145k|    int old10 = (ctxt->options & XML_PARSE_OLD10) ? 1 : 0;
  ------------------
  |  Branch (3200:17): [True: 99.8k, False: 45.8k]
  ------------------
 3201|   145k|    size_t startPosition = 0;
 3202|       |
 3203|   145k|    ret.name = NULL;
 3204|   145k|    ret.hashValue = 0;
 3205|       |
 3206|       |    /*
 3207|       |     * Handler for more complex cases
 3208|       |     */
 3209|   145k|    startPosition = CUR_PTR - BASE_PTR;
  ------------------
  |  | 2227|   145k|#define CUR_PTR ctxt->input->cur
  ------------------
                  startPosition = CUR_PTR - BASE_PTR;
  ------------------
  |  | 2228|   145k|#define BASE_PTR ctxt->input->base
  ------------------
 3210|   145k|    c = xmlCurrentChar(ctxt, &l);
 3211|   145k|    if ((c == ' ') || (c == '>') || (c == '/') || /* accelerators */
  ------------------
  |  Branch (3211:9): [True: 1.10k, False: 144k]
  |  Branch (3211:23): [True: 1.33k, False: 143k]
  |  Branch (3211:37): [True: 6.05k, False: 137k]
  ------------------
 3212|   137k|	(!xmlIsNameStartChar(c, old10) || (c == ':'))) {
  ------------------
  |  Branch (3212:3): [True: 115k, False: 21.2k]
  |  Branch (3212:36): [True: 3.77k, False: 17.4k]
  ------------------
 3213|   128k|	return(ret);
 3214|   128k|    }
 3215|       |
 3216|  4.78M|    while ((c != ' ') && (c != '>') && (c != '/') && /* test bigname.xml */
  ------------------
  |  Branch (3216:12): [True: 4.78M, False: 441]
  |  Branch (3216:26): [True: 4.78M, False: 629]
  |  Branch (3216:40): [True: 4.78M, False: 218]
  ------------------
 3217|  4.78M|	   (xmlIsNameChar(c, old10) && (c != ':'))) {
  ------------------
  |  Branch (3217:6): [True: 4.76M, False: 14.9k]
  |  Branch (3217:33): [True: 4.76M, False: 1.20k]
  ------------------
 3218|  4.76M|        if (len <= INT_MAX - l)
  ------------------
  |  Branch (3218:13): [True: 4.76M, False: 0]
  ------------------
 3219|  4.76M|	    len += l;
 3220|  4.76M|	NEXTL(l);
  ------------------
  |  | 2288|  4.76M|#define NEXTL(l) do {							\
  |  | 2289|  4.76M|    if (*(ctxt->input->cur) == '\n') {					\
  |  |  ------------------
  |  |  |  Branch (2289:9): [True: 0, False: 4.76M]
  |  |  ------------------
  |  | 2290|      0|	ctxt->input->line++; ctxt->input->col = 1;			\
  |  | 2291|  4.76M|    } else ctxt->input->col++;						\
  |  | 2292|  4.76M|    ctxt->input->cur += l;				\
  |  | 2293|  4.76M|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2293:12): [Folded, False: 4.76M]
  |  |  ------------------
  ------------------
 3221|  4.76M|	c = xmlCurrentChar(ctxt, &l);
 3222|  4.76M|    }
 3223|  17.4k|    if (len > maxLength) {
  ------------------
  |  Branch (3223:9): [True: 16, False: 17.4k]
  ------------------
 3224|     16|        xmlFatalErr(ctxt, XML_ERR_NAME_TOO_LONG, "NCName");
 3225|     16|        return(ret);
 3226|     16|    }
 3227|  17.4k|    ret = xmlDictLookupHashed(ctxt->dict, (BASE_PTR + startPosition), len);
  ------------------
  |  | 2228|  17.4k|#define BASE_PTR ctxt->input->base
  ------------------
 3228|  17.4k|    if (ret.name == NULL)
  ------------------
  |  Branch (3228:9): [True: 2, False: 17.4k]
  ------------------
 3229|      2|        xmlErrMemory(ctxt);
 3230|  17.4k|    return(ret);
 3231|  17.4k|}
parser.c:xmlParseAttribute2:
 8530|   283k|{
 8531|   283k|    xmlHashedString hname;
 8532|   283k|    const xmlChar *prefix, *name;
 8533|   283k|    xmlChar *val = NULL, *internal_val = NULL;
 8534|   283k|    int special = 0;
 8535|   283k|    int isNamespace;
 8536|   283k|    int flags;
 8537|       |
 8538|   283k|    *value = NULL;
 8539|   283k|    GROW;
  ------------------
  |  | 2271|   283k|    if ((!PARSER_PROGRESSIVE(ctxt)) && \
  |  |  ------------------
  |  |  |  |   47|   283k|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|   283k|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2271:9): [True: 142k, False: 140k]
  |  |  ------------------
  |  | 2272|   283k|        (ctxt->input->end - ctxt->input->cur < INPUT_CHUNK)) \
  |  |  ------------------
  |  |  |  |   63|   142k|#define INPUT_CHUNK	250
  |  |  ------------------
  |  |  |  Branch (2272:9): [True: 11.8k, False: 131k]
  |  |  ------------------
  |  | 2273|   283k|	xmlParserGrow(ctxt);
  ------------------
 8540|   283k|    hname = xmlParseQNameHashed(ctxt, hprefix);
 8541|   283k|    if (hname.name == NULL) {
  ------------------
  |  Branch (8541:9): [True: 101k, False: 181k]
  ------------------
 8542|   101k|        xmlFatalErrMsg(ctxt, XML_ERR_NAME_REQUIRED,
 8543|   101k|                       "error parsing attribute name\n");
 8544|   101k|        return(hname);
 8545|   101k|    }
 8546|   181k|    name = hname.name;
 8547|   181k|    prefix = hprefix->name;
 8548|       |
 8549|       |    /*
 8550|       |     * get the type if needed
 8551|       |     */
 8552|   181k|    if (ctxt->attsSpecial != NULL) {
  ------------------
  |  Branch (8552:9): [True: 32.1k, False: 149k]
  ------------------
 8553|  32.1k|        special = XML_PTR_TO_INT(xmlHashQLookup2(ctxt->attsSpecial, pref, elem,
  ------------------
  |  |   58|  32.1k|#define XML_PTR_TO_INT(p) ((XML_INTPTR_T) (p))
  ------------------
 8554|  32.1k|                                              prefix, name));
 8555|  32.1k|    }
 8556|       |
 8557|       |    /*
 8558|       |     * read the value
 8559|       |     */
 8560|   181k|    SKIP_BLANKS;
  ------------------
  |  | 2275|   181k|#define SKIP_BLANKS xmlSkipBlankChars(ctxt)
  ------------------
 8561|   181k|    if (RAW != '=') {
  ------------------
  |  | 2224|   181k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (8561:9): [True: 14.9k, False: 167k]
  ------------------
 8562|  14.9k|        xmlFatalErrMsgStr(ctxt, XML_ERR_ATTRIBUTE_WITHOUT_VALUE,
 8563|  14.9k|                          "Specification mandates value for attribute %s\n",
 8564|  14.9k|                          name);
 8565|  14.9k|        goto error;
 8566|  14.9k|    }
 8567|       |
 8568|       |
 8569|   167k|    NEXT;
  ------------------
  |  | 2279|   167k|#define NEXT xmlNextChar(ctxt)
  ------------------
 8570|   167k|    SKIP_BLANKS;
  ------------------
  |  | 2275|   167k|#define SKIP_BLANKS xmlSkipBlankChars(ctxt)
  ------------------
 8571|   167k|    flags = 0;
 8572|   167k|    isNamespace = (((prefix == NULL) && (name == ctxt->str_xmlns)) ||
  ------------------
  |  Branch (8572:21): [True: 66.4k, False: 100k]
  |  Branch (8572:41): [True: 15.3k, False: 51.1k]
  ------------------
 8573|   151k|                   (prefix == ctxt->str_xmlns));
  ------------------
  |  Branch (8573:20): [True: 25.6k, False: 126k]
  ------------------
 8574|   167k|    val = xmlParseAttValueInternal(ctxt, len, &flags, special,
 8575|   167k|                                   isNamespace);
 8576|   167k|    if (val == NULL)
  ------------------
  |  Branch (8576:9): [True: 3.35k, False: 163k]
  ------------------
 8577|  3.35k|        goto error;
 8578|       |
 8579|   163k|    *alloc = (flags & XML_ATTVAL_ALLOC) != 0;
  ------------------
  |  |   98|   163k|#define XML_ATTVAL_ALLOC        (1 << 0)
  ------------------
 8580|       |
 8581|   163k|#ifdef LIBXML_VALID_ENABLED
 8582|   163k|    if ((ctxt->validate) &&
  ------------------
  |  Branch (8582:9): [True: 76.7k, False: 86.9k]
  ------------------
 8583|  76.7k|        (ctxt->standalone == 1) &&
  ------------------
  |  Branch (8583:9): [True: 538, False: 76.2k]
  ------------------
 8584|    538|        (special & XML_SPECIAL_EXTERNAL) &&
  ------------------
  |  |   95|    538|#define XML_SPECIAL_EXTERNAL    (1 << 20)
  ------------------
  |  Branch (8584:9): [True: 120, False: 418]
  ------------------
 8585|    120|        (flags & XML_ATTVAL_NORM_CHANGE)) {
  ------------------
  |  |   99|    120|#define XML_ATTVAL_NORM_CHANGE  (1 << 1)
  ------------------
  |  Branch (8585:9): [True: 34, False: 86]
  ------------------
 8586|     34|        xmlValidityError(ctxt, XML_DTD_NOT_STANDALONE,
 8587|     34|                         "standalone: normalization of attribute %s on %s "
 8588|     34|                         "by external subset declaration\n",
 8589|     34|                         name, elem);
 8590|     34|    }
 8591|   163k|#endif
 8592|       |
 8593|   163k|    if (prefix == ctxt->str_xml) {
  ------------------
  |  Branch (8593:9): [True: 56.5k, False: 107k]
  ------------------
 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|  56.5k|        if ((ctxt->pedantic) && (xmlStrEqual(name, BAD_CAST "lang"))) {
  ------------------
  |  |   34|  51.0k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (8599:13): [True: 51.0k, False: 5.44k]
  |  Branch (8599:33): [True: 49.3k, False: 1.71k]
  ------------------
 8600|  49.3k|            internal_val = xmlStrndup(val, *len);
 8601|  49.3k|            if (internal_val == NULL)
  ------------------
  |  Branch (8601:17): [True: 2, False: 49.3k]
  ------------------
 8602|      2|                goto mem_error;
 8603|  49.3k|            if (!xmlCheckLanguageID(internal_val)) {
  ------------------
  |  Branch (8603:17): [True: 44.7k, False: 4.60k]
  ------------------
 8604|  44.7k|                xmlWarningMsg(ctxt, XML_WAR_LANG_VALUE,
 8605|  44.7k|                              "Malformed value for xml:lang : %s\n",
 8606|  44.7k|                              internal_val, NULL);
 8607|  44.7k|            }
 8608|  49.3k|        }
 8609|       |
 8610|       |        /*
 8611|       |         * Check that xml:space conforms to the specification
 8612|       |         */
 8613|  56.5k|        if (xmlStrEqual(name, BAD_CAST "space")) {
  ------------------
  |  |   34|  56.5k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (8613:13): [True: 945, False: 55.5k]
  ------------------
 8614|    945|            internal_val = xmlStrndup(val, *len);
 8615|    945|            if (internal_val == NULL)
  ------------------
  |  Branch (8615:17): [True: 1, False: 944]
  ------------------
 8616|      1|                goto mem_error;
 8617|    944|            if (xmlStrEqual(internal_val, BAD_CAST "default"))
  ------------------
  |  |   34|    944|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (8617:17): [True: 207, False: 737]
  ------------------
 8618|    207|                *(ctxt->space) = 0;
 8619|    737|            else if (xmlStrEqual(internal_val, BAD_CAST "preserve"))
  ------------------
  |  |   34|    737|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (8619:22): [True: 495, False: 242]
  ------------------
 8620|    495|                *(ctxt->space) = 1;
 8621|    242|            else {
 8622|    242|                xmlWarningMsg(ctxt, XML_WAR_SPACE_VALUE,
 8623|    242|                              "Invalid value \"%s\" for xml:space : \"default\" or \"preserve\" expected\n",
 8624|    242|                              internal_val, NULL);
 8625|    242|            }
 8626|    944|        }
 8627|  56.5k|        if (internal_val) {
  ------------------
  |  Branch (8627:13): [True: 50.3k, False: 6.21k]
  ------------------
 8628|  50.3k|            xmlFree(internal_val);
 8629|  50.3k|        }
 8630|  56.5k|    }
 8631|       |
 8632|   163k|    *value = val;
 8633|   163k|    return (hname);
 8634|       |
 8635|      3|mem_error:
 8636|      3|    xmlErrMemory(ctxt);
 8637|  18.2k|error:
 8638|  18.2k|    if ((val != NULL) && (*alloc != 0))
  ------------------
  |  Branch (8638:9): [True: 3, False: 18.2k]
  |  Branch (8638:26): [True: 1, False: 2]
  ------------------
 8639|      1|        xmlFree(val);
 8640|  18.2k|    return(hname);
 8641|      3|}
parser.c:xmlNsWarn:
  406|  8.26k|{
  407|       |    xmlCtxtErr(ctxt, NULL, XML_FROM_NAMESPACE, error, XML_ERR_WARNING,
  408|  8.26k|               info1, info2, info3, 0, msg, info1, info2, info3);
  409|  8.26k|}
parser.c:xmlCtxtGrowAttrs:
 1849|  22.1k|xmlCtxtGrowAttrs(xmlParserCtxtPtr ctxt) {
 1850|  22.1k|    const xmlChar **atts;
 1851|  22.1k|    unsigned *attallocs;
 1852|  22.1k|    int newSize;
 1853|       |
 1854|  22.1k|    newSize = xmlGrowCapacity(ctxt->maxatts / 5,
 1855|  22.1k|                              sizeof(atts[0]) * 5 + sizeof(attallocs[0]),
 1856|  22.1k|                              10, XML_MAX_ATTRS);
  ------------------
  |  |   93|  22.1k|#define XML_MAX_ATTRS 100000000 /* 100 million */
  ------------------
 1857|  22.1k|    if (newSize < 0) {
  ------------------
  |  Branch (1857:9): [True: 0, False: 22.1k]
  ------------------
 1858|      0|        xmlFatalErr(ctxt, XML_ERR_RESOURCE_LIMIT,
 1859|      0|                    "Maximum number of attributes exceeded");
 1860|      0|        return(-1);
 1861|      0|    }
 1862|       |
 1863|  22.1k|    atts = xmlRealloc(ctxt->atts, newSize * sizeof(atts[0]) * 5);
 1864|  22.1k|    if (atts == NULL)
  ------------------
  |  Branch (1864:9): [True: 6, False: 22.0k]
  ------------------
 1865|      6|        goto mem_error;
 1866|  22.0k|    ctxt->atts = atts;
 1867|       |
 1868|  22.0k|    attallocs = xmlRealloc(ctxt->attallocs,
 1869|  22.0k|                           newSize * sizeof(attallocs[0]));
 1870|  22.0k|    if (attallocs == NULL)
  ------------------
  |  Branch (1870:9): [True: 3, False: 22.0k]
  ------------------
 1871|      3|        goto mem_error;
 1872|  22.0k|    ctxt->attallocs = attallocs;
 1873|       |
 1874|  22.0k|    ctxt->maxatts = newSize * 5;
 1875|       |
 1876|  22.0k|    return(0);
 1877|       |
 1878|      9|mem_error:
 1879|      9|    xmlErrMemory(ctxt);
 1880|      9|    return(-1);
 1881|  22.0k|}
parser.c:xmlAttrHashInsert:
 8657|   264k|                  const xmlChar *uri, unsigned hashValue, int aindex) {
 8658|   264k|    xmlAttrHashBucket *table = ctxt->attrHash;
 8659|   264k|    xmlAttrHashBucket *bucket;
 8660|   264k|    unsigned hindex;
 8661|       |
 8662|   264k|    hindex = hashValue & (size - 1);
 8663|   264k|    bucket = &table[hindex];
 8664|       |
 8665|   305k|    while (bucket->index >= 0) {
  ------------------
  |  Branch (8665:12): [True: 102k, False: 203k]
  ------------------
 8666|   102k|        const xmlChar **atts = &ctxt->atts[bucket->index];
 8667|       |
 8668|   102k|        if (name == atts[0]) {
  ------------------
  |  Branch (8668:13): [True: 62.8k, False: 40.0k]
  ------------------
 8669|  62.8k|            int nsIndex = XML_PTR_TO_INT(atts[2]);
  ------------------
  |  |   58|  62.8k|#define XML_PTR_TO_INT(p) ((XML_INTPTR_T) (p))
  ------------------
 8670|       |
 8671|  62.8k|            if ((nsIndex == NS_INDEX_EMPTY) ? (uri == NULL) :
  ------------------
  |  |   80|  62.8k|#define NS_INDEX_EMPTY  INT_MAX
  ------------------
  |  Branch (8671:17): [True: 8.60k, False: 54.2k]
  |  Branch (8671:17): [True: 61.7k, False: 1.15k]
  ------------------
 8672|  62.8k|                (nsIndex == NS_INDEX_XML) ? (uri == ctxt->str_xml_ns) :
  ------------------
  |  |   81|  54.2k|#define NS_INDEX_XML    (INT_MAX - 1)
  ------------------
  |  Branch (8672:17): [True: 50.1k, False: 4.08k]
  ------------------
 8673|  54.2k|                (uri == ctxt->nsTab[nsIndex * 2 + 1]))
 8674|  61.7k|                return(bucket->index);
 8675|  62.8k|        }
 8676|       |
 8677|  41.2k|        hindex++;
 8678|  41.2k|        bucket++;
 8679|  41.2k|        if (hindex >= size) {
  ------------------
  |  Branch (8679:13): [True: 2.10k, False: 39.1k]
  ------------------
 8680|  2.10k|            hindex = 0;
 8681|  2.10k|            bucket = table;
 8682|  2.10k|        }
 8683|  41.2k|    }
 8684|       |
 8685|   203k|    bucket->index = aindex;
 8686|       |
 8687|       |    return(INT_MAX);
 8688|   264k|}
parser.c:xmlAttrHashInsertQName:
 8693|  4.00k|                       unsigned hashValue, int aindex) {
 8694|  4.00k|    xmlAttrHashBucket *table = ctxt->attrHash;
 8695|  4.00k|    xmlAttrHashBucket *bucket;
 8696|  4.00k|    unsigned hindex;
 8697|       |
 8698|  4.00k|    hindex = hashValue & (size - 1);
 8699|  4.00k|    bucket = &table[hindex];
 8700|       |
 8701|  5.69k|    while (bucket->index >= 0) {
  ------------------
  |  Branch (8701:12): [True: 3.58k, False: 2.10k]
  ------------------
 8702|  3.58k|        const xmlChar **atts = &ctxt->atts[bucket->index];
 8703|       |
 8704|  3.58k|        if ((name == atts[0]) && (prefix == atts[1]))
  ------------------
  |  Branch (8704:13): [True: 2.48k, False: 1.09k]
  |  Branch (8704:34): [True: 1.90k, False: 584]
  ------------------
 8705|  1.90k|            return(bucket->index);
 8706|       |
 8707|  1.68k|        hindex++;
 8708|  1.68k|        bucket++;
 8709|  1.68k|        if (hindex >= size) {
  ------------------
  |  Branch (8709:13): [True: 198, False: 1.48k]
  ------------------
 8710|    198|            hindex = 0;
 8711|    198|            bucket = table;
 8712|    198|        }
 8713|  1.68k|    }
 8714|       |
 8715|  2.10k|    bucket->index = aindex;
 8716|       |
 8717|       |    return(INT_MAX);
 8718|  4.00k|}
parser.c:xmlParserNsLookupUri:
 1536|   637k|xmlParserNsLookupUri(xmlParserCtxtPtr ctxt, const xmlHashedString *prefix) {
 1537|   637k|    const xmlChar *ret;
 1538|   637k|    int nsIndex;
 1539|       |
 1540|   637k|    if (prefix->name == ctxt->str_xml)
  ------------------
  |  Branch (1540:9): [True: 546, False: 637k]
  ------------------
 1541|    546|        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|   637k|    nsIndex = xmlParserNsLookup(ctxt, prefix, NULL);
 1548|   637k|    if ((nsIndex == INT_MAX) || (nsIndex < ctxt->nsdb->minNsIndex))
  ------------------
  |  Branch (1548:9): [True: 561k, False: 76.0k]
  |  Branch (1548:33): [True: 695, False: 75.4k]
  ------------------
 1549|   561k|        return(NULL);
 1550|       |
 1551|  75.4k|    ret = ctxt->nsTab[nsIndex * 2 + 1];
 1552|  75.4k|    if (ret[0] == 0)
  ------------------
  |  Branch (1552:9): [True: 11.7k, False: 63.6k]
  ------------------
 1553|  11.7k|        ret = NULL;
 1554|  75.4k|    return(ret);
 1555|   637k|}
parser.c:nameNsPush:
 2061|   804k|{
 2062|   804k|    xmlStartTag *tag;
 2063|       |
 2064|   804k|    if (ctxt->nameNr >= ctxt->nameMax) {
  ------------------
  |  Branch (2064:9): [True: 42.9k, False: 761k]
  ------------------
 2065|  42.9k|        const xmlChar **tmp;
 2066|  42.9k|        xmlStartTag *tmp2;
 2067|  42.9k|        int newSize;
 2068|       |
 2069|  42.9k|        newSize = xmlGrowCapacity(ctxt->nameMax,
 2070|  42.9k|                                  sizeof(tmp[0]) + sizeof(tmp2[0]),
 2071|  42.9k|                                  10, XML_MAX_ITEMS);
  ------------------
  |  |   13|  42.9k|#define XML_MAX_ITEMS 1000000000 /* 1 billion */
  ------------------
 2072|  42.9k|        if (newSize < 0)
  ------------------
  |  Branch (2072:13): [True: 0, False: 42.9k]
  ------------------
 2073|      0|            goto mem_error;
 2074|       |
 2075|  42.9k|        tmp = xmlRealloc(ctxt->nameTab, newSize * sizeof(tmp[0]));
 2076|  42.9k|        if (tmp == NULL)
  ------------------
  |  Branch (2076:13): [True: 12, False: 42.9k]
  ------------------
 2077|     12|	    goto mem_error;
 2078|  42.9k|	ctxt->nameTab = tmp;
 2079|       |
 2080|  42.9k|        tmp2 = xmlRealloc(ctxt->pushTab, newSize * sizeof(tmp2[0]));
 2081|  42.9k|        if (tmp2 == NULL)
  ------------------
  |  Branch (2081:13): [True: 15, False: 42.9k]
  ------------------
 2082|     15|	    goto mem_error;
 2083|  42.9k|	ctxt->pushTab = tmp2;
 2084|       |
 2085|  42.9k|        ctxt->nameMax = newSize;
 2086|   761k|    } else if (ctxt->pushTab == NULL) {
  ------------------
  |  Branch (2086:16): [True: 27.5k, False: 733k]
  ------------------
 2087|  27.5k|        ctxt->pushTab = xmlMalloc(ctxt->nameMax * sizeof(ctxt->pushTab[0]));
 2088|  27.5k|        if (ctxt->pushTab == NULL)
  ------------------
  |  Branch (2088:13): [True: 9, False: 27.5k]
  ------------------
 2089|      9|            goto mem_error;
 2090|  27.5k|    }
 2091|   804k|    ctxt->nameTab[ctxt->nameNr] = value;
 2092|   804k|    ctxt->name = value;
 2093|   804k|    tag = &ctxt->pushTab[ctxt->nameNr];
 2094|   804k|    tag->prefix = prefix;
 2095|   804k|    tag->URI = URI;
 2096|   804k|    tag->line = line;
 2097|   804k|    tag->nsNr = nsNr;
 2098|   804k|    return (ctxt->nameNr++);
 2099|     36|mem_error:
 2100|     36|    xmlErrMemory(ctxt);
 2101|     36|    return (-1);
 2102|   804k|}
parser.c:xmlParseElementEnd:
 9819|   236k|xmlParseElementEnd(xmlParserCtxtPtr ctxt) {
 9820|   236k|    xmlNodePtr cur = ctxt->node;
 9821|       |
 9822|   236k|    if (ctxt->nameNr <= 0) {
  ------------------
  |  Branch (9822:9): [True: 5, False: 236k]
  ------------------
 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|   236k|    if (ctxt->sax2) {
  ------------------
  |  Branch (9831:9): [True: 189k, False: 47.2k]
  ------------------
 9832|   189k|	xmlParseEndTag2(ctxt, &ctxt->pushTab[ctxt->nameNr - 1]);
 9833|   189k|	namePop(ctxt);
 9834|   189k|    }
 9835|  47.2k|#ifdef LIBXML_SAX1_ENABLED
 9836|  47.2k|    else
 9837|  47.2k|	xmlParseEndTag1(ctxt, 0);
 9838|   236k|#endif /* LIBXML_SAX1_ENABLED */
 9839|       |
 9840|       |    /*
 9841|       |     * Capture end position
 9842|       |     */
 9843|   236k|    if (cur != NULL && ctxt->record_info) {
  ------------------
  |  Branch (9843:9): [True: 195k, False: 40.9k]
  |  Branch (9843:24): [True: 0, False: 195k]
  ------------------
 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|   236k|}
parser.c:xmlParseEndTag2:
 9377|   221k|xmlParseEndTag2(xmlParserCtxtPtr ctxt, const xmlStartTag *tag) {
 9378|   221k|    const xmlChar *name;
 9379|       |
 9380|   221k|    GROW;
  ------------------
  |  | 2271|   221k|    if ((!PARSER_PROGRESSIVE(ctxt)) && \
  |  |  ------------------
  |  |  |  |   47|   221k|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|   221k|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2271:9): [True: 189k, False: 32.0k]
  |  |  ------------------
  |  | 2272|   221k|        (ctxt->input->end - ctxt->input->cur < INPUT_CHUNK)) \
  |  |  ------------------
  |  |  |  |   63|   189k|#define INPUT_CHUNK	250
  |  |  ------------------
  |  |  |  Branch (2272:9): [True: 11.0k, False: 178k]
  |  |  ------------------
  |  | 2273|   221k|	xmlParserGrow(ctxt);
  ------------------
 9381|   221k|    if ((RAW != '<') || (NXT(1) != '/')) {
  ------------------
  |  | 2224|   221k|#define RAW (*ctxt->input->cur)
  ------------------
                  if ((RAW != '<') || (NXT(1) != '/')) {
  ------------------
  |  | 2226|   221k|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
  |  Branch (9381:9): [True: 18, False: 221k]
  |  Branch (9381:25): [True: 23, False: 221k]
  ------------------
 9382|     41|	xmlFatalErr(ctxt, XML_ERR_LTSLASH_REQUIRED, NULL);
 9383|     41|	return;
 9384|     41|    }
 9385|   221k|    SKIP(2);
  ------------------
  |  | 2248|   221k|#define SKIP(val) do {							\
  |  | 2249|   221k|    ctxt->input->cur += (val),ctxt->input->col+=(val);			\
  |  | 2250|   221k|    if (*ctxt->input->cur == 0)						\
  |  |  ------------------
  |  |  |  Branch (2250:9): [True: 599, False: 220k]
  |  |  ------------------
  |  | 2251|   221k|        xmlParserGrow(ctxt);						\
  |  | 2252|   221k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2252:12): [Folded, False: 221k]
  |  |  ------------------
  ------------------
 9386|       |
 9387|   221k|    if (tag->prefix == NULL)
  ------------------
  |  Branch (9387:9): [True: 208k, False: 12.8k]
  ------------------
 9388|   208k|        name = xmlParseNameAndCompare(ctxt, ctxt->name);
 9389|  12.8k|    else
 9390|  12.8k|        name = xmlParseQNameAndCompare(ctxt, ctxt->name, tag->prefix);
 9391|       |
 9392|       |    /*
 9393|       |     * We should definitely be at the ending "S? '>'" part
 9394|       |     */
 9395|   221k|    GROW;
  ------------------
  |  | 2271|   221k|    if ((!PARSER_PROGRESSIVE(ctxt)) && \
  |  |  ------------------
  |  |  |  |   47|   221k|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|   221k|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2271:9): [True: 189k, False: 32.0k]
  |  |  ------------------
  |  | 2272|   221k|        (ctxt->input->end - ctxt->input->cur < INPUT_CHUNK)) \
  |  |  ------------------
  |  |  |  |   63|   189k|#define INPUT_CHUNK	250
  |  |  ------------------
  |  |  |  Branch (2272:9): [True: 11.0k, False: 177k]
  |  |  ------------------
  |  | 2273|   221k|	xmlParserGrow(ctxt);
  ------------------
 9396|   221k|    SKIP_BLANKS;
  ------------------
  |  | 2275|   221k|#define SKIP_BLANKS xmlSkipBlankChars(ctxt)
  ------------------
 9397|   221k|    if ((!IS_BYTE_CHAR(RAW)) || (RAW != '>')) {
  ------------------
  |  |  103|   221k|#define IS_BYTE_CHAR(c)	 xmlIsChar_ch(c)
  |  |  ------------------
  |  |  |  |  108|   221k|#define xmlIsChar_ch(c)		(((0x9 <= (c)) && ((c) <= 0xa)) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (108:28): [True: 215k, False: 5.56k]
  |  |  |  |  |  Branch (108:44): [True: 0, False: 215k]
  |  |  |  |  ------------------
  |  |  |  |  109|   221k|				 ((c) == 0xd) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (109:6): [True: 0, False: 221k]
  |  |  |  |  ------------------
  |  |  |  |  110|   221k|				  (0x20 <= (c)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (110:7): [True: 215k, False: 5.84k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                  if ((!IS_BYTE_CHAR(RAW)) || (RAW != '>')) {
  ------------------
  |  | 2224|   215k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (9397:33): [True: 10.2k, False: 204k]
  ------------------
 9398|  16.1k|	xmlFatalErr(ctxt, XML_ERR_GT_REQUIRED, NULL);
 9399|  16.1k|    } else
 9400|   204k|	NEXT1;
  ------------------
  |  | 2281|   204k|#define NEXT1 {								\
  |  | 2282|   204k|	ctxt->input->col++;						\
  |  | 2283|   204k|	ctxt->input->cur++;						\
  |  | 2284|   204k|	if (*ctxt->input->cur == 0)					\
  |  |  ------------------
  |  |  |  Branch (2284:6): [True: 1.29k, False: 203k]
  |  |  ------------------
  |  | 2285|   204k|	    xmlParserGrow(ctxt);						\
  |  | 2286|   204k|    }
  ------------------
 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|   221k|    if (name != (xmlChar*)1) {
  ------------------
  |  Branch (9408:9): [True: 12.1k, False: 208k]
  ------------------
 9409|  12.1k|        if (name == NULL) name = BAD_CAST "unparsable";
  ------------------
  |  |   34|  3.59k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (9409:13): [True: 3.59k, False: 8.56k]
  ------------------
 9410|  12.1k|        xmlFatalErrMsgStrIntStr(ctxt, XML_ERR_TAG_NAME_MISMATCH,
 9411|  12.1k|		     "Opening and ending tag mismatch: %s line %d and %s\n",
 9412|  12.1k|		                ctxt->name, tag->line, name);
 9413|  12.1k|    }
 9414|       |
 9415|       |    /*
 9416|       |     * SAX: End of Tag
 9417|       |     */
 9418|   221k|    if ((ctxt->sax != NULL) && (ctxt->sax->endElementNs != NULL) &&
  ------------------
  |  Branch (9418:9): [True: 221k, False: 0]
  |  Branch (9418:32): [True: 221k, False: 0]
  ------------------
 9419|   221k|	(!ctxt->disableSAX))
  ------------------
  |  Branch (9419:2): [True: 180k, False: 40.8k]
  ------------------
 9420|   180k|	ctxt->sax->endElementNs(ctxt->userData, ctxt->name, tag->prefix,
 9421|   180k|                                tag->URI);
 9422|       |
 9423|   221k|    spacePop(ctxt);
 9424|   221k|    if (tag->nsNr != 0)
  ------------------
  |  Branch (9424:9): [True: 39.6k, False: 181k]
  ------------------
 9425|  39.6k|	xmlParserNsPop(ctxt, tag->nsNr);
 9426|   221k|}
parser.c:xmlParseQNameAndCompare:
 8471|  12.8k|                        xmlChar const *prefix) {
 8472|  12.8k|    const xmlChar *cmp;
 8473|  12.8k|    const xmlChar *in;
 8474|  12.8k|    const xmlChar *ret;
 8475|  12.8k|    const xmlChar *prefix2;
 8476|       |
 8477|  12.8k|    if (prefix == NULL) return(xmlParseNameAndCompare(ctxt, name));
  ------------------
  |  Branch (8477:9): [True: 0, False: 12.8k]
  ------------------
 8478|       |
 8479|  12.8k|    GROW;
  ------------------
  |  | 2271|  12.8k|    if ((!PARSER_PROGRESSIVE(ctxt)) && \
  |  |  ------------------
  |  |  |  |   47|  12.8k|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|  12.8k|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2271:9): [True: 6.91k, False: 5.97k]
  |  |  ------------------
  |  | 2272|  12.8k|        (ctxt->input->end - ctxt->input->cur < INPUT_CHUNK)) \
  |  |  ------------------
  |  |  |  |   63|  6.91k|#define INPUT_CHUNK	250
  |  |  ------------------
  |  |  |  Branch (2272:9): [True: 1.84k, False: 5.07k]
  |  |  ------------------
  |  | 2273|  12.8k|	xmlParserGrow(ctxt);
  ------------------
 8480|  12.8k|    in = ctxt->input->cur;
 8481|       |
 8482|  12.8k|    cmp = prefix;
 8483|  27.2k|    while (*in != 0 && *in == *cmp) {
  ------------------
  |  Branch (8483:12): [True: 26.4k, False: 811]
  |  Branch (8483:24): [True: 14.3k, False: 12.0k]
  ------------------
 8484|  14.3k|	++in;
 8485|  14.3k|	++cmp;
 8486|  14.3k|    }
 8487|  12.8k|    if ((*cmp == 0) && (*in == ':')) {
  ------------------
  |  Branch (8487:9): [True: 11.8k, False: 1.00k]
  |  Branch (8487:24): [True: 10.4k, False: 1.42k]
  ------------------
 8488|  10.4k|        in++;
 8489|  10.4k|	cmp = name;
 8490|  33.4k|	while (*in != 0 && *in == *cmp) {
  ------------------
  |  Branch (8490:9): [True: 31.9k, False: 1.53k]
  |  Branch (8490:21): [True: 22.9k, False: 8.93k]
  ------------------
 8491|  22.9k|	    ++in;
 8492|  22.9k|	    ++cmp;
 8493|  22.9k|	}
 8494|  10.4k|	if (*cmp == 0 && (*in == '>' || IS_BLANK_CH (*in))) {
  ------------------
  |  |  137|  4.04k|#define IS_BLANK_CH(c)  xmlIsBlank_ch(c)
  |  |  ------------------
  |  |  |  |   90|  4.04k|#define xmlIsBlank_ch(c)	(((c) == 0x20) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (90:27): [True: 72, False: 3.97k]
  |  |  |  |  ------------------
  |  |  |  |   91|  4.04k|				 ((0x9 <= (c)) && ((c) <= 0xa)) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (91:7): [True: 2.94k, False: 1.02k]
  |  |  |  |  |  Branch (91:23): [True: 2.27k, False: 672]
  |  |  |  |  ------------------
  |  |  |  |   92|  4.04k|				 ((c) == 0xd))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (92:6): [True: 386, False: 1.31k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (8494:6): [True: 9.07k, False: 1.39k]
  |  Branch (8494:20): [True: 5.03k, False: 4.04k]
  ------------------
 8495|       |	    /* success */
 8496|  7.76k|            ctxt->input->col += in - ctxt->input->cur;
 8497|  7.76k|	    ctxt->input->cur = in;
 8498|  7.76k|	    return((const xmlChar*) 1);
 8499|  7.76k|	}
 8500|  10.4k|    }
 8501|       |    /*
 8502|       |     * all strings coms from the dictionary, equality can be done directly
 8503|       |     */
 8504|  5.13k|    ret = xmlParseQName (ctxt, &prefix2);
 8505|  5.13k|    if (ret == NULL)
  ------------------
  |  Branch (8505:9): [True: 435, False: 4.69k]
  ------------------
 8506|    435|        return(NULL);
 8507|  4.69k|    if ((ret == name) && (prefix == prefix2))
  ------------------
  |  Branch (8507:9): [True: 2.63k, False: 2.06k]
  |  Branch (8507:26): [True: 1.26k, False: 1.36k]
  ------------------
 8508|  1.26k|	return((const xmlChar*) 1);
 8509|  3.42k|    return ret;
 8510|  4.69k|}
parser.c:xmlParseQName:
 8448|  5.13k|xmlParseQName(xmlParserCtxtPtr ctxt, const xmlChar **prefix) {
 8449|  5.13k|    xmlHashedString n, p;
 8450|       |
 8451|  5.13k|    n = xmlParseQNameHashed(ctxt, &p);
 8452|  5.13k|    if (n.name == NULL)
  ------------------
  |  Branch (8452:9): [True: 435, False: 4.69k]
  ------------------
 8453|    435|        return(NULL);
 8454|  4.69k|    *prefix = p.name;
 8455|  4.69k|    return(n.name);
 8456|  5.13k|}
parser.c:xmlParseInternalSubset:
 7994|  13.0k|xmlParseInternalSubset(xmlParserCtxtPtr ctxt) {
 7995|       |    /*
 7996|       |     * Is there any DTD definition ?
 7997|       |     */
 7998|  13.0k|    if (RAW == '[') {
  ------------------
  |  | 2224|  13.0k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (7998:9): [True: 13.0k, False: 0]
  ------------------
 7999|  13.0k|        int oldInputNr = ctxt->inputNr;
 8000|       |
 8001|  13.0k|        NEXT;
  ------------------
  |  | 2279|  13.0k|#define NEXT xmlNextChar(ctxt)
  ------------------
 8002|       |	/*
 8003|       |	 * Parse the succession of Markup declarations and
 8004|       |	 * PEReferences.
 8005|       |	 * Subsequence (markupdecl | PEReference | S)*
 8006|       |	 */
 8007|  13.0k|	SKIP_BLANKS;
  ------------------
  |  | 2275|  13.0k|#define SKIP_BLANKS xmlSkipBlankChars(ctxt)
  ------------------
 8008|   675k|        while (1) {
  ------------------
  |  Branch (8008:16): [True: 675k, Folded]
  ------------------
 8009|   675k|            if (PARSER_STOPPED(ctxt)) {
  ------------------
  |  |   44|   675k|#define PARSER_STOPPED(ctxt) ((ctxt)->disableSAX > 1)
  |  |  ------------------
  |  |  |  Branch (44:30): [True: 715, False: 674k]
  |  |  ------------------
  ------------------
 8010|    715|                return;
 8011|   674k|            } else if (ctxt->input->cur >= ctxt->input->end) {
  ------------------
  |  Branch (8011:24): [True: 97.6k, False: 577k]
  ------------------
 8012|  97.6k|                if (ctxt->inputNr <= oldInputNr) {
  ------------------
  |  Branch (8012:21): [True: 1.40k, False: 96.2k]
  ------------------
 8013|  1.40k|                xmlFatalErr(ctxt, XML_ERR_INT_SUBSET_NOT_FINISHED, NULL);
 8014|  1.40k|                    return;
 8015|  1.40k|                }
 8016|  96.2k|                xmlPopPE(ctxt);
 8017|   577k|            } else if ((RAW == ']') && (ctxt->inputNr <= oldInputNr)) {
  ------------------
  |  | 2224|   577k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (8017:24): [True: 7.95k, False: 569k]
  |  Branch (8017:40): [True: 7.94k, False: 5]
  ------------------
 8018|  7.94k|                NEXT;
  ------------------
  |  | 2279|  7.94k|#define NEXT xmlNextChar(ctxt)
  ------------------
 8019|  7.94k|                SKIP_BLANKS;
  ------------------
  |  | 2275|  7.94k|#define SKIP_BLANKS xmlSkipBlankChars(ctxt)
  ------------------
 8020|  7.94k|                break;
 8021|   569k|            } else if ((PARSER_EXTERNAL(ctxt)) &&
  ------------------
  |  |   55|   569k|    (((ctxt)->inSubset == 2) || \
  |  |  ------------------
  |  |  |  Branch (55:6): [True: 0, False: 569k]
  |  |  ------------------
  |  |   56|   569k|     (((ctxt)->input->entity != NULL) && \
  |  |  ------------------
  |  |  |  Branch (56:7): [True: 516k, False: 52.4k]
  |  |  ------------------
  |  |   57|   569k|      ((ctxt)->input->entity->etype == XML_EXTERNAL_PARAMETER_ENTITY)))
  |  |  ------------------
  |  |  |  Branch (57:7): [True: 511k, False: 5.77k]
  |  |  ------------------
  ------------------
 8022|   511k|                       (RAW == '<') && (NXT(1) == '!') && (NXT(2) == '[')) {
  ------------------
  |  | 2224|   511k|#define RAW (*ctxt->input->cur)
  ------------------
                                     (RAW == '<') && (NXT(1) == '!') && (NXT(2) == '[')) {
  ------------------
  |  | 2226|   370k|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
                                     (RAW == '<') && (NXT(1) == '!') && (NXT(2) == '[')) {
  ------------------
  |  | 2226|   362k|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
  |  Branch (8022:24): [True: 370k, False: 140k]
  |  Branch (8022:40): [True: 362k, False: 8.10k]
  |  Branch (8022:59): [True: 3.26k, False: 359k]
  ------------------
 8023|       |                /*
 8024|       |                 * Conditional sections are allowed in external entities
 8025|       |                 * included by PE References in the internal subset.
 8026|       |                 */
 8027|  3.26k|                xmlParseConditionalSections(ctxt);
 8028|   565k|            } else if ((RAW == '<') && ((NXT(1) == '!') || (NXT(1) == '?'))) {
  ------------------
  |  | 2224|   565k|#define RAW (*ctxt->input->cur)
  ------------------
                          } else if ((RAW == '<') && ((NXT(1) == '!') || (NXT(1) == '?'))) {
  ------------------
  |  | 2226|   404k|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
                          } else if ((RAW == '<') && ((NXT(1) == '!') || (NXT(1) == '?'))) {
  ------------------
  |  | 2226|  8.99k|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
  |  Branch (8028:24): [True: 404k, False: 161k]
  |  Branch (8028:41): [True: 395k, False: 8.99k]
  |  Branch (8028:60): [True: 8.39k, False: 600]
  ------------------
 8029|   403k|                xmlParseMarkupDecl(ctxt);
 8030|   403k|            } else if (RAW == '%') {
  ------------------
  |  | 2224|   162k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (8030:24): [True: 159k, False: 2.97k]
  ------------------
 8031|   159k|                xmlParsePERefInternal(ctxt, 1);
 8032|   159k|            } else {
 8033|  2.97k|                xmlFatalErr(ctxt, XML_ERR_INT_SUBSET_NOT_FINISHED, NULL);
 8034|       |
 8035|  3.62k|                while (ctxt->inputNr > oldInputNr)
  ------------------
  |  Branch (8035:24): [True: 645, False: 2.97k]
  ------------------
 8036|    645|                    xmlPopPE(ctxt);
 8037|  2.97k|                return;
 8038|  2.97k|            }
 8039|   662k|            SKIP_BLANKS;
  ------------------
  |  | 2275|   662k|#define SKIP_BLANKS xmlSkipBlankChars(ctxt)
  ------------------
 8040|   662k|            SHRINK;
  ------------------
  |  | 2267|   662k|    if (!PARSER_PROGRESSIVE(ctxt)) \
  |  |  ------------------
  |  |  |  |   47|   662k|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|   662k|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2267:9): [True: 615k, False: 46.6k]
  |  |  ------------------
  |  | 2268|   662k|	xmlParserShrink(ctxt);
  ------------------
 8041|   662k|            GROW;
  ------------------
  |  | 2271|   662k|    if ((!PARSER_PROGRESSIVE(ctxt)) && \
  |  |  ------------------
  |  |  |  |   47|   662k|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|   662k|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2271:9): [True: 615k, False: 46.6k]
  |  |  ------------------
  |  | 2272|   662k|        (ctxt->input->end - ctxt->input->cur < INPUT_CHUNK)) \
  |  |  ------------------
  |  |  |  |   63|   615k|#define INPUT_CHUNK	250
  |  |  ------------------
  |  |  |  Branch (2272:9): [True: 434k, False: 181k]
  |  |  ------------------
  |  | 2273|   662k|	xmlParserGrow(ctxt);
  ------------------
 8042|   662k|        }
 8043|  13.0k|    }
 8044|       |
 8045|       |    /*
 8046|       |     * We should be at the end of the DOCTYPE declaration.
 8047|       |     */
 8048|  7.94k|    if (RAW != '>') {
  ------------------
  |  | 2224|  7.94k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (8048:9): [True: 117, False: 7.83k]
  ------------------
 8049|    117|        xmlFatalErr(ctxt, XML_ERR_DOCTYPE_NOT_FINISHED, NULL);
 8050|    117|        return;
 8051|    117|    }
 8052|  7.83k|    NEXT;
  ------------------
  |  | 2279|  7.83k|#define NEXT xmlNextChar(ctxt)
  ------------------
 8053|  7.83k|}
parser.c:xmlCleanSpecialAttr:
 1194|  18.5k|{
 1195|  18.5k|    if (ctxt->attsSpecial == NULL)
  ------------------
  |  Branch (1195:9): [True: 15.4k, False: 3.05k]
  ------------------
 1196|  15.4k|        return;
 1197|       |
 1198|  3.05k|    xmlHashScanFull(ctxt->attsSpecial, xmlCleanSpecialAttrCallback, ctxt);
 1199|       |
 1200|  3.05k|    if (xmlHashSize(ctxt->attsSpecial) == 0) {
  ------------------
  |  Branch (1200:9): [True: 200, False: 2.85k]
  ------------------
 1201|    200|        xmlHashFree(ctxt->attsSpecial, NULL);
 1202|       |        ctxt->attsSpecial = NULL;
 1203|    200|    }
 1204|  3.05k|}
parser.c:xmlCleanSpecialAttrCallback:
 1177|  20.2k|                            const xmlChar *unused ATTRIBUTE_UNUSED) {
 1178|  20.2k|    xmlParserCtxtPtr ctxt = (xmlParserCtxtPtr) data;
 1179|       |
 1180|  20.2k|    if (XML_PTR_TO_INT(payload) == XML_ATTRIBUTE_CDATA) {
  ------------------
  |  |   58|  20.2k|#define XML_PTR_TO_INT(p) ((XML_INTPTR_T) (p))
  ------------------
  |  Branch (1180:9): [True: 1.96k, False: 18.2k]
  ------------------
 1181|       |        xmlHashRemoveEntry2(ctxt->attsSpecial, fullname, fullattr, NULL);
 1182|  1.96k|    }
 1183|  20.2k|}
parser.c:xmlFinishDocument:
10351|  23.6k|xmlFinishDocument(xmlParserCtxtPtr ctxt) {
10352|  23.6k|    xmlDocPtr doc;
10353|       |
10354|       |    /*
10355|       |     * SAX: end of the document processing.
10356|       |     */
10357|  23.6k|    if ((ctxt->sax) && (ctxt->sax->endDocument != NULL))
  ------------------
  |  Branch (10357:9): [True: 23.6k, False: 0]
  |  Branch (10357:24): [True: 23.6k, False: 0]
  ------------------
10358|  23.6k|        ctxt->sax->endDocument(ctxt->userData);
10359|       |
10360|       |    /*
10361|       |     * Remove locally kept entity definitions if the tree was not built
10362|       |     */
10363|  23.6k|    doc = ctxt->myDoc;
10364|  23.6k|    if ((doc != NULL) &&
  ------------------
  |  Branch (10364:9): [True: 23.5k, False: 70]
  ------------------
10365|  23.5k|        (xmlStrEqual(doc->version, SAX_COMPAT_MODE))) {
  ------------------
  |  |  173|  23.5k|#define SAX_COMPAT_MODE BAD_CAST "SAX compatibility mode document"
  |  |  ------------------
  |  |  |  |   34|  23.5k|#define BAD_CAST (xmlChar *)
  |  |  ------------------
  ------------------
  |  Branch (10365:9): [True: 20, False: 23.5k]
  ------------------
10366|     20|        xmlFreeDoc(doc);
10367|       |        ctxt->myDoc = NULL;
10368|     20|    }
10369|  23.6k|}
parser.c:xmlParseTryOrFinish:
10830|   411k|xmlParseTryOrFinish(xmlParserCtxtPtr ctxt, int terminate) {
10831|   411k|    int ret = 0;
10832|   411k|    size_t avail;
10833|   411k|    xmlChar cur, next;
10834|       |
10835|   411k|    if (ctxt->input == NULL)
  ------------------
  |  Branch (10835:9): [True: 0, False: 411k]
  ------------------
10836|      0|        return(0);
10837|       |
10838|   411k|    if ((ctxt->input != NULL) &&
  ------------------
  |  Branch (10838:9): [True: 411k, False: 0]
  ------------------
10839|   411k|        (ctxt->input->cur - ctxt->input->base > 4096)) {
  ------------------
  |  Branch (10839:9): [True: 2.68k, False: 408k]
  ------------------
10840|  2.68k|        xmlParserShrink(ctxt);
10841|  2.68k|    }
10842|       |
10843|  5.10M|    while (ctxt->disableSAX == 0) {
  ------------------
  |  Branch (10843:12): [True: 5.09M, False: 10.3k]
  ------------------
10844|  5.09M|        avail = ctxt->input->end - ctxt->input->cur;
10845|  5.09M|        if (avail < 1)
  ------------------
  |  Branch (10845:13): [True: 21.0k, False: 5.07M]
  ------------------
10846|  21.0k|	    goto done;
10847|  5.07M|        switch (ctxt->instate) {
10848|  4.18k|            case XML_PARSER_EOF:
  ------------------
  |  Branch (10848:13): [True: 4.18k, False: 5.06M]
  ------------------
10849|       |	        /*
10850|       |		 * Document parsing is done !
10851|       |		 */
10852|  4.18k|	        goto done;
10853|  36.6k|            case XML_PARSER_START:
  ------------------
  |  Branch (10853:13): [True: 36.6k, False: 5.03M]
  ------------------
10854|       |                /*
10855|       |                 * Very first chars read from the document flow.
10856|       |                 */
10857|  36.6k|                if ((!terminate) && (avail < 4))
  ------------------
  |  Branch (10857:21): [True: 35.5k, False: 1.11k]
  |  Branch (10857:37): [True: 464, False: 35.0k]
  ------------------
10858|    464|                    goto done;
10859|       |
10860|       |                /*
10861|       |                 * We need more bytes to detect EBCDIC code pages.
10862|       |                 * See xmlDetectEBCDIC.
10863|       |                 */
10864|  36.1k|                if ((CMP4(CUR_PTR, 0x4C, 0x6F, 0xA7, 0x94)) &&
  ------------------
  |  | 2231|  36.1k|  ( ((unsigned char *) s)[ 0 ] == c1 && ((unsigned char *) s)[ 1 ] == c2 && \
  |  |  ------------------
  |  |  |  Branch (2231:5): [True: 759, False: 35.4k]
  |  |  |  Branch (2231:41): [True: 740, False: 19]
  |  |  ------------------
  |  | 2232|  36.1k|    ((unsigned char *) s)[ 2 ] == c3 && ((unsigned char *) s)[ 3 ] == c4 )
  |  |  ------------------
  |  |  |  Branch (2232:5): [True: 728, False: 12]
  |  |  |  Branch (2232:41): [True: 717, False: 11]
  |  |  ------------------
  ------------------
10865|    717|                    (!terminate) && (avail < 200))
  ------------------
  |  Branch (10865:21): [True: 374, False: 343]
  |  Branch (10865:37): [True: 341, False: 33]
  ------------------
10866|    341|                    goto done;
10867|       |
10868|  35.8k|                xmlDetectEncoding(ctxt);
10869|  35.8k|                ctxt->instate = XML_PARSER_XML_DECL;
10870|  35.8k|		break;
10871|       |
10872|  51.7k|            case XML_PARSER_XML_DECL:
  ------------------
  |  Branch (10872:13): [True: 51.7k, False: 5.02M]
  ------------------
10873|  51.7k|		if ((!terminate) && (avail < 2))
  ------------------
  |  Branch (10873:7): [True: 49.6k, False: 2.11k]
  |  Branch (10873:23): [True: 4, False: 49.6k]
  ------------------
10874|      4|		    goto done;
10875|  51.7k|		cur = ctxt->input->cur[0];
10876|  51.7k|		next = ctxt->input->cur[1];
10877|  51.7k|	        if ((cur == '<') && (next == '?')) {
  ------------------
  |  Branch (10877:14): [True: 50.9k, False: 815]
  |  Branch (10877:30): [True: 25.0k, False: 25.9k]
  ------------------
10878|       |		    /* PI or XML decl */
10879|  25.0k|		    if ((!terminate) &&
  ------------------
  |  Branch (10879:11): [True: 23.6k, False: 1.38k]
  ------------------
10880|  23.6k|                        (!xmlParseLookupString(ctxt, 2, "?>", 2)))
  ------------------
  |  Branch (10880:25): [True: 15.9k, False: 7.68k]
  ------------------
10881|  15.9k|			goto done;
10882|  9.06k|		    if ((ctxt->input->cur[2] == 'x') &&
  ------------------
  |  Branch (10882:11): [True: 7.40k, False: 1.66k]
  ------------------
10883|  7.40k|			(ctxt->input->cur[3] == 'm') &&
  ------------------
  |  Branch (10883:4): [True: 6.49k, False: 908]
  ------------------
10884|  6.49k|			(ctxt->input->cur[4] == 'l') &&
  ------------------
  |  Branch (10884:4): [True: 3.39k, False: 3.10k]
  ------------------
10885|  3.39k|			(IS_BLANK_CH(ctxt->input->cur[5]))) {
  ------------------
  |  |  137|  3.39k|#define IS_BLANK_CH(c)  xmlIsBlank_ch(c)
  |  |  ------------------
  |  |  |  |   90|  3.39k|#define xmlIsBlank_ch(c)	(((c) == 0x20) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (90:27): [True: 3.24k, False: 148]
  |  |  |  |  ------------------
  |  |  |  |   91|  3.39k|				 ((0x9 <= (c)) && ((c) <= 0xa)) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (91:7): [True: 146, False: 2]
  |  |  |  |  |  Branch (91:23): [True: 33, False: 113]
  |  |  |  |  ------------------
  |  |  |  |   92|  3.39k|				 ((c) == 0xd))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (92:6): [True: 7, False: 108]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
10886|  3.28k|			ret += 5;
10887|  3.28k|			xmlParseXMLDecl(ctxt);
10888|  5.78k|		    } else {
10889|  5.78k|			ctxt->version = xmlCharStrdup(XML_DEFAULT_VERSION);
  ------------------
  |  |   42|  5.78k|#define XML_DEFAULT_VERSION	"1.0"
  ------------------
10890|  5.78k|                        if (ctxt->version == NULL) {
  ------------------
  |  Branch (10890:29): [True: 4, False: 5.78k]
  ------------------
10891|      4|                            xmlErrMemory(ctxt);
10892|      4|                            break;
10893|      4|                        }
10894|  5.78k|		    }
10895|  26.7k|		} else {
10896|  26.7k|		    ctxt->version = xmlCharStrdup(XML_DEFAULT_VERSION);
  ------------------
  |  |   42|  26.7k|#define XML_DEFAULT_VERSION	"1.0"
  ------------------
10897|  26.7k|		    if (ctxt->version == NULL) {
  ------------------
  |  Branch (10897:11): [True: 3, False: 26.7k]
  ------------------
10898|      3|		        xmlErrMemory(ctxt);
10899|      3|			break;
10900|      3|		    }
10901|  26.7k|		}
10902|  35.7k|                if ((ctxt->sax) && (ctxt->sax->setDocumentLocator)) {
  ------------------
  |  Branch (10902:21): [True: 35.7k, False: 0]
  |  Branch (10902:36): [True: 35.7k, False: 0]
  ------------------
10903|  35.7k|                    ctxt->sax->setDocumentLocator(ctxt->userData,
10904|  35.7k|                            (xmlSAXLocator *) &xmlDefaultSAXLocator);
10905|  35.7k|                }
10906|  35.7k|                if ((ctxt->sax) && (ctxt->sax->startDocument) &&
  ------------------
  |  Branch (10906:21): [True: 35.7k, False: 0]
  |  Branch (10906:36): [True: 35.7k, False: 0]
  ------------------
10907|  35.7k|                    (!ctxt->disableSAX))
  ------------------
  |  Branch (10907:21): [True: 35.4k, False: 328]
  ------------------
10908|  35.4k|                    ctxt->sax->startDocument(ctxt->userData);
10909|  35.7k|                ctxt->instate = XML_PARSER_MISC;
10910|  35.7k|		break;
10911|   611k|            case XML_PARSER_START_TAG: {
  ------------------
  |  Branch (10911:13): [True: 611k, False: 4.45M]
  ------------------
10912|   611k|	        const xmlChar *name;
10913|   611k|		const xmlChar *prefix = NULL;
10914|   611k|		const xmlChar *URI = NULL;
10915|   611k|                int line = ctxt->input->line;
10916|   611k|		int nbNs = 0;
10917|       |
10918|   611k|		if ((!terminate) && (avail < 2))
  ------------------
  |  Branch (10918:7): [True: 537k, False: 74.6k]
  |  Branch (10918:23): [True: 102, False: 537k]
  ------------------
10919|    102|		    goto done;
10920|   611k|		cur = ctxt->input->cur[0];
10921|   611k|	        if (cur != '<') {
  ------------------
  |  Branch (10921:14): [True: 2.13k, False: 609k]
  ------------------
10922|  2.13k|		    xmlFatalErrMsg(ctxt, XML_ERR_DOCUMENT_EMPTY,
10923|  2.13k|                                   "Start tag expected, '<' not found");
10924|  2.13k|                    ctxt->instate = XML_PARSER_EOF;
10925|  2.13k|                    xmlFinishDocument(ctxt);
10926|  2.13k|		    goto done;
10927|  2.13k|		}
10928|   609k|		if ((!terminate) && (!xmlParseLookupGt(ctxt)))
  ------------------
  |  Branch (10928:7): [True: 536k, False: 73.0k]
  |  Branch (10928:23): [True: 243k, False: 292k]
  ------------------
10929|   243k|                    goto done;
10930|   366k|		if (ctxt->spaceNr == 0)
  ------------------
  |  Branch (10930:7): [True: 0, False: 366k]
  ------------------
10931|      0|		    spacePush(ctxt, -1);
10932|   366k|		else if (*ctxt->space == -2)
  ------------------
  |  Branch (10932:12): [True: 99.2k, False: 266k]
  ------------------
10933|  99.2k|		    spacePush(ctxt, -1);
10934|   266k|		else
10935|   266k|		    spacePush(ctxt, *ctxt->space);
10936|   366k|#ifdef LIBXML_SAX1_ENABLED
10937|   366k|		if (ctxt->sax2)
  ------------------
  |  Branch (10937:7): [True: 235k, False: 130k]
  ------------------
10938|   235k|#endif /* LIBXML_SAX1_ENABLED */
10939|   235k|		    name = xmlParseStartTag2(ctxt, &prefix, &URI, &nbNs);
10940|   130k|#ifdef LIBXML_SAX1_ENABLED
10941|   130k|		else
10942|   130k|		    name = xmlParseStartTag(ctxt);
10943|   366k|#endif /* LIBXML_SAX1_ENABLED */
10944|   366k|		if (name == NULL) {
  ------------------
  |  Branch (10944:7): [True: 1.70k, False: 364k]
  ------------------
10945|  1.70k|		    spacePop(ctxt);
10946|  1.70k|                    ctxt->instate = XML_PARSER_EOF;
10947|  1.70k|                    xmlFinishDocument(ctxt);
10948|  1.70k|		    goto done;
10949|  1.70k|		}
10950|   364k|#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|   364k|		if (ctxt->validate && ctxt->wellFormed && ctxt->myDoc &&
  ------------------
  |  Branch (10956:7): [True: 172k, False: 191k]
  |  Branch (10956:25): [True: 146k, False: 25.9k]
  |  Branch (10956:45): [True: 146k, False: 0]
  ------------------
10957|   146k|		    ctxt->node && (ctxt->node == ctxt->myDoc->children))
  ------------------
  |  Branch (10957:7): [True: 146k, False: 0]
  |  Branch (10957:21): [True: 0, False: 146k]
  ------------------
10958|      0|		    ctxt->valid &= xmlValidateRoot(&ctxt->vctxt, ctxt->myDoc);
10959|   364k|#endif /* LIBXML_VALID_ENABLED */
10960|       |
10961|       |		/*
10962|       |		 * Check for an Empty Element.
10963|       |		 */
10964|   364k|		if ((RAW == '/') && (NXT(1) == '>')) {
  ------------------
  |  | 2224|   364k|#define RAW (*ctxt->input->cur)
  ------------------
              		if ((RAW == '/') && (NXT(1) == '>')) {
  ------------------
  |  | 2226|   134k|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
  |  Branch (10964:7): [True: 134k, False: 229k]
  |  Branch (10964:23): [True: 131k, False: 3.18k]
  ------------------
10965|   131k|		    SKIP(2);
  ------------------
  |  | 2248|   131k|#define SKIP(val) do {							\
  |  | 2249|   131k|    ctxt->input->cur += (val),ctxt->input->col+=(val);			\
  |  | 2250|   131k|    if (*ctxt->input->cur == 0)						\
  |  |  ------------------
  |  |  |  Branch (2250:9): [True: 1.05k, False: 130k]
  |  |  ------------------
  |  | 2251|   131k|        xmlParserGrow(ctxt);						\
  |  | 2252|   131k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2252:12): [Folded, False: 131k]
  |  |  ------------------
  ------------------
10966|       |
10967|   131k|		    if (ctxt->sax2) {
  ------------------
  |  Branch (10967:11): [True: 97.4k, False: 34.2k]
  ------------------
10968|  97.4k|			if ((ctxt->sax != NULL) &&
  ------------------
  |  Branch (10968:8): [True: 97.4k, False: 0]
  ------------------
10969|  97.4k|			    (ctxt->sax->endElementNs != NULL) &&
  ------------------
  |  Branch (10969:8): [True: 97.4k, False: 0]
  ------------------
10970|  97.4k|			    (!ctxt->disableSAX))
  ------------------
  |  Branch (10970:8): [True: 97.4k, False: 43]
  ------------------
10971|  97.4k|			    ctxt->sax->endElementNs(ctxt->userData, name,
10972|  97.4k|			                            prefix, URI);
10973|  97.4k|			if (nbNs > 0)
  ------------------
  |  Branch (10973:8): [True: 4.69k, False: 92.7k]
  ------------------
10974|  4.69k|			    xmlParserNsPop(ctxt, nbNs);
10975|  97.4k|#ifdef LIBXML_SAX1_ENABLED
10976|  97.4k|		    } else {
10977|  34.2k|			if ((ctxt->sax != NULL) &&
  ------------------
  |  Branch (10977:8): [True: 34.2k, False: 0]
  ------------------
10978|  34.2k|			    (ctxt->sax->endElement != NULL) &&
  ------------------
  |  Branch (10978:8): [True: 34.2k, False: 0]
  ------------------
10979|  34.2k|			    (!ctxt->disableSAX))
  ------------------
  |  Branch (10979:8): [True: 34.2k, False: 13]
  ------------------
10980|  34.2k|			    ctxt->sax->endElement(ctxt->userData, name);
10981|  34.2k|#endif /* LIBXML_SAX1_ENABLED */
10982|  34.2k|		    }
10983|   131k|		    spacePop(ctxt);
10984|   232k|		} else if (RAW == '>') {
  ------------------
  |  | 2224|   232k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (10984:14): [True: 182k, False: 49.6k]
  ------------------
10985|   182k|		    NEXT;
  ------------------
  |  | 2279|   182k|#define NEXT xmlNextChar(ctxt)
  ------------------
10986|   182k|                    nameNsPush(ctxt, name, prefix, URI, line, nbNs);
10987|   182k|		} else {
10988|  49.6k|		    xmlFatalErrMsgStr(ctxt, XML_ERR_GT_REQUIRED,
10989|  49.6k|					 "Couldn't find end of Start Tag %s\n",
10990|  49.6k|					 name);
10991|  49.6k|		    nodePop(ctxt);
10992|  49.6k|		    spacePop(ctxt);
10993|  49.6k|                    if (nbNs > 0)
  ------------------
  |  Branch (10993:25): [True: 5.30k, False: 44.3k]
  ------------------
10994|  5.30k|                        xmlParserNsPop(ctxt, nbNs);
10995|  49.6k|		}
10996|       |
10997|   364k|                if (ctxt->nameNr == 0)
  ------------------
  |  Branch (10997:21): [True: 7.88k, False: 356k]
  ------------------
10998|  7.88k|                    ctxt->instate = XML_PARSER_EPILOG;
10999|   356k|                else
11000|   356k|                    ctxt->instate = XML_PARSER_CONTENT;
11001|   364k|                break;
11002|   366k|	    }
11003|  4.09M|            case XML_PARSER_CONTENT: {
  ------------------
  |  Branch (11003:13): [True: 4.09M, False: 975k]
  ------------------
11004|  4.09M|		cur = ctxt->input->cur[0];
11005|       |
11006|  4.09M|		if (cur == '<') {
  ------------------
  |  Branch (11006:7): [True: 508k, False: 3.58M]
  ------------------
11007|   508k|                    if ((!terminate) && (avail < 2))
  ------------------
  |  Branch (11007:25): [True: 420k, False: 87.0k]
  |  Branch (11007:41): [True: 1.27k, False: 419k]
  ------------------
11008|  1.27k|                        goto done;
11009|   506k|		    next = ctxt->input->cur[1];
11010|       |
11011|   506k|                    if (next == '/') {
  ------------------
  |  Branch (11011:25): [True: 47.1k, False: 459k]
  ------------------
11012|  47.1k|                        ctxt->instate = XML_PARSER_END_TAG;
11013|  47.1k|                        break;
11014|   459k|                    } else if (next == '?') {
  ------------------
  |  Branch (11014:32): [True: 24.0k, False: 435k]
  ------------------
11015|  24.0k|                        if ((!terminate) &&
  ------------------
  |  Branch (11015:29): [True: 18.1k, False: 5.92k]
  ------------------
11016|  18.1k|                            (!xmlParseLookupString(ctxt, 2, "?>", 2)))
  ------------------
  |  Branch (11016:29): [True: 5.44k, False: 12.7k]
  ------------------
11017|  5.44k|                            goto done;
11018|  18.6k|                        xmlParsePI(ctxt);
11019|  18.6k|                        ctxt->instate = XML_PARSER_CONTENT;
11020|  18.6k|                        break;
11021|   435k|                    } else if (next == '!') {
  ------------------
  |  Branch (11021:32): [True: 96.4k, False: 339k]
  ------------------
11022|  96.4k|                        if ((!terminate) && (avail < 3))
  ------------------
  |  Branch (11022:29): [True: 89.3k, False: 7.09k]
  |  Branch (11022:45): [True: 199, False: 89.1k]
  ------------------
11023|    199|                            goto done;
11024|  96.2k|                        next = ctxt->input->cur[2];
11025|       |
11026|  96.2k|                        if (next == '-') {
  ------------------
  |  Branch (11026:29): [True: 76.8k, False: 19.4k]
  ------------------
11027|  76.8k|                            if ((!terminate) && (avail < 4))
  ------------------
  |  Branch (11027:33): [True: 74.0k, False: 2.84k]
  |  Branch (11027:49): [True: 163, False: 73.8k]
  ------------------
11028|    163|                                goto done;
11029|  76.6k|                            if (ctxt->input->cur[3] == '-') {
  ------------------
  |  Branch (11029:33): [True: 76.6k, False: 18]
  ------------------
11030|  76.6k|                                if ((!terminate) &&
  ------------------
  |  Branch (11030:37): [True: 73.8k, False: 2.83k]
  ------------------
11031|  73.8k|                                    (!xmlParseLookupString(ctxt, 4, "-->", 3)))
  ------------------
  |  Branch (11031:37): [True: 6.04k, False: 67.7k]
  ------------------
11032|  6.04k|                                    goto done;
11033|  70.6k|                                xmlParseComment(ctxt);
11034|  70.6k|                                ctxt->instate = XML_PARSER_CONTENT;
11035|  70.6k|                                break;
11036|  76.6k|                            }
11037|  76.6k|                        } else if (next == '[') {
  ------------------
  |  Branch (11037:36): [True: 19.1k, False: 229]
  ------------------
11038|  19.1k|                            if ((!terminate) && (avail < 9))
  ------------------
  |  Branch (11038:33): [True: 15.0k, False: 4.17k]
  |  Branch (11038:49): [True: 105, False: 14.9k]
  ------------------
11039|    105|                                goto done;
11040|  19.0k|                            if ((ctxt->input->cur[2] == '[') &&
  ------------------
  |  Branch (11040:33): [True: 19.0k, False: 0]
  ------------------
11041|  19.0k|                                (ctxt->input->cur[3] == 'C') &&
  ------------------
  |  Branch (11041:33): [True: 19.0k, False: 22]
  ------------------
11042|  19.0k|                                (ctxt->input->cur[4] == 'D') &&
  ------------------
  |  Branch (11042:33): [True: 19.0k, False: 8]
  ------------------
11043|  19.0k|                                (ctxt->input->cur[5] == 'A') &&
  ------------------
  |  Branch (11043:33): [True: 19.0k, False: 5]
  ------------------
11044|  19.0k|                                (ctxt->input->cur[6] == 'T') &&
  ------------------
  |  Branch (11044:33): [True: 19.0k, False: 16]
  ------------------
11045|  19.0k|                                (ctxt->input->cur[7] == 'A') &&
  ------------------
  |  Branch (11045:33): [True: 19.0k, False: 5]
  ------------------
11046|  19.0k|                                (ctxt->input->cur[8] == '[')) {
  ------------------
  |  Branch (11046:33): [True: 19.0k, False: 13]
  ------------------
11047|  19.0k|                                if ((!terminate) &&
  ------------------
  |  Branch (11047:37): [True: 14.8k, False: 4.12k]
  ------------------
11048|  14.8k|                                    (!xmlParseLookupString(ctxt, 9, "]]>", 3)))
  ------------------
  |  Branch (11048:37): [True: 8.34k, False: 6.54k]
  ------------------
11049|  8.34k|                                    goto done;
11050|  10.6k|                                ctxt->instate = XML_PARSER_CDATA_SECTION;
11051|  10.6k|                                xmlParseCDSect(ctxt);
11052|  10.6k|                                ctxt->instate = XML_PARSER_CONTENT;
11053|  10.6k|                                break;
11054|  19.0k|                            }
11055|  19.0k|                        }
11056|  96.2k|                    }
11057|  3.58M|		} else if (cur == '&') {
  ------------------
  |  Branch (11057:14): [True: 40.9k, False: 3.54M]
  ------------------
11058|  40.9k|		    if ((!terminate) && (!xmlParseLookupChar(ctxt, ';')))
  ------------------
  |  Branch (11058:11): [True: 31.7k, False: 9.18k]
  |  Branch (11058:27): [True: 15.5k, False: 16.1k]
  ------------------
11059|  15.5k|			goto done;
11060|  25.3k|		    xmlParseReference(ctxt);
11061|  25.3k|                    break;
11062|  3.54M|		} 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.54M|		    if (avail < XML_PARSER_BIG_BUFFER_SIZE) {
  ------------------
  |  |  171|  3.54M|#define XML_PARSER_BIG_BUFFER_SIZE 300
  ------------------
  |  Branch (11075:11): [True: 131k, False: 3.41M]
  ------------------
11076|   131k|			if ((!terminate) && (!xmlParseLookupCharData(ctxt)))
  ------------------
  |  Branch (11076:8): [True: 110k, False: 21.0k]
  |  Branch (11076:24): [True: 6.98k, False: 103k]
  ------------------
11077|  6.98k|			    goto done;
11078|   131k|                    }
11079|  3.53M|                    ctxt->checkIndex = 0;
11080|  3.53M|		    xmlParseCharDataInternal(ctxt, !terminate);
11081|  3.53M|                    break;
11082|  3.54M|		}
11083|       |
11084|   339k|                ctxt->instate = XML_PARSER_START_TAG;
11085|   339k|		break;
11086|  4.09M|	    }
11087|  49.4k|            case XML_PARSER_END_TAG:
  ------------------
  |  Branch (11087:13): [True: 49.4k, False: 5.02M]
  ------------------
11088|  49.4k|		if ((!terminate) && (!xmlParseLookupChar(ctxt, '>')))
  ------------------
  |  Branch (11088:7): [True: 39.8k, False: 9.58k]
  |  Branch (11088:23): [True: 3.37k, False: 36.4k]
  ------------------
11089|  3.37k|		    goto done;
11090|  46.0k|		if (ctxt->sax2) {
  ------------------
  |  Branch (11090:7): [True: 32.0k, False: 14.0k]
  ------------------
11091|  32.0k|	            xmlParseEndTag2(ctxt, &ctxt->pushTab[ctxt->nameNr - 1]);
11092|  32.0k|		    nameNsPop(ctxt);
11093|  32.0k|		}
11094|  14.0k|#ifdef LIBXML_SAX1_ENABLED
11095|  14.0k|		  else
11096|  14.0k|		    xmlParseEndTag1(ctxt, 0);
11097|  46.0k|#endif /* LIBXML_SAX1_ENABLED */
11098|  46.0k|		if (ctxt->nameNr == 0) {
  ------------------
  |  Branch (11098:7): [True: 2.59k, False: 43.4k]
  ------------------
11099|  2.59k|		    ctxt->instate = XML_PARSER_EPILOG;
11100|  43.4k|		} else {
11101|  43.4k|		    ctxt->instate = XML_PARSER_CONTENT;
11102|  43.4k|		}
11103|  46.0k|		break;
11104|  97.0k|            case XML_PARSER_MISC:
  ------------------
  |  Branch (11104:13): [True: 97.0k, False: 4.97M]
  ------------------
11105|   182k|            case XML_PARSER_PROLOG:
  ------------------
  |  Branch (11105:13): [True: 85.4k, False: 4.98M]
  ------------------
11106|   187k|            case XML_PARSER_EPILOG:
  ------------------
  |  Branch (11106:13): [True: 5.41k, False: 5.06M]
  ------------------
11107|   187k|		SKIP_BLANKS;
  ------------------
  |  | 2275|   187k|#define SKIP_BLANKS xmlSkipBlankChars(ctxt)
  ------------------
11108|   187k|                avail = ctxt->input->end - ctxt->input->cur;
11109|   187k|		if (avail < 1)
  ------------------
  |  Branch (11109:7): [True: 3.15k, False: 184k]
  ------------------
11110|  3.15k|		    goto done;
11111|   184k|		if (ctxt->input->cur[0] == '<') {
  ------------------
  |  Branch (11111:7): [True: 180k, False: 3.88k]
  ------------------
11112|   180k|                    if ((!terminate) && (avail < 2))
  ------------------
  |  Branch (11112:25): [True: 176k, False: 4.82k]
  |  Branch (11112:41): [True: 231, False: 175k]
  ------------------
11113|    231|                        goto done;
11114|   180k|                    next = ctxt->input->cur[1];
11115|   180k|                    if (next == '?') {
  ------------------
  |  Branch (11115:25): [True: 37.8k, False: 142k]
  ------------------
11116|  37.8k|                        if ((!terminate) &&
  ------------------
  |  Branch (11116:29): [True: 36.6k, False: 1.21k]
  ------------------
11117|  36.6k|                            (!xmlParseLookupString(ctxt, 2, "?>", 2)))
  ------------------
  |  Branch (11117:29): [True: 8.43k, False: 28.2k]
  ------------------
11118|  8.43k|                            goto done;
11119|  29.4k|                        xmlParsePI(ctxt);
11120|  29.4k|                        break;
11121|   142k|                    } else if (next == '!') {
  ------------------
  |  Branch (11121:32): [True: 114k, False: 28.5k]
  ------------------
11122|   114k|                        if ((!terminate) && (avail < 3))
  ------------------
  |  Branch (11122:29): [True: 111k, False: 2.33k]
  |  Branch (11122:45): [True: 152, False: 111k]
  ------------------
11123|    152|                            goto done;
11124|       |
11125|   114k|                        if (ctxt->input->cur[2] == '-') {
  ------------------
  |  Branch (11125:29): [True: 76.3k, False: 37.7k]
  ------------------
11126|  76.3k|                            if ((!terminate) && (avail < 4))
  ------------------
  |  Branch (11126:33): [True: 75.7k, False: 607]
  |  Branch (11126:49): [True: 154, False: 75.6k]
  ------------------
11127|    154|                                goto done;
11128|  76.2k|                            if (ctxt->input->cur[3] == '-') {
  ------------------
  |  Branch (11128:33): [True: 76.2k, False: 10]
  ------------------
11129|  76.2k|                                if ((!terminate) &&
  ------------------
  |  Branch (11129:37): [True: 75.6k, False: 602]
  ------------------
11130|  75.6k|                                    (!xmlParseLookupString(ctxt, 4, "-->", 3)))
  ------------------
  |  Branch (11130:37): [True: 8.90k, False: 66.7k]
  ------------------
11131|  8.90k|                                    goto done;
11132|  67.3k|                                xmlParseComment(ctxt);
11133|  67.3k|                                break;
11134|  76.2k|                            }
11135|  76.2k|                        } else if (ctxt->instate == XML_PARSER_MISC) {
  ------------------
  |  Branch (11135:36): [True: 37.6k, False: 53]
  ------------------
11136|  37.6k|                            if ((!terminate) && (avail < 9))
  ------------------
  |  Branch (11136:33): [True: 35.9k, False: 1.70k]
  |  Branch (11136:49): [True: 23, False: 35.9k]
  ------------------
11137|     23|                                goto done;
11138|  37.6k|                            if ((ctxt->input->cur[2] == 'D') &&
  ------------------
  |  Branch (11138:33): [True: 37.6k, False: 22]
  ------------------
11139|  37.6k|                                (ctxt->input->cur[3] == 'O') &&
  ------------------
  |  Branch (11139:33): [True: 37.6k, False: 10]
  ------------------
11140|  37.6k|                                (ctxt->input->cur[4] == 'C') &&
  ------------------
  |  Branch (11140:33): [True: 37.6k, False: 6]
  ------------------
11141|  37.6k|                                (ctxt->input->cur[5] == 'T') &&
  ------------------
  |  Branch (11141:33): [True: 37.6k, False: 7]
  ------------------
11142|  37.6k|                                (ctxt->input->cur[6] == 'Y') &&
  ------------------
  |  Branch (11142:33): [True: 37.6k, False: 1]
  ------------------
11143|  37.6k|                                (ctxt->input->cur[7] == 'P') &&
  ------------------
  |  Branch (11143:33): [True: 37.5k, False: 3]
  ------------------
11144|  37.5k|                                (ctxt->input->cur[8] == 'E')) {
  ------------------
  |  Branch (11144:33): [True: 37.5k, False: 7]
  ------------------
11145|  37.5k|                                if ((!terminate) && (!xmlParseLookupGt(ctxt)))
  ------------------
  |  Branch (11145:37): [True: 35.9k, False: 1.65k]
  |  Branch (11145:53): [True: 21.3k, False: 14.6k]
  ------------------
11146|  21.3k|                                    goto done;
11147|  16.2k|                                ctxt->inSubset = 1;
11148|  16.2k|                                xmlParseDocTypeDecl(ctxt);
11149|  16.2k|                                if (RAW == '[') {
  ------------------
  |  | 2224|  16.2k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (11149:37): [True: 12.4k, False: 3.82k]
  ------------------
11150|  12.4k|                                    ctxt->instate = XML_PARSER_DTD;
11151|  12.4k|                                } else {
11152|  3.82k|                                    if (RAW == '>')
  ------------------
  |  | 2224|  3.82k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (11152:41): [True: 3.62k, False: 201]
  ------------------
11153|  3.62k|                                        NEXT;
  ------------------
  |  | 2279|  3.62k|#define NEXT xmlNextChar(ctxt)
  ------------------
11154|       |                                    /*
11155|       |                                     * Create and update the external subset.
11156|       |                                     */
11157|  3.82k|                                    ctxt->inSubset = 2;
11158|  3.82k|                                    if ((ctxt->sax != NULL) &&
  ------------------
  |  Branch (11158:41): [True: 3.82k, False: 0]
  ------------------
11159|  3.82k|                                        (!ctxt->disableSAX) &&
  ------------------
  |  Branch (11159:41): [True: 3.72k, False: 100]
  ------------------
11160|  3.72k|                                        (ctxt->sax->externalSubset != NULL))
  ------------------
  |  Branch (11160:41): [True: 3.72k, False: 0]
  ------------------
11161|  3.72k|                                        ctxt->sax->externalSubset(
11162|  3.72k|                                                ctxt->userData,
11163|  3.72k|                                                ctxt->intSubName,
11164|  3.72k|                                                ctxt->extSubSystem,
11165|  3.72k|                                                ctxt->extSubURI);
11166|  3.82k|                                    ctxt->inSubset = 0;
11167|  3.82k|                                    xmlCleanSpecialAttr(ctxt);
11168|  3.82k|                                    ctxt->instate = XML_PARSER_PROLOG;
11169|  3.82k|                                }
11170|  16.2k|                                break;
11171|  37.5k|                            }
11172|  37.6k|                        }
11173|   114k|                    }
11174|   180k|                }
11175|       |
11176|  32.5k|                if (ctxt->instate == XML_PARSER_EPILOG) {
  ------------------
  |  Branch (11176:21): [True: 2.04k, False: 30.5k]
  ------------------
11177|  2.04k|                    if (ctxt->errNo == XML_ERR_OK)
  ------------------
  |  Branch (11177:25): [True: 25, False: 2.01k]
  ------------------
11178|     25|                        xmlFatalErr(ctxt, XML_ERR_DOCUMENT_END, NULL);
11179|  2.04k|		    ctxt->instate = XML_PARSER_EOF;
11180|  2.04k|                    xmlFinishDocument(ctxt);
11181|  30.5k|                } else {
11182|  30.5k|		    ctxt->instate = XML_PARSER_START_TAG;
11183|  30.5k|		}
11184|  32.5k|		break;
11185|  33.9k|            case XML_PARSER_DTD: {
  ------------------
  |  Branch (11185:13): [True: 33.9k, False: 5.03M]
  ------------------
11186|  33.9k|                if ((!terminate) && (!xmlParseLookupInternalSubset(ctxt)))
  ------------------
  |  Branch (11186:21): [True: 29.3k, False: 4.62k]
  |  Branch (11186:37): [True: 21.6k, False: 7.71k]
  ------------------
11187|  21.6k|                    goto done;
11188|  12.3k|		xmlParseInternalSubset(ctxt);
11189|  12.3k|		ctxt->inSubset = 2;
11190|  12.3k|		if ((ctxt->sax != NULL) && (!ctxt->disableSAX) &&
  ------------------
  |  Branch (11190:7): [True: 12.3k, False: 0]
  |  Branch (11190:30): [True: 10.0k, False: 2.24k]
  ------------------
11191|  10.0k|		    (ctxt->sax->externalSubset != NULL))
  ------------------
  |  Branch (11191:7): [True: 10.0k, False: 0]
  ------------------
11192|  10.0k|		    ctxt->sax->externalSubset(ctxt->userData, ctxt->intSubName,
11193|  10.0k|			    ctxt->extSubSystem, ctxt->extSubURI);
11194|  12.3k|		ctxt->inSubset = 0;
11195|  12.3k|		xmlCleanSpecialAttr(ctxt);
11196|  12.3k|		ctxt->instate = XML_PARSER_PROLOG;
11197|  12.3k|                break;
11198|  33.9k|	    }
11199|      0|            default:
  ------------------
  |  Branch (11199:13): [True: 0, False: 5.07M]
  ------------------
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|  5.07M|	}
11205|  5.07M|    }
11206|   411k|done:
11207|   411k|    return(ret);
11208|   411k|}
parser.c:xmlParseLookupString:
10610|   242k|                     const char *str, size_t strLen) {
10611|   242k|    const xmlChar *cur, *term;
10612|       |
10613|   242k|    if (ctxt->checkIndex == 0) {
  ------------------
  |  Branch (10613:9): [True: 191k, False: 51.0k]
  ------------------
10614|   191k|        cur = ctxt->input->cur + startDelta;
10615|   191k|    } else {
10616|  51.0k|        cur = ctxt->input->cur + ctxt->checkIndex;
10617|  51.0k|    }
10618|       |
10619|   242k|    term = BAD_CAST strstr((const char *) cur, str);
  ------------------
  |  |   34|   242k|#define BAD_CAST (xmlChar *)
  ------------------
10620|   242k|    if (term == NULL) {
  ------------------
  |  Branch (10620:9): [True: 53.1k, False: 189k]
  ------------------
10621|  53.1k|        const xmlChar *end = ctxt->input->end;
10622|  53.1k|        size_t index;
10623|       |
10624|       |        /* Rescan (strLen - 1) characters. */
10625|  53.1k|        if ((size_t) (end - cur) < strLen)
  ------------------
  |  Branch (10625:13): [True: 1.15k, False: 51.9k]
  ------------------
10626|  1.15k|            end = cur;
10627|  51.9k|        else
10628|  51.9k|            end -= strLen - 1;
10629|  53.1k|        index = end - ctxt->input->cur;
10630|  53.1k|        if (index > LONG_MAX) {
  ------------------
  |  Branch (10630:13): [True: 0, False: 53.1k]
  ------------------
10631|      0|            ctxt->checkIndex = 0;
10632|      0|            return(ctxt->input->end - strLen);
10633|      0|        }
10634|  53.1k|        ctxt->checkIndex = index;
10635|   189k|    } else {
10636|   189k|        ctxt->checkIndex = 0;
10637|   189k|    }
10638|       |
10639|   242k|    return(term);
10640|   242k|}
parser.c:xmlParseLookupGt:
10677|   572k|xmlParseLookupGt(xmlParserCtxtPtr ctxt) {
10678|   572k|    const xmlChar *cur;
10679|   572k|    const xmlChar *end = ctxt->input->end;
10680|   572k|    int state = ctxt->endCheckState;
10681|   572k|    size_t index;
10682|       |
10683|   572k|    if (ctxt->checkIndex == 0)
  ------------------
  |  Branch (10683:9): [True: 316k, False: 256k]
  ------------------
10684|   316k|        cur = ctxt->input->cur + 1;
10685|   256k|    else
10686|   256k|        cur = ctxt->input->cur + ctxt->checkIndex;
10687|       |
10688|   170M|    while (cur < end) {
  ------------------
  |  Branch (10688:12): [True: 169M, False: 265k]
  ------------------
10689|   169M|        if (state) {
  ------------------
  |  Branch (10689:13): [True: 155M, False: 14.9M]
  ------------------
10690|   155M|            if (*cur == state)
  ------------------
  |  Branch (10690:17): [True: 200k, False: 154M]
  ------------------
10691|   200k|                state = 0;
10692|   155M|        } else if (*cur == '\'' || *cur == '"') {
  ------------------
  |  Branch (10692:20): [True: 90.4k, False: 14.8M]
  |  Branch (10692:36): [True: 112k, False: 14.7M]
  ------------------
10693|   202k|            state = *cur;
10694|  14.7M|        } else if (*cur == '>') {
  ------------------
  |  Branch (10694:20): [True: 307k, False: 14.4M]
  ------------------
10695|   307k|            ctxt->checkIndex = 0;
10696|   307k|            ctxt->endCheckState = 0;
10697|   307k|            return(1);
10698|   307k|        }
10699|   169M|        cur++;
10700|   169M|    }
10701|       |
10702|   265k|    index = cur - ctxt->input->cur;
10703|   265k|    if (index > LONG_MAX) {
  ------------------
  |  Branch (10703:9): [True: 0, False: 265k]
  ------------------
10704|      0|        ctxt->checkIndex = 0;
10705|      0|        ctxt->endCheckState = 0;
10706|      0|        return(1);
10707|      0|    }
10708|   265k|    ctxt->checkIndex = index;
10709|   265k|    ctxt->endCheckState = state;
10710|   265k|    return(0);
10711|   265k|}
parser.c:xmlParseLookupChar:
10576|  71.6k|xmlParseLookupChar(xmlParserCtxtPtr ctxt, int c) {
10577|  71.6k|    const xmlChar *cur;
10578|       |
10579|  71.6k|    if (ctxt->checkIndex == 0) {
  ------------------
  |  Branch (10579:9): [True: 56.1k, False: 15.5k]
  ------------------
10580|  56.1k|        cur = ctxt->input->cur + 1;
10581|  56.1k|    } else {
10582|  15.5k|        cur = ctxt->input->cur + ctxt->checkIndex;
10583|  15.5k|    }
10584|       |
10585|  71.6k|    if (memchr(cur, c, ctxt->input->end - cur) == NULL) {
  ------------------
  |  Branch (10585:9): [True: 18.9k, False: 52.6k]
  ------------------
10586|  18.9k|        size_t index = ctxt->input->end - ctxt->input->cur;
10587|       |
10588|  18.9k|        if (index > LONG_MAX) {
  ------------------
  |  Branch (10588:13): [True: 0, False: 18.9k]
  ------------------
10589|      0|            ctxt->checkIndex = 0;
10590|      0|            return(1);
10591|      0|        }
10592|  18.9k|        ctxt->checkIndex = index;
10593|  18.9k|        return(0);
10594|  52.6k|    } else {
10595|  52.6k|        ctxt->checkIndex = 0;
10596|  52.6k|        return(1);
10597|  52.6k|    }
10598|  71.6k|}
parser.c:xmlParseLookupCharData:
10648|   110k|xmlParseLookupCharData(xmlParserCtxtPtr ctxt) {
10649|   110k|    const xmlChar *cur = ctxt->input->cur + ctxt->checkIndex;
10650|   110k|    const xmlChar *end = ctxt->input->end;
10651|   110k|    size_t index;
10652|       |
10653|  1.01M|    while (cur < end) {
  ------------------
  |  Branch (10653:12): [True: 1.00M, False: 6.98k]
  ------------------
10654|  1.00M|        if ((*cur == '<') || (*cur == '&')) {
  ------------------
  |  Branch (10654:13): [True: 96.2k, False: 911k]
  |  Branch (10654:30): [True: 7.10k, False: 904k]
  ------------------
10655|   103k|            ctxt->checkIndex = 0;
10656|   103k|            return(1);
10657|   103k|        }
10658|   904k|        cur++;
10659|   904k|    }
10660|       |
10661|  6.98k|    index = cur - ctxt->input->cur;
10662|  6.98k|    if (index > LONG_MAX) {
  ------------------
  |  Branch (10662:9): [True: 0, False: 6.98k]
  ------------------
10663|      0|        ctxt->checkIndex = 0;
10664|      0|        return(1);
10665|      0|    }
10666|  6.98k|    ctxt->checkIndex = index;
10667|  6.98k|    return(0);
10668|  6.98k|}
parser.c:nameNsPop:
 2112|  32.0k|{
 2113|  32.0k|    const xmlChar *ret;
 2114|       |
 2115|  32.0k|    if (ctxt->nameNr <= 0)
  ------------------
  |  Branch (2115:9): [True: 0, False: 32.0k]
  ------------------
 2116|      0|        return (NULL);
 2117|  32.0k|    ctxt->nameNr--;
 2118|  32.0k|    if (ctxt->nameNr > 0)
  ------------------
  |  Branch (2118:9): [True: 30.6k, False: 1.41k]
  ------------------
 2119|  30.6k|        ctxt->name = ctxt->nameTab[ctxt->nameNr - 1];
 2120|  1.41k|    else
 2121|  1.41k|        ctxt->name = NULL;
 2122|  32.0k|    ret = ctxt->nameTab[ctxt->nameNr];
 2123|       |    ctxt->nameTab[ctxt->nameNr] = NULL;
 2124|  32.0k|    return (ret);
 2125|  32.0k|}
parser.c:xmlParseLookupInternalSubset:
10720|  29.3k|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|  29.3k|    const xmlChar *cur, *start;
10729|  29.3k|    const xmlChar *end = ctxt->input->end;
10730|  29.3k|    int state = ctxt->endCheckState;
10731|  29.3k|    size_t index;
10732|       |
10733|  29.3k|    if (ctxt->checkIndex == 0) {
  ------------------
  |  Branch (10733:9): [True: 10.9k, False: 18.3k]
  ------------------
10734|  10.9k|        cur = ctxt->input->cur + 1;
10735|  18.3k|    } else {
10736|  18.3k|        cur = ctxt->input->cur + ctxt->checkIndex;
10737|  18.3k|    }
10738|  29.3k|    start = cur;
10739|       |
10740|  18.9M|    while (cur < end) {
  ------------------
  |  Branch (10740:12): [True: 18.9M, False: 21.6k]
  ------------------
10741|  18.9M|        if (state == '-') {
  ------------------
  |  Branch (10741:13): [True: 155k, False: 18.7M]
  ------------------
10742|   155k|            if ((*cur == '-') &&
  ------------------
  |  Branch (10742:17): [True: 33.8k, False: 121k]
  ------------------
10743|  33.8k|                (cur[1] == '-') &&
  ------------------
  |  Branch (10743:17): [True: 18.8k, False: 14.9k]
  ------------------
10744|  18.8k|                (cur[2] == '>')) {
  ------------------
  |  Branch (10744:17): [True: 16.8k, False: 2.00k]
  ------------------
10745|  16.8k|                state = 0;
10746|  16.8k|                cur += 3;
10747|  16.8k|                start = cur;
10748|  16.8k|                continue;
10749|  16.8k|            }
10750|   155k|        }
10751|  18.7M|        else if (state == ']') {
  ------------------
  |  Branch (10751:18): [True: 9.44k, False: 18.7M]
  ------------------
10752|  9.44k|            if (*cur == '>') {
  ------------------
  |  Branch (10752:17): [True: 7.48k, False: 1.95k]
  ------------------
10753|  7.48k|                ctxt->checkIndex = 0;
10754|  7.48k|                ctxt->endCheckState = 0;
10755|  7.48k|                return(1);
10756|  7.48k|            }
10757|  1.95k|            if (IS_BLANK_CH(*cur)) {
  ------------------
  |  |  137|  1.95k|#define IS_BLANK_CH(c)  xmlIsBlank_ch(c)
  |  |  ------------------
  |  |  |  |   90|  1.95k|#define xmlIsBlank_ch(c)	(((c) == 0x20) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (90:27): [True: 250, False: 1.70k]
  |  |  |  |  ------------------
  |  |  |  |   91|  1.95k|				 ((0x9 <= (c)) && ((c) <= 0xa)) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (91:7): [True: 1.50k, False: 207]
  |  |  |  |  |  Branch (91:23): [True: 461, False: 1.04k]
  |  |  |  |  ------------------
  |  |  |  |   92|  1.95k|				 ((c) == 0xd))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (92:6): [True: 427, False: 820]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
10758|  1.13k|                state = ' ';
10759|  1.13k|            } else if (*cur != ']') {
  ------------------
  |  Branch (10759:24): [True: 468, False: 352]
  ------------------
10760|    468|                state = 0;
10761|    468|                start = cur;
10762|    468|                continue;
10763|    468|            }
10764|  1.95k|        }
10765|  18.7M|        else if (state == ' ') {
  ------------------
  |  Branch (10765:18): [True: 2.65k, False: 18.7M]
  ------------------
10766|  2.65k|            if (*cur == '>') {
  ------------------
  |  Branch (10766:17): [True: 232, False: 2.42k]
  ------------------
10767|    232|                ctxt->checkIndex = 0;
10768|    232|                ctxt->endCheckState = 0;
10769|    232|                return(1);
10770|    232|            }
10771|  2.42k|            if (!IS_BLANK_CH(*cur)) {
  ------------------
  |  |  137|  2.42k|#define IS_BLANK_CH(c)  xmlIsBlank_ch(c)
  |  |  ------------------
  |  |  |  |   90|  2.42k|#define xmlIsBlank_ch(c)	(((c) == 0x20) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (90:27): [True: 215, False: 2.21k]
  |  |  |  |  ------------------
  |  |  |  |   91|  2.42k|				 ((0x9 <= (c)) && ((c) <= 0xa)) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (91:7): [True: 1.95k, False: 254]
  |  |  |  |  |  Branch (91:23): [True: 446, False: 1.51k]
  |  |  |  |  ------------------
  |  |  |  |   92|  2.42k|				 ((c) == 0xd))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (92:6): [True: 865, False: 900]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
10772|    900|                state = 0;
10773|    900|                start = cur;
10774|    900|                continue;
10775|    900|            }
10776|  2.42k|        }
10777|  18.7M|        else if (state != 0) {
  ------------------
  |  Branch (10777:18): [True: 15.0M, False: 3.70M]
  ------------------
10778|  15.0M|            if (*cur == state) {
  ------------------
  |  Branch (10778:17): [True: 31.3k, False: 15.0M]
  ------------------
10779|  31.3k|                state = 0;
10780|  31.3k|                start = cur + 1;
10781|  31.3k|            }
10782|  15.0M|        }
10783|  3.70M|        else if (*cur == '<') {
  ------------------
  |  Branch (10783:18): [True: 54.9k, False: 3.65M]
  ------------------
10784|  54.9k|            if ((cur[1] == '!') &&
  ------------------
  |  Branch (10784:17): [True: 45.3k, False: 9.65k]
  ------------------
10785|  45.3k|                (cur[2] == '-') &&
  ------------------
  |  Branch (10785:17): [True: 17.1k, False: 28.1k]
  ------------------
10786|  17.1k|                (cur[3] == '-')) {
  ------------------
  |  Branch (10786:17): [True: 16.9k, False: 255]
  ------------------
10787|  16.9k|                state = '-';
10788|  16.9k|                cur += 4;
10789|       |                /* Don't treat <!--> as comment */
10790|  16.9k|                start = cur;
10791|  16.9k|                continue;
10792|  16.9k|            }
10793|  54.9k|        }
10794|  3.65M|        else if ((*cur == '"') || (*cur == '\'') || (*cur == ']')) {
  ------------------
  |  Branch (10794:18): [True: 19.9k, False: 3.63M]
  |  Branch (10794:35): [True: 11.7k, False: 3.62M]
  |  Branch (10794:53): [True: 9.10k, False: 3.61M]
  ------------------
10795|  40.7k|            state = *cur;
10796|  40.7k|        }
10797|       |
10798|  18.8M|        cur++;
10799|  18.8M|    }
10800|       |
10801|       |    /*
10802|       |     * Rescan the three last characters to detect "<!--" and "-->"
10803|       |     * split across chunks.
10804|       |     */
10805|  21.6k|    if ((state == 0) || (state == '-')) {
  ------------------
  |  Branch (10805:9): [True: 5.43k, False: 16.1k]
  |  Branch (10805:25): [True: 387, False: 15.7k]
  ------------------
10806|  5.82k|        if (cur - start < 3)
  ------------------
  |  Branch (10806:13): [True: 611, False: 5.21k]
  ------------------
10807|    611|            cur = start;
10808|  5.21k|        else
10809|  5.21k|            cur -= 3;
10810|  5.82k|    }
10811|  21.6k|    index = cur - ctxt->input->cur;
10812|  21.6k|    if (index > LONG_MAX) {
  ------------------
  |  Branch (10812:9): [True: 0, False: 21.6k]
  ------------------
10813|      0|        ctxt->checkIndex = 0;
10814|      0|        ctxt->endCheckState = 0;
10815|      0|        return(1);
10816|      0|    }
10817|  21.6k|    ctxt->checkIndex = index;
10818|  21.6k|    ctxt->endCheckState = state;
10819|  21.6k|    return(0);
10820|  21.6k|}
parser.c:xmlCtxtParseEntity:
11760|  7.13k|xmlCtxtParseEntity(xmlParserCtxtPtr ctxt, xmlEntityPtr ent) {
11761|  7.13k|    xmlParserInputPtr input;
11762|  7.13k|    xmlNodePtr list;
11763|  7.13k|    unsigned long consumed;
11764|  7.13k|    int isExternal;
11765|  7.13k|    int buildTree;
11766|  7.13k|    int oldMinNsIndex;
11767|  7.13k|    int oldNodelen, oldNodemem;
11768|       |
11769|  7.13k|    isExternal = (ent->etype == XML_EXTERNAL_GENERAL_PARSED_ENTITY);
11770|  7.13k|    buildTree = (ctxt->node != NULL);
11771|       |
11772|       |    /*
11773|       |     * Recursion check
11774|       |     */
11775|  7.13k|    if (ent->flags & XML_ENT_EXPANDING) {
  ------------------
  |  |   22|  7.13k|#define XML_ENT_EXPANDING   (1u << 3)
  ------------------
  |  Branch (11775:9): [True: 6, False: 7.12k]
  ------------------
11776|      6|        xmlFatalErr(ctxt, XML_ERR_ENTITY_LOOP, NULL);
11777|      6|        goto error;
11778|      6|    }
11779|       |
11780|       |    /*
11781|       |     * Load entity
11782|       |     */
11783|  7.12k|    input = xmlNewEntityInputStream(ctxt, ent);
11784|  7.12k|    if (input == NULL)
  ------------------
  |  Branch (11784:9): [True: 2.09k, False: 5.03k]
  ------------------
11785|  2.09k|        goto error;
11786|       |
11787|       |    /*
11788|       |     * When building a tree, we need to limit the scope of namespace
11789|       |     * declarations, so that entities don't reference xmlNs structs
11790|       |     * from the parent of a reference.
11791|       |     */
11792|  5.03k|    oldMinNsIndex = ctxt->nsdb->minNsIndex;
11793|  5.03k|    if (buildTree)
  ------------------
  |  Branch (11793:9): [True: 5.03k, False: 0]
  ------------------
11794|  5.03k|        ctxt->nsdb->minNsIndex = ctxt->nsNr;
11795|       |
11796|  5.03k|    oldNodelen = ctxt->nodelen;
11797|  5.03k|    oldNodemem = ctxt->nodemem;
11798|  5.03k|    ctxt->nodelen = 0;
11799|  5.03k|    ctxt->nodemem = 0;
11800|       |
11801|       |    /*
11802|       |     * Parse content
11803|       |     *
11804|       |     * This initiates a recursive call chain:
11805|       |     *
11806|       |     * - xmlCtxtParseContentInternal
11807|       |     * - xmlParseContentInternal
11808|       |     * - xmlParseReference
11809|       |     * - xmlCtxtParseEntity
11810|       |     *
11811|       |     * The nesting depth is limited by the maximum number of inputs,
11812|       |     * see xmlCtxtPushInput.
11813|       |     *
11814|       |     * It's possible to make this non-recursive (minNsIndex must be
11815|       |     * stored in the input struct) at the expense of code readability.
11816|       |     */
11817|       |
11818|  5.03k|    ent->flags |= XML_ENT_EXPANDING;
  ------------------
  |  |   22|  5.03k|#define XML_ENT_EXPANDING   (1u << 3)
  ------------------
11819|       |
11820|  5.03k|    list = xmlCtxtParseContentInternal(ctxt, input, isExternal, buildTree);
11821|       |
11822|  5.03k|    ent->flags &= ~XML_ENT_EXPANDING;
  ------------------
  |  |   22|  5.03k|#define XML_ENT_EXPANDING   (1u << 3)
  ------------------
11823|       |
11824|  5.03k|    ctxt->nsdb->minNsIndex = oldMinNsIndex;
11825|  5.03k|    ctxt->nodelen = oldNodelen;
11826|  5.03k|    ctxt->nodemem = oldNodemem;
11827|       |
11828|       |    /*
11829|       |     * Entity size accounting
11830|       |     */
11831|  5.03k|    consumed = input->consumed;
11832|  5.03k|    xmlSaturatedAddSizeT(&consumed, input->end - input->base);
11833|       |
11834|  5.03k|    if ((ent->flags & XML_ENT_CHECKED) == 0)
  ------------------
  |  |   20|  5.03k|#define XML_ENT_CHECKED     (1u << 1)
  ------------------
  |  Branch (11834:9): [True: 3.20k, False: 1.82k]
  ------------------
11835|  3.20k|        xmlSaturatedAdd(&ent->expandedSize, consumed);
11836|       |
11837|  5.03k|    if ((ent->flags & XML_ENT_PARSED) == 0) {
  ------------------
  |  |   19|  5.03k|#define XML_ENT_PARSED      (1u << 0)
  ------------------
  |  Branch (11837:9): [True: 3.20k, False: 1.82k]
  ------------------
11838|  3.20k|        if (isExternal)
  ------------------
  |  Branch (11838:13): [True: 1.56k, False: 1.64k]
  ------------------
11839|  1.56k|            xmlSaturatedAdd(&ctxt->sizeentities, consumed);
11840|       |
11841|  3.20k|        ent->children = list;
11842|       |
11843|  25.3k|        while (list != NULL) {
  ------------------
  |  Branch (11843:16): [True: 22.1k, False: 3.20k]
  ------------------
11844|  22.1k|            list->parent = (xmlNodePtr) ent;
11845|       |
11846|       |            /*
11847|       |             * Downstream code like the nginx xslt module can set
11848|       |             * ctxt->myDoc->extSubset to a separate DTD, so the entity
11849|       |             * might have a different or a NULL document.
11850|       |             */
11851|  22.1k|            if (list->doc != ent->doc)
  ------------------
  |  Branch (11851:17): [True: 0, False: 22.1k]
  ------------------
11852|      0|                xmlSetTreeDoc(list, ent->doc);
11853|       |
11854|  22.1k|            if (list->next == NULL)
  ------------------
  |  Branch (11854:17): [True: 2.26k, False: 19.8k]
  ------------------
11855|  2.26k|                ent->last = list;
11856|  22.1k|            list = list->next;
11857|  22.1k|        }
11858|  3.20k|    } else {
11859|  1.82k|        xmlFreeNodeList(list);
11860|  1.82k|    }
11861|       |
11862|  5.03k|    xmlFreeInputStream(input);
11863|       |
11864|  7.13k|error:
11865|  7.13k|    ent->flags |= XML_ENT_PARSED | XML_ENT_CHECKED;
  ------------------
  |  |   19|  7.13k|#define XML_ENT_PARSED      (1u << 0)
  ------------------
                  ent->flags |= XML_ENT_PARSED | XML_ENT_CHECKED;
  ------------------
  |  |   20|  7.13k|#define XML_ENT_CHECKED     (1u << 1)
  ------------------
11866|  7.13k|}
parser.c:xmlCtxtParseContentInternal:
11670|  5.03k|                            int hasTextDecl, int buildTree) {
11671|  5.03k|    xmlNodePtr root = NULL;
11672|  5.03k|    xmlNodePtr list = NULL;
11673|  5.03k|    xmlChar *rootName = BAD_CAST "#root";
  ------------------
  |  |   34|  5.03k|#define BAD_CAST (xmlChar *)
  ------------------
11674|  5.03k|    int result;
11675|       |
11676|  5.03k|    if (buildTree) {
  ------------------
  |  Branch (11676:9): [True: 5.03k, False: 0]
  ------------------
11677|  5.03k|        root = xmlNewDocNode(ctxt->myDoc, NULL, rootName, NULL);
11678|  5.03k|        if (root == NULL) {
  ------------------
  |  Branch (11678:13): [True: 4, False: 5.03k]
  ------------------
11679|      4|            xmlErrMemory(ctxt);
11680|      4|            goto error;
11681|      4|        }
11682|  5.03k|    }
11683|       |
11684|  5.03k|    if (xmlCtxtPushInput(ctxt, input) < 0)
  ------------------
  |  Branch (11684:9): [True: 2, False: 5.02k]
  ------------------
11685|      2|        goto error;
11686|       |
11687|  5.02k|    nameNsPush(ctxt, rootName, NULL, NULL, 0, 0);
11688|  5.02k|    spacePush(ctxt, -1);
11689|       |
11690|  5.02k|    if (buildTree)
  ------------------
  |  Branch (11690:9): [True: 5.02k, False: 0]
  ------------------
11691|  5.02k|        nodePush(ctxt, root);
11692|       |
11693|  5.02k|    if (hasTextDecl) {
  ------------------
  |  Branch (11693:9): [True: 1.88k, False: 3.14k]
  ------------------
11694|  1.88k|        xmlDetectEncoding(ctxt);
11695|       |
11696|       |        /*
11697|       |         * Parse a possible text declaration first
11698|       |         */
11699|  1.88k|        if ((CMP5(CUR_PTR, '<', '?', 'x', 'm', 'l')) &&
  ------------------
  |  | 2234|  1.88k|  ( CMP4( s, c1, c2, c3, c4 ) && ((unsigned char *) s)[ 4 ] == c5 )
  |  |  ------------------
  |  |  |  | 2231|  3.77k|  ( ((unsigned char *) s)[ 0 ] == c1 && ((unsigned char *) s)[ 1 ] == c2 && \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2231:5): [True: 1.09k, False: 788]
  |  |  |  |  |  Branch (2231:41): [True: 328, False: 770]
  |  |  |  |  ------------------
  |  |  |  | 2232|  1.88k|    ((unsigned char *) s)[ 2 ] == c3 && ((unsigned char *) s)[ 3 ] == c4 )
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2232:5): [True: 315, False: 13]
  |  |  |  |  |  Branch (2232:41): [True: 313, False: 2]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2234:34): [True: 309, False: 4]
  |  |  ------------------
  ------------------
11700|    309|            (IS_BLANK_CH(NXT(5)))) {
  ------------------
  |  |  137|    309|#define IS_BLANK_CH(c)  xmlIsBlank_ch(c)
  |  |  ------------------
  |  |  |  |   90|    309|#define xmlIsBlank_ch(c)	(((c) == 0x20) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (90:27): [True: 230, False: 79]
  |  |  |  |  ------------------
  |  |  |  |   91|    309|				 ((0x9 <= (c)) && ((c) <= 0xa)) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (91:7): [True: 78, False: 1]
  |  |  |  |  |  Branch (91:23): [True: 43, False: 35]
  |  |  |  |  ------------------
  |  |  |  |   92|    309|				 ((c) == 0xd))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (92:6): [True: 34, False: 2]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
11701|    307|            xmlParseTextDecl(ctxt);
11702|       |            /*
11703|       |             * An XML-1.0 document can't reference an entity not XML-1.0
11704|       |             */
11705|    307|            if ((xmlStrEqual(ctxt->version, BAD_CAST "1.0")) &&
  ------------------
  |  |   34|    307|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (11705:17): [True: 303, False: 4]
  ------------------
11706|    303|                (!xmlStrEqual(ctxt->input->version, BAD_CAST "1.0"))) {
  ------------------
  |  |   34|    303|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (11706:17): [True: 46, False: 257]
  ------------------
11707|     46|                xmlFatalErrMsg(ctxt, XML_ERR_VERSION_MISMATCH,
11708|     46|                               "Version mismatch between document and "
11709|     46|                               "entity\n");
11710|     46|            }
11711|    307|        }
11712|  1.88k|    }
11713|       |
11714|  5.02k|    xmlParseContentInternal(ctxt);
11715|       |
11716|  5.02k|    if (ctxt->input->cur < ctxt->input->end)
  ------------------
  |  Branch (11716:9): [True: 348, False: 4.68k]
  ------------------
11717|    348|	xmlFatalErr(ctxt, XML_ERR_NOT_WELL_BALANCED, NULL);
11718|       |
11719|  5.02k|    if ((ctxt->wellFormed) ||
  ------------------
  |  Branch (11719:9): [True: 3.46k, False: 1.56k]
  ------------------
11720|  4.21k|        ((ctxt->recovery) && (!xmlCtxtIsCatastrophicError(ctxt)))) {
  ------------------
  |  Branch (11720:10): [True: 882, False: 678]
  |  Branch (11720:30): [True: 744, False: 138]
  ------------------
11721|  4.21k|        if (root != NULL) {
  ------------------
  |  Branch (11721:13): [True: 4.21k, False: 0]
  ------------------
11722|  4.21k|            xmlNodePtr cur;
11723|       |
11724|       |            /*
11725|       |             * Unlink newly created node list.
11726|       |             */
11727|  4.21k|            list = root->children;
11728|  4.21k|            root->children = NULL;
11729|  4.21k|            root->last = NULL;
11730|  26.3k|            for (cur = list; cur != NULL; cur = cur->next)
  ------------------
  |  Branch (11730:30): [True: 22.1k, False: 4.21k]
  ------------------
11731|  22.1k|                cur->parent = NULL;
11732|  4.21k|        }
11733|  4.21k|    }
11734|       |
11735|       |    /*
11736|       |     * Read the rest of the stream in case of errors. We want
11737|       |     * to account for the whole entity size.
11738|       |     */
11739|  5.35k|    do {
11740|  5.35k|        ctxt->input->cur = ctxt->input->end;
11741|  5.35k|        xmlParserShrink(ctxt);
11742|  5.35k|        result = xmlParserGrow(ctxt);
11743|  5.35k|    } while (result > 0);
  ------------------
  |  Branch (11743:14): [True: 326, False: 5.02k]
  ------------------
11744|       |
11745|  5.02k|    if (buildTree)
  ------------------
  |  Branch (11745:9): [True: 5.02k, False: 0]
  ------------------
11746|  5.02k|        nodePop(ctxt);
11747|       |
11748|  5.02k|    namePop(ctxt);
11749|  5.02k|    spacePop(ctxt);
11750|       |
11751|  5.02k|    xmlCtxtPopInput(ctxt);
11752|       |
11753|  5.03k|error:
11754|  5.03k|    xmlFreeNode(root);
11755|       |
11756|  5.03k|    return(list);
11757|  5.02k|}
parser.c:xmlParserNsPush:
 1666|   263k|                const xmlHashedString *uri, void *saxData, int defAttr) {
 1667|   263k|    xmlParserNsBucket *bucket = NULL;
 1668|   263k|    xmlParserNsExtra *extra;
 1669|   263k|    const xmlChar **ns;
 1670|   263k|    unsigned hashValue, nsIndex, oldIndex;
 1671|       |
 1672|   263k|    if ((prefix != NULL) && (prefix->name == ctxt->str_xml))
  ------------------
  |  Branch (1672:9): [True: 230k, False: 33.0k]
  |  Branch (1672:29): [True: 198, False: 230k]
  ------------------
 1673|    198|        return(0);
 1674|       |
 1675|   263k|    if ((ctxt->nsNr >= ctxt->nsMax) && (xmlParserNsGrow(ctxt) < 0)) {
  ------------------
  |  Branch (1675:9): [True: 14.4k, False: 248k]
  |  Branch (1675:40): [True: 12, False: 14.4k]
  ------------------
 1676|     12|        xmlErrMemory(ctxt);
 1677|     12|        return(-1);
 1678|     12|    }
 1679|       |
 1680|       |    /*
 1681|       |     * Default namespace and 'xml' namespace
 1682|       |     */
 1683|   263k|    if ((prefix == NULL) || (prefix->name == NULL)) {
  ------------------
  |  Branch (1683:9): [True: 33.0k, False: 230k]
  |  Branch (1683:29): [True: 0, False: 230k]
  ------------------
 1684|  33.0k|        oldIndex = ctxt->nsdb->defaultNsIndex;
 1685|       |
 1686|  33.0k|        if (oldIndex != INT_MAX) {
  ------------------
  |  Branch (1686:13): [True: 30.1k, False: 2.85k]
  ------------------
 1687|  30.1k|            extra = &ctxt->nsdb->extra[oldIndex];
 1688|       |
 1689|  30.1k|            if (extra->elementId == ctxt->nsdb->elementId) {
  ------------------
  |  Branch (1689:17): [True: 617, False: 29.5k]
  ------------------
 1690|    617|                if (defAttr == 0)
  ------------------
  |  Branch (1690:21): [True: 379, False: 238]
  ------------------
 1691|    379|                    xmlErrAttributeDup(ctxt, NULL, BAD_CAST "xmlns");
  ------------------
  |  |   34|    379|#define BAD_CAST (xmlChar *)
  ------------------
 1692|    617|                return(0);
 1693|    617|            }
 1694|       |
 1695|  29.5k|            if ((ctxt->options & XML_PARSE_NSCLEAN) &&
  ------------------
  |  Branch (1695:17): [True: 6.30k, False: 23.2k]
  ------------------
 1696|  6.30k|                (uri->name == ctxt->nsTab[oldIndex * 2 + 1]))
  ------------------
  |  Branch (1696:17): [True: 4.24k, False: 2.05k]
  ------------------
 1697|  4.24k|                return(0);
 1698|  29.5k|        }
 1699|       |
 1700|  28.1k|        ctxt->nsdb->defaultNsIndex = ctxt->nsNr;
 1701|  28.1k|        goto populate_entry;
 1702|  33.0k|    }
 1703|       |
 1704|       |    /*
 1705|       |     * Hash table lookup
 1706|       |     */
 1707|   230k|    oldIndex = xmlParserNsLookup(ctxt, prefix, &bucket);
 1708|   230k|    if (oldIndex != INT_MAX) {
  ------------------
  |  Branch (1708:9): [True: 188k, False: 41.4k]
  ------------------
 1709|   188k|        extra = &ctxt->nsdb->extra[oldIndex];
 1710|       |
 1711|       |        /*
 1712|       |         * Check for duplicate definitions on the same element.
 1713|       |         */
 1714|   188k|        if (extra->elementId == ctxt->nsdb->elementId) {
  ------------------
  |  Branch (1714:13): [True: 850, False: 187k]
  ------------------
 1715|    850|            if (defAttr == 0)
  ------------------
  |  Branch (1715:17): [True: 645, False: 205]
  ------------------
 1716|    645|                xmlErrAttributeDup(ctxt, BAD_CAST "xmlns", prefix->name);
  ------------------
  |  |   34|    645|#define BAD_CAST (xmlChar *)
  ------------------
 1717|    850|            return(0);
 1718|    850|        }
 1719|       |
 1720|   187k|        if ((ctxt->options & XML_PARSE_NSCLEAN) &&
  ------------------
  |  Branch (1720:13): [True: 6.80k, False: 181k]
  ------------------
 1721|  6.80k|            (uri->name == ctxt->nsTab[bucket->index * 2 + 1]))
  ------------------
  |  Branch (1721:13): [True: 4.34k, False: 2.45k]
  ------------------
 1722|  4.34k|            return(0);
 1723|       |
 1724|   183k|        bucket->index = ctxt->nsNr;
 1725|   183k|        goto populate_entry;
 1726|   187k|    }
 1727|       |
 1728|       |    /*
 1729|       |     * Insert new bucket
 1730|       |     */
 1731|       |
 1732|  41.4k|    hashValue = prefix->hashValue;
 1733|       |
 1734|       |    /*
 1735|       |     * Grow hash table, 50% fill factor
 1736|       |     */
 1737|  41.4k|    if (ctxt->nsdb->hashElems + 1 > ctxt->nsdb->hashSize / 2) {
  ------------------
  |  Branch (1737:9): [True: 7.96k, False: 33.5k]
  ------------------
 1738|  7.96k|        xmlParserNsBucket *newHash;
 1739|  7.96k|        unsigned newSize, i, index;
 1740|       |
 1741|  7.96k|        if (ctxt->nsdb->hashSize > UINT_MAX / 2) {
  ------------------
  |  Branch (1741:13): [True: 0, False: 7.96k]
  ------------------
 1742|      0|            xmlErrMemory(ctxt);
 1743|      0|            return(-1);
 1744|      0|        }
 1745|  7.96k|        newSize = ctxt->nsdb->hashSize ? ctxt->nsdb->hashSize * 2 : 16;
  ------------------
  |  Branch (1745:19): [True: 573, False: 7.39k]
  ------------------
 1746|  7.96k|        newHash = xmlMalloc(newSize * sizeof(newHash[0]));
 1747|  7.96k|        if (newHash == NULL) {
  ------------------
  |  Branch (1747:13): [True: 4, False: 7.96k]
  ------------------
 1748|      4|            xmlErrMemory(ctxt);
 1749|      4|            return(-1);
 1750|      4|        }
 1751|  7.96k|        memset(newHash, 0, newSize * sizeof(newHash[0]));
 1752|       |
 1753|   117k|        for (i = 0; i < ctxt->nsdb->hashSize; i++) {
  ------------------
  |  Branch (1753:21): [True: 109k, False: 7.96k]
  ------------------
 1754|   109k|            unsigned hv = ctxt->nsdb->hash[i].hashValue;
 1755|   109k|            unsigned newIndex;
 1756|       |
 1757|   109k|            if ((hv == 0) || (ctxt->nsdb->hash[i].index == INT_MAX))
  ------------------
  |  Branch (1757:17): [True: 106k, False: 2.55k]
  |  Branch (1757:30): [True: 1.03k, False: 1.51k]
  ------------------
 1758|   107k|                continue;
 1759|  1.51k|            newIndex = hv & (newSize - 1);
 1760|       |
 1761|  2.28k|            while (newHash[newIndex].hashValue != 0) {
  ------------------
  |  Branch (1761:20): [True: 771, False: 1.51k]
  ------------------
 1762|    771|                newIndex++;
 1763|    771|                if (newIndex == newSize)
  ------------------
  |  Branch (1763:21): [True: 150, False: 621]
  ------------------
 1764|    150|                    newIndex = 0;
 1765|    771|            }
 1766|       |
 1767|  1.51k|            newHash[newIndex] = ctxt->nsdb->hash[i];
 1768|  1.51k|        }
 1769|       |
 1770|  7.96k|        xmlFree(ctxt->nsdb->hash);
 1771|  7.96k|        ctxt->nsdb->hash = newHash;
 1772|  7.96k|        ctxt->nsdb->hashSize = newSize;
 1773|       |
 1774|       |        /*
 1775|       |         * Relookup
 1776|       |         */
 1777|  7.96k|        index = hashValue & (newSize - 1);
 1778|       |
 1779|  8.32k|        while (newHash[index].hashValue != 0) {
  ------------------
  |  Branch (1779:16): [True: 360, False: 7.96k]
  ------------------
 1780|    360|            index++;
 1781|    360|            if (index == newSize)
  ------------------
  |  Branch (1781:17): [True: 57, False: 303]
  ------------------
 1782|     57|                index = 0;
 1783|    360|        }
 1784|       |
 1785|  7.96k|        bucket = &newHash[index];
 1786|  7.96k|    }
 1787|       |
 1788|  41.4k|    bucket->hashValue = hashValue;
 1789|  41.4k|    bucket->index = ctxt->nsNr;
 1790|  41.4k|    ctxt->nsdb->hashElems++;
 1791|  41.4k|    oldIndex = INT_MAX;
 1792|       |
 1793|   253k|populate_entry:
 1794|   253k|    nsIndex = ctxt->nsNr;
 1795|       |
 1796|   253k|    ns = &ctxt->nsTab[nsIndex * 2];
 1797|   253k|    ns[0] = prefix ? prefix->name : NULL;
  ------------------
  |  Branch (1797:13): [True: 225k, False: 28.1k]
  ------------------
 1798|   253k|    ns[1] = uri->name;
 1799|       |
 1800|   253k|    extra = &ctxt->nsdb->extra[nsIndex];
 1801|   253k|    extra->saxData = saxData;
 1802|   253k|    extra->prefixHashValue = prefix ? prefix->hashValue : 0;
  ------------------
  |  Branch (1802:30): [True: 225k, False: 28.1k]
  ------------------
 1803|   253k|    extra->uriHashValue = uri->hashValue;
 1804|   253k|    extra->elementId = ctxt->nsdb->elementId;
 1805|   253k|    extra->oldIndex = oldIndex;
 1806|       |
 1807|   253k|    ctxt->nsNr++;
 1808|       |
 1809|   253k|    return(1);
 1810|  41.4k|}
parser.c:xmlParserNsGrow:
 1624|  14.4k|xmlParserNsGrow(xmlParserCtxtPtr ctxt) {
 1625|  14.4k|    const xmlChar **table;
 1626|  14.4k|    xmlParserNsExtra *extra;
 1627|  14.4k|    int newSize;
 1628|       |
 1629|  14.4k|    newSize = xmlGrowCapacity(ctxt->nsMax,
 1630|  14.4k|                              sizeof(table[0]) + sizeof(extra[0]),
 1631|  14.4k|                              16, XML_MAX_ITEMS);
  ------------------
  |  |   13|  14.4k|#define XML_MAX_ITEMS 1000000000 /* 1 billion */
  ------------------
 1632|  14.4k|    if (newSize < 0)
  ------------------
  |  Branch (1632:9): [True: 0, False: 14.4k]
  ------------------
 1633|      0|        goto error;
 1634|       |
 1635|  14.4k|    table = xmlRealloc(ctxt->nsTab, 2 * newSize * sizeof(table[0]));
 1636|  14.4k|    if (table == NULL)
  ------------------
  |  Branch (1636:9): [True: 5, False: 14.4k]
  ------------------
 1637|      5|        goto error;
 1638|  14.4k|    ctxt->nsTab = table;
 1639|       |
 1640|  14.4k|    extra = xmlRealloc(ctxt->nsdb->extra, newSize * sizeof(extra[0]));
 1641|  14.4k|    if (extra == NULL)
  ------------------
  |  Branch (1641:9): [True: 7, False: 14.4k]
  ------------------
 1642|      7|        goto error;
 1643|  14.4k|    ctxt->nsdb->extra = extra;
 1644|       |
 1645|  14.4k|    ctxt->nsMax = newSize;
 1646|  14.4k|    return(0);
 1647|       |
 1648|     12|error:
 1649|     12|    xmlErrMemory(ctxt);
 1650|     12|    return(-1);
 1651|  14.4k|}
parser.c:xmlParserNsPop:
 1821|   142k|{
 1822|   142k|    int i;
 1823|       |
 1824|       |    /* assert(nr <= ctxt->nsNr); */
 1825|       |
 1826|   343k|    for (i = ctxt->nsNr - 1; i >= ctxt->nsNr - nr; i--) {
  ------------------
  |  Branch (1826:30): [True: 201k, False: 142k]
  ------------------
 1827|   201k|        const xmlChar *prefix = ctxt->nsTab[i * 2];
 1828|   201k|        xmlParserNsExtra *extra = &ctxt->nsdb->extra[i];
 1829|       |
 1830|   201k|        if (prefix == NULL) {
  ------------------
  |  Branch (1830:13): [True: 14.3k, False: 186k]
  ------------------
 1831|  14.3k|            ctxt->nsdb->defaultNsIndex = extra->oldIndex;
 1832|   186k|        } else {
 1833|   186k|            xmlHashedString hprefix;
 1834|   186k|            xmlParserNsBucket *bucket = NULL;
 1835|       |
 1836|   186k|            hprefix.name = prefix;
 1837|   186k|            hprefix.hashValue = extra->prefixHashValue;
 1838|   186k|            xmlParserNsLookup(ctxt, &hprefix, &bucket);
 1839|       |            /* assert(bucket && bucket->hashValue); */
 1840|   186k|            bucket->index = extra->oldIndex;
 1841|   186k|        }
 1842|   201k|    }
 1843|       |
 1844|   142k|    ctxt->nsNr -= nr;
 1845|   142k|    return(nr);
 1846|   142k|}
parser.c:xmlCtxtSetOptionsInternal:
13133|  44.8k|{
13134|  44.8k|    int allMask;
13135|       |
13136|  44.8k|    if (ctxt == NULL)
  ------------------
  |  Branch (13136:9): [True: 0, False: 44.8k]
  ------------------
13137|      0|        return(-1);
13138|       |
13139|       |    /*
13140|       |     * XInclude options aren't handled by the parser.
13141|       |     *
13142|       |     * XML_PARSE_XINCLUDE
13143|       |     * XML_PARSE_NOXINCNODE
13144|       |     * XML_PARSE_NOBASEFIX
13145|       |     */
13146|  44.8k|    allMask = XML_PARSE_RECOVER |
13147|  44.8k|              XML_PARSE_NOENT |
13148|  44.8k|              XML_PARSE_DTDLOAD |
13149|  44.8k|              XML_PARSE_DTDATTR |
13150|  44.8k|              XML_PARSE_DTDVALID |
13151|  44.8k|              XML_PARSE_NOERROR |
13152|  44.8k|              XML_PARSE_NOWARNING |
13153|  44.8k|              XML_PARSE_PEDANTIC |
13154|  44.8k|              XML_PARSE_NOBLANKS |
13155|  44.8k|#ifdef LIBXML_SAX1_ENABLED
13156|  44.8k|              XML_PARSE_SAX1 |
13157|  44.8k|#endif
13158|  44.8k|              XML_PARSE_NONET |
13159|  44.8k|              XML_PARSE_NODICT |
13160|  44.8k|              XML_PARSE_NSCLEAN |
13161|  44.8k|              XML_PARSE_NOCDATA |
13162|  44.8k|              XML_PARSE_COMPACT |
13163|  44.8k|              XML_PARSE_OLD10 |
13164|  44.8k|              XML_PARSE_HUGE |
13165|  44.8k|              XML_PARSE_OLDSAX |
13166|  44.8k|              XML_PARSE_IGNORE_ENC |
13167|  44.8k|              XML_PARSE_BIG_LINES |
13168|  44.8k|              XML_PARSE_NO_XXE |
13169|  44.8k|              XML_PARSE_UNZIP |
13170|  44.8k|              XML_PARSE_NO_SYS_CATALOG |
13171|  44.8k|              XML_PARSE_CATALOG_PI;
13172|       |
13173|  44.8k|    ctxt->options = (ctxt->options & keepMask) | (options & allMask);
13174|       |
13175|       |    /*
13176|       |     * For some options, struct members are historically the source
13177|       |     * of truth. The values are initalized from global variables and
13178|       |     * old code could also modify them directly. Several older API
13179|       |     * functions that don't take an options argument rely on these
13180|       |     * deprecated mechanisms.
13181|       |     *
13182|       |     * Once public access to struct members and the globals are
13183|       |     * disabled, we can use the options bitmask as source of
13184|       |     * truth, making all these struct members obsolete.
13185|       |     *
13186|       |     * The XML_DETECT_IDS flags is misnamed. It simply enables
13187|       |     * loading of the external subset.
13188|       |     */
13189|  44.8k|    ctxt->recovery = (options & XML_PARSE_RECOVER) ? 1 : 0;
  ------------------
  |  Branch (13189:22): [True: 23.0k, False: 21.8k]
  ------------------
13190|  44.8k|    ctxt->replaceEntities = (options & XML_PARSE_NOENT) ? 1 : 0;
  ------------------
  |  Branch (13190:29): [True: 22.8k, False: 21.9k]
  ------------------
13191|  44.8k|    ctxt->loadsubset = (options & XML_PARSE_DTDLOAD) ? XML_DETECT_IDS : 0;
  ------------------
  |  |  208|  25.0k|#define XML_DETECT_IDS		2
  ------------------
  |  Branch (13191:24): [True: 25.0k, False: 19.7k]
  ------------------
13192|  44.8k|    ctxt->loadsubset |= (options & XML_PARSE_DTDATTR) ? XML_COMPLETE_ATTRS : 0;
  ------------------
  |  |  209|  21.5k|#define XML_COMPLETE_ATTRS	4
  ------------------
  |  Branch (13192:25): [True: 21.5k, False: 23.2k]
  ------------------
13193|  44.8k|    ctxt->loadsubset |= (options & XML_PARSE_SKIP_IDS) ? XML_SKIP_IDS : 0;
  ------------------
  |  |  210|  21.7k|#define XML_SKIP_IDS		8
  ------------------
  |  Branch (13193:25): [True: 21.7k, False: 23.0k]
  ------------------
13194|  44.8k|    ctxt->validate = (options & XML_PARSE_DTDVALID) ? 1 : 0;
  ------------------
  |  Branch (13194:22): [True: 21.0k, False: 23.8k]
  ------------------
13195|  44.8k|    ctxt->pedantic = (options & XML_PARSE_PEDANTIC) ? 1 : 0;
  ------------------
  |  Branch (13195:22): [True: 10.1k, False: 34.6k]
  ------------------
13196|  44.8k|    ctxt->keepBlanks = (options & XML_PARSE_NOBLANKS) ? 0 : 1;
  ------------------
  |  Branch (13196:24): [True: 20.8k, False: 23.9k]
  ------------------
13197|  44.8k|    ctxt->dictNames = (options & XML_PARSE_NODICT) ? 0 : 1;
  ------------------
  |  Branch (13197:23): [True: 19.1k, False: 25.6k]
  ------------------
13198|       |
13199|  44.8k|    return(options & ~allMask);
13200|  44.8k|}

xmlCtxtSetErrorHandler:
  122|  44.9k|{
  123|  44.9k|    if (ctxt == NULL)
  ------------------
  |  Branch (123:9): [True: 0, False: 44.9k]
  ------------------
  124|      0|        return;
  125|  44.9k|    ctxt->errorHandler = handler;
  126|  44.9k|    ctxt->errorCtxt = data;
  127|  44.9k|}
xmlCtxtErrMemory:
  179|  11.5k|{
  180|  11.5k|    xmlStructuredErrorFunc schannel = NULL;
  181|  11.5k|    xmlGenericErrorFunc channel = NULL;
  182|  11.5k|    void *data;
  183|       |
  184|  11.5k|    if (ctxt == NULL) {
  ------------------
  |  Branch (184:9): [True: 0, False: 11.5k]
  ------------------
  185|      0|        xmlRaiseMemoryError(NULL, NULL, NULL, XML_FROM_PARSER, NULL);
  186|      0|        return;
  187|      0|    }
  188|       |
  189|  11.5k|    ctxt->errNo = XML_ERR_NO_MEMORY;
  190|  11.5k|    ctxt->instate = XML_PARSER_EOF; /* TODO: Remove after refactoring */
  191|  11.5k|    ctxt->wellFormed = 0;
  192|  11.5k|    ctxt->disableSAX = 2;
  193|       |
  194|  11.5k|    if (ctxt->errorHandler) {
  ------------------
  |  Branch (194:9): [True: 11.5k, False: 0]
  ------------------
  195|  11.5k|        schannel = ctxt->errorHandler;
  196|  11.5k|        data = ctxt->errorCtxt;
  197|  11.5k|    } 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|  11.5k|    xmlRaiseMemoryError(schannel, channel, data, XML_FROM_PARSER,
  207|  11.5k|                        &ctxt->lastError);
  208|  11.5k|}
xmlCtxtErrIO:
  221|   200k|{
  222|   200k|    const char *errstr, *msg, *str1, *str2;
  223|   200k|    xmlErrorLevel level;
  224|       |
  225|   200k|    if (ctxt == NULL)
  ------------------
  |  Branch (225:9): [True: 0, False: 200k]
  ------------------
  226|      0|        return;
  227|       |
  228|   200k|    if (((code == XML_IO_ENOENT) ||
  ------------------
  |  Branch (228:10): [True: 5.48k, False: 194k]
  ------------------
  229|   194k|         (code == XML_IO_UNKNOWN))) {
  ------------------
  |  Branch (229:10): [True: 0, False: 194k]
  ------------------
  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|  5.48k|        if (ctxt->validate == 0)
  ------------------
  |  Branch (236:13): [True: 2.55k, False: 2.93k]
  ------------------
  237|  2.55k|            level = XML_ERR_WARNING;
  238|  2.93k|        else
  239|  2.93k|            level = XML_ERR_ERROR;
  240|   194k|    } else if (code == XML_IO_NETWORK_ATTEMPT) {
  ------------------
  |  Branch (240:16): [True: 0, False: 194k]
  ------------------
  241|      0|        level = XML_ERR_ERROR;
  242|   194k|    } else {
  243|   194k|        level = XML_ERR_FATAL;
  244|   194k|    }
  245|       |
  246|   200k|    errstr = xmlErrString(code);
  247|       |
  248|   200k|    if (uri == NULL) {
  ------------------
  |  Branch (248:9): [True: 194k, False: 5.55k]
  ------------------
  249|   194k|        msg = "%s\n";
  250|   194k|        str1 = errstr;
  251|   194k|        str2 = NULL;
  252|   194k|    } else {
  253|  5.55k|        msg = "failed to load \"%s\": %s\n";
  254|  5.55k|        str1 = uri;
  255|  5.55k|        str2 = errstr;
  256|  5.55k|    }
  257|       |
  258|   200k|    xmlCtxtErr(ctxt, NULL, XML_FROM_IO, code, level,
  259|   200k|               (const xmlChar *) uri, NULL, NULL, 0,
  260|   200k|               msg, str1, str2);
  261|   200k|}
xmlCtxtIsCatastrophicError:
  268|  55.7M|xmlCtxtIsCatastrophicError(xmlParserCtxt *ctxt) {
  269|  55.7M|    if (ctxt == NULL)
  ------------------
  |  Branch (269:9): [True: 0, False: 55.7M]
  ------------------
  270|      0|        return(1);
  271|       |
  272|  55.7M|    return(xmlIsCatastrophicError(ctxt->lastError.level,
  273|  55.7M|                                  ctxt->lastError.code));
  274|  55.7M|}
xmlCtxtVErr:
  296|  56.2M|{
  297|  56.2M|    xmlStructuredErrorFunc schannel = NULL;
  298|  56.2M|    xmlGenericErrorFunc channel = NULL;
  299|  56.2M|    void *data = NULL;
  300|  56.2M|    const char *file = NULL;
  301|  56.2M|    int line = 0;
  302|  56.2M|    int col = 0;
  303|  56.2M|    int res;
  304|       |
  305|  56.2M|    if (code == XML_ERR_NO_MEMORY) {
  ------------------
  |  Branch (305:9): [True: 3.15k, False: 56.1M]
  ------------------
  306|  3.15k|        xmlCtxtErrMemory(ctxt);
  307|  3.15k|        return;
  308|  3.15k|    }
  309|       |
  310|  56.1M|    if (ctxt == NULL) {
  ------------------
  |  Branch (310:9): [True: 0, False: 56.1M]
  ------------------
  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|  56.1M|    if (PARSER_STOPPED(ctxt))
  ------------------
  |  |   44|  56.1M|#define PARSER_STOPPED(ctxt) ((ctxt)->disableSAX > 1)
  |  |  ------------------
  |  |  |  Branch (44:30): [True: 466k, False: 55.7M]
  |  |  ------------------
  ------------------
  322|   466k|	return;
  323|       |
  324|       |    /* Don't overwrite catastrophic errors */
  325|  55.7M|    if (xmlCtxtIsCatastrophicError(ctxt))
  ------------------
  |  Branch (325:9): [True: 0, False: 55.7M]
  ------------------
  326|      0|        return;
  327|       |
  328|  55.7M|    if (level == XML_ERR_WARNING) {
  ------------------
  |  Branch (328:9): [True: 166k, False: 55.5M]
  ------------------
  329|   166k|        if (ctxt->nbWarnings >= XML_MAX_ERRORS)
  ------------------
  |  |   54|   166k|#define XML_MAX_ERRORS 100
  ------------------
  |  Branch (329:13): [True: 118k, False: 48.6k]
  ------------------
  330|   118k|            return;
  331|  48.6k|        ctxt->nbWarnings += 1;
  332|  55.5M|    } 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|  55.5M|        if (xmlIsCatastrophicError(level, code) ||
  ------------------
  |  Branch (341:13): [True: 20, False: 55.5M]
  ------------------
  342|  55.5M|            code == XML_ERR_RESOURCE_LIMIT ||
  ------------------
  |  Branch (342:13): [True: 274, False: 55.5M]
  ------------------
  343|  55.5M|            code == XML_ERR_ENTITY_LOOP) {
  ------------------
  |  Branch (343:13): [True: 96, False: 55.5M]
  ------------------
  344|    390|            ctxt->disableSAX = 2; /* really stop parser */
  345|  55.5M|        } else {
  346|       |            /* Report at least one fatal error. */
  347|  55.5M|            if (ctxt->nbErrors >= XML_MAX_ERRORS &&
  ------------------
  |  |   54|   111M|#define XML_MAX_ERRORS 100
  ------------------
  |  Branch (347:17): [True: 55.0M, False: 563k]
  ------------------
  348|  55.0M|                (level < XML_ERR_FATAL || ctxt->wellFormed == 0))
  ------------------
  |  Branch (348:18): [True: 604k, False: 54.3M]
  |  Branch (348:43): [True: 54.3M, False: 224]
  ------------------
  349|  55.0M|                return;
  350|       |
  351|   563k|            if (level == XML_ERR_FATAL && ctxt->recovery == 0)
  ------------------
  |  Branch (351:17): [True: 427k, False: 136k]
  |  Branch (351:43): [True: 110k, False: 316k]
  ------------------
  352|   110k|                ctxt->disableSAX = 1;
  353|   563k|        }
  354|       |
  355|   563k|        if (level == XML_ERR_FATAL)
  ------------------
  |  Branch (355:13): [True: 427k, False: 136k]
  ------------------
  356|   427k|            ctxt->wellFormed = 0;
  357|   563k|        ctxt->errNo = code;
  358|   563k|        ctxt->nbErrors += 1;
  359|   563k|    }
  360|       |
  361|   612k|    if (((ctxt->options & XML_PARSE_NOERROR) == 0) &&
  ------------------
  |  Branch (361:9): [True: 228k, False: 384k]
  ------------------
  362|   228k|        ((level != XML_ERR_WARNING) ||
  ------------------
  |  Branch (362:10): [True: 212k, False: 15.7k]
  ------------------
  363|   220k|         ((ctxt->options & XML_PARSE_NOWARNING) == 0))) {
  ------------------
  |  Branch (363:10): [True: 7.94k, False: 7.77k]
  ------------------
  364|   220k|        if (ctxt->errorHandler) {
  ------------------
  |  Branch (364:13): [True: 220k, False: 0]
  ------------------
  365|   220k|            schannel = ctxt->errorHandler;
  366|   220k|            data = ctxt->errorCtxt;
  367|   220k|        } 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|   220k|    }
  385|       |
  386|   612k|    if (ctxt->input != NULL) {
  ------------------
  |  Branch (386:9): [True: 610k, False: 2.00k]
  ------------------
  387|   610k|        xmlParserInputPtr input = ctxt->input;
  388|       |
  389|   610k|        if ((input->filename == NULL) &&
  ------------------
  |  Branch (389:13): [True: 360k, False: 250k]
  ------------------
  390|   360k|            (ctxt->inputNr > 1)) {
  ------------------
  |  Branch (390:13): [True: 20.3k, False: 340k]
  ------------------
  391|  20.3k|            input = ctxt->inputTab[ctxt->inputNr - 2];
  392|  20.3k|        }
  393|   610k|        file = input->filename;
  394|   610k|        line = input->line;
  395|   610k|        col = input->col;
  396|   610k|    }
  397|       |
  398|   612k|    res = xmlVRaiseError(schannel, channel, data, ctxt, node, domain, code,
  399|   612k|                         level, file, line, (const char *) str1,
  400|   612k|                         (const char *) str2, (const char *) str3, int1, col,
  401|   612k|                         msg, ap);
  402|       |
  403|   612k|    if (res < 0) {
  ------------------
  |  Branch (403:9): [True: 2.38k, False: 610k]
  ------------------
  404|  2.38k|        xmlCtxtErrMemory(ctxt);
  405|  2.38k|        return;
  406|  2.38k|    }
  407|   612k|}
xmlCtxtErr:
  429|  55.7M|{
  430|  55.7M|    va_list ap;
  431|       |
  432|  55.7M|    va_start(ap, msg);
  433|  55.7M|    xmlCtxtVErr(ctxt, node, domain, code, level,
  434|  55.7M|                str1, str2, str3, int1, msg, ap);
  435|       |    va_end(ap);
  436|  55.7M|}
xmlFatalErr:
  481|  9.04M|{
  482|  9.04M|    const char *errmsg;
  483|  9.04M|    xmlErrorDomain domain = XML_FROM_PARSER;
  484|  9.04M|    xmlErrorLevel level = XML_ERR_FATAL;
  485|       |
  486|  9.04M|    errmsg = xmlErrString(code);
  487|       |
  488|  9.04M|    if ((ctxt != NULL) && (ctxt->html)) {
  ------------------
  |  Branch (488:9): [True: 9.04M, False: 0]
  |  Branch (488:27): [True: 0, False: 9.04M]
  ------------------
  489|      0|        domain = XML_FROM_HTML;
  490|       |
  491|       |        /* Continue if encoding is unsupported */
  492|      0|        if (code == XML_ERR_UNSUPPORTED_ENCODING)
  ------------------
  |  Branch (492:13): [True: 0, False: 0]
  ------------------
  493|      0|            level = XML_ERR_ERROR;
  494|      0|    }
  495|       |
  496|  9.04M|    if (info == NULL) {
  ------------------
  |  Branch (496:9): [True: 1.67M, False: 7.37M]
  ------------------
  497|  1.67M|        xmlCtxtErr(ctxt, NULL, domain, code, level,
  498|  1.67M|                   NULL, NULL, NULL, 0, "%s\n", errmsg);
  499|  7.37M|    } else {
  500|  7.37M|        xmlCtxtErr(ctxt, NULL, domain, code, level,
  501|  7.37M|                   (const xmlChar *) info, NULL, NULL, 0,
  502|  7.37M|                   "%s: %s\n", errmsg, info);
  503|  7.37M|    }
  504|  9.04M|}
xmlParserGrow:
  616|  8.67M|xmlParserGrow(xmlParserCtxt *ctxt) {
  617|  8.67M|    xmlParserInputPtr in = ctxt->input;
  618|  8.67M|    xmlParserInputBufferPtr buf = in->buf;
  619|  8.67M|    size_t curEnd = in->end - in->cur;
  620|  8.67M|    size_t curBase = in->cur - in->base;
  621|  8.67M|    size_t maxLength = (ctxt->options & XML_PARSE_HUGE) ?
  ------------------
  |  Branch (621:24): [True: 3.20M, False: 5.46M]
  ------------------
  622|  3.20M|                       XML_MAX_HUGE_LENGTH :
  ------------------
  |  |   55|  3.20M|#define XML_MAX_HUGE_LENGTH 1000000000
  ------------------
  623|  8.67M|                       XML_MAX_LOOKUP_LIMIT;
  ------------------
  |  |   81|  14.1M|#define XML_MAX_LOOKUP_LIMIT 10000000
  ------------------
  624|  8.67M|    int ret;
  625|       |
  626|  8.67M|    if (buf == NULL)
  ------------------
  |  Branch (626:9): [True: 0, False: 8.67M]
  ------------------
  627|      0|        return(0);
  628|       |    /* Don't grow push parser buffer. */
  629|  8.67M|    if (PARSER_PROGRESSIVE(ctxt))
  ------------------
  |  |   47|  8.67M|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  ------------------
  |  |  |  |   41|  8.67M|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  ------------------
  |  |  |  Branch (47:5): [True: 2.51M, False: 6.15M]
  |  |  ------------------
  ------------------
  630|  2.51M|        return(0);
  631|       |    /* Don't grow memory buffers. */
  632|  6.15M|    if ((buf->encoder == NULL) && (buf->readcallback == NULL))
  ------------------
  |  Branch (632:9): [True: 5.75M, False: 400k]
  |  Branch (632:35): [True: 5.75M, False: 0]
  ------------------
  633|  5.75M|        return(0);
  634|   400k|    if (buf->error != 0)
  ------------------
  |  Branch (634:9): [True: 122k, False: 277k]
  ------------------
  635|   122k|        return(-1);
  636|       |
  637|   277k|    if (curBase > maxLength) {
  ------------------
  |  Branch (637:9): [True: 0, False: 277k]
  ------------------
  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|   277k|    if (curEnd >= INPUT_CHUNK)
  ------------------
  |  |   63|   277k|#define INPUT_CHUNK	250
  ------------------
  |  Branch (643:9): [True: 296, False: 277k]
  ------------------
  644|    296|        return(0);
  645|       |
  646|   277k|    ret = xmlParserInputBufferGrow(buf, INPUT_CHUNK);
  ------------------
  |  |   63|   277k|#define INPUT_CHUNK	250
  ------------------
  647|   277k|    xmlBufUpdateInput(buf->buffer, in, curBase);
  648|       |
  649|   277k|    if (ret < 0) {
  ------------------
  |  Branch (649:9): [True: 537, False: 277k]
  ------------------
  650|    537|        xmlCtxtErrIO(ctxt, buf->error, NULL);
  651|    537|    }
  652|       |
  653|   277k|    return(ret);
  654|   277k|}
xmlParserCheckEOF:
  664|  21.8k|xmlParserCheckEOF(xmlParserCtxt *ctxt, xmlParserErrors code) {
  665|  21.8k|    xmlParserInputPtr in = ctxt->input;
  666|  21.8k|    xmlParserInputBufferPtr buf;
  667|       |
  668|  21.8k|    if (ctxt->errNo != XML_ERR_OK)
  ------------------
  |  Branch (668:9): [True: 17.8k, False: 4.03k]
  ------------------
  669|  17.8k|        return;
  670|       |
  671|  4.03k|    if (in->cur < in->end) {
  ------------------
  |  Branch (671:9): [True: 3, False: 4.03k]
  ------------------
  672|      3|        xmlFatalErr(ctxt, code, NULL);
  673|      3|        return;
  674|      3|    }
  675|       |
  676|  4.03k|    buf = in->buf;
  677|  4.03k|    if ((buf != NULL) && (buf->encoder != NULL)) {
  ------------------
  |  Branch (677:9): [True: 4.03k, False: 0]
  |  Branch (677:26): [True: 10, False: 4.02k]
  ------------------
  678|     10|        size_t curBase = in->cur - in->base;
  679|     10|        size_t sizeOut = 64;
  680|     10|        xmlCharEncError ret;
  681|       |
  682|       |        /*
  683|       |         * Check for truncated multi-byte sequence
  684|       |         */
  685|     10|        ret = xmlCharEncInput(buf, &sizeOut, /* flush */ 1);
  686|     10|        xmlBufUpdateInput(buf->buffer, in, curBase);
  687|     10|        if (ret != XML_ENC_ERR_SUCCESS) {
  ------------------
  |  Branch (687:13): [True: 1, False: 9]
  ------------------
  688|      1|            xmlCtxtErrIO(ctxt, buf->error, NULL);
  689|      1|            return;
  690|      1|        }
  691|       |
  692|       |        /* Shouldn't happen */
  693|      9|        if (in->cur < in->end)
  ------------------
  |  Branch (693:13): [True: 0, False: 9]
  ------------------
  694|      0|            xmlFatalErr(ctxt, XML_ERR_INTERNAL_ERROR, "expected EOF");
  695|      9|    }
  696|  4.03k|}
xmlParserShrink:
  749|  11.6M|xmlParserShrink(xmlParserCtxt *ctxt) {
  750|  11.6M|    xmlParserInputPtr in = ctxt->input;
  751|  11.6M|    xmlParserInputBufferPtr buf = in->buf;
  752|  11.6M|    size_t used, res;
  753|       |
  754|  11.6M|    if (buf == NULL)
  ------------------
  |  Branch (754:9): [True: 0, False: 11.6M]
  ------------------
  755|      0|        return;
  756|       |
  757|  11.6M|    used = in->cur - in->base;
  758|       |
  759|  11.6M|    if (used > LINE_LEN) {
  ------------------
  |  |  595|  11.6M|#define LINE_LEN        80
  ------------------
  |  Branch (759:9): [True: 7.06M, False: 4.56M]
  ------------------
  760|  7.06M|        res = xmlBufShrink(buf->buffer, used - LINE_LEN);
  ------------------
  |  |  595|  7.06M|#define LINE_LEN        80
  ------------------
  761|       |
  762|  7.06M|        if (res > 0) {
  ------------------
  |  Branch (762:13): [True: 7.06M, False: 224]
  ------------------
  763|  7.06M|            used -= res;
  764|  7.06M|            xmlSaturatedAddSizeT(&in->consumed, res);
  765|  7.06M|        }
  766|       |
  767|  7.06M|        xmlBufUpdateInput(buf->buffer, in, used);
  768|  7.06M|    }
  769|  11.6M|}
xmlNextChar:
  818|   346M|{
  819|   346M|    const unsigned char *cur;
  820|   346M|    size_t avail;
  821|   346M|    int c;
  822|       |
  823|   346M|    if ((ctxt == NULL) || (ctxt->input == NULL))
  ------------------
  |  Branch (823:9): [True: 0, False: 346M]
  |  Branch (823:27): [True: 0, False: 346M]
  ------------------
  824|      0|        return;
  825|       |
  826|   346M|    avail = ctxt->input->end - ctxt->input->cur;
  827|       |
  828|   346M|    if (avail < INPUT_CHUNK) {
  ------------------
  |  |   63|   346M|#define INPUT_CHUNK	250
  ------------------
  |  Branch (828:9): [True: 2.32M, False: 344M]
  ------------------
  829|  2.32M|        xmlParserGrow(ctxt);
  830|  2.32M|        if (ctxt->input->cur >= ctxt->input->end)
  ------------------
  |  Branch (830:13): [True: 779, False: 2.32M]
  ------------------
  831|    779|            return;
  832|  2.32M|        avail = ctxt->input->end - ctxt->input->cur;
  833|  2.32M|    }
  834|       |
  835|   346M|    cur = ctxt->input->cur;
  836|   346M|    c = *cur;
  837|       |
  838|   346M|    if (c < 0x80) {
  ------------------
  |  Branch (838:9): [True: 324M, False: 21.5M]
  ------------------
  839|   324M|        if (c == '\n') {
  ------------------
  |  Branch (839:13): [True: 509k, False: 324M]
  ------------------
  840|   509k|            ctxt->input->cur++;
  841|   509k|            ctxt->input->line++;
  842|   509k|            ctxt->input->col = 1;
  843|   324M|        } else if (c == '\r') {
  ------------------
  |  Branch (843:20): [True: 44.1k, False: 324M]
  ------------------
  844|       |            /*
  845|       |             *   2.11 End-of-Line Handling
  846|       |             *   the literal two-character sequence "#xD#xA" or a standalone
  847|       |             *   literal #xD, an XML processor must pass to the application
  848|       |             *   the single character #xA.
  849|       |             */
  850|  44.1k|            ctxt->input->cur += ((cur[1] == '\n') ? 2 : 1);
  ------------------
  |  Branch (850:34): [True: 42.7k, False: 1.39k]
  ------------------
  851|  44.1k|            ctxt->input->line++;
  852|  44.1k|            ctxt->input->col = 1;
  853|  44.1k|            return;
  854|   324M|        } else {
  855|   324M|            ctxt->input->cur++;
  856|   324M|            ctxt->input->col++;
  857|   324M|        }
  858|   324M|    } else {
  859|  21.5M|        ctxt->input->col++;
  860|       |
  861|  21.5M|        if ((avail < 2) || (cur[1] & 0xc0) != 0x80)
  ------------------
  |  Branch (861:13): [True: 2.20k, False: 21.5M]
  |  Branch (861:28): [True: 19.6M, False: 1.92M]
  ------------------
  862|  19.6M|            goto encoding_error;
  863|       |
  864|  1.92M|        if (c < 0xe0) {
  ------------------
  |  Branch (864:13): [True: 1.77M, False: 148k]
  ------------------
  865|       |            /* 2-byte code */
  866|  1.77M|            if (c < 0xc2)
  ------------------
  |  Branch (866:17): [True: 590k, False: 1.18M]
  ------------------
  867|   590k|                goto encoding_error;
  868|  1.18M|            ctxt->input->cur += 2;
  869|  1.18M|        } else {
  870|   148k|            unsigned int val = (c << 8) | cur[1];
  871|       |
  872|   148k|            if ((avail < 3) || (cur[2] & 0xc0) != 0x80)
  ------------------
  |  Branch (872:17): [True: 400, False: 147k]
  |  Branch (872:32): [True: 3.66k, False: 144k]
  ------------------
  873|  4.06k|                goto encoding_error;
  874|       |
  875|   144k|            if (c < 0xf0) {
  ------------------
  |  Branch (875:17): [True: 103k, False: 40.5k]
  ------------------
  876|       |                /* 3-byte code */
  877|   103k|                if ((val < 0xe0a0) || ((val >= 0xeda0) && (val < 0xee00)))
  ------------------
  |  Branch (877:21): [True: 72, False: 103k]
  |  Branch (877:40): [True: 16.0k, False: 87.4k]
  |  Branch (877:59): [True: 1.16k, False: 14.9k]
  ------------------
  878|  1.24k|                    goto encoding_error;
  879|   102k|                ctxt->input->cur += 3;
  880|   102k|            } else {
  881|  40.5k|                if ((avail < 4) || ((cur[3] & 0xc0) != 0x80))
  ------------------
  |  Branch (881:21): [True: 198, False: 40.3k]
  |  Branch (881:36): [True: 286, False: 40.0k]
  ------------------
  882|    484|                    goto encoding_error;
  883|       |
  884|       |                /* 4-byte code */
  885|  40.0k|                if ((val < 0xf090) || (val >= 0xf490))
  ------------------
  |  Branch (885:21): [True: 70, False: 40.0k]
  |  Branch (885:39): [True: 1.97k, False: 38.0k]
  ------------------
  886|  2.04k|                    goto encoding_error;
  887|  38.0k|                ctxt->input->cur += 4;
  888|  38.0k|            }
  889|   144k|        }
  890|  1.92M|    }
  891|       |
  892|   326M|    return;
  893|       |
  894|   326M|encoding_error:
  895|       |    /* Only report the first error */
  896|  20.2M|    if ((ctxt->input->flags & XML_INPUT_ENCODING_ERROR) == 0) {
  ------------------
  |  |   40|  20.2M|#define XML_INPUT_ENCODING_ERROR    (1u << 5)
  ------------------
  |  Branch (896:9): [True: 157k, False: 20.0M]
  ------------------
  897|   157k|        xmlCtxtErrIO(ctxt, XML_ERR_INVALID_ENCODING, NULL);
  898|   157k|        ctxt->input->flags |= XML_INPUT_ENCODING_ERROR;
  ------------------
  |  |   40|   157k|#define XML_INPUT_ENCODING_ERROR    (1u << 5)
  ------------------
  899|   157k|    }
  900|  20.2M|    ctxt->input->cur++;
  901|  20.2M|}
xmlCurrentChar:
  924|  57.7M|xmlCurrentChar(xmlParserCtxt *ctxt, int *len) {
  925|  57.7M|    const unsigned char *cur;
  926|  57.7M|    size_t avail;
  927|  57.7M|    int c;
  928|       |
  929|  57.7M|    if ((ctxt == NULL) || (len == NULL) || (ctxt->input == NULL)) return(0);
  ------------------
  |  Branch (929:9): [True: 0, False: 57.7M]
  |  Branch (929:27): [True: 0, False: 57.7M]
  |  Branch (929:44): [True: 0, False: 57.7M]
  ------------------
  930|       |
  931|  57.7M|    avail = ctxt->input->end - ctxt->input->cur;
  932|       |
  933|  57.7M|    if (avail < INPUT_CHUNK) {
  ------------------
  |  |   63|  57.7M|#define INPUT_CHUNK	250
  ------------------
  |  Branch (933:9): [True: 2.87M, False: 54.9M]
  ------------------
  934|  2.87M|        xmlParserGrow(ctxt);
  935|  2.87M|        avail = ctxt->input->end - ctxt->input->cur;
  936|  2.87M|    }
  937|       |
  938|  57.7M|    cur = ctxt->input->cur;
  939|  57.7M|    c = *cur;
  940|       |
  941|  57.7M|    if (c < 0x80) {
  ------------------
  |  Branch (941:9): [True: 29.1M, False: 28.6M]
  ------------------
  942|       |	/* 1-byte code */
  943|  29.1M|        if (c < 0x20) {
  ------------------
  |  Branch (943:13): [True: 12.8M, False: 16.2M]
  ------------------
  944|       |            /*
  945|       |             *   2.11 End-of-Line Handling
  946|       |             *   the literal two-character sequence "#xD#xA" or a standalone
  947|       |             *   literal #xD, an XML processor must pass to the application
  948|       |             *   the single character #xA.
  949|       |             */
  950|  12.8M|            if (c == '\r') {
  ------------------
  |  Branch (950:17): [True: 929k, False: 11.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|   929k|                if (cur[1] == '\n')
  ------------------
  |  Branch (956:21): [True: 24.8k, False: 904k]
  ------------------
  957|  24.8k|                    ctxt->input->cur++;
  958|   929k|                *len = 1;
  959|   929k|                c = '\n';
  960|  11.9M|            } else if (c == 0) {
  ------------------
  |  Branch (960:24): [True: 7.40M, False: 4.53M]
  ------------------
  961|  7.40M|                if (ctxt->input->cur >= ctxt->input->end) {
  ------------------
  |  Branch (961:21): [True: 33.9k, False: 7.37M]
  ------------------
  962|  33.9k|                    *len = 0;
  963|  7.37M|                } else {
  964|  7.37M|                    *len = 1;
  965|       |                    /*
  966|       |                     * TODO: Null bytes should be handled by callers,
  967|       |                     * but this can be tricky.
  968|       |                     */
  969|  7.37M|                    xmlFatalErr(ctxt, XML_ERR_INVALID_CHAR,
  970|  7.37M|                            "Char 0x0 out of allowed range\n");
  971|  7.37M|                }
  972|  7.40M|            } else {
  973|  4.53M|                *len = 1;
  974|  4.53M|            }
  975|  16.2M|        } else {
  976|  16.2M|            *len = 1;
  977|  16.2M|        }
  978|       |
  979|  29.1M|        return(c);
  980|  29.1M|    } else {
  981|  28.6M|        int val;
  982|       |
  983|  28.6M|        if (avail < 2)
  ------------------
  |  Branch (983:13): [True: 1.17k, False: 28.6M]
  ------------------
  984|  1.17k|            goto incomplete_sequence;
  985|  28.6M|        if ((cur[1] & 0xc0) != 0x80)
  ------------------
  |  Branch (985:13): [True: 8.12M, False: 20.5M]
  ------------------
  986|  8.12M|            goto encoding_error;
  987|       |
  988|  20.5M|        if (c < 0xe0) {
  ------------------
  |  Branch (988:13): [True: 11.4M, False: 9.00M]
  ------------------
  989|       |            /* 2-byte code */
  990|  11.4M|            if (c < 0xc2)
  ------------------
  |  Branch (990:17): [True: 309k, False: 11.1M]
  ------------------
  991|   309k|                goto encoding_error;
  992|  11.1M|            val = (c & 0x1f) << 6;
  993|  11.1M|            val |= cur[1] & 0x3f;
  994|  11.1M|            *len = 2;
  995|  11.1M|        } else {
  996|  9.00M|            if (avail < 3)
  ------------------
  |  Branch (996:17): [True: 551, False: 9.00M]
  ------------------
  997|    551|                goto incomplete_sequence;
  998|  9.00M|            if ((cur[2] & 0xc0) != 0x80)
  ------------------
  |  Branch (998:17): [True: 7.08k, False: 8.99M]
  ------------------
  999|  7.08k|                goto encoding_error;
 1000|       |
 1001|  8.99M|            if (c < 0xf0) {
  ------------------
  |  Branch (1001:17): [True: 8.97M, False: 22.4k]
  ------------------
 1002|       |                /* 3-byte code */
 1003|  8.97M|                val = (c & 0xf) << 12;
 1004|  8.97M|                val |= (cur[1] & 0x3f) << 6;
 1005|  8.97M|                val |= cur[2] & 0x3f;
 1006|  8.97M|                if ((val < 0x800) || ((val >= 0xd800) && (val < 0xe000)))
  ------------------
  |  Branch (1006:21): [True: 330, False: 8.97M]
  |  Branch (1006:39): [True: 3.22M, False: 5.74M]
  |  Branch (1006:58): [True: 214, False: 3.22M]
  ------------------
 1007|    544|                    goto encoding_error;
 1008|  8.96M|                *len = 3;
 1009|  8.96M|            } else {
 1010|  22.4k|                if (avail < 4)
  ------------------
  |  Branch (1010:21): [True: 425, False: 22.0k]
  ------------------
 1011|    425|                    goto incomplete_sequence;
 1012|  22.0k|                if ((cur[3] & 0xc0) != 0x80)
  ------------------
  |  Branch (1012:21): [True: 1.75k, False: 20.2k]
  ------------------
 1013|  1.75k|                    goto encoding_error;
 1014|       |
 1015|       |                /* 4-byte code */
 1016|  20.2k|                val = (c & 0x0f) << 18;
 1017|  20.2k|                val |= (cur[1] & 0x3f) << 12;
 1018|  20.2k|                val |= (cur[2] & 0x3f) << 6;
 1019|  20.2k|                val |= cur[3] & 0x3f;
 1020|  20.2k|                if ((val < 0x10000) || (val >= 0x110000))
  ------------------
  |  Branch (1020:21): [True: 272, False: 19.9k]
  |  Branch (1020:40): [True: 7.74k, False: 12.2k]
  ------------------
 1021|  8.01k|                    goto encoding_error;
 1022|  12.2k|                *len = 4;
 1023|  12.2k|            }
 1024|  8.99M|        }
 1025|       |
 1026|  20.1M|        return(val);
 1027|  20.5M|    }
 1028|       |
 1029|  8.45M|encoding_error:
 1030|       |    /* Only report the first error */
 1031|  8.45M|    if ((ctxt->input->flags & XML_INPUT_ENCODING_ERROR) == 0) {
  ------------------
  |  |   40|  8.45M|#define XML_INPUT_ENCODING_ERROR    (1u << 5)
  ------------------
  |  Branch (1031:9): [True: 12.3k, False: 8.44M]
  ------------------
 1032|  12.3k|        xmlCtxtErrIO(ctxt, XML_ERR_INVALID_ENCODING, NULL);
 1033|  12.3k|        ctxt->input->flags |= XML_INPUT_ENCODING_ERROR;
  ------------------
  |  |   40|  12.3k|#define XML_INPUT_ENCODING_ERROR    (1u << 5)
  ------------------
 1034|  12.3k|    }
 1035|  8.45M|    *len = 1;
 1036|  8.45M|    return(XML_INVALID_CHAR);
  ------------------
  |  |    9|  8.45M|#define XML_INVALID_CHAR 0x200000
  ------------------
 1037|       |
 1038|  2.14k|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|  2.14k|    *len = 0;
 1046|  2.14k|    return(0);
 1047|  57.7M|}
xmlCopyCharMultiByte:
 1086|  20.7M|xmlCopyCharMultiByte(xmlChar *out, int val) {
 1087|  20.7M|    if ((out == NULL) || (val < 0)) return(0);
  ------------------
  |  Branch (1087:9): [True: 0, False: 20.7M]
  |  Branch (1087:26): [True: 0, False: 20.7M]
  ------------------
 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|  20.7M|    if  (val >= 0x80) {
  ------------------
  |  Branch (1097:10): [True: 20.7M, False: 10.1k]
  ------------------
 1098|  20.7M|	xmlChar *savedout = out;
 1099|  20.7M|	int bits;
 1100|  20.7M|	if (val <   0x800) { *out++= (val >>  6) | 0xC0;  bits=  0; }
  ------------------
  |  Branch (1100:6): [True: 6.05M, False: 14.6M]
  ------------------
 1101|  14.6M|	else if (val < 0x10000) { *out++= (val >> 12) | 0xE0;  bits=  6;}
  ------------------
  |  Branch (1101:11): [True: 14.6M, False: 10.1k]
  ------------------
 1102|  10.1k|	else if (val < 0x110000)  { *out++= (val >> 18) | 0xF0;  bits=  12; }
  ------------------
  |  Branch (1102:11): [True: 10.1k, 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|  56.1M|	for ( ; bits >= 0; bits-= 6)
  ------------------
  |  Branch (1109:10): [True: 35.4M, False: 20.7M]
  ------------------
 1110|  35.4M|	    *out++= ((val >> bits) & 0x3F) | 0x80 ;
 1111|  20.7M|	return (out - savedout);
 1112|  20.7M|    }
 1113|  10.1k|    *out = val;
 1114|  10.1k|    return 1;
 1115|  20.7M|}
xmlSwitchEncoding:
 1263|  6.72k|{
 1264|  6.72k|    xmlCharEncodingHandlerPtr handler = NULL;
 1265|  6.72k|    int ret;
 1266|  6.72k|    xmlParserErrors code;
 1267|       |
 1268|  6.72k|    if ((ctxt == NULL) || (ctxt->input == NULL))
  ------------------
  |  Branch (1268:9): [True: 0, False: 6.72k]
  |  Branch (1268:27): [True: 0, False: 6.72k]
  ------------------
 1269|      0|        return(-1);
 1270|       |
 1271|  6.72k|    code = xmlLookupCharEncodingHandler(enc, &handler);
 1272|  6.72k|    if (code != 0) {
  ------------------
  |  Branch (1272:9): [True: 4, False: 6.71k]
  ------------------
 1273|      4|        xmlFatalErr(ctxt, code, NULL);
 1274|      4|        return(-1);
 1275|      4|    }
 1276|       |
 1277|  6.71k|    ret = xmlSwitchToEncoding(ctxt, handler);
 1278|       |
 1279|  6.71k|    if ((ret >= 0) && (enc == XML_CHAR_ENCODING_NONE)) {
  ------------------
  |  Branch (1279:9): [True: 4.83k, False: 1.88k]
  |  Branch (1279:23): [True: 0, False: 4.83k]
  ------------------
 1280|      0|        ctxt->input->flags &= ~XML_INPUT_HAS_ENCODING;
  ------------------
  |  |   33|      0|#define XML_INPUT_HAS_ENCODING      (1u << 0)
  ------------------
 1281|      0|    }
 1282|       |
 1283|  6.71k|    return(ret);
 1284|  6.72k|}
xmlInputSetEncodingHandler:
 1353|  14.1k|                           xmlCharEncodingHandler *handler) {
 1354|  14.1k|    xmlParserInputBufferPtr in;
 1355|  14.1k|    xmlBufPtr buf;
 1356|  14.1k|    xmlParserErrors code = XML_ERR_OK;
 1357|       |
 1358|  14.1k|    if ((input == NULL) || (input->buf == NULL)) {
  ------------------
  |  Branch (1358:9): [True: 0, False: 14.1k]
  |  Branch (1358:28): [True: 0, False: 14.1k]
  ------------------
 1359|      0|        xmlCharEncCloseFunc(handler);
 1360|      0|	return(XML_ERR_ARGUMENT);
 1361|      0|    }
 1362|  14.1k|    in = input->buf;
 1363|       |
 1364|  14.1k|    input->flags |= XML_INPUT_HAS_ENCODING;
  ------------------
  |  |   33|  14.1k|#define XML_INPUT_HAS_ENCODING      (1u << 0)
  ------------------
 1365|       |
 1366|       |    /*
 1367|       |     * UTF-8 requires no encoding handler.
 1368|       |     */
 1369|  14.1k|    if ((handler != NULL) &&
  ------------------
  |  Branch (1369:9): [True: 13.7k, False: 443]
  ------------------
 1370|  13.7k|        (xmlStrcasecmp(BAD_CAST handler->name, BAD_CAST "UTF-8") == 0)) {
  ------------------
  |  |   34|  13.7k|#define BAD_CAST (xmlChar *)
  ------------------
                      (xmlStrcasecmp(BAD_CAST handler->name, BAD_CAST "UTF-8") == 0)) {
  ------------------
  |  |   34|  13.7k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (1370:9): [True: 0, False: 13.7k]
  ------------------
 1371|      0|        xmlCharEncCloseFunc(handler);
 1372|      0|        handler = NULL;
 1373|      0|    }
 1374|       |
 1375|  14.1k|    if (in->encoder == handler)
  ------------------
  |  Branch (1375:9): [True: 443, False: 13.7k]
  ------------------
 1376|    443|        return(XML_ERR_OK);
 1377|       |
 1378|  13.7k|    if (in->encoder != NULL) {
  ------------------
  |  Branch (1378:9): [True: 0, False: 13.7k]
  ------------------
 1379|       |        /*
 1380|       |         * Switching encodings during parsing is a really bad idea,
 1381|       |         * but Chromium can switch between ISO-8859-1 and UTF-16 before
 1382|       |         * separate calls to xmlParseChunk.
 1383|       |         *
 1384|       |         * TODO: We should check whether the "raw" input buffer is empty and
 1385|       |         * convert the old content using the old encoder.
 1386|       |         */
 1387|       |
 1388|      0|        xmlCharEncCloseFunc(in->encoder);
 1389|      0|        in->encoder = handler;
 1390|      0|        return(XML_ERR_OK);
 1391|      0|    }
 1392|       |
 1393|  13.7k|    buf = xmlBufCreate(XML_IO_BUFFER_SIZE);
  ------------------
  |  |   20|  13.7k|#define XML_IO_BUFFER_SIZE 6000
  ------------------
 1394|  13.7k|    if (buf == NULL) {
  ------------------
  |  Branch (1394:9): [True: 24, False: 13.7k]
  ------------------
 1395|     24|        xmlCharEncCloseFunc(handler);
 1396|     24|        return(XML_ERR_NO_MEMORY);
 1397|     24|    }
 1398|       |
 1399|  13.7k|    in->encoder = handler;
 1400|  13.7k|    in->raw = in->buffer;
 1401|  13.7k|    in->buffer = buf;
 1402|       |
 1403|       |    /*
 1404|       |     * Is there already some content down the pipe to convert ?
 1405|       |     */
 1406|  13.7k|    if (input->end > input->base) {
  ------------------
  |  Branch (1406:9): [True: 13.7k, False: 0]
  ------------------
 1407|  13.7k|        size_t processed;
 1408|  13.7k|        size_t nbchars;
 1409|  13.7k|        xmlCharEncError res;
 1410|       |
 1411|       |        /*
 1412|       |         * Shrink the current input buffer.
 1413|       |         * Move it as the raw buffer and create a new input buffer
 1414|       |         */
 1415|  13.7k|        processed = input->cur - input->base;
 1416|  13.7k|        xmlBufShrink(in->raw, processed);
 1417|  13.7k|        input->consumed += processed;
 1418|  13.7k|        in->rawconsumed = processed;
 1419|       |
 1420|       |        /*
 1421|       |         * If we're push-parsing, we must convert the whole buffer.
 1422|       |         *
 1423|       |         * If we're pull-parsing, we could be parsing from a huge
 1424|       |         * memory buffer which we don't want to convert completely.
 1425|       |         */
 1426|  13.7k|        if (input->flags & XML_INPUT_PROGRESSIVE)
  ------------------
  |  |   41|  13.7k|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  ------------------
  |  Branch (1426:13): [True: 1.23k, False: 12.4k]
  ------------------
 1427|  1.23k|            nbchars = SIZE_MAX;
 1428|  12.4k|        else
 1429|  12.4k|            nbchars = 4000 /* MINLEN */;
 1430|  13.7k|        res = xmlCharEncInput(in, &nbchars, /* flush */ 0);
 1431|  13.7k|        if (res != XML_ENC_ERR_SUCCESS)
  ------------------
  |  Branch (1431:13): [True: 2.94k, False: 10.7k]
  ------------------
 1432|  2.94k|            code = in->error;
 1433|  13.7k|    }
 1434|       |
 1435|  13.7k|    xmlBufResetInput(in->buffer, input);
 1436|       |
 1437|  13.7k|    return(code);
 1438|  13.7k|}
xmlSwitchToEncoding:
 1475|  9.79k|{
 1476|  9.79k|    xmlParserErrors code;
 1477|       |
 1478|  9.79k|    if (ctxt == NULL)
  ------------------
  |  Branch (1478:9): [True: 0, False: 9.79k]
  ------------------
 1479|      0|        return(-1);
 1480|       |
 1481|  9.79k|    code = xmlInputSetEncodingHandler(ctxt->input, handler);
 1482|  9.79k|    if (code != XML_ERR_OK) {
  ------------------
  |  Branch (1482:9): [True: 1.97k, False: 7.82k]
  ------------------
 1483|  1.97k|        xmlCtxtErrIO(ctxt, code, NULL);
 1484|  1.97k|        return(-1);
 1485|  1.97k|    }
 1486|       |
 1487|  7.82k|    return(0);
 1488|  9.79k|}
xmlDetectEncoding:
 1498|   283k|xmlDetectEncoding(xmlParserCtxt *ctxt) {
 1499|   283k|    const xmlChar *in;
 1500|   283k|    xmlCharEncoding enc;
 1501|   283k|    int bomSize;
 1502|   283k|    int autoFlag = 0;
 1503|       |
 1504|   283k|    if (xmlParserGrow(ctxt) < 0)
  ------------------
  |  Branch (1504:9): [True: 0, False: 283k]
  ------------------
 1505|      0|        return;
 1506|   283k|    in = ctxt->input->cur;
 1507|   283k|    if (ctxt->input->end - in < 4)
  ------------------
  |  Branch (1507:9): [True: 1.31k, False: 282k]
  ------------------
 1508|  1.31k|        return;
 1509|       |
 1510|   282k|    if (ctxt->input->flags & XML_INPUT_HAS_ENCODING) {
  ------------------
  |  |   33|   282k|#define XML_INPUT_HAS_ENCODING      (1u << 0)
  ------------------
  |  Branch (1510:9): [True: 0, False: 282k]
  ------------------
 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|   282k|    enc = XML_CHAR_ENCODING_NONE;
 1523|   282k|    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|   282k|    switch (in[0]) {
  ------------------
  |  Branch (1531:13): [True: 260k, False: 21.6k]
  ------------------
 1532|  1.40k|        case 0x00:
  ------------------
  |  Branch (1532:9): [True: 1.40k, False: 281k]
  ------------------
 1533|  1.40k|            if ((!ctxt->html) &&
  ------------------
  |  Branch (1533:17): [True: 1.40k, False: 0]
  ------------------
 1534|  1.40k|                (in[1] == 0x00) && (in[2] == 0x00) && (in[3] == 0x3C)) {
  ------------------
  |  Branch (1534:17): [True: 695, False: 710]
  |  Branch (1534:36): [True: 479, False: 216]
  |  Branch (1534:55): [True: 275, False: 204]
  ------------------
 1535|    275|                enc = XML_CHAR_ENCODING_UCS4BE;
 1536|    275|                autoFlag = XML_INPUT_AUTO_OTHER;
  ------------------
  |  |   38|    275|#define XML_INPUT_AUTO_OTHER        (4u << 1)
  ------------------
 1537|  1.13k|            } else if ((in[1] == 0x3C) && (in[2] == 0x00) && (in[3] == 0x3F)) {
  ------------------
  |  Branch (1537:24): [True: 662, False: 468]
  |  Branch (1537:43): [True: 408, False: 254]
  |  Branch (1537:62): [True: 328, False: 80]
  ------------------
 1538|       |                /*
 1539|       |                 * TODO: The HTML5 spec requires to check that the
 1540|       |                 * next codepoint is an 'x'.
 1541|       |                 */
 1542|    328|                enc = XML_CHAR_ENCODING_UTF16BE;
 1543|    328|                autoFlag = XML_INPUT_AUTO_UTF16BE;
  ------------------
  |  |   37|    328|#define XML_INPUT_AUTO_UTF16BE      (3u << 1)
  ------------------
 1544|    328|            }
 1545|  1.40k|            break;
 1546|       |
 1547|   252k|        case 0x3C:
  ------------------
  |  Branch (1547:9): [True: 252k, False: 30.2k]
  ------------------
 1548|   252k|            if (in[1] == 0x00) {
  ------------------
  |  Branch (1548:17): [True: 4.27k, False: 248k]
  ------------------
 1549|  4.27k|                if ((!ctxt->html) &&
  ------------------
  |  Branch (1549:21): [True: 4.27k, False: 0]
  ------------------
 1550|  4.27k|                    (in[2] == 0x00) && (in[3] == 0x00)) {
  ------------------
  |  Branch (1550:21): [True: 702, False: 3.57k]
  |  Branch (1550:40): [True: 456, False: 246]
  ------------------
 1551|    456|                    enc = XML_CHAR_ENCODING_UCS4LE;
 1552|    456|                    autoFlag = XML_INPUT_AUTO_OTHER;
  ------------------
  |  |   38|    456|#define XML_INPUT_AUTO_OTHER        (4u << 1)
  ------------------
 1553|  3.81k|                } else if ((in[2] == 0x3F) && (in[3] == 0x00)) {
  ------------------
  |  Branch (1553:28): [True: 3.38k, False: 433]
  |  Branch (1553:47): [True: 3.11k, False: 268]
  ------------------
 1554|       |                    /*
 1555|       |                     * TODO: The HTML5 spec requires to check that the
 1556|       |                     * next codepoint is an 'x'.
 1557|       |                     */
 1558|  3.11k|                    enc = XML_CHAR_ENCODING_UTF16LE;
 1559|  3.11k|                    autoFlag = XML_INPUT_AUTO_UTF16LE;
  ------------------
  |  |   36|  3.11k|#define XML_INPUT_AUTO_UTF16LE      (2u << 1)
  ------------------
 1560|  3.11k|                }
 1561|  4.27k|            }
 1562|   252k|            break;
 1563|       |
 1564|  3.93k|        case 0x4C:
  ------------------
  |  Branch (1564:9): [True: 3.93k, False: 278k]
  ------------------
 1565|  3.93k|	    if ((!ctxt->html) &&
  ------------------
  |  Branch (1565:10): [True: 3.93k, False: 0]
  ------------------
 1566|  3.93k|                (in[1] == 0x6F) && (in[2] == 0xA7) && (in[3] == 0x94)) {
  ------------------
  |  Branch (1566:17): [True: 3.71k, False: 227]
  |  Branch (1566:36): [True: 3.42k, False: 290]
  |  Branch (1566:55): [True: 3.20k, False: 221]
  ------------------
 1567|  3.20k|	        enc = XML_CHAR_ENCODING_EBCDIC;
 1568|  3.20k|                autoFlag = XML_INPUT_AUTO_OTHER;
  ------------------
  |  |   38|  3.20k|#define XML_INPUT_AUTO_OTHER        (4u << 1)
  ------------------
 1569|  3.20k|            }
 1570|  3.93k|            break;
 1571|       |
 1572|    259|        case 0xEF:
  ------------------
  |  Branch (1572:9): [True: 259, False: 282k]
  ------------------
 1573|    259|            if ((in[1] == 0xBB) && (in[2] == 0xBF)) {
  ------------------
  |  Branch (1573:17): [True: 155, False: 104]
  |  Branch (1573:36): [True: 79, False: 76]
  ------------------
 1574|     79|                enc = XML_CHAR_ENCODING_UTF8;
 1575|     79|                autoFlag = XML_INPUT_AUTO_UTF8;
  ------------------
  |  |   35|     79|#define XML_INPUT_AUTO_UTF8         (1u << 1)
  ------------------
 1576|     79|                bomSize = 3;
 1577|     79|            }
 1578|    259|            break;
 1579|       |
 1580|  2.40k|        case 0xFE:
  ------------------
  |  Branch (1580:9): [True: 2.40k, False: 280k]
  ------------------
 1581|  2.40k|            if (in[1] == 0xFF) {
  ------------------
  |  Branch (1581:17): [True: 2.16k, False: 239]
  ------------------
 1582|  2.16k|                enc = XML_CHAR_ENCODING_UTF16BE;
 1583|  2.16k|                autoFlag = XML_INPUT_AUTO_UTF16BE;
  ------------------
  |  |   37|  2.16k|#define XML_INPUT_AUTO_UTF16BE      (3u << 1)
  ------------------
 1584|  2.16k|                bomSize = 2;
 1585|  2.16k|            }
 1586|  2.40k|            break;
 1587|       |
 1588|    509|        case 0xFF:
  ------------------
  |  Branch (1588:9): [True: 509, False: 282k]
  ------------------
 1589|    509|            if (in[1] == 0xFE) {
  ------------------
  |  Branch (1589:17): [True: 303, False: 206]
  ------------------
 1590|    303|                enc = XML_CHAR_ENCODING_UTF16LE;
 1591|    303|                autoFlag = XML_INPUT_AUTO_UTF16LE;
  ------------------
  |  |   36|    303|#define XML_INPUT_AUTO_UTF16LE      (2u << 1)
  ------------------
 1592|    303|                bomSize = 2;
 1593|    303|            }
 1594|    509|            break;
 1595|   282k|    }
 1596|       |
 1597|   282k|    if (bomSize > 0) {
  ------------------
  |  Branch (1597:9): [True: 2.54k, False: 280k]
  ------------------
 1598|  2.54k|        ctxt->input->cur += bomSize;
 1599|  2.54k|    }
 1600|       |
 1601|   282k|    if (enc != XML_CHAR_ENCODING_NONE) {
  ------------------
  |  Branch (1601:9): [True: 9.92k, False: 272k]
  ------------------
 1602|  9.92k|        ctxt->input->flags |= autoFlag;
 1603|       |
 1604|  9.92k|        if (enc == XML_CHAR_ENCODING_EBCDIC) {
  ------------------
  |  Branch (1604:13): [True: 3.20k, False: 6.72k]
  ------------------
 1605|  3.20k|            xmlCharEncodingHandlerPtr handler;
 1606|  3.20k|            xmlParserErrors res;
 1607|       |
 1608|  3.20k|            res = xmlDetectEBCDIC(ctxt, &handler);
 1609|  3.20k|            if (res != XML_ERR_OK) {
  ------------------
  |  Branch (1609:17): [True: 124, False: 3.07k]
  ------------------
 1610|    124|                xmlFatalErr(ctxt, res, "detecting EBCDIC\n");
 1611|  3.07k|            } else {
 1612|  3.07k|                xmlSwitchToEncoding(ctxt, handler);
 1613|  3.07k|            }
 1614|  6.72k|        } else {
 1615|  6.72k|            xmlSwitchEncoding(ctxt, enc);
 1616|  6.72k|        }
 1617|  9.92k|    }
 1618|   282k|}
xmlSetDeclaredEncoding:
 1632|  6.27k|xmlSetDeclaredEncoding(xmlParserCtxt *ctxt, xmlChar *encoding) {
 1633|  6.27k|    if (((ctxt->input->flags & XML_INPUT_HAS_ENCODING) == 0) &&
  ------------------
  |  |   33|  6.27k|#define XML_INPUT_HAS_ENCODING      (1u << 0)
  ------------------
  |  Branch (1633:9): [True: 6.27k, False: 6]
  ------------------
 1634|  6.27k|        ((ctxt->options & XML_PARSE_IGNORE_ENC) == 0)) {
  ------------------
  |  Branch (1634:9): [True: 5.03k, False: 1.24k]
  ------------------
 1635|  5.03k|        xmlCharEncodingHandlerPtr handler;
 1636|  5.03k|        xmlParserErrors res;
 1637|  5.03k|        xmlCharEncFlags flags = XML_ENC_INPUT;
 1638|       |
 1639|       |        /*
 1640|       |         * xmlSwitchEncodingName treats unsupported encodings as
 1641|       |         * warnings, but we want it to be an error in an encoding
 1642|       |         * declaration.
 1643|       |         */
 1644|  5.03k|        if (ctxt->html)
  ------------------
  |  Branch (1644:13): [True: 0, False: 5.03k]
  ------------------
 1645|      0|            flags |= XML_ENC_HTML;
 1646|  5.03k|        res = xmlCreateCharEncodingHandler((const char *) encoding,
 1647|  5.03k|                flags, ctxt->convImpl, ctxt->convCtxt, &handler);
 1648|  5.03k|        if (res != XML_ERR_OK) {
  ------------------
  |  Branch (1648:13): [True: 654, False: 4.37k]
  ------------------
 1649|    654|            xmlFatalErr(ctxt, res, (const char *) encoding);
 1650|    654|            xmlFree(encoding);
 1651|    654|            return;
 1652|    654|        }
 1653|       |
 1654|  4.37k|        res  = xmlInputSetEncodingHandler(ctxt->input, handler);
 1655|  4.37k|        if (res != XML_ERR_OK) {
  ------------------
  |  Branch (1655:13): [True: 994, False: 3.38k]
  ------------------
 1656|    994|            xmlCtxtErrIO(ctxt, res, NULL);
 1657|    994|            xmlFree(encoding);
 1658|    994|            return;
 1659|    994|        }
 1660|       |
 1661|  3.38k|        ctxt->input->flags |= XML_INPUT_USES_ENC_DECL;
  ------------------
  |  |   39|  3.38k|#define XML_INPUT_USES_ENC_DECL     (1u << 4)
  ------------------
 1662|  3.38k|    } else if (ctxt->input->flags & XML_INPUT_AUTO_ENCODING) {
  ------------------
  |  |   34|  1.24k|#define XML_INPUT_AUTO_ENCODING     (7u << 1)
  ------------------
  |  Branch (1662:16): [True: 6, False: 1.24k]
  ------------------
 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|  4.62k|    if (ctxt->encoding != NULL)
  ------------------
  |  Branch (1714:9): [True: 1.59k, False: 3.03k]
  ------------------
 1715|  1.59k|        xmlFree(ctxt->encoding);
 1716|  4.62k|    ctxt->encoding = encoding;
 1717|  4.62k|}
xmlGetActualEncoding:
 1740|  27.2k|xmlGetActualEncoding(xmlParserCtxt *ctxt) {
 1741|  27.2k|    const xmlChar *encoding = NULL;
 1742|       |
 1743|  27.2k|    if ((ctxt->input->flags & XML_INPUT_USES_ENC_DECL) ||
  ------------------
  |  |   39|  27.2k|#define XML_INPUT_USES_ENC_DECL     (1u << 4)
  ------------------
  |  Branch (1743:9): [True: 864, False: 26.3k]
  ------------------
 1744|  26.3k|        (ctxt->input->flags & XML_INPUT_AUTO_ENCODING)) {
  ------------------
  |  |   34|  26.3k|#define XML_INPUT_AUTO_ENCODING     (7u << 1)
  ------------------
  |  Branch (1744:9): [True: 527, False: 25.8k]
  ------------------
 1745|       |        /* Preserve encoding exactly */
 1746|  1.39k|        encoding = ctxt->encoding;
 1747|  25.8k|    } else if ((ctxt->input->buf) && (ctxt->input->buf->encoder)) {
  ------------------
  |  Branch (1747:16): [True: 25.8k, False: 0]
  |  Branch (1747:38): [True: 202, False: 25.6k]
  ------------------
 1748|    202|        encoding = BAD_CAST ctxt->input->buf->encoder->name;
  ------------------
  |  |   34|    202|#define BAD_CAST (xmlChar *)
  ------------------
 1749|  25.6k|    } else if (ctxt->input->flags & XML_INPUT_HAS_ENCODING) {
  ------------------
  |  |   33|  25.6k|#define XML_INPUT_HAS_ENCODING      (1u << 0)
  ------------------
  |  Branch (1749:16): [True: 206, False: 25.4k]
  ------------------
 1750|    206|        encoding = BAD_CAST "UTF-8";
  ------------------
  |  |   34|    206|#define BAD_CAST (xmlChar *)
  ------------------
 1751|    206|    }
 1752|       |
 1753|  27.2k|    return(encoding);
 1754|  27.2k|}
xmlFreeInputStream:
 1768|   298k|xmlFreeInputStream(xmlParserInput *input) {
 1769|   298k|    if (input == NULL) return;
  ------------------
  |  Branch (1769:9): [True: 1.89k, False: 296k]
  ------------------
 1770|       |
 1771|   296k|    if (input->filename != NULL) xmlFree((char *) input->filename);
  ------------------
  |  Branch (1771:9): [True: 248k, False: 48.2k]
  ------------------
 1772|   296k|    if (input->version != NULL) xmlFree((char *) input->version);
  ------------------
  |  Branch (1772:9): [True: 170k, False: 125k]
  ------------------
 1773|   296k|    if ((input->free != NULL) && (input->base != NULL))
  ------------------
  |  Branch (1773:9): [True: 0, False: 296k]
  |  Branch (1773:34): [True: 0, False: 0]
  ------------------
 1774|      0|        input->free((xmlChar *) input->base);
 1775|   296k|    if (input->buf != NULL)
  ------------------
  |  Branch (1775:9): [True: 296k, False: 0]
  ------------------
 1776|   296k|        xmlFreeParserInputBuffer(input->buf);
 1777|   296k|    xmlFree(input);
 1778|   296k|}
xmlNewInputFromMemory:
 1892|   248k|                      xmlParserInputFlags flags) {
 1893|   248k|    xmlParserInputBufferPtr buf;
 1894|       |
 1895|   248k|    if (mem == NULL)
  ------------------
  |  Branch (1895:9): [True: 0, False: 248k]
  ------------------
 1896|      0|	return(NULL);
 1897|       |
 1898|   248k|    buf = xmlNewInputBufferMemory(mem, size, flags, XML_CHAR_ENCODING_NONE);
 1899|   248k|    if (buf == NULL)
  ------------------
  |  Branch (1899:9): [True: 29, False: 248k]
  ------------------
 1900|     29|        return(NULL);
 1901|       |
 1902|   248k|    return(xmlNewInputInternal(buf, url));
 1903|   248k|}
xmlNewInputFromString:
 1954|  11.8k|                      xmlParserInputFlags flags) {
 1955|  11.8k|    xmlParserInputBufferPtr buf;
 1956|       |
 1957|  11.8k|    if (str == NULL)
  ------------------
  |  Branch (1957:9): [True: 0, False: 11.8k]
  ------------------
 1958|      0|	return(NULL);
 1959|       |
 1960|  11.8k|    buf = xmlNewInputBufferString(str, flags);
 1961|  11.8k|    if (buf == NULL)
  ------------------
  |  Branch (1961:9): [True: 9, False: 11.8k]
  ------------------
 1962|      9|        return(NULL);
 1963|       |
 1964|  11.8k|    return(xmlNewInputInternal(buf, url));
 1965|  11.8k|}
xmlCtxtNewInputFromString:
 1978|  11.8k|                          xmlParserInputFlags flags) {
 1979|  11.8k|    xmlParserInputPtr input;
 1980|       |
 1981|  11.8k|    if ((ctxt == NULL) || (str == NULL))
  ------------------
  |  Branch (1981:9): [True: 0, False: 11.8k]
  |  Branch (1981:27): [True: 0, False: 11.8k]
  ------------------
 1982|      0|	return(NULL);
 1983|       |
 1984|  11.8k|    input = xmlNewInputFromString(url, str, flags);
 1985|  11.8k|    if (input == NULL) {
  ------------------
  |  Branch (1985:9): [True: 11, False: 11.8k]
  ------------------
 1986|     11|        xmlCtxtErrMemory(ctxt);
 1987|     11|        return(NULL);
 1988|     11|    }
 1989|       |
 1990|  11.8k|    if (encoding != NULL)
  ------------------
  |  Branch (1990:9): [True: 0, False: 11.8k]
  ------------------
 1991|      0|        xmlSwitchInputEncodingName(ctxt, input, encoding);
 1992|       |
 1993|  11.8k|    return(input);
 1994|  11.8k|}
xmlNewPushInput:
 2155|  36.4k|xmlNewPushInput(const char *url, const char *chunk, int size) {
 2156|  36.4k|    xmlParserInputBufferPtr buf;
 2157|  36.4k|    xmlParserInputPtr input;
 2158|       |
 2159|  36.4k|    buf = xmlAllocParserInputBuffer(XML_CHAR_ENCODING_NONE);
 2160|  36.4k|    if (buf == NULL)
  ------------------
  |  Branch (2160:9): [True: 10, False: 36.4k]
  ------------------
 2161|     10|        return(NULL);
 2162|       |
 2163|  36.4k|    input = xmlNewInputInternal(buf, url);
 2164|  36.4k|    if (input == NULL)
  ------------------
  |  Branch (2164:9): [True: 2, False: 36.4k]
  ------------------
 2165|      2|	return(NULL);
 2166|       |
 2167|  36.4k|    input->flags |= XML_INPUT_PROGRESSIVE;
  ------------------
  |  |   41|  36.4k|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  ------------------
 2168|       |
 2169|  36.4k|    if ((size > 0) && (chunk != NULL)) {
  ------------------
  |  Branch (2169:9): [True: 35.4k, False: 988]
  |  Branch (2169:23): [True: 35.4k, False: 0]
  ------------------
 2170|  35.4k|        int res;
 2171|       |
 2172|  35.4k|	res = xmlParserInputBufferPush(input->buf, size, chunk);
 2173|  35.4k|        xmlBufResetInput(input->buf->buffer, input);
 2174|  35.4k|        if (res < 0) {
  ------------------
  |  Branch (2174:13): [True: 0, False: 35.4k]
  ------------------
 2175|      0|            xmlFreeInputStream(input);
 2176|      0|            return(NULL);
 2177|      0|        }
 2178|  35.4k|    }
 2179|       |
 2180|  36.4k|    return(input);
 2181|  36.4k|}
xmlNewEntityInputStream:
 2224|   117k|xmlNewEntityInputStream(xmlParserCtxt *ctxt, xmlEntity *ent) {
 2225|   117k|    xmlParserInputPtr input;
 2226|       |
 2227|   117k|    if ((ctxt == NULL) || (ent == NULL))
  ------------------
  |  Branch (2227:9): [True: 0, False: 117k]
  |  Branch (2227:27): [True: 0, False: 117k]
  ------------------
 2228|      0|	return(NULL);
 2229|       |
 2230|   117k|    if (ent->content != NULL) {
  ------------------
  |  Branch (2230:9): [True: 11.8k, False: 105k]
  ------------------
 2231|  11.8k|        input = xmlCtxtNewInputFromString(ctxt, NULL,
 2232|  11.8k|                (const char *) ent->content, NULL, XML_INPUT_BUF_STATIC);
 2233|   105k|    } else if (ent->URI != NULL) {
  ------------------
  |  Branch (2233:16): [True: 105k, False: 327]
  ------------------
 2234|   105k|        xmlResourceType rtype;
 2235|       |
 2236|   105k|        if (ent->etype == XML_EXTERNAL_PARAMETER_ENTITY)
  ------------------
  |  Branch (2236:13): [True: 101k, False: 3.91k]
  ------------------
 2237|   101k|            rtype = XML_RESOURCE_PARAMETER_ENTITY;
 2238|  3.91k|        else
 2239|  3.91k|            rtype = XML_RESOURCE_GENERAL_ENTITY;
 2240|       |
 2241|   105k|        input = xmlLoadResource(ctxt, (char *) ent->URI,
 2242|   105k|                                (char *) ent->ExternalID, rtype);
 2243|   105k|    } else {
 2244|    327|        return(NULL);
 2245|    327|    }
 2246|       |
 2247|   116k|    if (input == NULL)
  ------------------
  |  Branch (2247:9): [True: 3.60k, False: 113k]
  ------------------
 2248|  3.60k|        return(NULL);
 2249|       |
 2250|   113k|    input->entity = ent;
 2251|       |
 2252|   113k|    return(input);
 2253|   116k|}
xmlCtxtSetResourceLoader:
 2645|  44.9k|                         void *vctxt) {
 2646|  44.9k|    if (ctxt == NULL)
  ------------------
  |  Branch (2646:9): [True: 0, False: 44.9k]
  ------------------
 2647|      0|        return;
 2648|       |
 2649|  44.9k|    ctxt->resourceLoader = loader;
 2650|  44.9k|    ctxt->resourceCtxt = vctxt;
 2651|  44.9k|}
xmlLoadResource:
 2662|   253k|                xmlResourceType type) {
 2663|   253k|    char *canonicFilename;
 2664|   253k|    xmlParserInputPtr ret;
 2665|       |
 2666|   253k|    if (url == NULL)
  ------------------
  |  Branch (2666:9): [True: 234, False: 253k]
  ------------------
 2667|    234|        return(NULL);
 2668|       |
 2669|   253k|    if ((ctxt != NULL) && (ctxt->resourceLoader != NULL)) {
  ------------------
  |  Branch (2669:9): [True: 253k, False: 0]
  |  Branch (2669:27): [True: 253k, False: 0]
  ------------------
 2670|   253k|        char *resource = NULL;
 2671|   253k|        void *userData;
 2672|   253k|        xmlParserInputFlags flags = 0;
 2673|   253k|        int code;
 2674|       |
 2675|   253k|#ifdef LIBXML_CATALOG_ENABLED
 2676|   253k|        resource = xmlCtxtResolveFromCatalog(ctxt, url, publicId);
 2677|   253k|        if (resource != NULL)
  ------------------
  |  Branch (2677:13): [True: 0, False: 253k]
  ------------------
 2678|      0|            url = resource;
 2679|   253k|#endif
 2680|       |
 2681|   253k|        if (ctxt->options & XML_PARSE_UNZIP)
  ------------------
  |  Branch (2681:13): [True: 127k, False: 126k]
  ------------------
 2682|   127k|            flags |= XML_INPUT_UNZIP;
 2683|   253k|        if ((ctxt->options & XML_PARSE_NONET) == 0)
  ------------------
  |  Branch (2683:13): [True: 160k, False: 93.5k]
  ------------------
 2684|   160k|            flags |= XML_INPUT_NETWORK;
 2685|       |
 2686|   253k|        userData = ctxt->resourceCtxt;
 2687|   253k|        if (userData == NULL)
  ------------------
  |  Branch (2687:13): [True: 253k, False: 0]
  ------------------
 2688|   253k|            userData = ctxt;
 2689|       |
 2690|   253k|        code = ctxt->resourceLoader(userData, url, publicId, type,
 2691|   253k|                                    flags, &ret);
 2692|   253k|        if (code != XML_ERR_OK) {
  ------------------
  |  Branch (2692:13): [True: 5.55k, False: 248k]
  ------------------
 2693|  5.55k|            xmlCtxtErrIO(ctxt, code, url);
 2694|  5.55k|            ret = NULL;
 2695|  5.55k|        }
 2696|   253k|        if (resource != NULL)
  ------------------
  |  Branch (2696:13): [True: 0, False: 253k]
  ------------------
 2697|      0|            xmlFree(resource);
 2698|   253k|        return(ret);
 2699|   253k|    }
 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|  45.0k|{
 2948|  45.0k|    xmlParserInputPtr input;
 2949|       |
 2950|  45.0k|    if (ctxt == NULL) return;
  ------------------
  |  Branch (2950:9): [True: 34, False: 44.9k]
  ------------------
 2951|       |
 2952|  89.8k|    while ((input = xmlCtxtPopInput(ctxt)) != NULL) { /* Non consuming */
  ------------------
  |  Branch (2952:12): [True: 44.8k, False: 44.9k]
  ------------------
 2953|  44.8k|        xmlFreeInputStream(input);
 2954|  44.8k|    }
 2955|  44.9k|    if (ctxt->spaceTab != NULL) xmlFree(ctxt->spaceTab);
  ------------------
  |  Branch (2955:9): [True: 44.9k, False: 33]
  ------------------
 2956|  44.9k|    if (ctxt->nameTab != NULL) xmlFree((xmlChar * *)ctxt->nameTab);
  ------------------
  |  Branch (2956:9): [True: 44.9k, False: 27]
  ------------------
 2957|  44.9k|    if (ctxt->nodeTab != NULL) xmlFree(ctxt->nodeTab);
  ------------------
  |  Branch (2957:9): [True: 44.9k, False: 22]
  ------------------
 2958|  44.9k|    if (ctxt->nodeInfoTab != NULL) xmlFree(ctxt->nodeInfoTab);
  ------------------
  |  Branch (2958:9): [True: 0, False: 44.9k]
  ------------------
 2959|  44.9k|    if (ctxt->inputTab != NULL) xmlFree(ctxt->inputTab);
  ------------------
  |  Branch (2959:9): [True: 44.9k, False: 18]
  ------------------
 2960|  44.9k|    if (ctxt->version != NULL) xmlFree(ctxt->version);
  ------------------
  |  Branch (2960:9): [True: 42.6k, False: 2.37k]
  ------------------
 2961|  44.9k|    if (ctxt->encoding != NULL) xmlFree(ctxt->encoding);
  ------------------
  |  Branch (2961:9): [True: 1.06k, False: 43.9k]
  ------------------
 2962|  44.9k|    if (ctxt->extSubURI != NULL) xmlFree(ctxt->extSubURI);
  ------------------
  |  Branch (2962:9): [True: 2.79k, False: 42.1k]
  ------------------
 2963|  44.9k|    if (ctxt->extSubSystem != NULL) xmlFree(ctxt->extSubSystem);
  ------------------
  |  Branch (2963:9): [True: 790, False: 44.2k]
  ------------------
 2964|  44.9k|#ifdef LIBXML_SAX1_ENABLED
 2965|  44.9k|    if ((ctxt->sax != NULL) &&
  ------------------
  |  Branch (2965:9): [True: 44.9k, False: 12]
  ------------------
 2966|  44.9k|        (ctxt->sax != (xmlSAXHandlerPtr) &xmlDefaultSAXHandler))
  ------------------
  |  Branch (2966:9): [True: 44.9k, False: 0]
  ------------------
 2967|       |#else
 2968|       |    if (ctxt->sax != NULL)
 2969|       |#endif /* LIBXML_SAX1_ENABLED */
 2970|  44.9k|        xmlFree(ctxt->sax);
 2971|  44.9k|    if (ctxt->directory != NULL) xmlFree(ctxt->directory);
  ------------------
  |  Branch (2971:9): [True: 9.51k, False: 35.4k]
  ------------------
 2972|  44.9k|    if (ctxt->vctxt.nodeTab != NULL) xmlFree(ctxt->vctxt.nodeTab);
  ------------------
  |  Branch (2972:9): [True: 0, False: 44.9k]
  ------------------
 2973|  44.9k|    if (ctxt->atts != NULL) xmlFree((xmlChar * *)ctxt->atts);
  ------------------
  |  Branch (2973:9): [True: 23.6k, False: 21.3k]
  ------------------
 2974|  44.9k|    if (ctxt->dict != NULL) xmlDictFree(ctxt->dict);
  ------------------
  |  Branch (2974:9): [True: 44.9k, False: 6]
  ------------------
 2975|  44.9k|    if (ctxt->nsTab != NULL) xmlFree(ctxt->nsTab);
  ------------------
  |  Branch (2975:9): [True: 8.58k, False: 36.4k]
  ------------------
 2976|  44.9k|    if (ctxt->nsdb != NULL) xmlParserNsFree(ctxt->nsdb);
  ------------------
  |  Branch (2976:9): [True: 44.9k, False: 34]
  ------------------
 2977|  44.9k|    if (ctxt->attrHash != NULL) xmlFree(ctxt->attrHash);
  ------------------
  |  Branch (2977:9): [True: 6.07k, False: 38.9k]
  ------------------
 2978|  44.9k|    if (ctxt->pushTab != NULL) xmlFree(ctxt->pushTab);
  ------------------
  |  Branch (2978:9): [True: 27.5k, False: 17.4k]
  ------------------
 2979|  44.9k|    if (ctxt->attallocs != NULL) xmlFree(ctxt->attallocs);
  ------------------
  |  Branch (2979:9): [True: 12.2k, False: 32.7k]
  ------------------
 2980|  44.9k|    if (ctxt->attsDefault != NULL)
  ------------------
  |  Branch (2980:9): [True: 2.42k, False: 42.5k]
  ------------------
 2981|  2.42k|        xmlHashFree(ctxt->attsDefault, xmlHashDefaultDeallocator);
 2982|  44.9k|    if (ctxt->attsSpecial != NULL)
  ------------------
  |  Branch (2982:9): [True: 2.85k, False: 42.1k]
  ------------------
 2983|  2.85k|        xmlHashFree(ctxt->attsSpecial, NULL);
 2984|  44.9k|    if (ctxt->freeElems != NULL) {
  ------------------
  |  Branch (2984:9): [True: 24.0k, False: 20.9k]
  ------------------
 2985|  24.0k|        xmlNodePtr cur, next;
 2986|       |
 2987|  24.0k|	cur = ctxt->freeElems;
 2988|  48.1k|	while (cur != NULL) {
  ------------------
  |  Branch (2988:9): [True: 24.0k, False: 24.0k]
  ------------------
 2989|  24.0k|	    next = cur->next;
 2990|  24.0k|	    xmlFree(cur);
 2991|  24.0k|	    cur = next;
 2992|  24.0k|	}
 2993|  24.0k|    }
 2994|  44.9k|    if (ctxt->freeAttrs != NULL) {
  ------------------
  |  Branch (2994:9): [True: 14.0k, False: 30.9k]
  ------------------
 2995|  14.0k|        xmlAttrPtr cur, next;
 2996|       |
 2997|  14.0k|	cur = ctxt->freeAttrs;
 2998|  28.0k|	while (cur != NULL) {
  ------------------
  |  Branch (2998:9): [True: 14.0k, False: 14.0k]
  ------------------
 2999|  14.0k|	    next = cur->next;
 3000|  14.0k|	    xmlFree(cur);
 3001|  14.0k|	    cur = next;
 3002|  14.0k|	}
 3003|  14.0k|    }
 3004|       |    /*
 3005|       |     * cleanup the error strings
 3006|       |     */
 3007|  44.9k|    if (ctxt->lastError.message != NULL)
  ------------------
  |  Branch (3007:9): [True: 31.3k, False: 13.6k]
  ------------------
 3008|  31.3k|        xmlFree(ctxt->lastError.message);
 3009|  44.9k|    if (ctxt->lastError.file != NULL)
  ------------------
  |  Branch (3009:9): [True: 8.01k, False: 36.9k]
  ------------------
 3010|  8.01k|        xmlFree(ctxt->lastError.file);
 3011|  44.9k|    if (ctxt->lastError.str1 != NULL)
  ------------------
  |  Branch (3011:9): [True: 17.8k, False: 27.1k]
  ------------------
 3012|  17.8k|        xmlFree(ctxt->lastError.str1);
 3013|  44.9k|    if (ctxt->lastError.str2 != NULL)
  ------------------
  |  Branch (3013:9): [True: 5.64k, False: 39.3k]
  ------------------
 3014|  5.64k|        xmlFree(ctxt->lastError.str2);
 3015|  44.9k|    if (ctxt->lastError.str3 != NULL)
  ------------------
  |  Branch (3015:9): [True: 449, False: 44.5k]
  ------------------
 3016|    449|        xmlFree(ctxt->lastError.str3);
 3017|       |
 3018|  44.9k|#ifdef LIBXML_CATALOG_ENABLED
 3019|  44.9k|    if (ctxt->catalogs != NULL)
  ------------------
  |  Branch (3019:9): [True: 0, False: 44.9k]
  ------------------
 3020|      0|	xmlCatalogFreeLocal(ctxt->catalogs);
 3021|  44.9k|#endif
 3022|  44.9k|    xmlFree(ctxt);
 3023|  44.9k|}
xmlNewParserCtxt:
 3033|  8.55k|{
 3034|  8.55k|    return(xmlNewSAXParserCtxt(NULL, NULL));
 3035|  8.55k|}
xmlNewSAXParserCtxt:
 3054|  44.9k|{
 3055|  44.9k|    xmlParserCtxtPtr ctxt;
 3056|       |
 3057|  44.9k|    xmlInitParser();
 3058|       |
 3059|  44.9k|    ctxt = (xmlParserCtxtPtr) xmlMalloc(sizeof(xmlParserCtxt));
 3060|  44.9k|    if (ctxt == NULL)
  ------------------
  |  Branch (3060:9): [True: 4, False: 44.9k]
  ------------------
 3061|      4|	return(NULL);
 3062|  44.9k|    memset(ctxt, 0, sizeof(xmlParserCtxt));
 3063|  44.9k|    if (xmlInitSAXParserCtxt(ctxt, sax, userData) < 0) {
  ------------------
  |  Branch (3063:9): [True: 34, False: 44.9k]
  ------------------
 3064|     34|        xmlFreeParserCtxt(ctxt);
 3065|     34|	return(NULL);
 3066|     34|    }
 3067|  44.9k|    return(ctxt);
 3068|  44.9k|}
xmlInitNodeInfoSeq:
 3547|  44.9k|{
 3548|  44.9k|    if (seq == NULL)
  ------------------
  |  Branch (3548:9): [True: 0, False: 44.9k]
  ------------------
 3549|      0|        return;
 3550|  44.9k|    seq->length = 0;
 3551|  44.9k|    seq->maximum = 0;
 3552|       |    seq->buffer = NULL;
 3553|  44.9k|}
parserInternals.c:xmlDetectEBCDIC:
 1168|  3.20k|xmlDetectEBCDIC(xmlParserCtxtPtr ctxt, xmlCharEncodingHandlerPtr *hout) {
 1169|  3.20k|    xmlChar out[200];
 1170|  3.20k|    xmlParserInputPtr input = ctxt->input;
 1171|  3.20k|    xmlCharEncodingHandlerPtr handler;
 1172|  3.20k|    int inlen, outlen, i;
 1173|  3.20k|    xmlParserErrors code;
 1174|  3.20k|    xmlCharEncError res;
 1175|       |
 1176|  3.20k|    *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.20k|    code = xmlCreateCharEncodingHandler("IBM037", XML_ENC_INPUT,
 1183|  3.20k|            ctxt->convImpl, ctxt->convCtxt, &handler);
 1184|  3.20k|    if (code != XML_ERR_OK)
  ------------------
  |  Branch (1184:9): [True: 4, False: 3.19k]
  ------------------
 1185|      4|        return(code);
 1186|  3.19k|    outlen = sizeof(out) - 1;
 1187|  3.19k|    inlen = input->end - input->cur;
 1188|  3.19k|    res = xmlEncInputChunk(handler, out, &outlen, input->cur, &inlen,
 1189|  3.19k|                           /* flush */ 0);
 1190|       |    /*
 1191|       |     * Return the EBCDIC handler if decoding failed. The error will
 1192|       |     * be reported later.
 1193|       |     */
 1194|  3.19k|    if (res < 0)
  ------------------
  |  Branch (1194:9): [True: 764, False: 2.43k]
  ------------------
 1195|    764|        goto done;
 1196|  2.43k|    out[outlen] = 0;
 1197|       |
 1198|  51.4k|    for (i = 0; i < outlen; i++) {
  ------------------
  |  Branch (1198:17): [True: 50.4k, False: 1.01k]
  ------------------
 1199|  50.4k|        if (out[i] == '>')
  ------------------
  |  Branch (1199:13): [True: 250, False: 50.1k]
  ------------------
 1200|    250|            break;
 1201|  50.1k|        if ((out[i] == 'e') &&
  ------------------
  |  Branch (1201:13): [True: 2.71k, False: 47.4k]
  ------------------
 1202|  2.71k|            (xmlStrncmp(out + i, BAD_CAST "encoding", 8) == 0)) {
  ------------------
  |  |   34|  2.71k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (1202:13): [True: 1.16k, False: 1.54k]
  ------------------
 1203|  1.16k|            int start, cur, quote;
 1204|       |
 1205|  1.16k|            i += 8;
 1206|  1.16k|            while (IS_BLANK_CH(out[i]))
 1207|    933|                i += 1;
 1208|  1.16k|            if (out[i++] != '=')
  ------------------
  |  Branch (1208:17): [True: 246, False: 923]
  ------------------
 1209|    246|                break;
 1210|    923|            while (IS_BLANK_CH(out[i]))
 1211|    886|                i += 1;
 1212|    923|            quote = out[i++];
 1213|    923|            if ((quote != '\'') && (quote != '"'))
  ------------------
  |  Branch (1213:17): [True: 692, False: 231]
  |  Branch (1213:36): [True: 243, False: 449]
  ------------------
 1214|    243|                break;
 1215|    680|            start = i;
 1216|    680|            cur = out[i];
 1217|  4.49k|            while (((cur >= 'a') && (cur <= 'z')) ||
  ------------------
  |  Branch (1217:21): [True: 1.09k, False: 3.40k]
  |  Branch (1217:37): [True: 850, False: 240]
  ------------------
 1218|  3.64k|                   ((cur >= 'A') && (cur <= 'Z')) ||
  ------------------
  |  Branch (1218:21): [True: 2.01k, False: 1.62k]
  |  Branch (1218:37): [True: 1.00k, False: 1.01k]
  ------------------
 1219|  2.63k|                   ((cur >= '0') && (cur <= '9')) ||
  ------------------
  |  Branch (1219:21): [True: 1.46k, False: 1.17k]
  |  Branch (1219:37): [True: 444, False: 1.01k]
  ------------------
 1220|  2.19k|                   (cur == '.') || (cur == '_') ||
  ------------------
  |  Branch (1220:20): [True: 218, False: 1.97k]
  |  Branch (1220:36): [True: 774, False: 1.20k]
  ------------------
 1221|  1.20k|                   (cur == '-'))
  ------------------
  |  Branch (1221:20): [True: 523, False: 680]
  ------------------
 1222|  3.81k|                cur = out[++i];
 1223|    680|            if (cur != quote)
  ------------------
  |  Branch (1223:17): [True: 485, False: 195]
  ------------------
 1224|    485|                break;
 1225|    195|            out[i] = 0;
 1226|    195|            xmlCharEncCloseFunc(handler);
 1227|    195|            code = xmlCreateCharEncodingHandler((char *) out + start,
 1228|    195|                    XML_ENC_INPUT, ctxt->convImpl, ctxt->convCtxt,
 1229|    195|                    &handler);
 1230|    195|            if (code != XML_ERR_OK)
  ------------------
  |  Branch (1230:17): [True: 111, False: 84]
  ------------------
 1231|    111|                return(code);
 1232|     84|            *hout = handler;
 1233|     84|            return(XML_ERR_OK);
 1234|    195|        }
 1235|  50.1k|    }
 1236|       |
 1237|  3.00k|done:
 1238|       |    /*
 1239|       |     * Encoding handlers are stateful, so we have to recreate them.
 1240|       |     */
 1241|  3.00k|    xmlCharEncCloseFunc(handler);
 1242|  3.00k|    code = xmlCreateCharEncodingHandler("IBM037", XML_ENC_INPUT,
 1243|  3.00k|            ctxt->convImpl, ctxt->convCtxt, &handler);
 1244|  3.00k|    if (code != XML_ERR_OK)
  ------------------
  |  Branch (1244:9): [True: 9, False: 2.99k]
  ------------------
 1245|      9|        return(code);
 1246|  2.99k|    *hout = handler;
 1247|  2.99k|    return(XML_ERR_OK);
 1248|  3.00k|}
parserInternals.c:xmlNewInputInternal:
 1842|   296k|xmlNewInputInternal(xmlParserInputBufferPtr buf, const char *filename) {
 1843|   296k|    xmlParserInputPtr input;
 1844|       |
 1845|   296k|    input = (xmlParserInputPtr) xmlMalloc(sizeof(xmlParserInput));
 1846|   296k|    if (input == NULL) {
  ------------------
  |  Branch (1846:9): [True: 16, False: 296k]
  ------------------
 1847|     16|	xmlFreeParserInputBuffer(buf);
 1848|     16|	return(NULL);
 1849|     16|    }
 1850|   296k|    memset(input, 0, sizeof(xmlParserInput));
 1851|   296k|    input->line = 1;
 1852|   296k|    input->col = 1;
 1853|       |
 1854|   296k|    input->buf = buf;
 1855|   296k|    xmlBufResetInput(input->buf->buffer, input);
 1856|       |
 1857|   296k|    if (filename != NULL) {
  ------------------
  |  Branch (1857:9): [True: 248k, False: 48.2k]
  ------------------
 1858|   248k|        input->filename = xmlMemStrdup(filename);
 1859|   248k|        if (input->filename == NULL) {
  ------------------
  |  Branch (1859:13): [True: 10, False: 248k]
  ------------------
 1860|     10|            xmlFreeInputStream(input);
 1861|     10|            return(NULL);
 1862|     10|        }
 1863|   248k|    }
 1864|       |
 1865|   296k|    return(input);
 1866|   296k|}
parserInternals.c:xmlCtxtResolveFromCatalog:
 2363|   253k|                          const char *publicId) {
 2364|   253k|    char *resource;
 2365|   253k|    void *localCatalogs = NULL;
 2366|   253k|    int allowGlobal = 1;
 2367|   253k|    xmlParserErrors code;
 2368|       |
 2369|   253k|    if (ctxt != NULL) {
  ------------------
  |  Branch (2369:9): [True: 253k, False: 0]
  ------------------
 2370|       |        /*
 2371|       |         * Loading of HTML documents shouldn't use XML catalogs.
 2372|       |         */
 2373|   253k|        if (ctxt->html)
  ------------------
  |  Branch (2373:13): [True: 0, False: 253k]
  ------------------
 2374|      0|            return(NULL);
 2375|       |
 2376|   253k|        localCatalogs = ctxt->catalogs;
 2377|       |
 2378|   253k|        if (ctxt->options & XML_PARSE_NO_SYS_CATALOG)
  ------------------
  |  Branch (2378:13): [True: 46.3k, False: 207k]
  ------------------
 2379|  46.3k|            allowGlobal = 0;
 2380|   253k|    }
 2381|       |
 2382|   253k|    switch (xmlCatalogGetDefaults()) {
  ------------------
  |  Branch (2382:13): [True: 253k, False: 0]
  ------------------
 2383|   253k|        case XML_CATA_ALLOW_NONE:
  ------------------
  |  Branch (2383:9): [True: 253k, False: 0]
  ------------------
 2384|   253k|            return(NULL);
 2385|      0|        case XML_CATA_ALLOW_DOCUMENT:
  ------------------
  |  Branch (2385:9): [True: 0, False: 253k]
  ------------------
 2386|      0|            allowGlobal = 0;
 2387|      0|            break;
 2388|      0|        case XML_CATA_ALLOW_GLOBAL:
  ------------------
  |  Branch (2388:9): [True: 0, False: 253k]
  ------------------
 2389|      0|            localCatalogs = NULL;
 2390|      0|            break;
 2391|      0|        case XML_CATA_ALLOW_ALL:
  ------------------
  |  Branch (2391:9): [True: 0, False: 253k]
  ------------------
 2392|      0|            break;
 2393|   253k|    }
 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|   253k|}
parserInternals.c:xmlInitSAXParserCtxt:
 2766|  44.9k|{
 2767|  44.9k|    xmlParserInputPtr input;
 2768|  44.9k|#ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
 2769|  44.9k|    size_t initialNodeTabSize = 1;
 2770|       |#else
 2771|       |    size_t initialNodeTabSize = 10;
 2772|       |#endif
 2773|       |
 2774|  44.9k|    if (ctxt == NULL)
  ------------------
  |  Branch (2774:9): [True: 0, False: 44.9k]
  ------------------
 2775|      0|        return(-1);
 2776|       |
 2777|  44.9k|    if (ctxt->dict == NULL)
  ------------------
  |  Branch (2777:9): [True: 44.9k, False: 0]
  ------------------
 2778|  44.9k|	ctxt->dict = xmlDictCreate();
 2779|  44.9k|    if (ctxt->dict == NULL)
  ------------------
  |  Branch (2779:9): [True: 6, False: 44.9k]
  ------------------
 2780|      6|	return(-1);
 2781|       |
 2782|  44.9k|    if (ctxt->sax == NULL)
  ------------------
  |  Branch (2782:9): [True: 44.9k, False: 0]
  ------------------
 2783|  44.9k|	ctxt->sax = (xmlSAXHandler *) xmlMalloc(sizeof(xmlSAXHandler));
 2784|  44.9k|    if (ctxt->sax == NULL)
  ------------------
  |  Branch (2784:9): [True: 6, False: 44.9k]
  ------------------
 2785|      6|	return(-1);
 2786|  44.9k|    if (sax == NULL) {
  ------------------
  |  Branch (2786:9): [True: 8.55k, False: 36.4k]
  ------------------
 2787|  8.55k|	memset(ctxt->sax, 0, sizeof(xmlSAXHandler));
 2788|  8.55k|        xmlSAXVersion(ctxt->sax, 2);
 2789|  8.55k|        ctxt->userData = ctxt;
 2790|  36.4k|    } else {
 2791|  36.4k|	if (sax->initialized == XML_SAX2_MAGIC) {
  ------------------
  |  |  953|  36.4k|#define XML_SAX2_MAGIC 0xDEEDBEAF
  ------------------
  |  Branch (2791:6): [True: 36.4k, False: 0]
  ------------------
 2792|  36.4k|	    memcpy(ctxt->sax, sax, sizeof(xmlSAXHandler));
 2793|  36.4k|        } else {
 2794|      0|	    memset(ctxt->sax, 0, sizeof(xmlSAXHandler));
 2795|      0|	    memcpy(ctxt->sax, sax, sizeof(xmlSAXHandlerV1));
 2796|      0|        }
 2797|  36.4k|        ctxt->userData = userData ? userData : ctxt;
  ------------------
  |  Branch (2797:26): [True: 0, False: 36.4k]
  ------------------
 2798|  36.4k|    }
 2799|       |
 2800|  44.9k|    ctxt->maxatts = 0;
 2801|  44.9k|    ctxt->atts = NULL;
 2802|       |    /* Allocate the Input stack */
 2803|  44.9k|    if (ctxt->inputTab == NULL) {
  ------------------
  |  Branch (2803:9): [True: 44.9k, False: 0]
  ------------------
 2804|  44.9k|#ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
 2805|  44.9k|        size_t initialSize = 1;
 2806|       |#else
 2807|       |        size_t initialSize = 5;
 2808|       |#endif
 2809|       |
 2810|  44.9k|	ctxt->inputTab = xmlMalloc(initialSize * sizeof(xmlParserInputPtr));
 2811|  44.9k|	ctxt->inputMax = initialSize;
 2812|  44.9k|    }
 2813|  44.9k|    if (ctxt->inputTab == NULL)
  ------------------
  |  Branch (2813:9): [True: 6, False: 44.9k]
  ------------------
 2814|      6|	return(-1);
 2815|  44.9k|    while ((input = xmlCtxtPopInput(ctxt)) != NULL) { /* Non consuming */
  ------------------
  |  Branch (2815:12): [True: 0, False: 44.9k]
  ------------------
 2816|      0|        xmlFreeInputStream(input);
 2817|      0|    }
 2818|  44.9k|    ctxt->inputNr = 0;
 2819|  44.9k|    ctxt->input = NULL;
 2820|       |
 2821|  44.9k|    ctxt->version = NULL;
 2822|  44.9k|    ctxt->encoding = NULL;
 2823|  44.9k|    ctxt->standalone = -1;
 2824|  44.9k|    ctxt->hasExternalSubset = 0;
 2825|  44.9k|    ctxt->hasPErefs = 0;
 2826|  44.9k|    ctxt->html = 0;
 2827|  44.9k|    ctxt->instate = XML_PARSER_START;
 2828|       |
 2829|       |    /* Allocate the Node stack */
 2830|  44.9k|    if (ctxt->nodeTab == NULL) {
  ------------------
  |  Branch (2830:9): [True: 44.9k, False: 0]
  ------------------
 2831|  44.9k|	ctxt->nodeTab = xmlMalloc(initialNodeTabSize * sizeof(xmlNodePtr));
 2832|  44.9k|	ctxt->nodeMax = initialNodeTabSize;
 2833|  44.9k|    }
 2834|  44.9k|    if (ctxt->nodeTab == NULL)
  ------------------
  |  Branch (2834:9): [True: 4, False: 44.9k]
  ------------------
 2835|      4|	return(-1);
 2836|  44.9k|    ctxt->nodeNr = 0;
 2837|  44.9k|    ctxt->node = NULL;
 2838|       |
 2839|       |    /* Allocate the Name stack */
 2840|  44.9k|    if (ctxt->nameTab == NULL) {
  ------------------
  |  Branch (2840:9): [True: 44.9k, False: 0]
  ------------------
 2841|  44.9k|	ctxt->nameTab = xmlMalloc(initialNodeTabSize * sizeof(xmlChar *));
 2842|  44.9k|	ctxt->nameMax = initialNodeTabSize;
 2843|  44.9k|    }
 2844|  44.9k|    if (ctxt->nameTab == NULL)
  ------------------
  |  Branch (2844:9): [True: 5, False: 44.9k]
  ------------------
 2845|      5|	return(-1);
 2846|  44.9k|    ctxt->nameNr = 0;
 2847|  44.9k|    ctxt->name = NULL;
 2848|       |
 2849|       |    /* Allocate the space stack */
 2850|  44.9k|    if (ctxt->spaceTab == NULL) {
  ------------------
  |  Branch (2850:9): [True: 44.9k, False: 0]
  ------------------
 2851|  44.9k|	ctxt->spaceTab = xmlMalloc(initialNodeTabSize * sizeof(int));
 2852|  44.9k|	ctxt->spaceMax = initialNodeTabSize;
 2853|  44.9k|    }
 2854|  44.9k|    if (ctxt->spaceTab == NULL)
  ------------------
  |  Branch (2854:9): [True: 6, False: 44.9k]
  ------------------
 2855|      6|	return(-1);
 2856|  44.9k|    ctxt->spaceNr = 1;
 2857|  44.9k|    ctxt->spaceTab[0] = -1;
 2858|  44.9k|    ctxt->space = &ctxt->spaceTab[0];
 2859|  44.9k|    ctxt->myDoc = NULL;
 2860|  44.9k|    ctxt->wellFormed = 1;
 2861|  44.9k|    ctxt->nsWellFormed = 1;
 2862|  44.9k|    ctxt->valid = 1;
 2863|       |
 2864|  44.9k|    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|  44.9k|    ctxt->loadsubset = xmlLoadExtDtdDefaultValue;
  ------------------
  |  | 1331|  44.9k|  #define xmlLoadExtDtdDefaultValue (*__xmlLoadExtDtdDefaultValue())
  ------------------
 2873|  44.9k|    if (ctxt->loadsubset) {
  ------------------
  |  Branch (2873:9): [True: 0, False: 44.9k]
  ------------------
 2874|      0|        ctxt->options |= XML_PARSE_DTDLOAD;
 2875|      0|    }
 2876|  44.9k|    ctxt->validate = xmlDoValidityCheckingDefaultValue;
  ------------------
  |  | 1302|  44.9k|    (*__xmlDoValidityCheckingDefaultValue())
  ------------------
 2877|  44.9k|    if (ctxt->validate) {
  ------------------
  |  Branch (2877:9): [True: 0, False: 44.9k]
  ------------------
 2878|      0|        ctxt->options |= XML_PARSE_DTDVALID;
 2879|      0|    }
 2880|  44.9k|    ctxt->pedantic = xmlPedanticParserDefaultValue;
  ------------------
  |  | 1339|  44.9k|    (*__xmlPedanticParserDefaultValue())
  ------------------
 2881|  44.9k|    if (ctxt->pedantic) {
  ------------------
  |  Branch (2881:9): [True: 0, False: 44.9k]
  ------------------
 2882|      0|        ctxt->options |= XML_PARSE_PEDANTIC;
 2883|      0|    }
 2884|  44.9k|    ctxt->keepBlanks = xmlKeepBlanksDefaultValue;
  ------------------
  |  | 1316|  44.9k|  #define xmlKeepBlanksDefaultValue (*__xmlKeepBlanksDefaultValue())
  ------------------
 2885|  44.9k|    if (ctxt->keepBlanks == 0) {
  ------------------
  |  Branch (2885:9): [True: 0, False: 44.9k]
  ------------------
 2886|      0|	ctxt->sax->ignorableWhitespace = xmlSAX2IgnorableWhitespace;
 2887|      0|	ctxt->options |= XML_PARSE_NOBLANKS;
 2888|      0|    }
 2889|  44.9k|    ctxt->replaceEntities = xmlSubstituteEntitiesDefaultValue;
  ------------------
  |  | 1347|  44.9k|    (*__xmlSubstituteEntitiesDefaultValue())
  ------------------
 2890|  44.9k|    if (ctxt->replaceEntities) {
  ------------------
  |  Branch (2890:9): [True: 0, False: 44.9k]
  ------------------
 2891|      0|        ctxt->options |= XML_PARSE_NOENT;
 2892|      0|    }
 2893|  44.9k|    if (xmlGetWarningsDefaultValue == 0)
  ------------------
  |  | 1309|  44.9k|    (*__xmlGetWarningsDefaultValue())
  ------------------
  |  Branch (2893:9): [True: 0, False: 44.9k]
  ------------------
 2894|      0|        ctxt->options |= XML_PARSE_NOWARNING;
 2895|       |
 2896|  44.9k|    ctxt->vctxt.flags = XML_VCTXT_USE_PCTXT;
  ------------------
  |  |   20|  44.9k|#define XML_VCTXT_USE_PCTXT (1u << 1)
  ------------------
 2897|  44.9k|    ctxt->vctxt.userData = ctxt;
 2898|  44.9k|    ctxt->vctxt.error = xmlParserValidityError;
 2899|  44.9k|    ctxt->vctxt.warning = xmlParserValidityWarning;
 2900|       |
 2901|  44.9k|    ctxt->record_info = 0;
 2902|  44.9k|    ctxt->checkIndex = 0;
 2903|  44.9k|    ctxt->inSubset = 0;
 2904|  44.9k|    ctxt->errNo = XML_ERR_OK;
 2905|  44.9k|    ctxt->depth = 0;
 2906|  44.9k|    ctxt->catalogs = NULL;
 2907|  44.9k|    ctxt->sizeentities = 0;
 2908|  44.9k|    ctxt->sizeentcopy = 0;
 2909|  44.9k|    ctxt->input_id = 1;
 2910|  44.9k|    ctxt->maxAmpl = XML_MAX_AMPLIFICATION_DEFAULT;
  ------------------
  |  |   60|  44.9k|#define XML_MAX_AMPLIFICATION_DEFAULT 5
  ------------------
 2911|  44.9k|    xmlInitNodeInfoSeq(&ctxt->node_seq);
 2912|       |
 2913|  44.9k|    if (ctxt->nsdb == NULL) {
  ------------------
  |  Branch (2913:9): [True: 44.9k, False: 0]
  ------------------
 2914|  44.9k|        ctxt->nsdb = xmlParserNsCreate();
 2915|  44.9k|        if (ctxt->nsdb == NULL)
  ------------------
  |  Branch (2915:13): [True: 1, False: 44.9k]
  ------------------
 2916|      1|            return(-1);
 2917|  44.9k|    }
 2918|       |
 2919|  44.9k|    return(0);
 2920|  44.9k|}

xmlInitRelaxNGInternal:
 2719|      2|{
 2720|      2|    xmlInitMutex(&xmlRelaxNGMutex);
 2721|      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|   137k|{
  125|   137k|    if (tok == NULL)
  ------------------
  |  Branch (125:9): [True: 0, False: 137k]
  ------------------
  126|      0|        return;
  127|   137k|#ifdef HAVE_POSIX_THREADS
  128|       |    /*
  129|       |     * This assumes that __libc_single_threaded won't change while the
  130|       |     * lock is held.
  131|       |     */
  132|   137k|    pthread_mutex_lock(&tok->lock);
  133|       |#elif defined HAVE_WIN32_THREADS
  134|       |    EnterCriticalSection(&tok->cs);
  135|       |#endif
  136|       |
  137|   137k|}
xmlMutexUnlock:
  146|   137k|{
  147|   137k|    if (tok == NULL)
  ------------------
  |  Branch (147:9): [True: 0, False: 137k]
  ------------------
  148|      0|        return;
  149|   137k|#ifdef HAVE_POSIX_THREADS
  150|   137k|    pthread_mutex_unlock(&tok->lock);
  151|       |#elif defined HAVE_WIN32_THREADS
  152|       |    LeaveCriticalSection(&tok->cs);
  153|       |#endif
  154|   137k|}
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.38M|xmlInitParser(void) {
  405|  2.38M|#ifdef HAVE_POSIX_THREADS
  406|  2.38M|    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.38M|}
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|  31.0k|void BINARY_INSERTION_SORT(SORT_TYPE *dst, const size_t size) {
  250|       |  /* don't bother sorting an array of size <= 1 */
  251|  31.0k|  if (size <= 1) {
  ------------------
  |  Branch (251:7): [True: 0, False: 31.0k]
  ------------------
  252|      0|    return;
  253|      0|  }
  254|       |
  255|  31.0k|  BINARY_INSERTION_SORT_START(dst, 1, size);
  ------------------
  |  |  149|  31.0k|#define BINARY_INSERTION_SORT_START    SORT_MAKE_STR(binary_insertion_sort_start)
  |  |  ------------------
  |  |  |  |  146|  31.0k|#define SORT_MAKE_STR(x) SORT_MAKE_STR1(SORT_NAME,x)
  |  |  |  |  ------------------
  |  |  |  |  |  |  145|  31.0k|#define SORT_MAKE_STR1(x, y) SORT_CONCAT(x,y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  144|  31.0k|#define SORT_CONCAT(x, y) x ## _ ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  256|  31.0k|}
libxml_domnode_tim_sort:
  533|  42.8k|void TIM_SORT(SORT_TYPE *dst, const size_t size) {
  534|  42.8k|  size_t minrun;
  535|  42.8k|  TEMP_STORAGE_T _store, *store;
  536|  42.8k|  TIM_SORT_RUN_T run_stack[TIM_SORT_STACK_SIZE];
  537|  42.8k|  size_t stack_curr = 0;
  538|  42.8k|  size_t curr = 0;
  539|       |
  540|       |  /* don't bother sorting an array of size 1 */
  541|  42.8k|  if (size <= 1) {
  ------------------
  |  Branch (541:7): [True: 0, False: 42.8k]
  ------------------
  542|      0|    return;
  543|      0|  }
  544|       |
  545|  42.8k|  if (size < 64) {
  ------------------
  |  Branch (545:7): [True: 31.0k, False: 11.8k]
  ------------------
  546|  31.0k|    BINARY_INSERTION_SORT(dst, size);
  ------------------
  |  |  150|  31.0k|#define BINARY_INSERTION_SORT          SORT_MAKE_STR(binary_insertion_sort)
  |  |  ------------------
  |  |  |  |  146|  31.0k|#define SORT_MAKE_STR(x) SORT_MAKE_STR1(SORT_NAME,x)
  |  |  |  |  ------------------
  |  |  |  |  |  |  145|  31.0k|#define SORT_MAKE_STR1(x, y) SORT_CONCAT(x,y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  144|  31.0k|#define SORT_CONCAT(x, y) x ## _ ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  547|  31.0k|    return;
  548|  31.0k|  }
  549|       |
  550|       |  /* compute the minimum run length */
  551|  11.8k|  minrun = compute_minrun(size);
  552|       |  /* temporary storage for merges */
  553|  11.8k|  store = &_store;
  554|  11.8k|  store->alloc = 0;
  555|  11.8k|  store->storage = NULL;
  556|       |
  557|  11.8k|  if (!PUSH_NEXT(dst, size, store, minrun, run_stack, &stack_curr, &curr)) {
  ------------------
  |  Branch (557:7): [True: 0, False: 11.8k]
  ------------------
  558|      0|    return;
  559|      0|  }
  560|       |
  561|  11.8k|  if (!PUSH_NEXT(dst, size, store, minrun, run_stack, &stack_curr, &curr)) {
  ------------------
  |  Branch (561:7): [True: 9.86k, False: 1.95k]
  ------------------
  562|  9.86k|    return;
  563|  9.86k|  }
  564|       |
  565|  1.95k|  if (!PUSH_NEXT(dst, size, store, minrun, run_stack, &stack_curr, &curr)) {
  ------------------
  |  Branch (565:7): [True: 1.62k, False: 334]
  ------------------
  566|  1.62k|    return;
  567|  1.62k|  }
  568|       |
  569|  4.89k|  while (1) {
  ------------------
  |  Branch (569:10): [True: 4.89k, Folded]
  ------------------
  570|  4.89k|    if (!CHECK_INVARIANT(run_stack, stack_curr)) {
  ------------------
  |  |  153|  4.89k|#define CHECK_INVARIANT                SORT_MAKE_STR(check_invariant)
  |  |  ------------------
  |  |  |  |  146|  4.89k|#define SORT_MAKE_STR(x) SORT_MAKE_STR1(SORT_NAME,x)
  |  |  |  |  ------------------
  |  |  |  |  |  |  145|  4.89k|#define SORT_MAKE_STR1(x, y) SORT_CONCAT(x,y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  144|  4.89k|#define SORT_CONCAT(x, y) x ## _ ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (570:9): [True: 1.86k, False: 3.03k]
  ------------------
  571|  1.86k|      stack_curr = TIM_SORT_COLLAPSE(dst, run_stack, stack_curr, store, size);
  ------------------
  |  |  157|  1.86k|#define TIM_SORT_COLLAPSE              SORT_MAKE_STR(tim_sort_collapse)
  |  |  ------------------
  |  |  |  |  146|  1.86k|#define SORT_MAKE_STR(x) SORT_MAKE_STR1(SORT_NAME,x)
  |  |  |  |  ------------------
  |  |  |  |  |  |  145|  1.86k|#define SORT_MAKE_STR1(x, y) SORT_CONCAT(x,y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  144|  1.86k|#define SORT_CONCAT(x, y) x ## _ ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  572|  1.86k|      continue;
  573|  1.86k|    }
  574|       |
  575|  3.03k|    if (!PUSH_NEXT(dst, size, store, minrun, run_stack, &stack_curr, &curr)) {
  ------------------
  |  Branch (575:9): [True: 334, False: 2.70k]
  ------------------
  576|    334|      return;
  577|    334|    }
  578|  3.03k|  }
  579|    334|}
xpath.c:libxml_domnode_binary_insertion_sort_start:
  219|  36.4k|static void BINARY_INSERTION_SORT_START(SORT_TYPE *dst, const size_t start, const size_t size) {
  220|  36.4k|  size_t i;
  221|       |
  222|   421k|  for (i = start; i < size; i++) {
  ------------------
  |  Branch (222:19): [True: 384k, False: 36.4k]
  ------------------
  223|   384k|    size_t j;
  224|   384k|    SORT_TYPE x;
  ------------------
  |  |  593|   384k|#define SORT_TYPE xmlNodePtr
  ------------------
  225|   384k|    size_t location;
  226|       |
  227|       |    /* If this entry is already correct, just move along */
  228|   384k|    if (SORT_CMP(dst[i - 1], dst[i]) <= 0) {
  ------------------
  |  |  617|   384k|#define SORT_CMP(x, y)  (wrap_cmp(x, y))
  ------------------
  |  Branch (228:9): [True: 263k, False: 120k]
  ------------------
  229|   263k|      continue;
  230|   263k|    }
  231|       |
  232|       |    /* Else we need to find the right place, shift everything over, and squeeze in */
  233|   120k|    x = dst[i];
  234|   120k|    location = BINARY_INSERTION_FIND(dst, x, i);
  ------------------
  |  |  148|   120k|#define BINARY_INSERTION_FIND          SORT_MAKE_STR(binary_insertion_find)
  |  |  ------------------
  |  |  |  |  146|   120k|#define SORT_MAKE_STR(x) SORT_MAKE_STR1(SORT_NAME,x)
  |  |  |  |  ------------------
  |  |  |  |  |  |  145|   120k|#define SORT_MAKE_STR1(x, y) SORT_CONCAT(x,y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  144|   120k|#define SORT_CONCAT(x, y) x ## _ ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  235|       |
  236|   654k|    for (j = i - 1; j >= location; j--) {
  ------------------
  |  Branch (236:21): [True: 538k, False: 116k]
  ------------------
  237|   538k|      dst[j + 1] = dst[j];
  238|       |
  239|   538k|      if (j == 0) { /* check edge case because j is unsigned */
  ------------------
  |  Branch (239:11): [True: 4.62k, False: 533k]
  ------------------
  240|  4.62k|        break;
  241|  4.62k|      }
  242|   538k|    }
  243|       |
  244|   120k|    dst[location] = x;
  245|   120k|  }
  246|  36.4k|}
xpath.c:libxml_domnode_binary_insertion_find:
  180|   120k|    const size_t size) {
  181|   120k|  size_t l, c, r;
  182|   120k|  SORT_TYPE cx;
  ------------------
  |  |  593|   120k|#define SORT_TYPE xmlNodePtr
  ------------------
  183|   120k|  l = 0;
  184|   120k|  r = size - 1;
  185|   120k|  c = r >> 1;
  186|       |
  187|       |  /* check for out of bounds at the beginning. */
  188|   120k|  if (SORT_CMP(x, dst[0]) < 0) {
  ------------------
  |  |  617|   120k|#define SORT_CMP(x, y)  (wrap_cmp(x, y))
  ------------------
  |  Branch (188:7): [True: 4.62k, False: 116k]
  ------------------
  189|  4.62k|    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|   498k|  while (1) {
  ------------------
  |  Branch (196:10): [True: 498k, Folded]
  ------------------
  197|   498k|    const int val = SORT_CMP(x, cx);
  ------------------
  |  |  617|   498k|#define SORT_CMP(x, y)  (wrap_cmp(x, y))
  ------------------
  198|       |
  199|   498k|    if (val < 0) {
  ------------------
  |  Branch (199:9): [True: 107k, False: 390k]
  ------------------
  200|   107k|      if (c - l <= 1) {
  ------------------
  |  Branch (200:11): [True: 50.7k, False: 57.1k]
  ------------------
  201|  50.7k|        return c;
  202|  50.7k|      }
  203|       |
  204|  57.1k|      r = c;
  205|   390k|    } else { /* allow = for stability. The binary search favors the right. */
  206|   390k|      if (r - c <= 1) {
  ------------------
  |  Branch (206:11): [True: 65.4k, False: 324k]
  ------------------
  207|  65.4k|        return c + 1;
  208|  65.4k|      }
  209|       |
  210|   324k|      l = c;
  211|   324k|    }
  212|       |
  213|   381k|    c = l + ((r - l) >> 1);
  214|   381k|    cx = dst[c];
  215|   381k|  }
  216|   116k|}
xpath.c:compute_minrun:
  129|  11.8k|static __inline int compute_minrun(const uint64_t size) {
  130|  11.8k|  const int top_bit = 64 - CLZ(size);
  ------------------
  |  |   78|  11.8k|#define CLZ __builtin_clzll
  ------------------
  131|  11.8k|  const int shift = MAX(top_bit, 6) - 6;
  ------------------
  |  |   67|  11.8k|#define MAX(x,y) (((x) > (y) ? (x) : (y)))
  |  |  ------------------
  |  |  |  Branch (67:20): [True: 11.8k, False: 0]
  |  |  ------------------
  ------------------
  132|  11.8k|  const int minrun = size >> shift;
  133|  11.8k|  const uint64_t mask = (1ULL << shift) - 1;
  134|       |
  135|  11.8k|  if (mask & size) {
  ------------------
  |  Branch (135:7): [True: 7.12k, False: 4.69k]
  ------------------
  136|  7.12k|    return minrun + 1;
  137|  7.12k|  }
  138|       |
  139|  4.69k|  return minrun;
  140|  11.8k|}
xpath.c:PUSH_NEXT:
  496|  28.6k|                              size_t *curr) {
  497|  28.6k|  size_t len = COUNT_RUN(dst, *curr, size);
  ------------------
  |  |  152|  28.6k|#define COUNT_RUN                      SORT_MAKE_STR(count_run)
  |  |  ------------------
  |  |  |  |  146|  28.6k|#define SORT_MAKE_STR(x) SORT_MAKE_STR1(SORT_NAME,x)
  |  |  |  |  ------------------
  |  |  |  |  |  |  145|  28.6k|#define SORT_MAKE_STR1(x, y) SORT_CONCAT(x,y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  144|  28.6k|#define SORT_CONCAT(x, y) x ## _ ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  498|  28.6k|  size_t run = minrun;
  499|       |
  500|  28.6k|  if (run > size - *curr) {
  ------------------
  |  Branch (500:7): [True: 11.4k, False: 17.1k]
  ------------------
  501|  11.4k|    run = size - *curr;
  502|  11.4k|  }
  503|       |
  504|  28.6k|  if (run > len) {
  ------------------
  |  Branch (504:7): [True: 5.43k, False: 23.1k]
  ------------------
  505|  5.43k|    BINARY_INSERTION_SORT_START(&dst[*curr], len, run);
  ------------------
  |  |  149|  5.43k|#define BINARY_INSERTION_SORT_START    SORT_MAKE_STR(binary_insertion_sort_start)
  |  |  ------------------
  |  |  |  |  146|  5.43k|#define SORT_MAKE_STR(x) SORT_MAKE_STR1(SORT_NAME,x)
  |  |  |  |  ------------------
  |  |  |  |  |  |  145|  5.43k|#define SORT_MAKE_STR1(x, y) SORT_CONCAT(x,y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  144|  5.43k|#define SORT_CONCAT(x, y) x ## _ ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  506|  5.43k|    len = run;
  507|  5.43k|  }
  508|       |
  509|  28.6k|  run_stack[*stack_curr].start = *curr;
  510|  28.6k|  run_stack[*stack_curr].length = len;
  511|  28.6k|  (*stack_curr)++;
  512|  28.6k|  *curr += len;
  513|       |
  514|  28.6k|  if (*curr == size) {
  ------------------
  |  Branch (514:7): [True: 11.8k, False: 16.8k]
  ------------------
  515|       |    /* finish up */
  516|  25.4k|    while (*stack_curr > 1) {
  ------------------
  |  Branch (516:12): [True: 13.6k, False: 11.8k]
  ------------------
  517|  13.6k|      TIM_SORT_MERGE(dst, run_stack, *stack_curr, store);
  ------------------
  |  |  156|  13.6k|#define TIM_SORT_MERGE                 SORT_MAKE_STR(tim_sort_merge)
  |  |  ------------------
  |  |  |  |  146|  13.6k|#define SORT_MAKE_STR(x) SORT_MAKE_STR1(SORT_NAME,x)
  |  |  |  |  ------------------
  |  |  |  |  |  |  145|  13.6k|#define SORT_MAKE_STR1(x, y) SORT_CONCAT(x,y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  144|  13.6k|#define SORT_CONCAT(x, y) x ## _ ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  518|  13.6k|      run_stack[*stack_curr - 2].length += run_stack[*stack_curr - 1].length;
  519|  13.6k|      (*stack_curr)--;
  520|  13.6k|    }
  521|       |
  522|  11.8k|    if (store->storage != NULL) {
  ------------------
  |  Branch (522:9): [True: 11.8k, False: 0]
  ------------------
  523|  11.8k|      free(store->storage);
  524|  11.8k|      store->storage = NULL;
  525|  11.8k|    }
  526|       |
  527|  11.8k|    return 0;
  528|  11.8k|  }
  529|       |
  530|  16.8k|  return 1;
  531|  28.6k|}
xpath.c:libxml_domnode_count_run:
  272|  28.6k|static size_t COUNT_RUN(SORT_TYPE *dst, const size_t start, const size_t size) {
  273|  28.6k|  size_t curr;
  274|       |
  275|  28.6k|  if (size - start == 1) {
  ------------------
  |  Branch (275:7): [True: 10.5k, False: 18.0k]
  ------------------
  276|  10.5k|    return 1;
  277|  10.5k|  }
  278|       |
  279|  18.0k|  if (start >= size - 2) {
  ------------------
  |  Branch (279:7): [True: 189, False: 17.8k]
  ------------------
  280|    189|    if (SORT_CMP(dst[size - 2], dst[size - 1]) > 0) {
  ------------------
  |  |  617|    189|#define SORT_CMP(x, y)  (wrap_cmp(x, y))
  ------------------
  |  Branch (280:9): [True: 86, False: 103]
  ------------------
  281|     86|      SORT_SWAP(dst[size - 2], dst[size - 1]);
  ------------------
  |  |   59|     86|#define SORT_SWAP(x,y) {SORT_TYPE __SORT_SWAP_t = (x); (x) = (y); (y) = __SORT_SWAP_t;}
  |  |  ------------------
  |  |  |  |  593|     86|#define SORT_TYPE xmlNodePtr
  |  |  ------------------
  ------------------
  282|     86|    }
  283|       |
  284|    189|    return 2;
  285|    189|  }
  286|       |
  287|  17.8k|  curr = start + 2;
  288|       |
  289|  17.8k|  if (SORT_CMP(dst[start], dst[start + 1]) <= 0) {
  ------------------
  |  |  617|  17.8k|#define SORT_CMP(x, y)  (wrap_cmp(x, y))
  ------------------
  |  Branch (289:7): [True: 16.4k, False: 1.40k]
  ------------------
  290|       |    /* increasing run */
  291|  1.35M|    while (1) {
  ------------------
  |  Branch (291:12): [True: 1.35M, Folded]
  ------------------
  292|  1.35M|      if (curr == size - 1) {
  ------------------
  |  Branch (292:11): [True: 11.3k, False: 1.34M]
  ------------------
  293|  11.3k|        break;
  294|  11.3k|      }
  295|       |
  296|  1.34M|      if (SORT_CMP(dst[curr - 1], dst[curr]) > 0) {
  ------------------
  |  |  617|  1.34M|#define SORT_CMP(x, y)  (wrap_cmp(x, y))
  ------------------
  |  Branch (296:11): [True: 5.16k, False: 1.33M]
  ------------------
  297|  5.16k|        break;
  298|  5.16k|      }
  299|       |
  300|  1.33M|      curr++;
  301|  1.33M|    }
  302|       |
  303|  16.4k|    return curr - start;
  304|  16.4k|  } else {
  305|       |    /* decreasing run */
  306|  2.10k|    while (1) {
  ------------------
  |  Branch (306:12): [True: 2.10k, Folded]
  ------------------
  307|  2.10k|      if (curr == size - 1) {
  ------------------
  |  Branch (307:11): [True: 131, False: 1.96k]
  ------------------
  308|    131|        break;
  309|    131|      }
  310|       |
  311|  1.96k|      if (SORT_CMP(dst[curr - 1], dst[curr]) <= 0) {
  ------------------
  |  |  617|  1.96k|#define SORT_CMP(x, y)  (wrap_cmp(x, y))
  ------------------
  |  Branch (311:11): [True: 1.27k, False: 699]
  ------------------
  312|  1.27k|        break;
  313|  1.27k|      }
  314|       |
  315|    699|      curr++;
  316|    699|    }
  317|       |
  318|       |    /* reverse in-place */
  319|  1.40k|    REVERSE_ELEMENTS(dst, start, curr - 1);
  ------------------
  |  |  151|  1.40k|#define REVERSE_ELEMENTS               SORT_MAKE_STR(reverse_elements)
  |  |  ------------------
  |  |  |  |  146|  1.40k|#define SORT_MAKE_STR(x) SORT_MAKE_STR1(SORT_NAME,x)
  |  |  |  |  ------------------
  |  |  |  |  |  |  145|  1.40k|#define SORT_MAKE_STR1(x, y) SORT_CONCAT(x,y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  144|  1.40k|#define SORT_CONCAT(x, y) x ## _ ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  320|  1.40k|    return curr - start;
  321|  1.40k|  }
  322|  17.8k|}
xpath.c:libxml_domnode_reverse_elements:
  260|  1.40k|static __inline void REVERSE_ELEMENTS(SORT_TYPE *dst, size_t start, size_t end) {
  261|  2.94k|  while (1) {
  ------------------
  |  Branch (261:10): [True: 2.94k, Folded]
  ------------------
  262|  2.94k|    if (start >= end) {
  ------------------
  |  Branch (262:9): [True: 1.40k, False: 1.54k]
  ------------------
  263|  1.40k|      return;
  264|  1.40k|    }
  265|       |
  266|  1.54k|    SORT_SWAP(dst[start], dst[end]);
  ------------------
  |  |   59|  1.54k|#define SORT_SWAP(x,y) {SORT_TYPE __SORT_SWAP_t = (x); (x) = (y); (y) = __SORT_SWAP_t;}
  |  |  ------------------
  |  |  |  |  593|  1.54k|#define SORT_TYPE xmlNodePtr
  |  |  ------------------
  ------------------
  267|  1.54k|    start++;
  268|  1.54k|    end--;
  269|  1.54k|  }
  270|  1.40k|}
xpath.c:libxml_domnode_tim_sort_merge:
  374|  16.8k|                           TEMP_STORAGE_T *store) {
  375|  16.8k|  const size_t A = stack[stack_curr - 2].length;
  376|  16.8k|  const size_t B = stack[stack_curr - 1].length;
  377|  16.8k|  const size_t curr = stack[stack_curr - 2].start;
  378|  16.8k|  SORT_TYPE *storage;
  ------------------
  |  |  593|  16.8k|#define SORT_TYPE xmlNodePtr
  ------------------
  379|  16.8k|  size_t i, j, k;
  380|  16.8k|  TIM_SORT_RESIZE(store, MIN(A, B));
  ------------------
  |  |  155|  16.8k|#define TIM_SORT_RESIZE                SORT_MAKE_STR(tim_sort_resize)
  |  |  ------------------
  |  |  |  |  146|  16.8k|#define SORT_MAKE_STR(x) SORT_MAKE_STR1(SORT_NAME,x)
  |  |  |  |  ------------------
  |  |  |  |  |  |  145|  16.8k|#define SORT_MAKE_STR1(x, y) SORT_CONCAT(x,y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  144|  16.8k|#define SORT_CONCAT(x, y) x ## _ ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                TIM_SORT_RESIZE(store, MIN(A, B));
  ------------------
  |  |   71|  16.8k|#define MIN(x,y) (((x) < (y) ? (x) : (y)))
  |  |  ------------------
  |  |  |  Branch (71:20): [True: 2.98k, False: 13.8k]
  |  |  ------------------
  ------------------
  381|  16.8k|  storage = store->storage;
  382|       |
  383|       |  /* left merge */
  384|  16.8k|  if (A < B) {
  ------------------
  |  Branch (384:7): [True: 2.98k, False: 13.8k]
  ------------------
  385|  2.98k|    memcpy(storage, &dst[curr], A * sizeof(SORT_TYPE));
  386|  2.98k|    i = 0;
  387|  2.98k|    j = curr + A;
  388|       |
  389|   466k|    for (k = curr; k < curr + A + B; k++) {
  ------------------
  |  Branch (389:20): [True: 465k, False: 487]
  ------------------
  390|   465k|      if ((i < A) && (j < curr + A + B)) {
  ------------------
  |  Branch (390:11): [True: 463k, False: 2.50k]
  |  Branch (390:22): [True: 453k, False: 9.72k]
  ------------------
  391|   453k|        if (SORT_CMP(storage[i], dst[j]) <= 0) {
  ------------------
  |  |  617|   453k|#define SORT_CMP(x, y)  (wrap_cmp(x, y))
  ------------------
  |  Branch (391:13): [True: 217k, False: 235k]
  ------------------
  392|   217k|          dst[k] = storage[i++];
  393|   235k|        } else {
  394|   235k|          dst[k] = dst[j++];
  395|   235k|        }
  396|   453k|      } else if (i < A) {
  ------------------
  |  Branch (396:18): [True: 9.72k, False: 2.50k]
  ------------------
  397|  9.72k|        dst[k] = storage[i++];
  398|  9.72k|      } else {
  399|  2.50k|        break;
  400|  2.50k|      }
  401|   465k|    }
  402|  13.8k|  } else {
  403|       |    /* right merge */
  404|  13.8k|    memcpy(storage, &dst[curr + A], B * sizeof(SORT_TYPE));
  405|  13.8k|    i = B;
  406|  13.8k|    j = curr + A;
  407|  13.8k|    k = curr + A + B;
  408|       |
  409|   415k|    while (k > curr) {
  ------------------
  |  Branch (409:12): [True: 415k, False: 466]
  ------------------
  410|   415k|      k--;
  411|   415k|      if ((i > 0) && (j > curr)) {
  ------------------
  |  Branch (411:11): [True: 401k, False: 13.3k]
  |  Branch (411:22): [True: 398k, False: 3.48k]
  ------------------
  412|   398k|        if (SORT_CMP(dst[j - 1], storage[i - 1]) > 0) {
  ------------------
  |  |  617|   398k|#define SORT_CMP(x, y)  (wrap_cmp(x, y))
  ------------------
  |  Branch (412:13): [True: 112k, False: 286k]
  ------------------
  413|   112k|          dst[k] = dst[--j];
  414|   286k|        } else {
  415|   286k|          dst[k] = storage[--i];
  416|   286k|        }
  417|   398k|      } else if (i > 0) {
  ------------------
  |  Branch (417:18): [True: 3.48k, False: 13.3k]
  ------------------
  418|  3.48k|        dst[k] = storage[--i];
  419|  13.3k|      } else {
  420|  13.3k|        break;
  421|  13.3k|      }
  422|   415k|    }
  423|  13.8k|  }
  424|  16.8k|}
xpath.c:libxml_domnode_tim_sort_resize:
  358|  16.8k|static void TIM_SORT_RESIZE(TEMP_STORAGE_T *store, const size_t new_size) {
  359|  16.8k|  if (store->alloc < new_size) {
  ------------------
  |  Branch (359:7): [True: 13.9k, False: 2.90k]
  ------------------
  360|  13.9k|    SORT_TYPE *tempstore = (SORT_TYPE *)realloc(store->storage, new_size * sizeof(SORT_TYPE));
  ------------------
  |  |  593|  13.9k|#define SORT_TYPE xmlNodePtr
  ------------------
  361|       |
  362|  13.9k|    if (tempstore == NULL) {
  ------------------
  |  Branch (362:9): [True: 0, False: 13.9k]
  ------------------
  363|      0|      fprintf(stderr, "Error allocating temporary storage for tim sort: need %lu bytes",
  364|      0|              (unsigned long)(sizeof(SORT_TYPE) * new_size));
  365|      0|      exit(1);
  366|      0|    }
  367|       |
  368|  13.9k|    store->storage = tempstore;
  369|  13.9k|    store->alloc = new_size;
  370|  13.9k|  }
  371|  16.8k|}
xpath.c:libxml_domnode_check_invariant:
  324|  4.89k|static int CHECK_INVARIANT(TIM_SORT_RUN_T *stack, const int stack_curr) {
  325|  4.89k|  size_t A, B, C;
  326|       |
  327|  4.89k|  if (stack_curr < 2) {
  ------------------
  |  Branch (327:7): [True: 290, False: 4.60k]
  ------------------
  328|    290|    return 1;
  329|    290|  }
  330|       |
  331|  4.60k|  if (stack_curr == 2) {
  ------------------
  |  Branch (331:7): [True: 557, False: 4.05k]
  ------------------
  332|    557|    const size_t A1 = stack[stack_curr - 2].length;
  333|    557|    const size_t B1 = stack[stack_curr - 1].length;
  334|       |
  335|    557|    if (A1 <= B1) {
  ------------------
  |  Branch (335:9): [True: 23, False: 534]
  ------------------
  336|     23|      return 0;
  337|     23|    }
  338|       |
  339|    534|    return 1;
  340|    557|  }
  341|       |
  342|  4.05k|  A = stack[stack_curr - 3].length;
  343|  4.05k|  B = stack[stack_curr - 2].length;
  344|  4.05k|  C = stack[stack_curr - 1].length;
  345|       |
  346|  4.05k|  if ((A <= B + C) || (B <= C)) {
  ------------------
  |  Branch (346:7): [True: 1.13k, False: 2.92k]
  |  Branch (346:23): [True: 710, False: 2.21k]
  ------------------
  347|  1.84k|    return 0;
  348|  1.84k|  }
  349|       |
  350|  2.21k|  return 1;
  351|  4.05k|}
xpath.c:libxml_domnode_tim_sort_collapse:
  427|  1.86k|                             TEMP_STORAGE_T *store, const size_t size) {
  428|  4.74k|  while (1) {
  ------------------
  |  Branch (428:10): [True: 4.74k, Folded]
  ------------------
  429|  4.74k|    size_t A, B, C, D;
  430|  4.74k|    int ABC, BCD, CD;
  431|       |
  432|       |    /* if the stack only has one thing on it, we are done with the collapse */
  433|  4.74k|    if (stack_curr <= 1) {
  ------------------
  |  Branch (433:9): [True: 0, False: 4.74k]
  ------------------
  434|      0|      break;
  435|      0|    }
  436|       |
  437|       |    /* if this is the last merge, just do it */
  438|  4.74k|    if ((stack_curr == 2) && (stack[0].length + stack[1].length == size)) {
  ------------------
  |  Branch (438:9): [True: 762, False: 3.98k]
  |  Branch (438:30): [True: 0, False: 762]
  ------------------
  439|      0|      TIM_SORT_MERGE(dst, stack, stack_curr, store);
  ------------------
  |  |  156|      0|#define TIM_SORT_MERGE                 SORT_MAKE_STR(tim_sort_merge)
  |  |  ------------------
  |  |  |  |  146|      0|#define SORT_MAKE_STR(x) SORT_MAKE_STR1(SORT_NAME,x)
  |  |  |  |  ------------------
  |  |  |  |  |  |  145|      0|#define SORT_MAKE_STR1(x, y) SORT_CONCAT(x,y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  144|      0|#define SORT_CONCAT(x, y) x ## _ ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  440|      0|      stack[0].length += stack[1].length;
  441|      0|      stack_curr--;
  442|      0|      break;
  443|      0|    }
  444|       |    /* check if the invariant is off for a stack of 2 elements */
  445|  4.74k|    else if ((stack_curr == 2) && (stack[0].length <= stack[1].length)) {
  ------------------
  |  Branch (445:14): [True: 762, False: 3.98k]
  |  Branch (445:35): [True: 290, False: 472]
  ------------------
  446|    290|      TIM_SORT_MERGE(dst, stack, stack_curr, store);
  ------------------
  |  |  156|    290|#define TIM_SORT_MERGE                 SORT_MAKE_STR(tim_sort_merge)
  |  |  ------------------
  |  |  |  |  146|    290|#define SORT_MAKE_STR(x) SORT_MAKE_STR1(SORT_NAME,x)
  |  |  |  |  ------------------
  |  |  |  |  |  |  145|    290|#define SORT_MAKE_STR1(x, y) SORT_CONCAT(x,y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  144|    290|#define SORT_CONCAT(x, y) x ## _ ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  447|    290|      stack[0].length += stack[1].length;
  448|    290|      stack_curr--;
  449|    290|      break;
  450|  4.45k|    } else if (stack_curr == 2) {
  ------------------
  |  Branch (450:16): [True: 472, False: 3.98k]
  ------------------
  451|    472|      break;
  452|    472|    }
  453|       |
  454|  3.98k|    B = stack[stack_curr - 3].length;
  455|  3.98k|    C = stack[stack_curr - 2].length;
  456|  3.98k|    D = stack[stack_curr - 1].length;
  457|       |
  458|  3.98k|    if (stack_curr >= 4) {
  ------------------
  |  Branch (458:9): [True: 2.83k, False: 1.15k]
  ------------------
  459|  2.83k|      A = stack[stack_curr - 4].length;
  460|  2.83k|      ABC = (A <= B + C);
  461|  2.83k|    } else {
  462|  1.15k|      ABC = 0;
  463|  1.15k|    }
  464|       |
  465|  3.98k|    BCD = (B <= C + D) || ABC;
  ------------------
  |  Branch (465:11): [True: 1.63k, False: 2.35k]
  |  Branch (465:27): [True: 23, False: 2.33k]
  ------------------
  466|  3.98k|    CD = (C <= D);
  467|       |
  468|       |    /* Both invariants are good */
  469|  3.98k|    if (!BCD && !CD) {
  ------------------
  |  Branch (469:9): [True: 2.33k, False: 1.65k]
  |  Branch (469:17): [True: 1.10k, False: 1.23k]
  ------------------
  470|  1.10k|      break;
  471|  1.10k|    }
  472|       |
  473|       |    /* left merge */
  474|  2.88k|    if (BCD && !CD) {
  ------------------
  |  Branch (474:9): [True: 1.65k, False: 1.23k]
  |  Branch (474:16): [True: 607, False: 1.04k]
  ------------------
  475|    607|      TIM_SORT_MERGE(dst, stack, stack_curr - 1, store);
  ------------------
  |  |  156|    607|#define TIM_SORT_MERGE                 SORT_MAKE_STR(tim_sort_merge)
  |  |  ------------------
  |  |  |  |  146|    607|#define SORT_MAKE_STR(x) SORT_MAKE_STR1(SORT_NAME,x)
  |  |  |  |  ------------------
  |  |  |  |  |  |  145|    607|#define SORT_MAKE_STR1(x, y) SORT_CONCAT(x,y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  144|    607|#define SORT_CONCAT(x, y) x ## _ ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  476|    607|      stack[stack_curr - 3].length += stack[stack_curr - 2].length;
  477|    607|      stack[stack_curr - 2] = stack[stack_curr - 1];
  478|    607|      stack_curr--;
  479|  2.27k|    } else {
  480|       |      /* right merge */
  481|  2.27k|      TIM_SORT_MERGE(dst, stack, stack_curr, store);
  ------------------
  |  |  156|  2.27k|#define TIM_SORT_MERGE                 SORT_MAKE_STR(tim_sort_merge)
  |  |  ------------------
  |  |  |  |  146|  2.27k|#define SORT_MAKE_STR(x) SORT_MAKE_STR1(SORT_NAME,x)
  |  |  |  |  ------------------
  |  |  |  |  |  |  145|  2.27k|#define SORT_MAKE_STR1(x, y) SORT_CONCAT(x,y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  144|  2.27k|#define SORT_CONCAT(x, y) x ## _ ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  482|  2.27k|      stack[stack_curr - 2].length += stack[stack_curr - 1].length;
  483|  2.27k|      stack_curr--;
  484|  2.27k|    }
  485|  2.88k|  }
  486|       |
  487|  1.86k|  return stack_curr;
  488|  1.86k|}

xmlBuildQName:
  170|   343k|	      xmlChar *memory, int len) {
  171|   343k|    size_t lenn, lenp;
  172|   343k|    xmlChar *ret;
  173|       |
  174|   343k|    if ((ncname == NULL) || (len < 0)) return(NULL);
  ------------------
  |  Branch (174:9): [True: 0, False: 343k]
  |  Branch (174:29): [True: 0, False: 343k]
  ------------------
  175|   343k|    if (prefix == NULL) return((xmlChar *) ncname);
  ------------------
  |  Branch (175:9): [True: 215k, False: 127k]
  ------------------
  176|       |
  177|   127k|#ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
  178|       |    /* Make allocation more likely */
  179|   127k|    if (len > 8)
  ------------------
  |  Branch (179:9): [True: 91.5k, False: 36.3k]
  ------------------
  180|  91.5k|        len = 8;
  181|   127k|#endif
  182|       |
  183|   127k|    lenn = strlen((char *) ncname);
  184|   127k|    lenp = strlen((char *) prefix);
  185|   127k|    if (lenn >= SIZE_MAX - lenp - 1)
  ------------------
  |  Branch (185:9): [True: 0, False: 127k]
  ------------------
  186|      0|        return(NULL);
  187|       |
  188|   127k|    if ((memory == NULL) || ((size_t) len < lenn + lenp + 2)) {
  ------------------
  |  Branch (188:9): [True: 36.3k, False: 91.5k]
  |  Branch (188:29): [True: 37.8k, False: 53.7k]
  ------------------
  189|  74.1k|	ret = xmlMalloc(lenn + lenp + 2);
  190|  74.1k|	if (ret == NULL)
  ------------------
  |  Branch (190:6): [True: 56, False: 74.0k]
  ------------------
  191|     56|	    return(NULL);
  192|  74.1k|    } else {
  193|  53.7k|	ret = memory;
  194|  53.7k|    }
  195|   127k|    memcpy(&ret[0], prefix, lenp);
  196|   127k|    ret[lenp] = ':';
  197|   127k|    memcpy(&ret[lenp + 1], ncname, lenn);
  198|   127k|    ret[lenn + lenp + 1] = 0;
  199|   127k|    return(ret);
  200|   127k|}
xmlSplitQName3:
  268|   185k|xmlSplitQName3(const xmlChar *name, int *len) {
  269|   185k|    int l = 0;
  270|       |
  271|   185k|    if (name == NULL) return(NULL);
  ------------------
  |  Branch (271:9): [True: 0, False: 185k]
  ------------------
  272|   185k|    if (len == NULL) return(NULL);
  ------------------
  |  Branch (272:9): [True: 0, False: 185k]
  ------------------
  273|       |
  274|       |    /* nasty but valid */
  275|   185k|    if (name[0] == ':')
  ------------------
  |  Branch (275:9): [True: 1.60k, False: 183k]
  ------------------
  276|  1.60k|	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|   920k|    while ((name[l] != 0) && (name[l] != ':'))
  ------------------
  |  Branch (282:12): [True: 749k, False: 170k]
  |  Branch (282:30): [True: 736k, False: 12.8k]
  ------------------
  283|   736k|	l++;
  284|       |
  285|   183k|    if ((name[l] == 0) || (name[l+1] == 0))
  ------------------
  |  Branch (285:9): [True: 170k, False: 12.8k]
  |  Branch (285:27): [True: 378, False: 12.4k]
  ------------------
  286|   171k|	return(NULL);
  287|       |
  288|  12.4k|    *len = l;
  289|       |
  290|  12.4k|    return(&name[l+1]);
  291|   183k|}
xmlSplitQName4:
  306|   612k|xmlSplitQName4(const xmlChar *name, xmlChar **prefixPtr) {
  307|   612k|    xmlChar *prefix;
  308|   612k|    int l = 0;
  309|       |
  310|   612k|    if ((name == NULL) || (prefixPtr == NULL))
  ------------------
  |  Branch (310:9): [True: 0, False: 612k]
  |  Branch (310:27): [True: 0, False: 612k]
  ------------------
  311|      0|        return(NULL);
  312|       |
  313|   612k|    *prefixPtr = NULL;
  314|       |
  315|       |    /* nasty but valid */
  316|   612k|    if (name[0] == ':')
  ------------------
  |  Branch (316:9): [True: 4.60k, False: 608k]
  ------------------
  317|  4.60k|	return(name);
  318|       |
  319|       |    /*
  320|       |     * we are not trying to validate but just to cut, and yes it will
  321|       |     * work even if this is as set of UTF-8 encoded chars
  322|       |     */
  323|  2.51M|    while ((name[l] != 0) && (name[l] != ':'))
  ------------------
  |  Branch (323:12): [True: 2.07M, False: 436k]
  |  Branch (323:30): [True: 1.90M, False: 172k]
  ------------------
  324|  1.90M|	l++;
  325|       |
  326|       |    /*
  327|       |     * TODO: What about names with multiple colons?
  328|       |     */
  329|   608k|    if ((name[l] == 0) || (name[l+1] == 0))
  ------------------
  |  Branch (329:9): [True: 436k, False: 172k]
  |  Branch (329:27): [True: 1.60k, False: 170k]
  ------------------
  330|   437k|	return(name);
  331|       |
  332|   170k|    prefix = xmlStrndup(name, l);
  333|   170k|    if (prefix == NULL)
  ------------------
  |  Branch (333:9): [True: 53, False: 170k]
  ------------------
  334|     53|        return(NULL);
  335|       |
  336|   170k|    *prefixPtr = prefix;
  337|   170k|    return(&name[l+1]);
  338|   170k|}
xmlValidateNCName:
  355|  2.80k|xmlValidateNCName(const xmlChar *value, int space) {
  356|  2.80k|    const xmlChar *cur;
  357|       |
  358|  2.80k|    if (value == NULL)
  ------------------
  |  Branch (358:9): [True: 0, False: 2.80k]
  ------------------
  359|      0|        return(-1);
  360|       |
  361|  2.80k|    cur = value;
  362|       |
  363|  2.80k|    if (space) {
  ------------------
  |  Branch (363:9): [True: 2.80k, False: 0]
  ------------------
  364|  2.80k|	while (IS_BLANK_CH(*cur))
  365|    873|            cur++;
  366|  2.80k|    }
  367|       |
  368|  2.80k|    value = cur;
  369|  2.80k|    cur = xmlScanName(value, SIZE_MAX, XML_SCAN_NC);
  ------------------
  |  |   69|  2.80k|#define XML_SCAN_NC         1
  ------------------
  370|  2.80k|    if ((cur == NULL) || (cur == value))
  ------------------
  |  Branch (370:9): [True: 0, False: 2.80k]
  |  Branch (370:26): [True: 839, False: 1.96k]
  ------------------
  371|    839|        return(1);
  372|       |
  373|  1.96k|    if (space) {
  ------------------
  |  Branch (373:9): [True: 1.96k, False: 0]
  ------------------
  374|  1.96k|	while (IS_BLANK_CH(*cur))
  375|  1.23k|            cur++;
  376|  1.96k|    }
  377|       |
  378|  1.96k|    return(*cur != 0);
  379|  2.80k|}
xmlNewNs:
  517|  3.42M|xmlNewNs(xmlNode *node, const xmlChar *href, const xmlChar *prefix) {
  518|  3.42M|    xmlNsPtr cur;
  519|       |
  520|  3.42M|    if ((node != NULL) && (node->type != XML_ELEMENT_NODE))
  ------------------
  |  Branch (520:9): [True: 90.4k, False: 3.33M]
  |  Branch (520:27): [True: 0, False: 90.4k]
  ------------------
  521|      0|	return(NULL);
  522|       |
  523|       |    /*
  524|       |     * Allocate a new Namespace and fill the fields.
  525|       |     */
  526|  3.42M|    cur = (xmlNsPtr) xmlMalloc(sizeof(xmlNs));
  527|  3.42M|    if (cur == NULL)
  ------------------
  |  Branch (527:9): [True: 48, False: 3.42M]
  ------------------
  528|     48|	return(NULL);
  529|  3.42M|    memset(cur, 0, sizeof(xmlNs));
  530|  3.42M|    cur->type = XML_LOCAL_NAMESPACE;
  ------------------
  |  |  500|  3.42M|#define XML_LOCAL_NAMESPACE XML_NAMESPACE_DECL
  ------------------
  531|       |
  532|  3.42M|    if (href != NULL) {
  ------------------
  |  Branch (532:9): [True: 3.39M, False: 24.3k]
  ------------------
  533|  3.39M|	cur->href = xmlStrdup(href);
  534|  3.39M|        if (cur->href == NULL)
  ------------------
  |  Branch (534:13): [True: 51, False: 3.39M]
  ------------------
  535|     51|            goto error;
  536|  3.39M|    }
  537|  3.42M|    if (prefix != NULL) {
  ------------------
  |  Branch (537:9): [True: 3.37M, False: 49.7k]
  ------------------
  538|  3.37M|	cur->prefix = xmlStrdup(prefix);
  539|  3.37M|        if (cur->prefix == NULL)
  ------------------
  |  Branch (539:13): [True: 39, False: 3.37M]
  ------------------
  540|     39|            goto error;
  541|  3.37M|    }
  542|       |
  543|       |    /*
  544|       |     * Add it at the end to preserve parsing order ...
  545|       |     * and checks for existing use of the prefix
  546|       |     */
  547|  3.42M|    if (node != NULL) {
  ------------------
  |  Branch (547:9): [True: 90.4k, False: 3.33M]
  ------------------
  548|  90.4k|	if (node->nsDef == NULL) {
  ------------------
  |  Branch (548:6): [True: 81.4k, False: 8.91k]
  ------------------
  549|  81.4k|	    node->nsDef = cur;
  550|  81.4k|	} else {
  551|  8.91k|	    xmlNsPtr prev = node->nsDef;
  552|       |
  553|  8.91k|	    if ((xmlStrEqual(prev->prefix, cur->prefix)) &&
  ------------------
  |  Branch (553:10): [True: 0, False: 8.91k]
  ------------------
  554|      0|                (prev->href != NULL))
  ------------------
  |  Branch (554:17): [True: 0, False: 0]
  ------------------
  555|      0|                goto error;
  556|  12.8k|	    while (prev->next != NULL) {
  ------------------
  |  Branch (556:13): [True: 3.94k, False: 8.91k]
  ------------------
  557|  3.94k|	        prev = prev->next;
  558|  3.94k|		if ((xmlStrEqual(prev->prefix, cur->prefix)) &&
  ------------------
  |  Branch (558:7): [True: 0, False: 3.94k]
  ------------------
  559|      0|                    (prev->href != NULL))
  ------------------
  |  Branch (559:21): [True: 0, False: 0]
  ------------------
  560|      0|                    goto error;
  561|  3.94k|	    }
  562|  8.91k|	    prev->next = cur;
  563|  8.91k|	}
  564|  90.4k|    }
  565|  3.42M|    return(cur);
  566|       |
  567|     90|error:
  568|     90|    xmlFreeNs(cur);
  569|       |    return(NULL);
  570|  3.42M|}
xmlSetNs:
  580|  78.6k|xmlSetNs(xmlNode *node, xmlNs *ns) {
  581|  78.6k|    if (node == NULL) {
  ------------------
  |  Branch (581:9): [True: 0, False: 78.6k]
  ------------------
  582|      0|	return;
  583|      0|    }
  584|  78.6k|    if ((node->type == XML_ELEMENT_NODE) ||
  ------------------
  |  Branch (584:9): [True: 78.6k, False: 0]
  ------------------
  585|      0|        (node->type == XML_ATTRIBUTE_NODE))
  ------------------
  |  Branch (585:9): [True: 0, False: 0]
  ------------------
  586|  78.6k|	node->ns = ns;
  587|  78.6k|}
xmlFreeNs:
  595|  3.42M|xmlFreeNs(xmlNs *cur) {
  596|  3.42M|    if (cur == NULL) {
  ------------------
  |  Branch (596:9): [True: 0, False: 3.42M]
  ------------------
  597|      0|	return;
  598|      0|    }
  599|  3.42M|    if (cur->href != NULL) xmlFree((char *) cur->href);
  ------------------
  |  Branch (599:9): [True: 3.40M, False: 24.4k]
  ------------------
  600|  3.42M|    if (cur->prefix != NULL) xmlFree((char *) cur->prefix);
  ------------------
  |  Branch (600:9): [True: 3.37M, False: 49.8k]
  ------------------
  601|  3.42M|    xmlFree(cur);
  602|  3.42M|}
xmlFreeNsList:
  610|  3.31M|xmlFreeNsList(xmlNs *cur) {
  611|  3.31M|    xmlNsPtr next;
  612|  3.31M|    if (cur == NULL) {
  ------------------
  |  Branch (612:9): [True: 38, False: 3.30M]
  ------------------
  613|     38|	return;
  614|     38|    }
  615|  6.73M|    while (cur != NULL) {
  ------------------
  |  Branch (615:12): [True: 3.42M, False: 3.30M]
  ------------------
  616|  3.42M|        next = cur->next;
  617|  3.42M|        xmlFreeNs(cur);
  618|  3.42M|	cur = next;
  619|  3.42M|    }
  620|  3.30M|}
xmlNewDtd:
  640|  1.46k|          const xmlChar *systemId) {
  641|  1.46k|    xmlDtdPtr cur;
  642|       |
  643|  1.46k|    if ((doc != NULL) && (doc->extSubset != NULL)) {
  ------------------
  |  Branch (643:9): [True: 1.46k, False: 0]
  |  Branch (643:26): [True: 0, False: 1.46k]
  ------------------
  644|      0|	return(NULL);
  645|      0|    }
  646|       |
  647|       |    /*
  648|       |     * Allocate a new DTD and fill the fields.
  649|       |     */
  650|  1.46k|    cur = (xmlDtdPtr) xmlMalloc(sizeof(xmlDtd));
  651|  1.46k|    if (cur == NULL)
  ------------------
  |  Branch (651:9): [True: 1, False: 1.46k]
  ------------------
  652|      1|	return(NULL);
  653|  1.46k|    memset(cur, 0 , sizeof(xmlDtd));
  654|  1.46k|    cur->type = XML_DTD_NODE;
  655|       |
  656|  1.46k|    if (name != NULL) {
  ------------------
  |  Branch (656:9): [True: 1.46k, False: 0]
  ------------------
  657|  1.46k|	cur->name = xmlStrdup(name);
  658|  1.46k|        if (cur->name == NULL)
  ------------------
  |  Branch (658:13): [True: 3, False: 1.45k]
  ------------------
  659|      3|            goto error;
  660|  1.46k|    }
  661|  1.45k|    if (publicId != NULL) {
  ------------------
  |  Branch (661:9): [True: 7, False: 1.45k]
  ------------------
  662|      7|	cur->ExternalID = xmlStrdup(publicId);
  663|      7|        if (cur->ExternalID == NULL)
  ------------------
  |  Branch (663:13): [True: 1, False: 6]
  ------------------
  664|      1|            goto error;
  665|      7|    }
  666|  1.45k|    if (systemId != NULL) {
  ------------------
  |  Branch (666:9): [True: 1.43k, False: 18]
  ------------------
  667|  1.43k|	cur->SystemID = xmlStrdup(systemId);
  668|  1.43k|        if (cur->SystemID == NULL)
  ------------------
  |  Branch (668:13): [True: 1, False: 1.43k]
  ------------------
  669|      1|            goto error;
  670|  1.43k|    }
  671|  1.45k|    if (doc != NULL)
  ------------------
  |  Branch (671:9): [True: 1.45k, False: 0]
  ------------------
  672|  1.45k|	doc->extSubset = cur;
  673|  1.45k|    cur->doc = doc;
  674|       |
  675|  1.45k|    if ((xmlRegisterCallbacks) && (xmlRegisterNodeDefaultValue))
  ------------------
  |  |  932|      0|    (*__xmlRegisterNodeDefaultValue())
  ------------------
  |  Branch (675:9): [True: 0, False: 1.45k]
  |  Branch (675:35): [True: 0, False: 0]
  ------------------
  676|      0|	xmlRegisterNodeDefaultValue((xmlNodePtr)cur);
  ------------------
  |  |  932|      0|    (*__xmlRegisterNodeDefaultValue())
  ------------------
  677|  1.45k|    return(cur);
  678|       |
  679|      5|error:
  680|      5|    xmlFreeDtd(cur);
  681|       |    return(NULL);
  682|  1.45k|}
xmlGetIntSubset:
  691|  71.6k|xmlGetIntSubset(const xmlDoc *doc) {
  692|  71.6k|    xmlNodePtr cur;
  693|       |
  694|  71.6k|    if (doc == NULL)
  ------------------
  |  Branch (694:9): [True: 0, False: 71.6k]
  ------------------
  695|      0|	return(NULL);
  696|  71.6k|    cur = doc->children;
  697|  83.6k|    while (cur != NULL) {
  ------------------
  |  Branch (697:12): [True: 40.9k, False: 42.7k]
  ------------------
  698|  40.9k|	if (cur->type == XML_DTD_NODE)
  ------------------
  |  Branch (698:6): [True: 28.8k, False: 12.0k]
  ------------------
  699|  28.8k|	    return((xmlDtdPtr) cur);
  700|  12.0k|	cur = cur->next;
  701|  12.0k|    }
  702|  42.7k|    return((xmlDtdPtr) doc->intSubset);
  703|  71.6k|}
xmlCreateIntSubset:
  722|  18.6k|                   const xmlChar *systemId) {
  723|  18.6k|    xmlDtdPtr cur;
  724|       |
  725|  18.6k|    if (doc != NULL) {
  ------------------
  |  Branch (725:9): [True: 18.6k, False: 0]
  ------------------
  726|  18.6k|        cur = xmlGetIntSubset(doc);
  727|  18.6k|        if (cur != NULL)
  ------------------
  |  Branch (727:13): [True: 0, False: 18.6k]
  ------------------
  728|      0|            return(cur);
  729|  18.6k|    }
  730|       |
  731|       |    /*
  732|       |     * Allocate a new DTD and fill the fields.
  733|       |     */
  734|  18.6k|    cur = (xmlDtdPtr) xmlMalloc(sizeof(xmlDtd));
  735|  18.6k|    if (cur == NULL)
  ------------------
  |  Branch (735:9): [True: 4, False: 18.6k]
  ------------------
  736|      4|	return(NULL);
  737|  18.6k|    memset(cur, 0, sizeof(xmlDtd));
  738|  18.6k|    cur->type = XML_DTD_NODE;
  739|       |
  740|  18.6k|    if (name != NULL) {
  ------------------
  |  Branch (740:9): [True: 17.7k, False: 936]
  ------------------
  741|  17.7k|	cur->name = xmlStrdup(name);
  742|  17.7k|	if (cur->name == NULL)
  ------------------
  |  Branch (742:6): [True: 3, False: 17.7k]
  ------------------
  743|      3|            goto error;
  744|  17.7k|    }
  745|  18.6k|    if (publicId != NULL) {
  ------------------
  |  Branch (745:9): [True: 781, False: 17.8k]
  ------------------
  746|    781|	cur->ExternalID = xmlStrdup(publicId);
  747|    781|	if (cur->ExternalID  == NULL)
  ------------------
  |  Branch (747:6): [True: 1, False: 780]
  ------------------
  748|      1|            goto error;
  749|    781|    }
  750|  18.6k|    if (systemId != NULL) {
  ------------------
  |  Branch (750:9): [True: 2.75k, False: 15.8k]
  ------------------
  751|  2.75k|	cur->SystemID = xmlStrdup(systemId);
  752|  2.75k|	if (cur->SystemID == NULL)
  ------------------
  |  Branch (752:6): [True: 1, False: 2.75k]
  ------------------
  753|      1|            goto error;
  754|  2.75k|    }
  755|  18.6k|    if (doc != NULL) {
  ------------------
  |  Branch (755:9): [True: 18.6k, False: 0]
  ------------------
  756|  18.6k|	doc->intSubset = cur;
  757|  18.6k|	cur->parent = doc;
  758|  18.6k|	cur->doc = doc;
  759|  18.6k|	if (doc->children == NULL) {
  ------------------
  |  Branch (759:6): [True: 16.5k, False: 2.08k]
  ------------------
  760|  16.5k|	    doc->children = (xmlNodePtr) cur;
  761|  16.5k|	    doc->last = (xmlNodePtr) cur;
  762|  16.5k|	} else {
  763|  2.08k|	    if (doc->type == XML_HTML_DOCUMENT_NODE) {
  ------------------
  |  Branch (763:10): [True: 0, False: 2.08k]
  ------------------
  764|      0|		xmlNodePtr prev;
  765|       |
  766|      0|		prev = doc->children;
  767|      0|		prev->prev = (xmlNodePtr) cur;
  768|      0|		cur->next = prev;
  769|      0|		doc->children = (xmlNodePtr) cur;
  770|  2.08k|	    } else {
  771|  2.08k|		xmlNodePtr next;
  772|       |
  773|  2.08k|		next = doc->children;
  774|  4.29k|		while ((next != NULL) && (next->type != XML_ELEMENT_NODE))
  ------------------
  |  Branch (774:10): [True: 2.37k, False: 1.92k]
  |  Branch (774:28): [True: 2.20k, False: 164]
  ------------------
  775|  2.20k|		    next = next->next;
  776|  2.08k|		if (next == NULL) {
  ------------------
  |  Branch (776:7): [True: 1.92k, False: 164]
  ------------------
  777|  1.92k|		    cur->prev = doc->last;
  778|  1.92k|		    cur->prev->next = (xmlNodePtr) cur;
  779|  1.92k|		    cur->next = NULL;
  780|  1.92k|		    doc->last = (xmlNodePtr) cur;
  781|  1.92k|		} else {
  782|    164|		    cur->next = next;
  783|    164|		    cur->prev = next->prev;
  784|    164|		    if (cur->prev == NULL)
  ------------------
  |  Branch (784:11): [True: 161, False: 3]
  ------------------
  785|    161|			doc->children = (xmlNodePtr) cur;
  786|      3|		    else
  787|      3|			cur->prev->next = (xmlNodePtr) cur;
  788|    164|		    next->prev = (xmlNodePtr) cur;
  789|    164|		}
  790|  2.08k|	    }
  791|  2.08k|	}
  792|  18.6k|    }
  793|       |
  794|  18.6k|    if ((xmlRegisterCallbacks) && (xmlRegisterNodeDefaultValue))
  ------------------
  |  |  932|      0|    (*__xmlRegisterNodeDefaultValue())
  ------------------
  |  Branch (794:9): [True: 0, False: 18.6k]
  |  Branch (794:35): [True: 0, False: 0]
  ------------------
  795|      0|	xmlRegisterNodeDefaultValue((xmlNodePtr)cur);
  ------------------
  |  |  932|      0|    (*__xmlRegisterNodeDefaultValue())
  ------------------
  796|  18.6k|    return(cur);
  797|       |
  798|      5|error:
  799|      5|    xmlFreeDtd(cur);
  800|       |    return(NULL);
  801|  18.6k|}
xmlFreeDtd:
  820|  20.1k|xmlFreeDtd(xmlDtd *cur) {
  821|  20.1k|    xmlDictPtr dict = NULL;
  822|       |
  823|  20.1k|    if (cur == NULL) {
  ------------------
  |  Branch (823:9): [True: 0, False: 20.1k]
  ------------------
  824|      0|	return;
  825|      0|    }
  826|  20.1k|    if (cur->doc != NULL) dict = cur->doc->dict;
  ------------------
  |  Branch (826:9): [True: 20.1k, False: 10]
  ------------------
  827|       |
  828|  20.1k|    if ((xmlRegisterCallbacks) && (xmlDeregisterNodeDefaultValue))
  ------------------
  |  |  934|      0|    (*__xmlDeregisterNodeDefaultValue())
  ------------------
  |  Branch (828:9): [True: 0, False: 20.1k]
  |  Branch (828:35): [True: 0, False: 0]
  ------------------
  829|      0|	xmlDeregisterNodeDefaultValue((xmlNodePtr)cur);
  ------------------
  |  |  934|      0|    (*__xmlDeregisterNodeDefaultValue())
  ------------------
  830|       |
  831|  20.1k|    if (cur->children != NULL) {
  ------------------
  |  Branch (831:9): [True: 12.3k, False: 7.80k]
  ------------------
  832|  12.3k|	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|   414k|        while (c != NULL) {
  ------------------
  |  Branch (838:16): [True: 401k, False: 12.3k]
  ------------------
  839|   401k|	    next = c->next;
  840|   401k|	    if ((c->type != XML_ELEMENT_DECL) &&
  ------------------
  |  Branch (840:10): [True: 390k, False: 11.3k]
  ------------------
  841|   390k|		(c->type != XML_ATTRIBUTE_DECL) &&
  ------------------
  |  Branch (841:3): [True: 363k, False: 27.0k]
  ------------------
  842|   363k|		(c->type != XML_ENTITY_DECL)) {
  ------------------
  |  Branch (842:3): [True: 343k, False: 20.4k]
  ------------------
  843|   343k|		xmlUnlinkNodeInternal(c);
  844|   343k|		xmlFreeNode(c);
  845|   343k|	    }
  846|   401k|	    c = next;
  847|   401k|	}
  848|  12.3k|    }
  849|       |
  850|  20.1k|    DICT_FREE(cur->name)
  ------------------
  |  |  810|  20.1k|	if ((str) && ((!dict) ||				\
  |  |  ------------------
  |  |  |  Branch (810:6): [True: 19.1k, False: 942]
  |  |  |  Branch (810:16): [True: 8.27k, False: 10.8k]
  |  |  ------------------
  |  |  811|  19.1k|	    (xmlDictOwns(dict, (const xmlChar *)(str)) == 0)))	\
  |  |  ------------------
  |  |  |  Branch (811:6): [True: 10.8k, False: 0]
  |  |  ------------------
  |  |  812|  20.1k|	    xmlFree((char *)(str));
  ------------------
  851|       |
  852|  20.1k|    if (cur->SystemID != NULL)
  ------------------
  |  Branch (852:9): [True: 4.18k, False: 15.9k]
  ------------------
  853|  4.18k|        xmlFree(cur->SystemID);
  854|  20.1k|    if (cur->ExternalID != NULL)
  ------------------
  |  Branch (854:9): [True: 786, False: 19.3k]
  ------------------
  855|    786|        xmlFree(cur->ExternalID);
  856|       |
  857|       |    /* TODO !!! */
  858|  20.1k|    if (cur->notations != NULL)
  ------------------
  |  Branch (858:9): [True: 234, False: 19.8k]
  ------------------
  859|    234|        xmlFreeNotationTable((xmlNotationTablePtr) cur->notations);
  860|       |
  861|  20.1k|    if (cur->elements != NULL)
  ------------------
  |  Branch (861:9): [True: 7.48k, False: 12.6k]
  ------------------
  862|  7.48k|        xmlFreeElementTable((xmlElementTablePtr) cur->elements);
  863|  20.1k|    if (cur->attributes != NULL)
  ------------------
  |  Branch (863:9): [True: 4.65k, False: 15.4k]
  ------------------
  864|  4.65k|        xmlFreeAttributeTable((xmlAttributeTablePtr) cur->attributes);
  865|  20.1k|    if (cur->entities != NULL)
  ------------------
  |  Branch (865:9): [True: 4.57k, False: 15.5k]
  ------------------
  866|  4.57k|        xmlFreeEntitiesTable((xmlEntitiesTablePtr) cur->entities);
  867|  20.1k|    if (cur->pentities != NULL)
  ------------------
  |  Branch (867:9): [True: 3.20k, False: 16.9k]
  ------------------
  868|  3.20k|        xmlFreeEntitiesTable((xmlEntitiesTablePtr) cur->pentities);
  869|       |
  870|  20.1k|    xmlFree(cur);
  871|  20.1k|}
xmlNewDoc:
  880|  43.1k|xmlNewDoc(const xmlChar *version) {
  881|  43.1k|    xmlDocPtr cur;
  882|       |
  883|  43.1k|    if (version == NULL)
  ------------------
  |  Branch (883:9): [True: 521, False: 42.5k]
  ------------------
  884|    521|	version = (const xmlChar *) "1.0";
  885|       |
  886|       |    /*
  887|       |     * Allocate a new document and fill the fields.
  888|       |     */
  889|  43.1k|    cur = (xmlDocPtr) xmlMalloc(sizeof(xmlDoc));
  890|  43.1k|    if (cur == NULL)
  ------------------
  |  Branch (890:9): [True: 7, False: 43.0k]
  ------------------
  891|      7|	return(NULL);
  892|  43.0k|    memset(cur, 0, sizeof(xmlDoc));
  893|  43.0k|    cur->type = XML_DOCUMENT_NODE;
  894|       |
  895|  43.0k|    cur->version = xmlStrdup(version);
  896|  43.0k|    if (cur->version == NULL) {
  ------------------
  |  Branch (896:9): [True: 12, False: 43.0k]
  ------------------
  897|     12|	xmlFree(cur);
  898|     12|	return(NULL);
  899|     12|    }
  900|  43.0k|    cur->standalone = -1;
  901|  43.0k|    cur->compression = -1; /* not initialized */
  902|  43.0k|    cur->doc = cur;
  903|  43.0k|    cur->parseFlags = 0;
  904|  43.0k|    cur->properties = XML_DOC_USERBUILT;
  905|       |    /*
  906|       |     * The in memory encoding is always UTF8
  907|       |     * This field will never change and would
  908|       |     * be obsolete if not for binary compatibility.
  909|       |     */
  910|  43.0k|    cur->charset = XML_CHAR_ENCODING_UTF8;
  911|       |
  912|  43.0k|    if ((xmlRegisterCallbacks) && (xmlRegisterNodeDefaultValue))
  ------------------
  |  |  932|      0|    (*__xmlRegisterNodeDefaultValue())
  ------------------
  |  Branch (912:9): [True: 0, False: 43.0k]
  |  Branch (912:35): [True: 0, False: 0]
  ------------------
  913|      0|	xmlRegisterNodeDefaultValue((xmlNodePtr)cur);
  ------------------
  |  |  932|      0|    (*__xmlRegisterNodeDefaultValue())
  ------------------
  914|  43.0k|    return(cur);
  915|  43.0k|}
xmlFreeDoc:
  923|  12.7k|xmlFreeDoc(xmlDoc *cur) {
  924|  12.7k|    xmlDtdPtr extSubset, intSubset;
  925|  12.7k|    xmlDictPtr dict = NULL;
  926|       |
  927|  12.7k|    if (cur == NULL) {
  ------------------
  |  Branch (927:9): [True: 1.56k, False: 11.1k]
  ------------------
  928|  1.56k|	return;
  929|  1.56k|    }
  930|       |
  931|  11.1k|    dict = cur->dict;
  932|       |
  933|  11.1k|    if ((xmlRegisterCallbacks) && (xmlDeregisterNodeDefaultValue))
  ------------------
  |  |  934|      0|    (*__xmlDeregisterNodeDefaultValue())
  ------------------
  |  Branch (933:9): [True: 0, False: 11.1k]
  |  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|  11.1k|    if (cur->ids != NULL) xmlFreeIDTable((xmlIDTablePtr) cur->ids);
  ------------------
  |  Branch (939:9): [True: 217, False: 10.9k]
  ------------------
  940|  11.1k|    cur->ids = NULL;
  941|  11.1k|    if (cur->refs != NULL) xmlFreeRefTable((xmlRefTablePtr) cur->refs);
  ------------------
  |  Branch (941:9): [True: 275, False: 10.9k]
  ------------------
  942|  11.1k|    cur->refs = NULL;
  943|  11.1k|    extSubset = cur->extSubset;
  944|  11.1k|    intSubset = cur->intSubset;
  945|  11.1k|    if (intSubset == extSubset)
  ------------------
  |  Branch (945:9): [True: 7.05k, False: 4.11k]
  ------------------
  946|  7.05k|	extSubset = NULL;
  947|  11.1k|    if (extSubset != NULL) {
  ------------------
  |  Branch (947:9): [True: 185, False: 10.9k]
  ------------------
  948|    185|	xmlUnlinkNodeInternal((xmlNodePtr) cur->extSubset);
  949|    185|	cur->extSubset = NULL;
  950|    185|	xmlFreeDtd(extSubset);
  951|    185|    }
  952|  11.1k|    if (intSubset != NULL) {
  ------------------
  |  Branch (952:9): [True: 4.13k, False: 7.03k]
  ------------------
  953|  4.13k|	xmlUnlinkNodeInternal((xmlNodePtr) cur->intSubset);
  954|  4.13k|	cur->intSubset = NULL;
  955|  4.13k|	xmlFreeDtd(intSubset);
  956|  4.13k|    }
  957|       |
  958|  11.1k|    if (cur->children != NULL) xmlFreeNodeList(cur->children);
  ------------------
  |  Branch (958:9): [True: 10.5k, False: 622]
  ------------------
  959|  11.1k|    if (cur->oldNs != NULL) xmlFreeNsList(cur->oldNs);
  ------------------
  |  Branch (959:9): [True: 1.47k, False: 9.70k]
  ------------------
  960|       |
  961|  11.1k|    DICT_FREE(cur->name)
  ------------------
  |  |  810|  11.1k|	if ((str) && ((!dict) ||				\
  |  |  ------------------
  |  |  |  Branch (810:6): [True: 0, False: 11.1k]
  |  |  |  Branch (810:16): [True: 0, False: 0]
  |  |  ------------------
  |  |  811|      0|	    (xmlDictOwns(dict, (const xmlChar *)(str)) == 0)))	\
  |  |  ------------------
  |  |  |  Branch (811:6): [True: 0, False: 0]
  |  |  ------------------
  |  |  812|  11.1k|	    xmlFree((char *)(str));
  ------------------
  962|       |
  963|  11.1k|    if (cur->version != NULL)
  ------------------
  |  Branch (963:9): [True: 11.1k, False: 0]
  ------------------
  964|  11.1k|        xmlFree(cur->version);
  965|  11.1k|    if (cur->encoding != NULL)
  ------------------
  |  Branch (965:9): [True: 96, False: 11.0k]
  ------------------
  966|     96|        xmlFree(cur->encoding);
  967|  11.1k|    if (cur->URL != NULL)
  ------------------
  |  Branch (967:9): [True: 7.60k, False: 3.57k]
  ------------------
  968|  7.60k|        xmlFree(cur->URL);
  969|       |
  970|  11.1k|    xmlFree(cur);
  971|  11.1k|    if (dict) xmlDictFree(dict);
  ------------------
  |  Branch (971:9): [True: 5.81k, False: 5.36k]
  ------------------
  972|  11.1k|}
xmlNodeParseAttValue:
  998|  89.8k|                     const xmlChar *value, size_t len, xmlNode **listPtr) {
  999|  89.8k|    xmlNodePtr head = NULL, last = NULL;
 1000|  89.8k|    xmlNodePtr node;
 1001|  89.8k|    xmlChar *val = NULL;
 1002|  89.8k|    const xmlChar *cur;
 1003|  89.8k|    const xmlChar *q;
 1004|  89.8k|    xmlEntityPtr ent;
 1005|  89.8k|    xmlBufPtr buf;
 1006|  89.8k|    size_t remaining = len;
 1007|       |
 1008|  89.8k|    if (listPtr != NULL)
  ------------------
  |  Branch (1008:9): [True: 0, False: 89.8k]
  ------------------
 1009|      0|        *listPtr = NULL;
 1010|       |
 1011|  89.8k|    if ((value == NULL) || (value[0] == 0))
  ------------------
  |  Branch (1011:9): [True: 0, False: 89.8k]
  |  Branch (1011:28): [True: 4.23k, False: 85.6k]
  ------------------
 1012|  4.23k|        goto done;
 1013|       |
 1014|  85.6k|    cur = value;
 1015|       |
 1016|  85.6k|    buf = xmlBufCreate(50);
 1017|  85.6k|    if (buf == NULL)
  ------------------
  |  Branch (1017:9): [True: 33, False: 85.6k]
  ------------------
 1018|     33|        return(-1);
 1019|       |
 1020|  85.6k|    q = cur;
 1021|  91.7M|    while ((remaining > 0) && (*cur != 0)) {
  ------------------
  |  Branch (1021:12): [True: 91.6M, False: 51.1k]
  |  Branch (1021:31): [True: 91.6M, False: 34.3k]
  ------------------
 1022|  91.6M|	if (cur[0] == '&') {
  ------------------
  |  Branch (1022:6): [True: 32.9k, False: 91.6M]
  ------------------
 1023|  32.9k|	    int charval = 0;
 1024|       |
 1025|       |	    /*
 1026|       |	     * Save the current text.
 1027|       |	     */
 1028|  32.9k|            if (cur != q) {
  ------------------
  |  Branch (1028:17): [True: 20.7k, False: 12.1k]
  ------------------
 1029|  20.7k|		if (xmlBufAdd(buf, q, cur - q))
  ------------------
  |  Branch (1029:7): [True: 3, False: 20.7k]
  ------------------
 1030|      3|		    goto out;
 1031|  20.7k|	        q = cur;
 1032|  20.7k|	    }
 1033|       |
 1034|  32.9k|	    if ((remaining > 2) && (cur[1] == '#') && (cur[2] == 'x')) {
  ------------------
  |  Branch (1034:10): [True: 32.9k, False: 0]
  |  Branch (1034:29): [True: 14.2k, False: 18.6k]
  |  Branch (1034:48): [True: 4.14k, False: 10.1k]
  ------------------
 1035|  4.14k|	        int tmp = 0;
 1036|       |
 1037|  4.14k|		cur += 3;
 1038|  4.14k|                remaining -= 3;
 1039|  17.3k|		while ((remaining > 0) && ((tmp = *cur) != ';')) {
  ------------------
  |  Branch (1039:10): [True: 17.3k, False: 0]
  |  Branch (1039:29): [True: 13.2k, False: 4.14k]
  ------------------
 1040|  13.2k|		    if ((tmp >= '0') && (tmp <= '9'))
  ------------------
  |  Branch (1040:11): [True: 13.2k, False: 0]
  |  Branch (1040:27): [True: 710, False: 12.5k]
  ------------------
 1041|    710|			charval = charval * 16 + (tmp - '0');
 1042|  12.5k|		    else if ((tmp >= 'a') && (tmp <= 'f'))
  ------------------
  |  Branch (1042:16): [True: 3.88k, False: 8.63k]
  |  Branch (1042:32): [True: 3.88k, False: 0]
  ------------------
 1043|  3.88k|			charval = charval * 16 + (tmp - 'a') + 10;
 1044|  8.63k|		    else if ((tmp >= 'A') && (tmp <= 'F'))
  ------------------
  |  Branch (1044:16): [True: 8.63k, False: 0]
  |  Branch (1044:32): [True: 8.63k, False: 0]
  ------------------
 1045|  8.63k|			charval = charval * 16 + (tmp - 'A') + 10;
 1046|      0|		    else {
 1047|      0|			charval = 0;
 1048|      0|			break;
 1049|      0|		    }
 1050|  13.2k|                    if (charval > 0x110000)
  ------------------
  |  Branch (1050:25): [True: 0, False: 13.2k]
  ------------------
 1051|      0|                        charval = 0x110000;
 1052|  13.2k|		    cur++;
 1053|  13.2k|                    remaining--;
 1054|  13.2k|		}
 1055|  4.14k|		if (tmp == ';') {
  ------------------
  |  Branch (1055:7): [True: 4.14k, False: 0]
  ------------------
 1056|  4.14k|		    cur++;
 1057|  4.14k|                    remaining--;
 1058|  4.14k|                }
 1059|  4.14k|		q = cur;
 1060|  28.7k|	    } else if ((remaining > 1) && (cur[1] == '#')) {
  ------------------
  |  Branch (1060:17): [True: 28.7k, False: 0]
  |  Branch (1060:36): [True: 10.1k, False: 18.6k]
  ------------------
 1061|  10.1k|	        int tmp = 0;
 1062|       |
 1063|  10.1k|		cur += 2;
 1064|  10.1k|                remaining -= 2;
 1065|  30.4k|		while ((remaining > 0) && ((tmp = *cur) != ';')) {
  ------------------
  |  Branch (1065:10): [True: 30.4k, False: 0]
  |  Branch (1065:29): [True: 20.2k, False: 10.1k]
  ------------------
 1066|  20.2k|		    if ((tmp >= '0') && (tmp <= '9'))
  ------------------
  |  Branch (1066:11): [True: 20.2k, False: 0]
  |  Branch (1066:27): [True: 20.2k, False: 0]
  ------------------
 1067|  20.2k|			charval = charval * 10 + (tmp - '0');
 1068|      0|		    else {
 1069|      0|			charval = 0;
 1070|      0|			break;
 1071|      0|		    }
 1072|  20.2k|                    if (charval > 0x110000)
  ------------------
  |  Branch (1072:25): [True: 0, False: 20.2k]
  ------------------
 1073|      0|                        charval = 0x110000;
 1074|  20.2k|		    cur++;
 1075|  20.2k|                    remaining--;
 1076|  20.2k|		}
 1077|  10.1k|		if (tmp == ';') {
  ------------------
  |  Branch (1077:7): [True: 10.1k, False: 0]
  ------------------
 1078|  10.1k|		    cur++;
 1079|  10.1k|                    remaining--;
 1080|  10.1k|                }
 1081|  10.1k|		q = cur;
 1082|  18.6k|	    } else {
 1083|       |		/*
 1084|       |		 * Read the entity string
 1085|       |		 */
 1086|  18.6k|		cur++;
 1087|  18.6k|                remaining--;
 1088|  18.6k|		q = cur;
 1089|   110k|		while ((remaining > 0) && (*cur != 0) && (*cur != ';')) {
  ------------------
  |  Branch (1089:10): [True: 110k, False: 0]
  |  Branch (1089:29): [True: 110k, False: 0]
  |  Branch (1089:44): [True: 91.8k, False: 18.6k]
  ------------------
 1090|  91.8k|                    cur++;
 1091|  91.8k|                    remaining--;
 1092|  91.8k|                }
 1093|  18.6k|		if ((remaining <= 0) || (*cur == 0))
  ------------------
  |  Branch (1093:7): [True: 0, False: 18.6k]
  |  Branch (1093:27): [True: 0, False: 18.6k]
  ------------------
 1094|      0|		    break;
 1095|  18.6k|		if (cur != q) {
  ------------------
  |  Branch (1095:7): [True: 18.6k, False: 0]
  ------------------
 1096|  18.6k|		    val = xmlStrndup(q, cur - q);
 1097|  18.6k|                    if (val == NULL)
  ------------------
  |  Branch (1097:25): [True: 10, False: 18.6k]
  ------------------
 1098|     10|                        goto out;
 1099|  18.6k|		    ent = xmlGetDocEntity(doc, val);
 1100|  18.6k|		    if ((ent != NULL) &&
  ------------------
  |  Branch (1100:11): [True: 14.2k, False: 4.33k]
  ------------------
 1101|  14.2k|			(ent->etype == XML_INTERNAL_PREDEFINED_ENTITY)) {
  ------------------
  |  Branch (1101:4): [True: 292, False: 14.0k]
  ------------------
 1102|       |                        /*
 1103|       |                         * Predefined entities don't generate nodes
 1104|       |                         */
 1105|    292|			if (xmlBufCat(buf, ent->content))
  ------------------
  |  Branch (1105:8): [True: 0, False: 292]
  ------------------
 1106|      0|			    goto out;
 1107|  18.3k|                    } else if (ent == NULL ||
  ------------------
  |  Branch (1107:32): [True: 4.33k, False: 14.0k]
  ------------------
 1108|  18.3k|                               (ent->flags & XML_ENT_EXPANDING) == 0) {
  ------------------
  |  |   22|  14.0k|#define XML_ENT_EXPANDING   (1u << 3)
  ------------------
  |  Branch (1108:32): [True: 14.0k, False: 0]
  ------------------
 1109|       |			/*
 1110|       |			 * Flush buffer so far
 1111|       |			 */
 1112|  18.3k|			if (!xmlBufIsEmpty(buf)) {
  ------------------
  |  Branch (1112:8): [True: 11.4k, False: 6.92k]
  ------------------
 1113|  11.4k|			    node = xmlNewDocText(doc, NULL);
 1114|  11.4k|			    if (node == NULL)
  ------------------
  |  Branch (1114:12): [True: 5, False: 11.4k]
  ------------------
 1115|      5|				goto out;
 1116|  11.4k|			    node->content = xmlBufDetach(buf);
 1117|  11.4k|                            node->parent = (xmlNode *) attr;
 1118|       |
 1119|  11.4k|			    if (last == NULL) {
  ------------------
  |  Branch (1119:12): [True: 823, False: 10.5k]
  ------------------
 1120|    823|				head = node;
 1121|  10.5k|			    } else {
 1122|  10.5k|                                last->next = node;
 1123|  10.5k|                                node->prev = last;
 1124|  10.5k|			    }
 1125|  11.4k|                            last = node;
 1126|  11.4k|			}
 1127|       |
 1128|  18.3k|			if ((ent != NULL) &&
  ------------------
  |  Branch (1128:8): [True: 14.0k, False: 4.32k]
  ------------------
 1129|  14.0k|                            ((ent->flags & XML_ENT_PARSED) == 0) &&
  ------------------
  |  |   19|  14.0k|#define XML_ENT_PARSED      (1u << 0)
  ------------------
  |  Branch (1129:29): [True: 890, False: 13.1k]
  ------------------
 1130|    890|                            (ent->content != NULL)) {
  ------------------
  |  Branch (1130:29): [True: 809, False: 81]
  ------------------
 1131|    809|                            int res;
 1132|       |
 1133|    809|                            ent->flags |= XML_ENT_EXPANDING;
  ------------------
  |  |   22|    809|#define XML_ENT_EXPANDING   (1u << 3)
  ------------------
 1134|    809|                            res = xmlNodeParseAttValue(doc, (xmlAttr *) ent,
 1135|    809|                                                       ent->content, SIZE_MAX,
 1136|    809|                                                       NULL);
 1137|    809|                            ent->flags &= ~XML_ENT_EXPANDING;
  ------------------
  |  |   22|    809|#define XML_ENT_EXPANDING   (1u << 3)
  ------------------
 1138|    809|                            if (res < 0)
  ------------------
  |  Branch (1138:33): [True: 106, False: 703]
  ------------------
 1139|    106|                                goto out;
 1140|    703|                            ent->flags |= XML_ENT_PARSED;
  ------------------
  |  |   19|    703|#define XML_ENT_PARSED      (1u << 0)
  ------------------
 1141|    703|			}
 1142|       |
 1143|       |			/*
 1144|       |			 * Create a new REFERENCE_REF node
 1145|       |			 */
 1146|  18.2k|			node = xmlNewEntityRef((xmlDocPtr) doc, val);
 1147|  18.2k|                        val = NULL;
 1148|  18.2k|			if (node == NULL)
  ------------------
  |  Branch (1148:8): [True: 5, False: 18.2k]
  ------------------
 1149|      5|			    goto out;
 1150|  18.2k|                        node->parent = (xmlNode *) attr;
 1151|  18.2k|                        node->last = (xmlNodePtr) ent;
 1152|  18.2k|                        if (ent != NULL) {
  ------------------
  |  Branch (1152:29): [True: 13.8k, False: 4.32k]
  ------------------
 1153|  13.8k|                            node->children = (xmlNodePtr) ent;
 1154|  13.8k|                            node->content = ent->content;
 1155|  13.8k|                        }
 1156|       |
 1157|  18.2k|			if (last == NULL) {
  ------------------
  |  Branch (1157:8): [True: 1.79k, False: 16.4k]
  ------------------
 1158|  1.79k|			    head = node;
 1159|  16.4k|			} else {
 1160|  16.4k|                            last->next = node;
 1161|  16.4k|                            node->prev = last;
 1162|  16.4k|			}
 1163|  18.2k|                        last = node;
 1164|  18.2k|		    }
 1165|  18.5k|		    xmlFree(val);
 1166|  18.5k|                    val = NULL;
 1167|  18.5k|		}
 1168|  18.5k|		cur++;
 1169|  18.5k|                remaining--;
 1170|  18.5k|		q = cur;
 1171|  18.5k|	    }
 1172|  32.7k|	    if (charval != 0) {
  ------------------
  |  Branch (1172:10): [True: 14.2k, False: 18.5k]
  ------------------
 1173|  14.2k|		xmlChar buffer[10];
 1174|  14.2k|		int l;
 1175|       |
 1176|  14.2k|                if (charval >= 0x110000)
  ------------------
  |  Branch (1176:21): [True: 0, False: 14.2k]
  ------------------
 1177|      0|                    charval = 0xFFFD; /* replacement character */
 1178|       |
 1179|  14.2k|		l = xmlCopyCharMultiByte(buffer, charval);
 1180|  14.2k|		buffer[l] = 0;
 1181|       |
 1182|  14.2k|		if (xmlBufCat(buf, buffer))
  ------------------
  |  Branch (1182:7): [True: 1, False: 14.2k]
  ------------------
 1183|      1|		    goto out;
 1184|  14.2k|	    }
 1185|  91.6M|	} else {
 1186|  91.6M|	    cur++;
 1187|  91.6M|            remaining--;
 1188|  91.6M|        }
 1189|  91.6M|    }
 1190|       |
 1191|  85.4k|    if (cur != q) {
  ------------------
  |  Branch (1191:9): [True: 83.3k, False: 2.09k]
  ------------------
 1192|       |        /*
 1193|       |	 * Handle the last piece of text.
 1194|       |	 */
 1195|  83.3k|	if (xmlBufAdd(buf, q, cur - q))
  ------------------
  |  Branch (1195:6): [True: 4, False: 83.3k]
  ------------------
 1196|      4|	    goto out;
 1197|  83.3k|    }
 1198|       |
 1199|  85.4k|    if (!xmlBufIsEmpty(buf)) {
  ------------------
  |  Branch (1199:9): [True: 84.2k, False: 1.21k]
  ------------------
 1200|  84.2k|	node = xmlNewDocText(doc, NULL);
 1201|  84.2k|	if (node == NULL)
  ------------------
  |  Branch (1201:6): [True: 20, False: 84.2k]
  ------------------
 1202|     20|            goto out;
 1203|  84.2k|        node->parent = (xmlNode *) attr;
 1204|  84.2k|	node->content = xmlBufDetach(buf);
 1205|       |
 1206|  84.2k|	if (last == NULL) {
  ------------------
  |  Branch (1206:6): [True: 82.8k, False: 1.35k]
  ------------------
 1207|  82.8k|	    head = node;
 1208|  82.8k|	} else {
 1209|  1.35k|            last->next = node;
 1210|  1.35k|            node->prev = last;
 1211|  1.35k|	}
 1212|  84.2k|        last = node;
 1213|  84.2k|    } else if (head == NULL) {
  ------------------
  |  Branch (1213:16): [True: 0, False: 1.21k]
  ------------------
 1214|      0|        head = xmlNewDocText(doc, BAD_CAST "");
  ------------------
  |  |   34|      0|#define BAD_CAST (xmlChar *)
  ------------------
 1215|      0|        if (head == NULL)
  ------------------
  |  Branch (1215:13): [True: 0, False: 0]
  ------------------
 1216|      0|            goto out;
 1217|      0|        head->parent = (xmlNode *) attr;
 1218|      0|        last = head;
 1219|      0|    }
 1220|       |
 1221|  85.4k|    xmlBufFree(buf);
 1222|       |
 1223|  89.6k|done:
 1224|  89.6k|    if (attr != NULL) {
  ------------------
  |  Branch (1224:9): [True: 89.6k, False: 0]
  ------------------
 1225|  89.6k|        if (attr->children != NULL)
  ------------------
  |  Branch (1225:13): [True: 0, False: 89.6k]
  ------------------
 1226|      0|            xmlFreeNodeList(attr->children);
 1227|  89.6k|        attr->children = head;
 1228|  89.6k|        attr->last = last;
 1229|  89.6k|    }
 1230|       |
 1231|  89.6k|    if (listPtr != NULL)
  ------------------
  |  Branch (1231:9): [True: 0, False: 89.6k]
  ------------------
 1232|      0|        *listPtr = head;
 1233|       |
 1234|  89.6k|    return(0);
 1235|       |
 1236|    154|out:
 1237|    154|    xmlBufFree(buf);
 1238|    154|    if (val != NULL)
  ------------------
  |  Branch (1238:9): [True: 111, False: 43]
  ------------------
 1239|    111|        xmlFree(val);
 1240|    154|    if (head != NULL)
  ------------------
  |  Branch (1240:9): [True: 51, False: 103]
  ------------------
 1241|     51|        xmlFreeNodeList(head);
 1242|    154|    return(-1);
 1243|  85.4k|}
xmlNodeListGetStringInternal:
 1297|  1.28k|xmlNodeListGetStringInternal(const xmlNode *node, int escape, int flags) {
 1298|  1.28k|    xmlBufPtr buf;
 1299|  1.28k|    xmlChar *ret;
 1300|       |
 1301|  1.28k|    if (node == NULL)
  ------------------
  |  Branch (1301:9): [True: 0, False: 1.28k]
  ------------------
 1302|      0|        return(xmlStrdup(BAD_CAST ""));
  ------------------
  |  |   34|      0|#define BAD_CAST (xmlChar *)
  ------------------
 1303|       |
 1304|  1.28k|    if ((escape == 0) &&
  ------------------
  |  Branch (1304:9): [True: 1.28k, False: 0]
  ------------------
 1305|  1.28k|        ((node->type == XML_TEXT_NODE) ||
  ------------------
  |  Branch (1305:10): [True: 1.07k, False: 209]
  ------------------
 1306|    209|         (node->type == XML_CDATA_SECTION_NODE)) &&
  ------------------
  |  Branch (1306:10): [True: 0, False: 209]
  ------------------
 1307|  1.07k|        (node->next == NULL)) {
  ------------------
  |  Branch (1307:9): [True: 681, False: 394]
  ------------------
 1308|    681|        if (node->content == NULL)
  ------------------
  |  Branch (1308:13): [True: 0, False: 681]
  ------------------
 1309|      0|            return(xmlStrdup(BAD_CAST ""));
  ------------------
  |  |   34|      0|#define BAD_CAST (xmlChar *)
  ------------------
 1310|    681|        return(xmlStrdup(node->content));
 1311|    681|    }
 1312|       |
 1313|    603|    buf = xmlBufCreate(50);
 1314|    603|    if (buf == NULL)
  ------------------
  |  Branch (1314:9): [True: 5, False: 598]
  ------------------
 1315|      5|        return(NULL);
 1316|       |
 1317|  2.08k|    while (node != NULL) {
  ------------------
  |  Branch (1317:12): [True: 1.48k, False: 598]
  ------------------
 1318|  1.48k|        if ((node->type == XML_TEXT_NODE) ||
  ------------------
  |  Branch (1318:13): [True: 760, False: 728]
  ------------------
 1319|    760|            (node->type == XML_CDATA_SECTION_NODE)) {
  ------------------
  |  Branch (1319:13): [True: 0, False: 728]
  ------------------
 1320|    760|            if (node->content != NULL) {
  ------------------
  |  Branch (1320:17): [True: 760, False: 0]
  ------------------
 1321|    760|                if (escape == 0) {
  ------------------
  |  Branch (1321:21): [True: 760, False: 0]
  ------------------
 1322|    760|                    xmlBufCat(buf, node->content);
 1323|    760|                } 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|    760|            }
 1333|    760|        } else if (node->type == XML_ENTITY_REF_NODE) {
  ------------------
  |  Branch (1333:20): [True: 728, False: 0]
  ------------------
 1334|    728|            if (escape == 0) {
  ------------------
  |  Branch (1334:17): [True: 728, False: 0]
  ------------------
 1335|    728|                xmlBufGetNodeContent(buf, node);
 1336|    728|            } 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|    728|        }
 1342|       |
 1343|  1.48k|        node = node->next;
 1344|  1.48k|    }
 1345|       |
 1346|    598|    ret = xmlBufDetach(buf);
 1347|    598|    xmlBufFree(buf);
 1348|    598|    return(ret);
 1349|       |
 1350|      0|error:
 1351|      0|    xmlBufFree(buf);
 1352|       |    return(NULL);
 1353|    598|}
xmlNodeListGetString:
 1374|  1.28k|{
 1375|  1.28k|    int flags = 0;
 1376|  1.28k|    int escape = 0;
 1377|       |
 1378|       |    /* backward compatibility */
 1379|  1.28k|    if (list == NULL)
  ------------------
  |  Branch (1379:9): [True: 0, False: 1.28k]
  ------------------
 1380|      0|        return(NULL);
 1381|       |
 1382|  1.28k|    if (!inLine) {
  ------------------
  |  Branch (1382:9): [True: 0, False: 1.28k]
  ------------------
 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.28k|    return(xmlNodeListGetStringInternal(list, escape, flags));
 1396|  1.28k|}
xmlNewNsProp:
 1572|  74.8k|           const xmlChar *value) {
 1573|       |
 1574|  74.8k|    if (name == NULL) {
  ------------------
  |  Branch (1574:9): [True: 0, False: 74.8k]
  ------------------
 1575|      0|	return(NULL);
 1576|      0|    }
 1577|       |
 1578|  74.8k|    return xmlNewPropInternal(node, ns, name, value, 0);
 1579|  74.8k|}
xmlNewDocProp:
 1621|   968k|xmlNewDocProp(xmlDoc *doc, const xmlChar *name, const xmlChar *value) {
 1622|   968k|    xmlAttrPtr cur;
 1623|       |
 1624|   968k|    if (name == NULL) {
  ------------------
  |  Branch (1624:9): [True: 2.08k, False: 966k]
  ------------------
 1625|  2.08k|	return(NULL);
 1626|  2.08k|    }
 1627|       |
 1628|       |    /*
 1629|       |     * Allocate a new property and fill the fields.
 1630|       |     */
 1631|   966k|    cur = (xmlAttrPtr) xmlMalloc(sizeof(xmlAttr));
 1632|   966k|    if (cur == NULL)
  ------------------
  |  Branch (1632:9): [True: 11, False: 966k]
  ------------------
 1633|     11|	return(NULL);
 1634|   966k|    memset(cur, 0, sizeof(xmlAttr));
 1635|   966k|    cur->type = XML_ATTRIBUTE_NODE;
 1636|       |
 1637|   966k|    if ((doc != NULL) && (doc->dict != NULL))
  ------------------
  |  Branch (1637:9): [True: 966k, False: 0]
  |  Branch (1637:26): [True: 810k, False: 155k]
  ------------------
 1638|   810k|	cur->name = xmlDictLookup(doc->dict, name, -1);
 1639|   155k|    else
 1640|   155k|	cur->name = xmlStrdup(name);
 1641|   966k|    if (cur->name == NULL)
  ------------------
  |  Branch (1641:9): [True: 12, False: 966k]
  ------------------
 1642|     12|        goto error;
 1643|   966k|    cur->doc = doc;
 1644|   966k|    if (value != NULL) {
  ------------------
  |  Branch (1644:9): [True: 0, False: 966k]
  ------------------
 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|   966k|    if ((xmlRegisterCallbacks) && (xmlRegisterNodeDefaultValue))
  ------------------
  |  |  932|      0|    (*__xmlRegisterNodeDefaultValue())
  ------------------
  |  Branch (1653:9): [True: 0, False: 966k]
  |  Branch (1653:35): [True: 0, False: 0]
  ------------------
 1654|      0|	xmlRegisterNodeDefaultValue((xmlNodePtr)cur);
  ------------------
  |  |  932|      0|    (*__xmlRegisterNodeDefaultValue())
  ------------------
 1655|   966k|    return(cur);
 1656|       |
 1657|     12|error:
 1658|     12|    xmlFreeProp(cur);
 1659|       |    return(NULL);
 1660|   966k|}
xmlFreePropList:
 1668|   302k|xmlFreePropList(xmlAttr *cur) {
 1669|   302k|    xmlAttrPtr next;
 1670|   302k|    if (cur == NULL) return;
  ------------------
  |  Branch (1670:9): [True: 1.40k, False: 301k]
  ------------------
 1671|   848k|    while (cur != NULL) {
  ------------------
  |  Branch (1671:12): [True: 547k, False: 301k]
  ------------------
 1672|   547k|        next = cur->next;
 1673|   547k|        xmlFreeProp(cur);
 1674|   547k|	cur = next;
 1675|   547k|    }
 1676|   301k|}
xmlFreeProp:
 1684|   548k|xmlFreeProp(xmlAttr *cur) {
 1685|   548k|    xmlDictPtr dict = NULL;
 1686|   548k|    if (cur == NULL) return;
  ------------------
  |  Branch (1686:9): [True: 0, False: 548k]
  ------------------
 1687|       |
 1688|   548k|    if (cur->doc != NULL) dict = cur->doc->dict;
  ------------------
  |  Branch (1688:9): [True: 548k, False: 12]
  ------------------
 1689|       |
 1690|   548k|    if ((xmlRegisterCallbacks) && (xmlDeregisterNodeDefaultValue))
  ------------------
  |  |  934|      0|    (*__xmlDeregisterNodeDefaultValue())
  ------------------
  |  Branch (1690:9): [True: 0, False: 548k]
  |  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|   548k|    if (cur->doc != NULL && cur->id != NULL) {
  ------------------
  |  Branch (1694:9): [True: 548k, False: 12]
  |  Branch (1694:29): [True: 1.96k, False: 546k]
  ------------------
 1695|  1.96k|        xmlRemoveID(cur->doc, cur);
 1696|  1.96k|    }
 1697|   548k|    if (cur->children != NULL) xmlFreeNodeList(cur->children);
  ------------------
  |  Branch (1697:9): [True: 470k, False: 77.7k]
  ------------------
 1698|   548k|    DICT_FREE(cur->name)
  ------------------
  |  |  810|   548k|	if ((str) && ((!dict) ||				\
  |  |  ------------------
  |  |  |  Branch (810:6): [True: 548k, False: 46]
  |  |  |  Branch (810:16): [True: 210k, False: 337k]
  |  |  ------------------
  |  |  811|   548k|	    (xmlDictOwns(dict, (const xmlChar *)(str)) == 0)))	\
  |  |  ------------------
  |  |  |  Branch (811:6): [True: 0, False: 337k]
  |  |  ------------------
  |  |  812|   548k|	    xmlFree((char *)(str));
  ------------------
 1699|   548k|    xmlFree(cur);
 1700|   548k|}
xmlNewDocPI:
 1753|   120k|xmlNewDocPI(xmlDoc *doc, const xmlChar *name, const xmlChar *content) {
 1754|   120k|    xmlNodePtr cur;
 1755|       |
 1756|   120k|    if (name == NULL) {
  ------------------
  |  Branch (1756:9): [True: 0, False: 120k]
  ------------------
 1757|      0|	return(NULL);
 1758|      0|    }
 1759|       |
 1760|       |    /*
 1761|       |     * Allocate a new node and fill the fields.
 1762|       |     */
 1763|   120k|    cur = (xmlNodePtr) xmlMalloc(sizeof(xmlNode));
 1764|   120k|    if (cur == NULL)
  ------------------
  |  Branch (1764:9): [True: 4, False: 120k]
  ------------------
 1765|      4|	return(NULL);
 1766|   120k|    memset(cur, 0, sizeof(xmlNode));
 1767|   120k|    cur->type = XML_PI_NODE;
 1768|   120k|    cur->doc = doc;
 1769|       |
 1770|   120k|    if ((doc != NULL) && (doc->dict != NULL))
  ------------------
  |  Branch (1770:9): [True: 120k, False: 0]
  |  Branch (1770:26): [True: 45.6k, False: 74.4k]
  ------------------
 1771|  45.6k|        cur->name = xmlDictLookup(doc->dict, name, -1);
 1772|  74.4k|    else
 1773|  74.4k|	cur->name = xmlStrdup(name);
 1774|   120k|    if (cur->name == NULL)
  ------------------
  |  Branch (1774:9): [True: 2, False: 120k]
  ------------------
 1775|      2|        goto error;
 1776|   120k|    if (content != NULL) {
  ------------------
  |  Branch (1776:9): [True: 15.7k, False: 104k]
  ------------------
 1777|  15.7k|	cur->content = xmlStrdup(content);
 1778|  15.7k|        if (cur->content == NULL)
  ------------------
  |  Branch (1778:13): [True: 1, False: 15.7k]
  ------------------
 1779|      1|            goto error;
 1780|  15.7k|    }
 1781|       |
 1782|   120k|    if ((xmlRegisterCallbacks) && (xmlRegisterNodeDefaultValue))
  ------------------
  |  |  932|      0|    (*__xmlRegisterNodeDefaultValue())
  ------------------
  |  Branch (1782:9): [True: 0, False: 120k]
  |  Branch (1782:35): [True: 0, False: 0]
  ------------------
 1783|      0|	xmlRegisterNodeDefaultValue((xmlNodePtr)cur);
  ------------------
  |  |  932|      0|    (*__xmlRegisterNodeDefaultValue())
  ------------------
 1784|   120k|    return(cur);
 1785|       |
 1786|      3|error:
 1787|      3|    xmlFreeNode(cur);
 1788|       |    return(NULL);
 1789|   120k|}
xmlNewDocNode:
 1900|   537k|              const xmlChar *name, const xmlChar *content) {
 1901|   537k|    xmlNodePtr cur;
 1902|   537k|    xmlChar *copy;
 1903|       |
 1904|   537k|    if (name == NULL)
  ------------------
  |  Branch (1904:9): [True: 0, False: 537k]
  ------------------
 1905|      0|        return(NULL);
 1906|       |
 1907|   537k|    if ((doc != NULL) && (doc->dict != NULL)) {
  ------------------
  |  Branch (1907:9): [True: 537k, False: 0]
  |  Branch (1907:26): [True: 110k, False: 427k]
  ------------------
 1908|   110k|        const xmlChar *dictName = xmlDictLookup(doc->dict, name, -1);
 1909|       |
 1910|   110k|        if (dictName == NULL)
  ------------------
  |  Branch (1910:13): [True: 1, False: 110k]
  ------------------
 1911|      1|            return(NULL);
 1912|   110k|        return(xmlNewElem(doc, ns, dictName, content));
 1913|   110k|    }
 1914|       |
 1915|   427k|    copy = xmlStrdup(name);
 1916|   427k|    if (copy == NULL)
  ------------------
  |  Branch (1916:9): [True: 41, False: 427k]
  ------------------
 1917|     41|        return(NULL);
 1918|       |
 1919|   427k|    cur = xmlNewElem(doc, ns, copy, content);
 1920|   427k|    if (cur == NULL) {
  ------------------
  |  Branch (1920:9): [True: 39, False: 427k]
  ------------------
 1921|     39|        xmlFree(copy);
 1922|     39|        return(NULL);
 1923|     39|    }
 1924|       |
 1925|   427k|    return(cur);
 1926|   427k|}
xmlNewDocNodeEatName:
 1944|   252k|                     xmlChar *name, const xmlChar *content) {
 1945|   252k|    xmlNodePtr cur;
 1946|       |
 1947|   252k|    if (name == NULL)
  ------------------
  |  Branch (1947:9): [True: 0, False: 252k]
  ------------------
 1948|      0|        return(NULL);
 1949|       |
 1950|   252k|    cur = xmlNewElem(doc, ns, name, content);
 1951|   252k|    if (cur == NULL) {
  ------------------
  |  Branch (1951:9): [True: 35, False: 252k]
  ------------------
 1952|       |        /* if name doesn't come from the doc dictionary free it here */
 1953|     35|        if ((doc == NULL) ||
  ------------------
  |  Branch (1953:13): [True: 0, False: 35]
  ------------------
 1954|     35|            (doc->dict == NULL) ||
  ------------------
  |  Branch (1954:13): [True: 2, False: 33]
  ------------------
 1955|     33|            (!xmlDictOwns(doc->dict, name)))
  ------------------
  |  Branch (1955:13): [True: 0, False: 33]
  ------------------
 1956|      2|            xmlFree(name);
 1957|     35|        return(NULL);
 1958|     35|    }
 1959|       |
 1960|   252k|    return(cur);
 1961|   252k|}
xmlNewText:
 2037|   134k|xmlNewText(const xmlChar *content) {
 2038|   134k|    xmlNodePtr cur;
 2039|       |
 2040|       |    /*
 2041|       |     * Allocate a new node and fill the fields.
 2042|       |     */
 2043|   134k|    cur = (xmlNodePtr) xmlMalloc(sizeof(xmlNode));
 2044|   134k|    if (cur == NULL)
  ------------------
  |  Branch (2044:9): [True: 47, False: 134k]
  ------------------
 2045|     47|	return(NULL);
 2046|   134k|    memset(cur, 0, sizeof(xmlNode));
 2047|   134k|    cur->type = XML_TEXT_NODE;
 2048|       |
 2049|   134k|    cur->name = xmlStringText;
 2050|   134k|    if (content != NULL) {
  ------------------
  |  Branch (2050:9): [True: 38.8k, False: 95.8k]
  ------------------
 2051|  38.8k|	cur->content = xmlStrdup(content);
 2052|  38.8k|        if (cur->content == NULL)
  ------------------
  |  Branch (2052:13): [True: 22, False: 38.7k]
  ------------------
 2053|     22|            goto error;
 2054|  38.8k|    }
 2055|       |
 2056|   134k|    if ((xmlRegisterCallbacks) && (xmlRegisterNodeDefaultValue))
  ------------------
  |  |  932|      0|    (*__xmlRegisterNodeDefaultValue())
  ------------------
  |  Branch (2056:9): [True: 0, False: 134k]
  |  Branch (2056:35): [True: 0, False: 0]
  ------------------
 2057|      0|	xmlRegisterNodeDefaultValue(cur);
  ------------------
  |  |  932|      0|    (*__xmlRegisterNodeDefaultValue())
  ------------------
 2058|   134k|    return(cur);
 2059|       |
 2060|     22|error:
 2061|     22|    xmlFreeNode(cur);
 2062|       |    return(NULL);
 2063|   134k|}
xmlNewReference:
 2209|  32.4k|xmlNewReference(const xmlDoc *doc, const xmlChar *name) {
 2210|  32.4k|    xmlNodePtr cur;
 2211|  32.4k|    xmlEntityPtr ent;
 2212|       |
 2213|  32.4k|    if (name == NULL)
  ------------------
  |  Branch (2213:9): [True: 0, False: 32.4k]
  ------------------
 2214|      0|        return(NULL);
 2215|       |
 2216|       |    /*
 2217|       |     * Allocate a new node and fill the fields.
 2218|       |     */
 2219|  32.4k|    cur = (xmlNodePtr) xmlMalloc(sizeof(xmlNode));
 2220|  32.4k|    if (cur == NULL)
  ------------------
  |  Branch (2220:9): [True: 3, False: 32.4k]
  ------------------
 2221|      3|	return(NULL);
 2222|  32.4k|    memset(cur, 0, sizeof(xmlNode));
 2223|  32.4k|    cur->type = XML_ENTITY_REF_NODE;
 2224|       |
 2225|  32.4k|    cur->doc = (xmlDoc *)doc;
 2226|  32.4k|    if (name[0] == '&') {
  ------------------
  |  Branch (2226:9): [True: 0, False: 32.4k]
  ------------------
 2227|      0|        int len;
 2228|      0|        name++;
 2229|      0|	len = xmlStrlen(name);
 2230|      0|	if (name[len - 1] == ';')
  ------------------
  |  Branch (2230:6): [True: 0, False: 0]
  ------------------
 2231|      0|	    cur->name = xmlStrndup(name, len - 1);
 2232|      0|	else
 2233|      0|	    cur->name = xmlStrndup(name, len);
 2234|      0|    } else
 2235|  32.4k|	cur->name = xmlStrdup(name);
 2236|  32.4k|    if (cur->name == NULL)
  ------------------
  |  Branch (2236:9): [True: 6, False: 32.4k]
  ------------------
 2237|      6|        goto error;
 2238|       |
 2239|  32.4k|    ent = xmlGetDocEntity(doc, cur->name);
 2240|  32.4k|    if (ent != NULL) {
  ------------------
  |  Branch (2240:9): [True: 5.64k, False: 26.8k]
  ------------------
 2241|  5.64k|	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|  5.64k|	cur->children = (xmlNodePtr) ent;
 2248|  5.64k|	cur->last = (xmlNodePtr) ent;
 2249|  5.64k|    }
 2250|       |
 2251|  32.4k|    if ((xmlRegisterCallbacks) && (xmlRegisterNodeDefaultValue))
  ------------------
  |  |  932|      0|    (*__xmlRegisterNodeDefaultValue())
  ------------------
  |  Branch (2251:9): [True: 0, False: 32.4k]
  |  Branch (2251:35): [True: 0, False: 0]
  ------------------
 2252|      0|	xmlRegisterNodeDefaultValue(cur);
  ------------------
  |  |  932|      0|    (*__xmlRegisterNodeDefaultValue())
  ------------------
 2253|  32.4k|    return(cur);
 2254|       |
 2255|      6|error:
 2256|      6|    xmlFreeNode(cur);
 2257|       |    return(NULL);
 2258|  32.4k|}
xmlNewDocText:
 2269|   134k|xmlNewDocText(const xmlDoc *doc, const xmlChar *content) {
 2270|   134k|    xmlNodePtr cur;
 2271|       |
 2272|   134k|    cur = xmlNewText(content);
 2273|   134k|    if (cur != NULL) cur->doc = (xmlDoc *)doc;
  ------------------
  |  Branch (2273:9): [True: 134k, False: 69]
  ------------------
 2274|   134k|    return(cur);
 2275|   134k|}
xmlNewComment:
 2342|   476k|xmlNewComment(const xmlChar *content) {
 2343|   476k|    xmlNodePtr cur;
 2344|       |
 2345|       |    /*
 2346|       |     * Allocate a new node and fill the fields.
 2347|       |     */
 2348|   476k|    cur = (xmlNodePtr) xmlMalloc(sizeof(xmlNode));
 2349|   476k|    if (cur == NULL)
  ------------------
  |  Branch (2349:9): [True: 7, False: 476k]
  ------------------
 2350|      7|	return(NULL);
 2351|   476k|    memset(cur, 0, sizeof(xmlNode));
 2352|   476k|    cur->type = XML_COMMENT_NODE;
 2353|       |
 2354|   476k|    cur->name = xmlStringComment;
 2355|   476k|    if (content != NULL) {
  ------------------
  |  Branch (2355:9): [True: 476k, False: 0]
  ------------------
 2356|   476k|	cur->content = xmlStrdup(content);
 2357|   476k|        if (cur->content == NULL)
  ------------------
  |  Branch (2357:13): [True: 3, False: 476k]
  ------------------
 2358|      3|            goto error;
 2359|   476k|    }
 2360|       |
 2361|   476k|    if ((xmlRegisterCallbacks) && (xmlRegisterNodeDefaultValue))
  ------------------
  |  |  932|      0|    (*__xmlRegisterNodeDefaultValue())
  ------------------
  |  Branch (2361:9): [True: 0, False: 476k]
  |  Branch (2361:35): [True: 0, False: 0]
  ------------------
 2362|      0|	xmlRegisterNodeDefaultValue(cur);
  ------------------
  |  |  932|      0|    (*__xmlRegisterNodeDefaultValue())
  ------------------
 2363|   476k|    return(cur);
 2364|       |
 2365|      3|error:
 2366|      3|    xmlFreeNode(cur);
 2367|       |    return(NULL);
 2368|   476k|}
xmlNewCDataBlock:
 2380|  34.0k|xmlNewCDataBlock(xmlDoc *doc, const xmlChar *content, int len) {
 2381|  34.0k|    xmlNodePtr cur;
 2382|       |
 2383|       |    /*
 2384|       |     * Allocate a new node and fill the fields.
 2385|       |     */
 2386|  34.0k|    cur = (xmlNodePtr) xmlMalloc(sizeof(xmlNode));
 2387|  34.0k|    if (cur == NULL)
  ------------------
  |  Branch (2387:9): [True: 1, False: 34.0k]
  ------------------
 2388|      1|	return(NULL);
 2389|  34.0k|    memset(cur, 0, sizeof(xmlNode));
 2390|  34.0k|    cur->type = XML_CDATA_SECTION_NODE;
 2391|  34.0k|    cur->doc = doc;
 2392|       |
 2393|  34.0k|    if (content != NULL) {
  ------------------
  |  Branch (2393:9): [True: 34.0k, False: 0]
  ------------------
 2394|  34.0k|	cur->content = xmlStrndup(content, len);
 2395|  34.0k|        if (cur->content == NULL) {
  ------------------
  |  Branch (2395:13): [True: 4, False: 34.0k]
  ------------------
 2396|      4|            xmlFree(cur);
 2397|      4|            return(NULL);
 2398|      4|        }
 2399|  34.0k|    }
 2400|       |
 2401|  34.0k|    if ((xmlRegisterCallbacks) && (xmlRegisterNodeDefaultValue))
  ------------------
  |  |  932|      0|    (*__xmlRegisterNodeDefaultValue())
  ------------------
  |  Branch (2401:9): [True: 0, False: 34.0k]
  |  Branch (2401:35): [True: 0, False: 0]
  ------------------
 2402|      0|	xmlRegisterNodeDefaultValue(cur);
  ------------------
  |  |  932|      0|    (*__xmlRegisterNodeDefaultValue())
  ------------------
 2403|  34.0k|    return(cur);
 2404|  34.0k|}
xmlNewDocComment:
 2415|   476k|xmlNewDocComment(xmlDoc *doc, const xmlChar *content) {
 2416|   476k|    xmlNodePtr cur;
 2417|       |
 2418|   476k|    cur = xmlNewComment(content);
 2419|   476k|    if (cur != NULL) cur->doc = doc;
  ------------------
  |  Branch (2419:9): [True: 476k, False: 10]
  ------------------
 2420|   476k|    return(cur);
 2421|   476k|}
xmlAddNextSibling:
 2893|  11.5k|xmlAddNextSibling(xmlNode *prev, xmlNode *cur) {
 2894|  11.5k|    if ((prev == NULL) || (prev->type == XML_NAMESPACE_DECL) ||
  ------------------
  |  Branch (2894:9): [True: 0, False: 11.5k]
  |  Branch (2894:27): [True: 0, False: 11.5k]
  ------------------
 2895|  11.5k|        (cur == NULL) || (cur->type == XML_NAMESPACE_DECL) ||
  ------------------
  |  Branch (2895:9): [True: 0, False: 11.5k]
  |  Branch (2895:26): [True: 0, False: 11.5k]
  ------------------
 2896|  11.5k|        (cur == prev))
  ------------------
  |  Branch (2896:9): [True: 0, False: 11.5k]
  ------------------
 2897|      0|	return(NULL);
 2898|       |
 2899|  11.5k|    if (cur == prev->next)
  ------------------
  |  Branch (2899:9): [True: 0, False: 11.5k]
  ------------------
 2900|      0|        return(cur);
 2901|       |
 2902|  11.5k|    return(xmlInsertNode(prev->doc, cur, prev->parent, prev, prev->next, 0));
 2903|  11.5k|}
xmlAddPrevSibling:
 2922|   234k|xmlAddPrevSibling(xmlNode *next, xmlNode *cur) {
 2923|   234k|    if ((next == NULL) || (next->type == XML_NAMESPACE_DECL) ||
  ------------------
  |  Branch (2923:9): [True: 0, False: 234k]
  |  Branch (2923:27): [True: 0, False: 234k]
  ------------------
 2924|   234k|        (cur == NULL) || (cur->type == XML_NAMESPACE_DECL) ||
  ------------------
  |  Branch (2924:9): [True: 0, False: 234k]
  |  Branch (2924:26): [True: 0, False: 234k]
  ------------------
 2925|   234k|        (cur == next))
  ------------------
  |  Branch (2925:9): [True: 0, False: 234k]
  ------------------
 2926|      0|	return(NULL);
 2927|       |
 2928|   234k|    if (cur == next->prev)
  ------------------
  |  Branch (2928:9): [True: 0, False: 234k]
  ------------------
 2929|      0|        return(cur);
 2930|       |
 2931|   234k|    return(xmlInsertNode(next->doc, cur, next->parent, next->prev, next, 0));
 2932|   234k|}
xmlGetLastChild:
 3140|  11.8k|xmlGetLastChild(const xmlNode *parent) {
 3141|  11.8k|    if ((parent == NULL) || (parent->type == XML_NAMESPACE_DECL)) {
  ------------------
  |  Branch (3141:9): [True: 0, False: 11.8k]
  |  Branch (3141:29): [True: 0, False: 11.8k]
  ------------------
 3142|      0|	return(NULL);
 3143|      0|    }
 3144|  11.8k|    return(parent->last);
 3145|  11.8k|}
xmlFreeNodeList:
 3327|   501k|xmlFreeNodeList(xmlNode *cur) {
 3328|   501k|    xmlNodePtr next;
 3329|   501k|    xmlNodePtr parent;
 3330|   501k|    xmlDictPtr dict = NULL;
 3331|   501k|    size_t depth = 0;
 3332|       |
 3333|   501k|    if (cur == NULL) return;
  ------------------
  |  Branch (3333:9): [True: 7.45k, False: 494k]
  ------------------
 3334|   494k|    if (cur->type == XML_NAMESPACE_DECL) {
  ------------------
  |  Branch (3334:9): [True: 0, False: 494k]
  ------------------
 3335|      0|	xmlFreeNsList((xmlNsPtr) cur);
 3336|      0|	return;
 3337|      0|    }
 3338|   494k|    if (cur->doc != NULL) dict = cur->doc->dict;
  ------------------
  |  Branch (3338:9): [True: 494k, False: 0]
  ------------------
 3339|  6.81M|    while (1) {
  ------------------
  |  Branch (3339:12): [True: 6.81M, Folded]
  ------------------
 3340|  8.76M|        while ((cur->children != NULL) &&
  ------------------
  |  Branch (3340:16): [True: 1.95M, False: 6.81M]
  ------------------
 3341|  1.95M|               (cur->type != XML_DOCUMENT_NODE) &&
  ------------------
  |  Branch (3341:16): [True: 1.95M, False: 0]
  ------------------
 3342|  1.95M|               (cur->type != XML_HTML_DOCUMENT_NODE) &&
  ------------------
  |  Branch (3342:16): [True: 1.95M, False: 0]
  ------------------
 3343|  1.95M|               (cur->type != XML_DTD_NODE) &&
  ------------------
  |  Branch (3343:16): [True: 1.95M, False: 0]
  ------------------
 3344|  1.95M|               (cur->type != XML_ENTITY_REF_NODE)) {
  ------------------
  |  Branch (3344:16): [True: 1.94M, False: 5.99k]
  ------------------
 3345|  1.94M|            cur = cur->children;
 3346|  1.94M|            depth += 1;
 3347|  1.94M|        }
 3348|       |
 3349|  6.81M|        next = cur->next;
 3350|  6.81M|        parent = cur->parent;
 3351|  6.81M|	if ((cur->type == XML_DOCUMENT_NODE) ||
  ------------------
  |  Branch (3351:6): [True: 0, False: 6.81M]
  ------------------
 3352|  6.81M|            (cur->type == XML_HTML_DOCUMENT_NODE)) {
  ------------------
  |  Branch (3352:13): [True: 0, False: 6.81M]
  ------------------
 3353|      0|            xmlFreeDoc((xmlDocPtr) cur);
 3354|  6.81M|        } else if (cur->type == XML_DTD_NODE) {
  ------------------
  |  Branch (3354:20): [True: 0, False: 6.81M]
  ------------------
 3355|       |            /*
 3356|       |             * TODO: We should consider freeing the DTD if it isn't
 3357|       |             * referenced from doc->intSubset or doc->extSubset.
 3358|       |             */
 3359|      0|            cur->prev = NULL;
 3360|      0|            cur->next = NULL;
 3361|  6.81M|        } else {
 3362|  6.81M|	    if ((xmlRegisterCallbacks) && (xmlDeregisterNodeDefaultValue))
  ------------------
  |  |  934|      0|    (*__xmlDeregisterNodeDefaultValue())
  ------------------
  |  Branch (3362:10): [True: 0, False: 6.81M]
  |  Branch (3362:36): [True: 0, False: 0]
  ------------------
 3363|      0|		xmlDeregisterNodeDefaultValue(cur);
  ------------------
  |  |  934|      0|    (*__xmlDeregisterNodeDefaultValue())
  ------------------
 3364|       |
 3365|  6.81M|	    if (((cur->type == XML_ELEMENT_NODE) ||
  ------------------
  |  Branch (3365:11): [True: 3.04M, False: 3.77M]
  ------------------
 3366|  3.77M|		 (cur->type == XML_XINCLUDE_START) ||
  ------------------
  |  Branch (3366:4): [True: 4.10k, False: 3.76M]
  ------------------
 3367|  3.76M|		 (cur->type == XML_XINCLUDE_END)) &&
  ------------------
  |  Branch (3367:4): [True: 706k, False: 3.06M]
  ------------------
 3368|  3.75M|		(cur->properties != NULL))
  ------------------
  |  Branch (3368:3): [True: 294k, False: 3.45M]
  ------------------
 3369|   294k|		xmlFreePropList(cur->properties);
 3370|  6.81M|	    if ((cur->type != XML_ELEMENT_NODE) &&
  ------------------
  |  Branch (3370:10): [True: 3.77M, False: 3.04M]
  ------------------
 3371|  3.77M|		(cur->type != XML_XINCLUDE_START) &&
  ------------------
  |  Branch (3371:3): [True: 3.76M, False: 4.10k]
  ------------------
 3372|  3.76M|		(cur->type != XML_XINCLUDE_END) &&
  ------------------
  |  Branch (3372:3): [True: 3.06M, False: 706k]
  ------------------
 3373|  3.06M|		(cur->type != XML_ENTITY_REF_NODE) &&
  ------------------
  |  Branch (3373:3): [True: 2.96M, False: 94.9k]
  ------------------
 3374|  2.96M|		(cur->content != (xmlChar *) &(cur->properties))) {
  ------------------
  |  Branch (3374:3): [True: 2.81M, False: 152k]
  ------------------
 3375|  2.81M|		DICT_FREE(cur->content)
  ------------------
  |  |  810|  2.81M|	if ((str) && ((!dict) ||				\
  |  |  ------------------
  |  |  |  Branch (810:6): [True: 2.60M, False: 206k]
  |  |  |  Branch (810:16): [True: 1.10M, False: 1.50M]
  |  |  ------------------
  |  |  811|  2.60M|	    (xmlDictOwns(dict, (const xmlChar *)(str)) == 0)))	\
  |  |  ------------------
  |  |  |  Branch (811:6): [True: 1.50M, False: 450]
  |  |  ------------------
  |  |  812|  2.81M|	    xmlFree((char *)(str));
  ------------------
 3376|  2.81M|	    }
 3377|  6.81M|	    if (((cur->type == XML_ELEMENT_NODE) ||
  ------------------
  |  Branch (3377:11): [True: 3.04M, False: 3.77M]
  ------------------
 3378|  3.77M|	         (cur->type == XML_XINCLUDE_START) ||
  ------------------
  |  Branch (3378:11): [True: 4.10k, False: 3.76M]
  ------------------
 3379|  3.76M|		 (cur->type == XML_XINCLUDE_END)) &&
  ------------------
  |  Branch (3379:4): [True: 706k, False: 3.06M]
  ------------------
 3380|  3.75M|		(cur->nsDef != NULL))
  ------------------
  |  Branch (3380:3): [True: 1.01M, False: 2.73M]
  ------------------
 3381|  1.01M|		xmlFreeNsList(cur->nsDef);
 3382|       |
 3383|       |	    /*
 3384|       |	     * When a node is a text node or a comment, it uses a global static
 3385|       |	     * variable for the name of the node.
 3386|       |	     * Otherwise the node name might come from the document's
 3387|       |	     * dictionary
 3388|       |	     */
 3389|  6.81M|	    if ((cur->name != NULL) &&
  ------------------
  |  Branch (3389:10): [True: 6.73M, False: 80.9k]
  ------------------
 3390|  6.73M|		(cur->type != XML_TEXT_NODE) &&
  ------------------
  |  Branch (3390:3): [True: 4.14M, False: 2.58M]
  ------------------
 3391|  4.14M|		(cur->type != XML_COMMENT_NODE))
  ------------------
  |  Branch (3391:3): [True: 4.05M, False: 87.3k]
  ------------------
 3392|  4.05M|		DICT_FREE(cur->name)
  ------------------
  |  |  810|  4.05M|	if ((str) && ((!dict) ||				\
  |  |  ------------------
  |  |  |  Branch (810:6): [True: 4.05M, False: 0]
  |  |  |  Branch (810:16): [True: 988k, False: 3.06M]
  |  |  ------------------
  |  |  811|  4.05M|	    (xmlDictOwns(dict, (const xmlChar *)(str)) == 0)))	\
  |  |  ------------------
  |  |  |  Branch (811:6): [True: 13.6k, False: 3.05M]
  |  |  ------------------
  |  |  812|  4.05M|	    xmlFree((char *)(str));
  ------------------
 3393|  6.81M|	    xmlFree(cur);
 3394|  6.81M|	}
 3395|       |
 3396|  6.81M|        if (next != NULL) {
  ------------------
  |  Branch (3396:13): [True: 4.37M, False: 2.43M]
  ------------------
 3397|  4.37M|	    cur = next;
 3398|  4.37M|        } else {
 3399|  2.43M|            if ((depth == 0) || (parent == NULL))
  ------------------
  |  Branch (3399:17): [True: 494k, False: 1.94M]
  |  Branch (3399:33): [True: 0, False: 1.94M]
  ------------------
 3400|   494k|                break;
 3401|  1.94M|            depth -= 1;
 3402|  1.94M|            cur = parent;
 3403|       |            cur->children = NULL;
 3404|  1.94M|        }
 3405|  6.81M|    }
 3406|   494k|}
xmlFreeNode:
 3417|   391k|xmlFreeNode(xmlNode *cur) {
 3418|   391k|    xmlDictPtr dict = NULL;
 3419|       |
 3420|   391k|    if (cur == NULL) return;
  ------------------
  |  Branch (3420:9): [True: 94, False: 391k]
  ------------------
 3421|       |
 3422|       |    /* use xmlFreeDtd for DTD nodes */
 3423|   391k|    if (cur->type == XML_DTD_NODE) {
  ------------------
  |  Branch (3423:9): [True: 0, False: 391k]
  ------------------
 3424|      0|	xmlFreeDtd((xmlDtdPtr) cur);
 3425|      0|	return;
 3426|      0|    }
 3427|   391k|    if (cur->type == XML_NAMESPACE_DECL) {
  ------------------
  |  Branch (3427:9): [True: 0, False: 391k]
  ------------------
 3428|      0|	xmlFreeNs((xmlNsPtr) cur);
 3429|      0|        return;
 3430|      0|    }
 3431|   391k|    if (cur->type == XML_ATTRIBUTE_NODE) {
  ------------------
  |  Branch (3431:9): [True: 0, False: 391k]
  ------------------
 3432|      0|	xmlFreeProp((xmlAttrPtr) cur);
 3433|      0|	return;
 3434|      0|    }
 3435|   391k|    if (cur->type == XML_ENTITY_DECL) {
  ------------------
  |  Branch (3435:9): [True: 0, False: 391k]
  ------------------
 3436|      0|        xmlFreeEntity((xmlEntityPtr) cur);
 3437|      0|        return;
 3438|      0|    }
 3439|       |
 3440|   391k|    if ((xmlRegisterCallbacks) && (xmlDeregisterNodeDefaultValue))
  ------------------
  |  |  934|      0|    (*__xmlDeregisterNodeDefaultValue())
  ------------------
  |  Branch (3440:9): [True: 0, False: 391k]
  |  Branch (3440:35): [True: 0, False: 0]
  ------------------
 3441|      0|	xmlDeregisterNodeDefaultValue(cur);
  ------------------
  |  |  934|      0|    (*__xmlDeregisterNodeDefaultValue())
  ------------------
 3442|       |
 3443|   391k|    if (cur->doc != NULL) dict = cur->doc->dict;
  ------------------
  |  Branch (3443:9): [True: 391k, False: 25]
  ------------------
 3444|       |
 3445|   391k|    if ((cur->children != NULL) &&
  ------------------
  |  Branch (3445:9): [True: 8.93k, False: 382k]
  ------------------
 3446|  8.93k|	(cur->type != XML_ENTITY_REF_NODE))
  ------------------
  |  Branch (3446:2): [True: 8.37k, False: 561]
  ------------------
 3447|  8.37k|	xmlFreeNodeList(cur->children);
 3448|       |
 3449|   391k|    if ((cur->type == XML_ELEMENT_NODE) ||
  ------------------
  |  Branch (3449:9): [True: 30.4k, False: 360k]
  ------------------
 3450|   360k|        (cur->type == XML_XINCLUDE_START) ||
  ------------------
  |  Branch (3450:9): [True: 1.01k, False: 359k]
  ------------------
 3451|   359k|        (cur->type == XML_XINCLUDE_END)) {
  ------------------
  |  Branch (3451:9): [True: 255, False: 359k]
  ------------------
 3452|  31.6k|        if (cur->properties != NULL)
  ------------------
  |  Branch (3452:13): [True: 5.82k, False: 25.8k]
  ------------------
 3453|  5.82k|            xmlFreePropList(cur->properties);
 3454|  31.6k|        if (cur->nsDef != NULL)
  ------------------
  |  Branch (3454:13): [True: 6.48k, False: 25.2k]
  ------------------
 3455|  6.48k|            xmlFreeNsList(cur->nsDef);
 3456|   359k|    } else if ((cur->content != NULL) &&
  ------------------
  |  Branch (3456:16): [True: 354k, False: 5.55k]
  ------------------
 3457|   354k|               (cur->type != XML_ENTITY_REF_NODE) &&
  ------------------
  |  Branch (3457:16): [True: 353k, False: 296]
  ------------------
 3458|   353k|               (cur->content != (xmlChar *) &(cur->properties))) {
  ------------------
  |  Branch (3458:16): [True: 352k, False: 990]
  ------------------
 3459|   352k|        DICT_FREE(cur->content)
  ------------------
  |  |  810|   352k|	if ((str) && ((!dict) ||				\
  |  |  ------------------
  |  |  |  Branch (810:6): [True: 352k, False: 0]
  |  |  |  Branch (810:16): [True: 56.6k, False: 296k]
  |  |  ------------------
  |  |  811|   352k|	    (xmlDictOwns(dict, (const xmlChar *)(str)) == 0)))	\
  |  |  ------------------
  |  |  |  Branch (811:6): [True: 295k, False: 195]
  |  |  ------------------
  |  |  812|   352k|	    xmlFree((char *)(str));
  ------------------
 3460|   352k|    }
 3461|       |
 3462|       |    /*
 3463|       |     * When a node is a text node or a comment, it uses a global static
 3464|       |     * variable for the name of the node.
 3465|       |     * Otherwise the node name might come from the document's dictionary
 3466|       |     */
 3467|   391k|    if ((cur->name != NULL) &&
  ------------------
  |  Branch (3467:9): [True: 390k, False: 755]
  ------------------
 3468|   390k|        (cur->type != XML_TEXT_NODE) &&
  ------------------
  |  Branch (3468:9): [True: 377k, False: 12.6k]
  ------------------
 3469|   377k|        (cur->type != XML_COMMENT_NODE))
  ------------------
  |  Branch (3469:9): [True: 45.6k, False: 332k]
  ------------------
 3470|  45.6k|	DICT_FREE(cur->name)
  ------------------
  |  |  810|  45.6k|	if ((str) && ((!dict) ||				\
  |  |  ------------------
  |  |  |  Branch (810:6): [True: 45.6k, False: 0]
  |  |  |  Branch (810:16): [True: 17.4k, False: 28.2k]
  |  |  ------------------
  |  |  811|  45.6k|	    (xmlDictOwns(dict, (const xmlChar *)(str)) == 0)))	\
  |  |  ------------------
  |  |  |  Branch (811:6): [True: 226, False: 28.0k]
  |  |  ------------------
  |  |  812|  45.6k|	    xmlFree((char *)(str));
  ------------------
 3471|       |
 3472|   391k|    xmlFree(cur);
 3473|   391k|}
xmlUnlinkNode:
 3517|   258k|xmlUnlinkNode(xmlNode *cur) {
 3518|   258k|    if (cur == NULL)
  ------------------
  |  Branch (3518:9): [True: 0, False: 258k]
  ------------------
 3519|      0|	return;
 3520|       |
 3521|   258k|    if (cur->type == XML_NAMESPACE_DECL)
  ------------------
  |  Branch (3521:9): [True: 0, False: 258k]
  ------------------
 3522|      0|        return;
 3523|       |
 3524|   258k|    if (cur->type == XML_DTD_NODE) {
  ------------------
  |  Branch (3524:9): [True: 15.7k, False: 242k]
  ------------------
 3525|  15.7k|	xmlDocPtr doc = cur->doc;
 3526|       |
 3527|  15.7k|	if (doc != NULL) {
  ------------------
  |  Branch (3527:6): [True: 15.7k, False: 0]
  ------------------
 3528|  15.7k|	    if (doc->intSubset == (xmlDtdPtr) cur)
  ------------------
  |  Branch (3528:10): [True: 14.5k, False: 1.25k]
  ------------------
 3529|  14.5k|		doc->intSubset = NULL;
 3530|  15.7k|	    if (doc->extSubset == (xmlDtdPtr) cur)
  ------------------
  |  Branch (3530:10): [True: 1.25k, False: 14.5k]
  ------------------
 3531|  1.25k|		doc->extSubset = NULL;
 3532|  15.7k|	}
 3533|  15.7k|    }
 3534|       |
 3535|   258k|    if (cur->type == XML_ENTITY_DECL)
  ------------------
  |  Branch (3535:9): [True: 0, False: 258k]
  ------------------
 3536|      0|        xmlRemoveEntity((xmlEntityPtr) cur);
 3537|       |
 3538|   258k|    xmlUnlinkNodeInternal(cur);
 3539|   258k|}
xmlCopyNamespace:
 3615|  3.18M|xmlCopyNamespace(xmlNs *cur) {
 3616|  3.18M|    xmlNsPtr ret;
 3617|       |
 3618|  3.18M|    if (cur == NULL) return(NULL);
  ------------------
  |  Branch (3618:9): [True: 0, False: 3.18M]
  ------------------
 3619|  3.18M|    switch (cur->type) {
 3620|  3.18M|	case XML_LOCAL_NAMESPACE:
  ------------------
  |  |  500|  3.18M|#define XML_LOCAL_NAMESPACE XML_NAMESPACE_DECL
  ------------------
  |  Branch (3620:2): [True: 3.18M, False: 0]
  ------------------
 3621|  3.18M|	    ret = xmlNewNs(NULL, cur->href, cur->prefix);
 3622|  3.18M|	    break;
 3623|      0|	default:
  ------------------
  |  Branch (3623:2): [True: 0, False: 3.18M]
  ------------------
 3624|      0|	    return(NULL);
 3625|  3.18M|    }
 3626|  3.18M|    return(ret);
 3627|  3.18M|}
xmlCopyNamespaceList:
 3637|  3.17M|xmlCopyNamespaceList(xmlNs *cur) {
 3638|  3.17M|    xmlNsPtr ret = NULL;
 3639|  3.17M|    xmlNsPtr p = NULL,q;
 3640|       |
 3641|  6.35M|    while (cur != NULL) {
  ------------------
  |  Branch (3641:12): [True: 3.18M, False: 3.17M]
  ------------------
 3642|  3.18M|        q = xmlCopyNamespace(cur);
 3643|  3.18M|        if (q == NULL) {
  ------------------
  |  Branch (3643:13): [True: 53, False: 3.18M]
  ------------------
 3644|     53|            xmlFreeNsList(ret);
 3645|     53|            return(NULL);
 3646|     53|        }
 3647|  3.18M|	if (p == NULL) {
  ------------------
  |  Branch (3647:6): [True: 3.17M, False: 19.2k]
  ------------------
 3648|  3.17M|	    ret = p = q;
 3649|  3.17M|	} else {
 3650|  19.2k|	    p->next = q;
 3651|  19.2k|	    p = q;
 3652|  19.2k|	}
 3653|  3.18M|	cur = cur->next;
 3654|  3.18M|    }
 3655|  3.17M|    return(ret);
 3656|  3.17M|}
xmlCopyProp:
 3791|   968k|xmlCopyProp(xmlNode *target, xmlAttr *cur) {
 3792|       |	return xmlCopyPropInternal(NULL, target, cur);
 3793|   968k|}
xmlCopyPropList:
 3806|   571k|xmlCopyPropList(xmlNode *target, xmlAttr *cur) {
 3807|   571k|    xmlAttrPtr ret = NULL;
 3808|   571k|    xmlAttrPtr p = NULL,q;
 3809|       |
 3810|   571k|    if ((target != NULL) && (target->type != XML_ELEMENT_NODE))
  ------------------
  |  Branch (3810:9): [True: 571k, False: 0]
  |  Branch (3810:29): [True: 0, False: 571k]
  ------------------
 3811|      0|        return(NULL);
 3812|  1.53M|    while (cur != NULL) {
  ------------------
  |  Branch (3812:12): [True: 968k, False: 569k]
  ------------------
 3813|   968k|        q = xmlCopyProp(target, cur);
 3814|   968k|	if (q == NULL) {
  ------------------
  |  Branch (3814:6): [True: 2.15k, False: 966k]
  ------------------
 3815|  2.15k|            xmlFreePropList(ret);
 3816|  2.15k|	    return(NULL);
 3817|  2.15k|        }
 3818|   966k|	if (p == NULL) {
  ------------------
  |  Branch (3818:6): [True: 570k, False: 395k]
  ------------------
 3819|   570k|	    ret = p = q;
 3820|   570k|	} else {
 3821|   395k|	    p->next = q;
 3822|   395k|	    q->prev = p;
 3823|   395k|	    p = q;
 3824|   395k|	}
 3825|   966k|	cur = cur->next;
 3826|   966k|    }
 3827|   569k|    return(ret);
 3828|   571k|}
xmlStaticCopyNode:
 3860|  17.0M|                  int extended) {
 3861|  17.0M|    xmlNodePtr ret;
 3862|       |
 3863|  17.0M|    if (node == NULL) return(NULL);
  ------------------
  |  Branch (3863:9): [True: 0, False: 17.0M]
  ------------------
 3864|  17.0M|    switch (node->type) {
 3865|  5.63M|        case XML_TEXT_NODE:
  ------------------
  |  Branch (3865:9): [True: 5.63M, False: 11.4M]
  ------------------
 3866|  5.69M|        case XML_CDATA_SECTION_NODE:
  ------------------
  |  Branch (3866:9): [True: 55.3k, False: 17.0M]
  ------------------
 3867|  14.0M|        case XML_ELEMENT_NODE:
  ------------------
  |  Branch (3867:9): [True: 8.39M, False: 8.65M]
  ------------------
 3868|  14.0M|        case XML_DOCUMENT_FRAG_NODE:
  ------------------
  |  Branch (3868:9): [True: 0, False: 17.0M]
  ------------------
 3869|  14.1M|        case XML_ENTITY_REF_NODE:
  ------------------
  |  Branch (3869:9): [True: 60.5k, False: 16.9M]
  ------------------
 3870|  14.2M|        case XML_PI_NODE:
  ------------------
  |  Branch (3870:9): [True: 145k, False: 16.9M]
  ------------------
 3871|  14.3M|        case XML_COMMENT_NODE:
  ------------------
  |  Branch (3871:9): [True: 16.7k, False: 17.0M]
  ------------------
 3872|  14.3M|        case XML_XINCLUDE_START:
  ------------------
  |  Branch (3872:9): [True: 11.8k, False: 17.0M]
  ------------------
 3873|  17.0M|        case XML_XINCLUDE_END:
  ------------------
  |  Branch (3873:9): [True: 2.73M, False: 14.3M]
  ------------------
 3874|  17.0M|	    break;
 3875|      0|        case XML_ATTRIBUTE_NODE:
  ------------------
  |  Branch (3875:9): [True: 0, False: 17.0M]
  ------------------
 3876|      0|		return((xmlNodePtr) xmlCopyPropInternal(doc, parent, (xmlAttrPtr) node));
 3877|      0|        case XML_NAMESPACE_DECL:
  ------------------
  |  Branch (3877:9): [True: 0, False: 17.0M]
  ------------------
 3878|      0|	    return((xmlNodePtr) xmlCopyNamespaceList((xmlNsPtr) node));
 3879|       |
 3880|      0|        case XML_DOCUMENT_NODE:
  ------------------
  |  Branch (3880:9): [True: 0, False: 17.0M]
  ------------------
 3881|      0|        case XML_HTML_DOCUMENT_NODE:
  ------------------
  |  Branch (3881:9): [True: 0, False: 17.0M]
  ------------------
 3882|      0|	    return((xmlNodePtr) xmlCopyDoc((xmlDocPtr) node, extended));
 3883|      0|        default:
  ------------------
  |  Branch (3883:9): [True: 0, False: 17.0M]
  ------------------
 3884|      0|            return(NULL);
 3885|  17.0M|    }
 3886|       |
 3887|       |    /*
 3888|       |     * Allocate a new node and fill the fields.
 3889|       |     */
 3890|  17.0M|    ret = (xmlNodePtr) xmlMalloc(sizeof(xmlNode));
 3891|  17.0M|    if (ret == NULL)
  ------------------
  |  Branch (3891:9): [True: 150, False: 17.0M]
  ------------------
 3892|    150|	return(NULL);
 3893|  17.0M|    memset(ret, 0, sizeof(xmlNode));
 3894|  17.0M|    ret->type = node->type;
 3895|       |
 3896|  17.0M|    ret->doc = doc;
 3897|  17.0M|    ret->parent = parent;
 3898|  17.0M|    if (node->name == xmlStringText)
  ------------------
  |  Branch (3898:9): [True: 5.63M, False: 11.4M]
  ------------------
 3899|  5.63M|	ret->name = xmlStringText;
 3900|  11.4M|    else if (node->name == xmlStringTextNoenc)
  ------------------
  |  Branch (3900:14): [True: 0, False: 11.4M]
  ------------------
 3901|      0|	ret->name = xmlStringTextNoenc;
 3902|  11.4M|    else if (node->name == xmlStringComment)
  ------------------
  |  Branch (3902:14): [True: 16.7k, False: 11.4M]
  ------------------
 3903|  16.7k|	ret->name = xmlStringComment;
 3904|  11.4M|    else if (node->name != NULL) {
  ------------------
  |  Branch (3904:14): [True: 11.3M, False: 55.3k]
  ------------------
 3905|  11.3M|        if ((doc != NULL) && (doc->dict != NULL))
  ------------------
  |  Branch (3905:13): [True: 11.3M, False: 0]
  |  Branch (3905:30): [True: 10.6M, False: 717k]
  ------------------
 3906|  10.6M|	    ret->name = xmlDictLookup(doc->dict, node->name, -1);
 3907|   717k|	else
 3908|   717k|	    ret->name = xmlStrdup(node->name);
 3909|  11.3M|        if (ret->name == NULL)
  ------------------
  |  Branch (3909:13): [True: 37, False: 11.3M]
  ------------------
 3910|     37|            goto error;
 3911|  11.3M|    }
 3912|  17.0M|    if ((node->type != XML_ELEMENT_NODE) &&
  ------------------
  |  Branch (3912:9): [True: 8.65M, False: 8.39M]
  ------------------
 3913|  8.65M|	(node->content != NULL) &&
  ------------------
  |  Branch (3913:2): [True: 5.71M, False: 2.94M]
  ------------------
 3914|  5.71M|	(node->type != XML_ENTITY_REF_NODE) &&
  ------------------
  |  Branch (3914:2): [True: 5.71M, False: 898]
  ------------------
 3915|  5.71M|	(node->type != XML_XINCLUDE_END) &&
  ------------------
  |  Branch (3915:2): [True: 5.71M, False: 0]
  ------------------
 3916|  5.71M|	(node->type != XML_XINCLUDE_START)) {
  ------------------
  |  Branch (3916:2): [True: 5.71M, False: 0]
  ------------------
 3917|  5.71M|	ret->content = xmlStrdup(node->content);
 3918|  5.71M|        if (ret->content == NULL)
  ------------------
  |  Branch (3918:13): [True: 61, False: 5.71M]
  ------------------
 3919|     61|            goto error;
 3920|  11.3M|    }else{
 3921|  11.3M|      if (node->type == XML_ELEMENT_NODE)
  ------------------
  |  Branch (3921:11): [True: 8.39M, False: 2.94M]
  ------------------
 3922|  8.39M|        ret->line = node->line;
 3923|  11.3M|    }
 3924|       |
 3925|  17.0M|    if (!extended)
  ------------------
  |  Branch (3925:9): [True: 0, False: 17.0M]
  ------------------
 3926|      0|	goto out;
 3927|  17.0M|    if (((node->type == XML_ELEMENT_NODE) ||
  ------------------
  |  Branch (3927:10): [True: 8.39M, False: 8.65M]
  ------------------
 3928|  8.65M|         (node->type == XML_XINCLUDE_START)) && (node->nsDef != NULL)) {
  ------------------
  |  Branch (3928:10): [True: 11.7k, False: 8.64M]
  |  Branch (3928:49): [True: 3.17M, False: 5.23M]
  ------------------
 3929|  3.17M|        ret->nsDef = xmlCopyNamespaceList(node->nsDef);
 3930|  3.17M|        if (ret->nsDef == NULL)
  ------------------
  |  Branch (3930:13): [True: 53, False: 3.17M]
  ------------------
 3931|     53|            goto error;
 3932|  3.17M|    }
 3933|       |
 3934|  17.0M|    if ((node->type == XML_ELEMENT_NODE) && (node->ns != NULL)) {
  ------------------
  |  Branch (3934:9): [True: 8.39M, False: 8.65M]
  |  Branch (3934:45): [True: 536k, False: 7.86M]
  ------------------
 3935|   536k|        xmlNsPtr ns = NULL;
 3936|   536k|        int res;
 3937|       |
 3938|   536k|	res = xmlSearchNsSafe(ret, node->ns->prefix, &ns);
 3939|   536k|        if (res < 0)
  ------------------
  |  Branch (3939:13): [True: 1, False: 536k]
  ------------------
 3940|      1|            goto error;
 3941|   536k|	if (ns == NULL) {
  ------------------
  |  Branch (3941:6): [True: 1.06k, False: 534k]
  ------------------
 3942|       |	    /*
 3943|       |	     * Humm, we are copying an element whose namespace is defined
 3944|       |	     * out of the new tree scope. Search it in the original tree
 3945|       |	     * and add it at the top of the new tree.
 3946|       |             *
 3947|       |             * TODO: Searching the original tree seems unnecessary. We
 3948|       |             * already have a namespace URI.
 3949|       |	     */
 3950|  1.06k|	    res = xmlSearchNsSafe(node, node->ns->prefix, &ns);
 3951|  1.06k|            if (res < 0)
  ------------------
  |  Branch (3951:17): [True: 0, False: 1.06k]
  ------------------
 3952|      0|                goto error;
 3953|  1.06k|	    if (ns != NULL) {
  ------------------
  |  Branch (3953:10): [True: 1.06k, False: 0]
  ------------------
 3954|  1.06k|	        xmlNodePtr root = ret;
 3955|       |
 3956|  10.7k|		while (root->parent != NULL) root = root->parent;
  ------------------
  |  Branch (3956:10): [True: 9.68k, False: 1.06k]
  ------------------
 3957|  1.06k|		ret->ns = xmlNewNs(root, ns->href, ns->prefix);
 3958|  1.06k|            } else {
 3959|      0|                ret->ns = xmlNewReconciledNs(ret, node->ns);
 3960|      0|	    }
 3961|  1.06k|            if (ret->ns == NULL)
  ------------------
  |  Branch (3961:17): [True: 1, False: 1.06k]
  ------------------
 3962|      1|                goto error;
 3963|   534k|	} else {
 3964|       |	    /*
 3965|       |	     * reference the existing namespace definition in our own tree.
 3966|       |	     */
 3967|   534k|	    ret->ns = ns;
 3968|   534k|	}
 3969|   536k|    }
 3970|  17.0M|    if ((node->type == XML_ELEMENT_NODE) && (node->properties != NULL)) {
  ------------------
  |  Branch (3970:9): [True: 8.39M, False: 8.65M]
  |  Branch (3970:45): [True: 571k, False: 7.82M]
  ------------------
 3971|   571k|        ret->properties = xmlCopyPropList(ret, node->properties);
 3972|   571k|        if (ret->properties == NULL)
  ------------------
  |  Branch (3972:13): [True: 2.15k, False: 569k]
  ------------------
 3973|  2.15k|            goto error;
 3974|   571k|    }
 3975|  17.0M|    if (node->type == XML_ENTITY_REF_NODE) {
  ------------------
  |  Branch (3975:9): [True: 60.5k, False: 16.9M]
  ------------------
 3976|  60.5k|	if ((doc == NULL) || (node->doc != doc)) {
  ------------------
  |  Branch (3976:6): [True: 0, False: 60.5k]
  |  Branch (3976:23): [True: 249, False: 60.3k]
  ------------------
 3977|       |	    /*
 3978|       |	     * The copied node will go into a separate document, so
 3979|       |	     * to avoid dangling references to the ENTITY_DECL node
 3980|       |	     * we cannot keep the reference. Try to find it in the
 3981|       |	     * target document.
 3982|       |	     */
 3983|    249|	    ret->children = (xmlNodePtr) xmlGetDocEntity(doc, ret->name);
 3984|  60.3k|	} else {
 3985|  60.3k|            ret->children = node->children;
 3986|  60.3k|	}
 3987|  60.5k|	ret->last = ret->children;
 3988|  16.9M|    } else if ((node->children != NULL) && (extended != 2)) {
  ------------------
  |  Branch (3988:16): [True: 6.05M, False: 10.9M]
  |  Branch (3988:44): [True: 14.9k, False: 6.04M]
  ------------------
 3989|  14.9k|        xmlNodePtr cur, insert;
 3990|       |
 3991|  14.9k|        cur = node->children;
 3992|  14.9k|        insert = ret;
 3993|  14.7M|        while (cur != NULL) {
  ------------------
  |  Branch (3993:16): [True: 14.7M, False: 13.2k]
  ------------------
 3994|  14.7M|            xmlNodePtr copy = xmlStaticCopyNode(cur, doc, insert, 2);
 3995|  14.7M|            if (copy == NULL)
  ------------------
  |  Branch (3995:17): [True: 1.73k, False: 14.7M]
  ------------------
 3996|  1.73k|                goto error;
 3997|       |
 3998|       |            /* Check for coalesced text nodes */
 3999|  14.7M|            if (insert->last != copy) {
  ------------------
  |  Branch (3999:17): [True: 14.7M, False: 0]
  ------------------
 4000|  14.7M|                if (insert->last == NULL) {
  ------------------
  |  Branch (4000:21): [True: 5.58M, False: 9.16M]
  ------------------
 4001|  5.58M|                    insert->children = copy;
 4002|  9.16M|                } else {
 4003|  9.16M|                    copy->prev = insert->last;
 4004|  9.16M|                    insert->last->next = copy;
 4005|  9.16M|                }
 4006|  14.7M|                insert->last = copy;
 4007|  14.7M|            }
 4008|       |
 4009|  14.7M|            if ((cur->type != XML_ENTITY_REF_NODE) &&
  ------------------
  |  Branch (4009:17): [True: 14.6M, False: 59.1k]
  ------------------
 4010|  14.6M|                (cur->children != NULL)) {
  ------------------
  |  Branch (4010:17): [True: 5.57M, False: 9.12M]
  ------------------
 4011|  5.57M|                cur = cur->children;
 4012|  5.57M|                insert = copy;
 4013|  5.57M|                continue;
 4014|  5.57M|            }
 4015|       |
 4016|  14.6M|            while (1) {
  ------------------
  |  Branch (4016:20): [True: 14.6M, Folded]
  ------------------
 4017|  14.6M|                if (cur->next != NULL) {
  ------------------
  |  Branch (4017:21): [True: 9.16M, False: 5.52M]
  ------------------
 4018|  9.16M|                    cur = cur->next;
 4019|  9.16M|                    break;
 4020|  9.16M|                }
 4021|       |
 4022|  5.52M|                cur = cur->parent;
 4023|  5.52M|                insert = insert->parent;
 4024|  5.52M|                if (cur == node) {
  ------------------
  |  Branch (4024:21): [True: 13.2k, False: 5.51M]
  ------------------
 4025|  13.2k|                    cur = NULL;
 4026|  13.2k|                    break;
 4027|  13.2k|                }
 4028|  5.52M|            }
 4029|  9.18M|        }
 4030|  14.9k|    }
 4031|       |
 4032|  17.0M|out:
 4033|  17.0M|    if ((xmlRegisterCallbacks) && (xmlRegisterNodeDefaultValue))
  ------------------
  |  |  932|      0|    (*__xmlRegisterNodeDefaultValue())
  ------------------
  |  Branch (4033:9): [True: 0, False: 17.0M]
  |  Branch (4033:35): [True: 0, False: 0]
  ------------------
 4034|      0|	xmlRegisterNodeDefaultValue((xmlNodePtr)ret);
  ------------------
  |  |  932|      0|    (*__xmlRegisterNodeDefaultValue())
  ------------------
 4035|  17.0M|    return(ret);
 4036|       |
 4037|  4.03k|error:
 4038|  4.03k|    xmlFreeNode(ret);
 4039|       |    return(NULL);
 4040|  17.0M|}
xmlStaticCopyNodeList:
 4053|   788k|xmlStaticCopyNodeList(xmlNode *node, xmlDoc *doc, xmlNode *parent) {
 4054|   788k|    xmlNodePtr ret = NULL;
 4055|   788k|    xmlNodePtr p = NULL,q;
 4056|   788k|    xmlDtdPtr newSubset = NULL;
 4057|   788k|    int linkedSubset = 0;
 4058|       |
 4059|  1.57M|    while (node != NULL) {
  ------------------
  |  Branch (4059:12): [True: 788k, False: 788k]
  ------------------
 4060|   788k|        xmlNodePtr next = node->next;
 4061|       |
 4062|   788k|	if (node->type == XML_DTD_NODE ) {
  ------------------
  |  Branch (4062:6): [True: 0, False: 788k]
  ------------------
 4063|      0|	    if (doc == NULL) {
  ------------------
  |  Branch (4063:10): [True: 0, False: 0]
  ------------------
 4064|      0|		node = next;
 4065|      0|		continue;
 4066|      0|	    }
 4067|      0|	    if ((doc->intSubset == NULL) && (newSubset == NULL)) {
  ------------------
  |  Branch (4067:10): [True: 0, False: 0]
  |  Branch (4067:38): [True: 0, False: 0]
  ------------------
 4068|      0|		q = (xmlNodePtr) xmlCopyDtd( (xmlDtdPtr) node );
 4069|      0|		if (q == NULL) goto error;
  ------------------
  |  Branch (4069:7): [True: 0, False: 0]
  ------------------
 4070|       |                /* Can't fail on DTD */
 4071|      0|		xmlSetTreeDoc(q, doc);
 4072|      0|		q->parent = parent;
 4073|      0|		newSubset = (xmlDtdPtr) q;
 4074|      0|	    } else {
 4075|       |                /*
 4076|       |                 * We don't allow multiple internal subsets in a document,
 4077|       |                 * so we move the DTD instead of creating a copy.
 4078|       |                 */
 4079|      0|                linkedSubset = 1;
 4080|      0|		q = (xmlNodePtr) doc->intSubset;
 4081|       |                /* Unlink */
 4082|      0|                if (q->prev == NULL) {
  ------------------
  |  Branch (4082:21): [True: 0, False: 0]
  ------------------
 4083|      0|                    if (q->parent != NULL)
  ------------------
  |  Branch (4083:25): [True: 0, False: 0]
  ------------------
 4084|      0|                        q->parent->children = q->next;
 4085|      0|                } else {
 4086|      0|                    q->prev->next = q->next;
 4087|      0|                }
 4088|      0|                if (q->next == NULL) {
  ------------------
  |  Branch (4088:21): [True: 0, False: 0]
  ------------------
 4089|      0|                    if (q->parent != NULL)
  ------------------
  |  Branch (4089:25): [True: 0, False: 0]
  ------------------
 4090|      0|                        q->parent->last = q->prev;
 4091|      0|                } else {
 4092|      0|                    q->next->prev = q->prev;
 4093|      0|                }
 4094|      0|                q->parent = parent;
 4095|      0|                q->next = NULL;
 4096|      0|                q->prev = NULL;
 4097|      0|	    }
 4098|      0|	} else
 4099|   788k|	    q = xmlStaticCopyNode(node, doc, parent, 1);
 4100|   788k|	if (q == NULL) goto error;
  ------------------
  |  Branch (4100:6): [True: 26, False: 788k]
  ------------------
 4101|   788k|	if (ret == NULL) {
  ------------------
  |  Branch (4101:6): [True: 788k, False: 633]
  ------------------
 4102|   788k|	    q->prev = NULL;
 4103|   788k|	    ret = p = q;
 4104|   788k|	} else if (p != q) {
  ------------------
  |  Branch (4104:13): [True: 633, False: 0]
  ------------------
 4105|       |	/* the test is required if xmlStaticCopyNode coalesced 2 text nodes */
 4106|    633|	    p->next = q;
 4107|    633|	    q->prev = p;
 4108|    633|	    p = q;
 4109|    633|	}
 4110|   788k|	node = next;
 4111|   788k|    }
 4112|   788k|    if ((doc != NULL) && (newSubset != NULL))
  ------------------
  |  Branch (4112:9): [True: 788k, False: 0]
  |  Branch (4112:26): [True: 0, False: 788k]
  ------------------
 4113|      0|        doc->intSubset = newSubset;
 4114|   788k|    return(ret);
 4115|     26|error:
 4116|     26|    xmlFreeNodeList(ret);
 4117|     26|    if (newSubset != NULL)
  ------------------
  |  Branch (4117:9): [True: 0, False: 26]
  ------------------
 4118|      0|        xmlFreeDtd(newSubset);
 4119|     26|    if (linkedSubset != 0) {
  ------------------
  |  Branch (4119:9): [True: 0, False: 26]
  ------------------
 4120|      0|        doc->intSubset->next = NULL;
 4121|      0|        doc->intSubset->prev = NULL;
 4122|      0|    }
 4123|       |    return(NULL);
 4124|   788k|}
xmlDocCopyNode:
 4168|  82.6k|xmlDocCopyNode(xmlNode *node, xmlDoc *doc, int extended) {
 4169|  82.6k|    xmlNodePtr ret;
 4170|       |
 4171|       |    ret = xmlStaticCopyNode(node, doc, NULL, extended);
 4172|  82.6k|    return(ret);
 4173|  82.6k|}
xmlGetLineNo:
 4444|  41.4k|{
 4445|  41.4k|    return(xmlGetLineNoInternal(node, 0));
 4446|  41.4k|}
xmlDocGetRootElement:
 4672|   222k|xmlDocGetRootElement(const xmlDoc *doc) {
 4673|   222k|    xmlNodePtr ret;
 4674|       |
 4675|   222k|    if (doc == NULL) return(NULL);
  ------------------
  |  Branch (4675:9): [True: 0, False: 222k]
  ------------------
 4676|   222k|    ret = doc->children;
 4677|   277k|    while (ret != NULL) {
  ------------------
  |  Branch (4677:12): [True: 277k, False: 1]
  ------------------
 4678|   277k|	if (ret->type == XML_ELEMENT_NODE)
  ------------------
  |  Branch (4678:6): [True: 222k, False: 54.0k]
  ------------------
 4679|   222k|	    return(ret);
 4680|  54.0k|        ret = ret->next;
 4681|  54.0k|    }
 4682|      1|    return(ret);
 4683|   222k|}
xmlNodeGetLang:
 4769|  6.06k|xmlNodeGetLang(const xmlNode *cur) {
 4770|  6.06k|    xmlChar *lang;
 4771|  6.06k|    int res;
 4772|       |
 4773|  6.06k|    if ((cur == NULL) || (cur->type == XML_NAMESPACE_DECL))
  ------------------
  |  Branch (4773:9): [True: 0, False: 6.06k]
  |  Branch (4773:26): [True: 0, False: 6.06k]
  ------------------
 4774|      0|        return(NULL);
 4775|       |
 4776|   289k|    while (cur != NULL) {
  ------------------
  |  Branch (4776:12): [True: 283k, False: 5.59k]
  ------------------
 4777|   283k|        res = xmlNodeGetAttrValue(cur, BAD_CAST "lang", XML_XML_NAMESPACE,
  ------------------
  |  |   34|   283k|#define BAD_CAST (xmlChar *)
  ------------------
                      res = xmlNodeGetAttrValue(cur, BAD_CAST "lang", XML_XML_NAMESPACE,
  ------------------
  |  |  146|   283k|    (const xmlChar *) "http://www.w3.org/XML/1998/namespace"
  ------------------
 4778|   283k|                                  &lang);
 4779|   283k|        if (res < 0)
  ------------------
  |  Branch (4779:13): [True: 1, False: 283k]
  ------------------
 4780|      1|            return(NULL);
 4781|   283k|	if (lang != NULL)
  ------------------
  |  Branch (4781:6): [True: 467, False: 282k]
  ------------------
 4782|    467|	    return(lang);
 4783|       |
 4784|   282k|	cur = cur->parent;
 4785|   282k|    }
 4786|       |
 4787|  5.59k|    return(NULL);
 4788|  6.06k|}
xmlNodeGetSpacePreserve:
 4835|  1.05k|xmlNodeGetSpacePreserve(const xmlNode *cur) {
 4836|  1.05k|    xmlChar *space;
 4837|  1.05k|        int res;
 4838|       |
 4839|  1.05k|    if ((cur == NULL) || (cur->type != XML_ELEMENT_NODE))
  ------------------
  |  Branch (4839:9): [True: 0, False: 1.05k]
  |  Branch (4839:26): [True: 1.05k, False: 0]
  ------------------
 4840|  1.05k|        return(-1);
 4841|       |
 4842|      0|    while (cur != NULL) {
  ------------------
  |  Branch (4842:12): [True: 0, False: 0]
  ------------------
 4843|      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"
  ------------------
 4844|      0|                                  &space);
 4845|      0|        if (res < 0)
  ------------------
  |  Branch (4845:13): [True: 0, False: 0]
  ------------------
 4846|      0|            return(-1);
 4847|      0|	if (space != NULL) {
  ------------------
  |  Branch (4847:6): [True: 0, False: 0]
  ------------------
 4848|      0|	    if (xmlStrEqual(space, BAD_CAST "preserve")) {
  ------------------
  |  |   34|      0|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (4848:10): [True: 0, False: 0]
  ------------------
 4849|      0|		xmlFree(space);
 4850|      0|		return(1);
 4851|      0|	    }
 4852|      0|	    if (xmlStrEqual(space, BAD_CAST "default")) {
  ------------------
  |  |   34|      0|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (4852:10): [True: 0, False: 0]
  ------------------
 4853|      0|		xmlFree(space);
 4854|      0|		return(0);
 4855|      0|	    }
 4856|      0|	    xmlFree(space);
 4857|      0|	}
 4858|       |
 4859|      0|	cur = cur->parent;
 4860|      0|    }
 4861|       |
 4862|      0|    return(-1);
 4863|      0|}
xmlNodeSetBase:
 4919|  1.75k|xmlNodeSetBase(xmlNode *cur, const xmlChar* uri) {
 4920|  1.75k|    xmlNsPtr ns;
 4921|  1.75k|    xmlChar* fixed;
 4922|       |
 4923|  1.75k|    if (cur == NULL)
  ------------------
  |  Branch (4923:9): [True: 0, False: 1.75k]
  ------------------
 4924|      0|        return(-1);
 4925|  1.75k|    switch(cur->type) {
 4926|  1.75k|        case XML_ELEMENT_NODE:
  ------------------
  |  Branch (4926:9): [True: 1.75k, False: 0]
  ------------------
 4927|  1.75k|        case XML_ATTRIBUTE_NODE:
  ------------------
  |  Branch (4927:9): [True: 0, False: 1.75k]
  ------------------
 4928|  1.75k|	    break;
 4929|      0|        case XML_DOCUMENT_NODE:
  ------------------
  |  Branch (4929:9): [True: 0, False: 1.75k]
  ------------------
 4930|      0|        case XML_HTML_DOCUMENT_NODE: {
  ------------------
  |  Branch (4930:9): [True: 0, False: 1.75k]
  ------------------
 4931|      0|	    xmlDocPtr doc = (xmlDocPtr) cur;
 4932|       |
 4933|      0|	    if (doc->URL != NULL)
  ------------------
  |  Branch (4933:10): [True: 0, False: 0]
  ------------------
 4934|      0|		xmlFree(doc->URL);
 4935|      0|	    if (uri == NULL) {
  ------------------
  |  Branch (4935:10): [True: 0, False: 0]
  ------------------
 4936|      0|		doc->URL = NULL;
 4937|      0|            } else {
 4938|      0|		doc->URL = xmlPathToURI(uri);
 4939|      0|                if (doc->URL == NULL)
  ------------------
  |  Branch (4939:21): [True: 0, False: 0]
  ------------------
 4940|      0|                    return(-1);
 4941|      0|            }
 4942|      0|	    return(0);
 4943|      0|	}
 4944|      0|        default:
  ------------------
  |  Branch (4944:9): [True: 0, False: 1.75k]
  ------------------
 4945|      0|	    return(-1);
 4946|  1.75k|    }
 4947|       |
 4948|  1.75k|    xmlSearchNsByHrefSafe(cur, XML_XML_NAMESPACE, &ns);
  ------------------
  |  |  146|  1.75k|    (const xmlChar *) "http://www.w3.org/XML/1998/namespace"
  ------------------
 4949|  1.75k|    if (ns == NULL)
  ------------------
  |  Branch (4949:9): [True: 2, False: 1.75k]
  ------------------
 4950|      2|	return(-1);
 4951|  1.75k|    fixed = xmlPathToURI(uri);
 4952|  1.75k|    if (fixed == NULL)
  ------------------
  |  Branch (4952:9): [True: 6, False: 1.74k]
  ------------------
 4953|      6|        return(-1);
 4954|  1.74k|    if (xmlSetNsProp(cur, ns, BAD_CAST "base", fixed) == NULL) {
  ------------------
  |  |   34|  1.74k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (4954:9): [True: 12, False: 1.73k]
  ------------------
 4955|     12|        xmlFree(fixed);
 4956|     12|        return(-1);
 4957|     12|    }
 4958|  1.73k|    xmlFree(fixed);
 4959|       |
 4960|  1.73k|    return(0);
 4961|  1.74k|}
xmlNodeGetBaseSafe:
 4980|  75.4k|xmlNodeGetBaseSafe(const xmlDoc *doc, const xmlNode *cur, xmlChar **baseOut) {
 4981|  75.4k|    xmlChar *ret = NULL;
 4982|  75.4k|    xmlChar *base, *newbase;
 4983|  75.4k|    int res;
 4984|       |
 4985|  75.4k|    if (baseOut == NULL)
  ------------------
  |  Branch (4985:9): [True: 0, False: 75.4k]
  ------------------
 4986|      0|        return(1);
 4987|  75.4k|    *baseOut = NULL;
 4988|  75.4k|    if ((cur == NULL) && (doc == NULL))
  ------------------
  |  Branch (4988:9): [True: 0, False: 75.4k]
  |  Branch (4988:26): [True: 0, False: 0]
  ------------------
 4989|      0|        return(1);
 4990|  75.4k|    if ((cur != NULL) && (cur->type == XML_NAMESPACE_DECL))
  ------------------
  |  Branch (4990:9): [True: 75.4k, False: 0]
  |  Branch (4990:26): [True: 0, False: 75.4k]
  ------------------
 4991|      0|        return(1);
 4992|  75.4k|    if (doc == NULL)
  ------------------
  |  Branch (4992:9): [True: 48.8k, False: 26.6k]
  ------------------
 4993|  48.8k|        doc = cur->doc;
 4994|       |
 4995|  75.4k|    if ((doc != NULL) && (doc->type == XML_HTML_DOCUMENT_NODE)) {
  ------------------
  |  Branch (4995:9): [True: 75.4k, False: 0]
  |  Branch (4995:26): [True: 0, False: 75.4k]
  ------------------
 4996|      0|        cur = doc->children;
 4997|      0|	while ((cur != NULL) && (cur->name != NULL)) {
  ------------------
  |  Branch (4997:9): [True: 0, False: 0]
  |  Branch (4997:26): [True: 0, False: 0]
  ------------------
 4998|      0|	    if (cur->type != XML_ELEMENT_NODE) {
  ------------------
  |  Branch (4998:10): [True: 0, False: 0]
  ------------------
 4999|      0|	        cur = cur->next;
 5000|      0|		continue;
 5001|      0|	    }
 5002|      0|	    if (!xmlStrcasecmp(cur->name, BAD_CAST "html")) {
  ------------------
  |  |   34|      0|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (5002:10): [True: 0, False: 0]
  ------------------
 5003|      0|	        cur = cur->children;
 5004|      0|		continue;
 5005|      0|	    }
 5006|      0|	    if (!xmlStrcasecmp(cur->name, BAD_CAST "head")) {
  ------------------
  |  |   34|      0|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (5006:10): [True: 0, False: 0]
  ------------------
 5007|      0|	        cur = cur->children;
 5008|      0|		continue;
 5009|      0|	    }
 5010|      0|	    if (!xmlStrcasecmp(cur->name, BAD_CAST "base")) {
  ------------------
  |  |   34|      0|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (5010:10): [True: 0, False: 0]
  ------------------
 5011|      0|                if (xmlNodeGetAttrValue(cur, BAD_CAST "href", NULL, &ret) < 0)
  ------------------
  |  |   34|      0|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (5011:21): [True: 0, False: 0]
  ------------------
 5012|      0|                    return(-1);
 5013|      0|                if (ret == NULL)
  ------------------
  |  Branch (5013:21): [True: 0, False: 0]
  ------------------
 5014|      0|                    return(1);
 5015|      0|                goto found;
 5016|      0|	    }
 5017|      0|	    cur = cur->next;
 5018|      0|	}
 5019|      0|	return(0);
 5020|      0|    }
 5021|       |
 5022|  4.53M|    while (cur != NULL) {
  ------------------
  |  Branch (5022:12): [True: 4.47M, False: 58.5k]
  ------------------
 5023|  4.47M|	if (cur->type == XML_ENTITY_DECL) {
  ------------------
  |  Branch (5023:6): [True: 410, False: 4.47M]
  ------------------
 5024|    410|	    xmlEntityPtr ent = (xmlEntityPtr) cur;
 5025|       |
 5026|    410|            if (ent->URI == NULL)
  ------------------
  |  Branch (5026:17): [True: 200, False: 210]
  ------------------
 5027|    200|                break;
 5028|    210|            xmlFree(ret);
 5029|    210|	    ret = xmlStrdup(ent->URI);
 5030|    210|            if (ret == NULL)
  ------------------
  |  Branch (5030:17): [True: 1, False: 209]
  ------------------
 5031|      1|                return(-1);
 5032|    209|            goto found;
 5033|    210|	}
 5034|  4.47M|	if (cur->type == XML_ELEMENT_NODE) {
  ------------------
  |  Branch (5034:6): [True: 4.41M, False: 60.5k]
  ------------------
 5035|  4.41M|	    if (xmlNodeGetAttrValue(cur, BAD_CAST "base", XML_XML_NAMESPACE,
  ------------------
  |  |   34|  4.41M|#define BAD_CAST (xmlChar *)
  ------------------
              	    if (xmlNodeGetAttrValue(cur, BAD_CAST "base", XML_XML_NAMESPACE,
  ------------------
  |  |  146|  4.41M|    (const xmlChar *) "http://www.w3.org/XML/1998/namespace"
  ------------------
  |  Branch (5035:10): [True: 144, False: 4.41M]
  ------------------
 5036|  4.41M|                                    &base) < 0) {
 5037|    144|                xmlFree(ret);
 5038|    144|                return(-1);
 5039|    144|            }
 5040|  4.41M|	    if (base != NULL) {
  ------------------
  |  Branch (5040:10): [True: 478k, False: 3.93M]
  ------------------
 5041|   478k|		if (ret != NULL) {
  ------------------
  |  Branch (5041:7): [True: 428k, False: 49.8k]
  ------------------
 5042|   428k|		    res = xmlBuildURISafe(ret, base, &newbase);
 5043|   428k|                    xmlFree(ret);
 5044|   428k|                    xmlFree(base);
 5045|   428k|                    if (res != 0)
  ------------------
  |  Branch (5045:25): [True: 13.7k, False: 415k]
  ------------------
 5046|  13.7k|                        return(res);
 5047|   415k|		    ret = newbase;
 5048|   415k|		} else {
 5049|  49.8k|		    ret = base;
 5050|  49.8k|		}
 5051|   464k|		if ((!xmlStrncmp(ret, BAD_CAST "http://", 7)) ||
  ------------------
  |  |   34|   464k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (5051:7): [True: 587, False: 464k]
  ------------------
 5052|   464k|		    (!xmlStrncmp(ret, BAD_CAST "ftp://", 6)) ||
  ------------------
  |  |   34|   464k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (5052:7): [True: 781, False: 463k]
  ------------------
 5053|   463k|		    (!xmlStrncmp(ret, BAD_CAST "urn:", 4)))
  ------------------
  |  |   34|   463k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (5053:7): [True: 1.31k, False: 462k]
  ------------------
 5054|  2.68k|                    goto found;
 5055|   464k|	    }
 5056|  4.41M|	}
 5057|  4.45M|	cur = cur->parent;
 5058|  4.45M|    }
 5059|       |
 5060|  58.7k|    if ((doc != NULL) && (doc->URL != NULL)) {
  ------------------
  |  Branch (5060:9): [True: 58.7k, False: 0]
  |  Branch (5060:26): [True: 10.0k, False: 48.6k]
  ------------------
 5061|  10.0k|	if (ret == NULL) {
  ------------------
  |  Branch (5061:6): [True: 9.01k, False: 1.05k]
  ------------------
 5062|  9.01k|	    ret = xmlStrdup(doc->URL);
 5063|  9.01k|            if (ret == NULL)
  ------------------
  |  Branch (5063:17): [True: 14, False: 8.99k]
  ------------------
 5064|     14|                return(-1);
 5065|  9.01k|        } else {
 5066|  1.05k|            res = xmlBuildURISafe(ret, doc->URL, &newbase);
 5067|  1.05k|            xmlFree(ret);
 5068|  1.05k|            if (res != 0)
  ------------------
  |  Branch (5068:17): [True: 341, False: 710]
  ------------------
 5069|    341|                return(res);
 5070|    710|            ret = newbase;
 5071|    710|        }
 5072|  10.0k|    }
 5073|       |
 5074|  61.2k|found:
 5075|  61.2k|    *baseOut = ret;
 5076|  61.2k|    return(0);
 5077|  58.7k|}
xmlBufGetNodeContent:
 5200|   162k|{
 5201|   162k|    if ((cur == NULL) || (buf == NULL))
  ------------------
  |  Branch (5201:9): [True: 0, False: 162k]
  |  Branch (5201:26): [True: 0, False: 162k]
  ------------------
 5202|      0|        return(-1);
 5203|       |
 5204|   162k|    switch (cur->type) {
 5205|  82.9k|        case XML_DOCUMENT_NODE:
  ------------------
  |  Branch (5205:9): [True: 82.9k, False: 79.8k]
  ------------------
 5206|  82.9k|        case XML_HTML_DOCUMENT_NODE:
  ------------------
  |  Branch (5206:9): [True: 0, False: 162k]
  ------------------
 5207|  82.9k|        case XML_DOCUMENT_FRAG_NODE:
  ------------------
  |  Branch (5207:9): [True: 0, False: 162k]
  ------------------
 5208|   160k|        case XML_ELEMENT_NODE:
  ------------------
  |  Branch (5208:9): [True: 77.9k, False: 84.8k]
  ------------------
 5209|   162k|        case XML_ATTRIBUTE_NODE:
  ------------------
  |  Branch (5209:9): [True: 1.17k, False: 161k]
  ------------------
 5210|   162k|        case XML_ENTITY_DECL:
  ------------------
  |  Branch (5210:9): [True: 0, False: 162k]
  ------------------
 5211|   162k|            xmlBufGetChildContent(buf, cur);
 5212|   162k|            break;
 5213|       |
 5214|      0|        case XML_CDATA_SECTION_NODE:
  ------------------
  |  Branch (5214:9): [True: 0, False: 162k]
  ------------------
 5215|      0|        case XML_TEXT_NODE:
  ------------------
  |  Branch (5215:9): [True: 0, False: 162k]
  ------------------
 5216|      0|        case XML_COMMENT_NODE:
  ------------------
  |  Branch (5216:9): [True: 0, False: 162k]
  ------------------
 5217|      0|        case XML_PI_NODE:
  ------------------
  |  Branch (5217:9): [True: 0, False: 162k]
  ------------------
 5218|      0|	    xmlBufCat(buf, cur->content);
 5219|      0|            break;
 5220|       |
 5221|    728|        case XML_ENTITY_REF_NODE:
  ------------------
  |  Branch (5221:9): [True: 728, False: 162k]
  ------------------
 5222|    728|            xmlBufGetEntityRefContent(buf, cur);
 5223|    728|            break;
 5224|       |
 5225|      0|        case XML_NAMESPACE_DECL:
  ------------------
  |  Branch (5225:9): [True: 0, False: 162k]
  ------------------
 5226|      0|	    xmlBufCat(buf, ((xmlNsPtr) cur)->href);
 5227|      0|	    break;
 5228|       |
 5229|      0|        default:
  ------------------
  |  Branch (5229:9): [True: 0, False: 162k]
  ------------------
 5230|      0|            break;
 5231|   162k|    }
 5232|       |
 5233|   162k|    return(0);
 5234|   162k|}
xmlNodeGetContent:
 5251|   852k|{
 5252|   852k|    xmlBufPtr buf;
 5253|   852k|    xmlChar *ret;
 5254|       |
 5255|   852k|    if (cur == NULL)
  ------------------
  |  Branch (5255:9): [True: 0, False: 852k]
  ------------------
 5256|      0|        return (NULL);
 5257|       |
 5258|   852k|    switch (cur->type) {
 5259|  82.9k|        case XML_DOCUMENT_NODE:
  ------------------
  |  Branch (5259:9): [True: 82.9k, False: 769k]
  ------------------
 5260|  82.9k|        case XML_HTML_DOCUMENT_NODE:
  ------------------
  |  Branch (5260:9): [True: 0, False: 852k]
  ------------------
 5261|  82.9k|        case XML_ENTITY_REF_NODE:
  ------------------
  |  Branch (5261:9): [True: 0, False: 852k]
  ------------------
 5262|  82.9k|            break;
 5263|       |
 5264|      0|        case XML_DOCUMENT_FRAG_NODE:
  ------------------
  |  Branch (5264:9): [True: 0, False: 852k]
  ------------------
 5265|   226k|        case XML_ELEMENT_NODE:
  ------------------
  |  Branch (5265:9): [True: 226k, False: 625k]
  ------------------
 5266|   741k|        case XML_ATTRIBUTE_NODE:
  ------------------
  |  Branch (5266:9): [True: 514k, False: 337k]
  ------------------
 5267|   741k|        case XML_ENTITY_DECL: {
  ------------------
  |  Branch (5267:9): [True: 0, False: 852k]
  ------------------
 5268|   741k|            xmlNodePtr children = cur->children;
 5269|       |
 5270|   741k|            if (children == NULL)
  ------------------
  |  Branch (5270:17): [True: 323k, False: 418k]
  ------------------
 5271|   323k|                return(xmlStrdup(BAD_CAST ""));
  ------------------
  |  |   34|   323k|#define BAD_CAST (xmlChar *)
  ------------------
 5272|       |
 5273|       |            /* Optimization for single text children */
 5274|   418k|            if (((children->type == XML_TEXT_NODE) ||
  ------------------
  |  Branch (5274:18): [True: 361k, False: 56.8k]
  ------------------
 5275|  56.8k|                 (children->type == XML_CDATA_SECTION_NODE)) &&
  ------------------
  |  Branch (5275:18): [True: 3.04k, False: 53.8k]
  ------------------
 5276|   364k|                (children->next == NULL)) {
  ------------------
  |  Branch (5276:17): [True: 339k, False: 24.4k]
  ------------------
 5277|   339k|                if (children->content == NULL)
  ------------------
  |  Branch (5277:21): [True: 0, False: 339k]
  ------------------
 5278|      0|                    return(xmlStrdup(BAD_CAST ""));
  ------------------
  |  |   34|      0|#define BAD_CAST (xmlChar *)
  ------------------
 5279|   339k|                return(xmlStrdup(children->content));
 5280|   339k|            }
 5281|       |
 5282|  78.3k|            break;
 5283|   418k|        }
 5284|       |
 5285|  78.3k|        case XML_CDATA_SECTION_NODE:
  ------------------
  |  Branch (5285:9): [True: 759, False: 851k]
  ------------------
 5286|  26.9k|        case XML_TEXT_NODE:
  ------------------
  |  Branch (5286:9): [True: 26.1k, False: 826k]
  ------------------
 5287|  27.1k|        case XML_COMMENT_NODE:
  ------------------
  |  Branch (5287:9): [True: 246, False: 851k]
  ------------------
 5288|  27.4k|        case XML_PI_NODE:
  ------------------
  |  Branch (5288:9): [True: 335, False: 851k]
  ------------------
 5289|  27.4k|            if (cur->content != NULL)
  ------------------
  |  Branch (5289:17): [True: 27.1k, False: 335]
  ------------------
 5290|  27.1k|                return(xmlStrdup(cur->content));
 5291|    335|            else
 5292|    335|                return(xmlStrdup(BAD_CAST ""));
  ------------------
  |  |   34|    335|#define BAD_CAST (xmlChar *)
  ------------------
 5293|       |
 5294|    177|        case XML_NAMESPACE_DECL:
  ------------------
  |  Branch (5294:9): [True: 177, False: 852k]
  ------------------
 5295|    177|	    return(xmlStrdup(((xmlNsPtr) cur)->href));
 5296|       |
 5297|      0|        default:
  ------------------
  |  Branch (5297:9): [True: 0, False: 852k]
  ------------------
 5298|      0|            return(NULL);
 5299|   852k|    }
 5300|       |
 5301|   161k|    buf = xmlBufCreate(50);
 5302|   161k|    if (buf == NULL)
  ------------------
  |  Branch (5302:9): [True: 63, False: 161k]
  ------------------
 5303|     63|        return (NULL);
 5304|   161k|    xmlBufGetNodeContent(buf, cur);
 5305|   161k|    ret = xmlBufDetach(buf);
 5306|   161k|    xmlBufFree(buf);
 5307|       |
 5308|   161k|    return(ret);
 5309|   161k|}
xmlNodeAddContentLen:
 5412|     42|xmlNodeAddContentLen(xmlNode *cur, const xmlChar *content, int len) {
 5413|     42|    if (cur == NULL)
  ------------------
  |  Branch (5413:9): [True: 0, False: 42]
  ------------------
 5414|      0|	return(1);
 5415|     42|    if ((content == NULL) || (len <= 0))
  ------------------
  |  Branch (5415:9): [True: 0, False: 42]
  |  Branch (5415:30): [True: 18, False: 24]
  ------------------
 5416|     18|        return(0);
 5417|       |
 5418|     24|    switch (cur->type) {
 5419|      0|        case XML_DOCUMENT_FRAG_NODE:
  ------------------
  |  Branch (5419:9): [True: 0, False: 24]
  ------------------
 5420|      0|        case XML_ELEMENT_NODE:
  ------------------
  |  Branch (5420:9): [True: 0, False: 24]
  ------------------
 5421|      0|        case XML_ATTRIBUTE_NODE: {
  ------------------
  |  Branch (5421:9): [True: 0, False: 24]
  ------------------
 5422|      0|	    xmlNodePtr newNode, tmp;
 5423|       |
 5424|      0|	    newNode = xmlNewDocTextLen(cur->doc, content, len);
 5425|      0|	    if (newNode == NULL)
  ------------------
  |  Branch (5425:10): [True: 0, False: 0]
  ------------------
 5426|      0|                return(-1);
 5427|      0|            tmp = xmlAddChild(cur, newNode);
 5428|      0|            if (tmp == NULL) {
  ------------------
  |  Branch (5428:17): [True: 0, False: 0]
  ------------------
 5429|      0|                xmlFreeNode(newNode);
 5430|      0|                return(-1);
 5431|      0|            }
 5432|      0|	    break;
 5433|      0|	}
 5434|      0|	    break;
 5435|     24|        case XML_TEXT_NODE:
  ------------------
  |  Branch (5435:9): [True: 24, False: 0]
  ------------------
 5436|     24|        case XML_CDATA_SECTION_NODE:
  ------------------
  |  Branch (5436:9): [True: 0, False: 24]
  ------------------
 5437|     24|        case XML_PI_NODE:
  ------------------
  |  Branch (5437:9): [True: 0, False: 24]
  ------------------
 5438|     24|        case XML_COMMENT_NODE:
  ------------------
  |  Branch (5438:9): [True: 0, False: 24]
  ------------------
 5439|     24|            return(xmlTextAddContent(cur, content, len));
 5440|      0|        default:
  ------------------
  |  Branch (5440:9): [True: 0, False: 24]
  ------------------
 5441|      0|            break;
 5442|     24|    }
 5443|       |
 5444|      0|    return(0);
 5445|     24|}
xmlGetNsListSafe:
 5511|  31.5k|{
 5512|  31.5k|    xmlNsPtr cur;
 5513|  31.5k|    xmlNsPtr *namespaces = NULL;
 5514|  31.5k|    int nbns = 0;
 5515|  31.5k|    int maxns = 0;
 5516|  31.5k|    int i;
 5517|       |
 5518|  31.5k|    if (out == NULL)
  ------------------
  |  Branch (5518:9): [True: 0, False: 31.5k]
  ------------------
 5519|      0|        return(1);
 5520|  31.5k|    *out = NULL;
 5521|  31.5k|    if ((node == NULL) || (node->type == XML_NAMESPACE_DECL))
  ------------------
  |  Branch (5521:9): [True: 0, False: 31.5k]
  |  Branch (5521:27): [True: 0, False: 31.5k]
  ------------------
 5522|      0|        return(1);
 5523|       |
 5524|   158k|    while (node != NULL) {
  ------------------
  |  Branch (5524:12): [True: 127k, False: 31.5k]
  ------------------
 5525|   127k|        if (node->type == XML_ELEMENT_NODE) {
  ------------------
  |  Branch (5525:13): [True: 95.5k, False: 31.5k]
  ------------------
 5526|  95.5k|            cur = node->nsDef;
 5527|   148k|            while (cur != NULL) {
  ------------------
  |  Branch (5527:20): [True: 53.1k, False: 95.5k]
  ------------------
 5528|  74.7k|                for (i = 0; i < nbns; i++) {
  ------------------
  |  Branch (5528:29): [True: 22.4k, False: 52.3k]
  ------------------
 5529|  22.4k|                    if ((cur->prefix == namespaces[i]->prefix) ||
  ------------------
  |  Branch (5529:25): [True: 306, False: 22.1k]
  ------------------
 5530|  22.1k|                        (xmlStrEqual(cur->prefix, namespaces[i]->prefix)))
  ------------------
  |  Branch (5530:25): [True: 478, False: 21.6k]
  ------------------
 5531|    784|                        break;
 5532|  22.4k|                }
 5533|  53.1k|                if (i >= nbns) {
  ------------------
  |  Branch (5533:21): [True: 52.3k, False: 784]
  ------------------
 5534|  52.3k|                    if (nbns >= maxns) {
  ------------------
  |  Branch (5534:25): [True: 31.3k, False: 20.9k]
  ------------------
 5535|  31.3k|                        xmlNsPtr *tmp;
 5536|  31.3k|                        int newSize;
 5537|       |
 5538|  31.3k|                        newSize = xmlGrowCapacity(maxns, sizeof(tmp[0]),
 5539|  31.3k|                                                  10, XML_MAX_ITEMS);
  ------------------
  |  |   13|  31.3k|#define XML_MAX_ITEMS 1000000000 /* 1 billion */
  ------------------
 5540|  31.3k|                        if (newSize < 0) {
  ------------------
  |  Branch (5540:29): [True: 0, False: 31.3k]
  ------------------
 5541|      0|                            xmlFree(namespaces);
 5542|      0|                            return(-1);
 5543|      0|                        }
 5544|  31.3k|#ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
 5545|  31.3k|                        if (newSize < 2)
  ------------------
  |  Branch (5545:29): [True: 31.0k, False: 329]
  ------------------
 5546|  31.0k|                            newSize = 2;
 5547|  31.3k|#endif
 5548|  31.3k|                        tmp = xmlRealloc(namespaces,
 5549|  31.3k|                                         (newSize + 1) * sizeof(tmp[0]));
 5550|  31.3k|                        if (tmp == NULL) {
  ------------------
  |  Branch (5550:29): [True: 9, False: 31.3k]
  ------------------
 5551|      9|                            xmlFree(namespaces);
 5552|      9|                            return(-1);
 5553|      9|                        }
 5554|  31.3k|                        namespaces = tmp;
 5555|  31.3k|                        maxns = newSize;
 5556|  31.3k|                    }
 5557|  52.3k|                    namespaces[nbns++] = cur;
 5558|  52.3k|                    namespaces[nbns] = NULL;
 5559|  52.3k|                }
 5560|       |
 5561|  53.1k|                cur = cur->next;
 5562|  53.1k|            }
 5563|  95.5k|        }
 5564|   127k|        node = node->parent;
 5565|   127k|    }
 5566|       |
 5567|  31.5k|    *out = namespaces;
 5568|  31.5k|    return((namespaces == NULL) ? 1 : 0);
  ------------------
  |  Branch (5568:12): [True: 546, False: 30.9k]
  ------------------
 5569|  31.5k|}
xmlSearchNsSafe:
 5648|  1.61M|                xmlNs **out) {
 5649|  1.61M|    xmlNsPtr cur;
 5650|  1.61M|    xmlDocPtr doc;
 5651|  1.61M|    xmlNodePtr orig = node;
 5652|  1.61M|    xmlNodePtr parent;
 5653|       |
 5654|  1.61M|    if (out == NULL)
  ------------------
  |  Branch (5654:9): [True: 0, False: 1.61M]
  ------------------
 5655|      0|        return(1);
 5656|  1.61M|    *out = NULL;
 5657|  1.61M|    if ((node == NULL) || (node->type == XML_NAMESPACE_DECL))
  ------------------
  |  Branch (5657:9): [True: 0, False: 1.61M]
  |  Branch (5657:27): [True: 0, False: 1.61M]
  ------------------
 5658|      0|        return(1);
 5659|       |
 5660|  1.61M|    doc = node->doc;
 5661|       |
 5662|  1.61M|    if ((doc != NULL) && (IS_STR_XML(prefix))) {
  ------------------
  |  |  100|  1.61M|#define IS_STR_XML(str) ((str != NULL) && (str[0] == 'x') && \
  |  |  ------------------
  |  |  |  Branch (100:26): [True: 1.14M, False: 467k]
  |  |  |  Branch (100:43): [True: 620k, False: 528k]
  |  |  ------------------
  |  |  101|  1.61M|  (str[1] == 'm') && (str[2] == 'l') && (str[3] == 0))
  |  |  ------------------
  |  |  |  Branch (101:3): [True: 526k, False: 93.9k]
  |  |  |  Branch (101:22): [True: 524k, False: 1.64k]
  |  |  |  Branch (101:41): [True: 522k, False: 2.36k]
  |  |  ------------------
  ------------------
  |  Branch (5662:9): [True: 1.61M, False: 0]
  ------------------
 5663|   522k|        cur = xmlTreeEnsureXMLDecl(doc);
 5664|   522k|        if (cur == NULL)
  ------------------
  |  Branch (5664:13): [True: 24, False: 522k]
  ------------------
 5665|     24|            return(-1);
 5666|   522k|        *out = cur;
 5667|   522k|        return(0);
 5668|   522k|    }
 5669|       |
 5670|  1.09M|    while (node->type != XML_ELEMENT_NODE) {
  ------------------
  |  Branch (5670:12): [True: 13.5k, False: 1.08M]
  ------------------
 5671|  13.5k|        node = node->parent;
 5672|  13.5k|        if (node == NULL)
  ------------------
  |  Branch (5672:13): [True: 12.2k, False: 1.31k]
  ------------------
 5673|  12.2k|            return(0);
 5674|  13.5k|    }
 5675|       |
 5676|  1.08M|    parent = node;
 5677|       |
 5678|  54.2M|    while ((node != NULL) && (node->type == XML_ELEMENT_NODE)) {
  ------------------
  |  Branch (5678:12): [True: 54.1M, False: 43.3k]
  |  Branch (5678:30): [True: 53.7M, False: 380k]
  ------------------
 5679|  53.7M|        cur = node->nsDef;
 5680|  58.4M|        while (cur != NULL) {
  ------------------
  |  Branch (5680:16): [True: 5.23M, False: 53.2M]
  ------------------
 5681|  5.23M|            if ((xmlStrEqual(cur->prefix, prefix)) &&
  ------------------
  |  Branch (5681:17): [True: 891k, False: 4.34M]
  ------------------
 5682|   891k|                (cur->href != NULL)) {
  ------------------
  |  Branch (5682:17): [True: 573k, False: 318k]
  ------------------
 5683|   573k|                *out = cur;
 5684|   573k|                return(0);
 5685|   573k|            }
 5686|  4.66M|            cur = cur->next;
 5687|  4.66M|        }
 5688|  53.2M|        if (orig != node) {
  ------------------
  |  Branch (5688:13): [True: 52.6M, False: 597k]
  ------------------
 5689|  52.6M|            cur = node->ns;
 5690|  52.6M|            if ((cur != NULL) &&
  ------------------
  |  Branch (5690:17): [True: 567k, False: 52.0M]
  ------------------
 5691|   567k|                (xmlStrEqual(cur->prefix, prefix)) &&
  ------------------
  |  Branch (5691:17): [True: 84.5k, False: 483k]
  ------------------
 5692|  84.5k|                (cur->href != NULL)) {
  ------------------
  |  Branch (5692:17): [True: 84.5k, False: 0]
  ------------------
 5693|  84.5k|                *out = cur;
 5694|  84.5k|                return(0);
 5695|  84.5k|            }
 5696|  52.6M|        }
 5697|       |
 5698|  53.1M|	node = node->parent;
 5699|  53.1M|    }
 5700|       |
 5701|       |    /*
 5702|       |     * The XML-1.0 namespace is normally held on the document
 5703|       |     * element. In this case exceptionally create it on the
 5704|       |     * node element.
 5705|       |     */
 5706|   424k|    if ((doc == NULL) && (IS_STR_XML(prefix))) {
  ------------------
  |  |  100|      0|#define IS_STR_XML(str) ((str != NULL) && (str[0] == 'x') && \
  |  |  ------------------
  |  |  |  Branch (100:26): [True: 0, False: 0]
  |  |  |  Branch (100:43): [True: 0, False: 0]
  |  |  ------------------
  |  |  101|      0|  (str[1] == 'm') && (str[2] == 'l') && (str[3] == 0))
  |  |  ------------------
  |  |  |  Branch (101:3): [True: 0, False: 0]
  |  |  |  Branch (101:22): [True: 0, False: 0]
  |  |  |  Branch (101:41): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (5706:9): [True: 0, False: 424k]
  ------------------
 5707|      0|        cur = xmlNewXmlNs();
 5708|      0|        if (cur == NULL)
  ------------------
  |  Branch (5708:13): [True: 0, False: 0]
  ------------------
 5709|      0|            return(-1);
 5710|      0|        cur->next = parent->nsDef;
 5711|      0|        parent->nsDef = cur;
 5712|      0|        *out = cur;
 5713|      0|    }
 5714|       |
 5715|   424k|    return(0);
 5716|   424k|}
xmlSearchNsByHrefSafe:
 5795|  3.62k|                      xmlNs **out) {
 5796|  3.62k|    xmlNsPtr cur;
 5797|  3.62k|    xmlDocPtr doc;
 5798|  3.62k|    xmlNodePtr orig = node;
 5799|  3.62k|    xmlNodePtr parent;
 5800|  3.62k|    int is_attr;
 5801|       |
 5802|  3.62k|    if (out == NULL)
  ------------------
  |  Branch (5802:9): [True: 0, False: 3.62k]
  ------------------
 5803|      0|        return(1);
 5804|  3.62k|    *out = NULL;
 5805|  3.62k|    if ((node == NULL) || (node->type == XML_NAMESPACE_DECL))
  ------------------
  |  Branch (5805:9): [True: 0, False: 3.62k]
  |  Branch (5805:27): [True: 0, False: 3.62k]
  ------------------
 5806|      0|        return(1);
 5807|       |
 5808|  3.62k|    doc = node->doc;
 5809|       |
 5810|  3.62k|    if ((doc != NULL) && (xmlStrEqual(href, XML_XML_NAMESPACE))) {
  ------------------
  |  |  146|  3.62k|    (const xmlChar *) "http://www.w3.org/XML/1998/namespace"
  ------------------
  |  Branch (5810:9): [True: 3.62k, False: 0]
  |  Branch (5810:26): [True: 1.75k, False: 1.87k]
  ------------------
 5811|  1.75k|        cur = xmlTreeEnsureXMLDecl(doc);
 5812|  1.75k|        if (cur == NULL)
  ------------------
  |  Branch (5812:13): [True: 2, False: 1.75k]
  ------------------
 5813|      2|            return(-1);
 5814|  1.75k|        *out = cur;
 5815|  1.75k|        return(0);
 5816|  1.75k|    }
 5817|       |
 5818|  1.87k|    is_attr = (node->type == XML_ATTRIBUTE_NODE);
 5819|       |
 5820|  1.87k|    while (node->type != XML_ELEMENT_NODE) {
  ------------------
  |  Branch (5820:12): [True: 0, False: 1.87k]
  ------------------
 5821|      0|        node = node->parent;
 5822|      0|        if (node == NULL)
  ------------------
  |  Branch (5822:13): [True: 0, False: 0]
  ------------------
 5823|      0|            return(0);
 5824|      0|    }
 5825|       |
 5826|  1.87k|    parent = node;
 5827|       |
 5828|  47.2k|    while ((node != NULL) && (node->type == XML_ELEMENT_NODE)) {
  ------------------
  |  Branch (5828:12): [True: 46.5k, False: 675]
  |  Branch (5828:30): [True: 46.5k, False: 0]
  ------------------
 5829|  46.5k|        cur = node->nsDef;
 5830|  68.0k|        while (cur != NULL) {
  ------------------
  |  Branch (5830:16): [True: 22.5k, False: 45.4k]
  ------------------
 5831|  22.5k|            if (xmlStrEqual(cur->href, href)) {
  ------------------
  |  Branch (5831:17): [True: 5.32k, False: 17.2k]
  ------------------
 5832|  5.32k|                if (((!is_attr) || (cur->prefix != NULL)) &&
  ------------------
  |  Branch (5832:22): [True: 5.32k, False: 0]
  |  Branch (5832:36): [True: 0, False: 0]
  ------------------
 5833|  5.32k|                    (xmlNsInScope(doc, orig, node, cur->prefix) == 1)) {
  ------------------
  |  Branch (5833:21): [True: 1.08k, False: 4.23k]
  ------------------
 5834|  1.08k|                    *out = cur;
 5835|  1.08k|                    return(0);
 5836|  1.08k|                }
 5837|  5.32k|            }
 5838|  21.4k|            cur = cur->next;
 5839|  21.4k|        }
 5840|  45.4k|        if (orig != node) {
  ------------------
  |  Branch (5840:13): [True: 43.7k, False: 1.74k]
  ------------------
 5841|  43.7k|            cur = node->ns;
 5842|  43.7k|            if (cur != NULL) {
  ------------------
  |  Branch (5842:17): [True: 41.6k, False: 2.15k]
  ------------------
 5843|  41.6k|                if (xmlStrEqual(cur->href, href)) {
  ------------------
  |  Branch (5843:21): [True: 6.07k, False: 35.5k]
  ------------------
 5844|  6.07k|                    if (((!is_attr) || (cur->prefix != NULL)) &&
  ------------------
  |  Branch (5844:26): [True: 6.07k, False: 0]
  |  Branch (5844:40): [True: 0, False: 0]
  ------------------
 5845|  6.07k|                        (xmlNsInScope(doc, orig, node,
  ------------------
  |  Branch (5845:25): [True: 113, False: 5.96k]
  ------------------
 5846|  6.07k|                                      cur->prefix) == 1)) {
 5847|    113|                        *out = cur;
 5848|    113|                        return(0);
 5849|    113|                    }
 5850|  6.07k|                }
 5851|  41.6k|            }
 5852|  43.7k|        }
 5853|       |
 5854|  45.3k|        node = node->parent;
 5855|  45.3k|    }
 5856|       |
 5857|       |    /*
 5858|       |     * The XML-1.0 namespace is normally held on the document
 5859|       |     * element. In this case exceptionally create it on the
 5860|       |     * node element.
 5861|       |     */
 5862|    675|    if ((doc == NULL) && (xmlStrEqual(href, XML_XML_NAMESPACE))) {
  ------------------
  |  |  146|      0|    (const xmlChar *) "http://www.w3.org/XML/1998/namespace"
  ------------------
  |  Branch (5862:9): [True: 0, False: 675]
  |  Branch (5862:26): [True: 0, False: 0]
  ------------------
 5863|      0|        cur = xmlNewXmlNs();
 5864|      0|        if (cur == NULL)
  ------------------
  |  Branch (5864:13): [True: 0, False: 0]
  ------------------
 5865|      0|            return(-1);
 5866|      0|        cur->next = parent->nsDef;
 5867|      0|        parent->nsDef = cur;
 5868|      0|        *out = cur;
 5869|      0|    }
 5870|       |
 5871|    675|    return(0);
 5872|    675|}
xmlNodeGetAttrValue:
 6349|  4.89M|                    const xmlChar *nsUri, xmlChar **out) {
 6350|  4.89M|    xmlAttrPtr prop;
 6351|       |
 6352|  4.89M|    if (out == NULL)
  ------------------
  |  Branch (6352:9): [True: 0, False: 4.89M]
  ------------------
 6353|      0|        return(1);
 6354|  4.89M|    *out = NULL;
 6355|       |
 6356|  4.89M|    prop = xmlGetPropNodeInternal(node, name, nsUri, 0);
 6357|  4.89M|    if (prop == NULL)
  ------------------
  |  Branch (6357:9): [True: 4.39M, False: 508k]
  ------------------
 6358|  4.39M|	return(1);
 6359|       |
 6360|   508k|    *out = xmlGetPropNodeValueInternal(prop);
 6361|   508k|    if (*out == NULL)
  ------------------
  |  Branch (6361:9): [True: 204, False: 508k]
  ------------------
 6362|    204|        return(-1);
 6363|   508k|    return(0);
 6364|   508k|}
xmlUnsetProp:
 6466|    162|xmlUnsetProp(xmlNode *node, const xmlChar *name) {
 6467|    162|    xmlAttrPtr prop;
 6468|       |
 6469|    162|    prop = xmlGetPropNodeInternal(node, name, NULL, 0);
 6470|    162|    if (prop == NULL)
  ------------------
  |  Branch (6470:9): [True: 35, False: 127]
  ------------------
 6471|     35|	return(-1);
 6472|    127|    xmlUnlinkNodeInternal((xmlNodePtr) prop);
 6473|    127|    xmlFreeProp(prop);
 6474|    127|    return(0);
 6475|    162|}
xmlUnsetNsProp:
 6486|  6.58k|xmlUnsetNsProp(xmlNode *node, xmlNs *ns, const xmlChar *name) {
 6487|  6.58k|    xmlAttrPtr prop;
 6488|       |
 6489|  6.58k|    prop = xmlGetPropNodeInternal(node, name,
 6490|  6.58k|                                  (ns != NULL) ? ns->href : NULL, 0);
  ------------------
  |  Branch (6490:35): [True: 6.58k, False: 0]
  ------------------
 6491|  6.58k|    if (prop == NULL)
  ------------------
  |  Branch (6491:9): [True: 5.59k, False: 992]
  ------------------
 6492|  5.59k|	return(-1);
 6493|    992|    xmlUnlinkNodeInternal((xmlNodePtr) prop);
 6494|    992|    xmlFreeProp(prop);
 6495|    992|    return(0);
 6496|  6.58k|}
xmlSetNsProp:
 6551|  1.74k|{
 6552|  1.74k|    xmlAttrPtr prop;
 6553|       |
 6554|  1.74k|    if (ns && (ns->href == NULL))
  ------------------
  |  Branch (6554:9): [True: 1.74k, False: 0]
  |  Branch (6554:15): [True: 0, False: 1.74k]
  ------------------
 6555|      0|	return(NULL);
 6556|  1.74k|    if (name == NULL)
  ------------------
  |  Branch (6556:9): [True: 0, False: 1.74k]
  ------------------
 6557|      0|        return(NULL);
 6558|  1.74k|    prop = xmlGetPropNodeInternal(node, name,
 6559|  1.74k|                                  (ns != NULL) ? ns->href : NULL, 0);
  ------------------
  |  Branch (6559:35): [True: 1.74k, False: 0]
  ------------------
 6560|  1.74k|    if (prop != NULL) {
  ------------------
  |  Branch (6560:9): [True: 1.25k, False: 494]
  ------------------
 6561|  1.25k|        xmlNodePtr children = NULL;
 6562|       |
 6563|       |	/*
 6564|       |	* Modify the attribute's value.
 6565|       |	*/
 6566|  1.25k|        if (value != NULL) {
  ------------------
  |  Branch (6566:13): [True: 1.25k, False: 0]
  ------------------
 6567|  1.25k|	    children = xmlNewDocText(node->doc, value);
 6568|  1.25k|            if (children == NULL)
  ------------------
  |  Branch (6568:17): [True: 6, False: 1.24k]
  ------------------
 6569|      6|                return(NULL);
 6570|  1.25k|        }
 6571|       |
 6572|  1.24k|	if (prop->id != NULL) {
  ------------------
  |  Branch (6572:6): [True: 0, False: 1.24k]
  ------------------
 6573|      0|	    xmlRemoveID(node->doc, prop);
 6574|      0|	    prop->atype = XML_ATTRIBUTE_ID;
 6575|      0|	}
 6576|  1.24k|	if (prop->children != NULL)
  ------------------
  |  Branch (6576:6): [True: 1.22k, False: 23]
  ------------------
 6577|  1.22k|	    xmlFreeNodeList(prop->children);
 6578|  1.24k|	prop->children = NULL;
 6579|  1.24k|	prop->last = NULL;
 6580|  1.24k|	prop->ns = ns;
 6581|  1.24k|	if (value != NULL) {
  ------------------
  |  Branch (6581:6): [True: 1.24k, False: 0]
  ------------------
 6582|  1.24k|	    xmlNodePtr tmp;
 6583|       |
 6584|  1.24k|	    prop->children = children;
 6585|  1.24k|	    prop->last = NULL;
 6586|  1.24k|	    tmp = prop->children;
 6587|  2.49k|	    while (tmp != NULL) {
  ------------------
  |  Branch (6587:13): [True: 1.24k, False: 1.24k]
  ------------------
 6588|  1.24k|		tmp->parent = (xmlNodePtr) prop;
 6589|  1.24k|		if (tmp->next == NULL)
  ------------------
  |  Branch (6589:7): [True: 1.24k, False: 0]
  ------------------
 6590|  1.24k|		    prop->last = tmp;
 6591|  1.24k|		tmp = tmp->next;
 6592|  1.24k|	    }
 6593|  1.24k|	}
 6594|  1.24k|	if ((prop->atype == XML_ATTRIBUTE_ID) &&
  ------------------
  |  Branch (6594:6): [True: 0, False: 1.24k]
  ------------------
 6595|      0|	    (xmlAddIDSafe(prop, value) < 0)) {
  ------------------
  |  Branch (6595:6): [True: 0, False: 0]
  ------------------
 6596|      0|            return(NULL);
 6597|      0|        }
 6598|  1.24k|	return(prop);
 6599|  1.24k|    }
 6600|       |    /*
 6601|       |    * No equal attr found; create a new one.
 6602|       |    */
 6603|    494|    return(xmlNewPropInternal(node, ns, name, value, 0));
 6604|  1.74k|}
xmlNodeIsText:
 6613|  4.30k|xmlNodeIsText(const xmlNode *node) {
 6614|  4.30k|    if (node == NULL) return(0);
  ------------------
  |  Branch (6614:9): [True: 0, False: 4.30k]
  ------------------
 6615|       |
 6616|  4.30k|    if (node->type == XML_TEXT_NODE) return(1);
  ------------------
  |  Branch (6616:9): [True: 542, False: 3.76k]
  ------------------
 6617|  3.76k|    return(0);
 6618|  4.30k|}
xmlIsBlankNode:
 6628|  8.75k|xmlIsBlankNode(const xmlNode *node) {
 6629|  8.75k|    const xmlChar *cur;
 6630|  8.75k|    if (node == NULL) return(0);
  ------------------
  |  Branch (6630:9): [True: 0, False: 8.75k]
  ------------------
 6631|       |
 6632|  8.75k|    if ((node->type != XML_TEXT_NODE) &&
  ------------------
  |  Branch (6632:9): [True: 239, False: 8.51k]
  ------------------
 6633|    239|        (node->type != XML_CDATA_SECTION_NODE))
  ------------------
  |  Branch (6633:9): [True: 239, False: 0]
  ------------------
 6634|    239|	return(0);
 6635|  8.51k|    if (node->content == NULL) return(1);
  ------------------
  |  Branch (6635:9): [True: 297, False: 8.21k]
  ------------------
 6636|  8.21k|    cur = node->content;
 6637|  16.8k|    while (*cur != 0) {
  ------------------
  |  Branch (6637:12): [True: 13.9k, False: 2.94k]
  ------------------
 6638|  13.9k|	if (!IS_BLANK_CH(*cur)) return(0);
  ------------------
  |  |  137|  13.9k|#define IS_BLANK_CH(c)  xmlIsBlank_ch(c)
  |  |  ------------------
  |  |  |  |   90|  13.9k|#define xmlIsBlank_ch(c)	(((c) == 0x20) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (90:27): [True: 3.98k, False: 9.96k]
  |  |  |  |  ------------------
  |  |  |  |   91|  13.9k|				 ((0x9 <= (c)) && ((c) <= 0xa)) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (91:7): [True: 9.95k, False: 12]
  |  |  |  |  |  Branch (91:23): [True: 4.48k, False: 5.47k]
  |  |  |  |  ------------------
  |  |  |  |   92|  13.9k|				 ((c) == 0xd))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (92:6): [True: 214, False: 5.26k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 6639|  8.67k|	cur++;
 6640|  8.67k|    }
 6641|       |
 6642|  2.94k|    return(1);
 6643|  8.21k|}
xmlIsXHTML:
 8844|  28.8k|xmlIsXHTML(const xmlChar *systemID, const xmlChar *publicID) {
 8845|  28.8k|    if ((systemID == NULL) && (publicID == NULL))
  ------------------
  |  Branch (8845:9): [True: 9.41k, False: 19.4k]
  |  Branch (8845:31): [True: 9.41k, False: 0]
  ------------------
 8846|  9.41k|	return(-1);
 8847|  19.4k|    if (publicID != NULL) {
  ------------------
  |  Branch (8847:9): [True: 18.5k, False: 952]
  ------------------
 8848|  18.5k|	if (xmlStrEqual(publicID, XHTML_STRICT_PUBLIC_ID)) return(1);
  ------------------
  |  | 8823|  18.5k|#define XHTML_STRICT_PUBLIC_ID BAD_CAST \
  |  |  ------------------
  |  |  |  |   34|  18.5k|#define BAD_CAST (xmlChar *)
  |  |  ------------------
  |  | 8824|  18.5k|   "-//W3C//DTD XHTML 1.0 Strict//EN"
  ------------------
  |  Branch (8848:6): [True: 687, False: 17.8k]
  ------------------
 8849|  17.8k|	if (xmlStrEqual(publicID, XHTML_FRAME_PUBLIC_ID)) return(1);
  ------------------
  |  | 8827|  17.8k|#define XHTML_FRAME_PUBLIC_ID BAD_CAST \
  |  |  ------------------
  |  |  |  |   34|  17.8k|#define BAD_CAST (xmlChar *)
  |  |  ------------------
  |  | 8828|  17.8k|   "-//W3C//DTD XHTML 1.0 Frameset//EN"
  ------------------
  |  Branch (8849:6): [True: 6.66k, False: 11.1k]
  ------------------
 8850|  11.1k|	if (xmlStrEqual(publicID, XHTML_TRANS_PUBLIC_ID)) return(1);
  ------------------
  |  | 8831|  11.1k|#define XHTML_TRANS_PUBLIC_ID BAD_CAST \
  |  |  ------------------
  |  |  |  |   34|  11.1k|#define BAD_CAST (xmlChar *)
  |  |  ------------------
  |  | 8832|  11.1k|   "-//W3C//DTD XHTML 1.0 Transitional//EN"
  ------------------
  |  Branch (8850:6): [True: 1.58k, False: 9.59k]
  ------------------
 8851|  11.1k|    }
 8852|  10.5k|    if (systemID != NULL) {
  ------------------
  |  Branch (8852:9): [True: 10.5k, False: 0]
  ------------------
 8853|  10.5k|	if (xmlStrEqual(systemID, XHTML_STRICT_SYSTEM_ID)) return(1);
  ------------------
  |  | 8825|  10.5k|#define XHTML_STRICT_SYSTEM_ID BAD_CAST \
  |  |  ------------------
  |  |  |  |   34|  10.5k|#define BAD_CAST (xmlChar *)
  |  |  ------------------
  |  | 8826|  10.5k|   "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"
  ------------------
  |  Branch (8853:6): [True: 7.77k, False: 2.77k]
  ------------------
 8854|  2.77k|	if (xmlStrEqual(systemID, XHTML_FRAME_SYSTEM_ID)) return(1);
  ------------------
  |  | 8829|  2.77k|#define XHTML_FRAME_SYSTEM_ID BAD_CAST \
  |  |  ------------------
  |  |  |  |   34|  2.77k|#define BAD_CAST (xmlChar *)
  |  |  ------------------
  |  | 8830|  2.77k|   "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd"
  ------------------
  |  Branch (8854:6): [True: 802, False: 1.96k]
  ------------------
 8855|  1.96k|	if (xmlStrEqual(systemID, XHTML_TRANS_SYSTEM_ID)) return(1);
  ------------------
  |  | 8833|  1.96k|#define XHTML_TRANS_SYSTEM_ID BAD_CAST \
  |  |  ------------------
  |  |  |  |   34|  1.96k|#define BAD_CAST (xmlChar *)
  |  |  ------------------
  |  | 8834|  1.96k|   "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"
  ------------------
  |  Branch (8855:6): [True: 117, False: 1.85k]
  ------------------
 8856|  1.96k|    }
 8857|  1.85k|    return(0);
 8858|  10.5k|}
tree.c:xmlNewPropInternal:
 1435|  75.3k|{
 1436|  75.3k|    xmlAttrPtr cur;
 1437|  75.3k|    xmlDocPtr doc = NULL;
 1438|       |
 1439|  75.3k|    if ((node != NULL) && (node->type != XML_ELEMENT_NODE)) {
  ------------------
  |  Branch (1439:9): [True: 75.3k, False: 0]
  |  Branch (1439:27): [True: 0, False: 75.3k]
  ------------------
 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|  75.3k|    cur = (xmlAttrPtr) xmlMalloc(sizeof(xmlAttr));
 1451|  75.3k|    if (cur == NULL) {
  ------------------
  |  Branch (1451:9): [True: 19, False: 75.3k]
  ------------------
 1452|     19|        if ((eatname == 1) &&
  ------------------
  |  Branch (1452:13): [True: 0, False: 19]
  ------------------
 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|     19|        return (NULL);
 1458|     19|    }
 1459|  75.3k|    memset(cur, 0, sizeof(xmlAttr));
 1460|  75.3k|    cur->type = XML_ATTRIBUTE_NODE;
 1461|       |
 1462|  75.3k|    cur->parent = node;
 1463|  75.3k|    if (node != NULL) {
  ------------------
  |  Branch (1463:9): [True: 75.3k, False: 0]
  ------------------
 1464|  75.3k|        doc = node->doc;
 1465|  75.3k|        cur->doc = doc;
 1466|  75.3k|    }
 1467|  75.3k|    cur->ns = ns;
 1468|       |
 1469|  75.3k|    if (eatname == 0) {
  ------------------
  |  Branch (1469:9): [True: 75.3k, False: 0]
  ------------------
 1470|  75.3k|        if ((doc != NULL) && (doc->dict != NULL))
  ------------------
  |  Branch (1470:13): [True: 75.3k, False: 0]
  |  Branch (1470:30): [True: 26.3k, False: 49.0k]
  ------------------
 1471|  26.3k|            cur->name = (xmlChar *) xmlDictLookup(doc->dict, name, -1);
 1472|  49.0k|        else
 1473|  49.0k|            cur->name = xmlStrdup(name);
 1474|  75.3k|        if (cur->name == NULL)
  ------------------
  |  Branch (1474:13): [True: 15, False: 75.3k]
  ------------------
 1475|     15|            goto error;
 1476|  75.3k|    } else
 1477|      0|        cur->name = name;
 1478|       |
 1479|  75.3k|    if (value != NULL) {
  ------------------
  |  Branch (1479:9): [True: 493, False: 74.8k]
  ------------------
 1480|    493|        xmlNodePtr tmp;
 1481|       |
 1482|    493|        cur->children = xmlNewDocText(doc, value);
 1483|    493|        if (cur->children == NULL)
  ------------------
  |  Branch (1483:13): [True: 4, False: 489]
  ------------------
 1484|      4|            goto error;
 1485|    489|        cur->last = NULL;
 1486|    489|        tmp = cur->children;
 1487|    978|        while (tmp != NULL) {
  ------------------
  |  Branch (1487:16): [True: 489, False: 489]
  ------------------
 1488|    489|            tmp->parent = (xmlNodePtr) cur;
 1489|    489|            if (tmp->next == NULL)
  ------------------
  |  Branch (1489:17): [True: 489, False: 0]
  ------------------
 1490|    489|                cur->last = tmp;
 1491|    489|            tmp = tmp->next;
 1492|    489|        }
 1493|       |
 1494|    489|        if (doc != NULL) {
  ------------------
  |  Branch (1494:13): [True: 489, False: 0]
  ------------------
 1495|    489|            int res = xmlIsID(doc, node, cur);
 1496|       |
 1497|    489|            if (res < 0)
  ------------------
  |  Branch (1497:17): [True: 1, False: 488]
  ------------------
 1498|      1|                goto error;
 1499|    488|            if ((res == 1) && (xmlAddIDSafe(cur, value) < 0))
  ------------------
  |  Branch (1499:17): [True: 0, False: 488]
  |  Branch (1499:31): [True: 0, False: 0]
  ------------------
 1500|      0|                goto error;
 1501|    488|        }
 1502|    489|    }
 1503|       |
 1504|       |    /*
 1505|       |     * Add it at the end to preserve parsing order ...
 1506|       |     */
 1507|  75.3k|    if (node != NULL) {
  ------------------
  |  Branch (1507:9): [True: 75.3k, False: 0]
  ------------------
 1508|  75.3k|        if (node->properties == NULL) {
  ------------------
  |  Branch (1508:13): [True: 54.4k, False: 20.8k]
  ------------------
 1509|  54.4k|            node->properties = cur;
 1510|  54.4k|        } else {
 1511|  20.8k|            xmlAttrPtr prev = node->properties;
 1512|       |
 1513|   164k|            while (prev->next != NULL)
  ------------------
  |  Branch (1513:20): [True: 143k, False: 20.8k]
  ------------------
 1514|   143k|                prev = prev->next;
 1515|  20.8k|            prev->next = cur;
 1516|  20.8k|            cur->prev = prev;
 1517|  20.8k|        }
 1518|  75.3k|    }
 1519|       |
 1520|  75.3k|    if ((xmlRegisterCallbacks) && (xmlRegisterNodeDefaultValue))
  ------------------
  |  |  932|      0|    (*__xmlRegisterNodeDefaultValue())
  ------------------
  |  Branch (1520:9): [True: 0, False: 75.3k]
  |  Branch (1520:35): [True: 0, False: 0]
  ------------------
 1521|      0|        xmlRegisterNodeDefaultValue((xmlNodePtr) cur);
  ------------------
  |  |  932|      0|    (*__xmlRegisterNodeDefaultValue())
  ------------------
 1522|  75.3k|    return (cur);
 1523|       |
 1524|     20|error:
 1525|     20|    xmlFreeProp(cur);
 1526|       |    return(NULL);
 1527|  75.3k|}
tree.c:xmlNewElem:
 1842|   790k|           const xmlChar *content) {
 1843|   790k|    xmlNodePtr cur;
 1844|       |
 1845|   790k|    cur = (xmlNodePtr) xmlMalloc(sizeof(xmlNode));
 1846|   790k|    if (cur == NULL)
  ------------------
  |  Branch (1846:9): [True: 93, False: 790k]
  ------------------
 1847|     93|	return(NULL);
 1848|   790k|    memset(cur, 0, sizeof(xmlNode));
 1849|       |
 1850|   790k|    cur->type = XML_ELEMENT_NODE;
 1851|   790k|    cur->doc = doc;
 1852|   790k|    cur->name = name;
 1853|   790k|    cur->ns = ns;
 1854|       |
 1855|   790k|    if (content != NULL) {
  ------------------
  |  Branch (1855:9): [True: 0, False: 790k]
  ------------------
 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|   790k|    if ((xmlRegisterCallbacks) && (xmlRegisterNodeDefaultValue))
  ------------------
  |  |  932|      0|    (*__xmlRegisterNodeDefaultValue())
  ------------------
  |  Branch (1868:9): [True: 0, False: 790k]
  |  Branch (1868:35): [True: 0, False: 0]
  ------------------
 1869|      0|	xmlRegisterNodeDefaultValue((xmlNodePtr)cur);
  ------------------
  |  |  932|      0|    (*__xmlRegisterNodeDefaultValue())
  ------------------
 1870|       |
 1871|   790k|    return(cur);
 1872|   790k|}
tree.c:xmlNewEntityRef:
 2137|  18.2k|xmlNewEntityRef(xmlDocPtr doc, xmlChar *name) {
 2138|  18.2k|    xmlNodePtr cur;
 2139|       |
 2140|       |    /*
 2141|       |     * Allocate a new node and fill the fields.
 2142|       |     */
 2143|  18.2k|    cur = (xmlNodePtr) xmlMalloc(sizeof(xmlNode));
 2144|  18.2k|    if (cur == NULL) {
  ------------------
  |  Branch (2144:9): [True: 5, False: 18.2k]
  ------------------
 2145|      5|        xmlFree(name);
 2146|      5|	return(NULL);
 2147|      5|    }
 2148|  18.2k|    memset(cur, 0, sizeof(xmlNode));
 2149|  18.2k|    cur->type = XML_ENTITY_REF_NODE;
 2150|  18.2k|    cur->doc = doc;
 2151|  18.2k|    cur->name = name;
 2152|       |
 2153|  18.2k|    if ((xmlRegisterCallbacks) && (xmlRegisterNodeDefaultValue))
  ------------------
  |  |  932|      0|    (*__xmlRegisterNodeDefaultValue())
  ------------------
  |  Branch (2153:9): [True: 0, False: 18.2k]
  |  Branch (2153:35): [True: 0, False: 0]
  ------------------
 2154|      0|	xmlRegisterNodeDefaultValue(cur);
  ------------------
  |  |  932|      0|    (*__xmlRegisterNodeDefaultValue())
  ------------------
 2155|       |
 2156|  18.2k|    return(cur);
 2157|  18.2k|}
tree.c:xmlInsertNode:
 2791|   246k|              xmlNodePtr prev, xmlNodePtr next, int coalesce) {
 2792|   246k|    xmlNodePtr oldParent;
 2793|       |
 2794|   246k|    if (cur->type == XML_ATTRIBUTE_NODE)
  ------------------
  |  Branch (2794:9): [True: 0, False: 246k]
  ------------------
 2795|      0|	return xmlInsertProp(doc, cur, parent, prev, next);
 2796|       |
 2797|       |    /*
 2798|       |     * Coalesce text nodes
 2799|       |     */
 2800|   246k|    if ((coalesce) && (cur->type == XML_TEXT_NODE)) {
  ------------------
  |  Branch (2800:9): [True: 0, False: 246k]
  |  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|   246k|    oldParent = cur->parent;
 2829|   246k|    if (oldParent != NULL) {
  ------------------
  |  Branch (2829:9): [True: 0, False: 246k]
  ------------------
 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|   246k|    if (cur->next != NULL)
  ------------------
  |  Branch (2835:9): [True: 229k, False: 16.5k]
  ------------------
 2836|   229k|        cur->next->prev = cur->prev;
 2837|   246k|    if (cur->prev != NULL)
  ------------------
  |  Branch (2837:9): [True: 0, False: 246k]
  ------------------
 2838|      0|        cur->prev->next = cur->next;
 2839|       |
 2840|   246k|    if (cur->doc != doc) {
  ------------------
  |  Branch (2840:9): [True: 0, False: 246k]
  ------------------
 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|   246k|    cur->parent = parent;
 2857|   246k|    cur->prev = prev;
 2858|   246k|    cur->next = next;
 2859|       |
 2860|   246k|    if (prev == NULL) {
  ------------------
  |  Branch (2860:9): [True: 0, False: 246k]
  ------------------
 2861|      0|        if (parent != NULL)
  ------------------
  |  Branch (2861:13): [True: 0, False: 0]
  ------------------
 2862|      0|            parent->children = cur;
 2863|   246k|    } else {
 2864|   246k|        prev->next = cur;
 2865|   246k|    }
 2866|   246k|    if (next == NULL) {
  ------------------
  |  Branch (2866:9): [True: 1.11k, False: 245k]
  ------------------
 2867|  1.11k|        if (parent != NULL)
  ------------------
  |  Branch (2867:13): [True: 1.11k, False: 0]
  ------------------
 2868|  1.11k|            parent->last = cur;
 2869|   245k|    } else {
 2870|   245k|        next->prev = cur;
 2871|   245k|    }
 2872|       |
 2873|   246k|    return(cur);
 2874|   246k|}
tree.c:xmlTextSetContent:
 2717|     23|xmlTextSetContent(xmlNodePtr text, xmlChar *content) {
 2718|     23|    if ((text->content != NULL) &&
  ------------------
  |  Branch (2718:9): [True: 0, False: 23]
  ------------------
 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|     23|    text->content = content;
 2729|       |    text->properties = NULL;
 2730|     23|}
tree.c:xmlTextAddContent:
 2733|     24|xmlTextAddContent(xmlNodePtr text, const xmlChar *content, int len) {
 2734|     24|    xmlChar *merged;
 2735|       |
 2736|     24|    if (content == NULL)
  ------------------
  |  Branch (2736:9): [True: 0, False: 24]
  ------------------
 2737|      0|        return(0);
 2738|       |
 2739|     24|    merged = xmlStrncatNew(text->content, content, len);
 2740|     24|    if (merged == NULL)
  ------------------
  |  Branch (2740:9): [True: 1, False: 23]
  ------------------
 2741|      1|        return(-1);
 2742|       |
 2743|     23|    xmlTextSetContent(text, merged);
 2744|     23|    return(0);
 2745|     24|}
tree.c:xmlUnlinkNodeInternal:
 3484|   606k|xmlUnlinkNodeInternal(xmlNodePtr cur) {
 3485|   606k|    if (cur->parent != NULL) {
  ------------------
  |  Branch (3485:9): [True: 571k, False: 35.7k]
  ------------------
 3486|   571k|	xmlNodePtr parent;
 3487|   571k|	parent = cur->parent;
 3488|   571k|	if (cur->type == XML_ATTRIBUTE_NODE) {
  ------------------
  |  Branch (3488:6): [True: 1.11k, False: 569k]
  ------------------
 3489|  1.11k|	    if (parent->properties == (xmlAttrPtr) cur)
  ------------------
  |  Branch (3489:10): [True: 1.05k, False: 65]
  ------------------
 3490|  1.05k|		parent->properties = ((xmlAttrPtr) cur)->next;
 3491|   569k|	} else {
 3492|   569k|	    if (parent->children == cur)
  ------------------
  |  Branch (3492:10): [True: 192k, False: 377k]
  ------------------
 3493|   192k|		parent->children = cur->next;
 3494|   569k|	    if (parent->last == cur)
  ------------------
  |  Branch (3494:10): [True: 34.3k, False: 535k]
  ------------------
 3495|  34.3k|		parent->last = cur->prev;
 3496|   569k|	}
 3497|   571k|	cur->parent = NULL;
 3498|   571k|    }
 3499|       |
 3500|   606k|    if (cur->next != NULL)
  ------------------
  |  Branch (3500:9): [True: 535k, False: 70.8k]
  ------------------
 3501|   535k|        cur->next->prev = cur->prev;
 3502|   606k|    if (cur->prev != NULL)
  ------------------
  |  Branch (3502:9): [True: 377k, False: 229k]
  ------------------
 3503|   377k|        cur->prev->next = cur->next;
 3504|   606k|    cur->next = NULL;
 3505|       |    cur->prev = NULL;
 3506|   606k|}
tree.c:xmlCopyPropInternal:
 3659|   968k|xmlCopyPropInternal(xmlDocPtr doc, xmlNodePtr target, xmlAttrPtr cur) {
 3660|   968k|    xmlAttrPtr ret = NULL;
 3661|       |
 3662|   968k|    if (cur == NULL) return(NULL);
  ------------------
  |  Branch (3662:9): [True: 0, False: 968k]
  ------------------
 3663|   968k|    if ((target != NULL) && (target->type != XML_ELEMENT_NODE))
  ------------------
  |  Branch (3663:9): [True: 968k, False: 0]
  |  Branch (3663:29): [True: 0, False: 968k]
  ------------------
 3664|      0|        return(NULL);
 3665|   968k|    if (target != NULL)
  ------------------
  |  Branch (3665:9): [True: 968k, False: 0]
  ------------------
 3666|   968k|	ret = xmlNewDocProp(target->doc, cur->name, NULL);
 3667|      0|    else if (doc != NULL)
  ------------------
  |  Branch (3667:14): [True: 0, False: 0]
  ------------------
 3668|      0|	ret = xmlNewDocProp(doc, cur->name, NULL);
 3669|      0|    else if (cur->parent != NULL)
  ------------------
  |  Branch (3669:14): [True: 0, False: 0]
  ------------------
 3670|      0|	ret = xmlNewDocProp(cur->parent->doc, cur->name, NULL);
 3671|      0|    else if (cur->children != NULL)
  ------------------
  |  Branch (3671:14): [True: 0, False: 0]
  ------------------
 3672|      0|	ret = xmlNewDocProp(cur->children->doc, cur->name, NULL);
 3673|      0|    else
 3674|      0|	ret = xmlNewDocProp(NULL, cur->name, NULL);
 3675|   968k|    if (ret == NULL) return(NULL);
  ------------------
  |  Branch (3675:9): [True: 2.11k, False: 966k]
  ------------------
 3676|   966k|    ret->parent = target;
 3677|       |
 3678|   966k|    if ((cur->ns != NULL) && (target != NULL)) {
  ------------------
  |  Branch (3678:9): [True: 457k, False: 508k]
  |  Branch (3678:30): [True: 457k, False: 0]
  ------------------
 3679|   457k|      xmlNsPtr ns;
 3680|   457k|      int res;
 3681|       |
 3682|   457k|      res = xmlSearchNsSafe(target, cur->ns->prefix, &ns);
 3683|   457k|      if (res < 0)
  ------------------
  |  Branch (3683:11): [True: 1, False: 457k]
  ------------------
 3684|      1|          goto error;
 3685|   457k|      if (ns == NULL) {
  ------------------
  |  Branch (3685:11): [True: 509, False: 457k]
  ------------------
 3686|       |        /*
 3687|       |         * Humm, we are copying an element whose namespace is defined
 3688|       |         * out of the new tree scope. Search it in the original tree
 3689|       |         * and add it at the top of the new tree
 3690|       |         */
 3691|    509|        res = xmlSearchNsSafe(cur->parent, cur->ns->prefix, &ns);
 3692|    509|        if (res < 0)
  ------------------
  |  Branch (3692:13): [True: 0, False: 509]
  ------------------
 3693|      0|          goto error;
 3694|    509|        if (ns != NULL) {
  ------------------
  |  Branch (3694:13): [True: 509, False: 0]
  ------------------
 3695|    509|          xmlNodePtr root = target;
 3696|    509|          xmlNodePtr pred = NULL;
 3697|       |
 3698|    750|          while (root->parent != NULL) {
  ------------------
  |  Branch (3698:18): [True: 241, False: 509]
  ------------------
 3699|    241|            pred = root;
 3700|    241|            root = root->parent;
 3701|    241|          }
 3702|    509|          if (root == (xmlNodePtr) target->doc) {
  ------------------
  |  Branch (3702:15): [True: 0, False: 509]
  ------------------
 3703|       |            /* correct possibly cycling above the document elt */
 3704|      0|            root = pred;
 3705|      0|          }
 3706|    509|          ret->ns = xmlNewNs(root, ns->href, ns->prefix);
 3707|    509|          if (ret->ns == NULL)
  ------------------
  |  Branch (3707:15): [True: 1, False: 508]
  ------------------
 3708|      1|              goto error;
 3709|    509|        }
 3710|   457k|      } else {
 3711|       |        /*
 3712|       |         * we have to find something appropriate here since
 3713|       |         * we can't be sure, that the namespace we found is identified
 3714|       |         * by the prefix
 3715|       |         */
 3716|   457k|        if (xmlStrEqual(ns->href, cur->ns->href)) {
  ------------------
  |  Branch (3716:13): [True: 455k, False: 1.87k]
  ------------------
 3717|       |          /* this is the nice case */
 3718|   455k|          ret->ns = ns;
 3719|   455k|        } else {
 3720|       |          /*
 3721|       |           * we are in trouble: we need a new reconciled namespace.
 3722|       |           * This is expensive
 3723|       |           */
 3724|  1.87k|          ret->ns = xmlNewReconciledNs(target, cur->ns);
 3725|  1.87k|          if (ret->ns == NULL)
  ------------------
  |  Branch (3725:15): [True: 1, False: 1.87k]
  ------------------
 3726|      1|              goto error;
 3727|  1.87k|        }
 3728|   457k|      }
 3729|       |
 3730|   457k|    } else
 3731|   508k|        ret->ns = NULL;
 3732|       |
 3733|   966k|    if (cur->children != NULL) {
  ------------------
  |  Branch (3733:9): [True: 788k, False: 178k]
  ------------------
 3734|   788k|	xmlNodePtr tmp;
 3735|       |
 3736|   788k|	ret->children = xmlStaticCopyNodeList(cur->children, ret->doc, (xmlNodePtr) ret);
 3737|   788k|        if (ret->children == NULL)
  ------------------
  |  Branch (3737:13): [True: 26, False: 788k]
  ------------------
 3738|     26|            goto error;
 3739|   788k|	ret->last = NULL;
 3740|   788k|	tmp = ret->children;
 3741|  1.57M|	while (tmp != NULL) {
  ------------------
  |  Branch (3741:9): [True: 788k, False: 788k]
  ------------------
 3742|       |	    /* tmp->parent = (xmlNodePtr)ret; */
 3743|   788k|	    if (tmp->next == NULL)
  ------------------
  |  Branch (3743:10): [True: 788k, False: 633]
  ------------------
 3744|   788k|	        ret->last = tmp;
 3745|   788k|	    tmp = tmp->next;
 3746|   788k|	}
 3747|   788k|    }
 3748|       |    /*
 3749|       |     * Try to handle IDs
 3750|       |     */
 3751|   966k|    if ((target != NULL) && (cur != NULL) &&
  ------------------
  |  Branch (3751:9): [True: 966k, False: 0]
  |  Branch (3751:29): [True: 966k, False: 0]
  ------------------
 3752|   966k|	(target->doc != NULL) && (cur->doc != NULL) &&
  ------------------
  |  Branch (3752:2): [True: 966k, False: 0]
  |  Branch (3752:27): [True: 966k, False: 0]
  ------------------
 3753|   966k|        (cur->parent != NULL) &&
  ------------------
  |  Branch (3753:9): [True: 966k, False: 0]
  ------------------
 3754|   966k|        (cur->children != NULL)) {
  ------------------
  |  Branch (3754:9): [True: 788k, False: 178k]
  ------------------
 3755|   788k|        int res = xmlIsID(cur->doc, cur->parent, cur);
 3756|       |
 3757|   788k|        if (res < 0)
  ------------------
  |  Branch (3757:13): [True: 2, False: 788k]
  ------------------
 3758|      2|            goto error;
 3759|   788k|	if (res != 0) {
  ------------------
  |  Branch (3759:6): [True: 5.25k, False: 782k]
  ------------------
 3760|  5.25k|	    xmlChar *id;
 3761|       |
 3762|  5.25k|	    id = xmlNodeGetContent((xmlNodePtr) cur);
 3763|  5.25k|	    if (id == NULL)
  ------------------
  |  Branch (3763:10): [True: 3, False: 5.25k]
  ------------------
 3764|      3|                goto error;
 3765|  5.25k|            res = xmlAddIDSafe(ret, id);
 3766|  5.25k|	    xmlFree(id);
 3767|  5.25k|            if (res < 0)
  ------------------
  |  Branch (3767:17): [True: 4, False: 5.24k]
  ------------------
 3768|      4|                goto error;
 3769|  5.25k|	}
 3770|   788k|    }
 3771|   966k|    return(ret);
 3772|       |
 3773|     38|error:
 3774|     38|    xmlFreeProp(ret);
 3775|       |    return(NULL);
 3776|   966k|}
tree.c:xmlGetLineNoInternal:
 4396|  83.7k|{
 4397|  83.7k|    long result = -1;
 4398|       |
 4399|  83.7k|    if (depth >= 5)
  ------------------
  |  Branch (4399:9): [True: 5.61k, False: 78.1k]
  ------------------
 4400|  5.61k|        return(-1);
 4401|       |
 4402|  78.1k|    if (!node)
  ------------------
  |  Branch (4402:9): [True: 0, False: 78.1k]
  ------------------
 4403|      0|        return result;
 4404|  78.1k|    if ((node->type == XML_ELEMENT_NODE) ||
  ------------------
  |  Branch (4404:9): [True: 63.7k, False: 14.4k]
  ------------------
 4405|  14.4k|        (node->type == XML_TEXT_NODE) ||
  ------------------
  |  Branch (4405:9): [True: 12.8k, False: 1.59k]
  ------------------
 4406|  1.59k|	(node->type == XML_COMMENT_NODE) ||
  ------------------
  |  Branch (4406:2): [True: 82, False: 1.51k]
  ------------------
 4407|  77.3k|	(node->type == XML_PI_NODE)) {
  ------------------
  |  Branch (4407:2): [True: 663, False: 850]
  ------------------
 4408|  77.3k|	if (node->line == 65535) {
  ------------------
  |  Branch (4408:6): [True: 60.8k, False: 16.5k]
  ------------------
 4409|  60.8k|	    if ((node->type == XML_TEXT_NODE) && (node->psvi != NULL))
  ------------------
  |  Branch (4409:10): [True: 12.8k, False: 47.9k]
  |  Branch (4409:43): [True: 4.50k, False: 8.33k]
  ------------------
 4410|  4.50k|	        result = XML_PTR_TO_INT(node->psvi);
  ------------------
  |  |   58|  4.50k|#define XML_PTR_TO_INT(p) ((XML_INTPTR_T) (p))
  ------------------
 4411|  56.2k|	    else if ((node->type == XML_ELEMENT_NODE) &&
  ------------------
  |  Branch (4411:15): [True: 47.2k, False: 9.07k]
  ------------------
 4412|  47.2k|	             (node->children != NULL))
  ------------------
  |  Branch (4412:15): [True: 11.0k, False: 36.1k]
  ------------------
 4413|  11.0k|	        result = xmlGetLineNoInternal(node->children, depth + 1);
 4414|  45.2k|	    else if (node->next != NULL)
  ------------------
  |  Branch (4414:15): [True: 11.0k, False: 34.1k]
  ------------------
 4415|  11.0k|	        result = xmlGetLineNoInternal(node->next, depth + 1);
 4416|  34.1k|	    else if (node->prev != NULL)
  ------------------
  |  Branch (4416:15): [True: 19.2k, False: 14.8k]
  ------------------
 4417|  19.2k|	        result = xmlGetLineNoInternal(node->prev, depth + 1);
 4418|  60.8k|	}
 4419|  77.3k|	if ((result == -1) || (result == 65535))
  ------------------
  |  Branch (4419:6): [True: 36.9k, False: 40.3k]
  |  Branch (4419:24): [True: 23.2k, False: 17.0k]
  ------------------
 4420|  60.2k|	    result = node->line;
 4421|  77.3k|    } else if ((node->prev != NULL) &&
  ------------------
  |  Branch (4421:16): [True: 744, False: 106]
  ------------------
 4422|    744|             ((node->prev->type == XML_ELEMENT_NODE) ||
  ------------------
  |  Branch (4422:15): [True: 111, False: 633]
  ------------------
 4423|    633|	      (node->prev->type == XML_TEXT_NODE) ||
  ------------------
  |  Branch (4423:8): [True: 243, False: 390]
  ------------------
 4424|    390|	      (node->prev->type == XML_COMMENT_NODE) ||
  ------------------
  |  Branch (4424:8): [True: 0, False: 390]
  ------------------
 4425|    390|	      (node->prev->type == XML_PI_NODE)))
  ------------------
  |  Branch (4425:8): [True: 69, False: 321]
  ------------------
 4426|    423|        result = xmlGetLineNoInternal(node->prev, depth + 1);
 4427|    427|    else if ((node->parent != NULL) &&
  ------------------
  |  Branch (4427:14): [True: 427, False: 0]
  ------------------
 4428|    427|             (node->parent->type == XML_ELEMENT_NODE))
  ------------------
  |  Branch (4428:14): [True: 426, False: 1]
  ------------------
 4429|    426|        result = xmlGetLineNoInternal(node->parent, depth + 1);
 4430|       |
 4431|  78.1k|    return result;
 4432|  78.1k|}
tree.c:xmlBufGetChildContent:
 5155|   164k|xmlBufGetChildContent(xmlBufPtr buf, const xmlNode *tree) {
 5156|   164k|    const xmlNode *cur = tree->children;
 5157|       |
 5158|  19.5M|    while (cur != NULL) {
  ------------------
  |  Branch (5158:12): [True: 19.5M, False: 1.77k]
  ------------------
 5159|  19.5M|        switch (cur->type) {
 5160|  3.97M|            case XML_TEXT_NODE:
  ------------------
  |  Branch (5160:13): [True: 3.97M, False: 15.5M]
  ------------------
 5161|  3.99M|            case XML_CDATA_SECTION_NODE:
  ------------------
  |  Branch (5161:13): [True: 25.5k, False: 19.4M]
  ------------------
 5162|  3.99M|                xmlBufCat(buf, cur->content);
 5163|  3.99M|                break;
 5164|       |
 5165|  2.19k|            case XML_ENTITY_REF_NODE:
  ------------------
  |  Branch (5165:13): [True: 2.19k, False: 19.5M]
  ------------------
 5166|  2.19k|                xmlBufGetEntityRefContent(buf, cur);
 5167|  2.19k|                break;
 5168|       |
 5169|  15.5M|            default:
  ------------------
  |  Branch (5169:13): [True: 15.5M, False: 4.00M]
  ------------------
 5170|  15.5M|                if (cur->children != NULL) {
  ------------------
  |  Branch (5170:21): [True: 13.8M, False: 1.67M]
  ------------------
 5171|  13.8M|                    cur = cur->children;
 5172|  13.8M|                    continue;
 5173|  13.8M|                }
 5174|  1.67M|                break;
 5175|  19.5M|        }
 5176|       |
 5177|  19.5M|        while (cur->next == NULL) {
  ------------------
  |  Branch (5177:16): [True: 14.0M, False: 5.50M]
  ------------------
 5178|  14.0M|            cur = cur->parent;
 5179|  14.0M|            if (cur == tree)
  ------------------
  |  Branch (5179:17): [True: 162k, False: 13.8M]
  ------------------
 5180|   162k|                return;
 5181|  14.0M|        }
 5182|  5.50M|        cur = cur->next;
 5183|  5.50M|    }
 5184|   164k|}
tree.c:xmlBufGetEntityRefContent:
 5124|  2.92k|xmlBufGetEntityRefContent(xmlBufPtr buf, const xmlNode *ref) {
 5125|  2.92k|    xmlEntityPtr ent;
 5126|       |
 5127|  2.92k|    if (ref->children != NULL) {
  ------------------
  |  Branch (5127:9): [True: 2.66k, False: 254]
  ------------------
 5128|  2.66k|        ent = (xmlEntityPtr) ref->children;
 5129|  2.66k|    } else {
 5130|       |        /* lookup entity declaration */
 5131|    254|        ent = xmlGetDocEntity(ref->doc, ref->name);
 5132|    254|        if (ent == NULL)
  ------------------
  |  Branch (5132:13): [True: 254, False: 0]
  ------------------
 5133|    254|            return;
 5134|    254|    }
 5135|       |
 5136|       |    /*
 5137|       |     * The parser should always expand predefined entities but it's
 5138|       |     * possible to create references to predefined entities using
 5139|       |     * the tree API.
 5140|       |     */
 5141|  2.66k|    if (ent->etype == XML_INTERNAL_PREDEFINED_ENTITY) {
  ------------------
  |  Branch (5141:9): [True: 0, False: 2.66k]
  ------------------
 5142|      0|        xmlBufCat(buf, ent->content);
 5143|      0|        return;
 5144|      0|    }
 5145|       |
 5146|  2.66k|    if (ent->flags & XML_ENT_EXPANDING)
  ------------------
  |  |   22|  2.66k|#define XML_ENT_EXPANDING   (1u << 3)
  ------------------
  |  Branch (5146:9): [True: 0, False: 2.66k]
  ------------------
 5147|      0|        return;
 5148|       |
 5149|  2.66k|    ent->flags |= XML_ENT_EXPANDING;
  ------------------
  |  |   22|  2.66k|#define XML_ENT_EXPANDING   (1u << 3)
  ------------------
 5150|  2.66k|    xmlBufGetChildContent(buf, (xmlNodePtr) ent);
 5151|  2.66k|    ent->flags &= ~XML_ENT_EXPANDING;
  ------------------
  |  |   22|  2.66k|#define XML_ENT_EXPANDING   (1u << 3)
  ------------------
 5152|  2.66k|}
tree.c:xmlTreeEnsureXMLDecl:
 5624|   523k|{
 5625|   523k|    xmlNsPtr ns;
 5626|       |
 5627|   523k|    ns = doc->oldNs;
 5628|   523k|    if (ns != NULL)
  ------------------
  |  Branch (5628:9): [True: 518k, False: 5.42k]
  ------------------
 5629|   518k|	return (ns);
 5630|       |
 5631|  5.42k|    ns = xmlNewXmlNs();
 5632|  5.42k|    doc->oldNs = ns;
 5633|       |
 5634|  5.42k|    return(ns);
 5635|   523k|}
tree.c:xmlNewXmlNs:
 5592|  5.42k|xmlNewXmlNs(void) {
 5593|  5.42k|    xmlNsPtr ns;
 5594|       |
 5595|  5.42k|    ns = (xmlNsPtr) xmlMalloc(sizeof(xmlNs));
 5596|  5.42k|    if (ns == NULL)
  ------------------
  |  Branch (5596:9): [True: 9, False: 5.41k]
  ------------------
 5597|      9|        return(NULL);
 5598|  5.41k|    memset(ns, 0, sizeof(xmlNs));
 5599|  5.41k|    ns->type = XML_LOCAL_NAMESPACE;
  ------------------
  |  |  500|  5.41k|#define XML_LOCAL_NAMESPACE XML_NAMESPACE_DECL
  ------------------
 5600|  5.41k|    ns->href = xmlStrdup(XML_XML_NAMESPACE);
  ------------------
  |  |  146|  5.41k|    (const xmlChar *) "http://www.w3.org/XML/1998/namespace"
  ------------------
 5601|  5.41k|    if (ns->href == NULL) {
  ------------------
  |  Branch (5601:9): [True: 10, False: 5.40k]
  ------------------
 5602|     10|        xmlFreeNs(ns);
 5603|     10|        return(NULL);
 5604|     10|    }
 5605|  5.40k|    ns->prefix = xmlStrdup(BAD_CAST "xml");
  ------------------
  |  |   34|  5.40k|#define BAD_CAST (xmlChar *)
  ------------------
 5606|  5.40k|    if (ns->prefix == NULL) {
  ------------------
  |  Branch (5606:9): [True: 7, False: 5.39k]
  ------------------
 5607|      7|        xmlFreeNs(ns);
 5608|      7|        return(NULL);
 5609|      7|    }
 5610|       |
 5611|  5.39k|    return(ns);
 5612|  5.40k|}
tree.c:xmlNsInScope:
 5757|  11.3k|{
 5758|  11.3k|    xmlNsPtr tst;
 5759|       |
 5760|  61.0k|    while ((node != NULL) && (node != ancestor)) {
  ------------------
  |  Branch (5760:12): [True: 61.0k, False: 0]
  |  Branch (5760:30): [True: 59.8k, False: 1.19k]
  ------------------
 5761|  59.8k|        if ((node->type == XML_ENTITY_REF_NODE) ||
  ------------------
  |  Branch (5761:13): [True: 0, False: 59.8k]
  ------------------
 5762|  59.8k|            (node->type == XML_ENTITY_DECL))
  ------------------
  |  Branch (5762:13): [True: 0, False: 59.8k]
  ------------------
 5763|      0|            return (-1);
 5764|  59.8k|        if (node->type == XML_ELEMENT_NODE) {
  ------------------
  |  Branch (5764:13): [True: 59.8k, False: 0]
  ------------------
 5765|  59.8k|            tst = node->nsDef;
 5766|  78.2k|            while (tst != NULL) {
  ------------------
  |  Branch (5766:20): [True: 28.6k, False: 49.6k]
  ------------------
 5767|  28.6k|                if ((tst->prefix == NULL)
  ------------------
  |  Branch (5767:21): [True: 4.69k, False: 23.9k]
  ------------------
 5768|  4.69k|                    && (prefix == NULL))
  ------------------
  |  Branch (5768:24): [True: 586, False: 4.11k]
  ------------------
 5769|    586|                    return (0);
 5770|  28.0k|                if ((tst->prefix != NULL)
  ------------------
  |  Branch (5770:21): [True: 23.9k, False: 4.11k]
  ------------------
 5771|  23.9k|                    && (prefix != NULL)
  ------------------
  |  Branch (5771:24): [True: 21.6k, False: 2.26k]
  ------------------
 5772|  21.6k|                    && (xmlStrEqual(tst->prefix, prefix)))
  ------------------
  |  Branch (5772:24): [True: 9.61k, False: 12.0k]
  ------------------
 5773|  9.61k|                    return (0);
 5774|  18.4k|                tst = tst->next;
 5775|  18.4k|            }
 5776|  59.8k|        }
 5777|  49.6k|        node = node->parent;
 5778|  49.6k|    }
 5779|  1.19k|    if (node != ancestor)
  ------------------
  |  Branch (5779:9): [True: 0, False: 1.19k]
  ------------------
 5780|      0|        return (-1);
 5781|  1.19k|    return (1);
 5782|  1.19k|}
tree.c:xmlNewReconciledNs:
 5907|  1.87k|xmlNewReconciledNs(xmlNodePtr tree, xmlNsPtr ns) {
 5908|  1.87k|    xmlNsPtr def;
 5909|  1.87k|    xmlChar prefix[50];
 5910|  1.87k|    int counter = 1;
 5911|  1.87k|    int res;
 5912|       |
 5913|  1.87k|    if ((tree == NULL) || (tree->type != XML_ELEMENT_NODE)) {
  ------------------
  |  Branch (5913:9): [True: 0, False: 1.87k]
  |  Branch (5913:27): [True: 0, False: 1.87k]
  ------------------
 5914|      0|	return(NULL);
 5915|      0|    }
 5916|  1.87k|    if ((ns == NULL) || (ns->type != XML_NAMESPACE_DECL)) {
  ------------------
  |  Branch (5916:9): [True: 0, False: 1.87k]
  |  Branch (5916:25): [True: 0, False: 1.87k]
  ------------------
 5917|      0|	return(NULL);
 5918|      0|    }
 5919|       |    /*
 5920|       |     * Search an existing namespace definition inherited.
 5921|       |     */
 5922|  1.87k|    res = xmlSearchNsByHrefSafe(tree, ns->href, &def);
 5923|  1.87k|    if (res < 0)
  ------------------
  |  Branch (5923:9): [True: 0, False: 1.87k]
  ------------------
 5924|      0|        return(NULL);
 5925|  1.87k|    if (def != NULL)
  ------------------
  |  Branch (5925:9): [True: 1.19k, False: 675]
  ------------------
 5926|  1.19k|        return(def);
 5927|       |
 5928|       |    /*
 5929|       |     * Find a close prefix which is not already in use.
 5930|       |     * Let's strip namespace prefixes longer than 20 chars !
 5931|       |     */
 5932|    675|    if (ns->prefix == NULL)
  ------------------
  |  Branch (5932:9): [True: 0, False: 675]
  ------------------
 5933|      0|	snprintf((char *) prefix, sizeof(prefix), "default");
 5934|    675|    else
 5935|    675|	snprintf((char *) prefix, sizeof(prefix), "%.20s", (char *)ns->prefix);
 5936|       |
 5937|    675|    res = xmlSearchNsSafe(tree, prefix, &def);
 5938|    675|    if (res < 0)
  ------------------
  |  Branch (5938:9): [True: 0, False: 675]
  ------------------
 5939|      0|        return(NULL);
 5940|  2.16k|    while (def != NULL) {
  ------------------
  |  Branch (5940:12): [True: 1.49k, False: 675]
  ------------------
 5941|  1.49k|        if (counter > 1000) return(NULL);
  ------------------
  |  Branch (5941:13): [True: 0, False: 1.49k]
  ------------------
 5942|  1.49k|	if (ns->prefix == NULL)
  ------------------
  |  Branch (5942:6): [True: 0, False: 1.49k]
  ------------------
 5943|      0|	    snprintf((char *) prefix, sizeof(prefix), "default%d", counter++);
 5944|  1.49k|	else
 5945|  1.49k|	    snprintf((char *) prefix, sizeof(prefix), "%.20s%d",
 5946|  1.49k|		(char *)ns->prefix, counter++);
 5947|  1.49k|	res = xmlSearchNsSafe(tree, prefix, &def);
 5948|  1.49k|        if (res < 0)
  ------------------
  |  Branch (5948:13): [True: 0, False: 1.49k]
  ------------------
 5949|      0|            return(NULL);
 5950|  1.49k|    }
 5951|       |
 5952|       |    /*
 5953|       |     * OK, now we are ready to create a new one.
 5954|       |     */
 5955|    675|    def = xmlNewNs(tree, ns->href, prefix);
 5956|    675|    return(def);
 5957|    675|}
tree.c:xmlGetPropNodeInternal:
 6117|  4.90M|{
 6118|  4.90M|    xmlAttrPtr prop;
 6119|       |
 6120|       |    /* Avoid unused variable warning if features are disabled. */
 6121|  4.90M|    (void) useDTD;
 6122|       |
 6123|  4.90M|    if ((node == NULL) || (node->type != XML_ELEMENT_NODE) || (name == NULL))
  ------------------
  |  Branch (6123:9): [True: 0, False: 4.90M]
  |  Branch (6123:27): [True: 13.4k, False: 4.89M]
  |  Branch (6123:63): [True: 0, False: 4.89M]
  ------------------
 6124|  13.4k|	return(NULL);
 6125|       |
 6126|  4.89M|    if (node->properties != NULL) {
  ------------------
  |  Branch (6126:9): [True: 925k, False: 3.96M]
  ------------------
 6127|   925k|	prop = node->properties;
 6128|   925k|	if (nsName == NULL) {
  ------------------
  |  Branch (6128:6): [True: 59.2k, False: 866k]
  ------------------
 6129|       |	    /*
 6130|       |	    * We want the attr to be in no namespace.
 6131|       |	    */
 6132|  97.3k|	    do {
 6133|  97.3k|		if ((prop->ns == NULL) && xmlStrEqual(prop->name, name)) {
  ------------------
  |  Branch (6133:7): [True: 88.3k, False: 9.02k]
  |  Branch (6133:29): [True: 29.0k, False: 59.2k]
  ------------------
 6134|  29.0k|		    return(prop);
 6135|  29.0k|		}
 6136|  68.3k|		prop = prop->next;
 6137|  68.3k|	    } while (prop != NULL);
  ------------------
  |  Branch (6137:15): [True: 38.1k, False: 30.1k]
  ------------------
 6138|   866k|	} else {
 6139|       |	    /*
 6140|       |	    * We want the attr to be in the specified namespace.
 6141|       |	    */
 6142|  1.21M|	    do {
 6143|  1.21M|		if ((prop->ns != NULL) && xmlStrEqual(prop->name, name) &&
  ------------------
  |  Branch (6143:7): [True: 753k, False: 463k]
  |  Branch (6143:29): [True: 482k, False: 270k]
  ------------------
 6144|   482k|		    ((prop->ns->href == nsName) ||
  ------------------
  |  Branch (6144:8): [True: 1.51k, False: 481k]
  ------------------
 6145|   481k|		     xmlStrEqual(prop->ns->href, nsName)))
  ------------------
  |  Branch (6145:8): [True: 480k, False: 643]
  ------------------
 6146|   482k|		{
 6147|   482k|		    return(prop);
 6148|   482k|		}
 6149|   734k|		prop = prop->next;
 6150|   734k|	    } while (prop != NULL);
  ------------------
  |  Branch (6150:15): [True: 350k, False: 384k]
  ------------------
 6151|   866k|	}
 6152|   925k|    }
 6153|       |
 6154|  4.38M|    if (! useDTD)
  ------------------
  |  Branch (6154:9): [True: 4.38M, False: 0]
  ------------------
 6155|  4.38M|	return(NULL);
 6156|       |    /*
 6157|       |     * Check if there is a default/fixed attribute declaration in
 6158|       |     * the internal or external subset.
 6159|       |     */
 6160|      0|    if ((node->doc != NULL) && (node->doc->intSubset != NULL)) {
  ------------------
  |  Branch (6160:9): [True: 0, False: 0]
  |  Branch (6160:32): [True: 0, False: 0]
  ------------------
 6161|      0|	xmlDocPtr doc = node->doc;
 6162|      0|	xmlAttributePtr attrDecl = NULL;
 6163|      0|	xmlChar *elemQName, *tmpstr = NULL;
 6164|       |
 6165|       |	/*
 6166|       |	* We need the QName of the element for the DTD-lookup.
 6167|       |	*/
 6168|      0|	if ((node->ns != NULL) && (node->ns->prefix != NULL)) {
  ------------------
  |  Branch (6168:6): [True: 0, False: 0]
  |  Branch (6168:28): [True: 0, False: 0]
  ------------------
 6169|      0|	    tmpstr = xmlStrdup(node->ns->prefix);
 6170|      0|	    if (tmpstr == NULL)
  ------------------
  |  Branch (6170:10): [True: 0, False: 0]
  ------------------
 6171|      0|		return(NULL);
 6172|      0|	    tmpstr = xmlStrcat(tmpstr, BAD_CAST ":");
  ------------------
  |  |   34|      0|#define BAD_CAST (xmlChar *)
  ------------------
 6173|      0|	    if (tmpstr == NULL)
  ------------------
  |  Branch (6173:10): [True: 0, False: 0]
  ------------------
 6174|      0|		return(NULL);
 6175|      0|	    tmpstr = xmlStrcat(tmpstr, node->name);
 6176|      0|	    if (tmpstr == NULL)
  ------------------
  |  Branch (6176:10): [True: 0, False: 0]
  ------------------
 6177|      0|		return(NULL);
 6178|      0|	    elemQName = tmpstr;
 6179|      0|	} else
 6180|      0|	    elemQName = (xmlChar *) node->name;
 6181|      0|	if (nsName == NULL) {
  ------------------
  |  Branch (6181:6): [True: 0, False: 0]
  ------------------
 6182|       |	    /*
 6183|       |	    * The common and nice case: Attr in no namespace.
 6184|       |	    */
 6185|      0|	    attrDecl = xmlGetDtdQAttrDesc(doc->intSubset,
 6186|      0|		elemQName, name, NULL);
 6187|      0|	    if ((attrDecl == NULL) && (doc->extSubset != NULL)) {
  ------------------
  |  Branch (6187:10): [True: 0, False: 0]
  |  Branch (6187:32): [True: 0, False: 0]
  ------------------
 6188|      0|		attrDecl = xmlGetDtdQAttrDesc(doc->extSubset,
 6189|      0|		    elemQName, name, NULL);
 6190|      0|	    }
 6191|      0|        } else if (xmlStrEqual(nsName, XML_XML_NAMESPACE)) {
  ------------------
  |  |  146|      0|    (const xmlChar *) "http://www.w3.org/XML/1998/namespace"
  ------------------
  |  Branch (6191:20): [True: 0, False: 0]
  ------------------
 6192|       |	    /*
 6193|       |	    * The XML namespace must be bound to prefix 'xml'.
 6194|       |	    */
 6195|      0|	    attrDecl = xmlGetDtdQAttrDesc(doc->intSubset,
 6196|      0|		elemQName, name, BAD_CAST "xml");
  ------------------
  |  |   34|      0|#define BAD_CAST (xmlChar *)
  ------------------
 6197|      0|	    if ((attrDecl == NULL) && (doc->extSubset != NULL)) {
  ------------------
  |  Branch (6197:10): [True: 0, False: 0]
  |  Branch (6197:32): [True: 0, False: 0]
  ------------------
 6198|      0|		attrDecl = xmlGetDtdQAttrDesc(doc->extSubset,
 6199|      0|		    elemQName, name, BAD_CAST "xml");
  ------------------
  |  |   34|      0|#define BAD_CAST (xmlChar *)
  ------------------
 6200|      0|	    }
 6201|      0|	} else {
 6202|      0|	    xmlNsPtr *nsList, *cur;
 6203|       |
 6204|       |	    /*
 6205|       |	    * The ugly case: Search using the prefixes of in-scope
 6206|       |	    * ns-decls corresponding to @nsName.
 6207|       |	    */
 6208|      0|	    nsList = xmlGetNsList(node->doc, node);
 6209|      0|	    if (nsList == NULL) {
  ------------------
  |  Branch (6209:10): [True: 0, False: 0]
  ------------------
 6210|      0|		if (tmpstr != NULL)
  ------------------
  |  Branch (6210:7): [True: 0, False: 0]
  ------------------
 6211|      0|		    xmlFree(tmpstr);
 6212|      0|		return(NULL);
 6213|      0|	    }
 6214|      0|	    cur = nsList;
 6215|      0|	    while (*cur != NULL) {
  ------------------
  |  Branch (6215:13): [True: 0, False: 0]
  ------------------
 6216|      0|		if (xmlStrEqual((*cur)->href, nsName)) {
  ------------------
  |  Branch (6216:7): [True: 0, False: 0]
  ------------------
 6217|      0|		    attrDecl = xmlGetDtdQAttrDesc(doc->intSubset, elemQName,
 6218|      0|			name, (*cur)->prefix);
 6219|      0|		    if (attrDecl)
  ------------------
  |  Branch (6219:11): [True: 0, False: 0]
  ------------------
 6220|      0|			break;
 6221|      0|		    if (doc->extSubset != NULL) {
  ------------------
  |  Branch (6221:11): [True: 0, False: 0]
  ------------------
 6222|      0|			attrDecl = xmlGetDtdQAttrDesc(doc->extSubset, elemQName,
 6223|      0|			    name, (*cur)->prefix);
 6224|      0|			if (attrDecl)
  ------------------
  |  Branch (6224:8): [True: 0, False: 0]
  ------------------
 6225|      0|			    break;
 6226|      0|		    }
 6227|      0|		}
 6228|      0|		cur++;
 6229|      0|	    }
 6230|      0|	    xmlFree(nsList);
 6231|      0|	}
 6232|      0|	if (tmpstr != NULL)
  ------------------
  |  Branch (6232:6): [True: 0, False: 0]
  ------------------
 6233|      0|	    xmlFree(tmpstr);
 6234|       |	/*
 6235|       |	* Only default/fixed attrs are relevant.
 6236|       |	*/
 6237|      0|	if ((attrDecl != NULL) && (attrDecl->defaultValue != NULL))
  ------------------
  |  Branch (6237:6): [True: 0, False: 0]
  |  Branch (6237:28): [True: 0, False: 0]
  ------------------
 6238|      0|	    return((xmlAttrPtr) attrDecl);
 6239|      0|    }
 6240|       |
 6241|      0|    return(NULL);
 6242|      0|}
tree.c:xmlGetPropNodeValueInternal:
 6246|   508k|{
 6247|   508k|    if (prop == NULL)
  ------------------
  |  Branch (6247:9): [True: 0, False: 508k]
  ------------------
 6248|      0|	return(NULL);
 6249|   508k|    if (prop->type == XML_ATTRIBUTE_NODE) {
  ------------------
  |  Branch (6249:9): [True: 508k, False: 0]
  ------------------
 6250|   508k|	return(xmlNodeGetContent((xmlNodePtr) prop));
 6251|   508k|    } else if (prop->type == XML_ATTRIBUTE_DECL) {
  ------------------
  |  Branch (6251:16): [True: 0, False: 0]
  ------------------
 6252|      0|	return(xmlStrdup(((xmlAttributePtr)prop)->defaultValue));
 6253|      0|    }
 6254|      0|    return(NULL);
 6255|   508k|}

xmlParseURISafe:
  962|   554k|xmlParseURISafe(const char *str, xmlURI **uriOut) {
  963|   554k|    xmlURIPtr uri;
  964|   554k|    int ret;
  965|       |
  966|   554k|    if (uriOut == NULL)
  ------------------
  |  Branch (966:9): [True: 0, False: 554k]
  ------------------
  967|      0|        return(1);
  968|   554k|    *uriOut = NULL;
  969|   554k|    if (str == NULL)
  ------------------
  |  Branch (969:9): [True: 0, False: 554k]
  ------------------
  970|      0|	return(1);
  971|       |
  972|   554k|    uri = xmlCreateURI();
  973|   554k|    if (uri == NULL)
  ------------------
  |  Branch (973:9): [True: 168, False: 554k]
  ------------------
  974|    168|        return(-1);
  975|       |
  976|   554k|    ret = xmlParse3986URIReference(uri, str);
  977|   554k|    if (ret) {
  ------------------
  |  Branch (977:9): [True: 27.9k, False: 526k]
  ------------------
  978|  27.9k|        xmlFreeURI(uri);
  979|  27.9k|        return(ret);
  980|  27.9k|    }
  981|       |
  982|   526k|    *uriOut = uri;
  983|   526k|    return(0);
  984|   554k|}
xmlParseURIReference:
 1012|    986|xmlParseURIReference(xmlURI *uri, const char *str) {
 1013|    986|    return(xmlParse3986URIReference(uri, str));
 1014|    986|}
xmlCreateURI:
 1058|   575k|xmlCreateURI(void) {
 1059|   575k|    xmlURIPtr ret;
 1060|       |
 1061|   575k|    ret = (xmlURIPtr) xmlMalloc(sizeof(xmlURI));
 1062|   575k|    if (ret == NULL)
  ------------------
  |  Branch (1062:9): [True: 213, False: 575k]
  ------------------
 1063|    213|	return(NULL);
 1064|   575k|    memset(ret, 0, sizeof(xmlURI));
 1065|   575k|    ret->port = PORT_EMPTY;
  ------------------
  |  |   36|   575k|#define PORT_EMPTY           0
  ------------------
 1066|   575k|    return(ret);
 1067|   575k|}
xmlSaveUri:
 1095|  43.0k|xmlSaveUri(xmlURI *uri) {
 1096|  43.0k|    xmlChar *ret = NULL;
 1097|  43.0k|    xmlChar *temp;
 1098|  43.0k|    const char *p;
 1099|  43.0k|    int len;
 1100|  43.0k|    int max;
 1101|       |
 1102|  43.0k|    if (uri == NULL) return(NULL);
  ------------------
  |  Branch (1102:9): [True: 0, False: 43.0k]
  ------------------
 1103|       |
 1104|       |
 1105|  43.0k|    max = 80;
 1106|  43.0k|    ret = xmlMalloc(max + 1);
 1107|  43.0k|    if (ret == NULL)
  ------------------
  |  Branch (1107:9): [True: 88, False: 42.9k]
  ------------------
 1108|     88|	return(NULL);
 1109|  42.9k|    len = 0;
 1110|       |
 1111|  42.9k|    if (uri->scheme != NULL) {
  ------------------
  |  Branch (1111:9): [True: 12.3k, False: 30.6k]
  ------------------
 1112|  12.3k|	p = uri->scheme;
 1113|   103k|	while (*p != 0) {
  ------------------
  |  Branch (1113:9): [True: 90.8k, False: 12.3k]
  ------------------
 1114|  90.8k|	    if (len >= max) {
  ------------------
  |  Branch (1114:10): [True: 288, False: 90.6k]
  ------------------
 1115|    288|                temp = xmlSaveUriRealloc(ret, &max);
 1116|    288|                if (temp == NULL) goto mem_error;
  ------------------
  |  Branch (1116:21): [True: 2, False: 286]
  ------------------
 1117|    286|		ret = temp;
 1118|    286|	    }
 1119|  90.8k|	    ret[len++] = *p++;
 1120|  90.8k|	}
 1121|  12.3k|	if (len >= max) {
  ------------------
  |  Branch (1121:6): [True: 201, False: 12.1k]
  ------------------
 1122|    201|            temp = xmlSaveUriRealloc(ret, &max);
 1123|    201|            if (temp == NULL) goto mem_error;
  ------------------
  |  Branch (1123:17): [True: 2, False: 199]
  ------------------
 1124|    199|            ret = temp;
 1125|    199|	}
 1126|  12.3k|	ret[len++] = ':';
 1127|  12.3k|    }
 1128|  42.9k|    if (uri->opaque != NULL) {
  ------------------
  |  Branch (1128:9): [True: 0, False: 42.9k]
  ------------------
 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|  42.9k|    } else {
 1147|  42.9k|	if ((uri->server != NULL) || (uri->port != PORT_EMPTY)) {
  ------------------
  |  |   36|  33.6k|#define PORT_EMPTY           0
  ------------------
  |  Branch (1147:6): [True: 9.36k, False: 33.6k]
  |  Branch (1147:31): [True: 2.70k, False: 30.9k]
  ------------------
 1148|  12.0k|	    if (len + 3 >= max) {
  ------------------
  |  Branch (1148:10): [True: 233, False: 11.8k]
  ------------------
 1149|    233|                temp = xmlSaveUriRealloc(ret, &max);
 1150|    233|                if (temp == NULL) goto mem_error;
  ------------------
  |  Branch (1150:21): [True: 3, False: 230]
  ------------------
 1151|    230|                ret = temp;
 1152|    230|	    }
 1153|  12.0k|	    ret[len++] = '/';
 1154|  12.0k|	    ret[len++] = '/';
 1155|  12.0k|	    if (uri->user != NULL) {
  ------------------
  |  Branch (1155:10): [True: 4.41k, False: 7.65k]
  ------------------
 1156|  4.41k|		p = uri->user;
 1157|  36.7M|		while (*p != 0) {
  ------------------
  |  Branch (1157:10): [True: 36.7M, False: 4.40k]
  ------------------
 1158|  36.7M|		    if (len + 3 >= max) {
  ------------------
  |  Branch (1158:11): [True: 2.47k, False: 36.7M]
  ------------------
 1159|  2.47k|                        temp = xmlSaveUriRealloc(ret, &max);
 1160|  2.47k|                        if (temp == NULL) goto mem_error;
  ------------------
  |  Branch (1160:29): [True: 15, False: 2.45k]
  ------------------
 1161|  2.45k|                        ret = temp;
 1162|  2.45k|		    }
 1163|  36.7M|		    if ((IS_UNRESERVED(*(p))) ||
  ------------------
  |  |  103|  36.7M|#define IS_UNRESERVED(x) (IS_ALPHANUM(x) || IS_MARK(x))
  |  |  ------------------
  |  |  |  |   73|  73.5M|#define IS_ALPHANUM(x) (IS_ALPHA(x) || IS_DIGIT(x))
  |  |  |  |  ------------------
  |  |  |  |  |  |   45|  73.5M|#define IS_ALPHA(x) (IS_LOWALPHA(x) || IS_UPALPHA(x))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   53|  73.5M|#define IS_LOWALPHA(x) (((x) >= 'a') && ((x) <= 'z'))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (53:25): [True: 20.7k, False: 36.7M]
  |  |  |  |  |  |  |  |  |  Branch (53:41): [True: 19.5k, False: 1.25k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define IS_ALPHA(x) (IS_LOWALPHA(x) || IS_UPALPHA(x))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   60|  36.7M|#define IS_UPALPHA(x) (((x) >= 'A') && ((x) <= 'Z'))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (60:24): [True: 36.5M, False: 246k]
  |  |  |  |  |  |  |  |  |  Branch (60:40): [True: 36.5M, False: 1.86k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define IS_ALPHANUM(x) (IS_ALPHA(x) || IS_DIGIT(x))
  |  |  |  |  ------------------
  |  |  |  |  |  |   68|   248k|#define IS_DIGIT(x) (((x) >= '0') && ((x) <= '9'))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (68:22): [True: 55.3k, False: 193k]
  |  |  |  |  |  |  |  Branch (68:38): [True: 33.6k, False: 21.6k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define IS_UNRESERVED(x) (IS_ALPHANUM(x) || IS_MARK(x))
  |  |  ------------------
  |  |  |  |   79|   214k|#define IS_MARK(x) (((x) == '-') || ((x) == '_') || ((x) == '.') ||     \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (79:21): [True: 1.59k, False: 213k]
  |  |  |  |  |  Branch (79:37): [True: 611, False: 212k]
  |  |  |  |  |  Branch (79:53): [True: 2.60k, False: 210k]
  |  |  |  |  ------------------
  |  |  |  |   80|   214k|    ((x) == '!') || ((x) == '~') || ((x) == '*') || ((x) == '\'') ||    \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (80:5): [True: 1.25k, False: 208k]
  |  |  |  |  |  Branch (80:21): [True: 1.24k, False: 207k]
  |  |  |  |  |  Branch (80:37): [True: 2.61k, False: 205k]
  |  |  |  |  |  Branch (80:53): [True: 906, False: 204k]
  |  |  |  |  ------------------
  |  |  |  |   81|   214k|    ((x) == '(') || ((x) == ')'))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (81:5): [True: 1.24k, False: 202k]
  |  |  |  |  |  Branch (81:21): [True: 1.41k, False: 201k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1164|   201k|			((*(p) == ';')) || ((*(p) == ':')) ||
  ------------------
  |  Branch (1164:4): [True: 3.90k, False: 197k]
  |  Branch (1164:23): [True: 2.43k, False: 195k]
  ------------------
 1165|   195k|			((*(p) == '&')) || ((*(p) == '=')) ||
  ------------------
  |  Branch (1165:4): [True: 342, False: 194k]
  |  Branch (1165:23): [True: 1.33k, False: 193k]
  ------------------
 1166|   193k|			((*(p) == '+')) || ((*(p) == '$')) ||
  ------------------
  |  Branch (1166:4): [True: 1.39k, False: 192k]
  |  Branch (1166:23): [True: 910, False: 191k]
  ------------------
 1167|   191k|			((*(p) == ',')))
  ------------------
  |  Branch (1167:4): [True: 1.10k, False: 190k]
  ------------------
 1168|  36.5M|			ret[len++] = *p++;
 1169|   190k|		    else {
 1170|   190k|			int val = *(unsigned char *)p++;
 1171|   190k|			int hi = val / 0x10, lo = val % 0x10;
 1172|   190k|			ret[len++] = '%';
 1173|   190k|			ret[len++] = hi + (hi > 9? 'A'-10 : '0');
  ------------------
  |  Branch (1173:23): [True: 875, False: 189k]
  ------------------
 1174|   190k|			ret[len++] = lo + (lo > 9? 'A'-10 : '0');
  ------------------
  |  Branch (1174:23): [True: 27.4k, False: 162k]
  ------------------
 1175|   190k|		    }
 1176|  36.7M|		}
 1177|  4.40k|		if (len + 3 >= max) {
  ------------------
  |  Branch (1177:7): [True: 201, False: 4.20k]
  ------------------
 1178|    201|                    temp = xmlSaveUriRealloc(ret, &max);
 1179|    201|                    if (temp == NULL) goto mem_error;
  ------------------
  |  Branch (1179:25): [True: 1, False: 200]
  ------------------
 1180|    200|                    ret = temp;
 1181|    200|		}
 1182|  4.40k|		ret[len++] = '@';
 1183|  4.40k|	    }
 1184|  12.0k|	    if (uri->server != NULL) {
  ------------------
  |  Branch (1184:10): [True: 9.35k, False: 2.69k]
  ------------------
 1185|  9.35k|		p = uri->server;
 1186|  8.85M|		while (*p != 0) {
  ------------------
  |  Branch (1186:10): [True: 8.84M, False: 9.34k]
  ------------------
 1187|  8.84M|		    if (len >= max) {
  ------------------
  |  Branch (1187:11): [True: 568, False: 8.84M]
  ------------------
 1188|    568|			temp = xmlSaveUriRealloc(ret, &max);
 1189|    568|			if (temp == NULL) goto mem_error;
  ------------------
  |  Branch (1189:8): [True: 7, False: 561]
  ------------------
 1190|    561|			ret = temp;
 1191|    561|		    }
 1192|       |                    /* TODO: escaping? */
 1193|  8.84M|		    ret[len++] = (xmlChar) *p++;
 1194|  8.84M|		}
 1195|  9.35k|	    }
 1196|  12.0k|            if (uri->port > 0) {
  ------------------
  |  Branch (1196:17): [True: 1.08k, False: 10.9k]
  ------------------
 1197|  1.08k|                if (len + 10 >= max) {
  ------------------
  |  Branch (1197:21): [True: 201, False: 885]
  ------------------
 1198|    201|                    temp = xmlSaveUriRealloc(ret, &max);
 1199|    201|                    if (temp == NULL) goto mem_error;
  ------------------
  |  Branch (1199:25): [True: 1, False: 200]
  ------------------
 1200|    200|                    ret = temp;
 1201|    200|                }
 1202|  1.08k|                len += snprintf((char *) &ret[len], max - len, ":%d", uri->port);
 1203|  1.08k|            }
 1204|  30.9k|	} else if (uri->authority != NULL) {
  ------------------
  |  Branch (1204:13): [True: 0, False: 30.9k]
  ------------------
 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|  30.9k|	} else if (uri->scheme != NULL) {
  ------------------
  |  Branch (1232:13): [True: 633, False: 30.2k]
  ------------------
 1233|    633|	    if (len + 3 >= max) {
  ------------------
  |  Branch (1233:10): [True: 213, False: 420]
  ------------------
 1234|    213|                temp = xmlSaveUriRealloc(ret, &max);
 1235|    213|                if (temp == NULL) goto mem_error;
  ------------------
  |  Branch (1235:21): [True: 1, False: 212]
  ------------------
 1236|    212|                ret = temp;
 1237|    212|	    }
 1238|    633|	}
 1239|  42.9k|	if (uri->path != NULL) {
  ------------------
  |  Branch (1239:6): [True: 36.5k, False: 6.44k]
  ------------------
 1240|  36.5k|	    p = uri->path;
 1241|       |	    /*
 1242|       |	     * the colon in file:///d: should not be escaped or
 1243|       |	     * Windows accesses fail later.
 1244|       |	     */
 1245|  36.5k|	    if ((uri->scheme != NULL) &&
  ------------------
  |  Branch (1245:10): [True: 8.38k, False: 28.1k]
  ------------------
 1246|  8.38k|		(p[0] == '/') &&
  ------------------
  |  Branch (1246:3): [True: 7.63k, False: 754]
  ------------------
 1247|  7.63k|		(((p[1] >= 'a') && (p[1] <= 'z')) ||
  ------------------
  |  Branch (1247:5): [True: 1.66k, False: 5.97k]
  |  Branch (1247:22): [True: 1.36k, False: 293]
  ------------------
 1248|  6.26k|		 ((p[1] >= 'A') && (p[1] <= 'Z'))) &&
  ------------------
  |  Branch (1248:5): [True: 1.01k, False: 5.25k]
  |  Branch (1248:22): [True: 704, False: 309]
  ------------------
 1249|  2.07k|		(p[2] == ':') &&
  ------------------
  |  Branch (1249:3): [True: 693, False: 1.37k]
  ------------------
 1250|    693|	        (xmlStrEqual(BAD_CAST uri->scheme, BAD_CAST "file"))) {
  ------------------
  |  |   34|    693|#define BAD_CAST (xmlChar *)
  ------------------
              	        (xmlStrEqual(BAD_CAST uri->scheme, BAD_CAST "file"))) {
  ------------------
  |  |   34|    693|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (1250:10): [True: 398, False: 295]
  ------------------
 1251|    398|		if (len + 3 >= max) {
  ------------------
  |  Branch (1251:7): [True: 199, False: 199]
  ------------------
 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|    396|		ret[len++] = *p++;
 1257|    396|		ret[len++] = *p++;
 1258|    396|		ret[len++] = *p++;
 1259|    396|	    }
 1260|  3.91M|	    while (*p != 0) {
  ------------------
  |  Branch (1260:13): [True: 3.87M, False: 36.5k]
  ------------------
 1261|  3.87M|		if (len + 3 >= max) {
  ------------------
  |  Branch (1261:7): [True: 1.45k, False: 3.87M]
  ------------------
 1262|  1.45k|                    temp = xmlSaveUriRealloc(ret, &max);
 1263|  1.45k|                    if (temp == NULL) goto mem_error;
  ------------------
  |  Branch (1263:25): [True: 3, False: 1.45k]
  ------------------
 1264|  1.45k|                    ret = temp;
 1265|  1.45k|		}
 1266|  3.87M|		if ((IS_UNRESERVED(*(p))) || ((*(p) == '/')) ||
  ------------------
  |  |  103|  3.87M|#define IS_UNRESERVED(x) (IS_ALPHANUM(x) || IS_MARK(x))
  |  |  ------------------
  |  |  |  |   73|  7.75M|#define IS_ALPHANUM(x) (IS_ALPHA(x) || IS_DIGIT(x))
  |  |  |  |  ------------------
  |  |  |  |  |  |   45|  7.75M|#define IS_ALPHA(x) (IS_LOWALPHA(x) || IS_UPALPHA(x))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   53|  7.75M|#define IS_LOWALPHA(x) (((x) >= 'a') && ((x) <= 'z'))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (53:25): [True: 188k, False: 3.68M]
  |  |  |  |  |  |  |  |  |  Branch (53:41): [True: 186k, False: 1.33k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define IS_ALPHA(x) (IS_LOWALPHA(x) || IS_UPALPHA(x))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   60|  3.68M|#define IS_UPALPHA(x) (((x) >= 'A') && ((x) <= 'Z'))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (60:24): [True: 2.46M, False: 1.22M]
  |  |  |  |  |  |  |  |  |  Branch (60:40): [True: 2.45M, False: 2.10k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define IS_ALPHANUM(x) (IS_ALPHA(x) || IS_DIGIT(x))
  |  |  |  |  ------------------
  |  |  |  |  |  |   68|  1.22M|#define IS_DIGIT(x) (((x) >= '0') && ((x) <= '9'))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (68:22): [True: 36.1k, False: 1.19M]
  |  |  |  |  |  |  |  Branch (68:38): [True: 22.9k, False: 13.1k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define IS_UNRESERVED(x) (IS_ALPHANUM(x) || IS_MARK(x))
  |  |  ------------------
  |  |  |  |   79|  1.20M|#define IS_MARK(x) (((x) == '-') || ((x) == '_') || ((x) == '.') ||     \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (79:21): [True: 22.4k, False: 1.18M]
  |  |  |  |  |  Branch (79:37): [True: 674, False: 1.18M]
  |  |  |  |  |  Branch (79:53): [True: 50.9k, False: 1.13M]
  |  |  |  |  ------------------
  |  |  |  |   80|  1.20M|    ((x) == '!') || ((x) == '~') || ((x) == '*') || ((x) == '\'') ||    \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (80:5): [True: 2.92k, False: 1.12M]
  |  |  |  |  |  Branch (80:21): [True: 1.16k, False: 1.12M]
  |  |  |  |  |  Branch (80:37): [True: 1.01M, False: 109k]
  |  |  |  |  |  Branch (80:53): [True: 1.58k, False: 108k]
  |  |  |  |  ------------------
  |  |  |  |   81|  1.20M|    ((x) == '(') || ((x) == ')'))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (81:5): [True: 1.73k, False: 106k]
  |  |  |  |  |  Branch (81:21): [True: 1.38k, False: 105k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (1266:32): [True: 78.1k, False: 26.8k]
  ------------------
 1267|  26.8k|                    ((*(p) == ';')) || ((*(p) == '@')) || ((*(p) == '&')) ||
  ------------------
  |  Branch (1267:21): [True: 1.72k, False: 25.1k]
  |  Branch (1267:40): [True: 2.90k, False: 22.2k]
  |  Branch (1267:59): [True: 220, False: 22.0k]
  ------------------
 1268|  22.0k|	            ((*(p) == '=')) || ((*(p) == '+')) || ((*(p) == '$')) ||
  ------------------
  |  Branch (1268:14): [True: 2.32k, False: 19.7k]
  |  Branch (1268:33): [True: 1.72k, False: 17.9k]
  |  Branch (1268:52): [True: 1.34k, False: 16.6k]
  ------------------
 1269|  16.6k|	            ((*(p) == ',')))
  ------------------
  |  Branch (1269:14): [True: 2.70k, False: 13.9k]
  ------------------
 1270|  3.86M|		    ret[len++] = *p++;
 1271|  13.9k|		else {
 1272|  13.9k|		    int val = *(unsigned char *)p++;
 1273|  13.9k|		    int hi = val / 0x10, lo = val % 0x10;
 1274|  13.9k|		    ret[len++] = '%';
 1275|  13.9k|		    ret[len++] = hi + (hi > 9? 'A'-10 : '0');
  ------------------
  |  Branch (1275:26): [True: 1.24k, False: 12.6k]
  ------------------
 1276|  13.9k|		    ret[len++] = lo + (lo > 9? 'A'-10 : '0');
  ------------------
  |  Branch (1276:26): [True: 5.96k, False: 7.97k]
  ------------------
 1277|  13.9k|		}
 1278|  3.87M|	    }
 1279|  36.5k|	}
 1280|  42.9k|	if (uri->query_raw != NULL) {
  ------------------
  |  Branch (1280:6): [True: 3.21k, False: 39.7k]
  ------------------
 1281|  3.21k|	    if (len + 1 >= max) {
  ------------------
  |  Branch (1281:10): [True: 201, False: 3.01k]
  ------------------
 1282|    201|                temp = xmlSaveUriRealloc(ret, &max);
 1283|    201|                if (temp == NULL) goto mem_error;
  ------------------
  |  Branch (1283:21): [True: 1, False: 200]
  ------------------
 1284|    200|                ret = temp;
 1285|    200|	    }
 1286|  3.21k|	    ret[len++] = '?';
 1287|  3.21k|	    p = uri->query_raw;
 1288|  7.99M|	    while (*p != 0) {
  ------------------
  |  Branch (1288:13): [True: 7.98M, False: 3.19k]
  ------------------
 1289|  7.98M|		if (len + 1 >= max) {
  ------------------
  |  Branch (1289:7): [True: 620, False: 7.98M]
  ------------------
 1290|    620|                    temp = xmlSaveUriRealloc(ret, &max);
 1291|    620|                    if (temp == NULL) goto mem_error;
  ------------------
  |  Branch (1291:25): [True: 13, False: 607]
  ------------------
 1292|    607|                    ret = temp;
 1293|    607|		}
 1294|  7.98M|		ret[len++] = *p++;
 1295|  7.98M|	    }
 1296|  39.7k|	} else if (uri->query != NULL) {
  ------------------
  |  Branch (1296:13): [True: 0, False: 39.7k]
  ------------------
 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|  42.9k|    }
 1322|  42.9k|    if (uri->fragment != NULL) {
  ------------------
  |  Branch (1322:9): [True: 6.61k, False: 36.3k]
  ------------------
 1323|  6.61k|	if (len + 3 >= max) {
  ------------------
  |  Branch (1323:6): [True: 336, False: 6.27k]
  ------------------
 1324|    336|            temp = xmlSaveUriRealloc(ret, &max);
 1325|    336|            if (temp == NULL) goto mem_error;
  ------------------
  |  Branch (1325:17): [True: 2, False: 334]
  ------------------
 1326|    334|            ret = temp;
 1327|    334|	}
 1328|  6.61k|	ret[len++] = '#';
 1329|  6.61k|	p = uri->fragment;
 1330|  32.5k|	while (*p != 0) {
  ------------------
  |  Branch (1330:9): [True: 25.9k, False: 6.61k]
  ------------------
 1331|  25.9k|	    if (len + 3 >= max) {
  ------------------
  |  Branch (1331:10): [True: 288, False: 25.6k]
  ------------------
 1332|    288|                temp = xmlSaveUriRealloc(ret, &max);
 1333|    288|                if (temp == NULL) goto mem_error;
  ------------------
  |  Branch (1333:21): [True: 1, False: 287]
  ------------------
 1334|    287|                ret = temp;
 1335|    287|	    }
 1336|  25.9k|	    if ((IS_UNRESERVED(*(p))) || (IS_RESERVED(*(p))))
  ------------------
  |  |  103|  25.9k|#define IS_UNRESERVED(x) (IS_ALPHANUM(x) || IS_MARK(x))
  |  |  ------------------
  |  |  |  |   73|  51.8k|#define IS_ALPHANUM(x) (IS_ALPHA(x) || IS_DIGIT(x))
  |  |  |  |  ------------------
  |  |  |  |  |  |   45|  51.8k|#define IS_ALPHA(x) (IS_LOWALPHA(x) || IS_UPALPHA(x))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   53|  51.8k|#define IS_LOWALPHA(x) (((x) >= 'a') && ((x) <= 'z'))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (53:25): [True: 3.49k, False: 22.4k]
  |  |  |  |  |  |  |  |  |  Branch (53:41): [True: 3.10k, False: 389]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define IS_ALPHA(x) (IS_LOWALPHA(x) || IS_UPALPHA(x))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   60|  22.8k|#define IS_UPALPHA(x) (((x) >= 'A') && ((x) <= 'Z'))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (60:24): [True: 6.02k, False: 16.7k]
  |  |  |  |  |  |  |  |  |  Branch (60:40): [True: 2.36k, False: 3.65k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define IS_ALPHANUM(x) (IS_ALPHA(x) || IS_DIGIT(x))
  |  |  |  |  ------------------
  |  |  |  |  |  |   68|  20.4k|#define IS_DIGIT(x) (((x) >= '0') && ((x) <= '9'))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (68:22): [True: 9.53k, False: 10.9k]
  |  |  |  |  |  |  |  Branch (68:38): [True: 2.06k, False: 7.47k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define IS_UNRESERVED(x) (IS_ALPHANUM(x) || IS_MARK(x))
  |  |  ------------------
  |  |  |  |   79|  18.3k|#define IS_MARK(x) (((x) == '-') || ((x) == '_') || ((x) == '.') ||     \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (79:21): [True: 576, False: 17.7k]
  |  |  |  |  |  Branch (79:37): [True: 261, False: 17.5k]
  |  |  |  |  |  Branch (79:53): [True: 546, False: 16.9k]
  |  |  |  |  ------------------
  |  |  |  |   80|  18.3k|    ((x) == '!') || ((x) == '~') || ((x) == '*') || ((x) == '\'') ||    \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (80:5): [True: 363, False: 16.6k]
  |  |  |  |  |  Branch (80:21): [True: 386, False: 16.2k]
  |  |  |  |  |  Branch (80:37): [True: 1.12k, False: 15.1k]
  |  |  |  |  |  Branch (80:53): [True: 471, False: 14.6k]
  |  |  |  |  ------------------
  |  |  |  |   81|  18.3k|    ((x) == '(') || ((x) == ')'))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (81:5): [True: 979, False: 13.6k]
  |  |  |  |  |  Branch (81:21): [True: 452, False: 13.2k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
              	    if ((IS_UNRESERVED(*(p))) || (IS_RESERVED(*(p))))
  ------------------
  |  |   95|  13.2k|#define IS_RESERVED(x) (((x) == ';') || ((x) == '/') || ((x) == '?') || \
  |  |  ------------------
  |  |  |  Branch (95:25): [True: 987, False: 12.2k]
  |  |  |  Branch (95:41): [True: 610, False: 11.6k]
  |  |  |  Branch (95:57): [True: 1.67k, False: 9.93k]
  |  |  ------------------
  |  |   96|  13.2k|        ((x) == ':') || ((x) == '@') || ((x) == '&') || ((x) == '=') || \
  |  |  ------------------
  |  |  |  Branch (96:9): [True: 490, False: 9.44k]
  |  |  |  Branch (96:25): [True: 388, False: 9.06k]
  |  |  |  Branch (96:41): [True: 246, False: 8.81k]
  |  |  |  Branch (96:57): [True: 269, False: 8.54k]
  |  |  ------------------
  |  |   97|  13.2k|        ((x) == '+') || ((x) == '$') || ((x) == ',') || ((x) == '[') || \
  |  |  ------------------
  |  |  |  Branch (97:9): [True: 1.24k, False: 7.30k]
  |  |  |  Branch (97:25): [True: 381, False: 6.92k]
  |  |  |  Branch (97:41): [True: 3.40k, False: 3.51k]
  |  |  |  Branch (97:57): [True: 466, False: 3.05k]
  |  |  ------------------
  |  |   98|  13.2k|        ((x) == ']'))
  |  |  ------------------
  |  |  |  Branch (98:9): [True: 2.54k, False: 512]
  |  |  ------------------
  ------------------
 1337|  25.4k|		ret[len++] = *p++;
 1338|    512|	    else {
 1339|    512|		int val = *(unsigned char *)p++;
 1340|    512|		int hi = val / 0x10, lo = val % 0x10;
 1341|    512|		ret[len++] = '%';
 1342|    512|		ret[len++] = hi + (hi > 9? 'A'-10 : '0');
  ------------------
  |  Branch (1342:22): [True: 411, False: 101]
  ------------------
 1343|    512|		ret[len++] = lo + (lo > 9? 'A'-10 : '0');
  ------------------
  |  Branch (1343:22): [True: 353, False: 159]
  ------------------
 1344|    512|	    }
 1345|  25.9k|	}
 1346|  6.61k|    }
 1347|  42.9k|    if (len >= max) {
  ------------------
  |  Branch (1347:9): [True: 260, False: 42.6k]
  ------------------
 1348|    260|        temp = xmlSaveUriRealloc(ret, &max);
 1349|    260|        if (temp == NULL) goto mem_error;
  ------------------
  |  Branch (1349:13): [True: 2, False: 258]
  ------------------
 1350|    258|        ret = temp;
 1351|    258|    }
 1352|  42.9k|    ret[len] = 0;
 1353|  42.9k|    return(ret);
 1354|       |
 1355|     56|mem_error:
 1356|     56|    xmlFree(ret);
 1357|       |    return(NULL);
 1358|  42.9k|}
xmlFreeURI:
 1412|   586k|xmlFreeURI(xmlURI *uri) {
 1413|   586k|    if (uri == NULL) return;
  ------------------
  |  Branch (1413:9): [True: 11.0k, False: 575k]
  ------------------
 1414|       |
 1415|   575k|    if (uri->scheme != NULL) xmlFree(uri->scheme);
  ------------------
  |  Branch (1415:9): [True: 40.0k, False: 535k]
  ------------------
 1416|   575k|    if (uri->server != NULL) xmlFree(uri->server);
  ------------------
  |  Branch (1416:9): [True: 29.0k, False: 546k]
  ------------------
 1417|   575k|    if (uri->user != NULL) xmlFree(uri->user);
  ------------------
  |  Branch (1417:9): [True: 8.19k, False: 567k]
  ------------------
 1418|   575k|    if (uri->path != NULL) xmlFree(uri->path);
  ------------------
  |  Branch (1418:9): [True: 142k, False: 433k]
  ------------------
 1419|   575k|    if (uri->fragment != NULL) xmlFree(uri->fragment);
  ------------------
  |  Branch (1419:9): [True: 398k, False: 176k]
  ------------------
 1420|   575k|    if (uri->opaque != NULL) xmlFree(uri->opaque);
  ------------------
  |  Branch (1420:9): [True: 0, False: 575k]
  ------------------
 1421|   575k|    if (uri->authority != NULL) xmlFree(uri->authority);
  ------------------
  |  Branch (1421:9): [True: 0, False: 575k]
  ------------------
 1422|   575k|    if (uri->query != NULL) xmlFree(uri->query);
  ------------------
  |  Branch (1422:9): [True: 5.70k, False: 570k]
  ------------------
 1423|   575k|    if (uri->query_raw != NULL) xmlFree(uri->query_raw);
  ------------------
  |  Branch (1423:9): [True: 7.90k, False: 567k]
  ------------------
 1424|   575k|    xmlFree(uri);
 1425|   575k|}
xmlNormalizeURIPath:
 1555|  7.94k|xmlNormalizeURIPath(char *path) {
 1556|  7.94k|    return(xmlNormalizePath(path, 0));
 1557|  7.94k|}
xmlURIUnescapeString:
 1580|   982k|xmlURIUnescapeString(const char *str, int len, char *target) {
 1581|   982k|    char *ret, *out;
 1582|   982k|    const char *in;
 1583|       |
 1584|   982k|    if (str == NULL)
  ------------------
  |  Branch (1584:9): [True: 0, False: 982k]
  ------------------
 1585|      0|	return(NULL);
 1586|   982k|    if (len <= 0) len = strlen(str);
  ------------------
  |  Branch (1586:9): [True: 406k, False: 576k]
  ------------------
 1587|   982k|    if (len < 0) return(NULL);
  ------------------
  |  Branch (1587:9): [True: 0, False: 982k]
  ------------------
 1588|       |
 1589|   982k|    if (target == NULL) {
  ------------------
  |  Branch (1589:9): [True: 982k, False: 0]
  ------------------
 1590|   982k|	ret = xmlMalloc(len + 1);
 1591|   982k|	if (ret == NULL)
  ------------------
  |  Branch (1591:6): [True: 320, False: 982k]
  ------------------
 1592|    320|	    return(NULL);
 1593|   982k|    } else
 1594|      0|	ret = target;
 1595|   982k|    in = str;
 1596|   982k|    out = ret;
 1597|   135M|    while(len > 0) {
  ------------------
  |  Branch (1597:11): [True: 134M, False: 982k]
  ------------------
 1598|   134M|	if ((len > 2) && (*in == '%') && (is_hex(in[1])) && (is_hex(in[2]))) {
  ------------------
  |  Branch (1598:6): [True: 133M, False: 1.09M]
  |  Branch (1598:19): [True: 218k, False: 133M]
  |  Branch (1598:35): [True: 217k, False: 1.63k]
  |  Branch (1598:54): [True: 216k, False: 1.08k]
  ------------------
 1599|   216k|            int c = 0;
 1600|   216k|	    in++;
 1601|   216k|	    if ((*in >= '0') && (*in <= '9'))
  ------------------
  |  Branch (1601:10): [True: 216k, False: 0]
  |  Branch (1601:26): [True: 202k, False: 13.6k]
  ------------------
 1602|   202k|	        c = (*in - '0');
 1603|  13.6k|	    else if ((*in >= 'a') && (*in <= 'f'))
  ------------------
  |  Branch (1603:15): [True: 6.32k, False: 7.29k]
  |  Branch (1603:31): [True: 6.32k, False: 0]
  ------------------
 1604|  6.32k|	        c = (*in - 'a') + 10;
 1605|  7.29k|	    else if ((*in >= 'A') && (*in <= 'F'))
  ------------------
  |  Branch (1605:15): [True: 7.29k, False: 0]
  |  Branch (1605:31): [True: 7.29k, False: 0]
  ------------------
 1606|  7.29k|	        c = (*in - 'A') + 10;
 1607|   216k|	    in++;
 1608|   216k|	    if ((*in >= '0') && (*in <= '9'))
  ------------------
  |  Branch (1608:10): [True: 216k, False: 0]
  |  Branch (1608:26): [True: 199k, False: 16.5k]
  ------------------
 1609|   199k|	        c = c * 16 + (*in - '0');
 1610|  16.5k|	    else if ((*in >= 'a') && (*in <= 'f'))
  ------------------
  |  Branch (1610:15): [True: 7.83k, False: 8.68k]
  |  Branch (1610:31): [True: 7.83k, False: 0]
  ------------------
 1611|  7.83k|	        c = c * 16 + (*in - 'a') + 10;
 1612|  8.68k|	    else if ((*in >= 'A') && (*in <= 'F'))
  ------------------
  |  Branch (1612:15): [True: 8.68k, False: 0]
  |  Branch (1612:31): [True: 8.68k, False: 0]
  ------------------
 1613|  8.68k|	        c = c * 16 + (*in - 'A') + 10;
 1614|   216k|	    in++;
 1615|   216k|	    len -= 3;
 1616|       |            /* Explicit sign change */
 1617|   216k|	    *out++ = (char) c;
 1618|   134M|	} else {
 1619|   134M|	    *out++ = *in++;
 1620|   134M|	    len--;
 1621|   134M|	}
 1622|   134M|    }
 1623|   982k|    *out = 0;
 1624|   982k|    return(ret);
 1625|   982k|}
xmlURIEscapeStr:
 1637|  1.41k|xmlURIEscapeStr(const xmlChar *str, const xmlChar *list) {
 1638|  1.41k|    xmlChar *ret, ch;
 1639|  1.41k|    const xmlChar *in;
 1640|  1.41k|    int len, out;
 1641|       |
 1642|  1.41k|    if (str == NULL)
  ------------------
  |  Branch (1642:9): [True: 0, False: 1.41k]
  ------------------
 1643|      0|	return(NULL);
 1644|  1.41k|    if (str[0] == 0)
  ------------------
  |  Branch (1644:9): [True: 0, False: 1.41k]
  ------------------
 1645|      0|	return(xmlStrdup(str));
 1646|  1.41k|    len = xmlStrlen(str);
 1647|  1.41k|    if (len == 0)
  ------------------
  |  Branch (1647:9): [True: 0, False: 1.41k]
  ------------------
 1648|      0|        return(NULL);
 1649|       |
 1650|  1.41k|    len += 20;
 1651|  1.41k|    ret = xmlMalloc(len);
 1652|  1.41k|    if (ret == NULL)
  ------------------
  |  Branch (1652:9): [True: 4, False: 1.40k]
  ------------------
 1653|      4|	return(NULL);
 1654|  1.40k|    in = (const xmlChar *) str;
 1655|  1.40k|    out = 0;
 1656|  8.05M|    while(*in != 0) {
  ------------------
  |  Branch (1656:11): [True: 8.05M, False: 1.40k]
  ------------------
 1657|  8.05M|	if (len - out <= 3) {
  ------------------
  |  Branch (1657:6): [True: 711, False: 8.05M]
  ------------------
 1658|    711|            xmlChar *temp;
 1659|    711|            int newSize;
 1660|       |
 1661|    711|            newSize = xmlGrowCapacity(len, 1, 1, XML_MAX_ITEMS);
  ------------------
  |  |   13|    711|#define XML_MAX_ITEMS 1000000000 /* 1 billion */
  ------------------
 1662|    711|            if (newSize < 0) {
  ------------------
  |  Branch (1662:17): [True: 0, False: 711]
  ------------------
 1663|      0|		xmlFree(ret);
 1664|      0|                return(NULL);
 1665|      0|            }
 1666|    711|            temp = xmlRealloc(ret, newSize);
 1667|    711|	    if (temp == NULL) {
  ------------------
  |  Branch (1667:10): [True: 6, False: 705]
  ------------------
 1668|      6|		xmlFree(ret);
 1669|      6|		return(NULL);
 1670|      6|	    }
 1671|    705|	    ret = temp;
 1672|    705|            len = newSize;
 1673|    705|	}
 1674|       |
 1675|  8.05M|	ch = *in;
 1676|       |
 1677|  8.05M|	if ((ch != '@') && (!IS_UNRESERVED(ch)) && (!xmlStrchr(list, ch))) {
  ------------------
  |  |  103|  8.05M|#define IS_UNRESERVED(x) (IS_ALPHANUM(x) || IS_MARK(x))
  |  |  ------------------
  |  |  |  |   73|  16.1M|#define IS_ALPHANUM(x) (IS_ALPHA(x) || IS_DIGIT(x))
  |  |  |  |  ------------------
  |  |  |  |  |  |   45|  16.1M|#define IS_ALPHA(x) (IS_LOWALPHA(x) || IS_UPALPHA(x))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   53|  16.1M|#define IS_LOWALPHA(x) (((x) >= 'a') && ((x) <= 'z'))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (53:25): [True: 147k, False: 7.90M]
  |  |  |  |  |  |  |  |  |  Branch (53:41): [True: 130k, False: 17.0k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define IS_ALPHA(x) (IS_LOWALPHA(x) || IS_UPALPHA(x))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   60|  7.91M|#define IS_UPALPHA(x) (((x) >= 'A') && ((x) <= 'Z'))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (60:24): [True: 525k, False: 7.39M]
  |  |  |  |  |  |  |  |  |  Branch (60:40): [True: 507k, False: 18.1k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define IS_ALPHANUM(x) (IS_ALPHA(x) || IS_DIGIT(x))
  |  |  |  |  ------------------
  |  |  |  |  |  |   68|  7.41M|#define IS_DIGIT(x) (((x) >= '0') && ((x) <= '9'))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (68:22): [True: 119k, False: 7.29M]
  |  |  |  |  |  |  |  Branch (68:38): [True: 93.2k, False: 26.4k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define IS_UNRESERVED(x) (IS_ALPHANUM(x) || IS_MARK(x))
  |  |  ------------------
  |  |  |  |   79|  7.31M|#define IS_MARK(x) (((x) == '-') || ((x) == '_') || ((x) == '.') ||     \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (79:21): [True: 99.0k, False: 7.21M]
  |  |  |  |  |  Branch (79:37): [True: 334, False: 7.21M]
  |  |  |  |  |  Branch (79:53): [True: 132k, False: 7.08M]
  |  |  |  |  ------------------
  |  |  |  |   80|  7.31M|    ((x) == '!') || ((x) == '~') || ((x) == '*') || ((x) == '\'') ||    \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (80:5): [True: 4.04k, False: 7.08M]
  |  |  |  |  |  Branch (80:21): [True: 677, False: 7.08M]
  |  |  |  |  |  Branch (80:37): [True: 4.22M, False: 2.85M]
  |  |  |  |  |  Branch (80:53): [True: 1.77k, False: 2.85M]
  |  |  |  |  ------------------
  |  |  |  |   81|  7.31M|    ((x) == '(') || ((x) == ')'))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (81:5): [True: 2.20k, False: 2.84M]
  |  |  |  |  |  Branch (81:21): [True: 1.24k, False: 2.84M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (1677:6): [True: 8.05M, False: 834]
  |  Branch (1677:45): [True: 2.71M, False: 134k]
  ------------------
 1678|  2.71M|	    unsigned char val;
 1679|  2.71M|	    ret[out++] = '%';
 1680|  2.71M|	    val = ch >> 4;
 1681|  2.71M|	    if (val <= 9)
  ------------------
  |  Branch (1681:10): [True: 2.70M, False: 6.90k]
  ------------------
 1682|  2.70M|		ret[out++] = '0' + val;
 1683|  6.90k|	    else
 1684|  6.90k|		ret[out++] = 'A' + val - 0xA;
 1685|  2.71M|	    val = ch & 0xF;
 1686|  2.71M|	    if (val <= 9)
  ------------------
  |  Branch (1686:10): [True: 2.70M, False: 11.0k]
  ------------------
 1687|  2.70M|		ret[out++] = '0' + val;
 1688|  11.0k|	    else
 1689|  11.0k|		ret[out++] = 'A' + val - 0xA;
 1690|  2.71M|	    in++;
 1691|  5.33M|	} else {
 1692|  5.33M|	    ret[out++] = *in++;
 1693|  5.33M|	}
 1694|       |
 1695|  8.05M|    }
 1696|  1.40k|    ret[out] = 0;
 1697|  1.40k|    return(ret);
 1698|  1.40k|}
xmlBuildURISafe:
 1972|   456k|xmlBuildURISafe(const xmlChar *URI, const xmlChar *base, xmlChar **valPtr) {
 1973|   456k|    xmlChar *val = NULL;
 1974|   456k|    int ret, len, indx, cur, out;
 1975|   456k|    xmlURIPtr ref = NULL;
 1976|   456k|    xmlURIPtr bas = NULL;
 1977|   456k|    xmlURIPtr res = NULL;
 1978|       |
 1979|   456k|    if (valPtr == NULL)
  ------------------
  |  Branch (1979:9): [True: 0, False: 456k]
  ------------------
 1980|      0|        return(1);
 1981|   456k|    *valPtr = NULL;
 1982|       |
 1983|   456k|    if (URI == NULL)
  ------------------
  |  Branch (1983:9): [True: 0, False: 456k]
  ------------------
 1984|      0|        return(1);
 1985|       |
 1986|   456k|    if (base == NULL) {
  ------------------
  |  Branch (1986:9): [True: 18.4k, False: 437k]
  ------------------
 1987|  18.4k|        val = xmlStrdup(URI);
 1988|  18.4k|        if (val == NULL)
  ------------------
  |  Branch (1988:13): [True: 8, False: 18.4k]
  ------------------
 1989|      8|            return(-1);
 1990|  18.4k|        *valPtr = val;
 1991|  18.4k|        return(0);
 1992|  18.4k|    }
 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|   437k|    if (URI[0] != 0)
  ------------------
  |  Branch (2002:9): [True: 430k, False: 7.09k]
  ------------------
 2003|   430k|        ret = xmlParseURISafe((const char *) URI, &ref);
 2004|  7.09k|    else
 2005|  7.09k|        ret = 0;
 2006|   437k|    if (ret != 0)
  ------------------
  |  Branch (2006:9): [True: 8.96k, False: 428k]
  ------------------
 2007|  8.96k|	goto done;
 2008|   428k|    if ((ref != NULL) && (ref->scheme != NULL)) {
  ------------------
  |  Branch (2008:9): [True: 421k, False: 7.09k]
  |  Branch (2008:26): [True: 5.13k, False: 416k]
  ------------------
 2009|       |	/*
 2010|       |	 * The URI is absolute don't modify.
 2011|       |	 */
 2012|  5.13k|	val = xmlStrdup(URI);
 2013|  5.13k|        if (val == NULL)
  ------------------
  |  Branch (2013:13): [True: 28, False: 5.10k]
  ------------------
 2014|     28|            ret = -1;
 2015|  5.13k|	goto done;
 2016|  5.13k|    }
 2017|       |
 2018|       |    /*
 2019|       |     * If base has no scheme or authority, it is assumed to be a
 2020|       |     * filesystem path.
 2021|       |     */
 2022|   423k|    if (xmlStrstr(base, BAD_CAST "://") == NULL) {
  ------------------
  |  |   34|   423k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (2022:9): [True: 401k, False: 22.6k]
  ------------------
 2023|   401k|        xmlFreeURI(ref);
 2024|   401k|        return(xmlResolvePath(URI, base, valPtr));
 2025|   401k|    }
 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.6k|    ret = xmlParseURISafe((const char *) base, &bas);
 2045|  22.6k|    if (ret < 0)
  ------------------
  |  Branch (2045:9): [True: 164, False: 22.4k]
  ------------------
 2046|    164|        goto done;
 2047|  22.4k|    if (ret != 0) {
  ------------------
  |  Branch (2047:9): [True: 6.41k, False: 16.0k]
  ------------------
 2048|  6.41k|	if (ref) {
  ------------------
  |  Branch (2048:6): [True: 5.28k, False: 1.12k]
  ------------------
 2049|  5.28k|            ret = 0;
 2050|  5.28k|	    val = xmlSaveUri(ref);
 2051|  5.28k|            if (val == NULL)
  ------------------
  |  Branch (2051:17): [True: 14, False: 5.26k]
  ------------------
 2052|     14|                ret = -1;
 2053|  5.28k|        }
 2054|  6.41k|	goto done;
 2055|  6.41k|    }
 2056|  16.0k|    if (ref == NULL) {
  ------------------
  |  Branch (2056:9): [True: 1.86k, False: 14.2k]
  ------------------
 2057|       |	/*
 2058|       |	 * the base fragment must be ignored
 2059|       |	 */
 2060|  1.86k|	if (bas->fragment != NULL) {
  ------------------
  |  Branch (2060:6): [True: 249, False: 1.61k]
  ------------------
 2061|    249|	    xmlFree(bas->fragment);
 2062|    249|	    bas->fragment = NULL;
 2063|    249|	}
 2064|  1.86k|	val = xmlSaveUri(bas);
 2065|  1.86k|        if (val == NULL)
  ------------------
  |  Branch (2065:13): [True: 20, False: 1.84k]
  ------------------
 2066|     20|            ret = -1;
 2067|  1.86k|	goto done;
 2068|  1.86k|    }
 2069|       |
 2070|       |    /*
 2071|       |     * 2) If the path component is empty and the scheme, authority, and
 2072|       |     *    query components are undefined, then it is a reference to the
 2073|       |     *    current document and we are done.  Otherwise, the reference URI's
 2074|       |     *    query and fragment components are defined as found (or not found)
 2075|       |     *    within the URI reference and not inherited from the base URI.
 2076|       |     *
 2077|       |     *    NOTE that in modern browsers, the parsing differs from the above
 2078|       |     *    in the following aspect:  the query component is allowed to be
 2079|       |     *    defined while still treating this as a reference to the current
 2080|       |     *    document.
 2081|       |     */
 2082|  14.2k|    ret = -1;
 2083|  14.2k|    res = xmlCreateURI();
 2084|  14.2k|    if (res == NULL)
  ------------------
  |  Branch (2084:9): [True: 24, False: 14.1k]
  ------------------
 2085|     24|	goto done;
 2086|  14.1k|    if ((ref->scheme == NULL) && (ref->path == NULL) &&
  ------------------
  |  Branch (2086:9): [True: 14.1k, False: 0]
  |  Branch (2086:34): [True: 4.89k, False: 9.29k]
  ------------------
 2087|  4.89k|	((ref->authority == NULL) && (ref->server == NULL) &&
  ------------------
  |  Branch (2087:3): [True: 4.89k, False: 0]
  |  Branch (2087:31): [True: 4.18k, False: 718]
  ------------------
 2088|  4.18k|         (ref->port == PORT_EMPTY))) {
  ------------------
  |  |   36|  4.18k|#define PORT_EMPTY           0
  ------------------
  |  Branch (2088:10): [True: 3.94k, False: 239]
  ------------------
 2089|  3.94k|	if (bas->scheme != NULL) {
  ------------------
  |  Branch (2089:6): [True: 3.30k, False: 634]
  ------------------
 2090|  3.30k|	    res->scheme = xmlMemStrdup(bas->scheme);
 2091|  3.30k|            if (res->scheme == NULL)
  ------------------
  |  Branch (2091:17): [True: 10, False: 3.29k]
  ------------------
 2092|     10|                goto done;
 2093|  3.30k|        }
 2094|  3.93k|	if (bas->authority != NULL) {
  ------------------
  |  Branch (2094:6): [True: 0, False: 3.93k]
  ------------------
 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|  3.93k|        } else {
 2099|  3.93k|	    if (bas->server != NULL) {
  ------------------
  |  Branch (2099:10): [True: 2.49k, False: 1.43k]
  ------------------
 2100|  2.49k|		res->server = xmlMemStrdup(bas->server);
 2101|  2.49k|                if (res->server == NULL)
  ------------------
  |  Branch (2101:21): [True: 8, False: 2.48k]
  ------------------
 2102|      8|                    goto done;
 2103|  2.49k|            }
 2104|  3.92k|	    if (bas->user != NULL) {
  ------------------
  |  Branch (2104:10): [True: 1.80k, False: 2.11k]
  ------------------
 2105|  1.80k|		res->user = xmlMemStrdup(bas->user);
 2106|  1.80k|                if (res->user == NULL)
  ------------------
  |  Branch (2106:21): [True: 5, False: 1.80k]
  ------------------
 2107|      5|                    goto done;
 2108|  1.80k|            }
 2109|  3.91k|	    res->port = bas->port;
 2110|  3.91k|	}
 2111|  3.91k|	if (bas->path != NULL) {
  ------------------
  |  Branch (2111:6): [True: 2.00k, False: 1.91k]
  ------------------
 2112|  2.00k|	    res->path = xmlMemStrdup(bas->path);
 2113|  2.00k|            if (res->path == NULL)
  ------------------
  |  Branch (2113:17): [True: 8, False: 1.99k]
  ------------------
 2114|      8|                goto done;
 2115|  2.00k|        }
 2116|  3.91k|	if (ref->query_raw != NULL) {
  ------------------
  |  Branch (2116:6): [True: 428, False: 3.48k]
  ------------------
 2117|    428|	    res->query_raw = xmlMemStrdup (ref->query_raw);
 2118|    428|            if (res->query_raw == NULL)
  ------------------
  |  Branch (2118:17): [True: 4, False: 424]
  ------------------
 2119|      4|                goto done;
 2120|  3.48k|        } else if (ref->query != NULL) {
  ------------------
  |  Branch (2120:20): [True: 0, False: 3.48k]
  ------------------
 2121|      0|	    res->query = xmlMemStrdup(ref->query);
 2122|      0|            if (res->query == NULL)
  ------------------
  |  Branch (2122:17): [True: 0, False: 0]
  ------------------
 2123|      0|                goto done;
 2124|  3.48k|        } else if (bas->query_raw != NULL) {
  ------------------
  |  Branch (2124:20): [True: 1.18k, False: 2.30k]
  ------------------
 2125|  1.18k|	    res->query_raw = xmlMemStrdup(bas->query_raw);
 2126|  1.18k|            if (res->query_raw == NULL)
  ------------------
  |  Branch (2126:17): [True: 7, False: 1.17k]
  ------------------
 2127|      7|                goto done;
 2128|  2.30k|        } else if (bas->query != NULL) {
  ------------------
  |  Branch (2128:20): [True: 0, False: 2.30k]
  ------------------
 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|  3.90k|	if (ref->fragment != NULL) {
  ------------------
  |  Branch (2133:6): [True: 3.46k, False: 433]
  ------------------
 2134|  3.46k|	    res->fragment = xmlMemStrdup(ref->fragment);
 2135|  3.46k|            if (res->fragment == NULL)
  ------------------
  |  Branch (2135:17): [True: 11, False: 3.45k]
  ------------------
 2136|     11|                goto done;
 2137|  3.46k|        }
 2138|  3.88k|	goto step_7;
 2139|  3.90k|    }
 2140|       |
 2141|       |    /*
 2142|       |     * 3) If the scheme component is defined, indicating that the reference
 2143|       |     *    starts with a scheme name, then the reference is interpreted as an
 2144|       |     *    absolute URI and we are done.  Otherwise, the reference URI's
 2145|       |     *    scheme is inherited from the base URI's scheme component.
 2146|       |     */
 2147|  10.2k|    if (ref->scheme != NULL) {
  ------------------
  |  Branch (2147:9): [True: 0, False: 10.2k]
  ------------------
 2148|      0|	val = xmlSaveUri(ref);
 2149|      0|        if (val != NULL)
  ------------------
  |  Branch (2149:13): [True: 0, False: 0]
  ------------------
 2150|      0|            ret = 0;
 2151|      0|	goto done;
 2152|      0|    }
 2153|  10.2k|    if (bas->scheme != NULL) {
  ------------------
  |  Branch (2153:9): [True: 7.25k, False: 2.99k]
  ------------------
 2154|  7.25k|	res->scheme = xmlMemStrdup(bas->scheme);
 2155|  7.25k|        if (res->scheme == NULL)
  ------------------
  |  Branch (2155:13): [True: 18, False: 7.23k]
  ------------------
 2156|     18|            goto done;
 2157|  7.25k|    }
 2158|       |
 2159|  10.2k|    if (ref->query_raw != NULL) {
  ------------------
  |  Branch (2159:9): [True: 608, False: 9.62k]
  ------------------
 2160|    608|	res->query_raw = xmlMemStrdup(ref->query_raw);
 2161|    608|        if (res->query_raw == NULL)
  ------------------
  |  Branch (2161:13): [True: 2, False: 606]
  ------------------
 2162|      2|            goto done;
 2163|  9.62k|    } else if (ref->query != NULL) {
  ------------------
  |  Branch (2163:16): [True: 0, False: 9.62k]
  ------------------
 2164|      0|	res->query = xmlMemStrdup(ref->query);
 2165|      0|        if (res->query == NULL)
  ------------------
  |  Branch (2165:13): [True: 0, False: 0]
  ------------------
 2166|      0|            goto done;
 2167|      0|    }
 2168|  10.2k|    if (ref->fragment != NULL) {
  ------------------
  |  Branch (2168:9): [True: 1.57k, False: 8.65k]
  ------------------
 2169|  1.57k|	res->fragment = xmlMemStrdup(ref->fragment);
 2170|  1.57k|        if (res->fragment == NULL)
  ------------------
  |  Branch (2170:13): [True: 2, False: 1.57k]
  ------------------
 2171|      2|            goto done;
 2172|  1.57k|    }
 2173|       |
 2174|       |    /*
 2175|       |     * 4) If the authority component is defined, then the reference is a
 2176|       |     *    network-path and we skip to step 7.  Otherwise, the reference
 2177|       |     *    URI's authority is inherited from the base URI's authority
 2178|       |     *    component, which will also be undefined if the URI scheme does not
 2179|       |     *    use an authority component.
 2180|       |     */
 2181|  10.2k|    if ((ref->authority != NULL) || (ref->server != NULL) ||
  ------------------
  |  Branch (2181:9): [True: 0, False: 10.2k]
  |  Branch (2181:37): [True: 913, False: 9.31k]
  ------------------
 2182|  9.31k|         (ref->port != PORT_EMPTY)) {
  ------------------
  |  |   36|  9.31k|#define PORT_EMPTY           0
  ------------------
  |  Branch (2182:10): [True: 238, False: 9.07k]
  ------------------
 2183|  1.15k|	if (ref->authority != NULL) {
  ------------------
  |  Branch (2183:6): [True: 0, False: 1.15k]
  ------------------
 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.15k|        } else {
 2188|  1.15k|            if (ref->server != NULL) {
  ------------------
  |  Branch (2188:17): [True: 913, False: 238]
  ------------------
 2189|    913|                res->server = xmlMemStrdup(ref->server);
 2190|    913|                if (res->server == NULL)
  ------------------
  |  Branch (2190:21): [True: 4, False: 909]
  ------------------
 2191|      4|                    goto done;
 2192|    913|            }
 2193|  1.14k|	    if (ref->user != NULL) {
  ------------------
  |  Branch (2193:10): [True: 260, False: 887]
  ------------------
 2194|    260|		res->user = xmlMemStrdup(ref->user);
 2195|    260|                if (res->user == NULL)
  ------------------
  |  Branch (2195:21): [True: 1, False: 259]
  ------------------
 2196|      1|                    goto done;
 2197|    260|            }
 2198|  1.14k|            res->port = ref->port;
 2199|  1.14k|	}
 2200|  1.14k|	if (ref->path != NULL) {
  ------------------
  |  Branch (2200:6): [True: 198, False: 948]
  ------------------
 2201|    198|	    res->path = xmlMemStrdup(ref->path);
 2202|    198|            if (res->path == NULL)
  ------------------
  |  Branch (2202:17): [True: 1, False: 197]
  ------------------
 2203|      1|                goto done;
 2204|    198|        }
 2205|  1.14k|	goto step_7;
 2206|  1.14k|    }
 2207|  9.07k|    if (bas->authority != NULL) {
  ------------------
  |  Branch (2207:9): [True: 0, False: 9.07k]
  ------------------
 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|  9.07k|    } else if ((bas->server != NULL) || (bas->port != PORT_EMPTY)) {
  ------------------
  |  |   36|  4.67k|#define PORT_EMPTY           0
  ------------------
  |  Branch (2211:16): [True: 4.40k, False: 4.67k]
  |  Branch (2211:41): [True: 1.52k, False: 3.15k]
  ------------------
 2212|  5.92k|	if (bas->server != NULL) {
  ------------------
  |  Branch (2212:6): [True: 4.40k, False: 1.52k]
  ------------------
 2213|  4.40k|	    res->server = xmlMemStrdup(bas->server);
 2214|  4.40k|            if (res->server == NULL)
  ------------------
  |  Branch (2214:17): [True: 9, False: 4.39k]
  ------------------
 2215|      9|                goto done;
 2216|  4.40k|        }
 2217|  5.91k|	if (bas->user != NULL) {
  ------------------
  |  Branch (2217:6): [True: 1.50k, False: 4.40k]
  ------------------
 2218|  1.50k|	    res->user = xmlMemStrdup(bas->user);
 2219|  1.50k|            if (res->user == NULL)
  ------------------
  |  Branch (2219:17): [True: 3, False: 1.50k]
  ------------------
 2220|      3|                goto done;
 2221|  1.50k|        }
 2222|  5.91k|	res->port = bas->port;
 2223|  5.91k|    }
 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|  9.06k|    if ((ref->path != NULL) && (ref->path[0] == '/')) {
  ------------------
  |  Branch (2229:9): [True: 9.06k, False: 0]
  |  Branch (2229:32): [True: 1.10k, False: 7.95k]
  ------------------
 2230|  1.10k|	res->path = xmlMemStrdup(ref->path);
 2231|  1.10k|        if (res->path == NULL)
  ------------------
  |  Branch (2231:13): [True: 3, False: 1.10k]
  ------------------
 2232|      3|            goto done;
 2233|  1.10k|	goto step_7;
 2234|  1.10k|    }
 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.95k|    len = 2; /* extra / and 0 */
 2246|  7.95k|    if (ref->path != NULL)
  ------------------
  |  Branch (2246:9): [True: 7.95k, False: 0]
  ------------------
 2247|  7.95k|	len += strlen(ref->path);
 2248|  7.95k|    if (bas->path != NULL)
  ------------------
  |  Branch (2248:9): [True: 3.97k, False: 3.98k]
  ------------------
 2249|  3.97k|	len += strlen(bas->path);
 2250|  7.95k|    res->path = xmlMalloc(len);
 2251|  7.95k|    if (res->path == NULL)
  ------------------
  |  Branch (2251:9): [True: 17, False: 7.94k]
  ------------------
 2252|     17|	goto done;
 2253|  7.94k|    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.94k|    cur = 0;
 2261|  7.94k|    out = 0;
 2262|  7.94k|    if (bas->path != NULL) {
  ------------------
  |  Branch (2262:9): [True: 3.96k, False: 3.97k]
  ------------------
 2263|  34.8k|	while (bas->path[cur] != 0) {
  ------------------
  |  Branch (2263:9): [True: 33.0k, False: 1.72k]
  ------------------
 2264|  1.10M|	    while ((bas->path[cur] != 0) && (bas->path[cur] != '/'))
  ------------------
  |  Branch (2264:13): [True: 1.10M, False: 2.24k]
  |  Branch (2264:38): [True: 1.07M, False: 30.8k]
  ------------------
 2265|  1.07M|		cur++;
 2266|  33.0k|	    if (bas->path[cur] == 0)
  ------------------
  |  Branch (2266:10): [True: 2.24k, False: 30.8k]
  ------------------
 2267|  2.24k|		break;
 2268|       |
 2269|  30.8k|	    cur++;
 2270|  1.06M|	    while (out < cur) {
  ------------------
  |  Branch (2270:13): [True: 1.03M, False: 30.8k]
  ------------------
 2271|  1.03M|		res->path[out] = bas->path[out];
 2272|  1.03M|		out++;
 2273|  1.03M|	    }
 2274|  30.8k|	}
 2275|  3.96k|    }
 2276|  7.94k|    res->path[out] = 0;
 2277|       |
 2278|       |    /*
 2279|       |     * b) The reference's path component is appended to the buffer
 2280|       |     *    string.
 2281|       |     */
 2282|  7.94k|    if (ref->path != NULL && ref->path[0] != 0) {
  ------------------
  |  Branch (2282:9): [True: 7.94k, False: 0]
  |  Branch (2282:30): [True: 7.74k, False: 201]
  ------------------
 2283|  7.74k|	indx = 0;
 2284|       |	/*
 2285|       |	 * Ensure the path includes a '/'
 2286|       |	 */
 2287|  7.74k|	if ((out == 0) && ((bas->server != NULL) || bas->port != PORT_EMPTY))
  ------------------
  |  |   36|  2.26k|#define PORT_EMPTY           0
  ------------------
  |  Branch (2287:6): [True: 4.77k, False: 2.97k]
  |  Branch (2287:21): [True: 2.50k, False: 2.26k]
  |  Branch (2287:46): [True: 823, False: 1.43k]
  ------------------
 2288|  3.33k|	    res->path[out++] = '/';
 2289|  63.0k|	while (ref->path[indx] != 0) {
  ------------------
  |  Branch (2289:9): [True: 55.3k, False: 7.74k]
  ------------------
 2290|  55.3k|	    res->path[out++] = ref->path[indx++];
 2291|  55.3k|	}
 2292|  7.74k|    }
 2293|  7.94k|    res->path[out] = 0;
 2294|       |
 2295|       |    /*
 2296|       |     * Steps c) to h) are really path normalization steps
 2297|       |     */
 2298|  7.94k|    xmlNormalizeURIPath(res->path);
 2299|       |
 2300|  14.0k|step_7:
 2301|       |
 2302|       |    /*
 2303|       |     * 7) The resulting URI components, including any inherited from the
 2304|       |     *    base URI, are recombined to give the absolute form of the URI
 2305|       |     *    reference.
 2306|       |     */
 2307|  14.0k|    val = xmlSaveUri(res);
 2308|  14.0k|    if (val != NULL)
  ------------------
  |  Branch (2308:9): [True: 13.9k, False: 84]
  ------------------
 2309|  13.9k|        ret = 0;
 2310|       |
 2311|  36.7k|done:
 2312|  36.7k|    if (ref != NULL)
  ------------------
  |  Branch (2312:9): [True: 24.7k, False: 11.9k]
  ------------------
 2313|  24.7k|	xmlFreeURI(ref);
 2314|  36.7k|    if (bas != NULL)
  ------------------
  |  Branch (2314:9): [True: 16.0k, False: 20.6k]
  ------------------
 2315|  16.0k|	xmlFreeURI(bas);
 2316|  36.7k|    if (res != NULL)
  ------------------
  |  Branch (2316:9): [True: 14.1k, False: 22.5k]
  ------------------
 2317|  14.1k|	xmlFreeURI(res);
 2318|  36.7k|    *valPtr = val;
 2319|  36.7k|    return(ret);
 2320|  14.0k|}
xmlBuildRelativeURISafe:
 2493|  5.77k|{
 2494|  5.77k|    xmlChar *val = NULL;
 2495|  5.77k|    int ret = 0;
 2496|  5.77k|    size_t ix = 0;
 2497|  5.77k|    size_t nbslash = 0;
 2498|  5.77k|    size_t len = 0;
 2499|  5.77k|    xmlURIPtr ref = NULL;
 2500|  5.77k|    xmlURIPtr bas = NULL;
 2501|  5.77k|    const xmlChar *bptr, *uptr, *rptr;
 2502|  5.77k|    xmlChar *vptr;
 2503|  5.77k|    int remove_path = 0;
 2504|  5.77k|    int refDrive, baseDrive;
 2505|       |
 2506|  5.77k|    if (valPtr == NULL)
  ------------------
  |  Branch (2506:9): [True: 0, False: 5.77k]
  ------------------
 2507|      0|        return(1);
 2508|  5.77k|    *valPtr = NULL;
 2509|  5.77k|    if ((URI == NULL) || (*URI == 0))
  ------------------
  |  Branch (2509:9): [True: 0, False: 5.77k]
  |  Branch (2509:26): [True: 414, False: 5.35k]
  ------------------
 2510|    414|	return(1);
 2511|       |
 2512|  5.35k|    ret = xmlParseUriOrPath((char *) URI, &ref, &refDrive);
 2513|  5.35k|    if (ret < 0)
  ------------------
  |  Branch (2513:9): [True: 34, False: 5.32k]
  ------------------
 2514|     34|        goto done;
 2515|  5.32k|    if (ret != 0) {
  ------------------
  |  Branch (2515:9): [True: 240, False: 5.08k]
  ------------------
 2516|       |        /* Return URI if URI is invalid */
 2517|    240|        ret = 0;
 2518|    240|        val = xmlStrdup(URI);
 2519|    240|        if (val == NULL)
  ------------------
  |  Branch (2519:13): [True: 1, False: 239]
  ------------------
 2520|      1|            ret = -1;
 2521|    240|        goto done;
 2522|    240|    }
 2523|       |
 2524|       |    /* Return URI if base is empty */
 2525|  5.08k|    if ((base == NULL) || (*base == 0))
  ------------------
  |  Branch (2525:9): [True: 0, False: 5.08k]
  |  Branch (2525:27): [True: 3.20k, False: 1.87k]
  ------------------
 2526|  3.20k|        goto done;
 2527|       |
 2528|  1.87k|    ret = xmlParseUriOrPath((char *) base, &bas, &baseDrive);
 2529|  1.87k|    if (ret < 0)
  ------------------
  |  Branch (2529:9): [True: 7, False: 1.87k]
  ------------------
 2530|      7|        goto done;
 2531|  1.87k|    if (ret != 0) {
  ------------------
  |  Branch (2531:9): [True: 591, False: 1.28k]
  ------------------
 2532|       |        /* Return URI if base is invalid */
 2533|    591|        ret = 0;
 2534|    591|        goto done;
 2535|    591|    }
 2536|       |
 2537|       |    /*
 2538|       |     * If the scheme / server on the URI differs from the base,
 2539|       |     * just return the URI
 2540|       |     */
 2541|  1.28k|    if ((xmlStrcmp ((xmlChar *)bas->scheme, (xmlChar *)ref->scheme)) ||
  ------------------
  |  Branch (2541:9): [True: 78, False: 1.20k]
  ------------------
 2542|  1.20k|	(xmlStrcmp ((xmlChar *)bas->server, (xmlChar *)ref->server)) ||
  ------------------
  |  Branch (2542:2): [True: 18, False: 1.18k]
  ------------------
 2543|  1.18k|        (bas->port != ref->port) ||
  ------------------
  |  Branch (2543:9): [True: 0, False: 1.18k]
  ------------------
 2544|  1.18k|        (baseDrive != refDrive)) {
  ------------------
  |  Branch (2544:9): [True: 0, False: 1.18k]
  ------------------
 2545|     96|	goto done;
 2546|     96|    }
 2547|  1.18k|    if (xmlStrEqual((xmlChar *)bas->path, (xmlChar *)ref->path)) {
  ------------------
  |  Branch (2547:9): [True: 140, False: 1.04k]
  ------------------
 2548|    140|	val = xmlStrdup(BAD_CAST "");
  ------------------
  |  |   34|    140|#define BAD_CAST (xmlChar *)
  ------------------
 2549|    140|        if (val == NULL)
  ------------------
  |  Branch (2549:13): [True: 1, False: 139]
  ------------------
 2550|      1|            ret = -1;
 2551|    140|	goto done;
 2552|    140|    }
 2553|  1.04k|    if (bas->path == NULL) {
  ------------------
  |  Branch (2553:9): [True: 9, False: 1.03k]
  ------------------
 2554|      9|	val = xmlStrdup((xmlChar *)ref->path);
 2555|      9|        if (val == NULL) {
  ------------------
  |  Branch (2555:13): [True: 1, False: 8]
  ------------------
 2556|      1|            ret = -1;
 2557|      1|            goto done;
 2558|      1|        }
 2559|      8|	goto escape;
 2560|      9|    }
 2561|  1.03k|    if (ref->path == NULL) {
  ------------------
  |  Branch (2561:9): [True: 12, False: 1.02k]
  ------------------
 2562|     12|        ref->path = (char *) "/";
 2563|     12|	remove_path = 1;
 2564|     12|    }
 2565|       |
 2566|  1.03k|    bptr = (xmlChar *) bas->path;
 2567|  1.03k|    rptr = (xmlChar *) ref->path;
 2568|       |
 2569|       |    /*
 2570|       |     * Return URI if URI and base aren't both absolute or relative.
 2571|       |     */
 2572|  1.03k|    if ((bptr[0] == '/') != (rptr[0] == '/'))
  ------------------
  |  Branch (2572:9): [True: 144, False: 891]
  ------------------
 2573|    144|        goto done;
 2574|       |
 2575|       |    /*
 2576|       |     * At this point we can compare the two paths
 2577|       |     */
 2578|    891|    {
 2579|    891|        size_t pos = 0;
 2580|       |
 2581|       |        /*
 2582|       |         * Next we compare the two strings and find where they first differ
 2583|       |         */
 2584|  3.23k|	while ((bptr[pos] == rptr[pos]) && (bptr[pos] != 0))
  ------------------
  |  Branch (2584:9): [True: 2.33k, False: 891]
  |  Branch (2584:37): [True: 2.33k, False: 0]
  ------------------
 2585|  2.33k|	    pos++;
 2586|       |
 2587|    891|	if (bptr[pos] == rptr[pos]) {
  ------------------
  |  Branch (2587:6): [True: 0, False: 891]
  ------------------
 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|    891|	ix = pos;
 2599|  1.80k|	for (; ix > 0; ix--) {
  ------------------
  |  Branch (2599:9): [True: 1.08k, False: 726]
  ------------------
 2600|  1.08k|	    if (rptr[ix - 1] == '/')
  ------------------
  |  Branch (2600:10): [True: 165, False: 916]
  ------------------
 2601|    165|		break;
 2602|  1.08k|	}
 2603|    891|	uptr = (xmlChar *)&rptr[ix];
 2604|       |
 2605|       |	/*
 2606|       |	 * In base, count the number of '/' from the differing point
 2607|       |	 */
 2608|   139k|	for (; bptr[ix] != 0; ix++) {
  ------------------
  |  Branch (2608:9): [True: 138k, False: 891]
  ------------------
 2609|   138k|	    if (bptr[ix] == '/')
  ------------------
  |  Branch (2609:10): [True: 30.5k, False: 107k]
  ------------------
 2610|  30.5k|		nbslash++;
 2611|   138k|	}
 2612|       |
 2613|       |	/*
 2614|       |	 * e.g: URI="foo/" base="foo/bar" -> "./"
 2615|       |	 */
 2616|    891|	if (nbslash == 0 && !uptr[0]) {
  ------------------
  |  Branch (2616:6): [True: 256, False: 635]
  |  Branch (2616:22): [True: 1, False: 255]
  ------------------
 2617|      1|	    val = xmlStrdup(BAD_CAST "./");
  ------------------
  |  |   34|      1|#define BAD_CAST (xmlChar *)
  ------------------
 2618|      1|            if (val == NULL)
  ------------------
  |  Branch (2618:17): [True: 0, False: 1]
  ------------------
 2619|      0|                ret = -1;
 2620|      1|	    goto done;
 2621|      1|	}
 2622|       |
 2623|    890|	len = (size_t) xmlStrlen (uptr) + 1;
 2624|    890|    }
 2625|       |
 2626|    890|    if (nbslash == 0) {
  ------------------
  |  Branch (2626:9): [True: 255, False: 635]
  ------------------
 2627|    255|	if (uptr != NULL) {
  ------------------
  |  Branch (2627:6): [True: 255, False: 0]
  ------------------
 2628|       |	    /* exception characters from xmlSaveUri */
 2629|    255|	    val = xmlURIEscapeStr(uptr, BAD_CAST "/;&=+$,");
  ------------------
  |  |   34|    255|#define BAD_CAST (xmlChar *)
  ------------------
 2630|    255|            if (val == NULL)
  ------------------
  |  Branch (2630:17): [True: 3, False: 252]
  ------------------
 2631|      3|                ret = -1;
 2632|    255|        }
 2633|    255|	goto done;
 2634|    255|    }
 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|    635|    if (len + 3 * nbslash > SIZE_MAX) {
  ------------------
  |  Branch (2641:9): [True: 0, False: 635]
  ------------------
 2642|      0|        ret = -1;
 2643|      0|        goto done;
 2644|      0|    }
 2645|    635|    val = (xmlChar *) xmlMalloc (len + 3 * nbslash);
 2646|    635|    if (val == NULL) {
  ------------------
  |  Branch (2646:9): [True: 2, False: 633]
  ------------------
 2647|      2|        ret = -1;
 2648|      2|	goto done;
 2649|      2|    }
 2650|    633|    vptr = val;
 2651|       |    /*
 2652|       |     * Put in as many "../" as needed
 2653|       |     */
 2654|  31.2k|    for (; nbslash>0; nbslash--) {
  ------------------
  |  Branch (2654:12): [True: 30.5k, False: 633]
  ------------------
 2655|  30.5k|	*vptr++ = '.';
 2656|  30.5k|	*vptr++ = '.';
 2657|  30.5k|	*vptr++ = '/';
 2658|  30.5k|    }
 2659|       |    /*
 2660|       |     * Finish up with the end of the URI
 2661|       |     */
 2662|    633|    if (uptr != NULL) {
  ------------------
  |  Branch (2662:9): [True: 633, False: 0]
  ------------------
 2663|    633|        if ((vptr > val) && (len > 0) &&
  ------------------
  |  Branch (2663:13): [True: 633, False: 0]
  |  Branch (2663:29): [True: 633, False: 0]
  ------------------
 2664|    633|	    (uptr[0] == '/') && (vptr[-1] == '/')) {
  ------------------
  |  Branch (2664:6): [True: 0, False: 633]
  |  Branch (2664:26): [True: 0, False: 0]
  ------------------
 2665|      0|	    memcpy (vptr, uptr + 1, len - 1);
 2666|      0|	    vptr[len - 2] = 0;
 2667|    633|	} else {
 2668|    633|	    memcpy (vptr, uptr, len);
 2669|    633|	    vptr[len - 1] = 0;
 2670|    633|	}
 2671|    633|    } else {
 2672|      0|	vptr[len - 1] = 0;
 2673|      0|    }
 2674|       |
 2675|    641|escape:
 2676|       |    /* escape the freshly-built path */
 2677|    641|    vptr = val;
 2678|       |    /* exception characters from xmlSaveUri */
 2679|    641|    val = xmlURIEscapeStr(vptr, BAD_CAST "/;&=+$,");
  ------------------
  |  |   34|    641|#define BAD_CAST (xmlChar *)
  ------------------
 2680|    641|    if (val == NULL)
  ------------------
  |  Branch (2680:9): [True: 4, False: 637]
  ------------------
 2681|      4|        ret = -1;
 2682|    637|    else
 2683|    637|        ret = 0;
 2684|    641|    xmlFree(vptr);
 2685|       |
 2686|  5.35k|done:
 2687|  5.35k|    if ((ret == 0) && (val == NULL)) {
  ------------------
  |  Branch (2687:9): [True: 5.30k, False: 53]
  |  Branch (2687:23): [True: 4.03k, False: 1.26k]
  ------------------
 2688|  4.03k|        val = xmlSaveUri(ref);
 2689|  4.03k|        if (val == NULL)
  ------------------
  |  Branch (2689:13): [True: 8, False: 4.03k]
  ------------------
 2690|      8|            ret = -1;
 2691|  4.03k|    }
 2692|       |
 2693|       |    /*
 2694|       |     * Free the working variables
 2695|       |     */
 2696|  5.35k|    if (remove_path != 0)
  ------------------
  |  Branch (2696:9): [True: 12, False: 5.34k]
  ------------------
 2697|     12|        ref->path = NULL;
 2698|  5.35k|    if (ref != NULL)
  ------------------
  |  Branch (2698:9): [True: 5.08k, False: 274]
  ------------------
 2699|  5.08k|	xmlFreeURI (ref);
 2700|  5.35k|    if (bas != NULL)
  ------------------
  |  Branch (2700:9): [True: 1.28k, False: 4.07k]
  ------------------
 2701|  1.28k|	xmlFreeURI (bas);
 2702|  5.35k|    if (ret != 0) {
  ------------------
  |  Branch (2702:9): [True: 61, False: 5.29k]
  ------------------
 2703|     61|        xmlFree(val);
 2704|     61|        val = NULL;
 2705|     61|    }
 2706|       |
 2707|  5.35k|    *valPtr = val;
 2708|  5.35k|    return(ret);
 2709|    641|}
xmlCanonicPath:
 2747|  9.36k|{
 2748|  9.36k|    xmlChar *ret;
 2749|       |
 2750|  9.36k|    if (path == NULL)
  ------------------
  |  Branch (2750:9): [True: 0, False: 9.36k]
  ------------------
 2751|      0|	return(NULL);
 2752|       |
 2753|       |    /* Check if this is an "absolute uri" */
 2754|  9.36k|    if (xmlStrstr(path, BAD_CAST "://") != NULL) {
  ------------------
  |  |   34|  9.36k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (2754:9): [True: 514, False: 8.85k]
  ------------------
 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|    514|        ret = xmlURIEscapeStr(path, BAD_CAST ":/?#[]@!$&()*+,;='%");
  ------------------
  |  |   34|    514|#define BAD_CAST (xmlChar *)
  ------------------
 2763|  8.85k|    } else {
 2764|  8.85k|        ret = xmlStrdup((const xmlChar *) path);
 2765|  8.85k|    }
 2766|       |
 2767|  9.36k|    return(ret);
 2768|  9.36k|}
xmlPathToURI:
 2781|  9.36k|{
 2782|  9.36k|    return(xmlCanonicPath(path));
 2783|  9.36k|}
uri.c:xmlParse3986URIReference:
  924|   555k|xmlParse3986URIReference(xmlURIPtr uri, const char *str) {
  925|   555k|    int ret;
  926|       |
  927|   555k|    if (str == NULL)
  ------------------
  |  Branch (927:9): [True: 0, False: 555k]
  ------------------
  928|      0|	return(-1);
  929|   555k|    xmlCleanURI(uri);
  930|       |
  931|       |    /*
  932|       |     * Try first to parse absolute refs, then fallback to relative if
  933|       |     * it fails.
  934|       |     */
  935|   555k|    ret = xmlParse3986URI(uri, str);
  936|   555k|    if (ret < 0)
  ------------------
  |  Branch (936:9): [True: 145, False: 555k]
  ------------------
  937|    145|        return(ret);
  938|   555k|    if (ret != 0) {
  ------------------
  |  Branch (938:9): [True: 525k, False: 29.4k]
  ------------------
  939|   525k|	xmlCleanURI(uri);
  940|   525k|        ret = xmlParse3986RelativeRef(uri, str);
  941|   525k|	if (ret != 0) {
  ------------------
  |  Branch (941:6): [True: 28.5k, False: 497k]
  ------------------
  942|  28.5k|	    xmlCleanURI(uri);
  943|  28.5k|	    return(ret);
  944|  28.5k|	}
  945|   525k|    }
  946|   526k|    return(0);
  947|   555k|}
uri.c:xmlCleanURI:
 1383|  1.14M|xmlCleanURI(xmlURIPtr uri) {
 1384|  1.14M|    if (uri == NULL) return;
  ------------------
  |  Branch (1384:9): [True: 0, False: 1.14M]
  ------------------
 1385|       |
 1386|  1.14M|    if (uri->scheme != NULL) xmlFree(uri->scheme);
  ------------------
  |  Branch (1386:9): [True: 79.2k, False: 1.06M]
  ------------------
 1387|  1.14M|    uri->scheme = NULL;
 1388|  1.14M|    if (uri->server != NULL) xmlFree(uri->server);
  ------------------
  |  Branch (1388:9): [True: 4.31k, False: 1.14M]
  ------------------
 1389|  1.14M|    uri->server = NULL;
 1390|  1.14M|    if (uri->user != NULL) xmlFree(uri->user);
  ------------------
  |  Branch (1390:9): [True: 792, False: 1.14M]
  ------------------
 1391|  1.14M|    uri->user = NULL;
 1392|  1.14M|    if (uri->path != NULL) xmlFree(uri->path);
  ------------------
  |  Branch (1392:9): [True: 25.0k, False: 1.12M]
  ------------------
 1393|  1.14M|    uri->path = NULL;
 1394|  1.14M|    if (uri->fragment != NULL) xmlFree(uri->fragment);
  ------------------
  |  Branch (1394:9): [True: 1.73k, False: 1.14M]
  ------------------
 1395|  1.14M|    uri->fragment = NULL;
 1396|  1.14M|    if (uri->opaque != NULL) xmlFree(uri->opaque);
  ------------------
  |  Branch (1396:9): [True: 0, False: 1.14M]
  ------------------
 1397|  1.14M|    uri->opaque = NULL;
 1398|  1.14M|    if (uri->authority != NULL) xmlFree(uri->authority);
  ------------------
  |  Branch (1398:9): [True: 0, False: 1.14M]
  ------------------
 1399|  1.14M|    uri->authority = NULL;
 1400|  1.14M|    if (uri->query != NULL) xmlFree(uri->query);
  ------------------
  |  Branch (1400:9): [True: 1.81k, False: 1.14M]
  ------------------
 1401|  1.14M|    uri->query = NULL;
 1402|  1.14M|    if (uri->query_raw != NULL) xmlFree(uri->query_raw);
  ------------------
  |  Branch (1402:9): [True: 1.80k, False: 1.14M]
  ------------------
 1403|       |    uri->query_raw = NULL;
 1404|  1.14M|}
uri.c:xmlParse3986URI:
  885|   555k|xmlParse3986URI(xmlURIPtr uri, const char *str) {
  886|   555k|    int ret;
  887|       |
  888|   555k|    ret = xmlParse3986Scheme(uri, &str);
  889|   555k|    if (ret != 0) return(ret);
  ------------------
  |  Branch (889:9): [True: 446k, False: 108k]
  ------------------
  890|   108k|    if (*str != ':') {
  ------------------
  |  Branch (890:9): [True: 69.2k, False: 39.5k]
  ------------------
  891|  69.2k|	return(1);
  892|  69.2k|    }
  893|  39.5k|    str++;
  894|  39.5k|    ret = xmlParse3986HierPart(uri, &str);
  895|  39.5k|    if (ret != 0) return(ret);
  ------------------
  |  Branch (895:9): [True: 1.42k, False: 38.1k]
  ------------------
  896|  38.1k|    if (*str == '?') {
  ------------------
  |  Branch (896:9): [True: 2.67k, False: 35.4k]
  ------------------
  897|  2.67k|	str++;
  898|  2.67k|	ret = xmlParse3986Query(uri, &str);
  899|  2.67k|	if (ret != 0) return(ret);
  ------------------
  |  Branch (899:6): [True: 11, False: 2.66k]
  ------------------
  900|  2.67k|    }
  901|  38.0k|    if (*str == '#') {
  ------------------
  |  Branch (901:9): [True: 1.42k, False: 36.6k]
  ------------------
  902|  1.42k|	str++;
  903|  1.42k|	ret = xmlParse3986Fragment(uri, &str);
  904|  1.42k|	if (ret != 0) return(ret);
  ------------------
  |  Branch (904:6): [True: 1, False: 1.42k]
  ------------------
  905|  1.42k|    }
  906|  38.0k|    if (*str != 0) {
  ------------------
  |  Branch (906:9): [True: 8.64k, False: 29.4k]
  ------------------
  907|  8.64k|	xmlCleanURI(uri);
  908|  8.64k|	return(1);
  909|  8.64k|    }
  910|  29.4k|    return(0);
  911|  38.0k|}
uri.c:xmlParse3986Scheme:
  224|   555k|xmlParse3986Scheme(xmlURIPtr uri, const char **str) {
  225|   555k|    const char *cur;
  226|       |
  227|   555k|    cur = *str;
  228|   555k|    if (!ISA_ALPHA(cur))
  ------------------
  |  |  128|   555k|#define ISA_ALPHA(p) (((*(p) >= 'a') && (*(p) <= 'z')) ||		\
  |  |  ------------------
  |  |  |  Branch (128:24): [True: 105k, False: 450k]
  |  |  |  Branch (128:41): [True: 103k, False: 1.83k]
  |  |  ------------------
  |  |  129|   555k|                      ((*(p) >= 'A') && (*(p) <= 'Z')))
  |  |  ------------------
  |  |  |  Branch (129:24): [True: 7.48k, False: 444k]
  |  |  |  Branch (129:41): [True: 5.40k, False: 2.08k]
  |  |  ------------------
  ------------------
  229|   446k|	return(1);
  230|   108k|    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|   330k|    while (ISA_ALPHA(cur) || ISA_DIGIT(cur) ||
  ------------------
  |  |  128|   660k|#define ISA_ALPHA(p) (((*(p) >= 'a') && (*(p) <= 'z')) ||		\
  |  |  ------------------
  |  |  |  Branch (128:24): [True: 99.8k, False: 230k]
  |  |  |  Branch (128:41): [True: 99.4k, False: 425]
  |  |  ------------------
  |  |  129|   660k|                      ((*(p) >= 'A') && (*(p) <= 'Z')))
  |  |  ------------------
  |  |  |  Branch (129:24): [True: 76.9k, False: 154k]
  |  |  |  Branch (129:41): [True: 76.3k, False: 627]
  |  |  ------------------
  ------------------
                  while (ISA_ALPHA(cur) || ISA_DIGIT(cur) ||
  ------------------
  |  |  127|   485k|#define ISA_DIGIT(p) ((*(p) >= '0') && (*(p) <= '9'))
  |  |  ------------------
  |  |  |  Branch (127:23): [True: 77.6k, False: 77.0k]
  |  |  |  Branch (127:40): [True: 34.8k, False: 42.7k]
  |  |  ------------------
  ------------------
  241|   221k|           (*cur == '+') || (*cur == '-') || (*cur == '.')) cur++;
  ------------------
  |  Branch (241:12): [True: 6.53k, False: 113k]
  |  Branch (241:29): [True: 1.69k, False: 111k]
  |  Branch (241:46): [True: 2.80k, False: 108k]
  ------------------
  242|   108k|    if (uri != NULL) {
  ------------------
  |  Branch (242:9): [True: 108k, False: 0]
  ------------------
  243|   108k|	if (uri->scheme != NULL) xmlFree(uri->scheme);
  ------------------
  |  Branch (243:6): [True: 0, False: 108k]
  ------------------
  244|   108k|	uri->scheme = STRNDUP(*str, cur - *str);
  ------------------
  |  |  119|   108k|#define STRNDUP(s, n) (char *) xmlStrndup((const xmlChar *)(s), (n))
  ------------------
  245|   108k|        if (uri->scheme == NULL)
  ------------------
  |  Branch (245:13): [True: 66, False: 108k]
  ------------------
  246|     66|            return(-1);
  247|   108k|    }
  248|   108k|    *str = cur;
  249|   108k|    return(0);
  250|   108k|}
uri.c:xmlParse3986HierPart:
  782|  39.5k|{
  783|  39.5k|    const char *cur;
  784|  39.5k|    int ret;
  785|       |
  786|  39.5k|    cur = *str;
  787|       |
  788|  39.5k|    if ((*cur == '/') && (*(cur + 1) == '/')) {
  ------------------
  |  Branch (788:9): [True: 28.5k, False: 10.9k]
  |  Branch (788:26): [True: 27.6k, False: 973]
  ------------------
  789|  27.6k|        cur += 2;
  790|  27.6k|	ret = xmlParse3986Authority(uri, &cur);
  791|  27.6k|	if (ret != 0) return(ret);
  ------------------
  |  Branch (791:6): [True: 1.40k, False: 26.2k]
  ------------------
  792|       |        /*
  793|       |         * An empty server is marked with a special URI value.
  794|       |         */
  795|  26.2k|	if ((uri->server == NULL) && (uri->port == PORT_EMPTY))
  ------------------
  |  |   36|  3.31k|#define PORT_EMPTY           0
  ------------------
  |  Branch (795:6): [True: 3.31k, False: 22.9k]
  |  Branch (795:31): [True: 3.02k, False: 291]
  ------------------
  796|  3.02k|	    uri->port = PORT_EMPTY_SERVER;
  ------------------
  |  |   37|  3.02k|#define PORT_EMPTY_SERVER   -1
  ------------------
  797|  26.2k|	ret = xmlParse3986PathAbEmpty(uri, &cur);
  798|  26.2k|	if (ret != 0) return(ret);
  ------------------
  |  Branch (798:6): [True: 12, False: 26.2k]
  ------------------
  799|  26.2k|	*str = cur;
  800|  26.2k|	return(0);
  801|  26.2k|    } else if (*cur == '/') {
  ------------------
  |  Branch (801:16): [True: 973, False: 10.9k]
  ------------------
  802|    973|        ret = xmlParse3986PathAbsolute(uri, &cur);
  803|    973|	if (ret != 0) return(ret);
  ------------------
  |  Branch (803:6): [True: 1, False: 972]
  ------------------
  804|  10.9k|    } else if (ISA_PCHAR(uri, cur)) {
  ------------------
  |  |  174|  10.9k|     (ISA_UNRESERVED(u, p) || ISA_PCT_ENCODED(p) || ISA_SUB_DELIM(p) ||	\
  |  |  ------------------
  |  |  |  |  189|  21.8k|#define ISA_UNRESERVED(u, p) (xmlIsUnreserved(u, p))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (189:30): [True: 2.70k, False: 8.22k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                    (ISA_UNRESERVED(u, p) || ISA_PCT_ENCODED(p) || ISA_SUB_DELIM(p) ||	\
  |  |  ------------------
  |  |  |  |  168|  19.1k|     ((*(p) == '%') && (ISA_HEXDIG(p + 1)) && (ISA_HEXDIG(p + 2)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  131|  2.51k|       (ISA_DIGIT(p) || ((*(p) >= 'a') && (*(p) <= 'f')) ||		\
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  127|  5.02k|#define ISA_DIGIT(p) ((*(p) >= '0') && (*(p) <= '9'))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (127:23): [True: 2.18k, False: 328]
  |  |  |  |  |  |  |  |  |  Branch (127:40): [True: 420, False: 1.76k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (131:26): [True: 1.17k, False: 915]
  |  |  |  |  |  |  |  Branch (131:43): [True: 981, False: 196]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  132|  2.51k|        ((*(p) >= 'A') && (*(p) <= 'F')))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (132:10): [True: 737, False: 374]
  |  |  |  |  |  |  |  Branch (132:27): [True: 529, False: 208]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |                    ((*(p) == '%') && (ISA_HEXDIG(p + 1)) && (ISA_HEXDIG(p + 2)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  131|  1.93k|       (ISA_DIGIT(p) || ((*(p) >= 'a') && (*(p) <= 'f')) ||		\
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  127|  3.86k|#define ISA_DIGIT(p) ((*(p) >= '0') && (*(p) <= '9'))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (127:23): [True: 1.69k, False: 237]
  |  |  |  |  |  |  |  |  |  Branch (127:40): [True: 287, False: 1.40k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (131:26): [True: 976, False: 667]
  |  |  |  |  |  |  |  Branch (131:43): [True: 733, False: 243]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  132|  1.93k|        ((*(p) >= 'A') && (*(p) <= 'F')))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (132:10): [True: 669, False: 241]
  |  |  |  |  |  |  |  Branch (132:27): [True: 295, False: 374]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (168:7): [True: 2.51k, False: 5.71k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                    (ISA_UNRESERVED(u, p) || ISA_PCT_ENCODED(p) || ISA_SUB_DELIM(p) ||	\
  |  |  ------------------
  |  |  |  |  139|  17.8k|      (((*(p) == '!')) || ((*(p) == '$')) || ((*(p) == '&')) ||		\
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (139:8): [True: 264, False: 6.64k]
  |  |  |  |  |  Branch (139:27): [True: 215, False: 6.43k]
  |  |  |  |  |  Branch (139:46): [True: 257, False: 6.17k]
  |  |  |  |  ------------------
  |  |  |  |  140|  6.91k|       ((*(p) == '(')) || ((*(p) == ')')) || ((*(p) == '*')) ||		\
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (140:8): [True: 221, False: 5.95k]
  |  |  |  |  |  Branch (140:27): [True: 200, False: 5.75k]
  |  |  |  |  |  Branch (140:46): [True: 218, False: 5.53k]
  |  |  |  |  ------------------
  |  |  |  |  141|  6.91k|       ((*(p) == '+')) || ((*(p) == ',')) || ((*(p) == ';')) ||		\
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (141:8): [True: 734, False: 4.80k]
  |  |  |  |  |  Branch (141:27): [True: 374, False: 4.42k]
  |  |  |  |  |  Branch (141:46): [True: 355, False: 4.07k]
  |  |  |  |  ------------------
  |  |  |  |  142|  6.91k|       ((*(p) == '=')) || ((*(p) == '\'')))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (142:8): [True: 204, False: 3.87k]
  |  |  |  |  |  Branch (142:27): [True: 201, False: 3.66k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  175|  10.9k|      ((*(p) == ':')) || ((*(p) == '@')))
  |  |  ------------------
  |  |  |  Branch (175:7): [True: 452, False: 3.21k]
  |  |  |  Branch (175:26): [True: 205, False: 3.01k]
  |  |  ------------------
  ------------------
  805|  7.92k|        ret = xmlParse3986PathRootless(uri, &cur);
  806|  7.92k|	if (ret != 0) return(ret);
  ------------------
  |  Branch (806:6): [True: 16, False: 7.90k]
  ------------------
  807|  7.92k|    } else {
  808|       |	/* path-empty is effectively empty */
  809|  3.01k|	if (uri != NULL) {
  ------------------
  |  Branch (809:6): [True: 3.01k, False: 0]
  ------------------
  810|  3.01k|	    if (uri->path != NULL) xmlFree(uri->path);
  ------------------
  |  Branch (810:10): [True: 0, False: 3.01k]
  ------------------
  811|  3.01k|	    uri->path = NULL;
  812|  3.01k|	}
  813|  3.01k|    }
  814|  11.8k|    *str = cur;
  815|  11.8k|    return (0);
  816|  39.5k|}
uri.c:xmlParse3986Authority:
  529|  30.6k|{
  530|  30.6k|    const char *cur;
  531|  30.6k|    int ret;
  532|       |
  533|  30.6k|    cur = *str;
  534|       |    /*
  535|       |     * try to parse an userinfo and check for the trailing @
  536|       |     */
  537|  30.6k|    ret = xmlParse3986Userinfo(uri, &cur);
  538|  30.6k|    if (ret < 0)
  ------------------
  |  Branch (538:9): [True: 13, False: 30.6k]
  ------------------
  539|     13|        return(ret);
  540|  30.6k|    if ((ret != 0) || (*cur != '@'))
  ------------------
  |  Branch (540:9): [True: 25.2k, False: 5.42k]
  |  Branch (540:23): [True: 0, False: 5.42k]
  ------------------
  541|  25.2k|        cur = *str;
  542|  5.42k|    else
  543|  5.42k|        cur++;
  544|  30.6k|    ret = xmlParse3986Host(uri, &cur);
  545|  30.6k|    if (ret != 0) return(ret);
  ------------------
  |  Branch (545:9): [True: 260, False: 30.3k]
  ------------------
  546|  30.3k|    if (*cur == ':') {
  ------------------
  |  Branch (546:9): [True: 3.18k, False: 27.2k]
  ------------------
  547|  3.18k|        cur++;
  548|  3.18k|        ret = xmlParse3986Port(uri, &cur);
  549|  3.18k|	if (ret != 0) return(ret);
  ------------------
  |  Branch (549:6): [True: 1.43k, False: 1.74k]
  ------------------
  550|  3.18k|    }
  551|  28.9k|    *str = cur;
  552|  28.9k|    return(0);
  553|  30.3k|}
uri.c:xmlParse3986Userinfo:
  379|  30.6k|{
  380|  30.6k|    const char *cur;
  381|       |
  382|  30.6k|    cur = *str;
  383|  1.78M|    while (ISA_UNRESERVED(uri, cur) || ISA_PCT_ENCODED(cur) ||
  ------------------
  |  |  189|  3.57M|#define ISA_UNRESERVED(u, p) (xmlIsUnreserved(u, p))
  |  |  ------------------
  |  |  |  Branch (189:30): [True: 224k, False: 1.56M]
  |  |  ------------------
  ------------------
                  while (ISA_UNRESERVED(uri, cur) || ISA_PCT_ENCODED(cur) ||
  ------------------
  |  |  168|  3.35M|     ((*(p) == '%') && (ISA_HEXDIG(p + 1)) && (ISA_HEXDIG(p + 2)))
  |  |  ------------------
  |  |  |  |  131|  1.51M|       (ISA_DIGIT(p) || ((*(p) >= 'a') && (*(p) <= 'f')) ||		\
  |  |  |  |  ------------------
  |  |  |  |  |  |  127|  3.03M|#define ISA_DIGIT(p) ((*(p) >= '0') && (*(p) <= '9'))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (127:23): [True: 1.51M, False: 278]
  |  |  |  |  |  |  |  Branch (127:40): [True: 1.50M, False: 5.93k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (131:26): [True: 1.37k, False: 4.83k]
  |  |  |  |  |  Branch (131:43): [True: 1.16k, False: 208]
  |  |  |  |  ------------------
  |  |  |  |  132|  1.51M|        ((*(p) >= 'A') && (*(p) <= 'F')))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (132:10): [True: 4.76k, False: 279]
  |  |  |  |  |  Branch (132:27): [True: 4.52k, False: 234]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                    ((*(p) == '%') && (ISA_HEXDIG(p + 1)) && (ISA_HEXDIG(p + 2)))
  |  |  ------------------
  |  |  |  |  131|  1.51M|       (ISA_DIGIT(p) || ((*(p) >= 'a') && (*(p) <= 'f')) ||		\
  |  |  |  |  ------------------
  |  |  |  |  |  |  127|  3.03M|#define ISA_DIGIT(p) ((*(p) >= '0') && (*(p) <= '9'))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (127:23): [True: 1.51M, False: 330]
  |  |  |  |  |  |  |  Branch (127:40): [True: 1.51M, False: 4.98k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (131:26): [True: 1.23k, False: 4.07k]
  |  |  |  |  |  Branch (131:43): [True: 933, False: 301]
  |  |  |  |  ------------------
  |  |  |  |  132|  1.51M|        ((*(p) >= 'A') && (*(p) <= 'F')))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (132:10): [True: 3.83k, False: 539]
  |  |  |  |  |  Branch (132:27): [True: 3.53k, False: 301]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (168:7): [True: 1.51M, False: 48.9k]
  |  |  ------------------
  ------------------
  384|  50.3k|           ISA_SUB_DELIM(cur) || (*cur == ':'))
  ------------------
  |  |  139|  1.83M|      (((*(p) == '!')) || ((*(p) == '$')) || ((*(p) == '&')) ||		\
  |  |  ------------------
  |  |  |  Branch (139:8): [True: 1.96k, False: 48.3k]
  |  |  |  Branch (139:27): [True: 689, False: 47.6k]
  |  |  |  Branch (139:46): [True: 557, False: 47.1k]
  |  |  ------------------
  |  |  140|  50.3k|       ((*(p) == '(')) || ((*(p) == ')')) || ((*(p) == '*')) ||		\
  |  |  ------------------
  |  |  |  Branch (140:8): [True: 1.99k, False: 45.1k]
  |  |  |  Branch (140:27): [True: 1.34k, False: 43.7k]
  |  |  |  Branch (140:46): [True: 2.00k, False: 41.7k]
  |  |  ------------------
  |  |  141|  50.3k|       ((*(p) == '+')) || ((*(p) == ',')) || ((*(p) == ';')) ||		\
  |  |  ------------------
  |  |  |  Branch (141:8): [True: 1.41k, False: 40.3k]
  |  |  |  Branch (141:27): [True: 975, False: 39.3k]
  |  |  |  Branch (141:46): [True: 1.30k, False: 38.0k]
  |  |  ------------------
  |  |  142|  50.3k|       ((*(p) == '=')) || ((*(p) == '\'')))
  |  |  ------------------
  |  |  |  Branch (142:8): [True: 1.67k, False: 36.4k]
  |  |  |  Branch (142:27): [True: 1.90k, False: 34.5k]
  |  |  ------------------
  ------------------
  |  Branch (384:34): [True: 3.84k, False: 30.6k]
  ------------------
  385|  1.75M|	NEXT(cur);
  ------------------
  |  |  108|  1.75M|#define NEXT(p) ((*p == '%')? p += 3 : p++)
  |  |  ------------------
  |  |  |  Branch (108:18): [True: 1.51M, False: 243k]
  |  |  ------------------
  ------------------
  386|  30.6k|    if (*cur == '@') {
  ------------------
  |  Branch (386:9): [True: 5.43k, False: 25.2k]
  ------------------
  387|  5.43k|	if (uri != NULL) {
  ------------------
  |  Branch (387:6): [True: 5.43k, False: 0]
  ------------------
  388|  5.43k|	    if (uri->user != NULL) xmlFree(uri->user);
  ------------------
  |  Branch (388:10): [True: 0, False: 5.43k]
  ------------------
  389|  5.43k|	    if (uri->cleanup & XML_URI_NO_UNESCAPE)
  ------------------
  |  |  192|  5.43k|#define XML_URI_NO_UNESCAPE     2
  ------------------
  |  Branch (389:10): [True: 0, False: 5.43k]
  ------------------
  390|      0|		uri->user = STRNDUP(*str, cur - *str);
  ------------------
  |  |  119|      0|#define STRNDUP(s, n) (char *) xmlStrndup((const xmlChar *)(s), (n))
  ------------------
  391|  5.43k|	    else
  392|  5.43k|		uri->user = xmlURIUnescapeString(*str, cur - *str, NULL);
  393|  5.43k|            if (uri->user == NULL)
  ------------------
  |  Branch (393:17): [True: 13, False: 5.42k]
  ------------------
  394|     13|                return(-1);
  395|  5.43k|	}
  396|  5.42k|	*str = cur;
  397|  5.42k|	return(0);
  398|  5.43k|    }
  399|  25.2k|    return(1);
  400|  30.6k|}
uri.c:xmlParse3986Host:
  452|  30.6k|{
  453|  30.6k|    const char *cur = *str;
  454|  30.6k|    const char *host;
  455|       |
  456|  30.6k|    host = cur;
  457|       |    /*
  458|       |     * IPv6 and future addressing scheme are enclosed between brackets
  459|       |     */
  460|  30.6k|    if (*cur == '[') {
  ------------------
  |  Branch (460:9): [True: 429, False: 30.2k]
  ------------------
  461|    429|        cur++;
  462|  2.67k|	while ((*cur != ']') && (*cur != 0))
  ------------------
  |  Branch (462:9): [True: 2.48k, False: 198]
  |  Branch (462:26): [True: 2.24k, False: 231]
  ------------------
  463|  2.24k|	    cur++;
  464|    429|	if (*cur != ']')
  ------------------
  |  Branch (464:6): [True: 231, False: 198]
  ------------------
  465|    231|	    return(1);
  466|    198|	cur++;
  467|    198|	goto found;
  468|    429|    }
  469|       |    /*
  470|       |     * try to parse an IPv4
  471|       |     */
  472|  30.2k|    if (ISA_DIGIT(cur)) {
  ------------------
  |  |  127|  30.2k|#define ISA_DIGIT(p) ((*(p) >= '0') && (*(p) <= '9'))
  |  |  ------------------
  |  |  |  Branch (127:23): [True: 23.4k, False: 6.75k]
  |  |  |  Branch (127:40): [True: 7.66k, False: 15.8k]
  |  |  ------------------
  ------------------
  473|  7.66k|        if (xmlParse3986DecOctet(&cur) != 0)
  ------------------
  |  Branch (473:13): [True: 999, False: 6.66k]
  ------------------
  474|    999|	    goto not_ipv4;
  475|  6.66k|	if (*cur != '.')
  ------------------
  |  Branch (475:6): [True: 3.64k, False: 3.02k]
  ------------------
  476|  3.64k|	    goto not_ipv4;
  477|  3.02k|	cur++;
  478|  3.02k|        if (xmlParse3986DecOctet(&cur) != 0)
  ------------------
  |  Branch (478:13): [True: 1.28k, False: 1.74k]
  ------------------
  479|  1.28k|	    goto not_ipv4;
  480|  1.74k|	if (*cur != '.')
  ------------------
  |  Branch (480:6): [True: 1.44k, False: 300]
  ------------------
  481|  1.44k|	    goto not_ipv4;
  482|    300|        if (xmlParse3986DecOctet(&cur) != 0)
  ------------------
  |  Branch (482:13): [True: 300, False: 0]
  ------------------
  483|    300|	    goto not_ipv4;
  484|      0|	if (*cur != '.')
  ------------------
  |  Branch (484:6): [True: 0, False: 0]
  ------------------
  485|      0|	    goto not_ipv4;
  486|      0|        if (xmlParse3986DecOctet(&cur) != 0)
  ------------------
  |  Branch (486:13): [True: 0, False: 0]
  ------------------
  487|      0|	    goto not_ipv4;
  488|      0|	goto found;
  489|  7.66k|not_ipv4:
  490|  7.66k|        cur = *str;
  491|  7.66k|    }
  492|       |    /*
  493|       |     * then this should be a hostname which can be empty
  494|       |     */
  495|  11.1M|    while (ISA_UNRESERVED(uri, cur) ||
  ------------------
  |  |  189|  22.3M|#define ISA_UNRESERVED(u, p) (xmlIsUnreserved(u, p))
  |  |  ------------------
  |  |  |  Branch (189:30): [True: 11.0M, False: 79.5k]
  |  |  ------------------
  ------------------
  496|  79.5k|           ISA_PCT_ENCODED(cur) || ISA_SUB_DELIM(cur))
  ------------------
  |  |  168|  11.2M|     ((*(p) == '%') && (ISA_HEXDIG(p + 1)) && (ISA_HEXDIG(p + 2)))
  |  |  ------------------
  |  |  |  |  131|  30.3k|       (ISA_DIGIT(p) || ((*(p) >= 'a') && (*(p) <= 'f')) ||		\
  |  |  |  |  ------------------
  |  |  |  |  |  |  127|  60.7k|#define ISA_DIGIT(p) ((*(p) >= '0') && (*(p) <= '9'))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (127:23): [True: 30.0k, False: 294]
  |  |  |  |  |  |  |  Branch (127:40): [True: 27.2k, False: 2.83k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (131:26): [True: 1.34k, False: 1.78k]
  |  |  |  |  |  Branch (131:43): [True: 1.12k, False: 216]
  |  |  |  |  ------------------
  |  |  |  |  132|  30.3k|        ((*(p) >= 'A') && (*(p) <= 'F')))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (132:10): [True: 1.70k, False: 295]
  |  |  |  |  |  Branch (132:27): [True: 1.46k, False: 242]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                    ((*(p) == '%') && (ISA_HEXDIG(p + 1)) && (ISA_HEXDIG(p + 2)))
  |  |  ------------------
  |  |  |  |  131|  29.8k|       (ISA_DIGIT(p) || ((*(p) >= 'a') && (*(p) <= 'f')) ||		\
  |  |  |  |  ------------------
  |  |  |  |  |  |  127|  59.6k|#define ISA_DIGIT(p) ((*(p) >= '0') && (*(p) <= '9'))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (127:23): [True: 29.5k, False: 321]
  |  |  |  |  |  |  |  Branch (127:40): [True: 26.3k, False: 3.13k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (131:26): [True: 1.40k, False: 2.05k]
  |  |  |  |  |  Branch (131:43): [True: 1.10k, False: 301]
  |  |  |  |  ------------------
  |  |  |  |  132|  29.8k|        ((*(p) >= 'A') && (*(p) <= 'F')))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (132:10): [True: 1.79k, False: 562]
  |  |  |  |  |  Branch (132:27): [True: 1.49k, False: 301]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (168:7): [True: 30.3k, False: 49.2k]
  |  |  ------------------
  ------------------
                         ISA_PCT_ENCODED(cur) || ISA_SUB_DELIM(cur))
  ------------------
  |  |  139|  50.6k|      (((*(p) == '!')) || ((*(p) == '$')) || ((*(p) == '&')) ||		\
  |  |  ------------------
  |  |  |  Branch (139:8): [True: 2.85k, False: 47.7k]
  |  |  |  Branch (139:27): [True: 1.09k, False: 46.6k]
  |  |  |  Branch (139:46): [True: 431, False: 46.2k]
  |  |  ------------------
  |  |  140|  50.6k|       ((*(p) == '(')) || ((*(p) == ')')) || ((*(p) == '*')) ||		\
  |  |  ------------------
  |  |  |  Branch (140:8): [True: 2.72k, False: 43.5k]
  |  |  |  Branch (140:27): [True: 1.50k, False: 41.9k]
  |  |  |  Branch (140:46): [True: 2.25k, False: 39.7k]
  |  |  ------------------
  |  |  141|  50.6k|       ((*(p) == '+')) || ((*(p) == ',')) || ((*(p) == ';')) ||		\
  |  |  ------------------
  |  |  |  Branch (141:8): [True: 1.46k, False: 38.2k]
  |  |  |  Branch (141:27): [True: 795, False: 37.4k]
  |  |  |  Branch (141:46): [True: 3.98k, False: 33.4k]
  |  |  ------------------
  |  |  142|  50.6k|       ((*(p) == '=')) || ((*(p) == '\'')))
  |  |  ------------------
  |  |  |  Branch (142:8): [True: 1.81k, False: 31.6k]
  |  |  |  Branch (142:27): [True: 1.45k, False: 30.2k]
  |  |  ------------------
  ------------------
  497|  11.1M|        NEXT(cur);
  ------------------
  |  |  108|  11.1M|#define NEXT(p) ((*p == '%')? p += 3 : p++)
  |  |  ------------------
  |  |  |  Branch (108:18): [True: 28.9k, False: 11.1M]
  |  |  ------------------
  ------------------
  498|  30.4k|found:
  499|  30.4k|    if (uri != NULL) {
  ------------------
  |  Branch (499:9): [True: 30.4k, False: 0]
  ------------------
  500|  30.4k|	if (uri->authority != NULL) xmlFree(uri->authority);
  ------------------
  |  Branch (500:6): [True: 0, False: 30.4k]
  ------------------
  501|  30.4k|	uri->authority = NULL;
  502|  30.4k|	if (uri->server != NULL) xmlFree(uri->server);
  ------------------
  |  Branch (502:6): [True: 0, False: 30.4k]
  ------------------
  503|  30.4k|	if (cur != host) {
  ------------------
  |  Branch (503:6): [True: 25.5k, False: 4.83k]
  ------------------
  504|  25.5k|	    if (uri->cleanup & XML_URI_NO_UNESCAPE)
  ------------------
  |  |  192|  25.5k|#define XML_URI_NO_UNESCAPE     2
  ------------------
  |  Branch (504:10): [True: 0, False: 25.5k]
  ------------------
  505|      0|		uri->server = STRNDUP(host, cur - host);
  ------------------
  |  |  119|      0|#define STRNDUP(s, n) (char *) xmlStrndup((const xmlChar *)(s), (n))
  ------------------
  506|  25.5k|	    else
  507|  25.5k|		uri->server = xmlURIUnescapeString(host, cur - host, NULL);
  508|  25.5k|            if (uri->server == NULL)
  ------------------
  |  Branch (508:17): [True: 29, False: 25.5k]
  ------------------
  509|     29|                return(-1);
  510|  25.5k|	} else
  511|  4.83k|	    uri->server = NULL;
  512|  30.4k|    }
  513|  30.3k|    *str = cur;
  514|  30.3k|    return(0);
  515|  30.4k|}
uri.c:xmlParse3986DecOctet:
  415|  10.9k|xmlParse3986DecOctet(const char **str) {
  416|  10.9k|    const char *cur = *str;
  417|       |
  418|  10.9k|    if (!(ISA_DIGIT(cur)))
  ------------------
  |  |  127|  10.9k|#define ISA_DIGIT(p) ((*(p) >= '0') && (*(p) <= '9'))
  |  |  ------------------
  |  |  |  Branch (127:23): [True: 10.2k, False: 781]
  |  |  |  Branch (127:40): [True: 9.88k, False: 328]
  |  |  ------------------
  ------------------
  419|  1.10k|        return(1);
  420|  9.88k|    if (!ISA_DIGIT(cur+1))
  ------------------
  |  |  127|  9.88k|#define ISA_DIGIT(p) ((*(p) >= '0') && (*(p) <= '9'))
  |  |  ------------------
  |  |  |  Branch (127:23): [True: 5.83k, False: 4.05k]
  |  |  |  Branch (127:40): [True: 5.02k, False: 810]
  |  |  ------------------
  ------------------
  421|  4.86k|	cur++;
  422|  5.02k|    else if ((*cur != '0') && (ISA_DIGIT(cur + 1)) && (!ISA_DIGIT(cur+2)))
  ------------------
  |  |  127|  4.26k|#define ISA_DIGIT(p) ((*(p) >= '0') && (*(p) <= '9'))
  |  |  ------------------
  |  |  |  Branch (127:23): [True: 4.26k, False: 0]
  |  |  |  Branch (127:40): [True: 4.26k, False: 0]
  |  |  ------------------
  ------------------
                  else if ((*cur != '0') && (ISA_DIGIT(cur + 1)) && (!ISA_DIGIT(cur+2)))
  ------------------
  |  |  127|  4.26k|#define ISA_DIGIT(p) ((*(p) >= '0') && (*(p) <= '9'))
  |  |  ------------------
  |  |  |  Branch (127:23): [True: 3.16k, False: 1.10k]
  |  |  |  Branch (127:40): [True: 2.32k, False: 840]
  |  |  ------------------
  ------------------
  |  Branch (422:14): [True: 4.26k, False: 756]
  ------------------
  423|  1.94k|	cur += 2;
  424|  3.08k|    else if ((*cur == '1') && (ISA_DIGIT(cur + 1)) && (ISA_DIGIT(cur + 2)))
  ------------------
  |  |  127|    441|#define ISA_DIGIT(p) ((*(p) >= '0') && (*(p) <= '9'))
  |  |  ------------------
  |  |  |  Branch (127:23): [True: 441, False: 0]
  |  |  |  Branch (127:40): [True: 441, False: 0]
  |  |  ------------------
  ------------------
                  else if ((*cur == '1') && (ISA_DIGIT(cur + 1)) && (ISA_DIGIT(cur + 2)))
  ------------------
  |  |  127|    441|#define ISA_DIGIT(p) ((*(p) >= '0') && (*(p) <= '9'))
  |  |  ------------------
  |  |  |  Branch (127:23): [True: 441, False: 0]
  |  |  |  Branch (127:40): [True: 441, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (424:14): [True: 441, False: 2.64k]
  ------------------
  425|    441|	cur += 3;
  426|  2.64k|    else if ((*cur == '2') && (*(cur + 1) >= '0') &&
  ------------------
  |  Branch (426:14): [True: 1.61k, False: 1.02k]
  |  Branch (426:31): [True: 1.61k, False: 0]
  ------------------
  427|  1.61k|	     (*(cur + 1) <= '4') && (ISA_DIGIT(cur + 2)))
  ------------------
  |  |  127|    595|#define ISA_DIGIT(p) ((*(p) >= '0') && (*(p) <= '9'))
  |  |  ------------------
  |  |  |  Branch (127:23): [True: 595, False: 0]
  |  |  |  Branch (127:40): [True: 595, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (427:7): [True: 595, False: 1.02k]
  ------------------
  428|    595|	cur += 3;
  429|  2.04k|    else if ((*cur == '2') && (*(cur + 1) == '5') &&
  ------------------
  |  Branch (429:14): [True: 1.02k, False: 1.02k]
  |  Branch (429:31): [True: 576, False: 444]
  ------------------
  430|    576|	     (*(cur + 2) >= '0') && (*(cur + 1) <= '5'))
  ------------------
  |  Branch (430:7): [True: 576, False: 0]
  |  Branch (430:30): [True: 576, False: 0]
  ------------------
  431|    576|	cur += 3;
  432|  1.47k|    else
  433|  1.47k|        return(1);
  434|  8.41k|    *str = cur;
  435|  8.41k|    return(0);
  436|  9.88k|}
uri.c:xmlParse3986Port:
  342|  3.18k|{
  343|  3.18k|    const char *cur = *str;
  344|  3.18k|    int port = 0;
  345|       |
  346|  3.18k|    if (ISA_DIGIT(cur)) {
  ------------------
  |  |  127|  3.18k|#define ISA_DIGIT(p) ((*(p) >= '0') && (*(p) <= '9'))
  |  |  ------------------
  |  |  |  Branch (127:23): [True: 2.84k, False: 333]
  |  |  |  Branch (127:40): [True: 2.29k, False: 550]
  |  |  ------------------
  ------------------
  347|  11.7k|	while (ISA_DIGIT(cur)) {
  ------------------
  |  |  127|  11.7k|#define ISA_DIGIT(p) ((*(p) >= '0') && (*(p) <= '9'))
  |  |  ------------------
  |  |  |  Branch (127:23): [True: 10.3k, False: 1.43k]
  |  |  |  Branch (127:40): [True: 10.0k, False: 310]
  |  |  ------------------
  ------------------
  348|  10.0k|            int digit = *cur - '0';
  349|       |
  350|  10.0k|            if (port > INT_MAX / 10)
  ------------------
  |  Branch (350:17): [True: 335, False: 9.67k]
  ------------------
  351|    335|                return(1);
  352|  9.67k|            port *= 10;
  353|  9.67k|            if (port > INT_MAX - digit)
  ------------------
  |  Branch (353:17): [True: 216, False: 9.45k]
  ------------------
  354|    216|                return(1);
  355|  9.45k|	    port += digit;
  356|       |
  357|  9.45k|	    cur++;
  358|  9.45k|	}
  359|  1.74k|	if (uri != NULL)
  ------------------
  |  Branch (359:6): [True: 1.74k, False: 0]
  ------------------
  360|  1.74k|	    uri->port = port;
  361|  1.74k|	*str = cur;
  362|  1.74k|	return(0);
  363|  2.29k|    }
  364|    883|    return(1);
  365|  3.18k|}
uri.c:xmlParse3986PathAbEmpty:
  609|  28.9k|{
  610|  28.9k|    const char *cur;
  611|  28.9k|    int ret;
  612|       |
  613|  28.9k|    cur = *str;
  614|       |
  615|   100k|    while (*cur == '/') {
  ------------------
  |  Branch (615:12): [True: 71.4k, False: 28.9k]
  ------------------
  616|  71.4k|        cur++;
  617|  71.4k|	ret = xmlParse3986Segment(uri, &cur, 0, 1);
  618|  71.4k|	if (ret != 0) return(ret);
  ------------------
  |  Branch (618:6): [True: 0, False: 71.4k]
  ------------------
  619|  71.4k|    }
  620|  28.9k|    if (uri != NULL) {
  ------------------
  |  Branch (620:9): [True: 28.9k, False: 0]
  ------------------
  621|  28.9k|	if (uri->path != NULL) xmlFree(uri->path);
  ------------------
  |  Branch (621:6): [True: 0, False: 28.9k]
  ------------------
  622|  28.9k|        if (*str != cur) {
  ------------------
  |  Branch (622:13): [True: 15.2k, False: 13.6k]
  ------------------
  623|  15.2k|            if (uri->cleanup & XML_URI_NO_UNESCAPE)
  ------------------
  |  |  192|  15.2k|#define XML_URI_NO_UNESCAPE     2
  ------------------
  |  Branch (623:17): [True: 0, False: 15.2k]
  ------------------
  624|      0|                uri->path = STRNDUP(*str, cur - *str);
  ------------------
  |  |  119|      0|#define STRNDUP(s, n) (char *) xmlStrndup((const xmlChar *)(s), (n))
  ------------------
  625|  15.2k|            else
  626|  15.2k|                uri->path = xmlURIUnescapeString(*str, cur - *str, NULL);
  627|  15.2k|            if (uri->path == NULL)
  ------------------
  |  Branch (627:17): [True: 13, False: 15.2k]
  ------------------
  628|     13|                return (-1);
  629|  15.2k|        } else {
  630|  13.6k|            uri->path = NULL;
  631|  13.6k|        }
  632|  28.9k|    }
  633|  28.9k|    *str = cur;
  634|  28.9k|    return (0);
  635|  28.9k|}
uri.c:xmlParse3986Segment:
  572|   264k|{
  573|   264k|    const char *cur;
  574|       |
  575|   264k|    cur = *str;
  576|   264k|    if (!ISA_PCHAR(uri, cur) || (*cur == forbid)) {
  ------------------
  |  |  174|   529k|     (ISA_UNRESERVED(u, p) || ISA_PCT_ENCODED(p) || ISA_SUB_DELIM(p) ||	\
  |  |  ------------------
  |  |  |  |  189|   529k|#define ISA_UNRESERVED(u, p) (xmlIsUnreserved(u, p))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (189:30): [True: 180k, False: 84.2k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                    (ISA_UNRESERVED(u, p) || ISA_PCT_ENCODED(p) || ISA_SUB_DELIM(p) ||	\
  |  |  ------------------
  |  |  |  |  168|   348k|     ((*(p) == '%') && (ISA_HEXDIG(p + 1)) && (ISA_HEXDIG(p + 2)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  131|  6.61k|       (ISA_DIGIT(p) || ((*(p) >= 'a') && (*(p) <= 'f')) ||		\
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  127|  13.2k|#define ISA_DIGIT(p) ((*(p) >= '0') && (*(p) <= '9'))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (127:23): [True: 6.39k, False: 225]
  |  |  |  |  |  |  |  |  |  Branch (127:40): [True: 2.73k, False: 3.65k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (131:26): [True: 2.08k, False: 1.79k]
  |  |  |  |  |  |  |  Branch (131:43): [True: 1.86k, False: 222]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  132|  6.61k|        ((*(p) >= 'A') && (*(p) <= 'F')))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (132:10): [True: 1.60k, False: 409]
  |  |  |  |  |  |  |  Branch (132:27): [True: 1.25k, False: 356]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |                    ((*(p) == '%') && (ISA_HEXDIG(p + 1)) && (ISA_HEXDIG(p + 2)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  131|  5.85k|       (ISA_DIGIT(p) || ((*(p) >= 'a') && (*(p) <= 'f')) ||		\
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  127|  11.7k|#define ISA_DIGIT(p) ((*(p) >= '0') && (*(p) <= '9'))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (127:23): [True: 5.65k, False: 196]
  |  |  |  |  |  |  |  |  |  Branch (127:40): [True: 1.82k, False: 3.83k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (131:26): [True: 2.34k, False: 1.68k]
  |  |  |  |  |  |  |  Branch (131:43): [True: 2.14k, False: 200]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  132|  5.85k|        ((*(p) >= 'A') && (*(p) <= 'F')))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (132:10): [True: 1.63k, False: 250]
  |  |  |  |  |  |  |  Branch (132:27): [True: 1.39k, False: 239]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (168:7): [True: 6.61k, False: 77.6k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                    (ISA_UNRESERVED(u, p) || ISA_PCT_ENCODED(p) || ISA_SUB_DELIM(p) ||	\
  |  |  ------------------
  |  |  |  |  139|   343k|      (((*(p) == '!')) || ((*(p) == '$')) || ((*(p) == '&')) ||		\
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (139:8): [True: 2.15k, False: 76.7k]
  |  |  |  |  |  Branch (139:27): [True: 2.12k, False: 74.6k]
  |  |  |  |  |  Branch (139:46): [True: 604, False: 74.0k]
  |  |  |  |  ------------------
  |  |  |  |  140|  78.8k|       ((*(p) == '(')) || ((*(p) == ')')) || ((*(p) == '*')) ||		\
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (140:8): [True: 1.78k, False: 72.2k]
  |  |  |  |  |  Branch (140:27): [True: 1.27k, False: 70.9k]
  |  |  |  |  |  Branch (140:46): [True: 31.9k, False: 39.0k]
  |  |  |  |  ------------------
  |  |  |  |  141|  78.8k|       ((*(p) == '+')) || ((*(p) == ',')) || ((*(p) == ';')) ||		\
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (141:8): [True: 1.83k, False: 37.1k]
  |  |  |  |  |  Branch (141:27): [True: 1.43k, False: 35.7k]
  |  |  |  |  |  Branch (141:46): [True: 1.66k, False: 34.0k]
  |  |  |  |  ------------------
  |  |  |  |  142|  78.8k|       ((*(p) == '=')) || ((*(p) == '\'')))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (142:8): [True: 1.06k, False: 33.0k]
  |  |  |  |  |  Branch (142:27): [True: 2.31k, False: 30.6k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  175|   264k|      ((*(p) == ':')) || ((*(p) == '@')))
  |  |  ------------------
  |  |  |  Branch (175:7): [True: 4.02k, False: 26.6k]
  |  |  |  Branch (175:26): [True: 1.77k, False: 24.8k]
  |  |  ------------------
  ------------------
  |  Branch (576:33): [True: 951, False: 238k]
  ------------------
  577|  25.8k|        if (empty)
  ------------------
  |  Branch (577:13): [True: 22.6k, False: 3.23k]
  ------------------
  578|  22.6k|	    return(0);
  579|  3.23k|	return(1);
  580|  25.8k|    }
  581|   238k|    NEXT(cur);
  ------------------
  |  |  108|   238k|#define NEXT(p) ((*p == '%')? p += 3 : p++)
  |  |  ------------------
  |  |  |  Branch (108:18): [True: 5.36k, False: 233k]
  |  |  ------------------
  ------------------
  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|  5.67M|    while (ISA_PCHAR(uri, cur) && (*cur != forbid))
  ------------------
  |  |  174|  11.3M|     (ISA_UNRESERVED(u, p) || ISA_PCT_ENCODED(p) || ISA_SUB_DELIM(p) ||	\
  |  |  ------------------
  |  |  |  |  189|  11.3M|#define ISA_UNRESERVED(u, p) (xmlIsUnreserved(u, p))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (189:30): [True: 3.81M, False: 1.86M]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                    (ISA_UNRESERVED(u, p) || ISA_PCT_ENCODED(p) || ISA_SUB_DELIM(p) ||	\
  |  |  ------------------
  |  |  |  |  168|  7.54M|     ((*(p) == '%') && (ISA_HEXDIG(p + 1)) && (ISA_HEXDIG(p + 2)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  131|  9.92k|       (ISA_DIGIT(p) || ((*(p) >= 'a') && (*(p) <= 'f')) ||		\
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  127|  19.8k|#define ISA_DIGIT(p) ((*(p) >= '0') && (*(p) <= '9'))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (127:23): [True: 9.43k, False: 492]
  |  |  |  |  |  |  |  |  |  Branch (127:40): [True: 5.79k, False: 3.63k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (131:26): [True: 1.54k, False: 2.57k]
  |  |  |  |  |  |  |  Branch (131:43): [True: 1.26k, False: 283]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  132|  9.92k|        ((*(p) >= 'A') && (*(p) <= 'F')))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (132:10): [True: 2.22k, False: 637]
  |  |  |  |  |  |  |  Branch (132:27): [True: 1.89k, False: 328]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |                    ((*(p) == '%') && (ISA_HEXDIG(p + 1)) && (ISA_HEXDIG(p + 2)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  131|  8.96k|       (ISA_DIGIT(p) || ((*(p) >= 'a') && (*(p) <= 'f')) ||		\
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  127|  17.9k|#define ISA_DIGIT(p) ((*(p) >= '0') && (*(p) <= '9'))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (127:23): [True: 8.47k, False: 483]
  |  |  |  |  |  |  |  |  |  Branch (127:40): [True: 5.28k, False: 3.19k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (131:26): [True: 1.32k, False: 2.35k]
  |  |  |  |  |  |  |  Branch (131:43): [True: 1.03k, False: 287]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  132|  8.96k|        ((*(p) >= 'A') && (*(p) <= 'F')))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (132:10): [True: 2.11k, False: 523]
  |  |  |  |  |  |  |  Branch (132:27): [True: 1.49k, False: 628]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (168:7): [True: 9.92k, False: 1.85M]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                    (ISA_UNRESERVED(u, p) || ISA_PCT_ENCODED(p) || ISA_SUB_DELIM(p) ||	\
  |  |  ------------------
  |  |  |  |  139|  7.53M|      (((*(p) == '!')) || ((*(p) == '$')) || ((*(p) == '&')) ||		\
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (139:8): [True: 2.64k, False: 1.85M]
  |  |  |  |  |  Branch (139:27): [True: 1.20k, False: 1.85M]
  |  |  |  |  |  Branch (139:46): [True: 362, False: 1.85M]
  |  |  |  |  ------------------
  |  |  |  |  140|  1.86M|       ((*(p) == '(')) || ((*(p) == ')')) || ((*(p) == '*')) ||		\
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (140:8): [True: 1.75k, False: 1.85M]
  |  |  |  |  |  Branch (140:27): [True: 1.69k, False: 1.85M]
  |  |  |  |  |  Branch (140:46): [True: 1.59M, False: 258k]
  |  |  |  |  ------------------
  |  |  |  |  141|  1.86M|       ((*(p) == '+')) || ((*(p) == ',')) || ((*(p) == ';')) ||		\
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (141:8): [True: 1.87k, False: 256k]
  |  |  |  |  |  Branch (141:27): [True: 2.38k, False: 254k]
  |  |  |  |  |  Branch (141:46): [True: 1.83k, False: 252k]
  |  |  |  |  ------------------
  |  |  |  |  142|  1.86M|       ((*(p) == '=')) || ((*(p) == '\'')))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (142:8): [True: 5.20k, False: 247k]
  |  |  |  |  |  Branch (142:27): [True: 2.06k, False: 245k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  175|  5.67M|      ((*(p) == ':')) || ((*(p) == '@')))
  |  |  ------------------
  |  |  |  Branch (175:7): [True: 16.3k, False: 229k]
  |  |  |  Branch (175:26): [True: 2.28k, False: 226k]
  |  |  ------------------
  ------------------
  |  Branch (591:35): [True: 5.44M, False: 11.9k]
  ------------------
  592|  5.44M|        NEXT(cur);
  ------------------
  |  |  108|  5.67M|#define NEXT(p) ((*p == '%')? p += 3 : p++)
  |  |  ------------------
  |  |  |  Branch (108:18): [True: 7.80k, False: 5.43M]
  |  |  ------------------
  ------------------
  593|   238k|    *str = cur;
  594|   238k|    return (0);
  595|   264k|}
uri.c:xmlParse3986PathAbsolute:
  649|  8.69k|{
  650|  8.69k|    const char *cur;
  651|  8.69k|    int ret;
  652|       |
  653|  8.69k|    cur = *str;
  654|       |
  655|  8.69k|    if (*cur != '/')
  ------------------
  |  Branch (655:9): [True: 0, False: 8.69k]
  ------------------
  656|      0|        return(1);
  657|  8.69k|    cur++;
  658|  8.69k|    ret = xmlParse3986Segment(uri, &cur, 0, 0);
  659|  8.69k|    if (ret == 0) {
  ------------------
  |  Branch (659:9): [True: 6.40k, False: 2.28k]
  ------------------
  660|  18.9k|	while (*cur == '/') {
  ------------------
  |  Branch (660:9): [True: 12.5k, False: 6.40k]
  ------------------
  661|  12.5k|	    cur++;
  662|  12.5k|	    ret = xmlParse3986Segment(uri, &cur, 0, 1);
  663|  12.5k|	    if (ret != 0) return(ret);
  ------------------
  |  Branch (663:10): [True: 0, False: 12.5k]
  ------------------
  664|  12.5k|	}
  665|  6.40k|    }
  666|  8.69k|    if (uri != NULL) {
  ------------------
  |  Branch (666:9): [True: 8.69k, False: 0]
  ------------------
  667|  8.69k|	if (uri->path != NULL) xmlFree(uri->path);
  ------------------
  |  Branch (667:6): [True: 0, False: 8.69k]
  ------------------
  668|  8.69k|        if (cur != *str) {
  ------------------
  |  Branch (668:13): [True: 8.69k, False: 0]
  ------------------
  669|  8.69k|            if (uri->cleanup & XML_URI_NO_UNESCAPE)
  ------------------
  |  |  192|  8.69k|#define XML_URI_NO_UNESCAPE     2
  ------------------
  |  Branch (669:17): [True: 0, False: 8.69k]
  ------------------
  670|      0|                uri->path = STRNDUP(*str, cur - *str);
  ------------------
  |  |  119|      0|#define STRNDUP(s, n) (char *) xmlStrndup((const xmlChar *)(s), (n))
  ------------------
  671|  8.69k|            else
  672|  8.69k|                uri->path = xmlURIUnescapeString(*str, cur - *str, NULL);
  673|  8.69k|            if (uri->path == NULL)
  ------------------
  |  Branch (673:17): [True: 20, False: 8.67k]
  ------------------
  674|     20|                return (-1);
  675|  8.69k|        } else {
  676|      0|            uri->path = NULL;
  677|      0|        }
  678|  8.69k|    }
  679|  8.67k|    *str = cur;
  680|  8.67k|    return (0);
  681|  8.69k|}
uri.c:xmlIsUnreserved:
  196|  55.4M|xmlIsUnreserved(xmlURIPtr uri, const char *cur) {
  197|  55.4M|    if (uri == NULL)
  ------------------
  |  Branch (197:9): [True: 0, False: 55.4M]
  ------------------
  198|      0|        return(0);
  199|       |
  200|  55.4M|    if (ISA_STRICTLY_UNRESERVED(cur))
  ------------------
  |  |  161|  55.4M|      ((ISA_ALPHA(p)) || (ISA_DIGIT(p)) || ((*(p) == '-')) ||		\
  |  |  ------------------
  |  |  |  |  128|  55.4M|#define ISA_ALPHA(p) (((*(p) >= 'a') && (*(p) <= 'z')) ||		\
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (128:24): [True: 3.19M, False: 52.2M]
  |  |  |  |  |  Branch (128:41): [True: 3.17M, False: 11.0k]
  |  |  |  |  ------------------
  |  |  |  |  129|  55.4M|                      ((*(p) >= 'A') && (*(p) <= 'Z')))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (129:24): [True: 40.2M, False: 11.9M]
  |  |  |  |  |  Branch (129:41): [True: 40.2M, False: 19.8k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                     ((ISA_ALPHA(p)) || (ISA_DIGIT(p)) || ((*(p) == '-')) ||		\
  |  |  ------------------
  |  |  |  |  127|  12.0M|#define ISA_DIGIT(p) ((*(p) >= '0') && (*(p) <= '9'))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (127:23): [True: 1.59M, False: 10.4M]
  |  |  |  |  |  Branch (127:40): [True: 1.12M, False: 474k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (161:44): [True: 103k, False: 10.7M]
  |  |  ------------------
  |  |  162|  55.4M|       ((*(p) == '.')) || ((*(p) == '_')) || ((*(p) == '~')))
  |  |  ------------------
  |  |  |  Branch (162:8): [True: 170k, False: 10.6M]
  |  |  |  Branch (162:27): [True: 1.99k, False: 10.6M]
  |  |  |  Branch (162:46): [True: 10.1k, False: 10.5M]
  |  |  ------------------
  ------------------
  201|  44.8M|        return(1);
  202|       |
  203|  10.5M|    if (uri->cleanup & XML_URI_ALLOW_UNWISE) {
  ------------------
  |  |  191|  10.5M|#define XML_URI_ALLOW_UNWISE    1
  ------------------
  |  Branch (203:9): [True: 0, False: 10.5M]
  ------------------
  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|  10.5M|    } else if (uri->cleanup & XML_URI_ALLOW_UCSCHAR) {
  ------------------
  |  |  193|  10.5M|#define XML_URI_ALLOW_UCSCHAR   4
  ------------------
  |  Branch (206:16): [True: 0, False: 10.5M]
  ------------------
  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|  10.5M|    return(0);
  212|  10.5M|}
uri.c:xmlParse3986PathRootless:
  695|  7.92k|{
  696|  7.92k|    const char *cur;
  697|  7.92k|    int ret;
  698|       |
  699|  7.92k|    cur = *str;
  700|       |
  701|  7.92k|    ret = xmlParse3986Segment(uri, &cur, 0, 0);
  702|  7.92k|    if (ret != 0) return(ret);
  ------------------
  |  Branch (702:9): [True: 0, False: 7.92k]
  ------------------
  703|  10.6k|    while (*cur == '/') {
  ------------------
  |  Branch (703:12): [True: 2.73k, False: 7.92k]
  ------------------
  704|  2.73k|        cur++;
  705|  2.73k|	ret = xmlParse3986Segment(uri, &cur, 0, 1);
  706|  2.73k|	if (ret != 0) return(ret);
  ------------------
  |  Branch (706:6): [True: 0, False: 2.73k]
  ------------------
  707|  2.73k|    }
  708|  7.92k|    if (uri != NULL) {
  ------------------
  |  Branch (708:9): [True: 7.92k, False: 0]
  ------------------
  709|  7.92k|	if (uri->path != NULL) xmlFree(uri->path);
  ------------------
  |  Branch (709:6): [True: 0, False: 7.92k]
  ------------------
  710|  7.92k|        if (cur != *str) {
  ------------------
  |  Branch (710:13): [True: 7.92k, False: 0]
  ------------------
  711|  7.92k|            if (uri->cleanup & XML_URI_NO_UNESCAPE)
  ------------------
  |  |  192|  7.92k|#define XML_URI_NO_UNESCAPE     2
  ------------------
  |  Branch (711:17): [True: 0, False: 7.92k]
  ------------------
  712|      0|                uri->path = STRNDUP(*str, cur - *str);
  ------------------
  |  |  119|      0|#define STRNDUP(s, n) (char *) xmlStrndup((const xmlChar *)(s), (n))
  ------------------
  713|  7.92k|            else
  714|  7.92k|                uri->path = xmlURIUnescapeString(*str, cur - *str, NULL);
  715|  7.92k|            if (uri->path == NULL)
  ------------------
  |  Branch (715:17): [True: 16, False: 7.90k]
  ------------------
  716|     16|                return (-1);
  717|  7.92k|        } else {
  718|      0|            uri->path = NULL;
  719|      0|        }
  720|  7.92k|    }
  721|  7.90k|    *str = cur;
  722|  7.90k|    return (0);
  723|  7.92k|}
uri.c:xmlParse3986Query:
  300|  7.54k|{
  301|  7.54k|    const char *cur;
  302|       |
  303|  7.54k|    cur = *str;
  304|       |
  305|  26.4M|    while ((ISA_PCHAR(uri, cur)) || (*cur == '/') || (*cur == '?'))
  ------------------
  |  |  174|  26.4M|     (ISA_UNRESERVED(u, p) || ISA_PCT_ENCODED(p) || ISA_SUB_DELIM(p) ||	\
  |  |  ------------------
  |  |  |  |  189|  52.9M|#define ISA_UNRESERVED(u, p) (xmlIsUnreserved(u, p))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (189:30): [True: 25.9M, False: 548k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                    (ISA_UNRESERVED(u, p) || ISA_PCT_ENCODED(p) || ISA_SUB_DELIM(p) ||	\
  |  |  ------------------
  |  |  |  |  168|  27.0M|     ((*(p) == '%') && (ISA_HEXDIG(p + 1)) && (ISA_HEXDIG(p + 2)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  131|  4.75k|       (ISA_DIGIT(p) || ((*(p) >= 'a') && (*(p) <= 'f')) ||		\
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  127|  9.51k|#define ISA_DIGIT(p) ((*(p) >= '0') && (*(p) <= '9'))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (127:23): [True: 4.53k, False: 220]
  |  |  |  |  |  |  |  |  |  Branch (127:40): [True: 1.79k, False: 2.74k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (131:26): [True: 1.48k, False: 1.48k]
  |  |  |  |  |  |  |  Branch (131:43): [True: 1.19k, False: 290]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  132|  4.75k|        ((*(p) >= 'A') && (*(p) <= 'F')))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (132:10): [True: 1.53k, False: 236]
  |  |  |  |  |  |  |  Branch (132:27): [True: 1.17k, False: 359]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |                    ((*(p) == '%') && (ISA_HEXDIG(p + 1)) && (ISA_HEXDIG(p + 2)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  131|  4.16k|       (ISA_DIGIT(p) || ((*(p) >= 'a') && (*(p) <= 'f')) ||		\
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  127|  8.32k|#define ISA_DIGIT(p) ((*(p) >= '0') && (*(p) <= '9'))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (127:23): [True: 3.77k, False: 386]
  |  |  |  |  |  |  |  |  |  Branch (127:40): [True: 1.21k, False: 2.56k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (131:26): [True: 1.14k, False: 1.80k]
  |  |  |  |  |  |  |  Branch (131:43): [True: 930, False: 215]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  132|  4.16k|        ((*(p) >= 'A') && (*(p) <= 'F')))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (132:10): [True: 1.60k, False: 413]
  |  |  |  |  |  |  |  Branch (132:27): [True: 1.24k, False: 363]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (168:7): [True: 4.75k, False: 543k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                    (ISA_UNRESERVED(u, p) || ISA_PCT_ENCODED(p) || ISA_SUB_DELIM(p) ||	\
  |  |  ------------------
  |  |  |  |  139|  27.0M|      (((*(p) == '!')) || ((*(p) == '$')) || ((*(p) == '&')) ||		\
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (139:8): [True: 1.02k, False: 544k]
  |  |  |  |  |  Branch (139:27): [True: 490, False: 543k]
  |  |  |  |  |  Branch (139:46): [True: 322, False: 543k]
  |  |  |  |  ------------------
  |  |  |  |  140|   545k|       ((*(p) == '(')) || ((*(p) == ')')) || ((*(p) == '*')) ||		\
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (140:8): [True: 287, False: 543k]
  |  |  |  |  |  Branch (140:27): [True: 660, False: 542k]
  |  |  |  |  |  Branch (140:46): [True: 486k, False: 56.0k]
  |  |  |  |  ------------------
  |  |  |  |  141|   545k|       ((*(p) == '+')) || ((*(p) == ',')) || ((*(p) == ';')) ||		\
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (141:8): [True: 1.09k, False: 54.9k]
  |  |  |  |  |  Branch (141:27): [True: 420, False: 54.5k]
  |  |  |  |  |  Branch (141:46): [True: 993, False: 53.5k]
  |  |  |  |  ------------------
  |  |  |  |  142|   545k|       ((*(p) == '=')) || ((*(p) == '\'')))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (142:8): [True: 572, False: 52.9k]
  |  |  |  |  |  Branch (142:27): [True: 861, False: 52.0k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  175|  26.4M|      ((*(p) == ':')) || ((*(p) == '@')))
  |  |  ------------------
  |  |  |  Branch (175:7): [True: 2.64k, False: 49.4k]
  |  |  |  Branch (175:26): [True: 2.00k, False: 47.4k]
  |  |  ------------------
  ------------------
  |  Branch (305:37): [True: 22.4k, False: 25.0k]
  |  Branch (305:54): [True: 17.4k, False: 7.54k]
  ------------------
  306|  26.4M|        NEXT(cur);
  ------------------
  |  |  108|  26.4M|#define NEXT(p) ((*p == '%')? p += 3 : p++)
  |  |  ------------------
  |  |  |  Branch (108:18): [True: 3.38k, False: 26.4M]
  |  |  ------------------
  ------------------
  307|  7.54k|    if (uri != NULL) {
  ------------------
  |  Branch (307:9): [True: 7.54k, False: 0]
  ------------------
  308|  7.54k|        if (uri->query != NULL)
  ------------------
  |  Branch (308:13): [True: 0, False: 7.54k]
  ------------------
  309|      0|            xmlFree(uri->query);
  310|  7.54k|	if (uri->cleanup & XML_URI_NO_UNESCAPE)
  ------------------
  |  |  192|  7.54k|#define XML_URI_NO_UNESCAPE     2
  ------------------
  |  Branch (310:6): [True: 0, False: 7.54k]
  ------------------
  311|      0|	    uri->query = STRNDUP(*str, cur - *str);
  ------------------
  |  |  119|      0|#define STRNDUP(s, n) (char *) xmlStrndup((const xmlChar *)(s), (n))
  ------------------
  312|  7.54k|	else
  313|  7.54k|	    uri->query = xmlURIUnescapeString(*str, cur - *str, NULL);
  314|  7.54k|        if (uri->query == NULL)
  ------------------
  |  Branch (314:13): [True: 26, False: 7.51k]
  ------------------
  315|     26|            return (-1);
  316|       |
  317|       |	/* Save the raw bytes of the query as well.
  318|       |	 * See: http://mail.gnome.org/archives/xml/2007-April/thread.html#00114
  319|       |	 */
  320|  7.51k|	if (uri->query_raw != NULL)
  ------------------
  |  Branch (320:6): [True: 0, False: 7.51k]
  ------------------
  321|      0|	    xmlFree (uri->query_raw);
  322|  7.51k|	uri->query_raw = STRNDUP (*str, cur - *str);
  ------------------
  |  |  119|  7.51k|#define STRNDUP(s, n) (char *) xmlStrndup((const xmlChar *)(s), (n))
  ------------------
  323|  7.51k|        if (uri->query_raw == NULL)
  ------------------
  |  Branch (323:13): [True: 18, False: 7.49k]
  ------------------
  324|     18|            return (-1);
  325|  7.51k|    }
  326|  7.49k|    *str = cur;
  327|  7.49k|    return (0);
  328|  7.54k|}
uri.c:xmlParse3986Fragment:
  267|   397k|{
  268|   397k|    const char *cur;
  269|       |
  270|   397k|    cur = *str;
  271|       |
  272|  9.54M|    while ((ISA_PCHAR(uri, cur)) || (*cur == '/') || (*cur == '?') ||
  ------------------
  |  |  174|  9.54M|     (ISA_UNRESERVED(u, p) || ISA_PCT_ENCODED(p) || ISA_SUB_DELIM(p) ||	\
  |  |  ------------------
  |  |  |  |  189|  19.0M|#define ISA_UNRESERVED(u, p) (xmlIsUnreserved(u, p))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (189:30): [True: 3.51M, False: 6.02M]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                    (ISA_UNRESERVED(u, p) || ISA_PCT_ENCODED(p) || ISA_SUB_DELIM(p) ||	\
  |  |  ------------------
  |  |  |  |  168|  15.5M|     ((*(p) == '%') && (ISA_HEXDIG(p + 1)) && (ISA_HEXDIG(p + 2)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  131|  11.6k|       (ISA_DIGIT(p) || ((*(p) >= 'a') && (*(p) <= 'f')) ||		\
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  127|  23.3k|#define ISA_DIGIT(p) ((*(p) >= '0') && (*(p) <= '9'))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (127:23): [True: 11.3k, False: 259]
  |  |  |  |  |  |  |  |  |  Branch (127:40): [True: 7.94k, False: 3.44k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (131:26): [True: 1.40k, False: 2.30k]
  |  |  |  |  |  |  |  Branch (131:43): [True: 1.14k, False: 261]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  132|  11.6k|        ((*(p) >= 'A') && (*(p) <= 'F')))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (132:10): [True: 2.25k, False: 304]
  |  |  |  |  |  |  |  Branch (132:27): [True: 1.95k, False: 305]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |                    ((*(p) == '%') && (ISA_HEXDIG(p + 1)) && (ISA_HEXDIG(p + 2)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  131|  11.0k|       (ISA_DIGIT(p) || ((*(p) >= 'a') && (*(p) <= 'f')) ||		\
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  127|  22.0k|#define ISA_DIGIT(p) ((*(p) >= '0') && (*(p) <= '9'))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (127:23): [True: 10.7k, False: 285]
  |  |  |  |  |  |  |  |  |  Branch (127:40): [True: 7.39k, False: 3.36k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (131:26): [True: 1.50k, False: 2.14k]
  |  |  |  |  |  |  |  Branch (131:43): [True: 1.15k, False: 347]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  132|  11.0k|        ((*(p) >= 'A') && (*(p) <= 'F')))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (132:10): [True: 2.16k, False: 329]
  |  |  |  |  |  |  |  Branch (132:27): [True: 1.65k, False: 508]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (168:7): [True: 11.6k, False: 6.01M]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                    (ISA_UNRESERVED(u, p) || ISA_PCT_ENCODED(p) || ISA_SUB_DELIM(p) ||	\
  |  |  ------------------
  |  |  |  |  139|  15.5M|      (((*(p) == '!')) || ((*(p) == '$')) || ((*(p) == '&')) ||		\
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (139:8): [True: 2.13M, False: 3.88M]
  |  |  |  |  |  Branch (139:27): [True: 13.4k, False: 3.87M]
  |  |  |  |  |  Branch (139:46): [True: 353, False: 3.87M]
  |  |  |  |  ------------------
  |  |  |  |  140|  6.01M|       ((*(p) == '(')) || ((*(p) == ')')) || ((*(p) == '*')) ||		\
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (140:8): [True: 285k, False: 3.58M]
  |  |  |  |  |  Branch (140:27): [True: 300k, False: 3.28M]
  |  |  |  |  |  Branch (140:46): [True: 1.49M, False: 1.78M]
  |  |  |  |  ------------------
  |  |  |  |  141|  6.01M|       ((*(p) == '+')) || ((*(p) == ',')) || ((*(p) == ';')) ||		\
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (141:8): [True: 1.99k, False: 1.78M]
  |  |  |  |  |  Branch (141:27): [True: 305k, False: 1.48M]
  |  |  |  |  |  Branch (141:46): [True: 283k, False: 1.19M]
  |  |  |  |  ------------------
  |  |  |  |  142|  6.01M|       ((*(p) == '=')) || ((*(p) == '\'')))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (142:8): [True: 919, False: 1.19M]
  |  |  |  |  |  Branch (142:27): [True: 1.07k, False: 1.19M]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  175|  9.54M|      ((*(p) == ':')) || ((*(p) == '@')))
  |  |  ------------------
  |  |  |  Branch (175:7): [True: 69.7k, False: 1.12M]
  |  |  |  Branch (175:26): [True: 3.49k, False: 1.12M]
  |  |  ------------------
  ------------------
  |  Branch (272:37): [True: 717k, False: 406k]
  |  Branch (272:54): [True: 3.45k, False: 403k]
  ------------------
  273|   403k|           (*cur == '[') || (*cur == ']'))
  ------------------
  |  Branch (273:12): [True: 1.68k, False: 401k]
  |  Branch (273:29): [True: 3.96k, False: 397k]
  ------------------
  274|  9.14M|        NEXT(cur);
  ------------------
  |  |  108|  9.14M|#define NEXT(p) ((*p == '%')? p += 3 : p++)
  |  |  ------------------
  |  |  |  Branch (108:18): [True: 10.2k, False: 9.13M]
  |  |  ------------------
  ------------------
  275|   397k|    if (uri != NULL) {
  ------------------
  |  Branch (275:9): [True: 397k, False: 0]
  ------------------
  276|   397k|        if (uri->fragment != NULL)
  ------------------
  |  Branch (276:13): [True: 0, False: 397k]
  ------------------
  277|      0|            xmlFree(uri->fragment);
  278|   397k|	if (uri->cleanup & XML_URI_NO_UNESCAPE)
  ------------------
  |  |  192|   397k|#define XML_URI_NO_UNESCAPE     2
  ------------------
  |  Branch (278:6): [True: 0, False: 397k]
  ------------------
  279|      0|	    uri->fragment = STRNDUP(*str, cur - *str);
  ------------------
  |  |  119|      0|#define STRNDUP(s, n) (char *) xmlStrndup((const xmlChar *)(s), (n))
  ------------------
  280|   397k|	else
  281|   397k|	    uri->fragment = xmlURIUnescapeString(*str, cur - *str, NULL);
  282|   397k|        if (uri->fragment == NULL)
  ------------------
  |  Branch (282:13): [True: 41, False: 397k]
  ------------------
  283|     41|            return (-1);
  284|   397k|    }
  285|   397k|    *str = cur;
  286|   397k|    return (0);
  287|   397k|}
uri.c:xmlParse3986RelativeRef:
  833|   525k|xmlParse3986RelativeRef(xmlURIPtr uri, const char *str) {
  834|   525k|    int ret;
  835|       |
  836|   525k|    if ((*str == '/') && (*(str + 1) == '/')) {
  ------------------
  |  Branch (836:9): [True: 10.7k, False: 514k]
  |  Branch (836:26): [True: 3.04k, False: 7.71k]
  ------------------
  837|  3.04k|        str += 2;
  838|  3.04k|	ret = xmlParse3986Authority(uri, &str);
  839|  3.04k|	if (ret != 0) return(ret);
  ------------------
  |  Branch (839:6): [True: 307, False: 2.73k]
  ------------------
  840|  2.73k|	ret = xmlParse3986PathAbEmpty(uri, &str);
  841|  2.73k|	if (ret != 0) return(ret);
  ------------------
  |  Branch (841:6): [True: 1, False: 2.73k]
  ------------------
  842|   522k|    } else if (*str == '/') {
  ------------------
  |  Branch (842:16): [True: 7.71k, False: 514k]
  ------------------
  843|  7.71k|	ret = xmlParse3986PathAbsolute(uri, &str);
  844|  7.71k|	if (ret != 0) return(ret);
  ------------------
  |  Branch (844:6): [True: 19, False: 7.69k]
  ------------------
  845|   514k|    } else if (ISA_PCHAR(uri, str)) {
  ------------------
  |  |  174|   514k|     (ISA_UNRESERVED(u, p) || ISA_PCT_ENCODED(p) || ISA_SUB_DELIM(p) ||	\
  |  |  ------------------
  |  |  |  |  189|  1.02M|#define ISA_UNRESERVED(u, p) (xmlIsUnreserved(u, p))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (189:30): [True: 103k, False: 411k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                    (ISA_UNRESERVED(u, p) || ISA_PCT_ENCODED(p) || ISA_SUB_DELIM(p) ||	\
  |  |  ------------------
  |  |  |  |  168|   926k|     ((*(p) == '%') && (ISA_HEXDIG(p + 1)) && (ISA_HEXDIG(p + 2)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  131|  5.04k|       (ISA_DIGIT(p) || ((*(p) >= 'a') && (*(p) <= 'f')) ||		\
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  127|  10.0k|#define ISA_DIGIT(p) ((*(p) >= '0') && (*(p) <= '9'))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (127:23): [True: 4.65k, False: 387]
  |  |  |  |  |  |  |  |  |  Branch (127:40): [True: 1.95k, False: 2.70k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (131:26): [True: 1.63k, False: 1.45k]
  |  |  |  |  |  |  |  Branch (131:43): [True: 1.39k, False: 242]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  132|  5.04k|        ((*(p) >= 'A') && (*(p) <= 'F')))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (132:10): [True: 1.29k, False: 401]
  |  |  |  |  |  |  |  Branch (132:27): [True: 926, False: 371]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |                    ((*(p) == '%') && (ISA_HEXDIG(p + 1)) && (ISA_HEXDIG(p + 2)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  131|  4.26k|       (ISA_DIGIT(p) || ((*(p) >= 'a') && (*(p) <= 'f')) ||		\
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  127|  8.53k|#define ISA_DIGIT(p) ((*(p) >= '0') && (*(p) <= '9'))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (127:23): [True: 4.03k, False: 234]
  |  |  |  |  |  |  |  |  |  Branch (127:40): [True: 1.44k, False: 2.58k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (131:26): [True: 1.46k, False: 1.35k]
  |  |  |  |  |  |  |  Branch (131:43): [True: 1.26k, False: 205]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  132|  4.26k|        ((*(p) >= 'A') && (*(p) <= 'F')))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (132:10): [True: 1.09k, False: 463]
  |  |  |  |  |  |  |  Branch (132:27): [True: 762, False: 337]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (168:7): [True: 5.04k, False: 406k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                    (ISA_UNRESERVED(u, p) || ISA_PCT_ENCODED(p) || ISA_SUB_DELIM(p) ||	\
  |  |  ------------------
  |  |  |  |  139|   923k|      (((*(p) == '!')) || ((*(p) == '$')) || ((*(p) == '&')) ||		\
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (139:8): [True: 1.43k, False: 406k]
  |  |  |  |  |  Branch (139:27): [True: 1.60k, False: 405k]
  |  |  |  |  |  Branch (139:46): [True: 313, False: 404k]
  |  |  |  |  ------------------
  |  |  |  |  140|   408k|       ((*(p) == '(')) || ((*(p) == ')')) || ((*(p) == '*')) ||		\
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (140:8): [True: 1.27k, False: 403k]
  |  |  |  |  |  Branch (140:27): [True: 586, False: 402k]
  |  |  |  |  |  Branch (140:46): [True: 1.01k, False: 401k]
  |  |  |  |  ------------------
  |  |  |  |  141|   408k|       ((*(p) == '+')) || ((*(p) == ',')) || ((*(p) == ';')) ||		\
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (141:8): [True: 851, False: 401k]
  |  |  |  |  |  Branch (141:27): [True: 821, False: 400k]
  |  |  |  |  |  Branch (141:46): [True: 832, False: 399k]
  |  |  |  |  ------------------
  |  |  |  |  142|   408k|       ((*(p) == '=')) || ((*(p) == '\'')))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (142:8): [True: 843, False: 398k]
  |  |  |  |  |  Branch (142:27): [True: 1.14k, False: 397k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  175|   514k|      ((*(p) == ':')) || ((*(p) == '@')))
  |  |  ------------------
  |  |  |  Branch (175:7): [True: 951, False: 396k]
  |  |  |  Branch (175:26): [True: 602, False: 395k]
  |  |  ------------------
  ------------------
  846|   119k|        ret = xmlParse3986PathNoScheme(uri, &str);
  847|   119k|	if (ret != 0) return(ret);
  ------------------
  |  Branch (847:6): [True: 1.06k, False: 118k]
  ------------------
  848|   395k|    } else {
  849|       |	/* path-empty is effectively empty */
  850|   395k|	if (uri != NULL) {
  ------------------
  |  Branch (850:6): [True: 395k, False: 0]
  ------------------
  851|   395k|	    if (uri->path != NULL) xmlFree(uri->path);
  ------------------
  |  Branch (851:10): [True: 0, False: 395k]
  ------------------
  852|   395k|	    uri->path = NULL;
  853|   395k|	}
  854|   395k|    }
  855|       |
  856|   524k|    if (*str == '?') {
  ------------------
  |  Branch (856:9): [True: 4.87k, False: 519k]
  ------------------
  857|  4.87k|	str++;
  858|  4.87k|	ret = xmlParse3986Query(uri, &str);
  859|  4.87k|	if (ret != 0) return(ret);
  ------------------
  |  Branch (859:6): [True: 33, False: 4.83k]
  ------------------
  860|  4.87k|    }
  861|   524k|    if (*str == '#') {
  ------------------
  |  Branch (861:9): [True: 395k, False: 128k]
  ------------------
  862|   395k|	str++;
  863|   395k|	ret = xmlParse3986Fragment(uri, &str);
  864|   395k|	if (ret != 0) return(ret);
  ------------------
  |  Branch (864:6): [True: 40, False: 395k]
  ------------------
  865|   395k|    }
  866|   524k|    if (*str != 0) {
  ------------------
  |  Branch (866:9): [True: 27.1k, False: 497k]
  ------------------
  867|  27.1k|	xmlCleanURI(uri);
  868|  27.1k|	return(1);
  869|  27.1k|    }
  870|   497k|    return(0);
  871|   524k|}
uri.c:xmlParse3986PathNoScheme:
  737|   119k|{
  738|   119k|    const char *cur;
  739|   119k|    int ret;
  740|       |
  741|   119k|    cur = *str;
  742|       |
  743|   119k|    ret = xmlParse3986Segment(uri, &cur, ':', 0);
  744|   119k|    if (ret != 0) return(ret);
  ------------------
  |  Branch (744:9): [True: 951, False: 118k]
  ------------------
  745|   160k|    while (*cur == '/') {
  ------------------
  |  Branch (745:12): [True: 42.1k, False: 118k]
  ------------------
  746|  42.1k|        cur++;
  747|  42.1k|	ret = xmlParse3986Segment(uri, &cur, 0, 1);
  748|  42.1k|	if (ret != 0) return(ret);
  ------------------
  |  Branch (748:6): [True: 0, False: 42.1k]
  ------------------
  749|  42.1k|    }
  750|   118k|    if (uri != NULL) {
  ------------------
  |  Branch (750:9): [True: 118k, False: 0]
  ------------------
  751|   118k|	if (uri->path != NULL) xmlFree(uri->path);
  ------------------
  |  Branch (751:6): [True: 0, False: 118k]
  ------------------
  752|   118k|        if (cur != *str) {
  ------------------
  |  Branch (752:13): [True: 118k, False: 0]
  ------------------
  753|   118k|            if (uri->cleanup & XML_URI_NO_UNESCAPE)
  ------------------
  |  |  192|   118k|#define XML_URI_NO_UNESCAPE     2
  ------------------
  |  Branch (753:17): [True: 0, False: 118k]
  ------------------
  754|      0|                uri->path = STRNDUP(*str, cur - *str);
  ------------------
  |  |  119|      0|#define STRNDUP(s, n) (char *) xmlStrndup((const xmlChar *)(s), (n))
  ------------------
  755|   118k|            else
  756|   118k|                uri->path = xmlURIUnescapeString(*str, cur - *str, NULL);
  757|   118k|            if (uri->path == NULL)
  ------------------
  |  Branch (757:17): [True: 113, False: 118k]
  ------------------
  758|    113|                return (-1);
  759|   118k|        } else {
  760|      0|            uri->path = NULL;
  761|      0|        }
  762|   118k|    }
  763|   118k|    *str = cur;
  764|   118k|    return (0);
  765|   118k|}
uri.c:xmlSaveUriRealloc:
 1074|  7.73k|xmlSaveUriRealloc(xmlChar *ret, int *max) {
 1075|  7.73k|    xmlChar *temp;
 1076|  7.73k|    int newSize;
 1077|       |
 1078|  7.73k|    newSize = xmlGrowCapacity(*max, 1, 80, MAX_URI_LENGTH);
  ------------------
  |  |   34|  7.73k|#define MAX_URI_LENGTH 1024 * 1024
  ------------------
 1079|  7.73k|    if (newSize < 0)
  ------------------
  |  Branch (1079:9): [True: 26, False: 7.70k]
  ------------------
 1080|     26|        return(NULL);
 1081|  7.70k|    temp = xmlRealloc(ret, newSize + 1);
 1082|  7.70k|    if (temp == NULL)
  ------------------
  |  Branch (1082:9): [True: 30, False: 7.67k]
  ------------------
 1083|     30|        return(NULL);
 1084|  7.67k|    *max = newSize;
 1085|  7.67k|    return(temp);
 1086|  7.70k|}
uri.c:xmlNormalizePath:
 1456|  23.5k|xmlNormalizePath(char *path, int isFile) {
 1457|  23.5k|    char *cur, *out;
 1458|  23.5k|    int numSeg = 0;
 1459|       |
 1460|  23.5k|    if (path == NULL)
  ------------------
  |  Branch (1460:9): [True: 1.18k, False: 22.3k]
  ------------------
 1461|  1.18k|	return(-1);
 1462|       |
 1463|  22.3k|    cur = path;
 1464|  22.3k|    out = path;
 1465|       |
 1466|  22.3k|    if (*cur == 0)
  ------------------
  |  Branch (1466:9): [True: 201, False: 22.1k]
  ------------------
 1467|    201|        return(0);
 1468|       |
 1469|  22.1k|    if (xmlIsPathSeparator(*cur, isFile)) {
  ------------------
  |  Branch (1469:9): [True: 7.18k, False: 14.9k]
  ------------------
 1470|  7.18k|        cur++;
 1471|  7.18k|        *out++ = '/';
 1472|  7.18k|    }
 1473|       |
 1474|   143k|    while (*cur != 0) {
  ------------------
  |  Branch (1474:12): [True: 122k, False: 20.7k]
  ------------------
 1475|       |        /*
 1476|       |         * At this point, out is either empty or ends with a separator.
 1477|       |         * Collapse multiple separators first.
 1478|       |         */
 1479|   155k|        while (xmlIsPathSeparator(*cur, isFile)) {
  ------------------
  |  Branch (1479:16): [True: 32.3k, False: 122k]
  ------------------
 1480|       |#if defined(LIBXML_WINPATH_ENABLED)
 1481|       |            /* Allow two separators at start of path */
 1482|       |            if ((isFile) && (out == path + 1))
 1483|       |                *out++ = '/';
 1484|       |#endif
 1485|  32.3k|            cur++;
 1486|  32.3k|        }
 1487|       |
 1488|   122k|        if (*cur == '.') {
  ------------------
  |  Branch (1488:13): [True: 44.6k, False: 78.2k]
  ------------------
 1489|  44.6k|            if (cur[1] == 0) {
  ------------------
  |  Branch (1489:17): [True: 920, False: 43.6k]
  ------------------
 1490|       |                /* Ignore "." at end of path */
 1491|    920|                break;
 1492|  43.6k|            } else if (xmlIsPathSeparator(cur[1], isFile)) {
  ------------------
  |  Branch (1492:24): [True: 6.35k, False: 37.3k]
  ------------------
 1493|       |                /* Skip "./" */
 1494|  6.35k|                cur += 2;
 1495|  6.35k|                continue;
 1496|  37.3k|            } else if ((cur[1] == '.') &&
  ------------------
  |  Branch (1496:24): [True: 34.8k, False: 2.46k]
  ------------------
 1497|  34.8k|                       ((cur[2] == 0) || xmlIsPathSeparator(cur[2], isFile))) {
  ------------------
  |  Branch (1497:25): [True: 465, False: 34.4k]
  |  Branch (1497:42): [True: 33.8k, False: 519]
  ------------------
 1498|  34.3k|                if (numSeg > 0) {
  ------------------
  |  Branch (1498:21): [True: 4.05k, False: 30.3k]
  ------------------
 1499|       |                    /* Handle ".." by removing last segment */
 1500|  22.6k|                    do {
 1501|  22.6k|                        out--;
 1502|  22.6k|                    } while ((out > path) &&
  ------------------
  |  Branch (1502:30): [True: 22.2k, False: 445]
  ------------------
 1503|  22.2k|                             !xmlIsPathSeparator(out[-1], isFile));
  ------------------
  |  Branch (1503:30): [True: 18.6k, False: 3.61k]
  ------------------
 1504|  4.05k|                    numSeg--;
 1505|       |
 1506|  4.05k|                    if (cur[2] == 0)
  ------------------
  |  Branch (1506:25): [True: 241, False: 3.81k]
  ------------------
 1507|    241|                        break;
 1508|  3.81k|                    cur += 3;
 1509|  3.81k|                    continue;
 1510|  30.3k|                } else if (out[0] == '/') {
  ------------------
  |  Branch (1510:28): [True: 574, False: 29.7k]
  ------------------
 1511|       |                    /* Ignore extraneous ".." in absolute paths */
 1512|    574|                    if (cur[2] == 0)
  ------------------
  |  Branch (1512:25): [True: 204, False: 370]
  ------------------
 1513|    204|                        break;
 1514|    370|                    cur += 3;
 1515|    370|                    continue;
 1516|  29.7k|                } else {
 1517|       |                    /* Keep "../" at start of relative path */
 1518|  29.7k|                    numSeg--;
 1519|  29.7k|                }
 1520|  34.3k|            }
 1521|  44.6k|        }
 1522|       |
 1523|       |        /* Copy segment */
 1524|  1.58M|        while ((*cur != 0) && !xmlIsPathSeparator(*cur, isFile)) {
  ------------------
  |  Branch (1524:16): [True: 1.56M, False: 19.6k]
  |  Branch (1524:31): [True: 1.47M, False: 91.2k]
  ------------------
 1525|  1.47M|            *out++ = *cur++;
 1526|  1.47M|        }
 1527|       |
 1528|       |        /* Copy separator */
 1529|   110k|        if (*cur != 0) {
  ------------------
  |  Branch (1529:13): [True: 91.2k, False: 19.6k]
  ------------------
 1530|  91.2k|            cur++;
 1531|  91.2k|            *out++ = '/';
 1532|  91.2k|        }
 1533|       |
 1534|   110k|        numSeg++;
 1535|   110k|    }
 1536|       |
 1537|       |    /* Keep "." if output is empty and it's a file */
 1538|  22.1k|    if ((isFile) && (out <= path))
  ------------------
  |  Branch (1538:9): [True: 14.3k, False: 7.85k]
  |  Branch (1538:21): [True: 779, False: 13.5k]
  ------------------
 1539|    779|        *out++ = '.';
 1540|  22.1k|    *out = 0;
 1541|       |
 1542|  22.1k|    return(0);
 1543|  22.3k|}
uri.c:xmlIsPathSeparator:
 1434|  2.70M|xmlIsPathSeparator(int c, int isFile) {
 1435|  2.70M|    (void) isFile;
 1436|       |
 1437|  2.70M|    if (c == '/')
  ------------------
  |  Branch (1437:9): [True: 185k, False: 2.52M]
  ------------------
 1438|   185k|        return(1);
 1439|       |
 1440|       |#if defined(LIBXML_WINPATH_ENABLED)
 1441|       |    if (isFile && (c == '\\'))
 1442|       |        return(1);
 1443|       |#endif
 1444|       |
 1445|  2.52M|    return(0);
 1446|  2.70M|}
uri.c:is_hex:
 1559|   435k|static int is_hex(char c) {
 1560|   435k|    if (((c >= '0') && (c <= '9')) ||
  ------------------
  |  Branch (1560:10): [True: 434k, False: 1.55k]
  |  Branch (1560:24): [True: 402k, False: 31.8k]
  ------------------
 1561|  33.4k|        ((c >= 'a') && (c <= 'f')) ||
  ------------------
  |  Branch (1561:10): [True: 15.1k, False: 18.2k]
  |  Branch (1561:24): [True: 14.4k, False: 657]
  ------------------
 1562|  18.9k|        ((c >= 'A') && (c <= 'F')))
  ------------------
  |  Branch (1562:10): [True: 17.2k, False: 1.71k]
  |  Branch (1562:24): [True: 16.2k, False: 1.00k]
  ------------------
 1563|   433k|	return(1);
 1564|  2.71k|    return(0);
 1565|   435k|}
uri.c:xmlResolvePath:
 1863|   401k|xmlResolvePath(const xmlChar *escRef, const xmlChar *base, xmlChar **out) {
 1864|   401k|    const xmlChar *fragment;
 1865|   401k|    xmlChar *tmp = NULL;
 1866|   401k|    xmlChar *ref = NULL;
 1867|   401k|    xmlChar *result = NULL;
 1868|   401k|    int ret = -1;
 1869|   401k|    int i;
 1870|       |
 1871|   401k|    if (out == NULL)
  ------------------
  |  Branch (1871:9): [True: 0, False: 401k]
  ------------------
 1872|      0|        return(1);
 1873|   401k|    *out = NULL;
 1874|       |
 1875|   401k|    if ((escRef == NULL) || (escRef[0] == 0)) {
  ------------------
  |  Branch (1875:9): [True: 0, False: 401k]
  |  Branch (1875:29): [True: 4.06k, False: 397k]
  ------------------
 1876|  4.06k|        if ((base == NULL) || (base[0] == 0))
  ------------------
  |  Branch (1876:13): [True: 0, False: 4.06k]
  |  Branch (1876:31): [True: 3.60k, False: 467]
  ------------------
 1877|  3.60k|            return(1);
 1878|    467|        ref = xmlStrdup(base);
 1879|    467|        if (ref == NULL)
  ------------------
  |  Branch (1879:13): [True: 2, False: 465]
  ------------------
 1880|      2|            goto err_memory;
 1881|    465|        *out = ref;
 1882|    465|        return(0);
 1883|    467|    }
 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|   397k|    fragment = xmlStrchr(escRef, '#');
 1891|   397k|    if (fragment != NULL) {
  ------------------
  |  Branch (1891:9): [True: 385k, False: 11.5k]
  ------------------
 1892|   385k|        tmp = xmlStrndup(escRef, fragment - escRef);
 1893|   385k|        if (tmp == NULL)
  ------------------
  |  Branch (1893:13): [True: 11, False: 385k]
  ------------------
 1894|     11|            goto err_memory;
 1895|   385k|        escRef = tmp;
 1896|   385k|    }
 1897|       |
 1898|   396k|    ref = (xmlChar *) xmlURIUnescapeString((char *) escRef, -1, NULL);
 1899|   396k|    if (ref == NULL)
  ------------------
  |  Branch (1899:9): [True: 49, False: 396k]
  ------------------
 1900|     49|        goto err_memory;
 1901|       |
 1902|   396k|    if ((base == NULL) || (base[0] == 0))
  ------------------
  |  Branch (1902:9): [True: 0, False: 396k]
  |  Branch (1902:27): [True: 385k, False: 10.9k]
  ------------------
 1903|   385k|        goto done;
 1904|       |
 1905|  10.9k|    if (xmlIsAbsolutePath(ref))
  ------------------
  |  Branch (1905:9): [True: 1.73k, False: 9.25k]
  ------------------
 1906|  1.73k|        goto done;
 1907|       |
 1908|       |    /*
 1909|       |     * Remove last segment from base
 1910|       |     */
 1911|  9.25k|    i = xmlStrlen(base);
 1912|   852k|    while ((i > 0) && !xmlIsPathSeparator(base[i-1], 1))
  ------------------
  |  Branch (1912:12): [True: 851k, False: 1.14k]
  |  Branch (1912:23): [True: 843k, False: 8.10k]
  ------------------
 1913|   843k|        i--;
 1914|       |
 1915|       |    /*
 1916|       |     * Concatenate base and ref
 1917|       |     */
 1918|  9.25k|    if (i > 0) {
  ------------------
  |  Branch (1918:9): [True: 8.10k, False: 1.14k]
  ------------------
 1919|  8.10k|        int refLen = xmlStrlen(ref);
 1920|       |
 1921|  8.10k|        result = xmlMalloc(i + refLen + 1);
 1922|  8.10k|        if (result == NULL)
  ------------------
  |  Branch (1922:13): [True: 23, False: 8.08k]
  ------------------
 1923|     23|            goto err_memory;
 1924|       |
 1925|  8.08k|        memcpy(result, base, i);
 1926|  8.08k|        memcpy(result + i, ref, refLen + 1);
 1927|  8.08k|    }
 1928|       |
 1929|       |    /*
 1930|       |     * Normalize
 1931|       |     */
 1932|  9.22k|    xmlNormalizePath((char *) result, 1);
 1933|       |
 1934|   396k|done:
 1935|   396k|    if (result == NULL) {
  ------------------
  |  Branch (1935:9): [True: 388k, False: 8.08k]
  ------------------
 1936|   388k|        result = ref;
 1937|   388k|        ref = NULL;
 1938|   388k|    }
 1939|       |
 1940|   396k|    if (fragment != NULL) {
  ------------------
  |  Branch (1940:9): [True: 385k, False: 11.5k]
  ------------------
 1941|   385k|        result = xmlStrcat(result, fragment);
 1942|   385k|        if (result == NULL)
  ------------------
  |  Branch (1942:13): [True: 12, False: 385k]
  ------------------
 1943|     12|            goto err_memory;
 1944|   385k|    }
 1945|       |
 1946|   396k|    *out = result;
 1947|   396k|    ret = 0;
 1948|       |
 1949|   397k|err_memory:
 1950|   397k|    xmlFree(tmp);
 1951|   397k|    xmlFree(ref);
 1952|   397k|    return(ret);
 1953|   396k|}
uri.c:xmlIsAbsolutePath:
 1837|  17.2k|xmlIsAbsolutePath(const xmlChar *path) {
 1838|  17.2k|    int c = path[0];
 1839|       |
 1840|  17.2k|    if (xmlIsPathSeparator(c, 1))
  ------------------
  |  Branch (1840:9): [True: 2.51k, False: 14.6k]
  ------------------
 1841|  2.51k|        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|  14.6k|    return(0);
 1851|  17.2k|}
uri.c:xmlParseUriOrPath:
 2344|  7.23k|xmlParseUriOrPath(const char *str, xmlURIPtr *out, int *drive) {
 2345|  7.23k|    xmlURIPtr uri;
 2346|  7.23k|    char *buf = NULL;
 2347|  7.23k|    int ret;
 2348|       |
 2349|  7.23k|    *out = NULL;
 2350|  7.23k|    *drive = 0;
 2351|       |
 2352|  7.23k|    uri = xmlCreateURI();
 2353|  7.23k|    if (uri == NULL) {
  ------------------
  |  Branch (2353:9): [True: 21, False: 7.21k]
  ------------------
 2354|     21|        ret = -1;
 2355|     21|	goto done;
 2356|     21|    }
 2357|       |
 2358|  7.21k|    if (xmlStrstr(BAD_CAST str, BAD_CAST "://") == NULL) {
  ------------------
  |  |   34|  7.21k|#define BAD_CAST (xmlChar *)
  ------------------
                  if (xmlStrstr(BAD_CAST str, BAD_CAST "://") == NULL) {
  ------------------
  |  |   34|  7.21k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (2358:9): [True: 6.23k, False: 986]
  ------------------
 2359|  6.23k|        const char *path;
 2360|  6.23k|        size_t pathSize;
 2361|  6.23k|        int prependSlash = 0;
 2362|       |
 2363|  6.23k|        buf = xmlMemStrdup(str);
 2364|  6.23k|        if (buf == NULL) {
  ------------------
  |  Branch (2364:13): [True: 9, False: 6.22k]
  ------------------
 2365|      9|            ret = -1;
 2366|      9|            goto done;
 2367|      9|        }
 2368|  6.22k|        xmlNormalizePath(buf, /* isFile */ 1);
 2369|       |
 2370|  6.22k|        path = buf;
 2371|       |
 2372|  6.22k|        if (xmlIsAbsolutePath(BAD_CAST buf)) {
  ------------------
  |  |   34|  6.22k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (2372:13): [True: 778, False: 5.44k]
  ------------------
 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|    778|        }
 2426|       |
 2427|  6.22k|        pathSize = strlen(path);
 2428|  6.22k|        uri->path = xmlMalloc(pathSize + prependSlash + 1);
 2429|  6.22k|        if (uri->path == NULL) {
  ------------------
  |  Branch (2429:13): [True: 11, False: 6.21k]
  ------------------
 2430|     11|            ret = -1;
 2431|     11|            goto done;
 2432|     11|        }
 2433|  6.21k|        if (prependSlash) {
  ------------------
  |  Branch (2433:13): [True: 0, False: 6.21k]
  ------------------
 2434|      0|            uri->path[0] = '/';
 2435|      0|            memcpy(uri->path + 1, path, pathSize + 1);
 2436|  6.21k|        } else {
 2437|  6.21k|            memcpy(uri->path, path, pathSize + 1);
 2438|  6.21k|        }
 2439|  6.21k|    } else {
 2440|    986|	ret = xmlParseURIReference(uri, str);
 2441|    986|	if (ret != 0)
  ------------------
  |  Branch (2441:6): [True: 831, False: 155]
  ------------------
 2442|    831|	    goto done;
 2443|       |
 2444|    155|        xmlNormalizePath(uri->path, /* isFile */ 0);
 2445|    155|    }
 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|  6.36k|    *out = uri;
 2456|  6.36k|    uri = NULL;
 2457|  6.36k|    ret = 0;
 2458|       |
 2459|  7.23k|done:
 2460|  7.23k|    xmlFreeURI(uri);
 2461|  7.23k|    xmlFree(buf);
 2462|       |
 2463|  7.23k|    return(ret);
 2464|  6.36k|}

xmlValidBuildContentModel:
  597|  1.94k|xmlValidBuildContentModel(xmlValidCtxt *ctxt, xmlElement *elem) {
  598|  1.94k|    int ret = 0;
  599|       |
  600|  1.94k|    if ((ctxt == NULL) || (elem == NULL))
  ------------------
  |  Branch (600:9): [True: 0, False: 1.94k]
  |  Branch (600:27): [True: 0, False: 1.94k]
  ------------------
  601|      0|	return(0);
  602|  1.94k|    if (elem->type != XML_ELEMENT_DECL)
  ------------------
  |  Branch (602:9): [True: 0, False: 1.94k]
  ------------------
  603|      0|	return(0);
  604|  1.94k|    if (elem->etype != XML_ELEMENT_TYPE_ELEMENT)
  ------------------
  |  Branch (604:9): [True: 0, False: 1.94k]
  ------------------
  605|      0|	return(1);
  606|       |    /* TODO: should we rebuild in this case ? */
  607|  1.94k|    if (elem->contModel != NULL) {
  ------------------
  |  Branch (607:9): [True: 0, False: 1.94k]
  ------------------
  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.94k|    ctxt->am = xmlNewAutomata();
  616|  1.94k|    if (ctxt->am == NULL) {
  ------------------
  |  Branch (616:9): [True: 23, False: 1.92k]
  ------------------
  617|     23|        xmlVErrMemory(ctxt);
  618|     23|	return(0);
  619|     23|    }
  620|  1.92k|    ctxt->state = xmlAutomataGetInitState(ctxt->am);
  621|  1.92k|    if (xmlValidBuildAContentModel(elem->content, ctxt, elem->name) == 0)
  ------------------
  |  Branch (621:9): [True: 14, False: 1.90k]
  ------------------
  622|     14|        goto done;
  623|  1.90k|    xmlAutomataSetFinalState(ctxt->am, ctxt->state);
  624|  1.90k|    elem->contModel = xmlAutomataCompile(ctxt->am);
  625|  1.90k|    if (elem->contModel == NULL) {
  ------------------
  |  Branch (625:9): [True: 591, False: 1.31k]
  ------------------
  626|    591|        xmlVErrMemory(ctxt);
  627|    591|        goto done;
  628|    591|    }
  629|  1.31k|    if (xmlRegexpIsDeterminist(elem->contModel) != 1) {
  ------------------
  |  Branch (629:9): [True: 410, False: 907]
  ------------------
  630|    410|	char expr[5000];
  631|    410|	expr[0] = 0;
  632|    410|	xmlSnprintfElementContent(expr, 5000, elem->content, 1);
  633|    410|	xmlErrValidNode(ctxt, (xmlNodePtr) elem,
  634|    410|	                XML_DTD_CONTENT_NOT_DETERMINIST,
  635|    410|	       "Content model of %s is not deterministic: %s\n",
  636|    410|	       elem->name, BAD_CAST expr, NULL);
  ------------------
  |  |   34|    410|#define BAD_CAST (xmlChar *)
  ------------------
  637|    410|        ctxt->valid = 0;
  638|    410|	goto done;
  639|    410|    }
  640|       |
  641|    907|    ret = 1;
  642|       |
  643|  1.92k|done:
  644|  1.92k|    ctxt->state = NULL;
  645|  1.92k|    xmlFreeAutomata(ctxt->am);
  646|       |    ctxt->am = NULL;
  647|  1.92k|    return(ret);
  648|    907|}
xmlNewDocElementContent:
  708|   328k|                        xmlElementContentType type) {
  709|   328k|    xmlElementContentPtr ret;
  710|   328k|    xmlDictPtr dict = NULL;
  711|       |
  712|   328k|    if (doc != NULL)
  ------------------
  |  Branch (712:9): [True: 327k, False: 523]
  ------------------
  713|   327k|        dict = doc->dict;
  714|       |
  715|   328k|    ret = (xmlElementContentPtr) xmlMalloc(sizeof(xmlElementContent));
  716|   328k|    if (ret == NULL)
  ------------------
  |  Branch (716:9): [True: 14, False: 328k]
  ------------------
  717|     14|	return(NULL);
  718|   328k|    memset(ret, 0, sizeof(xmlElementContent));
  719|   328k|    ret->type = type;
  720|   328k|    ret->ocur = XML_ELEMENT_CONTENT_ONCE;
  721|   328k|    if (name != NULL) {
  ------------------
  |  Branch (721:9): [True: 165k, False: 163k]
  ------------------
  722|   165k|        int l;
  723|   165k|	const xmlChar *tmp;
  724|       |
  725|   165k|	tmp = xmlSplitQName3(name, &l);
  726|   165k|	if (tmp == NULL) {
  ------------------
  |  Branch (726:6): [True: 156k, False: 8.39k]
  ------------------
  727|   156k|	    if (dict == NULL)
  ------------------
  |  Branch (727:10): [True: 33.8k, False: 122k]
  ------------------
  728|  33.8k|		ret->name = xmlStrdup(name);
  729|   122k|	    else
  730|   122k|	        ret->name = xmlDictLookup(dict, name, -1);
  731|   156k|	} else {
  732|  8.39k|	    if (dict == NULL) {
  ------------------
  |  Branch (732:10): [True: 2.00k, False: 6.39k]
  ------------------
  733|  2.00k|		ret->prefix = xmlStrndup(name, l);
  734|  2.00k|		ret->name = xmlStrdup(tmp);
  735|  6.39k|	    } else {
  736|  6.39k|	        ret->prefix = xmlDictLookup(dict, name, l);
  737|  6.39k|		ret->name = xmlDictLookup(dict, tmp, -1);
  738|  6.39k|	    }
  739|  8.39k|            if (ret->prefix == NULL)
  ------------------
  |  Branch (739:17): [True: 2, False: 8.39k]
  ------------------
  740|      2|                goto error;
  741|  8.39k|	}
  742|   165k|        if (ret->name == NULL)
  ------------------
  |  Branch (742:13): [True: 2, False: 165k]
  ------------------
  743|      2|            goto error;
  744|   165k|    }
  745|   328k|    return(ret);
  746|       |
  747|      4|error:
  748|      4|    xmlFreeDocElementContent(doc, ret);
  749|       |    return(NULL);
  750|   328k|}
xmlFreeDocElementContent:
  885|  25.1k|xmlFreeDocElementContent(xmlDoc *doc, xmlElementContent *cur) {
  886|  25.1k|    xmlDictPtr dict = NULL;
  887|  25.1k|    size_t depth = 0;
  888|       |
  889|  25.1k|    if (cur == NULL)
  ------------------
  |  Branch (889:9): [True: 8.50k, False: 16.6k]
  ------------------
  890|  8.50k|        return;
  891|  16.6k|    if (doc != NULL)
  ------------------
  |  Branch (891:9): [True: 16.5k, False: 57]
  ------------------
  892|  16.5k|        dict = doc->dict;
  893|       |
  894|   328k|    while (1) {
  ------------------
  |  Branch (894:12): [True: 328k, Folded]
  ------------------
  895|   328k|        xmlElementContentPtr parent;
  896|       |
  897|   484k|        while ((cur->c1 != NULL) || (cur->c2 != NULL)) {
  ------------------
  |  Branch (897:16): [True: 156k, False: 328k]
  |  Branch (897:37): [True: 0, False: 328k]
  ------------------
  898|   156k|            cur = (cur->c1 != NULL) ? cur->c1 : cur->c2;
  ------------------
  |  Branch (898:19): [True: 156k, False: 0]
  ------------------
  899|   156k|            depth += 1;
  900|   156k|        }
  901|       |
  902|   328k|	if (dict) {
  ------------------
  |  Branch (902:6): [True: 256k, False: 71.2k]
  ------------------
  903|   256k|	    if ((cur->name != NULL) && (!xmlDictOwns(dict, cur->name)))
  ------------------
  |  Branch (903:10): [True: 129k, False: 127k]
  |  Branch (903:33): [True: 0, False: 129k]
  ------------------
  904|      0|	        xmlFree((xmlChar *) cur->name);
  905|   256k|	    if ((cur->prefix != NULL) && (!xmlDictOwns(dict, cur->prefix)))
  ------------------
  |  Branch (905:10): [True: 6.39k, False: 250k]
  |  Branch (905:35): [True: 0, False: 6.39k]
  ------------------
  906|      0|	        xmlFree((xmlChar *) cur->prefix);
  907|   256k|	} else {
  908|  71.2k|	    if (cur->name != NULL) xmlFree((xmlChar *) cur->name);
  ------------------
  |  Branch (908:10): [True: 35.7k, False: 35.4k]
  ------------------
  909|  71.2k|	    if (cur->prefix != NULL) xmlFree((xmlChar *) cur->prefix);
  ------------------
  |  Branch (909:10): [True: 1.99k, False: 69.2k]
  ------------------
  910|  71.2k|	}
  911|   328k|        parent = cur->parent;
  912|   328k|        if ((depth == 0) || (parent == NULL)) {
  ------------------
  |  Branch (912:13): [True: 16.6k, False: 311k]
  |  Branch (912:29): [True: 0, False: 311k]
  ------------------
  913|  16.6k|            xmlFree(cur);
  914|  16.6k|            break;
  915|  16.6k|        }
  916|   311k|        if (cur == parent->c1)
  ------------------
  |  Branch (916:13): [True: 156k, False: 154k]
  ------------------
  917|   156k|            parent->c1 = NULL;
  918|   154k|        else
  919|   154k|            parent->c2 = NULL;
  920|   311k|	xmlFree(cur);
  921|       |
  922|   311k|        if (parent->c2 != NULL) {
  ------------------
  |  Branch (922:13): [True: 154k, False: 156k]
  ------------------
  923|   154k|	    cur = parent->c2;
  924|   156k|        } else {
  925|   156k|            depth -= 1;
  926|   156k|            cur = parent;
  927|   156k|        }
  928|   311k|    }
  929|  16.6k|}
xmlSnprintfElementContent:
  973|  92.5k|xmlSnprintfElementContent(char *buf, int size, xmlElementContent *content, int englob) {
  974|  92.5k|    int len;
  975|       |
  976|  92.5k|    if (content == NULL) return;
  ------------------
  |  Branch (976:9): [True: 0, False: 92.5k]
  ------------------
  977|  92.5k|    len = strlen(buf);
  978|  92.5k|    if (size - len < 50) {
  ------------------
  |  Branch (978:9): [True: 102, False: 92.4k]
  ------------------
  979|    102|	if ((size - len > 4) && (buf[len - 1] != '.'))
  ------------------
  |  Branch (979:6): [True: 102, False: 0]
  |  Branch (979:26): [True: 102, False: 0]
  ------------------
  980|    102|	    strcat(buf, " ...");
  981|    102|	return;
  982|    102|    }
  983|  92.4k|    if (englob) strcat(buf, "(");
  ------------------
  |  Branch (983:9): [True: 12.1k, False: 80.2k]
  ------------------
  984|  92.4k|    switch (content->type) {
  ------------------
  |  Branch (984:13): [True: 92.4k, False: 0]
  ------------------
  985|      0|        case XML_ELEMENT_CONTENT_PCDATA:
  ------------------
  |  Branch (985:9): [True: 0, False: 92.4k]
  ------------------
  986|      0|            strcat(buf, "#PCDATA");
  987|      0|	    break;
  988|  47.9k|	case XML_ELEMENT_CONTENT_ELEMENT: {
  ------------------
  |  Branch (988:2): [True: 47.9k, False: 44.4k]
  ------------------
  989|  47.9k|            int qnameLen = xmlStrlen(content->name);
  990|       |
  991|  47.9k|	    if (content->prefix != NULL)
  ------------------
  |  Branch (991:10): [True: 3.08k, False: 44.9k]
  ------------------
  992|  3.08k|                qnameLen += xmlStrlen(content->prefix) + 1;
  993|  47.9k|	    if (size - len < qnameLen + 10) {
  ------------------
  |  Branch (993:10): [True: 330, False: 47.6k]
  ------------------
  994|    330|		strcat(buf, " ...");
  995|    330|		return;
  996|    330|	    }
  997|  47.6k|	    if (content->prefix != NULL) {
  ------------------
  |  Branch (997:10): [True: 2.91k, False: 44.7k]
  ------------------
  998|  2.91k|		strcat(buf, (char *) content->prefix);
  999|  2.91k|		strcat(buf, ":");
 1000|  2.91k|	    }
 1001|  47.6k|	    if (content->name != NULL)
  ------------------
  |  Branch (1001:10): [True: 47.6k, False: 0]
  ------------------
 1002|  47.6k|		strcat(buf, (char *) content->name);
 1003|  47.6k|	    break;
 1004|  47.9k|        }
 1005|  21.8k|	case XML_ELEMENT_CONTENT_SEQ:
  ------------------
  |  Branch (1005:2): [True: 21.8k, False: 70.5k]
  ------------------
 1006|  21.8k|	    if ((content->c1->type == XML_ELEMENT_CONTENT_OR) ||
  ------------------
  |  Branch (1006:10): [True: 4.18k, False: 17.6k]
  ------------------
 1007|  17.6k|	        (content->c1->type == XML_ELEMENT_CONTENT_SEQ))
  ------------------
  |  Branch (1007:10): [True: 1.78k, False: 15.8k]
  ------------------
 1008|  5.97k|		xmlSnprintfElementContent(buf, size, content->c1, 1);
 1009|  15.8k|	    else
 1010|  15.8k|		xmlSnprintfElementContent(buf, size, content->c1, 0);
 1011|  21.8k|	    len = strlen(buf);
 1012|  21.8k|	    if (size - len < 50) {
  ------------------
  |  Branch (1012:10): [True: 151, False: 21.6k]
  ------------------
 1013|    151|		if ((size - len > 4) && (buf[len - 1] != '.'))
  ------------------
  |  Branch (1013:7): [True: 145, False: 6]
  |  Branch (1013:27): [True: 97, False: 48]
  ------------------
 1014|     97|		    strcat(buf, " ...");
 1015|    151|		return;
 1016|    151|	    }
 1017|  21.6k|            strcat(buf, " , ");
 1018|  21.6k|	    if (((content->c2->type == XML_ELEMENT_CONTENT_OR) ||
  ------------------
  |  Branch (1018:11): [True: 62, False: 21.6k]
  ------------------
 1019|  21.6k|		 (content->c2->ocur != XML_ELEMENT_CONTENT_ONCE)) &&
  ------------------
  |  Branch (1019:4): [True: 1.56k, False: 20.0k]
  ------------------
 1020|  1.62k|		(content->c2->type != XML_ELEMENT_CONTENT_ELEMENT))
  ------------------
  |  Branch (1020:3): [True: 74, False: 1.55k]
  ------------------
 1021|     74|		xmlSnprintfElementContent(buf, size, content->c2, 1);
 1022|  21.6k|	    else
 1023|  21.6k|		xmlSnprintfElementContent(buf, size, content->c2, 0);
 1024|  21.6k|	    break;
 1025|  22.6k|	case XML_ELEMENT_CONTENT_OR:
  ------------------
  |  Branch (1025:2): [True: 22.6k, False: 69.8k]
  ------------------
 1026|  22.6k|	    if ((content->c1->type == XML_ELEMENT_CONTENT_OR) ||
  ------------------
  |  Branch (1026:10): [True: 1.76k, False: 20.8k]
  ------------------
 1027|  20.8k|	        (content->c1->type == XML_ELEMENT_CONTENT_SEQ))
  ------------------
  |  Branch (1027:10): [True: 303, False: 20.5k]
  ------------------
 1028|  2.06k|		xmlSnprintfElementContent(buf, size, content->c1, 1);
 1029|  20.5k|	    else
 1030|  20.5k|		xmlSnprintfElementContent(buf, size, content->c1, 0);
 1031|  22.6k|	    len = strlen(buf);
 1032|  22.6k|	    if (size - len < 50) {
  ------------------
  |  Branch (1032:10): [True: 177, False: 22.4k]
  ------------------
 1033|    177|		if ((size - len > 4) && (buf[len - 1] != '.'))
  ------------------
  |  Branch (1033:7): [True: 177, False: 0]
  |  Branch (1033:27): [True: 92, False: 85]
  ------------------
 1034|     92|		    strcat(buf, " ...");
 1035|    177|		return;
 1036|    177|	    }
 1037|  22.4k|            strcat(buf, " | ");
 1038|  22.4k|	    if (((content->c2->type == XML_ELEMENT_CONTENT_SEQ) ||
  ------------------
  |  Branch (1038:11): [True: 97, False: 22.3k]
  ------------------
 1039|  22.3k|		 (content->c2->ocur != XML_ELEMENT_CONTENT_ONCE)) &&
  ------------------
  |  Branch (1039:4): [True: 2.03k, False: 20.2k]
  ------------------
 1040|  2.12k|		(content->c2->type != XML_ELEMENT_CONTENT_ELEMENT))
  ------------------
  |  Branch (1040:3): [True: 105, False: 2.02k]
  ------------------
 1041|    105|		xmlSnprintfElementContent(buf, size, content->c2, 1);
 1042|  22.3k|	    else
 1043|  22.3k|		xmlSnprintfElementContent(buf, size, content->c2, 0);
 1044|  22.4k|	    break;
 1045|  92.4k|    }
 1046|  91.7k|    if (size - strlen(buf) <= 2) return;
  ------------------
  |  Branch (1046:9): [True: 49, False: 91.7k]
  ------------------
 1047|  91.7k|    if (englob)
  ------------------
  |  Branch (1047:9): [True: 12.0k, False: 79.6k]
  ------------------
 1048|  12.0k|        strcat(buf, ")");
 1049|  91.7k|    switch (content->ocur) {
  ------------------
  |  Branch (1049:13): [True: 91.7k, False: 0]
  ------------------
 1050|  72.7k|        case XML_ELEMENT_CONTENT_ONCE:
  ------------------
  |  Branch (1050:9): [True: 72.7k, False: 18.9k]
  ------------------
 1051|  72.7k|	    break;
 1052|  6.48k|        case XML_ELEMENT_CONTENT_OPT:
  ------------------
  |  Branch (1052:9): [True: 6.48k, False: 85.2k]
  ------------------
 1053|  6.48k|	    strcat(buf, "?");
 1054|  6.48k|	    break;
 1055|  8.78k|        case XML_ELEMENT_CONTENT_MULT:
  ------------------
  |  Branch (1055:9): [True: 8.78k, False: 82.9k]
  ------------------
 1056|  8.78k|	    strcat(buf, "*");
 1057|  8.78k|	    break;
 1058|  3.70k|        case XML_ELEMENT_CONTENT_PLUS:
  ------------------
  |  Branch (1058:9): [True: 3.70k, False: 88.0k]
  ------------------
 1059|  3.70k|	    strcat(buf, "+");
 1060|  3.70k|	    break;
 1061|  91.7k|    }
 1062|  91.7k|}
xmlAddElementDecl:
 1106|  17.4k|		  xmlElementContent *content) {
 1107|  17.4k|    xmlElementPtr ret;
 1108|  17.4k|    xmlElementTablePtr table;
 1109|  17.4k|    xmlAttributePtr oldAttributes = NULL;
 1110|  17.4k|    const xmlChar *localName;
 1111|  17.4k|    xmlChar *prefix = NULL;
 1112|       |
 1113|  17.4k|    if ((dtd == NULL) || (name == NULL))
  ------------------
  |  Branch (1113:9): [True: 0, False: 17.4k]
  |  Branch (1113:26): [True: 0, False: 17.4k]
  ------------------
 1114|      0|	return(NULL);
 1115|       |
 1116|  17.4k|    switch (type) {
 1117|  4.76k|        case XML_ELEMENT_TYPE_EMPTY:
  ------------------
  |  Branch (1117:9): [True: 4.76k, False: 12.6k]
  ------------------
 1118|  5.60k|        case XML_ELEMENT_TYPE_ANY:
  ------------------
  |  Branch (1118:9): [True: 843, False: 16.5k]
  ------------------
 1119|  5.60k|            if (content != NULL)
  ------------------
  |  Branch (1119:17): [True: 0, False: 5.60k]
  ------------------
 1120|      0|                return(NULL);
 1121|  5.60k|            break;
 1122|  5.60k|        case XML_ELEMENT_TYPE_MIXED:
  ------------------
  |  Branch (1122:9): [True: 5.32k, False: 12.0k]
  ------------------
 1123|  11.8k|        case XML_ELEMENT_TYPE_ELEMENT:
  ------------------
  |  Branch (1123:9): [True: 6.48k, False: 10.9k]
  ------------------
 1124|  11.8k|            if (content == NULL)
  ------------------
  |  Branch (1124:17): [True: 0, False: 11.8k]
  ------------------
 1125|      0|                return(NULL);
 1126|  11.8k|            break;
 1127|  11.8k|        default:
  ------------------
  |  Branch (1127:9): [True: 0, False: 17.4k]
  ------------------
 1128|      0|            return(NULL);
 1129|  17.4k|    }
 1130|       |
 1131|       |    /*
 1132|       |     * check if name is a QName
 1133|       |     */
 1134|  17.4k|    localName = xmlSplitQName4(name, &prefix);
 1135|  17.4k|    if (localName == NULL)
  ------------------
  |  Branch (1135:9): [True: 1, False: 17.4k]
  ------------------
 1136|      1|        goto mem_error;
 1137|       |
 1138|       |    /*
 1139|       |     * Create the Element table if needed.
 1140|       |     */
 1141|  17.4k|    table = (xmlElementTablePtr) dtd->elements;
 1142|  17.4k|    if (table == NULL) {
  ------------------
  |  Branch (1142:9): [True: 4.25k, False: 13.1k]
  ------------------
 1143|  4.25k|	xmlDictPtr dict = NULL;
 1144|       |
 1145|  4.25k|	if (dtd->doc != NULL)
  ------------------
  |  Branch (1145:6): [True: 4.25k, False: 0]
  ------------------
 1146|  4.25k|	    dict = dtd->doc->dict;
 1147|  4.25k|        table = xmlHashCreateDict(0, dict);
 1148|  4.25k|        if (table == NULL)
  ------------------
  |  Branch (1148:13): [True: 1, False: 4.25k]
  ------------------
 1149|      1|            goto mem_error;
 1150|  4.25k|	dtd->elements = (void *) table;
 1151|  4.25k|    }
 1152|       |
 1153|       |    /*
 1154|       |     * lookup old attributes inserted on an undefined element in the
 1155|       |     * internal subset.
 1156|       |     */
 1157|  17.4k|    if ((dtd->doc != NULL) && (dtd->doc->intSubset != NULL)) {
  ------------------
  |  Branch (1157:9): [True: 17.4k, False: 0]
  |  Branch (1157:31): [True: 17.4k, False: 0]
  ------------------
 1158|  17.4k|	ret = xmlHashLookup2(dtd->doc->intSubset->elements, localName, prefix);
 1159|  17.4k|	if ((ret != NULL) && (ret->etype == XML_ELEMENT_TYPE_UNDEFINED)) {
  ------------------
  |  Branch (1159:6): [True: 4.70k, False: 12.7k]
  |  Branch (1159:23): [True: 201, False: 4.50k]
  ------------------
 1160|    201|	    oldAttributes = ret->attributes;
 1161|    201|	    ret->attributes = NULL;
 1162|    201|	    xmlHashRemoveEntry2(dtd->doc->intSubset->elements, localName, prefix,
 1163|    201|                                NULL);
 1164|    201|	    xmlFreeElement(ret);
 1165|    201|	}
 1166|  17.4k|    }
 1167|       |
 1168|       |    /*
 1169|       |     * The element may already be present if one of its attribute
 1170|       |     * was registered first
 1171|       |     */
 1172|  17.4k|    ret = xmlHashLookup2(table, localName, prefix);
 1173|  17.4k|    if (ret != NULL) {
  ------------------
  |  Branch (1173:9): [True: 6.07k, False: 11.3k]
  ------------------
 1174|  6.07k|	if (ret->etype != XML_ELEMENT_TYPE_UNDEFINED) {
  ------------------
  |  Branch (1174:6): [True: 6.05k, False: 20]
  ------------------
 1175|  6.05k|#ifdef LIBXML_VALID_ENABLED
 1176|       |	    /*
 1177|       |	     * The element is already defined in this DTD.
 1178|       |	     */
 1179|  6.05k|            if ((ctxt != NULL) && (ctxt->flags & XML_VCTXT_VALIDATE))
  ------------------
  |  |   24|  6.05k|#define XML_VCTXT_VALIDATE (1u << 2)
  ------------------
  |  Branch (1179:17): [True: 6.05k, False: 0]
  |  Branch (1179:35): [True: 4.16k, False: 1.88k]
  ------------------
 1180|  4.16k|                xmlErrValidNode(ctxt, (xmlNodePtr) dtd, XML_DTD_ELEM_REDEFINED,
 1181|  4.16k|                                "Redefinition of element %s\n",
 1182|  4.16k|                                name, NULL, NULL);
 1183|  6.05k|#endif /* LIBXML_VALID_ENABLED */
 1184|  6.05k|            if (prefix != NULL)
  ------------------
  |  Branch (1184:17): [True: 413, False: 5.63k]
  ------------------
 1185|    413|	        xmlFree(prefix);
 1186|  6.05k|	    return(NULL);
 1187|  6.05k|	}
 1188|     20|	if (prefix != NULL) {
  ------------------
  |  Branch (1188:6): [True: 1, False: 19]
  ------------------
 1189|      1|	    xmlFree(prefix);
 1190|      1|	    prefix = NULL;
 1191|      1|	}
 1192|  11.3k|    } else {
 1193|  11.3k|        int res;
 1194|       |
 1195|  11.3k|	ret = (xmlElementPtr) xmlMalloc(sizeof(xmlElement));
 1196|  11.3k|	if (ret == NULL)
  ------------------
  |  Branch (1196:6): [True: 2, False: 11.3k]
  ------------------
 1197|      2|            goto mem_error;
 1198|  11.3k|	memset(ret, 0, sizeof(xmlElement));
 1199|  11.3k|	ret->type = XML_ELEMENT_DECL;
 1200|       |
 1201|       |	/*
 1202|       |	 * fill the structure.
 1203|       |	 */
 1204|  11.3k|	ret->name = xmlStrdup(localName);
 1205|  11.3k|	if (ret->name == NULL) {
  ------------------
  |  Branch (1205:6): [True: 2, False: 11.3k]
  ------------------
 1206|      2|	    xmlFree(ret);
 1207|      2|	    goto mem_error;
 1208|      2|	}
 1209|  11.3k|	ret->prefix = prefix;
 1210|  11.3k|        prefix = NULL;
 1211|       |
 1212|       |	/*
 1213|       |	 * Validity Check:
 1214|       |	 * Insertion must not fail
 1215|       |	 */
 1216|  11.3k|        res = xmlHashAdd2(table, localName, ret->prefix, ret);
 1217|  11.3k|        if (res <= 0) {
  ------------------
  |  Branch (1217:13): [True: 6, False: 11.3k]
  ------------------
 1218|      6|	    xmlFreeElement(ret);
 1219|      6|            goto mem_error;
 1220|      6|	}
 1221|       |	/*
 1222|       |	 * For new element, may have attributes from earlier
 1223|       |	 * definition in internal subset
 1224|       |	 */
 1225|  11.3k|	ret->attributes = oldAttributes;
 1226|  11.3k|    }
 1227|       |
 1228|       |    /*
 1229|       |     * Finish to fill the structure.
 1230|       |     */
 1231|  11.3k|    ret->etype = type;
 1232|       |    /*
 1233|       |     * Avoid a stupid copy when called by the parser
 1234|       |     * and flag it by setting a special parent value
 1235|       |     * so the parser doesn't unallocate it.
 1236|       |     */
 1237|  11.3k|    if (content != NULL) {
  ------------------
  |  Branch (1237:9): [True: 8.43k, False: 2.91k]
  ------------------
 1238|  8.43k|        if ((ctxt != NULL) && (ctxt->flags & XML_VCTXT_USE_PCTXT)) {
  ------------------
  |  |   20|  8.43k|#define XML_VCTXT_USE_PCTXT (1u << 1)
  ------------------
  |  Branch (1238:13): [True: 8.43k, False: 0]
  |  Branch (1238:31): [True: 8.43k, False: 0]
  ------------------
 1239|  8.43k|            ret->content = content;
 1240|  8.43k|            content->parent = (xmlElementContentPtr) 1;
 1241|  8.43k|        } else if (content != NULL){
  ------------------
  |  Branch (1241:20): [True: 0, False: 0]
  ------------------
 1242|      0|            ret->content = xmlCopyDocElementContent(dtd->doc, content);
 1243|      0|            if (ret->content == NULL)
  ------------------
  |  Branch (1243:17): [True: 0, False: 0]
  ------------------
 1244|      0|                goto mem_error;
 1245|      0|        }
 1246|  8.43k|    }
 1247|       |
 1248|       |    /*
 1249|       |     * Link it to the DTD
 1250|       |     */
 1251|  11.3k|    ret->parent = dtd;
 1252|  11.3k|    ret->doc = dtd->doc;
 1253|  11.3k|    if (dtd->last == NULL) {
  ------------------
  |  Branch (1253:9): [True: 3.97k, False: 7.37k]
  ------------------
 1254|  3.97k|	dtd->children = dtd->last = (xmlNodePtr) ret;
 1255|  7.37k|    } else {
 1256|  7.37k|        dtd->last->next = (xmlNodePtr) ret;
 1257|  7.37k|	ret->prev = dtd->last;
 1258|  7.37k|	dtd->last = (xmlNodePtr) ret;
 1259|  7.37k|    }
 1260|  11.3k|    if (prefix != NULL)
  ------------------
  |  Branch (1260:9): [True: 0, False: 11.3k]
  ------------------
 1261|      0|	xmlFree(prefix);
 1262|  11.3k|    return(ret);
 1263|       |
 1264|     12|mem_error:
 1265|     12|    xmlVErrMemory(ctxt);
 1266|     12|    if (prefix != NULL)
  ------------------
  |  Branch (1266:9): [True: 1, False: 11]
  ------------------
 1267|      1|        xmlFree(prefix);
 1268|       |    return(NULL);
 1269|  11.3k|}
xmlFreeElementTable:
 1284|  7.48k|xmlFreeElementTable(xmlElementTable *table) {
 1285|  7.48k|    xmlHashFree(table, xmlFreeElementTableEntry);
 1286|  7.48k|}
xmlCreateEnumeration:
 1413|  26.0k|xmlCreateEnumeration(const xmlChar *name) {
 1414|  26.0k|    xmlEnumerationPtr ret;
 1415|       |
 1416|  26.0k|    ret = (xmlEnumerationPtr) xmlMalloc(sizeof(xmlEnumeration));
 1417|  26.0k|    if (ret == NULL)
  ------------------
  |  Branch (1417:9): [True: 3, False: 26.0k]
  ------------------
 1418|      3|        return(NULL);
 1419|  26.0k|    memset(ret, 0, sizeof(xmlEnumeration));
 1420|       |
 1421|  26.0k|    if (name != NULL) {
  ------------------
  |  Branch (1421:9): [True: 26.0k, False: 0]
  ------------------
 1422|  26.0k|        ret->name = xmlStrdup(name);
 1423|  26.0k|        if (ret->name == NULL) {
  ------------------
  |  Branch (1423:13): [True: 2, False: 26.0k]
  ------------------
 1424|      2|            xmlFree(ret);
 1425|      2|            return(NULL);
 1426|      2|        }
 1427|  26.0k|    }
 1428|       |
 1429|  26.0k|    return(ret);
 1430|  26.0k|}
xmlFreeEnumeration:
 1438|  18.5k|xmlFreeEnumeration(xmlEnumeration *cur) {
 1439|  44.5k|    while (cur != NULL) {
  ------------------
  |  Branch (1439:12): [True: 26.0k, False: 18.5k]
  ------------------
 1440|  26.0k|        xmlEnumerationPtr next = cur->next;
 1441|       |
 1442|  26.0k|        xmlFree((xmlChar *) cur->name);
 1443|  26.0k|        xmlFree(cur);
 1444|       |
 1445|  26.0k|        cur = next;
 1446|  26.0k|    }
 1447|  18.5k|}
xmlAddAttributeDecl:
 1572|  58.5k|		    const xmlChar *defaultValue, xmlEnumeration *tree) {
 1573|  58.5k|    xmlAttributePtr ret = NULL;
 1574|  58.5k|    xmlAttributeTablePtr table;
 1575|  58.5k|    xmlElementPtr elemDef;
 1576|  58.5k|    xmlDictPtr dict = NULL;
 1577|  58.5k|    int res;
 1578|       |
 1579|  58.5k|    if (dtd == NULL) {
  ------------------
  |  Branch (1579:9): [True: 0, False: 58.5k]
  ------------------
 1580|      0|	xmlFreeEnumeration(tree);
 1581|      0|	return(NULL);
 1582|      0|    }
 1583|  58.5k|    if (name == NULL) {
  ------------------
  |  Branch (1583:9): [True: 8, False: 58.5k]
  ------------------
 1584|      8|	xmlFreeEnumeration(tree);
 1585|      8|	return(NULL);
 1586|      8|    }
 1587|  58.5k|    if (elem == NULL) {
  ------------------
  |  Branch (1587:9): [True: 0, False: 58.5k]
  ------------------
 1588|      0|	xmlFreeEnumeration(tree);
 1589|      0|	return(NULL);
 1590|      0|    }
 1591|  58.5k|    if (dtd->doc != NULL)
  ------------------
  |  Branch (1591:9): [True: 58.5k, False: 0]
  ------------------
 1592|  58.5k|	dict = dtd->doc->dict;
 1593|       |
 1594|  58.5k|#ifdef LIBXML_VALID_ENABLED
 1595|  58.5k|    if ((ctxt != NULL) && (ctxt->flags & XML_VCTXT_VALIDATE) &&
  ------------------
  |  |   24|  58.5k|#define XML_VCTXT_VALIDATE (1u << 2)
  ------------------
  |  Branch (1595:9): [True: 58.5k, False: 0]
  |  Branch (1595:27): [True: 46.1k, False: 12.3k]
  ------------------
 1596|  46.1k|        (defaultValue != NULL) &&
  ------------------
  |  Branch (1596:9): [True: 20.2k, False: 25.9k]
  ------------------
 1597|  20.2k|        (!xmlValidateAttributeValueInternal(dtd->doc, type, defaultValue))) {
  ------------------
  |  Branch (1597:9): [True: 9.08k, False: 11.1k]
  ------------------
 1598|  9.08k|	xmlErrValidNode(ctxt, (xmlNodePtr) dtd, XML_DTD_ATTRIBUTE_DEFAULT,
 1599|  9.08k|	                "Attribute %s of %s: invalid default value\n",
 1600|  9.08k|	                elem, name, defaultValue);
 1601|  9.08k|	defaultValue = NULL;
 1602|  9.08k|	if (ctxt != NULL)
  ------------------
  |  Branch (1602:6): [True: 9.08k, False: 0]
  ------------------
 1603|  9.08k|	    ctxt->valid = 0;
 1604|  9.08k|    }
 1605|  58.5k|#endif /* LIBXML_VALID_ENABLED */
 1606|       |
 1607|       |    /*
 1608|       |     * Check first that an attribute defined in the external subset wasn't
 1609|       |     * already defined in the internal subset
 1610|       |     */
 1611|  58.5k|    if ((dtd->doc != NULL) && (dtd->doc->extSubset == dtd) &&
  ------------------
  |  Branch (1611:9): [True: 58.5k, False: 0]
  |  Branch (1611:31): [True: 19.5k, False: 39.0k]
  ------------------
 1612|  19.5k|	(dtd->doc->intSubset != NULL) &&
  ------------------
  |  Branch (1612:2): [True: 19.5k, False: 0]
  ------------------
 1613|  19.5k|	(dtd->doc->intSubset->attributes != NULL)) {
  ------------------
  |  Branch (1613:2): [True: 5.01k, False: 14.5k]
  ------------------
 1614|  5.01k|        ret = xmlHashLookup3(dtd->doc->intSubset->attributes, name, ns, elem);
 1615|  5.01k|	if (ret != NULL) {
  ------------------
  |  Branch (1615:6): [True: 1.74k, False: 3.27k]
  ------------------
 1616|  1.74k|	    xmlFreeEnumeration(tree);
 1617|  1.74k|	    return(NULL);
 1618|  1.74k|	}
 1619|  5.01k|    }
 1620|       |
 1621|       |    /*
 1622|       |     * Create the Attribute table if needed.
 1623|       |     */
 1624|  56.8k|    table = (xmlAttributeTablePtr) dtd->attributes;
 1625|  56.8k|    if (table == NULL) {
  ------------------
  |  Branch (1625:9): [True: 4.65k, False: 52.1k]
  ------------------
 1626|  4.65k|        table = xmlHashCreateDict(0, dict);
 1627|  4.65k|	dtd->attributes = (void *) table;
 1628|  4.65k|    }
 1629|  56.8k|    if (table == NULL)
  ------------------
  |  Branch (1629:9): [True: 2, False: 56.8k]
  ------------------
 1630|      2|        goto mem_error;
 1631|       |
 1632|  56.8k|    ret = (xmlAttributePtr) xmlMalloc(sizeof(xmlAttribute));
 1633|  56.8k|    if (ret == NULL)
  ------------------
  |  Branch (1633:9): [True: 7, False: 56.7k]
  ------------------
 1634|      7|        goto mem_error;
 1635|  56.7k|    memset(ret, 0, sizeof(xmlAttribute));
 1636|  56.7k|    ret->type = XML_ATTRIBUTE_DECL;
 1637|       |
 1638|       |    /*
 1639|       |     * fill the structure.
 1640|       |     */
 1641|  56.7k|    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|  56.7k|    ret->doc = dtd->doc;
 1648|  56.7k|    if (dict) {
  ------------------
  |  Branch (1648:9): [True: 35.1k, False: 21.6k]
  ------------------
 1649|  35.1k|	ret->name = xmlDictLookup(dict, name, -1);
 1650|  35.1k|	ret->elem = xmlDictLookup(dict, elem, -1);
 1651|  35.1k|    } else {
 1652|  21.6k|	ret->name = xmlStrdup(name);
 1653|  21.6k|	ret->elem = xmlStrdup(elem);
 1654|  21.6k|    }
 1655|  56.7k|    if ((ret->name == NULL) || (ret->elem == NULL))
  ------------------
  |  Branch (1655:9): [True: 3, False: 56.7k]
  |  Branch (1655:32): [True: 5, False: 56.7k]
  ------------------
 1656|      8|        goto mem_error;
 1657|  56.7k|    if (ns != NULL) {
  ------------------
  |  Branch (1657:9): [True: 4.86k, False: 51.9k]
  ------------------
 1658|  4.86k|        if (dict)
  ------------------
  |  Branch (1658:13): [True: 2.65k, False: 2.21k]
  ------------------
 1659|  2.65k|            ret->prefix = xmlDictLookup(dict, ns, -1);
 1660|  2.21k|        else
 1661|  2.21k|            ret->prefix = xmlStrdup(ns);
 1662|  4.86k|        if (ret->prefix == NULL)
  ------------------
  |  Branch (1662:13): [True: 1, False: 4.86k]
  ------------------
 1663|      1|            goto mem_error;
 1664|  4.86k|    }
 1665|  56.7k|    ret->def = def;
 1666|  56.7k|    ret->tree = tree;
 1667|  56.7k|    tree = NULL;
 1668|  56.7k|    if (defaultValue != NULL) {
  ------------------
  |  Branch (1668:9): [True: 19.5k, False: 37.2k]
  ------------------
 1669|  19.5k|	ret->defaultValue = xmlStrdup(defaultValue);
 1670|  19.5k|        if (ret->defaultValue == NULL)
  ------------------
  |  Branch (1670:13): [True: 1, False: 19.5k]
  ------------------
 1671|      1|            goto mem_error;
 1672|  19.5k|    }
 1673|       |
 1674|  56.7k|    elemDef = xmlGetDtdElementDesc2(ctxt, dtd, elem);
 1675|  56.7k|    if (elemDef == NULL)
  ------------------
  |  Branch (1675:9): [True: 12, False: 56.7k]
  ------------------
 1676|     12|        goto mem_error;
 1677|       |
 1678|       |    /*
 1679|       |     * Validity Check:
 1680|       |     * Search the DTD for previous declarations of the ATTLIST
 1681|       |     */
 1682|  56.7k|    res = xmlHashAdd3(table, ret->name, ret->prefix, ret->elem, ret);
 1683|  56.7k|    if (res <= 0) {
  ------------------
  |  Branch (1683:9): [True: 29.7k, False: 27.0k]
  ------------------
 1684|  29.7k|        if (res < 0)
  ------------------
  |  Branch (1684:13): [True: 7, False: 29.7k]
  ------------------
 1685|      7|            goto mem_error;
 1686|  29.7k|#ifdef LIBXML_VALID_ENABLED
 1687|       |        /*
 1688|       |         * The attribute is already defined in this DTD.
 1689|       |         */
 1690|  29.7k|        if ((ctxt != NULL) && (ctxt->flags & XML_VCTXT_VALIDATE))
  ------------------
  |  |   24|  29.7k|#define XML_VCTXT_VALIDATE (1u << 2)
  ------------------
  |  Branch (1690:13): [True: 29.7k, False: 0]
  |  Branch (1690:31): [True: 23.5k, False: 6.24k]
  ------------------
 1691|  23.5k|            xmlErrValidWarning(ctxt, (xmlNodePtr) dtd,
 1692|  23.5k|                    XML_DTD_ATTRIBUTE_REDEFINED,
 1693|  23.5k|                    "Attribute %s of element %s: already defined\n",
 1694|  23.5k|                    name, elem, NULL);
 1695|  29.7k|#endif /* LIBXML_VALID_ENABLED */
 1696|  29.7k|	xmlFreeAttribute(ret);
 1697|  29.7k|	return(NULL);
 1698|  29.7k|    }
 1699|       |
 1700|       |    /*
 1701|       |     * Insert namespace default def first they need to be
 1702|       |     * processed first.
 1703|       |     */
 1704|  27.0k|    if ((xmlStrEqual(ret->name, BAD_CAST "xmlns")) ||
  ------------------
  |  |   34|  27.0k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (1704:9): [True: 539, False: 26.4k]
  ------------------
 1705|  26.4k|        ((ret->prefix != NULL &&
  ------------------
  |  Branch (1705:11): [True: 3.57k, False: 22.9k]
  ------------------
 1706|  3.57k|         (xmlStrEqual(ret->prefix, BAD_CAST "xmlns"))))) {
  ------------------
  |  |   34|  3.57k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (1706:10): [True: 1.47k, False: 2.10k]
  ------------------
 1707|  2.00k|        ret->nexth = elemDef->attributes;
 1708|  2.00k|        elemDef->attributes = ret;
 1709|  25.0k|    } else {
 1710|  25.0k|        xmlAttributePtr tmp = elemDef->attributes;
 1711|       |
 1712|  25.7k|        while ((tmp != NULL) &&
  ------------------
  |  Branch (1712:16): [True: 17.1k, False: 8.56k]
  ------------------
 1713|  17.1k|               ((xmlStrEqual(tmp->name, BAD_CAST "xmlns")) ||
  ------------------
  |  |   34|  17.1k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (1713:17): [True: 782, False: 16.3k]
  ------------------
 1714|  16.3k|                ((ret->prefix != NULL &&
  ------------------
  |  Branch (1714:19): [True: 1.10k, False: 15.2k]
  ------------------
 1715|  1.10k|                 (xmlStrEqual(ret->prefix, BAD_CAST "xmlns")))))) {
  ------------------
  |  |   34|  1.10k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (1715:18): [True: 0, False: 1.10k]
  ------------------
 1716|    782|            if (tmp->nexth == NULL)
  ------------------
  |  Branch (1716:17): [True: 61, False: 721]
  ------------------
 1717|     61|                break;
 1718|    721|            tmp = tmp->nexth;
 1719|    721|        }
 1720|  25.0k|        if (tmp != NULL) {
  ------------------
  |  Branch (1720:13): [True: 16.4k, False: 8.56k]
  ------------------
 1721|  16.4k|            ret->nexth = tmp->nexth;
 1722|  16.4k|            tmp->nexth = ret;
 1723|  16.4k|        } else {
 1724|  8.56k|            ret->nexth = elemDef->attributes;
 1725|  8.56k|            elemDef->attributes = ret;
 1726|  8.56k|        }
 1727|  25.0k|    }
 1728|       |
 1729|       |    /*
 1730|       |     * Link it to the DTD
 1731|       |     */
 1732|  27.0k|    ret->parent = dtd;
 1733|  27.0k|    if (dtd->last == NULL) {
  ------------------
  |  Branch (1733:9): [True: 2.82k, False: 24.1k]
  ------------------
 1734|  2.82k|	dtd->children = dtd->last = (xmlNodePtr) ret;
 1735|  24.1k|    } else {
 1736|  24.1k|        dtd->last->next = (xmlNodePtr) ret;
 1737|  24.1k|	ret->prev = dtd->last;
 1738|  24.1k|	dtd->last = (xmlNodePtr) ret;
 1739|  24.1k|    }
 1740|  27.0k|    return(ret);
 1741|       |
 1742|     38|mem_error:
 1743|     38|    xmlVErrMemory(ctxt);
 1744|     38|    xmlFreeEnumeration(tree);
 1745|     38|    xmlFreeAttribute(ret);
 1746|       |    return(NULL);
 1747|  56.7k|}
xmlFreeAttributeTable:
 1762|  4.65k|xmlFreeAttributeTable(xmlAttributeTable *table) {
 1763|  4.65k|    xmlHashFree(table, xmlFreeAttributeTableEntry);
 1764|  4.65k|}
xmlAddNotationDecl:
 1926|  2.05k|                   const xmlChar *publicId, const xmlChar *systemId) {
 1927|  2.05k|    xmlNotationPtr ret = NULL;
 1928|  2.05k|    xmlNotationTablePtr table;
 1929|  2.05k|    int res;
 1930|       |
 1931|  2.05k|    if (dtd == NULL) {
  ------------------
  |  Branch (1931:9): [True: 0, False: 2.05k]
  ------------------
 1932|      0|	return(NULL);
 1933|      0|    }
 1934|  2.05k|    if (name == NULL) {
  ------------------
  |  Branch (1934:9): [True: 0, False: 2.05k]
  ------------------
 1935|      0|	return(NULL);
 1936|      0|    }
 1937|  2.05k|    if ((publicId == NULL) && (systemId == NULL)) {
  ------------------
  |  Branch (1937:9): [True: 973, False: 1.08k]
  |  Branch (1937:31): [True: 0, False: 973]
  ------------------
 1938|      0|	return(NULL);
 1939|      0|    }
 1940|       |
 1941|       |    /*
 1942|       |     * Create the Notation table if needed.
 1943|       |     */
 1944|  2.05k|    table = (xmlNotationTablePtr) dtd->notations;
 1945|  2.05k|    if (table == NULL) {
  ------------------
  |  Branch (1945:9): [True: 236, False: 1.82k]
  ------------------
 1946|    236|	xmlDictPtr dict = NULL;
 1947|    236|	if (dtd->doc != NULL)
  ------------------
  |  Branch (1947:6): [True: 236, False: 0]
  ------------------
 1948|    236|	    dict = dtd->doc->dict;
 1949|       |
 1950|    236|        dtd->notations = table = xmlHashCreateDict(0, dict);
 1951|    236|        if (table == NULL)
  ------------------
  |  Branch (1951:13): [True: 2, False: 234]
  ------------------
 1952|      2|            goto mem_error;
 1953|    236|    }
 1954|       |
 1955|  2.05k|    ret = (xmlNotationPtr) xmlMalloc(sizeof(xmlNotation));
 1956|  2.05k|    if (ret == NULL)
  ------------------
  |  Branch (1956:9): [True: 2, False: 2.05k]
  ------------------
 1957|      2|        goto mem_error;
 1958|  2.05k|    memset(ret, 0, sizeof(xmlNotation));
 1959|       |
 1960|       |    /*
 1961|       |     * fill the structure.
 1962|       |     */
 1963|  2.05k|    ret->name = xmlStrdup(name);
 1964|  2.05k|    if (ret->name == NULL)
  ------------------
  |  Branch (1964:9): [True: 1, False: 2.05k]
  ------------------
 1965|      1|        goto mem_error;
 1966|  2.05k|    if (systemId != NULL) {
  ------------------
  |  Branch (1966:9): [True: 972, False: 1.07k]
  ------------------
 1967|    972|        ret->SystemID = xmlStrdup(systemId);
 1968|    972|        if (ret->SystemID == NULL)
  ------------------
  |  Branch (1968:13): [True: 1, False: 971]
  ------------------
 1969|      1|            goto mem_error;
 1970|    972|    }
 1971|  2.05k|    if (publicId != NULL) {
  ------------------
  |  Branch (1971:9): [True: 1.08k, False: 969]
  ------------------
 1972|  1.08k|        ret->PublicID = xmlStrdup(publicId);
 1973|  1.08k|        if (ret->PublicID == NULL)
  ------------------
  |  Branch (1973:13): [True: 3, False: 1.07k]
  ------------------
 1974|      3|            goto mem_error;
 1975|  1.08k|    }
 1976|       |
 1977|       |    /*
 1978|       |     * Validity Check:
 1979|       |     * Check the DTD for previous declarations of the ATTLIST
 1980|       |     */
 1981|  2.04k|    res = xmlHashAdd(table, name, ret);
 1982|  2.04k|    if (res <= 0) {
  ------------------
  |  Branch (1982:9): [True: 1.79k, False: 248]
  ------------------
 1983|  1.79k|        if (res < 0)
  ------------------
  |  Branch (1983:13): [True: 2, False: 1.79k]
  ------------------
 1984|      2|            goto mem_error;
 1985|  1.79k|#ifdef LIBXML_VALID_ENABLED
 1986|  1.79k|        if ((ctxt != NULL) && (ctxt->flags & XML_VCTXT_VALIDATE))
  ------------------
  |  |   24|  1.79k|#define XML_VCTXT_VALIDATE (1u << 2)
  ------------------
  |  Branch (1986:13): [True: 1.79k, False: 0]
  |  Branch (1986:31): [True: 1.10k, False: 693]
  ------------------
 1987|  1.10k|            xmlErrValid(ctxt, XML_DTD_NOTATION_REDEFINED,
 1988|  1.10k|                        "xmlAddNotationDecl: %s already defined\n",
 1989|  1.10k|                        (const char *) name);
 1990|  1.79k|#endif /* LIBXML_VALID_ENABLED */
 1991|  1.79k|	xmlFreeNotation(ret);
 1992|  1.79k|	return(NULL);
 1993|  1.79k|    }
 1994|    248|    return(ret);
 1995|       |
 1996|     11|mem_error:
 1997|     11|    xmlVErrMemory(ctxt);
 1998|     11|    xmlFreeNotation(ret);
 1999|       |    return(NULL);
 2000|  2.04k|}
xmlFreeNotationTable:
 2015|    234|xmlFreeNotationTable(xmlNotationTable *table) {
 2016|    234|    xmlHashFree(table, xmlFreeNotationTableEntry);
 2017|    234|}
xmlAddIDSafe:
 2259|  5.25k|xmlAddIDSafe(xmlAttr *attr, const xmlChar *value) {
 2260|       |    return(xmlAddIDInternal(attr, value, NULL));
 2261|  5.25k|}
xmlAddID:
 2274|  10.4k|         xmlAttr *attr) {
 2275|  10.4k|    xmlIDPtr id;
 2276|  10.4k|    int res;
 2277|       |
 2278|  10.4k|    if ((attr == NULL) || (doc != attr->doc))
  ------------------
  |  Branch (2278:9): [True: 0, False: 10.4k]
  |  Branch (2278:27): [True: 0, False: 10.4k]
  ------------------
 2279|      0|        return(NULL);
 2280|       |
 2281|  10.4k|    res = xmlAddIDInternal(attr, value, &id);
 2282|  10.4k|    if (res < 0) {
  ------------------
  |  Branch (2282:9): [True: 13, False: 10.4k]
  ------------------
 2283|     13|        xmlVErrMemory(ctxt);
 2284|     13|    }
 2285|  10.4k|    else if (res == 0) {
  ------------------
  |  Branch (2285:14): [True: 9.54k, False: 932]
  ------------------
 2286|  9.54k|        if (ctxt != NULL) {
  ------------------
  |  Branch (2286:13): [True: 9.54k, False: 0]
  ------------------
 2287|       |            /*
 2288|       |             * The id is already defined in this DTD.
 2289|       |             */
 2290|  9.54k|            xmlErrValidNode(ctxt, attr->parent, XML_DTD_ID_REDEFINED,
 2291|  9.54k|                            "ID %s already defined\n", value, NULL, NULL);
 2292|  9.54k|        }
 2293|  9.54k|    }
 2294|       |
 2295|  10.4k|    return(id);
 2296|  10.4k|}
xmlFreeIDTable:
 2309|    744|xmlFreeIDTable(xmlIDTable *table) {
 2310|    744|    xmlHashFree(table, xmlFreeIDTableEntry);
 2311|    744|}
xmlIsID:
 2326|   928k|xmlIsID(xmlDoc *doc, xmlNode *elem, xmlAttr *attr) {
 2327|   928k|    if ((attr == NULL) || (attr->name == NULL))
  ------------------
  |  Branch (2327:9): [True: 0, False: 928k]
  |  Branch (2327:27): [True: 26, False: 928k]
  ------------------
 2328|     26|        return(0);
 2329|       |
 2330|   928k|    if ((doc != NULL) && (doc->type == XML_HTML_DOCUMENT_NODE)) {
  ------------------
  |  Branch (2330:9): [True: 928k, False: 0]
  |  Branch (2330:26): [True: 0, False: 928k]
  ------------------
 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|   928k|    } else {
 2341|   928k|	xmlAttributePtr attrDecl = NULL;
 2342|   928k|	xmlChar felem[50];
 2343|   928k|	xmlChar *fullelemname;
 2344|   928k|        const xmlChar *aprefix;
 2345|       |
 2346|   928k|        if ((attr->ns != NULL) && (attr->ns->prefix != NULL) &&
  ------------------
  |  Branch (2346:13): [True: 323k, False: 604k]
  |  Branch (2346:35): [True: 323k, False: 0]
  ------------------
 2347|   323k|            (!strcmp((char *) attr->name, "id")) &&
  ------------------
  |  Branch (2347:13): [True: 2.84k, False: 321k]
  ------------------
 2348|  2.84k|            (!strcmp((char *) attr->ns->prefix, "xml")))
  ------------------
  |  Branch (2348:13): [True: 2.61k, False: 233]
  ------------------
 2349|  2.61k|            return(1);
 2350|       |
 2351|   925k|        if ((doc == NULL) ||
  ------------------
  |  Branch (2351:13): [True: 0, False: 925k]
  ------------------
 2352|   925k|            ((doc->intSubset == NULL) && (doc->extSubset == NULL)))
  ------------------
  |  Branch (2352:14): [True: 697k, False: 228k]
  |  Branch (2352:42): [True: 697k, False: 0]
  ------------------
 2353|   697k|            return(0);
 2354|       |
 2355|   228k|        if ((elem == NULL) ||
  ------------------
  |  Branch (2355:13): [True: 0, False: 228k]
  ------------------
 2356|   228k|            (elem->type != XML_ELEMENT_NODE) ||
  ------------------
  |  Branch (2356:13): [True: 0, False: 228k]
  ------------------
 2357|   228k|            (elem->name == NULL))
  ------------------
  |  Branch (2357:13): [True: 0, False: 228k]
  ------------------
 2358|      0|            return(0);
 2359|       |
 2360|   228k|	fullelemname = (elem->ns != NULL && elem->ns->prefix != NULL) ?
  ------------------
  |  Branch (2360:18): [True: 104k, False: 123k]
  |  Branch (2360:38): [True: 37.8k, False: 67.0k]
  ------------------
 2361|  37.8k|	    xmlBuildQName(elem->name, elem->ns->prefix, felem, 50) :
 2362|   228k|	    (xmlChar *)elem->name;
 2363|   228k|        if (fullelemname == NULL)
  ------------------
  |  Branch (2363:13): [True: 6, False: 228k]
  ------------------
 2364|      6|            return(-1);
 2365|       |
 2366|   228k|        aprefix = (attr->ns != NULL) ? attr->ns->prefix : NULL;
  ------------------
  |  Branch (2366:19): [True: 49.3k, False: 179k]
  ------------------
 2367|       |
 2368|   228k|	if (fullelemname != NULL) {
  ------------------
  |  Branch (2368:6): [True: 228k, False: 0]
  ------------------
 2369|   228k|	    attrDecl = xmlGetDtdQAttrDesc(doc->intSubset, fullelemname,
 2370|   228k|		                          attr->name, aprefix);
 2371|   228k|	    if ((attrDecl == NULL) && (doc->extSubset != NULL))
  ------------------
  |  Branch (2371:10): [True: 109k, False: 118k]
  |  Branch (2371:32): [True: 1.36k, False: 108k]
  ------------------
 2372|  1.36k|		attrDecl = xmlGetDtdQAttrDesc(doc->extSubset, fullelemname,
 2373|  1.36k|					      attr->name, aprefix);
 2374|   228k|	}
 2375|       |
 2376|   228k|	if ((fullelemname != felem) && (fullelemname != elem->name))
  ------------------
  |  Branch (2376:6): [True: 198k, False: 30.1k]
  |  Branch (2376:33): [True: 7.70k, False: 190k]
  ------------------
 2377|  7.70k|	    xmlFree(fullelemname);
 2378|       |
 2379|   228k|        if ((attrDecl != NULL) && (attrDecl->atype == XML_ATTRIBUTE_ID))
  ------------------
  |  Branch (2379:13): [True: 119k, False: 109k]
  |  Branch (2379:35): [True: 7.89k, False: 111k]
  ------------------
 2380|  7.89k|	    return(1);
 2381|   228k|    }
 2382|       |
 2383|   220k|    return(0);
 2384|   928k|}
xmlRemoveID:
 2394|  1.96k|xmlRemoveID(xmlDoc *doc, xmlAttr *attr) {
 2395|  1.96k|    xmlIDTablePtr table;
 2396|       |
 2397|  1.96k|    if (doc == NULL) return(-1);
  ------------------
  |  Branch (2397:9): [True: 0, False: 1.96k]
  ------------------
 2398|  1.96k|    if ((attr == NULL) || (attr->id == NULL)) return(-1);
  ------------------
  |  Branch (2398:9): [True: 0, False: 1.96k]
  |  Branch (2398:27): [True: 0, False: 1.96k]
  ------------------
 2399|       |
 2400|  1.96k|    table = (xmlIDTablePtr) doc->ids;
 2401|  1.96k|    if (table == NULL)
  ------------------
  |  Branch (2401:9): [True: 0, False: 1.96k]
  ------------------
 2402|      0|        return(-1);
 2403|       |
 2404|  1.96k|    if (xmlHashRemoveEntry(table, attr->id->value, xmlFreeIDTableEntry) < 0)
  ------------------
  |  Branch (2404:9): [True: 0, False: 1.96k]
  ------------------
 2405|      0|        return(-1);
 2406|       |
 2407|  1.96k|    return(0);
 2408|  1.96k|}
xmlGetID:
 2419|  16.3k|xmlGetID(xmlDoc *doc, const xmlChar *ID) {
 2420|  16.3k|    xmlIDTablePtr table;
 2421|  16.3k|    xmlIDPtr id;
 2422|       |
 2423|  16.3k|    if (doc == NULL) {
  ------------------
  |  Branch (2423:9): [True: 0, False: 16.3k]
  ------------------
 2424|      0|	return(NULL);
 2425|      0|    }
 2426|       |
 2427|  16.3k|    if (ID == NULL) {
  ------------------
  |  Branch (2427:9): [True: 0, False: 16.3k]
  ------------------
 2428|      0|	return(NULL);
 2429|      0|    }
 2430|       |
 2431|  16.3k|    table = (xmlIDTablePtr) doc->ids;
 2432|  16.3k|    if (table == NULL)
  ------------------
  |  Branch (2432:9): [True: 12.8k, False: 3.46k]
  ------------------
 2433|  12.8k|        return(NULL);
 2434|       |
 2435|  3.46k|    id = xmlHashLookup(table, ID);
 2436|  3.46k|    if (id == NULL)
  ------------------
  |  Branch (2436:9): [True: 1.86k, False: 1.60k]
  ------------------
 2437|  1.86k|	return(NULL);
 2438|  1.60k|    if (id->attr == NULL) {
  ------------------
  |  Branch (2438:9): [True: 149, False: 1.45k]
  ------------------
 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.45k|    return(id->attr);
 2446|  1.60k|}
xmlAddRef:
 2545|  38.4k|    xmlAttr *attr) {
 2546|  38.4k|    xmlRefPtr ret = NULL;
 2547|  38.4k|    xmlRefTablePtr table;
 2548|  38.4k|    xmlListPtr ref_list;
 2549|       |
 2550|  38.4k|    if (doc == NULL) {
  ------------------
  |  Branch (2550:9): [True: 0, False: 38.4k]
  ------------------
 2551|      0|        return(NULL);
 2552|      0|    }
 2553|  38.4k|    if (value == NULL) {
  ------------------
  |  Branch (2553:9): [True: 2, False: 38.4k]
  ------------------
 2554|      2|        return(NULL);
 2555|      2|    }
 2556|  38.4k|    if (attr == NULL) {
  ------------------
  |  Branch (2556:9): [True: 0, False: 38.4k]
  ------------------
 2557|      0|        return(NULL);
 2558|      0|    }
 2559|       |
 2560|       |    /*
 2561|       |     * Create the Ref table if needed.
 2562|       |     */
 2563|  38.4k|    table = (xmlRefTablePtr) doc->refs;
 2564|  38.4k|    if (table == NULL) {
  ------------------
  |  Branch (2564:9): [True: 532, False: 37.9k]
  ------------------
 2565|    532|        doc->refs = table = xmlHashCreate(0);
 2566|    532|        if (table == NULL)
  ------------------
  |  Branch (2566:13): [True: 1, False: 531]
  ------------------
 2567|      1|            goto failed;
 2568|    532|    }
 2569|       |
 2570|  38.4k|    ret = (xmlRefPtr) xmlMalloc(sizeof(xmlRef));
 2571|  38.4k|    if (ret == NULL)
  ------------------
  |  Branch (2571:9): [True: 2, False: 38.4k]
  ------------------
 2572|      2|        goto failed;
 2573|  38.4k|    memset(ret, 0, sizeof(*ret));
 2574|       |
 2575|       |    /*
 2576|       |     * fill the structure.
 2577|       |     */
 2578|  38.4k|    ret->value = xmlStrdup(value);
 2579|  38.4k|    if (ret->value == NULL)
  ------------------
  |  Branch (2579:9): [True: 5, False: 38.4k]
  ------------------
 2580|      5|        goto failed;
 2581|  38.4k|    if (xmlIsStreaming(ctxt)) {
  ------------------
  |  Branch (2581:9): [True: 3.60k, False: 34.8k]
  ------------------
 2582|       |	/*
 2583|       |	 * Operating in streaming mode, attr is gonna disappear
 2584|       |	 */
 2585|  3.60k|	ret->name = xmlStrdup(attr->name);
 2586|  3.60k|        if (ret->name == NULL)
  ------------------
  |  Branch (2586:13): [True: 2, False: 3.59k]
  ------------------
 2587|      2|            goto failed;
 2588|  3.59k|	ret->attr = NULL;
 2589|  34.8k|    } else {
 2590|  34.8k|	ret->name = NULL;
 2591|  34.8k|	ret->attr = attr;
 2592|  34.8k|    }
 2593|  38.4k|    ret->lineno = xmlGetLineNo(attr->parent);
 2594|       |
 2595|       |    /* To add a reference :-
 2596|       |     * References are maintained as a list of references,
 2597|       |     * Lookup the entry, if no entry create new nodelist
 2598|       |     * Add the owning node to the NodeList
 2599|       |     * Return the ref
 2600|       |     */
 2601|       |
 2602|  38.4k|    ref_list = xmlHashLookup(table, value);
 2603|  38.4k|    if (ref_list == NULL) {
  ------------------
  |  Branch (2603:9): [True: 695, False: 37.7k]
  ------------------
 2604|    695|        int res;
 2605|       |
 2606|    695|        ref_list = xmlListCreate(xmlFreeRef, xmlDummyCompare);
 2607|    695|        if (ref_list == NULL)
  ------------------
  |  Branch (2607:13): [True: 3, False: 692]
  ------------------
 2608|      3|	    goto failed;
 2609|    692|        res = xmlHashAdd(table, value, ref_list);
 2610|    692|        if (res <= 0) {
  ------------------
  |  Branch (2610:13): [True: 2, False: 690]
  ------------------
 2611|      2|            xmlListDelete(ref_list);
 2612|      2|	    goto failed;
 2613|      2|        }
 2614|    692|    }
 2615|  38.4k|    if (xmlListAppend(ref_list, ret) != 0)
  ------------------
  |  Branch (2615:9): [True: 3, False: 38.4k]
  ------------------
 2616|      3|        goto failed;
 2617|  38.4k|    return(ret);
 2618|       |
 2619|     18|failed:
 2620|     18|    xmlVErrMemory(ctxt);
 2621|     18|    if (ret != NULL) {
  ------------------
  |  Branch (2621:9): [True: 15, False: 3]
  ------------------
 2622|     15|        if (ret->value != NULL)
  ------------------
  |  Branch (2622:13): [True: 10, False: 5]
  ------------------
 2623|     10|	    xmlFree((char *)ret->value);
 2624|     15|        if (ret->name != NULL)
  ------------------
  |  Branch (2624:13): [True: 7, False: 8]
  ------------------
 2625|      7|	    xmlFree((char *)ret->name);
 2626|     15|        xmlFree(ret);
 2627|     15|    }
 2628|       |    return(NULL);
 2629|  38.4k|}
xmlFreeRefTable:
 2640|    531|xmlFreeRefTable(xmlRefTable *table) {
 2641|    531|    xmlHashFree(table, xmlFreeRefTableEntry);
 2642|    531|}
xmlIsRef:
 2658|   134k|xmlIsRef(xmlDoc *doc, xmlNode *elem, xmlAttr *attr) {
 2659|   134k|    if (attr == NULL)
  ------------------
  |  Branch (2659:9): [True: 0, False: 134k]
  ------------------
 2660|      0|        return(0);
 2661|   134k|    if (doc == NULL) {
  ------------------
  |  Branch (2661:9): [True: 0, False: 134k]
  ------------------
 2662|      0|        doc = attr->doc;
 2663|      0|	if (doc == NULL) return(0);
  ------------------
  |  Branch (2663:6): [True: 0, False: 0]
  ------------------
 2664|      0|    }
 2665|       |
 2666|   134k|    if ((doc->intSubset == NULL) && (doc->extSubset == NULL)) {
  ------------------
  |  Branch (2666:9): [True: 41.7k, False: 92.7k]
  |  Branch (2666:37): [True: 41.7k, False: 0]
  ------------------
 2667|  41.7k|        return(0);
 2668|  92.7k|    } else if (doc->type == XML_HTML_DOCUMENT_NODE) {
  ------------------
  |  Branch (2668:16): [True: 0, False: 92.7k]
  ------------------
 2669|       |        /* TODO @@@ */
 2670|      0|        return(0);
 2671|  92.7k|    } else {
 2672|  92.7k|        xmlAttributePtr attrDecl;
 2673|  92.7k|        const xmlChar *aprefix;
 2674|       |
 2675|  92.7k|        if (elem == NULL) return(0);
  ------------------
  |  Branch (2675:13): [True: 0, False: 92.7k]
  ------------------
 2676|  92.7k|        aprefix = (attr->ns != NULL) ? attr->ns->prefix : NULL;
  ------------------
  |  Branch (2676:19): [True: 13.6k, False: 79.0k]
  ------------------
 2677|  92.7k|        attrDecl = xmlGetDtdQAttrDesc(doc->intSubset, elem->name, attr->name,
 2678|  92.7k|                                      aprefix);
 2679|  92.7k|        if ((attrDecl == NULL) && (doc->extSubset != NULL))
  ------------------
  |  Branch (2679:13): [True: 29.3k, False: 63.4k]
  |  Branch (2679:35): [True: 928, False: 28.4k]
  ------------------
 2680|    928|            attrDecl = xmlGetDtdQAttrDesc(doc->extSubset, elem->name, attr->name,
 2681|    928|                                          aprefix);
 2682|       |
 2683|  92.7k|	if ((attrDecl != NULL) &&
  ------------------
  |  Branch (2683:6): [True: 63.9k, False: 28.7k]
  ------------------
 2684|  63.9k|	    (attrDecl->atype == XML_ATTRIBUTE_IDREF ||
  ------------------
  |  Branch (2684:7): [True: 498, False: 63.4k]
  ------------------
 2685|  63.4k|	     attrDecl->atype == XML_ATTRIBUTE_IDREFS))
  ------------------
  |  Branch (2685:7): [True: 34.4k, False: 28.9k]
  ------------------
 2686|  34.9k|	return(1);
 2687|  92.7k|    }
 2688|  57.7k|    return(0);
 2689|   134k|}
xmlGetDtdQElementDesc:
 2898|   557k|	              const xmlChar *prefix) {
 2899|   557k|    xmlElementTablePtr table;
 2900|       |
 2901|   557k|    if (dtd == NULL) return(NULL);
  ------------------
  |  Branch (2901:9): [True: 120k, False: 437k]
  ------------------
 2902|   437k|    if (dtd->elements == NULL) return(NULL);
  ------------------
  |  Branch (2902:9): [True: 120k, False: 316k]
  ------------------
 2903|   316k|    table = (xmlElementTablePtr) dtd->elements;
 2904|       |
 2905|   316k|    return(xmlHashLookup2(table, name, prefix));
 2906|   437k|}
xmlGetDtdQAttrDesc:
 2955|   463k|	          const xmlChar *prefix) {
 2956|   463k|    xmlAttributeTablePtr table;
 2957|       |
 2958|   463k|    if (dtd == NULL) return(NULL);
  ------------------
  |  Branch (2958:9): [True: 0, False: 463k]
  ------------------
 2959|   463k|    if (dtd->attributes == NULL) return(NULL);
  ------------------
  |  Branch (2959:9): [True: 83.8k, False: 379k]
  ------------------
 2960|   379k|    table = (xmlAttributeTablePtr) dtd->attributes;
 2961|       |
 2962|   379k|    return(xmlHashLookup3(table, name, prefix, elem));
 2963|   463k|}
xmlGetDtdNotationDesc:
 2974|  9.38k|xmlGetDtdNotationDesc(xmlDtd *dtd, const xmlChar *name) {
 2975|  9.38k|    xmlNotationTablePtr table;
 2976|       |
 2977|  9.38k|    if (dtd == NULL) return(NULL);
  ------------------
  |  Branch (2977:9): [True: 1.26k, False: 8.12k]
  ------------------
 2978|  8.12k|    if (dtd->notations == NULL) return(NULL);
  ------------------
  |  Branch (2978:9): [True: 5.60k, False: 2.51k]
  ------------------
 2979|  2.51k|    table = (xmlNotationTablePtr) dtd->notations;
 2980|       |
 2981|  2.51k|    return(xmlHashLookup(table, name));
 2982|  8.12k|}
xmlValidateNotationUse:
 2999|    149|                       const xmlChar *notationName) {
 3000|    149|    xmlNotationPtr notaDecl;
 3001|    149|    if ((doc == NULL) || (doc->intSubset == NULL) ||
  ------------------
  |  Branch (3001:9): [True: 0, False: 149]
  |  Branch (3001:26): [True: 0, False: 149]
  ------------------
 3002|    149|        (notationName == NULL)) return(-1);
  ------------------
  |  Branch (3002:9): [True: 0, False: 149]
  ------------------
 3003|       |
 3004|    149|    notaDecl = xmlGetDtdNotationDesc(doc->intSubset, notationName);
 3005|    149|    if ((notaDecl == NULL) && (doc->extSubset != NULL))
  ------------------
  |  Branch (3005:9): [True: 127, False: 22]
  |  Branch (3005:31): [True: 20, False: 107]
  ------------------
 3006|     20|	notaDecl = xmlGetDtdNotationDesc(doc->extSubset, notationName);
 3007|       |
 3008|    149|    if (notaDecl == NULL) {
  ------------------
  |  Branch (3008:9): [True: 126, False: 23]
  ------------------
 3009|    126|	xmlErrValidNode(ctxt, (xmlNodePtr) doc, XML_DTD_UNKNOWN_NOTATION,
 3010|    126|	                "NOTATION %s is not declared\n",
 3011|    126|		        notationName, NULL, NULL);
 3012|    126|	return(0);
 3013|    126|    }
 3014|     23|    return(1);
 3015|    149|}
xmlValidateNotationDecl:
 3266|    508|                         xmlNotation *nota ATTRIBUTE_UNUSED) {
 3267|    508|    int ret = 1;
 3268|       |
 3269|    508|    return(ret);
 3270|    508|}
xmlValidCtxtNormalizeAttributeValue:
 3484|  5.84k|	     xmlNode *elem, const xmlChar *name, const xmlChar *value) {
 3485|  5.84k|    xmlChar *ret;
 3486|  5.84k|    xmlAttributePtr attrDecl = NULL;
 3487|  5.84k|    const xmlChar *localName;
 3488|  5.84k|    xmlChar *prefix = NULL;
 3489|  5.84k|    int extsubset = 0;
 3490|       |
 3491|  5.84k|    if (doc == NULL) return(NULL);
  ------------------
  |  Branch (3491:9): [True: 0, False: 5.84k]
  ------------------
 3492|  5.84k|    if (elem == NULL) return(NULL);
  ------------------
  |  Branch (3492:9): [True: 0, False: 5.84k]
  ------------------
 3493|  5.84k|    if (name == NULL) return(NULL);
  ------------------
  |  Branch (3493:9): [True: 0, False: 5.84k]
  ------------------
 3494|  5.84k|    if (value == NULL) return(NULL);
  ------------------
  |  Branch (3494:9): [True: 0, False: 5.84k]
  ------------------
 3495|       |
 3496|  5.84k|    localName = xmlSplitQName4(name, &prefix);
 3497|  5.84k|    if (localName == NULL)
  ------------------
  |  Branch (3497:9): [True: 2, False: 5.84k]
  ------------------
 3498|      2|        goto mem_error;
 3499|       |
 3500|  5.84k|    if ((elem->ns != NULL) && (elem->ns->prefix != NULL)) {
  ------------------
  |  Branch (3500:9): [True: 1.79k, False: 4.05k]
  |  Branch (3500:31): [True: 1.34k, False: 444]
  ------------------
 3501|  1.34k|	xmlChar buf[50];
 3502|  1.34k|	xmlChar *elemname;
 3503|       |
 3504|  1.34k|	elemname = xmlBuildQName(elem->name, elem->ns->prefix, buf, 50);
 3505|  1.34k|	if (elemname == NULL)
  ------------------
  |  Branch (3505:6): [True: 1, False: 1.34k]
  ------------------
 3506|      1|	    goto mem_error;
 3507|  1.34k|        if (doc->intSubset != NULL)
  ------------------
  |  Branch (3507:13): [True: 1.34k, False: 0]
  ------------------
 3508|  1.34k|            attrDecl = xmlHashLookup3(doc->intSubset->attributes, localName,
 3509|  1.34k|                                      prefix, elemname);
 3510|  1.34k|	if ((attrDecl == NULL) && (doc->extSubset != NULL)) {
  ------------------
  |  Branch (3510:6): [True: 1.10k, False: 242]
  |  Branch (3510:28): [True: 621, False: 485]
  ------------------
 3511|    621|	    attrDecl = xmlHashLookup3(doc->extSubset->attributes, localName,
 3512|    621|                                      prefix, elemname);
 3513|    621|	    if (attrDecl != NULL)
  ------------------
  |  Branch (3513:10): [True: 231, False: 390]
  ------------------
 3514|    231|		extsubset = 1;
 3515|    621|	}
 3516|  1.34k|	if ((elemname != buf) && (elemname != elem->name))
  ------------------
  |  Branch (3516:6): [True: 630, False: 718]
  |  Branch (3516:27): [True: 630, False: 0]
  ------------------
 3517|    630|	    xmlFree(elemname);
 3518|  1.34k|    }
 3519|  5.84k|    if ((attrDecl == NULL) && (doc->intSubset != NULL))
  ------------------
  |  Branch (3519:9): [True: 5.36k, False: 473]
  |  Branch (3519:31): [True: 5.36k, False: 0]
  ------------------
 3520|  5.36k|	attrDecl = xmlHashLookup3(doc->intSubset->attributes, localName,
 3521|  5.36k|                                  prefix, elem->name);
 3522|  5.84k|    if ((attrDecl == NULL) && (doc->extSubset != NULL)) {
  ------------------
  |  Branch (3522:9): [True: 2.35k, False: 3.48k]
  |  Branch (3522:31): [True: 1.50k, False: 848]
  ------------------
 3523|  1.50k|	attrDecl = xmlHashLookup3(doc->extSubset->attributes, localName,
 3524|  1.50k|                                  prefix, elem->name);
 3525|  1.50k|	if (attrDecl != NULL)
  ------------------
  |  Branch (3525:6): [True: 698, False: 809]
  ------------------
 3526|    698|	    extsubset = 1;
 3527|  1.50k|    }
 3528|       |
 3529|  5.84k|    if (attrDecl == NULL)
  ------------------
  |  Branch (3529:9): [True: 1.65k, False: 4.18k]
  ------------------
 3530|  1.65k|	goto done;
 3531|  4.18k|    if (attrDecl->atype == XML_ATTRIBUTE_CDATA)
  ------------------
  |  Branch (3531:9): [True: 358, False: 3.82k]
  ------------------
 3532|    358|	goto done;
 3533|       |
 3534|  3.82k|    ret = xmlStrdup(value);
 3535|  3.82k|    if (ret == NULL)
  ------------------
  |  Branch (3535:9): [True: 3, False: 3.82k]
  ------------------
 3536|      3|	goto mem_error;
 3537|  3.82k|    xmlValidNormalizeString(ret);
 3538|  3.82k|    if ((doc->standalone) && (extsubset == 1) && (!xmlStrEqual(value, ret))) {
  ------------------
  |  Branch (3538:9): [True: 3.53k, False: 286]
  |  Branch (3538:30): [True: 594, False: 2.94k]
  |  Branch (3538:50): [True: 290, False: 304]
  ------------------
 3539|    290|	xmlErrValidNode(ctxt, elem, XML_DTD_NOT_STANDALONE,
 3540|    290|"standalone: %s on %s value had to be normalized based on external subset declaration\n",
 3541|    290|	       name, elem->name, NULL);
 3542|    290|	ctxt->valid = 0;
 3543|    290|    }
 3544|       |
 3545|  3.82k|    xmlFree(prefix);
 3546|  3.82k|    return(ret);
 3547|       |
 3548|      6|mem_error:
 3549|      6|    xmlVErrMemory(ctxt);
 3550|       |
 3551|  2.02k|done:
 3552|  2.02k|    xmlFree(prefix);
 3553|       |    return(NULL);
 3554|      6|}
xmlValidateAttributeDecl:
 3641|  16.0k|                         xmlAttribute *attr) {
 3642|  16.0k|    int ret = 1;
 3643|  16.0k|    int val;
 3644|  16.0k|    CHECK_DTD;
  ------------------
  |  |  418|  16.0k|   if (doc == NULL) return(0);					\
  |  |  ------------------
  |  |  |  Branch (418:8): [True: 0, False: 16.0k]
  |  |  ------------------
  |  |  419|  16.0k|   else if ((doc->intSubset == NULL) &&				\
  |  |  ------------------
  |  |  |  Branch (419:13): [True: 0, False: 16.0k]
  |  |  ------------------
  |  |  420|  16.0k|	    (doc->extSubset == NULL)) return(0)
  |  |  ------------------
  |  |  |  Branch (420:6): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 3645|  16.0k|    if(attr == NULL) return(1);
  ------------------
  |  Branch (3645:8): [True: 0, False: 16.0k]
  ------------------
 3646|       |
 3647|       |    /* Attribute Default Legal */
 3648|       |    /* Enumeration */
 3649|  16.0k|    if (attr->defaultValue != NULL) {
  ------------------
  |  Branch (3649:9): [True: 3.22k, False: 12.8k]
  ------------------
 3650|  3.22k|	val = xmlValidateAttributeValueInternal(doc, attr->atype,
 3651|  3.22k|	                                        attr->defaultValue);
 3652|  3.22k|	if (val == 0) {
  ------------------
  |  Branch (3652:6): [True: 0, False: 3.22k]
  ------------------
 3653|      0|	    xmlErrValidNode(ctxt, (xmlNodePtr) attr, XML_DTD_ATTRIBUTE_DEFAULT,
 3654|      0|	       "Syntax of default value for attribute %s of %s is not valid\n",
 3655|      0|	           attr->name, attr->elem, NULL);
 3656|      0|	}
 3657|  3.22k|        ret &= val;
 3658|  3.22k|    }
 3659|       |
 3660|       |    /* ID Attribute Default */
 3661|  16.0k|    if ((attr->atype == XML_ATTRIBUTE_ID)&&
  ------------------
  |  Branch (3661:9): [True: 3.17k, False: 12.8k]
  ------------------
 3662|  3.17k|        (attr->def != XML_ATTRIBUTE_IMPLIED) &&
  ------------------
  |  Branch (3662:9): [True: 748, False: 2.42k]
  ------------------
 3663|    748|	(attr->def != XML_ATTRIBUTE_REQUIRED)) {
  ------------------
  |  Branch (3663:2): [True: 728, False: 20]
  ------------------
 3664|    728|	xmlErrValidNode(ctxt, (xmlNodePtr) attr, XML_DTD_ID_FIXED,
 3665|    728|          "ID attribute %s of %s is not valid must be #IMPLIED or #REQUIRED\n",
 3666|    728|	       attr->name, attr->elem, NULL);
 3667|    728|	ret = 0;
 3668|    728|    }
 3669|       |
 3670|       |    /* One ID per Element Type */
 3671|  16.0k|    if (attr->atype == XML_ATTRIBUTE_ID) {
  ------------------
  |  Branch (3671:9): [True: 3.17k, False: 12.8k]
  ------------------
 3672|  3.17k|        xmlElementPtr elem = NULL;
 3673|  3.17k|        const xmlChar *elemLocalName;
 3674|  3.17k|        xmlChar *elemPrefix;
 3675|  3.17k|        int nbId;
 3676|       |
 3677|  3.17k|        elemLocalName = xmlSplitQName4(attr->elem, &elemPrefix);
 3678|  3.17k|        if (elemLocalName == NULL) {
  ------------------
  |  Branch (3678:13): [True: 1, False: 3.17k]
  ------------------
 3679|      1|            xmlVErrMemory(ctxt);
 3680|      1|            return(0);
 3681|      1|        }
 3682|       |
 3683|       |	/* the trick is that we parse DtD as their own internal subset */
 3684|  3.17k|        if (doc->intSubset != NULL)
  ------------------
  |  Branch (3684:13): [True: 3.17k, False: 0]
  ------------------
 3685|  3.17k|            elem = xmlHashLookup2(doc->intSubset->elements,
 3686|  3.17k|                                  elemLocalName, elemPrefix);
 3687|  3.17k|	if (elem != NULL) {
  ------------------
  |  Branch (3687:6): [True: 2.19k, False: 976]
  ------------------
 3688|  2.19k|	    nbId = xmlScanIDAttributeDecl(ctxt, elem, 0);
 3689|  2.19k|	} else {
 3690|    976|	    xmlAttributeTablePtr table;
 3691|       |
 3692|       |	    /*
 3693|       |	     * The attribute may be declared in the internal subset and the
 3694|       |	     * element in the external subset.
 3695|       |	     */
 3696|    976|	    nbId = 0;
 3697|    976|	    if (doc->intSubset != NULL) {
  ------------------
  |  Branch (3697:10): [True: 976, False: 0]
  ------------------
 3698|    976|		table = (xmlAttributeTablePtr) doc->intSubset->attributes;
 3699|    976|		xmlHashScan3(table, NULL, NULL, attr->elem,
 3700|    976|			     xmlValidateAttributeIdCallback, &nbId);
 3701|    976|	    }
 3702|    976|	}
 3703|  3.17k|	if (nbId > 1) {
  ------------------
  |  Branch (3703:6): [True: 122, False: 3.05k]
  ------------------
 3704|       |
 3705|    122|	    xmlErrValidNodeNr(ctxt, (xmlNodePtr) attr, XML_DTD_ID_SUBSET,
 3706|    122|       "Element %s has %d ID attribute defined in the internal subset : %s\n",
 3707|    122|		   attr->elem, nbId, attr->name);
 3708|    122|            ret = 0;
 3709|  3.05k|	} else if (doc->extSubset != NULL) {
  ------------------
  |  Branch (3709:13): [True: 1.28k, False: 1.77k]
  ------------------
 3710|  1.28k|	    int extId = 0;
 3711|  1.28k|	    elem = xmlHashLookup2(doc->extSubset->elements,
 3712|  1.28k|                                  elemLocalName, elemPrefix);
 3713|  1.28k|	    if (elem != NULL) {
  ------------------
  |  Branch (3713:10): [True: 1.28k, False: 0]
  ------------------
 3714|  1.28k|		extId = xmlScanIDAttributeDecl(ctxt, elem, 0);
 3715|  1.28k|	    }
 3716|  1.28k|	    if (extId > 1) {
  ------------------
  |  Branch (3716:10): [True: 60, False: 1.22k]
  ------------------
 3717|     60|		xmlErrValidNodeNr(ctxt, (xmlNodePtr) attr, XML_DTD_ID_SUBSET,
 3718|     60|       "Element %s has %d ID attribute defined in the external subset : %s\n",
 3719|     60|		       attr->elem, extId, attr->name);
 3720|     60|                ret = 0;
 3721|  1.22k|	    } else if (extId + nbId > 1) {
  ------------------
  |  Branch (3721:17): [True: 1, False: 1.22k]
  ------------------
 3722|      1|		xmlErrValidNode(ctxt, (xmlNodePtr) attr, XML_DTD_ID_SUBSET,
 3723|      1|"Element %s has ID attributes defined in the internal and external subset : %s\n",
 3724|      1|		       attr->elem, attr->name, NULL);
 3725|      1|                ret = 0;
 3726|      1|	    }
 3727|  1.28k|	}
 3728|       |
 3729|  3.17k|        xmlFree(elemPrefix);
 3730|  3.17k|    }
 3731|       |
 3732|       |    /* Validity Constraint: Enumeration */
 3733|  16.0k|    if ((attr->defaultValue != NULL) && (attr->tree != NULL)) {
  ------------------
  |  Branch (3733:9): [True: 3.22k, False: 12.8k]
  |  Branch (3733:41): [True: 1.50k, False: 1.71k]
  ------------------
 3734|  1.50k|        xmlEnumerationPtr tree = attr->tree;
 3735|  2.08k|	while (tree != NULL) {
  ------------------
  |  Branch (3735:9): [True: 1.80k, False: 278]
  ------------------
 3736|  1.80k|	    if (xmlStrEqual(tree->name, attr->defaultValue)) break;
  ------------------
  |  Branch (3736:10): [True: 1.22k, False: 576]
  ------------------
 3737|    576|	    tree = tree->next;
 3738|    576|	}
 3739|  1.50k|	if (tree == NULL) {
  ------------------
  |  Branch (3739:6): [True: 278, False: 1.22k]
  ------------------
 3740|    278|	    xmlErrValidNode(ctxt, (xmlNodePtr) attr, XML_DTD_ATTRIBUTE_VALUE,
 3741|    278|"Default value \"%s\" for attribute %s of %s is not among the enumerated set\n",
 3742|    278|		   attr->defaultValue, attr->name, attr->elem);
 3743|    278|	    ret = 0;
 3744|    278|	}
 3745|  1.50k|    }
 3746|       |
 3747|  16.0k|    return(ret);
 3748|  16.0k|}
xmlValidateElementDecl:
 3769|  8.72k|                       xmlElement *elem) {
 3770|  8.72k|    int ret = 1;
 3771|  8.72k|    xmlElementPtr tst;
 3772|  8.72k|    const xmlChar *localName;
 3773|  8.72k|    xmlChar *prefix;
 3774|       |
 3775|  8.72k|    CHECK_DTD;
  ------------------
  |  |  418|  8.72k|   if (doc == NULL) return(0);					\
  |  |  ------------------
  |  |  |  Branch (418:8): [True: 0, False: 8.72k]
  |  |  ------------------
  |  |  419|  8.72k|   else if ((doc->intSubset == NULL) &&				\
  |  |  ------------------
  |  |  |  Branch (419:13): [True: 0, False: 8.72k]
  |  |  ------------------
  |  |  420|  8.72k|	    (doc->extSubset == NULL)) return(0)
  |  |  ------------------
  |  |  |  Branch (420:6): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 3776|       |
 3777|  8.72k|    if (elem == NULL) return(1);
  ------------------
  |  Branch (3777:9): [True: 299, False: 8.42k]
  ------------------
 3778|       |
 3779|       |    /* No Duplicate Types */
 3780|  8.42k|    if (elem->etype == XML_ELEMENT_TYPE_MIXED) {
  ------------------
  |  Branch (3780:9): [True: 3.15k, False: 5.27k]
  ------------------
 3781|  3.15k|	xmlElementContentPtr cur, next;
 3782|  3.15k|        const xmlChar *name;
 3783|       |
 3784|  3.15k|	cur = elem->content;
 3785|  18.6k|	while (cur != NULL) {
  ------------------
  |  Branch (3785:9): [True: 18.6k, False: 0]
  ------------------
 3786|  18.6k|	    if (cur->type != XML_ELEMENT_CONTENT_OR) break;
  ------------------
  |  Branch (3786:10): [True: 3.15k, False: 15.4k]
  ------------------
 3787|  15.4k|	    if (cur->c1 == NULL) break;
  ------------------
  |  Branch (3787:10): [True: 0, False: 15.4k]
  ------------------
 3788|  15.4k|	    if (cur->c1->type == XML_ELEMENT_CONTENT_ELEMENT) {
  ------------------
  |  Branch (3788:10): [True: 14.0k, False: 1.44k]
  ------------------
 3789|  14.0k|		name = cur->c1->name;
 3790|  14.0k|		next = cur->c2;
 3791|   543k|		while (next != NULL) {
  ------------------
  |  Branch (3791:10): [True: 543k, False: 0]
  ------------------
 3792|   543k|		    if (next->type == XML_ELEMENT_CONTENT_ELEMENT) {
  ------------------
  |  Branch (3792:11): [True: 14.0k, False: 529k]
  ------------------
 3793|  14.0k|		        if ((xmlStrEqual(next->name, name)) &&
  ------------------
  |  Branch (3793:15): [True: 1.38k, False: 12.6k]
  ------------------
 3794|  1.38k|			    (xmlStrEqual(next->prefix, cur->c1->prefix))) {
  ------------------
  |  Branch (3794:8): [True: 1.04k, False: 337]
  ------------------
 3795|  1.04k|			    if (cur->c1->prefix == NULL) {
  ------------------
  |  Branch (3795:12): [True: 973, False: 70]
  ------------------
 3796|    973|				xmlErrValidNode(ctxt, (xmlNodePtr) elem, XML_DTD_CONTENT_ERROR,
 3797|    973|		   "Definition of %s has duplicate references of %s\n",
 3798|    973|				       elem->name, name, NULL);
 3799|    973|			    } else {
 3800|     70|				xmlErrValidNode(ctxt, (xmlNodePtr) elem, XML_DTD_CONTENT_ERROR,
 3801|     70|		   "Definition of %s has duplicate references of %s:%s\n",
 3802|     70|				       elem->name, cur->c1->prefix, name);
 3803|     70|			    }
 3804|  1.04k|			    ret = 0;
 3805|  1.04k|			}
 3806|  14.0k|			break;
 3807|  14.0k|		    }
 3808|   529k|		    if (next->c1 == NULL) break;
  ------------------
  |  Branch (3808:11): [True: 0, False: 529k]
  ------------------
 3809|   529k|		    if (next->c1->type != XML_ELEMENT_CONTENT_ELEMENT) break;
  ------------------
  |  Branch (3809:11): [True: 0, False: 529k]
  ------------------
 3810|   529k|		    if ((xmlStrEqual(next->c1->name, name)) &&
  ------------------
  |  Branch (3810:11): [True: 172k, False: 357k]
  ------------------
 3811|   172k|		        (xmlStrEqual(next->c1->prefix, cur->c1->prefix))) {
  ------------------
  |  Branch (3811:11): [True: 112k, False: 60.5k]
  ------------------
 3812|   112k|			if (cur->c1->prefix == NULL) {
  ------------------
  |  Branch (3812:8): [True: 104k, False: 7.33k]
  ------------------
 3813|   104k|			    xmlErrValidNode(ctxt, (xmlNodePtr) elem, XML_DTD_CONTENT_ERROR,
 3814|   104k|	       "Definition of %s has duplicate references to %s\n",
 3815|   104k|				   elem->name, name, NULL);
 3816|   104k|			} else {
 3817|  7.33k|			    xmlErrValidNode(ctxt, (xmlNodePtr) elem, XML_DTD_CONTENT_ERROR,
 3818|  7.33k|	       "Definition of %s has duplicate references to %s:%s\n",
 3819|  7.33k|				   elem->name, cur->c1->prefix, name);
 3820|  7.33k|			}
 3821|   112k|			ret = 0;
 3822|   112k|		    }
 3823|   529k|		    next = next->c2;
 3824|   529k|		}
 3825|  14.0k|	    }
 3826|  15.4k|	    cur = cur->c2;
 3827|  15.4k|	}
 3828|  3.15k|    }
 3829|       |
 3830|  8.42k|    localName = xmlSplitQName4(elem->name, &prefix);
 3831|  8.42k|    if (localName == NULL) {
  ------------------
  |  Branch (3831:9): [True: 1, False: 8.42k]
  ------------------
 3832|      1|        xmlVErrMemory(ctxt);
 3833|      1|        return(0);
 3834|      1|    }
 3835|       |
 3836|       |    /* VC: Unique Element Type Declaration */
 3837|  8.42k|    if (doc->intSubset != NULL) {
  ------------------
  |  Branch (3837:9): [True: 8.42k, False: 0]
  ------------------
 3838|  8.42k|        tst = xmlHashLookup2(doc->intSubset->elements, localName, prefix);
 3839|       |
 3840|  8.42k|        if ((tst != NULL ) && (tst != elem) &&
  ------------------
  |  Branch (3840:13): [True: 6.78k, False: 1.64k]
  |  Branch (3840:31): [True: 645, False: 6.13k]
  ------------------
 3841|    645|            ((tst->prefix == elem->prefix) ||
  ------------------
  |  Branch (3841:14): [True: 641, False: 4]
  ------------------
 3842|      4|             (xmlStrEqual(tst->prefix, elem->prefix))) &&
  ------------------
  |  Branch (3842:14): [True: 1, False: 3]
  ------------------
 3843|    642|            (tst->etype != XML_ELEMENT_TYPE_UNDEFINED)) {
  ------------------
  |  Branch (3843:13): [True: 641, False: 1]
  ------------------
 3844|    641|            xmlErrValidNode(ctxt, (xmlNodePtr) elem, XML_DTD_ELEM_REDEFINED,
 3845|    641|                            "Redefinition of element %s\n",
 3846|    641|                           elem->name, NULL, NULL);
 3847|    641|            ret = 0;
 3848|    641|        }
 3849|  8.42k|    }
 3850|  8.42k|    if (doc->extSubset != NULL) {
  ------------------
  |  Branch (3850:9): [True: 1.89k, False: 6.52k]
  ------------------
 3851|  1.89k|        tst = xmlHashLookup2(doc->extSubset->elements, localName, prefix);
 3852|       |
 3853|  1.89k|        if ((tst != NULL ) && (tst != elem) &&
  ------------------
  |  Branch (3853:13): [True: 1.87k, False: 21]
  |  Branch (3853:31): [True: 3, False: 1.87k]
  ------------------
 3854|      3|            ((tst->prefix == elem->prefix) ||
  ------------------
  |  Branch (3854:14): [True: 0, False: 3]
  ------------------
 3855|      3|             (xmlStrEqual(tst->prefix, elem->prefix))) &&
  ------------------
  |  Branch (3855:14): [True: 2, False: 1]
  ------------------
 3856|      2|            (tst->etype != XML_ELEMENT_TYPE_UNDEFINED)) {
  ------------------
  |  Branch (3856:13): [True: 1, False: 1]
  ------------------
 3857|      1|            xmlErrValidNode(ctxt, (xmlNodePtr) elem, XML_DTD_ELEM_REDEFINED,
 3858|      1|                            "Redefinition of element %s\n",
 3859|      1|                           elem->name, NULL, NULL);
 3860|      1|            ret = 0;
 3861|      1|        }
 3862|  1.89k|    }
 3863|       |
 3864|  8.42k|    xmlFree(prefix);
 3865|  8.42k|    return(ret);
 3866|  8.42k|}
xmlValidateOneAttribute:
 3897|  62.2k|{
 3898|  62.2k|    xmlAttributePtr attrDecl =  NULL;
 3899|  62.2k|    const xmlChar *aprefix;
 3900|  62.2k|    int val;
 3901|  62.2k|    int ret = 1;
 3902|       |
 3903|  62.2k|    CHECK_DTD;
  ------------------
  |  |  418|  62.2k|   if (doc == NULL) return(0);					\
  |  |  ------------------
  |  |  |  Branch (418:8): [True: 0, False: 62.2k]
  |  |  ------------------
  |  |  419|  62.2k|   else if ((doc->intSubset == NULL) &&				\
  |  |  ------------------
  |  |  |  Branch (419:13): [True: 0, False: 62.2k]
  |  |  ------------------
  |  |  420|  62.2k|	    (doc->extSubset == NULL)) return(0)
  |  |  ------------------
  |  |  |  Branch (420:6): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 3904|  62.2k|    if ((elem == NULL) || (elem->name == NULL)) return(0);
  ------------------
  |  Branch (3904:9): [True: 0, False: 62.2k]
  |  Branch (3904:27): [True: 0, False: 62.2k]
  ------------------
 3905|  62.2k|    if ((attr == NULL) || (attr->name == NULL)) return(0);
  ------------------
  |  Branch (3905:9): [True: 0, False: 62.2k]
  |  Branch (3905:27): [True: 0, False: 62.2k]
  ------------------
 3906|       |
 3907|  62.2k|    aprefix = (attr->ns != NULL) ? attr->ns->prefix : NULL;
  ------------------
  |  Branch (3907:15): [True: 6.83k, False: 55.4k]
  ------------------
 3908|       |
 3909|  62.2k|    if ((elem->ns != NULL) && (elem->ns->prefix != NULL)) {
  ------------------
  |  Branch (3909:9): [True: 8.72k, False: 53.5k]
  |  Branch (3909:31): [True: 3.05k, False: 5.67k]
  ------------------
 3910|  3.05k|	xmlChar fn[50];
 3911|  3.05k|	xmlChar *fullname;
 3912|       |
 3913|  3.05k|	fullname = xmlBuildQName(elem->name, elem->ns->prefix, fn, 50);
 3914|  3.05k|	if (fullname == NULL) {
  ------------------
  |  Branch (3914:6): [True: 2, False: 3.05k]
  ------------------
 3915|      2|            xmlVErrMemory(ctxt);
 3916|      2|	    return(0);
 3917|      2|        }
 3918|  3.05k|        attrDecl = xmlGetDtdQAttrDesc(doc->intSubset, fullname,
 3919|  3.05k|                                      attr->name, aprefix);
 3920|  3.05k|        if ((attrDecl == NULL) && (doc->extSubset != NULL))
  ------------------
  |  Branch (3920:13): [True: 2.61k, False: 432]
  |  Branch (3920:35): [True: 1.28k, False: 1.33k]
  ------------------
 3921|  1.28k|            attrDecl = xmlGetDtdQAttrDesc(doc->extSubset, fullname,
 3922|  1.28k|                                          attr->name, aprefix);
 3923|  3.05k|	if ((fullname != fn) && (fullname != elem->name))
  ------------------
  |  Branch (3923:6): [True: 1.44k, False: 1.60k]
  |  Branch (3923:26): [True: 1.44k, False: 0]
  ------------------
 3924|  1.44k|	    xmlFree(fullname);
 3925|  3.05k|    }
 3926|  62.2k|    if (attrDecl == NULL) {
  ------------------
  |  Branch (3926:9): [True: 61.2k, False: 985]
  ------------------
 3927|  61.2k|        attrDecl = xmlGetDtdQAttrDesc(doc->intSubset, elem->name,
 3928|  61.2k|                                      attr->name, aprefix);
 3929|  61.2k|        if ((attrDecl == NULL) && (doc->extSubset != NULL))
  ------------------
  |  Branch (3929:13): [True: 13.0k, False: 48.2k]
  |  Branch (3929:35): [True: 3.00k, False: 10.0k]
  ------------------
 3930|  3.00k|            attrDecl = xmlGetDtdQAttrDesc(doc->extSubset, elem->name,
 3931|  3.00k|                                          attr->name, aprefix);
 3932|  61.2k|    }
 3933|       |
 3934|       |
 3935|       |    /* Validity Constraint: Attribute Value Type */
 3936|  62.2k|    if (attrDecl == NULL) {
  ------------------
  |  Branch (3936:9): [True: 11.4k, False: 50.8k]
  ------------------
 3937|  11.4k|	xmlErrValidNode(ctxt, elem, XML_DTD_UNKNOWN_ATTRIBUTE,
 3938|  11.4k|	       "No declaration for attribute %s of element %s\n",
 3939|  11.4k|	       attr->name, elem->name, NULL);
 3940|  11.4k|	return(0);
 3941|  11.4k|    }
 3942|  50.8k|    if (attr->id != NULL)
  ------------------
  |  Branch (3942:9): [True: 0, False: 50.8k]
  ------------------
 3943|      0|        xmlRemoveID(doc, attr);
 3944|  50.8k|    attr->atype = attrDecl->atype;
 3945|       |
 3946|  50.8k|    val = xmlValidateAttributeValueInternal(doc, attrDecl->atype, value);
 3947|  50.8k|    if (val == 0) {
  ------------------
  |  Branch (3947:9): [True: 7.36k, False: 43.4k]
  ------------------
 3948|  7.36k|	    xmlErrValidNode(ctxt, elem, XML_DTD_ATTRIBUTE_VALUE,
 3949|  7.36k|	   "Syntax of value for attribute %s of %s is not valid\n",
 3950|  7.36k|	       attr->name, elem->name, NULL);
 3951|  7.36k|        ret = 0;
 3952|  7.36k|    }
 3953|       |
 3954|       |    /* Validity constraint: Fixed Attribute Default */
 3955|  50.8k|    if (attrDecl->def == XML_ATTRIBUTE_FIXED) {
  ------------------
  |  Branch (3955:9): [True: 3.15k, False: 47.7k]
  ------------------
 3956|  3.15k|	if (!xmlStrEqual(value, attrDecl->defaultValue)) {
  ------------------
  |  Branch (3956:6): [True: 945, False: 2.20k]
  ------------------
 3957|    945|	    xmlErrValidNode(ctxt, elem, XML_DTD_ATTRIBUTE_DEFAULT,
 3958|    945|	   "Value for attribute %s of %s is different from default \"%s\"\n",
 3959|    945|		   attr->name, elem->name, attrDecl->defaultValue);
 3960|    945|	    ret = 0;
 3961|    945|	}
 3962|  3.15k|    }
 3963|       |
 3964|       |    /* Validity Constraint: ID uniqueness */
 3965|  50.8k|    if (attrDecl->atype == XML_ATTRIBUTE_ID &&
  ------------------
  |  Branch (3965:9): [True: 2.57k, False: 48.2k]
  ------------------
 3966|  2.57k|        (ctxt == NULL || (ctxt->flags & XML_VCTXT_IN_ENTITY) == 0)) {
  ------------------
  |  |   28|  2.57k|#define XML_VCTXT_IN_ENTITY (1u << 3)
  ------------------
  |  Branch (3966:10): [True: 0, False: 2.57k]
  |  Branch (3966:26): [True: 2.44k, False: 127]
  ------------------
 3967|  2.44k|        if (xmlAddID(ctxt, doc, value, attr) == NULL)
  ------------------
  |  Branch (3967:13): [True: 2.08k, False: 360]
  ------------------
 3968|  2.08k|	    ret = 0;
 3969|  2.44k|    }
 3970|       |
 3971|  50.8k|    if ((attrDecl->atype == XML_ATTRIBUTE_IDREF) ||
  ------------------
  |  Branch (3971:9): [True: 1.63k, False: 49.2k]
  ------------------
 3972|  49.2k|	(attrDecl->atype == XML_ATTRIBUTE_IDREFS)) {
  ------------------
  |  Branch (3972:2): [True: 1.83k, False: 47.3k]
  ------------------
 3973|  3.46k|        if (xmlAddRef(ctxt, doc, value, attr) == NULL)
  ------------------
  |  Branch (3973:13): [True: 14, False: 3.45k]
  ------------------
 3974|     14|	    ret = 0;
 3975|  3.46k|    }
 3976|       |
 3977|       |    /* Validity Constraint: Notation Attributes */
 3978|  50.8k|    if (attrDecl->atype == XML_ATTRIBUTE_NOTATION) {
  ------------------
  |  Branch (3978:9): [True: 1.66k, False: 49.1k]
  ------------------
 3979|  1.66k|        xmlEnumerationPtr tree = attrDecl->tree;
 3980|  1.66k|        xmlNotationPtr nota;
 3981|       |
 3982|       |        /* First check that the given NOTATION was declared */
 3983|  1.66k|	nota = xmlGetDtdNotationDesc(doc->intSubset, value);
 3984|  1.66k|	if (nota == NULL)
  ------------------
  |  Branch (3984:6): [True: 1.42k, False: 234]
  ------------------
 3985|  1.42k|	    nota = xmlGetDtdNotationDesc(doc->extSubset, value);
 3986|       |
 3987|  1.66k|	if (nota == NULL) {
  ------------------
  |  Branch (3987:6): [True: 1.37k, False: 291]
  ------------------
 3988|  1.37k|	    xmlErrValidNode(ctxt, elem, XML_DTD_UNKNOWN_NOTATION,
 3989|  1.37k|       "Value \"%s\" for attribute %s of %s is not a declared Notation\n",
 3990|  1.37k|		   value, attr->name, elem->name);
 3991|  1.37k|	    ret = 0;
 3992|  1.37k|        }
 3993|       |
 3994|       |	/* Second, verify that it's among the list */
 3995|  2.60k|	while (tree != NULL) {
  ------------------
  |  Branch (3995:9): [True: 1.89k, False: 710]
  ------------------
 3996|  1.89k|	    if (xmlStrEqual(tree->name, value)) break;
  ------------------
  |  Branch (3996:10): [True: 951, False: 943]
  ------------------
 3997|    943|	    tree = tree->next;
 3998|    943|	}
 3999|  1.66k|	if (tree == NULL) {
  ------------------
  |  Branch (3999:6): [True: 710, False: 951]
  ------------------
 4000|    710|	    xmlErrValidNode(ctxt, elem, XML_DTD_NOTATION_VALUE,
 4001|    710|"Value \"%s\" for attribute %s of %s is not among the enumerated notations\n",
 4002|    710|		   value, attr->name, elem->name);
 4003|    710|	    ret = 0;
 4004|    710|	}
 4005|  1.66k|    }
 4006|       |
 4007|       |    /* Validity Constraint: Enumeration */
 4008|  50.8k|    if (attrDecl->atype == XML_ATTRIBUTE_ENUMERATION) {
  ------------------
  |  Branch (4008:9): [True: 38.7k, False: 12.0k]
  ------------------
 4009|  38.7k|        xmlEnumerationPtr tree = attrDecl->tree;
 4010|  52.1k|	while (tree != NULL) {
  ------------------
  |  Branch (4010:9): [True: 39.6k, False: 12.5k]
  ------------------
 4011|  39.6k|	    if (xmlStrEqual(tree->name, value)) break;
  ------------------
  |  Branch (4011:10): [True: 26.2k, False: 13.3k]
  ------------------
 4012|  13.3k|	    tree = tree->next;
 4013|  13.3k|	}
 4014|  38.7k|	if (tree == NULL) {
  ------------------
  |  Branch (4014:6): [True: 12.5k, False: 26.2k]
  ------------------
 4015|  12.5k|	    xmlErrValidNode(ctxt, elem, XML_DTD_ATTRIBUTE_VALUE,
 4016|  12.5k|       "Value \"%s\" for attribute %s of %s is not among the enumerated set\n",
 4017|  12.5k|		   value, attr->name, elem->name);
 4018|  12.5k|	    ret = 0;
 4019|  12.5k|	}
 4020|  38.7k|    }
 4021|       |
 4022|       |    /* Fixed Attribute Default */
 4023|  50.8k|    if ((attrDecl->def == XML_ATTRIBUTE_FIXED) &&
  ------------------
  |  Branch (4023:9): [True: 3.15k, False: 47.7k]
  ------------------
 4024|  3.15k|        (!xmlStrEqual(attrDecl->defaultValue, value))) {
  ------------------
  |  Branch (4024:9): [True: 945, False: 2.20k]
  ------------------
 4025|    945|	xmlErrValidNode(ctxt, elem, XML_DTD_ATTRIBUTE_VALUE,
 4026|    945|	   "Value for attribute %s of %s must be \"%s\"\n",
 4027|    945|	       attr->name, elem->name, attrDecl->defaultValue);
 4028|    945|        ret = 0;
 4029|    945|    }
 4030|       |
 4031|       |    /* Extra check for the attribute value */
 4032|  50.8k|    ret &= xmlValidateAttributeValue2(ctxt, doc, attr->name,
 4033|  50.8k|				      attrDecl->atype, value);
 4034|       |
 4035|  50.8k|    return(ret);
 4036|  62.2k|}
xmlValidateOneNamespace:
 4067|  13.3k|xmlNode *elem, const xmlChar *prefix, xmlNs *ns, const xmlChar *value) {
 4068|       |    /* xmlElementPtr elemDecl; */
 4069|  13.3k|    xmlAttributePtr attrDecl =  NULL;
 4070|  13.3k|    int val;
 4071|  13.3k|    int ret = 1;
 4072|       |
 4073|  13.3k|    CHECK_DTD;
  ------------------
  |  |  418|  13.3k|   if (doc == NULL) return(0);					\
  |  |  ------------------
  |  |  |  Branch (418:8): [True: 0, False: 13.3k]
  |  |  ------------------
  |  |  419|  13.3k|   else if ((doc->intSubset == NULL) &&				\
  |  |  ------------------
  |  |  |  Branch (419:13): [True: 0, False: 13.3k]
  |  |  ------------------
  |  |  420|  13.3k|	    (doc->extSubset == NULL)) return(0)
  |  |  ------------------
  |  |  |  Branch (420:6): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 4074|  13.3k|    if ((elem == NULL) || (elem->name == NULL)) return(0);
  ------------------
  |  Branch (4074:9): [True: 0, False: 13.3k]
  |  Branch (4074:27): [True: 0, False: 13.3k]
  ------------------
 4075|  13.3k|    if ((ns == NULL) || (ns->href == NULL)) return(0);
  ------------------
  |  Branch (4075:9): [True: 0, False: 13.3k]
  |  Branch (4075:25): [True: 0, False: 13.3k]
  ------------------
 4076|       |
 4077|  13.3k|    if (prefix != NULL) {
  ------------------
  |  Branch (4077:9): [True: 5.94k, False: 7.39k]
  ------------------
 4078|  5.94k|	xmlChar fn[50];
 4079|  5.94k|	xmlChar *fullname;
 4080|       |
 4081|  5.94k|	fullname = xmlBuildQName(elem->name, prefix, fn, 50);
 4082|  5.94k|	if (fullname == NULL) {
  ------------------
  |  Branch (4082:6): [True: 1, False: 5.94k]
  ------------------
 4083|      1|	    xmlVErrMemory(ctxt);
 4084|      1|	    return(0);
 4085|      1|	}
 4086|  5.94k|	if (ns->prefix != NULL) {
  ------------------
  |  Branch (4086:6): [True: 2.84k, False: 3.09k]
  ------------------
 4087|  2.84k|	    attrDecl = xmlGetDtdQAttrDesc(doc->intSubset, fullname,
 4088|  2.84k|		                          ns->prefix, BAD_CAST "xmlns");
  ------------------
  |  |   34|  2.84k|#define BAD_CAST (xmlChar *)
  ------------------
 4089|  2.84k|	    if ((attrDecl == NULL) && (doc->extSubset != NULL))
  ------------------
  |  Branch (4089:10): [True: 2.49k, False: 356]
  |  Branch (4089:32): [True: 1.29k, False: 1.19k]
  ------------------
 4090|  1.29k|		attrDecl = xmlGetDtdQAttrDesc(doc->extSubset, fullname,
 4091|  1.29k|					  ns->prefix, BAD_CAST "xmlns");
  ------------------
  |  |   34|  1.29k|#define BAD_CAST (xmlChar *)
  ------------------
 4092|  3.09k|	} else {
 4093|  3.09k|	    attrDecl = xmlGetDtdQAttrDesc(doc->intSubset, fullname,
 4094|  3.09k|                                          BAD_CAST "xmlns", NULL);
  ------------------
  |  |   34|  3.09k|#define BAD_CAST (xmlChar *)
  ------------------
 4095|  3.09k|	    if ((attrDecl == NULL) && (doc->extSubset != NULL))
  ------------------
  |  Branch (4095:10): [True: 2.89k, False: 200]
  |  Branch (4095:32): [True: 2.57k, False: 322]
  ------------------
 4096|  2.57k|		attrDecl = xmlGetDtdQAttrDesc(doc->extSubset, fullname,
 4097|  2.57k|                                              BAD_CAST "xmlns", NULL);
  ------------------
  |  |   34|  2.57k|#define BAD_CAST (xmlChar *)
  ------------------
 4098|  3.09k|	}
 4099|  5.94k|	if ((fullname != fn) && (fullname != elem->name))
  ------------------
  |  Branch (4099:6): [True: 3.10k, False: 2.84k]
  |  Branch (4099:26): [True: 3.10k, False: 0]
  ------------------
 4100|  3.10k|	    xmlFree(fullname);
 4101|  5.94k|    }
 4102|  13.3k|    if (attrDecl == NULL) {
  ------------------
  |  Branch (4102:9): [True: 12.7k, False: 556]
  ------------------
 4103|  12.7k|	if (ns->prefix != NULL) {
  ------------------
  |  Branch (4103:6): [True: 7.12k, False: 5.65k]
  ------------------
 4104|  7.12k|	    attrDecl = xmlGetDtdQAttrDesc(doc->intSubset, elem->name,
 4105|  7.12k|		                          ns->prefix, BAD_CAST "xmlns");
  ------------------
  |  |   34|  7.12k|#define BAD_CAST (xmlChar *)
  ------------------
 4106|  7.12k|	    if ((attrDecl == NULL) && (doc->extSubset != NULL))
  ------------------
  |  Branch (4106:10): [True: 3.39k, False: 3.73k]
  |  Branch (4106:32): [True: 2.13k, False: 1.25k]
  ------------------
 4107|  2.13k|		attrDecl = xmlGetDtdQAttrDesc(doc->extSubset, elem->name,
 4108|  2.13k|					      ns->prefix, BAD_CAST "xmlns");
  ------------------
  |  |   34|  2.13k|#define BAD_CAST (xmlChar *)
  ------------------
 4109|  7.12k|	} else {
 4110|  5.65k|	    attrDecl = xmlGetDtdQAttrDesc(doc->intSubset, elem->name,
 4111|  5.65k|                                          BAD_CAST "xmlns", NULL);
  ------------------
  |  |   34|  5.65k|#define BAD_CAST (xmlChar *)
  ------------------
 4112|  5.65k|	    if ((attrDecl == NULL) && (doc->extSubset != NULL))
  ------------------
  |  Branch (4112:10): [True: 3.37k, False: 2.28k]
  |  Branch (4112:32): [True: 2.88k, False: 491]
  ------------------
 4113|  2.88k|		attrDecl = xmlGetDtdQAttrDesc(doc->extSubset, elem->name,
 4114|  2.88k|                                              BAD_CAST "xmlns", NULL);
  ------------------
  |  |   34|  2.88k|#define BAD_CAST (xmlChar *)
  ------------------
 4115|  5.65k|	}
 4116|  12.7k|    }
 4117|       |
 4118|       |
 4119|       |    /* Validity Constraint: Attribute Value Type */
 4120|  13.3k|    if (attrDecl == NULL) {
  ------------------
  |  Branch (4120:9): [True: 5.90k, False: 7.43k]
  ------------------
 4121|  5.90k|	if (ns->prefix != NULL) {
  ------------------
  |  Branch (4121:6): [True: 2.57k, False: 3.33k]
  ------------------
 4122|  2.57k|	    xmlErrValidNode(ctxt, elem, XML_DTD_UNKNOWN_ATTRIBUTE,
 4123|  2.57k|		   "No declaration for attribute xmlns:%s of element %s\n",
 4124|  2.57k|		   ns->prefix, elem->name, NULL);
 4125|  3.33k|	} else {
 4126|  3.33k|	    xmlErrValidNode(ctxt, elem, XML_DTD_UNKNOWN_ATTRIBUTE,
 4127|  3.33k|		   "No declaration for attribute xmlns of element %s\n",
 4128|  3.33k|		   elem->name, NULL, NULL);
 4129|  3.33k|	}
 4130|  5.90k|	return(0);
 4131|  5.90k|    }
 4132|       |
 4133|  7.43k|    val = xmlValidateAttributeValueInternal(doc, attrDecl->atype, value);
 4134|  7.43k|    if (val == 0) {
  ------------------
  |  Branch (4134:9): [True: 3.06k, False: 4.37k]
  ------------------
 4135|  3.06k|	if (ns->prefix != NULL) {
  ------------------
  |  Branch (4135:6): [True: 1.92k, False: 1.14k]
  ------------------
 4136|  1.92k|	    xmlErrValidNode(ctxt, elem, XML_DTD_INVALID_DEFAULT,
 4137|  1.92k|	       "Syntax of value for attribute xmlns:%s of %s is not valid\n",
 4138|  1.92k|		   ns->prefix, elem->name, NULL);
 4139|  1.92k|	} else {
 4140|  1.14k|	    xmlErrValidNode(ctxt, elem, XML_DTD_INVALID_DEFAULT,
 4141|  1.14k|	       "Syntax of value for attribute xmlns of %s is not valid\n",
 4142|  1.14k|		   elem->name, NULL, NULL);
 4143|  1.14k|	}
 4144|  3.06k|        ret = 0;
 4145|  3.06k|    }
 4146|       |
 4147|       |    /* Validity constraint: Fixed Attribute Default */
 4148|  7.43k|    if (attrDecl->def == XML_ATTRIBUTE_FIXED) {
  ------------------
  |  Branch (4148:9): [True: 1.19k, False: 6.24k]
  ------------------
 4149|  1.19k|	if (!xmlStrEqual(value, attrDecl->defaultValue)) {
  ------------------
  |  Branch (4149:6): [True: 237, False: 955]
  ------------------
 4150|    237|	    if (ns->prefix != NULL) {
  ------------------
  |  Branch (4150:10): [True: 73, False: 164]
  ------------------
 4151|     73|		xmlErrValidNode(ctxt, elem, XML_DTD_ATTRIBUTE_DEFAULT,
 4152|     73|       "Value for attribute xmlns:%s of %s is different from default \"%s\"\n",
 4153|     73|		       ns->prefix, elem->name, attrDecl->defaultValue);
 4154|    164|	    } else {
 4155|    164|		xmlErrValidNode(ctxt, elem, XML_DTD_ATTRIBUTE_DEFAULT,
 4156|    164|       "Value for attribute xmlns of %s is different from default \"%s\"\n",
 4157|    164|		       elem->name, attrDecl->defaultValue, NULL);
 4158|    164|	    }
 4159|    237|	    ret = 0;
 4160|    237|	}
 4161|  1.19k|    }
 4162|       |
 4163|       |    /* Validity Constraint: Notation Attributes */
 4164|  7.43k|    if (attrDecl->atype == XML_ATTRIBUTE_NOTATION) {
  ------------------
  |  Branch (4164:9): [True: 1.19k, False: 6.24k]
  ------------------
 4165|  1.19k|        xmlEnumerationPtr tree = attrDecl->tree;
 4166|  1.19k|        xmlNotationPtr nota;
 4167|       |
 4168|       |        /* First check that the given NOTATION was declared */
 4169|  1.19k|	nota = xmlGetDtdNotationDesc(doc->intSubset, value);
 4170|  1.19k|	if (nota == NULL)
  ------------------
  |  Branch (4170:6): [True: 963, False: 227]
  ------------------
 4171|    963|	    nota = xmlGetDtdNotationDesc(doc->extSubset, value);
 4172|       |
 4173|  1.19k|	if (nota == NULL) {
  ------------------
  |  Branch (4173:6): [True: 796, False: 394]
  ------------------
 4174|    796|	    if (ns->prefix != NULL) {
  ------------------
  |  Branch (4174:10): [True: 658, False: 138]
  ------------------
 4175|    658|		xmlErrValidNode(ctxt, elem, XML_DTD_UNKNOWN_NOTATION,
 4176|    658|       "Value \"%s\" for attribute xmlns:%s of %s is not a declared Notation\n",
 4177|    658|		       value, ns->prefix, elem->name);
 4178|    658|	    } else {
 4179|    138|		xmlErrValidNode(ctxt, elem, XML_DTD_UNKNOWN_NOTATION,
 4180|    138|       "Value \"%s\" for attribute xmlns of %s is not a declared Notation\n",
 4181|    138|		       value, elem->name, NULL);
 4182|    138|	    }
 4183|    796|	    ret = 0;
 4184|    796|        }
 4185|       |
 4186|       |	/* Second, verify that it's among the list */
 4187|  3.68k|	while (tree != NULL) {
  ------------------
  |  Branch (4187:9): [True: 2.77k, False: 916]
  ------------------
 4188|  2.77k|	    if (xmlStrEqual(tree->name, value)) break;
  ------------------
  |  Branch (4188:10): [True: 274, False: 2.49k]
  ------------------
 4189|  2.49k|	    tree = tree->next;
 4190|  2.49k|	}
 4191|  1.19k|	if (tree == NULL) {
  ------------------
  |  Branch (4191:6): [True: 916, False: 274]
  ------------------
 4192|    916|	    if (ns->prefix != NULL) {
  ------------------
  |  Branch (4192:10): [True: 778, False: 138]
  ------------------
 4193|    778|		xmlErrValidNode(ctxt, elem, XML_DTD_NOTATION_VALUE,
 4194|    778|"Value \"%s\" for attribute xmlns:%s of %s is not among the enumerated notations\n",
 4195|    778|		       value, ns->prefix, elem->name);
 4196|    778|	    } else {
 4197|    138|		xmlErrValidNode(ctxt, elem, XML_DTD_NOTATION_VALUE,
 4198|    138|"Value \"%s\" for attribute xmlns of %s is not among the enumerated notations\n",
 4199|    138|		       value, elem->name, NULL);
 4200|    138|	    }
 4201|    916|	    ret = 0;
 4202|    916|	}
 4203|  1.19k|    }
 4204|       |
 4205|       |    /* Validity Constraint: Enumeration */
 4206|  7.43k|    if (attrDecl->atype == XML_ATTRIBUTE_ENUMERATION) {
  ------------------
  |  Branch (4206:9): [True: 3.64k, False: 3.78k]
  ------------------
 4207|  3.64k|        xmlEnumerationPtr tree = attrDecl->tree;
 4208|  7.89k|	while (tree != NULL) {
  ------------------
  |  Branch (4208:9): [True: 4.67k, False: 3.22k]
  ------------------
 4209|  4.67k|	    if (xmlStrEqual(tree->name, value)) break;
  ------------------
  |  Branch (4209:10): [True: 428, False: 4.24k]
  ------------------
 4210|  4.24k|	    tree = tree->next;
 4211|  4.24k|	}
 4212|  3.64k|	if (tree == NULL) {
  ------------------
  |  Branch (4212:6): [True: 3.22k, False: 428]
  ------------------
 4213|  3.22k|	    if (ns->prefix != NULL) {
  ------------------
  |  Branch (4213:10): [True: 2.39k, False: 831]
  ------------------
 4214|  2.39k|		xmlErrValidNode(ctxt, elem, XML_DTD_ATTRIBUTE_VALUE,
 4215|  2.39k|"Value \"%s\" for attribute xmlns:%s of %s is not among the enumerated set\n",
 4216|  2.39k|		       value, ns->prefix, elem->name);
 4217|  2.39k|	    } else {
 4218|    831|		xmlErrValidNode(ctxt, elem, XML_DTD_ATTRIBUTE_VALUE,
 4219|    831|"Value \"%s\" for attribute xmlns of %s is not among the enumerated set\n",
 4220|    831|		       value, elem->name, NULL);
 4221|    831|	    }
 4222|  3.22k|	    ret = 0;
 4223|  3.22k|	}
 4224|  3.64k|    }
 4225|       |
 4226|       |    /* Fixed Attribute Default */
 4227|  7.43k|    if ((attrDecl->def == XML_ATTRIBUTE_FIXED) &&
  ------------------
  |  Branch (4227:9): [True: 1.19k, False: 6.24k]
  ------------------
 4228|  1.19k|        (!xmlStrEqual(attrDecl->defaultValue, value))) {
  ------------------
  |  Branch (4228:9): [True: 237, False: 955]
  ------------------
 4229|    237|	if (ns->prefix != NULL) {
  ------------------
  |  Branch (4229:6): [True: 73, False: 164]
  ------------------
 4230|     73|	    xmlErrValidNode(ctxt, elem, XML_DTD_ELEM_NAMESPACE,
 4231|     73|		   "Value for attribute xmlns:%s of %s must be \"%s\"\n",
 4232|     73|		   ns->prefix, elem->name, attrDecl->defaultValue);
 4233|    164|	} else {
 4234|    164|	    xmlErrValidNode(ctxt, elem, XML_DTD_ELEM_NAMESPACE,
 4235|    164|		   "Value for attribute xmlns of %s must be \"%s\"\n",
 4236|    164|		   elem->name, attrDecl->defaultValue, NULL);
 4237|    164|	}
 4238|    237|        ret = 0;
 4239|    237|    }
 4240|       |
 4241|       |    /* Extra check for the attribute value */
 4242|  7.43k|    if (ns->prefix != NULL) {
  ------------------
  |  Branch (4242:9): [True: 4.90k, False: 2.52k]
  ------------------
 4243|  4.90k|	ret &= xmlValidateAttributeValue2(ctxt, doc, ns->prefix,
 4244|  4.90k|					  attrDecl->atype, value);
 4245|  4.90k|    } else {
 4246|  2.52k|	ret &= xmlValidateAttributeValue2(ctxt, doc, BAD_CAST "xmlns",
  ------------------
  |  |   34|  2.52k|#define BAD_CAST (xmlChar *)
  ------------------
 4247|  2.52k|					  attrDecl->atype, value);
 4248|  2.52k|    }
 4249|       |
 4250|  7.43k|    return(ret);
 4251|  13.3k|}
xmlValidatePushElement:
 5222|   129k|                       xmlNode *elem, const xmlChar *qname) {
 5223|   129k|    int ret = 1;
 5224|   129k|    xmlElementPtr eDecl;
 5225|   129k|    int extsubset = 0;
 5226|       |
 5227|   129k|    if (ctxt == NULL)
  ------------------
  |  Branch (5227:9): [True: 0, False: 129k]
  ------------------
 5228|      0|        return(0);
 5229|       |
 5230|   129k|    if ((ctxt->vstateNr > 0) && (ctxt->vstate != NULL)) {
  ------------------
  |  Branch (5230:9): [True: 125k, False: 3.10k]
  |  Branch (5230:33): [True: 125k, False: 0]
  ------------------
 5231|   125k|	xmlValidStatePtr state = ctxt->vstate;
 5232|   125k|	xmlElementPtr elemDecl;
 5233|       |
 5234|       |	/*
 5235|       |	 * Check the new element against the content model of the new elem.
 5236|       |	 */
 5237|   125k|	if (state->elemDecl != NULL) {
  ------------------
  |  Branch (5237:6): [True: 82.7k, False: 43.1k]
  ------------------
 5238|  82.7k|	    elemDecl = state->elemDecl;
 5239|       |
 5240|  82.7k|	    switch(elemDecl->etype) {
  ------------------
  |  Branch (5240:13): [True: 82.7k, False: 0]
  ------------------
 5241|  2.93k|		case XML_ELEMENT_TYPE_UNDEFINED:
  ------------------
  |  Branch (5241:3): [True: 2.93k, False: 79.8k]
  ------------------
 5242|  2.93k|		    ret = 0;
 5243|  2.93k|		    break;
 5244|    319|		case XML_ELEMENT_TYPE_EMPTY:
  ------------------
  |  Branch (5244:3): [True: 319, False: 82.4k]
  ------------------
 5245|    319|		    xmlErrValidNode(ctxt, state->node,
 5246|    319|				    XML_DTD_NOT_EMPTY,
 5247|    319|	       "Element %s was declared EMPTY this one has content\n",
 5248|    319|			   state->node->name, NULL, NULL);
 5249|    319|		    ret = 0;
 5250|    319|		    break;
 5251|    263|		case XML_ELEMENT_TYPE_ANY:
  ------------------
  |  Branch (5251:3): [True: 263, False: 82.5k]
  ------------------
 5252|       |		    /* I don't think anything is required then */
 5253|    263|		    break;
 5254|  4.36k|		case XML_ELEMENT_TYPE_MIXED:
  ------------------
  |  Branch (5254:3): [True: 4.36k, False: 78.4k]
  ------------------
 5255|       |		    /* simple case of declared as #PCDATA */
 5256|  4.36k|		    if ((elemDecl->content != NULL) &&
  ------------------
  |  Branch (5256:11): [True: 4.36k, False: 0]
  ------------------
 5257|  4.36k|			(elemDecl->content->type ==
  ------------------
  |  Branch (5257:4): [True: 1.29k, False: 3.06k]
  ------------------
 5258|  4.36k|			 XML_ELEMENT_CONTENT_PCDATA)) {
 5259|  1.29k|			xmlErrValidNode(ctxt, state->node,
 5260|  1.29k|					XML_DTD_NOT_PCDATA,
 5261|  1.29k|	       "Element %s was declared #PCDATA but contains non text nodes\n",
 5262|  1.29k|				state->node->name, NULL, NULL);
 5263|  1.29k|			ret = 0;
 5264|  3.06k|		    } else {
 5265|  3.06k|			ret = xmlValidateCheckMixed(ctxt, elemDecl->content,
 5266|  3.06k|				                    qname);
 5267|  3.06k|			if (ret != 1) {
  ------------------
  |  Branch (5267:8): [True: 1.99k, False: 1.07k]
  ------------------
 5268|  1.99k|			    xmlErrValidNode(ctxt, state->node,
 5269|  1.99k|					    XML_DTD_INVALID_CHILD,
 5270|  1.99k|	       "Element %s is not declared in %s list of possible children\n",
 5271|  1.99k|				    qname, state->node->name, NULL);
 5272|  1.99k|			}
 5273|  3.06k|		    }
 5274|  4.36k|		    break;
 5275|  74.8k|		case XML_ELEMENT_TYPE_ELEMENT:
  ------------------
  |  Branch (5275:3): [True: 74.8k, False: 7.87k]
  ------------------
 5276|       |		    /*
 5277|       |		     * TODO:
 5278|       |		     * VC: Standalone Document Declaration
 5279|       |		     *     - element types with element content, if white space
 5280|       |		     *       occurs directly within any instance of those types.
 5281|       |		     */
 5282|  74.8k|		    if (state->exec != NULL) {
  ------------------
  |  Branch (5282:11): [True: 74.3k, False: 557]
  ------------------
 5283|  74.3k|			ret = xmlRegExecPushString(state->exec, qname, NULL);
 5284|  74.3k|                        if (ret == XML_REGEXP_OUT_OF_MEMORY) {
  ------------------
  |  |   14|  74.3k|#define XML_REGEXP_OUT_OF_MEMORY    (-5)
  ------------------
  |  Branch (5284:29): [True: 327, False: 74.0k]
  ------------------
 5285|    327|                            xmlVErrMemory(ctxt);
 5286|    327|                            return(0);
 5287|    327|                        }
 5288|  74.0k|			if (ret < 0) {
  ------------------
  |  Branch (5288:8): [True: 11.5k, False: 62.4k]
  ------------------
 5289|  11.5k|			    xmlErrValidNode(ctxt, state->node,
 5290|  11.5k|					    XML_DTD_CONTENT_MODEL,
 5291|  11.5k|	       "Element %s content does not follow the DTD, Misplaced %s\n",
 5292|  11.5k|				   state->node->name, qname, NULL);
 5293|  11.5k|			    ret = 0;
 5294|  62.4k|			} else {
 5295|  62.4k|			    ret = 1;
 5296|  62.4k|			}
 5297|  74.0k|		    }
 5298|  74.5k|		    break;
 5299|  82.7k|	    }
 5300|  82.7k|	}
 5301|   125k|    }
 5302|   128k|    eDecl = xmlValidGetElemDecl(ctxt, doc, elem, &extsubset);
 5303|   128k|    vstateVPush(ctxt, eDecl, elem);
 5304|   128k|    return(ret);
 5305|   129k|}
xmlValidatePushCData:
 5318|  48.7k|xmlValidatePushCData(xmlValidCtxt *ctxt, const xmlChar *data, int len) {
 5319|  48.7k|    int ret = 1;
 5320|       |
 5321|  48.7k|    if (ctxt == NULL)
  ------------------
  |  Branch (5321:9): [True: 0, False: 48.7k]
  ------------------
 5322|      0|        return(0);
 5323|  48.7k|    if (len <= 0)
  ------------------
  |  Branch (5323:9): [True: 94, False: 48.6k]
  ------------------
 5324|     94|	return(ret);
 5325|  48.6k|    if ((ctxt->vstateNr > 0) && (ctxt->vstate != NULL)) {
  ------------------
  |  Branch (5325:9): [True: 48.1k, False: 455]
  |  Branch (5325:33): [True: 48.1k, False: 0]
  ------------------
 5326|  48.1k|	xmlValidStatePtr state = ctxt->vstate;
 5327|  48.1k|	xmlElementPtr elemDecl;
 5328|       |
 5329|       |	/*
 5330|       |	 * Check the new element against the content model of the new elem.
 5331|       |	 */
 5332|  48.1k|	if (state->elemDecl != NULL) {
  ------------------
  |  Branch (5332:6): [True: 14.6k, False: 33.4k]
  ------------------
 5333|  14.6k|	    elemDecl = state->elemDecl;
 5334|       |
 5335|  14.6k|	    switch(elemDecl->etype) {
  ------------------
  |  Branch (5335:13): [True: 14.6k, False: 0]
  ------------------
 5336|  1.10k|		case XML_ELEMENT_TYPE_UNDEFINED:
  ------------------
  |  Branch (5336:3): [True: 1.10k, False: 13.5k]
  ------------------
 5337|  1.10k|		    ret = 0;
 5338|  1.10k|		    break;
 5339|    314|		case XML_ELEMENT_TYPE_EMPTY:
  ------------------
  |  Branch (5339:3): [True: 314, False: 14.3k]
  ------------------
 5340|    314|		    xmlErrValidNode(ctxt, state->node,
 5341|    314|				    XML_DTD_NOT_EMPTY,
 5342|    314|	       "Element %s was declared EMPTY this one has content\n",
 5343|    314|			   state->node->name, NULL, NULL);
 5344|    314|		    ret = 0;
 5345|    314|		    break;
 5346|    106|		case XML_ELEMENT_TYPE_ANY:
  ------------------
  |  Branch (5346:3): [True: 106, False: 14.5k]
  ------------------
 5347|    106|		    break;
 5348|  8.40k|		case XML_ELEMENT_TYPE_MIXED:
  ------------------
  |  Branch (5348:3): [True: 8.40k, False: 6.26k]
  ------------------
 5349|  8.40k|		    break;
 5350|  4.74k|		case XML_ELEMENT_TYPE_ELEMENT: {
  ------------------
  |  Branch (5350:3): [True: 4.74k, False: 9.92k]
  ------------------
 5351|  4.74k|                    int i;
 5352|       |
 5353|  7.91k|                    for (i = 0;i < len;i++) {
  ------------------
  |  Branch (5353:32): [True: 6.60k, False: 1.30k]
  ------------------
 5354|  6.60k|                        if (!IS_BLANK_CH(data[i])) {
  ------------------
  |  |  137|  6.60k|#define IS_BLANK_CH(c)  xmlIsBlank_ch(c)
  |  |  ------------------
  |  |  |  |   90|  6.60k|#define xmlIsBlank_ch(c)	(((c) == 0x20) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (90:27): [True: 1.10k, False: 5.50k]
  |  |  |  |  ------------------
  |  |  |  |   91|  6.60k|				 ((0x9 <= (c)) && ((c) <= 0xa)) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (91:7): [True: 5.50k, False: 0]
  |  |  |  |  |  Branch (91:23): [True: 1.20k, False: 4.29k]
  |  |  |  |  ------------------
  |  |  |  |   92|  6.60k|				 ((c) == 0xd))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (92:6): [True: 856, False: 3.44k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 5355|  3.44k|                            xmlErrValidNode(ctxt, state->node,
 5356|  3.44k|                                            XML_DTD_CONTENT_MODEL,
 5357|  3.44k|       "Element %s content does not follow the DTD, Text not allowed\n",
 5358|  3.44k|                                   state->node->name, NULL, NULL);
 5359|  3.44k|                            ret = 0;
 5360|  3.44k|                            goto done;
 5361|  3.44k|                        }
 5362|  6.60k|                    }
 5363|       |                    /*
 5364|       |                     * TODO:
 5365|       |                     * VC: Standalone Document Declaration
 5366|       |                     *  element types with element content, if white space
 5367|       |                     *  occurs directly within any instance of those types.
 5368|       |                     */
 5369|  1.30k|                    break;
 5370|  4.74k|                }
 5371|  14.6k|	    }
 5372|  14.6k|	}
 5373|  48.1k|    }
 5374|  48.6k|done:
 5375|  48.6k|    return(ret);
 5376|  48.6k|}
xmlValidatePopElement:
 5392|   129k|		      const xmlChar *qname ATTRIBUTE_UNUSED) {
 5393|   129k|    int ret = 1;
 5394|       |
 5395|   129k|    if (ctxt == NULL)
  ------------------
  |  Branch (5395:9): [True: 0, False: 129k]
  ------------------
 5396|      0|        return(0);
 5397|       |
 5398|   129k|    if ((ctxt->vstateNr > 0) && (ctxt->vstate != NULL)) {
  ------------------
  |  Branch (5398:9): [True: 128k, False: 424]
  |  Branch (5398:33): [True: 128k, False: 0]
  ------------------
 5399|   128k|	xmlValidStatePtr state = ctxt->vstate;
 5400|   128k|	xmlElementPtr elemDecl;
 5401|       |
 5402|       |	/*
 5403|       |	 * Check the new element against the content model of the new elem.
 5404|       |	 */
 5405|   128k|	if (state->elemDecl != NULL) {
  ------------------
  |  Branch (5405:6): [True: 29.2k, False: 99.2k]
  ------------------
 5406|  29.2k|	    elemDecl = state->elemDecl;
 5407|       |
 5408|  29.2k|	    if (elemDecl->etype == XML_ELEMENT_TYPE_ELEMENT) {
  ------------------
  |  Branch (5408:10): [True: 12.9k, False: 16.3k]
  ------------------
 5409|  12.9k|		if (state->exec != NULL) {
  ------------------
  |  Branch (5409:7): [True: 12.3k, False: 622]
  ------------------
 5410|  12.3k|		    ret = xmlRegExecPushString(state->exec, NULL, NULL);
 5411|  12.3k|		    if (ret <= 0) {
  ------------------
  |  Branch (5411:11): [True: 10.4k, False: 1.87k]
  ------------------
 5412|  10.4k|                        if (ret == XML_REGEXP_OUT_OF_MEMORY)
  ------------------
  |  |   14|  10.4k|#define XML_REGEXP_OUT_OF_MEMORY    (-5)
  ------------------
  |  Branch (5412:29): [True: 30, False: 10.4k]
  ------------------
 5413|     30|                            xmlVErrMemory(ctxt);
 5414|  10.4k|                        else
 5415|  10.4k|			    xmlErrValidNode(ctxt, state->node,
 5416|  10.4k|			                    XML_DTD_CONTENT_MODEL,
 5417|  10.4k|	   "Element %s content does not follow the DTD, Expecting more children\n",
 5418|  10.4k|			       state->node->name, NULL,NULL);
 5419|  10.4k|			ret = 0;
 5420|  10.4k|		    } else {
 5421|       |			/*
 5422|       |			 * previous validation errors should not generate
 5423|       |			 * a new one here
 5424|       |			 */
 5425|  1.87k|			ret = 1;
 5426|  1.87k|		    }
 5427|  12.3k|		}
 5428|  12.9k|	    }
 5429|  29.2k|	}
 5430|   128k|	vstateVPop(ctxt);
 5431|   128k|    }
 5432|   129k|    return(ret);
 5433|   129k|}
xmlValidateOneElement:
 5458|   109k|                      xmlNode *elem) {
 5459|   109k|    xmlElementPtr elemDecl = NULL;
 5460|   109k|    xmlElementContentPtr cont;
 5461|   109k|    xmlAttributePtr attr;
 5462|   109k|    xmlNodePtr child;
 5463|   109k|    int ret = 1, tmp;
 5464|   109k|    const xmlChar *name;
 5465|   109k|    int extsubset = 0;
 5466|       |
 5467|   109k|    CHECK_DTD;
  ------------------
  |  |  418|   109k|   if (doc == NULL) return(0);					\
  |  |  ------------------
  |  |  |  Branch (418:8): [True: 0, False: 109k]
  |  |  ------------------
  |  |  419|   109k|   else if ((doc->intSubset == NULL) &&				\
  |  |  ------------------
  |  |  |  Branch (419:13): [True: 0, False: 109k]
  |  |  ------------------
  |  |  420|   109k|	    (doc->extSubset == NULL)) return(0)
  |  |  ------------------
  |  |  |  Branch (420:6): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 5468|       |
 5469|   109k|    if (elem == NULL) return(0);
  ------------------
  |  Branch (5469:9): [True: 0, False: 109k]
  ------------------
 5470|   109k|    switch (elem->type) {
 5471|      0|        case XML_TEXT_NODE:
  ------------------
  |  Branch (5471:9): [True: 0, False: 109k]
  ------------------
 5472|      0|        case XML_CDATA_SECTION_NODE:
  ------------------
  |  Branch (5472:9): [True: 0, False: 109k]
  ------------------
 5473|      0|        case XML_ENTITY_REF_NODE:
  ------------------
  |  Branch (5473:9): [True: 0, False: 109k]
  ------------------
 5474|      0|        case XML_PI_NODE:
  ------------------
  |  Branch (5474:9): [True: 0, False: 109k]
  ------------------
 5475|      0|        case XML_COMMENT_NODE:
  ------------------
  |  Branch (5475:9): [True: 0, False: 109k]
  ------------------
 5476|      0|        case XML_XINCLUDE_START:
  ------------------
  |  Branch (5476:9): [True: 0, False: 109k]
  ------------------
 5477|      0|        case XML_XINCLUDE_END:
  ------------------
  |  Branch (5477:9): [True: 0, False: 109k]
  ------------------
 5478|      0|	    return(1);
 5479|   109k|        case XML_ELEMENT_NODE:
  ------------------
  |  Branch (5479:9): [True: 109k, False: 0]
  ------------------
 5480|   109k|	    break;
 5481|      0|	default:
  ------------------
  |  Branch (5481:2): [True: 0, False: 109k]
  ------------------
 5482|      0|	    xmlErrValidNode(ctxt, elem, XML_ERR_INTERNAL_ERROR,
 5483|      0|		   "unexpected element type\n", NULL, NULL ,NULL);
 5484|      0|	    return(0);
 5485|   109k|    }
 5486|       |
 5487|       |    /*
 5488|       |     * Fetch the declaration
 5489|       |     */
 5490|   109k|    elemDecl = xmlValidGetElemDecl(ctxt, doc, elem, &extsubset);
 5491|   109k|    if (elemDecl == NULL)
  ------------------
  |  Branch (5491:9): [True: 87.5k, False: 21.8k]
  ------------------
 5492|  87.5k|	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|  21.8k|    if (ctxt->vstateNr == 0) {
  ------------------
  |  Branch (5498:9): [True: 12.1k, False: 9.79k]
  ------------------
 5499|       |    /* Check that the element content matches the definition */
 5500|  12.1k|    switch (elemDecl->etype) {
  ------------------
  |  Branch (5500:13): [True: 12.1k, False: 0]
  ------------------
 5501|  2.29k|        case XML_ELEMENT_TYPE_UNDEFINED:
  ------------------
  |  Branch (5501:9): [True: 2.29k, False: 9.81k]
  ------------------
 5502|  2.29k|	    xmlErrValidNode(ctxt, elem, XML_DTD_UNKNOWN_ELEM,
 5503|  2.29k|	                    "No declaration for element %s\n",
 5504|  2.29k|		   elem->name, NULL, NULL);
 5505|  2.29k|	    return(0);
 5506|  2.38k|        case XML_ELEMENT_TYPE_EMPTY:
  ------------------
  |  Branch (5506:9): [True: 2.38k, False: 9.71k]
  ------------------
 5507|  2.38k|	    if (elem->children != NULL) {
  ------------------
  |  Branch (5507:10): [True: 94, False: 2.29k]
  ------------------
 5508|     94|		xmlErrValidNode(ctxt, elem, XML_DTD_NOT_EMPTY,
 5509|     94|	       "Element %s was declared EMPTY this one has content\n",
 5510|     94|	               elem->name, NULL, NULL);
 5511|     94|		ret = 0;
 5512|     94|	    }
 5513|  2.38k|	    break;
 5514|     91|        case XML_ELEMENT_TYPE_ANY:
  ------------------
  |  Branch (5514:9): [True: 91, False: 12.0k]
  ------------------
 5515|       |	    /* I don't think anything is required then */
 5516|     91|	    break;
 5517|  2.83k|        case XML_ELEMENT_TYPE_MIXED:
  ------------------
  |  Branch (5517:9): [True: 2.83k, False: 9.27k]
  ------------------
 5518|       |
 5519|       |	    /* simple case of declared as #PCDATA */
 5520|  2.83k|	    if ((elemDecl->content != NULL) &&
  ------------------
  |  Branch (5520:10): [True: 2.83k, False: 0]
  ------------------
 5521|  2.83k|		(elemDecl->content->type == XML_ELEMENT_CONTENT_PCDATA)) {
  ------------------
  |  Branch (5521:3): [True: 2.21k, False: 619]
  ------------------
 5522|  2.21k|		ret = xmlValidateOneCdataElement(ctxt, doc, elem);
 5523|  2.21k|		if (!ret) {
  ------------------
  |  Branch (5523:7): [True: 1.18k, False: 1.02k]
  ------------------
 5524|  1.18k|		    xmlErrValidNode(ctxt, elem, XML_DTD_NOT_PCDATA,
 5525|  1.18k|	       "Element %s was declared #PCDATA but contains non text nodes\n",
 5526|  1.18k|			   elem->name, NULL, NULL);
 5527|  1.18k|		}
 5528|  2.21k|		break;
 5529|  2.21k|	    }
 5530|    619|	    child = elem->children;
 5531|       |	    /* Hum, this start to get messy */
 5532|  2.24k|	    while (child != NULL) {
  ------------------
  |  Branch (5532:13): [True: 1.62k, False: 618]
  ------------------
 5533|  1.62k|	        if (child->type == XML_ELEMENT_NODE) {
  ------------------
  |  Branch (5533:14): [True: 978, False: 644]
  ------------------
 5534|    978|		    name = child->name;
 5535|    978|		    if ((child->ns != NULL) && (child->ns->prefix != NULL)) {
  ------------------
  |  Branch (5535:11): [True: 402, False: 576]
  |  Branch (5535:34): [True: 324, False: 78]
  ------------------
 5536|    324|			xmlChar fn[50];
 5537|    324|			xmlChar *fullname;
 5538|       |
 5539|    324|			fullname = xmlBuildQName(child->name, child->ns->prefix,
 5540|    324|				                 fn, 50);
 5541|    324|			if (fullname == NULL) {
  ------------------
  |  Branch (5541:8): [True: 1, False: 323]
  ------------------
 5542|      1|                            xmlVErrMemory(ctxt);
 5543|      1|			    return(0);
 5544|      1|                        }
 5545|    323|			cont = elemDecl->content;
 5546|  1.39k|			while (cont != NULL) {
  ------------------
  |  Branch (5546:11): [True: 1.20k, False: 186]
  ------------------
 5547|  1.20k|			    if (cont->type == XML_ELEMENT_CONTENT_ELEMENT) {
  ------------------
  |  Branch (5547:12): [True: 248, False: 960]
  ------------------
 5548|    248|				if (xmlStrEqual(cont->name, fullname))
  ------------------
  |  Branch (5548:9): [True: 62, False: 186]
  ------------------
 5549|     62|				    break;
 5550|    960|			    } else if ((cont->type == XML_ELEMENT_CONTENT_OR) &&
  ------------------
  |  Branch (5550:19): [True: 960, False: 0]
  ------------------
 5551|    960|			       (cont->c1 != NULL) &&
  ------------------
  |  Branch (5551:11): [True: 960, False: 0]
  ------------------
 5552|    960|			       (cont->c1->type == XML_ELEMENT_CONTENT_ELEMENT)){
  ------------------
  |  Branch (5552:11): [True: 637, False: 323]
  ------------------
 5553|    637|				if (xmlStrEqual(cont->c1->name, fullname))
  ------------------
  |  Branch (5553:9): [True: 75, False: 562]
  ------------------
 5554|     75|				    break;
 5555|    637|			    } else if ((cont->type != XML_ELEMENT_CONTENT_OR) ||
  ------------------
  |  Branch (5555:19): [True: 0, False: 323]
  ------------------
 5556|    323|				(cont->c1 == NULL) ||
  ------------------
  |  Branch (5556:5): [True: 0, False: 323]
  ------------------
 5557|    323|				(cont->c1->type != XML_ELEMENT_CONTENT_PCDATA)){
  ------------------
  |  Branch (5557:5): [True: 0, False: 323]
  ------------------
 5558|      0|				xmlErrValid(ctxt, XML_DTD_MIXED_CORRUPT,
 5559|      0|					"Internal: MIXED struct corrupted\n",
 5560|      0|					NULL);
 5561|      0|				break;
 5562|      0|			    }
 5563|  1.07k|			    cont = cont->c2;
 5564|  1.07k|			}
 5565|    323|			if ((fullname != fn) && (fullname != child->name))
  ------------------
  |  Branch (5565:8): [True: 19, False: 304]
  |  Branch (5565:28): [True: 19, False: 0]
  ------------------
 5566|     19|			    xmlFree(fullname);
 5567|    323|			if (cont != NULL)
  ------------------
  |  Branch (5567:8): [True: 137, False: 186]
  ------------------
 5568|    137|			    goto child_ok;
 5569|    323|		    }
 5570|    840|		    cont = elemDecl->content;
 5571|  4.55k|		    while (cont != NULL) {
  ------------------
  |  Branch (5571:14): [True: 4.03k, False: 515]
  ------------------
 5572|  4.03k|		        if (cont->type == XML_ELEMENT_CONTENT_ELEMENT) {
  ------------------
  |  Branch (5572:15): [True: 763, False: 3.27k]
  ------------------
 5573|    763|			    if (xmlStrEqual(cont->name, name)) break;
  ------------------
  |  Branch (5573:12): [True: 248, False: 515]
  ------------------
 5574|  3.27k|			} else if ((cont->type == XML_ELEMENT_CONTENT_OR) &&
  ------------------
  |  Branch (5574:15): [True: 3.27k, False: 0]
  ------------------
 5575|  3.27k|			   (cont->c1 != NULL) &&
  ------------------
  |  Branch (5575:7): [True: 3.27k, False: 0]
  ------------------
 5576|  3.27k|			   (cont->c1->type == XML_ELEMENT_CONTENT_ELEMENT)) {
  ------------------
  |  Branch (5576:7): [True: 2.43k, False: 840]
  ------------------
 5577|  2.43k|			    if (xmlStrEqual(cont->c1->name, name)) break;
  ------------------
  |  Branch (5577:12): [True: 77, False: 2.35k]
  ------------------
 5578|  2.43k|			} else if ((cont->type != XML_ELEMENT_CONTENT_OR) ||
  ------------------
  |  Branch (5578:15): [True: 0, False: 840]
  ------------------
 5579|    840|			    (cont->c1 == NULL) ||
  ------------------
  |  Branch (5579:8): [True: 0, False: 840]
  ------------------
 5580|    840|			    (cont->c1->type != XML_ELEMENT_CONTENT_PCDATA)) {
  ------------------
  |  Branch (5580:8): [True: 0, False: 840]
  ------------------
 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.71k|			cont = cont->c2;
 5587|  3.71k|		    }
 5588|    840|		    if (cont == NULL) {
  ------------------
  |  Branch (5588:11): [True: 515, False: 325]
  ------------------
 5589|    515|			xmlErrValidNode(ctxt, elem, XML_DTD_INVALID_CHILD,
 5590|    515|	       "Element %s is not declared in %s list of possible children\n",
 5591|    515|			       name, elem->name, NULL);
 5592|    515|			ret = 0;
 5593|    515|		    }
 5594|    840|		}
 5595|  1.62k|child_ok:
 5596|  1.62k|	        child = child->next;
 5597|  1.62k|	    }
 5598|    618|	    break;
 5599|  4.49k|        case XML_ELEMENT_TYPE_ELEMENT:
  ------------------
  |  Branch (5599:9): [True: 4.49k, False: 7.60k]
  ------------------
 5600|  4.49k|	    if ((doc->standalone == 1) && (extsubset == 1)) {
  ------------------
  |  Branch (5600:10): [True: 408, False: 4.09k]
  |  Branch (5600:36): [True: 340, False: 68]
  ------------------
 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|    340|		child = elem->children;
 5607|    779|		while (child != NULL) {
  ------------------
  |  Branch (5607:10): [True: 475, False: 304]
  ------------------
 5608|    475|		    if ((child->type == XML_TEXT_NODE) &&
  ------------------
  |  Branch (5608:11): [True: 209, False: 266]
  ------------------
 5609|    209|                        (child->content != NULL)) {
  ------------------
  |  Branch (5609:25): [True: 209, False: 0]
  ------------------
 5610|    209|			const xmlChar *content = child->content;
 5611|       |
 5612|    209|			while (IS_BLANK_CH(*content))
 5613|    777|			    content++;
 5614|    209|			if (*content == 0) {
  ------------------
  |  Branch (5614:8): [True: 36, False: 173]
  ------------------
 5615|     36|			    xmlErrValidNode(ctxt, elem,
 5616|     36|			                    XML_DTD_STANDALONE_WHITE_SPACE,
 5617|     36|"standalone: %s declared in the external subset contains white spaces nodes\n",
 5618|     36|				   elem->name, NULL, NULL);
 5619|     36|			    ret = 0;
 5620|     36|			    break;
 5621|     36|			}
 5622|    209|		    }
 5623|    439|		    child =child->next;
 5624|    439|		}
 5625|    340|	    }
 5626|  4.49k|	    child = elem->children;
 5627|  4.49k|	    cont = elemDecl->content;
 5628|  4.49k|	    tmp = xmlValidateElementContent(ctxt, child, elemDecl, 1, elem);
 5629|  4.49k|	    if (tmp <= 0)
  ------------------
  |  Branch (5629:10): [True: 3.67k, False: 823]
  ------------------
 5630|  3.67k|		ret = 0;
 5631|  4.49k|	    break;
 5632|  12.1k|    }
 5633|  12.1k|    } /* not continuous */
 5634|       |
 5635|       |    /* [ VC: Required Attribute ] */
 5636|  19.6k|    attr = elemDecl->attributes;
 5637|  64.0k|    while (attr != NULL) {
  ------------------
  |  Branch (5637:12): [True: 44.4k, False: 19.6k]
  ------------------
 5638|  44.4k|	if (attr->def == XML_ATTRIBUTE_REQUIRED) {
  ------------------
  |  Branch (5638:6): [True: 2.90k, False: 41.5k]
  ------------------
 5639|  2.90k|	    int qualified = -1;
 5640|       |
 5641|  2.90k|	    if ((attr->prefix == NULL) &&
  ------------------
  |  Branch (5641:10): [True: 1.83k, False: 1.07k]
  ------------------
 5642|  1.83k|		(xmlStrEqual(attr->name, BAD_CAST "xmlns"))) {
  ------------------
  |  |   34|  1.83k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (5642:3): [True: 947, False: 884]
  ------------------
 5643|    947|		xmlNsPtr ns;
 5644|       |
 5645|    947|		ns = elem->nsDef;
 5646|  1.14k|		while (ns != NULL) {
  ------------------
  |  Branch (5646:10): [True: 271, False: 878]
  ------------------
 5647|    271|		    if (ns->prefix == NULL)
  ------------------
  |  Branch (5647:11): [True: 69, False: 202]
  ------------------
 5648|     69|			goto found;
 5649|    202|		    ns = ns->next;
 5650|    202|		}
 5651|  1.95k|	    } else if (xmlStrEqual(attr->prefix, BAD_CAST "xmlns")) {
  ------------------
  |  |   34|  1.95k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (5651:17): [True: 390, False: 1.56k]
  ------------------
 5652|    390|		xmlNsPtr ns;
 5653|       |
 5654|    390|		ns = elem->nsDef;
 5655|    393|		while (ns != NULL) {
  ------------------
  |  Branch (5655:10): [True: 4, False: 389]
  ------------------
 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.56k|	    } else {
 5661|  1.56k|		xmlAttrPtr attrib;
 5662|       |
 5663|  1.56k|		attrib = elem->properties;
 5664|  2.89k|		while (attrib != NULL) {
  ------------------
  |  Branch (5664:10): [True: 1.46k, False: 1.42k]
  ------------------
 5665|  1.46k|		    if (xmlStrEqual(attrib->name, attr->name)) {
  ------------------
  |  Branch (5665:11): [True: 621, False: 844]
  ------------------
 5666|    621|			if (attr->prefix != NULL) {
  ------------------
  |  Branch (5666:8): [True: 551, False: 70]
  ------------------
 5667|    551|			    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|    551|			    if (nameSpace == NULL) {
  ------------------
  |  Branch (5674:12): [True: 230, False: 321]
  ------------------
 5675|    230|				if (qualified < 0)
  ------------------
  |  Branch (5675:9): [True: 212, False: 18]
  ------------------
 5676|    212|				    qualified = 0;
 5677|    321|			    } else if (!xmlStrEqual(nameSpace->prefix,
  ------------------
  |  Branch (5677:19): [True: 250, False: 71]
  ------------------
 5678|    321|						    attr->prefix)) {
 5679|    250|				if (qualified < 1)
  ------------------
  |  Branch (5679:9): [True: 250, False: 0]
  ------------------
 5680|    250|				    qualified = 1;
 5681|    250|			    } else
 5682|     71|				goto found;
 5683|    551|			} 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|     70|			    goto found;
 5691|     70|			}
 5692|    621|		    }
 5693|  1.32k|		    attrib = attrib->next;
 5694|  1.32k|		}
 5695|  1.56k|	    }
 5696|  2.69k|	    if (qualified == -1) {
  ------------------
  |  Branch (5696:10): [True: 2.23k, False: 462]
  ------------------
 5697|  2.23k|		if (attr->prefix == NULL) {
  ------------------
  |  Branch (5697:7): [True: 1.69k, False: 539]
  ------------------
 5698|  1.69k|		    xmlErrValidNode(ctxt, elem, XML_DTD_MISSING_ATTRIBUTE,
 5699|  1.69k|		       "Element %s does not carry attribute %s\n",
 5700|  1.69k|			   elem->name, attr->name, NULL);
 5701|  1.69k|		    ret = 0;
 5702|  1.69k|	        } else {
 5703|    539|		    xmlErrValidNode(ctxt, elem, XML_DTD_MISSING_ATTRIBUTE,
 5704|    539|		       "Element %s does not carry attribute %s:%s\n",
 5705|    539|			   elem->name, attr->prefix,attr->name);
 5706|    539|		    ret = 0;
 5707|    539|		}
 5708|  2.23k|	    } else if (qualified == 0) {
  ------------------
  |  Branch (5708:17): [True: 212, False: 250]
  ------------------
 5709|    212|		if (xmlErrValidWarning(ctxt, elem, XML_DTD_NO_PREFIX,
  ------------------
  |  Branch (5709:7): [True: 11, False: 201]
  ------------------
 5710|    212|		                       "Element %s required attribute %s:%s "
 5711|    212|                                       "has no prefix\n",
 5712|    212|		                       elem->name, attr->prefix,
 5713|    212|                                       attr->name) < 0)
 5714|     11|                    ret = 0;
 5715|    250|	    } else if (qualified == 1) {
  ------------------
  |  Branch (5715:17): [True: 250, False: 0]
  ------------------
 5716|    250|		if (xmlErrValidWarning(ctxt, elem, XML_DTD_DIFFERENT_PREFIX,
  ------------------
  |  Branch (5716:7): [True: 11, False: 239]
  ------------------
 5717|    250|		                       "Element %s required attribute %s:%s "
 5718|    250|                                       "has different prefix\n",
 5719|    250|		                       elem->name, attr->prefix,
 5720|    250|                                       attr->name) < 0)
 5721|     11|                    ret = 0;
 5722|    250|	    }
 5723|  2.69k|	}
 5724|  44.4k|found:
 5725|  44.4k|        attr = attr->nexth;
 5726|  44.4k|    }
 5727|  19.6k|    return(ret);
 5728|  19.6k|}
xmlValidateRoot:
 5747|  5.92k|xmlValidateRoot(xmlValidCtxt *ctxt, xmlDoc *doc) {
 5748|  5.92k|    xmlNodePtr root;
 5749|  5.92k|    int ret;
 5750|       |
 5751|  5.92k|    if (doc == NULL) return(0);
  ------------------
  |  Branch (5751:9): [True: 0, False: 5.92k]
  ------------------
 5752|       |
 5753|  5.92k|    root = xmlDocGetRootElement(doc);
 5754|  5.92k|    if ((root == NULL) || (root->name == NULL)) {
  ------------------
  |  Branch (5754:9): [True: 0, False: 5.92k]
  |  Branch (5754:27): [True: 0, False: 5.92k]
  ------------------
 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.92k|    if ((doc->intSubset != NULL) &&
  ------------------
  |  Branch (5764:9): [True: 5.92k, False: 0]
  ------------------
 5765|  5.92k|	(doc->intSubset->name != NULL)) {
  ------------------
  |  Branch (5765:2): [True: 5.72k, False: 193]
  ------------------
 5766|       |	/*
 5767|       |	 * Check first the document root against the NQName
 5768|       |	 */
 5769|  5.72k|	if (!xmlStrEqual(doc->intSubset->name, root->name)) {
  ------------------
  |  Branch (5769:6): [True: 3.84k, False: 1.88k]
  ------------------
 5770|  3.84k|	    if ((root->ns != NULL) && (root->ns->prefix != NULL)) {
  ------------------
  |  Branch (5770:10): [True: 254, False: 3.59k]
  |  Branch (5770:32): [True: 90, False: 164]
  ------------------
 5771|     90|		xmlChar fn[50];
 5772|     90|		xmlChar *fullname;
 5773|       |
 5774|     90|		fullname = xmlBuildQName(root->name, root->ns->prefix, fn, 50);
 5775|     90|		if (fullname == NULL) {
  ------------------
  |  Branch (5775:7): [True: 1, False: 89]
  ------------------
 5776|      1|		    xmlVErrMemory(ctxt);
 5777|      1|		    return(0);
 5778|      1|		}
 5779|     89|		ret = xmlStrEqual(doc->intSubset->name, fullname);
 5780|     89|		if ((fullname != fn) && (fullname != root->name))
  ------------------
  |  Branch (5780:7): [True: 57, False: 32]
  |  Branch (5780:27): [True: 57, False: 0]
  ------------------
 5781|     57|		    xmlFree(fullname);
 5782|     89|		if (ret == 1)
  ------------------
  |  Branch (5782:7): [True: 27, False: 62]
  ------------------
 5783|     27|		    goto name_ok;
 5784|     89|	    }
 5785|  3.81k|	    if ((xmlStrEqual(doc->intSubset->name, BAD_CAST "HTML")) &&
  ------------------
  |  |   34|  3.81k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (5785:10): [True: 2, False: 3.81k]
  ------------------
 5786|      2|		(xmlStrEqual(root->name, BAD_CAST "html")))
  ------------------
  |  |   34|      2|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (5786:3): [True: 0, False: 2]
  ------------------
 5787|      0|		goto name_ok;
 5788|  3.81k|	    xmlErrValidNode(ctxt, root, XML_DTD_ROOT_NAME,
 5789|  3.81k|		   "root and DTD name do not match '%s' and '%s'\n",
 5790|  3.81k|		   root->name, doc->intSubset->name, NULL);
 5791|  3.81k|	    return(0);
 5792|  3.81k|	}
 5793|  5.72k|    }
 5794|  2.10k|name_ok:
 5795|  2.10k|    return(1);
 5796|  5.92k|}
xmlValidateDocumentFinal:
 6004|    523|xmlValidateDocumentFinal(xmlValidCtxt *ctxt, xmlDoc *doc) {
 6005|    523|    xmlRefTablePtr table;
 6006|    523|    xmlParserCtxtPtr pctxt = NULL;
 6007|    523|    xmlParserInputPtr oldInput = NULL;
 6008|       |
 6009|    523|    if (ctxt == NULL)
  ------------------
  |  Branch (6009:9): [True: 0, False: 523]
  ------------------
 6010|      0|        return(0);
 6011|    523|    if (doc == NULL) {
  ------------------
  |  Branch (6011:9): [True: 0, False: 523]
  ------------------
 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|    523|    if (ctxt->flags & XML_VCTXT_USE_PCTXT) {
  ------------------
  |  |   20|    523|#define XML_VCTXT_USE_PCTXT (1u << 1)
  ------------------
  |  Branch (6030:9): [True: 523, False: 0]
  ------------------
 6031|    523|        pctxt = ctxt->userData;
 6032|    523|        oldInput = pctxt->input;
 6033|    523|        pctxt->input = NULL;
 6034|    523|    }
 6035|       |
 6036|    523|    table = (xmlRefTablePtr) doc->refs;
 6037|    523|    ctxt->doc = doc;
 6038|    523|    ctxt->valid = 1;
 6039|    523|    xmlHashScan(table, xmlValidateCheckRefCallback, ctxt);
 6040|       |
 6041|    523|    if (ctxt->flags & XML_VCTXT_USE_PCTXT)
  ------------------
  |  |   20|    523|#define XML_VCTXT_USE_PCTXT (1u << 1)
  ------------------
  |  Branch (6041:9): [True: 523, False: 0]
  ------------------
 6042|    523|        pctxt->input = oldInput;
 6043|       |
 6044|    523|    return(ctxt->valid);
 6045|    523|}
xmlValidateDtdFinal:
 6223|  5.92k|xmlValidateDtdFinal(xmlValidCtxt *ctxt, xmlDoc *doc) {
 6224|  5.92k|    xmlDtdPtr dtd;
 6225|  5.92k|    xmlAttributeTablePtr table;
 6226|  5.92k|    xmlEntitiesTablePtr entities;
 6227|       |
 6228|  5.92k|    if ((doc == NULL) || (ctxt == NULL)) return(0);
  ------------------
  |  Branch (6228:9): [True: 0, False: 5.92k]
  |  Branch (6228:26): [True: 0, False: 5.92k]
  ------------------
 6229|  5.92k|    if ((doc->intSubset == NULL) && (doc->extSubset == NULL))
  ------------------
  |  Branch (6229:9): [True: 0, False: 5.92k]
  |  Branch (6229:37): [True: 0, False: 0]
  ------------------
 6230|      0|	return(0);
 6231|  5.92k|    ctxt->doc = doc;
 6232|  5.92k|    ctxt->valid = 1;
 6233|  5.92k|    dtd = doc->intSubset;
 6234|  5.92k|    if ((dtd != NULL) && (dtd->attributes != NULL)) {
  ------------------
  |  Branch (6234:9): [True: 5.92k, False: 0]
  |  Branch (6234:26): [True: 2.51k, False: 3.40k]
  ------------------
 6235|  2.51k|	table = (xmlAttributeTablePtr) dtd->attributes;
 6236|  2.51k|	xmlHashScan(table, xmlValidateAttributeCallback, ctxt);
 6237|  2.51k|    }
 6238|  5.92k|    if ((dtd != NULL) && (dtd->entities != NULL)) {
  ------------------
  |  Branch (6238:9): [True: 5.92k, False: 0]
  |  Branch (6238:26): [True: 2.09k, False: 3.83k]
  ------------------
 6239|  2.09k|	entities = (xmlEntitiesTablePtr) dtd->entities;
 6240|  2.09k|	xmlHashScan(entities, xmlValidateNotationCallback, ctxt);
 6241|  2.09k|    }
 6242|  5.92k|    dtd = doc->extSubset;
 6243|  5.92k|    if ((dtd != NULL) && (dtd->attributes != NULL)) {
  ------------------
  |  Branch (6243:9): [True: 604, False: 5.31k]
  |  Branch (6243:26): [True: 326, False: 278]
  ------------------
 6244|    326|	table = (xmlAttributeTablePtr) dtd->attributes;
 6245|    326|	xmlHashScan(table, xmlValidateAttributeCallback, ctxt);
 6246|    326|    }
 6247|  5.92k|    if ((dtd != NULL) && (dtd->entities != NULL)) {
  ------------------
  |  Branch (6247:9): [True: 604, False: 5.31k]
  |  Branch (6247:26): [True: 66, False: 538]
  ------------------
 6248|     66|	entities = (xmlEntitiesTablePtr) dtd->entities;
 6249|     66|	xmlHashScan(entities, xmlValidateNotationCallback, ctxt);
 6250|     66|    }
 6251|  5.92k|    return(ctxt->valid);
 6252|  5.92k|}
valid.c:xmlVErrMemory:
   54|  1.36k|{
   55|  1.36k|    if (ctxt != NULL) {
  ------------------
  |  Branch (55:9): [True: 1.36k, False: 0]
  ------------------
   56|  1.36k|        if (ctxt->flags & XML_VCTXT_USE_PCTXT) {
  ------------------
  |  |   20|  1.36k|#define XML_VCTXT_USE_PCTXT (1u << 1)
  ------------------
  |  Branch (56:13): [True: 1.36k, False: 0]
  ------------------
   57|  1.36k|            xmlCtxtErrMemory(ctxt->userData);
   58|  1.36k|        } else {
   59|      0|            xmlRaiseMemoryError(NULL, ctxt->error, ctxt->userData,
   60|      0|                                XML_FROM_VALID, NULL);
   61|      0|        }
   62|  1.36k|    } else {
   63|      0|        xmlRaiseMemoryError(NULL, NULL, NULL, XML_FROM_VALID, NULL);
   64|      0|    }
   65|  1.36k|}
valid.c:xmlValidBuildAContentModel:
  441|   249k|		           const xmlChar *name) {
  442|   249k|    if (content == NULL) {
  ------------------
  |  Branch (442:9): [True: 0, False: 249k]
  ------------------
  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|   249k|    switch (content->type) {
  449|      0|	case XML_ELEMENT_CONTENT_PCDATA:
  ------------------
  |  Branch (449:2): [True: 0, False: 249k]
  ------------------
  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|   202k|	case XML_ELEMENT_CONTENT_ELEMENT: {
  ------------------
  |  Branch (455:2): [True: 202k, False: 47.4k]
  ------------------
  456|   202k|	    xmlAutomataStatePtr oldstate = ctxt->state;
  457|   202k|	    xmlChar fn[50];
  458|   202k|	    xmlChar *fullname;
  459|       |
  460|   202k|	    fullname = xmlBuildQName(content->name, content->prefix, fn, 50);
  461|   202k|	    if (fullname == NULL) {
  ------------------
  |  Branch (461:10): [True: 14, False: 202k]
  ------------------
  462|     14|	        xmlVErrMemory(ctxt);
  463|     14|		return(0);
  464|     14|	    }
  465|       |
  466|   202k|	    switch (content->ocur) {
  ------------------
  |  Branch (466:14): [True: 202k, False: 0]
  ------------------
  467|   158k|		case XML_ELEMENT_CONTENT_ONCE:
  ------------------
  |  Branch (467:3): [True: 158k, False: 44.2k]
  ------------------
  468|   158k|		    ctxt->state = xmlAutomataNewTransition(ctxt->am,
  469|   158k|			    ctxt->state, NULL, fullname, NULL);
  470|   158k|		    break;
  471|  21.2k|		case XML_ELEMENT_CONTENT_OPT:
  ------------------
  |  Branch (471:3): [True: 21.2k, False: 181k]
  ------------------
  472|  21.2k|		    ctxt->state = xmlAutomataNewTransition(ctxt->am,
  473|  21.2k|			    ctxt->state, NULL, fullname, NULL);
  474|  21.2k|		    xmlAutomataNewEpsilon(ctxt->am, oldstate, ctxt->state);
  475|  21.2k|		    break;
  476|  8.32k|		case XML_ELEMENT_CONTENT_PLUS:
  ------------------
  |  Branch (476:3): [True: 8.32k, False: 194k]
  ------------------
  477|  8.32k|		    ctxt->state = xmlAutomataNewTransition(ctxt->am,
  478|  8.32k|			    ctxt->state, NULL, fullname, NULL);
  479|  8.32k|		    xmlAutomataNewTransition(ctxt->am, ctxt->state,
  480|  8.32k|			                     ctxt->state, fullname, NULL);
  481|  8.32k|		    break;
  482|  14.6k|		case XML_ELEMENT_CONTENT_MULT:
  ------------------
  |  Branch (482:3): [True: 14.6k, False: 187k]
  ------------------
  483|  14.6k|		    ctxt->state = xmlAutomataNewEpsilon(ctxt->am,
  484|  14.6k|					    ctxt->state, NULL);
  485|  14.6k|		    xmlAutomataNewTransition(ctxt->am,
  486|  14.6k|			    ctxt->state, ctxt->state, fullname, NULL);
  487|  14.6k|		    break;
  488|   202k|	    }
  489|   202k|	    if ((fullname != fn) && (fullname != content->name))
  ------------------
  |  Branch (489:10): [True: 193k, False: 9.14k]
  |  Branch (489:30): [True: 2.57k, False: 190k]
  ------------------
  490|  2.57k|		xmlFree(fullname);
  491|   202k|	    break;
  492|   202k|	}
  493|  12.4k|	case XML_ELEMENT_CONTENT_SEQ: {
  ------------------
  |  Branch (493:2): [True: 12.4k, False: 237k]
  ------------------
  494|  12.4k|	    xmlAutomataStatePtr oldstate, oldend;
  495|  12.4k|	    xmlElementContentOccur ocur;
  496|       |
  497|       |	    /*
  498|       |	     * Simply iterate over the content
  499|       |	     */
  500|  12.4k|	    oldstate = ctxt->state;
  501|  12.4k|	    ocur = content->ocur;
  502|  12.4k|	    if (ocur != XML_ELEMENT_CONTENT_ONCE) {
  ------------------
  |  Branch (502:10): [True: 11.6k, False: 805]
  ------------------
  503|  11.6k|		ctxt->state = xmlAutomataNewEpsilon(ctxt->am, oldstate, NULL);
  504|  11.6k|		oldstate = ctxt->state;
  505|  11.6k|	    }
  506|   106k|	    do {
  507|   106k|		if (xmlValidBuildAContentModel(content->c1, ctxt, name) == 0)
  ------------------
  |  Branch (507:7): [True: 18, False: 106k]
  ------------------
  508|     18|                    return(0);
  509|   106k|		content = content->c2;
  510|   106k|	    } while ((content->type == XML_ELEMENT_CONTENT_SEQ) &&
  ------------------
  |  Branch (510:15): [True: 93.8k, False: 12.4k]
  ------------------
  511|  93.8k|		     (content->ocur == XML_ELEMENT_CONTENT_ONCE));
  ------------------
  |  Branch (511:8): [True: 93.8k, False: 28]
  ------------------
  512|  12.4k|	    if (xmlValidBuildAContentModel(content, ctxt, name) == 0)
  ------------------
  |  Branch (512:10): [True: 1, False: 12.4k]
  ------------------
  513|      1|                return(0);
  514|  12.4k|	    oldend = ctxt->state;
  515|  12.4k|	    ctxt->state = xmlAutomataNewEpsilon(ctxt->am, oldend, NULL);
  516|  12.4k|	    switch (ocur) {
  ------------------
  |  Branch (516:14): [True: 12.4k, False: 0]
  ------------------
  517|    799|		case XML_ELEMENT_CONTENT_ONCE:
  ------------------
  |  Branch (517:3): [True: 799, False: 11.6k]
  ------------------
  518|    799|		    break;
  519|  8.88k|		case XML_ELEMENT_CONTENT_OPT:
  ------------------
  |  Branch (519:3): [True: 8.88k, False: 3.57k]
  ------------------
  520|  8.88k|		    xmlAutomataNewEpsilon(ctxt->am, oldstate, ctxt->state);
  521|  8.88k|		    break;
  522|    949|		case XML_ELEMENT_CONTENT_MULT:
  ------------------
  |  Branch (522:3): [True: 949, False: 11.5k]
  ------------------
  523|    949|		    xmlAutomataNewEpsilon(ctxt->am, oldstate, ctxt->state);
  524|    949|		    xmlAutomataNewEpsilon(ctxt->am, oldend, oldstate);
  525|    949|		    break;
  526|  1.83k|		case XML_ELEMENT_CONTENT_PLUS:
  ------------------
  |  Branch (526:3): [True: 1.83k, False: 10.6k]
  ------------------
  527|  1.83k|		    xmlAutomataNewEpsilon(ctxt->am, oldend, oldstate);
  528|  1.83k|		    break;
  529|  12.4k|	    }
  530|  12.4k|	    break;
  531|  12.4k|	}
  532|  34.9k|	case XML_ELEMENT_CONTENT_OR: {
  ------------------
  |  Branch (532:2): [True: 34.9k, False: 214k]
  ------------------
  533|  34.9k|	    xmlAutomataStatePtr oldstate, oldend;
  534|  34.9k|	    xmlElementContentOccur ocur;
  535|       |
  536|  34.9k|	    ocur = content->ocur;
  537|  34.9k|	    if ((ocur == XML_ELEMENT_CONTENT_PLUS) ||
  ------------------
  |  Branch (537:10): [True: 7.09k, False: 27.8k]
  ------------------
  538|  27.8k|		(ocur == XML_ELEMENT_CONTENT_MULT)) {
  ------------------
  |  Branch (538:3): [True: 19.2k, False: 8.60k]
  ------------------
  539|  26.3k|		ctxt->state = xmlAutomataNewEpsilon(ctxt->am,
  540|  26.3k|			ctxt->state, NULL);
  541|  26.3k|	    }
  542|  34.9k|	    oldstate = ctxt->state;
  543|  34.9k|	    oldend = xmlAutomataNewState(ctxt->am);
  544|       |
  545|       |	    /*
  546|       |	     * iterate over the subtypes and remerge the end with an
  547|       |	     * epsilon transition
  548|       |	     */
  549|  94.2k|	    do {
  550|  94.2k|		ctxt->state = oldstate;
  551|  94.2k|		if (xmlValidBuildAContentModel(content->c1, ctxt, name) == 0)
  ------------------
  |  Branch (551:7): [True: 9, False: 94.2k]
  ------------------
  552|      9|                    return(0);
  553|  94.2k|		xmlAutomataNewEpsilon(ctxt->am, ctxt->state, oldend);
  554|  94.2k|		content = content->c2;
  555|  94.2k|	    } while ((content->type == XML_ELEMENT_CONTENT_OR) &&
  ------------------
  |  Branch (555:15): [True: 59.3k, False: 34.9k]
  ------------------
  556|  59.3k|		     (content->ocur == XML_ELEMENT_CONTENT_ONCE));
  ------------------
  |  Branch (556:8): [True: 59.2k, False: 14]
  ------------------
  557|  34.9k|	    ctxt->state = oldstate;
  558|  34.9k|	    if (xmlValidBuildAContentModel(content, ctxt, name) == 0)
  ------------------
  |  Branch (558:10): [True: 4, False: 34.9k]
  ------------------
  559|      4|                return(0);
  560|  34.9k|	    xmlAutomataNewEpsilon(ctxt->am, ctxt->state, oldend);
  561|  34.9k|	    ctxt->state = xmlAutomataNewEpsilon(ctxt->am, oldend, NULL);
  562|  34.9k|	    switch (ocur) {
  ------------------
  |  Branch (562:14): [True: 34.9k, False: 0]
  ------------------
  563|  6.31k|		case XML_ELEMENT_CONTENT_ONCE:
  ------------------
  |  Branch (563:3): [True: 6.31k, False: 28.6k]
  ------------------
  564|  6.31k|		    break;
  565|  2.27k|		case XML_ELEMENT_CONTENT_OPT:
  ------------------
  |  Branch (565:3): [True: 2.27k, False: 32.6k]
  ------------------
  566|  2.27k|		    xmlAutomataNewEpsilon(ctxt->am, oldstate, ctxt->state);
  567|  2.27k|		    break;
  568|  19.2k|		case XML_ELEMENT_CONTENT_MULT:
  ------------------
  |  Branch (568:3): [True: 19.2k, False: 15.6k]
  ------------------
  569|  19.2k|		    xmlAutomataNewEpsilon(ctxt->am, oldstate, ctxt->state);
  570|  19.2k|		    xmlAutomataNewEpsilon(ctxt->am, oldend, oldstate);
  571|  19.2k|		    break;
  572|  7.09k|		case XML_ELEMENT_CONTENT_PLUS:
  ------------------
  |  Branch (572:3): [True: 7.09k, False: 27.8k]
  ------------------
  573|  7.09k|		    xmlAutomataNewEpsilon(ctxt->am, oldend, oldstate);
  574|  7.09k|		    break;
  575|  34.9k|	    }
  576|  34.9k|	    break;
  577|  34.9k|	}
  578|  34.9k|	default:
  ------------------
  |  Branch (578:2): [True: 0, False: 249k]
  ------------------
  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|   249k|    }
  584|   249k|    return(1);
  585|   249k|}
valid.c:xmlErrValidNode:
  131|   429k|{
  132|   429k|    xmlDoErrValid(ctxt, node, error, XML_ERR_ERROR, str1, str2, str3, 0,
  133|   429k|                  msg, str1, str2, str3);
  134|   429k|}
valid.c:xmlDoErrValid:
   75|   455k|              const char *msg, ...) {
   76|   455k|    xmlParserCtxtPtr pctxt = NULL;
   77|   455k|    va_list ap;
   78|   455k|    int ret = 0;
   79|       |
   80|   455k|    if (ctxt == NULL)
  ------------------
  |  Branch (80:9): [True: 0, False: 455k]
  ------------------
   81|      0|        return -1;
   82|   455k|    if (ctxt->flags & XML_VCTXT_USE_PCTXT)
  ------------------
  |  |   20|   455k|#define XML_VCTXT_USE_PCTXT (1u << 1)
  ------------------
  |  Branch (82:9): [True: 455k, False: 0]
  ------------------
   83|   455k|        pctxt = ctxt->userData;
   84|       |
   85|   455k|    va_start(ap, msg);
   86|   455k|    if (pctxt != NULL) {
  ------------------
  |  Branch (86:9): [True: 455k, False: 0]
  ------------------
   87|   455k|        xmlCtxtVErr(pctxt, node, XML_FROM_VALID, code, level,
   88|   455k|                    str1, str2, str3, int1, msg, ap);
   89|   455k|        if (pctxt->errNo == XML_ERR_NO_MEMORY)
  ------------------
  |  Branch (89:13): [True: 95.4k, False: 360k]
  ------------------
   90|  95.4k|            ret = -1;
   91|   455k|    } else {
   92|      0|        xmlGenericErrorFunc channel = NULL;
   93|      0|        void *data = NULL;
   94|      0|        int res;
   95|       |
   96|      0|        if (ctxt != NULL) {
  ------------------
  |  Branch (96:13): [True: 0, False: 0]
  ------------------
   97|      0|            channel = ctxt->error;
   98|      0|            data = ctxt->userData;
   99|      0|        }
  100|      0|        res = xmlVRaiseError(NULL, channel, data, NULL, node,
  101|      0|                             XML_FROM_VALID, code, level, NULL, 0,
  102|      0|                             (const char *) str1, (const char *) str2,
  103|      0|                             (const char *) str2, int1, 0,
  104|      0|                             msg, ap);
  105|      0|        if (res < 0) {
  ------------------
  |  Branch (105:13): [True: 0, False: 0]
  ------------------
  106|      0|            xmlVErrMemory(ctxt);
  107|      0|            ret = -1;
  108|      0|        }
  109|      0|    }
  110|   455k|    va_end(ap);
  111|       |
  112|   455k|    return ret;
  113|   455k|}
valid.c:xmlFreeElement:
 1076|  15.8k|xmlFreeElement(xmlElementPtr elem) {
 1077|  15.8k|    if (elem == NULL) return;
  ------------------
  |  Branch (1077:9): [True: 3, False: 15.8k]
  ------------------
 1078|  15.8k|    xmlUnlinkNode((xmlNodePtr) elem);
 1079|  15.8k|    xmlFreeDocElementContent(elem->doc, elem->content);
 1080|  15.8k|    if (elem->name != NULL)
  ------------------
  |  Branch (1080:9): [True: 15.8k, False: 4]
  ------------------
 1081|  15.8k|	xmlFree((xmlChar *) elem->name);
 1082|  15.8k|    if (elem->prefix != NULL)
  ------------------
  |  Branch (1082:9): [True: 1.02k, False: 14.8k]
  ------------------
 1083|  1.02k|	xmlFree((xmlChar *) elem->prefix);
 1084|  15.8k|#ifdef LIBXML_REGEXP_ENABLED
 1085|  15.8k|    if (elem->contModel != NULL)
  ------------------
  |  Branch (1085:9): [True: 1.31k, False: 14.5k]
  ------------------
 1086|  1.31k|	xmlRegFreeRegexp(elem->contModel);
 1087|  15.8k|#endif
 1088|  15.8k|    xmlFree(elem);
 1089|  15.8k|}
valid.c:xmlFreeElementTableEntry:
 1272|  15.6k|xmlFreeElementTableEntry(void *elem, const xmlChar *name ATTRIBUTE_UNUSED) {
 1273|  15.6k|    xmlFreeElement((xmlElementPtr) elem);
 1274|  15.6k|}
valid.c:xmlErrValidWarning:
  191|  23.9k|{
  192|  23.9k|    return xmlDoErrValid(ctxt, node, error, XML_ERR_WARNING, str1, str2, str3,
  193|  23.9k|                         0, msg, str1, str2, str3);
  194|  23.9k|}
valid.c:xmlFreeAttribute:
 1521|  56.8k|xmlFreeAttribute(xmlAttributePtr attr) {
 1522|  56.8k|    xmlDictPtr dict;
 1523|       |
 1524|  56.8k|    if (attr == NULL) return;
  ------------------
  |  Branch (1524:9): [True: 9, False: 56.7k]
  ------------------
 1525|  56.7k|    if (attr->doc != NULL)
  ------------------
  |  Branch (1525:9): [True: 56.7k, False: 0]
  ------------------
 1526|  56.7k|	dict = attr->doc->dict;
 1527|      0|    else
 1528|      0|	dict = NULL;
 1529|  56.7k|    xmlUnlinkNode((xmlNodePtr) attr);
 1530|  56.7k|    if (attr->tree != NULL)
  ------------------
  |  Branch (1530:9): [True: 12.5k, False: 44.2k]
  ------------------
 1531|  12.5k|        xmlFreeEnumeration(attr->tree);
 1532|  56.7k|    if (dict) {
  ------------------
  |  Branch (1532:9): [True: 35.1k, False: 21.6k]
  ------------------
 1533|  35.1k|        if ((attr->elem != NULL) && (!xmlDictOwns(dict, attr->elem)))
  ------------------
  |  Branch (1533:13): [True: 35.1k, False: 0]
  |  Branch (1533:37): [True: 0, False: 35.1k]
  ------------------
 1534|      0|	    xmlFree((xmlChar *) attr->elem);
 1535|  35.1k|        if ((attr->name != NULL) && (!xmlDictOwns(dict, attr->name)))
  ------------------
  |  Branch (1535:13): [True: 35.0k, False: 1]
  |  Branch (1535:37): [True: 0, False: 35.0k]
  ------------------
 1536|      0|	    xmlFree((xmlChar *) attr->name);
 1537|  35.1k|        if ((attr->prefix != NULL) && (!xmlDictOwns(dict, attr->prefix)))
  ------------------
  |  Branch (1537:13): [True: 2.65k, False: 32.4k]
  |  Branch (1537:39): [True: 0, False: 2.65k]
  ------------------
 1538|      0|	    xmlFree((xmlChar *) attr->prefix);
 1539|  35.1k|    } else {
 1540|  21.6k|	if (attr->elem != NULL)
  ------------------
  |  Branch (1540:6): [True: 21.6k, False: 5]
  ------------------
 1541|  21.6k|	    xmlFree((xmlChar *) attr->elem);
 1542|  21.6k|	if (attr->name != NULL)
  ------------------
  |  Branch (1542:6): [True: 21.6k, False: 2]
  ------------------
 1543|  21.6k|	    xmlFree((xmlChar *) attr->name);
 1544|  21.6k|	if (attr->prefix != NULL)
  ------------------
  |  Branch (1544:6): [True: 2.21k, False: 19.4k]
  ------------------
 1545|  2.21k|	    xmlFree((xmlChar *) attr->prefix);
 1546|  21.6k|    }
 1547|  56.7k|    if (attr->defaultValue != NULL)
  ------------------
  |  Branch (1547:9): [True: 19.5k, False: 37.2k]
  ------------------
 1548|  19.5k|        xmlFree(attr->defaultValue);
 1549|  56.7k|    xmlFree(attr);
 1550|  56.7k|}
valid.c:xmlFreeAttributeTableEntry:
 1750|  27.0k|xmlFreeAttributeTableEntry(void *attr, const xmlChar *name ATTRIBUTE_UNUSED) {
 1751|  27.0k|    xmlFreeAttribute((xmlAttributePtr) attr);
 1752|  27.0k|}
valid.c:xmlErrValid:
  148|  1.10k|{
  149|  1.10k|    xmlDoErrValid(ctxt, NULL, error, XML_ERR_ERROR, (const xmlChar *) extra,
  150|  1.10k|                  NULL, NULL, 0, msg, extra);
  151|  1.10k|}
valid.c:xmlFreeNotation:
 1902|  2.05k|xmlFreeNotation(xmlNotationPtr nota) {
 1903|  2.05k|    if (nota == NULL) return;
  ------------------
  |  Branch (1903:9): [True: 4, False: 2.05k]
  ------------------
 1904|  2.05k|    if (nota->name != NULL)
  ------------------
  |  Branch (1904:9): [True: 2.05k, False: 1]
  ------------------
 1905|  2.05k|	xmlFree((xmlChar *) nota->name);
 1906|  2.05k|    if (nota->PublicID != NULL)
  ------------------
  |  Branch (1906:9): [True: 1.07k, False: 974]
  ------------------
 1907|  1.07k|	xmlFree((xmlChar *) nota->PublicID);
 1908|  2.05k|    if (nota->SystemID != NULL)
  ------------------
  |  Branch (1908:9): [True: 971, False: 1.08k]
  ------------------
 1909|    971|	xmlFree((xmlChar *) nota->SystemID);
 1910|  2.05k|    xmlFree(nota);
 1911|  2.05k|}
valid.c:xmlFreeNotationTableEntry:
 2003|    248|xmlFreeNotationTableEntry(void *nota, const xmlChar *name ATTRIBUTE_UNUSED) {
 2004|    248|    xmlFreeNotation((xmlNotationPtr) nota);
 2005|    248|}
valid.c:xmlAddIDInternal:
 2182|  15.7k|xmlAddIDInternal(xmlAttrPtr attr, const xmlChar *value, xmlIDPtr *idPtr) {
 2183|  15.7k|    xmlDocPtr doc;
 2184|  15.7k|    xmlIDPtr id;
 2185|  15.7k|    xmlIDTablePtr table;
 2186|  15.7k|    int ret;
 2187|       |
 2188|  15.7k|    if (idPtr != NULL)
  ------------------
  |  Branch (2188:9): [True: 10.4k, False: 5.25k]
  ------------------
 2189|  10.4k|        *idPtr = NULL;
 2190|  15.7k|    if ((value == NULL) || (value[0] == 0))
  ------------------
  |  Branch (2190:9): [True: 1, False: 15.7k]
  |  Branch (2190:28): [True: 967, False: 14.7k]
  ------------------
 2191|    968|	return(0);
 2192|  14.7k|    if (attr == NULL)
  ------------------
  |  Branch (2192:9): [True: 0, False: 14.7k]
  ------------------
 2193|      0|	return(0);
 2194|       |
 2195|  14.7k|    doc = attr->doc;
 2196|  14.7k|    if (doc == NULL)
  ------------------
  |  Branch (2196:9): [True: 0, False: 14.7k]
  ------------------
 2197|      0|        return(0);
 2198|       |
 2199|       |    /*
 2200|       |     * Create the ID table if needed.
 2201|       |     */
 2202|  14.7k|    table = (xmlIDTablePtr) doc->ids;
 2203|  14.7k|    if (table == NULL)  {
  ------------------
  |  Branch (2203:9): [True: 747, False: 14.0k]
  ------------------
 2204|    747|        doc->ids = table = xmlHashCreate(0);
 2205|    747|        if (table == NULL)
  ------------------
  |  Branch (2205:13): [True: 3, False: 744]
  ------------------
 2206|      3|            return(-1);
 2207|  14.0k|    } else {
 2208|  14.0k|        id = xmlHashLookup(table, value);
 2209|  14.0k|        if (id != NULL)
  ------------------
  |  Branch (2209:13): [True: 11.7k, False: 2.28k]
  ------------------
 2210|  11.7k|            return(0);
 2211|  14.0k|    }
 2212|       |
 2213|  3.03k|    id = (xmlIDPtr) xmlMalloc(sizeof(xmlID));
 2214|  3.03k|    if (id == NULL)
  ------------------
  |  Branch (2214:9): [True: 3, False: 3.03k]
  ------------------
 2215|      3|	return(-1);
 2216|  3.03k|    memset(id, 0, sizeof(*id));
 2217|       |
 2218|       |    /*
 2219|       |     * fill the structure.
 2220|       |     */
 2221|  3.03k|    id->doc = doc;
 2222|  3.03k|    id->value = xmlStrdup(value);
 2223|  3.03k|    if (id->value == NULL) {
  ------------------
  |  Branch (2223:9): [True: 6, False: 3.02k]
  ------------------
 2224|      6|        xmlFreeID(id);
 2225|      6|        return(-1);
 2226|      6|    }
 2227|       |
 2228|  3.02k|    if (attr->id != NULL)
  ------------------
  |  Branch (2228:9): [True: 0, False: 3.02k]
  ------------------
 2229|      0|        xmlRemoveID(doc, attr);
 2230|       |
 2231|  3.02k|    if (xmlHashAddEntry(table, value, id) < 0) {
  ------------------
  |  Branch (2231:9): [True: 5, False: 3.01k]
  ------------------
 2232|      5|	xmlFreeID(id);
 2233|      5|	return(-1);
 2234|      5|    }
 2235|       |
 2236|  3.01k|    ret = 1;
 2237|  3.01k|    if (idPtr != NULL)
  ------------------
  |  Branch (2237:9): [True: 932, False: 2.08k]
  ------------------
 2238|    932|        *idPtr = id;
 2239|       |
 2240|  3.01k|    id->attr = attr;
 2241|  3.01k|    id->lineno = xmlGetLineNo(attr->parent);
 2242|  3.01k|    attr->atype = XML_ATTRIBUTE_ID;
 2243|  3.01k|    attr->id = id;
 2244|       |
 2245|  3.01k|    return(ret);
 2246|  3.02k|}
valid.c:xmlFreeID:
 2151|  3.03k|xmlFreeID(xmlIDPtr id) {
 2152|  3.03k|    xmlDictPtr dict = NULL;
 2153|       |
 2154|  3.03k|    if (id == NULL) return;
  ------------------
  |  Branch (2154:9): [True: 0, False: 3.03k]
  ------------------
 2155|       |
 2156|  3.03k|    if (id->doc != NULL)
  ------------------
  |  Branch (2156:9): [True: 3.03k, False: 0]
  ------------------
 2157|  3.03k|        dict = id->doc->dict;
 2158|       |
 2159|  3.03k|    if (id->value != NULL)
  ------------------
  |  Branch (2159:9): [True: 3.02k, False: 6]
  ------------------
 2160|  3.02k|	xmlFree(id->value);
 2161|  3.03k|    if (id->name != NULL)
  ------------------
  |  Branch (2161:9): [True: 125, False: 2.90k]
  ------------------
 2162|    125|	DICT_FREE(id->name)
  ------------------
  |  | 2129|    125|	if ((str) && ((!dict) ||				\
  |  |  ------------------
  |  |  |  Branch (2129:6): [True: 125, False: 0]
  |  |  |  Branch (2129:16): [True: 64, False: 61]
  |  |  ------------------
  |  | 2130|    125|	    (xmlDictOwns(dict, (const xmlChar *)(str)) == 0)))	\
  |  |  ------------------
  |  |  |  Branch (2130:6): [True: 0, False: 61]
  |  |  ------------------
  |  | 2131|    125|	    xmlFree((char *)(str));
  ------------------
 2163|  3.03k|    if (id->attr != NULL) {
  ------------------
  |  Branch (2163:9): [True: 2.89k, False: 136]
  ------------------
 2164|  2.89k|        id->attr->id = NULL;
 2165|  2.89k|        id->attr->atype = 0;
 2166|  2.89k|    }
 2167|       |
 2168|  3.03k|    xmlFree(id);
 2169|  3.03k|}
valid.c:xmlFreeIDTableEntry:
 2299|  3.01k|xmlFreeIDTableEntry(void *id, const xmlChar *name ATTRIBUTE_UNUSED) {
 2300|  3.01k|    xmlFreeID((xmlIDPtr) id);
 2301|  3.01k|}
valid.c:xmlIsStreaming:
 2134|  38.4k|xmlIsStreaming(xmlValidCtxtPtr ctxt) {
 2135|  38.4k|    xmlParserCtxtPtr pctxt;
 2136|       |
 2137|  38.4k|    if (ctxt == NULL)
  ------------------
  |  Branch (2137:9): [True: 0, False: 38.4k]
  ------------------
 2138|      0|        return(0);
 2139|  38.4k|    if ((ctxt->flags & XML_VCTXT_USE_PCTXT) == 0)
  ------------------
  |  |   20|  38.4k|#define XML_VCTXT_USE_PCTXT (1u << 1)
  ------------------
  |  Branch (2139:9): [True: 0, False: 38.4k]
  ------------------
 2140|      0|        return(0);
 2141|  38.4k|    pctxt = ctxt->userData;
 2142|  38.4k|    return(pctxt->parseMode == XML_PARSE_READER);
 2143|  38.4k|}
valid.c:xmlFreeRef:
 2475|  38.4k|xmlFreeRef(xmlLinkPtr lk) {
 2476|  38.4k|    xmlRefPtr ref = (xmlRefPtr)xmlLinkGetData(lk);
 2477|  38.4k|    if (ref == NULL) return;
  ------------------
  |  Branch (2477:9): [True: 0, False: 38.4k]
  ------------------
 2478|  38.4k|    if (ref->value != NULL)
  ------------------
  |  Branch (2478:9): [True: 38.4k, False: 0]
  ------------------
 2479|  38.4k|        xmlFree((xmlChar *)ref->value);
 2480|  38.4k|    if (ref->name != NULL)
  ------------------
  |  Branch (2480:9): [True: 3.59k, False: 34.8k]
  ------------------
 2481|  3.59k|        xmlFree((xmlChar *)ref->name);
 2482|  38.4k|    xmlFree(ref);
 2483|  38.4k|}
valid.c:xmlDummyCompare:
 2527|  37.7k|{
 2528|  37.7k|    return (0);
 2529|  37.7k|}
valid.c:xmlFreeRefTableEntry:
 2492|    690|xmlFreeRefTableEntry(void *payload, const xmlChar *name ATTRIBUTE_UNUSED) {
 2493|    690|    xmlListPtr list_ref = (xmlListPtr) payload;
 2494|    690|    if (list_ref == NULL) return;
  ------------------
  |  Branch (2494:9): [True: 0, False: 690]
  ------------------
 2495|    690|    xmlListDelete(list_ref);
 2496|    690|}
valid.c:xmlGetDtdElementDesc2:
 2827|  56.7k|xmlGetDtdElementDesc2(xmlValidCtxtPtr ctxt, xmlDtdPtr dtd, const xmlChar *name) {
 2828|  56.7k|    xmlElementTablePtr table;
 2829|  56.7k|    xmlElementPtr cur = NULL;
 2830|  56.7k|    const xmlChar *localName;
 2831|  56.7k|    xmlChar *prefix = NULL;
 2832|       |
 2833|  56.7k|    if (dtd == NULL) return(NULL);
  ------------------
  |  Branch (2833:9): [True: 0, False: 56.7k]
  ------------------
 2834|       |
 2835|       |    /*
 2836|       |     * Create the Element table if needed.
 2837|       |     */
 2838|  56.7k|    if (dtd->elements == NULL) {
  ------------------
  |  Branch (2838:9): [True: 3.23k, False: 53.5k]
  ------------------
 2839|  3.23k|	xmlDictPtr dict = NULL;
 2840|       |
 2841|  3.23k|	if (dtd->doc != NULL)
  ------------------
  |  Branch (2841:6): [True: 3.23k, False: 0]
  ------------------
 2842|  3.23k|	    dict = dtd->doc->dict;
 2843|       |
 2844|  3.23k|	dtd->elements = xmlHashCreateDict(0, dict);
 2845|  3.23k|	if (dtd->elements == NULL)
  ------------------
  |  Branch (2845:6): [True: 1, False: 3.23k]
  ------------------
 2846|      1|            goto mem_error;
 2847|  3.23k|    }
 2848|  56.7k|    table = (xmlElementTablePtr) dtd->elements;
 2849|       |
 2850|  56.7k|    localName = xmlSplitQName4(name, &prefix);
 2851|  56.7k|    if (localName == NULL)
  ------------------
  |  Branch (2851:9): [True: 1, False: 56.7k]
  ------------------
 2852|      1|        goto mem_error;
 2853|  56.7k|    cur = xmlHashLookup2(table, localName, prefix);
 2854|  56.7k|    if (cur == NULL) {
  ------------------
  |  Branch (2854:9): [True: 4.53k, False: 52.2k]
  ------------------
 2855|  4.53k|	cur = (xmlElementPtr) xmlMalloc(sizeof(xmlElement));
 2856|  4.53k|	if (cur == NULL)
  ------------------
  |  Branch (2856:6): [True: 1, False: 4.53k]
  ------------------
 2857|      1|            goto mem_error;
 2858|  4.53k|	memset(cur, 0, sizeof(xmlElement));
 2859|  4.53k|	cur->type = XML_ELEMENT_DECL;
 2860|  4.53k|        cur->doc = dtd->doc;
 2861|       |
 2862|       |	/*
 2863|       |	 * fill the structure.
 2864|       |	 */
 2865|  4.53k|	cur->name = xmlStrdup(localName);
 2866|  4.53k|        if (cur->name == NULL)
  ------------------
  |  Branch (2866:13): [True: 4, False: 4.53k]
  ------------------
 2867|      4|            goto mem_error;
 2868|  4.53k|	cur->prefix = prefix;
 2869|  4.53k|        prefix = NULL;
 2870|  4.53k|	cur->etype = XML_ELEMENT_TYPE_UNDEFINED;
 2871|       |
 2872|  4.53k|	if (xmlHashAdd2(table, localName, cur->prefix, cur) <= 0)
  ------------------
  |  Branch (2872:6): [True: 5, False: 4.52k]
  ------------------
 2873|      5|            goto mem_error;
 2874|  4.53k|    }
 2875|       |
 2876|  56.7k|    if (prefix != NULL)
  ------------------
  |  Branch (2876:9): [True: 1.03k, False: 55.7k]
  ------------------
 2877|  1.03k|        xmlFree(prefix);
 2878|  56.7k|    return(cur);
 2879|       |
 2880|     12|mem_error:
 2881|     12|    xmlVErrMemory(ctxt);
 2882|     12|    xmlFree(prefix);
 2883|     12|    xmlFreeElement(cur);
 2884|       |    return(NULL);
 2885|  56.7k|}
valid.c:xmlValidateNameValueInternal:
 3096|  21.0k|xmlValidateNameValueInternal(const xmlChar *value, int flags) {
 3097|  21.0k|    if ((value == NULL) || (value[0] == 0))
  ------------------
  |  Branch (3097:9): [True: 7, False: 20.9k]
  |  Branch (3097:28): [True: 513, False: 20.4k]
  ------------------
 3098|    520|        return(0);
 3099|       |
 3100|  20.4k|    value = xmlScanName(value, SIZE_MAX, flags);
 3101|  20.4k|    return((value != NULL) && (*value == 0));
  ------------------
  |  Branch (3101:12): [True: 20.4k, False: 0]
  |  Branch (3101:31): [True: 11.5k, False: 8.93k]
  ------------------
 3102|  21.0k|}
valid.c:xmlValidateNamesValueInternal:
 3125|  4.93k|xmlValidateNamesValueInternal(const xmlChar *value, int flags) {
 3126|  4.93k|    const xmlChar *cur;
 3127|       |
 3128|  4.93k|    if (value == NULL)
  ------------------
  |  Branch (3128:9): [True: 2, False: 4.93k]
  ------------------
 3129|      2|        return(0);
 3130|       |
 3131|  4.93k|    cur = xmlScanName(value, SIZE_MAX, flags);
 3132|  4.93k|    if ((cur == NULL) || (cur == value))
  ------------------
  |  Branch (3132:9): [True: 0, False: 4.93k]
  |  Branch (3132:26): [True: 723, False: 4.21k]
  ------------------
 3133|    723|        return(0);
 3134|       |
 3135|       |    /* Should not test IS_BLANK(val) here -- see erratum E20*/
 3136|  5.45k|    while (*cur == 0x20) {
  ------------------
  |  Branch (3136:12): [True: 1.66k, False: 3.79k]
  ------------------
 3137|  3.45k|	while (*cur == 0x20)
  ------------------
  |  Branch (3137:9): [True: 1.79k, False: 1.66k]
  ------------------
 3138|  1.79k|	    cur += 1;
 3139|       |
 3140|  1.66k|        value = cur;
 3141|  1.66k|        cur = xmlScanName(value, SIZE_MAX, flags);
 3142|  1.66k|        if ((cur == NULL) || (cur == value))
  ------------------
  |  Branch (3142:13): [True: 0, False: 1.66k]
  |  Branch (3142:30): [True: 420, False: 1.24k]
  ------------------
 3143|    420|            return(0);
 3144|  1.66k|    }
 3145|       |
 3146|  3.79k|    return(*cur == 0);
 3147|  4.21k|}
valid.c:xmlValidateNmtokenValueInternal:
 3172|  2.91k|xmlValidateNmtokenValueInternal(const xmlChar *value, int flags) {
 3173|  2.91k|    if ((value == NULL) || (value[0] == 0))
  ------------------
  |  Branch (3173:9): [True: 1, False: 2.91k]
  |  Branch (3173:28): [True: 105, False: 2.81k]
  ------------------
 3174|    106|        return(0);
 3175|       |
 3176|  2.81k|    value = xmlScanName(value, SIZE_MAX, flags | XML_SCAN_NMTOKEN);
  ------------------
  |  |   70|  2.81k|#define XML_SCAN_NMTOKEN    2
  ------------------
 3177|  2.81k|    return((value != NULL) && (*value == 0));
  ------------------
  |  Branch (3177:12): [True: 2.81k, False: 0]
  |  Branch (3177:31): [True: 2.61k, False: 198]
  ------------------
 3178|  2.91k|}
valid.c:xmlValidateNmtokensValueInternal:
 3205|  49.5k|xmlValidateNmtokensValueInternal(const xmlChar *value, int flags) {
 3206|  49.5k|    const xmlChar *cur;
 3207|       |
 3208|  49.5k|    if (value == NULL)
  ------------------
  |  Branch (3208:9): [True: 1, False: 49.5k]
  ------------------
 3209|      1|        return(0);
 3210|       |
 3211|  49.5k|    cur = value;
 3212|  49.5k|    while (IS_BLANK_CH(*cur))
 3213|    324|	cur += 1;
 3214|       |
 3215|  49.5k|    value = cur;
 3216|  49.5k|    cur = xmlScanName(value, SIZE_MAX, flags | XML_SCAN_NMTOKEN);
  ------------------
  |  |   70|  49.5k|#define XML_SCAN_NMTOKEN    2
  ------------------
 3217|  49.5k|    if ((cur == NULL) || (cur == value))
  ------------------
  |  Branch (3217:9): [True: 0, False: 49.5k]
  |  Branch (3217:26): [True: 4.66k, False: 44.8k]
  ------------------
 3218|  4.66k|        return(0);
 3219|       |
 3220|       |    /* Should not test IS_BLANK(val) here -- see erratum E20*/
 3221|  45.7k|    while (*cur == 0x20) {
  ------------------
  |  Branch (3221:12): [True: 1.41k, False: 44.3k]
  ------------------
 3222|  2.86k|	while (*cur == 0x20)
  ------------------
  |  Branch (3222:9): [True: 1.45k, False: 1.41k]
  ------------------
 3223|  1.45k|	    cur += 1;
 3224|  1.41k|        if (*cur == 0)
  ------------------
  |  Branch (3224:13): [True: 39, False: 1.37k]
  ------------------
 3225|     39|            return(1);
 3226|       |
 3227|  1.37k|        value = cur;
 3228|  1.37k|        cur = xmlScanName(value, SIZE_MAX, flags | XML_SCAN_NMTOKEN);
  ------------------
  |  |   70|  1.37k|#define XML_SCAN_NMTOKEN    2
  ------------------
 3229|  1.37k|        if ((cur == NULL) || (cur == value))
  ------------------
  |  Branch (3229:13): [True: 0, False: 1.37k]
  |  Branch (3229:30): [True: 477, False: 894]
  ------------------
 3230|    477|            return(0);
 3231|  1.37k|    }
 3232|       |
 3233|  44.3k|    return(*cur == 0);
 3234|  44.8k|}
valid.c:xmlValidateAttributeValueInternal:
 3283|  81.7k|                                  const xmlChar *value) {
 3284|  81.7k|    int flags = 0;
 3285|       |
 3286|  81.7k|    if ((doc != NULL) && (doc->properties & XML_DOC_OLD10))
  ------------------
  |  Branch (3286:9): [True: 81.7k, False: 0]
  |  Branch (3286:26): [True: 15.0k, False: 66.6k]
  ------------------
 3287|  15.0k|        flags |= XML_SCAN_OLD10;
  ------------------
  |  |   71|  15.0k|#define XML_SCAN_OLD10      4
  ------------------
 3288|       |
 3289|  81.7k|    switch (type) {
  ------------------
  |  Branch (3289:13): [True: 81.7k, False: 0]
  ------------------
 3290|  2.28k|	case XML_ATTRIBUTE_ENTITIES:
  ------------------
  |  Branch (3290:2): [True: 2.28k, False: 79.4k]
  ------------------
 3291|  4.93k|	case XML_ATTRIBUTE_IDREFS:
  ------------------
  |  Branch (3291:2): [True: 2.65k, False: 79.0k]
  ------------------
 3292|  4.93k|	    return(xmlValidateNamesValueInternal(value, flags));
 3293|  6.44k|	case XML_ATTRIBUTE_ENTITY:
  ------------------
  |  Branch (3293:2): [True: 6.44k, False: 75.2k]
  ------------------
 3294|  8.69k|	case XML_ATTRIBUTE_IDREF:
  ------------------
  |  Branch (3294:2): [True: 2.25k, False: 79.4k]
  ------------------
 3295|  17.6k|	case XML_ATTRIBUTE_ID:
  ------------------
  |  Branch (3295:2): [True: 8.95k, False: 72.7k]
  ------------------
 3296|  21.0k|	case XML_ATTRIBUTE_NOTATION:
  ------------------
  |  Branch (3296:2): [True: 3.34k, False: 78.3k]
  ------------------
 3297|  21.0k|	    return(xmlValidateNameValueInternal(value, flags));
 3298|  1.53k|	case XML_ATTRIBUTE_NMTOKENS:
  ------------------
  |  Branch (3298:2): [True: 1.53k, False: 80.1k]
  ------------------
 3299|  49.5k|	case XML_ATTRIBUTE_ENUMERATION:
  ------------------
  |  Branch (3299:2): [True: 48.0k, False: 33.6k]
  ------------------
 3300|  49.5k|	    return(xmlValidateNmtokensValueInternal(value, flags));
 3301|  2.91k|	case XML_ATTRIBUTE_NMTOKEN:
  ------------------
  |  Branch (3301:2): [True: 2.91k, False: 78.8k]
  ------------------
 3302|  2.91k|	    return(xmlValidateNmtokenValueInternal(value, flags));
 3303|  3.30k|        case XML_ATTRIBUTE_CDATA:
  ------------------
  |  Branch (3303:9): [True: 3.30k, False: 78.4k]
  ------------------
 3304|  3.30k|	    break;
 3305|  81.7k|    }
 3306|  3.30k|    return(1);
 3307|  81.7k|}
valid.c:xmlValidNormalizeString:
 3065|  3.82k|xmlValidNormalizeString(xmlChar *str) {
 3066|  3.82k|    xmlChar *dst;
 3067|  3.82k|    const xmlChar *src;
 3068|       |
 3069|  3.82k|    if (str == NULL)
  ------------------
  |  Branch (3069:9): [True: 0, False: 3.82k]
  ------------------
 3070|      0|        return;
 3071|  3.82k|    src = str;
 3072|  3.82k|    dst = str;
 3073|       |
 3074|  4.13k|    while (*src == 0x20) src++;
  ------------------
  |  Branch (3074:12): [True: 313, False: 3.82k]
  ------------------
 3075|  47.1k|    while (*src != 0) {
  ------------------
  |  Branch (3075:12): [True: 43.3k, False: 3.82k]
  ------------------
 3076|  43.3k|	if (*src == 0x20) {
  ------------------
  |  Branch (3076:6): [True: 1.57k, False: 41.8k]
  ------------------
 3077|  3.95k|	    while (*src == 0x20) src++;
  ------------------
  |  Branch (3077:13): [True: 2.38k, False: 1.57k]
  ------------------
 3078|  1.57k|	    if (*src != 0)
  ------------------
  |  Branch (3078:10): [True: 1.10k, False: 469]
  ------------------
 3079|  1.10k|		*dst++ = 0x20;
 3080|  41.8k|	} else {
 3081|  41.8k|	    *dst++ = *src++;
 3082|  41.8k|	}
 3083|  43.3k|    }
 3084|  3.82k|    *dst = 0;
 3085|  3.82k|}
valid.c:xmlScanIDAttributeDecl:
 1495|  3.48k|xmlScanIDAttributeDecl(xmlValidCtxtPtr ctxt, xmlElementPtr elem, int err) {
 1496|  3.48k|    xmlAttributePtr cur;
 1497|  3.48k|    int ret = 0;
 1498|       |
 1499|  3.48k|    if (elem == NULL) return(0);
  ------------------
  |  Branch (1499:9): [True: 0, False: 3.48k]
  ------------------
 1500|  3.48k|    cur = elem->attributes;
 1501|  8.04k|    while (cur != NULL) {
  ------------------
  |  Branch (1501:12): [True: 4.56k, False: 3.48k]
  ------------------
 1502|  4.56k|        if (cur->atype == XML_ATTRIBUTE_ID) {
  ------------------
  |  Branch (1502:13): [True: 3.53k, False: 1.02k]
  ------------------
 1503|  3.53k|	    ret ++;
 1504|  3.53k|	    if ((ret > 1) && (err))
  ------------------
  |  Branch (1504:10): [True: 377, False: 3.16k]
  |  Branch (1504:23): [True: 0, False: 377]
  ------------------
 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.53k|	}
 1509|  4.56k|	cur = cur->nexth;
 1510|  4.56k|    }
 1511|  3.48k|    return(ret);
 1512|  3.48k|}
valid.c:xmlValidateAttributeIdCallback:
 3614|     73|	                       const xmlChar *name ATTRIBUTE_UNUSED) {
 3615|     73|    xmlAttributePtr attr = (xmlAttributePtr) payload;
 3616|     73|    int *count = (int *) data;
 3617|     73|    if (attr->atype == XML_ATTRIBUTE_ID) (*count)++;
  ------------------
  |  Branch (3617:9): [True: 43, False: 30]
  ------------------
 3618|     73|}
valid.c:xmlErrValidNodeNr:
  169|  1.34k|{
  170|       |    xmlDoErrValid(ctxt, node, error, XML_ERR_ERROR, str1, str3, NULL, int2,
  171|  1.34k|                  msg, str1, int2, str3);
  172|  1.34k|}
valid.c:xmlValidateAttributeValue2:
 3367|  58.2k|      const xmlChar *name, xmlAttributeType type, const xmlChar *value) {
 3368|  58.2k|    int ret = 1;
 3369|  58.2k|    switch (type) {
  ------------------
  |  Branch (3369:13): [True: 58.2k, False: 0]
  ------------------
 3370|  1.83k|	case XML_ATTRIBUTE_IDREFS:
  ------------------
  |  Branch (3370:2): [True: 1.83k, False: 56.4k]
  ------------------
 3371|  3.55k|	case XML_ATTRIBUTE_IDREF:
  ------------------
  |  Branch (3371:2): [True: 1.72k, False: 56.5k]
  ------------------
 3372|  7.07k|	case XML_ATTRIBUTE_ID:
  ------------------
  |  Branch (3372:2): [True: 3.52k, False: 54.7k]
  ------------------
 3373|  7.33k|	case XML_ATTRIBUTE_NMTOKENS:
  ------------------
  |  Branch (3373:2): [True: 259, False: 58.0k]
  ------------------
 3374|  49.7k|	case XML_ATTRIBUTE_ENUMERATION:
  ------------------
  |  Branch (3374:2): [True: 42.4k, False: 15.8k]
  ------------------
 3375|  50.0k|	case XML_ATTRIBUTE_NMTOKEN:
  ------------------
  |  Branch (3375:2): [True: 277, False: 58.0k]
  ------------------
 3376|  50.7k|        case XML_ATTRIBUTE_CDATA:
  ------------------
  |  Branch (3376:9): [True: 692, False: 57.6k]
  ------------------
 3377|  50.7k|	    break;
 3378|  3.11k|	case XML_ATTRIBUTE_ENTITY: {
  ------------------
  |  Branch (3378:2): [True: 3.11k, False: 55.1k]
  ------------------
 3379|  3.11k|	    xmlEntityPtr ent;
 3380|       |
 3381|  3.11k|	    ent = xmlGetDocEntity(doc, value);
 3382|       |	    /* yeah it's a bit messy... */
 3383|  3.11k|	    if ((ent == NULL) && (doc->standalone == 1)) {
  ------------------
  |  Branch (3383:10): [True: 2.70k, False: 416]
  |  Branch (3383:27): [True: 25, False: 2.67k]
  ------------------
 3384|     25|		doc->standalone = 0;
 3385|     25|		ent = xmlGetDocEntity(doc, value);
 3386|     25|	    }
 3387|  3.11k|	    if (ent == NULL) {
  ------------------
  |  Branch (3387:10): [True: 2.70k, False: 417]
  ------------------
 3388|  2.70k|		xmlErrValidNode(ctxt, (xmlNodePtr) doc,
 3389|  2.70k|				XML_DTD_UNKNOWN_ENTITY,
 3390|  2.70k|   "ENTITY attribute %s reference an unknown entity \"%s\"\n",
 3391|  2.70k|		       name, value, NULL);
 3392|  2.70k|		ret = 0;
 3393|  2.70k|	    } else if (ent->etype != XML_EXTERNAL_GENERAL_UNPARSED_ENTITY) {
  ------------------
  |  Branch (3393:17): [True: 210, False: 207]
  ------------------
 3394|    210|		xmlErrValidNode(ctxt, (xmlNodePtr) doc,
 3395|    210|				XML_DTD_ENTITY_TYPE,
 3396|    210|   "ENTITY attribute %s reference an entity \"%s\" of wrong type\n",
 3397|    210|		       name, value, NULL);
 3398|    210|		ret = 0;
 3399|    210|	    }
 3400|  3.11k|	    break;
 3401|  50.0k|        }
 3402|  1.59k|	case XML_ATTRIBUTE_ENTITIES: {
  ------------------
  |  Branch (3402:2): [True: 1.59k, False: 56.7k]
  ------------------
 3403|  1.59k|	    xmlChar *dup, *nam = NULL, *cur, save;
 3404|  1.59k|	    xmlEntityPtr ent;
 3405|       |
 3406|  1.59k|	    dup = xmlStrdup(value);
 3407|  1.59k|	    if (dup == NULL) {
  ------------------
  |  Branch (3407:10): [True: 2, False: 1.58k]
  ------------------
 3408|      2|                xmlVErrMemory(ctxt);
 3409|      2|		return(0);
 3410|      2|            }
 3411|  1.58k|	    cur = dup;
 3412|  4.97k|	    while (*cur != 0) {
  ------------------
  |  Branch (3412:13): [True: 4.55k, False: 424]
  ------------------
 3413|  4.55k|		nam = cur;
 3414|  34.6k|		while ((*cur != 0) && (!IS_BLANK_CH(*cur))) cur++;
  ------------------
  |  |  137|  33.5k|#define IS_BLANK_CH(c)  xmlIsBlank_ch(c)
  |  |  ------------------
  |  |  |  |   90|  33.5k|#define xmlIsBlank_ch(c)	(((c) == 0x20) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (90:27): [True: 2.55k, False: 30.9k]
  |  |  |  |  ------------------
  |  |  |  |   91|  33.5k|				 ((0x9 <= (c)) && ((c) <= 0xa)) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (91:7): [True: 30.9k, False: 0]
  |  |  |  |  |  Branch (91:23): [True: 479, False: 30.4k]
  |  |  |  |  ------------------
  |  |  |  |   92|  33.5k|				 ((c) == 0xd))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (92:6): [True: 356, False: 30.1k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (3414:10): [True: 33.5k, False: 1.16k]
  ------------------
 3415|  4.55k|		save = *cur;
 3416|  4.55k|		*cur = 0;
 3417|  4.55k|		ent = xmlGetDocEntity(doc, nam);
 3418|  4.55k|		if (ent == NULL) {
  ------------------
  |  Branch (3418:7): [True: 4.02k, False: 530]
  ------------------
 3419|  4.02k|		    xmlErrValidNode(ctxt, (xmlNodePtr) doc,
 3420|  4.02k|				    XML_DTD_UNKNOWN_ENTITY,
 3421|  4.02k|       "ENTITIES attribute %s reference an unknown entity \"%s\"\n",
 3422|  4.02k|			   name, nam, NULL);
 3423|  4.02k|		    ret = 0;
 3424|  4.02k|		} else if (ent->etype != XML_EXTERNAL_GENERAL_UNPARSED_ENTITY) {
  ------------------
  |  Branch (3424:14): [True: 273, False: 257]
  ------------------
 3425|    273|		    xmlErrValidNode(ctxt, (xmlNodePtr) doc,
 3426|    273|				    XML_DTD_ENTITY_TYPE,
 3427|    273|       "ENTITIES attribute %s reference an entity \"%s\" of wrong type\n",
 3428|    273|			   name, nam, NULL);
 3429|    273|		    ret = 0;
 3430|    273|		}
 3431|  4.55k|		if (save == 0)
  ------------------
  |  Branch (3431:7): [True: 1.16k, False: 3.38k]
  ------------------
 3432|  1.16k|		    break;
 3433|  3.38k|		*cur = save;
 3434|  3.53k|		while (IS_BLANK_CH(*cur)) cur++;
 3435|  3.38k|	    }
 3436|  1.58k|	    xmlFree(dup);
 3437|  1.58k|	    break;
 3438|  1.59k|	}
 3439|  2.85k|	case XML_ATTRIBUTE_NOTATION: {
  ------------------
  |  Branch (3439:2): [True: 2.85k, False: 55.4k]
  ------------------
 3440|  2.85k|	    xmlNotationPtr nota;
 3441|       |
 3442|  2.85k|	    nota = xmlGetDtdNotationDesc(doc->intSubset, value);
 3443|  2.85k|	    if ((nota == NULL) && (doc->extSubset != NULL))
  ------------------
  |  Branch (3443:10): [True: 2.39k, False: 461]
  |  Branch (3443:28): [True: 1.12k, False: 1.26k]
  ------------------
 3444|  1.12k|		nota = xmlGetDtdNotationDesc(doc->extSubset, value);
 3445|       |
 3446|  2.85k|	    if (nota == NULL) {
  ------------------
  |  Branch (3446:10): [True: 2.16k, False: 685]
  ------------------
 3447|  2.16k|		xmlErrValidNode(ctxt, (xmlNodePtr) doc,
 3448|  2.16k|		                XML_DTD_UNKNOWN_NOTATION,
 3449|  2.16k|       "NOTATION attribute %s reference an unknown notation \"%s\"\n",
 3450|  2.16k|		       name, value, NULL);
 3451|  2.16k|		ret = 0;
 3452|  2.16k|	    }
 3453|  2.85k|	    break;
 3454|  1.59k|        }
 3455|  58.2k|    }
 3456|  58.2k|    return(ret);
 3457|  58.2k|}
valid.c:xmlValidateCheckMixed:
 5092|  3.06k|	              xmlElementContentPtr cont, const xmlChar *qname) {
 5093|  3.06k|    const xmlChar *name;
 5094|  3.06k|    int plen;
 5095|  3.06k|    name = xmlSplitQName3(qname, &plen);
 5096|       |
 5097|  3.06k|    if (name == NULL) {
  ------------------
  |  Branch (5097:9): [True: 2.06k, False: 1.00k]
  ------------------
 5098|  10.0k|	while (cont != NULL) {
  ------------------
  |  Branch (5098:9): [True: 8.78k, False: 1.31k]
  ------------------
 5099|  8.78k|	    if (cont->type == XML_ELEMENT_CONTENT_ELEMENT) {
  ------------------
  |  Branch (5099:10): [True: 1.82k, False: 6.96k]
  ------------------
 5100|  1.82k|		if ((cont->prefix == NULL) && (xmlStrEqual(cont->name, qname)))
  ------------------
  |  Branch (5100:7): [True: 1.06k, False: 753]
  |  Branch (5100:33): [True: 508, False: 560]
  ------------------
 5101|    508|		    return(1);
 5102|  6.96k|	    } else if ((cont->type == XML_ELEMENT_CONTENT_OR) &&
  ------------------
  |  Branch (5102:17): [True: 6.96k, False: 0]
  ------------------
 5103|  6.96k|	       (cont->c1 != NULL) &&
  ------------------
  |  Branch (5103:9): [True: 6.96k, False: 0]
  ------------------
 5104|  6.96k|	       (cont->c1->type == XML_ELEMENT_CONTENT_ELEMENT)){
  ------------------
  |  Branch (5104:9): [True: 4.90k, False: 2.06k]
  ------------------
 5105|  4.90k|		if ((cont->c1->prefix == NULL) &&
  ------------------
  |  Branch (5105:7): [True: 2.41k, False: 2.48k]
  ------------------
 5106|  2.41k|		    (xmlStrEqual(cont->c1->name, qname)))
  ------------------
  |  Branch (5106:7): [True: 241, False: 2.17k]
  ------------------
 5107|    241|		    return(1);
 5108|  4.90k|	    } else if ((cont->type != XML_ELEMENT_CONTENT_OR) ||
  ------------------
  |  Branch (5108:17): [True: 0, False: 2.06k]
  ------------------
 5109|  2.06k|		(cont->c1 == NULL) ||
  ------------------
  |  Branch (5109:3): [True: 0, False: 2.06k]
  ------------------
 5110|  2.06k|		(cont->c1->type != XML_ELEMENT_CONTENT_PCDATA)){
  ------------------
  |  Branch (5110:3): [True: 0, False: 2.06k]
  ------------------
 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.03k|	    cont = cont->c2;
 5117|  8.03k|	}
 5118|  2.06k|    } else {
 5119|  5.82k|	while (cont != NULL) {
  ------------------
  |  Branch (5119:9): [True: 5.14k, False: 683]
  ------------------
 5120|  5.14k|	    if (cont->type == XML_ELEMENT_CONTENT_ELEMENT) {
  ------------------
  |  Branch (5120:10): [True: 793, False: 4.35k]
  ------------------
 5121|    793|		if ((cont->prefix != NULL) &&
  ------------------
  |  Branch (5121:7): [True: 536, False: 257]
  ------------------
 5122|    536|		    (xmlStrncmp(cont->prefix, qname, plen) == 0) &&
  ------------------
  |  Branch (5122:7): [True: 156, False: 380]
  ------------------
 5123|    156|		    (xmlStrEqual(cont->name, name)))
  ------------------
  |  Branch (5123:7): [True: 110, False: 46]
  ------------------
 5124|    110|		    return(1);
 5125|  4.35k|	    } else if ((cont->type == XML_ELEMENT_CONTENT_OR) &&
  ------------------
  |  Branch (5125:17): [True: 4.35k, False: 0]
  ------------------
 5126|  4.35k|	       (cont->c1 != NULL) &&
  ------------------
  |  Branch (5126:9): [True: 4.35k, False: 0]
  ------------------
 5127|  4.35k|	       (cont->c1->type == XML_ELEMENT_CONTENT_ELEMENT)){
  ------------------
  |  Branch (5127:9): [True: 3.34k, False: 1.00k]
  ------------------
 5128|  3.34k|		if ((cont->c1->prefix != NULL) &&
  ------------------
  |  Branch (5128:7): [True: 2.23k, False: 1.11k]
  ------------------
 5129|  2.23k|		    (xmlStrncmp(cont->c1->prefix, qname, plen) == 0) &&
  ------------------
  |  Branch (5129:7): [True: 1.27k, False: 958]
  ------------------
 5130|  1.27k|		    (xmlStrEqual(cont->c1->name, name)))
  ------------------
  |  Branch (5130:7): [True: 213, False: 1.05k]
  ------------------
 5131|    213|		    return(1);
 5132|  3.34k|	    } else if ((cont->type != XML_ELEMENT_CONTENT_OR) ||
  ------------------
  |  Branch (5132:17): [True: 0, False: 1.00k]
  ------------------
 5133|  1.00k|		(cont->c1 == NULL) ||
  ------------------
  |  Branch (5133:3): [True: 0, False: 1.00k]
  ------------------
 5134|  1.00k|		(cont->c1->type != XML_ELEMENT_CONTENT_PCDATA)){
  ------------------
  |  Branch (5134:3): [True: 0, False: 1.00k]
  ------------------
 5135|      0|		xmlErrValid(ctxt, XML_DTD_MIXED_CORRUPT,
 5136|      0|			"Internal: MIXED struct corrupted\n",
 5137|      0|			NULL);
 5138|      0|		break;
 5139|      0|	    }
 5140|  4.82k|	    cont = cont->c2;
 5141|  4.82k|	}
 5142|  1.00k|    }
 5143|  1.99k|    return(0);
 5144|  3.06k|}
valid.c:xmlValidGetElemDecl:
 5159|   238k|	            xmlNodePtr elem, int *extsubset) {
 5160|   238k|    xmlElementPtr elemDecl = NULL;
 5161|   238k|    const xmlChar *prefix = NULL;
 5162|       |
 5163|   238k|    if ((ctxt == NULL) || (doc == NULL) ||
  ------------------
  |  Branch (5163:9): [True: 0, False: 238k]
  |  Branch (5163:27): [True: 0, False: 238k]
  ------------------
 5164|   238k|        (elem == NULL) || (elem->name == NULL))
  ------------------
  |  Branch (5164:9): [True: 0, False: 238k]
  |  Branch (5164:27): [True: 0, False: 238k]
  ------------------
 5165|      0|        return(NULL);
 5166|   238k|    if (extsubset != NULL)
  ------------------
  |  Branch (5166:9): [True: 238k, False: 0]
  ------------------
 5167|   238k|	*extsubset = 0;
 5168|       |
 5169|       |    /*
 5170|       |     * Fetch the declaration for the qualified name
 5171|       |     */
 5172|   238k|    if ((elem->ns != NULL) && (elem->ns->prefix != NULL))
  ------------------
  |  Branch (5172:9): [True: 37.9k, False: 200k]
  |  Branch (5172:31): [True: 11.8k, False: 26.1k]
  ------------------
 5173|  11.8k|	prefix = elem->ns->prefix;
 5174|       |
 5175|   238k|    if (prefix != NULL) {
  ------------------
  |  Branch (5175:9): [True: 11.8k, False: 226k]
  ------------------
 5176|  11.8k|	elemDecl = xmlGetDtdQElementDesc(doc->intSubset,
 5177|  11.8k|		                         elem->name, prefix);
 5178|  11.8k|	if ((elemDecl == NULL) && (doc->extSubset != NULL)) {
  ------------------
  |  Branch (5178:6): [True: 10.3k, False: 1.50k]
  |  Branch (5178:28): [True: 6.23k, False: 4.12k]
  ------------------
 5179|  6.23k|	    elemDecl = xmlGetDtdQElementDesc(doc->extSubset,
 5180|  6.23k|		                             elem->name, prefix);
 5181|  6.23k|	    if ((elemDecl != NULL) && (extsubset != NULL))
  ------------------
  |  Branch (5181:10): [True: 1.24k, False: 4.99k]
  |  Branch (5181:32): [True: 1.24k, False: 0]
  ------------------
 5182|  1.24k|		*extsubset = 1;
 5183|  6.23k|	}
 5184|  11.8k|    }
 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|   238k|    if (elemDecl == NULL) {
  ------------------
  |  Branch (5191:9): [True: 235k, False: 2.75k]
  ------------------
 5192|   235k|	elemDecl = xmlGetDtdQElementDesc(doc->intSubset, elem->name, NULL);
 5193|   235k|	if ((elemDecl == NULL) && (doc->extSubset != NULL)) {
  ------------------
  |  Branch (5193:6): [True: 188k, False: 46.7k]
  |  Branch (5193:28): [True: 22.4k, False: 166k]
  ------------------
 5194|  22.4k|	    elemDecl = xmlGetDtdQElementDesc(doc->extSubset, elem->name, NULL);
 5195|  22.4k|	    if ((elemDecl != NULL) && (extsubset != NULL))
  ------------------
  |  Branch (5195:10): [True: 1.73k, False: 20.7k]
  |  Branch (5195:32): [True: 1.73k, False: 0]
  ------------------
 5196|  1.73k|		*extsubset = 1;
 5197|  22.4k|	}
 5198|   235k|    }
 5199|   238k|    if (elemDecl == NULL) {
  ------------------
  |  Branch (5199:9): [True: 186k, False: 51.2k]
  ------------------
 5200|   186k|	xmlErrValidNode(ctxt, elem,
 5201|   186k|			XML_DTD_UNKNOWN_ELEM,
 5202|   186k|	       "No declaration for element %s\n",
 5203|   186k|	       elem->name, NULL, NULL);
 5204|   186k|    }
 5205|   238k|    return(elemDecl);
 5206|   238k|}
valid.c:vstateVPush:
  216|   128k|vstateVPush(xmlValidCtxtPtr ctxt, xmlElementPtr elemDecl, xmlNodePtr node) {
  217|   128k|    if (ctxt->vstateNr >= ctxt->vstateMax) {
  ------------------
  |  Branch (217:9): [True: 8.32k, False: 120k]
  ------------------
  218|  8.32k|        xmlValidState *tmp;
  219|  8.32k|        int newSize;
  220|       |
  221|  8.32k|        newSize = xmlGrowCapacity(ctxt->vstateMax, sizeof(tmp[0]),
  222|  8.32k|                                  10, XML_MAX_ITEMS);
  ------------------
  |  |   13|  8.32k|#define XML_MAX_ITEMS 1000000000 /* 1 billion */
  ------------------
  223|  8.32k|        if (newSize < 0) {
  ------------------
  |  Branch (223:13): [True: 0, False: 8.32k]
  ------------------
  224|      0|	    xmlVErrMemory(ctxt);
  225|      0|	    return(-1);
  226|      0|	}
  227|  8.32k|	tmp = xmlRealloc(ctxt->vstateTab, newSize * sizeof(tmp[0]));
  228|  8.32k|        if (tmp == NULL) {
  ------------------
  |  Branch (228:13): [True: 109, False: 8.21k]
  ------------------
  229|    109|	    xmlVErrMemory(ctxt);
  230|    109|	    return(-1);
  231|    109|	}
  232|  8.21k|	ctxt->vstateTab = tmp;
  233|  8.21k|	ctxt->vstateMax = newSize;
  234|  8.21k|    }
  235|   128k|    ctxt->vstate = &ctxt->vstateTab[ctxt->vstateNr];
  236|   128k|    ctxt->vstateTab[ctxt->vstateNr].elemDecl = elemDecl;
  237|   128k|    ctxt->vstateTab[ctxt->vstateNr].node = node;
  238|   128k|    if ((elemDecl != NULL) && (elemDecl->etype == XML_ELEMENT_TYPE_ELEMENT)) {
  ------------------
  |  Branch (238:9): [True: 29.3k, False: 99.2k]
  |  Branch (238:31): [True: 12.9k, False: 16.3k]
  ------------------
  239|  12.9k|	if (elemDecl->contModel == NULL)
  ------------------
  |  Branch (239:6): [True: 1.49k, False: 11.4k]
  ------------------
  240|  1.49k|	    xmlValidBuildContentModel(ctxt, elemDecl);
  241|  12.9k|	if (elemDecl->contModel != NULL) {
  ------------------
  |  Branch (241:6): [True: 12.3k, False: 617]
  ------------------
  242|  12.3k|	    ctxt->vstateTab[ctxt->vstateNr].exec =
  243|  12.3k|		xmlRegNewExecCtxt(elemDecl->contModel, NULL, NULL);
  244|  12.3k|            if (ctxt->vstateTab[ctxt->vstateNr].exec == NULL) {
  ------------------
  |  Branch (244:17): [True: 29, False: 12.3k]
  ------------------
  245|     29|                xmlVErrMemory(ctxt);
  246|     29|                return(-1);
  247|     29|            }
  248|  12.3k|	} else {
  249|    617|	    ctxt->vstateTab[ctxt->vstateNr].exec = NULL;
  250|    617|	    xmlErrValidNode(ctxt, (xmlNodePtr) elemDecl,
  251|    617|	                    XML_ERR_INTERNAL_ERROR,
  252|    617|			    "Failed to build content model regexp for %s\n",
  253|    617|			    node->name, NULL, NULL);
  254|    617|	}
  255|  12.9k|    }
  256|   128k|    return(ctxt->vstateNr++);
  257|   128k|}
valid.c:vstateVPop:
  260|   128k|vstateVPop(xmlValidCtxtPtr ctxt) {
  261|   128k|    xmlElementPtr elemDecl;
  262|       |
  263|   128k|    if (ctxt->vstateNr < 1) return(-1);
  ------------------
  |  Branch (263:9): [True: 0, False: 128k]
  ------------------
  264|   128k|    ctxt->vstateNr--;
  265|   128k|    elemDecl = ctxt->vstateTab[ctxt->vstateNr].elemDecl;
  266|   128k|    ctxt->vstateTab[ctxt->vstateNr].elemDecl = NULL;
  267|   128k|    ctxt->vstateTab[ctxt->vstateNr].node = NULL;
  268|   128k|    if ((elemDecl != NULL) && (elemDecl->etype == XML_ELEMENT_TYPE_ELEMENT)) {
  ------------------
  |  Branch (268:9): [True: 29.2k, False: 99.2k]
  |  Branch (268:31): [True: 12.9k, False: 16.3k]
  ------------------
  269|  12.9k|	xmlRegFreeExecCtxt(ctxt->vstateTab[ctxt->vstateNr].exec);
  270|  12.9k|    }
  271|   128k|    ctxt->vstateTab[ctxt->vstateNr].exec = NULL;
  272|   128k|    if (ctxt->vstateNr >= 1)
  ------------------
  |  Branch (272:9): [True: 125k, False: 3.04k]
  ------------------
  273|   125k|	ctxt->vstate = &ctxt->vstateTab[ctxt->vstateNr - 1];
  274|  3.04k|    else
  275|  3.04k|	ctxt->vstate = NULL;
  276|   128k|    return(ctxt->vstateNr);
  277|   128k|}
valid.c:xmlValidateOneCdataElement:
 5023|  2.21k|                           xmlNodePtr elem) {
 5024|  2.21k|    int ret = 1;
 5025|  2.21k|    xmlNodePtr cur, child;
 5026|       |
 5027|  2.21k|    if ((ctxt == NULL) || (doc == NULL) || (elem == NULL) ||
  ------------------
  |  Branch (5027:9): [True: 0, False: 2.21k]
  |  Branch (5027:27): [True: 0, False: 2.21k]
  |  Branch (5027:44): [True: 0, False: 2.21k]
  ------------------
 5028|  2.21k|        (elem->type != XML_ELEMENT_NODE))
  ------------------
  |  Branch (5028:9): [True: 0, False: 2.21k]
  ------------------
 5029|      0|	return(0);
 5030|       |
 5031|  2.21k|    child = elem->children;
 5032|       |
 5033|  2.21k|    cur = child;
 5034|  11.3k|    while (cur != NULL) {
  ------------------
  |  Branch (5034:12): [True: 10.2k, False: 1.02k]
  ------------------
 5035|  10.2k|	switch (cur->type) {
 5036|  3.50k|	    case XML_ENTITY_REF_NODE:
  ------------------
  |  Branch (5036:6): [True: 3.50k, False: 6.78k]
  ------------------
 5037|       |		/*
 5038|       |		 * Push the current node to be able to roll back
 5039|       |		 * and process within the entity
 5040|       |		 */
 5041|  3.50k|		if ((cur->children != NULL) &&
  ------------------
  |  Branch (5041:7): [True: 3.16k, False: 339]
  ------------------
 5042|  3.16k|		    (cur->children->children != NULL)) {
  ------------------
  |  Branch (5042:7): [True: 2.33k, False: 824]
  ------------------
 5043|  2.33k|		    if (nodeVPush(ctxt, cur) < 0) {
  ------------------
  |  Branch (5043:11): [True: 1, False: 2.33k]
  ------------------
 5044|      1|                        ret = 0;
 5045|      1|                        goto done;
 5046|      1|                    }
 5047|  2.33k|		    cur = cur->children->children;
 5048|  2.33k|		    continue;
 5049|  2.33k|		}
 5050|  1.16k|		break;
 5051|  1.16k|	    case XML_COMMENT_NODE:
  ------------------
  |  Branch (5051:6): [True: 318, False: 9.96k]
  ------------------
 5052|  1.41k|	    case XML_PI_NODE:
  ------------------
  |  Branch (5052:6): [True: 1.09k, False: 9.19k]
  ------------------
 5053|  5.29k|	    case XML_TEXT_NODE:
  ------------------
  |  Branch (5053:6): [True: 3.87k, False: 6.40k]
  ------------------
 5054|  5.59k|	    case XML_CDATA_SECTION_NODE:
  ------------------
  |  Branch (5054:6): [True: 308, False: 9.97k]
  ------------------
 5055|  5.59k|		break;
 5056|  1.18k|	    default:
  ------------------
  |  Branch (5056:6): [True: 1.18k, False: 9.09k]
  ------------------
 5057|  1.18k|		ret = 0;
 5058|  1.18k|		goto done;
 5059|  10.2k|	}
 5060|       |	/*
 5061|       |	 * Switch to next element
 5062|       |	 */
 5063|  6.76k|	cur = cur->next;
 5064|  9.08k|	while (cur == NULL) {
  ------------------
  |  Branch (5064:9): [True: 2.92k, False: 6.16k]
  ------------------
 5065|  2.92k|	    cur = nodeVPop(ctxt);
 5066|  2.92k|	    if (cur == NULL)
  ------------------
  |  Branch (5066:10): [True: 602, False: 2.32k]
  ------------------
 5067|    602|		break;
 5068|  2.32k|	    cur = cur->next;
 5069|  2.32k|	}
 5070|  6.76k|    }
 5071|  2.21k|done:
 5072|  2.21k|    ctxt->nodeMax = 0;
 5073|  2.21k|    ctxt->nodeNr = 0;
 5074|  2.21k|    if (ctxt->nodeTab != NULL) {
  ------------------
  |  Branch (5074:9): [True: 378, False: 1.83k]
  ------------------
 5075|    378|	xmlFree(ctxt->nodeTab);
 5076|       |	ctxt->nodeTab = NULL;
 5077|    378|    }
 5078|  2.21k|    return(ret);
 5079|  2.21k|}
valid.c:nodeVPush:
  374|  2.87k|{
  375|  2.87k|    if (ctxt->nodeNr >= ctxt->nodeMax) {
  ------------------
  |  Branch (375:9): [True: 655, False: 2.21k]
  ------------------
  376|    655|        xmlNodePtr *tmp;
  377|    655|        int newSize;
  378|       |
  379|    655|        newSize = xmlGrowCapacity(ctxt->nodeMax, sizeof(tmp[0]),
  380|    655|                                  4, XML_MAX_ITEMS);
  ------------------
  |  |   13|    655|#define XML_MAX_ITEMS 1000000000 /* 1 billion */
  ------------------
  381|    655|        if (newSize < 0) {
  ------------------
  |  Branch (381:13): [True: 0, False: 655]
  ------------------
  382|      0|	    xmlVErrMemory(ctxt);
  383|      0|            return (-1);
  384|      0|        }
  385|    655|        tmp = xmlRealloc(ctxt->nodeTab, newSize * sizeof(tmp[0]));
  386|    655|        if (tmp == NULL) {
  ------------------
  |  Branch (386:13): [True: 2, False: 653]
  ------------------
  387|      2|	    xmlVErrMemory(ctxt);
  388|      2|            return (-1);
  389|      2|        }
  390|    653|	ctxt->nodeTab = tmp;
  391|    653|        ctxt->nodeMax = newSize;
  392|    653|    }
  393|  2.86k|    ctxt->nodeTab[ctxt->nodeNr] = value;
  394|  2.86k|    ctxt->node = value;
  395|  2.86k|    return (ctxt->nodeNr++);
  396|  2.87k|}
valid.c:nodeVPop:
  399|  5.26k|{
  400|  5.26k|    xmlNodePtr ret;
  401|       |
  402|  5.26k|    if (ctxt->nodeNr <= 0)
  ------------------
  |  Branch (402:9): [True: 2.44k, False: 2.81k]
  ------------------
  403|  2.44k|        return (NULL);
  404|  2.81k|    ctxt->nodeNr--;
  405|  2.81k|    if (ctxt->nodeNr > 0)
  ------------------
  |  Branch (405:9): [True: 2.26k, False: 550]
  ------------------
  406|  2.26k|        ctxt->node = ctxt->nodeTab[ctxt->nodeNr - 1];
  407|    550|    else
  408|    550|        ctxt->node = NULL;
  409|  2.81k|    ret = ctxt->nodeTab[ctxt->nodeNr];
  410|       |    ctxt->nodeTab[ctxt->nodeNr] = NULL;
  411|  2.81k|    return (ret);
  412|  5.26k|}
valid.c:xmlValidateElementContent:
 4720|  4.49k|       xmlElementPtr elemDecl, int warn, xmlNodePtr parent) {
 4721|  4.49k|    int ret = 1;
 4722|       |#ifndef  LIBXML_REGEXP_ENABLED
 4723|       |    xmlNodePtr repl = NULL, last = NULL, tmp;
 4724|       |#endif
 4725|  4.49k|    xmlNodePtr cur;
 4726|  4.49k|    xmlElementContentPtr cont;
 4727|  4.49k|    const xmlChar *name;
 4728|       |
 4729|  4.49k|    if ((elemDecl == NULL) || (parent == NULL) || (ctxt == NULL))
  ------------------
  |  Branch (4729:9): [True: 0, False: 4.49k]
  |  Branch (4729:31): [True: 0, False: 4.49k]
  |  Branch (4729:51): [True: 0, False: 4.49k]
  ------------------
 4730|      0|	return(-1);
 4731|  4.49k|    cont = elemDecl->content;
 4732|  4.49k|    name = elemDecl->name;
 4733|       |
 4734|  4.49k|#ifdef LIBXML_REGEXP_ENABLED
 4735|       |    /* Build the regexp associated to the content model */
 4736|  4.49k|    if (elemDecl->contModel == NULL)
  ------------------
  |  Branch (4736:9): [True: 453, False: 4.04k]
  ------------------
 4737|    453|	ret = xmlValidBuildContentModel(ctxt, elemDecl);
 4738|  4.49k|    if (elemDecl->contModel == NULL) {
  ------------------
  |  Branch (4738:9): [True: 11, False: 4.48k]
  ------------------
 4739|     11|	return(-1);
 4740|  4.48k|    } else {
 4741|  4.48k|	xmlRegExecCtxtPtr exec;
 4742|       |
 4743|  4.48k|	if (!xmlRegexpIsDeterminist(elemDecl->contModel)) {
  ------------------
  |  Branch (4743:6): [True: 91, False: 4.39k]
  ------------------
 4744|     91|	    return(-1);
 4745|     91|	}
 4746|  4.39k|	ctxt->nodeMax = 0;
 4747|  4.39k|	ctxt->nodeNr = 0;
 4748|  4.39k|	ctxt->nodeTab = NULL;
 4749|  4.39k|	exec = xmlRegNewExecCtxt(elemDecl->contModel, NULL, NULL);
 4750|  4.39k|	if (exec == NULL) {
  ------------------
  |  Branch (4750:6): [True: 1, False: 4.39k]
  ------------------
 4751|      1|            xmlVErrMemory(ctxt);
 4752|      1|            return(-1);
 4753|      1|        }
 4754|  4.39k|        cur = child;
 4755|  14.7k|        while (cur != NULL) {
  ------------------
  |  Branch (4755:16): [True: 11.5k, False: 3.22k]
  ------------------
 4756|  11.5k|            switch (cur->type) {
 4757|  3.61k|                case XML_ENTITY_REF_NODE:
  ------------------
  |  Branch (4757:17): [True: 3.61k, False: 7.92k]
  ------------------
 4758|       |                    /*
 4759|       |                     * Push the current node to be able to roll back
 4760|       |                     * and process within the entity
 4761|       |                     */
 4762|  3.61k|                    if ((cur->children != NULL) &&
  ------------------
  |  Branch (4762:25): [True: 3.56k, False: 44]
  ------------------
 4763|  3.56k|                        (cur->children->children != NULL)) {
  ------------------
  |  Branch (4763:25): [True: 534, False: 3.03k]
  ------------------
 4764|    534|                        if (nodeVPush(ctxt, cur) < 0) {
  ------------------
  |  Branch (4764:29): [True: 1, False: 533]
  ------------------
 4765|      1|                            ret = -1;
 4766|      1|                            goto fail;
 4767|      1|                        }
 4768|    533|                        cur = cur->children->children;
 4769|    533|                        continue;
 4770|    534|                    }
 4771|  3.07k|                    break;
 4772|  3.07k|                case XML_TEXT_NODE:
  ------------------
  |  Branch (4772:17): [True: 2.34k, False: 9.18k]
  ------------------
 4773|  2.34k|                    if (xmlIsBlankNode(cur))
  ------------------
  |  Branch (4773:25): [True: 1.21k, False: 1.13k]
  ------------------
 4774|  1.21k|                        break;
 4775|  1.13k|                    ret = 0;
 4776|  1.13k|                    goto fail;
 4777|     36|                case XML_CDATA_SECTION_NODE:
  ------------------
  |  Branch (4777:17): [True: 36, False: 11.4k]
  ------------------
 4778|       |                    /* TODO */
 4779|     36|                    ret = 0;
 4780|     36|                    goto fail;
 4781|  5.02k|                case XML_ELEMENT_NODE:
  ------------------
  |  Branch (4781:17): [True: 5.02k, False: 6.50k]
  ------------------
 4782|  5.02k|                    if ((cur->ns != NULL) && (cur->ns->prefix != NULL)) {
  ------------------
  |  Branch (4782:25): [True: 2.04k, False: 2.98k]
  |  Branch (4782:46): [True: 255, False: 1.78k]
  ------------------
 4783|    255|                        xmlChar fn[50];
 4784|    255|                        xmlChar *fullname;
 4785|       |
 4786|    255|                        fullname = xmlBuildQName(cur->name,
 4787|    255|                                                 cur->ns->prefix, fn, 50);
 4788|    255|                        if (fullname == NULL) {
  ------------------
  |  Branch (4788:29): [True: 1, False: 254]
  ------------------
 4789|      1|                            xmlVErrMemory(ctxt);
 4790|      1|                            ret = -1;
 4791|      1|                            goto fail;
 4792|      1|                        }
 4793|    254|                        ret = xmlRegExecPushString(exec, fullname, NULL);
 4794|    254|                        if ((fullname != fn) && (fullname != cur->name))
  ------------------
  |  Branch (4794:29): [True: 145, False: 109]
  |  Branch (4794:49): [True: 145, False: 0]
  ------------------
 4795|    145|                            xmlFree(fullname);
 4796|  4.77k|                    } else {
 4797|  4.77k|                        ret = xmlRegExecPushString(exec, cur->name, NULL);
 4798|  4.77k|                    }
 4799|  5.02k|                    break;
 4800|  5.02k|                default:
  ------------------
  |  Branch (4800:17): [True: 513, False: 11.0k]
  ------------------
 4801|    513|                    break;
 4802|  11.5k|            }
 4803|  9.83k|            if (ret == XML_REGEXP_OUT_OF_MEMORY)
  ------------------
  |  |   14|  9.83k|#define XML_REGEXP_OUT_OF_MEMORY    (-5)
  ------------------
  |  Branch (4803:17): [True: 109, False: 9.72k]
  ------------------
 4804|    109|                xmlVErrMemory(ctxt);
 4805|       |            /*
 4806|       |             * Switch to next element
 4807|       |             */
 4808|  9.83k|            cur = cur->next;
 4809|  10.3k|            while (cur == NULL) {
  ------------------
  |  Branch (4809:20): [True: 2.34k, False: 7.98k]
  ------------------
 4810|  2.34k|                cur = nodeVPop(ctxt);
 4811|  2.34k|                if (cur == NULL)
  ------------------
  |  Branch (4811:21): [True: 1.84k, False: 495]
  ------------------
 4812|  1.84k|                    break;
 4813|    495|                cur = cur->next;
 4814|    495|            }
 4815|  9.83k|        }
 4816|  3.22k|        ret = xmlRegExecPushString(exec, NULL, NULL);
 4817|  3.22k|        if (ret == XML_REGEXP_OUT_OF_MEMORY)
  ------------------
  |  |   14|  3.22k|#define XML_REGEXP_OUT_OF_MEMORY    (-5)
  ------------------
  |  Branch (4817:13): [True: 6, False: 3.22k]
  ------------------
 4818|      6|            xmlVErrMemory(ctxt);
 4819|  4.39k|fail:
 4820|  4.39k|        xmlRegFreeExecCtxt(exec);
 4821|  4.39k|    }
 4822|       |#else  /* LIBXML_REGEXP_ENABLED */
 4823|       |    /*
 4824|       |     * Allocate the stack
 4825|       |     */
 4826|       |#ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
 4827|       |    ctxt->vstateMax = 8;
 4828|       |#else
 4829|       |    ctxt->vstateMax = 1;
 4830|       |#endif
 4831|       |    ctxt->vstateTab = xmlMalloc(ctxt->vstateMax * sizeof(ctxt->vstateTab[0]));
 4832|       |    if (ctxt->vstateTab == NULL) {
 4833|       |	xmlVErrMemory(ctxt);
 4834|       |	return(-1);
 4835|       |    }
 4836|       |    /*
 4837|       |     * The first entry in the stack is reserved to the current state
 4838|       |     */
 4839|       |    ctxt->nodeMax = 0;
 4840|       |    ctxt->nodeNr = 0;
 4841|       |    ctxt->nodeTab = NULL;
 4842|       |    ctxt->vstate = &ctxt->vstateTab[0];
 4843|       |    ctxt->vstateNr = 1;
 4844|       |    CONT = cont;
 4845|       |    NODE = child;
 4846|       |    DEPTH = 0;
 4847|       |    OCCURS = 0;
 4848|       |    STATE = 0;
 4849|       |    ret = xmlValidateElementType(ctxt);
 4850|       |    if ((ret == -3) && (warn)) {
 4851|       |	char expr[5000];
 4852|       |	expr[0] = 0;
 4853|       |	xmlSnprintfElementContent(expr, 5000, elemDecl->content, 1);
 4854|       |	xmlErrValidNode(ctxt, (xmlNodePtr) elemDecl,
 4855|       |                XML_DTD_CONTENT_NOT_DETERMINIST,
 4856|       |	        "Content model of %s is not deterministic: %s\n",
 4857|       |	        name, BAD_CAST expr, NULL);
 4858|       |    } else if (ret == -2) {
 4859|       |	/*
 4860|       |	 * An entities reference appeared at this level.
 4861|       |	 * Build a minimal representation of this node content
 4862|       |	 * sufficient to run the validation process on it
 4863|       |	 */
 4864|       |	cur = child;
 4865|       |	while (cur != NULL) {
 4866|       |	    switch (cur->type) {
 4867|       |		case XML_ENTITY_REF_NODE:
 4868|       |		    /*
 4869|       |		     * Push the current node to be able to roll back
 4870|       |		     * and process within the entity
 4871|       |		     */
 4872|       |		    if ((cur->children != NULL) &&
 4873|       |			(cur->children->children != NULL)) {
 4874|       |			if (nodeVPush(ctxt, cur) < 0) {
 4875|       |                            xmlFreeNodeList(repl);
 4876|       |                            ret = -1;
 4877|       |                            goto done;
 4878|       |                        }
 4879|       |			cur = cur->children->children;
 4880|       |			continue;
 4881|       |		    }
 4882|       |		    break;
 4883|       |		case XML_TEXT_NODE:
 4884|       |		    if (xmlIsBlankNode(cur))
 4885|       |			break;
 4886|       |		    /* falls through */
 4887|       |		case XML_CDATA_SECTION_NODE:
 4888|       |		case XML_ELEMENT_NODE:
 4889|       |		    /*
 4890|       |		     * Allocate a new node and minimally fills in
 4891|       |		     * what's required
 4892|       |		     */
 4893|       |		    tmp = (xmlNodePtr) xmlMalloc(sizeof(xmlNode));
 4894|       |		    if (tmp == NULL) {
 4895|       |			xmlVErrMemory(ctxt);
 4896|       |			xmlFreeNodeList(repl);
 4897|       |			ret = -1;
 4898|       |			goto done;
 4899|       |		    }
 4900|       |		    tmp->type = cur->type;
 4901|       |		    tmp->name = cur->name;
 4902|       |		    tmp->ns = cur->ns;
 4903|       |		    tmp->next = NULL;
 4904|       |		    tmp->content = NULL;
 4905|       |		    if (repl == NULL)
 4906|       |			repl = last = tmp;
 4907|       |		    else {
 4908|       |			last->next = tmp;
 4909|       |			last = tmp;
 4910|       |		    }
 4911|       |		    if (cur->type == XML_CDATA_SECTION_NODE) {
 4912|       |			/*
 4913|       |			 * E59 spaces in CDATA does not match the
 4914|       |			 * nonterminal S
 4915|       |			 */
 4916|       |			tmp->content = xmlStrdup(BAD_CAST "CDATA");
 4917|       |		    }
 4918|       |		    break;
 4919|       |		default:
 4920|       |		    break;
 4921|       |	    }
 4922|       |	    /*
 4923|       |	     * Switch to next element
 4924|       |	     */
 4925|       |	    cur = cur->next;
 4926|       |	    while (cur == NULL) {
 4927|       |		cur = nodeVPop(ctxt);
 4928|       |		if (cur == NULL)
 4929|       |		    break;
 4930|       |		cur = cur->next;
 4931|       |	    }
 4932|       |	}
 4933|       |
 4934|       |	/*
 4935|       |	 * Relaunch the validation
 4936|       |	 */
 4937|       |	ctxt->vstate = &ctxt->vstateTab[0];
 4938|       |	ctxt->vstateNr = 1;
 4939|       |	CONT = cont;
 4940|       |	NODE = repl;
 4941|       |	DEPTH = 0;
 4942|       |	OCCURS = 0;
 4943|       |	STATE = 0;
 4944|       |	ret = xmlValidateElementType(ctxt);
 4945|       |    }
 4946|       |#endif /* LIBXML_REGEXP_ENABLED */
 4947|  4.39k|    if ((warn) && ((ret != 1) && (ret != -3))) {
  ------------------
  |  Branch (4947:9): [True: 4.39k, False: 0]
  |  Branch (4947:20): [True: 3.57k, False: 823]
  |  Branch (4947:34): [True: 3.57k, False: 0]
  ------------------
 4948|  3.57k|	if (ctxt != NULL) {
  ------------------
  |  Branch (4948:6): [True: 3.57k, False: 0]
  ------------------
 4949|  3.57k|	    char expr[5000];
 4950|  3.57k|	    char list[5000];
 4951|       |
 4952|  3.57k|	    expr[0] = 0;
 4953|  3.57k|	    xmlSnprintfElementContent(&expr[0], 5000, cont, 1);
 4954|  3.57k|	    list[0] = 0;
 4955|       |#ifndef LIBXML_REGEXP_ENABLED
 4956|       |	    if (repl != NULL)
 4957|       |		xmlSnprintfElements(&list[0], 5000, repl, 1);
 4958|       |	    else
 4959|       |#endif /* LIBXML_REGEXP_ENABLED */
 4960|  3.57k|		xmlSnprintfElements(&list[0], 5000, child, 1);
 4961|       |
 4962|  3.57k|	    if (name != NULL) {
  ------------------
  |  Branch (4962:10): [True: 3.57k, False: 0]
  ------------------
 4963|  3.57k|		xmlErrValidNode(ctxt, parent, XML_DTD_CONTENT_MODEL,
 4964|  3.57k|	   "Element %s content does not follow the DTD, expecting %s, got %s\n",
 4965|  3.57k|		       name, BAD_CAST expr, BAD_CAST list);
  ------------------
  |  |   34|  3.57k|#define BAD_CAST (xmlChar *)
  ------------------
              		       name, BAD_CAST expr, BAD_CAST list);
  ------------------
  |  |   34|  3.57k|#define BAD_CAST (xmlChar *)
  ------------------
 4966|  3.57k|	    } else {
 4967|      0|		xmlErrValidNode(ctxt, parent, XML_DTD_CONTENT_MODEL,
 4968|      0|	   "Element content does not follow the DTD, expecting %s, got %s\n",
 4969|      0|		       BAD_CAST expr, BAD_CAST list, NULL);
  ------------------
  |  |   34|      0|#define BAD_CAST (xmlChar *)
  ------------------
              		       BAD_CAST expr, BAD_CAST list, NULL);
  ------------------
  |  |   34|      0|#define BAD_CAST (xmlChar *)
  ------------------
 4970|      0|	    }
 4971|  3.57k|	} else {
 4972|      0|	    if (name != NULL) {
  ------------------
  |  Branch (4972:10): [True: 0, False: 0]
  ------------------
 4973|      0|		xmlErrValidNode(ctxt, parent, XML_DTD_CONTENT_MODEL,
 4974|      0|		       "Element %s content does not follow the DTD\n",
 4975|      0|		       name, NULL, NULL);
 4976|      0|	    } else {
 4977|      0|		xmlErrValidNode(ctxt, parent, XML_DTD_CONTENT_MODEL,
 4978|      0|		       "Element content does not follow the DTD\n",
 4979|      0|		                NULL, NULL, NULL);
 4980|      0|	    }
 4981|      0|	}
 4982|  3.57k|	ret = 0;
 4983|  3.57k|    }
 4984|  4.39k|    if (ret == -3)
  ------------------
  |  Branch (4984:9): [True: 0, False: 4.39k]
  ------------------
 4985|      0|	ret = 1;
 4986|       |
 4987|       |#ifndef  LIBXML_REGEXP_ENABLED
 4988|       |done:
 4989|       |    /*
 4990|       |     * Deallocate the copy if done, and free up the validation stack
 4991|       |     */
 4992|       |    while (repl != NULL) {
 4993|       |	tmp = repl->next;
 4994|       |	xmlFree(repl);
 4995|       |	repl = tmp;
 4996|       |    }
 4997|       |    ctxt->vstateMax = 0;
 4998|       |    if (ctxt->vstateTab != NULL) {
 4999|       |	xmlFree(ctxt->vstateTab);
 5000|       |	ctxt->vstateTab = NULL;
 5001|       |    }
 5002|       |#endif
 5003|  4.39k|    ctxt->nodeMax = 0;
 5004|  4.39k|    ctxt->nodeNr = 0;
 5005|  4.39k|    if (ctxt->nodeTab != NULL) {
  ------------------
  |  Branch (5005:9): [True: 138, False: 4.25k]
  ------------------
 5006|    138|	xmlFree(ctxt->nodeTab);
 5007|    138|	ctxt->nodeTab = NULL;
 5008|    138|    }
 5009|  4.39k|    return(ret);
 5010|       |
 5011|  4.49k|}
valid.c:xmlSnprintfElements:
 4623|  3.57k|xmlSnprintfElements(char *buf, int size, xmlNodePtr node, int glob) {
 4624|  3.57k|    xmlNodePtr cur;
 4625|  3.57k|    int len;
 4626|       |
 4627|  3.57k|    if (node == NULL) return;
  ------------------
  |  Branch (4627:9): [True: 810, False: 2.76k]
  ------------------
 4628|  2.76k|    len = strlen(buf);
 4629|  2.76k|    if (glob) {
  ------------------
  |  Branch (4629:9): [True: 2.76k, False: 0]
  ------------------
 4630|  2.76k|        if (size - len < 50) {
  ------------------
  |  Branch (4630:13): [True: 0, False: 2.76k]
  ------------------
 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.76k|        strcat(buf, "(");
 4636|  2.76k|    }
 4637|  2.76k|    cur = node;
 4638|  15.7k|    while (cur != NULL) {
  ------------------
  |  Branch (4638:12): [True: 13.0k, False: 2.68k]
  ------------------
 4639|  13.0k|	len = strlen(buf);
 4640|  13.0k|	if (size - len < 50) {
  ------------------
  |  Branch (4640:6): [True: 41, False: 12.9k]
  ------------------
 4641|     41|	    if ((size - len > 4) && (buf[len - 1] != '.'))
  ------------------
  |  Branch (4641:10): [True: 41, False: 0]
  |  Branch (4641:30): [True: 41, False: 0]
  ------------------
 4642|     41|		strcat(buf, " ...");
 4643|     41|	    return;
 4644|     41|	}
 4645|  12.9k|        switch (cur->type) {
  ------------------
  |  Branch (4645:17): [True: 12.9k, False: 0]
  ------------------
 4646|  5.25k|            case XML_ELEMENT_NODE: {
  ------------------
  |  Branch (4646:13): [True: 5.25k, False: 7.72k]
  ------------------
 4647|  5.25k|                int qnameLen = xmlStrlen(cur->name);
 4648|       |
 4649|  5.25k|                if ((cur->ns != NULL) && (cur->ns->prefix != NULL))
  ------------------
  |  Branch (4649:21): [True: 2.37k, False: 2.88k]
  |  Branch (4649:42): [True: 343, False: 2.03k]
  ------------------
 4650|    343|                    qnameLen += xmlStrlen(cur->ns->prefix) + 1;
 4651|  5.25k|                if (size - len < qnameLen + 10) {
  ------------------
  |  Branch (4651:21): [True: 40, False: 5.21k]
  ------------------
 4652|     40|                    if ((size - len > 4) && (buf[len - 1] != '.'))
  ------------------
  |  Branch (4652:25): [True: 40, False: 0]
  |  Branch (4652:45): [True: 40, False: 0]
  ------------------
 4653|     40|                        strcat(buf, " ...");
 4654|     40|                    return;
 4655|     40|                }
 4656|  5.21k|		if ((cur->ns != NULL) && (cur->ns->prefix != NULL)) {
  ------------------
  |  Branch (4656:7): [True: 2.37k, False: 2.84k]
  |  Branch (4656:28): [True: 343, False: 2.03k]
  ------------------
 4657|    343|		    strcat(buf, (char *) cur->ns->prefix);
 4658|    343|		    strcat(buf, ":");
 4659|    343|		}
 4660|  5.21k|                if (cur->name != NULL)
  ------------------
  |  Branch (4660:21): [True: 5.21k, False: 0]
  ------------------
 4661|  5.21k|	            strcat(buf, (char *) cur->name);
 4662|  5.21k|		if (cur->next != NULL)
  ------------------
  |  Branch (4662:7): [True: 3.69k, False: 1.52k]
  ------------------
 4663|  3.69k|		    strcat(buf, " ");
 4664|  5.21k|		break;
 4665|  5.25k|            }
 4666|  4.37k|            case XML_TEXT_NODE:
  ------------------
  |  Branch (4666:13): [True: 4.37k, False: 8.60k]
  ------------------
 4667|  4.37k|		if (xmlIsBlankNode(cur))
  ------------------
  |  Branch (4667:7): [True: 973, False: 3.40k]
  ------------------
 4668|    973|		    break;
 4669|       |                /* Falls through. */
 4670|  4.51k|            case XML_CDATA_SECTION_NODE:
  ------------------
  |  Branch (4670:13): [True: 1.10k, False: 11.8k]
  ------------------
 4671|  4.81k|            case XML_ENTITY_REF_NODE:
  ------------------
  |  Branch (4671:13): [True: 297, False: 12.6k]
  ------------------
 4672|  4.81k|	        strcat(buf, "CDATA");
 4673|  4.81k|		if (cur->next != NULL)
  ------------------
  |  Branch (4673:7): [True: 3.86k, False: 950]
  ------------------
 4674|  3.86k|		    strcat(buf, " ");
 4675|  4.81k|		break;
 4676|      0|            case XML_ATTRIBUTE_NODE:
  ------------------
  |  Branch (4676:13): [True: 0, False: 12.9k]
  ------------------
 4677|      0|            case XML_DOCUMENT_NODE:
  ------------------
  |  Branch (4677:13): [True: 0, False: 12.9k]
  ------------------
 4678|      0|	    case XML_HTML_DOCUMENT_NODE:
  ------------------
  |  Branch (4678:6): [True: 0, False: 12.9k]
  ------------------
 4679|      0|            case XML_DOCUMENT_TYPE_NODE:
  ------------------
  |  Branch (4679:13): [True: 0, False: 12.9k]
  ------------------
 4680|      0|            case XML_DOCUMENT_FRAG_NODE:
  ------------------
  |  Branch (4680:13): [True: 0, False: 12.9k]
  ------------------
 4681|      0|            case XML_NOTATION_NODE:
  ------------------
  |  Branch (4681:13): [True: 0, False: 12.9k]
  ------------------
 4682|      0|	    case XML_NAMESPACE_DECL:
  ------------------
  |  Branch (4682:6): [True: 0, False: 12.9k]
  ------------------
 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: 12.9k]
  ------------------
 4688|    435|            case XML_PI_NODE:
  ------------------
  |  Branch (4688:13): [True: 435, False: 12.5k]
  ------------------
 4689|    435|            case XML_DTD_NODE:
  ------------------
  |  Branch (4689:13): [True: 0, False: 12.9k]
  ------------------
 4690|  1.94k|            case XML_COMMENT_NODE:
  ------------------
  |  Branch (4690:13): [True: 1.50k, False: 11.4k]
  ------------------
 4691|  1.94k|	    case XML_ELEMENT_DECL:
  ------------------
  |  Branch (4691:6): [True: 0, False: 12.9k]
  ------------------
 4692|  1.94k|	    case XML_ATTRIBUTE_DECL:
  ------------------
  |  Branch (4692:6): [True: 0, False: 12.9k]
  ------------------
 4693|  1.94k|	    case XML_ENTITY_DECL:
  ------------------
  |  Branch (4693:6): [True: 0, False: 12.9k]
  ------------------
 4694|  1.94k|	    case XML_XINCLUDE_START:
  ------------------
  |  Branch (4694:6): [True: 0, False: 12.9k]
  ------------------
 4695|  1.94k|	    case XML_XINCLUDE_END:
  ------------------
  |  Branch (4695:6): [True: 0, False: 12.9k]
  ------------------
 4696|  1.94k|		break;
 4697|  12.9k|	}
 4698|  12.9k|	cur = cur->next;
 4699|  12.9k|    }
 4700|  2.68k|    if (glob) {
  ------------------
  |  Branch (4700:9): [True: 2.68k, False: 0]
  ------------------
 4701|  2.68k|        len = strlen(buf);
 4702|  2.68k|        if (size - len > 1)
  ------------------
  |  Branch (4702:13): [True: 2.68k, False: 0]
  ------------------
 4703|  2.68k|            strcat(buf, ")");
 4704|  2.68k|    }
 4705|  2.68k|}
valid.c:xmlValidateCheckRefCallback:
 5974|    205|xmlValidateCheckRefCallback(void *payload, void *data, const xmlChar *name) {
 5975|    205|    xmlListPtr ref_list = (xmlListPtr) payload;
 5976|    205|    xmlValidCtxtPtr ctxt = (xmlValidCtxtPtr) data;
 5977|    205|    xmlValidateMemo memo;
 5978|       |
 5979|    205|    if (ref_list == NULL)
  ------------------
  |  Branch (5979:9): [True: 0, False: 205]
  ------------------
 5980|      0|	return;
 5981|    205|    memo.ctxt = ctxt;
 5982|    205|    memo.name = name;
 5983|       |
 5984|    205|    xmlListWalk(ref_list, xmlWalkValidateList, &memo);
 5985|       |
 5986|    205|}
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: 727, False: 824]
  |  Branch (5886:32): [True: 0, False: 727]
  ------------------
 5887|      0|	return;
 5888|  1.55k|    attr = ref->attr;
 5889|  1.55k|    if (attr == NULL) {
  ------------------
  |  Branch (5889:9): [True: 727, False: 824]
  ------------------
 5890|    727|	xmlChar *dup, *str = NULL, *cur, save;
 5891|       |
 5892|    727|	dup = xmlStrdup(name);
 5893|    727|	if (dup == NULL) {
  ------------------
  |  Branch (5893:6): [True: 1, False: 726]
  ------------------
 5894|      1|            xmlVErrMemory(ctxt);
 5895|      1|	    return;
 5896|      1|	}
 5897|    726|	cur = dup;
 5898|  1.50k|	while (*cur != 0) {
  ------------------
  |  Branch (5898:9): [True: 1.38k, False: 128]
  ------------------
 5899|  1.38k|	    str = cur;
 5900|  7.80k|	    while ((*cur != 0) && (!IS_BLANK_CH(*cur))) cur++;
  ------------------
  |  |  137|  7.20k|#define IS_BLANK_CH(c)  xmlIsBlank_ch(c)
  |  |  ------------------
  |  |  |  |   90|  7.20k|#define xmlIsBlank_ch(c)	(((c) == 0x20) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (90:27): [True: 576, False: 6.63k]
  |  |  |  |  ------------------
  |  |  |  |   91|  7.20k|				 ((0x9 <= (c)) && ((c) <= 0xa)) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (91:7): [True: 6.63k, False: 0]
  |  |  |  |  |  Branch (91:23): [True: 194, False: 6.43k]
  |  |  |  |  ------------------
  |  |  |  |   92|  7.20k|				 ((c) == 0xd))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (92:6): [True: 13, False: 6.42k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (5900:13): [True: 7.20k, False: 598]
  ------------------
 5901|  1.38k|	    save = *cur;
 5902|  1.38k|	    *cur = 0;
 5903|  1.38k|	    id = xmlGetID(ctxt->doc, str);
 5904|  1.38k|	    if (id == NULL) {
  ------------------
  |  Branch (5904:10): [True: 1.16k, False: 220]
  ------------------
 5905|  1.16k|		xmlErrValidNodeNr(ctxt, NULL, XML_DTD_UNKNOWN_ID,
 5906|  1.16k|	   "attribute %s line %d references an unknown ID \"%s\"\n",
 5907|  1.16k|		       ref->name, ref->lineno, str);
 5908|  1.16k|		ctxt->valid = 0;
 5909|  1.16k|	    }
 5910|  1.38k|	    if (save == 0)
  ------------------
  |  Branch (5910:10): [True: 598, False: 783]
  ------------------
 5911|    598|		break;
 5912|    783|	    *cur = save;
 5913|  1.18k|	    while (IS_BLANK_CH(*cur)) cur++;
 5914|    783|	}
 5915|    726|	xmlFree(dup);
 5916|    824|    } else if (attr->atype == XML_ATTRIBUTE_IDREF) {
  ------------------
  |  Branch (5916:16): [True: 707, False: 117]
  ------------------
 5917|    707|	id = xmlGetID(ctxt->doc, name);
 5918|    707|	if (id == NULL) {
  ------------------
  |  Branch (5918:6): [True: 364, False: 343]
  ------------------
 5919|    364|	    xmlErrValidNode(ctxt, attr->parent, XML_DTD_UNKNOWN_ID,
 5920|    364|	   "IDREF attribute %s references an unknown ID \"%s\"\n",
 5921|    364|		   attr->name, name, NULL);
 5922|    364|	    ctxt->valid = 0;
 5923|    364|	}
 5924|    707|    } else if (attr->atype == XML_ATTRIBUTE_IDREFS) {
  ------------------
  |  Branch (5924:16): [True: 117, False: 0]
  ------------------
 5925|    117|	xmlChar *dup, *str = NULL, *cur, save;
 5926|       |
 5927|    117|	dup = xmlStrdup(name);
 5928|    117|	if (dup == NULL) {
  ------------------
  |  Branch (5928:6): [True: 1, False: 116]
  ------------------
 5929|      1|	    xmlVErrMemory(ctxt);
 5930|      1|	    ctxt->valid = 0;
 5931|      1|	    return;
 5932|      1|	}
 5933|    116|	cur = dup;
 5934|  1.04k|	while (*cur != 0) {
  ------------------
  |  Branch (5934:9): [True: 1.03k, False: 14]
  ------------------
 5935|  1.03k|	    str = cur;
 5936|  6.20k|	    while ((*cur != 0) && (!IS_BLANK_CH(*cur))) cur++;
  ------------------
  |  |  137|  6.10k|#define IS_BLANK_CH(c)  xmlIsBlank_ch(c)
  |  |  ------------------
  |  |  |  |   90|  6.10k|#define xmlIsBlank_ch(c)	(((c) == 0x20) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (90:27): [True: 672, False: 5.42k]
  |  |  |  |  ------------------
  |  |  |  |   91|  6.10k|				 ((0x9 <= (c)) && ((c) <= 0xa)) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (91:7): [True: 5.42k, False: 0]
  |  |  |  |  |  Branch (91:23): [True: 199, False: 5.22k]
  |  |  |  |  ------------------
  |  |  |  |   92|  6.10k|				 ((c) == 0xd))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (92:6): [True: 61, False: 5.16k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (5936:13): [True: 6.10k, False: 102]
  ------------------
 5937|  1.03k|	    save = *cur;
 5938|  1.03k|	    *cur = 0;
 5939|  1.03k|	    id = xmlGetID(ctxt->doc, str);
 5940|  1.03k|	    if (id == NULL) {
  ------------------
  |  Branch (5940:10): [True: 1.03k, False: 0]
  ------------------
 5941|  1.03k|		xmlErrValidNode(ctxt, attr->parent, XML_DTD_UNKNOWN_ID,
 5942|  1.03k|	   "IDREFS attribute %s references an unknown ID \"%s\"\n",
 5943|  1.03k|			     attr->name, str, NULL);
 5944|  1.03k|		ctxt->valid = 0;
 5945|  1.03k|	    }
 5946|  1.03k|	    if (save == 0)
  ------------------
  |  Branch (5946:10): [True: 102, False: 932]
  ------------------
 5947|    102|		break;
 5948|    932|	    *cur = save;
 5949|  1.38k|	    while (IS_BLANK_CH(*cur)) cur++;
 5950|    932|	}
 5951|    116|	xmlFree(dup);
 5952|    116|    }
 5953|  1.55k|}
valid.c:xmlValidateAttributeCallback:
 6150|  10.3k|	                     const xmlChar *name ATTRIBUTE_UNUSED) {
 6151|  10.3k|    xmlAttributePtr cur = (xmlAttributePtr) payload;
 6152|  10.3k|    xmlValidCtxtPtr ctxt = (xmlValidCtxtPtr) data;
 6153|  10.3k|    xmlDocPtr doc;
 6154|  10.3k|    xmlElementPtr elem = NULL;
 6155|       |
 6156|  10.3k|    if (cur == NULL)
  ------------------
  |  Branch (6156:9): [True: 0, False: 10.3k]
  ------------------
 6157|      0|	return;
 6158|  10.3k|    if (cur->atype == XML_ATTRIBUTE_NOTATION) {
  ------------------
  |  Branch (6158:9): [True: 189, False: 10.1k]
  ------------------
 6159|    189|        const xmlChar *elemLocalName;
 6160|    189|        xmlChar *elemPrefix;
 6161|       |
 6162|    189|	doc = cur->doc;
 6163|    189|	if (cur->elem == NULL) {
  ------------------
  |  Branch (6163:6): [True: 0, False: 189]
  ------------------
 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|    189|        elemLocalName = xmlSplitQName4(cur->elem, &elemPrefix);
 6171|    189|        if (elemLocalName == NULL) {
  ------------------
  |  Branch (6171:13): [True: 1, False: 188]
  ------------------
 6172|      1|            xmlVErrMemory(ctxt);
 6173|      1|            return;
 6174|      1|        }
 6175|       |
 6176|    188|	if ((doc != NULL) && (doc->intSubset != NULL))
  ------------------
  |  Branch (6176:6): [True: 188, False: 0]
  |  Branch (6176:23): [True: 188, False: 0]
  ------------------
 6177|    188|	    elem = xmlHashLookup2(doc->intSubset->elements,
 6178|    188|                                  elemLocalName, elemPrefix);
 6179|    188|	if ((elem == NULL) && (doc != NULL) && (doc->extSubset != NULL))
  ------------------
  |  Branch (6179:6): [True: 55, False: 133]
  |  Branch (6179:24): [True: 55, False: 0]
  |  Branch (6179:41): [True: 55, False: 0]
  ------------------
 6180|     55|	    elem = xmlHashLookup2(doc->extSubset->elements,
 6181|     55|                                  elemLocalName, elemPrefix);
 6182|    188|	if ((elem == NULL) && (cur->parent != NULL) &&
  ------------------
  |  Branch (6182:6): [True: 0, False: 188]
  |  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|    188|        xmlFree(elemPrefix);
 6188|       |
 6189|    188|	if (elem == NULL) {
  ------------------
  |  Branch (6189:6): [True: 0, False: 188]
  ------------------
 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|    188|	if (elem->etype == XML_ELEMENT_TYPE_EMPTY) {
  ------------------
  |  Branch (6195:6): [True: 19, False: 169]
  ------------------
 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|    188|    }
 6202|  10.3k|}
valid.c:xmlValidateNotationCallback:
 6129|  3.95k|	                    const xmlChar *name ATTRIBUTE_UNUSED) {
 6130|  3.95k|    xmlEntityPtr cur = (xmlEntityPtr) payload;
 6131|  3.95k|    xmlValidCtxtPtr ctxt = (xmlValidCtxtPtr) data;
 6132|  3.95k|    if (cur == NULL)
  ------------------
  |  Branch (6132:9): [True: 0, False: 3.95k]
  ------------------
 6133|      0|	return;
 6134|  3.95k|    if (cur->etype == XML_EXTERNAL_GENERAL_UNPARSED_ENTITY) {
  ------------------
  |  Branch (6134:9): [True: 166, False: 3.79k]
  ------------------
 6135|    166|	xmlChar *notation = cur->content;
 6136|       |
 6137|    166|	if (notation != NULL) {
  ------------------
  |  Branch (6137:6): [True: 149, False: 17]
  ------------------
 6138|    149|	    int ret;
 6139|       |
 6140|    149|	    ret = xmlValidateNotationUse(ctxt, cur->doc, notation);
 6141|    149|	    if (ret != 1) {
  ------------------
  |  Branch (6141:10): [True: 126, False: 23]
  ------------------
 6142|    126|		ctxt->valid = 0;
 6143|    126|	    }
 6144|    149|	}
 6145|    166|    }
 6146|  3.95k|}

xmlXIncludeNewContext:
  258|  7.90k|xmlXIncludeNewContext(xmlDoc *doc) {
  259|  7.90k|    xmlXIncludeCtxtPtr ret;
  260|       |
  261|  7.90k|    if (doc == NULL)
  ------------------
  |  Branch (261:9): [True: 0, False: 7.90k]
  ------------------
  262|      0|	return(NULL);
  263|  7.90k|    ret = (xmlXIncludeCtxtPtr) xmlMalloc(sizeof(xmlXIncludeCtxt));
  264|  7.90k|    if (ret == NULL)
  ------------------
  |  Branch (264:9): [True: 1, False: 7.90k]
  ------------------
  265|      1|	return(NULL);
  266|  7.90k|    memset(ret, 0, sizeof(xmlXIncludeCtxt));
  267|  7.90k|    ret->doc = doc;
  268|  7.90k|    ret->incNr = 0;
  269|  7.90k|    ret->incMax = 0;
  270|       |    ret->incTab = NULL;
  271|  7.90k|    ret->nbErrors = 0;
  272|  7.90k|    return(ret);
  273|  7.90k|}
xmlXIncludeFreeContext:
  281|  7.90k|xmlXIncludeFreeContext(xmlXIncludeCtxt *ctxt) {
  282|  7.90k|    int i;
  283|       |
  284|  7.90k|    if (ctxt == NULL)
  ------------------
  |  Branch (284:9): [True: 0, False: 7.90k]
  ------------------
  285|      0|	return;
  286|  7.90k|    if (ctxt->urlTab != NULL) {
  ------------------
  |  Branch (286:9): [True: 7.57k, False: 337]
  ------------------
  287|  16.0k|	for (i = 0; i < ctxt->urlNr; i++) {
  ------------------
  |  Branch (287:14): [True: 8.43k, False: 7.57k]
  ------------------
  288|  8.43k|	    xmlFreeDoc(ctxt->urlTab[i].doc);
  289|  8.43k|	    xmlFree(ctxt->urlTab[i].url);
  290|  8.43k|	}
  291|  7.57k|	xmlFree(ctxt->urlTab);
  292|  7.57k|    }
  293|  7.90k|    for (i = 0;i < ctxt->incNr;i++) {
  ------------------
  |  Branch (293:16): [True: 0, False: 7.90k]
  ------------------
  294|      0|	if (ctxt->incTab[i] != NULL)
  ------------------
  |  Branch (294:6): [True: 0, False: 0]
  ------------------
  295|      0|	    xmlXIncludeFreeRef(ctxt->incTab[i]);
  296|      0|    }
  297|  7.90k|    if (ctxt->incTab != NULL)
  ------------------
  |  Branch (297:9): [True: 7.82k, False: 85]
  ------------------
  298|  7.82k|	xmlFree(ctxt->incTab);
  299|  7.90k|    if (ctxt->txtTab != NULL) {
  ------------------
  |  Branch (299:9): [True: 40, False: 7.86k]
  ------------------
  300|     78|	for (i = 0;i < ctxt->txtNr;i++) {
  ------------------
  |  Branch (300:13): [True: 38, False: 40]
  ------------------
  301|     38|	    xmlFree(ctxt->txtTab[i].text);
  302|     38|	    xmlFree(ctxt->txtTab[i].url);
  303|     38|	}
  304|     40|	xmlFree(ctxt->txtTab);
  305|     40|    }
  306|  7.90k|#ifdef LIBXML_XPTR_ENABLED
  307|  7.90k|    if (ctxt->xpctxt != NULL)
  ------------------
  |  Branch (307:9): [True: 6.27k, False: 1.63k]
  ------------------
  308|  6.27k|	xmlXPathFreeContext(ctxt->xpctxt);
  309|  7.90k|#endif
  310|  7.90k|    xmlFree(ctxt);
  311|  7.90k|}
xmlXIncludeGetLastError:
 1975|  11.6k|xmlXIncludeGetLastError(xmlXIncludeCtxt *ctxt) {
 1976|  11.6k|    if (ctxt == NULL)
  ------------------
  |  Branch (1976:9): [True: 0, False: 11.6k]
  ------------------
 1977|      0|        return(XML_ERR_ARGUMENT);
 1978|  11.6k|    return(ctxt->errNo);
 1979|  11.6k|}
xmlXIncludeSetErrorHandler:
 1992|  7.90k|                           xmlStructuredErrorFunc handler, void *data) {
 1993|  7.90k|    if (ctxt == NULL)
  ------------------
  |  Branch (1993:9): [True: 0, False: 7.90k]
  ------------------
 1994|      0|        return;
 1995|  7.90k|    ctxt->errorHandler = handler;
 1996|  7.90k|    ctxt->errorCtxt = data;
 1997|  7.90k|}
xmlXIncludeSetResourceLoader:
 2010|  7.90k|                             xmlResourceLoader loader, void *data) {
 2011|  7.90k|    if (ctxt == NULL)
  ------------------
  |  Branch (2011:9): [True: 0, False: 7.90k]
  ------------------
 2012|      0|        return;
 2013|  7.90k|    ctxt->resourceLoader = loader;
 2014|  7.90k|    ctxt->resourceCtxt = data;
 2015|  7.90k|}
xmlXIncludeSetFlags:
 2025|  7.90k|xmlXIncludeSetFlags(xmlXIncludeCtxt *ctxt, int flags) {
 2026|  7.90k|    if (ctxt == NULL)
  ------------------
  |  Branch (2026:9): [True: 0, False: 7.90k]
  ------------------
 2027|      0|        return(-1);
 2028|  7.90k|    ctxt->parseFlags = flags;
 2029|  7.90k|    return(0);
 2030|  7.90k|}
xmlXIncludeSetStreamingMode:
 2040|  7.90k|xmlXIncludeSetStreamingMode(xmlXIncludeCtxt *ctxt, int mode) {
 2041|  7.90k|    if (ctxt == NULL)
  ------------------
  |  Branch (2041:9): [True: 0, False: 7.90k]
  ------------------
 2042|      0|        return(-1);
 2043|  7.90k|    ctxt->isStream = !!mode;
 2044|  7.90k|    return(0);
 2045|  7.90k|}
xmlXIncludeProcessNode:
 2177|  13.8k|xmlXIncludeProcessNode(xmlXIncludeCtxt *ctxt, xmlNode *node) {
 2178|  13.8k|    int ret = 0;
 2179|       |
 2180|  13.8k|    if ((node == NULL) || (node->type == XML_NAMESPACE_DECL) ||
  ------------------
  |  Branch (2180:9): [True: 0, False: 13.8k]
  |  Branch (2180:27): [True: 0, False: 13.8k]
  ------------------
 2181|  13.8k|        (node->doc == NULL) || (ctxt == NULL))
  ------------------
  |  Branch (2181:9): [True: 0, False: 13.8k]
  |  Branch (2181:32): [True: 0, False: 13.8k]
  ------------------
 2182|      0|	return(-1);
 2183|  13.8k|    ret = xmlXIncludeDoProcessRoot(ctxt, node);
 2184|  13.8k|    if ((ret >= 0) && (ctxt->nbErrors > 0))
  ------------------
  |  Branch (2184:9): [True: 13.8k, False: 0]
  |  Branch (2184:23): [True: 11.6k, False: 2.15k]
  ------------------
 2185|  11.6k|	ret = -1;
 2186|  13.8k|    return(ret);
 2187|  13.8k|}
xinclude.c:xmlXIncludeFreeRef:
  239|  35.6k|xmlXIncludeFreeRef(xmlXIncludeRefPtr ref) {
  240|  35.6k|    if (ref == NULL)
  ------------------
  |  Branch (240:9): [True: 18.3k, False: 17.2k]
  ------------------
  241|  18.3k|	return;
  242|  17.2k|    if (ref->URI != NULL)
  ------------------
  |  Branch (242:9): [True: 17.2k, False: 0]
  ------------------
  243|  17.2k|	xmlFree(ref->URI);
  244|  17.2k|    if (ref->fragment != NULL)
  ------------------
  |  Branch (244:9): [True: 11.0k, False: 6.19k]
  ------------------
  245|  11.0k|	xmlFree(ref->fragment);
  246|  17.2k|    if (ref->base != NULL)
  ------------------
  |  Branch (246:9): [True: 9.32k, False: 7.89k]
  ------------------
  247|  9.32k|	xmlFree(ref->base);
  248|  17.2k|    xmlFree(ref);
  249|  17.2k|}
xinclude.c:xmlXIncludeDoProcessRoot:
 1959|  13.8k|xmlXIncludeDoProcessRoot(xmlXIncludeCtxtPtr ctxt, xmlNodePtr tree) {
 1960|  13.8k|    if ((tree == NULL) || (tree->type == XML_NAMESPACE_DECL))
  ------------------
  |  Branch (1960:9): [True: 0, False: 13.8k]
  |  Branch (1960:27): [True: 0, False: 13.8k]
  ------------------
 1961|      0|	return(-1);
 1962|  13.8k|    if (ctxt == NULL)
  ------------------
  |  Branch (1962:9): [True: 0, False: 13.8k]
  ------------------
 1963|      0|	return(-1);
 1964|       |
 1965|  13.8k|    return(xmlXIncludeDoProcess(ctxt, tree));
 1966|  13.8k|}
xinclude.c:xmlXIncludeDoProcess:
 1878|  20.7k|xmlXIncludeDoProcess(xmlXIncludeCtxtPtr ctxt, xmlNodePtr tree) {
 1879|  20.7k|    xmlXIncludeRefPtr ref;
 1880|  20.7k|    xmlNodePtr cur;
 1881|  20.7k|    int ret = 0;
 1882|  20.7k|    int i, start;
 1883|       |
 1884|       |    /*
 1885|       |     * First phase: lookup the elements in the document
 1886|       |     */
 1887|  20.7k|    start = ctxt->incNr;
 1888|  20.7k|    cur = tree;
 1889|   566k|    do {
 1890|       |	/* TODO: need to work on entities -> stack */
 1891|   566k|        if (xmlXIncludeTestNode(ctxt, cur) == 1) {
  ------------------
  |  Branch (1891:13): [True: 20.8k, False: 545k]
  ------------------
 1892|  20.8k|            ref = xmlXIncludeExpandNode(ctxt, cur);
 1893|       |            /*
 1894|       |             * Mark direct includes.
 1895|       |             */
 1896|  20.8k|            if (ref != NULL)
  ------------------
  |  Branch (1896:17): [True: 16.8k, False: 4.00k]
  ------------------
 1897|  16.8k|                ref->replace = 1;
 1898|   545k|        } else if ((cur->children != NULL) &&
  ------------------
  |  Branch (1898:20): [True: 158k, False: 387k]
  ------------------
 1899|   158k|                   ((cur->type == XML_DOCUMENT_NODE) ||
  ------------------
  |  Branch (1899:21): [True: 0, False: 158k]
  ------------------
 1900|   158k|                    (cur->type == XML_ELEMENT_NODE))) {
  ------------------
  |  Branch (1900:21): [True: 157k, False: 271]
  ------------------
 1901|   157k|            cur = cur->children;
 1902|   157k|            continue;
 1903|   157k|        }
 1904|   566k|        do {
 1905|   566k|            if (cur == tree)
  ------------------
  |  Branch (1905:17): [True: 20.7k, False: 545k]
  ------------------
 1906|  20.7k|                break;
 1907|   545k|            if (cur->next != NULL) {
  ------------------
  |  Branch (1907:17): [True: 387k, False: 157k]
  ------------------
 1908|   387k|                cur = cur->next;
 1909|   387k|                break;
 1910|   387k|            }
 1911|   157k|            cur = cur->parent;
 1912|   157k|        } while (cur != NULL);
  ------------------
  |  Branch (1912:18): [True: 157k, False: 0]
  ------------------
 1913|   566k|    } while ((cur != NULL) && (cur != tree));
  ------------------
  |  Branch (1913:14): [True: 566k, False: 0]
  |  Branch (1913:31): [True: 545k, False: 20.7k]
  ------------------
 1914|       |
 1915|       |    /*
 1916|       |     * Second phase: extend the original document infoset.
 1917|       |     */
 1918|  37.9k|    for (i = start; i < ctxt->incNr; i++) {
  ------------------
  |  Branch (1918:21): [True: 17.1k, False: 20.7k]
  ------------------
 1919|  17.1k|	if (ctxt->incTab[i]->replace != 0) {
  ------------------
  |  Branch (1919:6): [True: 16.8k, False: 331]
  ------------------
 1920|  16.8k|            xmlXIncludeIncludeNode(ctxt, ctxt->incTab[i]);
 1921|  16.8k|            ctxt->incTab[i]->replace = 0;
 1922|  16.8k|        } else {
 1923|       |            /*
 1924|       |             * Ignore includes which were added indirectly, for example
 1925|       |             * inside xi:fallback elements.
 1926|       |             */
 1927|    331|            if (ctxt->incTab[i]->inc != NULL) {
  ------------------
  |  Branch (1927:17): [True: 239, False: 92]
  ------------------
 1928|    239|                xmlFreeNodeList(ctxt->incTab[i]->inc);
 1929|    239|                ctxt->incTab[i]->inc = NULL;
 1930|    239|            }
 1931|    331|        }
 1932|  17.1k|	ret++;
 1933|  17.1k|    }
 1934|       |
 1935|  20.7k|    if (ctxt->isStream) {
  ------------------
  |  Branch (1935:9): [True: 13.8k, False: 6.87k]
  ------------------
 1936|       |        /*
 1937|       |         * incTab references nodes which will eventually be deleted in
 1938|       |         * streaming mode. The table is only required for XPointer
 1939|       |         * expressions which aren't allowed in streaming mode.
 1940|       |         */
 1941|  26.5k|        for (i = 0;i < ctxt->incNr;i++) {
  ------------------
  |  Branch (1941:20): [True: 12.6k, False: 13.8k]
  ------------------
 1942|  12.6k|            xmlXIncludeFreeRef(ctxt->incTab[i]);
 1943|  12.6k|        }
 1944|  13.8k|        ctxt->incNr = 0;
 1945|  13.8k|    }
 1946|       |
 1947|  20.7k|    return(ret);
 1948|  20.7k|}
xinclude.c:xmlXIncludeTestNode:
 1808|   566k|xmlXIncludeTestNode(xmlXIncludeCtxtPtr ctxt, xmlNodePtr node) {
 1809|   566k|    if (node == NULL)
  ------------------
  |  Branch (1809:9): [True: 0, False: 566k]
  ------------------
 1810|      0|	return(0);
 1811|   566k|    if (node->type != XML_ELEMENT_NODE)
  ------------------
  |  Branch (1811:9): [True: 296k, False: 269k]
  ------------------
 1812|   296k|	return(0);
 1813|   269k|    if (node->ns == NULL)
  ------------------
  |  Branch (1813:9): [True: 211k, False: 58.4k]
  ------------------
 1814|   211k|	return(0);
 1815|  58.4k|    if ((xmlStrEqual(node->ns->href, XINCLUDE_NS)) ||
  ------------------
  |  |   30|  58.4k|#define XINCLUDE_NS (const xmlChar *) "http://www.w3.org/2003/XInclude"
  ------------------
  |  Branch (1815:9): [True: 9.02k, False: 49.4k]
  ------------------
 1816|  49.4k|        (xmlStrEqual(node->ns->href, XINCLUDE_OLD_NS))) {
  ------------------
  |  |   34|  49.4k|#define XINCLUDE_OLD_NS (const xmlChar *) "http://www.w3.org/2001/XInclude"
  ------------------
  |  Branch (1816:9): [True: 17.2k, False: 32.2k]
  ------------------
 1817|  26.2k|	if (xmlStrEqual(node->ns->href, XINCLUDE_OLD_NS)) {
  ------------------
  |  |   34|  26.2k|#define XINCLUDE_OLD_NS (const xmlChar *) "http://www.w3.org/2001/XInclude"
  ------------------
  |  Branch (1817:6): [True: 17.2k, False: 9.02k]
  ------------------
 1818|  17.2k|	    if (ctxt->legacy == 0) {
  ------------------
  |  Branch (1818:10): [True: 4.99k, False: 12.2k]
  ------------------
 1819|  4.99k|	        ctxt->legacy = 1;
 1820|  4.99k|	    }
 1821|  17.2k|	}
 1822|  26.2k|	if (xmlStrEqual(node->name, XINCLUDE_NODE)) {
  ------------------
  |  |   38|  26.2k|#define XINCLUDE_NODE (const xmlChar *) "include"
  ------------------
  |  Branch (1822:6): [True: 23.4k, False: 2.82k]
  ------------------
 1823|  23.4k|	    xmlNodePtr child = node->children;
 1824|  23.4k|	    int nb_fallback = 0;
 1825|       |
 1826|  45.4k|	    while (child != NULL) {
  ------------------
  |  Branch (1826:13): [True: 24.3k, False: 21.0k]
  ------------------
 1827|  24.3k|		if ((child->type == XML_ELEMENT_NODE) &&
  ------------------
  |  Branch (1827:7): [True: 11.1k, False: 13.2k]
  ------------------
 1828|  11.1k|		    (child->ns != NULL) &&
  ------------------
  |  Branch (1828:7): [True: 10.1k, False: 940]
  ------------------
 1829|  10.1k|		    ((xmlStrEqual(child->ns->href, XINCLUDE_NS)) ||
  ------------------
  |  |   30|  10.1k|#define XINCLUDE_NS (const xmlChar *) "http://www.w3.org/2003/XInclude"
  ------------------
  |  Branch (1829:8): [True: 6.54k, False: 3.65k]
  ------------------
 1830|  9.79k|		     (xmlStrEqual(child->ns->href, XINCLUDE_OLD_NS)))) {
  ------------------
  |  |   34|  3.65k|#define XINCLUDE_OLD_NS (const xmlChar *) "http://www.w3.org/2001/XInclude"
  ------------------
  |  Branch (1830:8): [True: 3.25k, False: 404]
  ------------------
 1831|  9.79k|		    if (xmlStrEqual(child->name, XINCLUDE_NODE)) {
  ------------------
  |  |   38|  9.79k|#define XINCLUDE_NODE (const xmlChar *) "include"
  ------------------
  |  Branch (1831:11): [True: 2.35k, False: 7.44k]
  ------------------
 1832|  2.35k|			xmlXIncludeErr(ctxt, node,
 1833|  2.35k|			               XML_XINCLUDE_INCLUDE_IN_INCLUDE,
 1834|  2.35k|				       "%s has an 'include' child\n",
 1835|  2.35k|				       XINCLUDE_NODE);
  ------------------
  |  |   38|  2.35k|#define XINCLUDE_NODE (const xmlChar *) "include"
  ------------------
 1836|  2.35k|			return(0);
 1837|  2.35k|		    }
 1838|  7.44k|		    if (xmlStrEqual(child->name, XINCLUDE_FALLBACK)) {
  ------------------
  |  |   42|  7.44k|#define XINCLUDE_FALLBACK (const xmlChar *) "fallback"
  ------------------
  |  Branch (1838:11): [True: 815, False: 6.62k]
  ------------------
 1839|    815|			nb_fallback++;
 1840|    815|		    }
 1841|  7.44k|		}
 1842|  22.0k|		child = child->next;
 1843|  22.0k|	    }
 1844|  21.0k|	    if (nb_fallback > 1) {
  ------------------
  |  Branch (1844:10): [True: 207, False: 20.8k]
  ------------------
 1845|    207|		xmlXIncludeErr(ctxt, node, XML_XINCLUDE_FALLBACKS_IN_INCLUDE,
 1846|    207|			       "%s has multiple fallback children\n",
 1847|    207|		               XINCLUDE_NODE);
  ------------------
  |  |   38|    207|#define XINCLUDE_NODE (const xmlChar *) "include"
  ------------------
 1848|    207|		return(0);
 1849|    207|	    }
 1850|  20.8k|	    return(1);
 1851|  21.0k|	}
 1852|  2.82k|	if (xmlStrEqual(node->name, XINCLUDE_FALLBACK)) {
  ------------------
  |  |   42|  2.82k|#define XINCLUDE_FALLBACK (const xmlChar *) "fallback"
  ------------------
  |  Branch (1852:6): [True: 1.27k, False: 1.55k]
  ------------------
 1853|  1.27k|	    if ((node->parent == NULL) ||
  ------------------
  |  Branch (1853:10): [True: 0, False: 1.27k]
  ------------------
 1854|  1.27k|		(node->parent->type != XML_ELEMENT_NODE) ||
  ------------------
  |  Branch (1854:3): [True: 3, False: 1.27k]
  ------------------
 1855|  1.27k|		(node->parent->ns == NULL) ||
  ------------------
  |  Branch (1855:3): [True: 114, False: 1.15k]
  ------------------
 1856|  1.15k|		((!xmlStrEqual(node->parent->ns->href, XINCLUDE_NS)) &&
  ------------------
  |  |   30|  1.15k|#define XINCLUDE_NS (const xmlChar *) "http://www.w3.org/2003/XInclude"
  ------------------
  |  Branch (1856:4): [True: 666, False: 492]
  ------------------
 1857|    666|		 (!xmlStrEqual(node->parent->ns->href, XINCLUDE_OLD_NS))) ||
  ------------------
  |  |   34|    666|#define XINCLUDE_OLD_NS (const xmlChar *) "http://www.w3.org/2001/XInclude"
  ------------------
  |  Branch (1857:4): [True: 148, False: 518]
  ------------------
 1858|  1.01k|		(!xmlStrEqual(node->parent->name, XINCLUDE_NODE))) {
  ------------------
  |  |   38|  1.01k|#define XINCLUDE_NODE (const xmlChar *) "include"
  ------------------
  |  Branch (1858:3): [True: 339, False: 671]
  ------------------
 1859|    604|		xmlXIncludeErr(ctxt, node,
 1860|    604|		               XML_XINCLUDE_FALLBACK_NOT_IN_INCLUDE,
 1861|    604|			       "%s is not the child of an 'include'\n",
 1862|    604|			       XINCLUDE_FALLBACK);
  ------------------
  |  |   42|    604|#define XINCLUDE_FALLBACK (const xmlChar *) "fallback"
  ------------------
 1863|    604|	    }
 1864|  1.27k|	}
 1865|  2.82k|    }
 1866|  35.0k|    return(0);
 1867|  58.4k|}
xinclude.c:xmlXIncludeErr:
  161|  24.4k|{
  162|  24.4k|    xmlStructuredErrorFunc schannel = NULL;
  163|  24.4k|    xmlGenericErrorFunc channel = NULL;
  164|  24.4k|    void *data = NULL;
  165|  24.4k|    int res;
  166|       |
  167|  24.4k|    if (error == XML_ERR_NO_MEMORY) {
  ------------------
  |  Branch (167:9): [True: 122, False: 24.3k]
  ------------------
  168|    122|        xmlXIncludeErrMemory(ctxt);
  169|    122|        return;
  170|    122|    }
  171|       |
  172|  24.3k|    if (ctxt->fatalErr != 0)
  ------------------
  |  Branch (172:9): [True: 5.82k, False: 18.4k]
  ------------------
  173|  5.82k|        return;
  174|  18.4k|    ctxt->nbErrors++;
  175|       |
  176|  18.4k|    schannel = ctxt->errorHandler;
  177|  18.4k|    data = ctxt->errorCtxt;
  178|       |
  179|  18.4k|    if (schannel == NULL) {
  ------------------
  |  Branch (179:9): [True: 0, False: 18.4k]
  ------------------
  180|      0|        channel = xmlGenericError;
  ------------------
  |  |  976|      0|  #define xmlGenericError (*__xmlGenericError())
  ------------------
  181|      0|        data = xmlGenericErrorContext;
  ------------------
  |  |  983|      0|  #define xmlGenericErrorContext (*__xmlGenericErrorContext())
  ------------------
  182|      0|    }
  183|       |
  184|  18.4k|    res = xmlRaiseError(schannel, channel, data, ctxt, node,
  185|  18.4k|                        XML_FROM_XINCLUDE, error, XML_ERR_ERROR,
  186|  18.4k|                        NULL, 0, (const char *) extra, NULL, NULL, 0, 0,
  187|  18.4k|                        msg, (const char *) extra);
  188|  18.4k|    if (res < 0) {
  ------------------
  |  Branch (188:9): [True: 149, False: 18.3k]
  ------------------
  189|    149|        ctxt->errNo = XML_ERR_NO_MEMORY;
  190|    149|        ctxt->fatalErr = 1;
  191|  18.3k|    } else {
  192|  18.3k|        ctxt->errNo = error;
  193|       |        /*
  194|       |         * Note that we treat IO errors except ENOENT as fatal
  195|       |         * although the XInclude spec could be interpreted in a
  196|       |         * way that at least some IO errors should be handled
  197|       |         * gracefully.
  198|       |         */
  199|  18.3k|        if (xmlIsCatastrophicError(XML_ERR_FATAL, error))
  ------------------
  |  Branch (199:13): [True: 2, False: 18.3k]
  ------------------
  200|      2|            ctxt->fatalErr = 1;
  201|  18.3k|    }
  202|  18.4k|}
xinclude.c:xmlXIncludeErrMemory:
  140|  2.85k|{
  141|  2.85k|    ctxt->errNo = XML_ERR_NO_MEMORY;
  142|  2.85k|    ctxt->fatalErr = 1;
  143|  2.85k|    ctxt->nbErrors++;
  144|       |
  145|  2.85k|    xmlRaiseMemoryError(ctxt->errorHandler, NULL, ctxt->errorCtxt,
  146|       |                        XML_FROM_XINCLUDE, NULL);
  147|  2.85k|}
xinclude.c:xmlXIncludeExpandNode:
 1572|  21.3k|xmlXIncludeExpandNode(xmlXIncludeCtxtPtr ctxt, xmlNodePtr node) {
 1573|  21.3k|    xmlXIncludeRefPtr ref;
 1574|  21.3k|    int i;
 1575|       |
 1576|  21.3k|    if (ctxt->fatalErr)
  ------------------
  |  Branch (1576:9): [True: 375, False: 21.0k]
  ------------------
 1577|    375|        return(NULL);
 1578|  21.0k|    if (ctxt->depth >= XINCLUDE_MAX_DEPTH) {
  ------------------
  |  |   36|  21.0k|#define XINCLUDE_MAX_DEPTH 40
  ------------------
  |  Branch (1578:9): [True: 0, False: 21.0k]
  ------------------
 1579|      0|        xmlXIncludeErr(ctxt, node, XML_XINCLUDE_RECURSION,
 1580|      0|                       "maximum recursion depth exceeded\n", NULL);
 1581|      0|        ctxt->fatalErr = 1;
 1582|      0|        return(NULL);
 1583|      0|    }
 1584|       |
 1585|  21.0k|#ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
 1586|       |    /*
 1587|       |     * The XInclude engine offers no protection against exponential
 1588|       |     * expansion attacks similar to "billion laughs". Avoid timeouts by
 1589|       |     * limiting the total number of replacements when fuzzing.
 1590|       |     *
 1591|       |     * Unfortuately, a single XInclude can already result in quadratic
 1592|       |     * behavior:
 1593|       |     *
 1594|       |     *     <doc xmlns:xi="http://www.w3.org/2001/XInclude">
 1595|       |     *       <xi:include xpointer="xpointer(//e)"/>
 1596|       |     *       <e>
 1597|       |     *         <e>
 1598|       |     *           <e>
 1599|       |     *             <!-- more nested elements -->
 1600|       |     *           </e>
 1601|       |     *         </e>
 1602|       |     *       </e>
 1603|       |     *     </doc>
 1604|       |     */
 1605|  21.0k|    if (ctxt->incTotal >= 20)
  ------------------
  |  Branch (1605:9): [True: 2.43k, False: 18.5k]
  ------------------
 1606|  2.43k|        return(NULL);
 1607|  18.5k|    ctxt->incTotal++;
 1608|  18.5k|#endif
 1609|       |
 1610|  29.3k|    for (i = 0; i < ctxt->incNr; i++) {
  ------------------
  |  Branch (1610:17): [True: 10.8k, False: 18.4k]
  ------------------
 1611|  10.8k|        if (ctxt->incTab[i]->elem == node) {
  ------------------
  |  Branch (1611:13): [True: 153, False: 10.7k]
  ------------------
 1612|    153|            if (ctxt->incTab[i]->expanding) {
  ------------------
  |  Branch (1612:17): [True: 114, False: 39]
  ------------------
 1613|    114|                xmlXIncludeErr(ctxt, node, XML_XINCLUDE_RECURSION,
 1614|    114|                               "inclusion loop detected\n", NULL);
 1615|    114|                return(NULL);
 1616|    114|            }
 1617|     39|            return(ctxt->incTab[i]);
 1618|    153|        }
 1619|  10.8k|    }
 1620|       |
 1621|  18.4k|    ref = xmlXIncludeAddNode(ctxt, node);
 1622|  18.4k|    if (ref == NULL)
  ------------------
  |  Branch (1622:9): [True: 1.22k, False: 17.1k]
  ------------------
 1623|  1.22k|        return(NULL);
 1624|  17.1k|    ref->expanding = 1;
 1625|  17.1k|    ctxt->depth++;
 1626|  17.1k|    xmlXIncludeLoadNode(ctxt, ref);
 1627|  17.1k|    ctxt->depth--;
 1628|  17.1k|    ref->expanding = 0;
 1629|       |
 1630|  17.1k|    return(ref);
 1631|  18.4k|}
xinclude.c:xmlXIncludeAddNode:
  396|  18.4k|xmlXIncludeAddNode(xmlXIncludeCtxtPtr ctxt, xmlNodePtr cur) {
  397|  18.4k|    xmlXIncludeRefPtr ref = NULL;
  398|  18.4k|    xmlXIncludeRefPtr ret = NULL;
  399|  18.4k|    xmlURIPtr uri = NULL;
  400|  18.4k|    xmlChar *href = NULL;
  401|  18.4k|    xmlChar *parse = NULL;
  402|  18.4k|    xmlChar *fragment = NULL;
  403|  18.4k|    xmlChar *base = NULL;
  404|  18.4k|    xmlChar *tmp;
  405|  18.4k|    int xml = 1;
  406|  18.4k|    int local = 0;
  407|  18.4k|    int res;
  408|       |
  409|  18.4k|    if (ctxt == NULL)
  ------------------
  |  Branch (409:9): [True: 0, False: 18.4k]
  ------------------
  410|      0|	return(NULL);
  411|  18.4k|    if (cur == NULL)
  ------------------
  |  Branch (411:9): [True: 0, False: 18.4k]
  ------------------
  412|      0|	return(NULL);
  413|       |
  414|       |    /*
  415|       |     * read the attributes
  416|       |     */
  417|       |
  418|  18.4k|    fragment = xmlXIncludeGetProp(ctxt, cur, XINCLUDE_PARSE_XPOINTER);
  ------------------
  |  |   66|  18.4k|#define XINCLUDE_PARSE_XPOINTER (const xmlChar *) "xpointer"
  ------------------
  419|       |
  420|  18.4k|    href = xmlXIncludeGetProp(ctxt, cur, XINCLUDE_HREF);
  ------------------
  |  |   46|  18.4k|#define XINCLUDE_HREF (const xmlChar *) "href"
  ------------------
  421|  18.4k|    if (href == NULL) {
  ------------------
  |  Branch (421:9): [True: 461, False: 17.9k]
  ------------------
  422|    461|        if (fragment == NULL) {
  ------------------
  |  Branch (422:13): [True: 358, False: 103]
  ------------------
  423|    358|	    xmlXIncludeErr(ctxt, cur, XML_XINCLUDE_NO_HREF,
  424|    358|	                   "href or xpointer must be present\n", parse);
  425|    358|	    goto error;
  426|    358|        }
  427|       |
  428|    103|	href = xmlStrdup(BAD_CAST ""); /* @@@@ href is now optional */
  ------------------
  |  |   34|    103|#define BAD_CAST (xmlChar *)
  ------------------
  429|    103|	if (href == NULL) {
  ------------------
  |  Branch (429:6): [True: 3, False: 100]
  ------------------
  430|      3|            xmlXIncludeErrMemory(ctxt);
  431|      3|	    goto error;
  432|      3|        }
  433|  17.9k|    } else if (xmlStrlen(href) > XML_MAX_URI_LENGTH) {
  ------------------
  |  |   11|  17.9k|#define XML_MAX_URI_LENGTH 2000
  ------------------
  |  Branch (433:16): [True: 20, False: 17.9k]
  ------------------
  434|     20|        xmlXIncludeErr(ctxt, cur, XML_XINCLUDE_HREF_URI, "URI too long\n",
  435|     20|                       NULL);
  436|     20|        goto error;
  437|     20|    }
  438|       |
  439|  18.0k|    parse = xmlXIncludeGetProp(ctxt, cur, XINCLUDE_PARSE);
  ------------------
  |  |   50|  18.0k|#define XINCLUDE_PARSE (const xmlChar *) "parse"
  ------------------
  440|  18.0k|    if (parse != NULL) {
  ------------------
  |  Branch (440:9): [True: 423, False: 17.6k]
  ------------------
  441|    423|	if (xmlStrEqual(parse, XINCLUDE_PARSE_XML))
  ------------------
  |  |   54|    423|#define XINCLUDE_PARSE_XML (const xmlChar *) "xml"
  ------------------
  |  Branch (441:6): [True: 249, False: 174]
  ------------------
  442|    249|	    xml = 1;
  443|    174|	else if (xmlStrEqual(parse, XINCLUDE_PARSE_TEXT))
  ------------------
  |  |   58|    174|#define XINCLUDE_PARSE_TEXT (const xmlChar *) "text"
  ------------------
  |  Branch (443:11): [True: 154, False: 20]
  ------------------
  444|    154|	    xml = 0;
  445|     20|	else {
  446|     20|	    xmlXIncludeErr(ctxt, cur, XML_XINCLUDE_PARSE_VALUE,
  447|     20|	                   "invalid value %s for 'parse'\n", parse);
  448|     20|	    goto error;
  449|     20|	}
  450|    423|    }
  451|       |
  452|       |    /*
  453|       |     * Check the URL and remove any fragment identifier
  454|       |     */
  455|  18.0k|    res = xmlParseURISafe((const char *)href, &uri);
  456|  18.0k|    if (uri == NULL) {
  ------------------
  |  Branch (456:9): [True: 158, False: 17.8k]
  ------------------
  457|    158|        if (res < 0)
  ------------------
  |  Branch (457:13): [True: 38, False: 120]
  ------------------
  458|     38|            xmlXIncludeErrMemory(ctxt);
  459|    120|        else
  460|    120|            xmlXIncludeErr(ctxt, cur, XML_XINCLUDE_HREF_URI,
  461|    120|                           "invalid value href %s\n", href);
  462|    158|        goto error;
  463|    158|    }
  464|       |
  465|  17.8k|    if (uri->fragment != NULL) {
  ------------------
  |  Branch (465:9): [True: 1.56k, False: 16.2k]
  ------------------
  466|  1.56k|        if (ctxt->legacy != 0) {
  ------------------
  |  Branch (466:13): [True: 1.52k, False: 40]
  ------------------
  467|  1.52k|	    if (fragment == NULL) {
  ------------------
  |  Branch (467:10): [True: 1.43k, False: 85]
  ------------------
  468|  1.43k|		fragment = (xmlChar *) uri->fragment;
  469|  1.43k|	    } else {
  470|     85|		xmlFree(uri->fragment);
  471|     85|	    }
  472|  1.52k|	} else {
  473|     40|	    xmlXIncludeErr(ctxt, cur, XML_XINCLUDE_FRAGMENT_ID,
  474|     40|       "Invalid fragment identifier in URI %s use the xpointer attribute\n",
  475|     40|                           href);
  476|     40|	    goto error;
  477|     40|	}
  478|  1.52k|	uri->fragment = NULL;
  479|  1.52k|    }
  480|  17.8k|    tmp = xmlSaveUri(uri);
  481|  17.8k|    if (tmp == NULL) {
  ------------------
  |  Branch (481:9): [True: 18, False: 17.7k]
  ------------------
  482|     18|	xmlXIncludeErrMemory(ctxt);
  483|     18|	goto error;
  484|     18|    }
  485|  17.7k|    xmlFree(href);
  486|  17.7k|    href = tmp;
  487|       |
  488|       |    /*
  489|       |     * Resolve URI
  490|       |     */
  491|       |
  492|  17.7k|    if (xmlNodeGetBaseSafe(ctxt->doc, cur, &base) < 0) {
  ------------------
  |  Branch (492:9): [True: 21, False: 17.7k]
  ------------------
  493|     21|        xmlXIncludeErrMemory(ctxt);
  494|     21|        goto error;
  495|     21|    }
  496|       |
  497|  17.7k|    if (href[0] != 0) {
  ------------------
  |  Branch (497:9): [True: 16.8k, False: 898]
  ------------------
  498|  16.8k|        if (xmlBuildURISafe(href, base, &tmp) < 0) {
  ------------------
  |  Branch (498:13): [True: 70, False: 16.8k]
  ------------------
  499|     70|            xmlXIncludeErrMemory(ctxt);
  500|     70|            goto error;
  501|     70|        }
  502|  16.8k|        if (tmp == NULL) {
  ------------------
  |  Branch (502:13): [True: 1, False: 16.8k]
  ------------------
  503|      1|            xmlXIncludeErr(ctxt, cur, XML_XINCLUDE_HREF_URI,
  504|      1|                           "failed build URL\n", NULL);
  505|      1|            goto error;
  506|      1|        }
  507|  16.8k|        xmlFree(href);
  508|  16.8k|        href = tmp;
  509|       |
  510|  16.8k|        if (xmlStrEqual(href, ctxt->doc->URL))
  ------------------
  |  Branch (510:13): [True: 3.16k, False: 13.6k]
  ------------------
  511|  3.16k|            local = 1;
  512|  16.8k|    } else {
  513|    898|        local = 1;
  514|    898|    }
  515|       |
  516|       |    /*
  517|       |     * If local and xml then we need a fragment
  518|       |     */
  519|  17.7k|    if ((local == 1) && (xml == 1) &&
  ------------------
  |  Branch (519:9): [True: 4.06k, False: 13.6k]
  |  Branch (519:25): [True: 4.04k, False: 13]
  ------------------
  520|  4.04k|        ((fragment == NULL) || (fragment[0] == 0))) {
  ------------------
  |  Branch (520:10): [True: 438, False: 3.61k]
  |  Branch (520:32): [True: 34, False: 3.57k]
  ------------------
  521|    472|	xmlXIncludeErr(ctxt, cur, XML_XINCLUDE_RECURSION,
  522|    472|	               "detected a local recursion with no xpointer in %s\n",
  523|    472|		       href);
  524|    472|	goto error;
  525|    472|    }
  526|       |
  527|  17.2k|    ref = (xmlXIncludeRefPtr) xmlMalloc(sizeof(xmlXIncludeRef));
  528|  17.2k|    if (ref == NULL) {
  ------------------
  |  Branch (528:9): [True: 17, False: 17.2k]
  ------------------
  529|     17|        xmlXIncludeErrMemory(ctxt);
  530|     17|        goto error;
  531|     17|    }
  532|  17.2k|    memset(ref, 0, sizeof(xmlXIncludeRef));
  533|       |
  534|  17.2k|    ref->elem = cur;
  535|  17.2k|    ref->xml = xml;
  536|  17.2k|    ref->URI = href;
  537|  17.2k|    href = NULL;
  538|  17.2k|    ref->fragment = fragment;
  539|  17.2k|    fragment = NULL;
  540|       |
  541|       |    /*
  542|       |     * xml:base fixup
  543|       |     */
  544|  17.2k|    if (((ctxt->parseFlags & XML_PARSE_NOBASEFIX) == 0) &&
  ------------------
  |  Branch (544:9): [True: 9.33k, False: 7.88k]
  ------------------
  545|  9.33k|        (cur->doc != NULL) &&
  ------------------
  |  Branch (545:9): [True: 9.33k, False: 0]
  ------------------
  546|  9.33k|        ((cur->doc->parseFlags & XML_PARSE_NOBASEFIX) == 0)) {
  ------------------
  |  Branch (546:9): [True: 9.33k, False: 0]
  ------------------
  547|  9.33k|        if (base != NULL) {
  ------------------
  |  Branch (547:13): [True: 5.04k, False: 4.29k]
  ------------------
  548|  5.04k|            ref->base = base;
  549|  5.04k|            base = NULL;
  550|  5.04k|        } else {
  551|  4.29k|            ref->base = xmlStrdup(BAD_CAST "");
  ------------------
  |  |   34|  4.29k|#define BAD_CAST (xmlChar *)
  ------------------
  552|  4.29k|            if (ref->base == NULL) {
  ------------------
  |  Branch (552:17): [True: 3, False: 4.28k]
  ------------------
  553|      3|	        xmlXIncludeErrMemory(ctxt);
  554|      3|                goto error;
  555|      3|            }
  556|  4.29k|        }
  557|  9.33k|    }
  558|       |
  559|  17.2k|    if (ctxt->incNr >= ctxt->incMax) {
  ------------------
  |  Branch (559:9): [True: 12.0k, False: 5.18k]
  ------------------
  560|  12.0k|        xmlXIncludeRefPtr *table;
  561|  12.0k|        int newSize;
  562|       |
  563|  12.0k|        newSize = xmlGrowCapacity(ctxt->incMax, sizeof(table[0]),
  564|  12.0k|                                  4, XML_MAX_ITEMS);
  ------------------
  |  |   13|  12.0k|#define XML_MAX_ITEMS 1000000000 /* 1 billion */
  ------------------
  565|  12.0k|        if (newSize < 0) {
  ------------------
  |  Branch (565:13): [True: 0, False: 12.0k]
  ------------------
  566|      0|	    xmlXIncludeErrMemory(ctxt);
  567|      0|	    goto error;
  568|      0|	}
  569|  12.0k|        table = xmlRealloc(ctxt->incTab, newSize * sizeof(table[0]));
  570|  12.0k|        if (table == NULL) {
  ------------------
  |  Branch (570:13): [True: 19, False: 12.0k]
  ------------------
  571|     19|	    xmlXIncludeErrMemory(ctxt);
  572|     19|	    goto error;
  573|     19|	}
  574|  12.0k|        ctxt->incTab = table;
  575|  12.0k|        ctxt->incMax = newSize;
  576|  12.0k|    }
  577|  17.1k|    ctxt->incTab[ctxt->incNr++] = ref;
  578|       |
  579|  17.1k|    ret = ref;
  580|  17.1k|    ref = NULL;
  581|       |
  582|  18.4k|error:
  583|  18.4k|    xmlXIncludeFreeRef(ref);
  584|  18.4k|    xmlFreeURI(uri);
  585|  18.4k|    xmlFree(href);
  586|  18.4k|    xmlFree(parse);
  587|  18.4k|    xmlFree(fragment);
  588|  18.4k|    xmlFree(base);
  589|  18.4k|    return(ret);
  590|  17.1k|}
xinclude.c:xmlXIncludeGetProp:
  214|  54.9k|                   const xmlChar *name) {
  215|  54.9k|    xmlChar *ret;
  216|       |
  217|  54.9k|    if (xmlNodeGetAttrValue(cur, name, XINCLUDE_NS, &ret) < 0)
  ------------------
  |  |   30|  54.9k|#define XINCLUDE_NS (const xmlChar *) "http://www.w3.org/2003/XInclude"
  ------------------
  |  Branch (217:9): [True: 2, False: 54.9k]
  ------------------
  218|      2|        xmlXIncludeErrMemory(ctxt);
  219|  54.9k|    if (ret != NULL)
  ------------------
  |  Branch (219:9): [True: 40, False: 54.9k]
  ------------------
  220|     40|        return(ret);
  221|       |
  222|  54.9k|    if (ctxt->legacy != 0) {
  ------------------
  |  Branch (222:9): [True: 30.5k, False: 24.3k]
  ------------------
  223|  30.5k|        if (xmlNodeGetAttrValue(cur, name, XINCLUDE_OLD_NS, &ret) < 0)
  ------------------
  |  |   34|  30.5k|#define XINCLUDE_OLD_NS (const xmlChar *) "http://www.w3.org/2001/XInclude"
  ------------------
  |  Branch (223:13): [True: 1, False: 30.5k]
  ------------------
  224|      1|            xmlXIncludeErrMemory(ctxt);
  225|  30.5k|        if (ret != NULL)
  ------------------
  |  Branch (225:13): [True: 36, False: 30.5k]
  ------------------
  226|     36|            return(ret);
  227|  30.5k|    }
  228|       |
  229|  54.9k|    if (xmlNodeGetAttrValue(cur, name, NULL, &ret) < 0)
  ------------------
  |  Branch (229:9): [True: 40, False: 54.8k]
  ------------------
  230|     40|        xmlXIncludeErrMemory(ctxt);
  231|  54.9k|    return(ret);
  232|  54.9k|}
xinclude.c:xmlXIncludeLoadNode:
 1641|  17.1k|xmlXIncludeLoadNode(xmlXIncludeCtxtPtr ctxt, xmlXIncludeRefPtr ref) {
 1642|  17.1k|    xmlNodePtr cur;
 1643|  17.1k|    int ret;
 1644|       |
 1645|  17.1k|    if ((ctxt == NULL) || (ref == NULL))
  ------------------
  |  Branch (1645:9): [True: 0, False: 17.1k]
  |  Branch (1645:27): [True: 0, False: 17.1k]
  ------------------
 1646|      0|	return(-1);
 1647|  17.1k|    cur = ref->elem;
 1648|  17.1k|    if (cur == NULL)
  ------------------
  |  Branch (1648:9): [True: 0, False: 17.1k]
  ------------------
 1649|      0|	return(-1);
 1650|       |
 1651|  17.1k|    if (ref->xml) {
  ------------------
  |  Branch (1651:9): [True: 17.0k, False: 152]
  ------------------
 1652|  17.0k|	ret = xmlXIncludeLoadDoc(ctxt, ref);
 1653|       |	/* xmlXIncludeGetFragment(ctxt, cur, URI); */
 1654|  17.0k|    } else {
 1655|    152|	ret = xmlXIncludeLoadTxt(ctxt, ref);
 1656|    152|    }
 1657|       |
 1658|  17.1k|    if (ret < 0) {
  ------------------
  |  Branch (1658:9): [True: 9.45k, False: 7.74k]
  ------------------
 1659|  9.45k|	xmlNodePtr children;
 1660|       |
 1661|       |	/*
 1662|       |	 * Time to try a fallback if available
 1663|       |	 */
 1664|  9.45k|	children = cur->children;
 1665|  13.0k|	while (children != NULL) {
  ------------------
  |  Branch (1665:9): [True: 4.04k, False: 8.97k]
  ------------------
 1666|  4.04k|	    if ((children->type == XML_ELEMENT_NODE) &&
  ------------------
  |  Branch (1666:10): [True: 1.65k, False: 2.39k]
  ------------------
 1667|  1.65k|		(children->ns != NULL) &&
  ------------------
  |  Branch (1667:3): [True: 1.13k, False: 515]
  ------------------
 1668|  1.13k|		(xmlStrEqual(children->name, XINCLUDE_FALLBACK)) &&
  ------------------
  |  |   42|  1.13k|#define XINCLUDE_FALLBACK (const xmlChar *) "fallback"
  ------------------
  |  Branch (1668:3): [True: 474, False: 661]
  ------------------
 1669|    474|		((xmlStrEqual(children->ns->href, XINCLUDE_NS)) ||
  ------------------
  |  |   30|    474|#define XINCLUDE_NS (const xmlChar *) "http://www.w3.org/2003/XInclude"
  ------------------
  |  Branch (1669:4): [True: 250, False: 224]
  ------------------
 1670|    474|		 (xmlStrEqual(children->ns->href, XINCLUDE_OLD_NS)))) {
  ------------------
  |  |   34|    224|#define XINCLUDE_OLD_NS (const xmlChar *) "http://www.w3.org/2001/XInclude"
  ------------------
  |  Branch (1670:4): [True: 224, False: 0]
  ------------------
 1671|    474|		ret = xmlXIncludeLoadFallback(ctxt, children, ref);
 1672|    474|		break;
 1673|    474|	    }
 1674|  3.56k|	    children = children->next;
 1675|  3.56k|	}
 1676|  9.45k|    }
 1677|  17.1k|    if (ret < 0) {
  ------------------
  |  Branch (1677:9): [True: 9.08k, False: 8.11k]
  ------------------
 1678|  9.08k|	xmlXIncludeErr(ctxt, cur, XML_XINCLUDE_NO_FALLBACK,
 1679|  9.08k|		       "could not load %s, and no fallback was found\n",
 1680|  9.08k|		       ref->URI);
 1681|  9.08k|    }
 1682|       |
 1683|  17.1k|    return(0);
 1684|  17.1k|}
xinclude.c:xmlXIncludeLoadDoc:
 1061|  17.0k|xmlXIncludeLoadDoc(xmlXIncludeCtxtPtr ctxt, xmlXIncludeRefPtr ref) {
 1062|  17.0k|    xmlXIncludeDocPtr cache;
 1063|  17.0k|    xmlDocPtr doc;
 1064|  17.0k|    const xmlChar *url = ref->URI;
 1065|  17.0k|    const xmlChar *fragment = ref->fragment;
 1066|  17.0k|    int i = 0;
 1067|  17.0k|    int ret = -1;
 1068|  17.0k|    int cacheNr;
 1069|  17.0k|#ifdef LIBXML_XPTR_ENABLED
 1070|  17.0k|    int saveFlags;
 1071|  17.0k|#endif
 1072|       |
 1073|       |    /*
 1074|       |     * Handling of references to the local document are done
 1075|       |     * directly through ctxt->doc.
 1076|       |     */
 1077|  17.0k|    if ((url[0] == 0) || (url[0] == '#') ||
  ------------------
  |  Branch (1077:9): [True: 874, False: 16.1k]
  |  Branch (1077:26): [True: 1.05k, False: 15.1k]
  ------------------
 1078|  15.1k|	((ctxt->doc != NULL) && (xmlStrEqual(url, ctxt->doc->URL)))) {
  ------------------
  |  Branch (1078:3): [True: 15.1k, False: 0]
  |  Branch (1078:26): [True: 2.67k, False: 12.4k]
  ------------------
 1079|  4.60k|	doc = ctxt->doc;
 1080|  4.60k|        goto loaded;
 1081|  4.60k|    }
 1082|       |
 1083|       |    /*
 1084|       |     * Prevent reloading the document twice.
 1085|       |     */
 1086|  15.8k|    for (i = 0; i < ctxt->urlNr; i++) {
  ------------------
  |  Branch (1086:17): [True: 7.43k, False: 8.43k]
  ------------------
 1087|  7.43k|	if (xmlStrEqual(url, ctxt->urlTab[i].url)) {
  ------------------
  |  Branch (1087:6): [True: 4.00k, False: 3.42k]
  ------------------
 1088|  4.00k|            if (ctxt->urlTab[i].expanding) {
  ------------------
  |  Branch (1088:17): [True: 69, False: 3.93k]
  ------------------
 1089|     69|                xmlXIncludeErr(ctxt, ref->elem, XML_XINCLUDE_RECURSION,
 1090|     69|                               "inclusion loop detected\n", NULL);
 1091|     69|                goto error;
 1092|     69|            }
 1093|  3.93k|	    doc = ctxt->urlTab[i].doc;
 1094|  3.93k|            if (doc == NULL)
  ------------------
  |  Branch (1094:17): [True: 457, False: 3.47k]
  ------------------
 1095|    457|                goto error;
 1096|  3.47k|	    goto loaded;
 1097|  3.93k|	}
 1098|  7.43k|    }
 1099|       |
 1100|       |    /*
 1101|       |     * Load it.
 1102|       |     */
 1103|  8.43k|#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|  8.43k|    saveFlags = ctxt->parseFlags;
 1110|  8.43k|    if (fragment != NULL) {	/* if this is an XPointer eval */
  ------------------
  |  Branch (1110:9): [True: 6.55k, False: 1.88k]
  ------------------
 1111|  6.55k|	ctxt->parseFlags |= XML_PARSE_NOENT;
 1112|  6.55k|    }
 1113|  8.43k|#endif
 1114|       |
 1115|  8.43k|    doc = xmlXIncludeParseFile(ctxt, (const char *)url);
 1116|  8.43k|#ifdef LIBXML_XPTR_ENABLED
 1117|  8.43k|    ctxt->parseFlags = saveFlags;
 1118|  8.43k|#endif
 1119|       |
 1120|       |    /* Also cache NULL docs */
 1121|  8.43k|    if (ctxt->urlNr >= ctxt->urlMax) {
  ------------------
  |  Branch (1121:9): [True: 8.28k, False: 154]
  ------------------
 1122|  8.28k|        xmlXIncludeDoc *tmp;
 1123|  8.28k|        int newSize;
 1124|       |
 1125|  8.28k|        newSize = xmlGrowCapacity(ctxt->urlMax, sizeof(tmp[0]),
 1126|  8.28k|                                  8, XML_MAX_ITEMS);
  ------------------
  |  |   13|  8.28k|#define XML_MAX_ITEMS 1000000000 /* 1 billion */
  ------------------
 1127|  8.28k|        if (newSize < 0) {
  ------------------
  |  Branch (1127:13): [True: 0, False: 8.28k]
  ------------------
 1128|      0|            xmlXIncludeErrMemory(ctxt);
 1129|      0|            xmlFreeDoc(doc);
 1130|      0|            goto error;
 1131|      0|        }
 1132|  8.28k|        tmp = xmlRealloc(ctxt->urlTab, newSize * sizeof(tmp[0]));
 1133|  8.28k|        if (tmp == NULL) {
  ------------------
  |  Branch (1133:13): [True: 2, False: 8.28k]
  ------------------
 1134|      2|            xmlXIncludeErrMemory(ctxt);
 1135|      2|            xmlFreeDoc(doc);
 1136|      2|            goto error;
 1137|      2|        }
 1138|  8.28k|        ctxt->urlMax = newSize;
 1139|  8.28k|        ctxt->urlTab = tmp;
 1140|  8.28k|    }
 1141|  8.43k|    cache = &ctxt->urlTab[ctxt->urlNr];
 1142|  8.43k|    cache->doc = doc;
 1143|  8.43k|    cache->url = xmlStrdup(url);
 1144|  8.43k|    if (cache->url == NULL) {
  ------------------
  |  Branch (1144:9): [True: 2, False: 8.43k]
  ------------------
 1145|      2|        xmlXIncludeErrMemory(ctxt);
 1146|      2|        xmlFreeDoc(doc);
 1147|      2|        goto error;
 1148|      2|    }
 1149|  8.43k|    cache->expanding = 0;
 1150|  8.43k|    cacheNr = ctxt->urlNr++;
 1151|       |
 1152|  8.43k|    if (doc == NULL)
  ------------------
  |  Branch (1152:9): [True: 1.56k, False: 6.87k]
  ------------------
 1153|  1.56k|        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|  6.87k|    if ((doc->URL != NULL) && (!xmlStrEqual(url, doc->URL)))
  ------------------
  |  Branch (1160:9): [True: 6.87k, False: 0]
  |  Branch (1160:31): [True: 0, False: 6.87k]
  ------------------
 1161|      0|        url = doc->URL;
 1162|       |
 1163|       |    /*
 1164|       |     * Make sure we have all entities fixed up
 1165|       |     */
 1166|  6.87k|    xmlXIncludeMergeEntities(ctxt, ctxt->doc, doc);
 1167|       |
 1168|       |    /*
 1169|       |     * We don't need the DTD anymore, free up space
 1170|       |    if (doc->intSubset != NULL) {
 1171|       |	xmlUnlinkNode((xmlNodePtr) doc->intSubset);
 1172|       |	xmlFreeNode((xmlNodePtr) doc->intSubset);
 1173|       |	doc->intSubset = NULL;
 1174|       |    }
 1175|       |    if (doc->extSubset != NULL) {
 1176|       |	xmlUnlinkNode((xmlNodePtr) doc->extSubset);
 1177|       |	xmlFreeNode((xmlNodePtr) doc->extSubset);
 1178|       |	doc->extSubset = NULL;
 1179|       |    }
 1180|       |     */
 1181|  6.87k|    cache->expanding = 1;
 1182|  6.87k|    xmlXIncludeRecurseDoc(ctxt, doc);
 1183|       |    /* urlTab might be reallocated. */
 1184|  6.87k|    cache = &ctxt->urlTab[cacheNr];
 1185|  6.87k|    cache->expanding = 0;
 1186|       |
 1187|  14.9k|loaded:
 1188|  14.9k|    if (fragment == NULL) {
  ------------------
  |  Branch (1188:9): [True: 4.42k, False: 10.5k]
  ------------------
 1189|  4.42k|        xmlNodePtr root;
 1190|       |
 1191|  4.42k|        root = xmlDocGetRootElement(doc);
 1192|  4.42k|        if (root == NULL) {
  ------------------
  |  Branch (1192:13): [True: 1, False: 4.42k]
  ------------------
 1193|      1|            xmlXIncludeErr(ctxt, ref->elem, XML_ERR_INTERNAL_ERROR,
 1194|      1|                           "document without root\n", NULL);
 1195|      1|            goto error;
 1196|      1|        }
 1197|       |
 1198|  4.42k|        ref->inc = xmlDocCopyNode(root, ctxt->doc, 1);
 1199|  4.42k|        if (ref->inc == NULL) {
  ------------------
  |  Branch (1199:13): [True: 73, False: 4.35k]
  ------------------
 1200|     73|            xmlXIncludeErrMemory(ctxt);
 1201|     73|            goto error;
 1202|     73|        }
 1203|       |
 1204|  4.35k|        if (ref->base != NULL)
  ------------------
  |  Branch (1204:13): [True: 3.50k, False: 844]
  ------------------
 1205|  3.50k|            xmlXIncludeBaseFixup(ctxt, root, ref->inc, ref->base);
 1206|  4.35k|    }
 1207|  10.5k|#ifdef LIBXML_XPTR_ENABLED
 1208|  10.5k|    else {
 1209|       |	/*
 1210|       |	 * Computes the XPointer expression and make a copy used
 1211|       |	 * as the replacement copy.
 1212|       |	 */
 1213|  10.5k|	xmlXPathObjectPtr xptr;
 1214|  10.5k|	xmlNodeSetPtr set;
 1215|       |
 1216|  10.5k|        if (ctxt->isStream && doc == ctxt->doc) {
  ------------------
  |  Branch (1216:13): [True: 7.03k, False: 3.49k]
  |  Branch (1216:31): [True: 73, False: 6.96k]
  ------------------
 1217|     73|	    xmlXIncludeErr(ctxt, ref->elem, XML_XINCLUDE_XPTR_FAILED,
 1218|     73|			   "XPointer expressions not allowed in streaming"
 1219|     73|                           " mode\n", NULL);
 1220|     73|            goto error;
 1221|     73|        }
 1222|       |
 1223|  10.4k|        if (ctxt->xpctxt == NULL) {
  ------------------
  |  Branch (1223:13): [True: 6.28k, False: 4.16k]
  ------------------
 1224|  6.28k|            ctxt->xpctxt = xmlXPathNewContext(doc);
 1225|  6.28k|            if (ctxt->xpctxt == NULL) {
  ------------------
  |  Branch (1225:17): [True: 14, False: 6.27k]
  ------------------
 1226|     14|                xmlXIncludeErrMemory(ctxt);
 1227|     14|                goto error;
 1228|     14|            }
 1229|  6.27k|            if (ctxt->errorHandler != NULL)
  ------------------
  |  Branch (1229:17): [True: 6.27k, False: 0]
  ------------------
 1230|  6.27k|                xmlXPathSetErrorHandler(ctxt->xpctxt, ctxt->errorHandler,
 1231|  6.27k|                                        ctxt->errorCtxt);
 1232|  6.27k|#ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
 1233|  6.27k|            ctxt->xpctxt->opLimit = 100000;
 1234|  6.27k|#endif
 1235|  6.27k|        } else {
 1236|  4.16k|            ctxt->xpctxt->doc = doc;
 1237|  4.16k|        }
 1238|  10.4k|	xptr = xmlXPtrEval(fragment, ctxt->xpctxt);
 1239|  10.4k|	if (ctxt->xpctxt->lastError.code != XML_ERR_OK) {
  ------------------
  |  Branch (1239:6): [True: 7.09k, False: 3.34k]
  ------------------
 1240|  7.09k|            if (ctxt->xpctxt->lastError.code == XML_ERR_NO_MEMORY)
  ------------------
  |  Branch (1240:17): [True: 2.12k, False: 4.97k]
  ------------------
 1241|  2.12k|                xmlXIncludeErrMemory(ctxt);
 1242|  4.97k|            else
 1243|  4.97k|                xmlXIncludeErr(ctxt, ref->elem, XML_XINCLUDE_XPTR_FAILED,
 1244|  4.97k|                               "XPointer evaluation failed: #%s\n",
 1245|  4.97k|                               fragment);
 1246|  7.09k|            goto error;
 1247|  7.09k|	}
 1248|  3.34k|        if (xptr == NULL)
  ------------------
  |  Branch (1248:13): [True: 2.32k, False: 1.01k]
  ------------------
 1249|  2.32k|            goto done;
 1250|  1.01k|	switch (xptr->type) {
  ------------------
  |  Branch (1250:10): [True: 1.01k, False: 0]
  ------------------
 1251|      0|	    case XPATH_UNDEFINED:
  ------------------
  |  Branch (1251:6): [True: 0, False: 1.01k]
  ------------------
 1252|      0|	    case XPATH_BOOLEAN:
  ------------------
  |  Branch (1252:6): [True: 0, False: 1.01k]
  ------------------
 1253|      0|	    case XPATH_NUMBER:
  ------------------
  |  Branch (1253:6): [True: 0, False: 1.01k]
  ------------------
 1254|      0|	    case XPATH_STRING:
  ------------------
  |  Branch (1254:6): [True: 0, False: 1.01k]
  ------------------
 1255|      0|	    case XPATH_USERS:
  ------------------
  |  Branch (1255:6): [True: 0, False: 1.01k]
  ------------------
 1256|      0|	    case XPATH_XSLT_TREE:
  ------------------
  |  Branch (1256:6): [True: 0, False: 1.01k]
  ------------------
 1257|      0|		xmlXIncludeErr(ctxt, ref->elem, XML_XINCLUDE_XPTR_RESULT,
 1258|      0|			       "XPointer is not a range: #%s\n",
 1259|      0|			       fragment);
 1260|      0|                xmlXPathFreeObject(xptr);
 1261|      0|                goto error;
 1262|  1.01k|	    case XPATH_NODESET:
  ------------------
  |  Branch (1262:6): [True: 1.01k, False: 0]
  ------------------
 1263|  1.01k|                break;
 1264|       |
 1265|  1.01k|	}
 1266|  1.01k|	set = xptr->nodesetval;
 1267|  1.01k|	if (set != NULL) {
  ------------------
  |  Branch (1267:6): [True: 1.01k, False: 0]
  ------------------
 1268|   347k|	    for (i = 0;i < set->nodeNr;i++) {
  ------------------
  |  Branch (1268:17): [True: 346k, False: 1.00k]
  ------------------
 1269|   346k|		if (set->nodeTab[i] == NULL) /* shouldn't happen */
  ------------------
  |  Branch (1269:7): [True: 0, False: 346k]
  ------------------
 1270|      0|		    continue;
 1271|   346k|		switch (set->nodeTab[i]->type) {
  ------------------
  |  Branch (1271:11): [True: 346k, False: 0]
  ------------------
 1272|   168k|		    case XML_ELEMENT_NODE:
  ------------------
  |  Branch (1272:7): [True: 168k, False: 178k]
  ------------------
 1273|   279k|		    case XML_TEXT_NODE:
  ------------------
  |  Branch (1273:7): [True: 111k, False: 235k]
  ------------------
 1274|   296k|		    case XML_CDATA_SECTION_NODE:
  ------------------
  |  Branch (1274:7): [True: 16.4k, False: 330k]
  ------------------
 1275|   296k|		    case XML_ENTITY_REF_NODE:
  ------------------
  |  Branch (1275:7): [True: 0, False: 346k]
  ------------------
 1276|   296k|		    case XML_ENTITY_NODE:
  ------------------
  |  Branch (1276:7): [True: 0, False: 346k]
  ------------------
 1277|   343k|		    case XML_PI_NODE:
  ------------------
  |  Branch (1277:7): [True: 46.7k, False: 300k]
  ------------------
 1278|   346k|		    case XML_COMMENT_NODE:
  ------------------
  |  Branch (1278:7): [True: 3.53k, False: 343k]
  ------------------
 1279|   346k|		    case XML_DOCUMENT_NODE:
  ------------------
  |  Branch (1279:7): [True: 235, False: 346k]
  ------------------
 1280|   346k|		    case XML_HTML_DOCUMENT_NODE:
  ------------------
  |  Branch (1280:7): [True: 0, False: 346k]
  ------------------
 1281|   346k|			continue;
 1282|       |
 1283|     12|		    case XML_ATTRIBUTE_NODE:
  ------------------
  |  Branch (1283:7): [True: 12, False: 346k]
  ------------------
 1284|     12|			xmlXIncludeErr(ctxt, ref->elem,
 1285|     12|			               XML_XINCLUDE_XPTR_RESULT,
 1286|     12|				       "XPointer selects an attribute: #%s\n",
 1287|     12|				       fragment);
 1288|     12|			goto xptr_error;
 1289|      0|		    case XML_NAMESPACE_DECL:
  ------------------
  |  Branch (1289:7): [True: 0, False: 346k]
  ------------------
 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: 346k]
  ------------------
 1296|      0|		    case XML_DOCUMENT_FRAG_NODE:
  ------------------
  |  Branch (1296:7): [True: 0, False: 346k]
  ------------------
 1297|      0|		    case XML_NOTATION_NODE:
  ------------------
  |  Branch (1297:7): [True: 0, False: 346k]
  ------------------
 1298|      0|		    case XML_DTD_NODE:
  ------------------
  |  Branch (1298:7): [True: 0, False: 346k]
  ------------------
 1299|      0|		    case XML_ELEMENT_DECL:
  ------------------
  |  Branch (1299:7): [True: 0, False: 346k]
  ------------------
 1300|      0|		    case XML_ATTRIBUTE_DECL:
  ------------------
  |  Branch (1300:7): [True: 0, False: 346k]
  ------------------
 1301|      0|		    case XML_ENTITY_DECL:
  ------------------
  |  Branch (1301:7): [True: 0, False: 346k]
  ------------------
 1302|      0|		    case XML_XINCLUDE_START:
  ------------------
  |  Branch (1302:7): [True: 0, False: 346k]
  ------------------
 1303|      0|		    case XML_XINCLUDE_END:
  ------------------
  |  Branch (1303:7): [True: 0, False: 346k]
  ------------------
 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|   346k|		}
 1311|   346k|	    }
 1312|  1.01k|	}
 1313|  1.00k|        ref->inc = xmlXIncludeCopyXPointer(ctxt, xptr, ref->base);
 1314|  1.01k|xptr_error:
 1315|  1.01k|        xmlXPathFreeObject(xptr);
 1316|  1.01k|    }
 1317|       |
 1318|  7.69k|done:
 1319|  7.69k|#endif
 1320|       |
 1321|  7.69k|    ret = 0;
 1322|       |
 1323|  17.0k|error:
 1324|  17.0k|    return(ret);
 1325|  7.69k|}
xinclude.c:xmlXIncludeParseFile:
  320|  8.43k|xmlXIncludeParseFile(xmlXIncludeCtxtPtr ctxt, const char *URL) {
  321|  8.43k|    xmlDocPtr ret = NULL;
  322|  8.43k|    xmlParserCtxtPtr pctxt;
  323|  8.43k|    xmlParserInputPtr inputStream;
  324|       |
  325|  8.43k|    xmlInitParser();
  326|       |
  327|  8.43k|    pctxt = xmlNewParserCtxt();
  328|  8.43k|    if (pctxt == NULL) {
  ------------------
  |  Branch (328:9): [True: 14, False: 8.42k]
  ------------------
  329|     14|	xmlXIncludeErrMemory(ctxt);
  330|     14|	return(NULL);
  331|     14|    }
  332|  8.42k|    if (ctxt->errorHandler != NULL)
  ------------------
  |  Branch (332:9): [True: 8.42k, False: 0]
  ------------------
  333|  8.42k|        xmlCtxtSetErrorHandler(pctxt, ctxt->errorHandler, ctxt->errorCtxt);
  334|  8.42k|    if (ctxt->resourceLoader != NULL)
  ------------------
  |  Branch (334:9): [True: 8.42k, False: 0]
  ------------------
  335|  8.42k|        xmlCtxtSetResourceLoader(pctxt, ctxt->resourceLoader,
  336|  8.42k|                                 ctxt->resourceCtxt);
  337|       |
  338|       |    /*
  339|       |     * pass in the application data to the parser context.
  340|       |     */
  341|  8.42k|    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|  8.42k|    if ((ctxt->doc != NULL) && (ctxt->doc->dict != NULL)) {
  ------------------
  |  Branch (347:9): [True: 8.42k, False: 0]
  |  Branch (347:32): [True: 4.31k, False: 4.10k]
  ------------------
  348|  4.31k|       if (pctxt->dict != NULL)
  ------------------
  |  Branch (348:12): [True: 4.31k, False: 0]
  ------------------
  349|  4.31k|            xmlDictFree(pctxt->dict);
  350|  4.31k|	pctxt->dict = ctxt->doc->dict;
  351|  4.31k|	xmlDictReference(pctxt->dict);
  352|  4.31k|    }
  353|       |
  354|       |    /*
  355|       |     * We set DTDLOAD to make sure that ID attributes declared in
  356|       |     * external DTDs are detected.
  357|       |     */
  358|  8.42k|    xmlCtxtUseOptions(pctxt, ctxt->parseFlags | XML_PARSE_DTDLOAD);
  359|       |
  360|  8.42k|    inputStream = xmlLoadResource(pctxt, URL, NULL, XML_RESOURCE_XINCLUDE);
  361|  8.42k|    if (inputStream == NULL)
  ------------------
  |  Branch (361:9): [True: 744, False: 7.68k]
  ------------------
  362|    744|        goto error;
  363|       |
  364|  7.68k|    if (xmlCtxtPushInput(pctxt, inputStream) < 0) {
  ------------------
  |  Branch (364:9): [True: 1, False: 7.67k]
  ------------------
  365|      1|        xmlFreeInputStream(inputStream);
  366|      1|        goto error;
  367|      1|    }
  368|       |
  369|  7.67k|    xmlParseDocument(pctxt);
  370|       |
  371|  7.67k|    if (pctxt->wellFormed) {
  ------------------
  |  Branch (371:9): [True: 6.87k, False: 804]
  ------------------
  372|  6.87k|        ret = pctxt->myDoc;
  373|  6.87k|    }
  374|    804|    else {
  375|    804|        ret = NULL;
  376|    804|	if (pctxt->myDoc != NULL)
  ------------------
  |  Branch (376:6): [True: 738, False: 66]
  ------------------
  377|    738|	    xmlFreeDoc(pctxt->myDoc);
  378|    804|        pctxt->myDoc = NULL;
  379|    804|    }
  380|       |
  381|  8.42k|error:
  382|  8.42k|    if (xmlCtxtIsCatastrophicError(pctxt))
  ------------------
  |  Branch (382:9): [True: 123, False: 8.30k]
  ------------------
  383|    123|        xmlXIncludeErr(ctxt, NULL, pctxt->errNo, "parser error", NULL);
  384|  8.42k|    xmlFreeParserCtxt(pctxt);
  385|       |
  386|  8.42k|    return(ret);
  387|  7.67k|}
xinclude.c:xmlXIncludeMergeEntities:
 1002|  6.87k|	                 xmlDocPtr from) {
 1003|  6.87k|    xmlNodePtr cur;
 1004|  6.87k|    xmlDtdPtr target, source;
 1005|       |
 1006|  6.87k|    if (ctxt == NULL)
  ------------------
  |  Branch (1006:9): [True: 0, False: 6.87k]
  ------------------
 1007|      0|	return(-1);
 1008|       |
 1009|  6.87k|    if ((from == NULL) || (from->intSubset == NULL))
  ------------------
  |  Branch (1009:9): [True: 0, False: 6.87k]
  |  Branch (1009:27): [True: 4.98k, False: 1.88k]
  ------------------
 1010|  4.98k|	return(0);
 1011|       |
 1012|  1.88k|    target = doc->intSubset;
 1013|  1.88k|    if (target == NULL) {
  ------------------
  |  Branch (1013:9): [True: 165, False: 1.72k]
  ------------------
 1014|    165|	cur = xmlDocGetRootElement(doc);
 1015|    165|	if (cur == NULL)
  ------------------
  |  Branch (1015:6): [True: 0, False: 165]
  ------------------
 1016|      0|	    return(-1);
 1017|    165|        target = xmlCreateIntSubset(doc, cur->name, NULL, NULL);
 1018|    165|	if (target == NULL) {
  ------------------
  |  Branch (1018:6): [True: 1, False: 164]
  ------------------
 1019|      1|            xmlXIncludeErrMemory(ctxt);
 1020|      1|	    return(-1);
 1021|      1|        }
 1022|    165|    }
 1023|       |
 1024|  1.88k|    source = from->intSubset;
 1025|  1.88k|    if ((source != NULL) && (source->entities != NULL)) {
  ------------------
  |  Branch (1025:9): [True: 1.88k, False: 0]
  |  Branch (1025:29): [True: 110, False: 1.77k]
  ------------------
 1026|    110|	xmlXIncludeMergeData data;
 1027|       |
 1028|    110|	data.ctxt = ctxt;
 1029|    110|	data.doc = doc;
 1030|       |
 1031|    110|	xmlHashScan((xmlHashTablePtr) source->entities,
 1032|    110|		    xmlXIncludeMergeEntity, &data);
 1033|    110|    }
 1034|  1.88k|    source = from->extSubset;
 1035|  1.88k|    if ((source != NULL) && (source->entities != NULL)) {
  ------------------
  |  Branch (1035:9): [True: 19, False: 1.86k]
  |  Branch (1035:29): [True: 0, False: 19]
  ------------------
 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.88k|    return(0);
 1051|  1.88k|}
xinclude.c:xmlXIncludeMergeEntity:
  921|    341|	               const xmlChar *name ATTRIBUTE_UNUSED) {
  922|    341|    xmlEntityPtr ent = (xmlEntityPtr) payload;
  923|    341|    xmlXIncludeMergeDataPtr data = (xmlXIncludeMergeDataPtr) vdata;
  924|    341|    xmlEntityPtr ret, prev;
  925|    341|    xmlDocPtr doc;
  926|    341|    xmlXIncludeCtxtPtr ctxt;
  927|       |
  928|    341|    if ((ent == NULL) || (data == NULL))
  ------------------
  |  Branch (928:9): [True: 0, False: 341]
  |  Branch (928:26): [True: 0, False: 341]
  ------------------
  929|      0|	return;
  930|    341|    ctxt = data->ctxt;
  931|    341|    doc = data->doc;
  932|    341|    if ((ctxt == NULL) || (doc == NULL))
  ------------------
  |  Branch (932:9): [True: 0, False: 341]
  |  Branch (932:27): [True: 0, False: 341]
  ------------------
  933|      0|	return;
  934|    341|    switch (ent->etype) {
  ------------------
  |  Branch (934:13): [True: 341, False: 0]
  ------------------
  935|      0|        case XML_INTERNAL_PARAMETER_ENTITY:
  ------------------
  |  Branch (935:9): [True: 0, False: 341]
  ------------------
  936|      0|        case XML_EXTERNAL_PARAMETER_ENTITY:
  ------------------
  |  Branch (936:9): [True: 0, False: 341]
  ------------------
  937|      0|        case XML_INTERNAL_PREDEFINED_ENTITY:
  ------------------
  |  Branch (937:9): [True: 0, False: 341]
  ------------------
  938|      0|	    return;
  939|     63|        case XML_INTERNAL_GENERAL_ENTITY:
  ------------------
  |  Branch (939:9): [True: 63, False: 278]
  ------------------
  940|    337|        case XML_EXTERNAL_GENERAL_PARSED_ENTITY:
  ------------------
  |  Branch (940:9): [True: 274, False: 67]
  ------------------
  941|    341|        case XML_EXTERNAL_GENERAL_UNPARSED_ENTITY:
  ------------------
  |  Branch (941:9): [True: 4, False: 337]
  ------------------
  942|    341|	    break;
  943|    341|    }
  944|    341|    prev = xmlGetDocEntity(doc, ent->name);
  945|    341|    if (prev == NULL) {
  ------------------
  |  Branch (945:9): [True: 140, False: 201]
  ------------------
  946|    140|        ret = xmlAddDocEntity(doc, ent->name, ent->etype, ent->ExternalID,
  947|    140|                              ent->SystemID, ent->content);
  948|    140|        if (ret == NULL) {
  ------------------
  |  Branch (948:13): [True: 2, False: 138]
  ------------------
  949|      2|            xmlXIncludeErrMemory(ctxt);
  950|      2|            return;
  951|      2|        }
  952|    138|	if (ent->URI != NULL) {
  ------------------
  |  Branch (952:6): [True: 96, False: 42]
  ------------------
  953|     96|	    ret->URI = xmlStrdup(ent->URI);
  954|     96|            if (ret->URI == 0)
  ------------------
  |  Branch (954:17): [True: 2, False: 94]
  ------------------
  955|      2|                xmlXIncludeErrMemory(ctxt);
  956|     96|        }
  957|    201|    } else {
  958|    201|        if (ent->etype != prev->etype)
  ------------------
  |  Branch (958:13): [True: 23, False: 178]
  ------------------
  959|     23|            goto error;
  960|       |
  961|    178|        if ((ent->SystemID != NULL) && (prev->SystemID != NULL)) {
  ------------------
  |  Branch (961:13): [True: 164, False: 14]
  |  Branch (961:40): [True: 164, False: 0]
  ------------------
  962|    164|            if (!xmlStrEqual(ent->SystemID, prev->SystemID))
  ------------------
  |  Branch (962:17): [True: 28, False: 136]
  ------------------
  963|     28|                goto error;
  964|    164|        } 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: 5, False: 9]
  ------------------
  970|      5|                goto error;
  971|     14|        } else {
  972|      0|            goto error;
  973|      0|        }
  974|    178|    }
  975|    283|    return;
  976|    283|error:
  977|     56|    switch (ent->etype) {
  ------------------
  |  Branch (977:13): [True: 56, False: 0]
  ------------------
  978|      0|        case XML_INTERNAL_PARAMETER_ENTITY:
  ------------------
  |  Branch (978:9): [True: 0, False: 56]
  ------------------
  979|      0|        case XML_EXTERNAL_PARAMETER_ENTITY:
  ------------------
  |  Branch (979:9): [True: 0, False: 56]
  ------------------
  980|      0|        case XML_INTERNAL_PREDEFINED_ENTITY:
  ------------------
  |  Branch (980:9): [True: 0, False: 56]
  ------------------
  981|     26|        case XML_INTERNAL_GENERAL_ENTITY:
  ------------------
  |  Branch (981:9): [True: 26, False: 30]
  ------------------
  982|     56|        case XML_EXTERNAL_GENERAL_PARSED_ENTITY:
  ------------------
  |  Branch (982:9): [True: 30, False: 26]
  ------------------
  983|     56|	    return;
  984|      0|        case XML_EXTERNAL_GENERAL_UNPARSED_ENTITY:
  ------------------
  |  Branch (984:9): [True: 0, False: 56]
  ------------------
  985|      0|	    break;
  986|     56|    }
  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|  6.87k|xmlXIncludeRecurseDoc(xmlXIncludeCtxtPtr ctxt, xmlDocPtr doc) {
  600|  6.87k|    xmlDocPtr oldDoc;
  601|  6.87k|    xmlXIncludeRefPtr *oldIncTab;
  602|  6.87k|    int oldIncMax, oldIncNr, oldIsStream;
  603|  6.87k|    int i;
  604|       |
  605|  6.87k|    oldDoc = ctxt->doc;
  606|  6.87k|    oldIncMax = ctxt->incMax;
  607|  6.87k|    oldIncNr = ctxt->incNr;
  608|  6.87k|    oldIncTab = ctxt->incTab;
  609|  6.87k|    oldIsStream = ctxt->isStream;
  610|  6.87k|    ctxt->doc = doc;
  611|  6.87k|    ctxt->incMax = 0;
  612|  6.87k|    ctxt->incNr = 0;
  613|  6.87k|    ctxt->incTab = NULL;
  614|  6.87k|    ctxt->isStream = 0;
  615|       |
  616|  6.87k|    xmlXIncludeDoProcess(ctxt, xmlDocGetRootElement(doc));
  617|       |
  618|  6.87k|    if (ctxt->incTab != NULL) {
  ------------------
  |  Branch (618:9): [True: 2.86k, False: 4.01k]
  ------------------
  619|  7.37k|        for (i = 0; i < ctxt->incNr; i++)
  ------------------
  |  Branch (619:21): [True: 4.51k, False: 2.86k]
  ------------------
  620|  4.51k|            xmlXIncludeFreeRef(ctxt->incTab[i]);
  621|  2.86k|        xmlFree(ctxt->incTab);
  622|  2.86k|    }
  623|       |
  624|  6.87k|    ctxt->doc = oldDoc;
  625|  6.87k|    ctxt->incMax = oldIncMax;
  626|  6.87k|    ctxt->incNr = oldIncNr;
  627|  6.87k|    ctxt->incTab = oldIncTab;
  628|  6.87k|    ctxt->isStream = oldIsStream;
  629|  6.87k|}
xinclude.c:xmlXIncludeBaseFixup:
  639|  12.8k|                     const xmlChar *targetBase) {
  640|  12.8k|    xmlChar *base = NULL;
  641|  12.8k|    xmlChar *relBase = NULL;
  642|  12.8k|    xmlNs ns;
  643|  12.8k|    int res;
  644|       |
  645|  12.8k|    if (cur->type != XML_ELEMENT_NODE)
  ------------------
  |  Branch (645:9): [True: 4.07k, False: 8.81k]
  ------------------
  646|  4.07k|        return;
  647|       |
  648|  8.81k|    if (xmlNodeGetBaseSafe(cur->doc, cur, &base) < 0)
  ------------------
  |  Branch (648:9): [True: 14, False: 8.80k]
  ------------------
  649|     14|        xmlXIncludeErrMemory(ctxt);
  650|       |
  651|  8.81k|    if ((base != NULL) && !xmlStrEqual(base, targetBase)) {
  ------------------
  |  Branch (651:9): [True: 7.34k, False: 1.47k]
  |  Branch (651:27): [True: 6.00k, False: 1.34k]
  ------------------
  652|  6.00k|        if ((xmlStrlen(base) > XML_MAX_URI_LENGTH) ||
  ------------------
  |  |   11|  6.00k|#define XML_MAX_URI_LENGTH 2000
  ------------------
  |  Branch (652:13): [True: 138, False: 5.86k]
  ------------------
  653|  5.86k|            (xmlStrlen(targetBase) > XML_MAX_URI_LENGTH)) {
  ------------------
  |  |   11|  5.86k|#define XML_MAX_URI_LENGTH 2000
  ------------------
  |  Branch (653:13): [True: 89, False: 5.77k]
  ------------------
  654|    227|            relBase = xmlStrdup(base);
  655|    227|            if (relBase == NULL) {
  ------------------
  |  Branch (655:17): [True: 2, False: 225]
  ------------------
  656|      2|                xmlXIncludeErrMemory(ctxt);
  657|      2|                goto done;
  658|      2|            }
  659|  5.77k|        } else if (xmlBuildRelativeURISafe(base, targetBase, &relBase) < 0) {
  ------------------
  |  Branch (659:20): [True: 61, False: 5.71k]
  ------------------
  660|     61|            xmlXIncludeErrMemory(ctxt);
  661|     61|            goto done;
  662|     61|        }
  663|  5.93k|        if (relBase == NULL) {
  ------------------
  |  Branch (663:13): [True: 414, False: 5.52k]
  ------------------
  664|    414|            xmlXIncludeErr(ctxt, cur,
  665|    414|                    XML_XINCLUDE_HREF_URI,
  666|    414|                    "Building relative URI failed: %s\n",
  667|    414|                    base);
  668|    414|            goto done;
  669|    414|        }
  670|       |
  671|       |        /*
  672|       |         * If the new base doesn't contain a slash, it can be omitted.
  673|       |         */
  674|  5.52k|        if (xmlStrchr(relBase, '/') != NULL) {
  ------------------
  |  Branch (674:13): [True: 1.75k, False: 3.76k]
  ------------------
  675|  1.75k|            res = xmlNodeSetBase(copy, relBase);
  676|  1.75k|            if (res < 0)
  ------------------
  |  Branch (676:17): [True: 20, False: 1.73k]
  ------------------
  677|     20|                xmlXIncludeErrMemory(ctxt);
  678|  1.75k|            goto done;
  679|  1.75k|        }
  680|  5.52k|    }
  681|       |
  682|       |    /*
  683|       |     * Delete existing xml:base if bases are equal
  684|       |     */
  685|  6.58k|    memset(&ns, 0, sizeof(ns));
  686|  6.58k|    ns.href = XML_XML_NAMESPACE;
  ------------------
  |  |  146|  6.58k|    (const xmlChar *) "http://www.w3.org/XML/1998/namespace"
  ------------------
  687|  6.58k|    xmlUnsetNsProp(copy, &ns, BAD_CAST "base");
  ------------------
  |  |   34|  6.58k|#define BAD_CAST (xmlChar *)
  ------------------
  688|       |
  689|  8.81k|done:
  690|  8.81k|    xmlFree(base);
  691|  8.81k|    xmlFree(relBase);
  692|  8.81k|}
xinclude.c:xmlXIncludeCopyXPointer:
  827|  1.00k|                        const xmlChar *targetBase) {
  828|  1.00k|    xmlNodePtr list = NULL, last = NULL, copy;
  829|  1.00k|    int i;
  830|       |
  831|  1.00k|    if ((ctxt == NULL) || (obj == NULL))
  ------------------
  |  Branch (831:9): [True: 0, False: 1.00k]
  |  Branch (831:27): [True: 0, False: 1.00k]
  ------------------
  832|      0|	return(NULL);
  833|  1.00k|    switch (obj->type) {
  834|  1.00k|        case XPATH_NODESET: {
  ------------------
  |  Branch (834:9): [True: 1.00k, False: 0]
  ------------------
  835|  1.00k|	    xmlNodeSetPtr set = obj->nodesetval;
  836|  1.00k|	    if (set == NULL)
  ------------------
  |  Branch (836:10): [True: 0, False: 1.00k]
  ------------------
  837|      0|		break;
  838|   232k|	    for (i = 0;i < set->nodeNr;i++) {
  ------------------
  |  Branch (838:17): [True: 231k, False: 697]
  ------------------
  839|   231k|                xmlNodePtr node;
  840|       |
  841|   231k|		if (set->nodeTab[i] == NULL)
  ------------------
  |  Branch (841:7): [True: 0, False: 231k]
  ------------------
  842|      0|		    continue;
  843|   231k|		switch (set->nodeTab[i]->type) {
  844|    235|		    case XML_DOCUMENT_NODE:
  ------------------
  |  Branch (844:7): [True: 235, False: 231k]
  ------------------
  845|    235|		    case XML_HTML_DOCUMENT_NODE:
  ------------------
  |  Branch (845:7): [True: 0, False: 231k]
  ------------------
  846|    235|                        node = xmlDocGetRootElement(
  847|    235|                                (xmlDocPtr) set->nodeTab[i]);
  848|    235|                        if (node == NULL) {
  ------------------
  |  Branch (848:29): [True: 0, False: 235]
  ------------------
  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|    235|                        break;
  855|   110k|                    case XML_TEXT_NODE:
  ------------------
  |  Branch (855:21): [True: 110k, False: 121k]
  ------------------
  856|   127k|		    case XML_CDATA_SECTION_NODE:
  ------------------
  |  Branch (856:7): [True: 16.3k, False: 215k]
  ------------------
  857|   181k|		    case XML_ELEMENT_NODE:
  ------------------
  |  Branch (857:7): [True: 54.3k, False: 177k]
  ------------------
  858|   228k|		    case XML_PI_NODE:
  ------------------
  |  Branch (858:7): [True: 46.7k, False: 185k]
  ------------------
  859|   231k|		    case XML_COMMENT_NODE:
  ------------------
  |  Branch (859:7): [True: 3.50k, False: 228k]
  ------------------
  860|   231k|                        node = set->nodeTab[i];
  861|   231k|			break;
  862|      0|                    default:
  ------------------
  |  Branch (862:21): [True: 0, False: 231k]
  ------------------
  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|   231k|		}
  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|   231k|		copy = xmlXIncludeCopyNode(ctxt, node, 0, targetBase);
  876|   231k|                if (copy == NULL) {
  ------------------
  |  Branch (876:21): [True: 305, False: 231k]
  ------------------
  877|    305|                    xmlFreeNodeList(list);
  878|    305|                    return(NULL);
  879|    305|                }
  880|   231k|		if (last == NULL) {
  ------------------
  |  Branch (880:7): [True: 562, False: 230k]
  ------------------
  881|    562|                    list = copy;
  882|   230k|                } else {
  883|   230k|                    while (last->next != NULL)
  ------------------
  |  Branch (883:28): [True: 0, False: 230k]
  ------------------
  884|      0|                        last = last->next;
  885|   230k|                    copy->prev = last;
  886|   230k|                    last->next = copy;
  887|   230k|		}
  888|   231k|                last = copy;
  889|   231k|	    }
  890|    697|	    break;
  891|  1.00k|	}
  892|    697|	default:
  ------------------
  |  Branch (892:2): [True: 0, False: 1.00k]
  ------------------
  893|      0|	    break;
  894|  1.00k|    }
  895|    697|    return(list);
  896|  1.00k|}
xinclude.c:xmlXIncludeCopyNode:
  705|   232k|                    int copyChildren, const xmlChar *targetBase) {
  706|   232k|    xmlNodePtr result = NULL;
  707|   232k|    xmlNodePtr insertParent = NULL;
  708|   232k|    xmlNodePtr insertLast = NULL;
  709|   232k|    xmlNodePtr cur;
  710|   232k|    xmlNodePtr item;
  711|   232k|    int depth = 0;
  712|       |
  713|   232k|    if (copyChildren) {
  ------------------
  |  Branch (713:9): [True: 439, False: 231k]
  ------------------
  714|    439|        cur = elem->children;
  715|    439|        if (cur == NULL)
  ------------------
  |  Branch (715:13): [True: 0, False: 439]
  ------------------
  716|      0|            return(NULL);
  717|   231k|    } else {
  718|   231k|        cur = elem;
  719|   231k|    }
  720|       |
  721|  1.42M|    while (1) {
  ------------------
  |  Branch (721:12): [True: 1.42M, Folded]
  ------------------
  722|  1.42M|        xmlNodePtr copy = NULL;
  723|  1.42M|        int recurse = 0;
  724|       |
  725|  1.42M|        if ((cur->type == XML_DOCUMENT_NODE) ||
  ------------------
  |  Branch (725:13): [True: 0, False: 1.42M]
  ------------------
  726|  1.42M|            (cur->type == XML_DTD_NODE)) {
  ------------------
  |  Branch (726:13): [True: 0, False: 1.42M]
  ------------------
  727|      0|            ;
  728|  1.42M|        } else if ((cur->type == XML_ELEMENT_NODE) &&
  ------------------
  |  Branch (728:20): [True: 618k, False: 808k]
  ------------------
  729|   618k|                   (cur->ns != NULL) &&
  ------------------
  |  Branch (729:20): [True: 86.3k, False: 531k]
  ------------------
  730|  86.3k|                   (xmlStrEqual(cur->name, XINCLUDE_NODE)) &&
  ------------------
  |  |   38|  86.3k|#define XINCLUDE_NODE (const xmlChar *) "include"
  ------------------
  |  Branch (730:20): [True: 741, False: 85.5k]
  ------------------
  731|    741|                   ((xmlStrEqual(cur->ns->href, XINCLUDE_NS)) ||
  ------------------
  |  |   30|    741|#define XINCLUDE_NS (const xmlChar *) "http://www.w3.org/2003/XInclude"
  ------------------
  |  Branch (731:21): [True: 327, False: 414]
  ------------------
  732|    515|                    (xmlStrEqual(cur->ns->href, XINCLUDE_OLD_NS)))) {
  ------------------
  |  |   34|    414|#define XINCLUDE_OLD_NS (const xmlChar *) "http://www.w3.org/2001/XInclude"
  ------------------
  |  Branch (732:21): [True: 188, False: 226]
  ------------------
  733|    515|            xmlXIncludeRefPtr ref = xmlXIncludeExpandNode(ctxt, cur);
  734|       |
  735|    515|            if (ref == NULL)
  ------------------
  |  Branch (735:17): [True: 145, False: 370]
  ------------------
  736|    145|                goto error;
  737|       |            /*
  738|       |             * TODO: Insert XML_XINCLUDE_START and XML_XINCLUDE_END nodes
  739|       |             */
  740|  3.06k|            for (item = ref->inc; item != NULL; item = item->next) {
  ------------------
  |  Branch (740:35): [True: 2.70k, False: 360]
  ------------------
  741|  2.70k|                copy = xmlStaticCopyNode(item, ctxt->doc, insertParent, 1);
  742|  2.70k|                if (copy == NULL) {
  ------------------
  |  Branch (742:21): [True: 10, False: 2.69k]
  ------------------
  743|     10|                    xmlXIncludeErrMemory(ctxt);
  744|     10|                    goto error;
  745|     10|                }
  746|       |
  747|  2.69k|                if (result == NULL)
  ------------------
  |  Branch (747:21): [True: 29, False: 2.66k]
  ------------------
  748|     29|                    result = copy;
  749|  2.69k|                if (insertLast != NULL) {
  ------------------
  |  Branch (749:21): [True: 2.61k, False: 73]
  ------------------
  750|  2.61k|                    insertLast->next = copy;
  751|  2.61k|                    copy->prev = insertLast;
  752|  2.61k|                } else if (insertParent != NULL) {
  ------------------
  |  Branch (752:28): [True: 44, False: 29]
  ------------------
  753|     44|                    insertParent->children = copy;
  754|     44|                }
  755|  2.69k|                insertLast = copy;
  756|       |
  757|  2.69k|                if ((depth == 0) && (targetBase != NULL))
  ------------------
  |  Branch (757:21): [True: 1.98k, False: 711]
  |  Branch (757:37): [True: 888, False: 1.09k]
  ------------------
  758|    888|                    xmlXIncludeBaseFixup(ctxt, item, copy, targetBase);
  759|  2.69k|            }
  760|  1.42M|        } else {
  761|  1.42M|            copy = xmlStaticCopyNode(cur, ctxt->doc, insertParent, 2);
  762|  1.42M|            if (copy == NULL) {
  ------------------
  |  Branch (762:17): [True: 125, False: 1.42M]
  ------------------
  763|    125|                xmlXIncludeErrMemory(ctxt);
  764|    125|                goto error;
  765|    125|            }
  766|       |
  767|  1.42M|            if (result == NULL)
  ------------------
  |  Branch (767:17): [True: 232k, False: 1.19M]
  ------------------
  768|   232k|                result = copy;
  769|  1.42M|            if (insertLast != NULL) {
  ------------------
  |  Branch (769:17): [True: 725k, False: 700k]
  ------------------
  770|   725k|                insertLast->next = copy;
  771|   725k|                copy->prev = insertLast;
  772|   725k|            } else if (insertParent != NULL) {
  ------------------
  |  Branch (772:24): [True: 468k, False: 232k]
  ------------------
  773|   468k|                insertParent->children = copy;
  774|   468k|            }
  775|  1.42M|            insertLast = copy;
  776|       |
  777|  1.42M|            if ((depth == 0) && (targetBase != NULL))
  ------------------
  |  Branch (777:17): [True: 234k, False: 1.19M]
  |  Branch (777:33): [True: 8.50k, False: 225k]
  ------------------
  778|  8.50k|                xmlXIncludeBaseFixup(ctxt, cur, copy, targetBase);
  779|       |
  780|  1.42M|            recurse = (cur->type != XML_ENTITY_REF_NODE) &&
  ------------------
  |  Branch (780:23): [True: 1.42M, False: 211]
  ------------------
  781|  1.42M|                      (cur->children != NULL);
  ------------------
  |  Branch (781:23): [True: 468k, False: 957k]
  ------------------
  782|  1.42M|        }
  783|       |
  784|  1.42M|        if (recurse) {
  ------------------
  |  Branch (784:13): [True: 468k, False: 957k]
  ------------------
  785|   468k|            cur = cur->children;
  786|   468k|            insertParent = insertLast;
  787|   468k|            insertLast = NULL;
  788|   468k|            depth += 1;
  789|   468k|            continue;
  790|   468k|        }
  791|       |
  792|   957k|        if (cur == elem)
  ------------------
  |  Branch (792:13): [True: 223k, False: 734k]
  ------------------
  793|   223k|            return(result);
  794|       |
  795|  1.19M|        while (cur->next == NULL) {
  ------------------
  |  Branch (795:16): [True: 467k, False: 725k]
  ------------------
  796|   467k|            if (insertParent != NULL)
  ------------------
  |  Branch (796:17): [True: 467k, False: 420]
  ------------------
  797|   467k|                insertParent->last = insertLast;
  798|   467k|            cur = cur->parent;
  799|   467k|            if (cur == elem)
  ------------------
  |  Branch (799:17): [True: 8.15k, False: 459k]
  ------------------
  800|  8.15k|                return(result);
  801|   459k|            insertLast = insertParent;
  802|   459k|            insertParent = insertParent->parent;
  803|   459k|            depth -= 1;
  804|   459k|        }
  805|       |
  806|   725k|        cur = cur->next;
  807|   725k|    }
  808|       |
  809|    280|error:
  810|    280|    xmlFreeNodeList(result);
  811|       |    return(NULL);
  812|   232k|}
xinclude.c:xmlXIncludeLoadTxt:
 1335|    152|xmlXIncludeLoadTxt(xmlXIncludeCtxtPtr ctxt, xmlXIncludeRefPtr ref) {
 1336|    152|    xmlParserInputBufferPtr buf;
 1337|    152|    xmlNodePtr node = NULL;
 1338|    152|    const xmlChar *url = ref->URI;
 1339|    152|    int i;
 1340|    152|    int ret = -1;
 1341|    152|    xmlChar *encoding = NULL;
 1342|    152|    xmlCharEncodingHandlerPtr handler = NULL;
 1343|    152|    xmlParserCtxtPtr pctxt = NULL;
 1344|    152|    xmlParserInputPtr inputStream = NULL;
 1345|    152|    int len;
 1346|    152|    int res;
 1347|    152|    const xmlChar *content;
 1348|       |
 1349|       |    /*
 1350|       |     * Handling of references to the local document are done
 1351|       |     * directly through ctxt->doc.
 1352|       |     */
 1353|    152|    if (url[0] == 0) {
  ------------------
  |  Branch (1353:9): [True: 6, False: 146]
  ------------------
 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|    149|    for (i = 0; i < ctxt->txtNr; i++) {
  ------------------
  |  Branch (1362:17): [True: 18, False: 131]
  ------------------
 1363|     18|	if (xmlStrEqual(url, ctxt->txtTab[i].url)) {
  ------------------
  |  Branch (1363:6): [True: 15, False: 3]
  ------------------
 1364|     15|            node = xmlNewDocText(ctxt->doc, ctxt->txtTab[i].text);
 1365|     15|            if (node == NULL)
  ------------------
  |  Branch (1365:17): [True: 1, False: 14]
  ------------------
 1366|      1|                xmlXIncludeErrMemory(ctxt);
 1367|     15|	    goto loaded;
 1368|     15|	}
 1369|     18|    }
 1370|       |
 1371|       |    /*
 1372|       |     * Try to get the encoding if available
 1373|       |     */
 1374|    131|    if (ref->elem != NULL) {
  ------------------
  |  Branch (1374:9): [True: 131, False: 0]
  ------------------
 1375|    131|	encoding = xmlXIncludeGetProp(ctxt, ref->elem, XINCLUDE_PARSE_ENCODING);
  ------------------
  |  |   62|    131|#define XINCLUDE_PARSE_ENCODING (const xmlChar *) "encoding"
  ------------------
 1376|    131|    }
 1377|    131|    if (encoding != NULL) {
  ------------------
  |  Branch (1377:9): [True: 26, False: 105]
  ------------------
 1378|     26|        xmlParserErrors code;
 1379|       |
 1380|     26|        code = xmlOpenCharEncodingHandler((const char *) encoding,
 1381|     26|                                          /* output */ 0, &handler);
 1382|       |
 1383|     26|        if (code != XML_ERR_OK) {
  ------------------
  |  Branch (1383:13): [True: 13, False: 13]
  ------------------
 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|     26|    }
 1397|       |
 1398|       |    /*
 1399|       |     * Load it.
 1400|       |     */
 1401|    119|    pctxt = xmlNewParserCtxt();
 1402|    119|    if (pctxt == NULL) {
  ------------------
  |  Branch (1402:9): [True: 1, False: 118]
  ------------------
 1403|      1|        xmlXIncludeErrMemory(ctxt);
 1404|      1|        goto error;
 1405|      1|    }
 1406|    118|    if (ctxt->errorHandler != NULL)
  ------------------
  |  Branch (1406:9): [True: 118, False: 0]
  ------------------
 1407|    118|        xmlCtxtSetErrorHandler(pctxt, ctxt->errorHandler, ctxt->errorCtxt);
 1408|    118|    if (ctxt->resourceLoader != NULL)
  ------------------
  |  Branch (1408:9): [True: 118, False: 0]
  ------------------
 1409|    118|        xmlCtxtSetResourceLoader(pctxt, ctxt->resourceLoader,
 1410|    118|                                 ctxt->resourceCtxt);
 1411|       |
 1412|    118|    inputStream = xmlLoadResource(pctxt, (const char*) url, NULL,
 1413|    118|                                  XML_RESOURCE_XINCLUDE_TEXT);
 1414|    118|    if (inputStream == NULL) {
  ------------------
  |  Branch (1414:9): [True: 17, False: 101]
  ------------------
 1415|       |        /*
 1416|       |         * ENOENT only produces a warning which isn't reflected in errNo.
 1417|       |         */
 1418|     17|        if (pctxt->errNo == XML_ERR_NO_MEMORY)
  ------------------
  |  Branch (1418:13): [True: 2, False: 15]
  ------------------
 1419|      2|            xmlXIncludeErrMemory(ctxt);
 1420|     15|        else if ((pctxt->errNo != XML_ERR_OK) &&
  ------------------
  |  Branch (1420:18): [True: 1, False: 14]
  ------------------
 1421|      1|                 (pctxt->errNo != XML_IO_ENOENT) &&
  ------------------
  |  Branch (1421:18): [True: 1, False: 0]
  ------------------
 1422|      1|                 (pctxt->errNo != XML_IO_UNKNOWN))
  ------------------
  |  Branch (1422:18): [True: 1, False: 0]
  ------------------
 1423|      1|            xmlXIncludeErr(ctxt, NULL, pctxt->errNo, "load error", NULL);
 1424|     17|	goto error;
 1425|     17|    }
 1426|    101|    buf = inputStream->buf;
 1427|    101|    if (buf == NULL)
  ------------------
  |  Branch (1427:9): [True: 0, False: 101]
  ------------------
 1428|      0|	goto error;
 1429|    101|    if (buf->encoder)
  ------------------
  |  Branch (1429:9): [True: 0, False: 101]
  ------------------
 1430|      0|	xmlCharEncCloseFunc(buf->encoder);
 1431|    101|    buf->encoder = handler;
 1432|    101|    handler = NULL;
 1433|       |
 1434|    101|    node = xmlNewDocText(ctxt->doc, NULL);
 1435|    101|    if (node == NULL) {
  ------------------
  |  Branch (1435:9): [True: 1, False: 100]
  ------------------
 1436|      1|        xmlXIncludeErrMemory(ctxt);
 1437|      1|	goto error;
 1438|      1|    }
 1439|       |
 1440|       |    /*
 1441|       |     * Scan all chars from the resource and add the to the node
 1442|       |     */
 1443|    100|    do {
 1444|    100|        res = xmlParserInputBufferRead(buf, 4096);
 1445|    100|    } while (res > 0);
  ------------------
  |  Branch (1445:14): [True: 0, False: 100]
  ------------------
 1446|    100|    if (res < 0) {
  ------------------
  |  Branch (1446:9): [True: 0, False: 100]
  ------------------
 1447|      0|        if (buf->error == XML_ERR_NO_MEMORY)
  ------------------
  |  Branch (1447:13): [True: 0, False: 0]
  ------------------
 1448|      0|            xmlXIncludeErrMemory(ctxt);
 1449|      0|        else
 1450|      0|            xmlXIncludeErr(ctxt, NULL, buf->error, "read error", NULL);
 1451|      0|        goto error;
 1452|      0|    }
 1453|       |
 1454|    100|    content = xmlBufContent(buf->buffer);
 1455|    100|    len = xmlBufUse(buf->buffer);
 1456|  11.3k|    for (i = 0; i < len;) {
  ------------------
  |  Branch (1456:17): [True: 11.3k, False: 42]
  ------------------
 1457|  11.3k|        int cur;
 1458|  11.3k|        int l;
 1459|       |
 1460|  11.3k|        l = len - i;
 1461|  11.3k|        cur = xmlGetUTF8Char(&content[i], &l);
 1462|  11.3k|        if ((cur < 0) || (!IS_CHAR(cur))) {
  ------------------
  |  |  115|  11.2k|#define IS_CHAR(c)   xmlIsCharQ(c)
  |  |  ------------------
  |  |  |  |  117|  11.2k|#define xmlIsCharQ(c)		(((c) < 0x100) ? \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (117:25): [True: 10.9k, False: 337]
  |  |  |  |  ------------------
  |  |  |  |  118|  11.2k|				 xmlIsChar_ch((c)) :\
  |  |  |  |  ------------------
  |  |  |  |  |  |  108|  10.9k|#define xmlIsChar_ch(c)		(((0x9 <= (c)) && ((c) <= 0xa)) || \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (108:28): [True: 10.9k, False: 14]
  |  |  |  |  |  |  |  Branch (108:44): [True: 696, False: 10.2k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  109|  10.9k|				 ((c) == 0xd) || \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (109:6): [True: 216, False: 10.0k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  110|  10.9k|				  (0x20 <= (c)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (110:7): [True: 10.0k, False: 22]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  119|  11.2k|				(((0x100 <= (c)) && ((c) <= 0xd7ff)) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (119:7): [True: 337, False: 0]
  |  |  |  |  |  Branch (119:25): [True: 215, False: 122]
  |  |  |  |  ------------------
  |  |  |  |  120|    337|				 ((0xe000 <= (c)) && ((c) <= 0xfffd)) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (120:7): [True: 122, False: 0]
  |  |  |  |  |  Branch (120:26): [True: 32, False: 90]
  |  |  |  |  ------------------
  |  |  |  |  121|    337|				 ((0x10000 <= (c)) && ((c) <= 0x10ffff))))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (121:7): [True: 89, False: 1]
  |  |  |  |  |  Branch (121:27): [True: 89, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (1462:13): [True: 35, False: 11.2k]
  |  Branch (1462:26): [True: 23, False: 11.2k]
  ------------------
 1463|     58|            xmlXIncludeErr(ctxt, ref->elem, XML_XINCLUDE_INVALID_CHAR,
 1464|     58|                           "%s contains invalid char\n", url);
 1465|     58|            goto error;
 1466|     58|        }
 1467|       |
 1468|  11.2k|        i += l;
 1469|  11.2k|    }
 1470|       |
 1471|     42|    if (xmlNodeAddContentLen(node, content, len) < 0)
  ------------------
  |  Branch (1471:9): [True: 1, False: 41]
  ------------------
 1472|      1|        xmlXIncludeErrMemory(ctxt);
 1473|       |
 1474|     42|    if (ctxt->txtNr >= ctxt->txtMax) {
  ------------------
  |  Branch (1474:9): [True: 42, False: 0]
  ------------------
 1475|     42|        xmlXIncludeTxt *tmp;
 1476|     42|        int newSize;
 1477|       |
 1478|     42|        newSize = xmlGrowCapacity(ctxt->txtMax, sizeof(tmp[0]),
 1479|     42|                                  8, XML_MAX_ITEMS);
  ------------------
  |  |   13|     42|#define XML_MAX_ITEMS 1000000000 /* 1 billion */
  ------------------
 1480|     42|        if (newSize < 0) {
  ------------------
  |  Branch (1480:13): [True: 0, False: 42]
  ------------------
 1481|      0|            xmlXIncludeErrMemory(ctxt);
 1482|      0|	    goto error;
 1483|      0|        }
 1484|     42|        tmp = xmlRealloc(ctxt->txtTab, newSize * sizeof(tmp[0]));
 1485|     42|        if (tmp == NULL) {
  ------------------
  |  Branch (1485:13): [True: 2, False: 40]
  ------------------
 1486|      2|            xmlXIncludeErrMemory(ctxt);
 1487|      2|	    goto error;
 1488|      2|        }
 1489|     40|        ctxt->txtMax = newSize;
 1490|     40|        ctxt->txtTab = tmp;
 1491|     40|    }
 1492|     40|    ctxt->txtTab[ctxt->txtNr].text = xmlStrdup(node->content);
 1493|     40|    if ((node->content != NULL) &&
  ------------------
  |  Branch (1493:9): [True: 21, False: 19]
  ------------------
 1494|     21|        (ctxt->txtTab[ctxt->txtNr].text == NULL)) {
  ------------------
  |  Branch (1494:9): [True: 1, False: 20]
  ------------------
 1495|      1|        xmlXIncludeErrMemory(ctxt);
 1496|      1|        goto error;
 1497|      1|    }
 1498|     39|    ctxt->txtTab[ctxt->txtNr].url = xmlStrdup(url);
 1499|     39|    if (ctxt->txtTab[ctxt->txtNr].url == NULL) {
  ------------------
  |  Branch (1499:9): [True: 1, False: 38]
  ------------------
 1500|      1|        xmlXIncludeErrMemory(ctxt);
 1501|      1|        xmlFree(ctxt->txtTab[ctxt->txtNr].text);
 1502|      1|        goto error;
 1503|      1|    }
 1504|     38|    ctxt->txtNr++;
 1505|       |
 1506|     53|loaded:
 1507|       |    /*
 1508|       |     * Add the element as the replacement copy.
 1509|       |     */
 1510|     53|    ref->inc = node;
 1511|     53|    node = NULL;
 1512|     53|    ret = 0;
 1513|       |
 1514|    152|error:
 1515|    152|    xmlFreeNode(node);
 1516|    152|    xmlFreeInputStream(inputStream);
 1517|    152|    xmlFreeParserCtxt(pctxt);
 1518|    152|    xmlCharEncCloseFunc(handler);
 1519|    152|    xmlFree(encoding);
 1520|    152|    return(ret);
 1521|     53|}
xinclude.c:xmlXIncludeLoadFallback:
 1534|    474|                        xmlXIncludeRefPtr ref) {
 1535|    474|    int ret = 0;
 1536|    474|    int oldNbErrors;
 1537|       |
 1538|    474|    if ((fallback == NULL) || (fallback->type == XML_NAMESPACE_DECL) ||
  ------------------
  |  Branch (1538:9): [True: 0, False: 474]
  |  Branch (1538:31): [True: 0, False: 474]
  ------------------
 1539|    474|        (ctxt == NULL))
  ------------------
  |  Branch (1539:9): [True: 0, False: 474]
  ------------------
 1540|      0|	return(-1);
 1541|    474|    if (fallback->children != NULL) {
  ------------------
  |  Branch (1541:9): [True: 439, False: 35]
  ------------------
 1542|       |	/*
 1543|       |	 * It's possible that the fallback also has 'includes'
 1544|       |	 * (Bug 129969), so we re-process the fallback just in case
 1545|       |	 */
 1546|    439|        oldNbErrors = ctxt->nbErrors;
 1547|    439|	ref->inc = xmlXIncludeCopyNode(ctxt, fallback, 1, ref->base);
 1548|    439|	if (ctxt->nbErrors > oldNbErrors)
  ------------------
  |  Branch (1548:6): [True: 109, False: 330]
  ------------------
 1549|    109|	    ret = -1;
 1550|    439|    } else {
 1551|       |        ref->inc = NULL;
 1552|     35|    }
 1553|    474|    ref->fallback = 1;
 1554|    474|    return(ret);
 1555|    474|}
xinclude.c:xmlXIncludeIncludeNode:
 1694|  16.8k|xmlXIncludeIncludeNode(xmlXIncludeCtxtPtr ctxt, xmlXIncludeRefPtr ref) {
 1695|  16.8k|    xmlNodePtr cur, end, list, tmp;
 1696|       |
 1697|  16.8k|    if ((ctxt == NULL) || (ref == NULL))
  ------------------
  |  Branch (1697:9): [True: 0, False: 16.8k]
  |  Branch (1697:27): [True: 0, False: 16.8k]
  ------------------
 1698|      0|	return(-1);
 1699|  16.8k|    cur = ref->elem;
 1700|  16.8k|    if ((cur == NULL) || (cur->type == XML_NAMESPACE_DECL))
  ------------------
  |  Branch (1700:9): [True: 0, False: 16.8k]
  |  Branch (1700:26): [True: 0, False: 16.8k]
  ------------------
 1701|      0|	return(-1);
 1702|       |
 1703|  16.8k|    list = ref->inc;
 1704|  16.8k|    ref->inc = NULL;
 1705|       |
 1706|       |    /*
 1707|       |     * Check against the risk of generating a multi-rooted document
 1708|       |     */
 1709|  16.8k|    if ((cur->parent != NULL) &&
  ------------------
  |  Branch (1709:9): [True: 16.8k, False: 0]
  ------------------
 1710|  16.8k|	(cur->parent->type != XML_ELEMENT_NODE)) {
  ------------------
  |  Branch (1710:2): [True: 7.94k, False: 8.92k]
  ------------------
 1711|  7.94k|	int nb_elem = 0;
 1712|       |
 1713|  7.94k|	tmp = list;
 1714|  11.5k|	while (tmp != NULL) {
  ------------------
  |  Branch (1714:9): [True: 3.60k, False: 7.94k]
  ------------------
 1715|  3.60k|	    if (tmp->type == XML_ELEMENT_NODE)
  ------------------
  |  Branch (1715:10): [True: 3.06k, False: 540]
  ------------------
 1716|  3.06k|		nb_elem++;
 1717|  3.60k|	    tmp = tmp->next;
 1718|  3.60k|	}
 1719|  7.94k|        if (nb_elem != 1) {
  ------------------
  |  Branch (1719:13): [True: 5.30k, False: 2.64k]
  ------------------
 1720|  5.30k|            if (nb_elem > 1)
  ------------------
  |  Branch (1720:17): [True: 56, False: 5.24k]
  ------------------
 1721|     56|                xmlXIncludeErr(ctxt, ref->elem, XML_XINCLUDE_MULTIPLE_ROOT,
 1722|     56|                               "XInclude error: would result in multiple root "
 1723|     56|                               "nodes\n", NULL);
 1724|  5.24k|            else
 1725|  5.24k|                xmlXIncludeErr(ctxt, ref->elem, XML_XINCLUDE_MULTIPLE_ROOT,
 1726|  5.24k|                               "XInclude error: would result in no root "
 1727|  5.24k|                               "node\n", NULL);
 1728|  5.30k|            xmlFreeNodeList(list);
 1729|  5.30k|	    return(-1);
 1730|  5.30k|	}
 1731|  7.94k|    }
 1732|       |
 1733|  11.5k|    if (ctxt->parseFlags & XML_PARSE_NOXINCNODE) {
  ------------------
  |  Branch (1733:9): [True: 0, False: 11.5k]
  ------------------
 1734|       |	/*
 1735|       |	 * Add the list of nodes
 1736|       |         *
 1737|       |         * TODO: Coalesce text nodes unless we are streaming mode.
 1738|       |	 */
 1739|      0|	while (list != NULL) {
  ------------------
  |  Branch (1739:9): [True: 0, False: 0]
  ------------------
 1740|      0|	    end = list;
 1741|      0|	    list = list->next;
 1742|       |
 1743|      0|	    if (xmlAddPrevSibling(cur, end) == NULL) {
  ------------------
  |  Branch (1743:10): [True: 0, False: 0]
  ------------------
 1744|      0|                xmlUnlinkNode(end);
 1745|      0|                xmlFreeNode(end);
 1746|      0|                goto err_memory;
 1747|      0|            }
 1748|      0|	}
 1749|      0|	xmlUnlinkNode(cur);
 1750|      0|	xmlFreeNode(cur);
 1751|  11.5k|    } else {
 1752|  11.5k|        xmlNodePtr child, next;
 1753|       |
 1754|       |	/*
 1755|       |	 * Change the current node as an XInclude start one, and add an
 1756|       |	 * XInclude end one
 1757|       |	 */
 1758|  11.5k|        if (ref->fallback)
  ------------------
  |  Branch (1758:13): [True: 162, False: 11.4k]
  ------------------
 1759|    162|            xmlUnsetProp(cur, BAD_CAST "href");
  ------------------
  |  |   34|    162|#define BAD_CAST (xmlChar *)
  ------------------
 1760|  11.5k|	cur->type = XML_XINCLUDE_START;
 1761|       |        /* Remove fallback children */
 1762|  23.6k|        for (child = cur->children; child != NULL; child = next) {
  ------------------
  |  Branch (1762:37): [True: 12.0k, False: 11.5k]
  ------------------
 1763|  12.0k|            next = child->next;
 1764|  12.0k|            xmlUnlinkNode(child);
 1765|  12.0k|            xmlFreeNode(child);
 1766|  12.0k|        }
 1767|  11.5k|	end = xmlNewDocNode(cur->doc, cur->ns, cur->name, NULL);
 1768|  11.5k|	if (end == NULL)
  ------------------
  |  Branch (1768:6): [True: 24, False: 11.5k]
  ------------------
 1769|     24|            goto err_memory;
 1770|  11.5k|	end->type = XML_XINCLUDE_END;
 1771|  11.5k|	if (xmlAddNextSibling(cur, end) == NULL) {
  ------------------
  |  Branch (1771:6): [True: 0, False: 11.5k]
  ------------------
 1772|      0|            xmlFreeNode(end);
 1773|      0|            goto err_memory;
 1774|      0|        }
 1775|       |
 1776|       |	/*
 1777|       |	 * Add the list of nodes
 1778|       |	 */
 1779|   246k|	while (list != NULL) {
  ------------------
  |  Branch (1779:9): [True: 234k, False: 11.5k]
  ------------------
 1780|   234k|	    cur = list;
 1781|   234k|	    list = list->next;
 1782|       |
 1783|   234k|	    if (xmlAddPrevSibling(end, cur) == NULL) {
  ------------------
  |  Branch (1783:10): [True: 0, False: 234k]
  ------------------
 1784|      0|                xmlUnlinkNode(cur);
 1785|      0|                xmlFreeNode(cur);
 1786|      0|                goto err_memory;
 1787|      0|            }
 1788|   234k|	}
 1789|  11.5k|    }
 1790|       |
 1791|       |
 1792|  11.5k|    return(0);
 1793|       |
 1794|     24|err_memory:
 1795|     24|    xmlXIncludeErrMemory(ctxt);
 1796|     24|    xmlFreeNodeList(list);
 1797|     24|    return(-1);
 1798|  11.5k|}

xmlSerializeText:
  306|  2.15M|                 unsigned flags) {
  307|  2.15M|    const xmlChar *cur;
  308|  2.15M|    const signed char *tab;
  309|       |
  310|  2.15M|    if (string == NULL)
  ------------------
  |  Branch (310:9): [True: 0, False: 2.15M]
  ------------------
  311|      0|        return;
  312|       |
  313|  2.15M|#ifdef LIBXML_HTML_ENABLED
  314|  2.15M|    if (flags & XML_ESCAPE_HTML) {
  ------------------
  |  |   24|  2.15M|#define XML_ESCAPE_HTML             (1u << 2)
  ------------------
  |  Branch (314:9): [True: 0, False: 2.15M]
  ------------------
  315|      0|        if (flags & XML_ESCAPE_ATTR)
  ------------------
  |  |   22|      0|#define XML_ESCAPE_ATTR             (1u << 0)
  ------------------
  |  Branch (315:13): [True: 0, False: 0]
  ------------------
  316|      0|            tab = htmlEscapeTabAttr;
  317|      0|        else
  318|      0|            tab = htmlEscapeTab;
  319|      0|    }
  320|  2.15M|    else
  321|  2.15M|#endif
  322|  2.15M|    {
  323|  2.15M|        if (flags & XML_ESCAPE_QUOT)
  ------------------
  |  |   25|  2.15M|#define XML_ESCAPE_QUOT             (1u << 3)
  ------------------
  |  Branch (323:13): [True: 0, False: 2.15M]
  ------------------
  324|      0|            tab = xmlEscapeTabQuot;
  325|  2.15M|        else if (flags & XML_ESCAPE_ATTR)
  ------------------
  |  |   22|  2.15M|#define XML_ESCAPE_ATTR             (1u << 0)
  ------------------
  |  Branch (325:18): [True: 993k, False: 1.15M]
  ------------------
  326|   993k|            tab = xmlEscapeTabAttr;
  327|  1.15M|        else
  328|  1.15M|            tab = xmlEscapeTab;
  329|  2.15M|    }
  330|       |
  331|  2.15M|    cur = string;
  332|       |
  333|  2.22M|    while (1) {
  ------------------
  |  Branch (333:12): [True: 2.22M, Folded]
  ------------------
  334|  2.22M|        const xmlChar *base;
  335|  2.22M|        int c;
  336|  2.22M|        int offset;
  337|       |
  338|  2.22M|        base = cur;
  339|  2.22M|        offset = -1;
  340|       |
  341|   101M|        while (1) {
  ------------------
  |  Branch (341:16): [True: 101M, Folded]
  ------------------
  342|   101M|            if ((size_t) (cur - string) >= maxSize)
  ------------------
  |  Branch (342:17): [True: 0, False: 101M]
  ------------------
  343|      0|                break;
  344|       |
  345|   101M|            c = (unsigned char) *cur;
  346|       |
  347|   101M|            if (c < 0x80) {
  ------------------
  |  Branch (347:17): [True: 96.1M, False: 5.77M]
  ------------------
  348|  96.1M|                offset = tab[c];
  349|  96.1M|                if (offset >= 0)
  ------------------
  |  Branch (349:21): [True: 2.22M, False: 93.9M]
  ------------------
  350|  2.22M|                    break;
  351|  96.1M|            } else if (flags & XML_ESCAPE_NON_ASCII) {
  ------------------
  |  |   23|  5.77M|#define XML_ESCAPE_NON_ASCII        (1u << 1)
  ------------------
  |  Branch (351:24): [True: 0, False: 5.77M]
  ------------------
  352|      0|                break;
  353|      0|            }
  354|       |
  355|  99.6M|            cur += 1;
  356|  99.6M|        }
  357|       |
  358|  2.22M|        if (cur > base)
  ------------------
  |  Branch (358:13): [True: 2.13M, False: 90.2k]
  ------------------
  359|  2.13M|            xmlOutputBufferWrite(buf, cur - base, (char *) base);
  360|       |
  361|  2.22M|        if ((size_t) (cur - string) >= maxSize)
  ------------------
  |  Branch (361:13): [True: 0, False: 2.22M]
  ------------------
  362|      0|            break;
  363|       |
  364|  2.22M|        if (offset >= 0) {
  ------------------
  |  Branch (364:13): [True: 2.22M, False: 0]
  ------------------
  365|  2.22M|            if (c == 0)
  ------------------
  |  Branch (365:17): [True: 2.15M, False: 72.8k]
  ------------------
  366|  2.15M|                break;
  367|       |
  368|  72.8k|            xmlOutputBufferWrite(buf, xmlEscapeContent[offset],
  369|  72.8k|                                 &xmlEscapeContent[offset+1]);
  370|  72.8k|            cur += 1;
  371|  72.8k|        } 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|  2.22M|    }
  390|  2.15M|}
xmlAllocParserInputBuffer:
 1332|  36.4k|xmlAllocParserInputBuffer(xmlCharEncoding enc) {
 1333|  36.4k|    xmlParserInputBufferPtr ret;
 1334|       |
 1335|  36.4k|    ret = (xmlParserInputBufferPtr) xmlMalloc(sizeof(xmlParserInputBuffer));
 1336|  36.4k|    if (ret == NULL) {
  ------------------
  |  Branch (1336:9): [True: 6, False: 36.4k]
  ------------------
 1337|      6|	return(NULL);
 1338|      6|    }
 1339|  36.4k|    memset(ret, 0, sizeof(xmlParserInputBuffer));
 1340|  36.4k|    ret->buffer = xmlBufCreate(XML_IO_BUFFER_SIZE);
  ------------------
  |  |   20|  36.4k|#define XML_IO_BUFFER_SIZE 6000
  ------------------
 1341|  36.4k|    if (ret->buffer == NULL) {
  ------------------
  |  Branch (1341:9): [True: 4, False: 36.4k]
  ------------------
 1342|      4|        xmlFree(ret);
 1343|      4|	return(NULL);
 1344|      4|    }
 1345|  36.4k|    if (enc != XML_CHAR_ENCODING_NONE) {
  ------------------
  |  Branch (1345:9): [True: 0, False: 36.4k]
  ------------------
 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|  36.4k|    if (ret->encoder != NULL)
  ------------------
  |  Branch (1352:9): [True: 0, False: 36.4k]
  ------------------
 1353|      0|        ret->raw = xmlBufCreate(XML_IO_BUFFER_SIZE);
  ------------------
  |  |   20|      0|#define XML_IO_BUFFER_SIZE 6000
  ------------------
 1354|  36.4k|    else
 1355|  36.4k|        ret->raw = NULL;
 1356|  36.4k|    ret->readcallback = NULL;
 1357|  36.4k|    ret->closecallback = NULL;
 1358|  36.4k|    ret->context = NULL;
 1359|  36.4k|    ret->compressed = -1;
 1360|  36.4k|    ret->rawconsumed = 0;
 1361|       |
 1362|  36.4k|    return(ret);
 1363|  36.4k|}
xmlAllocOutputBuffer:
 1375|  30.0k|xmlAllocOutputBuffer(xmlCharEncodingHandler *encoder) {
 1376|  30.0k|    xmlOutputBufferPtr ret;
 1377|       |
 1378|  30.0k|    ret = (xmlOutputBufferPtr) xmlMalloc(sizeof(xmlOutputBuffer));
 1379|  30.0k|    if (ret == NULL) {
  ------------------
  |  Branch (1379:9): [True: 35, False: 30.0k]
  ------------------
 1380|     35|	return(NULL);
 1381|     35|    }
 1382|  30.0k|    memset(ret, 0, sizeof(xmlOutputBuffer));
 1383|  30.0k|    ret->buffer = xmlBufCreate(MINLEN);
  ------------------
  |  |   52|  30.0k|#define MINLEN 4000
  ------------------
 1384|  30.0k|    if (ret->buffer == NULL) {
  ------------------
  |  Branch (1384:9): [True: 42, False: 29.9k]
  ------------------
 1385|     42|        xmlFree(ret);
 1386|     42|	return(NULL);
 1387|     42|    }
 1388|       |
 1389|  29.9k|    ret->encoder = encoder;
 1390|  29.9k|    if (encoder != NULL) {
  ------------------
  |  Branch (1390:9): [True: 0, False: 29.9k]
  ------------------
 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.9k|        ret->conv = NULL;
 1404|  29.9k|    ret->writecallback = NULL;
 1405|  29.9k|    ret->closecallback = NULL;
 1406|  29.9k|    ret->context = NULL;
 1407|  29.9k|    ret->written = 0;
 1408|       |
 1409|  29.9k|    return(ret);
 1410|  29.9k|}
xmlFreeParserInputBuffer:
 1419|   335k|xmlFreeParserInputBuffer(xmlParserInputBuffer *in) {
 1420|   335k|    if (in == NULL) return;
  ------------------
  |  Branch (1420:9): [True: 2.41k, False: 332k]
  ------------------
 1421|       |
 1422|   332k|    if (in->raw) {
  ------------------
  |  Branch (1422:9): [True: 13.7k, False: 319k]
  ------------------
 1423|  13.7k|        xmlBufFree(in->raw);
 1424|  13.7k|	in->raw = NULL;
 1425|  13.7k|    }
 1426|   332k|    if (in->encoder != NULL) {
  ------------------
  |  Branch (1426:9): [True: 13.7k, False: 319k]
  ------------------
 1427|  13.7k|        xmlCharEncCloseFunc(in->encoder);
 1428|  13.7k|    }
 1429|   332k|    if (in->closecallback != NULL) {
  ------------------
  |  Branch (1429:9): [True: 0, False: 332k]
  ------------------
 1430|      0|	in->closecallback(in->context);
 1431|      0|    }
 1432|   332k|    if (in->buffer != NULL) {
  ------------------
  |  Branch (1432:9): [True: 332k, False: 0]
  ------------------
 1433|   332k|        xmlBufFree(in->buffer);
 1434|   332k|	in->buffer = NULL;
 1435|   332k|    }
 1436|       |
 1437|   332k|    xmlFree(in);
 1438|   332k|}
xmlOutputBufferClose:
 1451|  29.9k|{
 1452|  29.9k|    int ret;
 1453|       |
 1454|  29.9k|    if (out == NULL)
  ------------------
  |  Branch (1454:9): [True: 0, False: 29.9k]
  ------------------
 1455|      0|        return (-1);
 1456|       |
 1457|  29.9k|    if (out->writecallback != NULL)
  ------------------
  |  Branch (1457:9): [True: 0, False: 29.9k]
  ------------------
 1458|      0|        xmlOutputBufferFlush(out);
 1459|       |
 1460|  29.9k|    if (out->closecallback != NULL) {
  ------------------
  |  Branch (1460:9): [True: 0, False: 29.9k]
  ------------------
 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.9k|    if (out->error != XML_ERR_OK)
  ------------------
  |  Branch (1472:9): [True: 21, False: 29.9k]
  ------------------
 1473|     21|        ret = -out->error;
 1474|  29.9k|    else
 1475|  29.9k|        ret = out->written;
 1476|       |
 1477|  29.9k|    if (out->conv) {
  ------------------
  |  Branch (1477:9): [True: 0, False: 29.9k]
  ------------------
 1478|      0|        xmlBufFree(out->conv);
 1479|      0|        out->conv = NULL;
 1480|      0|    }
 1481|  29.9k|    if (out->encoder != NULL) {
  ------------------
  |  Branch (1481:9): [True: 0, False: 29.9k]
  ------------------
 1482|      0|        xmlCharEncCloseFunc(out->encoder);
 1483|      0|    }
 1484|  29.9k|    if (out->buffer != NULL) {
  ------------------
  |  Branch (1484:9): [True: 29.9k, False: 0]
  ------------------
 1485|  29.9k|        xmlBufFree(out->buffer);
 1486|  29.9k|        out->buffer = NULL;
 1487|  29.9k|    }
 1488|       |
 1489|  29.9k|    xmlFree(out);
 1490|       |
 1491|  29.9k|    return(ret);
 1492|  29.9k|}
xmlNewInputBufferMemory:
 1940|   284k|                        xmlParserInputFlags flags, xmlCharEncoding enc) {
 1941|   284k|    xmlParserInputBufferPtr ret;
 1942|       |
 1943|   284k|    if ((flags & XML_INPUT_BUF_STATIC) &&
  ------------------
  |  Branch (1943:9): [True: 248k, False: 36.4k]
  ------------------
 1944|   248k|        ((flags & XML_INPUT_BUF_ZERO_TERMINATED) == 0)) {
  ------------------
  |  Branch (1944:9): [True: 0, False: 248k]
  ------------------
 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|   284k|    } else {
 1968|   284k|        ret = xmlMalloc(sizeof(*ret));
 1969|   284k|        if (ret == NULL)
  ------------------
  |  Branch (1969:13): [True: 17, False: 284k]
  ------------------
 1970|     17|            return(NULL);
 1971|   284k|        memset(ret, 0, sizeof(xmlParserInputBuffer));
 1972|   284k|        ret->compressed = -1;
 1973|       |
 1974|   284k|        ret->buffer = xmlBufCreateMem((const xmlChar *) mem, size,
 1975|   284k|                                      (flags & XML_INPUT_BUF_STATIC ? 1 : 0));
  ------------------
  |  Branch (1975:40): [True: 248k, False: 36.4k]
  ------------------
 1976|   284k|        if (ret->buffer == NULL) {
  ------------------
  |  Branch (1976:13): [True: 26, False: 284k]
  ------------------
 1977|     26|            xmlFree(ret);
 1978|     26|            return(NULL);
 1979|     26|        }
 1980|   284k|    }
 1981|       |
 1982|   284k|    return(ret);
 1983|   284k|}
xmlParserInputBufferCreateMem:
 2005|  36.4k|xmlParserInputBufferCreateMem(const char *mem, int size, xmlCharEncoding enc) {
 2006|  36.4k|    if ((mem == NULL) || (size < 0))
  ------------------
  |  Branch (2006:9): [True: 0, False: 36.4k]
  |  Branch (2006:26): [True: 0, False: 36.4k]
  ------------------
 2007|      0|        return(NULL);
 2008|       |
 2009|  36.4k|    return(xmlNewInputBufferMemory(mem, size, 0, enc));
 2010|  36.4k|}
xmlNewInputBufferString:
 2049|  11.8k|xmlNewInputBufferString(const char *str, xmlParserInputFlags flags) {
 2050|  11.8k|    xmlParserInputBufferPtr ret;
 2051|       |
 2052|  11.8k|    ret = xmlMalloc(sizeof(*ret));
 2053|  11.8k|    if (ret == NULL)
  ------------------
  |  Branch (2053:9): [True: 4, False: 11.8k]
  ------------------
 2054|      4|	return(NULL);
 2055|  11.8k|    memset(ret, 0, sizeof(xmlParserInputBuffer));
 2056|  11.8k|    ret->compressed = -1;
 2057|       |
 2058|  11.8k|    ret->buffer = xmlBufCreateMem((const xmlChar *) str, strlen(str),
 2059|  11.8k|                                  (flags & XML_INPUT_BUF_STATIC ? 1 : 0));
  ------------------
  |  Branch (2059:36): [True: 11.8k, False: 0]
  ------------------
 2060|  11.8k|    if (ret->buffer == NULL) {
  ------------------
  |  Branch (2060:9): [True: 5, False: 11.8k]
  ------------------
 2061|      5|        xmlFree(ret);
 2062|      5|	return(NULL);
 2063|      5|    }
 2064|       |
 2065|  11.8k|    return(ret);
 2066|  11.8k|}
xmlParserInputBufferPush:
 2231|   449k|	                 int len, const char *buf) {
 2232|   449k|    size_t nbchars = 0;
 2233|   449k|    int ret;
 2234|       |
 2235|   449k|    if (len < 0) return(0);
  ------------------
  |  Branch (2235:9): [True: 0, False: 449k]
  ------------------
 2236|   449k|    if ((in == NULL) || (in->error)) return(-1);
  ------------------
  |  Branch (2236:9): [True: 0, False: 449k]
  |  Branch (2236:25): [True: 233, False: 449k]
  ------------------
 2237|   449k|    if (in->encoder != NULL) {
  ------------------
  |  Branch (2237:9): [True: 30.0k, False: 419k]
  ------------------
 2238|       |        /*
 2239|       |	 * Store the data in the incoming raw buffer
 2240|       |	 */
 2241|  30.0k|        if (in->raw == NULL) {
  ------------------
  |  Branch (2241:13): [True: 0, False: 30.0k]
  ------------------
 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|  30.0k|	ret = xmlBufAdd(in->raw, (const xmlChar *) buf, len);
 2249|  30.0k|	if (ret != 0) {
  ------------------
  |  Branch (2249:6): [True: 0, False: 30.0k]
  ------------------
 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|  30.0k|        nbchars = SIZE_MAX;
 2258|  30.0k|	if (xmlCharEncInput(in, &nbchars, /* flush */ 0) !=
  ------------------
  |  Branch (2258:6): [True: 10, False: 30.0k]
  ------------------
 2259|  30.0k|            XML_ENC_ERR_SUCCESS)
 2260|     10|            return(-1);
 2261|  30.0k|        if (nbchars > INT_MAX)
  ------------------
  |  Branch (2261:13): [True: 0, False: 30.0k]
  ------------------
 2262|      0|            nbchars = INT_MAX;
 2263|   419k|    } else {
 2264|   419k|	nbchars = len;
 2265|   419k|        ret = xmlBufAdd(in->buffer, (xmlChar *) buf, nbchars);
 2266|   419k|	if (ret != 0) {
  ------------------
  |  Branch (2266:6): [True: 1, False: 419k]
  ------------------
 2267|      1|            in->error = XML_ERR_NO_MEMORY;
 2268|      1|	    return(-1);
 2269|      1|        }
 2270|   419k|    }
 2271|   449k|    return(nbchars);
 2272|   449k|}
xmlParserInputBufferGrow:
 2298|   501k|xmlParserInputBufferGrow(xmlParserInputBuffer *in, int len) {
 2299|   501k|    int res = 0;
 2300|       |
 2301|   501k|    if ((in == NULL) || (in->error))
  ------------------
  |  Branch (2301:9): [True: 0, False: 501k]
  |  Branch (2301:25): [True: 1.03k, False: 500k]
  ------------------
 2302|  1.03k|        return(-1);
 2303|       |
 2304|   500k|    if (len < MINLEN)
  ------------------
  |  |   52|   500k|#define MINLEN 4000
  ------------------
  |  Branch (2304:9): [True: 278k, False: 221k]
  ------------------
 2305|   278k|        len = MINLEN;
  ------------------
  |  |   52|   278k|#define MINLEN 4000
  ------------------
 2306|       |
 2307|       |    /*
 2308|       |     * Call the read method for this I/O type.
 2309|       |     */
 2310|   500k|    if (in->readcallback != NULL) {
  ------------------
  |  Branch (2310:9): [True: 0, False: 500k]
  ------------------
 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|   500k|    if (in->encoder != NULL) {
  ------------------
  |  Branch (2355:9): [True: 300k, False: 199k]
  ------------------
 2356|   300k|        size_t sizeOut;
 2357|       |
 2358|       |        /*
 2359|       |         * Don't convert whole buffer when reading from memory.
 2360|       |         */
 2361|   300k|        if (in->readcallback == NULL)
  ------------------
  |  Branch (2361:13): [True: 300k, False: 0]
  ------------------
 2362|   300k|            sizeOut = len;
 2363|      0|        else
 2364|      0|            sizeOut = SIZE_MAX;
 2365|       |
 2366|   300k|	if (xmlCharEncInput(in, &sizeOut, /* flush */ 0) !=
  ------------------
  |  Branch (2366:6): [True: 796, False: 300k]
  ------------------
 2367|   300k|            XML_ENC_ERR_SUCCESS)
 2368|    796|	    return(-1);
 2369|   300k|        res = sizeOut;
 2370|   300k|    }
 2371|   499k|    return(res);
 2372|   500k|}
xmlParserInputBufferRead:
 2385|  66.3k|xmlParserInputBufferRead(xmlParserInputBuffer *in, int len) {
 2386|  66.3k|    return(xmlParserInputBufferGrow(in, len));
 2387|  66.3k|}
xmlOutputBufferWrite:
 2403|  18.5M|xmlOutputBufferWrite(xmlOutputBuffer *out, int len, const char *data) {
 2404|  18.5M|    xmlBufPtr buf = NULL;
 2405|  18.5M|    size_t written = 0;
 2406|  18.5M|    int ret;
 2407|       |
 2408|  18.5M|    if ((out == NULL) || (out->error))
  ------------------
  |  Branch (2408:9): [True: 0, False: 18.5M]
  |  Branch (2408:26): [True: 12.2k, False: 18.5M]
  ------------------
 2409|  12.2k|        return(-1);
 2410|  18.5M|    if (len < 0)
  ------------------
  |  Branch (2410:9): [True: 0, False: 18.5M]
  ------------------
 2411|      0|        return(0);
 2412|       |
 2413|  18.5M|    ret = xmlBufAdd(out->buffer, (const xmlChar *) data, len);
 2414|  18.5M|    if (ret != 0) {
  ------------------
  |  Branch (2414:9): [True: 21, False: 18.5M]
  ------------------
 2415|     21|        out->error = XML_ERR_NO_MEMORY;
 2416|     21|        return(-1);
 2417|     21|    }
 2418|       |
 2419|       |    /*
 2420|       |     * first handle encoding stuff.
 2421|       |     */
 2422|  18.5M|    if (out->encoder != NULL) {
  ------------------
  |  Branch (2422:9): [True: 0, False: 18.5M]
  ------------------
 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|  18.5M|    } else {
 2450|  18.5M|        if (out->writecallback)
  ------------------
  |  Branch (2450:13): [True: 0, False: 18.5M]
  ------------------
 2451|      0|            buf = out->buffer;
 2452|  18.5M|        else
 2453|  18.5M|            written = len;
 2454|  18.5M|    }
 2455|       |
 2456|  18.5M|    if ((buf != NULL) && (out->writecallback)) {
  ------------------
  |  Branch (2456:9): [True: 0, False: 18.5M]
  |  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|  18.5M|    return(written <= INT_MAX ? written : INT_MAX);
  ------------------
  |  Branch (2491:12): [True: 18.5M, False: 0]
  ------------------
 2492|  18.5M|}
xmlOutputBufferWriteString:
 2580|  4.90M|xmlOutputBufferWriteString(xmlOutputBuffer *out, const char *str) {
 2581|  4.90M|    int len;
 2582|       |
 2583|  4.90M|    if ((out == NULL) || (out->error)) return(-1);
  ------------------
  |  Branch (2583:9): [True: 0, False: 4.90M]
  |  Branch (2583:26): [True: 3.11k, False: 4.89M]
  ------------------
 2584|  4.89M|    if (str == NULL)
  ------------------
  |  Branch (2584:9): [True: 0, False: 4.89M]
  ------------------
 2585|      0|        return(-1);
 2586|  4.89M|    len = strlen(str);
 2587|       |
 2588|  4.89M|    if (len > 0)
  ------------------
  |  Branch (2588:9): [True: 4.89M, False: 664]
  ------------------
 2589|  4.89M|	return(xmlOutputBufferWrite(out, len, str));
 2590|    664|    return(len);
 2591|  4.89M|}
xmlOutputBufferWriteQuotedString:
 2609|  5.48k|                                 const xmlChar *string) {
 2610|  5.48k|    const xmlChar *cur, *base;
 2611|       |
 2612|  5.48k|    if ((buf == NULL) || (buf->error))
  ------------------
  |  Branch (2612:9): [True: 0, False: 5.48k]
  |  Branch (2612:26): [True: 0, False: 5.48k]
  ------------------
 2613|      0|        return;
 2614|       |
 2615|  5.48k|    if (xmlStrchr(string, '\"')) {
  ------------------
  |  Branch (2615:9): [True: 68, False: 5.41k]
  ------------------
 2616|     68|        if (xmlStrchr(string, '\'')) {
  ------------------
  |  Branch (2616:13): [True: 0, False: 68]
  ------------------
 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|     68|        else{
 2637|     68|	    xmlOutputBufferWrite(buf, 1, "'");
 2638|     68|            xmlOutputBufferWriteString(buf, (const char *) string);
 2639|     68|	    xmlOutputBufferWrite(buf, 1, "'");
 2640|     68|        }
 2641|  5.41k|    } else {
 2642|  5.41k|        xmlOutputBufferWrite(buf, 1, "\"");
 2643|  5.41k|        xmlOutputBufferWriteString(buf, (const char *) string);
 2644|  5.41k|        xmlOutputBufferWrite(buf, 1, "\"");
 2645|  5.41k|    }
 2646|  5.48k|}
xmlParserGetDirectory:
 2720|   146k|xmlParserGetDirectory(const char *filename) {
 2721|   146k|    char *ret = NULL;
 2722|   146k|    char dir[1024];
 2723|   146k|    char *cur;
 2724|       |
 2725|   146k|    if (filename == NULL) return(NULL);
  ------------------
  |  Branch (2725:9): [True: 0, False: 146k]
  ------------------
 2726|       |
 2727|       |#if defined(LIBXML_WINPATH_ENABLED)
 2728|       |#   define IS_XMLPGD_SEP(ch) ((ch=='/')||(ch=='\\'))
 2729|       |#else
 2730|   146k|#   define IS_XMLPGD_SEP(ch) (ch=='/')
 2731|   146k|#endif
 2732|       |
 2733|   146k|    strncpy(dir, filename, 1023);
 2734|   146k|    dir[1023] = 0;
 2735|   146k|    cur = &dir[strlen(dir)];
 2736|  1.04M|    while (cur > dir) {
  ------------------
  |  Branch (2736:12): [True: 910k, False: 138k]
  ------------------
 2737|   910k|         if (IS_XMLPGD_SEP(*cur)) break;
  ------------------
  |  | 2730|   910k|#   define IS_XMLPGD_SEP(ch) (ch=='/')
  |  |  ------------------
  |  |  |  Branch (2730:30): [True: 8.08k, False: 902k]
  |  |  ------------------
  ------------------
 2738|   902k|	 cur --;
 2739|   902k|    }
 2740|   146k|    if (IS_XMLPGD_SEP(*cur)) {
  ------------------
  |  | 2730|   146k|#   define IS_XMLPGD_SEP(ch) (ch=='/')
  |  |  ------------------
  |  |  |  Branch (2730:30): [True: 8.18k, False: 138k]
  |  |  ------------------
  ------------------
 2741|  8.18k|        if (cur == dir) dir[1] = 0;
  ------------------
  |  Branch (2741:13): [True: 101, False: 8.08k]
  ------------------
 2742|  8.08k|	else *cur = 0;
 2743|  8.18k|	ret = xmlMemStrdup(dir);
 2744|   138k|    } else {
 2745|   138k|        ret = xmlMemStrdup(".");
 2746|   138k|    }
 2747|   146k|    return(ret);
 2748|   146k|#undef IS_XMLPGD_SEP
 2749|   146k|}
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:
  368|      2|xmlInitMemoryInternal(void) {
  369|      2|    xmlInitMutex(&xmlMemMutex);
  370|      2|}
xmlMemSetup:
  415|      2|            xmlReallocFunc reallocFunc, xmlStrdupFunc strdupFunc) {
  416|      2|    if (freeFunc == NULL)
  ------------------
  |  Branch (416:9): [True: 0, False: 2]
  ------------------
  417|      0|	return(-1);
  418|      2|    if (mallocFunc == NULL)
  ------------------
  |  Branch (418:9): [True: 0, False: 2]
  ------------------
  419|      0|	return(-1);
  420|      2|    if (reallocFunc == NULL)
  ------------------
  |  Branch (420:9): [True: 0, False: 2]
  ------------------
  421|      0|	return(-1);
  422|      2|    if (strdupFunc == NULL)
  ------------------
  |  Branch (422:9): [True: 0, False: 2]
  ------------------
  423|      0|	return(-1);
  424|      2|    xmlFree = freeFunc;
  425|      2|    xmlMalloc = mallocFunc;
  426|      2|    xmlMallocAtomic = mallocFunc;
  427|      2|    xmlRealloc = reallocFunc;
  428|      2|    xmlMemStrdup = strdupFunc;
  429|      2|    return(0);
  430|      2|}

xmlTextReaderRead:
 1200|  9.28M|xmlTextReaderRead(xmlTextReader *reader) {
 1201|  9.28M|    int val, olddepth = 0;
 1202|  9.28M|    xmlTextReaderState oldstate = XML_TEXTREADER_START;
 1203|  9.28M|    xmlNodePtr oldnode = NULL;
 1204|       |
 1205|  9.28M|    if (reader == NULL)
  ------------------
  |  Branch (1205:9): [True: 0, False: 9.28M]
  ------------------
 1206|      0|	return(-1);
 1207|  9.28M|    if (reader->state == XML_TEXTREADER_ERROR)
  ------------------
  |  Branch (1207:9): [True: 157k, False: 9.12M]
  ------------------
 1208|   157k|        return(-1);
 1209|       |
 1210|  9.12M|    reader->curnode = NULL;
 1211|  9.12M|    if (reader->doc != NULL)
  ------------------
  |  Branch (1211:9): [True: 0, False: 9.12M]
  ------------------
 1212|      0|        return(xmlTextReaderReadTree(reader));
 1213|  9.12M|    if (reader->ctxt == NULL)
  ------------------
  |  Branch (1213:9): [True: 0, False: 9.12M]
  ------------------
 1214|      0|	return(-1);
 1215|       |
 1216|  9.12M|    if (reader->mode == XML_TEXTREADER_MODE_INITIAL) {
  ------------------
  |  Branch (1216:9): [True: 35.8k, False: 9.08M]
  ------------------
 1217|  35.8k|	reader->mode = XML_TEXTREADER_MODE_INTERACTIVE;
 1218|       |	/*
 1219|       |	 * Initial state
 1220|       |	 */
 1221|  50.7k|	do {
 1222|  50.7k|	    val = xmlTextReaderPushData(reader);
 1223|  50.7k|            if (val < 0) {
  ------------------
  |  Branch (1223:17): [True: 17.0k, False: 33.7k]
  ------------------
 1224|  17.0k|                reader->mode = XML_TEXTREADER_MODE_ERROR;
 1225|  17.0k|                reader->state = XML_TEXTREADER_ERROR;
 1226|  17.0k|                return(-1);
 1227|  17.0k|            }
 1228|  50.7k|	} while ((reader->ctxt->node == NULL) &&
  ------------------
  |  Branch (1228:11): [True: 19.0k, False: 14.6k]
  ------------------
 1229|  19.0k|		 ((reader->mode != XML_TEXTREADER_MODE_EOF) &&
  ------------------
  |  Branch (1229:5): [True: 14.9k, False: 4.17k]
  ------------------
 1230|  14.9k|		  (reader->state != XML_TEXTREADER_DONE)));
  ------------------
  |  Branch (1230:5): [True: 14.9k, False: 0]
  ------------------
 1231|  18.8k|	if (reader->ctxt->node == NULL) {
  ------------------
  |  Branch (1231:6): [True: 4.17k, False: 14.6k]
  ------------------
 1232|  4.17k|	    if (reader->ctxt->myDoc != NULL) {
  ------------------
  |  Branch (1232:10): [True: 4.17k, False: 0]
  ------------------
 1233|  4.17k|		reader->node = reader->ctxt->myDoc->children;
 1234|  4.17k|	    }
 1235|  4.17k|	    if (reader->node == NULL) {
  ------------------
  |  Branch (1235:10): [True: 0, False: 4.17k]
  ------------------
 1236|      0|                reader->mode = XML_TEXTREADER_MODE_ERROR;
 1237|      0|                reader->state = XML_TEXTREADER_ERROR;
 1238|      0|		return(-1);
 1239|      0|	    }
 1240|  4.17k|	    reader->state = XML_TEXTREADER_ELEMENT;
 1241|  14.6k|	} else {
 1242|  14.6k|	    if (reader->ctxt->myDoc != NULL) {
  ------------------
  |  Branch (1242:10): [True: 14.6k, False: 0]
  ------------------
 1243|  14.6k|		reader->node = reader->ctxt->myDoc->children;
 1244|  14.6k|	    }
 1245|  14.6k|	    if (reader->node == NULL)
  ------------------
  |  Branch (1245:10): [True: 0, False: 14.6k]
  ------------------
 1246|      0|		reader->node = reader->ctxt->nodeTab[0];
 1247|  14.6k|	    reader->state = XML_TEXTREADER_ELEMENT;
 1248|  14.6k|	}
 1249|  18.8k|	reader->depth = 0;
 1250|  18.8k|	reader->ctxt->parseMode = XML_PARSE_READER;
 1251|  18.8k|	goto node_found;
 1252|  18.8k|    }
 1253|  9.08M|    oldstate = reader->state;
 1254|  9.08M|    olddepth = reader->ctxt->nodeNr;
 1255|  9.08M|    oldnode = reader->node;
 1256|       |
 1257|  9.99M|get_next_node:
 1258|  9.99M|    if (reader->node == NULL) {
  ------------------
  |  Branch (1258:9): [True: 7.56k, False: 9.98M]
  ------------------
 1259|  7.56k|	if (reader->mode == XML_TEXTREADER_MODE_EOF) {
  ------------------
  |  Branch (1259:6): [True: 7.47k, False: 91]
  ------------------
 1260|  7.47k|	    return(0);
 1261|  7.47k|        } else {
 1262|     91|            reader->mode = XML_TEXTREADER_MODE_ERROR;
 1263|     91|            reader->state = XML_TEXTREADER_ERROR;
 1264|     91|	    return(-1);
 1265|     91|        }
 1266|  7.56k|    }
 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|  9.99M|    while ((reader->node != NULL) && (reader->node->next == NULL) &&
  ------------------
  |  Branch (1273:12): [True: 9.99M, False: 0]
  |  Branch (1273:38): [True: 3.81M, False: 6.17M]
  ------------------
 1274|  3.81M|	   (reader->ctxt->nodeNr == olddepth) &&
  ------------------
  |  Branch (1274:5): [True: 3.81M, False: 1.25k]
  ------------------
 1275|  3.81M|           ((oldstate == XML_TEXTREADER_BACKTRACK) ||
  ------------------
  |  Branch (1275:13): [True: 940k, False: 2.87M]
  ------------------
 1276|  2.87M|            (reader->node->children == NULL) ||
  ------------------
  |  Branch (1276:13): [True: 1.02M, False: 1.85M]
  ------------------
 1277|  1.85M|	    (reader->node->type == XML_ENTITY_REF_NODE) ||
  ------------------
  |  Branch (1277:6): [True: 471, False: 1.85M]
  ------------------
 1278|  1.85M|	    ((reader->node->children != NULL) &&
  ------------------
  |  Branch (1278:7): [True: 1.85M, False: 0]
  ------------------
 1279|  1.85M|	     (reader->node->children->type == XML_TEXT_NODE) &&
  ------------------
  |  Branch (1279:7): [True: 152k, False: 1.70M]
  ------------------
 1280|   152k|	     (reader->node->children->next == NULL)) ||
  ------------------
  |  Branch (1280:7): [True: 136k, False: 16.3k]
  ------------------
 1281|  1.71M|	    (reader->node->type == XML_DTD_NODE) ||
  ------------------
  |  Branch (1281:6): [True: 0, False: 1.71M]
  ------------------
 1282|  1.71M|	    (reader->node->type == XML_DOCUMENT_NODE) ||
  ------------------
  |  Branch (1282:6): [True: 0, False: 1.71M]
  ------------------
 1283|  1.71M|	    (reader->node->type == XML_HTML_DOCUMENT_NODE)) &&
  ------------------
  |  Branch (1283:6): [True: 0, False: 1.71M]
  ------------------
 1284|  2.09M|	   ((reader->ctxt->node == NULL) ||
  ------------------
  |  Branch (1284:6): [True: 5.70k, False: 2.09M]
  ------------------
 1285|  2.09M|	    (reader->ctxt->node == reader->node) ||
  ------------------
  |  Branch (1285:6): [True: 7.95k, False: 2.08M]
  ------------------
 1286|  2.08M|	    (reader->ctxt->node == reader->node->parent)) &&
  ------------------
  |  Branch (1286:6): [True: 2.35k, False: 2.08M]
  ------------------
 1287|  16.0k|	   (reader->ctxt->instate != XML_PARSER_EOF) &&
  ------------------
  |  Branch (1287:5): [True: 8.58k, False: 7.42k]
  ------------------
 1288|  8.58k|	   (PARSER_STOPPED(reader->ctxt) == 0)) {
  ------------------
  |  |   44|  8.58k|#define PARSER_STOPPED(ctxt) ((ctxt)->disableSAX > 1)
  ------------------
  |  Branch (1288:5): [True: 8.58k, False: 0]
  ------------------
 1289|  8.58k|	val = xmlTextReaderPushData(reader);
 1290|  8.58k|	if (val < 0) {
  ------------------
  |  Branch (1290:6): [True: 4.28k, False: 4.30k]
  ------------------
 1291|  4.28k|            reader->mode = XML_TEXTREADER_MODE_ERROR;
 1292|  4.28k|            reader->state = XML_TEXTREADER_ERROR;
 1293|  4.28k|	    return(-1);
 1294|  4.28k|        }
 1295|  4.30k|	if (reader->node == NULL)
  ------------------
  |  Branch (1295:6): [True: 0, False: 4.30k]
  ------------------
 1296|      0|	    goto node_end;
 1297|  4.30k|    }
 1298|  9.98M|    if (oldstate != XML_TEXTREADER_BACKTRACK) {
  ------------------
  |  Branch (1298:9): [True: 7.24M, False: 2.74M]
  ------------------
 1299|  7.24M|	if ((reader->node->children != NULL) &&
  ------------------
  |  Branch (1299:6): [True: 3.78M, False: 3.45M]
  ------------------
 1300|  3.78M|	    (reader->node->type != XML_ENTITY_REF_NODE) &&
  ------------------
  |  Branch (1300:6): [True: 3.78M, False: 1.89k]
  ------------------
 1301|  3.78M|	    (reader->node->type != XML_XINCLUDE_START) &&
  ------------------
  |  Branch (1301:6): [True: 3.78M, False: 0]
  ------------------
 1302|  3.78M|	    (reader->node->type != XML_DTD_NODE)) {
  ------------------
  |  Branch (1302:6): [True: 3.78M, False: 2.92k]
  ------------------
 1303|  3.78M|	    reader->node = reader->node->children;
 1304|  3.78M|	    reader->depth++;
 1305|  3.78M|	    reader->state = XML_TEXTREADER_ELEMENT;
 1306|  3.78M|	    goto node_found;
 1307|  3.78M|	}
 1308|  7.24M|    }
 1309|  6.20M|    if (reader->node->next != NULL) {
  ------------------
  |  Branch (1309:9): [True: 4.24M, False: 1.95M]
  ------------------
 1310|  4.24M|	if ((oldstate == XML_TEXTREADER_ELEMENT) &&
  ------------------
  |  Branch (1310:6): [True: 1.91M, False: 2.33M]
  ------------------
 1311|  1.91M|            (reader->node->type == XML_ELEMENT_NODE) &&
  ------------------
  |  Branch (1311:13): [True: 754k, False: 1.16M]
  ------------------
 1312|   754k|	    (reader->node->children == NULL) &&
  ------------------
  |  Branch (1312:6): [True: 754k, False: 0]
  ------------------
 1313|   754k|	    ((reader->node->extra & NODE_IS_EMPTY) == 0)
  ------------------
  |  |  169|   754k|#define NODE_IS_EMPTY		0x1
  ------------------
  |  Branch (1313:6): [True: 667k, False: 87.0k]
  ------------------
 1314|   667k|#ifdef LIBXML_XINCLUDE_ENABLED
 1315|   667k|	    && (reader->in_xinclude <= 0)
  ------------------
  |  Branch (1315:9): [True: 530k, False: 137k]
  ------------------
 1316|  4.24M|#endif
 1317|  4.24M|	    ) {
 1318|   530k|	    reader->state = XML_TEXTREADER_END;
 1319|   530k|	    goto node_found;
 1320|   530k|	}
 1321|  3.71M|#ifdef LIBXML_REGEXP_ENABLED
 1322|  3.71M|	if ((reader->validate) &&
  ------------------
  |  Branch (1322:6): [True: 3.41M, False: 298k]
  ------------------
 1323|  3.41M|	    (reader->node->type == XML_ELEMENT_NODE))
  ------------------
  |  Branch (1323:6): [True: 1.53M, False: 1.88M]
  ------------------
 1324|  1.53M|	    if (xmlTextReaderValidatePop(reader) < 0)
  ------------------
  |  Branch (1324:10): [True: 1, False: 1.53M]
  ------------------
 1325|      1|                return(-1);
 1326|  3.71M|#endif /* LIBXML_REGEXP_ENABLED */
 1327|  3.71M|        if ((reader->preserves > 0) &&
  ------------------
  |  Branch (1327:13): [True: 1.46M, False: 2.25M]
  ------------------
 1328|  1.46M|	    (reader->node->extra & NODE_IS_SPRESERVED))
  ------------------
  |  |  171|  1.46M|#define NODE_IS_SPRESERVED	0x4
  ------------------
  |  Branch (1328:6): [True: 614, False: 1.46M]
  ------------------
 1329|    614|	    reader->preserves--;
 1330|  3.71M|	reader->node = reader->node->next;
 1331|  3.71M|	reader->state = XML_TEXTREADER_ELEMENT;
 1332|       |
 1333|       |	/*
 1334|       |	 * Cleanup of the old node
 1335|       |	 */
 1336|  3.71M|	if ((reader->preserves == 0) &&
  ------------------
  |  Branch (1336:6): [True: 2.25M, False: 1.46M]
  ------------------
 1337|  2.25M|#ifdef LIBXML_XINCLUDE_ENABLED
 1338|  2.25M|	    (reader->in_xinclude == 0) &&
  ------------------
  |  Branch (1338:6): [True: 144k, False: 2.11M]
  ------------------
 1339|   144k|#endif
 1340|   144k|	    (reader->entNr == 0) &&
  ------------------
  |  Branch (1340:6): [True: 144k, False: 0]
  ------------------
 1341|   144k|	    (reader->node->prev != NULL) &&
  ------------------
  |  Branch (1341:6): [True: 144k, False: 0]
  ------------------
 1342|   144k|            (reader->node->prev->type != XML_DTD_NODE)) {
  ------------------
  |  Branch (1342:13): [True: 139k, False: 5.40k]
  ------------------
 1343|   139k|	    xmlNodePtr tmp = reader->node->prev;
 1344|   139k|	    if ((tmp->extra & NODE_IS_PRESERVED) == 0) {
  ------------------
  |  |  170|   139k|#define NODE_IS_PRESERVED	0x2
  ------------------
  |  Branch (1344:10): [True: 138k, False: 497]
  ------------------
 1345|   138k|                if (oldnode == tmp)
  ------------------
  |  Branch (1345:21): [True: 137k, False: 1.65k]
  ------------------
 1346|   137k|                    oldnode = NULL;
 1347|   138k|		xmlUnlinkNode(tmp);
 1348|   138k|		xmlTextReaderFreeNode(reader, tmp);
 1349|   138k|	    }
 1350|   139k|	}
 1351|       |
 1352|  3.71M|	goto node_found;
 1353|  3.71M|    }
 1354|  1.95M|    if ((oldstate == XML_TEXTREADER_ELEMENT) &&
  ------------------
  |  Branch (1354:9): [True: 905k, False: 1.04M]
  ------------------
 1355|   905k|	(reader->node->type == XML_ELEMENT_NODE) &&
  ------------------
  |  Branch (1355:2): [True: 110k, False: 795k]
  ------------------
 1356|   110k|	(reader->node->children == NULL) &&
  ------------------
  |  Branch (1356:2): [True: 110k, False: 0]
  ------------------
 1357|   110k|	((reader->node->extra & NODE_IS_EMPTY) == 0)) {;
  ------------------
  |  |  169|   110k|#define NODE_IS_EMPTY		0x1
  ------------------
  |  Branch (1357:2): [True: 108k, False: 1.44k]
  ------------------
 1358|   108k|	reader->state = XML_TEXTREADER_END;
 1359|   108k|	goto node_found;
 1360|   108k|    }
 1361|  1.84M|#ifdef LIBXML_REGEXP_ENABLED
 1362|  1.84M|    if ((reader->validate != XML_TEXTREADER_NOT_VALIDATE) &&
  ------------------
  |  Branch (1362:9): [True: 1.73M, False: 115k]
  ------------------
 1363|  1.73M|        (reader->node->type == XML_ELEMENT_NODE)) {
  ------------------
  |  Branch (1363:9): [True: 938k, False: 792k]
  ------------------
 1364|   938k|        if (xmlTextReaderValidatePop(reader) < 0)
  ------------------
  |  Branch (1364:13): [True: 1, False: 938k]
  ------------------
 1365|      1|            return(-1);
 1366|   938k|    }
 1367|  1.84M|#endif /* LIBXML_REGEXP_ENABLED */
 1368|  1.84M|    if ((reader->preserves > 0) &&
  ------------------
  |  Branch (1368:9): [True: 378k, False: 1.46M]
  ------------------
 1369|   378k|	(reader->node->extra & NODE_IS_SPRESERVED))
  ------------------
  |  |  171|   378k|#define NODE_IS_SPRESERVED	0x4
  ------------------
  |  Branch (1369:2): [True: 188, False: 378k]
  ------------------
 1370|    188|	reader->preserves--;
 1371|  1.84M|    reader->node = reader->node->parent;
 1372|  1.84M|    if ((reader->node == NULL) ||
  ------------------
  |  Branch (1372:9): [True: 0, False: 1.84M]
  ------------------
 1373|  1.84M|	(reader->node->type == XML_DOCUMENT_NODE) ||
  ------------------
  |  Branch (1373:2): [True: 2.02k, False: 1.84M]
  ------------------
 1374|  1.84M|	(reader->node->type == XML_HTML_DOCUMENT_NODE)) {
  ------------------
  |  Branch (1374:2): [True: 0, False: 1.84M]
  ------------------
 1375|  2.02k|	if (reader->mode != XML_TEXTREADER_MODE_EOF) {
  ------------------
  |  Branch (1375:6): [True: 709, False: 1.31k]
  ------------------
 1376|    709|	    val = xmlParseChunk(reader->ctxt, "", 0, 1);
 1377|    709|	    reader->state = XML_TEXTREADER_DONE;
 1378|    709|	    if (val != 0) {
  ------------------
  |  Branch (1378:10): [True: 704, False: 5]
  ------------------
 1379|    704|                reader->mode = XML_TEXTREADER_MODE_ERROR;
 1380|    704|                reader->state = XML_TEXTREADER_ERROR;
 1381|    704|	        return(-1);
 1382|    704|            }
 1383|    709|	}
 1384|  1.32k|	reader->node = NULL;
 1385|  1.32k|	reader->depth = -1;
 1386|       |
 1387|       |	/*
 1388|       |	 * Cleanup of the old node
 1389|       |	 */
 1390|  1.32k|	if ((oldnode != NULL) && (reader->preserves == 0) &&
  ------------------
  |  Branch (1390:6): [True: 1.25k, False: 68]
  |  Branch (1390:27): [True: 1.24k, False: 11]
  ------------------
 1391|  1.24k|#ifdef LIBXML_XINCLUDE_ENABLED
 1392|  1.24k|	    (reader->in_xinclude == 0) &&
  ------------------
  |  Branch (1392:6): [True: 1.12k, False: 118]
  ------------------
 1393|  1.12k|#endif
 1394|  1.12k|	    (reader->entNr == 0) &&
  ------------------
  |  Branch (1394:6): [True: 1.12k, False: 0]
  ------------------
 1395|  1.12k|	    (oldnode->type != XML_DTD_NODE) &&
  ------------------
  |  Branch (1395:6): [True: 1.12k, False: 0]
  ------------------
 1396|  1.12k|	    ((oldnode->extra & NODE_IS_PRESERVED) == 0)) {
  ------------------
  |  |  170|  1.12k|#define NODE_IS_PRESERVED	0x2
  ------------------
  |  Branch (1396:6): [True: 1.09k, False: 35]
  ------------------
 1397|  1.09k|	    xmlUnlinkNode(oldnode);
 1398|  1.09k|	    xmlTextReaderFreeNode(reader, oldnode);
 1399|  1.09k|	}
 1400|       |
 1401|  1.32k|	goto node_end;
 1402|  2.02k|    }
 1403|  1.84M|    if ((reader->preserves == 0) &&
  ------------------
  |  Branch (1403:9): [True: 1.46M, False: 378k]
  ------------------
 1404|  1.46M|#ifdef LIBXML_XINCLUDE_ENABLED
 1405|  1.46M|        (reader->in_xinclude == 0) &&
  ------------------
  |  Branch (1405:9): [True: 17.9k, False: 1.44M]
  ------------------
 1406|  17.9k|#endif
 1407|  17.9k|	(reader->entNr == 0) &&
  ------------------
  |  Branch (1407:2): [True: 17.9k, False: 0]
  ------------------
 1408|  17.9k|        (reader->node->last != NULL) &&
  ------------------
  |  Branch (1408:9): [True: 17.9k, False: 0]
  ------------------
 1409|  17.9k|        ((reader->node->last->extra & NODE_IS_PRESERVED) == 0)) {
  ------------------
  |  |  170|  17.9k|#define NODE_IS_PRESERVED	0x2
  ------------------
  |  Branch (1409:9): [True: 17.7k, False: 158]
  ------------------
 1410|  17.7k|	xmlNodePtr tmp = reader->node->last;
 1411|  17.7k|	xmlUnlinkNode(tmp);
 1412|  17.7k|	xmlTextReaderFreeNode(reader, tmp);
 1413|  17.7k|    }
 1414|  1.84M|    reader->depth--;
 1415|  1.84M|    reader->state = XML_TEXTREADER_BACKTRACK;
 1416|       |
 1417|  10.0M|node_found:
 1418|       |    /*
 1419|       |     * If we are in the middle of a piece of CDATA make sure it's finished
 1420|       |     */
 1421|  10.0M|    if ((reader->node != NULL) &&
  ------------------
  |  Branch (1421:9): [True: 10.0M, False: 0]
  ------------------
 1422|  10.0M|        (reader->node->next == NULL) &&
  ------------------
  |  Branch (1422:9): [True: 3.82M, False: 6.17M]
  ------------------
 1423|  3.82M|        ((reader->node->type == XML_TEXT_NODE) ||
  ------------------
  |  Branch (1423:10): [True: 797k, False: 3.02M]
  ------------------
 1424|  3.02M|	 (reader->node->type == XML_CDATA_SECTION_NODE))) {
  ------------------
  |  Branch (1424:3): [True: 477, False: 3.02M]
  ------------------
 1425|   797k|            if (xmlTextReaderExpand(reader) == NULL)
  ------------------
  |  Branch (1425:17): [True: 2.34k, False: 795k]
  ------------------
 1426|  2.34k|	        return -1;
 1427|   797k|    }
 1428|       |
 1429|  9.99M|#ifdef LIBXML_XINCLUDE_ENABLED
 1430|       |    /*
 1431|       |     * Handle XInclude if asked for
 1432|       |     */
 1433|  9.99M|    if ((reader->xinclude) && (reader->in_xinclude == 0) &&
  ------------------
  |  Branch (1433:9): [True: 9.91M, False: 89.6k]
  |  Branch (1433:31): [True: 2.91M, False: 6.99M]
  ------------------
 1434|  2.91M|        (reader->state != XML_TEXTREADER_BACKTRACK) &&
  ------------------
  |  Branch (1434:9): [True: 2.89M, False: 13.0k]
  ------------------
 1435|  2.89M|        (reader->node != NULL) &&
  ------------------
  |  Branch (1435:9): [True: 2.89M, False: 0]
  ------------------
 1436|  2.89M|	(reader->node->type == XML_ELEMENT_NODE) &&
  ------------------
  |  Branch (1436:2): [True: 2.85M, False: 41.5k]
  ------------------
 1437|  2.85M|	(reader->node->ns != NULL) &&
  ------------------
  |  Branch (1437:2): [True: 43.7k, False: 2.81M]
  ------------------
 1438|  43.7k|	((xmlStrEqual(reader->node->ns->href, XINCLUDE_NS)) ||
  ------------------
  |  |   30|  43.7k|#define XINCLUDE_NS (const xmlChar *) "http://www.w3.org/2003/XInclude"
  ------------------
  |  Branch (1438:3): [True: 5.59k, False: 38.1k]
  ------------------
 1439|  38.1k|	 (xmlStrEqual(reader->node->ns->href, XINCLUDE_OLD_NS)))) {
  ------------------
  |  |   34|  38.1k|#define XINCLUDE_OLD_NS (const xmlChar *) "http://www.w3.org/2001/XInclude"
  ------------------
  |  Branch (1439:3): [True: 8.26k, False: 29.8k]
  ------------------
 1440|  13.8k|	if (reader->xincctxt == NULL) {
  ------------------
  |  Branch (1440:6): [True: 7.90k, False: 5.95k]
  ------------------
 1441|  7.90k|	    reader->xincctxt = xmlXIncludeNewContext(reader->ctxt->myDoc);
 1442|  7.90k|            if (reader->xincctxt == NULL) {
  ------------------
  |  Branch (1442:17): [True: 1, False: 7.90k]
  ------------------
 1443|      1|                xmlTextReaderErrMemory(reader);
 1444|      1|                return(-1);
 1445|      1|            }
 1446|  7.90k|	    xmlXIncludeSetFlags(reader->xincctxt,
 1447|  7.90k|	                        reader->parserFlags & (~XML_PARSE_NOXINCNODE));
 1448|  7.90k|            xmlXIncludeSetStreamingMode(reader->xincctxt, 1);
 1449|  7.90k|            if ((reader->errorFunc != NULL) || (reader->sErrorFunc != NULL))
  ------------------
  |  Branch (1449:17): [True: 0, False: 7.90k]
  |  Branch (1449:48): [True: 7.90k, False: 0]
  ------------------
 1450|  7.90k|                xmlXIncludeSetErrorHandler(reader->xincctxt,
 1451|  7.90k|                        xmlTextReaderStructuredRelay, reader);
 1452|  7.90k|            if (reader->resourceLoader != NULL)
  ------------------
  |  Branch (1452:17): [True: 7.90k, False: 0]
  ------------------
 1453|  7.90k|                xmlXIncludeSetResourceLoader(reader->xincctxt,
 1454|  7.90k|                        reader->resourceLoader, reader->resourceCtxt);
 1455|  7.90k|	}
 1456|       |	/*
 1457|       |	 * expand that node and process it
 1458|       |	 */
 1459|  13.8k|	if (xmlTextReaderExpand(reader) == NULL)
  ------------------
  |  Branch (1459:6): [True: 14, False: 13.8k]
  ------------------
 1460|     14|	    return(-1);
 1461|  13.8k|        if (xmlXIncludeProcessNode(reader->xincctxt, reader->node) < 0) {
  ------------------
  |  Branch (1461:13): [True: 11.6k, False: 2.15k]
  ------------------
 1462|  11.6k|            int err = xmlXIncludeGetLastError(reader->xincctxt);
 1463|       |
 1464|  11.6k|            if (xmlIsCatastrophicError(XML_ERR_FATAL, err)) {
  ------------------
  |  Branch (1464:17): [True: 3.00k, False: 8.68k]
  ------------------
 1465|  3.00k|                xmlFatalErr(reader->ctxt, err, NULL);
 1466|  3.00k|                reader->mode = XML_TEXTREADER_MODE_ERROR;
 1467|  3.00k|                reader->state = XML_TEXTREADER_ERROR;
 1468|  3.00k|            }
 1469|  11.6k|            return(-1);
 1470|  11.6k|        }
 1471|  13.8k|    }
 1472|  9.98M|    if ((reader->node != NULL) && (reader->node->type == XML_XINCLUDE_START)) {
  ------------------
  |  Branch (1472:9): [True: 9.98M, False: 0]
  |  Branch (1472:35): [True: 6.77k, False: 9.98M]
  ------------------
 1473|  6.77k|        reader->in_xinclude++;
 1474|  6.77k|	goto get_next_node;
 1475|  6.77k|    }
 1476|  9.98M|    if ((reader->node != NULL) && (reader->node->type == XML_XINCLUDE_END)) {
  ------------------
  |  Branch (1476:9): [True: 9.98M, False: 0]
  |  Branch (1476:35): [True: 900k, False: 9.08M]
  ------------------
 1477|   900k|        reader->in_xinclude--;
 1478|   900k|	goto get_next_node;
 1479|   900k|    }
 1480|  9.08M|#endif
 1481|       |    /*
 1482|       |     * Handle entities enter and exit when in entity replacement mode
 1483|       |     */
 1484|  9.08M|    if ((reader->node != NULL) &&
  ------------------
  |  Branch (1484:9): [True: 9.08M, False: 0]
  ------------------
 1485|  9.08M|	(reader->node->type == XML_ENTITY_REF_NODE) &&
  ------------------
  |  Branch (1485:2): [True: 2.32k, False: 9.07M]
  ------------------
 1486|  2.32k|	(reader->ctxt != NULL) && (reader->ctxt->replaceEntities == 1)) {
  ------------------
  |  Branch (1486:2): [True: 2.32k, False: 0]
  |  Branch (1486:28): [True: 0, False: 2.32k]
  ------------------
 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|  9.08M|    } else if ((reader->node != NULL) &&
  ------------------
  |  Branch (1495:16): [True: 9.08M, False: 0]
  ------------------
 1496|  9.08M|	       (reader->node->type == XML_ENTITY_REF_NODE) &&
  ------------------
  |  Branch (1496:9): [True: 2.32k, False: 9.07M]
  ------------------
 1497|  2.32k|	       (reader->ctxt != NULL) && (reader->validate)) {
  ------------------
  |  Branch (1497:9): [True: 2.32k, False: 0]
  |  Branch (1497:35): [True: 1.57k, False: 747]
  ------------------
 1498|  1.57k|	if (xmlTextReaderValidateEntity(reader) < 0)
  ------------------
  |  Branch (1498:6): [True: 15, False: 1.56k]
  ------------------
 1499|     15|            return(-1);
 1500|  1.57k|#endif /* LIBXML_REGEXP_ENABLED */
 1501|  1.57k|    }
 1502|  9.08M|    if ((reader->node != NULL) &&
  ------------------
  |  Branch (1502:9): [True: 9.08M, False: 0]
  ------------------
 1503|  9.08M|	(reader->node->type == XML_ENTITY_DECL) &&
  ------------------
  |  Branch (1503:2): [True: 0, False: 9.08M]
  ------------------
 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|  9.08M|#ifdef LIBXML_REGEXP_ENABLED
 1510|  9.08M|    if ((reader->validate != XML_TEXTREADER_NOT_VALIDATE) && (reader->node != NULL)) {
  ------------------
  |  Branch (1510:9): [True: 8.36M, False: 714k]
  |  Branch (1510:62): [True: 8.36M, False: 0]
  ------------------
 1511|  8.36M|	xmlNodePtr node = reader->node;
 1512|       |
 1513|  8.36M|	if ((node->type == XML_ELEMENT_NODE) &&
  ------------------
  |  Branch (1513:6): [True: 6.48M, False: 1.87M]
  ------------------
 1514|  6.48M|            ((reader->state != XML_TEXTREADER_END) &&
  ------------------
  |  Branch (1514:14): [True: 5.95M, False: 535k]
  ------------------
 1515|  5.95M|	     (reader->state != XML_TEXTREADER_BACKTRACK))) {
  ------------------
  |  Branch (1515:7): [True: 4.22M, False: 1.72M]
  ------------------
 1516|  4.22M|	    if (xmlTextReaderValidatePush(reader) < 0)
  ------------------
  |  Branch (1516:10): [True: 1, False: 4.22M]
  ------------------
 1517|      1|                return(-1);
 1518|  4.22M|	} else if ((node->type == XML_TEXT_NODE) ||
  ------------------
  |  Branch (1518:13): [True: 1.66M, False: 2.47M]
  ------------------
 1519|  2.47M|		   (node->type == XML_CDATA_SECTION_NODE)) {
  ------------------
  |  Branch (1519:6): [True: 50.0k, False: 2.42M]
  ------------------
 1520|  1.71M|            xmlTextReaderValidateCData(reader, node->content,
 1521|  1.71M|	                               xmlStrlen(node->content));
 1522|  1.71M|	}
 1523|  8.36M|    }
 1524|  9.08M|#endif /* LIBXML_REGEXP_ENABLED */
 1525|  9.08M|#ifdef LIBXML_PATTERN_ENABLED
 1526|  9.08M|    if ((reader->patternNr > 0) && (reader->state != XML_TEXTREADER_END) &&
  ------------------
  |  Branch (1526:9): [True: 0, False: 9.08M]
  |  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|  9.08M|#endif /* LIBXML_PATTERN_ENABLED */
 1537|  9.08M|#ifdef LIBXML_SCHEMAS_ENABLED
 1538|  9.08M|    if ((reader->validate == XML_TEXTREADER_VALIDATE_XSD) &&
  ------------------
  |  Branch (1538:9): [True: 0, False: 9.08M]
  ------------------
 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|  9.08M|#endif /* LIBXML_PATTERN_ENABLED */
 1544|  9.08M|    return(1);
 1545|  1.32k|node_end:
 1546|  1.32k|    reader->state = XML_TEXTREADER_DONE;
 1547|  1.32k|    return(0);
 1548|  9.08M|}
xmlTextReaderReadState:
 1557|  5.59k|xmlTextReaderReadState(xmlTextReader *reader) {
 1558|  5.59k|    if (reader == NULL)
  ------------------
  |  Branch (1558:9): [True: 0, False: 5.59k]
  ------------------
 1559|      0|	return(-1);
 1560|  5.59k|    return(reader->mode);
 1561|  5.59k|}
xmlTextReaderExpand:
 1572|   862k|xmlTextReaderExpand(xmlTextReader *reader) {
 1573|   862k|    if ((reader == NULL) || (reader->node == NULL))
  ------------------
  |  Branch (1573:9): [True: 0, False: 862k]
  |  Branch (1573:29): [True: 8.50k, False: 854k]
  ------------------
 1574|  8.50k|        return(NULL);
 1575|   854k|    if (reader->doc != NULL)
  ------------------
  |  Branch (1575:9): [True: 0, False: 854k]
  ------------------
 1576|      0|        return(reader->node);
 1577|   854k|    if (reader->ctxt == NULL)
  ------------------
  |  Branch (1577:9): [True: 0, False: 854k]
  ------------------
 1578|      0|        return(NULL);
 1579|   854k|    if (xmlTextReaderDoExpand(reader) < 0)
  ------------------
  |  Branch (1579:9): [True: 11.6k, False: 842k]
  ------------------
 1580|  11.6k|        return(NULL);
 1581|   842k|    return(reader->node);
 1582|   854k|}
xmlTextReaderNext:
 1593|  21.2k|xmlTextReaderNext(xmlTextReader *reader) {
 1594|  21.2k|    int ret;
 1595|  21.2k|    xmlNodePtr cur;
 1596|       |
 1597|  21.2k|    if (reader == NULL)
  ------------------
  |  Branch (1597:9): [True: 0, False: 21.2k]
  ------------------
 1598|      0|	return(-1);
 1599|  21.2k|    if (reader->doc != NULL)
  ------------------
  |  Branch (1599:9): [True: 0, False: 21.2k]
  ------------------
 1600|      0|        return(xmlTextReaderNextTree(reader));
 1601|  21.2k|    cur = reader->node;
 1602|  21.2k|    if ((cur == NULL) || (cur->type != XML_ELEMENT_NODE))
  ------------------
  |  Branch (1602:9): [True: 6.01k, False: 15.2k]
  |  Branch (1602:26): [True: 4.22k, False: 11.0k]
  ------------------
 1603|  10.2k|        return(xmlTextReaderRead(reader));
 1604|  11.0k|    if (reader->state == XML_TEXTREADER_END || reader->state == XML_TEXTREADER_BACKTRACK)
  ------------------
  |  Branch (1604:9): [True: 222, False: 10.8k]
  |  Branch (1604:48): [True: 843, False: 9.99k]
  ------------------
 1605|  1.06k|        return(xmlTextReaderRead(reader));
 1606|  9.99k|    if (cur->extra & NODE_IS_EMPTY)
  ------------------
  |  |  169|  9.99k|#define NODE_IS_EMPTY		0x1
  ------------------
  |  Branch (1606:9): [True: 1.24k, False: 8.75k]
  ------------------
 1607|  1.24k|        return(xmlTextReaderRead(reader));
 1608|  9.02M|    do {
 1609|  9.02M|        ret = xmlTextReaderRead(reader);
 1610|  9.02M|	if (ret != 1)
  ------------------
  |  Branch (1610:6): [True: 8.03k, False: 9.01M]
  ------------------
 1611|  8.03k|	    return(ret);
 1612|  9.02M|    } while (reader->node != cur);
  ------------------
  |  Branch (1612:14): [True: 9.01M, False: 716]
  ------------------
 1613|    716|    return(xmlTextReaderRead(reader));
 1614|  8.75k|}
xmlTextReaderReadInnerXml:
 1658|  13.2k|{
 1659|  13.2k|    xmlOutputBufferPtr output;
 1660|  13.2k|    xmlNodePtr cur;
 1661|  13.2k|    xmlChar *ret;
 1662|       |
 1663|  13.2k|    if (xmlTextReaderExpand(reader) == NULL)
  ------------------
  |  Branch (1663:9): [True: 5.65k, False: 7.57k]
  ------------------
 1664|  5.65k|        return(NULL);
 1665|       |
 1666|  7.57k|    if (reader->node == NULL)
  ------------------
  |  Branch (1666:9): [True: 0, False: 7.57k]
  ------------------
 1667|      0|        return(NULL);
 1668|       |
 1669|  7.57k|    output = xmlAllocOutputBuffer(NULL);
 1670|  7.57k|    if (output == NULL) {
  ------------------
  |  Branch (1670:9): [True: 22, False: 7.54k]
  ------------------
 1671|     22|        xmlTextReaderErrMemory(reader);
 1672|     22|        return(NULL);
 1673|     22|    }
 1674|       |
 1675|  20.6k|    for (cur = reader->node->children; cur != NULL; cur = cur->next)
  ------------------
  |  Branch (1675:40): [True: 13.1k, False: 7.54k]
  ------------------
 1676|  13.1k|        xmlTextReaderDumpCopy(reader, output, cur);
 1677|       |
 1678|  7.54k|    if (output->error)
  ------------------
  |  Branch (1678:9): [True: 2, False: 7.54k]
  ------------------
 1679|      2|        xmlCtxtErrIO(reader->ctxt, output->error, NULL);
 1680|       |
 1681|  7.54k|    ret = xmlBufDetach(output->buffer);
 1682|  7.54k|    xmlOutputBufferClose(output);
 1683|       |
 1684|  7.54k|    return(ret);
 1685|  7.57k|}
xmlTextReaderReadOuterXml:
 1697|  29.7k|{
 1698|  29.7k|    xmlOutputBufferPtr output;
 1699|  29.7k|    xmlNodePtr node;
 1700|  29.7k|    xmlChar *ret;
 1701|       |
 1702|  29.7k|    if (xmlTextReaderExpand(reader) == NULL)
  ------------------
  |  Branch (1702:9): [True: 7.30k, False: 22.4k]
  ------------------
 1703|  7.30k|        return(NULL);
 1704|       |
 1705|  22.4k|    node = reader->node;
 1706|  22.4k|    if (node == NULL)
  ------------------
  |  Branch (1706:9): [True: 0, False: 22.4k]
  ------------------
 1707|      0|        return(NULL);
 1708|       |
 1709|  22.4k|    output = xmlAllocOutputBuffer(NULL);
 1710|  22.4k|    if (output == NULL) {
  ------------------
  |  Branch (1710:9): [True: 55, False: 22.4k]
  ------------------
 1711|     55|        xmlTextReaderErrMemory(reader);
 1712|     55|        return(NULL);
 1713|     55|    }
 1714|       |
 1715|  22.4k|    xmlTextReaderDumpCopy(reader, output, node);
 1716|  22.4k|    if (output->error)
  ------------------
  |  Branch (1716:9): [True: 19, False: 22.3k]
  ------------------
 1717|     19|        xmlCtxtErrIO(reader->ctxt, output->error, NULL);
 1718|       |
 1719|  22.4k|    ret = xmlBufDetach(output->buffer);
 1720|  22.4k|    xmlOutputBufferClose(output);
 1721|       |
 1722|  22.4k|    return(ret);
 1723|  22.4k|}
xmlTextReaderReadString:
 1737|  8.80k|{
 1738|  8.80k|    xmlNodePtr node, cur;
 1739|  8.80k|    xmlBufPtr buf;
 1740|  8.80k|    xmlChar *ret;
 1741|       |
 1742|  8.80k|    if ((reader == NULL) || (reader->node == NULL))
  ------------------
  |  Branch (1742:9): [True: 0, False: 8.80k]
  |  Branch (1742:29): [True: 2.47k, False: 6.33k]
  ------------------
 1743|  2.47k|       return(NULL);
 1744|       |
 1745|  6.33k|    node = (reader->curnode != NULL) ? reader->curnode : reader->node;
  ------------------
  |  Branch (1745:12): [True: 507, False: 5.82k]
  ------------------
 1746|  6.33k|    switch (node->type) {
 1747|  1.02k|        case XML_TEXT_NODE:
  ------------------
  |  Branch (1747:9): [True: 1.02k, False: 5.30k]
  ------------------
 1748|  1.31k|        case XML_CDATA_SECTION_NODE:
  ------------------
  |  Branch (1748:9): [True: 291, False: 6.04k]
  ------------------
 1749|  1.31k|            break;
 1750|  3.82k|        case XML_ELEMENT_NODE:
  ------------------
  |  Branch (1750:9): [True: 3.82k, False: 2.50k]
  ------------------
 1751|  3.82k|            if ((xmlTextReaderDoExpand(reader) == -1) ||
  ------------------
  |  Branch (1751:17): [True: 1.46k, False: 2.36k]
  ------------------
 1752|  2.36k|                (node->children == NULL))
  ------------------
  |  Branch (1752:17): [True: 1.37k, False: 985]
  ------------------
 1753|  2.83k|                return(NULL);
 1754|    985|            break;
 1755|  1.19k|        default:
  ------------------
  |  Branch (1755:9): [True: 1.19k, False: 5.14k]
  ------------------
 1756|  1.19k|            return(NULL);
 1757|  6.33k|    }
 1758|       |
 1759|  2.30k|    buf = xmlBufCreate(50);
 1760|  2.30k|    if (buf == NULL) {
  ------------------
  |  Branch (1760:9): [True: 7, False: 2.29k]
  ------------------
 1761|      7|        xmlTextReaderErrMemory(reader);
 1762|      7|        return(NULL);
 1763|      7|    }
 1764|       |
 1765|  2.29k|    cur = node;
 1766|  1.60M|    while (cur != NULL) {
  ------------------
  |  Branch (1766:12): [True: 1.60M, False: 0]
  ------------------
 1767|  1.60M|        switch (cur->type) {
 1768|   270k|            case XML_TEXT_NODE:
  ------------------
  |  Branch (1768:13): [True: 270k, False: 1.32M]
  ------------------
 1769|   271k|            case XML_CDATA_SECTION_NODE:
  ------------------
  |  Branch (1769:13): [True: 581, False: 1.59M]
  ------------------
 1770|   271k|                xmlBufCat(buf, cur->content);
 1771|   271k|                break;
 1772|       |
 1773|   887k|            case XML_ELEMENT_NODE:
  ------------------
  |  Branch (1773:13): [True: 887k, False: 713k]
  ------------------
 1774|   887k|                if (cur->children != NULL) {
  ------------------
  |  Branch (1774:21): [True: 710k, False: 176k]
  ------------------
 1775|   710k|                    cur = cur->children;
 1776|   710k|                    continue;
 1777|   710k|                }
 1778|   176k|                break;
 1779|       |
 1780|   442k|            default:
  ------------------
  |  Branch (1780:13): [True: 442k, False: 1.15M]
  ------------------
 1781|   442k|                break;
 1782|  1.60M|        }
 1783|       |
 1784|   890k|        if (cur == node)
  ------------------
  |  Branch (1784:13): [True: 1.31k, False: 888k]
  ------------------
 1785|  1.31k|            goto done;
 1786|       |
 1787|  1.59M|        while (cur->next == NULL) {
  ------------------
  |  Branch (1787:16): [True: 710k, False: 888k]
  ------------------
 1788|   710k|            cur = cur->parent;
 1789|   710k|            if (cur == node)
  ------------------
  |  Branch (1789:17): [True: 985, False: 709k]
  ------------------
 1790|    985|                goto done;
 1791|   710k|        }
 1792|   888k|        cur = cur->next;
 1793|   888k|    }
 1794|       |
 1795|  2.29k|done:
 1796|  2.29k|    ret = xmlBufDetach(buf);
 1797|  2.29k|    if (ret == NULL)
  ------------------
  |  Branch (1797:9): [True: 2, False: 2.29k]
  ------------------
 1798|      2|        xmlTextReaderErrMemory(reader);
 1799|       |
 1800|  2.29k|    xmlBufFree(buf);
 1801|  2.29k|    return(ret);
 1802|  2.29k|}
xmlTextReaderNextSibling:
 1951|  7.66k|xmlTextReaderNextSibling(xmlTextReader *reader) {
 1952|  7.66k|    if (reader == NULL)
  ------------------
  |  Branch (1952:9): [True: 0, False: 7.66k]
  ------------------
 1953|      0|        return(-1);
 1954|  7.66k|    if (reader->doc == NULL) {
  ------------------
  |  Branch (1954:9): [True: 7.66k, False: 0]
  ------------------
 1955|       |        /* TODO */
 1956|  7.66k|	return(-1);
 1957|  7.66k|    }
 1958|       |
 1959|      0|    if (reader->state == XML_TEXTREADER_END)
  ------------------
  |  Branch (1959:9): [True: 0, False: 0]
  ------------------
 1960|      0|        return(0);
 1961|       |
 1962|      0|    if (reader->node == NULL)
  ------------------
  |  Branch (1962:9): [True: 0, False: 0]
  ------------------
 1963|      0|        return(xmlTextReaderNextTree(reader));
 1964|       |
 1965|      0|    if (reader->node->next != NULL) {
  ------------------
  |  Branch (1965:9): [True: 0, False: 0]
  ------------------
 1966|      0|        reader->node = reader->node->next;
 1967|      0|        reader->state = XML_TEXTREADER_START;
 1968|      0|        return(1);
 1969|      0|    }
 1970|       |
 1971|      0|    return(0);
 1972|      0|}
xmlNewTextReader:
 1987|  36.4k|xmlNewTextReader(xmlParserInputBuffer *input, const char *URI) {
 1988|  36.4k|    xmlTextReaderPtr ret;
 1989|       |
 1990|  36.4k|    if (input == NULL)
  ------------------
  |  Branch (1990:9): [True: 0, False: 36.4k]
  ------------------
 1991|      0|	return(NULL);
 1992|  36.4k|    ret = xmlMalloc(sizeof(xmlTextReader));
 1993|  36.4k|    if (ret == NULL)
  ------------------
  |  Branch (1993:9): [True: 9, False: 36.4k]
  ------------------
 1994|      9|	return(NULL);
 1995|  36.4k|    memset(ret, 0, sizeof(xmlTextReader));
 1996|  36.4k|    ret->doc = NULL;
 1997|  36.4k|    ret->entTab = NULL;
 1998|  36.4k|    ret->entMax = 0;
 1999|  36.4k|    ret->entNr = 0;
 2000|  36.4k|    ret->input = input;
 2001|  36.4k|    ret->buffer = xmlBufCreate(50);
 2002|  36.4k|    if (ret->buffer == NULL) {
  ------------------
  |  Branch (2002:9): [True: 7, False: 36.4k]
  ------------------
 2003|      7|        xmlFree(ret);
 2004|      7|	return(NULL);
 2005|      7|    }
 2006|  36.4k|    ret->sax = (xmlSAXHandler *) xmlMalloc(sizeof(xmlSAXHandler));
 2007|  36.4k|    if (ret->sax == NULL) {
  ------------------
  |  Branch (2007:9): [True: 1, False: 36.4k]
  ------------------
 2008|      1|	xmlBufFree(ret->buffer);
 2009|      1|	xmlFree(ret);
 2010|      1|	return(NULL);
 2011|      1|    }
 2012|  36.4k|    xmlSAXVersion(ret->sax, 2);
 2013|  36.4k|    ret->startElement = ret->sax->startElement;
 2014|  36.4k|    ret->sax->startElement = xmlTextReaderStartElement;
 2015|  36.4k|    ret->endElement = ret->sax->endElement;
 2016|  36.4k|    ret->sax->endElement = xmlTextReaderEndElement;
 2017|  36.4k|#ifdef LIBXML_SAX1_ENABLED
 2018|  36.4k|    if (ret->sax->initialized == XML_SAX2_MAGIC) {
  ------------------
  |  |  953|  36.4k|#define XML_SAX2_MAGIC 0xDEEDBEAF
  ------------------
  |  Branch (2018:9): [True: 36.4k, False: 0]
  ------------------
 2019|  36.4k|#endif /* LIBXML_SAX1_ENABLED */
 2020|  36.4k|	ret->startElementNs = ret->sax->startElementNs;
 2021|  36.4k|	ret->sax->startElementNs = xmlTextReaderStartElementNs;
 2022|  36.4k|	ret->endElementNs = ret->sax->endElementNs;
 2023|  36.4k|	ret->sax->endElementNs = xmlTextReaderEndElementNs;
 2024|  36.4k|#ifdef LIBXML_SAX1_ENABLED
 2025|  36.4k|    } else {
 2026|      0|	ret->startElementNs = NULL;
 2027|      0|	ret->endElementNs = NULL;
 2028|      0|    }
 2029|  36.4k|#endif /* LIBXML_SAX1_ENABLED */
 2030|  36.4k|    ret->characters = ret->sax->characters;
 2031|  36.4k|    ret->sax->characters = xmlTextReaderCharacters;
 2032|  36.4k|    ret->sax->ignorableWhitespace = xmlTextReaderCharacters;
 2033|  36.4k|    ret->cdataBlock = ret->sax->cdataBlock;
 2034|  36.4k|    ret->sax->cdataBlock = xmlTextReaderCDataBlock;
 2035|       |
 2036|  36.4k|    ret->mode = XML_TEXTREADER_MODE_INITIAL;
 2037|  36.4k|    ret->node = NULL;
 2038|  36.4k|    ret->curnode = NULL;
 2039|  36.4k|    if (xmlBufUse(ret->input->buffer) < 4) {
  ------------------
  |  Branch (2039:9): [True: 1.02k, False: 35.4k]
  ------------------
 2040|  1.02k|	xmlParserInputBufferRead(input, 4);
 2041|  1.02k|    }
 2042|  36.4k|    if (xmlBufUse(ret->input->buffer) >= 4) {
  ------------------
  |  Branch (2042:9): [True: 35.4k, False: 1.02k]
  ------------------
 2043|  35.4k|	ret->ctxt = xmlCreatePushParserCtxt(ret->sax, NULL,
 2044|  35.4k|			     (const char *) xmlBufContent(ret->input->buffer),
 2045|  35.4k|                                            4, URI);
 2046|  35.4k|	ret->base = 0;
 2047|  35.4k|	ret->cur = 4;
 2048|  35.4k|    } else {
 2049|  1.02k|	ret->ctxt = xmlCreatePushParserCtxt(ret->sax, NULL, NULL, 0, URI);
 2050|  1.02k|	ret->base = 0;
 2051|  1.02k|	ret->cur = 0;
 2052|  1.02k|    }
 2053|       |
 2054|  36.4k|    if (ret->ctxt == NULL) {
  ------------------
  |  Branch (2054:9): [True: 35, False: 36.4k]
  ------------------
 2055|     35|	xmlBufFree(ret->buffer);
 2056|     35|	xmlFree(ret->sax);
 2057|     35|	xmlFree(ret);
 2058|     35|	return(NULL);
 2059|     35|    }
 2060|  36.4k|    ret->ctxt->parseMode = XML_PARSE_READER;
 2061|  36.4k|    ret->ctxt->_private = ret;
 2062|  36.4k|    ret->ctxt->dictNames = 1;
 2063|  36.4k|    ret->allocs = XML_TEXTREADER_CTXT;
  ------------------
  |  |   78|  36.4k|#define XML_TEXTREADER_CTXT	2
  ------------------
 2064|       |    /*
 2065|       |     * use the parser dictionary to allocate all elements and attributes names
 2066|       |     */
 2067|  36.4k|    ret->dict = ret->ctxt->dict;
 2068|  36.4k|#ifdef LIBXML_XINCLUDE_ENABLED
 2069|  36.4k|    ret->xinclude = 0;
 2070|  36.4k|#endif
 2071|  36.4k|#ifdef LIBXML_PATTERN_ENABLED
 2072|  36.4k|    ret->patternMax = 0;
 2073|       |    ret->patternTab = NULL;
 2074|  36.4k|#endif
 2075|  36.4k|    return(ret);
 2076|  36.4k|}
xmlFreeTextReader:
 2126|  36.4k|xmlFreeTextReader(xmlTextReader *reader) {
 2127|  36.4k|    if (reader == NULL)
  ------------------
  |  Branch (2127:9): [True: 0, False: 36.4k]
  ------------------
 2128|      0|	return;
 2129|  36.4k|#ifdef LIBXML_RELAXNG_ENABLED
 2130|  36.4k|    if (reader->rngSchemas != NULL) {
  ------------------
  |  Branch (2130:9): [True: 0, False: 36.4k]
  ------------------
 2131|      0|	xmlRelaxNGFree(reader->rngSchemas);
 2132|      0|	reader->rngSchemas = NULL;
 2133|      0|    }
 2134|  36.4k|    if (reader->rngValidCtxt != NULL) {
  ------------------
  |  Branch (2134:9): [True: 0, False: 36.4k]
  ------------------
 2135|      0|	if (! reader->rngPreserveCtxt)
  ------------------
  |  Branch (2135:6): [True: 0, False: 0]
  ------------------
 2136|      0|	    xmlRelaxNGFreeValidCtxt(reader->rngValidCtxt);
 2137|      0|	reader->rngValidCtxt = NULL;
 2138|      0|    }
 2139|  36.4k|#endif
 2140|  36.4k|#ifdef LIBXML_SCHEMAS_ENABLED
 2141|  36.4k|    if (reader->xsdPlug != NULL) {
  ------------------
  |  Branch (2141:9): [True: 0, False: 36.4k]
  ------------------
 2142|      0|	xmlSchemaSAXUnplug(reader->xsdPlug);
 2143|      0|	reader->xsdPlug = NULL;
 2144|      0|    }
 2145|  36.4k|    if (reader->xsdValidCtxt != NULL) {
  ------------------
  |  Branch (2145:9): [True: 0, False: 36.4k]
  ------------------
 2146|      0|	if (! reader->xsdPreserveCtxt)
  ------------------
  |  Branch (2146:6): [True: 0, False: 0]
  ------------------
 2147|      0|	    xmlSchemaFreeValidCtxt(reader->xsdValidCtxt);
 2148|      0|	reader->xsdValidCtxt = NULL;
 2149|      0|    }
 2150|  36.4k|    if (reader->xsdSchemas != NULL) {
  ------------------
  |  Branch (2150:9): [True: 0, False: 36.4k]
  ------------------
 2151|      0|	xmlSchemaFree(reader->xsdSchemas);
 2152|      0|	reader->xsdSchemas = NULL;
 2153|      0|    }
 2154|  36.4k|#endif
 2155|  36.4k|#ifdef LIBXML_XINCLUDE_ENABLED
 2156|  36.4k|    if (reader->xincctxt != NULL)
  ------------------
  |  Branch (2156:9): [True: 7.90k, False: 28.4k]
  ------------------
 2157|  7.90k|	xmlXIncludeFreeContext(reader->xincctxt);
 2158|  36.4k|#endif
 2159|  36.4k|#ifdef LIBXML_PATTERN_ENABLED
 2160|  36.4k|    if (reader->patternTab != NULL) {
  ------------------
  |  Branch (2160:9): [True: 0, False: 36.4k]
  ------------------
 2161|      0|        int i;
 2162|      0|	for (i = 0;i < reader->patternNr;i++) {
  ------------------
  |  Branch (2162:13): [True: 0, False: 0]
  ------------------
 2163|      0|	    if (reader->patternTab[i] != NULL)
  ------------------
  |  Branch (2163:10): [True: 0, False: 0]
  ------------------
 2164|      0|	        xmlFreePattern(reader->patternTab[i]);
 2165|      0|	}
 2166|      0|	xmlFree(reader->patternTab);
 2167|      0|    }
 2168|  36.4k|#endif
 2169|  36.4k|    if (reader->mode != XML_TEXTREADER_MODE_CLOSED)
  ------------------
  |  Branch (2169:9): [True: 35.9k, False: 425]
  ------------------
 2170|  35.9k|        xmlTextReaderClose(reader);
 2171|  36.4k|    if (reader->ctxt != NULL) {
  ------------------
  |  Branch (2171:9): [True: 36.4k, False: 0]
  ------------------
 2172|  36.4k|        if (reader->dict == reader->ctxt->dict)
  ------------------
  |  Branch (2172:13): [True: 36.4k, False: 0]
  ------------------
 2173|  36.4k|	    reader->dict = NULL;
 2174|  36.4k|	if (reader->allocs & XML_TEXTREADER_CTXT)
  ------------------
  |  |   78|  36.4k|#define XML_TEXTREADER_CTXT	2
  ------------------
  |  Branch (2174:6): [True: 36.4k, False: 0]
  ------------------
 2175|  36.4k|	    xmlFreeParserCtxt(reader->ctxt);
 2176|  36.4k|    }
 2177|  36.4k|    if (reader->sax != NULL)
  ------------------
  |  Branch (2177:9): [True: 36.4k, False: 0]
  ------------------
 2178|  36.4k|	xmlFree(reader->sax);
 2179|  36.4k|    if (reader->buffer != NULL)
  ------------------
  |  Branch (2179:9): [True: 36.4k, False: 0]
  ------------------
 2180|  36.4k|        xmlBufFree(reader->buffer);
 2181|  36.4k|    if (reader->entTab != NULL)
  ------------------
  |  Branch (2181:9): [True: 215, False: 36.1k]
  ------------------
 2182|    215|	xmlFree(reader->entTab);
 2183|  36.4k|    if (reader->dict != NULL)
  ------------------
  |  Branch (2183:9): [True: 0, False: 36.4k]
  ------------------
 2184|      0|        xmlDictFree(reader->dict);
 2185|  36.4k|    xmlFree(reader);
 2186|  36.4k|}
xmlTextReaderClose:
 2202|  37.6k|xmlTextReaderClose(xmlTextReader *reader) {
 2203|  37.6k|    if (reader == NULL)
  ------------------
  |  Branch (2203:9): [True: 0, False: 37.6k]
  ------------------
 2204|      0|	return(-1);
 2205|  37.6k|    reader->node = NULL;
 2206|  37.6k|    reader->curnode = NULL;
 2207|  37.6k|    reader->mode = XML_TEXTREADER_MODE_CLOSED;
 2208|  37.6k|    if (reader->faketext != NULL) {
  ------------------
  |  Branch (2208:9): [True: 165, False: 37.4k]
  ------------------
 2209|    165|        xmlFreeNode(reader->faketext);
 2210|    165|        reader->faketext = NULL;
 2211|    165|    }
 2212|  37.6k|    if (reader->ctxt != NULL) {
  ------------------
  |  Branch (2212:9): [True: 37.6k, False: 0]
  ------------------
 2213|  37.6k|#ifdef LIBXML_VALID_ENABLED
 2214|  37.6k|	if ((reader->ctxt->vctxt.vstateTab != NULL) &&
  ------------------
  |  Branch (2214:6): [True: 2.73k, False: 34.8k]
  ------------------
 2215|  2.73k|	    (reader->ctxt->vctxt.vstateMax > 0)){
  ------------------
  |  Branch (2215:6): [True: 2.73k, False: 0]
  ------------------
 2216|  2.73k|#ifdef LIBXML_REGEXP_ENABLED
 2217|  30.4k|            while (reader->ctxt->vctxt.vstateNr > 0)
  ------------------
  |  Branch (2217:20): [True: 27.7k, False: 2.73k]
  ------------------
 2218|  27.7k|                xmlValidatePopElement(&reader->ctxt->vctxt, NULL, NULL, NULL);
 2219|  2.73k|#endif /* LIBXML_REGEXP_ENABLED */
 2220|  2.73k|	    xmlFree(reader->ctxt->vctxt.vstateTab);
 2221|  2.73k|	    reader->ctxt->vctxt.vstateTab = NULL;
 2222|  2.73k|	    reader->ctxt->vctxt.vstateMax = 0;
 2223|  2.73k|	}
 2224|  37.6k|#endif /* LIBXML_VALID_ENABLED */
 2225|  37.6k|	xmlStopParser(reader->ctxt);
 2226|  37.6k|	if (reader->ctxt->myDoc != NULL) {
  ------------------
  |  Branch (2226:6): [True: 34.3k, False: 3.26k]
  ------------------
 2227|  34.3k|	    if (reader->preserve == 0)
  ------------------
  |  Branch (2227:10): [True: 31.9k, False: 2.45k]
  ------------------
 2228|  31.9k|		xmlTextReaderFreeDoc(reader, reader->ctxt->myDoc);
 2229|  34.3k|	    reader->ctxt->myDoc = NULL;
 2230|  34.3k|	}
 2231|  37.6k|    }
 2232|  37.6k|    if ((reader->input != NULL)  && (reader->allocs & XML_TEXTREADER_INPUT)) {
  ------------------
  |  |   77|  36.1k|#define XML_TEXTREADER_INPUT	1
  ------------------
  |  Branch (2232:9): [True: 36.1k, False: 1.48k]
  |  Branch (2232:37): [True: 35.3k, False: 823]
  ------------------
 2233|  35.3k|	xmlFreeParserInputBuffer(reader->input);
 2234|  35.3k|	reader->allocs -= XML_TEXTREADER_INPUT;
  ------------------
  |  |   77|  35.3k|#define XML_TEXTREADER_INPUT	1
  ------------------
 2235|  35.3k|    }
 2236|  37.6k|    return(0);
 2237|  37.6k|}
xmlTextReaderGetAttributeNo:
 2249|  5.51k|xmlTextReaderGetAttributeNo(xmlTextReader *reader, int no) {
 2250|  5.51k|    xmlChar *ret;
 2251|  5.51k|    int i;
 2252|  5.51k|    xmlAttrPtr cur;
 2253|  5.51k|    xmlNsPtr ns;
 2254|       |
 2255|  5.51k|    if (reader == NULL)
  ------------------
  |  Branch (2255:9): [True: 0, False: 5.51k]
  ------------------
 2256|      0|	return(NULL);
 2257|  5.51k|    if (reader->node == NULL)
  ------------------
  |  Branch (2257:9): [True: 686, False: 4.83k]
  ------------------
 2258|    686|	return(NULL);
 2259|  4.83k|    if (reader->curnode != NULL)
  ------------------
  |  Branch (2259:9): [True: 277, False: 4.55k]
  ------------------
 2260|    277|	return(NULL);
 2261|       |    /* TODO: handle the xmlDecl */
 2262|  4.55k|    if (reader->node->type != XML_ELEMENT_NODE)
  ------------------
  |  Branch (2262:9): [True: 1.83k, False: 2.72k]
  ------------------
 2263|  1.83k|	return(NULL);
 2264|       |
 2265|  2.72k|    ns = reader->node->nsDef;
 2266|  3.19k|    for (i = 0;(i < no) && (ns != NULL);i++) {
  ------------------
  |  Branch (2266:16): [True: 2.40k, False: 786]
  |  Branch (2266:28): [True: 474, False: 1.93k]
  ------------------
 2267|    474|	ns = ns->next;
 2268|    474|    }
 2269|  2.72k|    if (ns != NULL)
  ------------------
  |  Branch (2269:9): [True: 305, False: 2.41k]
  ------------------
 2270|    305|	return(readerStrdup(reader, ns->href));
 2271|       |
 2272|  2.41k|    cur = reader->node->properties;
 2273|  2.41k|    if (cur == NULL)
  ------------------
  |  Branch (2273:9): [True: 1.18k, False: 1.23k]
  ------------------
 2274|  1.18k|	return(NULL);
 2275|  1.76k|    for (;i < no;i++) {
  ------------------
  |  Branch (2275:11): [True: 1.15k, False: 614]
  ------------------
 2276|  1.15k|	cur = cur->next;
 2277|  1.15k|	if (cur == NULL)
  ------------------
  |  Branch (2277:6): [True: 617, False: 535]
  ------------------
 2278|    617|	    return(NULL);
 2279|  1.15k|    }
 2280|       |    /* TODO walk the DTD if present */
 2281|       |
 2282|    614|    if (cur->children == NULL)
  ------------------
  |  Branch (2282:9): [True: 240, False: 374]
  ------------------
 2283|    240|        return(NULL);
 2284|    374|    ret = xmlNodeListGetString(reader->node->doc, cur->children, 1);
 2285|    374|    if (ret == NULL)
  ------------------
  |  Branch (2285:9): [True: 1, False: 373]
  ------------------
 2286|      1|        xmlTextReaderErrMemory(reader);
 2287|    374|    return(ret);
 2288|    614|}
xmlTextReaderGetAttribute:
 2299|  27.7k|xmlTextReaderGetAttribute(xmlTextReader *reader, const xmlChar *name) {
 2300|  27.7k|    xmlChar *prefix = NULL;
 2301|  27.7k|    const xmlChar *localname;
 2302|  27.7k|    xmlNsPtr ns;
 2303|  27.7k|    xmlChar *ret = NULL;
 2304|  27.7k|    int result;
 2305|       |
 2306|  27.7k|    if ((reader == NULL) || (name == NULL))
  ------------------
  |  Branch (2306:9): [True: 0, False: 27.7k]
  |  Branch (2306:29): [True: 11.7k, False: 16.0k]
  ------------------
 2307|  11.7k|	return(NULL);
 2308|  16.0k|    if (reader->node == NULL)
  ------------------
  |  Branch (2308:9): [True: 0, False: 16.0k]
  ------------------
 2309|      0|	return(NULL);
 2310|  16.0k|    if (reader->curnode != NULL)
  ------------------
  |  Branch (2310:9): [True: 1.08k, False: 14.9k]
  ------------------
 2311|  1.08k|	return(NULL);
 2312|       |
 2313|       |    /* TODO: handle the xmlDecl */
 2314|  14.9k|    if (reader->node->type != XML_ELEMENT_NODE)
  ------------------
  |  Branch (2314:9): [True: 5.77k, False: 9.22k]
  ------------------
 2315|  5.77k|	return(NULL);
 2316|       |
 2317|  9.22k|    localname = xmlSplitQName4(name, &prefix);
 2318|  9.22k|    if (localname == NULL) {
  ------------------
  |  Branch (2318:9): [True: 18, False: 9.20k]
  ------------------
 2319|     18|        xmlTextReaderErrMemory(reader);
 2320|     18|        return(NULL);
 2321|     18|    }
 2322|  9.20k|    if (prefix == NULL) {
  ------------------
  |  Branch (2322:9): [True: 6.07k, False: 3.13k]
  ------------------
 2323|       |        /*
 2324|       |         * Namespace default decl
 2325|       |         */
 2326|  6.07k|        if (xmlStrEqual(name, BAD_CAST "xmlns")) {
  ------------------
  |  |   34|  6.07k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (2326:13): [True: 557, False: 5.51k]
  ------------------
 2327|    557|            ns = reader->node->nsDef;
 2328|    767|            while (ns != NULL) {
  ------------------
  |  Branch (2328:20): [True: 428, False: 339]
  ------------------
 2329|    428|                if (ns->prefix == NULL) {
  ------------------
  |  Branch (2329:21): [True: 218, False: 210]
  ------------------
 2330|    218|                    return(readerStrdup(reader, ns->href));
 2331|    218|                }
 2332|    210|                ns = ns->next;
 2333|    210|            }
 2334|    339|            return NULL;
 2335|    557|        }
 2336|       |
 2337|  5.51k|        result = xmlNodeGetAttrValue(reader->node, name, NULL, &ret);
 2338|  5.51k|        if (result < 0)
  ------------------
  |  Branch (2338:13): [True: 8, False: 5.50k]
  ------------------
 2339|      8|            xmlTextReaderErrMemory(reader);
 2340|  5.51k|        return(ret);
 2341|  6.07k|    }
 2342|       |
 2343|       |    /*
 2344|       |     * Namespace default decl
 2345|       |     */
 2346|  3.13k|    if (xmlStrEqual(prefix, BAD_CAST "xmlns")) {
  ------------------
  |  |   34|  3.13k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (2346:9): [True: 806, False: 2.32k]
  ------------------
 2347|    806|        ns = reader->node->nsDef;
 2348|  1.39k|        while (ns != NULL) {
  ------------------
  |  Branch (2348:16): [True: 815, False: 584]
  ------------------
 2349|    815|            if ((ns->prefix != NULL) && (xmlStrEqual(ns->prefix, localname))) {
  ------------------
  |  Branch (2349:17): [True: 606, False: 209]
  |  Branch (2349:41): [True: 222, False: 384]
  ------------------
 2350|    222|                ret = readerStrdup(reader, ns->href);
 2351|    222|                break;
 2352|    222|            }
 2353|    593|            ns = ns->next;
 2354|    593|        }
 2355|  2.32k|    } else {
 2356|  2.32k|        result = xmlSearchNsSafe(reader->node, prefix, &ns);
 2357|  2.32k|        if (result < 0)
  ------------------
  |  Branch (2357:13): [True: 1, False: 2.32k]
  ------------------
 2358|      1|            xmlTextReaderErrMemory(reader);
 2359|  2.32k|        if (ns != NULL) {
  ------------------
  |  Branch (2359:13): [True: 1.51k, False: 817]
  ------------------
 2360|  1.51k|            result = xmlNodeGetAttrValue(reader->node, localname, ns->href,
 2361|  1.51k|                                         &ret);
 2362|  1.51k|            if (result < 0)
  ------------------
  |  Branch (2362:17): [True: 2, False: 1.51k]
  ------------------
 2363|      2|                xmlTextReaderErrMemory(reader);
 2364|  1.51k|        }
 2365|  2.32k|    }
 2366|       |
 2367|  3.13k|    if (prefix != NULL)
  ------------------
  |  Branch (2367:9): [True: 3.13k, False: 0]
  ------------------
 2368|  3.13k|        xmlFree(prefix);
 2369|  3.13k|    return(ret);
 2370|  9.20k|}
xmlTextReaderGetAttributeNs:
 2384|  26.7k|			    const xmlChar *namespaceURI) {
 2385|  26.7k|    xmlChar *ret = NULL;
 2386|  26.7k|    xmlChar *prefix = NULL;
 2387|  26.7k|    xmlNsPtr ns;
 2388|  26.7k|    int result;
 2389|       |
 2390|  26.7k|    if ((reader == NULL) || (localName == NULL))
  ------------------
  |  Branch (2390:9): [True: 0, False: 26.7k]
  |  Branch (2390:29): [True: 11.4k, False: 15.3k]
  ------------------
 2391|  11.4k|	return(NULL);
 2392|  15.3k|    if (reader->node == NULL)
  ------------------
  |  Branch (2392:9): [True: 0, False: 15.3k]
  ------------------
 2393|      0|	return(NULL);
 2394|  15.3k|    if (reader->curnode != NULL)
  ------------------
  |  Branch (2394:9): [True: 1.86k, False: 13.4k]
  ------------------
 2395|  1.86k|	return(NULL);
 2396|       |
 2397|       |    /* TODO: handle the xmlDecl */
 2398|  13.4k|    if (reader->node->type != XML_ELEMENT_NODE)
  ------------------
  |  Branch (2398:9): [True: 5.36k, False: 8.09k]
  ------------------
 2399|  5.36k|	return(NULL);
 2400|       |
 2401|  8.09k|    if (xmlStrEqual(namespaceURI, BAD_CAST "http://www.w3.org/2000/xmlns/")) {
  ------------------
  |  |   34|  8.09k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (2401:9): [True: 1.24k, False: 6.85k]
  ------------------
 2402|  1.24k|        if (! xmlStrEqual(localName, BAD_CAST "xmlns")) {
  ------------------
  |  |   34|  1.24k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (2402:13): [True: 861, False: 383]
  ------------------
 2403|    861|            prefix = BAD_CAST localName;
  ------------------
  |  |   34|    861|#define BAD_CAST (xmlChar *)
  ------------------
 2404|    861|        }
 2405|  1.24k|        ns = reader->node->nsDef;
 2406|  2.04k|        while (ns != NULL) {
  ------------------
  |  Branch (2406:16): [True: 1.20k, False: 846]
  ------------------
 2407|  1.20k|            if ((prefix == NULL && ns->prefix == NULL) ||
  ------------------
  |  Branch (2407:18): [True: 400, False: 803]
  |  Branch (2407:36): [True: 197, False: 203]
  ------------------
 2408|  1.00k|                ((ns->prefix != NULL) && (xmlStrEqual(ns->prefix, localName)))) {
  ------------------
  |  Branch (2408:18): [True: 669, False: 337]
  |  Branch (2408:42): [True: 201, False: 468]
  ------------------
 2409|    398|                return readerStrdup(reader, ns->href);
 2410|    398|            }
 2411|    805|            ns = ns->next;
 2412|    805|        }
 2413|    846|        return NULL;
 2414|  1.24k|    }
 2415|       |
 2416|  6.85k|    result = xmlNodeGetAttrValue(reader->node, localName, namespaceURI, &ret);
 2417|  6.85k|    if (result < 0)
  ------------------
  |  Branch (2417:9): [True: 6, False: 6.84k]
  ------------------
 2418|      6|        xmlTextReaderErrMemory(reader);
 2419|       |
 2420|  6.85k|    return(ret);
 2421|  8.09k|}
xmlTextReaderGetRemainder:
 2437|  3.50k|xmlTextReaderGetRemainder(xmlTextReader *reader) {
 2438|  3.50k|    xmlParserInputBufferPtr ret = NULL;
 2439|       |
 2440|  3.50k|    if (reader == NULL)
  ------------------
  |  Branch (2440:9): [True: 0, False: 3.50k]
  ------------------
 2441|      0|	return(NULL);
 2442|  3.50k|    if (reader->node == NULL)
  ------------------
  |  Branch (2442:9): [True: 2.41k, False: 1.08k]
  ------------------
 2443|  2.41k|	return(NULL);
 2444|       |
 2445|  1.08k|    reader->node = NULL;
 2446|  1.08k|    reader->curnode = NULL;
 2447|  1.08k|    reader->mode = XML_TEXTREADER_MODE_EOF;
 2448|  1.08k|    if (reader->ctxt != NULL) {
  ------------------
  |  Branch (2448:9): [True: 1.08k, False: 0]
  ------------------
 2449|  1.08k|	xmlStopParser(reader->ctxt);
 2450|  1.08k|	if (reader->ctxt->myDoc != NULL) {
  ------------------
  |  Branch (2450:6): [True: 1.08k, False: 0]
  ------------------
 2451|  1.08k|	    if (reader->preserve == 0)
  ------------------
  |  Branch (2451:10): [True: 0, False: 1.08k]
  ------------------
 2452|      0|		xmlTextReaderFreeDoc(reader, reader->ctxt->myDoc);
 2453|  1.08k|	    reader->ctxt->myDoc = NULL;
 2454|  1.08k|	}
 2455|  1.08k|    }
 2456|  1.08k|    if (reader->allocs & XML_TEXTREADER_INPUT) {
  ------------------
  |  |   77|  1.08k|#define XML_TEXTREADER_INPUT	1
  ------------------
  |  Branch (2456:9): [True: 1.08k, False: 0]
  ------------------
 2457|  1.08k|	ret = reader->input;
 2458|  1.08k|	reader->input = NULL;
 2459|  1.08k|	reader->allocs -= XML_TEXTREADER_INPUT;
  ------------------
  |  |   77|  1.08k|#define XML_TEXTREADER_INPUT	1
  ------------------
 2460|  1.08k|    } else {
 2461|       |	/*
 2462|       |	 * Hum, one may need to duplicate the data structure because
 2463|       |	 * without reference counting the input may be freed twice:
 2464|       |	 *   - by the layer which allocated it.
 2465|       |	 *   - by the layer to which would have been returned to.
 2466|       |	 */
 2467|      0|	return(NULL);
 2468|      0|    }
 2469|  1.08k|    return(ret);
 2470|  1.08k|}
xmlTextReaderLookupNamespace:
 2482|  7.54k|xmlTextReaderLookupNamespace(xmlTextReader *reader, const xmlChar *prefix) {
 2483|  7.54k|    xmlNsPtr ns;
 2484|  7.54k|    int result;
 2485|       |
 2486|  7.54k|    if (reader == NULL)
  ------------------
  |  Branch (2486:9): [True: 0, False: 7.54k]
  ------------------
 2487|      0|	return(NULL);
 2488|  7.54k|    if (reader->node == NULL)
  ------------------
  |  Branch (2488:9): [True: 2.36k, False: 5.18k]
  ------------------
 2489|  2.36k|	return(NULL);
 2490|       |
 2491|  5.18k|    result = xmlSearchNsSafe(reader->node, prefix, &ns);
 2492|  5.18k|    if (result < 0) {
  ------------------
  |  Branch (2492:9): [True: 0, False: 5.18k]
  ------------------
 2493|      0|        xmlTextReaderErrMemory(reader);
 2494|      0|        return(NULL);
 2495|      0|    }
 2496|  5.18k|    if (ns == NULL)
  ------------------
  |  Branch (2496:9): [True: 4.26k, False: 919]
  ------------------
 2497|  4.26k|	return(NULL);
 2498|    919|    return(readerStrdup(reader, ns->href));
 2499|  5.18k|}
xmlTextReaderMoveToAttributeNo:
 2511|  7.27k|xmlTextReaderMoveToAttributeNo(xmlTextReader *reader, int no) {
 2512|  7.27k|    int i;
 2513|  7.27k|    xmlAttrPtr cur;
 2514|  7.27k|    xmlNsPtr ns;
 2515|       |
 2516|  7.27k|    if (reader == NULL)
  ------------------
  |  Branch (2516:9): [True: 0, False: 7.27k]
  ------------------
 2517|      0|	return(-1);
 2518|  7.27k|    if (reader->node == NULL)
  ------------------
  |  Branch (2518:9): [True: 2.81k, False: 4.46k]
  ------------------
 2519|  2.81k|	return(-1);
 2520|       |    /* TODO: handle the xmlDecl */
 2521|  4.46k|    if (reader->node->type != XML_ELEMENT_NODE)
  ------------------
  |  Branch (2521:9): [True: 1.21k, False: 3.25k]
  ------------------
 2522|  1.21k|	return(-1);
 2523|       |
 2524|  3.25k|    reader->curnode = NULL;
 2525|       |
 2526|  3.25k|    ns = reader->node->nsDef;
 2527|  4.72k|    for (i = 0;(i < no) && (ns != NULL);i++) {
  ------------------
  |  Branch (2527:16): [True: 4.03k, False: 681]
  |  Branch (2527:28): [True: 1.46k, False: 2.57k]
  ------------------
 2528|  1.46k|	ns = ns->next;
 2529|  1.46k|    }
 2530|  3.25k|    if (ns != NULL) {
  ------------------
  |  Branch (2530:9): [True: 319, False: 2.93k]
  ------------------
 2531|    319|	reader->curnode = (xmlNodePtr) ns;
 2532|    319|	return(1);
 2533|    319|    }
 2534|       |
 2535|  2.93k|    cur = reader->node->properties;
 2536|  2.93k|    if (cur == NULL)
  ------------------
  |  Branch (2536:9): [True: 1.06k, False: 1.87k]
  ------------------
 2537|  1.06k|	return(0);
 2538|  2.91k|    for (;i < no;i++) {
  ------------------
  |  Branch (2538:11): [True: 2.37k, False: 541]
  ------------------
 2539|  2.37k|	cur = cur->next;
 2540|  2.37k|	if (cur == NULL)
  ------------------
  |  Branch (2540:6): [True: 1.33k, False: 1.03k]
  ------------------
 2541|  1.33k|	    return(0);
 2542|  2.37k|    }
 2543|       |    /* TODO walk the DTD if present */
 2544|       |
 2545|    541|    reader->curnode = (xmlNodePtr) cur;
 2546|    541|    return(1);
 2547|  1.87k|}
xmlTextReaderMoveToAttribute:
 2558|  12.0k|xmlTextReaderMoveToAttribute(xmlTextReader *reader, const xmlChar *name) {
 2559|  12.0k|    xmlChar *prefix = NULL;
 2560|  12.0k|    const xmlChar *localname;
 2561|  12.0k|    xmlNsPtr ns;
 2562|  12.0k|    xmlAttrPtr prop;
 2563|       |
 2564|  12.0k|    if ((reader == NULL) || (name == NULL))
  ------------------
  |  Branch (2564:9): [True: 0, False: 12.0k]
  |  Branch (2564:29): [True: 4.21k, False: 7.83k]
  ------------------
 2565|  4.21k|	return(-1);
 2566|  7.83k|    if (reader->node == NULL)
  ------------------
  |  Branch (2566:9): [True: 0, False: 7.83k]
  ------------------
 2567|      0|	return(-1);
 2568|       |
 2569|       |    /* TODO: handle the xmlDecl */
 2570|  7.83k|    if (reader->node->type != XML_ELEMENT_NODE)
  ------------------
  |  Branch (2570:9): [True: 2.06k, False: 5.76k]
  ------------------
 2571|  2.06k|	return(0);
 2572|       |
 2573|  5.76k|    localname = xmlSplitQName4(name, &prefix);
 2574|  5.76k|    if (localname == NULL) {
  ------------------
  |  Branch (2574:9): [True: 8, False: 5.75k]
  ------------------
 2575|      8|        xmlTextReaderErrMemory(reader);
 2576|      8|        return(-1);
 2577|      8|    }
 2578|  5.75k|    if (prefix == NULL) {
  ------------------
  |  Branch (2578:9): [True: 3.50k, False: 2.25k]
  ------------------
 2579|       |	/*
 2580|       |	 * Namespace default decl
 2581|       |	 */
 2582|  3.50k|	if (xmlStrEqual(name, BAD_CAST "xmlns")) {
  ------------------
  |  |   34|  3.50k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (2582:6): [True: 594, False: 2.91k]
  ------------------
 2583|    594|	    ns = reader->node->nsDef;
 2584|    815|	    while (ns != NULL) {
  ------------------
  |  Branch (2584:13): [True: 515, False: 300]
  ------------------
 2585|    515|		if (ns->prefix == NULL) {
  ------------------
  |  Branch (2585:7): [True: 294, False: 221]
  ------------------
 2586|    294|		    reader->curnode = (xmlNodePtr) ns;
 2587|    294|		    return(1);
 2588|    294|		}
 2589|    221|		ns = ns->next;
 2590|    221|	    }
 2591|    300|	    return(0);
 2592|    594|	}
 2593|       |
 2594|  2.91k|	prop = reader->node->properties;
 2595|  4.24k|	while (prop != NULL) {
  ------------------
  |  Branch (2595:9): [True: 1.70k, False: 2.54k]
  ------------------
 2596|       |	    /*
 2597|       |	     * One need to have
 2598|       |	     *   - same attribute names
 2599|       |	     *   - and the attribute carrying that namespace
 2600|       |	     */
 2601|  1.70k|	    if ((xmlStrEqual(prop->name, name)) &&
  ------------------
  |  Branch (2601:10): [True: 564, False: 1.14k]
  ------------------
 2602|    564|		((prop->ns == NULL) || (prop->ns->prefix == NULL))) {
  ------------------
  |  Branch (2602:4): [True: 369, False: 195]
  |  Branch (2602:26): [True: 0, False: 195]
  ------------------
 2603|    369|		reader->curnode = (xmlNodePtr) prop;
 2604|    369|		return(1);
 2605|    369|	    }
 2606|  1.33k|	    prop = prop->next;
 2607|  1.33k|	}
 2608|  2.54k|	return(0);
 2609|  2.91k|    }
 2610|       |
 2611|       |    /*
 2612|       |     * Namespace default decl
 2613|       |     */
 2614|  2.25k|    if (xmlStrEqual(prefix, BAD_CAST "xmlns")) {
  ------------------
  |  |   34|  2.25k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (2614:9): [True: 954, False: 1.30k]
  ------------------
 2615|    954|	ns = reader->node->nsDef;
 2616|  1.51k|	while (ns != NULL) {
  ------------------
  |  Branch (2616:9): [True: 959, False: 559]
  ------------------
 2617|    959|	    if ((ns->prefix != NULL) && (xmlStrEqual(ns->prefix, localname))) {
  ------------------
  |  Branch (2617:10): [True: 756, False: 203]
  |  Branch (2617:34): [True: 395, False: 361]
  ------------------
 2618|    395|		reader->curnode = (xmlNodePtr) ns;
 2619|    395|		goto found;
 2620|    395|	    }
 2621|    564|	    ns = ns->next;
 2622|    564|	}
 2623|    559|	goto not_found;
 2624|    954|    }
 2625|  1.30k|    prop = reader->node->properties;
 2626|  2.57k|    while (prop != NULL) {
  ------------------
  |  Branch (2626:12): [True: 1.49k, False: 1.07k]
  ------------------
 2627|       |	/*
 2628|       |	 * One need to have
 2629|       |	 *   - same attribute names
 2630|       |	 *   - and the attribute carrying that namespace
 2631|       |	 */
 2632|  1.49k|	if ((xmlStrEqual(prop->name, localname)) &&
  ------------------
  |  Branch (2632:6): [True: 674, False: 820]
  ------------------
 2633|    674|	    (prop->ns != NULL) && (xmlStrEqual(prop->ns->prefix, prefix))) {
  ------------------
  |  Branch (2633:6): [True: 425, False: 249]
  |  Branch (2633:28): [True: 222, False: 203]
  ------------------
 2634|    222|	    reader->curnode = (xmlNodePtr) prop;
 2635|    222|	    goto found;
 2636|    222|	}
 2637|  1.27k|	prop = prop->next;
 2638|  1.27k|    }
 2639|  1.63k|not_found:
 2640|  1.63k|    if (prefix != NULL)
  ------------------
  |  Branch (2640:9): [True: 1.63k, False: 0]
  ------------------
 2641|  1.63k|        xmlFree(prefix);
 2642|  1.63k|    return(0);
 2643|       |
 2644|    617|found:
 2645|    617|    if (prefix != NULL)
  ------------------
  |  Branch (2645:9): [True: 617, False: 0]
  ------------------
 2646|    617|        xmlFree(prefix);
 2647|    617|    return(1);
 2648|  1.30k|}
xmlTextReaderMoveToAttributeNs:
 2661|  11.5k|	const xmlChar *localName, const xmlChar *namespaceURI) {
 2662|  11.5k|    xmlAttrPtr prop;
 2663|  11.5k|    xmlNodePtr node;
 2664|  11.5k|    xmlNsPtr ns;
 2665|  11.5k|    xmlChar *prefix = NULL;
 2666|       |
 2667|  11.5k|    if ((reader == NULL) || (localName == NULL) || (namespaceURI == NULL))
  ------------------
  |  Branch (2667:9): [True: 0, False: 11.5k]
  |  Branch (2667:29): [True: 5.12k, False: 6.46k]
  |  Branch (2667:52): [True: 2.84k, False: 3.61k]
  ------------------
 2668|  7.97k|	return(-1);
 2669|  3.61k|    if (reader->node == NULL)
  ------------------
  |  Branch (2669:9): [True: 0, False: 3.61k]
  ------------------
 2670|      0|	return(-1);
 2671|  3.61k|    if (reader->node->type != XML_ELEMENT_NODE)
  ------------------
  |  Branch (2671:9): [True: 0, False: 3.61k]
  ------------------
 2672|      0|	return(0);
 2673|  3.61k|    node = reader->node;
 2674|       |
 2675|  3.61k|    if (xmlStrEqual(namespaceURI, BAD_CAST "http://www.w3.org/2000/xmlns/")) {
  ------------------
  |  |   34|  3.61k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (2675:9): [True: 2.26k, False: 1.35k]
  ------------------
 2676|  2.26k|		if (! xmlStrEqual(localName, BAD_CAST "xmlns")) {
  ------------------
  |  |   34|  2.26k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (2676:7): [True: 1.38k, False: 875]
  ------------------
 2677|  1.38k|			prefix = BAD_CAST localName;
  ------------------
  |  |   34|  1.38k|#define BAD_CAST (xmlChar *)
  ------------------
 2678|  1.38k|		}
 2679|  2.26k|		ns = reader->node->nsDef;
 2680|  3.05k|		while (ns != NULL) {
  ------------------
  |  Branch (2680:10): [True: 2.64k, False: 416]
  ------------------
 2681|  2.64k|			if ((prefix == NULL && ns->prefix == NULL) ||
  ------------------
  |  Branch (2681:9): [True: 880, False: 1.76k]
  |  Branch (2681:27): [True: 680, False: 200]
  ------------------
 2682|  1.96k|				((ns->prefix != NULL) && (xmlStrEqual(ns->prefix, localName)))) {
  ------------------
  |  Branch (2682:6): [True: 1.42k, False: 531]
  |  Branch (2682:30): [True: 1.16k, False: 265]
  ------------------
 2683|  1.84k|				reader->curnode = (xmlNodePtr) ns;
 2684|  1.84k|				return(1);
 2685|  1.84k|			}
 2686|    796|			ns = ns->next;
 2687|    796|		}
 2688|    416|		return(0);
 2689|  2.26k|    }
 2690|       |
 2691|  1.35k|    prop = node->properties;
 2692|  2.60k|    while (prop != NULL) {
  ------------------
  |  Branch (2692:12): [True: 1.50k, False: 1.10k]
  ------------------
 2693|       |	/*
 2694|       |	 * One need to have
 2695|       |	 *   - same attribute names
 2696|       |	 *   - and the attribute carrying that namespace
 2697|       |	 */
 2698|  1.50k|        if (xmlStrEqual(prop->name, localName) &&
  ------------------
  |  Branch (2698:13): [True: 711, False: 792]
  ------------------
 2699|    711|	    ((prop->ns != NULL) &&
  ------------------
  |  Branch (2699:7): [True: 453, False: 258]
  ------------------
 2700|    453|	     (xmlStrEqual(prop->ns->href, namespaceURI)))) {
  ------------------
  |  Branch (2700:7): [True: 253, False: 200]
  ------------------
 2701|    253|	    reader->curnode = (xmlNodePtr) prop;
 2702|    253|	    return(1);
 2703|    253|        }
 2704|  1.25k|	prop = prop->next;
 2705|  1.25k|    }
 2706|  1.10k|    return(0);
 2707|  1.35k|}
xmlTextReaderMoveToFirstAttribute:
 2717|  13.9k|xmlTextReaderMoveToFirstAttribute(xmlTextReader *reader) {
 2718|  13.9k|    if (reader == NULL)
  ------------------
  |  Branch (2718:9): [True: 0, False: 13.9k]
  ------------------
 2719|      0|	return(-1);
 2720|  13.9k|    if (reader->node == NULL)
  ------------------
  |  Branch (2720:9): [True: 4.43k, False: 9.48k]
  ------------------
 2721|  4.43k|	return(-1);
 2722|  9.48k|    if (reader->node->type != XML_ELEMENT_NODE)
  ------------------
  |  Branch (2722:9): [True: 2.46k, False: 7.01k]
  ------------------
 2723|  2.46k|	return(0);
 2724|       |
 2725|  7.01k|    if (reader->node->nsDef != NULL) {
  ------------------
  |  Branch (2725:9): [True: 3.15k, False: 3.86k]
  ------------------
 2726|  3.15k|	reader->curnode = (xmlNodePtr) reader->node->nsDef;
 2727|  3.15k|	return(1);
 2728|  3.15k|    }
 2729|  3.86k|    if (reader->node->properties != NULL) {
  ------------------
  |  Branch (2729:9): [True: 1.82k, False: 2.04k]
  ------------------
 2730|  1.82k|	reader->curnode = (xmlNodePtr) reader->node->properties;
 2731|  1.82k|	return(1);
 2732|  1.82k|    }
 2733|  2.04k|    return(0);
 2734|  3.86k|}
xmlTextReaderMoveToNextAttribute:
 2744|  7.88k|xmlTextReaderMoveToNextAttribute(xmlTextReader *reader) {
 2745|  7.88k|    if (reader == NULL)
  ------------------
  |  Branch (2745:9): [True: 0, False: 7.88k]
  ------------------
 2746|      0|	return(-1);
 2747|  7.88k|    if (reader->node == NULL)
  ------------------
  |  Branch (2747:9): [True: 2.13k, False: 5.74k]
  ------------------
 2748|  2.13k|	return(-1);
 2749|  5.74k|    if (reader->node->type != XML_ELEMENT_NODE)
  ------------------
  |  Branch (2749:9): [True: 1.68k, False: 4.05k]
  ------------------
 2750|  1.68k|	return(0);
 2751|  4.05k|    if (reader->curnode == NULL)
  ------------------
  |  Branch (2751:9): [True: 1.95k, False: 2.10k]
  ------------------
 2752|  1.95k|	return(xmlTextReaderMoveToFirstAttribute(reader));
 2753|       |
 2754|  2.10k|    if (reader->curnode->type == XML_NAMESPACE_DECL) {
  ------------------
  |  Branch (2754:9): [True: 894, False: 1.21k]
  ------------------
 2755|    894|	xmlNsPtr ns = (xmlNsPtr) reader->curnode;
 2756|    894|	if (ns->next != NULL) {
  ------------------
  |  Branch (2756:6): [True: 227, False: 667]
  ------------------
 2757|    227|	    reader->curnode = (xmlNodePtr) ns->next;
 2758|    227|	    return(1);
 2759|    227|	}
 2760|    667|	if (reader->node->properties != NULL) {
  ------------------
  |  Branch (2760:6): [True: 276, False: 391]
  ------------------
 2761|    276|	    reader->curnode = (xmlNodePtr) reader->node->properties;
 2762|    276|	    return(1);
 2763|    276|	}
 2764|    391|	return(0);
 2765|  1.21k|    } else if ((reader->curnode->type == XML_ATTRIBUTE_NODE) &&
  ------------------
  |  Branch (2765:16): [True: 947, False: 263]
  ------------------
 2766|    947|	       (reader->curnode->next != NULL)) {
  ------------------
  |  Branch (2766:9): [True: 237, False: 710]
  ------------------
 2767|    237|	reader->curnode = reader->curnode->next;
 2768|    237|	return(1);
 2769|    237|    }
 2770|    973|    return(0);
 2771|  2.10k|}
xmlTextReaderMoveToElement:
 2781|  5.08k|xmlTextReaderMoveToElement(xmlTextReader *reader) {
 2782|  5.08k|    if (reader == NULL)
  ------------------
  |  Branch (2782:9): [True: 0, False: 5.08k]
  ------------------
 2783|      0|	return(-1);
 2784|  5.08k|    if (reader->node == NULL)
  ------------------
  |  Branch (2784:9): [True: 2.00k, False: 3.07k]
  ------------------
 2785|  2.00k|	return(-1);
 2786|  3.07k|    if (reader->node->type != XML_ELEMENT_NODE)
  ------------------
  |  Branch (2786:9): [True: 1.28k, False: 1.79k]
  ------------------
 2787|  1.28k|	return(0);
 2788|  1.79k|    if (reader->curnode != NULL) {
  ------------------
  |  Branch (2788:9): [True: 449, False: 1.34k]
  ------------------
 2789|    449|	reader->curnode = NULL;
 2790|    449|	return(1);
 2791|    449|    }
 2792|  1.34k|    return(0);
 2793|  1.79k|}
xmlTextReaderReadAttributeValue:
 2804|  10.1k|xmlTextReaderReadAttributeValue(xmlTextReader *reader) {
 2805|  10.1k|    if (reader == NULL)
  ------------------
  |  Branch (2805:9): [True: 0, False: 10.1k]
  ------------------
 2806|      0|	return(-1);
 2807|  10.1k|    if (reader->node == NULL)
  ------------------
  |  Branch (2807:9): [True: 3.13k, False: 7.02k]
  ------------------
 2808|  3.13k|	return(-1);
 2809|  7.02k|    if (reader->curnode == NULL)
  ------------------
  |  Branch (2809:9): [True: 5.15k, False: 1.86k]
  ------------------
 2810|  5.15k|	return(0);
 2811|  1.86k|    if (reader->curnode->type == XML_ATTRIBUTE_NODE) {
  ------------------
  |  Branch (2811:9): [True: 531, False: 1.33k]
  ------------------
 2812|    531|	if (reader->curnode->children == NULL)
  ------------------
  |  Branch (2812:6): [True: 202, False: 329]
  ------------------
 2813|    202|	    return(0);
 2814|    329|	reader->curnode = reader->curnode->children;
 2815|  1.33k|    } else if (reader->curnode->type == XML_NAMESPACE_DECL) {
  ------------------
  |  Branch (2815:16): [True: 582, False: 752]
  ------------------
 2816|    582|	xmlNsPtr ns = (xmlNsPtr) reader->curnode;
 2817|       |
 2818|    582|	if (reader->faketext == NULL) {
  ------------------
  |  Branch (2818:6): [True: 166, False: 416]
  ------------------
 2819|    166|	    reader->faketext = xmlNewDocText(reader->node->doc,
 2820|    166|		                             ns->href);
 2821|    166|            if (reader->faketext == NULL) {
  ------------------
  |  Branch (2821:17): [True: 1, False: 165]
  ------------------
 2822|      1|                xmlTextReaderErrMemory(reader);
 2823|      1|                return(-1);
 2824|      1|            }
 2825|    416|	} else {
 2826|    416|            if ((reader->faketext->content != NULL) &&
  ------------------
  |  Branch (2826:17): [True: 203, False: 213]
  ------------------
 2827|    203|	        (reader->faketext->content !=
  ------------------
  |  Branch (2827:10): [True: 203, False: 0]
  ------------------
 2828|    203|		 (xmlChar *) &(reader->faketext->properties)))
 2829|    203|		xmlFree(reader->faketext->content);
 2830|    416|            if (ns->href == NULL) {
  ------------------
  |  Branch (2830:17): [True: 213, False: 203]
  ------------------
 2831|    213|                reader->faketext->content = NULL;
 2832|    213|            } else {
 2833|    203|                reader->faketext->content = xmlStrdup(ns->href);
 2834|    203|                if (reader->faketext->content == NULL) {
  ------------------
  |  Branch (2834:21): [True: 1, False: 202]
  ------------------
 2835|      1|                    xmlTextReaderErrMemory(reader);
 2836|      1|                    return(-1);
 2837|      1|                }
 2838|    203|            }
 2839|    416|	}
 2840|    580|	reader->curnode = reader->faketext;
 2841|    752|    } else {
 2842|    752|	if (reader->curnode->next == NULL)
  ------------------
  |  Branch (2842:6): [True: 680, False: 72]
  ------------------
 2843|    680|	    return(0);
 2844|     72|	reader->curnode = reader->curnode->next;
 2845|     72|    }
 2846|    981|    return(1);
 2847|  1.86k|}
xmlTextReaderConstEncoding:
 2857|  3.67k|xmlTextReaderConstEncoding(xmlTextReader *reader) {
 2858|  3.67k|    const xmlChar *encoding = NULL;
 2859|       |
 2860|  3.67k|    if (reader == NULL)
  ------------------
  |  Branch (2860:9): [True: 0, False: 3.67k]
  ------------------
 2861|      0|        return(NULL);
 2862|       |
 2863|  3.67k|    if (reader->ctxt != NULL)
  ------------------
  |  Branch (2863:9): [True: 3.67k, False: 0]
  ------------------
 2864|  3.67k|        encoding = xmlGetActualEncoding(reader->ctxt);
 2865|      0|    else if (reader->doc != NULL)
  ------------------
  |  Branch (2865:14): [True: 0, False: 0]
  ------------------
 2866|      0|        encoding = reader->doc->encoding;
 2867|       |
 2868|  3.67k|    return(constString(reader, encoding));
 2869|  3.67k|}
xmlTextReaderAttributeCount:
 2884|  8.96k|xmlTextReaderAttributeCount(xmlTextReader *reader) {
 2885|  8.96k|    int ret;
 2886|  8.96k|    xmlAttrPtr attr;
 2887|  8.96k|    xmlNsPtr ns;
 2888|  8.96k|    xmlNodePtr node;
 2889|       |
 2890|  8.96k|    if (reader == NULL)
  ------------------
  |  Branch (2890:9): [True: 0, False: 8.96k]
  ------------------
 2891|      0|	return(-1);
 2892|  8.96k|    if (reader->node == NULL)
  ------------------
  |  Branch (2892:9): [True: 3.17k, False: 5.78k]
  ------------------
 2893|  3.17k|	return(0);
 2894|       |
 2895|  5.78k|    if (reader->curnode != NULL)
  ------------------
  |  Branch (2895:9): [True: 488, False: 5.29k]
  ------------------
 2896|    488|	node = reader->curnode;
 2897|  5.29k|    else
 2898|  5.29k|	node = reader->node;
 2899|       |
 2900|  5.78k|    if (node->type != XML_ELEMENT_NODE)
  ------------------
  |  Branch (2900:9): [True: 1.88k, False: 3.89k]
  ------------------
 2901|  1.88k|	return(0);
 2902|  3.89k|    if ((reader->state == XML_TEXTREADER_END) ||
  ------------------
  |  Branch (2902:9): [True: 229, False: 3.66k]
  ------------------
 2903|  3.66k|	(reader->state == XML_TEXTREADER_BACKTRACK))
  ------------------
  |  Branch (2903:2): [True: 278, False: 3.38k]
  ------------------
 2904|    507|	return(0);
 2905|  3.38k|    ret = 0;
 2906|  3.38k|    attr = node->properties;
 2907|  8.62k|    while (attr != NULL) {
  ------------------
  |  Branch (2907:12): [True: 5.24k, False: 3.38k]
  ------------------
 2908|  5.24k|	ret++;
 2909|  5.24k|	attr = attr->next;
 2910|  5.24k|    }
 2911|  3.38k|    ns = node->nsDef;
 2912|  5.63k|    while (ns != NULL) {
  ------------------
  |  Branch (2912:12): [True: 2.24k, False: 3.38k]
  ------------------
 2913|  2.24k|	ret++;
 2914|  2.24k|	ns = ns->next;
 2915|  2.24k|    }
 2916|  3.38k|    return(ret);
 2917|  3.89k|}
xmlTextReaderNodeType:
 2928|  10.2k|xmlTextReaderNodeType(xmlTextReader *reader) {
 2929|  10.2k|    xmlNodePtr node;
 2930|       |
 2931|  10.2k|    if (reader == NULL)
  ------------------
  |  Branch (2931:9): [True: 0, False: 10.2k]
  ------------------
 2932|      0|	return(-1);
 2933|  10.2k|    if (reader->node == NULL)
  ------------------
  |  Branch (2933:9): [True: 3.06k, False: 7.16k]
  ------------------
 2934|  3.06k|	return(XML_READER_TYPE_NONE);
 2935|  7.16k|    if (reader->curnode != NULL)
  ------------------
  |  Branch (2935:9): [True: 770, False: 6.39k]
  ------------------
 2936|    770|	node = reader->curnode;
 2937|  6.39k|    else
 2938|  6.39k|	node = reader->node;
 2939|  7.16k|    switch (node->type) {
  ------------------
  |  Branch (2939:13): [True: 7.16k, False: 0]
  ------------------
 2940|  2.20k|        case XML_ELEMENT_NODE:
  ------------------
  |  Branch (2940:9): [True: 2.20k, False: 4.96k]
  ------------------
 2941|  2.20k|	    if ((reader->state == XML_TEXTREADER_END) ||
  ------------------
  |  Branch (2941:10): [True: 240, False: 1.96k]
  ------------------
 2942|  1.96k|		(reader->state == XML_TEXTREADER_BACKTRACK))
  ------------------
  |  Branch (2942:3): [True: 281, False: 1.68k]
  ------------------
 2943|    521|		return(XML_READER_TYPE_END_ELEMENT);
 2944|  1.68k|	    return(XML_READER_TYPE_ELEMENT);
 2945|    276|        case XML_NAMESPACE_DECL:
  ------------------
  |  Branch (2945:9): [True: 276, False: 6.89k]
  ------------------
 2946|    528|        case XML_ATTRIBUTE_NODE:
  ------------------
  |  Branch (2946:9): [True: 252, False: 6.91k]
  ------------------
 2947|    528|	    return(XML_READER_TYPE_ATTRIBUTE);
 2948|  2.02k|        case XML_TEXT_NODE:
  ------------------
  |  Branch (2948:9): [True: 2.02k, False: 5.13k]
  ------------------
 2949|  2.02k|	    if (xmlIsBlankNode(reader->node)) {
  ------------------
  |  Branch (2949:10): [True: 1.05k, False: 974]
  ------------------
 2950|  1.05k|		if (xmlNodeGetSpacePreserve(reader->node))
  ------------------
  |  Branch (2950:7): [True: 1.05k, False: 0]
  ------------------
 2951|  1.05k|		    return(XML_READER_TYPE_SIGNIFICANT_WHITESPACE);
 2952|      0|		else
 2953|      0|		    return(XML_READER_TYPE_WHITESPACE);
 2954|  1.05k|	    } else {
 2955|    974|		return(XML_READER_TYPE_TEXT);
 2956|    974|	    }
 2957|    256|        case XML_CDATA_SECTION_NODE:
  ------------------
  |  Branch (2957:9): [True: 256, False: 6.91k]
  ------------------
 2958|    256|	    return(XML_READER_TYPE_CDATA);
 2959|    221|        case XML_ENTITY_REF_NODE:
  ------------------
  |  Branch (2959:9): [True: 221, False: 6.94k]
  ------------------
 2960|    221|	    return(XML_READER_TYPE_ENTITY_REFERENCE);
 2961|      0|        case XML_ENTITY_NODE:
  ------------------
  |  Branch (2961:9): [True: 0, False: 7.16k]
  ------------------
 2962|      0|	    return(XML_READER_TYPE_ENTITY);
 2963|    270|        case XML_PI_NODE:
  ------------------
  |  Branch (2963:9): [True: 270, False: 6.89k]
  ------------------
 2964|    270|	    return(XML_READER_TYPE_PROCESSING_INSTRUCTION);
 2965|    266|        case XML_COMMENT_NODE:
  ------------------
  |  Branch (2965:9): [True: 266, False: 6.90k]
  ------------------
 2966|    266|	    return(XML_READER_TYPE_COMMENT);
 2967|    377|        case XML_DOCUMENT_NODE:
  ------------------
  |  Branch (2967:9): [True: 377, False: 6.79k]
  ------------------
 2968|    377|        case XML_HTML_DOCUMENT_NODE:
  ------------------
  |  Branch (2968:9): [True: 0, False: 7.16k]
  ------------------
 2969|    377|	    return(XML_READER_TYPE_DOCUMENT);
 2970|      0|        case XML_DOCUMENT_FRAG_NODE:
  ------------------
  |  Branch (2970:9): [True: 0, False: 7.16k]
  ------------------
 2971|      0|	    return(XML_READER_TYPE_DOCUMENT_FRAGMENT);
 2972|      0|        case XML_NOTATION_NODE:
  ------------------
  |  Branch (2972:9): [True: 0, False: 7.16k]
  ------------------
 2973|      0|	    return(XML_READER_TYPE_NOTATION);
 2974|      0|        case XML_DOCUMENT_TYPE_NODE:
  ------------------
  |  Branch (2974:9): [True: 0, False: 7.16k]
  ------------------
 2975|    343|        case XML_DTD_NODE:
  ------------------
  |  Branch (2975:9): [True: 343, False: 6.82k]
  ------------------
 2976|    343|	    return(XML_READER_TYPE_DOCUMENT_TYPE);
 2977|       |
 2978|      0|        case XML_ELEMENT_DECL:
  ------------------
  |  Branch (2978:9): [True: 0, False: 7.16k]
  ------------------
 2979|      0|        case XML_ATTRIBUTE_DECL:
  ------------------
  |  Branch (2979:9): [True: 0, False: 7.16k]
  ------------------
 2980|      0|        case XML_ENTITY_DECL:
  ------------------
  |  Branch (2980:9): [True: 0, False: 7.16k]
  ------------------
 2981|    674|        case XML_XINCLUDE_START:
  ------------------
  |  Branch (2981:9): [True: 674, False: 6.49k]
  ------------------
 2982|    674|        case XML_XINCLUDE_END:
  ------------------
  |  Branch (2982:9): [True: 0, False: 7.16k]
  ------------------
 2983|    674|	    return(XML_READER_TYPE_NONE);
 2984|  7.16k|    }
 2985|      0|    return(-1);
 2986|  7.16k|}
xmlTextReaderIsEmptyElement:
 2995|  9.95k|xmlTextReaderIsEmptyElement(xmlTextReader *reader) {
 2996|  9.95k|    if ((reader == NULL) || (reader->node == NULL))
  ------------------
  |  Branch (2996:9): [True: 0, False: 9.95k]
  |  Branch (2996:29): [True: 2.52k, False: 7.43k]
  ------------------
 2997|  2.52k|	return(-1);
 2998|  7.43k|    if (reader->node->type != XML_ELEMENT_NODE)
  ------------------
  |  Branch (2998:9): [True: 4.52k, False: 2.90k]
  ------------------
 2999|  4.52k|	return(0);
 3000|  2.90k|    if (reader->curnode != NULL)
  ------------------
  |  Branch (3000:9): [True: 426, False: 2.48k]
  ------------------
 3001|    426|	return(0);
 3002|  2.48k|    if (reader->node->children != NULL)
  ------------------
  |  Branch (3002:9): [True: 1.66k, False: 822]
  ------------------
 3003|  1.66k|	return(0);
 3004|    822|    if (reader->state == XML_TEXTREADER_END)
  ------------------
  |  Branch (3004:9): [True: 259, False: 563]
  ------------------
 3005|    259|	return(0);
 3006|    563|    if (reader->doc != NULL)
  ------------------
  |  Branch (3006:9): [True: 0, False: 563]
  ------------------
 3007|      0|        return(1);
 3008|    563|#ifdef LIBXML_XINCLUDE_ENABLED
 3009|    563|    if (reader->in_xinclude > 0)
  ------------------
  |  Branch (3009:9): [True: 156, False: 407]
  ------------------
 3010|    156|        return(1);
 3011|    407|#endif
 3012|    407|    return((reader->node->extra & NODE_IS_EMPTY) != 0);
  ------------------
  |  |  169|    407|#define NODE_IS_EMPTY		0x1
  ------------------
 3013|    563|}
xmlTextReaderLocalName:
 3023|  5.43k|xmlTextReaderLocalName(xmlTextReader *reader) {
 3024|  5.43k|    xmlNodePtr node;
 3025|  5.43k|    if ((reader == NULL) || (reader->node == NULL))
  ------------------
  |  Branch (3025:9): [True: 0, False: 5.43k]
  |  Branch (3025:29): [True: 1.86k, False: 3.57k]
  ------------------
 3026|  1.86k|	return(NULL);
 3027|  3.57k|    if (reader->curnode != NULL)
  ------------------
  |  Branch (3027:9): [True: 716, False: 2.85k]
  ------------------
 3028|    716|	node = reader->curnode;
 3029|  2.85k|    else
 3030|  2.85k|	node = reader->node;
 3031|  3.57k|    if (node->type == XML_NAMESPACE_DECL) {
  ------------------
  |  Branch (3031:9): [True: 461, False: 3.11k]
  ------------------
 3032|    461|	xmlNsPtr ns = (xmlNsPtr) node;
 3033|    461|	if (ns->prefix == NULL)
  ------------------
  |  Branch (3033:6): [True: 206, False: 255]
  ------------------
 3034|    206|	    return(readerStrdup(reader, BAD_CAST "xmlns"));
  ------------------
  |  |   34|    206|#define BAD_CAST (xmlChar *)
  ------------------
 3035|    255|	else
 3036|    255|	    return(readerStrdup(reader, ns->prefix));
 3037|    461|    }
 3038|  3.11k|    if ((node->type != XML_ELEMENT_NODE) &&
  ------------------
  |  Branch (3038:9): [True: 1.90k, False: 1.20k]
  ------------------
 3039|  1.90k|	(node->type != XML_ATTRIBUTE_NODE))
  ------------------
  |  Branch (3039:2): [True: 1.67k, False: 232]
  ------------------
 3040|  1.67k|	return(xmlTextReaderName(reader));
 3041|  1.44k|    return(readerStrdup(reader, node->name));
 3042|  3.11k|}
xmlTextReaderConstLocalName:
 3052|  40.2k|xmlTextReaderConstLocalName(xmlTextReader *reader) {
 3053|  40.2k|    xmlNodePtr node;
 3054|  40.2k|    if ((reader == NULL) || (reader->node == NULL))
  ------------------
  |  Branch (3054:9): [True: 0, False: 40.2k]
  |  Branch (3054:29): [True: 14.5k, False: 25.7k]
  ------------------
 3055|  14.5k|	return(NULL);
 3056|  25.7k|    if (reader->curnode != NULL)
  ------------------
  |  Branch (3056:9): [True: 4.17k, False: 21.5k]
  ------------------
 3057|  4.17k|	node = reader->curnode;
 3058|  21.5k|    else
 3059|  21.5k|	node = reader->node;
 3060|  25.7k|    if (node->type == XML_NAMESPACE_DECL) {
  ------------------
  |  Branch (3060:9): [True: 2.61k, False: 23.1k]
  ------------------
 3061|  2.61k|	xmlNsPtr ns = (xmlNsPtr) node;
 3062|  2.61k|	if (ns->prefix == NULL)
  ------------------
  |  Branch (3062:6): [True: 799, False: 1.81k]
  ------------------
 3063|    799|	    return(constString(reader, BAD_CAST "xmlns"));
  ------------------
  |  |   34|    799|#define BAD_CAST (xmlChar *)
  ------------------
 3064|  1.81k|	else
 3065|  1.81k|	    return(ns->prefix);
 3066|  2.61k|    }
 3067|  23.1k|    if ((node->type != XML_ELEMENT_NODE) &&
  ------------------
  |  Branch (3067:9): [True: 11.7k, False: 11.3k]
  ------------------
 3068|  11.7k|	(node->type != XML_ATTRIBUTE_NODE))
  ------------------
  |  Branch (3068:2): [True: 10.6k, False: 1.16k]
  ------------------
 3069|  10.6k|	return(xmlTextReaderConstName(reader));
 3070|  12.4k|    return(node->name);
 3071|  23.1k|}
xmlTextReaderName:
 3081|  7.44k|xmlTextReaderName(xmlTextReader *reader) {
 3082|  7.44k|    xmlNodePtr node;
 3083|  7.44k|    xmlChar *ret;
 3084|       |
 3085|  7.44k|    if ((reader == NULL) || (reader->node == NULL))
  ------------------
  |  Branch (3085:9): [True: 0, False: 7.44k]
  |  Branch (3085:29): [True: 1.48k, False: 5.95k]
  ------------------
 3086|  1.48k|	return(NULL);
 3087|  5.95k|    if (reader->curnode != NULL)
  ------------------
  |  Branch (3087:9): [True: 784, False: 5.17k]
  ------------------
 3088|    784|	node = reader->curnode;
 3089|  5.17k|    else
 3090|  5.17k|	node = reader->node;
 3091|  5.95k|    switch (node->type) {
  ------------------
  |  Branch (3091:13): [True: 5.95k, False: 0]
  ------------------
 3092|  1.57k|        case XML_ELEMENT_NODE:
  ------------------
  |  Branch (3092:9): [True: 1.57k, False: 4.38k]
  ------------------
 3093|  1.81k|        case XML_ATTRIBUTE_NODE:
  ------------------
  |  Branch (3093:9): [True: 242, False: 5.71k]
  ------------------
 3094|  1.81k|	    if ((node->ns == NULL) ||
  ------------------
  |  Branch (3094:10): [True: 1.19k, False: 622]
  ------------------
 3095|    622|		(node->ns->prefix == NULL))
  ------------------
  |  Branch (3095:3): [True: 288, False: 334]
  ------------------
 3096|  1.48k|		return(readerStrdup(reader, node->name));
 3097|       |
 3098|    334|            ret = xmlBuildQName(node->name, node->ns->prefix, NULL, 0);
 3099|    334|            if (ret == NULL)
  ------------------
  |  Branch (3099:17): [True: 1, False: 333]
  ------------------
 3100|      1|                xmlTextReaderErrMemory(reader);
 3101|    334|	    return(ret);
 3102|    860|        case XML_TEXT_NODE:
  ------------------
  |  Branch (3102:9): [True: 860, False: 5.09k]
  ------------------
 3103|    860|	    return(readerStrdup(reader, BAD_CAST "#text"));
  ------------------
  |  |   34|    860|#define BAD_CAST (xmlChar *)
  ------------------
 3104|    215|        case XML_CDATA_SECTION_NODE:
  ------------------
  |  Branch (3104:9): [True: 215, False: 5.74k]
  ------------------
 3105|    215|	    return(readerStrdup(reader, BAD_CAST "#cdata-section"));
  ------------------
  |  |   34|    215|#define BAD_CAST (xmlChar *)
  ------------------
 3106|      0|        case XML_ENTITY_NODE:
  ------------------
  |  Branch (3106:9): [True: 0, False: 5.95k]
  ------------------
 3107|    275|        case XML_ENTITY_REF_NODE:
  ------------------
  |  Branch (3107:9): [True: 275, False: 5.68k]
  ------------------
 3108|    275|	    return(readerStrdup(reader, node->name));
 3109|    545|        case XML_PI_NODE:
  ------------------
  |  Branch (3109:9): [True: 545, False: 5.41k]
  ------------------
 3110|    545|	    return(readerStrdup(reader, node->name));
 3111|    280|        case XML_COMMENT_NODE:
  ------------------
  |  Branch (3111:9): [True: 280, False: 5.67k]
  ------------------
 3112|    280|	    return(readerStrdup(reader, BAD_CAST "#comment"));
  ------------------
  |  |   34|    280|#define BAD_CAST (xmlChar *)
  ------------------
 3113|    336|        case XML_DOCUMENT_NODE:
  ------------------
  |  Branch (3113:9): [True: 336, False: 5.62k]
  ------------------
 3114|    336|        case XML_HTML_DOCUMENT_NODE:
  ------------------
  |  Branch (3114:9): [True: 0, False: 5.95k]
  ------------------
 3115|    336|	    return(readerStrdup(reader, BAD_CAST "#document"));
  ------------------
  |  |   34|    336|#define BAD_CAST (xmlChar *)
  ------------------
 3116|      0|        case XML_DOCUMENT_FRAG_NODE:
  ------------------
  |  Branch (3116:9): [True: 0, False: 5.95k]
  ------------------
 3117|      0|	    return(readerStrdup(reader, BAD_CAST "#document-fragment"));
  ------------------
  |  |   34|      0|#define BAD_CAST (xmlChar *)
  ------------------
 3118|      0|        case XML_NOTATION_NODE:
  ------------------
  |  Branch (3118:9): [True: 0, False: 5.95k]
  ------------------
 3119|      0|	    return(readerStrdup(reader, node->name));
 3120|      0|        case XML_DOCUMENT_TYPE_NODE:
  ------------------
  |  Branch (3120:9): [True: 0, False: 5.95k]
  ------------------
 3121|    582|        case XML_DTD_NODE:
  ------------------
  |  Branch (3121:9): [True: 582, False: 5.37k]
  ------------------
 3122|    582|	    return(readerStrdup(reader, node->name));
 3123|    445|        case XML_NAMESPACE_DECL: {
  ------------------
  |  Branch (3123:9): [True: 445, False: 5.51k]
  ------------------
 3124|    445|	    xmlNsPtr ns = (xmlNsPtr) node;
 3125|       |
 3126|    445|	    if (ns->prefix == NULL)
  ------------------
  |  Branch (3126:10): [True: 217, False: 228]
  ------------------
 3127|    217|		return(readerStrdup(reader, BAD_CAST "xmlns"));
  ------------------
  |  |   34|    217|#define BAD_CAST (xmlChar *)
  ------------------
 3128|    228|            ret = xmlBuildQName(ns->prefix, BAD_CAST "xmlns", NULL, 0);
  ------------------
  |  |   34|    228|#define BAD_CAST (xmlChar *)
  ------------------
 3129|    228|            if (ret == NULL)
  ------------------
  |  Branch (3129:17): [True: 2, False: 226]
  ------------------
 3130|      2|                xmlTextReaderErrMemory(reader);
 3131|    228|	    return(ret);
 3132|    445|	}
 3133|       |
 3134|      0|        case XML_ELEMENT_DECL:
  ------------------
  |  Branch (3134:9): [True: 0, False: 5.95k]
  ------------------
 3135|      0|        case XML_ATTRIBUTE_DECL:
  ------------------
  |  Branch (3135:9): [True: 0, False: 5.95k]
  ------------------
 3136|      0|        case XML_ENTITY_DECL:
  ------------------
  |  Branch (3136:9): [True: 0, False: 5.95k]
  ------------------
 3137|    601|        case XML_XINCLUDE_START:
  ------------------
  |  Branch (3137:9): [True: 601, False: 5.35k]
  ------------------
 3138|    601|        case XML_XINCLUDE_END:
  ------------------
  |  Branch (3138:9): [True: 0, False: 5.95k]
  ------------------
 3139|    601|	    return(NULL);
 3140|  5.95k|    }
 3141|      0|    return(NULL);
 3142|  5.95k|}
xmlTextReaderConstName:
 3152|  53.8k|xmlTextReaderConstName(xmlTextReader *reader) {
 3153|  53.8k|    xmlNodePtr node;
 3154|       |
 3155|  53.8k|    if ((reader == NULL) || (reader->node == NULL))
  ------------------
  |  Branch (3155:9): [True: 0, False: 53.8k]
  |  Branch (3155:29): [True: 15.4k, False: 38.4k]
  ------------------
 3156|  15.4k|	return(NULL);
 3157|  38.4k|    if (reader->curnode != NULL)
  ------------------
  |  Branch (3157:9): [True: 3.17k, False: 35.2k]
  ------------------
 3158|  3.17k|	node = reader->curnode;
 3159|  35.2k|    else
 3160|  35.2k|	node = reader->node;
 3161|  38.4k|    switch (node->type) {
  ------------------
  |  Branch (3161:13): [True: 38.4k, False: 0]
  ------------------
 3162|  14.3k|        case XML_ELEMENT_NODE:
  ------------------
  |  Branch (3162:9): [True: 14.3k, False: 24.0k]
  ------------------
 3163|  15.2k|        case XML_ATTRIBUTE_NODE:
  ------------------
  |  Branch (3163:9): [True: 872, False: 37.5k]
  ------------------
 3164|  15.2k|	    if ((node->ns == NULL) ||
  ------------------
  |  Branch (3164:10): [True: 12.3k, False: 2.92k]
  ------------------
 3165|  2.92k|		(node->ns->prefix == NULL))
  ------------------
  |  Branch (3165:3): [True: 736, False: 2.19k]
  ------------------
 3166|  13.0k|		return(node->name);
 3167|  2.19k|	    return(constQString(reader, node->ns->prefix, node->name));
 3168|  7.50k|        case XML_TEXT_NODE:
  ------------------
  |  Branch (3168:9): [True: 7.50k, False: 30.9k]
  ------------------
 3169|  7.50k|	    return(constString(reader, BAD_CAST "#text"));
  ------------------
  |  |   34|  7.50k|#define BAD_CAST (xmlChar *)
  ------------------
 3170|    452|        case XML_CDATA_SECTION_NODE:
  ------------------
  |  Branch (3170:9): [True: 452, False: 37.9k]
  ------------------
 3171|    452|	    return(constString(reader, BAD_CAST "#cdata-section"));
  ------------------
  |  |   34|    452|#define BAD_CAST (xmlChar *)
  ------------------
 3172|      0|        case XML_ENTITY_NODE:
  ------------------
  |  Branch (3172:9): [True: 0, False: 38.4k]
  ------------------
 3173|    341|        case XML_ENTITY_REF_NODE:
  ------------------
  |  Branch (3173:9): [True: 341, False: 38.0k]
  ------------------
 3174|    341|	    return(constString(reader, node->name));
 3175|  1.67k|        case XML_PI_NODE:
  ------------------
  |  Branch (3175:9): [True: 1.67k, False: 36.7k]
  ------------------
 3176|  1.67k|	    return(constString(reader, node->name));
 3177|    929|        case XML_COMMENT_NODE:
  ------------------
  |  Branch (3177:9): [True: 929, False: 37.4k]
  ------------------
 3178|    929|	    return(constString(reader, BAD_CAST "#comment"));
  ------------------
  |  |   34|    929|#define BAD_CAST (xmlChar *)
  ------------------
 3179|  3.90k|        case XML_DOCUMENT_NODE:
  ------------------
  |  Branch (3179:9): [True: 3.90k, False: 34.5k]
  ------------------
 3180|  3.90k|        case XML_HTML_DOCUMENT_NODE:
  ------------------
  |  Branch (3180:9): [True: 0, False: 38.4k]
  ------------------
 3181|  3.90k|	    return(constString(reader, BAD_CAST "#document"));
  ------------------
  |  |   34|  3.90k|#define BAD_CAST (xmlChar *)
  ------------------
 3182|      0|        case XML_DOCUMENT_FRAG_NODE:
  ------------------
  |  Branch (3182:9): [True: 0, False: 38.4k]
  ------------------
 3183|      0|	    return(constString(reader, BAD_CAST "#document-fragment"));
  ------------------
  |  |   34|      0|#define BAD_CAST (xmlChar *)
  ------------------
 3184|      0|        case XML_NOTATION_NODE:
  ------------------
  |  Branch (3184:9): [True: 0, False: 38.4k]
  ------------------
 3185|      0|	    return(constString(reader, node->name));
 3186|      0|        case XML_DOCUMENT_TYPE_NODE:
  ------------------
  |  Branch (3186:9): [True: 0, False: 38.4k]
  ------------------
 3187|  1.71k|        case XML_DTD_NODE:
  ------------------
  |  Branch (3187:9): [True: 1.71k, False: 36.6k]
  ------------------
 3188|  1.71k|	    return(constString(reader, node->name));
 3189|  1.45k|        case XML_NAMESPACE_DECL: {
  ------------------
  |  Branch (3189:9): [True: 1.45k, False: 36.9k]
  ------------------
 3190|  1.45k|	    xmlNsPtr ns = (xmlNsPtr) node;
 3191|       |
 3192|  1.45k|	    if (ns->prefix == NULL)
  ------------------
  |  Branch (3192:10): [True: 508, False: 945]
  ------------------
 3193|    508|		return(constString(reader, BAD_CAST "xmlns"));
  ------------------
  |  |   34|    508|#define BAD_CAST (xmlChar *)
  ------------------
 3194|    945|	    return(constQString(reader, BAD_CAST "xmlns", ns->prefix));
  ------------------
  |  |   34|    945|#define BAD_CAST (xmlChar *)
  ------------------
 3195|  1.45k|	}
 3196|       |
 3197|      0|        case XML_ELEMENT_DECL:
  ------------------
  |  Branch (3197:9): [True: 0, False: 38.4k]
  ------------------
 3198|      0|        case XML_ATTRIBUTE_DECL:
  ------------------
  |  Branch (3198:9): [True: 0, False: 38.4k]
  ------------------
 3199|      0|        case XML_ENTITY_DECL:
  ------------------
  |  Branch (3199:9): [True: 0, False: 38.4k]
  ------------------
 3200|  5.19k|        case XML_XINCLUDE_START:
  ------------------
  |  Branch (3200:9): [True: 5.19k, False: 33.2k]
  ------------------
 3201|  5.19k|        case XML_XINCLUDE_END:
  ------------------
  |  Branch (3201:9): [True: 0, False: 38.4k]
  ------------------
 3202|  5.19k|	    return(NULL);
 3203|  38.4k|    }
 3204|      0|    return(NULL);
 3205|  38.4k|}
xmlTextReaderPrefix:
 3215|  4.43k|xmlTextReaderPrefix(xmlTextReader *reader) {
 3216|  4.43k|    xmlNodePtr node;
 3217|  4.43k|    if ((reader == NULL) || (reader->node == NULL))
  ------------------
  |  Branch (3217:9): [True: 0, False: 4.43k]
  |  Branch (3217:29): [True: 1.67k, False: 2.76k]
  ------------------
 3218|  1.67k|	return(NULL);
 3219|  2.76k|    if (reader->curnode != NULL)
  ------------------
  |  Branch (3219:9): [True: 733, False: 2.02k]
  ------------------
 3220|    733|	node = reader->curnode;
 3221|  2.02k|    else
 3222|  2.02k|	node = reader->node;
 3223|  2.76k|    if (node->type == XML_NAMESPACE_DECL) {
  ------------------
  |  Branch (3223:9): [True: 455, False: 2.30k]
  ------------------
 3224|    455|	xmlNsPtr ns = (xmlNsPtr) node;
 3225|    455|	if (ns->prefix == NULL)
  ------------------
  |  Branch (3225:6): [True: 202, False: 253]
  ------------------
 3226|    202|	    return(NULL);
 3227|    253|	return(readerStrdup(reader, BAD_CAST "xmlns"));
  ------------------
  |  |   34|    253|#define BAD_CAST (xmlChar *)
  ------------------
 3228|    455|    }
 3229|  2.30k|    if ((node->type != XML_ELEMENT_NODE) &&
  ------------------
  |  Branch (3229:9): [True: 1.02k, False: 1.27k]
  ------------------
 3230|  1.02k|	(node->type != XML_ATTRIBUTE_NODE))
  ------------------
  |  Branch (3230:2): [True: 782, False: 245]
  ------------------
 3231|    782|	return(NULL);
 3232|  1.52k|    if ((node->ns != NULL) && (node->ns->prefix != NULL))
  ------------------
  |  Branch (3232:9): [True: 588, False: 935]
  |  Branch (3232:31): [True: 359, False: 229]
  ------------------
 3233|    359|	return(readerStrdup(reader, node->ns->prefix));
 3234|  1.16k|    return(NULL);
 3235|  1.52k|}
xmlTextReaderConstPrefix:
 3245|  19.6k|xmlTextReaderConstPrefix(xmlTextReader *reader) {
 3246|  19.6k|    xmlNodePtr node;
 3247|  19.6k|    if ((reader == NULL) || (reader->node == NULL))
  ------------------
  |  Branch (3247:9): [True: 0, False: 19.6k]
  |  Branch (3247:29): [True: 6.66k, False: 13.0k]
  ------------------
 3248|  6.66k|	return(NULL);
 3249|  13.0k|    if (reader->curnode != NULL)
  ------------------
  |  Branch (3249:9): [True: 2.13k, False: 10.8k]
  ------------------
 3250|  2.13k|	node = reader->curnode;
 3251|  10.8k|    else
 3252|  10.8k|	node = reader->node;
 3253|  13.0k|    if (node->type == XML_NAMESPACE_DECL) {
  ------------------
  |  Branch (3253:9): [True: 1.16k, False: 11.8k]
  ------------------
 3254|  1.16k|	xmlNsPtr ns = (xmlNsPtr) node;
 3255|  1.16k|	if (ns->prefix == NULL)
  ------------------
  |  Branch (3255:6): [True: 402, False: 762]
  ------------------
 3256|    402|	    return(NULL);
 3257|    762|	return(constString(reader, BAD_CAST "xmlns"));
  ------------------
  |  |   34|    762|#define BAD_CAST (xmlChar *)
  ------------------
 3258|  1.16k|    }
 3259|  11.8k|    if ((node->type != XML_ELEMENT_NODE) &&
  ------------------
  |  Branch (3259:9): [True: 5.72k, False: 6.11k]
  ------------------
 3260|  5.72k|	(node->type != XML_ATTRIBUTE_NODE))
  ------------------
  |  Branch (3260:2): [True: 4.99k, False: 729]
  ------------------
 3261|  4.99k|	return(NULL);
 3262|  6.84k|    if ((node->ns != NULL) && (node->ns->prefix != NULL))
  ------------------
  |  Branch (3262:9): [True: 1.66k, False: 5.18k]
  |  Branch (3262:31): [True: 1.12k, False: 532]
  ------------------
 3263|  1.12k|	return(constString(reader, node->ns->prefix));
 3264|  5.71k|    return(NULL);
 3265|  6.84k|}
xmlTextReaderNamespaceUri:
 3275|  3.23k|xmlTextReaderNamespaceUri(xmlTextReader *reader) {
 3276|  3.23k|    xmlNodePtr node;
 3277|  3.23k|    if ((reader == NULL) || (reader->node == NULL))
  ------------------
  |  Branch (3277:9): [True: 0, False: 3.23k]
  |  Branch (3277:29): [True: 1.52k, False: 1.71k]
  ------------------
 3278|  1.52k|	return(NULL);
 3279|  1.71k|    if (reader->curnode != NULL)
  ------------------
  |  Branch (3279:9): [True: 677, False: 1.03k]
  ------------------
 3280|    677|	node = reader->curnode;
 3281|  1.03k|    else
 3282|  1.03k|	node = reader->node;
 3283|  1.71k|    if (node->type == XML_NAMESPACE_DECL)
  ------------------
  |  Branch (3283:9): [True: 227, False: 1.48k]
  ------------------
 3284|    227|	return(readerStrdup(reader, BAD_CAST "http://www.w3.org/2000/xmlns/"));
  ------------------
  |  |   34|    227|#define BAD_CAST (xmlChar *)
  ------------------
 3285|  1.48k|    if ((node->type != XML_ELEMENT_NODE) &&
  ------------------
  |  Branch (3285:9): [True: 733, False: 752]
  ------------------
 3286|    733|	(node->type != XML_ATTRIBUTE_NODE))
  ------------------
  |  Branch (3286:2): [True: 475, False: 258]
  ------------------
 3287|    475|	return(NULL);
 3288|  1.01k|    if (node->ns != NULL)
  ------------------
  |  Branch (3288:9): [True: 250, False: 760]
  ------------------
 3289|    250|	return(readerStrdup(reader, node->ns->href));
 3290|    760|    return(NULL);
 3291|  1.01k|}
xmlTextReaderConstNamespaceUri:
 3301|  43.6k|xmlTextReaderConstNamespaceUri(xmlTextReader *reader) {
 3302|  43.6k|    xmlNodePtr node;
 3303|  43.6k|    if ((reader == NULL) || (reader->node == NULL))
  ------------------
  |  Branch (3303:9): [True: 0, False: 43.6k]
  |  Branch (3303:29): [True: 15.8k, False: 27.8k]
  ------------------
 3304|  15.8k|	return(NULL);
 3305|  27.8k|    if (reader->curnode != NULL)
  ------------------
  |  Branch (3305:9): [True: 4.49k, False: 23.3k]
  ------------------
 3306|  4.49k|	node = reader->curnode;
 3307|  23.3k|    else
 3308|  23.3k|	node = reader->node;
 3309|  27.8k|    if (node->type == XML_NAMESPACE_DECL)
  ------------------
  |  Branch (3309:9): [True: 2.68k, False: 25.1k]
  ------------------
 3310|  2.68k|	return(constString(reader, BAD_CAST "http://www.w3.org/2000/xmlns/"));
  ------------------
  |  |   34|  2.68k|#define BAD_CAST (xmlChar *)
  ------------------
 3311|  25.1k|    if ((node->type != XML_ELEMENT_NODE) &&
  ------------------
  |  Branch (3311:9): [True: 12.9k, False: 12.2k]
  ------------------
 3312|  12.9k|	(node->type != XML_ATTRIBUTE_NODE))
  ------------------
  |  Branch (3312:2): [True: 11.5k, False: 1.37k]
  ------------------
 3313|  11.5k|	return(NULL);
 3314|  13.6k|    if (node->ns != NULL)
  ------------------
  |  Branch (3314:9): [True: 4.85k, False: 8.75k]
  ------------------
 3315|  4.85k|	return(constString(reader, node->ns->href));
 3316|  8.75k|    return(NULL);
 3317|  13.6k|}
xmlTextReaderBaseUri:
 3327|  8.49k|xmlTextReaderBaseUri(xmlTextReader *reader) {
 3328|  8.49k|    xmlChar *ret = NULL;
 3329|  8.49k|    int result;
 3330|       |
 3331|  8.49k|    if ((reader == NULL) || (reader->node == NULL))
  ------------------
  |  Branch (3331:9): [True: 0, False: 8.49k]
  |  Branch (3331:29): [True: 1.49k, False: 6.99k]
  ------------------
 3332|  1.49k|	return(NULL);
 3333|  6.99k|    result = xmlNodeGetBaseSafe(NULL, reader->node, &ret);
 3334|  6.99k|    if (result < 0)
  ------------------
  |  Branch (3334:9): [True: 132, False: 6.86k]
  ------------------
 3335|    132|        xmlTextReaderErrMemory(reader);
 3336|       |
 3337|  6.99k|    return(ret);
 3338|  8.49k|}
xmlTextReaderConstBaseUri:
 3348|  45.5k|xmlTextReaderConstBaseUri(xmlTextReader *reader) {
 3349|  45.5k|    xmlChar *tmp;
 3350|  45.5k|    const xmlChar *ret;
 3351|  45.5k|    int result;
 3352|       |
 3353|  45.5k|    if ((reader == NULL) || (reader->node == NULL))
  ------------------
  |  Branch (3353:9): [True: 0, False: 45.5k]
  |  Branch (3353:29): [True: 3.67k, False: 41.8k]
  ------------------
 3354|  3.67k|	return(NULL);
 3355|  41.8k|    result = xmlNodeGetBaseSafe(NULL, reader->node, &tmp);
 3356|  41.8k|    if (result < 0)
  ------------------
  |  Branch (3356:9): [True: 750, False: 41.1k]
  ------------------
 3357|    750|        xmlTextReaderErrMemory(reader);
 3358|  41.8k|    if (tmp == NULL)
  ------------------
  |  Branch (3358:9): [True: 14.6k, False: 27.2k]
  ------------------
 3359|  14.6k|        return(NULL);
 3360|  27.2k|    ret = constString(reader, tmp);
 3361|  27.2k|    xmlFree(tmp);
 3362|  27.2k|    return(ret);
 3363|  41.8k|}
xmlTextReaderDepth:
 3372|  3.69k|xmlTextReaderDepth(xmlTextReader *reader) {
 3373|  3.69k|    if (reader == NULL)
  ------------------
  |  Branch (3373:9): [True: 0, False: 3.69k]
  ------------------
 3374|      0|	return(-1);
 3375|  3.69k|    if (reader->node == NULL)
  ------------------
  |  Branch (3375:9): [True: 1.16k, False: 2.53k]
  ------------------
 3376|  1.16k|	return(0);
 3377|       |
 3378|  2.53k|    if (reader->curnode != NULL) {
  ------------------
  |  Branch (3378:9): [True: 797, False: 1.74k]
  ------------------
 3379|    797|	if ((reader->curnode->type == XML_ATTRIBUTE_NODE) ||
  ------------------
  |  Branch (3379:6): [True: 261, False: 536]
  ------------------
 3380|    536|	    (reader->curnode->type == XML_NAMESPACE_DECL))
  ------------------
  |  Branch (3380:6): [True: 300, False: 236]
  ------------------
 3381|    561|	    return(reader->depth + 1);
 3382|    236|	return(reader->depth + 2);
 3383|    797|    }
 3384|  1.74k|    return(reader->depth);
 3385|  2.53k|}
xmlTextReaderHasAttributes:
 3394|  3.45k|xmlTextReaderHasAttributes(xmlTextReader *reader) {
 3395|  3.45k|    xmlNodePtr node;
 3396|  3.45k|    if (reader == NULL)
  ------------------
  |  Branch (3396:9): [True: 0, False: 3.45k]
  ------------------
 3397|      0|	return(-1);
 3398|  3.45k|    if (reader->node == NULL)
  ------------------
  |  Branch (3398:9): [True: 1.10k, False: 2.35k]
  ------------------
 3399|  1.10k|	return(0);
 3400|  2.35k|    if (reader->curnode != NULL)
  ------------------
  |  Branch (3400:9): [True: 270, False: 2.08k]
  ------------------
 3401|    270|	node = reader->curnode;
 3402|  2.08k|    else
 3403|  2.08k|	node = reader->node;
 3404|       |
 3405|  2.35k|    if ((node->type == XML_ELEMENT_NODE) &&
  ------------------
  |  Branch (3405:9): [True: 1.43k, False: 913]
  ------------------
 3406|  1.43k|	((node->properties != NULL) || (node->nsDef != NULL)))
  ------------------
  |  Branch (3406:3): [True: 372, False: 1.06k]
  |  Branch (3406:33): [True: 392, False: 674]
  ------------------
 3407|    764|	return(1);
 3408|       |    /* TODO: handle the xmlDecl */
 3409|  1.58k|    return(0);
 3410|  2.35k|}
xmlTextReaderHasValue:
 3419|  11.5k|xmlTextReaderHasValue(xmlTextReader *reader) {
 3420|  11.5k|    xmlNodePtr node;
 3421|  11.5k|    if (reader == NULL)
  ------------------
  |  Branch (3421:9): [True: 0, False: 11.5k]
  ------------------
 3422|      0|	return(-1);
 3423|  11.5k|    if (reader->node == NULL)
  ------------------
  |  Branch (3423:9): [True: 4.57k, False: 6.99k]
  ------------------
 3424|  4.57k|	return(0);
 3425|  6.99k|    if (reader->curnode != NULL)
  ------------------
  |  Branch (3425:9): [True: 924, False: 6.07k]
  ------------------
 3426|    924|	node = reader->curnode;
 3427|  6.07k|    else
 3428|  6.07k|	node = reader->node;
 3429|       |
 3430|  6.99k|    switch (node->type) {
 3431|    357|        case XML_ATTRIBUTE_NODE:
  ------------------
  |  Branch (3431:9): [True: 357, False: 6.63k]
  ------------------
 3432|  1.46k|        case XML_TEXT_NODE:
  ------------------
  |  Branch (3432:9): [True: 1.11k, False: 5.88k]
  ------------------
 3433|  1.70k|        case XML_CDATA_SECTION_NODE:
  ------------------
  |  Branch (3433:9): [True: 242, False: 6.75k]
  ------------------
 3434|  2.00k|        case XML_PI_NODE:
  ------------------
  |  Branch (3434:9): [True: 296, False: 6.69k]
  ------------------
 3435|  2.33k|        case XML_COMMENT_NODE:
  ------------------
  |  Branch (3435:9): [True: 332, False: 6.66k]
  ------------------
 3436|  2.72k|        case XML_NAMESPACE_DECL:
  ------------------
  |  Branch (3436:9): [True: 385, False: 6.61k]
  ------------------
 3437|  2.72k|	    return(1);
 3438|  4.27k|	default:
  ------------------
  |  Branch (3438:2): [True: 4.27k, False: 2.72k]
  ------------------
 3439|  4.27k|	    break;
 3440|  6.99k|    }
 3441|  4.27k|    return(0);
 3442|  6.99k|}
xmlTextReaderValue:
 3452|  9.16k|xmlTextReaderValue(xmlTextReader *reader) {
 3453|  9.16k|    xmlNodePtr node;
 3454|  9.16k|    if (reader == NULL)
  ------------------
  |  Branch (3454:9): [True: 0, False: 9.16k]
  ------------------
 3455|      0|	return(NULL);
 3456|  9.16k|    if (reader->node == NULL)
  ------------------
  |  Branch (3456:9): [True: 2.41k, False: 6.75k]
  ------------------
 3457|  2.41k|	return(NULL);
 3458|  6.75k|    if (reader->curnode != NULL)
  ------------------
  |  Branch (3458:9): [True: 1.94k, False: 4.81k]
  ------------------
 3459|  1.94k|	node = reader->curnode;
 3460|  4.81k|    else
 3461|  4.81k|	node = reader->node;
 3462|       |
 3463|  6.75k|    switch (node->type) {
 3464|    584|        case XML_NAMESPACE_DECL:
  ------------------
  |  Branch (3464:9): [True: 584, False: 6.17k]
  ------------------
 3465|    584|	    return(readerStrdup(reader, ((xmlNsPtr) node)->href));
 3466|  1.13k|        case XML_ATTRIBUTE_NODE:{
  ------------------
  |  Branch (3466:9): [True: 1.13k, False: 5.62k]
  ------------------
 3467|  1.13k|	    xmlAttrPtr attr = (xmlAttrPtr) node;
 3468|  1.13k|            xmlDocPtr doc = NULL;
 3469|  1.13k|            xmlChar *ret;
 3470|       |
 3471|  1.13k|            if (attr->children == NULL)
  ------------------
  |  Branch (3471:17): [True: 229, False: 910]
  ------------------
 3472|    229|                return(NULL);
 3473|    910|	    if (attr->parent != NULL)
  ------------------
  |  Branch (3473:10): [True: 910, False: 0]
  ------------------
 3474|    910|                doc = attr->parent->doc;
 3475|    910|	    ret = xmlNodeListGetString(doc, attr->children, 1);
 3476|    910|            if (ret == NULL)
  ------------------
  |  Branch (3476:17): [True: 8, False: 902]
  ------------------
 3477|      8|                xmlTextReaderErrMemory(reader);
 3478|    910|	    return(ret);
 3479|  1.13k|	}
 3480|  1.17k|        case XML_TEXT_NODE:
  ------------------
  |  Branch (3480:9): [True: 1.17k, False: 5.58k]
  ------------------
 3481|  1.41k|        case XML_CDATA_SECTION_NODE:
  ------------------
  |  Branch (3481:9): [True: 238, False: 6.52k]
  ------------------
 3482|  1.81k|        case XML_PI_NODE:
  ------------------
  |  Branch (3482:9): [True: 395, False: 6.36k]
  ------------------
 3483|  2.10k|        case XML_COMMENT_NODE:
  ------------------
  |  Branch (3483:9): [True: 290, False: 6.46k]
  ------------------
 3484|  2.10k|            return(readerStrdup(reader, node->content));
 3485|  2.93k|	default:
  ------------------
  |  Branch (3485:2): [True: 2.93k, False: 3.82k]
  ------------------
 3486|  2.93k|	    break;
 3487|  6.75k|    }
 3488|  2.93k|    return(NULL);
 3489|  6.75k|}
xmlTextReaderConstValue:
 3499|  6.02k|xmlTextReaderConstValue(xmlTextReader *reader) {
 3500|  6.02k|    xmlNodePtr node;
 3501|  6.02k|    if (reader == NULL)
  ------------------
  |  Branch (3501:9): [True: 0, False: 6.02k]
  ------------------
 3502|      0|	return(NULL);
 3503|  6.02k|    if (reader->node == NULL)
  ------------------
  |  Branch (3503:9): [True: 1.42k, False: 4.60k]
  ------------------
 3504|  1.42k|	return(NULL);
 3505|  4.60k|    if (reader->curnode != NULL)
  ------------------
  |  Branch (3505:9): [True: 1.60k, False: 2.99k]
  ------------------
 3506|  1.60k|	node = reader->curnode;
 3507|  2.99k|    else
 3508|  2.99k|	node = reader->node;
 3509|       |
 3510|  4.60k|    switch (node->type) {
 3511|    394|        case XML_NAMESPACE_DECL:
  ------------------
  |  Branch (3511:9): [True: 394, False: 4.21k]
  ------------------
 3512|    394|	    return(((xmlNsPtr) node)->href);
 3513|  1.13k|        case XML_ATTRIBUTE_NODE:{
  ------------------
  |  Branch (3513:9): [True: 1.13k, False: 3.47k]
  ------------------
 3514|  1.13k|	    xmlAttrPtr attr = (xmlAttrPtr) node;
 3515|  1.13k|	    const xmlChar *ret;
 3516|       |
 3517|  1.13k|	    if ((attr->children != NULL) &&
  ------------------
  |  Branch (3517:10): [True: 927, False: 207]
  ------------------
 3518|    927|	        (attr->children->type == XML_TEXT_NODE) &&
  ------------------
  |  Branch (3518:10): [True: 594, False: 333]
  ------------------
 3519|    594|		(attr->children->next == NULL))
  ------------------
  |  Branch (3519:3): [True: 319, False: 275]
  ------------------
 3520|    319|		return(attr->children->content);
 3521|    815|	    else {
 3522|    815|		if (reader->buffer == NULL) {
  ------------------
  |  Branch (3522:7): [True: 0, False: 815]
  ------------------
 3523|      0|		    reader->buffer = xmlBufCreate(50);
 3524|      0|                    if (reader->buffer == NULL)
  ------------------
  |  Branch (3524:25): [True: 0, False: 0]
  ------------------
 3525|      0|                        return (NULL);
 3526|      0|                } else
 3527|    815|                    xmlBufEmpty(reader->buffer);
 3528|    815|	        xmlBufGetNodeContent(reader->buffer, node);
 3529|    815|		ret = xmlBufContent(reader->buffer);
 3530|    815|		if (ret == NULL) {
  ------------------
  |  Branch (3530:7): [True: 1, False: 814]
  ------------------
 3531|      1|                    xmlTextReaderErrMemory(reader);
 3532|       |		    /* error on the buffer best to reallocate */
 3533|      1|		    xmlBufFree(reader->buffer);
 3534|      1|		    reader->buffer = xmlBufCreate(50);
 3535|      1|		}
 3536|    815|		return(ret);
 3537|    815|	    }
 3538|      0|	    break;
 3539|  1.13k|	}
 3540|    952|        case XML_TEXT_NODE:
  ------------------
  |  Branch (3540:9): [True: 952, False: 3.65k]
  ------------------
 3541|  1.23k|        case XML_CDATA_SECTION_NODE:
  ------------------
  |  Branch (3541:9): [True: 278, False: 4.33k]
  ------------------
 3542|  1.47k|        case XML_PI_NODE:
  ------------------
  |  Branch (3542:9): [True: 246, False: 4.36k]
  ------------------
 3543|  1.68k|        case XML_COMMENT_NODE:
  ------------------
  |  Branch (3543:9): [True: 207, False: 4.40k]
  ------------------
 3544|  1.68k|	    return(node->content);
 3545|  1.39k|	default:
  ------------------
  |  Branch (3545:2): [True: 1.39k, False: 3.21k]
  ------------------
 3546|  1.39k|	    break;
 3547|  4.60k|    }
 3548|  1.39k|    return(NULL);
 3549|  4.60k|}
xmlTextReaderIsDefault:
 3559|  6.56k|xmlTextReaderIsDefault(xmlTextReader *reader) {
 3560|  6.56k|    if (reader == NULL)
  ------------------
  |  Branch (3560:9): [True: 0, False: 6.56k]
  ------------------
 3561|      0|	return(-1);
 3562|  6.56k|    return(0);
 3563|  6.56k|}
xmlTextReaderQuoteChar:
 3572|  3.69k|xmlTextReaderQuoteChar(xmlTextReader *reader) {
 3573|  3.69k|    if (reader == NULL)
  ------------------
  |  Branch (3573:9): [True: 0, False: 3.69k]
  ------------------
 3574|      0|	return(-1);
 3575|       |    /* TODO maybe lookup the attribute value for " first */
 3576|  3.69k|    return('"');
 3577|  3.69k|}
xmlTextReaderXmlLang:
 3587|  3.27k|xmlTextReaderXmlLang(xmlTextReader *reader) {
 3588|  3.27k|    if (reader == NULL)
  ------------------
  |  Branch (3588:9): [True: 0, False: 3.27k]
  ------------------
 3589|      0|	return(NULL);
 3590|  3.27k|    if (reader->node == NULL)
  ------------------
  |  Branch (3590:9): [True: 1.21k, False: 2.06k]
  ------------------
 3591|  1.21k|	return(NULL);
 3592|  2.06k|    return(xmlNodeGetLang(reader->node));
 3593|  3.27k|}
xmlTextReaderConstXmlLang:
 3602|  7.09k|xmlTextReaderConstXmlLang(xmlTextReader *reader) {
 3603|  7.09k|    xmlChar *tmp;
 3604|  7.09k|    const xmlChar *ret;
 3605|       |
 3606|  7.09k|    if (reader == NULL)
  ------------------
  |  Branch (3606:9): [True: 0, False: 7.09k]
  ------------------
 3607|      0|	return(NULL);
 3608|  7.09k|    if (reader->node == NULL)
  ------------------
  |  Branch (3608:9): [True: 3.10k, False: 3.99k]
  ------------------
 3609|  3.10k|	return(NULL);
 3610|  3.99k|    tmp = xmlNodeGetLang(reader->node);
 3611|  3.99k|    if (tmp == NULL)
  ------------------
  |  Branch (3611:9): [True: 3.74k, False: 256]
  ------------------
 3612|  3.74k|        return(NULL);
 3613|    256|    ret = constString(reader, tmp);
 3614|    256|    xmlFree(tmp);
 3615|    256|    return(ret);
 3616|  3.99k|}
xmlTextReaderNormalization:
 3645|  1.85k|xmlTextReaderNormalization(xmlTextReader *reader) {
 3646|  1.85k|    if (reader == NULL)
  ------------------
  |  Branch (3646:9): [True: 0, False: 1.85k]
  ------------------
 3647|      0|	return(-1);
 3648|  1.85k|    return(1);
 3649|  1.85k|}
xmlTextReaderGetParserProp:
 3730|  7.83k|xmlTextReaderGetParserProp(xmlTextReader *reader, int prop) {
 3731|  7.83k|    xmlParserProperties p = (xmlParserProperties) prop;
 3732|  7.83k|    xmlParserCtxtPtr ctxt;
 3733|       |
 3734|  7.83k|    if ((reader == NULL) || (reader->ctxt == NULL))
  ------------------
  |  Branch (3734:9): [True: 0, False: 7.83k]
  |  Branch (3734:29): [True: 0, False: 7.83k]
  ------------------
 3735|      0|	return(-1);
 3736|  7.83k|    ctxt = reader->ctxt;
 3737|       |
 3738|  7.83k|    switch (p) {
  ------------------
  |  Branch (3738:13): [True: 1.66k, False: 6.17k]
  ------------------
 3739|    668|        case XML_PARSER_LOADDTD:
  ------------------
  |  Branch (3739:9): [True: 668, False: 7.16k]
  ------------------
 3740|    668|	    if ((ctxt->loadsubset != 0) || (ctxt->validate != 0))
  ------------------
  |  Branch (3740:10): [True: 263, False: 405]
  |  Branch (3740:37): [True: 198, False: 207]
  ------------------
 3741|    461|		return(1);
 3742|    207|	    return(0);
 3743|    392|        case XML_PARSER_DEFAULTATTRS:
  ------------------
  |  Branch (3743:9): [True: 392, False: 7.43k]
  ------------------
 3744|    392|	    if (ctxt->loadsubset & XML_COMPLETE_ATTRS)
  ------------------
  |  |  209|    392|#define XML_COMPLETE_ATTRS	4
  ------------------
  |  Branch (3744:10): [True: 195, False: 197]
  ------------------
 3745|    195|		return(1);
 3746|    197|	    return(0);
 3747|    316|        case XML_PARSER_VALIDATE:
  ------------------
  |  Branch (3747:9): [True: 316, False: 7.51k]
  ------------------
 3748|    316|	    return(reader->validate);
 3749|    284|	case XML_PARSER_SUBST_ENTITIES:
  ------------------
  |  Branch (3749:2): [True: 284, False: 7.54k]
  ------------------
 3750|    284|	    return(ctxt->replaceEntities);
 3751|  7.83k|    }
 3752|  6.17k|    return(-1);
 3753|  7.83k|}
xmlTextReaderGetParserLineNumber:
 3764|  5.57k|{
 3765|  5.57k|    if ((reader == NULL) || (reader->ctxt == NULL) ||
  ------------------
  |  Branch (3765:9): [True: 0, False: 5.57k]
  |  Branch (3765:29): [True: 0, False: 5.57k]
  ------------------
 3766|  5.57k|        (reader->ctxt->input == NULL)) {
  ------------------
  |  Branch (3766:9): [True: 0, False: 5.57k]
  ------------------
 3767|      0|        return (0);
 3768|      0|    }
 3769|  5.57k|    return (reader->ctxt->input->line);
 3770|  5.57k|}
xmlTextReaderGetParserColumnNumber:
 3780|  8.91k|{
 3781|  8.91k|    if ((reader == NULL) || (reader->ctxt == NULL) ||
  ------------------
  |  Branch (3781:9): [True: 0, False: 8.91k]
  |  Branch (3781:29): [True: 0, False: 8.91k]
  ------------------
 3782|  8.91k|        (reader->ctxt->input == NULL)) {
  ------------------
  |  Branch (3782:9): [True: 0, False: 8.91k]
  ------------------
 3783|      0|        return (0);
 3784|      0|    }
 3785|  8.91k|    return (reader->ctxt->input->col);
 3786|  8.91k|}
xmlTextReaderCurrentNode:
 3797|  12.0k|xmlTextReaderCurrentNode(xmlTextReader *reader) {
 3798|  12.0k|    if (reader == NULL)
  ------------------
  |  Branch (3798:9): [True: 0, False: 12.0k]
  ------------------
 3799|      0|	return(NULL);
 3800|       |
 3801|  12.0k|    if (reader->curnode != NULL)
  ------------------
  |  Branch (3801:9): [True: 967, False: 11.1k]
  ------------------
 3802|    967|	return(reader->curnode);
 3803|  11.1k|    return(reader->node);
 3804|  12.0k|}
xmlTextReaderPreserve:
 3815|  7.44k|xmlTextReaderPreserve(xmlTextReader *reader) {
 3816|  7.44k|    xmlNodePtr cur, parent;
 3817|       |
 3818|  7.44k|    if (reader == NULL)
  ------------------
  |  Branch (3818:9): [True: 0, False: 7.44k]
  ------------------
 3819|      0|	return(NULL);
 3820|       |
 3821|  7.44k|    cur = reader->node;
 3822|  7.44k|    if (cur == NULL)
  ------------------
  |  Branch (3822:9): [True: 2.89k, False: 4.55k]
  ------------------
 3823|  2.89k|        return(NULL);
 3824|       |
 3825|  4.55k|    if ((cur->type != XML_DOCUMENT_NODE) && (cur->type != XML_DTD_NODE)) {
  ------------------
  |  Branch (3825:9): [True: 4.15k, False: 405]
  |  Branch (3825:45): [True: 3.74k, False: 406]
  ------------------
 3826|  3.74k|	cur->extra |= NODE_IS_PRESERVED;
  ------------------
  |  |  170|  3.74k|#define NODE_IS_PRESERVED	0x2
  ------------------
 3827|  3.74k|	cur->extra |= NODE_IS_SPRESERVED;
  ------------------
  |  |  171|  3.74k|#define NODE_IS_SPRESERVED	0x4
  ------------------
 3828|  3.74k|    }
 3829|  4.55k|    reader->preserves++;
 3830|       |
 3831|  4.55k|    parent = cur->parent;;
 3832|  1.13M|    while (parent != NULL) {
  ------------------
  |  Branch (3832:12): [True: 1.13M, False: 4.55k]
  ------------------
 3833|  1.13M|        if (parent->type == XML_ELEMENT_NODE)
  ------------------
  |  Branch (3833:13): [True: 1.12M, False: 4.17k]
  ------------------
 3834|  1.12M|	    parent->extra |= NODE_IS_PRESERVED;
  ------------------
  |  |  170|  1.12M|#define NODE_IS_PRESERVED	0x2
  ------------------
 3835|  1.13M|	parent = parent->parent;
 3836|  1.13M|    }
 3837|  4.55k|    return(cur);
 3838|  7.44k|}
xmlTextReaderCurrentDoc:
 3898|  8.99k|xmlTextReaderCurrentDoc(xmlTextReader *reader) {
 3899|  8.99k|    if (reader == NULL)
  ------------------
  |  Branch (3899:9): [True: 0, False: 8.99k]
  ------------------
 3900|      0|	return(NULL);
 3901|  8.99k|    if (reader->doc != NULL)
  ------------------
  |  Branch (3901:9): [True: 0, False: 8.99k]
  ------------------
 3902|      0|        return(reader->doc);
 3903|  8.99k|    if ((reader->ctxt == NULL) || (reader->ctxt->myDoc == NULL))
  ------------------
  |  Branch (3903:9): [True: 0, False: 8.99k]
  |  Branch (3903:35): [True: 1.75k, False: 7.24k]
  ------------------
 3904|  1.75k|	return(NULL);
 3905|       |
 3906|  7.24k|    reader->preserve = 1;
 3907|  7.24k|    return(reader->ctxt->myDoc);
 3908|  8.99k|}
xmlTextReaderIsNamespaceDecl:
 4381|  3.57k|xmlTextReaderIsNamespaceDecl(xmlTextReader *reader) {
 4382|  3.57k|    xmlNodePtr node;
 4383|  3.57k|    if (reader == NULL)
  ------------------
  |  Branch (4383:9): [True: 0, False: 3.57k]
  ------------------
 4384|      0|	return(-1);
 4385|  3.57k|    if (reader->node == NULL)
  ------------------
  |  Branch (4385:9): [True: 1.44k, False: 2.13k]
  ------------------
 4386|  1.44k|	return(-1);
 4387|  2.13k|    if (reader->curnode != NULL)
  ------------------
  |  Branch (4387:9): [True: 584, False: 1.54k]
  ------------------
 4388|    584|	node = reader->curnode;
 4389|  1.54k|    else
 4390|  1.54k|	node = reader->node;
 4391|       |
 4392|  2.13k|    if (XML_NAMESPACE_DECL == node->type)
  ------------------
  |  Branch (4392:9): [True: 296, False: 1.83k]
  ------------------
 4393|    296|	return(1);
 4394|  1.83k|    else
 4395|  1.83k|	return(0);
 4396|  2.13k|}
xmlTextReaderConstXmlVersion:
 4406|  3.92k|xmlTextReaderConstXmlVersion(xmlTextReader *reader) {
 4407|  3.92k|    xmlDocPtr doc = NULL;
 4408|  3.92k|    if (reader == NULL)
  ------------------
  |  Branch (4408:9): [True: 0, False: 3.92k]
  ------------------
 4409|      0|	return(NULL);
 4410|  3.92k|    if (reader->doc != NULL)
  ------------------
  |  Branch (4410:9): [True: 0, False: 3.92k]
  ------------------
 4411|      0|        doc = reader->doc;
 4412|  3.92k|    else if (reader->ctxt != NULL)
  ------------------
  |  Branch (4412:14): [True: 3.92k, False: 0]
  ------------------
 4413|  3.92k|	doc = reader->ctxt->myDoc;
 4414|  3.92k|    if (doc == NULL)
  ------------------
  |  Branch (4414:9): [True: 722, False: 3.20k]
  ------------------
 4415|    722|	return(NULL);
 4416|       |
 4417|  3.20k|    if (doc->version == NULL)
  ------------------
  |  Branch (4417:9): [True: 0, False: 3.20k]
  ------------------
 4418|      0|	return(NULL);
 4419|  3.20k|    else
 4420|  3.20k|      return(constString(reader, doc->version));
 4421|  3.20k|}
xmlTextReaderStandalone:
 4432|  3.94k|xmlTextReaderStandalone(xmlTextReader *reader) {
 4433|  3.94k|    xmlDocPtr doc = NULL;
 4434|  3.94k|    if (reader == NULL)
  ------------------
  |  Branch (4434:9): [True: 0, False: 3.94k]
  ------------------
 4435|      0|	return(-1);
 4436|  3.94k|    if (reader->doc != NULL)
  ------------------
  |  Branch (4436:9): [True: 0, False: 3.94k]
  ------------------
 4437|      0|        doc = reader->doc;
 4438|  3.94k|    else if (reader->ctxt != NULL)
  ------------------
  |  Branch (4438:14): [True: 3.94k, False: 0]
  ------------------
 4439|  3.94k|	doc = reader->ctxt->myDoc;
 4440|  3.94k|    if (doc == NULL)
  ------------------
  |  Branch (4440:9): [True: 1.03k, False: 2.91k]
  ------------------
 4441|  1.03k|	return(-1);
 4442|       |
 4443|  2.91k|    return(doc->standalone);
 4444|  3.94k|}
xmlTextReaderSetStructuredErrorHandler:
 4592|  36.4k|{
 4593|  36.4k|    if (reader == NULL)
  ------------------
  |  Branch (4593:9): [True: 0, False: 36.4k]
  ------------------
 4594|      0|        return;
 4595|       |
 4596|  36.4k|    if (f != NULL) {
  ------------------
  |  Branch (4596:9): [True: 36.4k, False: 0]
  ------------------
 4597|  36.4k|        reader->sErrorFunc = f;
 4598|  36.4k|        reader->errorFunc = NULL;
 4599|  36.4k|        reader->errorFuncArg = arg;
 4600|  36.4k|        xmlCtxtSetErrorHandler(reader->ctxt,
 4601|  36.4k|                xmlTextReaderStructuredRelay, reader);
 4602|  36.4k|#ifdef LIBXML_RELAXNG_ENABLED
 4603|  36.4k|        if (reader->rngValidCtxt) {
  ------------------
  |  Branch (4603:13): [True: 0, False: 36.4k]
  ------------------
 4604|      0|            xmlRelaxNGSetValidStructuredErrors(reader->rngValidCtxt,
 4605|      0|                    xmlTextReaderStructuredRelay, reader);
 4606|      0|        }
 4607|  36.4k|#endif
 4608|  36.4k|#ifdef LIBXML_SCHEMAS_ENABLED
 4609|  36.4k|        if (reader->xsdValidCtxt) {
  ------------------
  |  Branch (4609:13): [True: 0, False: 36.4k]
  ------------------
 4610|      0|            xmlSchemaSetValidStructuredErrors(reader->xsdValidCtxt,
 4611|      0|                    xmlTextReaderStructuredRelay, reader);
 4612|      0|        }
 4613|  36.4k|#endif
 4614|  36.4k|    } else {
 4615|       |        /* restore defaults */
 4616|      0|        reader->errorFunc = NULL;
 4617|      0|        reader->sErrorFunc = NULL;
 4618|      0|        reader->errorFuncArg = NULL;
 4619|      0|        xmlCtxtSetErrorHandler(reader->ctxt, NULL, NULL);
 4620|      0|#ifdef LIBXML_RELAXNG_ENABLED
 4621|      0|        if (reader->rngValidCtxt) {
  ------------------
  |  Branch (4621:13): [True: 0, False: 0]
  ------------------
 4622|      0|            xmlRelaxNGSetValidStructuredErrors(reader->rngValidCtxt, NULL,
 4623|      0|                                               NULL);
 4624|      0|        }
 4625|      0|#endif
 4626|      0|#ifdef LIBXML_SCHEMAS_ENABLED
 4627|      0|        if (reader->xsdValidCtxt) {
  ------------------
  |  Branch (4627:13): [True: 0, False: 0]
  ------------------
 4628|      0|            xmlSchemaSetValidStructuredErrors(reader->xsdValidCtxt, NULL,
 4629|       |                                              NULL);
 4630|      0|        }
 4631|      0|#endif
 4632|      0|    }
 4633|  36.4k|}
xmlTextReaderSetResourceLoader:
 4663|  36.4k|                               xmlResourceLoader loader, void *data) {
 4664|  36.4k|    if ((reader == NULL) || (reader->ctxt == NULL))
  ------------------
  |  Branch (4664:9): [True: 0, False: 36.4k]
  |  Branch (4664:29): [True: 0, False: 36.4k]
  ------------------
 4665|      0|        return;
 4666|       |
 4667|  36.4k|    reader->resourceLoader = loader;
 4668|  36.4k|    reader->resourceCtxt = data;
 4669|       |
 4670|  36.4k|    xmlCtxtSetResourceLoader(reader->ctxt, loader, data);
 4671|  36.4k|}
xmlTextReaderIsValid:
 4681|  3.53k|{
 4682|  3.53k|    if (reader == NULL)
  ------------------
  |  Branch (4682:9): [True: 0, False: 3.53k]
  ------------------
 4683|      0|        return (-1);
 4684|  3.53k|#ifdef LIBXML_RELAXNG_ENABLED
 4685|  3.53k|    if (reader->validate == XML_TEXTREADER_VALIDATE_RNG)
  ------------------
  |  Branch (4685:9): [True: 0, False: 3.53k]
  ------------------
 4686|      0|        return (reader->rngValidErrors == 0);
 4687|  3.53k|#endif
 4688|  3.53k|#ifdef LIBXML_SCHEMAS_ENABLED
 4689|  3.53k|    if (reader->validate == XML_TEXTREADER_VALIDATE_XSD)
  ------------------
  |  Branch (4689:9): [True: 0, False: 3.53k]
  ------------------
 4690|      0|        return (reader->xsdValidErrors == 0);
 4691|  3.53k|#endif
 4692|  3.53k|    if ((reader->ctxt != NULL) && (reader->ctxt->validate == 1))
  ------------------
  |  Branch (4692:9): [True: 3.53k, False: 0]
  |  Branch (4692:35): [True: 1.24k, False: 2.29k]
  ------------------
 4693|  1.24k|        return (reader->ctxt->valid);
 4694|  2.29k|    return (0);
 4695|  3.53k|}
xmlTextReaderSetup:
 4718|  36.4k|{
 4719|  36.4k|    if (reader == NULL) {
  ------------------
  |  Branch (4719:9): [True: 0, False: 36.4k]
  ------------------
 4720|      0|        if (input != NULL)
  ------------------
  |  Branch (4720:13): [True: 0, False: 0]
  ------------------
 4721|      0|	    xmlFreeParserInputBuffer(input);
 4722|      0|        return (-1);
 4723|      0|    }
 4724|       |
 4725|       |    /*
 4726|       |     * we force the generation of compact text nodes on the reader
 4727|       |     * since usr applications should never modify the tree
 4728|       |     */
 4729|  36.4k|    options |= XML_PARSE_COMPACT;
 4730|       |
 4731|  36.4k|    reader->doc = NULL;
 4732|  36.4k|    reader->entNr = 0;
 4733|  36.4k|    reader->parserFlags = options;
 4734|  36.4k|    reader->validate = XML_TEXTREADER_NOT_VALIDATE;
 4735|  36.4k|    if ((input != NULL) && (reader->input != NULL) &&
  ------------------
  |  Branch (4735:9): [True: 0, False: 36.4k]
  |  Branch (4735:28): [True: 0, False: 0]
  ------------------
 4736|      0|        (reader->allocs & XML_TEXTREADER_INPUT)) {
  ------------------
  |  |   77|      0|#define XML_TEXTREADER_INPUT	1
  ------------------
  |  Branch (4736:9): [True: 0, False: 0]
  ------------------
 4737|      0|	xmlFreeParserInputBuffer(reader->input);
 4738|      0|	reader->input = NULL;
 4739|      0|	reader->allocs -= XML_TEXTREADER_INPUT;
  ------------------
  |  |   77|      0|#define XML_TEXTREADER_INPUT	1
  ------------------
 4740|      0|    }
 4741|  36.4k|    if (input != NULL) {
  ------------------
  |  Branch (4741:9): [True: 0, False: 36.4k]
  ------------------
 4742|      0|	reader->input = input;
 4743|      0|	reader->allocs |= XML_TEXTREADER_INPUT;
  ------------------
  |  |   77|      0|#define XML_TEXTREADER_INPUT	1
  ------------------
 4744|      0|    }
 4745|  36.4k|    if (reader->buffer == NULL)
  ------------------
  |  Branch (4745:9): [True: 0, False: 36.4k]
  ------------------
 4746|      0|        reader->buffer = xmlBufCreate(50);
 4747|  36.4k|    if (reader->buffer == NULL) {
  ------------------
  |  Branch (4747:9): [True: 0, False: 36.4k]
  ------------------
 4748|      0|        return (-1);
 4749|      0|    }
 4750|  36.4k|    if (reader->sax == NULL)
  ------------------
  |  Branch (4750:9): [True: 0, False: 36.4k]
  ------------------
 4751|      0|	reader->sax = (xmlSAXHandler *) xmlMalloc(sizeof(xmlSAXHandler));
 4752|  36.4k|    if (reader->sax == NULL) {
  ------------------
  |  Branch (4752:9): [True: 0, False: 36.4k]
  ------------------
 4753|      0|        return (-1);
 4754|      0|    }
 4755|  36.4k|    xmlSAXVersion(reader->sax, 2);
 4756|  36.4k|    reader->startElement = reader->sax->startElement;
 4757|  36.4k|    reader->sax->startElement = xmlTextReaderStartElement;
 4758|  36.4k|    reader->endElement = reader->sax->endElement;
 4759|  36.4k|    reader->sax->endElement = xmlTextReaderEndElement;
 4760|  36.4k|#ifdef LIBXML_SAX1_ENABLED
 4761|  36.4k|    if (reader->sax->initialized == XML_SAX2_MAGIC) {
  ------------------
  |  |  953|  36.4k|#define XML_SAX2_MAGIC 0xDEEDBEAF
  ------------------
  |  Branch (4761:9): [True: 36.4k, False: 0]
  ------------------
 4762|  36.4k|#endif /* LIBXML_SAX1_ENABLED */
 4763|  36.4k|        reader->startElementNs = reader->sax->startElementNs;
 4764|  36.4k|        reader->sax->startElementNs = xmlTextReaderStartElementNs;
 4765|  36.4k|        reader->endElementNs = reader->sax->endElementNs;
 4766|  36.4k|        reader->sax->endElementNs = xmlTextReaderEndElementNs;
 4767|  36.4k|#ifdef LIBXML_SAX1_ENABLED
 4768|  36.4k|    } else {
 4769|      0|        reader->startElementNs = NULL;
 4770|      0|        reader->endElementNs = NULL;
 4771|      0|    }
 4772|  36.4k|#endif /* LIBXML_SAX1_ENABLED */
 4773|  36.4k|    reader->characters = reader->sax->characters;
 4774|  36.4k|    reader->sax->characters = xmlTextReaderCharacters;
 4775|  36.4k|    reader->sax->ignorableWhitespace = xmlTextReaderCharacters;
 4776|  36.4k|    reader->cdataBlock = reader->sax->cdataBlock;
 4777|  36.4k|    reader->sax->cdataBlock = xmlTextReaderCDataBlock;
 4778|       |
 4779|  36.4k|    reader->mode = XML_TEXTREADER_MODE_INITIAL;
 4780|  36.4k|    reader->node = NULL;
 4781|  36.4k|    reader->curnode = NULL;
 4782|  36.4k|    if (input != NULL) {
  ------------------
  |  Branch (4782:9): [True: 0, False: 36.4k]
  ------------------
 4783|      0|        if (xmlBufUse(reader->input->buffer) < 4) {
  ------------------
  |  Branch (4783:13): [True: 0, False: 0]
  ------------------
 4784|      0|            xmlParserInputBufferRead(input, 4);
 4785|      0|        }
 4786|      0|        if (reader->ctxt == NULL) {
  ------------------
  |  Branch (4786:13): [True: 0, False: 0]
  ------------------
 4787|      0|            if (xmlBufUse(reader->input->buffer) >= 4) {
  ------------------
  |  Branch (4787:17): [True: 0, False: 0]
  ------------------
 4788|      0|                reader->ctxt = xmlCreatePushParserCtxt(reader->sax, NULL,
 4789|      0|		       (const char *) xmlBufContent(reader->input->buffer),
 4790|      0|                                      4, URL);
 4791|      0|                reader->base = 0;
 4792|      0|                reader->cur = 4;
 4793|      0|            } else {
 4794|      0|                reader->ctxt =
 4795|      0|                    xmlCreatePushParserCtxt(reader->sax, NULL, NULL, 0, URL);
 4796|      0|                reader->base = 0;
 4797|      0|                reader->cur = 0;
 4798|      0|            }
 4799|      0|            if (reader->ctxt == NULL) {
  ------------------
  |  Branch (4799:17): [True: 0, False: 0]
  ------------------
 4800|      0|                return (-1);
 4801|      0|            }
 4802|      0|        } else {
 4803|      0|	    xmlParserInputPtr inputStream;
 4804|      0|	    xmlParserInputBufferPtr buf;
 4805|       |
 4806|      0|	    xmlCtxtReset(reader->ctxt);
 4807|      0|	    buf = xmlAllocParserInputBuffer(XML_CHAR_ENCODING_NONE);
 4808|      0|	    if (buf == NULL) return(-1);
  ------------------
  |  Branch (4808:10): [True: 0, False: 0]
  ------------------
 4809|      0|	    inputStream = xmlNewInputStream(reader->ctxt);
 4810|      0|	    if (inputStream == NULL) {
  ------------------
  |  Branch (4810:10): [True: 0, False: 0]
  ------------------
 4811|      0|		xmlFreeParserInputBuffer(buf);
 4812|      0|		return(-1);
 4813|      0|	    }
 4814|       |
 4815|      0|	    if (URL == NULL)
  ------------------
  |  Branch (4815:10): [True: 0, False: 0]
  ------------------
 4816|      0|		inputStream->filename = NULL;
 4817|      0|	    else
 4818|      0|		inputStream->filename = (char *)
 4819|      0|		    xmlCanonicPath((const xmlChar *) URL);
 4820|      0|	    inputStream->buf = buf;
 4821|      0|            xmlBufResetInput(buf->buffer, inputStream);
 4822|       |
 4823|      0|            if (xmlCtxtPushInput(reader->ctxt, inputStream) < 0) {
  ------------------
  |  Branch (4823:17): [True: 0, False: 0]
  ------------------
 4824|      0|                xmlFreeInputStream(inputStream);
 4825|      0|                return(-1);
 4826|      0|            }
 4827|      0|	    reader->cur = 0;
 4828|      0|	}
 4829|      0|    }
 4830|  36.4k|    if (reader->dict != NULL) {
  ------------------
  |  Branch (4830:9): [True: 36.4k, False: 0]
  ------------------
 4831|  36.4k|        if (reader->ctxt->dict != NULL) {
  ------------------
  |  Branch (4831:13): [True: 36.4k, False: 0]
  ------------------
 4832|  36.4k|	    if (reader->dict != reader->ctxt->dict) {
  ------------------
  |  Branch (4832:10): [True: 0, False: 36.4k]
  ------------------
 4833|      0|		xmlDictFree(reader->dict);
 4834|      0|		reader->dict = reader->ctxt->dict;
 4835|      0|	    }
 4836|  36.4k|	} else {
 4837|      0|	    reader->ctxt->dict = reader->dict;
 4838|      0|	}
 4839|  36.4k|    } else {
 4840|      0|	if (reader->ctxt->dict == NULL)
  ------------------
  |  Branch (4840:6): [True: 0, False: 0]
  ------------------
 4841|      0|	    reader->ctxt->dict = xmlDictCreate();
 4842|      0|        reader->dict = reader->ctxt->dict;
 4843|      0|    }
 4844|  36.4k|    reader->ctxt->_private = reader;
 4845|  36.4k|    reader->ctxt->dictNames = 1;
 4846|       |    /*
 4847|       |     * use the parser dictionary to allocate all elements and attributes names
 4848|       |     */
 4849|  36.4k|    reader->ctxt->parseMode = XML_PARSE_READER;
 4850|       |
 4851|  36.4k|#ifdef LIBXML_XINCLUDE_ENABLED
 4852|  36.4k|    if (reader->xincctxt != NULL) {
  ------------------
  |  Branch (4852:9): [True: 0, False: 36.4k]
  ------------------
 4853|      0|	xmlXIncludeFreeContext(reader->xincctxt);
 4854|      0|	reader->xincctxt = NULL;
 4855|      0|    }
 4856|  36.4k|    if (options & XML_PARSE_XINCLUDE) {
  ------------------
  |  Branch (4856:9): [True: 20.8k, False: 15.5k]
  ------------------
 4857|  20.8k|        reader->xinclude = 1;
 4858|  20.8k|	options -= XML_PARSE_XINCLUDE;
 4859|  20.8k|    } else
 4860|  15.5k|        reader->xinclude = 0;
 4861|  36.4k|    reader->in_xinclude = 0;
 4862|  36.4k|#endif
 4863|  36.4k|#ifdef LIBXML_PATTERN_ENABLED
 4864|  36.4k|    if (reader->patternTab == NULL) {
  ------------------
  |  Branch (4864:9): [True: 36.4k, False: 0]
  ------------------
 4865|  36.4k|        reader->patternNr = 0;
 4866|  36.4k|	reader->patternMax = 0;
 4867|  36.4k|    }
 4868|  36.4k|    while (reader->patternNr > 0) {
  ------------------
  |  Branch (4868:12): [True: 0, False: 36.4k]
  ------------------
 4869|      0|        reader->patternNr--;
 4870|      0|	if (reader->patternTab[reader->patternNr] != NULL) {
  ------------------
  |  Branch (4870:6): [True: 0, False: 0]
  ------------------
 4871|      0|	    xmlFreePattern(reader->patternTab[reader->patternNr]);
 4872|      0|            reader->patternTab[reader->patternNr] = NULL;
 4873|      0|	}
 4874|      0|    }
 4875|  36.4k|#endif
 4876|       |
 4877|  36.4k|    if (options & XML_PARSE_DTDVALID)
  ------------------
  |  Branch (4877:9): [True: 17.2k, False: 19.1k]
  ------------------
 4878|  17.2k|        reader->validate = XML_TEXTREADER_VALIDATE_DTD;
 4879|       |
 4880|  36.4k|    xmlCtxtUseOptions(reader->ctxt, options);
 4881|  36.4k|    if (encoding != NULL)
  ------------------
  |  Branch (4881:9): [True: 0, False: 36.4k]
  ------------------
 4882|      0|        xmlSwitchEncodingName(reader->ctxt, encoding);
 4883|  36.4k|    if ((URL != NULL) && (reader->ctxt->input != NULL) &&
  ------------------
  |  Branch (4883:9): [True: 0, False: 36.4k]
  |  Branch (4883:26): [True: 0, False: 0]
  ------------------
 4884|      0|        (reader->ctxt->input->filename == NULL)) {
  ------------------
  |  Branch (4884:9): [True: 0, False: 0]
  ------------------
 4885|      0|        reader->ctxt->input->filename = (char *)
 4886|      0|            xmlStrdup((const xmlChar *) URL);
 4887|      0|        if (reader->ctxt->input->filename == NULL)
  ------------------
  |  Branch (4887:13): [True: 0, False: 0]
  ------------------
 4888|      0|            return(-1);
 4889|      0|    }
 4890|       |
 4891|  36.4k|    reader->doc = NULL;
 4892|       |
 4893|  36.4k|    return (0);
 4894|  36.4k|}
xmlTextReaderGetLastError:
 4918|  36.4k|{
 4919|  36.4k|    if ((reader == NULL) || (reader->ctxt == NULL))
  ------------------
  |  Branch (4919:9): [True: 0, False: 36.4k]
  |  Branch (4919:29): [True: 0, False: 36.4k]
  ------------------
 4920|      0|        return(NULL);
 4921|  36.4k|    return(&reader->ctxt->lastError);
 4922|  36.4k|}
xmlTextReaderByteConsumed:
 4940|  5.60k|xmlTextReaderByteConsumed(xmlTextReader *reader) {
 4941|  5.60k|    xmlParserInputPtr in;
 4942|       |
 4943|  5.60k|    if ((reader == NULL) || (reader->ctxt == NULL))
  ------------------
  |  Branch (4943:9): [True: 0, False: 5.60k]
  |  Branch (4943:29): [True: 0, False: 5.60k]
  ------------------
 4944|      0|        return(-1);
 4945|  5.60k|    in = reader->ctxt->input;
 4946|  5.60k|    if (in == NULL)
  ------------------
  |  Branch (4946:9): [True: 0, False: 5.60k]
  ------------------
 4947|      0|        return(-1);
 4948|  5.60k|    return(in->consumed + (in->cur - in->base));
 4949|  5.60k|}
xmlReaderForMemory:
 5047|  36.4k|{
 5048|  36.4k|    xmlTextReaderPtr reader;
 5049|  36.4k|    xmlParserInputBufferPtr buf;
 5050|       |
 5051|  36.4k|    buf = xmlParserInputBufferCreateMem(buffer, size, XML_CHAR_ENCODING_NONE);
 5052|  36.4k|    if (buf == NULL) {
  ------------------
  |  Branch (5052:9): [True: 14, False: 36.4k]
  ------------------
 5053|     14|        return (NULL);
 5054|     14|    }
 5055|  36.4k|    reader = xmlNewTextReader(buf, URL);
 5056|  36.4k|    if (reader == NULL) {
  ------------------
  |  Branch (5056:9): [True: 52, False: 36.4k]
  ------------------
 5057|     52|        xmlFreeParserInputBuffer(buf);
 5058|     52|        return (NULL);
 5059|     52|    }
 5060|  36.4k|    reader->allocs |= XML_TEXTREADER_INPUT;
  ------------------
  |  |   77|  36.4k|#define XML_TEXTREADER_INPUT	1
  ------------------
 5061|  36.4k|    if (xmlTextReaderSetup(reader, NULL, URL, encoding, options) < 0) {
  ------------------
  |  Branch (5061:9): [True: 0, False: 36.4k]
  ------------------
 5062|      0|        xmlFreeTextReader(reader);
 5063|      0|        return (NULL);
 5064|      0|    }
 5065|  36.4k|    return (reader);
 5066|  36.4k|}
xmlreader.c:xmlTextReaderPushData:
  788|  75.0k|xmlTextReaderPushData(xmlTextReaderPtr reader) {
  789|  75.0k|    xmlBufPtr inbuf;
  790|  75.0k|    int val, s;
  791|  75.0k|    xmlTextReaderState oldstate;
  792|       |
  793|  75.0k|    if ((reader->input == NULL) || (reader->input->buffer == NULL))
  ------------------
  |  Branch (793:9): [True: 0, False: 75.0k]
  |  Branch (793:36): [True: 0, False: 75.0k]
  ------------------
  794|      0|	return(-1);
  795|       |
  796|  75.0k|    oldstate = reader->state;
  797|  75.0k|    reader->state = XML_TEXTREADER_NONE;
  798|  75.0k|    inbuf = reader->input->buffer;
  799|       |
  800|   422k|    while (reader->state == XML_TEXTREADER_NONE) {
  ------------------
  |  Branch (800:12): [True: 414k, False: 7.62k]
  ------------------
  801|   414k|	if (xmlBufUse(inbuf) < reader->cur + CHUNK_SIZE) {
  ------------------
  |  |   69|   414k|#define CHUNK_SIZE 512
  ------------------
  |  Branch (801:6): [True: 65.2k, False: 349k]
  ------------------
  802|       |	    /*
  803|       |	     * Refill the buffer unless we are at the end of the stream
  804|       |	     */
  805|  65.2k|	    if (reader->mode != XML_TEXTREADER_MODE_EOF) {
  ------------------
  |  Branch (805:10): [True: 65.2k, False: 0]
  ------------------
  806|  65.2k|		val = xmlParserInputBufferRead(reader->input, 4096);
  807|  65.2k|		if (val == 0) {
  ------------------
  |  Branch (807:7): [True: 65.2k, False: 0]
  ------------------
  808|  65.2k|		    if (xmlBufUse(inbuf) == reader->cur) {
  ------------------
  |  Branch (808:11): [True: 30.4k, False: 34.7k]
  ------------------
  809|  30.4k|			reader->mode = XML_TEXTREADER_MODE_EOF;
  810|  30.4k|                        break;
  811|  30.4k|		    }
  812|  65.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|  65.2k|	    } else
  820|      0|		break;
  821|  65.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|   384k|	if (xmlBufUse(inbuf) >= reader->cur + CHUNK_SIZE) {
  ------------------
  |  |   69|   384k|#define CHUNK_SIZE 512
  ------------------
  |  Branch (826:6): [True: 349k, False: 34.7k]
  ------------------
  827|   349k|	    val = xmlParseChunk(reader->ctxt,
  828|   349k|                 (const char *) xmlBufContent(inbuf) + reader->cur,
  829|   349k|                                CHUNK_SIZE, 0);
  ------------------
  |  |   69|   349k|#define CHUNK_SIZE 512
  ------------------
  830|   349k|	    reader->cur += CHUNK_SIZE;
  ------------------
  |  |   69|   349k|#define CHUNK_SIZE 512
  ------------------
  831|   349k|	    if (val != 0)
  ------------------
  |  Branch (831:10): [True: 2.15k, False: 347k]
  ------------------
  832|  2.15k|		reader->ctxt->wellFormed = 0;
  833|   349k|	    if (reader->ctxt->wellFormed == 0)
  ------------------
  |  Branch (833:10): [True: 2.15k, False: 347k]
  ------------------
  834|  2.15k|		break;
  835|   349k|	} else {
  836|  34.7k|	    s = xmlBufUse(inbuf) - reader->cur;
  837|  34.7k|	    val = xmlParseChunk(reader->ctxt,
  838|  34.7k|		 (const char *) xmlBufContent(inbuf) + reader->cur,
  839|  34.7k|			        s, 0);
  840|  34.7k|	    reader->cur += s;
  841|  34.7k|	    if (val != 0)
  ------------------
  |  Branch (841:10): [True: 6.00k, False: 28.7k]
  ------------------
  842|  6.00k|		reader->ctxt->wellFormed = 0;
  843|  34.7k|	    break;
  844|  34.7k|	}
  845|   384k|    }
  846|  75.0k|    reader->state = oldstate;
  847|       |
  848|       |    /*
  849|       |     * Discard the consumed input when needed and possible
  850|       |     */
  851|  75.0k|    if (reader->mode == XML_TEXTREADER_MODE_INTERACTIVE) {
  ------------------
  |  Branch (851:9): [True: 42.9k, False: 32.0k]
  ------------------
  852|  42.9k|        if (reader->cur > 80 /* LINE_LEN */) {
  ------------------
  |  Branch (852:13): [True: 27.5k, False: 15.3k]
  ------------------
  853|  27.5k|            val = xmlBufShrink(inbuf, reader->cur - 80);
  854|  27.5k|            if (val >= 0) {
  ------------------
  |  Branch (854:17): [True: 27.5k, False: 0]
  ------------------
  855|  27.5k|                reader->cur -= val;
  856|  27.5k|            }
  857|  27.5k|        }
  858|  42.9k|    }
  859|       |
  860|       |    /*
  861|       |     * At the end of the stream signal that the work is done to the Push
  862|       |     * parser.
  863|       |     */
  864|  32.0k|    else if (reader->mode == XML_TEXTREADER_MODE_EOF) {
  ------------------
  |  Branch (864:14): [True: 30.4k, False: 1.59k]
  ------------------
  865|  30.4k|	if (reader->state != XML_TEXTREADER_DONE) {
  ------------------
  |  Branch (865:6): [True: 30.4k, False: 0]
  ------------------
  866|  30.4k|	    s = xmlBufUse(inbuf) - reader->cur;
  867|  30.4k|	    val = xmlParseChunk(reader->ctxt,
  868|  30.4k|		 (const char *) xmlBufContent(inbuf) + reader->cur,
  869|  30.4k|			        s, 1);
  870|  30.4k|	    reader->cur = xmlBufUse(inbuf);
  871|  30.4k|	    reader->state  = XML_TEXTREADER_DONE;
  872|  30.4k|	    if (val != 0) {
  ------------------
  |  Branch (872:10): [True: 26.2k, False: 4.25k]
  ------------------
  873|  26.2k|	        if (reader->ctxt->wellFormed)
  ------------------
  |  Branch (873:14): [True: 0, False: 26.2k]
  ------------------
  874|      0|		    reader->ctxt->wellFormed = 0;
  875|  26.2k|		else
  876|  26.2k|		    return(-1);
  877|  26.2k|	    }
  878|  30.4k|	}
  879|  30.4k|    }
  880|  48.7k|    if (reader->ctxt->wellFormed == 0) {
  ------------------
  |  Branch (880:9): [True: 8.15k, False: 40.6k]
  ------------------
  881|  8.15k|	reader->mode = XML_TEXTREADER_MODE_EOF;
  882|  8.15k|        return(-1);
  883|  8.15k|    }
  884|       |
  885|  40.6k|    return(0);
  886|  48.7k|}
xmlreader.c:xmlTextReaderValidatePop:
  992|  2.48M|xmlTextReaderValidatePop(xmlTextReaderPtr reader) {
  993|  2.48M|    xmlNodePtr node = reader->node;
  994|       |
  995|  2.48M|#ifdef LIBXML_VALID_ENABLED
  996|  2.48M|    if ((reader->validate == XML_TEXTREADER_VALIDATE_DTD) &&
  ------------------
  |  Branch (996:9): [True: 2.48M, False: 0]
  ------------------
  997|  2.48M|        (reader->ctxt != NULL) && (reader->ctxt->validate == 1)) {
  ------------------
  |  Branch (997:9): [True: 2.48M, False: 0]
  |  Branch (997:35): [True: 101k, False: 2.37M]
  ------------------
  998|   101k|	if ((node->ns == NULL) || (node->ns->prefix == NULL)) {
  ------------------
  |  Branch (998:6): [True: 88.9k, False: 12.3k]
  |  Branch (998:28): [True: 7.74k, False: 4.60k]
  ------------------
  999|  96.6k|	    reader->ctxt->valid &= xmlValidatePopElement(&reader->ctxt->vctxt,
 1000|  96.6k|				    reader->ctxt->myDoc, node, node->name);
 1001|  96.6k|	} else {
 1002|  4.60k|            xmlChar buf[50];
 1003|  4.60k|	    xmlChar *qname;
 1004|       |
 1005|  4.60k|	    qname = xmlBuildQName(node->name, node->ns->prefix, buf, 50);
 1006|  4.60k|            if (qname == NULL) {
  ------------------
  |  Branch (1006:17): [True: 11, False: 4.59k]
  ------------------
 1007|     11|                xmlTextReaderErrMemory(reader);
 1008|     11|                return(-1);
 1009|     11|            }
 1010|  4.59k|	    reader->ctxt->valid &= xmlValidatePopElement(&reader->ctxt->vctxt,
 1011|  4.59k|				    reader->ctxt->myDoc, node, qname);
 1012|  4.59k|            if (qname != buf)
  ------------------
  |  Branch (1012:17): [True: 1.65k, False: 2.94k]
  ------------------
 1013|  1.65k|	        xmlFree(qname);
 1014|  4.59k|	}
 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|   101k|    }
 1021|  2.48M|#endif /* LIBXML_VALID_ENABLED */
 1022|  2.48M|#ifdef LIBXML_RELAXNG_ENABLED
 1023|  2.48M|    if ((reader->validate == XML_TEXTREADER_VALIDATE_RNG) &&
  ------------------
  |  Branch (1023:9): [True: 0, False: 2.48M]
  ------------------
 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|  2.48M|#endif
 1039|       |
 1040|  2.48M|    return(0);
 1041|  2.48M|}
xmlreader.c:xmlTextReaderFreeNode:
  434|   157k|xmlTextReaderFreeNode(xmlTextReaderPtr reader, xmlNodePtr cur) {
  435|   157k|    xmlDictPtr dict;
  436|       |
  437|   157k|    if ((reader != NULL) && (reader->ctxt != NULL))
  ------------------
  |  Branch (437:9): [True: 157k, False: 0]
  |  Branch (437:29): [True: 157k, False: 0]
  ------------------
  438|   157k|	dict = reader->ctxt->dict;
  439|      0|    else
  440|      0|        dict = NULL;
  441|   157k|    if (cur->type == XML_DTD_NODE) {
  ------------------
  |  Branch (441:9): [True: 0, False: 157k]
  ------------------
  442|      0|	xmlFreeDtd((xmlDtdPtr) cur);
  443|      0|	return;
  444|      0|    }
  445|   157k|    if (cur->type == XML_NAMESPACE_DECL) {
  ------------------
  |  Branch (445:9): [True: 0, False: 157k]
  ------------------
  446|      0|	xmlFreeNs((xmlNsPtr) cur);
  447|      0|        return;
  448|      0|    }
  449|   157k|    if (cur->type == XML_ATTRIBUTE_NODE) {
  ------------------
  |  Branch (449:9): [True: 0, False: 157k]
  ------------------
  450|      0|	xmlTextReaderFreeProp(reader, (xmlAttrPtr) cur);
  451|      0|	return;
  452|      0|    }
  453|       |
  454|   157k|    if ((cur->children != NULL) &&
  ------------------
  |  Branch (454:9): [True: 1.96k, False: 155k]
  ------------------
  455|  1.96k|	(cur->type != XML_ENTITY_REF_NODE)) {
  ------------------
  |  Branch (455:2): [True: 467, False: 1.49k]
  ------------------
  456|    467|	if (cur->children->parent == cur)
  ------------------
  |  Branch (456:6): [True: 467, False: 0]
  ------------------
  457|    467|	    xmlTextReaderFreeNodeList(reader, cur->children);
  458|    467|	cur->children = NULL;
  459|    467|    }
  460|       |
  461|   157k|    if ((xmlRegisterCallbacks) && (xmlDeregisterNodeDefaultValue))
  ------------------
  |  |  934|      0|    (*__xmlDeregisterNodeDefaultValue())
  ------------------
  |  Branch (461:9): [True: 0, False: 157k]
  |  Branch (461:35): [True: 0, False: 0]
  ------------------
  462|      0|	xmlDeregisterNodeDefaultValue(cur);
  ------------------
  |  |  934|      0|    (*__xmlDeregisterNodeDefaultValue())
  ------------------
  463|       |
  464|   157k|    if (((cur->type == XML_ELEMENT_NODE) ||
  ------------------
  |  Branch (464:10): [True: 106k, False: 51.0k]
  ------------------
  465|  51.0k|	 (cur->type == XML_XINCLUDE_START) ||
  ------------------
  |  Branch (465:3): [True: 5.10k, False: 45.9k]
  ------------------
  466|  45.9k|	 (cur->type == XML_XINCLUDE_END)) &&
  ------------------
  |  Branch (466:3): [True: 1.71k, False: 44.2k]
  ------------------
  467|   113k|	(cur->properties != NULL))
  ------------------
  |  Branch (467:2): [True: 16.6k, False: 96.8k]
  ------------------
  468|  16.6k|	xmlTextReaderFreePropList(reader, cur->properties);
  469|   157k|    if ((cur->content != (xmlChar *) &(cur->properties)) &&
  ------------------
  |  Branch (469:9): [True: 145k, False: 12.1k]
  ------------------
  470|   145k|        (cur->type != XML_ELEMENT_NODE) &&
  ------------------
  |  Branch (470:9): [True: 38.9k, False: 106k]
  ------------------
  471|  38.9k|	(cur->type != XML_XINCLUDE_START) &&
  ------------------
  |  Branch (471:2): [True: 33.8k, False: 5.10k]
  ------------------
  472|  33.8k|	(cur->type != XML_XINCLUDE_END) &&
  ------------------
  |  Branch (472:2): [True: 32.1k, False: 1.71k]
  ------------------
  473|  32.1k|	(cur->type != XML_ENTITY_REF_NODE)) {
  ------------------
  |  Branch (473:2): [True: 30.3k, False: 1.73k]
  ------------------
  474|  30.3k|	DICT_FREE(cur->content);
  ------------------
  |  |  183|  30.3k|	if ((str) && ((!dict) ||				\
  |  |  ------------------
  |  |  |  Branch (183:6): [True: 28.5k, False: 1.85k]
  |  |  |  Branch (183:16): [True: 0, False: 28.5k]
  |  |  ------------------
  |  |  184|  28.5k|	    (xmlDictOwns(dict, (const xmlChar *)(str)) == 0)))	\
  |  |  ------------------
  |  |  |  Branch (184:6): [True: 28.0k, False: 504]
  |  |  ------------------
  |  |  185|  30.3k|	    xmlFree((char *)(str));
  ------------------
  475|  30.3k|    }
  476|   157k|    if (((cur->type == XML_ELEMENT_NODE) ||
  ------------------
  |  Branch (476:10): [True: 106k, False: 51.0k]
  ------------------
  477|  51.0k|	 (cur->type == XML_XINCLUDE_START) ||
  ------------------
  |  Branch (477:3): [True: 5.10k, False: 45.9k]
  ------------------
  478|  45.9k|	 (cur->type == XML_XINCLUDE_END)) &&
  ------------------
  |  Branch (478:3): [True: 1.71k, False: 44.2k]
  ------------------
  479|   113k|	(cur->nsDef != NULL))
  ------------------
  |  Branch (479:2): [True: 5.99k, False: 107k]
  ------------------
  480|  5.99k|	xmlFreeNsList(cur->nsDef);
  481|       |
  482|       |    /*
  483|       |     * we don't free names here they are interned now
  484|       |     */
  485|   157k|    if ((cur->type != XML_TEXT_NODE) &&
  ------------------
  |  Branch (485:9): [True: 122k, False: 34.6k]
  ------------------
  486|   122k|        (cur->type != XML_COMMENT_NODE))
  ------------------
  |  Branch (486:9): [True: 121k, False: 1.64k]
  ------------------
  487|   121k|	DICT_FREE(cur->name);
  ------------------
  |  |  183|   121k|	if ((str) && ((!dict) ||				\
  |  |  ------------------
  |  |  |  Branch (183:6): [True: 120k, False: 1.04k]
  |  |  |  Branch (183:16): [True: 0, False: 120k]
  |  |  ------------------
  |  |  184|   120k|	    (xmlDictOwns(dict, (const xmlChar *)(str)) == 0)))	\
  |  |  ------------------
  |  |  |  Branch (184:6): [True: 34.5k, False: 85.7k]
  |  |  ------------------
  |  |  185|   121k|	    xmlFree((char *)(str));
  ------------------
  488|       |
  489|   157k|    if (((cur->type == XML_ELEMENT_NODE) ||
  ------------------
  |  Branch (489:10): [True: 106k, False: 51.0k]
  ------------------
  490|  51.0k|	 (cur->type == XML_TEXT_NODE)) &&
  ------------------
  |  Branch (490:3): [True: 34.6k, False: 16.3k]
  ------------------
  491|   141k|	(reader != NULL) && (reader->ctxt != NULL) &&
  ------------------
  |  Branch (491:2): [True: 141k, False: 0]
  |  Branch (491:22): [True: 141k, False: 0]
  ------------------
  492|   141k|	(reader->ctxt->freeElemsNr < MAX_FREE_NODES)) {
  ------------------
  |  |   56|   141k|#define MAX_FREE_NODES 1
  ------------------
  |  Branch (492:2): [True: 9.99k, False: 131k]
  ------------------
  493|  9.99k|	cur->next = reader->ctxt->freeElems;
  494|  9.99k|	reader->ctxt->freeElems = cur;
  495|  9.99k|	reader->ctxt->freeElemsNr++;
  496|   147k|    } else {
  497|   147k|	xmlFree(cur);
  498|   147k|    }
  499|   157k|}
xmlreader.c:xmlTextReaderFreeProp:
  277|   764k|xmlTextReaderFreeProp(xmlTextReaderPtr reader, xmlAttrPtr cur) {
  278|   764k|    xmlDictPtr dict;
  279|       |
  280|   764k|    if ((reader != NULL) && (reader->ctxt != NULL))
  ------------------
  |  Branch (280:9): [True: 764k, False: 0]
  |  Branch (280:29): [True: 764k, False: 0]
  ------------------
  281|   764k|	dict = reader->ctxt->dict;
  282|      0|    else
  283|      0|        dict = NULL;
  284|   764k|    if (cur == NULL) return;
  ------------------
  |  Branch (284:9): [True: 0, False: 764k]
  ------------------
  285|       |
  286|   764k|    if ((xmlRegisterCallbacks) && (xmlDeregisterNodeDefaultValue))
  ------------------
  |  |  934|      0|    (*__xmlDeregisterNodeDefaultValue())
  ------------------
  |  Branch (286:9): [True: 0, False: 764k]
  |  Branch (286:35): [True: 0, False: 0]
  ------------------
  287|      0|	xmlDeregisterNodeDefaultValue((xmlNodePtr) cur);
  ------------------
  |  |  934|      0|    (*__xmlDeregisterNodeDefaultValue())
  ------------------
  288|       |
  289|   764k|    if (cur->children != NULL)
  ------------------
  |  Branch (289:9): [True: 658k, False: 105k]
  ------------------
  290|   658k|        xmlTextReaderFreeNodeList(reader, cur->children);
  291|       |
  292|   764k|    if (cur->id != NULL) {
  ------------------
  |  Branch (292:9): [True: 125, False: 764k]
  ------------------
  293|       |        /*
  294|       |         * Operating in streaming mode, attr is gonna disappear
  295|       |         */
  296|    125|        cur->id->attr = NULL;
  297|    125|        if (cur->id->name != NULL)
  ------------------
  |  Branch (297:13): [True: 0, False: 125]
  ------------------
  298|      0|            DICT_FREE(cur->id->name);
  ------------------
  |  |  183|      0|	if ((str) && ((!dict) ||				\
  |  |  ------------------
  |  |  |  Branch (183:6): [True: 0, False: 0]
  |  |  |  Branch (183:16): [True: 0, False: 0]
  |  |  ------------------
  |  |  184|      0|	    (xmlDictOwns(dict, (const xmlChar *)(str)) == 0)))	\
  |  |  ------------------
  |  |  |  Branch (184:6): [True: 0, False: 0]
  |  |  ------------------
  |  |  185|      0|	    xmlFree((char *)(str));
  ------------------
  299|    125|        cur->id->name = cur->name;
  300|    125|        cur->name = NULL;
  301|   764k|    } else {
  302|   764k|        DICT_FREE(cur->name);
  ------------------
  |  |  183|   764k|	if ((str) && ((!dict) ||				\
  |  |  ------------------
  |  |  |  Branch (183:6): [True: 764k, False: 35]
  |  |  |  Branch (183:16): [True: 0, False: 764k]
  |  |  ------------------
  |  |  184|   764k|	    (xmlDictOwns(dict, (const xmlChar *)(str)) == 0)))	\
  |  |  ------------------
  |  |  |  Branch (184:6): [True: 93.7k, False: 670k]
  |  |  ------------------
  |  |  185|   764k|	    xmlFree((char *)(str));
  ------------------
  303|   764k|    }
  304|       |
  305|   764k|    if ((reader != NULL) && (reader->ctxt != NULL) &&
  ------------------
  |  Branch (305:9): [True: 764k, False: 0]
  |  Branch (305:29): [True: 764k, False: 0]
  ------------------
  306|   764k|        (reader->ctxt->freeAttrsNr < MAX_FREE_NODES)) {
  ------------------
  |  |   56|   764k|#define MAX_FREE_NODES 1
  ------------------
  |  Branch (306:9): [True: 15.5k, False: 748k]
  ------------------
  307|  15.5k|        cur->next = reader->ctxt->freeAttrs;
  308|  15.5k|	reader->ctxt->freeAttrs = cur;
  309|  15.5k|	reader->ctxt->freeAttrsNr++;
  310|   748k|    } else {
  311|   748k|	xmlFree(cur);
  312|   748k|    }
  313|   764k|}
xmlreader.c:xmlTextReaderFreeNodeList:
  340|   682k|xmlTextReaderFreeNodeList(xmlTextReaderPtr reader, xmlNodePtr cur) {
  341|   682k|    xmlNodePtr next;
  342|   682k|    xmlNodePtr parent;
  343|   682k|    xmlDictPtr dict;
  344|   682k|    size_t depth = 0;
  345|       |
  346|   682k|    if ((reader != NULL) && (reader->ctxt != NULL))
  ------------------
  |  Branch (346:9): [True: 682k, False: 0]
  |  Branch (346:29): [True: 682k, False: 0]
  ------------------
  347|   682k|	dict = reader->ctxt->dict;
  348|      0|    else
  349|      0|        dict = NULL;
  350|   682k|    if (cur == NULL) return;
  ------------------
  |  Branch (350:9): [True: 0, False: 682k]
  ------------------
  351|   682k|    if (cur->type == XML_NAMESPACE_DECL) {
  ------------------
  |  Branch (351:9): [True: 0, False: 682k]
  ------------------
  352|      0|	xmlFreeNsList((xmlNsPtr) cur);
  353|      0|	return;
  354|      0|    }
  355|   682k|    if ((cur->type == XML_DOCUMENT_NODE) ||
  ------------------
  |  Branch (355:9): [True: 0, False: 682k]
  ------------------
  356|   682k|	(cur->type == XML_HTML_DOCUMENT_NODE)) {
  ------------------
  |  Branch (356:2): [True: 0, False: 682k]
  ------------------
  357|      0|	xmlFreeDoc((xmlDocPtr) cur);
  358|      0|	return;
  359|      0|    }
  360|  12.0M|    while (1) {
  ------------------
  |  Branch (360:12): [True: 12.0M, Folded]
  ------------------
  361|  16.5M|        while ((cur->type != XML_DTD_NODE) &&
  ------------------
  |  Branch (361:16): [True: 16.5M, False: 0]
  ------------------
  362|  16.5M|               (cur->type != XML_ENTITY_REF_NODE) &&
  ------------------
  |  Branch (362:16): [True: 16.5M, False: 13.5k]
  ------------------
  363|  16.5M|               (cur->children != NULL) &&
  ------------------
  |  Branch (363:16): [True: 4.49M, False: 12.0M]
  ------------------
  364|  4.49M|               (cur->children->parent == cur)) {
  ------------------
  |  Branch (364:16): [True: 4.49M, False: 0]
  ------------------
  365|  4.49M|            cur = cur->children;
  366|  4.49M|            depth += 1;
  367|  4.49M|        }
  368|       |
  369|  12.0M|        next = cur->next;
  370|  12.0M|        parent = cur->parent;
  371|       |
  372|       |	/* unroll to speed up freeing the document */
  373|  12.0M|	if (cur->type != XML_DTD_NODE) {
  ------------------
  |  Branch (373:6): [True: 12.0M, False: 0]
  ------------------
  374|       |
  375|  12.0M|	    if ((xmlRegisterCallbacks) && (xmlDeregisterNodeDefaultValue))
  ------------------
  |  |  934|      0|    (*__xmlDeregisterNodeDefaultValue())
  ------------------
  |  Branch (375:10): [True: 0, False: 12.0M]
  |  Branch (375:36): [True: 0, False: 0]
  ------------------
  376|      0|		xmlDeregisterNodeDefaultValue(cur);
  ------------------
  |  |  934|      0|    (*__xmlDeregisterNodeDefaultValue())
  ------------------
  377|       |
  378|  12.0M|	    if (((cur->type == XML_ELEMENT_NODE) ||
  ------------------
  |  Branch (378:11): [True: 5.98M, False: 6.04M]
  ------------------
  379|  6.04M|		 (cur->type == XML_XINCLUDE_START) ||
  ------------------
  |  Branch (379:4): [True: 13.1k, False: 6.03M]
  ------------------
  380|  6.03M|		 (cur->type == XML_XINCLUDE_END)) &&
  ------------------
  |  Branch (380:4): [True: 2.03M, False: 4.00M]
  ------------------
  381|  8.03M|		(cur->properties != NULL))
  ------------------
  |  Branch (381:3): [True: 401k, False: 7.63M]
  ------------------
  382|   401k|		xmlTextReaderFreePropList(reader, cur->properties);
  383|  12.0M|	    if ((cur->content != (xmlChar *) &(cur->properties)) &&
  ------------------
  |  Branch (383:10): [True: 11.9M, False: 111k]
  ------------------
  384|  11.9M|	        (cur->type != XML_ELEMENT_NODE) &&
  ------------------
  |  Branch (384:10): [True: 5.93M, False: 5.98M]
  ------------------
  385|  5.93M|		(cur->type != XML_XINCLUDE_START) &&
  ------------------
  |  Branch (385:3): [True: 5.92M, False: 13.1k]
  ------------------
  386|  5.92M|		(cur->type != XML_XINCLUDE_END) &&
  ------------------
  |  Branch (386:3): [True: 3.89M, False: 2.03M]
  ------------------
  387|  3.89M|		(cur->type != XML_ENTITY_REF_NODE)) {
  ------------------
  |  Branch (387:3): [True: 3.87M, False: 13.5k]
  ------------------
  388|  3.87M|		DICT_FREE(cur->content);
  ------------------
  |  |  183|  3.87M|	if ((str) && ((!dict) ||				\
  |  |  ------------------
  |  |  |  Branch (183:6): [True: 3.84M, False: 35.7k]
  |  |  |  Branch (183:16): [True: 0, False: 3.84M]
  |  |  ------------------
  |  |  184|  3.84M|	    (xmlDictOwns(dict, (const xmlChar *)(str)) == 0)))	\
  |  |  ------------------
  |  |  |  Branch (184:6): [True: 3.84M, False: 713]
  |  |  ------------------
  |  |  185|  3.87M|	    xmlFree((char *)(str));
  ------------------
  389|  3.87M|	    }
  390|  12.0M|	    if (((cur->type == XML_ELEMENT_NODE) ||
  ------------------
  |  Branch (390:11): [True: 5.98M, False: 6.04M]
  ------------------
  391|  6.04M|	         (cur->type == XML_XINCLUDE_START) ||
  ------------------
  |  Branch (391:11): [True: 13.1k, False: 6.03M]
  ------------------
  392|  6.03M|		 (cur->type == XML_XINCLUDE_END)) &&
  ------------------
  |  Branch (392:4): [True: 2.03M, False: 4.00M]
  ------------------
  393|  8.03M|		(cur->nsDef != NULL))
  ------------------
  |  Branch (393:3): [True: 2.27M, False: 5.76M]
  ------------------
  394|  2.27M|		xmlFreeNsList(cur->nsDef);
  395|       |
  396|       |	    /*
  397|       |	     * we don't free element names here they are interned now
  398|       |	     */
  399|  12.0M|	    if ((cur->type != XML_TEXT_NODE) &&
  ------------------
  |  Branch (399:10): [True: 8.16M, False: 3.87M]
  ------------------
  400|  8.16M|		(cur->type != XML_COMMENT_NODE))
  ------------------
  |  Branch (400:3): [True: 8.09M, False: 72.1k]
  ------------------
  401|  8.09M|		DICT_FREE(cur->name);
  ------------------
  |  |  183|  8.09M|	if ((str) && ((!dict) ||				\
  |  |  ------------------
  |  |  |  Branch (183:6): [True: 8.08M, False: 6.59k]
  |  |  |  Branch (183:16): [True: 0, False: 8.08M]
  |  |  ------------------
  |  |  184|  8.08M|	    (xmlDictOwns(dict, (const xmlChar *)(str)) == 0)))	\
  |  |  ------------------
  |  |  |  Branch (184:6): [True: 223k, False: 7.86M]
  |  |  ------------------
  |  |  185|  8.09M|	    xmlFree((char *)(str));
  ------------------
  402|  12.0M|	    if (((cur->type == XML_ELEMENT_NODE) ||
  ------------------
  |  Branch (402:11): [True: 5.98M, False: 6.04M]
  ------------------
  403|  6.04M|		 (cur->type == XML_TEXT_NODE)) &&
  ------------------
  |  Branch (403:4): [True: 3.87M, False: 2.17M]
  ------------------
  404|  9.85M|	        (reader != NULL) && (reader->ctxt != NULL) &&
  ------------------
  |  Branch (404:10): [True: 9.85M, False: 0]
  |  Branch (404:30): [True: 9.85M, False: 0]
  ------------------
  405|  9.85M|		(reader->ctxt->freeElemsNr < MAX_FREE_NODES)) {
  ------------------
  |  |   56|  9.85M|#define MAX_FREE_NODES 1
  ------------------
  |  Branch (405:3): [True: 19.0k, False: 9.83M]
  ------------------
  406|  19.0k|	        cur->next = reader->ctxt->freeElems;
  407|  19.0k|		reader->ctxt->freeElems = cur;
  408|  19.0k|		reader->ctxt->freeElemsNr++;
  409|  12.0M|	    } else {
  410|  12.0M|		xmlFree(cur);
  411|  12.0M|	    }
  412|  12.0M|	}
  413|       |
  414|  12.0M|        if (next != NULL) {
  ------------------
  |  Branch (414:13): [True: 6.86M, False: 5.17M]
  ------------------
  415|  6.86M|	    cur = next;
  416|  6.86M|        } else {
  417|  5.17M|            if ((depth == 0) || (parent == NULL))
  ------------------
  |  Branch (417:17): [True: 682k, False: 4.49M]
  |  Branch (417:33): [True: 0, False: 4.49M]
  ------------------
  418|   682k|                break;
  419|  4.49M|            depth -= 1;
  420|  4.49M|            cur = parent;
  421|       |            cur->children = NULL;
  422|  4.49M|        }
  423|  12.0M|    }
  424|   682k|}
xmlreader.c:xmlTextReaderFreePropList:
  322|   418k|xmlTextReaderFreePropList(xmlTextReaderPtr reader, xmlAttrPtr cur) {
  323|   418k|    xmlAttrPtr next;
  324|       |
  325|  1.18M|    while (cur != NULL) {
  ------------------
  |  Branch (325:12): [True: 764k, False: 418k]
  ------------------
  326|   764k|        next = cur->next;
  327|   764k|        xmlTextReaderFreeProp(reader, cur);
  328|   764k|	cur = next;
  329|   764k|    }
  330|   418k|}
xmlreader.c:xmlTextReaderErrMemory:
  206|  3.30k|xmlTextReaderErrMemory(xmlTextReaderPtr reader) {
  207|  3.30k|    if (reader == NULL) {
  ------------------
  |  Branch (207:9): [True: 0, False: 3.30k]
  ------------------
  208|      0|        xmlRaiseMemoryError(NULL, NULL, NULL, XML_FROM_PARSER, NULL);
  209|      0|        return;
  210|      0|    }
  211|       |
  212|  3.30k|    if (reader->ctxt != NULL)
  ------------------
  |  Branch (212:9): [True: 3.30k, False: 0]
  ------------------
  213|  3.30k|        xmlCtxtErrMemory(reader->ctxt);
  214|      0|    else
  215|      0|        xmlRaiseMemoryError(NULL, NULL, NULL, XML_FROM_PARSER, NULL);
  216|       |
  217|  3.30k|    reader->mode = XML_TEXTREADER_MODE_ERROR;
  218|  3.30k|    reader->state = XML_TEXTREADER_ERROR;
  219|  3.30k|}
xmlreader.c:xmlTextReaderStructuredRelay:
  558|   260k|{
  559|   260k|    xmlTextReaderPtr reader = (xmlTextReaderPtr) userData;
  560|       |
  561|   260k|    if (reader->sErrorFunc != NULL) {
  ------------------
  |  Branch (561:9): [True: 260k, False: 0]
  ------------------
  562|   260k|        reader->sErrorFunc(reader->errorFuncArg, error);
  563|   260k|    } 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|   260k|}
xmlreader.c:xmlTextReaderEntPush:
  593|  22.6k|{
  594|  22.6k|    if (reader->entNr >= reader->entMax) {
  ------------------
  |  Branch (594:9): [True: 463, False: 22.1k]
  ------------------
  595|    463|        xmlNodePtr *tmp;
  596|    463|        int newSize;
  597|       |
  598|    463|        newSize = xmlGrowCapacity(reader->entMax, sizeof(tmp[0]),
  599|    463|                                  10, XML_MAX_ITEMS);
  ------------------
  |  |   13|    463|#define XML_MAX_ITEMS 1000000000 /* 1 billion */
  ------------------
  600|    463|        if (newSize < 0) {
  ------------------
  |  Branch (600:13): [True: 0, False: 463]
  ------------------
  601|      0|            xmlTextReaderErrMemory(reader);
  602|      0|            return (-1);
  603|      0|        }
  604|    463|        tmp = xmlRealloc(reader->entTab, newSize * sizeof(tmp[0]));
  605|    463|        if (tmp == NULL) {
  ------------------
  |  Branch (605:13): [True: 3, False: 460]
  ------------------
  606|      3|            xmlTextReaderErrMemory(reader);
  607|      3|            return (-1);
  608|      3|        }
  609|    460|        reader->entTab = tmp;
  610|    460|        reader->entMax = newSize;
  611|    460|    }
  612|  22.6k|    reader->entTab[reader->entNr] = value;
  613|  22.6k|    reader->ent = value;
  614|  22.6k|    return (reader->entNr++);
  615|  22.6k|}
xmlreader.c:xmlTextReaderValidateEntity:
 1051|  1.57k|xmlTextReaderValidateEntity(xmlTextReaderPtr reader) {
 1052|  1.57k|    xmlNodePtr oldnode = reader->node;
 1053|  1.57k|    xmlNodePtr node = reader->node;
 1054|       |
 1055|  71.3k|    do {
 1056|  71.3k|	if (node->type == XML_ENTITY_REF_NODE) {
  ------------------
  |  Branch (1056:6): [True: 38.7k, False: 32.5k]
  ------------------
 1057|  38.7k|	    if ((node->children != NULL) &&
  ------------------
  |  Branch (1057:10): [True: 33.8k, False: 4.95k]
  ------------------
 1058|  33.8k|		(node->children->type == XML_ENTITY_DECL) &&
  ------------------
  |  Branch (1058:3): [True: 33.8k, False: 0]
  ------------------
 1059|  33.8k|		(node->children->children != NULL)) {
  ------------------
  |  Branch (1059:3): [True: 22.6k, False: 11.1k]
  ------------------
 1060|  22.6k|		if (xmlTextReaderEntPush(reader, node) < 0) {
  ------------------
  |  Branch (1060:7): [True: 3, False: 22.6k]
  ------------------
 1061|      3|                    if (node == oldnode)
  ------------------
  |  Branch (1061:25): [True: 1, False: 2]
  ------------------
 1062|      1|                        break;
 1063|      2|                    goto skip_children;
 1064|      3|                }
 1065|  22.6k|		node = node->children->children;
 1066|  22.6k|		continue;
 1067|  22.6k|	    } else {
 1068|       |		/*
 1069|       |		 * The error has probably been raised already.
 1070|       |		 */
 1071|  16.1k|		if (node == oldnode)
  ------------------
  |  Branch (1071:7): [True: 355, False: 15.7k]
  ------------------
 1072|    355|		    break;
 1073|  15.7k|                goto skip_children;
 1074|  16.1k|	    }
 1075|  38.7k|#ifdef LIBXML_REGEXP_ENABLED
 1076|  38.7k|	} else if (node->type == XML_ELEMENT_NODE) {
  ------------------
  |  Branch (1076:13): [True: 3.95k, False: 28.5k]
  ------------------
 1077|  3.95k|	    reader->node = node;
 1078|  3.95k|	    if (xmlTextReaderValidatePush(reader) < 0)
  ------------------
  |  Branch (1078:10): [True: 6, False: 3.95k]
  ------------------
 1079|      6|                return(-1);
 1080|  28.5k|	} else if ((node->type == XML_TEXT_NODE) ||
  ------------------
  |  Branch (1080:13): [True: 25.6k, False: 2.91k]
  ------------------
 1081|  26.7k|		   (node->type == XML_CDATA_SECTION_NODE)) {
  ------------------
  |  Branch (1081:6): [True: 1.03k, False: 1.87k]
  ------------------
 1082|  26.7k|            xmlTextReaderValidateCData(reader, node->content,
 1083|  26.7k|	                               xmlStrlen(node->content));
 1084|  26.7k|#endif
 1085|  26.7k|	}
 1086|       |
 1087|       |	/*
 1088|       |	 * go to next node
 1089|       |	 */
 1090|  32.5k|	if (node->children != NULL) {
  ------------------
  |  Branch (1090:6): [True: 2.27k, False: 30.2k]
  ------------------
 1091|  2.27k|	    node = node->children;
 1092|  2.27k|	    continue;
 1093|  30.2k|	} else if (node->type == XML_ELEMENT_NODE) {
  ------------------
  |  Branch (1093:13): [True: 1.67k, False: 28.5k]
  ------------------
 1094|  1.67k|	    if (xmlTextReaderValidatePop(reader) < 0)
  ------------------
  |  Branch (1094:10): [True: 9, False: 1.66k]
  ------------------
 1095|      9|                return(-1);
 1096|  1.67k|	}
 1097|  46.0k|skip_children:
 1098|  46.0k|	if (node->next != NULL) {
  ------------------
  |  Branch (1098:6): [True: 30.1k, False: 15.8k]
  ------------------
 1099|  30.1k|	    node = node->next;
 1100|  30.1k|	    continue;
 1101|  30.1k|	}
 1102|  24.8k|	do {
 1103|  24.8k|	    node = node->parent;
 1104|  24.8k|	    if (node->type == XML_ELEMENT_NODE) {
  ------------------
  |  Branch (1104:10): [True: 2.26k, False: 22.6k]
  ------------------
 1105|  2.26k|	        xmlNodePtr tmp;
 1106|  2.26k|		if (reader->entNr == 0) {
  ------------------
  |  Branch (1106:7): [True: 0, False: 2.26k]
  ------------------
 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|  2.26k|		reader->node = node;
 1116|  2.26k|		if (xmlTextReaderValidatePop(reader) < 0)
  ------------------
  |  Branch (1116:7): [True: 0, False: 2.26k]
  ------------------
 1117|      0|                    return(-1);
 1118|  2.26k|	    }
 1119|  24.8k|	    if ((node->type == XML_ENTITY_DECL) &&
  ------------------
  |  Branch (1119:10): [True: 22.6k, False: 2.26k]
  ------------------
 1120|  22.6k|		(reader->ent != NULL) && (reader->ent->children == node)) {
  ------------------
  |  Branch (1120:3): [True: 22.6k, False: 0]
  |  Branch (1120:28): [True: 22.6k, False: 0]
  ------------------
 1121|  22.6k|		node = xmlTextReaderEntPop(reader);
 1122|  22.6k|	    }
 1123|  24.8k|	    if (node == oldnode)
  ------------------
  |  Branch (1123:10): [True: 1.20k, False: 23.6k]
  ------------------
 1124|  1.20k|		break;
 1125|  23.6k|	    if (node->next != NULL) {
  ------------------
  |  Branch (1125:10): [True: 14.6k, False: 9.00k]
  ------------------
 1126|  14.6k|		node = node->next;
 1127|  14.6k|		break;
 1128|  14.6k|	    }
 1129|  23.6k|	} while ((node != NULL) && (node != oldnode));
  ------------------
  |  Branch (1129:11): [True: 9.00k, False: 0]
  |  Branch (1129:29): [True: 9.00k, False: 0]
  ------------------
 1130|  70.9k|    } while ((node != NULL) && (node != oldnode));
  ------------------
  |  Branch (1130:14): [True: 70.9k, False: 0]
  |  Branch (1130:32): [True: 69.7k, False: 1.20k]
  ------------------
 1131|  1.56k|    reader->node = oldnode;
 1132|       |
 1133|  1.56k|    return(0);
 1134|  1.57k|}
xmlreader.c:xmlTextReaderEntPop:
  625|  22.6k|{
  626|  22.6k|    xmlNodePtr ret;
  627|       |
  628|  22.6k|    if (reader->entNr <= 0)
  ------------------
  |  Branch (628:9): [True: 0, False: 22.6k]
  ------------------
  629|      0|        return (NULL);
  630|  22.6k|    reader->entNr--;
  631|  22.6k|    if (reader->entNr > 0)
  ------------------
  |  Branch (631:9): [True: 21.4k, False: 1.20k]
  ------------------
  632|  21.4k|        reader->ent = reader->entTab[reader->entNr - 1];
  633|  1.20k|    else
  634|  1.20k|        reader->ent = NULL;
  635|  22.6k|    ret = reader->entTab[reader->entNr];
  636|       |    reader->entTab[reader->entNr] = NULL;
  637|  22.6k|    return (ret);
  638|  22.6k|}
xmlreader.c:xmlTextReaderValidatePush:
  895|  4.22M|xmlTextReaderValidatePush(xmlTextReaderPtr reader) {
  896|  4.22M|    xmlNodePtr node = reader->node;
  897|       |
  898|  4.22M|#ifdef LIBXML_VALID_ENABLED
  899|  4.22M|    if ((reader->validate == XML_TEXTREADER_VALIDATE_DTD) &&
  ------------------
  |  Branch (899:9): [True: 4.22M, False: 0]
  ------------------
  900|  4.22M|        (reader->ctxt != NULL) && (reader->ctxt->validate == 1)) {
  ------------------
  |  Branch (900:9): [True: 4.22M, False: 0]
  |  Branch (900:35): [True: 129k, False: 4.09M]
  ------------------
  901|   129k|	if ((node->ns == NULL) || (node->ns->prefix == NULL)) {
  ------------------
  |  Branch (901:6): [True: 102k, False: 27.0k]
  |  Branch (901:28): [True: 19.1k, False: 7.92k]
  ------------------
  902|   121k|	    reader->ctxt->valid &= xmlValidatePushElement(&reader->ctxt->vctxt,
  903|   121k|				    reader->ctxt->myDoc, node, node->name);
  904|   121k|	} else {
  905|  7.92k|            xmlChar buf[50];
  906|  7.92k|	    xmlChar *qname;
  907|       |
  908|  7.92k|	    qname = xmlBuildQName(node->name, node->ns->prefix, buf, 50);
  909|  7.92k|            if (qname == NULL) {
  ------------------
  |  Branch (909:17): [True: 7, False: 7.92k]
  ------------------
  910|      7|                xmlTextReaderErrMemory(reader);
  911|      7|                return(-1);
  912|      7|            }
  913|  7.92k|	    reader->ctxt->valid &= xmlValidatePushElement(&reader->ctxt->vctxt,
  914|  7.92k|				    reader->ctxt->myDoc, node, qname);
  915|  7.92k|            if (qname != buf)
  ------------------
  |  Branch (915:17): [True: 4.11k, False: 3.80k]
  ------------------
  916|  4.11k|	        xmlFree(qname);
  917|  7.92k|	}
  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|   129k|    }
  924|  4.22M|#endif /* LIBXML_VALID_ENABLED */
  925|  4.22M|#ifdef LIBXML_RELAXNG_ENABLED
  926|  4.22M|    if ((reader->validate == XML_TEXTREADER_VALIDATE_RNG) &&
  ------------------
  |  Branch (926:9): [True: 0, False: 4.22M]
  ------------------
  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.22M|#endif
  952|       |
  953|  4.22M|    return(0);
  954|  4.22M|}
xmlreader.c:xmlTextReaderValidateCData:
  965|  1.74M|                           const xmlChar *data, int len) {
  966|  1.74M|#ifdef LIBXML_VALID_ENABLED
  967|  1.74M|    if ((reader->validate == XML_TEXTREADER_VALIDATE_DTD) &&
  ------------------
  |  Branch (967:9): [True: 1.74M, False: 0]
  ------------------
  968|  1.74M|        (reader->ctxt != NULL) && (reader->ctxt->validate == 1)) {
  ------------------
  |  Branch (968:9): [True: 1.74M, False: 0]
  |  Branch (968:35): [True: 48.7k, False: 1.69M]
  ------------------
  969|  48.7k|	reader->ctxt->valid &= xmlValidatePushCData(&reader->ctxt->vctxt,
  970|  48.7k|	                                            data, len);
  971|  48.7k|    }
  972|  1.74M|#endif /* LIBXML_VALID_ENABLED */
  973|  1.74M|#ifdef LIBXML_RELAXNG_ENABLED
  974|  1.74M|    if ((reader->validate == XML_TEXTREADER_VALIDATE_RNG) &&
  ------------------
  |  Branch (974:9): [True: 0, False: 1.74M]
  ------------------
  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|  1.74M|#endif
  984|  1.74M|}
xmlreader.c:xmlTextReaderDoExpand:
 1166|   858k|xmlTextReaderDoExpand(xmlTextReaderPtr reader) {
 1167|   858k|    int val;
 1168|       |
 1169|   858k|    if ((reader == NULL) || (reader->node == NULL) || (reader->ctxt == NULL))
  ------------------
  |  Branch (1169:9): [True: 0, False: 858k]
  |  Branch (1169:29): [True: 0, False: 858k]
  |  Branch (1169:55): [True: 0, False: 858k]
  ------------------
 1170|      0|        return(-1);
 1171|   860k|    do {
 1172|   860k|	if (PARSER_STOPPED(reader->ctxt))
  ------------------
  |  |   44|   860k|#define PARSER_STOPPED(ctxt) ((ctxt)->disableSAX > 1)
  |  |  ------------------
  |  |  |  Branch (44:30): [True: 22.2k, False: 838k]
  |  |  ------------------
  ------------------
 1173|  22.2k|            return(1);
 1174|       |
 1175|   838k|        if (xmlTextReaderGetSuccessor(reader->node) != NULL)
  ------------------
  |  Branch (1175:13): [True: 816k, False: 22.3k]
  ------------------
 1176|   816k|	    return(1);
 1177|  22.3k|	if (reader->ctxt->nodeNr < reader->depth)
  ------------------
  |  Branch (1177:6): [True: 2.01k, False: 20.3k]
  ------------------
 1178|  2.01k|	    return(1);
 1179|  20.3k|	if (reader->mode == XML_TEXTREADER_MODE_EOF)
  ------------------
  |  Branch (1179:6): [True: 4.69k, False: 15.6k]
  ------------------
 1180|  4.69k|	    return(1);
 1181|  15.6k|	val = xmlTextReaderPushData(reader);
 1182|  15.6k|	if (val < 0){
  ------------------
  |  Branch (1182:6): [True: 13.0k, False: 2.56k]
  ------------------
 1183|  13.0k|	    reader->mode = XML_TEXTREADER_MODE_ERROR;
 1184|  13.0k|            reader->state = XML_TEXTREADER_ERROR;
 1185|  13.0k|	    return(-1);
 1186|  13.0k|	}
 1187|  15.6k|    } while(reader->mode != XML_TEXTREADER_MODE_EOF);
  ------------------
  |  Branch (1187:13): [True: 2.51k, False: 52]
  ------------------
 1188|     52|    return(1);
 1189|   858k|}
xmlreader.c:xmlTextReaderGetSuccessor:
 1145|   838k|xmlTextReaderGetSuccessor(xmlNodePtr cur) {
 1146|   838k|    if (cur == NULL) return(NULL) ; /* ERROR */
  ------------------
  |  Branch (1146:9): [True: 0, False: 838k]
  ------------------
 1147|   838k|    if (cur->next != NULL) return(cur->next) ;
  ------------------
  |  Branch (1147:9): [True: 20.5k, False: 817k]
  ------------------
 1148|  1.81M|    do {
 1149|  1.81M|        cur = cur->parent;
 1150|  1.81M|        if (cur == NULL) break;
  ------------------
  |  Branch (1150:13): [True: 22.3k, False: 1.79M]
  ------------------
 1151|  1.79M|        if (cur->next != NULL) return(cur->next);
  ------------------
  |  Branch (1151:13): [True: 795k, False: 1.00M]
  ------------------
 1152|  1.79M|    } while (cur != NULL);
  ------------------
  |  Branch (1152:14): [True: 1.00M, False: 0]
  ------------------
 1153|  22.3k|    return(cur);
 1154|   817k|}
xmlreader.c:xmlTextReaderDumpCopy:
 1619|  35.5k|                      xmlNodePtr node) {
 1620|  35.5k|    if ((node->type == XML_DTD_NODE) ||
  ------------------
  |  Branch (1620:9): [True: 1.15k, False: 34.3k]
  ------------------
 1621|  34.3k|        (node->type == XML_ELEMENT_DECL) ||
  ------------------
  |  Branch (1621:9): [True: 404, False: 33.9k]
  ------------------
 1622|  33.9k|        (node->type == XML_ATTRIBUTE_DECL) ||
  ------------------
  |  Branch (1622:9): [True: 793, False: 33.1k]
  ------------------
 1623|  33.1k|        (node->type == XML_ENTITY_DECL))
  ------------------
  |  Branch (1623:9): [True: 359, False: 32.8k]
  ------------------
 1624|  2.70k|        return;
 1625|       |
 1626|  32.8k|    if ((node->type == XML_DOCUMENT_NODE) ||
  ------------------
  |  Branch (1626:9): [True: 3.85k, False: 28.9k]
  ------------------
 1627|  28.9k|        (node->type == XML_HTML_DOCUMENT_NODE)) {
  ------------------
  |  Branch (1627:9): [True: 0, False: 28.9k]
  ------------------
 1628|  3.85k|        xmlNodeDumpOutput(output, node->doc, node, 0, 0, NULL);
 1629|  28.9k|    } else {
 1630|  28.9k|        xmlNodePtr copy;
 1631|       |
 1632|       |        /*
 1633|       |         * Create a copy to make sure that namespace declarations from
 1634|       |         * ancestors are added.
 1635|       |         */
 1636|  28.9k|        copy = xmlDocCopyNode(node, node->doc, 1);
 1637|  28.9k|        if (copy == NULL) {
  ------------------
  |  Branch (1637:13): [True: 2.17k, False: 26.8k]
  ------------------
 1638|  2.17k|            xmlTextReaderErrMemory(reader);
 1639|  2.17k|            return;
 1640|  2.17k|        }
 1641|       |
 1642|  26.8k|        xmlNodeDumpOutput(output, copy->doc, copy, 0, 0, NULL);
 1643|       |
 1644|  26.8k|        xmlFreeNode(copy);
 1645|  26.8k|    }
 1646|  32.8k|}
xmlreader.c:xmlTextReaderStartElement:
  649|   151k|	                  const xmlChar **atts) {
  650|   151k|    xmlParserCtxtPtr ctxt = (xmlParserCtxtPtr) ctx;
  651|   151k|    xmlTextReaderPtr reader = ctxt->_private;
  652|       |
  653|   151k|    if ((reader != NULL) && (reader->startElement != NULL)) {
  ------------------
  |  Branch (653:9): [True: 151k, False: 0]
  |  Branch (653:29): [True: 151k, False: 0]
  ------------------
  654|   151k|	reader->startElement(ctx, fullname, atts);
  655|   151k|	if ((ctxt->node != NULL) && (ctxt->input != NULL) &&
  ------------------
  |  Branch (655:6): [True: 151k, False: 9]
  |  Branch (655:30): [True: 151k, False: 0]
  ------------------
  656|   151k|	    (ctxt->input->cur != NULL) && (ctxt->input->cur[0] == '/') &&
  ------------------
  |  Branch (656:6): [True: 151k, False: 0]
  |  Branch (656:36): [True: 40.9k, False: 110k]
  ------------------
  657|  40.9k|	    (ctxt->input->cur[1] == '>'))
  ------------------
  |  Branch (657:6): [True: 38.6k, False: 2.27k]
  ------------------
  658|  38.6k|	    ctxt->node->extra = NODE_IS_EMPTY;
  ------------------
  |  |  169|  38.6k|#define NODE_IS_EMPTY		0x1
  ------------------
  659|   151k|    }
  660|   151k|    if (reader != NULL)
  ------------------
  |  Branch (660:9): [True: 151k, False: 0]
  ------------------
  661|   151k|	reader->state = XML_TEXTREADER_ELEMENT;
  662|   151k|}
xmlreader.c:xmlTextReaderEndElement:
  671|  56.1k|xmlTextReaderEndElement(void *ctx, const xmlChar *fullname) {
  672|  56.1k|    xmlParserCtxtPtr ctxt = (xmlParserCtxtPtr) ctx;
  673|  56.1k|    xmlTextReaderPtr reader = ctxt->_private;
  674|       |
  675|  56.1k|    if ((reader != NULL) && (reader->endElement != NULL)) {
  ------------------
  |  Branch (675:9): [True: 56.1k, False: 0]
  |  Branch (675:29): [True: 56.1k, False: 0]
  ------------------
  676|  56.1k|	reader->endElement(ctx, fullname);
  677|  56.1k|    }
  678|  56.1k|}
xmlreader.c:xmlTextReaderStartElementNs:
  704|   259k|{
  705|   259k|    xmlParserCtxtPtr ctxt = (xmlParserCtxtPtr) ctx;
  706|   259k|    xmlTextReaderPtr reader = ctxt->_private;
  707|       |
  708|   259k|    if ((reader != NULL) && (reader->startElementNs != NULL)) {
  ------------------
  |  Branch (708:9): [True: 259k, False: 0]
  |  Branch (708:29): [True: 259k, False: 0]
  ------------------
  709|   259k|	reader->startElementNs(ctx, localname, prefix, URI, nb_namespaces,
  710|   259k|	                       namespaces, nb_attributes, nb_defaulted,
  711|   259k|			       attributes);
  712|   259k|	if ((ctxt->node != NULL) && (ctxt->input != NULL) &&
  ------------------
  |  Branch (712:6): [True: 259k, False: 31]
  |  Branch (712:30): [True: 259k, False: 0]
  ------------------
  713|   259k|	    (ctxt->input->cur != NULL) && (ctxt->input->cur[0] == '/') &&
  ------------------
  |  Branch (713:6): [True: 259k, False: 0]
  |  Branch (713:36): [True: 106k, False: 153k]
  ------------------
  714|   106k|	    (ctxt->input->cur[1] == '>'))
  ------------------
  |  Branch (714:6): [True: 103k, False: 2.55k]
  ------------------
  715|   103k|	    ctxt->node->extra = NODE_IS_EMPTY;
  ------------------
  |  |  169|   103k|#define NODE_IS_EMPTY		0x1
  ------------------
  716|   259k|    }
  717|   259k|    if (reader != NULL)
  ------------------
  |  Branch (717:9): [True: 259k, False: 0]
  ------------------
  718|   259k|	reader->state = XML_TEXTREADER_ELEMENT;
  719|   259k|}
xmlreader.c:xmlTextReaderEndElementNs:
  734|   139k|{
  735|   139k|    xmlParserCtxtPtr ctxt = (xmlParserCtxtPtr) ctx;
  736|   139k|    xmlTextReaderPtr reader = ctxt->_private;
  737|       |
  738|   139k|    if ((reader != NULL) && (reader->endElementNs != NULL)) {
  ------------------
  |  Branch (738:9): [True: 139k, False: 0]
  |  Branch (738:29): [True: 139k, False: 0]
  ------------------
  739|   139k|	reader->endElementNs(ctx, localname, prefix, URI);
  740|   139k|    }
  741|   139k|}
xmlreader.c:xmlTextReaderCharacters:
  753|   329k|{
  754|   329k|    xmlParserCtxtPtr ctxt = (xmlParserCtxtPtr) ctx;
  755|   329k|    xmlTextReaderPtr reader = ctxt->_private;
  756|       |
  757|   329k|    if ((reader != NULL) && (reader->characters != NULL)) {
  ------------------
  |  Branch (757:9): [True: 329k, False: 0]
  |  Branch (757:29): [True: 329k, False: 0]
  ------------------
  758|   329k|	reader->characters(ctx, ch, len);
  759|   329k|    }
  760|   329k|}
xmlreader.c:xmlTextReaderCDataBlock:
  771|  6.53k|{
  772|  6.53k|    xmlParserCtxtPtr ctxt = (xmlParserCtxtPtr) ctx;
  773|  6.53k|    xmlTextReaderPtr reader = ctxt->_private;
  774|       |
  775|  6.53k|    if ((reader != NULL) && (reader->cdataBlock != NULL)) {
  ------------------
  |  Branch (775:9): [True: 6.53k, False: 0]
  |  Branch (775:29): [True: 6.53k, False: 0]
  ------------------
  776|  6.53k|	reader->cdataBlock(ctx, ch, len);
  777|  6.53k|    }
  778|  6.53k|}
xmlreader.c:xmlTextReaderFreeDoc:
  508|  31.9k|xmlTextReaderFreeDoc(xmlTextReaderPtr reader, xmlDocPtr cur) {
  509|  31.9k|    xmlDtdPtr extSubset, intSubset;
  510|       |
  511|  31.9k|    if (cur == NULL) return;
  ------------------
  |  Branch (511:9): [True: 0, False: 31.9k]
  ------------------
  512|       |
  513|  31.9k|    if ((xmlRegisterCallbacks) && (xmlDeregisterNodeDefaultValue))
  ------------------
  |  |  934|      0|    (*__xmlDeregisterNodeDefaultValue())
  ------------------
  |  Branch (513:9): [True: 0, False: 31.9k]
  |  Branch (513:35): [True: 0, False: 0]
  ------------------
  514|      0|	xmlDeregisterNodeDefaultValue((xmlNodePtr) cur);
  ------------------
  |  |  934|      0|    (*__xmlDeregisterNodeDefaultValue())
  ------------------
  515|       |
  516|       |    /*
  517|       |     * Do this before freeing the children list to avoid ID lookups
  518|       |     */
  519|  31.9k|    if (cur->ids != NULL) xmlFreeIDTable((xmlIDTablePtr) cur->ids);
  ------------------
  |  Branch (519:9): [True: 527, False: 31.3k]
  ------------------
  520|  31.9k|    cur->ids = NULL;
  521|  31.9k|    if (cur->refs != NULL) xmlFreeRefTable((xmlRefTablePtr) cur->refs);
  ------------------
  |  Branch (521:9): [True: 256, False: 31.6k]
  ------------------
  522|  31.9k|    cur->refs = NULL;
  523|  31.9k|    extSubset = cur->extSubset;
  524|  31.9k|    intSubset = cur->intSubset;
  525|  31.9k|    if (intSubset == extSubset)
  ------------------
  |  Branch (525:9): [True: 17.3k, False: 14.5k]
  ------------------
  526|  17.3k|	extSubset = NULL;
  527|  31.9k|    if (extSubset != NULL) {
  ------------------
  |  Branch (527:9): [True: 1.25k, False: 30.6k]
  ------------------
  528|  1.25k|	xmlUnlinkNode((xmlNodePtr) cur->extSubset);
  529|  1.25k|	cur->extSubset = NULL;
  530|  1.25k|	xmlFreeDtd(extSubset);
  531|  1.25k|    }
  532|  31.9k|    if (intSubset != NULL) {
  ------------------
  |  Branch (532:9): [True: 14.5k, False: 17.3k]
  ------------------
  533|  14.5k|	xmlUnlinkNode((xmlNodePtr) cur->intSubset);
  534|  14.5k|	cur->intSubset = NULL;
  535|  14.5k|	xmlFreeDtd(intSubset);
  536|  14.5k|    }
  537|       |
  538|  31.9k|    if (cur->children != NULL) xmlTextReaderFreeNodeList(reader, cur->children);
  ------------------
  |  Branch (538:9): [True: 22.8k, False: 9.09k]
  ------------------
  539|       |
  540|  31.9k|    if (cur->version != NULL) xmlFree(cur->version);
  ------------------
  |  Branch (540:9): [True: 31.9k, False: 0]
  ------------------
  541|  31.9k|    if (cur->name != NULL) xmlFree((char *) cur->name);
  ------------------
  |  Branch (541:9): [True: 0, False: 31.9k]
  ------------------
  542|  31.9k|    if (cur->encoding != NULL) xmlFree(cur->encoding);
  ------------------
  |  Branch (542:9): [True: 213, False: 31.6k]
  ------------------
  543|  31.9k|    if (cur->oldNs != NULL) xmlFreeNsList(cur->oldNs);
  ------------------
  |  Branch (543:9): [True: 3.92k, False: 27.9k]
  ------------------
  544|  31.9k|    if (cur->URL != NULL) xmlFree(cur->URL);
  ------------------
  |  Branch (544:9): [True: 0, False: 31.9k]
  ------------------
  545|  31.9k|    if (cur->dict != NULL) xmlDictFree(cur->dict);
  ------------------
  |  Branch (545:9): [True: 18.7k, False: 13.1k]
  ------------------
  546|       |
  547|  31.9k|    xmlFree(cur);
  548|  31.9k|}
xmlreader.c:readerStrdup:
  222|  12.5k|readerStrdup(xmlTextReaderPtr reader, const xmlChar *string) {
  223|  12.5k|    xmlChar *copy;
  224|       |
  225|  12.5k|    if (string == NULL)
  ------------------
  |  Branch (225:9): [True: 1.20k, False: 11.3k]
  ------------------
  226|  1.20k|        return(NULL);
  227|       |
  228|  11.3k|    copy = xmlStrdup(string);
  229|  11.3k|    if (copy == NULL)
  ------------------
  |  Branch (229:9): [True: 58, False: 11.2k]
  ------------------
  230|     58|        xmlTextReaderErrMemory(reader);
  231|       |
  232|  11.3k|    return(copy);
  233|  12.5k|}
xmlreader.c:constString:
  236|  61.5k|constString(xmlTextReaderPtr reader, const xmlChar *string) {
  237|  61.5k|    const xmlChar *dictString;
  238|       |
  239|  61.5k|    if (string == NULL)
  ------------------
  |  Branch (239:9): [True: 2.70k, False: 58.8k]
  ------------------
  240|  2.70k|        return(NULL);
  241|       |
  242|  58.8k|    dictString = xmlDictLookup(reader->dict, string, -1);
  243|  58.8k|    if (dictString == NULL)
  ------------------
  |  Branch (243:9): [True: 15, False: 58.8k]
  ------------------
  244|     15|        xmlTextReaderErrMemory(reader);
  245|       |
  246|  58.8k|    return(dictString);
  247|  61.5k|}
xmlreader.c:constQString:
  251|  3.13k|             const xmlChar *name) {
  252|  3.13k|    const xmlChar *dictString;
  253|       |
  254|  3.13k|    if (name == NULL)
  ------------------
  |  Branch (254:9): [True: 0, False: 3.13k]
  ------------------
  255|      0|        return(NULL);
  256|       |
  257|  3.13k|    dictString = xmlDictQLookup(reader->dict, prefix, name);
  258|  3.13k|    if (dictString == NULL)
  ------------------
  |  Branch (258:9): [True: 3, False: 3.13k]
  ------------------
  259|      3|        xmlTextReaderErrMemory(reader);
  260|       |
  261|  3.13k|    return(dictString);
  262|  3.13k|}

xmlRegNewExecCtxt:
 3615|  16.7k|xmlRegNewExecCtxt(xmlRegexp *comp, xmlRegExecCallbacks callback, void *data) {
 3616|  16.7k|    xmlRegExecCtxtPtr exec;
 3617|       |
 3618|  16.7k|    if (comp == NULL)
  ------------------
  |  Branch (3618:9): [True: 0, False: 16.7k]
  ------------------
 3619|      0|	return(NULL);
 3620|  16.7k|    if ((comp->compact == NULL) && (comp->states == NULL))
  ------------------
  |  Branch (3620:9): [True: 1.98k, False: 14.7k]
  |  Branch (3620:36): [True: 0, False: 1.98k]
  ------------------
 3621|      0|        return(NULL);
 3622|  16.7k|    exec = (xmlRegExecCtxtPtr) xmlMalloc(sizeof(xmlRegExecCtxt));
 3623|  16.7k|    if (exec == NULL)
  ------------------
  |  Branch (3623:9): [True: 30, False: 16.7k]
  ------------------
 3624|     30|	return(NULL);
 3625|  16.7k|    memset(exec, 0, sizeof(xmlRegExecCtxt));
 3626|  16.7k|    exec->inputString = NULL;
 3627|  16.7k|    exec->index = 0;
 3628|  16.7k|    exec->determinist = 1;
 3629|  16.7k|    exec->maxRollbacks = 0;
 3630|  16.7k|    exec->nbRollbacks = 0;
 3631|  16.7k|    exec->rollbacks = NULL;
 3632|  16.7k|    exec->status = XML_REGEXP_OK;
  ------------------
  |  |   11|  16.7k|#define XML_REGEXP_OK               0
  ------------------
 3633|  16.7k|    exec->comp = comp;
 3634|  16.7k|    if (comp->compact == NULL)
  ------------------
  |  Branch (3634:9): [True: 1.97k, False: 14.7k]
  ------------------
 3635|  1.97k|	exec->state = comp->states[0];
 3636|  16.7k|    exec->transno = 0;
 3637|  16.7k|    exec->transcount = 0;
 3638|  16.7k|    exec->callback = callback;
 3639|  16.7k|    exec->data = data;
 3640|  16.7k|    if (comp->nbCounters > 0) {
  ------------------
  |  Branch (3640:9): [True: 0, False: 16.7k]
  ------------------
 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|  16.7k|    } else {
 3654|  16.7k|	exec->counts = NULL;
 3655|  16.7k|	exec->errCounts = NULL;
 3656|  16.7k|    }
 3657|  16.7k|    exec->inputStackMax = 0;
 3658|  16.7k|    exec->inputStackNr = 0;
 3659|  16.7k|    exec->inputStack = NULL;
 3660|  16.7k|    exec->errStateNo = -1;
 3661|       |    exec->errString = NULL;
 3662|  16.7k|    exec->nbPush = 0;
 3663|  16.7k|    return(exec);
 3664|  16.7k|}
xmlRegFreeExecCtxt:
 3674|  17.3k|xmlRegFreeExecCtxt(xmlRegExecCtxt *exec) {
 3675|  17.3k|    if (exec == NULL)
  ------------------
  |  Branch (3675:9): [True: 617, False: 16.7k]
  ------------------
 3676|    617|	return;
 3677|       |
 3678|  16.7k|    if (exec->rollbacks != NULL) {
  ------------------
  |  Branch (3678:9): [True: 692, False: 16.0k]
  ------------------
 3679|    692|	if (exec->counts != NULL) {
  ------------------
  |  Branch (3679:6): [True: 0, False: 692]
  ------------------
 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|    692|	xmlFree(exec->rollbacks);
 3687|    692|    }
 3688|  16.7k|    if (exec->counts != NULL)
  ------------------
  |  Branch (3688:9): [True: 0, False: 16.7k]
  ------------------
 3689|      0|	xmlFree(exec->counts);
 3690|  16.7k|    if (exec->inputStack != NULL) {
  ------------------
  |  Branch (3690:9): [True: 691, False: 16.0k]
  ------------------
 3691|    691|	int i;
 3692|       |
 3693|  62.0k|	for (i = 0;i < exec->inputStackNr;i++) {
  ------------------
  |  Branch (3693:13): [True: 61.3k, False: 691]
  ------------------
 3694|  61.3k|	    if (exec->inputStack[i].value != NULL)
  ------------------
  |  Branch (3694:10): [True: 61.3k, False: 0]
  ------------------
 3695|  61.3k|		xmlFree(exec->inputStack[i].value);
 3696|  61.3k|	}
 3697|    691|	xmlFree(exec->inputStack);
 3698|    691|    }
 3699|  16.7k|    if (exec->errString != NULL)
  ------------------
  |  Branch (3699:9): [True: 8.70k, False: 8.00k]
  ------------------
 3700|  8.70k|        xmlFree(exec->errString);
 3701|  16.7k|    xmlFree(exec);
 3702|  16.7k|}
xmlRegExecPushString:
 4197|  94.8k|	             void *data) {
 4198|  94.8k|    return(xmlRegExecPushStringInternal(exec, value, data, 0));
 4199|  94.8k|}
xmlRegexpIsDeterminist:
 5558|  7.23k|xmlRegexpIsDeterminist(xmlRegexp *comp) {
 5559|  7.23k|    xmlAutomataPtr am;
 5560|  7.23k|    int ret;
 5561|       |
 5562|  7.23k|    if (comp == NULL)
  ------------------
  |  Branch (5562:9): [True: 0, False: 7.23k]
  ------------------
 5563|      0|	return(-1);
 5564|  7.23k|    if (comp->determinist != -1)
  ------------------
  |  Branch (5564:9): [True: 5.80k, False: 1.43k]
  ------------------
 5565|  5.80k|	return(comp->determinist);
 5566|       |
 5567|  1.43k|    am = xmlNewAutomata();
 5568|  1.43k|    if (am == NULL)
  ------------------
  |  Branch (5568:9): [True: 25, False: 1.40k]
  ------------------
 5569|     25|        return(-1);
 5570|  1.40k|    if (am->states != NULL) {
  ------------------
  |  Branch (5570:9): [True: 1.40k, False: 0]
  ------------------
 5571|  1.40k|	int i;
 5572|       |
 5573|  2.81k|	for (i = 0;i < am->nbStates;i++)
  ------------------
  |  Branch (5573:13): [True: 1.40k, False: 1.40k]
  ------------------
 5574|  1.40k|	    xmlRegFreeState(am->states[i]);
 5575|  1.40k|	xmlFree(am->states);
 5576|  1.40k|    }
 5577|  1.40k|    am->nbAtoms = comp->nbAtoms;
 5578|  1.40k|    am->atoms = comp->atoms;
 5579|  1.40k|    am->nbStates = comp->nbStates;
 5580|  1.40k|    am->states = comp->states;
 5581|  1.40k|    am->determinist = -1;
 5582|  1.40k|    am->flags = comp->flags;
 5583|  1.40k|    ret = xmlFAComputesDeterminism(am);
 5584|  1.40k|    am->atoms = NULL;
 5585|       |    am->states = NULL;
 5586|  1.40k|    xmlFreeAutomata(am);
 5587|  1.40k|    comp->determinist = ret;
 5588|  1.40k|    return(ret);
 5589|  1.43k|}
xmlRegFreeRegexp:
 5597|  1.31k|xmlRegFreeRegexp(xmlRegexp *regexp) {
 5598|  1.31k|    int i;
 5599|  1.31k|    if (regexp == NULL)
  ------------------
  |  Branch (5599:9): [True: 0, False: 1.31k]
  ------------------
 5600|      0|	return;
 5601|       |
 5602|  1.31k|    if (regexp->string != NULL)
  ------------------
  |  Branch (5602:9): [True: 0, False: 1.31k]
  ------------------
 5603|      0|	xmlFree(regexp->string);
 5604|  1.31k|    if (regexp->states != NULL) {
  ------------------
  |  Branch (5604:9): [True: 410, False: 907]
  ------------------
 5605|   159k|	for (i = 0;i < regexp->nbStates;i++)
  ------------------
  |  Branch (5605:13): [True: 159k, False: 410]
  ------------------
 5606|   159k|	    xmlRegFreeState(regexp->states[i]);
 5607|    410|	xmlFree(regexp->states);
 5608|    410|    }
 5609|  1.31k|    if (regexp->atoms != NULL) {
  ------------------
  |  Branch (5609:9): [True: 410, False: 907]
  ------------------
 5610|   104k|	for (i = 0;i < regexp->nbAtoms;i++)
  ------------------
  |  Branch (5610:13): [True: 103k, False: 410]
  ------------------
 5611|   103k|	    xmlRegFreeAtom(regexp->atoms[i]);
 5612|    410|	xmlFree(regexp->atoms);
 5613|    410|    }
 5614|  1.31k|    if (regexp->counters != NULL)
  ------------------
  |  Branch (5614:9): [True: 0, False: 1.31k]
  ------------------
 5615|      0|	xmlFree(regexp->counters);
 5616|  1.31k|    if (regexp->compact != NULL)
  ------------------
  |  Branch (5616:9): [True: 907, False: 410]
  ------------------
 5617|    907|	xmlFree(regexp->compact);
 5618|  1.31k|    if (regexp->transdata != NULL)
  ------------------
  |  Branch (5618:9): [True: 0, False: 1.31k]
  ------------------
 5619|      0|	xmlFree(regexp->transdata);
 5620|  1.31k|    if (regexp->stringMap != NULL) {
  ------------------
  |  Branch (5620:9): [True: 907, False: 410]
  ------------------
 5621|  4.36k|	for (i = 0; i < regexp->nbstrings;i++)
  ------------------
  |  Branch (5621:14): [True: 3.46k, False: 907]
  ------------------
 5622|  3.46k|	    xmlFree(regexp->stringMap[i]);
 5623|    907|	xmlFree(regexp->stringMap);
 5624|    907|    }
 5625|       |
 5626|  1.31k|    xmlFree(regexp);
 5627|  1.31k|}
xmlNewAutomata:
 5643|  3.37k|xmlNewAutomata(void) {
 5644|  3.37k|    xmlAutomataPtr ctxt;
 5645|       |
 5646|  3.37k|    ctxt = xmlRegNewParserCtxt(NULL);
 5647|  3.37k|    if (ctxt == NULL)
  ------------------
  |  Branch (5647:9): [True: 20, False: 3.35k]
  ------------------
 5648|     20|	return(NULL);
 5649|       |
 5650|       |    /* initialize the parser */
 5651|  3.35k|    ctxt->state = xmlRegStatePush(ctxt);
 5652|  3.35k|    if (ctxt->state == NULL) {
  ------------------
  |  Branch (5652:9): [True: 28, False: 3.32k]
  ------------------
 5653|     28|	xmlFreeAutomata(ctxt);
 5654|     28|	return(NULL);
 5655|     28|    }
 5656|  3.32k|    ctxt->start = ctxt->state;
 5657|  3.32k|    ctxt->end = NULL;
 5658|       |
 5659|  3.32k|    ctxt->start->type = XML_REGEXP_START_STATE;
 5660|  3.32k|    ctxt->flags = 0;
 5661|       |
 5662|  3.32k|    return(ctxt);
 5663|  3.35k|}
xmlFreeAutomata:
 5673|  3.35k|xmlFreeAutomata(xmlAutomata *am) {
 5674|  3.35k|    if (am == NULL)
  ------------------
  |  Branch (5674:9): [True: 0, False: 3.35k]
  ------------------
 5675|      0|	return;
 5676|  3.35k|    xmlRegFreeParserCtxt(am);
 5677|  3.35k|}
xmlAutomataGetInitState:
 5703|  1.92k|xmlAutomataGetInitState(xmlAutomata *am) {
 5704|  1.92k|    if (am == NULL)
  ------------------
  |  Branch (5704:9): [True: 0, False: 1.92k]
  ------------------
 5705|      0|	return(NULL);
 5706|  1.92k|    return(am->start);
 5707|  1.92k|}
xmlAutomataSetFinalState:
 5719|  1.90k|xmlAutomataSetFinalState(xmlAutomata *am, xmlAutomataState *state) {
 5720|  1.90k|    if ((am == NULL) || (state == NULL))
  ------------------
  |  Branch (5720:9): [True: 0, False: 1.90k]
  |  Branch (5720:25): [True: 73, False: 1.83k]
  ------------------
 5721|     73|	return(-1);
 5722|  1.83k|    state->type = XML_REGEXP_FINAL_STATE;
 5723|  1.83k|    return(0);
 5724|  1.90k|}
xmlAutomataNewTransition:
 5745|   210k|			 void *data) {
 5746|   210k|    xmlRegAtomPtr atom;
 5747|       |
 5748|   210k|    if ((am == NULL) || (from == NULL) || (token == NULL))
  ------------------
  |  Branch (5748:9): [True: 0, False: 210k]
  |  Branch (5748:25): [True: 2.92k, False: 207k]
  |  Branch (5748:43): [True: 0, False: 207k]
  ------------------
 5749|  2.92k|	return(NULL);
 5750|   207k|    atom = xmlRegNewAtom(am, XML_REGEXP_STRING);
 5751|   207k|    if (atom == NULL)
  ------------------
  |  Branch (5751:9): [True: 43, False: 207k]
  ------------------
 5752|     43|        return(NULL);
 5753|   207k|    atom->data = data;
 5754|   207k|    atom->valuep = xmlStrdup(token);
 5755|   207k|    if (atom->valuep == NULL) {
  ------------------
  |  Branch (5755:9): [True: 33, False: 207k]
  ------------------
 5756|     33|        xmlRegFreeAtom(atom);
 5757|     33|        xmlRegexpErrMemory(am);
 5758|     33|        return(NULL);
 5759|     33|    }
 5760|       |
 5761|   207k|    if (xmlFAGenerateTransitions(am, from, to, atom) < 0) {
  ------------------
  |  Branch (5761:9): [True: 77, False: 207k]
  ------------------
 5762|     77|        xmlRegFreeAtom(atom);
 5763|     77|	return(NULL);
 5764|     77|    }
 5765|   207k|    if (to == NULL)
  ------------------
  |  Branch (5765:9): [True: 185k, False: 22.0k]
  ------------------
 5766|   185k|	return(am->state);
 5767|  22.0k|    return(to);
 5768|   207k|}
xmlAutomataNewState:
 6229|  34.9k|xmlAutomataNewState(xmlAutomata *am) {
 6230|  34.9k|    if (am == NULL)
  ------------------
  |  Branch (6230:9): [True: 0, False: 34.9k]
  ------------------
 6231|      0|	return(NULL);
 6232|  34.9k|    return(xmlRegStatePush(am));
 6233|  34.9k|}
xmlAutomataNewEpsilon:
 6249|   311k|		      xmlAutomataState *to) {
 6250|   311k|    if ((am == NULL) || (from == NULL))
  ------------------
  |  Branch (6250:9): [True: 0, False: 311k]
  |  Branch (6250:25): [True: 810, False: 310k]
  ------------------
 6251|    810|	return(NULL);
 6252|   310k|    xmlFAGenerateEpsilonTransition(am, from, to);
 6253|   310k|    if (to == NULL)
  ------------------
  |  Branch (6253:9): [True: 100k, False: 209k]
  ------------------
 6254|   100k|	return(am->state);
 6255|   209k|    return(to);
 6256|   310k|}
xmlAutomataCompile:
 6366|  1.90k|xmlAutomataCompile(xmlAutomata *am) {
 6367|  1.90k|    xmlRegexpPtr ret;
 6368|       |
 6369|  1.90k|    if ((am == NULL) || (am->error != 0)) return(NULL);
  ------------------
  |  Branch (6369:9): [True: 0, False: 1.90k]
  |  Branch (6369:25): [True: 360, False: 1.54k]
  ------------------
 6370|  1.54k|    xmlFAEliminateEpsilonTransitions(am);
 6371|  1.54k|    if (am->error != 0)
  ------------------
  |  Branch (6371:9): [True: 109, False: 1.43k]
  ------------------
 6372|    109|        return(NULL);
 6373|       |    /* xmlFAComputesDeterminism(am); */
 6374|  1.43k|    ret = xmlRegEpxFromParse(am);
 6375|       |
 6376|  1.43k|    return(ret);
 6377|  1.54k|}
xmlregexp.c:xmlRegExecPushStringInternal:
 3886|  94.8k|	                     void *data, int compound) {
 3887|  94.8k|    xmlRegTransPtr trans;
 3888|  94.8k|    xmlRegAtomPtr atom;
 3889|  94.8k|    int ret;
 3890|  94.8k|    int final = 0;
 3891|  94.8k|    int progress = 1;
 3892|       |
 3893|  94.8k|    if (exec == NULL)
  ------------------
  |  Branch (3893:9): [True: 0, False: 94.8k]
  ------------------
 3894|      0|	return(-1);
 3895|  94.8k|    if (exec->comp == NULL)
  ------------------
  |  Branch (3895:9): [True: 0, False: 94.8k]
  ------------------
 3896|      0|	return(-1);
 3897|  94.8k|    if (exec->status != XML_REGEXP_OK)
  ------------------
  |  |   11|  94.8k|#define XML_REGEXP_OK               0
  ------------------
  |  Branch (3897:9): [True: 16.2k, False: 78.6k]
  ------------------
 3898|  16.2k|	return(exec->status);
 3899|       |
 3900|  78.6k|    if (exec->comp->compact != NULL)
  ------------------
  |  Branch (3900:9): [True: 15.1k, False: 63.4k]
  ------------------
 3901|  15.1k|	return(xmlRegCompactPushString(exec, exec->comp, value, data));
 3902|       |
 3903|  63.4k|    if (value == NULL) {
  ------------------
  |  Branch (3903:9): [True: 1.11k, False: 62.3k]
  ------------------
 3904|  1.11k|        if (exec->state->type == XML_REGEXP_FINAL_STATE)
  ------------------
  |  Branch (3904:13): [True: 640, False: 470]
  ------------------
 3905|    640|	    return(1);
 3906|    470|	final = 1;
 3907|    470|    }
 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|  62.8k|    if ((value != NULL) && (exec->inputStackNr > 0)) {
  ------------------
  |  Branch (3913:9): [True: 62.3k, False: 470]
  |  Branch (3913:28): [True: 60.7k, False: 1.67k]
  ------------------
 3914|  60.7k|	xmlFARegExecSaveInputString(exec, value, data);
 3915|  60.7k|	value = exec->inputStack[exec->index].value;
 3916|  60.7k|	data = exec->inputStack[exec->index].data;
 3917|  60.7k|    }
 3918|       |
 3919|  46.9M|    while ((exec->status == XML_REGEXP_OK) &&
  ------------------
  |  |   11|  46.9M|#define XML_REGEXP_OK               0
  ------------------
  |  Branch (3919:12): [True: 46.9M, False: 1.29k]
  ------------------
 3920|  46.9M|	   ((value != NULL) ||
  ------------------
  |  Branch (3920:6): [True: 46.6M, False: 259k]
  ------------------
 3921|   259k|	    ((final == 1) &&
  ------------------
  |  Branch (3921:7): [True: 198k, False: 61.5k]
  ------------------
 3922|  46.8M|	     (exec->state->type != XML_REGEXP_FINAL_STATE)))) {
  ------------------
  |  Branch (3922:7): [True: 198k, False: 30]
  ------------------
 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|  46.8M|	if ((value == NULL) && (exec->counts == NULL))
  ------------------
  |  Branch (3929:6): [True: 198k, False: 46.6M]
  |  Branch (3929:25): [True: 198k, False: 0]
  ------------------
 3930|   198k|	    goto rollback;
 3931|       |
 3932|  46.6M|	exec->transcount = 0;
 3933|  93.1M|	for (;exec->transno < exec->state->nbTrans;exec->transno++) {
  ------------------
  |  Branch (3933:8): [True: 69.9M, False: 23.2M]
  ------------------
 3934|  69.9M|	    trans = &exec->state->trans[exec->transno];
 3935|  69.9M|	    if (trans->to < 0)
  ------------------
  |  Branch (3935:10): [True: 23.2M, False: 46.7M]
  ------------------
 3936|  23.2M|		continue;
 3937|  46.7M|	    atom = trans->atom;
 3938|  46.7M|	    ret = 0;
 3939|  46.7M|	    if (trans->count == REGEXP_ALL_LAX_COUNTER) {
  ------------------
  |  |  405|  46.7M|#define REGEXP_ALL_LAX_COUNTER	0x123457
  ------------------
  |  Branch (3939:10): [True: 0, False: 46.7M]
  ------------------
 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|  46.7M|	    } else if (trans->count == REGEXP_ALL_COUNTER) {
  ------------------
  |  |  404|  46.7M|#define REGEXP_ALL_COUNTER	0x123456
  ------------------
  |  Branch (3974:17): [True: 0, False: 46.7M]
  ------------------
 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|  46.7M|	    } else if (trans->count >= 0) {
  ------------------
  |  Branch (3996:17): [True: 0, False: 46.7M]
  ------------------
 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|  46.7M|	    } else if (atom == NULL) {
  ------------------
  |  Branch (4007:17): [True: 0, False: 46.7M]
  ------------------
 4008|      0|		exec->status = XML_REGEXP_INTERNAL_ERROR;
  ------------------
  |  |   13|      0|#define XML_REGEXP_INTERNAL_ERROR   (-4)
  ------------------
 4009|      0|		break;
 4010|  46.7M|	    } else if (value != NULL) {
  ------------------
  |  Branch (4010:17): [True: 46.7M, False: 0]
  ------------------
 4011|  46.7M|		ret = xmlRegStrEqualWildcard(atom->valuep, value);
 4012|  46.7M|		if (atom->neg) {
  ------------------
  |  Branch (4012:7): [True: 0, False: 46.7M]
  ------------------
 4013|      0|		    ret = !ret;
 4014|      0|		    if (!compound)
  ------------------
  |  Branch (4014:11): [True: 0, False: 0]
  ------------------
 4015|      0|		        ret = 0;
 4016|      0|		}
 4017|  46.7M|		if ((ret == 1) && (trans->counter >= 0)) {
  ------------------
  |  Branch (4017:7): [True: 23.4M, False: 23.2M]
  |  Branch (4017:21): [True: 0, False: 23.4M]
  ------------------
 4018|      0|		    xmlRegCounterPtr counter;
 4019|      0|		    int count;
 4020|       |
 4021|      0|		    count = exec->counts[trans->counter];
 4022|      0|		    counter = &exec->comp->counters[trans->counter];
 4023|      0|		    if (count >= counter->max)
  ------------------
  |  Branch (4023:11): [True: 0, False: 0]
  ------------------
 4024|      0|			ret = 0;
 4025|      0|		}
 4026|       |
 4027|  46.7M|		if ((ret == 1) && (atom->min > 0) && (atom->max > 0)) {
  ------------------
  |  Branch (4027:7): [True: 23.4M, False: 23.2M]
  |  Branch (4027:21): [True: 0, False: 23.4M]
  |  Branch (4027:40): [True: 0, False: 0]
  ------------------
 4028|      0|		    xmlRegStatePtr to = exec->comp->states[trans->to];
 4029|       |
 4030|       |		    /*
 4031|       |		     * this is a multiple input sequence
 4032|       |		     */
 4033|      0|		    if (exec->state->nbTrans > exec->transno + 1) {
  ------------------
  |  Branch (4033:11): [True: 0, False: 0]
  ------------------
 4034|      0|			if (exec->inputStackNr <= 0) {
  ------------------
  |  Branch (4034:8): [True: 0, False: 0]
  ------------------
 4035|      0|			    xmlFARegExecSaveInputString(exec, value, data);
 4036|      0|			}
 4037|      0|			xmlFARegExecSave(exec);
 4038|      0|		    }
 4039|      0|		    exec->transcount = 1;
 4040|      0|		    do {
 4041|       |			/*
 4042|       |			 * Try to progress as much as possible on the input
 4043|       |			 */
 4044|      0|			if (exec->transcount == atom->max) {
  ------------------
  |  Branch (4044:8): [True: 0, False: 0]
  ------------------
 4045|      0|			    break;
 4046|      0|			}
 4047|      0|			exec->index++;
 4048|      0|			value = exec->inputStack[exec->index].value;
 4049|      0|			data = exec->inputStack[exec->index].data;
 4050|       |
 4051|       |			/*
 4052|       |			 * End of input: stop here
 4053|       |			 */
 4054|      0|			if (value == NULL) {
  ------------------
  |  Branch (4054:8): [True: 0, False: 0]
  ------------------
 4055|      0|			    exec->index --;
 4056|      0|			    break;
 4057|      0|			}
 4058|      0|			if (exec->transcount >= atom->min) {
  ------------------
  |  Branch (4058:8): [True: 0, False: 0]
  ------------------
 4059|      0|			    int transno = exec->transno;
 4060|      0|			    xmlRegStatePtr state = exec->state;
 4061|       |
 4062|       |			    /*
 4063|       |			     * The transition is acceptable save it
 4064|       |			     */
 4065|      0|			    exec->transno = -1; /* trick */
 4066|      0|			    exec->state = to;
 4067|      0|			    if (exec->inputStackNr <= 0) {
  ------------------
  |  Branch (4067:12): [True: 0, False: 0]
  ------------------
 4068|      0|				xmlFARegExecSaveInputString(exec, value, data);
 4069|      0|			    }
 4070|      0|			    xmlFARegExecSave(exec);
 4071|      0|			    exec->transno = transno;
 4072|      0|			    exec->state = state;
 4073|      0|			}
 4074|      0|			ret = xmlStrEqual(value, atom->valuep);
 4075|      0|			exec->transcount++;
 4076|      0|		    } while (ret == 1);
  ------------------
  |  Branch (4076:16): [True: 0, False: 0]
  ------------------
 4077|      0|		    if (exec->transcount < atom->min)
  ------------------
  |  Branch (4077:11): [True: 0, False: 0]
  ------------------
 4078|      0|			ret = 0;
 4079|       |
 4080|       |		    /*
 4081|       |		     * If the last check failed but one transition was found
 4082|       |		     * possible, rollback
 4083|       |		     */
 4084|      0|		    if (ret < 0)
  ------------------
  |  Branch (4084:11): [True: 0, False: 0]
  ------------------
 4085|      0|			ret = 0;
 4086|      0|		    if (ret == 0) {
  ------------------
  |  Branch (4086:11): [True: 0, False: 0]
  ------------------
 4087|      0|			goto rollback;
 4088|      0|		    }
 4089|      0|		}
 4090|  46.7M|	    }
 4091|  46.7M|	    if (ret == 1) {
  ------------------
  |  Branch (4091:10): [True: 23.4M, False: 23.2M]
  ------------------
 4092|  23.4M|		if ((exec->callback != NULL) && (atom != NULL) &&
  ------------------
  |  Branch (4092:7): [True: 0, False: 23.4M]
  |  Branch (4092:35): [True: 0, False: 0]
  ------------------
 4093|      0|			(data != NULL)) {
  ------------------
  |  Branch (4093:4): [True: 0, False: 0]
  ------------------
 4094|      0|		    exec->callback(exec->data, atom->valuep,
 4095|      0|			           atom->data, data);
 4096|      0|		}
 4097|  23.4M|		if (exec->state->nbTrans > exec->transno + 1) {
  ------------------
  |  Branch (4097:7): [True: 23.4M, False: 45.6k]
  ------------------
 4098|  23.4M|		    if (exec->inputStackNr <= 0) {
  ------------------
  |  Branch (4098:11): [True: 693, False: 23.4M]
  ------------------
 4099|    693|			xmlFARegExecSaveInputString(exec, value, data);
 4100|    693|		    }
 4101|  23.4M|		    xmlFARegExecSave(exec);
 4102|  23.4M|		}
 4103|  23.4M|		if (trans->counter >= 0) {
  ------------------
  |  Branch (4103:7): [True: 0, False: 23.4M]
  ------------------
 4104|      0|		    exec->counts[trans->counter]++;
 4105|      0|		}
 4106|  23.4M|		if ((trans->count >= 0) &&
  ------------------
  |  Branch (4106:7): [True: 0, False: 23.4M]
  ------------------
 4107|      0|		    (trans->count < REGEXP_ALL_COUNTER)) {
  ------------------
  |  |  404|      0|#define REGEXP_ALL_COUNTER	0x123456
  ------------------
  |  Branch (4107:7): [True: 0, False: 0]
  ------------------
 4108|      0|		    exec->counts[trans->count] = 0;
 4109|      0|		}
 4110|  23.4M|                if ((exec->comp->states[trans->to] != NULL) &&
  ------------------
  |  Branch (4110:21): [True: 23.4M, False: 0]
  ------------------
 4111|  23.4M|		    (exec->comp->states[trans->to]->type ==
  ------------------
  |  Branch (4111:7): [True: 0, False: 23.4M]
  ------------------
 4112|  23.4M|		     XML_REGEXP_SINK_STATE)) {
 4113|       |		    /*
 4114|       |		     * entering a sink state, save the current state as error
 4115|       |		     * state.
 4116|       |		     */
 4117|      0|                    if (xmlRegExecSetErrString(exec, value) < 0)
  ------------------
  |  Branch (4117:25): [True: 0, False: 0]
  ------------------
 4118|      0|                        break;
 4119|      0|		    exec->errState = exec->state;
 4120|      0|		    memcpy(exec->errCounts, exec->counts,
 4121|      0|			   exec->comp->nbCounters * sizeof(int));
 4122|      0|		}
 4123|  23.4M|		exec->state = exec->comp->states[trans->to];
 4124|  23.4M|		exec->transno = 0;
 4125|  23.4M|		if (trans->atom != NULL) {
  ------------------
  |  Branch (4125:7): [True: 23.4M, False: 0]
  ------------------
 4126|  23.4M|		    if (exec->inputStack != NULL) {
  ------------------
  |  Branch (4126:11): [True: 23.4M, False: 254]
  ------------------
 4127|  23.4M|			exec->index++;
 4128|  23.4M|			if (exec->index < exec->inputStackNr) {
  ------------------
  |  Branch (4128:8): [True: 23.2M, False: 258k]
  ------------------
 4129|  23.2M|			    value = exec->inputStack[exec->index].value;
 4130|  23.2M|			    data = exec->inputStack[exec->index].data;
 4131|  23.2M|			} else {
 4132|   258k|			    value = NULL;
 4133|   258k|			    data = NULL;
 4134|   258k|			}
 4135|  23.4M|		    } else {
 4136|    254|			value = NULL;
 4137|    254|			data = NULL;
 4138|    254|		    }
 4139|  23.4M|		}
 4140|  23.4M|		goto progress;
 4141|  23.4M|	    } else if (ret < 0) {
  ------------------
  |  Branch (4141:17): [True: 0, False: 23.2M]
  ------------------
 4142|      0|		exec->status = XML_REGEXP_INTERNAL_ERROR;
  ------------------
  |  |   13|      0|#define XML_REGEXP_INTERNAL_ERROR   (-4)
  ------------------
 4143|      0|		break;
 4144|      0|	    }
 4145|  46.7M|	}
 4146|  23.2M|	if ((exec->transno != 0) || (exec->state->nbTrans == 0)) {
  ------------------
  |  Branch (4146:6): [True: 23.2M, False: 271]
  |  Branch (4146:30): [True: 271, False: 0]
  ------------------
 4147|  23.4M|rollback:
 4148|       |            /*
 4149|       |	     * if we didn't yet rollback on the current input
 4150|       |	     * store the current state as the error state.
 4151|       |	     */
 4152|  23.4M|	    if ((progress) && (exec->state != NULL) &&
  ------------------
  |  Branch (4152:10): [True: 246k, False: 23.1M]
  |  Branch (4152:24): [True: 246k, False: 0]
  ------------------
 4153|   246k|	        (exec->state->type != XML_REGEXP_SINK_STATE)) {
  ------------------
  |  Branch (4153:10): [True: 246k, False: 0]
  ------------------
 4154|   246k|	        progress = 0;
 4155|   246k|                if (xmlRegExecSetErrString(exec, value) < 0)
  ------------------
  |  Branch (4155:21): [True: 6, False: 246k]
  ------------------
 4156|      6|                    break;
 4157|   246k|		exec->errState = exec->state;
 4158|   246k|                if (exec->comp->nbCounters)
  ------------------
  |  Branch (4158:21): [True: 0, False: 246k]
  ------------------
 4159|      0|                    memcpy(exec->errCounts, exec->counts,
 4160|      0|                           exec->comp->nbCounters * sizeof(int));
 4161|   246k|	    }
 4162|       |
 4163|       |	    /*
 4164|       |	     * Failed to find a way out
 4165|       |	     */
 4166|  23.4M|	    exec->determinist = 0;
 4167|  23.4M|	    xmlFARegExecRollBack(exec);
 4168|  23.4M|	    if ((exec->inputStack != NULL ) &&
  ------------------
  |  Branch (4168:10): [True: 23.4M, False: 862]
  ------------------
 4169|  23.4M|                (exec->status == XML_REGEXP_OK)) {
  ------------------
  |  |   11|  23.4M|#define XML_REGEXP_OK               0
  ------------------
  |  Branch (4169:17): [True: 23.4M, False: 429]
  ------------------
 4170|  23.4M|		value = exec->inputStack[exec->index].value;
 4171|  23.4M|		data = exec->inputStack[exec->index].data;
 4172|  23.4M|	    }
 4173|  23.4M|	}
 4174|  23.4M|	continue;
 4175|  23.4M|progress:
 4176|  23.4M|        progress = 1;
 4177|  23.4M|    }
 4178|  62.8k|    if (exec->status == XML_REGEXP_OK) {
  ------------------
  |  |   11|  62.8k|#define XML_REGEXP_OK               0
  ------------------
  |  Branch (4178:9): [True: 61.5k, False: 1.30k]
  ------------------
 4179|  61.5k|        return(exec->state->type == XML_REGEXP_FINAL_STATE);
 4180|  61.5k|    }
 4181|  1.30k|    return(exec->status);
 4182|  62.8k|}
xmlregexp.c:xmlFARegExecSaveInputString:
 3722|  61.3k|	                    void *data) {
 3723|  61.3k|    if (exec->inputStackNr + 1 >= exec->inputStackMax) {
  ------------------
  |  Branch (3723:9): [True: 1.44k, False: 59.9k]
  ------------------
 3724|  1.44k|	xmlRegInputTokenPtr tmp;
 3725|  1.44k|        int newSize;
 3726|       |
 3727|  1.44k|        newSize = xmlGrowCapacity(exec->inputStackMax, sizeof(tmp[0]),
 3728|  1.44k|                                  4, XML_MAX_ITEMS);
  ------------------
  |  |   13|  1.44k|#define XML_MAX_ITEMS 1000000000 /* 1 billion */
  ------------------
 3729|  1.44k|	if (newSize < 0) {
  ------------------
  |  Branch (3729:6): [True: 0, False: 1.44k]
  ------------------
 3730|      0|            exec->status = XML_REGEXP_OUT_OF_MEMORY;
  ------------------
  |  |   14|      0|#define XML_REGEXP_OUT_OF_MEMORY    (-5)
  ------------------
 3731|      0|	    return;
 3732|      0|	}
 3733|  1.44k|#ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
 3734|  1.44k|        if (newSize < 2)
  ------------------
  |  Branch (3734:13): [True: 693, False: 754]
  ------------------
 3735|    693|            newSize = 2;
 3736|  1.44k|#endif
 3737|  1.44k|	tmp = xmlRealloc(exec->inputStack, newSize * sizeof(tmp[0]));
 3738|  1.44k|	if (tmp == NULL) {
  ------------------
  |  Branch (3738:6): [True: 2, False: 1.44k]
  ------------------
 3739|      2|            exec->status = XML_REGEXP_OUT_OF_MEMORY;
  ------------------
  |  |   14|      2|#define XML_REGEXP_OUT_OF_MEMORY    (-5)
  ------------------
 3740|      2|	    return;
 3741|      2|	}
 3742|  1.44k|	exec->inputStack = tmp;
 3743|  1.44k|	exec->inputStackMax = newSize;
 3744|  1.44k|    }
 3745|  61.3k|    if (value == NULL) {
  ------------------
  |  Branch (3745:9): [True: 0, False: 61.3k]
  ------------------
 3746|      0|        exec->inputStack[exec->inputStackNr].value = NULL;
 3747|  61.3k|    } else {
 3748|  61.3k|        exec->inputStack[exec->inputStackNr].value = xmlStrdup(value);
 3749|  61.3k|        if (exec->inputStack[exec->inputStackNr].value == NULL) {
  ------------------
  |  Branch (3749:13): [True: 3, False: 61.3k]
  ------------------
 3750|      3|            exec->status = XML_REGEXP_OUT_OF_MEMORY;
  ------------------
  |  |   14|      3|#define XML_REGEXP_OUT_OF_MEMORY    (-5)
  ------------------
 3751|      3|            return;
 3752|      3|        }
 3753|  61.3k|    }
 3754|  61.3k|    exec->inputStack[exec->inputStackNr].data = data;
 3755|  61.3k|    exec->inputStackNr++;
 3756|  61.3k|    exec->inputStack[exec->inputStackNr].value = NULL;
 3757|       |    exec->inputStack[exec->inputStackNr].data = NULL;
 3758|  61.3k|}
xmlregexp.c:xmlRegStrEqualWildcard:
 3772|  81.2M|xmlRegStrEqualWildcard(const xmlChar *expStr, const xmlChar *valStr) {
 3773|  81.2M|    if (expStr == valStr) return(1);
  ------------------
  |  Branch (3773:9): [True: 0, False: 81.2M]
  ------------------
 3774|  81.2M|    if (expStr == NULL) return(0);
  ------------------
  |  Branch (3774:9): [True: 0, False: 81.2M]
  ------------------
 3775|  81.2M|    if (valStr == NULL) return(0);
  ------------------
  |  Branch (3775:9): [True: 0, False: 81.2M]
  ------------------
 3776|   102M|    do {
 3777|       |	/*
 3778|       |	* Eval if we have a wildcard for the current item.
 3779|       |	*/
 3780|   102M|        if (*expStr != *valStr) {
  ------------------
  |  Branch (3780:13): [True: 48.9M, False: 53.3M]
  ------------------
 3781|       |	    /* if one of them starts with a wildcard make valStr be it */
 3782|  48.9M|	    if (*valStr == '*') {
  ------------------
  |  Branch (3782:10): [True: 0, False: 48.9M]
  ------------------
 3783|      0|	        const xmlChar *tmp;
 3784|       |
 3785|      0|		tmp = valStr;
 3786|      0|		valStr = expStr;
 3787|      0|		expStr = tmp;
 3788|      0|	    }
 3789|  48.9M|	    if ((*valStr != 0) && (*expStr != 0) && (*expStr++ == '*')) {
  ------------------
  |  Branch (3789:10): [True: 48.9M, False: 0]
  |  Branch (3789:28): [True: 48.0M, False: 891k]
  |  Branch (3789:46): [True: 0, False: 48.0M]
  ------------------
 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|  48.9M|		return(0);
 3798|  48.9M|	}
 3799|  53.3M|	expStr++;
 3800|  53.3M|	valStr++;
 3801|  53.3M|    } while (*valStr != 0);
  ------------------
  |  Branch (3801:14): [True: 21.0M, False: 32.3M]
  ------------------
 3802|  32.3M|    if (*expStr != 0)
  ------------------
  |  Branch (3802:9): [True: 810k, False: 31.4M]
  ------------------
 3803|   810k|	return (0);
 3804|  31.4M|    else
 3805|  31.4M|	return (1);
 3806|  32.3M|}
xmlregexp.c:xmlFARegExecSave:
 3241|  23.4M|xmlFARegExecSave(xmlRegExecCtxtPtr exec) {
 3242|  23.4M|#ifdef MAX_PUSH
 3243|  23.4M|    if (exec->nbPush > MAX_PUSH) {
  ------------------
  |  |   41|  23.4M|#define MAX_PUSH 10000000
  ------------------
  |  Branch (3243:9): [True: 1, False: 23.4M]
  ------------------
 3244|      1|        exec->status = XML_REGEXP_INTERNAL_LIMIT;
  ------------------
  |  |   15|      1|#define XML_REGEXP_INTERNAL_LIMIT   (-6)
  ------------------
 3245|      1|        return;
 3246|      1|    }
 3247|  23.4M|    exec->nbPush++;
 3248|  23.4M|#endif
 3249|       |
 3250|  23.4M|    if (exec->nbRollbacks >= exec->maxRollbacks) {
  ------------------
  |  Branch (3250:9): [True: 1.46k, False: 23.4M]
  ------------------
 3251|  1.46k|	xmlRegExecRollback *tmp;
 3252|  1.46k|        int newSize;
 3253|  1.46k|	int len = exec->nbRollbacks;
 3254|       |
 3255|  1.46k|        newSize = xmlGrowCapacity(exec->maxRollbacks, sizeof(tmp[0]),
 3256|  1.46k|                                  4, XML_MAX_ITEMS);
  ------------------
  |  |   13|  1.46k|#define XML_MAX_ITEMS 1000000000 /* 1 billion */
  ------------------
 3257|  1.46k|	if (newSize < 0) {
  ------------------
  |  Branch (3257:6): [True: 0, False: 1.46k]
  ------------------
 3258|      0|            exec->status = XML_REGEXP_OUT_OF_MEMORY;
  ------------------
  |  |   14|      0|#define XML_REGEXP_OUT_OF_MEMORY    (-5)
  ------------------
 3259|      0|	    return;
 3260|      0|	}
 3261|  1.46k|	tmp = xmlRealloc(exec->rollbacks, newSize * sizeof(tmp[0]));
 3262|  1.46k|	if (tmp == NULL) {
  ------------------
  |  Branch (3262:6): [True: 1, False: 1.46k]
  ------------------
 3263|      1|            exec->status = XML_REGEXP_OUT_OF_MEMORY;
  ------------------
  |  |   14|      1|#define XML_REGEXP_OUT_OF_MEMORY    (-5)
  ------------------
 3264|      1|	    return;
 3265|      1|	}
 3266|  1.46k|	exec->rollbacks = tmp;
 3267|  1.46k|	exec->maxRollbacks = newSize;
 3268|  1.46k|	tmp = &exec->rollbacks[len];
 3269|  1.46k|	memset(tmp, 0, (exec->maxRollbacks - len) * sizeof(xmlRegExecRollback));
 3270|  1.46k|    }
 3271|  23.4M|    exec->rollbacks[exec->nbRollbacks].state = exec->state;
 3272|  23.4M|    exec->rollbacks[exec->nbRollbacks].index = exec->index;
 3273|  23.4M|    exec->rollbacks[exec->nbRollbacks].nextbranch = exec->transno + 1;
 3274|  23.4M|    if (exec->comp->nbCounters > 0) {
  ------------------
  |  Branch (3274:9): [True: 0, False: 23.4M]
  ------------------
 3275|      0|	if (exec->rollbacks[exec->nbRollbacks].counts == NULL) {
  ------------------
  |  Branch (3275:6): [True: 0, False: 0]
  ------------------
 3276|      0|	    exec->rollbacks[exec->nbRollbacks].counts = (int *)
 3277|      0|		xmlMalloc(exec->comp->nbCounters * sizeof(int));
 3278|      0|	    if (exec->rollbacks[exec->nbRollbacks].counts == NULL) {
  ------------------
  |  Branch (3278:10): [True: 0, False: 0]
  ------------------
 3279|      0|		exec->status = XML_REGEXP_OUT_OF_MEMORY;
  ------------------
  |  |   14|      0|#define XML_REGEXP_OUT_OF_MEMORY    (-5)
  ------------------
 3280|      0|		return;
 3281|      0|	    }
 3282|      0|	}
 3283|      0|	memcpy(exec->rollbacks[exec->nbRollbacks].counts, exec->counts,
 3284|      0|	       exec->comp->nbCounters * sizeof(int));
 3285|      0|    }
 3286|  23.4M|    exec->nbRollbacks++;
 3287|  23.4M|}
xmlregexp.c:xmlRegExecSetErrString:
 3705|   253k|xmlRegExecSetErrString(xmlRegExecCtxtPtr exec, const xmlChar *value) {
 3706|   253k|    if (exec->errString != NULL)
  ------------------
  |  Branch (3706:9): [True: 47.1k, False: 206k]
  ------------------
 3707|  47.1k|        xmlFree(exec->errString);
 3708|   253k|    if (value == NULL) {
  ------------------
  |  Branch (3708:9): [True: 198k, False: 55.9k]
  ------------------
 3709|   198k|        exec->errString = NULL;
 3710|   198k|    } else {
 3711|  55.9k|        exec->errString = xmlStrdup(value);
 3712|  55.9k|        if (exec->errString == NULL) {
  ------------------
  |  Branch (3712:13): [True: 34, False: 55.9k]
  ------------------
 3713|     34|            exec->status = XML_REGEXP_OUT_OF_MEMORY;
  ------------------
  |  |   14|     34|#define XML_REGEXP_OUT_OF_MEMORY    (-5)
  ------------------
 3714|     34|            return(-1);
 3715|     34|        }
 3716|  55.9k|    }
 3717|   253k|    return(0);
 3718|   253k|}
xmlregexp.c:xmlFARegExecRollBack:
 3290|  23.4M|xmlFARegExecRollBack(xmlRegExecCtxtPtr exec) {
 3291|  23.4M|    if (exec->status != XML_REGEXP_OK)
  ------------------
  |  |   11|  23.4M|#define XML_REGEXP_OK               0
  ------------------
  |  Branch (3291:9): [True: 0, False: 23.4M]
  ------------------
 3292|      0|        return;
 3293|  23.4M|    if (exec->nbRollbacks <= 0) {
  ------------------
  |  Branch (3293:9): [True: 1.29k, False: 23.4M]
  ------------------
 3294|  1.29k|	exec->status = XML_REGEXP_NOT_FOUND;
  ------------------
  |  |   12|  1.29k|#define XML_REGEXP_NOT_FOUND        (-1)
  ------------------
 3295|  1.29k|	return;
 3296|  1.29k|    }
 3297|  23.4M|    exec->nbRollbacks--;
 3298|  23.4M|    exec->state = exec->rollbacks[exec->nbRollbacks].state;
 3299|  23.4M|    exec->index = exec->rollbacks[exec->nbRollbacks].index;
 3300|  23.4M|    exec->transno = exec->rollbacks[exec->nbRollbacks].nextbranch;
 3301|  23.4M|    if (exec->comp->nbCounters > 0) {
  ------------------
  |  Branch (3301:9): [True: 0, False: 23.4M]
  ------------------
 3302|      0|	if (exec->rollbacks[exec->nbRollbacks].counts == NULL) {
  ------------------
  |  Branch (3302:6): [True: 0, False: 0]
  ------------------
 3303|      0|	    exec->status = XML_REGEXP_INTERNAL_ERROR;
  ------------------
  |  |   13|      0|#define XML_REGEXP_INTERNAL_ERROR   (-4)
  ------------------
 3304|      0|	    return;
 3305|      0|	}
 3306|      0|	if (exec->counts) {
  ------------------
  |  Branch (3306:6): [True: 0, False: 0]
  ------------------
 3307|      0|	    memcpy(exec->counts, exec->rollbacks[exec->nbRollbacks].counts,
 3308|      0|	       exec->comp->nbCounters * sizeof(int));
 3309|      0|	}
 3310|      0|    }
 3311|  23.4M|}
xmlregexp.c:xmlRegCompactPushString:
 3822|  15.1k|	                void *data) {
 3823|  15.1k|    int state = exec->index;
 3824|  15.1k|    int i, target;
 3825|       |
 3826|  15.1k|    if ((comp == NULL) || (comp->compact == NULL) || (comp->stringMap == NULL))
  ------------------
  |  Branch (3826:9): [True: 0, False: 15.1k]
  |  Branch (3826:27): [True: 0, False: 15.1k]
  |  Branch (3826:54): [True: 0, False: 15.1k]
  ------------------
 3827|      0|	return(-1);
 3828|       |
 3829|  15.1k|    if (value == NULL) {
  ------------------
  |  Branch (3829:9): [True: 6.10k, False: 9.08k]
  ------------------
 3830|       |	/*
 3831|       |	 * are we at a final state ?
 3832|       |	 */
 3833|  6.10k|	if (comp->compact[state * (comp->nbstrings + 1)] ==
  ------------------
  |  Branch (3833:6): [True: 2.02k, False: 4.07k]
  ------------------
 3834|  6.10k|            XML_REGEXP_FINAL_STATE)
 3835|  2.02k|	    return(1);
 3836|  4.07k|	return(0);
 3837|  6.10k|    }
 3838|       |
 3839|       |    /*
 3840|       |     * Examine all outside transitions from current state
 3841|       |     */
 3842|  31.7k|    for (i = 0;i < comp->nbstrings;i++) {
  ------------------
  |  Branch (3842:16): [True: 23.9k, False: 7.85k]
  ------------------
 3843|  23.9k|	target = comp->compact[state * (comp->nbstrings + 1) + i + 1];
 3844|  23.9k|	if ((target > 0) && (target <= comp->nbstates)) {
  ------------------
  |  Branch (3844:6): [True: 20.1k, False: 3.75k]
  |  Branch (3844:22): [True: 20.1k, False: 0]
  ------------------
 3845|  20.1k|	    target--; /* to avoid 0 */
 3846|  20.1k|	    if (xmlRegStrEqualWildcard(comp->stringMap[i], value)) {
  ------------------
  |  Branch (3846:10): [True: 1.22k, False: 18.9k]
  ------------------
 3847|  1.22k|		exec->index = target;
 3848|  1.22k|		if ((exec->callback != NULL) && (comp->transdata != NULL)) {
  ------------------
  |  Branch (3848:7): [True: 0, False: 1.22k]
  |  Branch (3848:35): [True: 0, False: 0]
  ------------------
 3849|      0|		    exec->callback(exec->data, value,
 3850|      0|			  comp->transdata[state * comp->nbstrings + i], data);
 3851|      0|		}
 3852|  1.22k|		if (comp->compact[target * (comp->nbstrings + 1)] ==
  ------------------
  |  Branch (3852:7): [True: 0, False: 1.22k]
  ------------------
 3853|  1.22k|		    XML_REGEXP_SINK_STATE)
 3854|      0|		    goto error;
 3855|       |
 3856|  1.22k|		if (comp->compact[target * (comp->nbstrings + 1)] ==
  ------------------
  |  Branch (3856:7): [True: 894, False: 330]
  ------------------
 3857|  1.22k|		    XML_REGEXP_FINAL_STATE)
 3858|    894|		    return(1);
 3859|    330|		return(0);
 3860|  1.22k|	    }
 3861|  20.1k|	}
 3862|  23.9k|    }
 3863|       |    /*
 3864|       |     * Failed to find an exit transition out from current state for the
 3865|       |     * current token
 3866|       |     */
 3867|  7.85k|error:
 3868|  7.85k|    exec->errStateNo = state;
 3869|  7.85k|    exec->status = XML_REGEXP_NOT_FOUND;
  ------------------
  |  |   12|  7.85k|#define XML_REGEXP_NOT_FOUND        (-1)
  ------------------
 3870|  7.85k|    xmlRegExecSetErrString(exec, value);
 3871|  7.85k|    return(exec->status);
 3872|  9.08k|}
xmlregexp.c:xmlRegNewParserCtxt:
  731|  3.37k|xmlRegNewParserCtxt(const xmlChar *string) {
  732|  3.37k|    xmlRegParserCtxtPtr ret;
  733|       |
  734|  3.37k|    ret = (xmlRegParserCtxtPtr) xmlMalloc(sizeof(xmlRegParserCtxt));
  735|  3.37k|    if (ret == NULL)
  ------------------
  |  Branch (735:9): [True: 20, False: 3.35k]
  ------------------
  736|     20|	return(NULL);
  737|  3.35k|    memset(ret, 0, sizeof(xmlRegParserCtxt));
  738|  3.35k|    if (string != NULL) {
  ------------------
  |  Branch (738:9): [True: 0, False: 3.35k]
  ------------------
  739|      0|        ret->string = xmlStrdup(string);
  740|      0|        if (ret->string == NULL) {
  ------------------
  |  Branch (740:13): [True: 0, False: 0]
  ------------------
  741|      0|            xmlFree(ret);
  742|      0|            return(NULL);
  743|      0|        }
  744|      0|        ret->len = strlen((const char *) ret->string);
  745|      0|    }
  746|  3.35k|    ret->cur = ret->string;
  747|  3.35k|    ret->neg = 0;
  748|  3.35k|    ret->negs = 0;
  749|  3.35k|    ret->error = 0;
  750|  3.35k|    ret->determinist = -1;
  751|  3.35k|    return(ret);
  752|  3.35k|}
xmlregexp.c:xmlRegStatePush:
 1578|   324k|xmlRegStatePush(xmlRegParserCtxtPtr ctxt) {
 1579|   324k|    xmlRegStatePtr state;
 1580|       |
 1581|   324k|    if (ctxt->nbStates >= ctxt->maxStates) {
  ------------------
  |  Branch (1581:9): [True: 13.1k, False: 311k]
  ------------------
 1582|  13.1k|	xmlRegStatePtr *tmp;
 1583|  13.1k|        int newSize;
 1584|       |
 1585|  13.1k|        newSize = xmlGrowCapacity(ctxt->maxStates, sizeof(tmp[0]),
 1586|  13.1k|                                  4, XML_MAX_ITEMS);
  ------------------
  |  |   13|  13.1k|#define XML_MAX_ITEMS 1000000000 /* 1 billion */
  ------------------
 1587|  13.1k|	if (newSize < 0) {
  ------------------
  |  Branch (1587:6): [True: 0, False: 13.1k]
  ------------------
 1588|      0|	    xmlRegexpErrMemory(ctxt);
 1589|      0|	    return(NULL);
 1590|      0|	}
 1591|  13.1k|	tmp = xmlRealloc(ctxt->states, newSize * sizeof(tmp[0]));
 1592|  13.1k|	if (tmp == NULL) {
  ------------------
  |  Branch (1592:6): [True: 48, False: 13.0k]
  ------------------
 1593|     48|	    xmlRegexpErrMemory(ctxt);
 1594|     48|	    return(NULL);
 1595|     48|	}
 1596|  13.0k|	ctxt->states = tmp;
 1597|  13.0k|	ctxt->maxStates = newSize;
 1598|  13.0k|    }
 1599|       |
 1600|   324k|    state = xmlRegNewState(ctxt);
 1601|   324k|    if (state == NULL)
  ------------------
  |  Branch (1601:9): [True: 85, False: 324k]
  ------------------
 1602|     85|        return(NULL);
 1603|       |
 1604|   324k|    state->no = ctxt->nbStates;
 1605|   324k|    ctxt->states[ctxt->nbStates++] = state;
 1606|       |
 1607|   324k|    return(state);
 1608|   324k|}
xmlregexp.c:xmlRegNewState:
  919|   324k|xmlRegNewState(xmlRegParserCtxtPtr ctxt) {
  920|   324k|    xmlRegStatePtr ret;
  921|       |
  922|   324k|    ret = (xmlRegStatePtr) xmlMalloc(sizeof(xmlRegState));
  923|   324k|    if (ret == NULL) {
  ------------------
  |  Branch (923:9): [True: 85, False: 324k]
  ------------------
  924|     85|	xmlRegexpErrMemory(ctxt);
  925|     85|	return(NULL);
  926|     85|    }
  927|   324k|    memset(ret, 0, sizeof(xmlRegState));
  928|   324k|    ret->type = XML_REGEXP_TRANS_STATE;
  929|   324k|    ret->mark = XML_REGEXP_MARK_NORMAL;
  930|   324k|    return(ret);
  931|   324k|}
xmlregexp.c:xmlRegexpErrCompile:
  442|      4|{
  443|      4|    const char *regexp = NULL;
  444|      4|    int idx = 0;
  445|      4|    int res;
  446|       |
  447|      4|    if (ctxt != NULL) {
  ------------------
  |  Branch (447:9): [True: 4, False: 0]
  ------------------
  448|      4|        regexp = (const char *) ctxt->string;
  449|      4|	idx = ctxt->cur - ctxt->string;
  450|      4|	ctxt->error = XML_REGEXP_COMPILE_ERROR;
  451|      4|    }
  452|       |
  453|      4|    res = xmlRaiseError(NULL, NULL, NULL, NULL, NULL, XML_FROM_REGEXP,
  454|      4|                        XML_REGEXP_COMPILE_ERROR, XML_ERR_FATAL,
  455|      4|                        NULL, 0, extra, regexp, NULL, idx, 0,
  456|      4|                        "failed to compile: %s\n", extra);
  457|      4|    if (res < 0)
  ------------------
  |  Branch (457:9): [True: 0, False: 4]
  ------------------
  458|      0|        xmlRegexpErrMemory(ctxt);
  459|      4|}
xmlregexp.c:xmlFAEliminateEpsilonTransitions:
 2076|  1.54k|xmlFAEliminateEpsilonTransitions(xmlRegParserCtxtPtr ctxt) {
 2077|  1.54k|    int statenr, transnr;
 2078|  1.54k|    xmlRegStatePtr state;
 2079|  1.54k|    int has_epsilon;
 2080|       |
 2081|  1.54k|    if (ctxt->states == NULL) return;
  ------------------
  |  Branch (2081:9): [True: 0, False: 1.54k]
  ------------------
 2082|       |
 2083|       |    /*
 2084|       |     * Eliminate simple epsilon transition and the associated unreachable
 2085|       |     * states.
 2086|       |     */
 2087|  1.54k|    xmlFAEliminateSimpleEpsilonTransitions(ctxt);
 2088|   180k|    for (statenr = 0;statenr < ctxt->nbStates;statenr++) {
  ------------------
  |  Branch (2088:22): [True: 179k, False: 1.54k]
  ------------------
 2089|   179k|	state = ctxt->states[statenr];
 2090|   179k|	if ((state != NULL) && (state->type == XML_REGEXP_UNREACH_STATE)) {
  ------------------
  |  Branch (2090:6): [True: 179k, False: 0]
  |  Branch (2090:25): [True: 79.7k, False: 99.5k]
  ------------------
 2091|  79.7k|	    xmlRegFreeState(state);
 2092|  79.7k|	    ctxt->states[statenr] = NULL;
 2093|  79.7k|	}
 2094|   179k|    }
 2095|       |
 2096|  1.54k|    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|   180k|    for (statenr = ctxt->nbStates - 1;statenr >= 0;statenr--) {
  ------------------
  |  Branch (2106:39): [True: 179k, False: 1.54k]
  ------------------
 2107|   179k|	state = ctxt->states[statenr];
 2108|   179k|	if (state == NULL)
  ------------------
  |  Branch (2108:6): [True: 79.7k, False: 99.5k]
  ------------------
 2109|  79.7k|	    continue;
 2110|  99.5k|	if ((state->nbTrans == 0) &&
  ------------------
  |  Branch (2110:6): [True: 1.34k, False: 98.2k]
  ------------------
 2111|  1.34k|	    (state->type != XML_REGEXP_FINAL_STATE)) {
  ------------------
  |  Branch (2111:6): [True: 0, False: 1.34k]
  ------------------
 2112|      0|	    state->type = XML_REGEXP_SINK_STATE;
 2113|      0|	}
 2114|  1.39M|	for (transnr = 0;transnr < state->nbTrans;transnr++) {
  ------------------
  |  Branch (2114:19): [True: 1.29M, False: 99.5k]
  ------------------
 2115|  1.29M|	    if ((state->trans[transnr].atom == NULL) &&
  ------------------
  |  Branch (2115:10): [True: 136k, False: 1.15M]
  ------------------
 2116|   136k|		(state->trans[transnr].to >= 0)) {
  ------------------
  |  Branch (2116:3): [True: 82.1k, False: 54.6k]
  ------------------
 2117|  82.1k|		if (state->trans[transnr].to == statenr) {
  ------------------
  |  Branch (2117:7): [True: 0, False: 82.1k]
  ------------------
 2118|      0|		    state->trans[transnr].to = -1;
 2119|  82.1k|		} else if (state->trans[transnr].count < 0) {
  ------------------
  |  Branch (2119:14): [True: 82.1k, False: 0]
  ------------------
 2120|  82.1k|		    int newto = state->trans[transnr].to;
 2121|       |
 2122|  82.1k|		    has_epsilon = 1;
 2123|  82.1k|		    state->trans[transnr].to = -2;
 2124|  82.1k|		    state->mark = XML_REGEXP_MARK_START;
 2125|  82.1k|		    xmlFAReduceEpsilonTransitions(ctxt, statenr,
 2126|  82.1k|				      newto, state->trans[transnr].counter);
 2127|  82.1k|		    xmlFAFinishReduceEpsilonTransitions(ctxt, newto);
 2128|  82.1k|		    state->mark = XML_REGEXP_MARK_NORMAL;
 2129|  82.1k|	        }
 2130|  82.1k|	    }
 2131|  1.29M|	}
 2132|  99.5k|    }
 2133|       |    /*
 2134|       |     * Eliminate the epsilon transitions
 2135|       |     */
 2136|  1.54k|    if (has_epsilon) {
  ------------------
  |  Branch (2136:9): [True: 1.27k, False: 277]
  ------------------
 2137|   179k|	for (statenr = 0;statenr < ctxt->nbStates;statenr++) {
  ------------------
  |  Branch (2137:19): [True: 178k, False: 1.27k]
  ------------------
 2138|   178k|	    state = ctxt->states[statenr];
 2139|   178k|	    if (state == NULL)
  ------------------
  |  Branch (2139:10): [True: 79.7k, False: 98.7k]
  ------------------
 2140|  79.7k|		continue;
 2141|  1.39M|	    for (transnr = 0;transnr < state->nbTrans;transnr++) {
  ------------------
  |  Branch (2141:23): [True: 1.29M, False: 98.7k]
  ------------------
 2142|  1.29M|		xmlRegTransPtr trans = &(state->trans[transnr]);
 2143|  1.29M|		if ((trans->atom == NULL) &&
  ------------------
  |  Branch (2143:7): [True: 136k, False: 1.15M]
  ------------------
 2144|   136k|		    (trans->count < 0) &&
  ------------------
  |  Branch (2144:7): [True: 136k, False: 0]
  ------------------
 2145|   136k|		    (trans->to >= 0)) {
  ------------------
  |  Branch (2145:7): [True: 0, False: 136k]
  ------------------
 2146|      0|		    trans->to = -1;
 2147|      0|		}
 2148|  1.29M|	    }
 2149|  98.7k|	}
 2150|  1.27k|    }
 2151|       |
 2152|       |    /*
 2153|       |     * Use this pass to detect unreachable states too
 2154|       |     */
 2155|   180k|    for (statenr = 0;statenr < ctxt->nbStates;statenr++) {
  ------------------
  |  Branch (2155:22): [True: 179k, False: 1.54k]
  ------------------
 2156|   179k|	state = ctxt->states[statenr];
 2157|   179k|	if (state != NULL)
  ------------------
  |  Branch (2157:6): [True: 99.5k, False: 79.7k]
  ------------------
 2158|  99.5k|	    state->reached = XML_REGEXP_MARK_NORMAL;
 2159|   179k|    }
 2160|  1.54k|    state = ctxt->states[0];
 2161|  1.54k|    if (state != NULL)
  ------------------
  |  Branch (2161:9): [True: 1.54k, False: 0]
  ------------------
 2162|  1.54k|	state->reached = XML_REGEXP_MARK_START;
 2163|  80.9k|    while (state != NULL) {
  ------------------
  |  Branch (2163:12): [True: 79.4k, False: 1.54k]
  ------------------
 2164|  79.4k|	xmlRegStatePtr target = NULL;
 2165|  79.4k|	state->reached = XML_REGEXP_MARK_VISITED;
 2166|       |	/*
 2167|       |	 * Mark all states reachable from the current reachable state
 2168|       |	 */
 2169|  1.12M|	for (transnr = 0;transnr < state->nbTrans;transnr++) {
  ------------------
  |  Branch (2169:19): [True: 1.04M, False: 79.4k]
  ------------------
 2170|  1.04M|	    if ((state->trans[transnr].to >= 0) &&
  ------------------
  |  Branch (2170:10): [True: 915k, False: 129k]
  ------------------
 2171|   915k|		((state->trans[transnr].atom != NULL) ||
  ------------------
  |  Branch (2171:4): [True: 915k, False: 0]
  ------------------
 2172|   915k|		 (state->trans[transnr].count >= 0))) {
  ------------------
  |  Branch (2172:4): [True: 0, False: 0]
  ------------------
 2173|   915k|		int newto = state->trans[transnr].to;
 2174|       |
 2175|   915k|		if (ctxt->states[newto] == NULL)
  ------------------
  |  Branch (2175:7): [True: 2, False: 915k]
  ------------------
 2176|      2|		    continue;
 2177|   915k|		if (ctxt->states[newto]->reached == XML_REGEXP_MARK_NORMAL) {
  ------------------
  |  Branch (2177:7): [True: 77.8k, False: 837k]
  ------------------
 2178|  77.8k|		    ctxt->states[newto]->reached = XML_REGEXP_MARK_START;
 2179|  77.8k|		    target = ctxt->states[newto];
 2180|  77.8k|		}
 2181|   915k|	    }
 2182|  1.04M|	}
 2183|       |
 2184|       |	/*
 2185|       |	 * find the next accessible state not explored
 2186|       |	 */
 2187|  79.4k|	if (target == NULL) {
  ------------------
  |  Branch (2187:6): [True: 39.3k, False: 40.0k]
  ------------------
 2188|   240M|	    for (statenr = 1;statenr < ctxt->nbStates;statenr++) {
  ------------------
  |  Branch (2188:23): [True: 240M, False: 1.54k]
  ------------------
 2189|   240M|		state = ctxt->states[statenr];
 2190|   240M|		if ((state != NULL) && (state->reached ==
  ------------------
  |  Branch (2190:7): [True: 113M, False: 127M]
  |  Branch (2190:26): [True: 37.8k, False: 113M]
  ------------------
 2191|   113M|			XML_REGEXP_MARK_START)) {
 2192|  37.8k|		    target = state;
 2193|  37.8k|		    break;
 2194|  37.8k|		}
 2195|   240M|	    }
 2196|  39.3k|	}
 2197|  79.4k|	state = target;
 2198|  79.4k|    }
 2199|   180k|    for (statenr = 0;statenr < ctxt->nbStates;statenr++) {
  ------------------
  |  Branch (2199:22): [True: 179k, False: 1.54k]
  ------------------
 2200|   179k|	state = ctxt->states[statenr];
 2201|   179k|	if ((state != NULL) && (state->reached == XML_REGEXP_MARK_NORMAL)) {
  ------------------
  |  Branch (2201:6): [True: 99.5k, False: 79.7k]
  |  Branch (2201:25): [True: 20.1k, False: 79.4k]
  ------------------
 2202|  20.1k|	    xmlRegFreeState(state);
 2203|  20.1k|	    ctxt->states[statenr] = NULL;
 2204|  20.1k|	}
 2205|   179k|    }
 2206|       |
 2207|  1.54k|}
xmlregexp.c:xmlFAEliminateSimpleEpsilonTransitions:
 2025|  1.54k|xmlFAEliminateSimpleEpsilonTransitions(xmlRegParserCtxtPtr ctxt) {
 2026|  1.54k|    int statenr, i, j, newto;
 2027|  1.54k|    xmlRegStatePtr state, tmp;
 2028|       |
 2029|   180k|    for (statenr = 0;statenr < ctxt->nbStates;statenr++) {
  ------------------
  |  Branch (2029:22): [True: 179k, False: 1.54k]
  ------------------
 2030|   179k|	state = ctxt->states[statenr];
 2031|   179k|	if (state == NULL)
  ------------------
  |  Branch (2031:6): [True: 0, False: 179k]
  ------------------
 2032|      0|	    continue;
 2033|   179k|	if (state->nbTrans != 1)
  ------------------
  |  Branch (2033:6): [True: 74.3k, False: 104k]
  ------------------
 2034|  74.3k|	    continue;
 2035|   104k|       if (state->type == XML_REGEXP_UNREACH_STATE ||
  ------------------
  |  Branch (2035:12): [True: 0, False: 104k]
  ------------------
 2036|   104k|           state->type == XML_REGEXP_FINAL_STATE)
  ------------------
  |  Branch (2036:12): [True: 201, False: 104k]
  ------------------
 2037|    201|	    continue;
 2038|       |	/* is the only transition out a basic transition */
 2039|   104k|	if ((state->trans[0].atom == NULL) &&
  ------------------
  |  Branch (2039:6): [True: 80.6k, False: 24.1k]
  ------------------
 2040|  80.6k|	    (state->trans[0].to >= 0) &&
  ------------------
  |  Branch (2040:6): [True: 80.6k, False: 8]
  ------------------
 2041|  80.6k|	    (state->trans[0].to != statenr) &&
  ------------------
  |  Branch (2041:6): [True: 80.6k, False: 0]
  ------------------
 2042|  80.6k|	    (state->trans[0].counter < 0) &&
  ------------------
  |  Branch (2042:6): [True: 80.6k, False: 0]
  ------------------
 2043|  80.6k|	    (state->trans[0].count < 0)) {
  ------------------
  |  Branch (2043:6): [True: 80.6k, False: 0]
  ------------------
 2044|  80.6k|	    newto = state->trans[0].to;
 2045|       |
 2046|  80.6k|            if (state->type == XML_REGEXP_START_STATE) {
  ------------------
  |  Branch (2046:17): [True: 814, False: 79.7k]
  ------------------
 2047|  79.7k|            } else {
 2048|   201k|	        for (i = 0;i < state->nbTransTo;i++) {
  ------------------
  |  Branch (2048:21): [True: 121k, False: 79.7k]
  ------------------
 2049|   121k|		    tmp = ctxt->states[state->transTo[i]];
 2050|  58.1M|		    for (j = 0;j < tmp->nbTrans;j++) {
  ------------------
  |  Branch (2050:18): [True: 58.0M, False: 121k]
  ------------------
 2051|  58.0M|			if (tmp->trans[j].to == statenr) {
  ------------------
  |  Branch (2051:8): [True: 115k, False: 57.8M]
  ------------------
 2052|   115k|			    tmp->trans[j].to = -1;
 2053|   115k|			    xmlRegStateAddTrans(ctxt, tmp, tmp->trans[j].atom,
 2054|   115k|						ctxt->states[newto],
 2055|   115k|					        tmp->trans[j].counter,
 2056|   115k|						tmp->trans[j].count);
 2057|   115k|			}
 2058|  58.0M|		    }
 2059|   121k|		}
 2060|  79.7k|		if (state->type == XML_REGEXP_FINAL_STATE)
  ------------------
  |  Branch (2060:7): [True: 0, False: 79.7k]
  ------------------
 2061|      0|		    ctxt->states[newto]->type = XML_REGEXP_FINAL_STATE;
 2062|       |		/* eliminate the transition completely */
 2063|  79.7k|		state->nbTrans = 0;
 2064|       |
 2065|  79.7k|                state->type = XML_REGEXP_UNREACH_STATE;
 2066|       |
 2067|  79.7k|	    }
 2068|       |
 2069|  80.6k|	}
 2070|   104k|    }
 2071|  1.54k|}
xmlregexp.c:xmlFAReduceEpsilonTransitions:
 1928|   246k|	                      int tonr, int counter) {
 1929|   246k|    int transnr;
 1930|   246k|    xmlRegStatePtr from;
 1931|   246k|    xmlRegStatePtr to;
 1932|       |
 1933|   246k|    from = ctxt->states[fromnr];
 1934|   246k|    if (from == NULL)
  ------------------
  |  Branch (1934:9): [True: 0, False: 246k]
  ------------------
 1935|      0|	return;
 1936|   246k|    to = ctxt->states[tonr];
 1937|   246k|    if (to == NULL)
  ------------------
  |  Branch (1937:9): [True: 91, False: 246k]
  ------------------
 1938|     91|	return;
 1939|   246k|    if ((to->mark == XML_REGEXP_MARK_START) ||
  ------------------
  |  Branch (1939:9): [True: 0, False: 246k]
  ------------------
 1940|   246k|	(to->mark == XML_REGEXP_MARK_VISITED))
  ------------------
  |  Branch (1940:2): [True: 50.0k, False: 196k]
  ------------------
 1941|  50.0k|	return;
 1942|       |
 1943|   196k|    to->mark = XML_REGEXP_MARK_VISITED;
 1944|   196k|    if (to->type == XML_REGEXP_FINAL_STATE) {
  ------------------
  |  Branch (1944:9): [True: 66.3k, False: 129k]
  ------------------
 1945|  66.3k|	from->type = XML_REGEXP_FINAL_STATE;
 1946|  66.3k|    }
 1947|  8.66M|    for (transnr = 0;transnr < to->nbTrans;transnr++) {
  ------------------
  |  Branch (1947:22): [True: 8.47M, False: 196k]
  ------------------
 1948|  8.47M|        xmlRegTransPtr t1 = &to->trans[transnr];
 1949|  8.47M|        int tcounter;
 1950|       |
 1951|  8.47M|        if (t1->to < 0)
  ------------------
  |  Branch (1951:13): [True: 589k, False: 7.88M]
  ------------------
 1952|   589k|	    continue;
 1953|  7.88M|        if (t1->counter >= 0) {
  ------------------
  |  Branch (1953:13): [True: 0, False: 7.88M]
  ------------------
 1954|       |            /* assert(counter < 0); */
 1955|      0|            tcounter = t1->counter;
 1956|  7.88M|        } else {
 1957|  7.88M|            tcounter = counter;
 1958|  7.88M|        }
 1959|  7.88M|	if (t1->atom == NULL) {
  ------------------
  |  Branch (1959:6): [True: 165k, False: 7.71M]
  ------------------
 1960|       |	    /*
 1961|       |	     * Don't remove counted transitions
 1962|       |	     * Don't loop either
 1963|       |	     */
 1964|   165k|	    if (t1->to != fromnr) {
  ------------------
  |  Branch (1964:10): [True: 164k, False: 1.69k]
  ------------------
 1965|   164k|		if (t1->count >= 0) {
  ------------------
  |  Branch (1965:7): [True: 0, False: 164k]
  ------------------
 1966|      0|		    xmlRegStateAddTrans(ctxt, from, NULL, ctxt->states[t1->to],
 1967|      0|					-1, t1->count);
 1968|   164k|		} else {
 1969|   164k|                    xmlFAReduceEpsilonTransitions(ctxt, fromnr, t1->to,
 1970|   164k|                                                  tcounter);
 1971|   164k|		}
 1972|   164k|	    }
 1973|  7.71M|	} else {
 1974|  7.71M|            xmlRegStateAddTrans(ctxt, from, t1->atom,
 1975|  7.71M|                                ctxt->states[t1->to], tcounter, -1);
 1976|  7.71M|	}
 1977|  7.88M|    }
 1978|   196k|}
xmlregexp.c:xmlFAFinishReduceEpsilonTransitions:
 1985|   247k|xmlFAFinishReduceEpsilonTransitions(xmlRegParserCtxtPtr ctxt, int tonr) {
 1986|   247k|    int transnr;
 1987|   247k|    xmlRegStatePtr to;
 1988|       |
 1989|   247k|    to = ctxt->states[tonr];
 1990|   247k|    if (to == NULL)
  ------------------
  |  Branch (1990:9): [True: 91, False: 247k]
  ------------------
 1991|     91|	return;
 1992|   247k|    if ((to->mark == XML_REGEXP_MARK_START) ||
  ------------------
  |  Branch (1992:9): [True: 1.69k, False: 246k]
  ------------------
 1993|   246k|	(to->mark == XML_REGEXP_MARK_NORMAL))
  ------------------
  |  Branch (1993:2): [True: 50.0k, False: 196k]
  ------------------
 1994|  51.7k|	return;
 1995|       |
 1996|   196k|    to->mark = XML_REGEXP_MARK_NORMAL;
 1997|  8.66M|    for (transnr = 0;transnr < to->nbTrans;transnr++) {
  ------------------
  |  Branch (1997:22): [True: 8.47M, False: 196k]
  ------------------
 1998|  8.47M|	xmlRegTransPtr t1 = &to->trans[transnr];
 1999|  8.47M|	if ((t1->to >= 0) && (t1->atom == NULL))
  ------------------
  |  Branch (1999:6): [True: 7.88M, False: 589k]
  |  Branch (1999:23): [True: 165k, False: 7.71M]
  ------------------
 2000|   165k|            xmlFAFinishReduceEpsilonTransitions(ctxt, t1->to);
 2001|  8.47M|    }
 2002|   196k|}
xmlregexp.c:xmlRegEpxFromParse:
  503|  1.43k|xmlRegEpxFromParse(xmlRegParserCtxtPtr ctxt) {
  504|  1.43k|    xmlRegexpPtr ret;
  505|       |
  506|  1.43k|    ret = (xmlRegexpPtr) xmlMalloc(sizeof(xmlRegexp));
  507|  1.43k|    if (ret == NULL) {
  ------------------
  |  Branch (507:9): [True: 8, False: 1.43k]
  ------------------
  508|      8|	xmlRegexpErrMemory(ctxt);
  509|      8|	return(NULL);
  510|      8|    }
  511|  1.43k|    memset(ret, 0, sizeof(xmlRegexp));
  512|  1.43k|    ret->string = ctxt->string;
  513|  1.43k|    ret->nbStates = ctxt->nbStates;
  514|  1.43k|    ret->states = ctxt->states;
  515|  1.43k|    ret->nbAtoms = ctxt->nbAtoms;
  516|  1.43k|    ret->atoms = ctxt->atoms;
  517|  1.43k|    ret->nbCounters = ctxt->nbCounters;
  518|  1.43k|    ret->counters = ctxt->counters;
  519|  1.43k|    ret->determinist = ctxt->determinist;
  520|  1.43k|    ret->flags = ctxt->flags;
  521|  1.43k|    if (ret->determinist == -1) {
  ------------------
  |  Branch (521:9): [True: 1.43k, False: 0]
  ------------------
  522|  1.43k|        if (xmlRegexpIsDeterminist(ret) < 0) {
  ------------------
  |  Branch (522:13): [True: 25, False: 1.40k]
  ------------------
  523|     25|            xmlRegexpErrMemory(ctxt);
  524|     25|            xmlFree(ret);
  525|     25|            return(NULL);
  526|     25|        }
  527|  1.43k|    }
  528|       |
  529|  1.40k|    if ((ret->determinist != 0) &&
  ------------------
  |  Branch (529:9): [True: 996, False: 410]
  ------------------
  530|    996|	(ret->nbCounters == 0) &&
  ------------------
  |  Branch (530:2): [True: 996, False: 0]
  ------------------
  531|    996|	(ctxt->negs == 0) &&
  ------------------
  |  Branch (531:2): [True: 996, False: 0]
  ------------------
  532|    996|	(ret->atoms != NULL) &&
  ------------------
  |  Branch (532:2): [True: 996, False: 0]
  ------------------
  533|    996|	(ret->atoms[0] != NULL) &&
  ------------------
  |  Branch (533:2): [True: 996, False: 0]
  ------------------
  534|    996|	(ret->atoms[0]->type == XML_REGEXP_STRING)) {
  ------------------
  |  Branch (534:2): [True: 996, False: 0]
  ------------------
  535|    996|	int i, j, nbstates = 0, nbatoms = 0;
  536|    996|	int *stateRemap;
  537|    996|	int *stringRemap;
  538|    996|	int *transitions;
  539|    996|	void **transdata;
  540|    996|	xmlChar **stringMap;
  541|    996|        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|    996|	stateRemap = xmlMalloc(ret->nbStates * sizeof(int));
  552|    996|	if (stateRemap == NULL) {
  ------------------
  |  Branch (552:6): [True: 7, False: 989]
  ------------------
  553|      7|	    xmlRegexpErrMemory(ctxt);
  554|      7|	    xmlFree(ret);
  555|      7|	    return(NULL);
  556|      7|	}
  557|  18.6k|	for (i = 0;i < ret->nbStates;i++) {
  ------------------
  |  Branch (557:13): [True: 17.7k, False: 989]
  ------------------
  558|  17.7k|	    if (ret->states[i] != NULL) {
  ------------------
  |  Branch (558:10): [True: 14.1k, False: 3.57k]
  ------------------
  559|  14.1k|		stateRemap[i] = nbstates;
  560|  14.1k|		nbstates++;
  561|  14.1k|	    } else {
  562|  3.57k|		stateRemap[i] = -1;
  563|  3.57k|	    }
  564|  17.7k|	}
  565|    989|	stringMap = xmlMalloc(ret->nbAtoms * sizeof(char *));
  566|    989|	if (stringMap == NULL) {
  ------------------
  |  Branch (566:6): [True: 8, False: 981]
  ------------------
  567|      8|	    xmlRegexpErrMemory(ctxt);
  568|      8|	    xmlFree(stateRemap);
  569|      8|	    xmlFree(ret);
  570|      8|	    return(NULL);
  571|      8|	}
  572|    981|	stringRemap = xmlMalloc(ret->nbAtoms * sizeof(int));
  573|    981|	if (stringRemap == NULL) {
  ------------------
  |  Branch (573:6): [True: 9, False: 972]
  ------------------
  574|      9|	    xmlRegexpErrMemory(ctxt);
  575|      9|	    xmlFree(stringMap);
  576|      9|	    xmlFree(stateRemap);
  577|      9|	    xmlFree(ret);
  578|      9|	    return(NULL);
  579|      9|	}
  580|  17.8k|	for (i = 0;i < ret->nbAtoms;i++) {
  ------------------
  |  Branch (580:13): [True: 16.9k, False: 925]
  ------------------
  581|  16.9k|	    if ((ret->atoms[i]->type == XML_REGEXP_STRING) &&
  ------------------
  |  Branch (581:10): [True: 16.9k, False: 0]
  ------------------
  582|  16.9k|		(ret->atoms[i]->quant == XML_REGEXP_QUANT_ONCE)) {
  ------------------
  |  Branch (582:3): [True: 16.9k, False: 0]
  ------------------
  583|  16.9k|		value = ret->atoms[i]->valuep;
  584|   192k|                for (j = 0;j < nbatoms;j++) {
  ------------------
  |  Branch (584:28): [True: 188k, False: 3.77k]
  ------------------
  585|   188k|		    if (xmlStrEqual(stringMap[j], value)) {
  ------------------
  |  Branch (585:11): [True: 13.1k, False: 175k]
  ------------------
  586|  13.1k|			stringRemap[i] = j;
  587|  13.1k|			break;
  588|  13.1k|		    }
  589|   188k|		}
  590|  16.9k|		if (j >= nbatoms) {
  ------------------
  |  Branch (590:7): [True: 3.77k, False: 13.1k]
  ------------------
  591|  3.77k|		    stringRemap[i] = nbatoms;
  592|  3.77k|		    stringMap[nbatoms] = xmlStrdup(value);
  593|  3.77k|		    if (stringMap[nbatoms] == NULL) {
  ------------------
  |  Branch (593:11): [True: 47, False: 3.73k]
  ------------------
  594|    204|			for (i = 0;i < nbatoms;i++)
  ------------------
  |  Branch (594:15): [True: 157, False: 47]
  ------------------
  595|    157|			    xmlFree(stringMap[i]);
  596|     47|			xmlFree(stringRemap);
  597|     47|			xmlFree(stringMap);
  598|     47|			xmlFree(stateRemap);
  599|     47|			xmlFree(ret);
  600|     47|			return(NULL);
  601|     47|		    }
  602|  3.73k|		    nbatoms++;
  603|  3.73k|		}
  604|  16.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|  16.9k|	}
  614|    925|	transitions = (int *) xmlRegCalloc2(nbstates + 1, nbatoms + 1,
  615|    925|                                            sizeof(int));
  616|    925|	if (transitions == NULL) {
  ------------------
  |  Branch (616:6): [True: 18, False: 907]
  ------------------
  617|     18|	    xmlFree(stateRemap);
  618|     18|	    xmlFree(stringRemap);
  619|    133|            for (i = 0;i < nbatoms;i++)
  ------------------
  |  Branch (619:24): [True: 115, False: 18]
  ------------------
  620|    115|		xmlFree(stringMap[i]);
  621|     18|	    xmlFree(stringMap);
  622|     18|	    xmlFree(ret);
  623|     18|	    return(NULL);
  624|     18|	}
  625|       |
  626|       |	/*
  627|       |	 * Allocate the transition table. The first entry for each
  628|       |	 * state corresponds to the state type.
  629|       |	 */
  630|    907|	transdata = NULL;
  631|       |
  632|  17.7k|	for (i = 0;i < ret->nbStates;i++) {
  ------------------
  |  Branch (632:13): [True: 16.8k, False: 907]
  ------------------
  633|  16.8k|	    int stateno, atomno, targetno, prev;
  634|  16.8k|	    xmlRegStatePtr state;
  635|  16.8k|	    xmlRegTransPtr trans;
  636|       |
  637|  16.8k|	    stateno = stateRemap[i];
  638|  16.8k|	    if (stateno == -1)
  ------------------
  |  Branch (638:10): [True: 3.24k, False: 13.6k]
  ------------------
  639|  3.24k|		continue;
  640|  13.6k|	    state = ret->states[i];
  641|       |
  642|  13.6k|	    transitions[stateno * (nbatoms + 1)] = state->type;
  643|       |
  644|  40.4k|	    for (j = 0;j < state->nbTrans;j++) {
  ------------------
  |  Branch (644:17): [True: 26.8k, False: 13.6k]
  ------------------
  645|  26.8k|		trans = &(state->trans[j]);
  646|  26.8k|		if ((trans->to < 0) || (trans->atom == NULL))
  ------------------
  |  Branch (646:7): [True: 6.64k, False: 20.1k]
  |  Branch (646:26): [True: 0, False: 20.1k]
  ------------------
  647|  6.64k|		    continue;
  648|  20.1k|                atomno = stringRemap[trans->atom->no];
  649|  20.1k|		if ((trans->atom->data != NULL) && (transdata == NULL)) {
  ------------------
  |  Branch (649:7): [True: 0, False: 20.1k]
  |  Branch (649:38): [True: 0, False: 0]
  ------------------
  650|      0|		    transdata = (void **) xmlRegCalloc2(nbstates, nbatoms,
  651|      0|			                                sizeof(void *));
  652|      0|		    if (transdata == NULL) {
  ------------------
  |  Branch (652:11): [True: 0, False: 0]
  ------------------
  653|      0|			xmlRegexpErrMemory(ctxt);
  654|      0|			break;
  655|      0|		    }
  656|      0|		}
  657|  20.1k|		targetno = stateRemap[trans->to];
  658|       |		/*
  659|       |		 * if the same atom can generate transitions to 2 different
  660|       |		 * states then it means the automata is not deterministic and
  661|       |		 * the compact form can't be used !
  662|       |		 */
  663|  20.1k|		prev = transitions[stateno * (nbatoms + 1) + atomno + 1];
  664|  20.1k|		if (prev != 0) {
  ------------------
  |  Branch (664:7): [True: 0, False: 20.1k]
  ------------------
  665|      0|		    if (prev != targetno + 1) {
  ------------------
  |  Branch (665:11): [True: 0, False: 0]
  ------------------
  666|      0|			ret->determinist = 0;
  667|      0|			if (transdata != NULL)
  ------------------
  |  Branch (667:8): [True: 0, False: 0]
  ------------------
  668|      0|			    xmlFree(transdata);
  669|      0|			xmlFree(transitions);
  670|      0|			xmlFree(stateRemap);
  671|      0|			xmlFree(stringRemap);
  672|      0|			for (i = 0;i < nbatoms;i++)
  ------------------
  |  Branch (672:15): [True: 0, False: 0]
  ------------------
  673|      0|			    xmlFree(stringMap[i]);
  674|      0|			xmlFree(stringMap);
  675|      0|			goto not_determ;
  676|      0|		    }
  677|  20.1k|		} else {
  678|  20.1k|		    transitions[stateno * (nbatoms + 1) + atomno + 1] =
  679|  20.1k|			targetno + 1; /* to avoid 0 */
  680|  20.1k|		    if (transdata != NULL)
  ------------------
  |  Branch (680:11): [True: 0, False: 20.1k]
  ------------------
  681|      0|			transdata[stateno * nbatoms + atomno] =
  682|      0|			    trans->atom->data;
  683|  20.1k|		}
  684|  20.1k|	    }
  685|  13.6k|	}
  686|    907|	ret->determinist = 1;
  687|       |	/*
  688|       |	 * Cleanup of the old data
  689|       |	 */
  690|    907|	if (ret->states != NULL) {
  ------------------
  |  Branch (690:6): [True: 907, False: 0]
  ------------------
  691|  17.7k|	    for (i = 0;i < ret->nbStates;i++)
  ------------------
  |  Branch (691:17): [True: 16.8k, False: 907]
  ------------------
  692|  16.8k|		xmlRegFreeState(ret->states[i]);
  693|    907|	    xmlFree(ret->states);
  694|    907|	}
  695|    907|	ret->states = NULL;
  696|    907|	ret->nbStates = 0;
  697|    907|	if (ret->atoms != NULL) {
  ------------------
  |  Branch (697:6): [True: 907, False: 0]
  ------------------
  698|  17.4k|	    for (i = 0;i < ret->nbAtoms;i++)
  ------------------
  |  Branch (698:17): [True: 16.5k, False: 907]
  ------------------
  699|  16.5k|		xmlRegFreeAtom(ret->atoms[i]);
  700|    907|	    xmlFree(ret->atoms);
  701|    907|	}
  702|    907|	ret->atoms = NULL;
  703|    907|	ret->nbAtoms = 0;
  704|       |
  705|    907|	ret->compact = transitions;
  706|    907|	ret->transdata = transdata;
  707|    907|	ret->stringMap = stringMap;
  708|    907|	ret->nbstrings = nbatoms;
  709|    907|	ret->nbstates = nbstates;
  710|    907|	xmlFree(stateRemap);
  711|    907|	xmlFree(stringRemap);
  712|    907|    }
  713|  1.31k|not_determ:
  714|  1.31k|    ctxt->string = NULL;
  715|  1.31k|    ctxt->nbStates = 0;
  716|  1.31k|    ctxt->states = NULL;
  717|  1.31k|    ctxt->nbAtoms = 0;
  718|  1.31k|    ctxt->atoms = NULL;
  719|  1.31k|    ctxt->nbCounters = 0;
  720|       |    ctxt->counters = NULL;
  721|  1.31k|    return(ret);
  722|  1.40k|}
xmlregexp.c:xmlRegCalloc2:
  478|    925|xmlRegCalloc2(size_t dim1, size_t dim2, size_t elemSize) {
  479|    925|    size_t numElems, totalSize;
  480|    925|    void *ret;
  481|       |
  482|       |    /* Check for overflow */
  483|    925|    if ((dim2 == 0) || (elemSize == 0) ||
  ------------------
  |  Branch (483:9): [True: 0, False: 925]
  |  Branch (483:24): [True: 0, False: 925]
  ------------------
  484|    925|        (dim1 > SIZE_MAX / dim2 / elemSize))
  ------------------
  |  Branch (484:9): [True: 0, False: 925]
  ------------------
  485|      0|        return (NULL);
  486|    925|    numElems = dim1 * dim2;
  487|    925|    if (numElems > XML_MAX_ITEMS)
  ------------------
  |  |   13|    925|#define XML_MAX_ITEMS 1000000000 /* 1 billion */
  ------------------
  |  Branch (487:9): [True: 0, False: 925]
  ------------------
  488|      0|        return NULL;
  489|    925|    totalSize = numElems * elemSize;
  490|    925|    ret = xmlMalloc(totalSize);
  491|    925|    if (ret != NULL)
  ------------------
  |  Branch (491:9): [True: 907, False: 18]
  ------------------
  492|    907|        memset(ret, 0, totalSize);
  493|    925|    return (ret);
  494|    925|}
xmlregexp.c:xmlRegFreeParserCtxt:
  956|  3.35k|xmlRegFreeParserCtxt(xmlRegParserCtxtPtr ctxt) {
  957|  3.35k|    int i;
  958|  3.35k|    if (ctxt == NULL)
  ------------------
  |  Branch (958:9): [True: 0, False: 3.35k]
  ------------------
  959|      0|	return;
  960|       |
  961|  3.35k|    if (ctxt->string != NULL)
  ------------------
  |  Branch (961:9): [True: 0, False: 3.35k]
  ------------------
  962|      0|	xmlFree(ctxt->string);
  963|  3.35k|    if (ctxt->states != NULL) {
  ------------------
  |  Branch (963:9): [True: 621, False: 2.73k]
  ------------------
  964|   147k|	for (i = 0;i < ctxt->nbStates;i++)
  ------------------
  |  Branch (964:13): [True: 146k, False: 621]
  ------------------
  965|   146k|	    xmlRegFreeState(ctxt->states[i]);
  966|    621|	xmlFree(ctxt->states);
  967|    621|    }
  968|  3.35k|    if (ctxt->atoms != NULL) {
  ------------------
  |  Branch (968:9): [True: 580, False: 2.77k]
  ------------------
  969|  87.8k|	for (i = 0;i < ctxt->nbAtoms;i++)
  ------------------
  |  Branch (969:13): [True: 87.3k, False: 580]
  ------------------
  970|  87.3k|	    xmlRegFreeAtom(ctxt->atoms[i]);
  971|    580|	xmlFree(ctxt->atoms);
  972|    580|    }
  973|  3.35k|    if (ctxt->counters != NULL)
  ------------------
  |  Branch (973:9): [True: 0, False: 3.35k]
  ------------------
  974|      0|	xmlFree(ctxt->counters);
  975|  3.35k|    xmlFree(ctxt);
  976|  3.35k|}
xmlregexp.c:xmlRegFreeState:
  939|   424k|xmlRegFreeState(xmlRegStatePtr state) {
  940|   424k|    if (state == NULL)
  ------------------
  |  Branch (940:9): [True: 99.9k, False: 324k]
  ------------------
  941|  99.9k|	return;
  942|       |
  943|   324k|    if (state->trans != NULL)
  ------------------
  |  Branch (943:9): [True: 320k, False: 4.07k]
  ------------------
  944|   320k|	xmlFree(state->trans);
  945|   324k|    if (state->transTo != NULL)
  ------------------
  |  Branch (945:9): [True: 321k, False: 3.38k]
  ------------------
  946|   321k|	xmlFree(state->transTo);
  947|   324k|    xmlFree(state);
  948|   324k|}
xmlregexp.c:xmlFAComputesDeterminism:
 2803|  1.40k|xmlFAComputesDeterminism(xmlRegParserCtxtPtr ctxt) {
 2804|  1.40k|    int statenr, transnr;
 2805|  1.40k|    xmlRegStatePtr state;
 2806|  1.40k|    xmlRegTransPtr t1, t2, last;
 2807|  1.40k|    int i;
 2808|  1.40k|    int ret = 1;
 2809|  1.40k|    int deep = 1;
 2810|       |
 2811|  1.40k|    if (ctxt->determinist != -1)
  ------------------
  |  Branch (2811:9): [True: 0, False: 1.40k]
  ------------------
 2812|      0|	return(ctxt->determinist);
 2813|       |
 2814|  1.40k|    if (ctxt->flags & AM_AUTOMATA_RNG)
  ------------------
  |  |  288|  1.40k|#define AM_AUTOMATA_RNG 1
  ------------------
  |  Branch (2814:9): [True: 0, False: 1.40k]
  ------------------
 2815|      0|        deep = 0;
 2816|       |
 2817|       |    /*
 2818|       |     * First cleanup the automata removing cancelled transitions
 2819|       |     */
 2820|   178k|    for (statenr = 0;statenr < ctxt->nbStates;statenr++) {
  ------------------
  |  Branch (2820:22): [True: 177k, False: 1.40k]
  ------------------
 2821|   177k|	state = ctxt->states[statenr];
 2822|   177k|	if (state == NULL)
  ------------------
  |  Branch (2822:6): [True: 98.9k, False: 78.2k]
  ------------------
 2823|  98.9k|	    continue;
 2824|  78.2k|	if (state->nbTrans < 2)
  ------------------
  |  Branch (2824:6): [True: 22.4k, False: 55.7k]
  ------------------
 2825|  22.4k|	    continue;
 2826|  1.05M|	for (transnr = 0;transnr < state->nbTrans;transnr++) {
  ------------------
  |  Branch (2826:19): [True: 1.00M, False: 55.7k]
  ------------------
 2827|  1.00M|	    t1 = &(state->trans[transnr]);
 2828|       |	    /*
 2829|       |	     * Determinism checks in case of counted or all transitions
 2830|       |	     * will have to be handled separately
 2831|       |	     */
 2832|  1.00M|	    if (t1->atom == NULL) {
  ------------------
  |  Branch (2832:10): [True: 106k, False: 894k]
  ------------------
 2833|       |		/* t1->nd = 1; */
 2834|   106k|		continue;
 2835|   106k|	    }
 2836|   894k|	    if (t1->to < 0) /* eliminated */
  ------------------
  |  Branch (2836:10): [True: 20.7k, False: 873k]
  ------------------
 2837|  20.7k|		continue;
 2838|   314M|	    for (i = 0;i < transnr;i++) {
  ------------------
  |  Branch (2838:17): [True: 313M, False: 873k]
  ------------------
 2839|   313M|		t2 = &(state->trans[i]);
 2840|   313M|		if (t2->to < 0) /* eliminated */
  ------------------
  |  Branch (2840:7): [True: 263M, False: 49.6M]
  ------------------
 2841|   263M|		    continue;
 2842|  49.6M|		if (t2->atom != NULL) {
  ------------------
  |  Branch (2842:7): [True: 49.6M, False: 0]
  ------------------
 2843|  49.6M|		    if (t1->to == t2->to) {
  ------------------
  |  Branch (2843:11): [True: 10.1M, False: 39.4M]
  ------------------
 2844|       |                        /*
 2845|       |                         * Here we use deep because we want to keep the
 2846|       |                         * transitions which indicate a conflict
 2847|       |                         */
 2848|  10.1M|			if (xmlFAEqualAtoms(t1->atom, t2->atom, deep) &&
  ------------------
  |  Branch (2848:8): [True: 231k, False: 9.93M]
  ------------------
 2849|   231k|                            (t1->counter == t2->counter) &&
  ------------------
  |  Branch (2849:29): [True: 231k, False: 0]
  ------------------
 2850|   231k|                            (t1->count == t2->count))
  ------------------
  |  Branch (2850:29): [True: 231k, False: 0]
  ------------------
 2851|   231k|			    t2->to = -1; /* eliminated */
 2852|  10.1M|		    }
 2853|  49.6M|		}
 2854|  49.6M|	    }
 2855|   873k|	}
 2856|  55.7k|    }
 2857|       |
 2858|       |    /*
 2859|       |     * Check for all states that there aren't 2 transitions
 2860|       |     * with the same atom and a different target.
 2861|       |     */
 2862|   178k|    for (statenr = 0;statenr < ctxt->nbStates;statenr++) {
  ------------------
  |  Branch (2862:22): [True: 177k, False: 1.40k]
  ------------------
 2863|   177k|	state = ctxt->states[statenr];
 2864|   177k|	if (state == NULL)
  ------------------
  |  Branch (2864:6): [True: 98.9k, False: 78.2k]
  ------------------
 2865|  98.9k|	    continue;
 2866|  78.2k|	if (state->nbTrans < 2)
  ------------------
  |  Branch (2866:6): [True: 22.4k, False: 55.7k]
  ------------------
 2867|  22.4k|	    continue;
 2868|  55.7k|	last = NULL;
 2869|  1.05M|	for (transnr = 0;transnr < state->nbTrans;transnr++) {
  ------------------
  |  Branch (2869:19): [True: 1.00M, False: 55.7k]
  ------------------
 2870|  1.00M|	    t1 = &(state->trans[transnr]);
 2871|       |	    /*
 2872|       |	     * Determinism checks in case of counted or all transitions
 2873|       |	     * will have to be handled separately
 2874|       |	     */
 2875|  1.00M|	    if (t1->atom == NULL) {
  ------------------
  |  Branch (2875:10): [True: 106k, False: 894k]
  ------------------
 2876|   106k|		continue;
 2877|   106k|	    }
 2878|   894k|	    if (t1->to < 0) /* eliminated */
  ------------------
  |  Branch (2878:10): [True: 252k, False: 641k]
  ------------------
 2879|   252k|		continue;
 2880|  47.9M|	    for (i = 0;i < transnr;i++) {
  ------------------
  |  Branch (2880:17): [True: 47.2M, False: 641k]
  ------------------
 2881|  47.2M|		t2 = &(state->trans[i]);
 2882|  47.2M|		if (t2->to < 0) /* eliminated */
  ------------------
  |  Branch (2882:7): [True: 12.7M, False: 34.5M]
  ------------------
 2883|  12.7M|		    continue;
 2884|  34.5M|		if (t2->atom != NULL) {
  ------------------
  |  Branch (2884:7): [True: 34.5M, False: 0]
  ------------------
 2885|       |                    /*
 2886|       |                     * But here we don't use deep because we want to
 2887|       |                     * find transitions which indicate a conflict
 2888|       |                     */
 2889|  34.5M|		    if (xmlFACompareAtoms(t1->atom, t2->atom, 1)) {
  ------------------
  |  Branch (2889:11): [True: 8.02M, False: 26.4M]
  ------------------
 2890|       |                        /*
 2891|       |                         * Treat equal counter transitions that couldn't be
 2892|       |                         * eliminated as deterministic.
 2893|       |                         */
 2894|  8.02M|                        if ((t1->to != t2->to) ||
  ------------------
  |  Branch (2894:29): [True: 8.02M, 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|  8.02M|                            ret = 0;
 2898|       |			/* mark the transitions as non-deterministic ones */
 2899|  8.02M|			t1->nd = 1;
 2900|  8.02M|			t2->nd = 1;
 2901|  8.02M|			last = t1;
 2902|  8.02M|		    }
 2903|  34.5M|		} 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|  34.5M|	    }
 2926|       |	    /* don't shortcut the computation so all non deterministic
 2927|       |	       transition get marked down
 2928|       |	    if (ret == 0)
 2929|       |		break; */
 2930|   641k|	}
 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|  55.7k|	if (last != NULL) {
  ------------------
  |  Branch (2937:6): [True: 32.8k, False: 22.9k]
  ------------------
 2938|  32.8k|	    last->nd = 2;
 2939|  32.8k|	}
 2940|       |
 2941|       |	/* don't shortcut the computation so all non deterministic
 2942|       |	   transition get marked down
 2943|       |	if (ret == 0)
 2944|       |	    break; */
 2945|  55.7k|    }
 2946|       |
 2947|  1.40k|    ctxt->determinist = ret;
 2948|  1.40k|    return(ret);
 2949|  1.40k|}
xmlregexp.c:xmlFAEqualAtoms:
 2581|  10.1M|xmlFAEqualAtoms(xmlRegAtomPtr atom1, xmlRegAtomPtr atom2, int deep) {
 2582|  10.1M|    int ret = 0;
 2583|       |
 2584|  10.1M|    if (atom1 == atom2)
  ------------------
  |  Branch (2584:9): [True: 0, False: 10.1M]
  ------------------
 2585|      0|	return(1);
 2586|  10.1M|    if ((atom1 == NULL) || (atom2 == NULL))
  ------------------
  |  Branch (2586:9): [True: 0, False: 10.1M]
  |  Branch (2586:28): [True: 0, False: 10.1M]
  ------------------
 2587|      0|	return(0);
 2588|       |
 2589|  10.1M|    if (atom1->type != atom2->type)
  ------------------
  |  Branch (2589:9): [True: 0, False: 10.1M]
  ------------------
 2590|      0|        return(0);
 2591|  10.1M|    switch (atom1->type) {
 2592|      0|        case XML_REGEXP_EPSILON:
  ------------------
  |  Branch (2592:9): [True: 0, False: 10.1M]
  ------------------
 2593|      0|	    ret = 0;
 2594|      0|	    break;
 2595|  10.1M|        case XML_REGEXP_STRING:
  ------------------
  |  Branch (2595:9): [True: 10.1M, False: 0]
  ------------------
 2596|  10.1M|            if (!deep)
  ------------------
  |  Branch (2596:17): [True: 0, False: 10.1M]
  ------------------
 2597|      0|                ret = (atom1->valuep == atom2->valuep);
 2598|  10.1M|            else
 2599|  10.1M|                ret = xmlStrEqual((xmlChar *)atom1->valuep,
 2600|  10.1M|                                  (xmlChar *)atom2->valuep);
 2601|  10.1M|	    break;
 2602|      0|        case XML_REGEXP_CHARVAL:
  ------------------
  |  Branch (2602:9): [True: 0, False: 10.1M]
  ------------------
 2603|      0|	    ret = (atom1->codepoint == atom2->codepoint);
 2604|      0|	    break;
 2605|      0|	case XML_REGEXP_RANGES:
  ------------------
  |  Branch (2605:2): [True: 0, False: 10.1M]
  ------------------
 2606|       |	    /* too hard to do in the general case */
 2607|      0|	    ret = 0;
 2608|      0|	default:
  ------------------
  |  Branch (2608:2): [True: 0, False: 10.1M]
  ------------------
 2609|      0|	    break;
 2610|  10.1M|    }
 2611|  10.1M|    return(ret);
 2612|  10.1M|}
xmlregexp.c:xmlFACompareAtoms:
 2624|  34.5M|xmlFACompareAtoms(xmlRegAtomPtr atom1, xmlRegAtomPtr atom2, int deep) {
 2625|  34.5M|    int ret = 1;
 2626|       |
 2627|  34.5M|    if (atom1 == atom2)
  ------------------
  |  Branch (2627:9): [True: 0, False: 34.5M]
  ------------------
 2628|      0|	return(1);
 2629|  34.5M|    if ((atom1 == NULL) || (atom2 == NULL))
  ------------------
  |  Branch (2629:9): [True: 0, False: 34.5M]
  |  Branch (2629:28): [True: 0, False: 34.5M]
  ------------------
 2630|      0|	return(0);
 2631|       |
 2632|  34.5M|    if ((atom1->type == XML_REGEXP_ANYCHAR) ||
  ------------------
  |  Branch (2632:9): [True: 0, False: 34.5M]
  ------------------
 2633|  34.5M|        (atom2->type == XML_REGEXP_ANYCHAR))
  ------------------
  |  Branch (2633:9): [True: 0, False: 34.5M]
  ------------------
 2634|      0|	return(1);
 2635|       |
 2636|  34.5M|    if (atom1->type > atom2->type) {
  ------------------
  |  Branch (2636:9): [True: 0, False: 34.5M]
  ------------------
 2637|      0|	xmlRegAtomPtr tmp;
 2638|      0|	tmp = atom1;
 2639|      0|	atom1 = atom2;
 2640|      0|	atom2 = tmp;
 2641|      0|    }
 2642|  34.5M|    if (atom1->type != atom2->type) {
  ------------------
  |  Branch (2642:9): [True: 0, False: 34.5M]
  ------------------
 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|  34.5M|    switch (atom1->type) {
 2649|  34.5M|        case XML_REGEXP_STRING:
  ------------------
  |  Branch (2649:9): [True: 34.5M, False: 0]
  ------------------
 2650|  34.5M|            if (!deep)
  ------------------
  |  Branch (2650:17): [True: 0, False: 34.5M]
  ------------------
 2651|      0|                ret = (atom1->valuep != atom2->valuep);
 2652|  34.5M|            else {
 2653|  34.5M|                xmlChar *val1 = (xmlChar *)atom1->valuep;
 2654|  34.5M|                xmlChar *val2 = (xmlChar *)atom2->valuep;
 2655|  34.5M|                int compound1 = (xmlStrchr(val1, '|') != NULL);
 2656|  34.5M|                int compound2 = (xmlStrchr(val2, '|') != NULL);
 2657|       |
 2658|       |                /* Ignore negative match flag for ##other namespaces */
 2659|  34.5M|                if (compound1 != compound2)
  ------------------
  |  Branch (2659:21): [True: 0, False: 34.5M]
  ------------------
 2660|      0|                    return(0);
 2661|       |
 2662|  34.5M|                ret = xmlRegStrEqualWildcard(val1, val2);
 2663|  34.5M|            }
 2664|  34.5M|	    break;
 2665|  34.5M|        case XML_REGEXP_EPSILON:
  ------------------
  |  Branch (2665:9): [True: 0, False: 34.5M]
  ------------------
 2666|      0|	    goto not_determinist;
 2667|      0|        case XML_REGEXP_CHARVAL:
  ------------------
  |  Branch (2667:9): [True: 0, False: 34.5M]
  ------------------
 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: 34.5M]
  ------------------
 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: 34.5M]
  ------------------
 2699|      0|	    goto not_determinist;
 2700|  34.5M|    }
 2701|  34.5M|done:
 2702|  34.5M|    if (atom1->neg != atom2->neg) {
  ------------------
  |  Branch (2702:9): [True: 0, False: 34.5M]
  ------------------
 2703|      0|        ret = !ret;
 2704|      0|    }
 2705|  34.5M|    if (ret == 0)
  ------------------
  |  Branch (2705:9): [True: 26.4M, False: 8.02M]
  ------------------
 2706|  26.4M|        return(0);
 2707|  8.02M|not_determinist:
 2708|  8.02M|    return(1);
 2709|  34.5M|}
xmlregexp.c:xmlRegFreeAtom:
  855|   207k|xmlRegFreeAtom(xmlRegAtomPtr atom) {
  856|   207k|    int i;
  857|       |
  858|   207k|    if (atom == NULL)
  ------------------
  |  Branch (858:9): [True: 0, False: 207k]
  ------------------
  859|      0|	return;
  860|       |
  861|   207k|    for (i = 0;i < atom->nbRanges;i++)
  ------------------
  |  Branch (861:16): [True: 0, False: 207k]
  ------------------
  862|      0|	xmlRegFreeRange(atom->ranges[i]);
  863|   207k|    if (atom->ranges != NULL)
  ------------------
  |  Branch (863:9): [True: 0, False: 207k]
  ------------------
  864|      0|	xmlFree(atom->ranges);
  865|   207k|    if ((atom->type == XML_REGEXP_STRING) && (atom->valuep != NULL))
  ------------------
  |  Branch (865:9): [True: 207k, False: 0]
  |  Branch (865:46): [True: 207k, False: 33]
  ------------------
  866|   207k|	xmlFree(atom->valuep);
  867|   207k|    if ((atom->type == XML_REGEXP_STRING) && (atom->valuep2 != NULL))
  ------------------
  |  Branch (867:9): [True: 207k, False: 0]
  |  Branch (867:46): [True: 0, False: 207k]
  ------------------
  868|      0|	xmlFree(atom->valuep2);
  869|   207k|    if ((atom->type == XML_REGEXP_BLOCK_NAME) && (atom->valuep != NULL))
  ------------------
  |  Branch (869:9): [True: 0, False: 207k]
  |  Branch (869:50): [True: 0, False: 0]
  ------------------
  870|      0|	xmlFree(atom->valuep);
  871|   207k|    xmlFree(atom);
  872|   207k|}
xmlregexp.c:xmlRegNewAtom:
  833|   207k|xmlRegNewAtom(xmlRegParserCtxtPtr ctxt, xmlRegAtomType type) {
  834|   207k|    xmlRegAtomPtr ret;
  835|       |
  836|   207k|    ret = (xmlRegAtomPtr) xmlMalloc(sizeof(xmlRegAtom));
  837|   207k|    if (ret == NULL) {
  ------------------
  |  Branch (837:9): [True: 43, False: 207k]
  ------------------
  838|     43|	xmlRegexpErrMemory(ctxt);
  839|     43|	return(NULL);
  840|     43|    }
  841|   207k|    memset(ret, 0, sizeof(xmlRegAtom));
  842|   207k|    ret->type = type;
  843|   207k|    ret->quant = XML_REGEXP_QUANT_ONCE;
  844|   207k|    ret->min = 0;
  845|   207k|    ret->max = 0;
  846|   207k|    return(ret);
  847|   207k|}
xmlregexp.c:xmlRegexpErrMemory:
  427|    554|{
  428|    554|    if (ctxt != NULL)
  ------------------
  |  Branch (428:9): [True: 554, False: 0]
  ------------------
  429|    554|        ctxt->error = XML_ERR_NO_MEMORY;
  430|       |
  431|    554|    xmlRaiseMemoryError(NULL, NULL, NULL, XML_FROM_REGEXP, NULL);
  432|    554|}
xmlregexp.c:xmlFAGenerateTransitions:
 1698|   207k|	                 xmlRegStatePtr to, xmlRegAtomPtr atom) {
 1699|   207k|    xmlRegStatePtr end;
 1700|   207k|    int nullable = 0;
 1701|       |
 1702|   207k|    if (atom == NULL) {
  ------------------
  |  Branch (1702:9): [True: 0, False: 207k]
  ------------------
 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|   207k|    if (atom->type == XML_REGEXP_SUBREG) {
  ------------------
  |  Branch (1706:9): [True: 0, False: 207k]
  ------------------
 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|   207k|    if ((atom->min == 0) && (atom->max == 0) &&
  ------------------
  |  Branch (1849:9): [True: 207k, False: 0]
  |  Branch (1849:29): [True: 207k, False: 0]
  ------------------
 1850|   207k|               (atom->quant == XML_REGEXP_QUANT_RANGE)) {
  ------------------
  |  Branch (1850:16): [True: 0, False: 207k]
  ------------------
 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|   207k|    if (to == NULL) {
  ------------------
  |  Branch (1864:9): [True: 185k, False: 22.0k]
  ------------------
 1865|   185k|	to = xmlRegStatePush(ctxt);
 1866|   185k|	if (to == NULL)
  ------------------
  |  Branch (1866:6): [True: 57, False: 185k]
  ------------------
 1867|     57|	    return(-1);
 1868|   185k|    }
 1869|   207k|    end = to;
 1870|   207k|    if ((atom->quant == XML_REGEXP_QUANT_MULT) ||
  ------------------
  |  Branch (1870:9): [True: 0, False: 207k]
  ------------------
 1871|   207k|        (atom->quant == XML_REGEXP_QUANT_PLUS)) {
  ------------------
  |  Branch (1871:9): [True: 0, False: 207k]
  ------------------
 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|   207k|    if ((atom->quant == XML_REGEXP_QUANT_RANGE) &&
  ------------------
  |  Branch (1885:9): [True: 0, False: 207k]
  ------------------
 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|   207k|    xmlRegStateAddTrans(ctxt, from, atom, to, -1, -1);
 1893|   207k|    ctxt->state = end;
 1894|   207k|    switch (atom->quant) {
 1895|      0|	case XML_REGEXP_QUANT_OPT:
  ------------------
  |  Branch (1895:2): [True: 0, False: 207k]
  ------------------
 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: 207k]
  ------------------
 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: 207k]
  ------------------
 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: 207k]
  ------------------
 1909|      0|	    if (nullable)
  ------------------
  |  Branch (1909:10): [True: 0, False: 0]
  ------------------
 1910|      0|		xmlFAGenerateEpsilonTransition(ctxt, from, to);
 1911|      0|	    break;
 1912|   207k|	default:
  ------------------
  |  Branch (1912:2): [True: 207k, False: 0]
  ------------------
 1913|   207k|	    break;
 1914|   207k|    }
 1915|   207k|    if (xmlRegAtomPush(ctxt, atom) < 0)
  ------------------
  |  Branch (1915:9): [True: 20, False: 207k]
  ------------------
 1916|     20|	return(-1);
 1917|   207k|    return(0);
 1918|   207k|}
xmlregexp.c:xmlRegStateAddTrans:
 1521|  8.34M|		    int counter, int count) {
 1522|       |
 1523|  8.34M|    int nrtrans;
 1524|       |
 1525|  8.34M|    if (state == NULL) {
  ------------------
  |  Branch (1525:9): [True: 0, False: 8.34M]
  ------------------
 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|  8.34M|    if (target == NULL) {
  ------------------
  |  Branch (1529:9): [True: 4, False: 8.34M]
  ------------------
 1530|      4|	ERROR("add state: target is NULL");
  ------------------
  |  |   47|      4|    ctxt->error = XML_REGEXP_COMPILE_ERROR;				\
  |  |   48|      4|    xmlRegexpErrCompile(ctxt, str);
  ------------------
 1531|      4|	return;
 1532|      4|    }
 1533|       |    /*
 1534|       |     * Other routines follow the philosophy 'When in doubt, add a transition'
 1535|       |     * so we check here whether such a transition is already present and, if
 1536|       |     * so, silently ignore this request.
 1537|       |     */
 1538|       |
 1539|  1.04G|    for (nrtrans = state->nbTrans - 1; nrtrans >= 0; nrtrans--) {
  ------------------
  |  Branch (1539:40): [True: 1.04G, False: 1.60M]
  ------------------
 1540|  1.04G|	xmlRegTransPtr trans = &(state->trans[nrtrans]);
 1541|  1.04G|	if ((trans->atom == atom) &&
  ------------------
  |  Branch (1541:6): [True: 7.25M, False: 1.03G]
  ------------------
 1542|  7.25M|	    (trans->to == target->no) &&
  ------------------
  |  Branch (1542:6): [True: 6.74M, False: 515k]
  ------------------
 1543|  6.74M|	    (trans->counter == counter) &&
  ------------------
  |  Branch (1543:6): [True: 6.74M, False: 0]
  ------------------
 1544|  6.74M|	    (trans->count == count)) {
  ------------------
  |  Branch (1544:6): [True: 6.74M, False: 0]
  ------------------
 1545|  6.74M|	    return;
 1546|  6.74M|	}
 1547|  1.04G|    }
 1548|       |
 1549|  1.60M|    if (state->nbTrans >= state->maxTrans) {
  ------------------
  |  Branch (1549:9): [True: 697k, False: 910k]
  ------------------
 1550|   697k|	xmlRegTrans *tmp;
 1551|   697k|        int newSize;
 1552|       |
 1553|   697k|        newSize = xmlGrowCapacity(state->maxTrans, sizeof(tmp[0]),
 1554|   697k|                                  8, XML_MAX_ITEMS);
  ------------------
  |  |   13|   697k|#define XML_MAX_ITEMS 1000000000 /* 1 billion */
  ------------------
 1555|   697k|	if (newSize < 0) {
  ------------------
  |  Branch (1555:6): [True: 0, False: 697k]
  ------------------
 1556|      0|	    xmlRegexpErrMemory(ctxt);
 1557|      0|	    return;
 1558|      0|	}
 1559|   697k|	tmp = xmlRealloc(state->trans, newSize * sizeof(tmp[0]));
 1560|   697k|	if (tmp == NULL) {
  ------------------
  |  Branch (1560:6): [True: 142, False: 697k]
  ------------------
 1561|    142|	    xmlRegexpErrMemory(ctxt);
 1562|    142|	    return;
 1563|    142|	}
 1564|   697k|	state->trans = tmp;
 1565|   697k|	state->maxTrans = newSize;
 1566|   697k|    }
 1567|       |
 1568|  1.60M|    state->trans[state->nbTrans].atom = atom;
 1569|  1.60M|    state->trans[state->nbTrans].to = target->no;
 1570|  1.60M|    state->trans[state->nbTrans].counter = counter;
 1571|  1.60M|    state->trans[state->nbTrans].count = count;
 1572|  1.60M|    state->trans[state->nbTrans].nd = 0;
 1573|  1.60M|    state->nbTrans++;
 1574|  1.60M|    xmlRegStateAddTransTo(ctxt, target, state->no);
 1575|  1.60M|}
xmlregexp.c:xmlRegStateAddTransTo:
 1495|  1.60M|                      int from) {
 1496|  1.60M|    if (target->nbTransTo >= target->maxTransTo) {
  ------------------
  |  Branch (1496:9): [True: 683k, False: 924k]
  ------------------
 1497|   683k|	int *tmp;
 1498|   683k|        int newSize;
 1499|       |
 1500|   683k|        newSize = xmlGrowCapacity(target->maxTransTo, sizeof(tmp[0]),
 1501|   683k|                                  8, XML_MAX_ITEMS);
  ------------------
  |  |   13|   683k|#define XML_MAX_ITEMS 1000000000 /* 1 billion */
  ------------------
 1502|   683k|	if (newSize < 0) {
  ------------------
  |  Branch (1502:6): [True: 0, False: 683k]
  ------------------
 1503|      0|	    xmlRegexpErrMemory(ctxt);
 1504|      0|	    return;
 1505|      0|	}
 1506|   683k|	tmp = xmlRealloc(target->transTo, newSize * sizeof(tmp[0]));
 1507|   683k|	if (tmp == NULL) {
  ------------------
  |  Branch (1507:6): [True: 126, False: 682k]
  ------------------
 1508|    126|	    xmlRegexpErrMemory(ctxt);
 1509|    126|	    return;
 1510|    126|	}
 1511|   682k|	target->transTo = tmp;
 1512|   682k|	target->maxTransTo = newSize;
 1513|   682k|    }
 1514|  1.60M|    target->transTo[target->nbTransTo] = from;
 1515|  1.60M|    target->nbTransTo++;
 1516|  1.60M|}
xmlregexp.c:xmlRegAtomPush:
 1465|   207k|xmlRegAtomPush(xmlRegParserCtxtPtr ctxt, xmlRegAtomPtr atom) {
 1466|   207k|    if (atom == NULL) {
  ------------------
  |  Branch (1466:9): [True: 0, False: 207k]
  ------------------
 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|   207k|    if (ctxt->nbAtoms >= ctxt->maxAtoms) {
  ------------------
  |  Branch (1470:9): [True: 9.47k, False: 198k]
  ------------------
 1471|  9.47k|	xmlRegAtomPtr *tmp;
 1472|  9.47k|        int newSize;
 1473|       |
 1474|  9.47k|        newSize = xmlGrowCapacity(ctxt->maxAtoms, sizeof(tmp[0]),
 1475|  9.47k|                                  4, XML_MAX_ITEMS);
  ------------------
  |  |   13|  9.47k|#define XML_MAX_ITEMS 1000000000 /* 1 billion */
  ------------------
 1476|  9.47k|	if (newSize < 0) {
  ------------------
  |  Branch (1476:6): [True: 0, False: 9.47k]
  ------------------
 1477|      0|	    xmlRegexpErrMemory(ctxt);
 1478|      0|	    return(-1);
 1479|      0|	}
 1480|  9.47k|	tmp = xmlRealloc(ctxt->atoms, newSize * sizeof(tmp[0]));
 1481|  9.47k|	if (tmp == NULL) {
  ------------------
  |  Branch (1481:6): [True: 20, False: 9.45k]
  ------------------
 1482|     20|	    xmlRegexpErrMemory(ctxt);
 1483|     20|	    return(-1);
 1484|     20|	}
 1485|  9.45k|	ctxt->atoms = tmp;
 1486|  9.45k|        ctxt->maxAtoms = newSize;
 1487|  9.45k|    }
 1488|   207k|    atom->no = ctxt->nbAtoms;
 1489|   207k|    ctxt->atoms[ctxt->nbAtoms++] = atom;
 1490|   207k|    return(0);
 1491|   207k|}
xmlregexp.c:xmlFAGenerateEpsilonTransition:
 1640|   310k|			       xmlRegStatePtr from, xmlRegStatePtr to) {
 1641|   310k|    if (to == NULL) {
  ------------------
  |  Branch (1641:9): [True: 100k, False: 209k]
  ------------------
 1642|   100k|	to = xmlRegStatePush(ctxt);
 1643|   100k|        if (to == NULL)
  ------------------
  |  Branch (1643:13): [True: 26, False: 100k]
  ------------------
 1644|     26|            return(-1);
 1645|   100k|	ctxt->state = to;
 1646|   100k|    }
 1647|   310k|    xmlRegStateAddTrans(ctxt, from, NULL, to, -1, -1);
 1648|   310k|    return(0);
 1649|   310k|}

xmlSaveSetIndentString:
  126|  30.6k|xmlSaveSetIndentString(xmlSaveCtxt *ctxt, const char *indent) {
  127|  30.6k|    size_t len;
  128|  30.6k|    int i;
  129|       |
  130|  30.6k|    if ((ctxt == NULL) || (indent == NULL))
  ------------------
  |  Branch (130:9): [True: 0, False: 30.6k]
  |  Branch (130:27): [True: 0, False: 30.6k]
  ------------------
  131|      0|        return(-1);
  132|       |
  133|  30.6k|    len = strlen(indent);
  134|  30.6k|    if ((len <= 0) || (len > MAX_INDENT))
  ------------------
  |  |   20|  30.6k|#define MAX_INDENT 60
  ------------------
  |  Branch (134:9): [True: 0, False: 30.6k]
  |  Branch (134:23): [True: 0, False: 30.6k]
  ------------------
  135|      0|        return(-1);
  136|       |
  137|  30.6k|    ctxt->indent_size = len;
  138|  30.6k|    ctxt->indent_nr = MAX_INDENT / ctxt->indent_size;
  ------------------
  |  |   20|  30.6k|#define MAX_INDENT 60
  ------------------
  139|   950k|    for (i = 0; i < ctxt->indent_nr; i++)
  ------------------
  |  Branch (139:17): [True: 919k, False: 30.6k]
  ------------------
  140|   919k|        memcpy(&ctxt->indent[i * ctxt->indent_size], indent, len);
  141|       |
  142|  30.6k|    return(0);
  143|  30.6k|}
xmlNodeDumpOutput:
 2334|  30.6k|{
 2335|  30.6k|    xmlSaveCtxt ctxt;
 2336|  30.6k|    int options;
 2337|  30.6k|#ifdef LIBXML_HTML_ENABLED
 2338|  30.6k|    xmlDtdPtr dtd;
 2339|  30.6k|    int is_xhtml = 0;
 2340|  30.6k|#endif
 2341|       |
 2342|  30.6k|    (void) doc;
 2343|       |
 2344|  30.6k|    xmlInitParser();
 2345|       |
 2346|  30.6k|    if ((buf == NULL) || (cur == NULL)) return;
  ------------------
  |  Branch (2346:9): [True: 0, False: 30.6k]
  |  Branch (2346:26): [True: 0, False: 30.6k]
  ------------------
 2347|       |
 2348|  30.6k|    if (level < 0)
  ------------------
  |  Branch (2348:9): [True: 0, False: 30.6k]
  ------------------
 2349|      0|        level = 0;
 2350|  30.6k|    else if (level > 100)
  ------------------
  |  Branch (2350:14): [True: 0, False: 30.6k]
  ------------------
 2351|      0|        level = 100;
 2352|       |
 2353|  30.6k|    if (encoding == NULL)
  ------------------
  |  Branch (2353:9): [True: 30.6k, False: 0]
  ------------------
 2354|  30.6k|        encoding = "UTF-8";
 2355|       |
 2356|  30.6k|    memset(&ctxt, 0, sizeof(ctxt));
 2357|  30.6k|    ctxt.buf = buf;
 2358|  30.6k|    ctxt.level = level;
 2359|  30.6k|    ctxt.encoding = (const xmlChar *) encoding;
 2360|       |
 2361|  30.6k|    options = XML_SAVE_AS_XML;
 2362|  30.6k|    if (format)
  ------------------
  |  Branch (2362:9): [True: 0, False: 30.6k]
  ------------------
 2363|      0|        options |= XML_SAVE_FORMAT;
 2364|  30.6k|    xmlSaveCtxtInit(&ctxt, options);
 2365|       |
 2366|  30.6k|#ifdef LIBXML_HTML_ENABLED
 2367|  30.6k|    dtd = xmlGetIntSubset(doc);
 2368|  30.6k|    if (dtd != NULL) {
  ------------------
  |  Branch (2368:9): [True: 25.1k, False: 5.52k]
  ------------------
 2369|  25.1k|	is_xhtml = xmlIsXHTML(dtd->SystemID, dtd->ExternalID);
 2370|  25.1k|	if (is_xhtml < 0)
  ------------------
  |  Branch (2370:6): [True: 6.07k, False: 19.0k]
  ------------------
 2371|  6.07k|	    is_xhtml = 0;
 2372|  25.1k|    }
 2373|       |
 2374|  30.6k|    if (is_xhtml)
  ------------------
  |  Branch (2374:9): [True: 17.4k, False: 13.2k]
  ------------------
 2375|  17.4k|        xhtmlNodeDumpOutput(&ctxt, cur);
 2376|  13.2k|    else
 2377|  13.2k|#endif
 2378|  13.2k|        xmlNodeDumpOutputInternal(&ctxt, cur);
 2379|  30.6k|}
xmlsave.c:xmlNsDumpOutput:
  762|   795k|xmlNsDumpOutput(xmlOutputBufferPtr buf, xmlNsPtr cur, xmlSaveCtxtPtr ctxt) {
  763|   795k|    unsigned escapeFlags = XML_ESCAPE_ATTR;
  ------------------
  |  |   22|   795k|#define XML_ESCAPE_ATTR             (1u << 0)
  ------------------
  764|       |
  765|   795k|    if ((cur == NULL) || (buf == NULL)) return;
  ------------------
  |  Branch (765:9): [True: 0, False: 795k]
  |  Branch (765:26): [True: 0, False: 795k]
  ------------------
  766|       |
  767|   795k|    if ((ctxt == NULL) || (ctxt->encoding == NULL))
  ------------------
  |  Branch (767:9): [True: 0, False: 795k]
  |  Branch (767:27): [True: 0, False: 795k]
  ------------------
  768|      0|        escapeFlags |= XML_ESCAPE_NON_ASCII;
  ------------------
  |  |   23|      0|#define XML_ESCAPE_NON_ASCII        (1u << 1)
  ------------------
  769|       |
  770|   795k|    if ((cur->type == XML_LOCAL_NAMESPACE) && (cur->href != NULL)) {
  ------------------
  |  |  500|   795k|#define XML_LOCAL_NAMESPACE XML_NAMESPACE_DECL
  ------------------
  |  Branch (770:9): [True: 795k, False: 0]
  |  Branch (770:47): [True: 791k, False: 3.84k]
  ------------------
  771|   791k|	if (xmlStrEqual(cur->prefix, BAD_CAST "xml"))
  ------------------
  |  |   34|   791k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (771:6): [True: 206, False: 791k]
  ------------------
  772|    206|	    return;
  773|       |
  774|   791k|	if (ctxt != NULL && ctxt->format == 2)
  ------------------
  |  Branch (774:6): [True: 791k, False: 0]
  |  Branch (774:22): [True: 0, False: 791k]
  ------------------
  775|      0|	    xmlOutputBufferWriteWSNonSig(ctxt, 2);
  776|   791k|	else
  777|   791k|	    xmlOutputBufferWrite(buf, 1, " ");
  778|       |
  779|       |        /* Within the context of an element attributes */
  780|   791k|	if (cur->prefix != NULL) {
  ------------------
  |  Branch (780:6): [True: 786k, False: 5.12k]
  ------------------
  781|   786k|	    xmlOutputBufferWrite(buf, 6, "xmlns:");
  782|   786k|	    xmlOutputBufferWriteString(buf, (const char *)cur->prefix);
  783|   786k|	} else
  784|  5.12k|	    xmlOutputBufferWrite(buf, 5, "xmlns");
  785|   791k|        xmlOutputBufferWrite(buf, 2, "=\"");
  786|       |        xmlSerializeText(buf, cur->href, SIZE_MAX, escapeFlags);
  787|   791k|        xmlOutputBufferWrite(buf, 1, "\"");
  788|   791k|    }
  789|   795k|}
xmlsave.c:xmlSaveDocInternal:
 1226|  3.85k|                   const xmlChar *encoding) {
 1227|  3.85k|#ifdef LIBXML_HTML_ENABLED
 1228|  3.85k|    xmlDtdPtr dtd;
 1229|  3.85k|    int is_xhtml = 0;
 1230|  3.85k|#endif
 1231|  3.85k|    xmlOutputBufferPtr buf = ctxt->buf;
 1232|  3.85k|    int switched_encoding = 0;
 1233|       |
 1234|  3.85k|    xmlInitParser();
 1235|       |
 1236|  3.85k|    if ((cur->type != XML_HTML_DOCUMENT_NODE) &&
  ------------------
  |  Branch (1236:9): [True: 3.85k, False: 0]
  ------------------
 1237|  3.85k|        (cur->type != XML_DOCUMENT_NODE))
  ------------------
  |  Branch (1237:9): [True: 0, False: 3.85k]
  ------------------
 1238|      0|	 return(-1);
 1239|       |
 1240|  3.85k|    if (encoding == NULL)
  ------------------
  |  Branch (1240:9): [True: 0, False: 3.85k]
  ------------------
 1241|      0|	encoding = cur->encoding;
 1242|       |
 1243|  3.85k|    if (((cur->type == XML_HTML_DOCUMENT_NODE) &&
  ------------------
  |  Branch (1243:10): [True: 0, False: 3.85k]
  ------------------
 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|  3.85k|        (ctxt->options & XML_SAVE_AS_HTML)) {
  ------------------
  |  Branch (1246:9): [True: 0, False: 3.85k]
  ------------------
 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|  3.85k|    } else if ((cur->type == XML_DOCUMENT_NODE) ||
  ------------------
  |  Branch (1267:16): [True: 3.85k, False: 0]
  ------------------
 1268|      0|               (ctxt->options & XML_SAVE_AS_XML) ||
  ------------------
  |  Branch (1268:16): [True: 0, False: 0]
  ------------------
 1269|  3.85k|               (ctxt->options & XML_SAVE_XHTML)) {
  ------------------
  |  Branch (1269:16): [True: 0, False: 0]
  ------------------
 1270|  3.85k|	if ((encoding != NULL) && (ctxt->encoding == NULL)) {
  ------------------
  |  Branch (1270:6): [True: 3.85k, False: 0]
  |  Branch (1270:28): [True: 0, False: 3.85k]
  ------------------
 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|  3.85k|	if ((ctxt->options & XML_SAVE_NO_DECL) == 0) {
  ------------------
  |  Branch (1279:6): [True: 3.85k, False: 0]
  ------------------
 1280|  3.85k|	    xmlOutputBufferWrite(buf, 15, "<?xml version=\"");
 1281|  3.85k|	    if (cur->version != NULL)
  ------------------
  |  Branch (1281:10): [True: 3.85k, False: 0]
  ------------------
 1282|  3.85k|		xmlOutputBufferWriteString(buf, (char *) cur->version);
 1283|      0|	    else
 1284|      0|		xmlOutputBufferWrite(buf, 3, "1.0");
 1285|  3.85k|	    xmlOutputBufferWrite(buf, 1, "\"");
 1286|  3.85k|	    if (encoding != NULL) {
  ------------------
  |  Branch (1286:10): [True: 3.85k, False: 0]
  ------------------
 1287|  3.85k|		xmlOutputBufferWrite(buf, 11, " encoding=\"");
 1288|  3.85k|		xmlOutputBufferWriteString(buf, (char *) encoding);
 1289|  3.85k|	        xmlOutputBufferWrite(buf, 1, "\"");
 1290|  3.85k|	    }
 1291|  3.85k|	    switch (cur->standalone) {
  ------------------
  |  Branch (1291:14): [True: 148, False: 3.70k]
  ------------------
 1292|     81|		case 0:
  ------------------
  |  Branch (1292:3): [True: 81, False: 3.76k]
  ------------------
 1293|     81|		    xmlOutputBufferWrite(buf, 16, " standalone=\"no\"");
 1294|     81|		    break;
 1295|     67|		case 1:
  ------------------
  |  Branch (1295:3): [True: 67, False: 3.78k]
  ------------------
 1296|     67|		    xmlOutputBufferWrite(buf, 17, " standalone=\"yes\"");
 1297|     67|		    break;
 1298|  3.85k|	    }
 1299|  3.85k|	    xmlOutputBufferWrite(buf, 3, "?>\n");
 1300|  3.85k|	}
 1301|       |
 1302|  3.85k|#ifdef LIBXML_HTML_ENABLED
 1303|  3.85k|        if (ctxt->options & XML_SAVE_XHTML)
  ------------------
  |  Branch (1303:13): [True: 181, False: 3.66k]
  ------------------
 1304|    181|            is_xhtml = 1;
 1305|  3.85k|	if ((ctxt->options & XML_SAVE_NO_XHTML) == 0) {
  ------------------
  |  Branch (1305:6): [True: 3.85k, False: 0]
  ------------------
 1306|  3.85k|	    dtd = xmlGetIntSubset(cur);
 1307|  3.85k|	    if (dtd != NULL) {
  ------------------
  |  Branch (1307:10): [True: 3.76k, False: 81]
  ------------------
 1308|  3.76k|		is_xhtml = xmlIsXHTML(dtd->SystemID, dtd->ExternalID);
 1309|  3.76k|		if (is_xhtml < 0) is_xhtml = 0;
  ------------------
  |  Branch (1309:7): [True: 3.33k, False: 431]
  ------------------
 1310|  3.76k|	    }
 1311|  3.85k|	}
 1312|  3.85k|#endif
 1313|  3.85k|	if (cur->children != NULL) {
  ------------------
  |  Branch (1313:6): [True: 3.85k, False: 0]
  ------------------
 1314|  3.85k|	    xmlNodePtr child = cur->children;
 1315|       |
 1316|  11.5k|	    while (child != NULL) {
  ------------------
  |  Branch (1316:13): [True: 7.69k, False: 3.85k]
  ------------------
 1317|  7.69k|		ctxt->level = 0;
 1318|  7.69k|#ifdef LIBXML_HTML_ENABLED
 1319|  7.69k|		if (is_xhtml)
  ------------------
  |  Branch (1319:7): [True: 414, False: 7.27k]
  ------------------
 1320|    414|		    xhtmlNodeDumpOutput(ctxt, child);
 1321|  7.27k|		else
 1322|  7.27k|#endif
 1323|  7.27k|		    xmlNodeDumpOutputInternal(ctxt, child);
 1324|  7.69k|                if ((child->type != XML_XINCLUDE_START) &&
  ------------------
  |  Branch (1324:21): [True: 7.69k, False: 0]
  ------------------
 1325|  7.69k|                    (child->type != XML_XINCLUDE_END))
  ------------------
  |  Branch (1325:21): [True: 7.69k, False: 0]
  ------------------
 1326|  7.69k|                    xmlOutputBufferWrite(buf, 1, "\n");
 1327|  7.69k|		child = child->next;
 1328|  7.69k|	    }
 1329|  3.85k|	}
 1330|  3.85k|    }
 1331|       |
 1332|       |    /*
 1333|       |     * Restore the state of the saving context at the end of the document
 1334|       |     */
 1335|  3.85k|    if (switched_encoding) {
  ------------------
  |  Branch (1335:9): [True: 0, False: 3.85k]
  ------------------
 1336|      0|	xmlSaveClearEncoding(ctxt);
 1337|      0|    }
 1338|       |
 1339|  3.85k|    return(0);
 1340|  3.85k|}
xmlsave.c:xhtmlNodeDumpOutput:
 1489|  17.8k|xhtmlNodeDumpOutput(xmlSaveCtxtPtr ctxt, xmlNodePtr cur) {
 1490|  17.8k|    int format = ctxt->format, addmeta, oldoptions;
 1491|  17.8k|    xmlNodePtr tmp, root, unformattedNode = NULL, parent;
 1492|  17.8k|    xmlChar *start, *end;
 1493|  17.8k|    xmlOutputBufferPtr buf = ctxt->buf;
 1494|       |
 1495|  17.8k|    if (cur == NULL) return;
  ------------------
  |  Branch (1495:9): [True: 0, False: 17.8k]
  ------------------
 1496|       |
 1497|  17.8k|    oldoptions = ctxt->options;
 1498|  17.8k|    ctxt->options |= XML_SAVE_XHTML;
 1499|       |
 1500|  17.8k|    root = cur;
 1501|  17.8k|    parent = cur->parent;
 1502|  52.2k|    while (1) {
  ------------------
  |  Branch (1502:12): [True: 52.2k, Folded]
  ------------------
 1503|  52.2k|        switch (cur->type) {
 1504|    181|        case XML_DOCUMENT_NODE:
  ------------------
  |  Branch (1504:9): [True: 181, False: 52.0k]
  ------------------
 1505|    181|        case XML_HTML_DOCUMENT_NODE:
  ------------------
  |  Branch (1505:9): [True: 0, False: 52.2k]
  ------------------
 1506|    181|            xmlSaveDocInternal(ctxt, (xmlDocPtr) cur, ctxt->encoding);
 1507|    181|	    break;
 1508|       |
 1509|      0|        case XML_NAMESPACE_DECL:
  ------------------
  |  Branch (1509:9): [True: 0, False: 52.2k]
  ------------------
 1510|      0|	    xmlNsDumpOutput(buf, (xmlNsPtr) cur, ctxt);
 1511|      0|	    break;
 1512|       |
 1513|    181|        case XML_DTD_NODE:
  ------------------
  |  Branch (1513:9): [True: 181, False: 52.0k]
  ------------------
 1514|    181|            xmlDtdDumpOutput(ctxt, (xmlDtdPtr) cur);
 1515|    181|	    break;
 1516|       |
 1517|      0|        case XML_DOCUMENT_FRAG_NODE:
  ------------------
  |  Branch (1517:9): [True: 0, False: 52.2k]
  ------------------
 1518|       |            /* Always validate cur->parent when descending. */
 1519|      0|            if ((cur->parent == parent) && (cur->children != NULL)) {
  ------------------
  |  Branch (1519:17): [True: 0, False: 0]
  |  Branch (1519:44): [True: 0, False: 0]
  ------------------
 1520|      0|                parent = cur;
 1521|      0|                cur = cur->children;
 1522|      0|                continue;
 1523|      0|            }
 1524|      0|            break;
 1525|       |
 1526|      0|        case XML_ELEMENT_DECL:
  ------------------
  |  Branch (1526:9): [True: 0, False: 52.2k]
  ------------------
 1527|      0|            xmlBufDumpElementDecl(buf, (xmlElementPtr) cur);
 1528|      0|	    break;
 1529|       |
 1530|      0|        case XML_ATTRIBUTE_DECL:
  ------------------
  |  Branch (1530:9): [True: 0, False: 52.2k]
  ------------------
 1531|      0|            xmlSaveWriteAttributeDecl(ctxt, (xmlAttributePtr) cur);
 1532|      0|	    break;
 1533|       |
 1534|      0|        case XML_ENTITY_DECL:
  ------------------
  |  Branch (1534:9): [True: 0, False: 52.2k]
  ------------------
 1535|      0|            xmlBufDumpEntityDecl(buf, (xmlEntityPtr) cur);
 1536|      0|	    break;
 1537|       |
 1538|  30.9k|        case XML_ELEMENT_NODE:
  ------------------
  |  Branch (1538:9): [True: 30.9k, False: 21.2k]
  ------------------
 1539|  30.9k|            addmeta = 0;
 1540|       |
 1541|  30.9k|	    if ((cur != root) && (ctxt->format == 1))
  ------------------
  |  Branch (1541:10): [True: 18.9k, False: 11.9k]
  |  Branch (1541:27): [True: 0, False: 18.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|  30.9k|            if ((cur->parent != parent) && (cur->children != NULL)) {
  ------------------
  |  Branch (1549:17): [True: 0, False: 30.9k]
  |  Branch (1549:44): [True: 0, False: 0]
  ------------------
 1550|      0|                xhtmlNodeDumpOutput(ctxt, cur);
 1551|      0|                break;
 1552|      0|            }
 1553|       |
 1554|  30.9k|            xmlOutputBufferWrite(buf, 1, "<");
 1555|  30.9k|            if ((cur->ns != NULL) && (cur->ns->prefix != NULL)) {
  ------------------
  |  Branch (1555:17): [True: 5.18k, False: 25.7k]
  |  Branch (1555:38): [True: 2.12k, False: 3.05k]
  ------------------
 1556|  2.12k|                xmlOutputBufferWriteString(buf, (const char *)cur->ns->prefix);
 1557|  2.12k|                xmlOutputBufferWrite(buf, 1, ":");
 1558|  2.12k|            }
 1559|       |
 1560|  30.9k|            xmlOutputBufferWriteString(buf, (const char *)cur->name);
 1561|  30.9k|            if (cur->nsDef)
  ------------------
  |  Branch (1561:17): [True: 4.63k, False: 26.3k]
  ------------------
 1562|  4.63k|                xmlNsListDumpOutputCtxt(ctxt, cur->nsDef);
 1563|  30.9k|            if ((xmlStrEqual(cur->name, BAD_CAST "html") &&
  ------------------
  |  |   34|  30.9k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (1563:18): [True: 1.42k, False: 29.5k]
  ------------------
 1564|  1.42k|                (cur->ns == NULL) && (cur->nsDef == NULL))) {
  ------------------
  |  Branch (1564:17): [True: 1.02k, False: 404]
  |  Branch (1564:38): [True: 526, False: 499]
  ------------------
 1565|       |                /*
 1566|       |                 * 3.1.1. Strictly Conforming Documents A.3.1.1 3/
 1567|       |                 */
 1568|    526|                xmlOutputBufferWriteString(buf,
 1569|    526|                        " xmlns=\"http://www.w3.org/1999/xhtml\"");
 1570|    526|            }
 1571|  30.9k|            if (cur->properties != NULL)
  ------------------
  |  Branch (1571:17): [True: 9.96k, False: 21.0k]
  ------------------
 1572|  9.96k|                xhtmlAttrListDumpOutput(ctxt, cur->properties);
 1573|       |
 1574|  30.9k|            if ((parent != NULL) &&
  ------------------
  |  Branch (1574:17): [True: 19.1k, False: 11.8k]
  ------------------
 1575|  19.1k|                (parent->parent == (xmlNodePtr) cur->doc) &&
  ------------------
  |  Branch (1575:17): [True: 72, False: 19.0k]
  ------------------
 1576|     72|                xmlStrEqual(cur->name, BAD_CAST"head") &&
  ------------------
  |  |   34|     72|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (1576:17): [True: 0, False: 72]
  ------------------
 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|  30.9k|            if (cur->children == NULL) {
  ------------------
  |  Branch (1604:17): [True: 17.4k, False: 13.5k]
  ------------------
 1605|  17.4k|                if (((cur->ns == NULL) || (cur->ns->prefix == NULL)) &&
  ------------------
  |  Branch (1605:22): [True: 14.8k, False: 2.55k]
  |  Branch (1605:43): [True: 1.52k, False: 1.02k]
  ------------------
 1606|  16.4k|                    ((xhtmlIsEmpty(cur) == 1) && (addmeta == 0))) {
  ------------------
  |  Branch (1606:22): [True: 4.01k, False: 12.3k]
  |  Branch (1606:50): [True: 4.01k, False: 0]
  ------------------
 1607|       |                    /*
 1608|       |                     * C.2. Empty Elements
 1609|       |                     */
 1610|  4.01k|                    xmlOutputBufferWrite(buf, 3, " />");
 1611|  13.4k|                } else {
 1612|  13.4k|                    if (addmeta == 1) {
  ------------------
  |  Branch (1612:25): [True: 0, False: 13.4k]
  ------------------
 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|  13.4k|                    } else {
 1631|  13.4k|                        xmlOutputBufferWrite(buf, 1, ">");
 1632|  13.4k|                    }
 1633|       |                    /*
 1634|       |                     * C.3. Element Minimization and Empty Element Content
 1635|       |                     */
 1636|  13.4k|                    xmlOutputBufferWrite(buf, 2, "</");
 1637|  13.4k|                    if ((cur->ns != NULL) && (cur->ns->prefix != NULL)) {
  ------------------
  |  Branch (1637:25): [True: 2.55k, False: 10.8k]
  |  Branch (1637:46): [True: 1.02k, False: 1.52k]
  ------------------
 1638|  1.02k|                        xmlOutputBufferWriteString(buf,
 1639|  1.02k|                                (const char *)cur->ns->prefix);
 1640|  1.02k|                        xmlOutputBufferWrite(buf, 1, ":");
 1641|  1.02k|                    }
 1642|  13.4k|                    xmlOutputBufferWriteString(buf, (const char *)cur->name);
 1643|  13.4k|                    xmlOutputBufferWrite(buf, 1, ">");
 1644|  13.4k|                }
 1645|  17.4k|            } else {
 1646|  13.5k|                xmlOutputBufferWrite(buf, 1, ">");
 1647|  13.5k|                if (addmeta == 1) {
  ------------------
  |  Branch (1647:21): [True: 0, False: 13.5k]
  ------------------
 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|  13.5k|                if (ctxt->format == 1) {
  ------------------
  |  Branch (1664:21): [True: 0, False: 13.5k]
  ------------------
 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|  13.5k|                if (ctxt->format == 1) xmlOutputBufferWrite(buf, 1, "\n");
  ------------------
  |  Branch (1677:21): [True: 0, False: 13.5k]
  ------------------
 1678|  13.5k|                if (ctxt->level >= 0) ctxt->level++;
  ------------------
  |  Branch (1678:21): [True: 13.5k, False: 0]
  ------------------
 1679|  13.5k|                parent = cur;
 1680|  13.5k|                cur = cur->children;
 1681|  13.5k|                continue;
 1682|  13.5k|            }
 1683|       |
 1684|  17.4k|            break;
 1685|       |
 1686|  17.4k|        case XML_TEXT_NODE:
  ------------------
  |  Branch (1686:9): [True: 17.1k, False: 35.0k]
  ------------------
 1687|  17.1k|	    if (cur->content == NULL)
  ------------------
  |  Branch (1687:10): [True: 0, False: 17.1k]
  ------------------
 1688|      0|                break;
 1689|  17.1k|	    if ((cur->name == xmlStringText) ||
  ------------------
  |  Branch (1689:10): [True: 17.1k, False: 0]
  ------------------
 1690|  17.1k|		(cur->name != xmlStringTextNoenc)) {
  ------------------
  |  Branch (1690:3): [True: 0, False: 0]
  ------------------
 1691|  17.1k|                if (ctxt->escape)
  ------------------
  |  Branch (1691:21): [True: 0, False: 17.1k]
  ------------------
 1692|      0|                    xmlOutputBufferWriteEscape(buf, cur->content,
 1693|      0|                                               ctxt->escape);
 1694|  17.1k|                else
 1695|  17.1k|                    xmlSaveWriteText(ctxt, cur->content, /* flags */ 0);
 1696|  17.1k|	    } else {
 1697|       |		/*
 1698|       |		 * Disable escaping, needed for XSLT
 1699|       |		 */
 1700|      0|		xmlOutputBufferWriteString(buf, (const char *) cur->content);
 1701|      0|	    }
 1702|  17.1k|	    break;
 1703|       |
 1704|  1.69k|        case XML_PI_NODE:
  ------------------
  |  Branch (1704:9): [True: 1.69k, False: 50.5k]
  ------------------
 1705|  1.69k|            if (cur->content != NULL) {
  ------------------
  |  Branch (1705:17): [True: 1.19k, False: 499]
  ------------------
 1706|  1.19k|                xmlOutputBufferWrite(buf, 2, "<?");
 1707|  1.19k|                xmlOutputBufferWriteString(buf, (const char *)cur->name);
 1708|  1.19k|                if (cur->content != NULL) {
  ------------------
  |  Branch (1708:21): [True: 1.19k, False: 0]
  ------------------
 1709|  1.19k|                    xmlOutputBufferWrite(buf, 1, " ");
 1710|  1.19k|                    xmlOutputBufferWriteString(buf,
 1711|  1.19k|                            (const char *)cur->content);
 1712|  1.19k|                }
 1713|  1.19k|                xmlOutputBufferWrite(buf, 2, "?>");
 1714|  1.19k|            } else {
 1715|    499|                xmlOutputBufferWrite(buf, 2, "<?");
 1716|    499|                xmlOutputBufferWriteString(buf, (const char *)cur->name);
 1717|    499|                xmlOutputBufferWrite(buf, 2, "?>");
 1718|    499|            }
 1719|  1.69k|            break;
 1720|       |
 1721|    472|        case XML_COMMENT_NODE:
  ------------------
  |  Branch (1721:9): [True: 472, False: 51.7k]
  ------------------
 1722|    472|            if (cur->content != NULL) {
  ------------------
  |  Branch (1722:17): [True: 472, False: 0]
  ------------------
 1723|    472|                xmlOutputBufferWrite(buf, 4, "<!--");
 1724|    472|                xmlOutputBufferWriteString(buf, (const char *)cur->content);
 1725|    472|                xmlOutputBufferWrite(buf, 3, "-->");
 1726|    472|            }
 1727|    472|            break;
 1728|       |
 1729|    621|        case XML_ENTITY_REF_NODE:
  ------------------
  |  Branch (1729:9): [True: 621, False: 51.5k]
  ------------------
 1730|    621|            xmlOutputBufferWrite(buf, 1, "&");
 1731|    621|            xmlOutputBufferWriteString(buf, (const char *)cur->name);
 1732|    621|            xmlOutputBufferWrite(buf, 1, ";");
 1733|    621|            break;
 1734|       |
 1735|    684|        case XML_CDATA_SECTION_NODE:
  ------------------
  |  Branch (1735:9): [True: 684, False: 51.5k]
  ------------------
 1736|    684|            if (cur->content == NULL || *cur->content == '\0') {
  ------------------
  |  Branch (1736:17): [True: 0, False: 684]
  |  Branch (1736:41): [True: 229, False: 455]
  ------------------
 1737|    229|                xmlOutputBufferWrite(buf, 12, "<![CDATA[]]>");
 1738|    455|            } else {
 1739|    455|                start = end = cur->content;
 1740|  2.83k|                while (*end != '\0') {
  ------------------
  |  Branch (1740:24): [True: 2.38k, False: 455]
  ------------------
 1741|  2.38k|                    if (*end == ']' && *(end + 1) == ']' &&
  ------------------
  |  Branch (1741:25): [True: 662, False: 1.72k]
  |  Branch (1741:40): [True: 345, False: 317]
  ------------------
 1742|    345|                        *(end + 2) == '>') {
  ------------------
  |  Branch (1742:25): [True: 0, False: 345]
  ------------------
 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|  2.38k|                    end++;
 1751|  2.38k|                }
 1752|    455|                if (start != end) {
  ------------------
  |  Branch (1752:21): [True: 455, False: 0]
  ------------------
 1753|    455|                    xmlOutputBufferWrite(buf, 9, "<![CDATA[");
 1754|    455|                    xmlOutputBufferWriteString(buf, (const char *)start);
 1755|    455|                    xmlOutputBufferWrite(buf, 3, "]]>");
 1756|    455|                }
 1757|    455|            }
 1758|    684|            break;
 1759|       |
 1760|      0|        case XML_ATTRIBUTE_NODE:
  ------------------
  |  Branch (1760:9): [True: 0, False: 52.2k]
  ------------------
 1761|      0|            xmlAttrDumpOutput(ctxt, (xmlAttrPtr) cur);
 1762|      0|	    break;
 1763|       |
 1764|    259|        default:
  ------------------
  |  Branch (1764:9): [True: 259, False: 51.9k]
  ------------------
 1765|    259|            break;
 1766|  52.2k|        }
 1767|       |
 1768|  52.2k|        while (1) {
  ------------------
  |  Branch (1768:16): [True: 52.2k, Folded]
  ------------------
 1769|  52.2k|            if (cur == root)
  ------------------
  |  Branch (1769:17): [True: 17.8k, False: 34.3k]
  ------------------
 1770|  17.8k|                return;
 1771|  34.3k|            if (ctxt->format == 1)
  ------------------
  |  Branch (1771:17): [True: 0, False: 34.3k]
  ------------------
 1772|      0|                xmlOutputBufferWrite(buf, 1, "\n");
 1773|  34.3k|            if (cur->next != NULL) {
  ------------------
  |  Branch (1773:17): [True: 20.8k, False: 13.5k]
  ------------------
 1774|  20.8k|                cur = cur->next;
 1775|  20.8k|                break;
 1776|  20.8k|            }
 1777|       |
 1778|  13.5k|            cur = parent;
 1779|       |            /* cur->parent was validated when descending. */
 1780|  13.5k|            parent = cur->parent;
 1781|       |
 1782|  13.5k|            if (cur->type == XML_ELEMENT_NODE) {
  ------------------
  |  Branch (1782:17): [True: 13.5k, False: 0]
  ------------------
 1783|  13.5k|                if (ctxt->level > 0) ctxt->level--;
  ------------------
  |  Branch (1783:21): [True: 13.5k, False: 0]
  ------------------
 1784|  13.5k|                if (ctxt->format == 1)
  ------------------
  |  Branch (1784:21): [True: 0, False: 13.5k]
  ------------------
 1785|      0|                    xmlSaveWriteIndent(ctxt, 0);
 1786|       |
 1787|  13.5k|                xmlOutputBufferWrite(buf, 2, "</");
 1788|  13.5k|                if ((cur->ns != NULL) && (cur->ns->prefix != NULL)) {
  ------------------
  |  Branch (1788:21): [True: 2.63k, False: 10.9k]
  |  Branch (1788:42): [True: 1.09k, False: 1.53k]
  ------------------
 1789|  1.09k|                    xmlOutputBufferWriteString(buf,
 1790|  1.09k|                            (const char *)cur->ns->prefix);
 1791|  1.09k|                    xmlOutputBufferWrite(buf, 1, ":");
 1792|  1.09k|                }
 1793|       |
 1794|  13.5k|                xmlOutputBufferWriteString(buf, (const char *)cur->name);
 1795|  13.5k|                xmlOutputBufferWrite(buf, 1, ">");
 1796|       |
 1797|  13.5k|                if (cur == unformattedNode) {
  ------------------
  |  Branch (1797:21): [True: 0, False: 13.5k]
  ------------------
 1798|      0|                    ctxt->format = format;
 1799|      0|                    unformattedNode = NULL;
 1800|      0|                }
 1801|  13.5k|            }
 1802|  13.5k|        }
 1803|  38.6k|    }
 1804|       |
 1805|      0|    ctxt->options = oldoptions;
 1806|      0|}
xmlsave.c:xmlDtdDumpOutput:
  827|  3.76k|xmlDtdDumpOutput(xmlSaveCtxtPtr ctxt, xmlDtdPtr dtd) {
  828|  3.76k|    xmlOutputBufferPtr buf;
  829|  3.76k|    xmlNodePtr cur;
  830|  3.76k|    int format, level;
  831|       |
  832|  3.76k|    if (dtd == NULL) return;
  ------------------
  |  Branch (832:9): [True: 0, False: 3.76k]
  ------------------
  833|  3.76k|    if ((ctxt == NULL) || (ctxt->buf == NULL))
  ------------------
  |  Branch (833:9): [True: 0, False: 3.76k]
  |  Branch (833:27): [True: 0, False: 3.76k]
  ------------------
  834|      0|        return;
  835|  3.76k|    buf = ctxt->buf;
  836|  3.76k|    xmlOutputBufferWrite(buf, 10, "<!DOCTYPE ");
  837|  3.76k|    xmlOutputBufferWriteString(buf, (const char *)dtd->name);
  838|  3.76k|    if (dtd->ExternalID != NULL) {
  ------------------
  |  Branch (838:9): [True: 274, False: 3.49k]
  ------------------
  839|    274|	xmlOutputBufferWrite(buf, 8, " PUBLIC ");
  840|    274|	xmlOutputBufferWriteQuotedString(buf, dtd->ExternalID);
  841|    274|	xmlOutputBufferWrite(buf, 1, " ");
  842|    274|	xmlOutputBufferWriteQuotedString(buf, dtd->SystemID);
  843|  3.49k|    }  else if (dtd->SystemID != NULL) {
  ------------------
  |  Branch (843:17): [True: 157, False: 3.33k]
  ------------------
  844|    157|	xmlOutputBufferWrite(buf, 8, " SYSTEM ");
  845|    157|	xmlOutputBufferWriteQuotedString(buf, dtd->SystemID);
  846|    157|    }
  847|  3.76k|    if ((dtd->entities == NULL) && (dtd->elements == NULL) &&
  ------------------
  |  Branch (847:9): [True: 2.80k, False: 963]
  |  Branch (847:36): [True: 219, False: 2.58k]
  ------------------
  848|    219|        (dtd->attributes == NULL) && (dtd->notations == NULL) &&
  ------------------
  |  Branch (848:9): [True: 219, False: 0]
  |  Branch (848:38): [True: 86, False: 133]
  ------------------
  849|     86|	(dtd->pentities == NULL)) {
  ------------------
  |  Branch (849:2): [True: 76, False: 10]
  ------------------
  850|     76|	xmlOutputBufferWrite(buf, 1, ">");
  851|     76|	return;
  852|     76|    }
  853|  3.69k|    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|  3.69k|    if ((dtd->notations != NULL) && ((dtd->doc == NULL) ||
  ------------------
  |  Branch (858:9): [True: 865, False: 2.82k]
  |  Branch (858:38): [True: 0, False: 865]
  ------------------
  859|    865|        (dtd->doc->intSubset == dtd))) {
  ------------------
  |  Branch (859:9): [True: 865, False: 0]
  ------------------
  860|    865|        xmlBufDumpNotationTable(buf, (xmlNotationTablePtr) dtd->notations);
  861|    865|    }
  862|  3.69k|    format = ctxt->format;
  863|  3.69k|    level = ctxt->level;
  864|  3.69k|    ctxt->format = 0;
  865|  3.69k|    ctxt->level = -1;
  866|  15.3k|    for (cur = dtd->children; cur != NULL; cur = cur->next) {
  ------------------
  |  Branch (866:31): [True: 11.6k, False: 3.69k]
  ------------------
  867|  11.6k|        xmlNodeDumpOutputInternal(ctxt, cur);
  868|  11.6k|    }
  869|  3.69k|    ctxt->format = format;
  870|  3.69k|    ctxt->level = level;
  871|  3.69k|    xmlOutputBufferWrite(buf, 2, "]>");
  872|  3.69k|}
xmlsave.c:xmlBufDumpElementDecl:
  417|  4.60k|xmlBufDumpElementDecl(xmlOutputBufferPtr buf, xmlElementPtr elem) {
  418|  4.60k|    xmlOutputBufferWrite(buf, 10, "<!ELEMENT ");
  419|  4.60k|    if (elem->prefix != NULL) {
  ------------------
  |  Branch (419:9): [True: 836, False: 3.76k]
  ------------------
  420|    836|        xmlOutputBufferWriteString(buf, (const char *) elem->prefix);
  421|    836|        xmlOutputBufferWrite(buf, 1, ":");
  422|    836|    }
  423|  4.60k|    xmlOutputBufferWriteString(buf, (const char *) elem->name);
  424|  4.60k|    xmlOutputBufferWrite(buf, 1, " ");
  425|       |
  426|  4.60k|    switch (elem->etype) {
  427|  1.26k|	case XML_ELEMENT_TYPE_EMPTY:
  ------------------
  |  Branch (427:2): [True: 1.26k, False: 3.34k]
  ------------------
  428|  1.26k|	    xmlOutputBufferWrite(buf, 5, "EMPTY");
  429|  1.26k|	    break;
  430|     34|	case XML_ELEMENT_TYPE_ANY:
  ------------------
  |  Branch (430:2): [True: 34, False: 4.57k]
  ------------------
  431|     34|	    xmlOutputBufferWrite(buf, 3, "ANY");
  432|     34|	    break;
  433|    733|	case XML_ELEMENT_TYPE_MIXED:
  ------------------
  |  Branch (433:2): [True: 733, False: 3.87k]
  ------------------
  434|  3.30k|	case XML_ELEMENT_TYPE_ELEMENT:
  ------------------
  |  Branch (434:2): [True: 2.57k, False: 2.03k]
  ------------------
  435|  3.30k|	    xmlBufDumpElementContent(buf, elem->content);
  436|  3.30k|	    break;
  437|      0|        default:
  ------------------
  |  Branch (437:9): [True: 0, False: 4.60k]
  ------------------
  438|       |            /* assert(0); */
  439|      0|            break;
  440|  4.60k|    }
  441|       |
  442|  4.60k|    xmlOutputBufferWrite(buf, 2, ">\n");
  443|  4.60k|}
xmlsave.c:xmlBufDumpElementContent:
  345|  3.30k|                         xmlElementContentPtr content) {
  346|  3.30k|    xmlElementContentPtr cur;
  347|       |
  348|  3.30k|    if (content == NULL) return;
  ------------------
  |  Branch (348:9): [True: 0, False: 3.30k]
  ------------------
  349|       |
  350|  3.30k|    xmlOutputBufferWrite(buf, 1, "(");
  351|  3.30k|    cur = content;
  352|       |
  353|   129k|    do {
  354|   129k|        if (cur == NULL) return;
  ------------------
  |  Branch (354:13): [True: 0, False: 129k]
  ------------------
  355|       |
  356|   129k|        switch (cur->type) {
  ------------------
  |  Branch (356:17): [True: 129k, False: 0]
  ------------------
  357|    733|            case XML_ELEMENT_CONTENT_PCDATA:
  ------------------
  |  Branch (357:13): [True: 733, False: 128k]
  ------------------
  358|    733|                xmlOutputBufferWrite(buf, 7, "#PCDATA");
  359|    733|                break;
  360|  65.5k|            case XML_ELEMENT_CONTENT_ELEMENT:
  ------------------
  |  Branch (360:13): [True: 65.5k, False: 63.7k]
  ------------------
  361|  65.5k|                if (cur->prefix != NULL) {
  ------------------
  |  Branch (361:21): [True: 5.50k, False: 60.0k]
  ------------------
  362|  5.50k|                    xmlOutputBufferWriteString(buf,
  363|  5.50k|                            (const char *) cur->prefix);
  364|  5.50k|                    xmlOutputBufferWrite(buf, 1, ":");
  365|  5.50k|                }
  366|  65.5k|                xmlOutputBufferWriteString(buf, (const char *) cur->name);
  367|  65.5k|                break;
  368|  29.0k|            case XML_ELEMENT_CONTENT_SEQ:
  ------------------
  |  Branch (368:13): [True: 29.0k, False: 100k]
  ------------------
  369|  62.9k|            case XML_ELEMENT_CONTENT_OR:
  ------------------
  |  Branch (369:13): [True: 33.9k, False: 95.2k]
  ------------------
  370|  62.9k|                if ((cur != content) &&
  ------------------
  |  Branch (370:21): [True: 61.2k, False: 1.74k]
  ------------------
  371|  61.2k|                    (cur->parent != NULL) &&
  ------------------
  |  Branch (371:21): [True: 61.2k, False: 0]
  ------------------
  372|  61.2k|                    ((cur->type != cur->parent->type) ||
  ------------------
  |  Branch (372:22): [True: 13.3k, False: 47.9k]
  ------------------
  373|  47.9k|                     (cur->ocur != XML_ELEMENT_CONTENT_ONCE)))
  ------------------
  |  Branch (373:22): [True: 4.04k, False: 43.8k]
  ------------------
  374|  17.3k|                    xmlOutputBufferWrite(buf, 1, "(");
  375|  62.9k|                cur = cur->c1;
  376|  62.9k|                continue;
  377|   129k|        }
  378|       |
  379|   129k|        while (cur != content) {
  ------------------
  |  Branch (379:16): [True: 125k, False: 3.30k]
  ------------------
  380|   125k|            xmlElementContentPtr parent = cur->parent;
  381|       |
  382|   125k|            if (parent == NULL) return;
  ------------------
  |  Branch (382:17): [True: 0, False: 125k]
  ------------------
  383|       |
  384|   125k|            if (((cur->type == XML_ELEMENT_CONTENT_OR) ||
  ------------------
  |  Branch (384:18): [True: 33.1k, False: 92.8k]
  ------------------
  385|  92.8k|                 (cur->type == XML_ELEMENT_CONTENT_SEQ)) &&
  ------------------
  |  Branch (385:18): [True: 28.1k, False: 64.7k]
  ------------------
  386|  61.2k|                ((cur->type != parent->type) ||
  ------------------
  |  Branch (386:18): [True: 13.3k, False: 47.9k]
  ------------------
  387|  47.9k|                 (cur->ocur != XML_ELEMENT_CONTENT_ONCE)))
  ------------------
  |  Branch (387:18): [True: 4.04k, False: 43.8k]
  ------------------
  388|  17.3k|                xmlOutputBufferWrite(buf, 1, ")");
  389|   125k|            xmlBufDumpElementOccur(buf, cur);
  390|       |
  391|   125k|            if (cur == parent->c1) {
  ------------------
  |  Branch (391:17): [True: 62.9k, False: 62.9k]
  ------------------
  392|  62.9k|                if (parent->type == XML_ELEMENT_CONTENT_SEQ)
  ------------------
  |  Branch (392:21): [True: 29.0k, False: 33.9k]
  ------------------
  393|  29.0k|                    xmlOutputBufferWrite(buf, 3, " , ");
  394|  33.9k|                else if (parent->type == XML_ELEMENT_CONTENT_OR)
  ------------------
  |  Branch (394:26): [True: 33.9k, False: 0]
  ------------------
  395|  33.9k|                    xmlOutputBufferWrite(buf, 3, " | ");
  396|       |
  397|  62.9k|                cur = parent->c2;
  398|  62.9k|                break;
  399|  62.9k|            }
  400|       |
  401|  62.9k|            cur = parent;
  402|  62.9k|        }
  403|   129k|    } while (cur != content);
  ------------------
  |  Branch (403:14): [True: 125k, False: 3.30k]
  ------------------
  404|       |
  405|  3.30k|    xmlOutputBufferWrite(buf, 1, ")");
  406|  3.30k|    xmlBufDumpElementOccur(buf, content);
  407|  3.30k|}
xmlsave.c:xmlBufDumpElementOccur:
  321|   129k|xmlBufDumpElementOccur(xmlOutputBufferPtr buf, xmlElementContentPtr cur) {
  322|   129k|    switch (cur->ocur) {
  ------------------
  |  Branch (322:13): [True: 129k, False: 0]
  ------------------
  323|  98.3k|        case XML_ELEMENT_CONTENT_ONCE:
  ------------------
  |  Branch (323:9): [True: 98.3k, False: 30.9k]
  ------------------
  324|  98.3k|            break;
  325|  14.4k|        case XML_ELEMENT_CONTENT_OPT:
  ------------------
  |  Branch (325:9): [True: 14.4k, False: 114k]
  ------------------
  326|  14.4k|            xmlOutputBufferWrite(buf, 1, "?");
  327|  14.4k|            break;
  328|  12.9k|        case XML_ELEMENT_CONTENT_MULT:
  ------------------
  |  Branch (328:9): [True: 12.9k, False: 116k]
  ------------------
  329|  12.9k|            xmlOutputBufferWrite(buf, 1, "*");
  330|  12.9k|            break;
  331|  3.50k|        case XML_ELEMENT_CONTENT_PLUS:
  ------------------
  |  Branch (331:9): [True: 3.50k, False: 125k]
  ------------------
  332|  3.50k|            xmlOutputBufferWrite(buf, 1, "+");
  333|  3.50k|            break;
  334|   129k|    }
  335|   129k|}
xmlsave.c:xmlSaveWriteAttributeDecl:
  471|  3.23k|xmlSaveWriteAttributeDecl(xmlSaveCtxtPtr ctxt, xmlAttributePtr attr) {
  472|  3.23k|    xmlOutputBufferPtr buf = ctxt->buf;
  473|       |
  474|  3.23k|    xmlOutputBufferWrite(buf, 10, "<!ATTLIST ");
  475|  3.23k|    xmlOutputBufferWriteString(buf, (const char *) attr->elem);
  476|  3.23k|    xmlOutputBufferWrite(buf, 1, " ");
  477|  3.23k|    if (attr->prefix != NULL) {
  ------------------
  |  Branch (477:9): [True: 1.09k, False: 2.13k]
  ------------------
  478|  1.09k|	xmlOutputBufferWriteString(buf, (const char *) attr->prefix);
  479|  1.09k|	xmlOutputBufferWrite(buf, 1, ":");
  480|  1.09k|    }
  481|  3.23k|    xmlOutputBufferWriteString(buf, (const char *) attr->name);
  482|       |
  483|  3.23k|    switch (attr->atype) {
  484|    725|	case XML_ATTRIBUTE_CDATA:
  ------------------
  |  Branch (484:2): [True: 725, False: 2.50k]
  ------------------
  485|    725|	    xmlOutputBufferWrite(buf, 6, " CDATA");
  486|    725|	    break;
  487|    276|	case XML_ATTRIBUTE_ID:
  ------------------
  |  Branch (487:2): [True: 276, False: 2.95k]
  ------------------
  488|    276|	    xmlOutputBufferWrite(buf, 3, " ID");
  489|    276|	    break;
  490|    359|	case XML_ATTRIBUTE_IDREF:
  ------------------
  |  Branch (490:2): [True: 359, False: 2.87k]
  ------------------
  491|    359|	    xmlOutputBufferWrite(buf, 6, " IDREF");
  492|    359|	    break;
  493|    332|	case XML_ATTRIBUTE_IDREFS:
  ------------------
  |  Branch (493:2): [True: 332, False: 2.89k]
  ------------------
  494|    332|	    xmlOutputBufferWrite(buf, 7, " IDREFS");
  495|    332|	    break;
  496|     92|	case XML_ATTRIBUTE_ENTITY:
  ------------------
  |  Branch (496:2): [True: 92, False: 3.13k]
  ------------------
  497|     92|	    xmlOutputBufferWrite(buf, 7, " ENTITY");
  498|     92|	    break;
  499|    466|	case XML_ATTRIBUTE_ENTITIES:
  ------------------
  |  Branch (499:2): [True: 466, False: 2.76k]
  ------------------
  500|    466|	    xmlOutputBufferWrite(buf, 9, " ENTITIES");
  501|    466|	    break;
  502|    280|	case XML_ATTRIBUTE_NMTOKEN:
  ------------------
  |  Branch (502:2): [True: 280, False: 2.95k]
  ------------------
  503|    280|	    xmlOutputBufferWrite(buf, 8, " NMTOKEN");
  504|    280|	    break;
  505|    137|	case XML_ATTRIBUTE_NMTOKENS:
  ------------------
  |  Branch (505:2): [True: 137, False: 3.09k]
  ------------------
  506|    137|	    xmlOutputBufferWrite(buf, 9, " NMTOKENS");
  507|    137|	    break;
  508|    476|	case XML_ATTRIBUTE_ENUMERATION:
  ------------------
  |  Branch (508:2): [True: 476, False: 2.75k]
  ------------------
  509|    476|	    xmlOutputBufferWrite(buf, 2, " (");
  510|    476|	    xmlBufDumpEnumeration(buf, attr->tree);
  511|    476|	    break;
  512|     87|	case XML_ATTRIBUTE_NOTATION:
  ------------------
  |  Branch (512:2): [True: 87, False: 3.14k]
  ------------------
  513|     87|	    xmlOutputBufferWrite(buf, 11, " NOTATION (");
  514|     87|	    xmlBufDumpEnumeration(buf, attr->tree);
  515|     87|	    break;
  516|      0|	default:
  ------------------
  |  Branch (516:2): [True: 0, False: 3.23k]
  ------------------
  517|       |            /* assert(0); */
  518|      0|            break;
  519|  3.23k|    }
  520|       |
  521|  3.23k|    switch (attr->def) {
  522|  1.11k|	case XML_ATTRIBUTE_NONE:
  ------------------
  |  Branch (522:2): [True: 1.11k, False: 2.11k]
  ------------------
  523|  1.11k|	    break;
  524|    817|	case XML_ATTRIBUTE_REQUIRED:
  ------------------
  |  Branch (524:2): [True: 817, False: 2.41k]
  ------------------
  525|    817|	    xmlOutputBufferWrite(buf, 10, " #REQUIRED");
  526|    817|	    break;
  527|    520|	case XML_ATTRIBUTE_IMPLIED:
  ------------------
  |  Branch (527:2): [True: 520, False: 2.71k]
  ------------------
  528|    520|	    xmlOutputBufferWrite(buf, 9, " #IMPLIED");
  529|    520|	    break;
  530|    782|	case XML_ATTRIBUTE_FIXED:
  ------------------
  |  Branch (530:2): [True: 782, False: 2.44k]
  ------------------
  531|    782|	    xmlOutputBufferWrite(buf, 7, " #FIXED");
  532|    782|	    break;
  533|      0|	default:
  ------------------
  |  Branch (533:2): [True: 0, False: 3.23k]
  ------------------
  534|       |            /* assert(0); */
  535|      0|            break;
  536|  3.23k|    }
  537|       |
  538|  3.23k|    if (attr->defaultValue != NULL) {
  ------------------
  |  Branch (538:9): [True: 1.10k, False: 2.12k]
  ------------------
  539|  1.10k|        xmlOutputBufferWrite(buf, 2, " \"");
  540|  1.10k|        xmlSaveWriteText(ctxt, attr->defaultValue, XML_ESCAPE_ATTR);
  ------------------
  |  |   22|  1.10k|#define XML_ESCAPE_ATTR             (1u << 0)
  ------------------
  541|  1.10k|        xmlOutputBufferWrite(buf, 1, "\"");
  542|  1.10k|    }
  543|       |
  544|  3.23k|    xmlOutputBufferWrite(buf, 2, ">\n");
  545|  3.23k|}
xmlsave.c:xmlBufDumpEnumeration:
  452|    563|xmlBufDumpEnumeration(xmlOutputBufferPtr buf, xmlEnumerationPtr cur) {
  453|  1.28k|    while (cur != NULL) {
  ------------------
  |  Branch (453:12): [True: 720, False: 563]
  ------------------
  454|    720|        xmlOutputBufferWriteString(buf, (const char *) cur->name);
  455|    720|        if (cur->next != NULL)
  ------------------
  |  Branch (455:13): [True: 157, False: 563]
  ------------------
  456|    157|            xmlOutputBufferWrite(buf, 3, " | ");
  457|       |
  458|    720|        cur = cur->next;
  459|    720|    }
  460|       |
  461|    563|    xmlOutputBufferWrite(buf, 1, ")");
  462|    563|}
xmlsave.c:xmlBufDumpEntityDecl:
  592|  3.54k|xmlBufDumpEntityDecl(xmlOutputBufferPtr buf, xmlEntityPtr ent) {
  593|  3.54k|    if ((ent->etype == XML_INTERNAL_PARAMETER_ENTITY) ||
  ------------------
  |  Branch (593:9): [True: 124, False: 3.41k]
  ------------------
  594|  3.41k|        (ent->etype == XML_EXTERNAL_PARAMETER_ENTITY))
  ------------------
  |  Branch (594:9): [True: 313, False: 3.10k]
  ------------------
  595|    437|        xmlOutputBufferWrite(buf, 11, "<!ENTITY % ");
  596|  3.10k|    else
  597|  3.10k|        xmlOutputBufferWrite(buf, 9, "<!ENTITY ");
  598|  3.54k|    xmlOutputBufferWriteString(buf, (const char *) ent->name);
  599|  3.54k|    xmlOutputBufferWrite(buf, 1, " ");
  600|       |
  601|  3.54k|    if ((ent->etype == XML_EXTERNAL_GENERAL_PARSED_ENTITY) ||
  ------------------
  |  Branch (601:9): [True: 367, False: 3.17k]
  ------------------
  602|  3.17k|        (ent->etype == XML_EXTERNAL_GENERAL_UNPARSED_ENTITY) ||
  ------------------
  |  Branch (602:9): [True: 435, False: 2.73k]
  ------------------
  603|  2.73k|        (ent->etype == XML_EXTERNAL_PARAMETER_ENTITY)) {
  ------------------
  |  Branch (603:9): [True: 313, False: 2.42k]
  ------------------
  604|  1.11k|        if (ent->ExternalID != NULL) {
  ------------------
  |  Branch (604:13): [True: 379, False: 736]
  ------------------
  605|    379|             xmlOutputBufferWrite(buf, 7, "PUBLIC ");
  606|    379|             xmlOutputBufferWriteQuotedString(buf, ent->ExternalID);
  607|    379|             xmlOutputBufferWrite(buf, 1, " ");
  608|    736|        } else {
  609|    736|             xmlOutputBufferWrite(buf, 7, "SYSTEM ");
  610|    736|        }
  611|  1.11k|        xmlOutputBufferWriteQuotedString(buf, ent->SystemID);
  612|  1.11k|    }
  613|       |
  614|  3.54k|    if (ent->etype == XML_EXTERNAL_GENERAL_UNPARSED_ENTITY) {
  ------------------
  |  Branch (614:9): [True: 435, False: 3.10k]
  ------------------
  615|    435|        if (ent->content != NULL) { /* Should be true ! */
  ------------------
  |  Branch (615:13): [True: 396, False: 39]
  ------------------
  616|    396|            xmlOutputBufferWrite(buf, 7, " NDATA ");
  617|    396|            if (ent->orig != NULL)
  ------------------
  |  Branch (617:17): [True: 70, False: 326]
  ------------------
  618|     70|                xmlOutputBufferWriteString(buf, (const char *) ent->orig);
  619|    326|            else
  620|    326|                xmlOutputBufferWriteString(buf, (const char *) ent->content);
  621|    396|        }
  622|    435|    }
  623|       |
  624|  3.54k|    if ((ent->etype == XML_INTERNAL_GENERAL_ENTITY) ||
  ------------------
  |  Branch (624:9): [True: 2.30k, False: 1.23k]
  ------------------
  625|  2.42k|        (ent->etype == XML_INTERNAL_PARAMETER_ENTITY)) {
  ------------------
  |  Branch (625:9): [True: 124, False: 1.11k]
  ------------------
  626|       |        /*
  627|       |         * We could save the original quote character and avoid
  628|       |         * calling xmlOutputBufferWriteQuotedString here.
  629|       |         */
  630|  2.42k|        if (ent->orig != NULL)
  ------------------
  |  Branch (630:13): [True: 2.41k, False: 14]
  ------------------
  631|  2.41k|            xmlOutputBufferWriteQuotedString(buf, ent->orig);
  632|     14|        else
  633|     14|            xmlBufDumpEntityContent(buf, ent->content);
  634|  2.42k|    }
  635|       |
  636|  3.54k|    xmlOutputBufferWrite(buf, 2, ">\n");
  637|  3.54k|}
xmlsave.c:xmlBufDumpEntityContent:
  555|     14|xmlBufDumpEntityContent(xmlOutputBufferPtr buf, const xmlChar *content) {
  556|     14|    const char * base, *cur;
  557|       |
  558|     14|    if (content == NULL)
  ------------------
  |  Branch (558:9): [True: 0, False: 14]
  ------------------
  559|      0|        return;
  560|       |
  561|     14|    xmlOutputBufferWrite(buf, 1, "\"");
  562|     14|    base = cur = (const char *) content;
  563|    150|    while (*cur != 0) {
  ------------------
  |  Branch (563:12): [True: 136, False: 14]
  ------------------
  564|    136|        if (*cur == '"') {
  ------------------
  |  Branch (564:13): [True: 0, False: 136]
  ------------------
  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|    136|        } else if (*cur == '%') {
  ------------------
  |  Branch (570:20): [True: 0, False: 136]
  ------------------
  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|    136|        } else {
  577|    136|            cur++;
  578|    136|        }
  579|    136|    }
  580|     14|    if (base != cur)
  ------------------
  |  Branch (580:9): [True: 14, False: 0]
  ------------------
  581|     14|        xmlOutputBufferWrite(buf, cur - base, base);
  582|     14|    xmlOutputBufferWrite(buf, 1, "\"");
  583|     14|}
xmlsave.c:xmlNsListDumpOutputCtxt:
  799|   786k|xmlNsListDumpOutputCtxt(xmlSaveCtxtPtr ctxt, xmlNsPtr cur) {
  800|  1.58M|    while (cur != NULL) {
  ------------------
  |  Branch (800:12): [True: 795k, False: 786k]
  ------------------
  801|   795k|        xmlNsDumpOutput(ctxt->buf, cur, ctxt);
  802|   795k|	cur = cur->next;
  803|   795k|    }
  804|   786k|}
xmlsave.c:xhtmlAttrListDumpOutput:
 1421|  9.96k|xhtmlAttrListDumpOutput(xmlSaveCtxtPtr ctxt, xmlAttrPtr cur) {
 1422|  9.96k|    xmlAttrPtr xml_lang = NULL;
 1423|  9.96k|    xmlAttrPtr lang = NULL;
 1424|  9.96k|    xmlAttrPtr name = NULL;
 1425|  9.96k|    xmlAttrPtr id = NULL;
 1426|  9.96k|    xmlNodePtr parent;
 1427|  9.96k|    xmlOutputBufferPtr buf;
 1428|       |
 1429|  9.96k|    if (cur == NULL) return;
  ------------------
  |  Branch (1429:9): [True: 0, False: 9.96k]
  ------------------
 1430|  9.96k|    buf = ctxt->buf;
 1431|  9.96k|    parent = cur->parent;
 1432|  32.8k|    while (cur != NULL) {
  ------------------
  |  Branch (1432:12): [True: 22.8k, False: 9.96k]
  ------------------
 1433|  22.8k|	if ((cur->ns == NULL) && (xmlStrEqual(cur->name, BAD_CAST "id")))
  ------------------
  |  |   34|  20.6k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (1433:6): [True: 20.6k, False: 2.17k]
  |  Branch (1433:27): [True: 495, False: 20.1k]
  ------------------
 1434|    495|	    id = cur;
 1435|  22.3k|	else
 1436|  22.3k|	if ((cur->ns == NULL) && (xmlStrEqual(cur->name, BAD_CAST "name")))
  ------------------
  |  |   34|  20.1k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (1436:6): [True: 20.1k, False: 2.17k]
  |  Branch (1436:27): [True: 2.35k, False: 17.8k]
  ------------------
 1437|  2.35k|	    name = cur;
 1438|  19.9k|	else
 1439|  19.9k|	if ((cur->ns == NULL) && (xmlStrEqual(cur->name, BAD_CAST "lang")))
  ------------------
  |  |   34|  17.8k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (1439:6): [True: 17.8k, False: 2.17k]
  |  Branch (1439:27): [True: 1.01k, False: 16.8k]
  ------------------
 1440|  1.01k|	    lang = cur;
 1441|  18.9k|	else
 1442|  18.9k|	if ((cur->ns != NULL) && (xmlStrEqual(cur->name, BAD_CAST "lang")) &&
  ------------------
  |  |   34|  2.17k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (1442:6): [True: 2.17k, False: 16.8k]
  |  Branch (1442:27): [True: 1.46k, False: 712]
  ------------------
 1443|  1.46k|	    (xmlStrEqual(cur->ns->prefix, BAD_CAST "xml")))
  ------------------
  |  |   34|  1.46k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (1443:6): [True: 1.26k, False: 199]
  ------------------
 1444|  1.26k|	    xml_lang = cur;
 1445|  22.8k|        xmlAttrDumpOutput(ctxt, cur);
 1446|  22.8k|	cur = cur->next;
 1447|  22.8k|    }
 1448|       |    /*
 1449|       |     * C.8
 1450|       |     */
 1451|  9.96k|    if ((name != NULL) && (id == NULL)) {
  ------------------
  |  Branch (1451:9): [True: 2.35k, False: 7.61k]
  |  Branch (1451:27): [True: 2.14k, False: 212]
  ------------------
 1452|  2.14k|	if ((parent != NULL) && (parent->name != NULL) &&
  ------------------
  |  Branch (1452:6): [True: 2.14k, False: 0]
  |  Branch (1452:26): [True: 2.14k, False: 0]
  ------------------
 1453|  2.14k|	    ((xmlStrEqual(parent->name, BAD_CAST "a")) ||
  ------------------
  |  |   34|  2.14k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (1453:7): [True: 478, False: 1.66k]
  ------------------
 1454|  1.66k|	     (xmlStrEqual(parent->name, BAD_CAST "p")) ||
  ------------------
  |  |   34|  1.66k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (1454:7): [True: 214, False: 1.45k]
  ------------------
 1455|  1.45k|	     (xmlStrEqual(parent->name, BAD_CAST "div")) ||
  ------------------
  |  |   34|  1.45k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (1455:7): [True: 246, False: 1.20k]
  ------------------
 1456|  1.20k|	     (xmlStrEqual(parent->name, BAD_CAST "img")) ||
  ------------------
  |  |   34|  1.20k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (1456:7): [True: 221, False: 988]
  ------------------
 1457|    988|	     (xmlStrEqual(parent->name, BAD_CAST "map")) ||
  ------------------
  |  |   34|    988|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (1457:7): [True: 67, False: 921]
  ------------------
 1458|    921|	     (xmlStrEqual(parent->name, BAD_CAST "applet")) ||
  ------------------
  |  |   34|    921|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (1458:7): [True: 203, False: 718]
  ------------------
 1459|    718|	     (xmlStrEqual(parent->name, BAD_CAST "form")) ||
  ------------------
  |  |   34|    718|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (1459:7): [True: 80, False: 638]
  ------------------
 1460|    638|	     (xmlStrEqual(parent->name, BAD_CAST "frame")) ||
  ------------------
  |  |   34|    638|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (1460:7): [True: 203, False: 435]
  ------------------
 1461|  1.91k|	     (xmlStrEqual(parent->name, BAD_CAST "iframe")))) {
  ------------------
  |  |   34|    435|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (1461:7): [True: 202, False: 233]
  ------------------
 1462|  1.91k|	    xmlOutputBufferWrite(buf, 5, " id=\"");
 1463|  1.91k|            xmlSaveWriteAttrContent(ctxt, name);
 1464|  1.91k|	    xmlOutputBufferWrite(buf, 1, "\"");
 1465|  1.91k|	}
 1466|  2.14k|    }
 1467|       |    /*
 1468|       |     * C.7.
 1469|       |     */
 1470|  9.96k|    if ((lang != NULL) && (xml_lang == NULL)) {
  ------------------
  |  Branch (1470:9): [True: 979, False: 8.99k]
  |  Branch (1470:27): [True: 700, False: 279]
  ------------------
 1471|    700|	xmlOutputBufferWrite(buf, 11, " xml:lang=\"");
 1472|    700|        xmlSaveWriteAttrContent(ctxt, lang);
 1473|    700|	xmlOutputBufferWrite(buf, 1, "\"");
 1474|    700|    } else
 1475|  9.26k|    if ((xml_lang != NULL) && (lang == NULL)) {
  ------------------
  |  Branch (1475:9): [True: 1.13k, False: 8.13k]
  |  Branch (1475:31): [True: 860, False: 279]
  ------------------
 1476|    860|	xmlOutputBufferWrite(buf, 7, " lang=\"");
 1477|    860|        xmlSaveWriteAttrContent(ctxt, xml_lang);
 1478|    860|	xmlOutputBufferWrite(buf, 1, "\"");
 1479|    860|    }
 1480|  9.96k|}
xmlsave.c:xmlSaveWriteAttrContent:
  241|   260k|{
  242|   260k|    xmlNodePtr children;
  243|   260k|    xmlOutputBufferPtr buf = ctxt->buf;
  244|       |
  245|   260k|    children = attr->children;
  246|   460k|    while (children != NULL) {
  ------------------
  |  Branch (246:12): [True: 200k, False: 260k]
  ------------------
  247|   200k|        switch (children->type) {
  248|   200k|            case XML_TEXT_NODE:
  ------------------
  |  Branch (248:13): [True: 200k, False: 431]
  ------------------
  249|   200k|	        xmlSaveWriteText(ctxt, children->content, XML_ESCAPE_ATTR);
  ------------------
  |  |   22|   200k|#define XML_ESCAPE_ATTR             (1u << 0)
  ------------------
  250|   200k|		break;
  251|    431|            case XML_ENTITY_REF_NODE:
  ------------------
  |  Branch (251:13): [True: 431, False: 200k]
  ------------------
  252|    431|                xmlOutputBufferWrite(buf, 1, "&");
  253|    431|                xmlOutputBufferWriteString(buf, (const char *) children->name);
  254|    431|                xmlOutputBufferWrite(buf, 1, ";");
  255|    431|                break;
  256|      0|            default:
  ------------------
  |  Branch (256:13): [True: 0, False: 200k]
  ------------------
  257|       |                /* should not happen unless we have a badly built tree */
  258|      0|                break;
  259|   200k|        }
  260|   200k|        children = children->next;
  261|   200k|    }
  262|   260k|}
xmlsave.c:xhtmlIsEmpty:
 1356|  16.4k|xhtmlIsEmpty(xmlNodePtr node) {
 1357|  16.4k|    if (node == NULL)
  ------------------
  |  Branch (1357:9): [True: 0, False: 16.4k]
  ------------------
 1358|      0|	return(-1);
 1359|  16.4k|    if (node->type != XML_ELEMENT_NODE)
  ------------------
  |  Branch (1359:9): [True: 0, False: 16.4k]
  ------------------
 1360|      0|	return(0);
 1361|  16.4k|    if ((node->ns != NULL) && (!xmlStrEqual(node->ns->href, XHTML_NS_NAME)))
  ------------------
  |  |   33|  1.52k|#define XHTML_NS_NAME BAD_CAST "http://www.w3.org/1999/xhtml"
  |  |  ------------------
  |  |  |  |   34|  1.52k|#define BAD_CAST (xmlChar *)
  |  |  ------------------
  ------------------
  |  Branch (1361:9): [True: 1.52k, False: 14.8k]
  |  Branch (1361:31): [True: 1.31k, False: 212]
  ------------------
 1362|  1.31k|	return(0);
 1363|  15.1k|    if (node->children != NULL)
  ------------------
  |  Branch (1363:9): [True: 0, False: 15.1k]
  ------------------
 1364|      0|	return(0);
 1365|  15.1k|    switch (node->name ? node->name[0] : 0) {
  ------------------
  |  Branch (1365:13): [True: 15.1k, False: 0]
  |  Branch (1365:13): [True: 11.4k, False: 3.67k]
  ------------------
 1366|  3.05k|	case 'a':
  ------------------
  |  Branch (1366:2): [True: 3.05k, False: 12.0k]
  ------------------
 1367|  3.05k|	    if (xmlStrEqual(node->name, BAD_CAST "area"))
  ------------------
  |  |   34|  3.05k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (1367:10): [True: 203, False: 2.85k]
  ------------------
 1368|    203|		return(1);
 1369|  2.85k|	    return(0);
 1370|  1.52k|	case 'b':
  ------------------
  |  Branch (1370:2): [True: 1.52k, False: 13.5k]
  ------------------
 1371|  1.52k|	    if (xmlStrEqual(node->name, BAD_CAST "br"))
  ------------------
  |  |   34|  1.52k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (1371:10): [True: 301, False: 1.22k]
  ------------------
 1372|    301|		return(1);
 1373|  1.22k|	    if (xmlStrEqual(node->name, BAD_CAST "base"))
  ------------------
  |  |   34|  1.22k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (1373:10): [True: 268, False: 959]
  ------------------
 1374|    268|		return(1);
 1375|    959|	    if (xmlStrEqual(node->name, BAD_CAST "basefont"))
  ------------------
  |  |   34|    959|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (1375:10): [True: 200, False: 759]
  ------------------
 1376|    200|		return(1);
 1377|    759|	    return(0);
 1378|    694|	case 'c':
  ------------------
  |  Branch (1378:2): [True: 694, False: 14.4k]
  ------------------
 1379|    694|	    if (xmlStrEqual(node->name, BAD_CAST "col"))
  ------------------
  |  |   34|    694|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (1379:10): [True: 222, False: 472]
  ------------------
 1380|    222|		return(1);
 1381|    472|	    return(0);
 1382|    593|	case 'f':
  ------------------
  |  Branch (1382:2): [True: 593, False: 14.5k]
  ------------------
 1383|    593|	    if (xmlStrEqual(node->name, BAD_CAST "frame"))
  ------------------
  |  |   34|    593|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (1383:10): [True: 281, False: 312]
  ------------------
 1384|    281|		return(1);
 1385|    312|	    return(0);
 1386|    785|	case 'h':
  ------------------
  |  Branch (1386:2): [True: 785, False: 14.3k]
  ------------------
 1387|    785|	    if (xmlStrEqual(node->name, BAD_CAST "hr"))
  ------------------
  |  |   34|    785|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (1387:10): [True: 213, False: 572]
  ------------------
 1388|    213|		return(1);
 1389|    572|	    return(0);
 1390|  1.67k|	case 'i':
  ------------------
  |  Branch (1390:2): [True: 1.67k, False: 13.4k]
  ------------------
 1391|  1.67k|	    if (xmlStrEqual(node->name, BAD_CAST "img"))
  ------------------
  |  |   34|  1.67k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (1391:10): [True: 763, False: 913]
  ------------------
 1392|    763|		return(1);
 1393|    913|	    if (xmlStrEqual(node->name, BAD_CAST "input"))
  ------------------
  |  |   34|    913|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (1393:10): [True: 197, False: 716]
  ------------------
 1394|    197|		return(1);
 1395|    716|	    if (xmlStrEqual(node->name, BAD_CAST "isindex"))
  ------------------
  |  |   34|    716|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (1395:10): [True: 272, False: 444]
  ------------------
 1396|    272|		return(1);
 1397|    444|	    return(0);
 1398|    550|	case 'l':
  ------------------
  |  Branch (1398:2): [True: 550, False: 14.5k]
  ------------------
 1399|    550|	    if (xmlStrEqual(node->name, BAD_CAST "link"))
  ------------------
  |  |   34|    550|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (1399:10): [True: 236, False: 314]
  ------------------
 1400|    236|		return(1);
 1401|    314|	    return(0);
 1402|    719|	case 'm':
  ------------------
  |  Branch (1402:2): [True: 719, False: 14.3k]
  ------------------
 1403|    719|	    if (xmlStrEqual(node->name, BAD_CAST "meta"))
  ------------------
  |  |   34|    719|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (1403:10): [True: 77, False: 642]
  ------------------
 1404|     77|		return(1);
 1405|    642|	    return(0);
 1406|  1.82k|	case 'p':
  ------------------
  |  Branch (1406:2): [True: 1.82k, False: 13.2k]
  ------------------
 1407|  1.82k|	    if (xmlStrEqual(node->name, BAD_CAST "param"))
  ------------------
  |  |   34|  1.82k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (1407:10): [True: 786, False: 1.03k]
  ------------------
 1408|    786|		return(1);
 1409|  1.03k|	    return(0);
 1410|  15.1k|    }
 1411|  3.67k|    return(0);
 1412|  15.1k|}
xmlsave.c:xmlSaveWriteText:
  226|  1.36M|xmlSaveWriteText(xmlSaveCtxt *ctxt, const xmlChar *text, unsigned flags) {
  227|  1.36M|    if (ctxt->encoding == NULL)
  ------------------
  |  Branch (227:9): [True: 0, False: 1.36M]
  ------------------
  228|      0|        flags |= XML_ESCAPE_NON_ASCII;
  ------------------
  |  |   23|      0|#define XML_ESCAPE_NON_ASCII        (1u << 1)
  ------------------
  229|       |
  230|       |    xmlSerializeText(ctxt->buf, text, SIZE_MAX, flags);
  231|  1.36M|}
xmlsave.c:xmlAttrDumpOutput:
  881|   256k|xmlAttrDumpOutput(xmlSaveCtxtPtr ctxt, xmlAttrPtr cur) {
  882|   256k|    xmlOutputBufferPtr buf;
  883|       |
  884|   256k|    if (cur == NULL) return;
  ------------------
  |  Branch (884:9): [True: 0, False: 256k]
  ------------------
  885|   256k|    buf = ctxt->buf;
  886|   256k|    if (buf == NULL) return;
  ------------------
  |  Branch (886:9): [True: 0, False: 256k]
  ------------------
  887|   256k|    if (ctxt->format == 2)
  ------------------
  |  Branch (887:9): [True: 0, False: 256k]
  ------------------
  888|      0|        xmlOutputBufferWriteWSNonSig(ctxt, 2);
  889|   256k|    else
  890|   256k|        xmlOutputBufferWrite(buf, 1, " ");
  891|   256k|    if ((cur->ns != NULL) && (cur->ns->prefix != NULL)) {
  ------------------
  |  Branch (891:9): [True: 115k, False: 141k]
  |  Branch (891:30): [True: 114k, False: 405]
  ------------------
  892|   114k|        xmlOutputBufferWriteString(buf, (const char *)cur->ns->prefix);
  893|   114k|	xmlOutputBufferWrite(buf, 1, ":");
  894|   114k|    }
  895|   256k|    xmlOutputBufferWriteString(buf, (const char *)cur->name);
  896|   256k|    xmlOutputBufferWrite(buf, 2, "=\"");
  897|   256k|#ifdef LIBXML_HTML_ENABLED
  898|   256k|    if ((ctxt->options & XML_SAVE_XHTML) &&
  ------------------
  |  Branch (898:9): [True: 22.8k, False: 234k]
  ------------------
  899|  22.8k|        (cur->ns == NULL) &&
  ------------------
  |  Branch (899:9): [True: 20.6k, False: 2.17k]
  ------------------
  900|  20.6k|        ((cur->children == NULL) ||
  ------------------
  |  Branch (900:10): [True: 8.39k, False: 12.2k]
  ------------------
  901|  12.2k|         (cur->children->content == NULL) ||
  ------------------
  |  Branch (901:10): [True: 0, False: 12.2k]
  ------------------
  902|  12.2k|         (cur->children->content[0] == 0)) &&
  ------------------
  |  Branch (902:10): [True: 8.06k, False: 4.21k]
  ------------------
  903|  16.4k|        (htmlIsBooleanAttr(cur->name))) {
  ------------------
  |  Branch (903:9): [True: 205, False: 16.2k]
  ------------------
  904|    205|        xmlOutputBufferWriteString(buf, (const char *) cur->name);
  905|    205|    } else
  906|   256k|#endif
  907|   256k|    {
  908|   256k|        xmlSaveWriteAttrContent(ctxt, cur);
  909|   256k|    }
  910|   256k|    xmlOutputBufferWrite(buf, 1, "\"");
  911|   256k|}
xmlsave.c:xmlNodeDumpOutputInternal:
  961|  32.1k|xmlNodeDumpOutputInternal(xmlSaveCtxtPtr ctxt, xmlNodePtr cur) {
  962|  32.1k|    int format = ctxt->format;
  963|  32.1k|    xmlNodePtr tmp, root, unformattedNode = NULL, parent;
  964|  32.1k|    xmlAttrPtr attr;
  965|  32.1k|    xmlChar *start, *end;
  966|  32.1k|    xmlOutputBufferPtr buf;
  967|       |
  968|  32.1k|    if (cur == NULL) return;
  ------------------
  |  Branch (968:9): [True: 0, False: 32.1k]
  ------------------
  969|  32.1k|    buf = ctxt->buf;
  970|       |
  971|  32.1k|    root = cur;
  972|  32.1k|    parent = cur->parent;
  973|  3.89M|    while (1) {
  ------------------
  |  Branch (973:12): [True: 3.89M, Folded]
  ------------------
  974|  3.89M|        switch (cur->type) {
  975|  3.66k|        case XML_DOCUMENT_NODE:
  ------------------
  |  Branch (975:9): [True: 3.66k, False: 3.89M]
  ------------------
  976|  3.66k|        case XML_HTML_DOCUMENT_NODE:
  ------------------
  |  Branch (976:9): [True: 0, False: 3.89M]
  ------------------
  977|  3.66k|	    xmlSaveDocInternal(ctxt, (xmlDocPtr) cur, ctxt->encoding);
  978|  3.66k|	    break;
  979|       |
  980|  3.58k|        case XML_DTD_NODE:
  ------------------
  |  Branch (980:9): [True: 3.58k, False: 3.89M]
  ------------------
  981|  3.58k|            xmlDtdDumpOutput(ctxt, (xmlDtdPtr) cur);
  982|  3.58k|            break;
  983|       |
  984|      0|        case XML_DOCUMENT_FRAG_NODE:
  ------------------
  |  Branch (984:9): [True: 0, False: 3.89M]
  ------------------
  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|  4.60k|        case XML_ELEMENT_DECL:
  ------------------
  |  Branch (993:9): [True: 4.60k, False: 3.89M]
  ------------------
  994|  4.60k|            xmlBufDumpElementDecl(buf, (xmlElementPtr) cur);
  995|  4.60k|            break;
  996|       |
  997|  3.23k|        case XML_ATTRIBUTE_DECL:
  ------------------
  |  Branch (997:9): [True: 3.23k, False: 3.89M]
  ------------------
  998|  3.23k|            xmlSaveWriteAttributeDecl(ctxt, (xmlAttributePtr) cur);
  999|  3.23k|            break;
 1000|       |
 1001|  3.54k|        case XML_ENTITY_DECL:
  ------------------
  |  Branch (1001:9): [True: 3.54k, False: 3.89M]
  ------------------
 1002|  3.54k|            xmlBufDumpEntityDecl(buf, (xmlEntityPtr) cur);
 1003|  3.54k|            break;
 1004|       |
 1005|  2.05M|        case XML_ELEMENT_NODE:
  ------------------
  |  Branch (1005:9): [True: 2.05M, False: 1.83M]
  ------------------
 1006|  2.05M|	    if ((cur != root) && (ctxt->format == 1))
  ------------------
  |  Branch (1006:10): [True: 2.05M, False: 7.88k]
  |  Branch (1006:27): [True: 0, False: 2.05M]
  ------------------
 1007|      0|                xmlSaveWriteIndent(ctxt, 0);
 1008|       |
 1009|       |            /*
 1010|       |             * Some users like lxml are known to pass nodes with a corrupted
 1011|       |             * tree structure. Fall back to a recursive call to handle this
 1012|       |             * case.
 1013|       |             */
 1014|  2.05M|            if ((cur->parent != parent) && (cur->children != NULL)) {
  ------------------
  |  Branch (1014:17): [True: 0, False: 2.05M]
  |  Branch (1014:44): [True: 0, False: 0]
  ------------------
 1015|      0|                xmlNodeDumpOutputInternal(ctxt, cur);
 1016|      0|                break;
 1017|      0|            }
 1018|       |
 1019|  2.05M|            xmlOutputBufferWrite(buf, 1, "<");
 1020|  2.05M|            if ((cur->ns != NULL) && (cur->ns->prefix != NULL)) {
  ------------------
  |  Branch (1020:17): [True: 119k, False: 1.93M]
  |  Branch (1020:38): [True: 112k, False: 7.09k]
  ------------------
 1021|   112k|                xmlOutputBufferWriteString(buf, (const char *)cur->ns->prefix);
 1022|   112k|                xmlOutputBufferWrite(buf, 1, ":");
 1023|   112k|            }
 1024|  2.05M|            xmlOutputBufferWriteString(buf, (const char *)cur->name);
 1025|  2.05M|            if (cur->nsDef)
  ------------------
  |  Branch (1025:17): [True: 781k, False: 1.27M]
  ------------------
 1026|   781k|                xmlNsListDumpOutputCtxt(ctxt, cur->nsDef);
 1027|  2.29M|            for (attr = cur->properties; attr != NULL; attr = attr->next)
  ------------------
  |  Branch (1027:42): [True: 234k, False: 2.05M]
  ------------------
 1028|   234k|                xmlAttrDumpOutput(ctxt, attr);
 1029|       |
 1030|  2.05M|            if (cur->children == NULL) {
  ------------------
  |  Branch (1030:17): [True: 673k, False: 1.38M]
  ------------------
 1031|   673k|                if ((ctxt->options & XML_SAVE_NO_EMPTY) == 0) {
  ------------------
  |  Branch (1031:21): [True: 673k, False: 0]
  ------------------
 1032|   673k|                    if (ctxt->format == 2)
  ------------------
  |  Branch (1032:25): [True: 0, False: 673k]
  ------------------
 1033|      0|                        xmlOutputBufferWriteWSNonSig(ctxt, 0);
 1034|   673k|                    xmlOutputBufferWrite(buf, 2, "/>");
 1035|   673k|                } 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.38M|            } else {
 1050|  1.38M|                if (ctxt->format == 1) {
  ------------------
  |  Branch (1050:21): [True: 0, False: 1.38M]
  ------------------
 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.38M|                if (ctxt->format == 2)
  ------------------
  |  Branch (1063:21): [True: 0, False: 1.38M]
  ------------------
 1064|      0|                    xmlOutputBufferWriteWSNonSig(ctxt, 1);
 1065|  1.38M|                xmlOutputBufferWrite(buf, 1, ">");
 1066|  1.38M|                if (ctxt->format == 1) xmlOutputBufferWrite(buf, 1, "\n");
  ------------------
  |  Branch (1066:21): [True: 0, False: 1.38M]
  ------------------
 1067|  1.38M|                if (ctxt->level >= 0) ctxt->level++;
  ------------------
  |  Branch (1067:21): [True: 1.38M, False: 0]
  ------------------
 1068|  1.38M|                parent = cur;
 1069|  1.38M|                cur = cur->children;
 1070|  1.38M|                continue;
 1071|  1.38M|            }
 1072|       |
 1073|   673k|            break;
 1074|       |
 1075|  1.14M|        case XML_TEXT_NODE:
  ------------------
  |  Branch (1075:9): [True: 1.14M, False: 2.75M]
  ------------------
 1076|  1.14M|	    if (cur->content == NULL)
  ------------------
  |  Branch (1076:10): [True: 264, False: 1.14M]
  ------------------
 1077|    264|                break;
 1078|  1.14M|	    if (cur->name != xmlStringTextNoenc) {
  ------------------
  |  Branch (1078:10): [True: 1.14M, False: 0]
  ------------------
 1079|  1.14M|                if (ctxt->escape)
  ------------------
  |  Branch (1079:21): [True: 0, False: 1.14M]
  ------------------
 1080|      0|                    xmlOutputBufferWriteEscape(buf, cur->content,
 1081|      0|                                               ctxt->escape);
 1082|       |#ifdef TEST_OUTPUT_BUFFER_WRITE_ESCAPE
 1083|       |                else if (ctxt->encoding)
 1084|       |                    xmlOutputBufferWriteEscape(buf, cur->content, NULL);
 1085|       |#endif
 1086|  1.14M|                else
 1087|  1.14M|                    xmlSaveWriteText(ctxt, cur->content, /* flags */ 0);
 1088|  1.14M|	    } else {
 1089|       |		/*
 1090|       |		 * Disable escaping, needed for XSLT
 1091|       |		 */
 1092|      0|		xmlOutputBufferWriteString(buf, (const char *) cur->content);
 1093|      0|	    }
 1094|  1.14M|	    break;
 1095|       |
 1096|    894|        case XML_PI_NODE:
  ------------------
  |  Branch (1096:9): [True: 894, False: 3.89M]
  ------------------
 1097|    894|	    if ((cur != root) && (ctxt->format == 1))
  ------------------
  |  Branch (1097:10): [True: 286, False: 608]
  |  Branch (1097:27): [True: 0, False: 286]
  ------------------
 1098|      0|                xmlSaveWriteIndent(ctxt, 0);
 1099|       |
 1100|    894|            if (cur->content != NULL) {
  ------------------
  |  Branch (1100:17): [True: 276, False: 618]
  ------------------
 1101|    276|                xmlOutputBufferWrite(buf, 2, "<?");
 1102|    276|                xmlOutputBufferWriteString(buf, (const char *)cur->name);
 1103|    276|                if (cur->content != NULL) {
  ------------------
  |  Branch (1103:21): [True: 276, False: 0]
  ------------------
 1104|    276|                    if (ctxt->format == 2)
  ------------------
  |  Branch (1104:25): [True: 0, False: 276]
  ------------------
 1105|      0|                        xmlOutputBufferWriteWSNonSig(ctxt, 0);
 1106|    276|                    else
 1107|    276|                        xmlOutputBufferWrite(buf, 1, " ");
 1108|    276|                    xmlOutputBufferWriteString(buf,
 1109|    276|                            (const char *)cur->content);
 1110|    276|                }
 1111|    276|                xmlOutputBufferWrite(buf, 2, "?>");
 1112|    618|            } else {
 1113|    618|                xmlOutputBufferWrite(buf, 2, "<?");
 1114|    618|                xmlOutputBufferWriteString(buf, (const char *)cur->name);
 1115|    618|                if (ctxt->format == 2)
  ------------------
  |  Branch (1115:21): [True: 0, False: 618]
  ------------------
 1116|      0|                    xmlOutputBufferWriteWSNonSig(ctxt, 0);
 1117|    618|                xmlOutputBufferWrite(buf, 2, "?>");
 1118|    618|            }
 1119|    894|            break;
 1120|       |
 1121|    904|        case XML_COMMENT_NODE:
  ------------------
  |  Branch (1121:9): [True: 904, False: 3.89M]
  ------------------
 1122|    904|	    if ((cur != root) && (ctxt->format == 1))
  ------------------
  |  Branch (1122:10): [True: 370, False: 534]
  |  Branch (1122:27): [True: 0, False: 370]
  ------------------
 1123|      0|                xmlSaveWriteIndent(ctxt, 0);
 1124|       |
 1125|    904|            if (cur->content != NULL) {
  ------------------
  |  Branch (1125:17): [True: 904, False: 0]
  ------------------
 1126|    904|                xmlOutputBufferWrite(buf, 4, "<!--");
 1127|    904|                xmlOutputBufferWriteString(buf, (const char *)cur->content);
 1128|    904|                xmlOutputBufferWrite(buf, 3, "-->");
 1129|    904|            }
 1130|    904|            break;
 1131|       |
 1132|  2.47k|        case XML_ENTITY_REF_NODE:
  ------------------
  |  Branch (1132:9): [True: 2.47k, False: 3.89M]
  ------------------
 1133|  2.47k|            xmlOutputBufferWrite(buf, 1, "&");
 1134|  2.47k|            xmlOutputBufferWriteString(buf, (const char *)cur->name);
 1135|  2.47k|            xmlOutputBufferWrite(buf, 1, ";");
 1136|  2.47k|            break;
 1137|       |
 1138|    607|        case XML_CDATA_SECTION_NODE:
  ------------------
  |  Branch (1138:9): [True: 607, False: 3.89M]
  ------------------
 1139|    607|            if (cur->content == NULL || *cur->content == '\0') {
  ------------------
  |  Branch (1139:17): [True: 0, False: 607]
  |  Branch (1139:41): [True: 292, False: 315]
  ------------------
 1140|    292|                xmlOutputBufferWrite(buf, 12, "<![CDATA[]]>");
 1141|    315|            } else {
 1142|    315|                start = end = cur->content;
 1143|  1.90k|                while (*end != '\0') {
  ------------------
  |  Branch (1143:24): [True: 1.59k, False: 315]
  ------------------
 1144|  1.59k|                    if ((*end == ']') && (*(end + 1) == ']') &&
  ------------------
  |  Branch (1144:25): [True: 459, False: 1.13k]
  |  Branch (1144:42): [True: 218, False: 241]
  ------------------
 1145|    218|                        (*(end + 2) == '>')) {
  ------------------
  |  Branch (1145:25): [True: 0, False: 218]
  ------------------
 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|  1.59k|                    end++;
 1154|  1.59k|                }
 1155|    315|                if (start != end) {
  ------------------
  |  Branch (1155:21): [True: 315, False: 0]
  ------------------
 1156|    315|                    xmlOutputBufferWrite(buf, 9, "<![CDATA[");
 1157|    315|                    xmlOutputBufferWriteString(buf, (const char *)start);
 1158|    315|                    xmlOutputBufferWrite(buf, 3, "]]>");
 1159|    315|                }
 1160|    315|            }
 1161|    607|            break;
 1162|       |
 1163|      0|        case XML_ATTRIBUTE_NODE:
  ------------------
  |  Branch (1163:9): [True: 0, False: 3.89M]
  ------------------
 1164|      0|            xmlAttrDumpOutput(ctxt, (xmlAttrPtr) cur);
 1165|      0|            break;
 1166|       |
 1167|      0|        case XML_NAMESPACE_DECL:
  ------------------
  |  Branch (1167:9): [True: 0, False: 3.89M]
  ------------------
 1168|      0|            xmlNsDumpOutput(buf, (xmlNsPtr) cur, ctxt);
 1169|      0|            break;
 1170|       |
 1171|   672k|        default:
  ------------------
  |  Branch (1171:9): [True: 672k, False: 3.22M]
  ------------------
 1172|   672k|            break;
 1173|  3.89M|        }
 1174|       |
 1175|  3.89M|        while (1) {
  ------------------
  |  Branch (1175:16): [True: 3.89M, Folded]
  ------------------
 1176|  3.89M|            if (cur == root)
  ------------------
  |  Branch (1176:17): [True: 32.1k, False: 3.86M]
  ------------------
 1177|  32.1k|                return;
 1178|  3.86M|            if ((ctxt->format == 1) &&
  ------------------
  |  Branch (1178:17): [True: 0, False: 3.86M]
  ------------------
 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.86M|            if (cur->next != NULL) {
  ------------------
  |  Branch (1182:17): [True: 2.48M, False: 1.38M]
  ------------------
 1183|  2.48M|                cur = cur->next;
 1184|  2.48M|                break;
 1185|  2.48M|            }
 1186|       |
 1187|  1.38M|            cur = parent;
 1188|       |            /* cur->parent was validated when descending. */
 1189|  1.38M|            parent = cur->parent;
 1190|       |
 1191|  1.38M|            if (cur->type == XML_ELEMENT_NODE) {
  ------------------
  |  Branch (1191:17): [True: 1.38M, False: 0]
  ------------------
 1192|  1.38M|                if (ctxt->level > 0) ctxt->level--;
  ------------------
  |  Branch (1192:21): [True: 1.38M, False: 0]
  ------------------
 1193|  1.38M|                if (ctxt->format == 1)
  ------------------
  |  Branch (1193:21): [True: 0, False: 1.38M]
  ------------------
 1194|      0|                    xmlSaveWriteIndent(ctxt, 0);
 1195|       |
 1196|  1.38M|                xmlOutputBufferWrite(buf, 2, "</");
 1197|  1.38M|                if ((cur->ns != NULL) && (cur->ns->prefix != NULL)) {
  ------------------
  |  Branch (1197:21): [True: 11.1k, False: 1.37M]
  |  Branch (1197:42): [True: 6.44k, False: 4.66k]
  ------------------
 1198|  6.44k|                    xmlOutputBufferWriteString(buf,
 1199|  6.44k|                            (const char *)cur->ns->prefix);
 1200|  6.44k|                    xmlOutputBufferWrite(buf, 1, ":");
 1201|  6.44k|                }
 1202|       |
 1203|  1.38M|                xmlOutputBufferWriteString(buf, (const char *)cur->name);
 1204|  1.38M|                if (ctxt->format == 2)
  ------------------
  |  Branch (1204:21): [True: 0, False: 1.38M]
  ------------------
 1205|      0|                    xmlOutputBufferWriteWSNonSig(ctxt, 0);
 1206|  1.38M|                xmlOutputBufferWrite(buf, 1, ">");
 1207|       |
 1208|  1.38M|                if (cur == unformattedNode) {
  ------------------
  |  Branch (1208:21): [True: 0, False: 1.38M]
  ------------------
 1209|      0|                    ctxt->format = format;
 1210|       |                    unformattedNode = NULL;
 1211|      0|                }
 1212|  1.38M|            }
 1213|  1.38M|        }
 1214|  2.51M|    }
 1215|  32.1k|}
xmlsave.c:xmlBufDumpNotationDecl:
  271|    869|xmlBufDumpNotationDecl(xmlOutputBufferPtr buf, xmlNotationPtr nota) {
  272|    869|    xmlOutputBufferWrite(buf, 11, "<!NOTATION ");
  273|    869|    xmlOutputBufferWriteString(buf, (const char *) nota->name);
  274|       |
  275|    869|    if (nota->PublicID != NULL) {
  ------------------
  |  Branch (275:9): [True: 632, False: 237]
  ------------------
  276|    632|	xmlOutputBufferWrite(buf, 8, " PUBLIC ");
  277|    632|	xmlOutputBufferWriteQuotedString(buf, nota->PublicID);
  278|    632|	if (nota->SystemID != NULL) {
  ------------------
  |  Branch (278:6): [True: 3, False: 629]
  ------------------
  279|      3|	    xmlOutputBufferWrite(buf, 1, " ");
  280|      3|	    xmlOutputBufferWriteQuotedString(buf, nota->SystemID);
  281|      3|	}
  282|    632|    } else {
  283|    237|	xmlOutputBufferWrite(buf, 8, " SYSTEM ");
  284|    237|	xmlOutputBufferWriteQuotedString(buf, nota->SystemID);
  285|    237|    }
  286|       |
  287|    869|    xmlOutputBufferWrite(buf, 3, " >\n");
  288|    869|}
xmlsave.c:xmlBufDumpNotationTable:
  310|    865|xmlBufDumpNotationTable(xmlOutputBufferPtr buf, xmlNotationTablePtr table) {
  311|    865|    xmlHashScan(table, xmlBufDumpNotationDeclScan, buf);
  312|    865|}
xmlsave.c:xmlBufDumpNotationDeclScan:
  299|    869|                           const xmlChar *name ATTRIBUTE_UNUSED) {
  300|    869|    xmlBufDumpNotationDecl((xmlOutputBufferPtr) buf, (xmlNotationPtr) nota);
  301|    869|}
xmlsave.c:xmlSaveCtxtInit:
  153|  30.6k|{
  154|  30.6k|    if (ctxt == NULL) return;
  ------------------
  |  Branch (154:9): [True: 0, False: 30.6k]
  ------------------
  155|       |
  156|  30.6k|    xmlSaveSetIndentString(ctxt, xmlTreeIndentString);
  ------------------
  |  | 1364|  30.6k|    #define xmlTreeIndentString (*__xmlTreeIndentString())
  ------------------
  157|       |
  158|  30.6k|    if (options & XML_SAVE_FORMAT)
  ------------------
  |  Branch (158:9): [True: 0, False: 30.6k]
  ------------------
  159|      0|        ctxt->format = 1;
  160|  30.6k|    else if (options & XML_SAVE_WSNONSIG)
  ------------------
  |  Branch (160:14): [True: 0, False: 30.6k]
  ------------------
  161|      0|        ctxt->format = 2;
  162|       |
  163|  30.6k|    if (((options & XML_SAVE_EMPTY) == 0) &&
  ------------------
  |  Branch (163:9): [True: 30.6k, False: 0]
  ------------------
  164|  30.6k|        (xmlSaveNoEmptyTags))
  ------------------
  |  | 1372|  30.6k|    #define xmlSaveNoEmptyTags (*__xmlSaveNoEmptyTags())
  ------------------
  |  Branch (164:9): [True: 0, False: 30.6k]
  ------------------
  165|      0|	options |= XML_SAVE_NO_EMPTY;
  166|       |
  167|  30.6k|    ctxt->options = options;
  168|  30.6k|}

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

xmlStrndup:
   50|  22.7M|xmlStrndup(const xmlChar *cur, int len) {
   51|  22.7M|    xmlChar *ret;
   52|       |
   53|  22.7M|    if ((cur == NULL) || (len < 0)) return(NULL);
  ------------------
  |  Branch (53:9): [True: 0, False: 22.7M]
  |  Branch (53:26): [True: 0, False: 22.7M]
  ------------------
   54|  22.7M|    ret = xmlMalloc((size_t) len + 1);
   55|  22.7M|    if (ret == NULL) {
  ------------------
  |  Branch (55:9): [True: 2.69k, False: 22.7M]
  ------------------
   56|  2.69k|        return(NULL);
   57|  2.69k|    }
   58|  22.7M|    memcpy(ret, cur, len);
   59|  22.7M|    ret[len] = 0;
   60|  22.7M|    return(ret);
   61|  22.7M|}
xmlStrdup:
   72|  18.0M|xmlStrdup(const xmlChar *cur) {
   73|  18.0M|    const xmlChar *p = cur;
   74|       |
   75|  18.0M|    if (cur == NULL) return(NULL);
  ------------------
  |  Branch (75:9): [True: 21, False: 18.0M]
  ------------------
   76|   809M|    while (*p != 0) p++; /* non input consuming */
  ------------------
  |  Branch (76:12): [True: 791M, False: 18.0M]
  ------------------
   77|  18.0M|    return(xmlStrndup(cur, p - cur));
   78|  18.0M|}
xmlCharStrndup:
   89|   648k|xmlCharStrndup(const char *cur, int len) {
   90|   648k|    int i;
   91|   648k|    xmlChar *ret;
   92|       |
   93|   648k|    if ((cur == NULL) || (len < 0)) return(NULL);
  ------------------
  |  Branch (93:9): [True: 0, False: 648k]
  |  Branch (93:26): [True: 0, False: 648k]
  ------------------
   94|   648k|    ret = xmlMalloc((size_t) len + 1);
   95|   648k|    if (ret == NULL) {
  ------------------
  |  Branch (95:9): [True: 147, False: 648k]
  ------------------
   96|    147|        return(NULL);
   97|    147|    }
   98|  83.6M|    for (i = 0;i < len;i++) {
  ------------------
  |  Branch (98:16): [True: 82.9M, False: 648k]
  ------------------
   99|       |        /* Explicit sign change */
  100|  82.9M|        ret[i] = (xmlChar) cur[i];
  101|  82.9M|        if (ret[i] == 0) return(ret);
  ------------------
  |  Branch (101:13): [True: 0, False: 82.9M]
  ------------------
  102|  82.9M|    }
  103|   648k|    ret[len] = 0;
  104|   648k|    return(ret);
  105|   648k|}
xmlCharStrdup:
  115|   648k|xmlCharStrdup(const char *cur) {
  116|   648k|    const char *p = cur;
  117|       |
  118|   648k|    if (cur == NULL) return(NULL);
  ------------------
  |  Branch (118:9): [True: 0, False: 648k]
  ------------------
  119|  83.6M|    while (*p != '\0') p++; /* non input consuming */
  ------------------
  |  Branch (119:12): [True: 82.9M, False: 648k]
  ------------------
  120|   648k|    return(xmlCharStrndup(cur, p - cur));
  121|   648k|}
xmlStrcmp:
  132|  2.48k|xmlStrcmp(const xmlChar *str1, const xmlChar *str2) {
  133|  2.48k|    if (str1 == str2) return(0);
  ------------------
  |  Branch (133:9): [True: 2.38k, False: 96]
  ------------------
  134|     96|    if (str1 == NULL) return(-1);
  ------------------
  |  Branch (134:9): [True: 96, 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|  25.1M|xmlStrEqual(const xmlChar *str1, const xmlChar *str2) {
  158|  25.1M|    if (str1 == str2) return(1);
  ------------------
  |  Branch (158:9): [True: 816k, False: 24.3M]
  ------------------
  159|  24.3M|    if (str1 == NULL) return(0);
  ------------------
  |  Branch (159:9): [True: 626k, False: 23.6M]
  ------------------
  160|  23.6M|    if (str2 == NULL) return(0);
  ------------------
  |  Branch (160:9): [True: 4.04M, False: 19.6M]
  ------------------
  161|  19.6M|#ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
  162|  19.6M|    return(strcmp((const char *)str1, (const char *)str2) == 0);
  163|       |#else
  164|       |    do {
  165|       |        if (*str1++ != *str2) return(0);
  166|       |    } while (*str2++);
  167|       |    return(1);
  168|       |#endif
  169|  23.6M|}
xmlStrQEqual:
  181|  45.7k|xmlStrQEqual(const xmlChar *pref, const xmlChar *name, const xmlChar *str) {
  182|  45.7k|    if (pref == NULL) return(xmlStrEqual(name, str));
  ------------------
  |  Branch (182:9): [True: 13.2k, False: 32.4k]
  ------------------
  183|  32.4k|    if (name == NULL) return(0);
  ------------------
  |  Branch (183:9): [True: 0, False: 32.4k]
  ------------------
  184|  32.4k|    if (str == NULL) return(0);
  ------------------
  |  Branch (184:9): [True: 0, False: 32.4k]
  ------------------
  185|       |
  186|   208k|    do {
  187|   208k|        if (*pref++ != *str) return(0);
  ------------------
  |  Branch (187:13): [True: 0, False: 208k]
  ------------------
  188|   208k|    } while ((*str++) && (*pref));
  ------------------
  |  Branch (188:14): [True: 208k, False: 0]
  |  Branch (188:26): [True: 175k, False: 32.4k]
  ------------------
  189|  32.4k|    if (*str++ != ':') return(0);
  ------------------
  |  Branch (189:9): [True: 0, False: 32.4k]
  ------------------
  190|   272k|    do {
  191|   272k|        if (*name++ != *str) return(0);
  ------------------
  |  Branch (191:13): [True: 0, False: 272k]
  ------------------
  192|   272k|    } while (*str++);
  ------------------
  |  Branch (192:14): [True: 239k, False: 32.4k]
  ------------------
  193|  32.4k|    return(1);
  194|  32.4k|}
xmlStrncmp:
  206|  22.5M|xmlStrncmp(const xmlChar *str1, const xmlChar *str2, int len) {
  207|  22.5M|    if (len <= 0) return(0);
  ------------------
  |  Branch (207:9): [True: 12, False: 22.5M]
  ------------------
  208|  22.5M|    if (str1 == str2) return(0);
  ------------------
  |  Branch (208:9): [True: 0, False: 22.5M]
  ------------------
  209|  22.5M|    if (str1 == NULL) return(-1);
  ------------------
  |  Branch (209:9): [True: 1, False: 22.5M]
  ------------------
  210|  22.5M|    if (str2 == NULL) return(1);
  ------------------
  |  Branch (210:9): [True: 0, False: 22.5M]
  ------------------
  211|  22.5M|#ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
  212|  22.5M|    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|  22.5M|}
xmlStrcasecmp:
  266|  84.5k|xmlStrcasecmp(const xmlChar *str1, const xmlChar *str2) {
  267|  84.5k|    register int tmp;
  268|       |
  269|  84.5k|    if (str1 == str2) return(0);
  ------------------
  |  Branch (269:9): [True: 0, False: 84.5k]
  ------------------
  270|  84.5k|    if (str1 == NULL) return(-1);
  ------------------
  |  Branch (270:9): [True: 0, False: 84.5k]
  ------------------
  271|  84.5k|    if (str2 == NULL) return(1);
  ------------------
  |  Branch (271:9): [True: 0, False: 84.5k]
  ------------------
  272|   209k|    do {
  273|   209k|        tmp = casemap[*str1++] - casemap[*str2];
  274|   209k|        if (tmp != 0) return(tmp);
  ------------------
  |  Branch (274:13): [True: 79.9k, False: 130k]
  ------------------
  275|   209k|    } while (*str2++ != 0);
  ------------------
  |  Branch (275:14): [True: 125k, False: 4.59k]
  ------------------
  276|  4.59k|    return 0;
  277|  84.5k|}
xmlStrchr:
  312|  72.5M|xmlStrchr(const xmlChar *str, xmlChar val) {
  313|  72.5M|    if (str == NULL) return(NULL);
  ------------------
  |  Branch (313:9): [True: 0, False: 72.5M]
  ------------------
  314|   352M|    while (*str != 0) { /* non input consuming */
  ------------------
  |  Branch (314:12): [True: 280M, False: 72.0M]
  ------------------
  315|   280M|        if (*str == val) return((xmlChar *) str);
  ------------------
  |  Branch (315:13): [True: 525k, False: 280M]
  ------------------
  316|   280M|        str++;
  317|   280M|    }
  318|  72.0M|    return(NULL);
  319|  72.5M|}
xmlStrstr:
  330|   509k|xmlStrstr(const xmlChar *str, const xmlChar *val) {
  331|   509k|    int n;
  332|       |
  333|   509k|    if (str == NULL) return(NULL);
  ------------------
  |  Branch (333:9): [True: 0, False: 509k]
  ------------------
  334|   509k|    if (val == NULL) return(NULL);
  ------------------
  |  Branch (334:9): [True: 0, False: 509k]
  ------------------
  335|   509k|    n = xmlStrlen(val);
  336|       |
  337|   509k|    if (n == 0) return(str);
  ------------------
  |  Branch (337:9): [True: 0, False: 509k]
  ------------------
  338|  2.95M|    while (*str != 0) { /* non input consuming */
  ------------------
  |  Branch (338:12): [True: 2.47M, False: 483k]
  ------------------
  339|  2.47M|        if (*str == *val) {
  ------------------
  |  Branch (339:13): [True: 32.0k, False: 2.43M]
  ------------------
  340|  32.0k|            if (!xmlStrncmp(str, val, n)) return((const xmlChar *) str);
  ------------------
  |  Branch (340:17): [True: 25.0k, False: 6.92k]
  ------------------
  341|  32.0k|        }
  342|  2.44M|        str++;
  343|  2.44M|    }
  344|   483k|    return(NULL);
  345|   509k|}
xmlStrlen:
  405|  3.03M|xmlStrlen(const xmlChar *str) {
  406|  3.03M|    size_t len = str ? strlen((const char *)str) : 0;
  ------------------
  |  Branch (406:18): [True: 3.03M, False: 1.96k]
  ------------------
  407|  3.03M|    return(len > INT_MAX ? 0 : len);
  ------------------
  |  Branch (407:12): [True: 0, False: 3.03M]
  ------------------
  408|  3.03M|}
xmlStrncat:
  423|   386k|xmlStrncat(xmlChar *cur, const xmlChar *add, int len) {
  424|   386k|    int size;
  425|   386k|    xmlChar *ret;
  426|       |
  427|   386k|    if ((add == NULL) || (len == 0))
  ------------------
  |  Branch (427:9): [True: 0, False: 386k]
  |  Branch (427:26): [True: 367, False: 386k]
  ------------------
  428|    367|        return(cur);
  429|       |
  430|   386k|    if (len < 0) {
  ------------------
  |  Branch (430:9): [True: 0, False: 386k]
  ------------------
  431|      0|        if (cur != NULL)
  ------------------
  |  Branch (431:13): [True: 0, False: 0]
  ------------------
  432|      0|            xmlFree(cur);
  433|      0|        return(NULL);
  434|      0|    }
  435|       |
  436|   386k|    if (cur == NULL)
  ------------------
  |  Branch (436:9): [True: 0, False: 386k]
  ------------------
  437|      0|        return(xmlStrndup(add, len));
  438|       |
  439|   386k|    size = xmlStrlen(cur);
  440|   386k|    if ((size < 0) || (size > INT_MAX - len)) {
  ------------------
  |  Branch (440:9): [True: 0, False: 386k]
  |  Branch (440:23): [True: 0, False: 386k]
  ------------------
  441|      0|        xmlFree(cur);
  442|      0|        return(NULL);
  443|      0|    }
  444|   386k|    ret = (xmlChar *) xmlRealloc(cur, (size_t) size + len + 1);
  445|   386k|    if (ret == NULL) {
  ------------------
  |  Branch (445:9): [True: 14, False: 386k]
  ------------------
  446|     14|        xmlFree(cur);
  447|     14|        return(NULL);
  448|     14|    }
  449|   386k|    memcpy(&ret[size], add, len);
  450|   386k|    ret[size + len] = 0;
  451|   386k|    return(ret);
  452|   386k|}
xmlStrncatNew:
  465|     24|xmlStrncatNew(const xmlChar *str1, const xmlChar *str2, int len) {
  466|     24|    int size;
  467|     24|    xmlChar *ret;
  468|       |
  469|     24|    if (len < 0) {
  ------------------
  |  Branch (469:9): [True: 0, False: 24]
  ------------------
  470|      0|        len = xmlStrlen(str2);
  471|      0|        if (len < 0)
  ------------------
  |  Branch (471:13): [True: 0, False: 0]
  ------------------
  472|      0|            return(NULL);
  473|      0|    }
  474|     24|    if (str1 == NULL)
  ------------------
  |  Branch (474:9): [True: 24, False: 0]
  ------------------
  475|     24|        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|   386k|xmlStrcat(xmlChar *cur, const xmlChar *add) {
  503|   386k|    const xmlChar *p = add;
  504|       |
  505|   386k|    if (add == NULL) return(cur);
  ------------------
  |  Branch (505:9): [True: 2, False: 386k]
  ------------------
  506|   386k|    if (cur == NULL)
  ------------------
  |  Branch (506:9): [True: 4, False: 386k]
  ------------------
  507|      4|        return(xmlStrdup(add));
  508|       |
  509|  8.06M|    while (*p != 0) p++; /* non input consuming */
  ------------------
  |  Branch (509:12): [True: 7.68M, False: 386k]
  ------------------
  510|   386k|    return(xmlStrncat(cur, add, p - add));
  511|   386k|}
xmlStrVASPrintf:
  573|  1.24M|xmlStrVASPrintf(xmlChar **out, int maxSize, const char *msg, va_list ap) {
  574|  1.24M|    char empty[1];
  575|  1.24M|    va_list copy;
  576|  1.24M|    xmlChar *buf;
  577|  1.24M|    int res, size;
  578|  1.24M|    int truncated = 0;
  579|       |
  580|  1.24M|    if (out == NULL)
  ------------------
  |  Branch (580:9): [True: 0, False: 1.24M]
  ------------------
  581|      0|        return(1);
  582|  1.24M|    *out = NULL;
  583|  1.24M|    if (msg == NULL)
  ------------------
  |  Branch (583:9): [True: 0, False: 1.24M]
  ------------------
  584|      0|        return(1);
  585|  1.24M|    if (maxSize < 32)
  ------------------
  |  Branch (585:9): [True: 0, False: 1.24M]
  ------------------
  586|      0|        maxSize = 32;
  587|       |
  588|  1.24M|    va_copy(copy, ap);
  589|  1.24M|    res = vsnprintf(empty, 1, msg, copy);
  590|  1.24M|    va_end(copy);
  591|       |
  592|  1.24M|    if (res > 0) {
  ------------------
  |  Branch (592:9): [True: 1.24M, False: 0]
  ------------------
  593|       |        /* snprintf seems to work according to C99. */
  594|       |
  595|  1.24M|        if (res < maxSize) {
  ------------------
  |  Branch (595:13): [True: 1.24M, False: 302]
  ------------------
  596|  1.24M|            size = res + 1;
  597|  1.24M|        } else {
  598|    302|            size = maxSize;
  599|    302|            truncated = 1;
  600|    302|        }
  601|  1.24M|        buf = xmlMalloc(size);
  602|  1.24M|        if (buf == NULL)
  ------------------
  |  Branch (602:13): [True: 1.42k, False: 1.24M]
  ------------------
  603|  1.42k|            return(-1);
  604|  1.24M|        if (vsnprintf((char *) buf, size, msg, ap) < 0) {
  ------------------
  |  Branch (604:13): [True: 0, False: 1.24M]
  ------------------
  605|      0|            xmlFree(buf);
  606|      0|            return(1);
  607|      0|        }
  608|  1.24M|    } 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.24M|    if (truncated != 0) {
  ------------------
  |  Branch (658:9): [True: 302, False: 1.24M]
  ------------------
  659|    302|        int i = size - 1;
  660|       |
  661|    447|        while (i > 0) {
  ------------------
  |  Branch (661:16): [True: 447, False: 0]
  ------------------
  662|       |            /* Break after ASCII */
  663|    447|            if (buf[i-1] < 0x80)
  ------------------
  |  Branch (663:17): [True: 170, False: 277]
  ------------------
  664|    170|                break;
  665|    277|            i -= 1;
  666|       |            /* Break before non-ASCII */
  667|    277|            if (buf[i] >= 0xc0)
  ------------------
  |  Branch (667:17): [True: 132, False: 145]
  ------------------
  668|    132|                break;
  669|    277|        }
  670|       |
  671|    302|        buf[i] = 0;
  672|    302|    }
  673|       |
  674|  1.24M|    *out = (xmlChar *) buf;
  675|  1.24M|    return(truncated);
  676|  1.24M|}
xmlUTF8Strlen:
  770|  9.54k|xmlUTF8Strlen(const xmlChar *utf) {
  771|  9.54k|    size_t ret = 0;
  772|       |
  773|  9.54k|    if (utf == NULL)
  ------------------
  |  Branch (773:9): [True: 8, False: 9.53k]
  ------------------
  774|      8|        return(-1);
  775|       |
  776|  1.06M|    while (*utf != 0) {
  ------------------
  |  Branch (776:12): [True: 1.05M, False: 9.53k]
  ------------------
  777|  1.05M|        if (utf[0] & 0x80) {
  ------------------
  |  Branch (777:13): [True: 8.96k, False: 1.04M]
  ------------------
  778|  8.96k|            if ((utf[1] & 0xc0) != 0x80)
  ------------------
  |  Branch (778:17): [True: 0, False: 8.96k]
  ------------------
  779|      0|                return(-1);
  780|  8.96k|            if ((utf[0] & 0xe0) == 0xe0) {
  ------------------
  |  Branch (780:17): [True: 3.55k, False: 5.41k]
  ------------------
  781|  3.55k|                if ((utf[2] & 0xc0) != 0x80)
  ------------------
  |  Branch (781:21): [True: 0, False: 3.55k]
  ------------------
  782|      0|                    return(-1);
  783|  3.55k|                if ((utf[0] & 0xf0) == 0xf0) {
  ------------------
  |  Branch (783:21): [True: 889, False: 2.66k]
  ------------------
  784|    889|                    if ((utf[0] & 0xf8) != 0xf0 || (utf[3] & 0xc0) != 0x80)
  ------------------
  |  Branch (784:25): [True: 0, False: 889]
  |  Branch (784:52): [True: 0, False: 889]
  ------------------
  785|      0|                        return(-1);
  786|    889|                    utf += 4;
  787|  2.66k|                } else {
  788|  2.66k|                    utf += 3;
  789|  2.66k|                }
  790|  5.41k|            } else {
  791|  5.41k|                utf += 2;
  792|  5.41k|            }
  793|  1.04M|        } else {
  794|  1.04M|            utf++;
  795|  1.04M|        }
  796|  1.05M|        ret++;
  797|  1.05M|    }
  798|  9.53k|    return(ret > INT_MAX ? 0 : ret);
  ------------------
  |  Branch (798:12): [True: 0, False: 9.53k]
  ------------------
  799|  9.53k|}
xmlGetUTF8Char:
  812|  18.3M|xmlGetUTF8Char(const unsigned char *utf, int *len) {
  813|  18.3M|    unsigned int c;
  814|       |
  815|  18.3M|    if (utf == NULL)
  ------------------
  |  Branch (815:9): [True: 0, False: 18.3M]
  ------------------
  816|      0|        goto error;
  817|  18.3M|    if (len == NULL)
  ------------------
  |  Branch (817:9): [True: 0, False: 18.3M]
  ------------------
  818|      0|        goto error;
  819|       |
  820|  18.3M|    c = utf[0];
  821|  18.3M|    if (c < 0x80) {
  ------------------
  |  Branch (821:9): [True: 13.6M, False: 4.74M]
  ------------------
  822|  13.6M|        if (*len < 1)
  ------------------
  |  Branch (822:13): [True: 0, False: 13.6M]
  ------------------
  823|      0|            goto error;
  824|       |        /* 1-byte code */
  825|  13.6M|        *len = 1;
  826|  13.6M|    } else {
  827|  4.74M|        if ((*len < 2) || ((utf[1] & 0xc0) != 0x80))
  ------------------
  |  Branch (827:13): [True: 272, False: 4.74M]
  |  Branch (827:27): [True: 78.0k, False: 4.66M]
  ------------------
  828|  78.3k|            goto error;
  829|  4.66M|        if (c < 0xe0) {
  ------------------
  |  Branch (829:13): [True: 277k, False: 4.38M]
  ------------------
  830|   277k|            if (c < 0xc2)
  ------------------
  |  Branch (830:17): [True: 48.6k, False: 228k]
  ------------------
  831|  48.6k|                goto error;
  832|       |            /* 2-byte code */
  833|   228k|            *len = 2;
  834|   228k|            c = (c & 0x1f) << 6;
  835|   228k|            c |= utf[1] & 0x3f;
  836|  4.38M|        } else {
  837|  4.38M|            if ((*len < 3) || ((utf[2] & 0xc0) != 0x80))
  ------------------
  |  Branch (837:17): [True: 75, False: 4.38M]
  |  Branch (837:31): [True: 836, False: 4.38M]
  ------------------
  838|    911|                goto error;
  839|  4.38M|            if (c < 0xf0) {
  ------------------
  |  Branch (839:17): [True: 4.38M, False: 4.03k]
  ------------------
  840|       |                /* 3-byte code */
  841|  4.38M|                *len = 3;
  842|  4.38M|                c = (c & 0xf) << 12;
  843|  4.38M|                c |= (utf[1] & 0x3f) << 6;
  844|  4.38M|                c |= utf[2] & 0x3f;
  845|  4.38M|                if ((c < 0x800) || ((c >= 0xd800) && (c < 0xe000)))
  ------------------
  |  Branch (845:21): [True: 252, False: 4.38M]
  |  Branch (845:37): [True: 2.17M, False: 2.21M]
  |  Branch (845:54): [True: 684, False: 2.17M]
  ------------------
  846|    936|                    goto error;
  847|  4.38M|            } else {
  848|  4.03k|                if ((*len < 4) || ((utf[3] & 0xc0) != 0x80))
  ------------------
  |  Branch (848:21): [True: 72, False: 3.96k]
  |  Branch (848:35): [True: 283, False: 3.68k]
  ------------------
  849|    355|                    goto error;
  850|  3.68k|                *len = 4;
  851|       |                /* 4-byte code */
  852|  3.68k|                c = (c & 0x7) << 18;
  853|  3.68k|                c |= (utf[1] & 0x3f) << 12;
  854|  3.68k|                c |= (utf[2] & 0x3f) << 6;
  855|  3.68k|                c |= utf[3] & 0x3f;
  856|  3.68k|                if ((c < 0x10000) || (c >= 0x110000))
  ------------------
  |  Branch (856:21): [True: 396, False: 3.28k]
  |  Branch (856:38): [True: 336, False: 2.94k]
  ------------------
  857|    732|                    goto error;
  858|  3.68k|            }
  859|  4.38M|        }
  860|  4.66M|    }
  861|  18.2M|    return(c);
  862|       |
  863|   129k|error:
  864|   129k|    if (len != NULL)
  ------------------
  |  Branch (864:9): [True: 129k, False: 0]
  ------------------
  865|   129k|	*len = 0;
  866|   129k|    return(-1);
  867|  18.3M|}
xmlUTF8Strsize:
  933|   180k|xmlUTF8Strsize(const xmlChar *utf, int len) {
  934|   180k|    const xmlChar *ptr=utf;
  935|   180k|    int ch;
  936|   180k|    size_t ret;
  937|       |
  938|   180k|    if (utf == NULL)
  ------------------
  |  Branch (938:9): [True: 0, False: 180k]
  ------------------
  939|      0|        return(0);
  940|       |
  941|   180k|    if (len <= 0)
  ------------------
  |  Branch (941:9): [True: 0, False: 180k]
  ------------------
  942|      0|        return(0);
  943|       |
  944|   368k|    while ( len-- > 0) {
  ------------------
  |  Branch (944:13): [True: 188k, False: 180k]
  ------------------
  945|   188k|        if ( !*ptr )
  ------------------
  |  Branch (945:14): [True: 672, False: 187k]
  ------------------
  946|    672|            break;
  947|   187k|        ch = *ptr++;
  948|   187k|        if ((ch & 0x80))
  ------------------
  |  Branch (948:13): [True: 0, False: 187k]
  ------------------
  949|      0|            while ((ch<<=1) & 0x80 ) {
  ------------------
  |  Branch (949:20): [True: 0, False: 0]
  ------------------
  950|      0|		if (*ptr == 0) break;
  ------------------
  |  Branch (950:7): [True: 0, False: 0]
  ------------------
  951|      0|                ptr++;
  952|      0|	    }
  953|   187k|    }
  954|   180k|    ret = ptr - utf;
  955|   180k|    return (ret > INT_MAX ? 0 : ret);
  ------------------
  |  Branch (955:13): [True: 0, False: 180k]
  ------------------
  956|   180k|}
xmlUTF8Strndup:
  967|    915|xmlUTF8Strndup(const xmlChar *utf, int len) {
  968|    915|    xmlChar *ret;
  969|    915|    int i;
  970|       |
  971|    915|    if ((utf == NULL) || (len < 0)) return(NULL);
  ------------------
  |  Branch (971:9): [True: 0, False: 915]
  |  Branch (971:26): [True: 0, False: 915]
  ------------------
  972|    915|    i = xmlUTF8Strsize(utf, len);
  973|    915|    ret = xmlMalloc((size_t) i + 1);
  974|    915|    if (ret == NULL) {
  ------------------
  |  Branch (974:9): [True: 5, False: 910]
  ------------------
  975|      5|        return(NULL);
  976|      5|    }
  977|    910|    memcpy(ret, utf, i);
  978|    910|    ret[i] = 0;
  979|    910|    return(ret);
  980|    915|}
xmlUTF8Strpos:
  991|  27.2k|xmlUTF8Strpos(const xmlChar *utf, int pos) {
  992|  27.2k|    int ch;
  993|       |
  994|  27.2k|    if (utf == NULL) return(NULL);
  ------------------
  |  Branch (994:9): [True: 0, False: 27.2k]
  ------------------
  995|  27.2k|    if (pos < 0)
  ------------------
  |  Branch (995:9): [True: 0, False: 27.2k]
  ------------------
  996|      0|        return(NULL);
  997|  4.48M|    while (pos--) {
  ------------------
  |  Branch (997:12): [True: 4.45M, False: 27.2k]
  ------------------
  998|  4.45M|        ch = *utf++;
  999|  4.45M|        if (ch == 0)
  ------------------
  |  Branch (999:13): [True: 0, False: 4.45M]
  ------------------
 1000|      0|            return(NULL);
 1001|  4.45M|        if ( ch & 0x80 ) {
  ------------------
  |  Branch (1001:14): [True: 14.6k, False: 4.44M]
  ------------------
 1002|       |            /* if not simple ascii, verify proper format */
 1003|  14.6k|            if ( (ch & 0xc0) != 0xc0 )
  ------------------
  |  Branch (1003:18): [True: 0, False: 14.6k]
  ------------------
 1004|      0|                return(NULL);
 1005|       |            /* then skip over remaining bytes for this char */
 1006|  48.4k|            while ( (ch <<= 1) & 0x80 )
  ------------------
  |  Branch (1006:21): [True: 33.7k, False: 14.6k]
  ------------------
 1007|  33.7k|                if ( (*utf++ & 0xc0) != 0x80 )
  ------------------
  |  Branch (1007:22): [True: 0, False: 33.7k]
  ------------------
 1008|      0|                    return(NULL);
 1009|  14.6k|        }
 1010|  4.45M|    }
 1011|  27.2k|    return((xmlChar *)utf);
 1012|  27.2k|}
xmlUTF8Strloc:
 1023|  91.6k|xmlUTF8Strloc(const xmlChar *utf, const xmlChar *utfchar) {
 1024|  91.6k|    size_t i;
 1025|  91.6k|    int size;
 1026|  91.6k|    int ch;
 1027|       |
 1028|  91.6k|    if (utf==NULL || utfchar==NULL) return -1;
  ------------------
  |  Branch (1028:9): [True: 0, False: 91.6k]
  |  Branch (1028:22): [True: 0, False: 91.6k]
  ------------------
 1029|  91.6k|    size = xmlUTF8Strsize(utfchar, 1);
 1030|  21.1M|        for(i=0; (ch=*utf) != 0; i++) {
  ------------------
  |  Branch (1030:18): [True: 21.1M, False: 61.0k]
  ------------------
 1031|  21.1M|            if (xmlStrncmp(utf, utfchar, size)==0)
  ------------------
  |  Branch (1031:17): [True: 30.5k, False: 21.0M]
  ------------------
 1032|  30.5k|                return(i > INT_MAX ? 0 : i);
  ------------------
  |  Branch (1032:24): [True: 0, False: 30.5k]
  ------------------
 1033|  21.0M|            utf++;
 1034|  21.0M|            if ( ch & 0x80 ) {
  ------------------
  |  Branch (1034:18): [True: 129k, False: 20.9M]
  ------------------
 1035|       |                /* if not simple ascii, verify proper format */
 1036|   129k|                if ( (ch & 0xc0) != 0xc0 )
  ------------------
  |  Branch (1036:22): [True: 0, False: 129k]
  ------------------
 1037|      0|                    return(-1);
 1038|       |                /* then skip over remaining bytes for this char */
 1039|   350k|                while ( (ch <<= 1) & 0x80 )
  ------------------
  |  Branch (1039:25): [True: 220k, False: 129k]
  ------------------
 1040|   220k|                    if ( (*utf++ & 0xc0) != 0x80 )
  ------------------
  |  Branch (1040:26): [True: 0, False: 220k]
  ------------------
 1041|      0|                        return(-1);
 1042|   129k|            }
 1043|  21.0M|        }
 1044|       |
 1045|  61.0k|    return(-1);
 1046|  91.6k|}
xmlUTF8Strsub:
 1060|    915|xmlUTF8Strsub(const xmlChar *utf, int start, int len) {
 1061|    915|    int i;
 1062|    915|    int ch;
 1063|       |
 1064|    915|    if (utf == NULL) return(NULL);
  ------------------
  |  Branch (1064:9): [True: 0, False: 915]
  ------------------
 1065|    915|    if (start < 0) return(NULL);
  ------------------
  |  Branch (1065:9): [True: 0, False: 915]
  ------------------
 1066|    915|    if (len < 0) return(NULL);
  ------------------
  |  Branch (1066:9): [True: 0, False: 915]
  ------------------
 1067|       |
 1068|       |    /*
 1069|       |     * Skip over any leading chars
 1070|       |     */
 1071|  1.86k|    for (i = 0; i < start; i++) {
  ------------------
  |  Branch (1071:17): [True: 952, False: 915]
  ------------------
 1072|    952|        ch = *utf++;
 1073|    952|        if (ch == 0)
  ------------------
  |  Branch (1073:13): [True: 0, False: 952]
  ------------------
 1074|      0|            return(NULL);
 1075|       |        /* skip over remaining bytes for this char */
 1076|    952|        if (ch & 0x80) {
  ------------------
  |  Branch (1076:13): [True: 0, False: 952]
  ------------------
 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|    952|    }
 1085|       |
 1086|    915|    return(xmlUTF8Strndup(utf, len));
 1087|    915|}

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|   477k|xmlXPathIsNaN(double val) {
  251|   477k|#ifdef isnan
  252|   477k|    return isnan(val);
  253|       |#else
  254|       |    return !(val == val);
  255|       |#endif
  256|   477k|}
xmlXPathIsInf:
  265|   336k|xmlXPathIsInf(double val) {
  266|   336k|#ifdef isinf
  267|   336k|    return isinf(val) ? (val > 0 ? 1 : -1) : 0;
  ------------------
  |  Branch (267:12): [True: 13.5k, False: 323k]
  |  Branch (267:26): [True: 6.03k, False: 7.55k]
  ------------------
  268|       |#else
  269|       |    if (val >= xmlXPathPINF)
  270|       |        return 1;
  271|       |    if (val <= -xmlXPathPINF)
  272|       |        return -1;
  273|       |    return 0;
  274|       |#endif
  275|   336k|}
xmlXPathErrMemory:
  677|  3.13k|{
  678|  3.13k|    if (ctxt == NULL)
  ------------------
  |  Branch (678:9): [True: 0, False: 3.13k]
  ------------------
  679|      0|        return;
  680|  3.13k|    xmlRaiseMemoryError(ctxt->error, NULL, ctxt->userData, XML_FROM_XPATH,
  681|  3.13k|                        &ctxt->lastError);
  682|  3.13k|}
xmlXPathPErrMemory:
  691|  2.97k|{
  692|  2.97k|    if (ctxt == NULL)
  ------------------
  |  Branch (692:9): [True: 0, False: 2.97k]
  ------------------
  693|      0|        return;
  694|  2.97k|    ctxt->error = XPATH_MEMORY_ERROR;
  695|  2.97k|    xmlXPathErrMemory(ctxt->context);
  696|  2.97k|}
xmlXPathErr:
  777|  7.07k|xmlXPathErr(xmlXPathParserContext *ctxt, int code) {
  778|  7.07k|    xmlXPathErrFmt(ctxt, code, "%s\n", xmlXPathErrorMessages[code]);
  779|  7.07k|}
xmlXPathFreeCompExpr:
  971|  10.3k|{
  972|  10.3k|    xmlXPathStepOpPtr op;
  973|  10.3k|    int i;
  974|       |
  975|  10.3k|    if (comp == NULL)
  ------------------
  |  Branch (975:9): [True: 0, False: 10.3k]
  ------------------
  976|      0|        return;
  977|  10.3k|    if (comp->dict == NULL) {
  ------------------
  |  Branch (977:9): [True: 10.3k, False: 0]
  ------------------
  978|  3.31M|	for (i = 0; i < comp->nbStep; i++) {
  ------------------
  |  Branch (978:14): [True: 3.30M, False: 10.3k]
  ------------------
  979|  3.30M|	    op = &comp->steps[i];
  980|  3.30M|	    if (op->value4 != NULL) {
  ------------------
  |  Branch (980:10): [True: 56.9k, False: 3.24M]
  ------------------
  981|  56.9k|		if (op->op == XPATH_OP_VALUE)
  ------------------
  |  Branch (981:7): [True: 42.1k, False: 14.8k]
  ------------------
  982|  42.1k|		    xmlXPathFreeObject(op->value4);
  983|  14.8k|		else
  984|  14.8k|		    xmlFree(op->value4);
  985|  56.9k|	    }
  986|  3.30M|	    if (op->value5 != NULL)
  ------------------
  |  Branch (986:10): [True: 79.3k, False: 3.22M]
  ------------------
  987|  79.3k|		xmlFree(op->value5);
  988|  3.30M|	}
  989|  10.3k|    } 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|  10.3k|    if (comp->steps != NULL) {
  ------------------
  |  Branch (999:9): [True: 10.3k, False: 0]
  ------------------
 1000|  10.3k|        xmlFree(comp->steps);
 1001|  10.3k|    }
 1002|       |#ifdef XPATH_STREAMING
 1003|       |    if (comp->stream != NULL) {
 1004|       |        xmlFreePatternList(comp->stream);
 1005|       |    }
 1006|       |#endif
 1007|  10.3k|    if (comp->expr != NULL) {
  ------------------
  |  Branch (1007:9): [True: 0, False: 10.3k]
  ------------------
 1008|      0|        xmlFree(comp->expr);
 1009|      0|    }
 1010|       |
 1011|  10.3k|    xmlFree(comp);
 1012|  10.3k|}
xmlXPathValuePop:
 1979|  3.81M|{
 1980|  3.81M|    xmlXPathObjectPtr ret;
 1981|       |
 1982|  3.81M|    if ((ctxt == NULL) || (ctxt->valueNr <= 0))
  ------------------
  |  Branch (1982:9): [True: 0, False: 3.81M]
  |  Branch (1982:27): [True: 9.28k, False: 3.80M]
  ------------------
 1983|  9.28k|        return (NULL);
 1984|       |
 1985|  3.80M|    ctxt->valueNr--;
 1986|  3.80M|    if (ctxt->valueNr > 0)
  ------------------
  |  Branch (1986:9): [True: 3.20M, False: 609k]
  ------------------
 1987|  3.20M|        ctxt->value = ctxt->valueTab[ctxt->valueNr - 1];
 1988|   609k|    else
 1989|   609k|        ctxt->value = NULL;
 1990|  3.80M|    ret = ctxt->valueTab[ctxt->valueNr];
 1991|       |    ctxt->valueTab[ctxt->valueNr] = NULL;
 1992|  3.80M|    return (ret);
 1993|  3.81M|}
xmlXPathValuePush:
 2007|  3.81M|{
 2008|  3.81M|    if (ctxt == NULL) return(-1);
  ------------------
  |  Branch (2008:9): [True: 0, False: 3.81M]
  ------------------
 2009|  3.81M|    if (value == NULL) {
  ------------------
  |  Branch (2009:9): [True: 931, False: 3.81M]
  ------------------
 2010|       |        /*
 2011|       |         * A NULL value typically indicates that a memory allocation failed.
 2012|       |         */
 2013|    931|        xmlXPathPErrMemory(ctxt);
 2014|    931|        return(-1);
 2015|    931|    }
 2016|  3.81M|    if (ctxt->valueNr >= ctxt->valueMax) {
  ------------------
  |  Branch (2016:9): [True: 351, False: 3.81M]
  ------------------
 2017|    351|        xmlXPathObjectPtr *tmp;
 2018|    351|        int newSize;
 2019|       |
 2020|    351|        newSize = xmlGrowCapacity(ctxt->valueMax, sizeof(tmp[0]),
 2021|    351|                                  10, XPATH_MAX_STACK_DEPTH);
  ------------------
  |  |   96|    351|#define XPATH_MAX_STACK_DEPTH 1000000
  ------------------
 2022|    351|        if (newSize < 0) {
  ------------------
  |  Branch (2022:13): [True: 0, False: 351]
  ------------------
 2023|      0|            xmlXPathPErrMemory(ctxt);
 2024|      0|            xmlXPathFreeObject(value);
 2025|      0|            return (-1);
 2026|      0|        }
 2027|    351|        tmp = xmlRealloc(ctxt->valueTab, newSize * sizeof(tmp[0]));
 2028|    351|        if (tmp == NULL) {
  ------------------
  |  Branch (2028:13): [True: 3, False: 348]
  ------------------
 2029|      3|            xmlXPathPErrMemory(ctxt);
 2030|      3|            xmlXPathFreeObject(value);
 2031|      3|            return (-1);
 2032|      3|        }
 2033|    348|	ctxt->valueTab = tmp;
 2034|    348|        ctxt->valueMax = newSize;
 2035|    348|    }
 2036|  3.81M|    ctxt->valueTab[ctxt->valueNr] = value;
 2037|  3.81M|    ctxt->value = value;
 2038|  3.81M|    return (ctxt->valueNr++);
 2039|  3.81M|}
xmlXPathNodeSetSort:
 2552|  42.8k|xmlXPathNodeSetSort(xmlNodeSet *set) {
 2553|       |#ifndef WITH_TIM_SORT
 2554|       |    int i, j, incr, len;
 2555|       |    xmlNodePtr tmp;
 2556|       |#endif
 2557|       |
 2558|  42.8k|    if (set == NULL)
  ------------------
  |  Branch (2558:9): [True: 0, False: 42.8k]
  ------------------
 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|  42.8k|    libxml_domnode_tim_sort(set->nodeTab, set->nodeNr);
 2590|  42.8k|#endif /* WITH_TIM_SORT */
 2591|  42.8k|}
xmlXPathNodeSetFreeNs:
 2647|   145k|xmlXPathNodeSetFreeNs(xmlNs *ns) {
 2648|   145k|    if ((ns == NULL) || (ns->type != XML_NAMESPACE_DECL))
  ------------------
  |  Branch (2648:9): [True: 0, False: 145k]
  |  Branch (2648:25): [True: 0, False: 145k]
  ------------------
 2649|      0|	return;
 2650|       |
 2651|   145k|    if ((ns->next != NULL) && (ns->next->type != XML_NAMESPACE_DECL)) {
  ------------------
  |  Branch (2651:9): [True: 145k, False: 0]
  |  Branch (2651:31): [True: 145k, False: 0]
  ------------------
 2652|   145k|	if (ns->href != NULL)
  ------------------
  |  Branch (2652:6): [True: 96.1k, False: 49.7k]
  ------------------
 2653|  96.1k|	    xmlFree((xmlChar *)ns->href);
 2654|   145k|	if (ns->prefix != NULL)
  ------------------
  |  Branch (2654:6): [True: 103k, False: 42.2k]
  ------------------
 2655|   103k|	    xmlFree((xmlChar *)ns->prefix);
 2656|   145k|	xmlFree(ns);
 2657|   145k|    }
 2658|   145k|}
xmlXPathNodeSetCreate:
 2667|  2.25M|xmlXPathNodeSetCreate(xmlNode *val) {
 2668|  2.25M|    xmlNodeSetPtr ret;
 2669|       |
 2670|  2.25M|    ret = (xmlNodeSetPtr) xmlMalloc(sizeof(xmlNodeSet));
 2671|  2.25M|    if (ret == NULL)
  ------------------
  |  Branch (2671:9): [True: 282, False: 2.25M]
  ------------------
 2672|    282|	return(NULL);
 2673|  2.25M|    memset(ret, 0 , sizeof(xmlNodeSet));
 2674|  2.25M|    if (val != NULL) {
  ------------------
  |  Branch (2674:9): [True: 1.16M, False: 1.08M]
  ------------------
 2675|  1.16M|        ret->nodeTab = (xmlNodePtr *) xmlMalloc(XML_NODESET_DEFAULT *
  ------------------
  |  | 2593|  1.16M|#define XML_NODESET_DEFAULT	10
  ------------------
 2676|  1.16M|					     sizeof(xmlNodePtr));
 2677|  1.16M|	if (ret->nodeTab == NULL) {
  ------------------
  |  Branch (2677:6): [True: 120, False: 1.16M]
  ------------------
 2678|    120|	    xmlFree(ret);
 2679|    120|	    return(NULL);
 2680|    120|	}
 2681|  1.16M|	memset(ret->nodeTab, 0 ,
 2682|  1.16M|	       XML_NODESET_DEFAULT * sizeof(xmlNodePtr));
  ------------------
  |  | 2593|  1.16M|#define XML_NODESET_DEFAULT	10
  ------------------
 2683|  1.16M|        ret->nodeMax = XML_NODESET_DEFAULT;
  ------------------
  |  | 2593|  1.16M|#define XML_NODESET_DEFAULT	10
  ------------------
 2684|  1.16M|	if (val->type == XML_NAMESPACE_DECL) {
  ------------------
  |  Branch (2684:6): [True: 31.7k, False: 1.13M]
  ------------------
 2685|  31.7k|	    xmlNsPtr ns = (xmlNsPtr) val;
 2686|  31.7k|            xmlNodePtr nsNode = xmlXPathNodeSetDupNs((xmlNodePtr) ns->next, ns);
 2687|       |
 2688|  31.7k|            if (nsNode == NULL) {
  ------------------
  |  Branch (2688:17): [True: 7, False: 31.7k]
  ------------------
 2689|      7|                xmlXPathFreeNodeSet(ret);
 2690|      7|                return(NULL);
 2691|      7|            }
 2692|  31.7k|	    ret->nodeTab[ret->nodeNr++] = nsNode;
 2693|  31.7k|	} else
 2694|  1.13M|	    ret->nodeTab[ret->nodeNr++] = val;
 2695|  1.16M|    }
 2696|  2.25M|    return(ret);
 2697|  2.25M|}
xmlXPathNodeSetAddNs:
 2761|  76.2k|xmlXPathNodeSetAddNs(xmlNodeSet *cur, xmlNode *node, xmlNs *ns) {
 2762|  76.2k|    int i;
 2763|  76.2k|    xmlNodePtr nsNode;
 2764|       |
 2765|  76.2k|    if ((cur == NULL) || (ns == NULL) || (node == NULL) ||
  ------------------
  |  Branch (2765:9): [True: 0, False: 76.2k]
  |  Branch (2765:26): [True: 0, False: 76.2k]
  |  Branch (2765:42): [True: 0, False: 76.2k]
  ------------------
 2766|  76.2k|        (ns->type != XML_NAMESPACE_DECL) ||
  ------------------
  |  Branch (2766:9): [True: 0, False: 76.2k]
  ------------------
 2767|  76.2k|	(node->type != XML_ELEMENT_NODE))
  ------------------
  |  Branch (2767:2): [True: 0, False: 76.2k]
  ------------------
 2768|      0|	return(-1);
 2769|       |
 2770|       |    /* @@ with_ns to check whether namespace nodes should be looked at @@ */
 2771|       |    /*
 2772|       |     * prevent duplicates
 2773|       |     */
 2774|   144k|    for (i = 0;i < cur->nodeNr;i++) {
  ------------------
  |  Branch (2774:16): [True: 68.2k, False: 76.2k]
  ------------------
 2775|  68.2k|        if ((cur->nodeTab[i] != NULL) &&
  ------------------
  |  Branch (2775:13): [True: 68.2k, False: 0]
  ------------------
 2776|  68.2k|	    (cur->nodeTab[i]->type == XML_NAMESPACE_DECL) &&
  ------------------
  |  Branch (2776:6): [True: 68.2k, False: 0]
  ------------------
 2777|  68.2k|	    (((xmlNsPtr)cur->nodeTab[i])->next == (xmlNsPtr) node) &&
  ------------------
  |  Branch (2777:6): [True: 68.2k, False: 0]
  ------------------
 2778|  68.2k|	    (xmlStrEqual(ns->prefix, ((xmlNsPtr)cur->nodeTab[i])->prefix)))
  ------------------
  |  Branch (2778:6): [True: 0, False: 68.2k]
  ------------------
 2779|      0|	    return(0);
 2780|  68.2k|    }
 2781|       |
 2782|       |    /*
 2783|       |     * grow the nodeTab if needed
 2784|       |     */
 2785|  76.2k|    if (cur->nodeNr >= cur->nodeMax) {
  ------------------
  |  Branch (2785:9): [True: 4.01k, False: 72.2k]
  ------------------
 2786|  4.01k|        if (xmlXPathNodeSetGrow(cur) < 0)
  ------------------
  |  Branch (2786:13): [True: 4, False: 4.01k]
  ------------------
 2787|      4|            return(-1);
 2788|  4.01k|    }
 2789|  76.2k|    nsNode = xmlXPathNodeSetDupNs(node, ns);
 2790|  76.2k|    if(nsNode == NULL)
  ------------------
  |  Branch (2790:8): [True: 19, False: 76.2k]
  ------------------
 2791|     19|        return(-1);
 2792|  76.2k|    cur->nodeTab[cur->nodeNr++] = nsNode;
 2793|  76.2k|    return(0);
 2794|  76.2k|}
xmlXPathNodeSetAdd:
 2804|  1.03k|xmlXPathNodeSetAdd(xmlNodeSet *cur, xmlNode *val) {
 2805|  1.03k|    int i;
 2806|       |
 2807|  1.03k|    if ((cur == NULL) || (val == NULL)) return(-1);
  ------------------
  |  Branch (2807:9): [True: 0, False: 1.03k]
  |  Branch (2807:26): [True: 0, False: 1.03k]
  ------------------
 2808|       |
 2809|       |    /* @@ with_ns to check whether namespace nodes should be looked at @@ */
 2810|       |    /*
 2811|       |     * prevent duplicates
 2812|       |     */
 2813|  1.03k|    for (i = 0;i < cur->nodeNr;i++)
  ------------------
  |  Branch (2813:16): [True: 448, False: 589]
  ------------------
 2814|    448|        if (cur->nodeTab[i] == val) return(0);
  ------------------
  |  Branch (2814:13): [True: 448, False: 0]
  ------------------
 2815|       |
 2816|       |    /*
 2817|       |     * grow the nodeTab if needed
 2818|       |     */
 2819|    589|    if (cur->nodeNr >= cur->nodeMax) {
  ------------------
  |  Branch (2819:9): [True: 589, False: 0]
  ------------------
 2820|    589|        if (xmlXPathNodeSetGrow(cur) < 0)
  ------------------
  |  Branch (2820:13): [True: 2, False: 587]
  ------------------
 2821|      2|            return(-1);
 2822|    589|    }
 2823|       |
 2824|    587|    if (val->type == XML_NAMESPACE_DECL) {
  ------------------
  |  Branch (2824:9): [True: 0, False: 587]
  ------------------
 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|    587|	cur->nodeTab[cur->nodeNr++] = val;
 2833|    587|    return(0);
 2834|    587|}
xmlXPathNodeSetAddUnique:
 2845|  5.21M|xmlXPathNodeSetAddUnique(xmlNodeSet *cur, xmlNode *val) {
 2846|  5.21M|    if ((cur == NULL) || (val == NULL)) return(-1);
  ------------------
  |  Branch (2846:9): [True: 0, False: 5.21M]
  |  Branch (2846:26): [True: 0, False: 5.21M]
  ------------------
 2847|       |
 2848|       |    /* @@ with_ns to check whether namespace nodes should be looked at @@ */
 2849|       |    /*
 2850|       |     * grow the nodeTab if needed
 2851|       |     */
 2852|  5.21M|    if (cur->nodeNr >= cur->nodeMax) {
  ------------------
  |  Branch (2852:9): [True: 1.25M, False: 3.96M]
  ------------------
 2853|  1.25M|        if (xmlXPathNodeSetGrow(cur) < 0)
  ------------------
  |  Branch (2853:13): [True: 151, False: 1.25M]
  ------------------
 2854|    151|            return(-1);
 2855|  1.25M|    }
 2856|       |
 2857|  5.21M|    if (val->type == XML_NAMESPACE_DECL) {
  ------------------
  |  Branch (2857:9): [True: 37.0k, False: 5.17M]
  ------------------
 2858|  37.0k|	xmlNsPtr ns = (xmlNsPtr) val;
 2859|  37.0k|        xmlNodePtr nsNode = xmlXPathNodeSetDupNs((xmlNodePtr) ns->next, ns);
 2860|       |
 2861|  37.0k|        if (nsNode == NULL)
  ------------------
  |  Branch (2861:13): [True: 6, False: 37.0k]
  ------------------
 2862|      6|            return(-1);
 2863|  37.0k|	cur->nodeTab[cur->nodeNr++] = nsNode;
 2864|  37.0k|    } else
 2865|  5.17M|	cur->nodeTab[cur->nodeNr++] = val;
 2866|  5.21M|    return(0);
 2867|  5.21M|}
xmlXPathNodeSetMerge:
 2880|  59.8k|xmlXPathNodeSetMerge(xmlNodeSet *val1, xmlNodeSet *val2) {
 2881|  59.8k|    int i, j, initNr, skip;
 2882|  59.8k|    xmlNodePtr n1, n2;
 2883|       |
 2884|  59.8k|    if (val1 == NULL) {
  ------------------
  |  Branch (2884:9): [True: 2, False: 59.8k]
  ------------------
 2885|      2|	val1 = xmlXPathNodeSetCreate(NULL);
 2886|      2|        if (val1 == NULL)
  ------------------
  |  Branch (2886:13): [True: 0, False: 2]
  ------------------
 2887|      0|            return (NULL);
 2888|      2|    }
 2889|  59.8k|    if (val2 == NULL)
  ------------------
  |  Branch (2889:9): [True: 27, False: 59.8k]
  ------------------
 2890|     27|        return(val1);
 2891|       |
 2892|       |    /* @@ with_ns to check whether namespace nodes should be looked at @@ */
 2893|  59.8k|    initNr = val1->nodeNr;
 2894|       |
 2895|   680k|    for (i = 0;i < val2->nodeNr;i++) {
  ------------------
  |  Branch (2895:16): [True: 620k, False: 59.7k]
  ------------------
 2896|   620k|	n2 = val2->nodeTab[i];
 2897|       |	/*
 2898|       |	 * check against duplicates
 2899|       |	 */
 2900|   620k|	skip = 0;
 2901|  12.9M|	for (j = 0; j < initNr; j++) {
  ------------------
  |  Branch (2901:14): [True: 12.4M, False: 536k]
  ------------------
 2902|  12.4M|	    n1 = val1->nodeTab[j];
 2903|  12.4M|	    if (n1 == n2) {
  ------------------
  |  Branch (2903:10): [True: 83.8k, False: 12.3M]
  ------------------
 2904|  83.8k|		skip = 1;
 2905|  83.8k|		break;
 2906|  12.3M|	    } else if ((n1->type == XML_NAMESPACE_DECL) &&
  ------------------
  |  Branch (2906:17): [True: 1.33k, False: 12.3M]
  ------------------
 2907|  1.33k|		       (n2->type == XML_NAMESPACE_DECL)) {
  ------------------
  |  Branch (2907:10): [True: 0, False: 1.33k]
  ------------------
 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|  12.4M|	}
 2917|   620k|	if (skip)
  ------------------
  |  Branch (2917:6): [True: 83.8k, False: 536k]
  ------------------
 2918|  83.8k|	    continue;
 2919|       |
 2920|       |	/*
 2921|       |	 * grow the nodeTab if needed
 2922|       |	 */
 2923|   536k|        if (val1->nodeNr >= val1->nodeMax) {
  ------------------
  |  Branch (2923:13): [True: 63.3k, False: 473k]
  ------------------
 2924|  63.3k|            if (xmlXPathNodeSetGrow(val1) < 0)
  ------------------
  |  Branch (2924:17): [True: 22, False: 63.3k]
  ------------------
 2925|     22|                goto error;
 2926|  63.3k|        }
 2927|   536k|	if (n2->type == XML_NAMESPACE_DECL) {
  ------------------
  |  Branch (2927:6): [True: 932, False: 535k]
  ------------------
 2928|    932|	    xmlNsPtr ns = (xmlNsPtr) n2;
 2929|    932|            xmlNodePtr nsNode = xmlXPathNodeSetDupNs((xmlNodePtr) ns->next, ns);
 2930|       |
 2931|    932|            if (nsNode == NULL)
  ------------------
  |  Branch (2931:17): [True: 17, False: 915]
  ------------------
 2932|     17|                goto error;
 2933|    915|	    val1->nodeTab[val1->nodeNr++] = nsNode;
 2934|    915|	} else
 2935|   535k|	    val1->nodeTab[val1->nodeNr++] = n2;
 2936|   536k|    }
 2937|       |
 2938|  59.7k|    return(val1);
 2939|       |
 2940|     39|error:
 2941|     39|    xmlXPathFreeNodeSet(val1);
 2942|       |    return(NULL);
 2943|  59.8k|}
xmlXPathFreeNodeSet:
 3101|  2.25M|xmlXPathFreeNodeSet(xmlNodeSet *obj) {
 3102|  2.25M|    if (obj == NULL) return;
  ------------------
  |  Branch (3102:9): [True: 27, False: 2.25M]
  ------------------
 3103|  2.25M|    if (obj->nodeTab != NULL) {
  ------------------
  |  Branch (3103:9): [True: 1.53M, False: 711k]
  ------------------
 3104|  1.53M|	int i;
 3105|       |
 3106|       |	/* @@ with_ns to check whether namespace nodes should be looked at @@ */
 3107|  7.92M|	for (i = 0;i < obj->nodeNr;i++)
  ------------------
  |  Branch (3107:13): [True: 6.38M, False: 1.53M]
  ------------------
 3108|  6.38M|	    if ((obj->nodeTab[i] != NULL) &&
  ------------------
  |  Branch (3108:10): [True: 6.38M, False: 0]
  ------------------
 3109|  6.38M|		(obj->nodeTab[i]->type == XML_NAMESPACE_DECL))
  ------------------
  |  Branch (3109:3): [True: 116k, False: 6.26M]
  ------------------
 3110|   116k|		xmlXPathNodeSetFreeNs((xmlNsPtr) obj->nodeTab[i]);
 3111|  1.53M|	xmlFree(obj->nodeTab);
 3112|  1.53M|    }
 3113|  2.25M|    xmlFree(obj);
 3114|  2.25M|}
xmlXPathNewNodeSet:
 3191|  1.16M|xmlXPathNewNodeSet(xmlNode *val) {
 3192|  1.16M|    xmlXPathObjectPtr ret;
 3193|       |
 3194|  1.16M|    ret = (xmlXPathObjectPtr) xmlMalloc(sizeof(xmlXPathObject));
 3195|  1.16M|    if (ret == NULL)
  ------------------
  |  Branch (3195:9): [True: 157, False: 1.16M]
  ------------------
 3196|    157|	return(NULL);
 3197|  1.16M|    memset(ret, 0 , sizeof(xmlXPathObject));
 3198|  1.16M|    ret->type = XPATH_NODESET;
 3199|  1.16M|    ret->boolval = 0;
 3200|  1.16M|    ret->nodesetval = xmlXPathNodeSetCreate(val);
 3201|  1.16M|    if (ret->nodesetval == NULL) {
  ------------------
  |  Branch (3201:9): [True: 273, False: 1.16M]
  ------------------
 3202|    273|        xmlFree(ret);
 3203|    273|        return(NULL);
 3204|    273|    }
 3205|       |    /* @@ with_ns to check whether namespace nodes should be looked at @@ */
 3206|  1.16M|    return(ret);
 3207|  1.16M|}
xmlXPathWrapNodeSet:
 3267|  1.05M|xmlXPathWrapNodeSet(xmlNodeSet *val) {
 3268|  1.05M|    xmlXPathObjectPtr ret;
 3269|       |
 3270|  1.05M|    ret = (xmlXPathObjectPtr) xmlMalloc(sizeof(xmlXPathObject));
 3271|  1.05M|    if (ret == NULL) {
  ------------------
  |  Branch (3271:9): [True: 184, False: 1.05M]
  ------------------
 3272|    184|        xmlXPathFreeNodeSet(val);
 3273|    184|	return(NULL);
 3274|    184|    }
 3275|  1.05M|    memset(ret, 0 , sizeof(xmlXPathObject));
 3276|  1.05M|    ret->type = XPATH_NODESET;
 3277|  1.05M|    ret->nodesetval = val;
 3278|  1.05M|    return(ret);
 3279|  1.05M|}
xmlXPathFunctionLookup:
 3743|  7.67k|xmlXPathFunctionLookup(xmlXPathContext *ctxt, const xmlChar *name) {
 3744|       |    return(xmlXPathFunctionLookupNS(ctxt, name, NULL));
 3745|  7.67k|}
xmlXPathFunctionLookupNS:
 3758|  7.69k|			 const xmlChar *ns_uri) {
 3759|  7.69k|    xmlXPathFunction ret;
 3760|  7.69k|    void *payload;
 3761|       |
 3762|  7.69k|    if (ctxt == NULL)
  ------------------
  |  Branch (3762:9): [True: 0, False: 7.69k]
  ------------------
 3763|      0|	return(NULL);
 3764|  7.69k|    if (name == NULL)
  ------------------
  |  Branch (3764:9): [True: 0, False: 7.69k]
  ------------------
 3765|      0|	return(NULL);
 3766|       |
 3767|  7.69k|    if (ns_uri == NULL) {
  ------------------
  |  Branch (3767:9): [True: 7.67k, False: 15]
  ------------------
 3768|  7.67k|        int bucketIndex = xmlXPathSFComputeHash(name) % SF_HASH_SIZE;
  ------------------
  |  |  168|  7.67k|#define SF_HASH_SIZE 64
  ------------------
 3769|       |
 3770|  10.4k|        while (xmlXPathSFHash[bucketIndex] != UCHAR_MAX) {
  ------------------
  |  Branch (3770:16): [True: 10.0k, False: 454]
  ------------------
 3771|  10.0k|            int funcIndex = xmlXPathSFHash[bucketIndex];
 3772|       |
 3773|  10.0k|            if (strcmp(xmlXPathStandardFunctions[funcIndex].name,
  ------------------
  |  Branch (3773:17): [True: 7.22k, False: 2.79k]
  ------------------
 3774|  10.0k|                       (char *) name) == 0)
 3775|  7.22k|                return(xmlXPathStandardFunctions[funcIndex].func);
 3776|       |
 3777|  2.79k|            bucketIndex += 1;
 3778|  2.79k|            if (bucketIndex >= SF_HASH_SIZE)
  ------------------
  |  |  168|  2.79k|#define SF_HASH_SIZE 64
  ------------------
  |  Branch (3778:17): [True: 0, False: 2.79k]
  ------------------
 3779|      0|                bucketIndex = 0;
 3780|  2.79k|        }
 3781|  7.67k|    }
 3782|       |
 3783|    469|    if (ctxt->funcLookupFunc != NULL) {
  ------------------
  |  Branch (3783:9): [True: 0, False: 469]
  ------------------
 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|    469|    if (ctxt->funcHash == NULL)
  ------------------
  |  Branch (3792:9): [True: 469, False: 0]
  ------------------
 3793|    469|	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|    469|}
xmlXPathRegisteredFuncsCleanup:
 3807|  6.27k|xmlXPathRegisteredFuncsCleanup(xmlXPathContext *ctxt) {
 3808|  6.27k|    if (ctxt == NULL)
  ------------------
  |  Branch (3808:9): [True: 0, False: 6.27k]
  ------------------
 3809|      0|	return;
 3810|       |
 3811|  6.27k|    xmlHashFree(ctxt->funcHash, NULL);
 3812|       |    ctxt->funcHash = NULL;
 3813|  6.27k|}
xmlXPathVariableLookup:
 3891|     34|xmlXPathVariableLookup(xmlXPathContext *ctxt, const xmlChar *name) {
 3892|     34|    if (ctxt == NULL)
  ------------------
  |  Branch (3892:9): [True: 0, False: 34]
  ------------------
 3893|      0|	return(NULL);
 3894|       |
 3895|     34|    if (ctxt->varLookupFunc != NULL) {
  ------------------
  |  Branch (3895:9): [True: 0, False: 34]
  ------------------
 3896|      0|	xmlXPathObjectPtr ret;
 3897|       |
 3898|      0|	ret = ((xmlXPathVariableLookupFunc)ctxt->varLookupFunc)
 3899|      0|	        (ctxt->varLookupData, name, NULL);
 3900|      0|	return(ret);
 3901|      0|    }
 3902|     34|    return(xmlXPathVariableLookupNS(ctxt, name, NULL));
 3903|     34|}
xmlXPathVariableLookupNS:
 3916|     45|			 const xmlChar *ns_uri) {
 3917|     45|    if (ctxt == NULL)
  ------------------
  |  Branch (3917:9): [True: 0, False: 45]
  ------------------
 3918|      0|	return(NULL);
 3919|       |
 3920|     45|    if (ctxt->varLookupFunc != NULL) {
  ------------------
  |  Branch (3920:9): [True: 0, False: 45]
  ------------------
 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|     45|    if (ctxt->varHash == NULL)
  ------------------
  |  Branch (3928:9): [True: 45, False: 0]
  ------------------
 3929|     45|	return(NULL);
 3930|      0|    if (name == NULL)
  ------------------
  |  Branch (3930:9): [True: 0, False: 0]
  ------------------
 3931|      0|	return(NULL);
 3932|       |
 3933|      0|    return(xmlXPathObjectCopy(xmlHashLookup2(ctxt->varHash, name, ns_uri)));
 3934|      0|}
xmlXPathRegisteredVariablesCleanup:
 3942|  6.27k|xmlXPathRegisteredVariablesCleanup(xmlXPathContext *ctxt) {
 3943|  6.27k|    if (ctxt == NULL)
  ------------------
  |  Branch (3943:9): [True: 0, False: 6.27k]
  ------------------
 3944|      0|	return;
 3945|       |
 3946|  6.27k|    xmlHashFree(ctxt->varHash, xmlXPathFreeObjectEntry);
 3947|       |    ctxt->varHash = NULL;
 3948|  6.27k|}
xmlXPathRegisterNs:
 3961|    483|			   const xmlChar *ns_uri) {
 3962|    483|    xmlChar *copy;
 3963|       |
 3964|    483|    if (ctxt == NULL)
  ------------------
  |  Branch (3964:9): [True: 0, False: 483]
  ------------------
 3965|      0|	return(-1);
 3966|    483|    if (prefix == NULL)
  ------------------
  |  Branch (3966:9): [True: 0, False: 483]
  ------------------
 3967|      0|	return(-1);
 3968|    483|    if (prefix[0] == 0)
  ------------------
  |  Branch (3968:9): [True: 0, False: 483]
  ------------------
 3969|      0|	return(-1);
 3970|       |
 3971|    483|    if (ctxt->nsHash == NULL)
  ------------------
  |  Branch (3971:9): [True: 38, False: 445]
  ------------------
 3972|     38|	ctxt->nsHash = xmlHashCreate(10);
 3973|    483|    if (ctxt->nsHash == NULL) {
  ------------------
  |  Branch (3973:9): [True: 2, False: 481]
  ------------------
 3974|      2|        xmlXPathErrMemory(ctxt);
 3975|      2|	return(-1);
 3976|      2|    }
 3977|    481|    if (ns_uri == NULL)
  ------------------
  |  Branch (3977:9): [True: 0, False: 481]
  ------------------
 3978|      0|        return(xmlHashRemoveEntry(ctxt->nsHash, prefix,
 3979|      0|	                          xmlHashDefaultDeallocator));
 3980|       |
 3981|    481|    copy = xmlStrdup(ns_uri);
 3982|    481|    if (copy == NULL) {
  ------------------
  |  Branch (3982:9): [True: 1, False: 480]
  ------------------
 3983|      1|        xmlXPathErrMemory(ctxt);
 3984|      1|        return(-1);
 3985|      1|    }
 3986|    480|    if (xmlHashUpdateEntry(ctxt->nsHash, prefix, copy,
  ------------------
  |  Branch (3986:9): [True: 2, False: 478]
  ------------------
 3987|    480|                           xmlHashDefaultDeallocator) < 0) {
 3988|      2|        xmlXPathErrMemory(ctxt);
 3989|      2|        xmlFree(copy);
 3990|      2|        return(-1);
 3991|      2|    }
 3992|       |
 3993|    478|    return(0);
 3994|    480|}
xmlXPathNsLookup:
 4005|  7.06k|xmlXPathNsLookup(xmlXPathContext *ctxt, const xmlChar *prefix) {
 4006|  7.06k|    if (ctxt == NULL)
  ------------------
  |  Branch (4006:9): [True: 0, False: 7.06k]
  ------------------
 4007|      0|	return(NULL);
 4008|  7.06k|    if (prefix == NULL)
  ------------------
  |  Branch (4008:9): [True: 0, False: 7.06k]
  ------------------
 4009|      0|	return(NULL);
 4010|       |
 4011|  7.06k|    if (xmlStrEqual(prefix, (const xmlChar *) "xml"))
  ------------------
  |  Branch (4011:9): [True: 6.81k, False: 254]
  ------------------
 4012|  6.81k|	return(XML_XML_NAMESPACE);
  ------------------
  |  |  146|  6.81k|    (const xmlChar *) "http://www.w3.org/XML/1998/namespace"
  ------------------
 4013|       |
 4014|    254|    if (ctxt->namespaces != NULL) {
  ------------------
  |  Branch (4014:9): [True: 0, False: 254]
  ------------------
 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|    254|    return((const xmlChar *) xmlHashLookup(ctxt->nsHash, prefix));
 4025|    254|}
xmlXPathRegisteredNsCleanup:
 4033|  6.27k|xmlXPathRegisteredNsCleanup(xmlXPathContext *ctxt) {
 4034|  6.27k|    if (ctxt == NULL)
  ------------------
  |  Branch (4034:9): [True: 0, False: 6.27k]
  ------------------
 4035|      0|	return;
 4036|       |
 4037|  6.27k|    xmlHashFree(ctxt->nsHash, xmlHashDefaultDeallocator);
 4038|       |    ctxt->nsHash = NULL;
 4039|  6.27k|}
xmlXPathNewFloat:
 4056|   360k|xmlXPathNewFloat(double val) {
 4057|   360k|    xmlXPathObjectPtr ret;
 4058|       |
 4059|   360k|    ret = (xmlXPathObjectPtr) xmlMalloc(sizeof(xmlXPathObject));
 4060|   360k|    if (ret == NULL)
  ------------------
  |  Branch (4060:9): [True: 125, False: 360k]
  ------------------
 4061|    125|	return(NULL);
 4062|   360k|    memset(ret, 0 , sizeof(xmlXPathObject));
 4063|   360k|    ret->type = XPATH_NUMBER;
 4064|   360k|    ret->floatval = val;
 4065|   360k|    return(ret);
 4066|   360k|}
xmlXPathNewBoolean:
 4075|   561k|xmlXPathNewBoolean(int val) {
 4076|   561k|    xmlXPathObjectPtr ret;
 4077|       |
 4078|   561k|    ret = (xmlXPathObjectPtr) xmlMalloc(sizeof(xmlXPathObject));
 4079|   561k|    if (ret == NULL)
  ------------------
  |  Branch (4079:9): [True: 72, False: 561k]
  ------------------
 4080|     72|	return(NULL);
 4081|   561k|    memset(ret, 0 , sizeof(xmlXPathObject));
 4082|   561k|    ret->type = XPATH_BOOLEAN;
 4083|   561k|    ret->boolval = (val != 0);
 4084|   561k|    return(ret);
 4085|   561k|}
xmlXPathNewString:
 4094|   112k|xmlXPathNewString(const xmlChar *val) {
 4095|   112k|    xmlXPathObjectPtr ret;
 4096|       |
 4097|   112k|    ret = (xmlXPathObjectPtr) xmlMalloc(sizeof(xmlXPathObject));
 4098|   112k|    if (ret == NULL)
  ------------------
  |  Branch (4098:9): [True: 21, False: 112k]
  ------------------
 4099|     21|	return(NULL);
 4100|   112k|    memset(ret, 0 , sizeof(xmlXPathObject));
 4101|   112k|    ret->type = XPATH_STRING;
 4102|   112k|    if (val == NULL)
  ------------------
  |  Branch (4102:9): [True: 5, False: 112k]
  ------------------
 4103|      5|        val = BAD_CAST "";
  ------------------
  |  |   34|      5|#define BAD_CAST (xmlChar *)
  ------------------
 4104|   112k|    ret->stringval = xmlStrdup(val);
 4105|   112k|    if (ret->stringval == NULL) {
  ------------------
  |  Branch (4105:9): [True: 25, False: 112k]
  ------------------
 4106|     25|        xmlFree(ret);
 4107|     25|        return(NULL);
 4108|     25|    }
 4109|   112k|    return(ret);
 4110|   112k|}
xmlXPathWrapString:
 4121|  40.8k|xmlXPathWrapString (xmlChar *val) {
 4122|  40.8k|    xmlXPathObjectPtr ret;
 4123|       |
 4124|  40.8k|    ret = (xmlXPathObjectPtr) xmlMalloc(sizeof(xmlXPathObject));
 4125|  40.8k|    if (ret == NULL) {
  ------------------
  |  Branch (4125:9): [True: 35, False: 40.8k]
  ------------------
 4126|     35|        xmlFree(val);
 4127|     35|	return(NULL);
 4128|     35|    }
 4129|  40.8k|    memset(ret, 0 , sizeof(xmlXPathObject));
 4130|  40.8k|    ret->type = XPATH_STRING;
 4131|  40.8k|    ret->stringval = val;
 4132|  40.8k|    return(ret);
 4133|  40.8k|}
xmlXPathObjectCopy:
 4183|   285k|xmlXPathObjectCopy(xmlXPathObject *val) {
 4184|   285k|    xmlXPathObjectPtr ret;
 4185|       |
 4186|   285k|    if (val == NULL)
  ------------------
  |  Branch (4186:9): [True: 0, False: 285k]
  ------------------
 4187|      0|	return(NULL);
 4188|       |
 4189|   285k|    ret = (xmlXPathObjectPtr) xmlMalloc(sizeof(xmlXPathObject));
 4190|   285k|    if (ret == NULL)
  ------------------
  |  Branch (4190:9): [True: 68, False: 285k]
  ------------------
 4191|     68|	return(NULL);
 4192|   285k|    memcpy(ret, val , sizeof(xmlXPathObject));
 4193|   285k|    switch (val->type) {
 4194|      0|	case XPATH_BOOLEAN:
  ------------------
  |  Branch (4194:2): [True: 0, False: 285k]
  ------------------
 4195|   265k|	case XPATH_NUMBER:
  ------------------
  |  Branch (4195:2): [True: 265k, False: 20.2k]
  ------------------
 4196|   265k|	    break;
 4197|  20.2k|	case XPATH_STRING:
  ------------------
  |  Branch (4197:2): [True: 20.2k, False: 265k]
  ------------------
 4198|  20.2k|	    ret->stringval = xmlStrdup(val->stringval);
 4199|  20.2k|            if (ret->stringval == NULL) {
  ------------------
  |  Branch (4199:17): [True: 6, False: 20.2k]
  ------------------
 4200|      6|                xmlFree(ret);
 4201|      6|                return(NULL);
 4202|      6|            }
 4203|  20.2k|	    break;
 4204|  20.2k|	case XPATH_XSLT_TREE:
  ------------------
  |  Branch (4204:2): [True: 0, False: 285k]
  ------------------
 4205|      0|	case XPATH_NODESET:
  ------------------
  |  Branch (4205:2): [True: 0, False: 285k]
  ------------------
 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: 285k]
  ------------------
 4215|      0|	    ret->user = val->user;
 4216|      0|	    break;
 4217|      0|        default:
  ------------------
  |  Branch (4217:9): [True: 0, False: 285k]
  ------------------
 4218|      0|            xmlFree(ret);
 4219|      0|            ret = NULL;
 4220|      0|	    break;
 4221|   285k|    }
 4222|   285k|    return(ret);
 4223|   285k|}
xmlXPathFreeObject:
 4231|  3.58M|xmlXPathFreeObject(xmlXPathObject *obj) {
 4232|  3.58M|    if (obj == NULL) return;
  ------------------
  |  Branch (4232:9): [True: 0, False: 3.58M]
  ------------------
 4233|  3.58M|    if ((obj->type == XPATH_NODESET) || (obj->type == XPATH_XSLT_TREE)) {
  ------------------
  |  Branch (4233:9): [True: 2.22M, False: 1.36M]
  |  Branch (4233:41): [True: 0, False: 1.36M]
  ------------------
 4234|  2.22M|        if (obj->nodesetval != NULL)
  ------------------
  |  Branch (4234:13): [True: 2.22M, False: 62]
  ------------------
 4235|  2.22M|            xmlXPathFreeNodeSet(obj->nodesetval);
 4236|  2.22M|    } else if (obj->type == XPATH_STRING) {
  ------------------
  |  Branch (4236:16): [True: 174k, False: 1.18M]
  ------------------
 4237|   174k|	if (obj->stringval != NULL)
  ------------------
  |  Branch (4237:6): [True: 174k, False: 19]
  ------------------
 4238|   174k|	    xmlFree(obj->stringval);
 4239|   174k|    }
 4240|  3.58M|    xmlFree(obj);
 4241|  3.58M|}
xmlXPathCastBooleanToString:
 4354|  4.07k|xmlXPathCastBooleanToString (int val) {
 4355|  4.07k|    xmlChar *ret;
 4356|  4.07k|    if (val)
  ------------------
  |  Branch (4356:9): [True: 690, False: 3.38k]
  ------------------
 4357|    690|	ret = xmlStrdup((const xmlChar *) "true");
 4358|  3.38k|    else
 4359|  3.38k|	ret = xmlStrdup((const xmlChar *) "false");
 4360|  4.07k|    return(ret);
 4361|  4.07k|}
xmlXPathCastNumberToString:
 4370|  14.4k|xmlXPathCastNumberToString (double val) {
 4371|  14.4k|    xmlChar *ret;
 4372|  14.4k|    switch (xmlXPathIsInf(val)) {
 4373|    221|    case 1:
  ------------------
  |  Branch (4373:5): [True: 221, False: 14.2k]
  ------------------
 4374|    221|	ret = xmlStrdup((const xmlChar *) "Infinity");
 4375|    221|	break;
 4376|    556|    case -1:
  ------------------
  |  Branch (4376:5): [True: 556, False: 13.8k]
  ------------------
 4377|    556|	ret = xmlStrdup((const xmlChar *) "-Infinity");
 4378|    556|	break;
 4379|  13.6k|    default:
  ------------------
  |  Branch (4379:5): [True: 13.6k, False: 777]
  ------------------
 4380|  13.6k|	if (xmlXPathIsNaN(val)) {
  ------------------
  |  Branch (4380:6): [True: 1.47k, False: 12.1k]
  ------------------
 4381|  1.47k|	    ret = xmlStrdup((const xmlChar *) "NaN");
 4382|  12.1k|	} else if (val == 0) {
  ------------------
  |  Branch (4382:13): [True: 1.10k, False: 11.0k]
  ------------------
 4383|       |            /* Omit sign for negative zero. */
 4384|  1.10k|	    ret = xmlStrdup((const xmlChar *) "0");
 4385|  11.0k|	} else {
 4386|       |	    /* could be improved */
 4387|  11.0k|	    char buf[100];
 4388|  11.0k|	    xmlXPathFormatNumber(val, buf, 99);
 4389|  11.0k|	    buf[99] = 0;
 4390|  11.0k|	    ret = xmlStrdup((const xmlChar *) buf);
 4391|  11.0k|	}
 4392|  14.4k|    }
 4393|  14.4k|    return(ret);
 4394|  14.4k|}
xmlXPathCastNodeToString:
 4403|   333k|xmlXPathCastNodeToString (xmlNode *node) {
 4404|   333k|    return(xmlNodeGetContent(node));
 4405|   333k|}
xmlXPathCastNodeSetToString:
 4414|   390k|xmlXPathCastNodeSetToString (xmlNodeSet *ns) {
 4415|   390k|    if ((ns == NULL) || (ns->nodeNr == 0) || (ns->nodeTab == NULL))
  ------------------
  |  Branch (4415:9): [True: 0, False: 390k]
  |  Branch (4415:25): [True: 272k, False: 117k]
  |  Branch (4415:46): [True: 0, False: 117k]
  ------------------
 4416|   272k|	return(xmlStrdup((const xmlChar *) ""));
 4417|       |
 4418|   117k|    if (ns->nodeNr > 1)
  ------------------
  |  Branch (4418:9): [True: 30.9k, False: 87.0k]
  ------------------
 4419|  30.9k|	xmlXPathNodeSetSort(ns);
 4420|   117k|    return(xmlXPathCastNodeToString(ns->nodeTab[0]));
 4421|   390k|}
xmlXPathCastToString:
 4431|  39.7k|xmlXPathCastToString(xmlXPathObject *val) {
 4432|  39.7k|    xmlChar *ret = NULL;
 4433|       |
 4434|  39.7k|    if (val == NULL)
  ------------------
  |  Branch (4434:9): [True: 0, False: 39.7k]
  ------------------
 4435|      0|	return(xmlStrdup((const xmlChar *) ""));
 4436|  39.7k|    switch (val->type) {
  ------------------
  |  Branch (4436:13): [True: 39.7k, False: 0]
  ------------------
 4437|      0|	case XPATH_UNDEFINED:
  ------------------
  |  Branch (4437:2): [True: 0, False: 39.7k]
  ------------------
 4438|      0|	    ret = xmlStrdup((const xmlChar *) "");
 4439|      0|	    break;
 4440|  20.8k|        case XPATH_NODESET:
  ------------------
  |  Branch (4440:9): [True: 20.8k, False: 18.9k]
  ------------------
 4441|  20.8k|        case XPATH_XSLT_TREE:
  ------------------
  |  Branch (4441:9): [True: 0, False: 39.7k]
  ------------------
 4442|  20.8k|	    ret = xmlXPathCastNodeSetToString(val->nodesetval);
 4443|  20.8k|	    break;
 4444|    466|	case XPATH_STRING:
  ------------------
  |  Branch (4444:2): [True: 466, False: 39.3k]
  ------------------
 4445|    466|	    return(xmlStrdup(val->stringval));
 4446|  4.07k|        case XPATH_BOOLEAN:
  ------------------
  |  Branch (4446:9): [True: 4.07k, False: 35.7k]
  ------------------
 4447|  4.07k|	    ret = xmlXPathCastBooleanToString(val->boolval);
 4448|  4.07k|	    break;
 4449|  14.4k|	case XPATH_NUMBER: {
  ------------------
  |  Branch (4449:2): [True: 14.4k, False: 25.3k]
  ------------------
 4450|  14.4k|	    ret = xmlXPathCastNumberToString(val->floatval);
 4451|  14.4k|	    break;
 4452|  20.8k|	}
 4453|      0|	case XPATH_USERS:
  ------------------
  |  Branch (4453:2): [True: 0, False: 39.7k]
  ------------------
 4454|       |	    /* TODO */
 4455|      0|	    ret = xmlStrdup((const xmlChar *) "");
 4456|      0|	    break;
 4457|  39.7k|    }
 4458|  39.3k|    return(ret);
 4459|  39.7k|}
xmlXPathCastBooleanToNumber:
 4507|  25.8k|xmlXPathCastBooleanToNumber(int val) {
 4508|  25.8k|    if (val)
  ------------------
  |  Branch (4508:9): [True: 2.80k, False: 23.0k]
  ------------------
 4509|  2.80k|	return(1.0);
 4510|  23.0k|    return(0.0);
 4511|  25.8k|}
xmlXPathCastStringToNumber:
 4520|   595k|xmlXPathCastStringToNumber(const xmlChar * val) {
 4521|   595k|    return(xmlXPathStringEvalNumber(val));
 4522|   595k|}
xmlXPathCastNumberToBoolean:
 4617|  50.9k|xmlXPathCastNumberToBoolean (double val) {
 4618|  50.9k|     if (xmlXPathIsNaN(val) || (val == 0.0))
  ------------------
  |  Branch (4618:10): [True: 37.6k, False: 13.2k]
  |  Branch (4618:32): [True: 1.93k, False: 11.3k]
  ------------------
 4619|  39.6k|	 return(0);
 4620|  11.3k|     return(1);
 4621|  50.9k|}
xmlXPathCastStringToBoolean:
 4630|     53|xmlXPathCastStringToBoolean (const xmlChar *val) {
 4631|     53|    if ((val == NULL) || (xmlStrlen(val) == 0))
  ------------------
  |  Branch (4631:9): [True: 0, False: 53]
  |  Branch (4631:26): [True: 18, False: 35]
  ------------------
 4632|     18|	return(0);
 4633|     35|    return(1);
 4634|     53|}
xmlXPathCastNodeSetToBoolean:
 4643|  8.06k|xmlXPathCastNodeSetToBoolean (xmlNodeSet *ns) {
 4644|  8.06k|    if ((ns == NULL) || (ns->nodeNr == 0))
  ------------------
  |  Branch (4644:9): [True: 0, False: 8.06k]
  |  Branch (4644:25): [True: 6.77k, False: 1.28k]
  ------------------
 4645|  6.77k|	return(0);
 4646|  1.28k|    return(1);
 4647|  8.06k|}
xmlXPathCastToBoolean:
 4656|  11.3k|xmlXPathCastToBoolean (xmlXPathObject *val) {
 4657|  11.3k|    int ret = 0;
 4658|       |
 4659|  11.3k|    if (val == NULL)
  ------------------
  |  Branch (4659:9): [True: 0, False: 11.3k]
  ------------------
 4660|      0|	return(0);
 4661|  11.3k|    switch (val->type) {
  ------------------
  |  Branch (4661:13): [True: 11.3k, False: 0]
  ------------------
 4662|      0|    case XPATH_UNDEFINED:
  ------------------
  |  Branch (4662:5): [True: 0, False: 11.3k]
  ------------------
 4663|      0|	ret = 0;
 4664|      0|	break;
 4665|  8.06k|    case XPATH_NODESET:
  ------------------
  |  Branch (4665:5): [True: 8.06k, False: 3.33k]
  ------------------
 4666|  8.06k|    case XPATH_XSLT_TREE:
  ------------------
  |  Branch (4666:5): [True: 0, False: 11.3k]
  ------------------
 4667|  8.06k|	ret = xmlXPathCastNodeSetToBoolean(val->nodesetval);
 4668|  8.06k|	break;
 4669|     53|    case XPATH_STRING:
  ------------------
  |  Branch (4669:5): [True: 53, False: 11.3k]
  ------------------
 4670|     53|	ret = xmlXPathCastStringToBoolean(val->stringval);
 4671|     53|	break;
 4672|  3.27k|    case XPATH_NUMBER:
  ------------------
  |  Branch (4672:5): [True: 3.27k, False: 8.11k]
  ------------------
 4673|  3.27k|	ret = xmlXPathCastNumberToBoolean(val->floatval);
 4674|  3.27k|	break;
 4675|      0|    case XPATH_BOOLEAN:
  ------------------
  |  Branch (4675:5): [True: 0, False: 11.3k]
  ------------------
 4676|      0|	ret = val->boolval;
 4677|      0|	break;
 4678|      0|    case XPATH_USERS:
  ------------------
  |  Branch (4678:5): [True: 0, False: 11.3k]
  ------------------
 4679|       |	/* TODO */
 4680|      0|	ret = 0;
 4681|      0|	break;
 4682|  11.3k|    }
 4683|  11.3k|    return(ret);
 4684|  11.3k|}
xmlXPathNewContext:
 4720|  6.28k|xmlXPathNewContext(xmlDoc *doc) {
 4721|  6.28k|    xmlXPathContextPtr ret;
 4722|       |
 4723|  6.28k|    ret = (xmlXPathContextPtr) xmlMalloc(sizeof(xmlXPathContext));
 4724|  6.28k|    if (ret == NULL)
  ------------------
  |  Branch (4724:9): [True: 14, False: 6.27k]
  ------------------
 4725|     14|	return(NULL);
 4726|  6.27k|    memset(ret, 0 , sizeof(xmlXPathContext));
 4727|  6.27k|    ret->doc = doc;
 4728|  6.27k|    ret->node = NULL;
 4729|       |
 4730|  6.27k|    ret->varHash = NULL;
 4731|       |
 4732|  6.27k|    ret->nb_types = 0;
 4733|  6.27k|    ret->max_types = 0;
 4734|  6.27k|    ret->types = NULL;
 4735|       |
 4736|  6.27k|    ret->nb_axis = 0;
 4737|  6.27k|    ret->max_axis = 0;
 4738|  6.27k|    ret->axis = NULL;
 4739|       |
 4740|  6.27k|    ret->nsHash = NULL;
 4741|  6.27k|    ret->user = NULL;
 4742|       |
 4743|  6.27k|    ret->contextSize = -1;
 4744|  6.27k|    ret->proximityPosition = -1;
 4745|       |
 4746|       |#ifdef XP_DEFAULT_CACHE_ON
 4747|       |    if (xmlXPathContextSetCache(ret, 1, -1, 0) == -1) {
 4748|       |	xmlXPathFreeContext(ret);
 4749|       |	return(NULL);
 4750|       |    }
 4751|       |#endif
 4752|       |
 4753|  6.27k|    return(ret);
 4754|  6.28k|}
xmlXPathFreeContext:
 4762|  6.27k|xmlXPathFreeContext(xmlXPathContext *ctxt) {
 4763|  6.27k|    if (ctxt == NULL) return;
  ------------------
  |  Branch (4763:9): [True: 0, False: 6.27k]
  ------------------
 4764|       |
 4765|  6.27k|    if (ctxt->cache != NULL)
  ------------------
  |  Branch (4765:9): [True: 0, False: 6.27k]
  ------------------
 4766|      0|	xmlXPathFreeCache((xmlXPathContextCachePtr) ctxt->cache);
 4767|  6.27k|    xmlXPathRegisteredNsCleanup(ctxt);
 4768|  6.27k|    xmlXPathRegisteredFuncsCleanup(ctxt);
 4769|  6.27k|    xmlXPathRegisteredVariablesCleanup(ctxt);
 4770|  6.27k|    xmlResetError(&ctxt->lastError);
 4771|  6.27k|    xmlFree(ctxt);
 4772|  6.27k|}
xmlXPathSetErrorHandler:
 4785|  6.27k|                        xmlStructuredErrorFunc handler, void *data) {
 4786|  6.27k|    if (ctxt == NULL)
  ------------------
  |  Branch (4786:9): [True: 0, False: 6.27k]
  ------------------
 4787|      0|        return;
 4788|       |
 4789|  6.27k|    ctxt->error = handler;
 4790|  6.27k|    ctxt->userData = data;
 4791|  6.27k|}
xmlXPathNewParserContext:
 4807|  10.4k|xmlXPathNewParserContext(const xmlChar *str, xmlXPathContext *ctxt) {
 4808|  10.4k|    xmlXPathParserContextPtr ret;
 4809|       |
 4810|  10.4k|    ret = (xmlXPathParserContextPtr) xmlMalloc(sizeof(xmlXPathParserContext));
 4811|  10.4k|    if (ret == NULL) {
  ------------------
  |  Branch (4811:9): [True: 30, False: 10.4k]
  ------------------
 4812|     30|        xmlXPathErrMemory(ctxt);
 4813|     30|	return(NULL);
 4814|     30|    }
 4815|  10.4k|    memset(ret, 0 , sizeof(xmlXPathParserContext));
 4816|  10.4k|    ret->cur = ret->base = str;
 4817|  10.4k|    ret->context = ctxt;
 4818|       |
 4819|  10.4k|    ret->comp = xmlXPathNewCompExpr();
 4820|  10.4k|    if (ret->comp == NULL) {
  ------------------
  |  Branch (4820:9): [True: 47, False: 10.3k]
  ------------------
 4821|     47|        xmlXPathErrMemory(ctxt);
 4822|     47|	xmlFree(ret->valueTab);
 4823|     47|	xmlFree(ret);
 4824|     47|	return(NULL);
 4825|     47|    }
 4826|  10.3k|    if ((ctxt != NULL) && (ctxt->dict != NULL)) {
  ------------------
  |  Branch (4826:9): [True: 10.3k, False: 0]
  |  Branch (4826:27): [True: 0, False: 10.3k]
  ------------------
 4827|      0|        ret->comp->dict = ctxt->dict;
 4828|      0|	xmlDictReference(ret->comp->dict);
 4829|      0|    }
 4830|       |
 4831|  10.3k|    return(ret);
 4832|  10.4k|}
xmlXPathFreeParserContext:
 4879|  10.3k|xmlXPathFreeParserContext(xmlXPathParserContext *ctxt) {
 4880|  10.3k|    int i;
 4881|       |
 4882|  10.3k|    if (ctxt == NULL)
  ------------------
  |  Branch (4882:9): [True: 0, False: 10.3k]
  ------------------
 4883|      0|        return;
 4884|       |
 4885|  10.3k|    if (ctxt->valueTab != NULL) {
  ------------------
  |  Branch (4885:9): [True: 10.3k, False: 38]
  ------------------
 4886|  18.8k|        for (i = 0; i < ctxt->valueNr; i++) {
  ------------------
  |  Branch (4886:21): [True: 8.51k, False: 10.3k]
  ------------------
 4887|  8.51k|            if (ctxt->context)
  ------------------
  |  Branch (4887:17): [True: 8.51k, False: 0]
  ------------------
 4888|  8.51k|                xmlXPathReleaseObject(ctxt->context, ctxt->valueTab[i]);
 4889|      0|            else
 4890|      0|                xmlXPathFreeObject(ctxt->valueTab[i]);
 4891|  8.51k|        }
 4892|  10.3k|        xmlFree(ctxt->valueTab);
 4893|  10.3k|    }
 4894|  10.3k|    if (ctxt->comp != NULL) {
  ------------------
  |  Branch (4894:9): [True: 10.3k, 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|  10.3k|	xmlXPathFreeCompExpr(ctxt->comp);
 4902|  10.3k|    }
 4903|  10.3k|    xmlFree(ctxt);
 4904|  10.3k|}
xmlXPathEqualValues:
 5702|   369k|xmlXPathEqualValues(xmlXPathParserContext *ctxt) {
 5703|   369k|    xmlXPathObjectPtr arg1, arg2, argtmp;
 5704|   369k|    int ret = 0;
 5705|       |
 5706|   369k|    if ((ctxt == NULL) || (ctxt->context == NULL)) return(0);
  ------------------
  |  Branch (5706:9): [True: 0, False: 369k]
  |  Branch (5706:27): [True: 0, False: 369k]
  ------------------
 5707|   369k|    arg2 = xmlXPathValuePop(ctxt);
 5708|   369k|    arg1 = xmlXPathValuePop(ctxt);
 5709|   369k|    if ((arg1 == NULL) || (arg2 == NULL)) {
  ------------------
  |  Branch (5709:9): [True: 0, False: 369k]
  |  Branch (5709:27): [True: 0, False: 369k]
  ------------------
 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|   369k|    if (arg1 == arg2) {
  ------------------
  |  Branch (5717:9): [True: 0, False: 369k]
  ------------------
 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|   369k|    if ((arg2->type == XPATH_NODESET) || (arg2->type == XPATH_XSLT_TREE) ||
  ------------------
  |  Branch (5725:9): [True: 129k, False: 239k]
  |  Branch (5725:42): [True: 0, False: 239k]
  ------------------
 5726|   239k|      (arg1->type == XPATH_NODESET) || (arg1->type == XPATH_XSLT_TREE)) {
  ------------------
  |  Branch (5726:7): [True: 22.9k, False: 216k]
  |  Branch (5726:40): [True: 0, False: 216k]
  ------------------
 5727|       |	/*
 5728|       |	 *Hack it to assure arg1 is the nodeset
 5729|       |	 */
 5730|   152k|	if ((arg1->type != XPATH_NODESET) && (arg1->type != XPATH_XSLT_TREE)) {
  ------------------
  |  Branch (5730:6): [True: 94.4k, False: 58.0k]
  |  Branch (5730:39): [True: 94.4k, False: 0]
  ------------------
 5731|  94.4k|		argtmp = arg2;
 5732|  94.4k|		arg2 = arg1;
 5733|  94.4k|		arg1 = argtmp;
 5734|  94.4k|	}
 5735|   152k|	switch (arg2->type) {
  ------------------
  |  Branch (5735:10): [True: 152k, False: 0]
  ------------------
 5736|      0|	    case XPATH_UNDEFINED:
  ------------------
  |  Branch (5736:6): [True: 0, False: 152k]
  ------------------
 5737|      0|		break;
 5738|  35.0k|	    case XPATH_NODESET:
  ------------------
  |  Branch (5738:6): [True: 35.0k, False: 117k]
  ------------------
 5739|  35.0k|	    case XPATH_XSLT_TREE:
  ------------------
  |  Branch (5739:6): [True: 0, False: 152k]
  ------------------
 5740|  35.0k|		ret = xmlXPathEqualNodeSets(ctxt, arg1, arg2, 0);
 5741|  35.0k|		break;
 5742|  80.7k|	    case XPATH_BOOLEAN:
  ------------------
  |  Branch (5742:6): [True: 80.7k, False: 71.6k]
  ------------------
 5743|  80.7k|		if ((arg1->nodesetval == NULL) ||
  ------------------
  |  Branch (5743:7): [True: 0, False: 80.7k]
  ------------------
 5744|  80.7k|		  (arg1->nodesetval->nodeNr == 0)) ret = 0;
  ------------------
  |  Branch (5744:5): [True: 41.6k, False: 39.1k]
  ------------------
 5745|  39.1k|		else
 5746|  39.1k|		    ret = 1;
 5747|  80.7k|		ret = (ret == arg2->boolval);
 5748|  80.7k|		break;
 5749|  31.2k|	    case XPATH_NUMBER:
  ------------------
  |  Branch (5749:6): [True: 31.2k, False: 121k]
  ------------------
 5750|  31.2k|		ret = xmlXPathEqualNodeSetFloat(ctxt, arg1, arg2->floatval, 0);
 5751|  31.2k|		break;
 5752|  5.38k|	    case XPATH_STRING:
  ------------------
  |  Branch (5752:6): [True: 5.38k, False: 147k]
  ------------------
 5753|  5.38k|		ret = xmlXPathEqualNodeSetString(ctxt, arg1,
 5754|  5.38k|                                                 arg2->stringval, 0);
 5755|  5.38k|		break;
 5756|      0|	    case XPATH_USERS:
  ------------------
  |  Branch (5756:6): [True: 0, False: 152k]
  ------------------
 5757|       |		/* TODO */
 5758|      0|		break;
 5759|   152k|	}
 5760|   152k|	xmlXPathReleaseObject(ctxt->context, arg1);
 5761|   152k|	xmlXPathReleaseObject(ctxt->context, arg2);
 5762|   152k|	return(ret);
 5763|   152k|    }
 5764|       |
 5765|   216k|    return (xmlXPathEqualValuesCommon(ctxt, arg1, arg2));
 5766|   369k|}
xmlXPathNotEqualValues:
 5775|  4.38k|xmlXPathNotEqualValues(xmlXPathParserContext *ctxt) {
 5776|  4.38k|    xmlXPathObjectPtr arg1, arg2, argtmp;
 5777|  4.38k|    int ret = 0;
 5778|       |
 5779|  4.38k|    if ((ctxt == NULL) || (ctxt->context == NULL)) return(0);
  ------------------
  |  Branch (5779:9): [True: 0, False: 4.38k]
  |  Branch (5779:27): [True: 0, False: 4.38k]
  ------------------
 5780|  4.38k|    arg2 = xmlXPathValuePop(ctxt);
 5781|  4.38k|    arg1 = xmlXPathValuePop(ctxt);
 5782|  4.38k|    if ((arg1 == NULL) || (arg2 == NULL)) {
  ------------------
  |  Branch (5782:9): [True: 0, False: 4.38k]
  |  Branch (5782:27): [True: 0, False: 4.38k]
  ------------------
 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.38k|    if (arg1 == arg2) {
  ------------------
  |  Branch (5790:9): [True: 0, False: 4.38k]
  ------------------
 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.38k|    if ((arg2->type == XPATH_NODESET) || (arg2->type == XPATH_XSLT_TREE) ||
  ------------------
  |  Branch (5798:9): [True: 1.90k, False: 2.48k]
  |  Branch (5798:42): [True: 0, False: 2.48k]
  ------------------
 5799|  3.45k|      (arg1->type == XPATH_NODESET) || (arg1->type == XPATH_XSLT_TREE)) {
  ------------------
  |  Branch (5799:7): [True: 1.54k, False: 936]
  |  Branch (5799:40): [True: 0, False: 936]
  ------------------
 5800|       |	/*
 5801|       |	 *Hack it to assure arg1 is the nodeset
 5802|       |	 */
 5803|  3.45k|	if ((arg1->type != XPATH_NODESET) && (arg1->type != XPATH_XSLT_TREE)) {
  ------------------
  |  Branch (5803:6): [True: 1.00k, False: 2.45k]
  |  Branch (5803:39): [True: 1.00k, False: 0]
  ------------------
 5804|  1.00k|		argtmp = arg2;
 5805|  1.00k|		arg2 = arg1;
 5806|  1.00k|		arg1 = argtmp;
 5807|  1.00k|	}
 5808|  3.45k|	switch (arg2->type) {
  ------------------
  |  Branch (5808:10): [True: 3.45k, False: 0]
  ------------------
 5809|      0|	    case XPATH_UNDEFINED:
  ------------------
  |  Branch (5809:6): [True: 0, False: 3.45k]
  ------------------
 5810|      0|		break;
 5811|    906|	    case XPATH_NODESET:
  ------------------
  |  Branch (5811:6): [True: 906, False: 2.54k]
  ------------------
 5812|    906|	    case XPATH_XSLT_TREE:
  ------------------
  |  Branch (5812:6): [True: 0, False: 3.45k]
  ------------------
 5813|    906|		ret = xmlXPathEqualNodeSets(ctxt, arg1, arg2, 1);
 5814|    906|		break;
 5815|    806|	    case XPATH_BOOLEAN:
  ------------------
  |  Branch (5815:6): [True: 806, False: 2.64k]
  ------------------
 5816|    806|		if ((arg1->nodesetval == NULL) ||
  ------------------
  |  Branch (5816:7): [True: 0, False: 806]
  ------------------
 5817|    806|		  (arg1->nodesetval->nodeNr == 0)) ret = 0;
  ------------------
  |  Branch (5817:5): [True: 400, False: 406]
  ------------------
 5818|    406|		else
 5819|    406|		    ret = 1;
 5820|    806|		ret = (ret != arg2->boolval);
 5821|    806|		break;
 5822|    598|	    case XPATH_NUMBER:
  ------------------
  |  Branch (5822:6): [True: 598, False: 2.85k]
  ------------------
 5823|    598|		ret = xmlXPathEqualNodeSetFloat(ctxt, arg1, arg2->floatval, 1);
 5824|    598|		break;
 5825|  1.14k|	    case XPATH_STRING:
  ------------------
  |  Branch (5825:6): [True: 1.14k, False: 2.31k]
  ------------------
 5826|  1.14k|		ret = xmlXPathEqualNodeSetString(ctxt, arg1,
 5827|  1.14k|                                                 arg2->stringval, 1);
 5828|  1.14k|		break;
 5829|      0|	    case XPATH_USERS:
  ------------------
  |  Branch (5829:6): [True: 0, False: 3.45k]
  ------------------
 5830|       |		/* TODO */
 5831|      0|		break;
 5832|  3.45k|	}
 5833|  3.45k|	xmlXPathReleaseObject(ctxt->context, arg1);
 5834|  3.45k|	xmlXPathReleaseObject(ctxt->context, arg2);
 5835|  3.45k|	return(ret);
 5836|  3.45k|    }
 5837|       |
 5838|    936|    return (!xmlXPathEqualValuesCommon(ctxt, arg1, arg2));
 5839|  4.38k|}
xmlXPathCompareValues:
 5864|   224k|xmlXPathCompareValues(xmlXPathParserContext *ctxt, int inf, int strict) {
 5865|   224k|    int ret = 0, arg1i = 0, arg2i = 0;
 5866|   224k|    xmlXPathObjectPtr arg1, arg2;
 5867|       |
 5868|   224k|    if ((ctxt == NULL) || (ctxt->context == NULL)) return(0);
  ------------------
  |  Branch (5868:9): [True: 0, False: 224k]
  |  Branch (5868:27): [True: 0, False: 224k]
  ------------------
 5869|   224k|    arg2 = xmlXPathValuePop(ctxt);
 5870|   224k|    arg1 = xmlXPathValuePop(ctxt);
 5871|   224k|    if ((arg1 == NULL) || (arg2 == NULL)) {
  ------------------
  |  Branch (5871:9): [True: 7, False: 224k]
  |  Branch (5871:27): [True: 0, False: 224k]
  ------------------
 5872|      7|	if (arg1 != NULL)
  ------------------
  |  Branch (5872:6): [True: 0, False: 7]
  ------------------
 5873|      0|	    xmlXPathReleaseObject(ctxt->context, arg1);
 5874|      7|	else
 5875|      7|	    xmlXPathReleaseObject(ctxt->context, arg2);
 5876|      7|	XP_ERROR0(XPATH_INVALID_OPERAND);
  ------------------
  |  |  252|      7|    { xmlXPathErr(ctxt, X); return(0); }
  ------------------
 5877|      0|    }
 5878|       |
 5879|   224k|    if ((arg2->type == XPATH_NODESET) || (arg2->type == XPATH_XSLT_TREE) ||
  ------------------
  |  Branch (5879:9): [True: 131k, False: 92.9k]
  |  Branch (5879:42): [True: 0, False: 92.9k]
  ------------------
 5880|   157k|      (arg1->type == XPATH_NODESET) || (arg1->type == XPATH_XSLT_TREE)) {
  ------------------
  |  Branch (5880:7): [True: 26.0k, False: 66.9k]
  |  Branch (5880:40): [True: 0, False: 66.9k]
  ------------------
 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|   157k|	if (((arg2->type == XPATH_NODESET) || (arg2->type == XPATH_XSLT_TREE)) &&
  ------------------
  |  Branch (5886:7): [True: 131k, False: 26.0k]
  |  Branch (5886:40): [True: 0, False: 26.0k]
  ------------------
 5887|   131k|	  ((arg1->type == XPATH_NODESET) || (arg1->type == XPATH_XSLT_TREE))){
  ------------------
  |  Branch (5887:5): [True: 83.5k, False: 48.0k]
  |  Branch (5887:38): [True: 0, False: 48.0k]
  ------------------
 5888|  83.5k|	    ret = xmlXPathCompareNodeSets(ctxt, inf, strict, arg1, arg2);
 5889|  83.5k|	} else {
 5890|  74.0k|	    if ((arg1->type == XPATH_NODESET) || (arg1->type == XPATH_XSLT_TREE)) {
  ------------------
  |  Branch (5890:10): [True: 26.0k, False: 48.0k]
  |  Branch (5890:43): [True: 0, False: 48.0k]
  ------------------
 5891|  26.0k|		ret = xmlXPathCompareNodeSetValue(ctxt, inf, strict,
 5892|  26.0k|			                          arg1, arg2);
 5893|  48.0k|	    } else {
 5894|  48.0k|		ret = xmlXPathCompareNodeSetValue(ctxt, !inf, strict,
 5895|  48.0k|			                          arg2, arg1);
 5896|  48.0k|	    }
 5897|  74.0k|	}
 5898|   157k|	return(ret);
 5899|   157k|    }
 5900|       |
 5901|  66.9k|    if (arg1->type != XPATH_NUMBER) {
  ------------------
  |  Branch (5901:9): [True: 13.6k, False: 53.2k]
  ------------------
 5902|  13.6k|	xmlXPathValuePush(ctxt, arg1);
 5903|  13.6k|	xmlXPathNumberFunction(ctxt, 1);
 5904|  13.6k|	arg1 = xmlXPathValuePop(ctxt);
 5905|  13.6k|    }
 5906|  66.9k|    if (arg2->type != XPATH_NUMBER) {
  ------------------
  |  Branch (5906:9): [True: 8.94k, False: 57.9k]
  ------------------
 5907|  8.94k|	xmlXPathValuePush(ctxt, arg2);
 5908|  8.94k|	xmlXPathNumberFunction(ctxt, 1);
 5909|  8.94k|	arg2 = xmlXPathValuePop(ctxt);
 5910|  8.94k|    }
 5911|  66.9k|    if (ctxt->error)
  ------------------
  |  Branch (5911:9): [True: 343, False: 66.5k]
  ------------------
 5912|    343|        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|  66.5k|    if (xmlXPathIsNaN(arg1->floatval) || xmlXPathIsNaN(arg2->floatval)) {
  ------------------
  |  Branch (5918:9): [True: 47.1k, False: 19.4k]
  |  Branch (5918:42): [True: 1.18k, False: 18.2k]
  ------------------
 5919|  48.2k|	ret=0;
 5920|  48.2k|    } else {
 5921|  18.2k|	arg1i=xmlXPathIsInf(arg1->floatval);
 5922|  18.2k|	arg2i=xmlXPathIsInf(arg2->floatval);
 5923|  18.2k|	if (inf && strict) {
  ------------------
  |  Branch (5923:6): [True: 11.3k, False: 6.90k]
  |  Branch (5923:13): [True: 8.42k, False: 2.95k]
  ------------------
 5924|  8.42k|	    if ((arg1i == -1 && arg2i != -1) ||
  ------------------
  |  Branch (5924:11): [True: 573, False: 7.85k]
  |  Branch (5924:26): [True: 273, False: 300]
  ------------------
 5925|  8.15k|		(arg2i == 1 && arg1i != 1)) {
  ------------------
  |  Branch (5925:4): [True: 930, False: 7.22k]
  |  Branch (5925:18): [True: 367, False: 563]
  ------------------
 5926|    640|		ret = 1;
 5927|  7.78k|	    } else if (arg1i == 0 && arg2i == 0) {
  ------------------
  |  Branch (5927:17): [True: 6.71k, False: 1.06k]
  |  Branch (5927:31): [True: 6.40k, False: 315]
  ------------------
 5928|  6.40k|		ret = (arg1->floatval < arg2->floatval);
 5929|  6.40k|	    } else {
 5930|  1.38k|		ret = 0;
 5931|  1.38k|	    }
 5932|  8.42k|	}
 5933|  9.86k|	else if (inf && !strict) {
  ------------------
  |  Branch (5933:11): [True: 2.95k, False: 6.90k]
  |  Branch (5933:18): [True: 2.95k, False: 0]
  ------------------
 5934|  2.95k|	    if (arg1i == -1 || arg2i == 1) {
  ------------------
  |  Branch (5934:10): [True: 266, False: 2.68k]
  |  Branch (5934:25): [True: 214, False: 2.47k]
  ------------------
 5935|    480|		ret = 1;
 5936|  2.47k|	    } else if (arg1i == 0 && arg2i == 0) {
  ------------------
  |  Branch (5936:17): [True: 1.94k, False: 529]
  |  Branch (5936:31): [True: 601, False: 1.34k]
  ------------------
 5937|    601|		ret = (arg1->floatval <= arg2->floatval);
 5938|  1.87k|	    } else {
 5939|  1.87k|		ret = 0;
 5940|  1.87k|	    }
 5941|  2.95k|	}
 5942|  6.90k|	else if (!inf && strict) {
  ------------------
  |  Branch (5942:11): [True: 6.90k, False: 0]
  |  Branch (5942:19): [True: 5.07k, False: 1.82k]
  ------------------
 5943|  5.07k|	    if ((arg1i == 1 && arg2i != 1) ||
  ------------------
  |  Branch (5943:11): [True: 839, False: 4.24k]
  |  Branch (5943:25): [True: 315, False: 524]
  ------------------
 5944|  4.76k|		(arg2i == -1 && arg1i != -1)) {
  ------------------
  |  Branch (5944:4): [True: 649, False: 4.11k]
  |  Branch (5944:19): [True: 379, False: 270]
  ------------------
 5945|    694|		ret = 1;
 5946|  4.38k|	    } else if (arg1i == 0 && arg2i == 0) {
  ------------------
  |  Branch (5946:17): [True: 3.47k, False: 912]
  |  Branch (5946:31): [True: 2.96k, False: 510]
  ------------------
 5947|  2.96k|		ret = (arg1->floatval > arg2->floatval);
 5948|  2.96k|	    } else {
 5949|  1.42k|		ret = 0;
 5950|  1.42k|	    }
 5951|  5.07k|	}
 5952|  1.82k|	else if (!inf && !strict) {
  ------------------
  |  Branch (5952:11): [True: 1.82k, False: 0]
  |  Branch (5952:19): [True: 1.82k, False: 0]
  ------------------
 5953|  1.82k|	    if (arg1i == 1 || arg2i == -1) {
  ------------------
  |  Branch (5953:10): [True: 195, False: 1.63k]
  |  Branch (5953:24): [True: 229, False: 1.40k]
  ------------------
 5954|    424|		ret = 1;
 5955|  1.40k|	    } else if (arg1i == 0 && arg2i == 0) {
  ------------------
  |  Branch (5955:17): [True: 1.28k, False: 124]
  |  Branch (5955:31): [True: 1.03k, False: 250]
  ------------------
 5956|  1.03k|		ret = (arg1->floatval >= arg2->floatval);
 5957|  1.03k|	    } else {
 5958|    374|		ret = 0;
 5959|    374|	    }
 5960|  1.82k|	}
 5961|  18.2k|    }
 5962|  66.9k|error:
 5963|  66.9k|    xmlXPathReleaseObject(ctxt->context, arg1);
 5964|  66.9k|    xmlXPathReleaseObject(ctxt->context, arg2);
 5965|  66.9k|    return(ret);
 5966|  66.5k|}
xmlXPathValueFlipSign:
 5976|  99.4k|xmlXPathValueFlipSign(xmlXPathParserContext *ctxt) {
 5977|  99.4k|    if ((ctxt == NULL) || (ctxt->context == NULL)) return;
  ------------------
  |  Branch (5977:9): [True: 0, False: 99.4k]
  |  Branch (5977:27): [True: 0, False: 99.4k]
  ------------------
 5978|  99.4k|    CAST_TO_NUMBER;
  ------------------
  |  |  297|  99.4k|    if ((ctxt->value != NULL) && (ctxt->value->type != XPATH_NUMBER))	\
  |  |  ------------------
  |  |  |  Branch (297:9): [True: 99.4k, False: 0]
  |  |  |  Branch (297:34): [True: 70.3k, False: 29.0k]
  |  |  ------------------
  |  |  298|  99.4k|        xmlXPathNumberFunction(ctxt, 1);
  ------------------
 5979|  99.4k|    CHECK_TYPE(XPATH_NUMBER);
  ------------------
  |  |  261|  99.4k|    if ((ctxt->value == NULL) || (ctxt->value->type != typeval))	\
  |  |  ------------------
  |  |  |  Branch (261:9): [True: 8, False: 99.4k]
  |  |  |  Branch (261:34): [True: 9, False: 99.4k]
  |  |  ------------------
  |  |  262|  99.4k|        XP_ERROR(XPATH_INVALID_TYPE)
  |  |  ------------------
  |  |  |  |  244|     17|    { xmlXPathErr(ctxt, X); return; }
  |  |  ------------------
  ------------------
 5980|  99.4k|    ctxt->value->floatval = -ctxt->value->floatval;
 5981|  99.4k|}
xmlXPathAddValues:
 5991|  71.2k|xmlXPathAddValues(xmlXPathParserContext *ctxt) {
 5992|  71.2k|    xmlXPathObjectPtr arg;
 5993|  71.2k|    double val;
 5994|       |
 5995|  71.2k|    arg = xmlXPathValuePop(ctxt);
 5996|  71.2k|    if (arg == NULL)
  ------------------
  |  Branch (5996:9): [True: 0, False: 71.2k]
  ------------------
 5997|  71.2k|	XP_ERROR(XPATH_INVALID_OPERAND);
  ------------------
  |  |  244|      0|    { xmlXPathErr(ctxt, X); return; }
  ------------------
 5998|  71.2k|    val = xmlXPathCastToNumberInternal(ctxt, arg);
 5999|  71.2k|    xmlXPathReleaseObject(ctxt->context, arg);
 6000|  71.2k|    CAST_TO_NUMBER;
  ------------------
  |  |  297|  71.2k|    if ((ctxt->value != NULL) && (ctxt->value->type != XPATH_NUMBER))	\
  |  |  ------------------
  |  |  |  Branch (297:9): [True: 71.2k, False: 0]
  |  |  |  Branch (297:34): [True: 58.3k, False: 12.8k]
  |  |  ------------------
  |  |  298|  71.2k|        xmlXPathNumberFunction(ctxt, 1);
  ------------------
 6001|  71.2k|    CHECK_TYPE(XPATH_NUMBER);
  ------------------
  |  |  261|  71.2k|    if ((ctxt->value == NULL) || (ctxt->value->type != typeval))	\
  |  |  ------------------
  |  |  |  Branch (261:9): [True: 6, False: 71.2k]
  |  |  |  Branch (261:34): [True: 1, False: 71.2k]
  |  |  ------------------
  |  |  262|  71.2k|        XP_ERROR(XPATH_INVALID_TYPE)
  |  |  ------------------
  |  |  |  |  244|      7|    { xmlXPathErr(ctxt, X); return; }
  |  |  ------------------
  ------------------
 6002|  71.2k|    ctxt->value->floatval += val;
 6003|  71.2k|}
xmlXPathSubValues:
 6013|  42.9k|xmlXPathSubValues(xmlXPathParserContext *ctxt) {
 6014|  42.9k|    xmlXPathObjectPtr arg;
 6015|  42.9k|    double val;
 6016|       |
 6017|  42.9k|    arg = xmlXPathValuePop(ctxt);
 6018|  42.9k|    if (arg == NULL)
  ------------------
  |  Branch (6018:9): [True: 0, False: 42.9k]
  ------------------
 6019|  42.9k|	XP_ERROR(XPATH_INVALID_OPERAND);
  ------------------
  |  |  244|      0|    { xmlXPathErr(ctxt, X); return; }
  ------------------
 6020|  42.9k|    val = xmlXPathCastToNumberInternal(ctxt, arg);
 6021|  42.9k|    xmlXPathReleaseObject(ctxt->context, arg);
 6022|  42.9k|    CAST_TO_NUMBER;
  ------------------
  |  |  297|  42.9k|    if ((ctxt->value != NULL) && (ctxt->value->type != XPATH_NUMBER))	\
  |  |  ------------------
  |  |  |  Branch (297:9): [True: 42.9k, False: 0]
  |  |  |  Branch (297:34): [True: 15.4k, False: 27.5k]
  |  |  ------------------
  |  |  298|  42.9k|        xmlXPathNumberFunction(ctxt, 1);
  ------------------
 6023|  42.9k|    CHECK_TYPE(XPATH_NUMBER);
  ------------------
  |  |  261|  42.9k|    if ((ctxt->value == NULL) || (ctxt->value->type != typeval))	\
  |  |  ------------------
  |  |  |  Branch (261:9): [True: 3, False: 42.9k]
  |  |  |  Branch (261:34): [True: 6, False: 42.9k]
  |  |  ------------------
  |  |  262|  42.9k|        XP_ERROR(XPATH_INVALID_TYPE)
  |  |  ------------------
  |  |  |  |  244|      9|    { xmlXPathErr(ctxt, X); return; }
  |  |  ------------------
  ------------------
 6024|  42.9k|    ctxt->value->floatval -= val;
 6025|  42.9k|}
xmlXPathMultValues:
 6035|   115k|xmlXPathMultValues(xmlXPathParserContext *ctxt) {
 6036|   115k|    xmlXPathObjectPtr arg;
 6037|   115k|    double val;
 6038|       |
 6039|   115k|    arg = xmlXPathValuePop(ctxt);
 6040|   115k|    if (arg == NULL)
  ------------------
  |  Branch (6040:9): [True: 0, False: 115k]
  ------------------
 6041|   115k|	XP_ERROR(XPATH_INVALID_OPERAND);
  ------------------
  |  |  244|      0|    { xmlXPathErr(ctxt, X); return; }
  ------------------
 6042|   115k|    val = xmlXPathCastToNumberInternal(ctxt, arg);
 6043|   115k|    xmlXPathReleaseObject(ctxt->context, arg);
 6044|   115k|    CAST_TO_NUMBER;
  ------------------
  |  |  297|   115k|    if ((ctxt->value != NULL) && (ctxt->value->type != XPATH_NUMBER))	\
  |  |  ------------------
  |  |  |  Branch (297:9): [True: 115k, False: 0]
  |  |  |  Branch (297:34): [True: 40.9k, False: 74.4k]
  |  |  ------------------
  |  |  298|   115k|        xmlXPathNumberFunction(ctxt, 1);
  ------------------
 6045|   115k|    CHECK_TYPE(XPATH_NUMBER);
  ------------------
  |  |  261|   115k|    if ((ctxt->value == NULL) || (ctxt->value->type != typeval))	\
  |  |  ------------------
  |  |  |  Branch (261:9): [True: 5, False: 115k]
  |  |  |  Branch (261:34): [True: 1, False: 115k]
  |  |  ------------------
  |  |  262|   115k|        XP_ERROR(XPATH_INVALID_TYPE)
  |  |  ------------------
  |  |  |  |  244|      6|    { xmlXPathErr(ctxt, X); return; }
  |  |  ------------------
  ------------------
 6046|   115k|    ctxt->value->floatval *= val;
 6047|   115k|}
xmlXPathDivValues:
 6058|  1.29k|xmlXPathDivValues(xmlXPathParserContext *ctxt) {
 6059|  1.29k|    xmlXPathObjectPtr arg;
 6060|  1.29k|    double val;
 6061|       |
 6062|  1.29k|    arg = xmlXPathValuePop(ctxt);
 6063|  1.29k|    if (arg == NULL)
  ------------------
  |  Branch (6063:9): [True: 0, False: 1.29k]
  ------------------
 6064|  1.29k|	XP_ERROR(XPATH_INVALID_OPERAND);
  ------------------
  |  |  244|      0|    { xmlXPathErr(ctxt, X); return; }
  ------------------
 6065|  1.29k|    val = xmlXPathCastToNumberInternal(ctxt, arg);
 6066|  1.29k|    xmlXPathReleaseObject(ctxt->context, arg);
 6067|  1.29k|    CAST_TO_NUMBER;
  ------------------
  |  |  297|  1.29k|    if ((ctxt->value != NULL) && (ctxt->value->type != XPATH_NUMBER))	\
  |  |  ------------------
  |  |  |  Branch (297:9): [True: 1.29k, False: 0]
  |  |  |  Branch (297:34): [True: 660, False: 633]
  |  |  ------------------
  |  |  298|  1.29k|        xmlXPathNumberFunction(ctxt, 1);
  ------------------
 6068|  1.29k|    CHECK_TYPE(XPATH_NUMBER);
  ------------------
  |  |  261|  1.29k|    if ((ctxt->value == NULL) || (ctxt->value->type != typeval))	\
  |  |  ------------------
  |  |  |  Branch (261:9): [True: 0, False: 1.29k]
  |  |  |  Branch (261:34): [True: 1, False: 1.29k]
  |  |  ------------------
  |  |  262|  1.29k|        XP_ERROR(XPATH_INVALID_TYPE)
  |  |  ------------------
  |  |  |  |  244|      1|    { xmlXPathErr(ctxt, X); return; }
  |  |  ------------------
  ------------------
 6069|  1.29k|    ctxt->value->floatval /= val;
 6070|  1.29k|}
xmlXPathModValues:
 6080|  1.51k|xmlXPathModValues(xmlXPathParserContext *ctxt) {
 6081|  1.51k|    xmlXPathObjectPtr arg;
 6082|  1.51k|    double arg1, arg2;
 6083|       |
 6084|  1.51k|    arg = xmlXPathValuePop(ctxt);
 6085|  1.51k|    if (arg == NULL)
  ------------------
  |  Branch (6085:9): [True: 0, False: 1.51k]
  ------------------
 6086|  1.51k|	XP_ERROR(XPATH_INVALID_OPERAND);
  ------------------
  |  |  244|      0|    { xmlXPathErr(ctxt, X); return; }
  ------------------
 6087|  1.51k|    arg2 = xmlXPathCastToNumberInternal(ctxt, arg);
 6088|  1.51k|    xmlXPathReleaseObject(ctxt->context, arg);
 6089|  1.51k|    CAST_TO_NUMBER;
  ------------------
  |  |  297|  1.51k|    if ((ctxt->value != NULL) && (ctxt->value->type != XPATH_NUMBER))	\
  |  |  ------------------
  |  |  |  Branch (297:9): [True: 1.51k, False: 0]
  |  |  |  Branch (297:34): [True: 405, False: 1.10k]
  |  |  ------------------
  |  |  298|  1.51k|        xmlXPathNumberFunction(ctxt, 1);
  ------------------
 6090|  1.51k|    CHECK_TYPE(XPATH_NUMBER);
  ------------------
  |  |  261|  1.51k|    if ((ctxt->value == NULL) || (ctxt->value->type != typeval))	\
  |  |  ------------------
  |  |  |  Branch (261:9): [True: 1, False: 1.51k]
  |  |  |  Branch (261:34): [True: 1, False: 1.50k]
  |  |  ------------------
  |  |  262|  1.51k|        XP_ERROR(XPATH_INVALID_TYPE)
  |  |  ------------------
  |  |  |  |  244|      2|    { xmlXPathErr(ctxt, X); return; }
  |  |  ------------------
  ------------------
 6091|  1.50k|    arg1 = ctxt->value->floatval;
 6092|  1.50k|    if (arg2 == 0)
  ------------------
  |  Branch (6092:9): [True: 25, False: 1.48k]
  ------------------
 6093|     25|	ctxt->value->floatval = xmlXPathNAN;
 6094|  1.48k|    else {
 6095|  1.48k|	ctxt->value->floatval = fmod(arg1, arg2);
 6096|  1.48k|    }
 6097|  1.50k|}
xmlXPathNextSelf:
 6138|  1.10k|xmlXPathNextSelf(xmlXPathParserContext *ctxt, xmlNode *cur) {
 6139|  1.10k|    if ((ctxt == NULL) || (ctxt->context == NULL)) return(NULL);
  ------------------
  |  Branch (6139:9): [True: 0, False: 1.10k]
  |  Branch (6139:27): [True: 0, False: 1.10k]
  ------------------
 6140|  1.10k|    if (cur == NULL)
  ------------------
  |  Branch (6140:9): [True: 552, False: 552]
  ------------------
 6141|    552|        return(ctxt->context->node);
 6142|    552|    return(NULL);
 6143|  1.10k|}
xmlXPathNextChild:
 6154|   197k|xmlXPathNextChild(xmlXPathParserContext *ctxt, xmlNode *cur) {
 6155|   197k|    if ((ctxt == NULL) || (ctxt->context == NULL)) return(NULL);
  ------------------
  |  Branch (6155:9): [True: 0, False: 197k]
  |  Branch (6155:27): [True: 0, False: 197k]
  ------------------
 6156|   197k|    if (cur == NULL) {
  ------------------
  |  Branch (6156:9): [True: 84.6k, False: 112k]
  ------------------
 6157|  84.6k|	if (ctxt->context->node == NULL) return(NULL);
  ------------------
  |  Branch (6157:6): [True: 0, False: 84.6k]
  ------------------
 6158|  84.6k|	switch (ctxt->context->node->type) {
  ------------------
  |  Branch (6158:10): [True: 84.6k, False: 0]
  ------------------
 6159|  20.4k|            case XML_ELEMENT_NODE:
  ------------------
  |  Branch (6159:13): [True: 20.4k, False: 64.2k]
  ------------------
 6160|  60.1k|            case XML_TEXT_NODE:
  ------------------
  |  Branch (6160:13): [True: 39.7k, False: 44.9k]
  ------------------
 6161|  71.3k|            case XML_CDATA_SECTION_NODE:
  ------------------
  |  Branch (6161:13): [True: 11.1k, False: 73.5k]
  ------------------
 6162|  71.3k|            case XML_ENTITY_REF_NODE:
  ------------------
  |  Branch (6162:13): [True: 0, False: 84.6k]
  ------------------
 6163|  71.3k|            case XML_ENTITY_NODE:
  ------------------
  |  Branch (6163:13): [True: 0, False: 84.6k]
  ------------------
 6164|  72.4k|            case XML_PI_NODE:
  ------------------
  |  Branch (6164:13): [True: 1.11k, False: 83.5k]
  ------------------
 6165|  84.1k|            case XML_COMMENT_NODE:
  ------------------
  |  Branch (6165:13): [True: 11.7k, False: 72.9k]
  ------------------
 6166|  84.1k|            case XML_NOTATION_NODE:
  ------------------
  |  Branch (6166:13): [True: 0, False: 84.6k]
  ------------------
 6167|  84.1k|            case XML_DTD_NODE:
  ------------------
  |  Branch (6167:13): [True: 0, False: 84.6k]
  ------------------
 6168|  84.1k|		return(ctxt->context->node->children);
 6169|    468|            case XML_DOCUMENT_NODE:
  ------------------
  |  Branch (6169:13): [True: 468, False: 84.2k]
  ------------------
 6170|    468|            case XML_DOCUMENT_TYPE_NODE:
  ------------------
  |  Branch (6170:13): [True: 0, False: 84.6k]
  ------------------
 6171|    468|            case XML_DOCUMENT_FRAG_NODE:
  ------------------
  |  Branch (6171:13): [True: 0, False: 84.6k]
  ------------------
 6172|    468|            case XML_HTML_DOCUMENT_NODE:
  ------------------
  |  Branch (6172:13): [True: 0, False: 84.6k]
  ------------------
 6173|    468|		return(((xmlDocPtr) ctxt->context->node)->children);
 6174|      0|	    case XML_ELEMENT_DECL:
  ------------------
  |  Branch (6174:6): [True: 0, False: 84.6k]
  ------------------
 6175|      0|	    case XML_ATTRIBUTE_DECL:
  ------------------
  |  Branch (6175:6): [True: 0, False: 84.6k]
  ------------------
 6176|      0|	    case XML_ENTITY_DECL:
  ------------------
  |  Branch (6176:6): [True: 0, False: 84.6k]
  ------------------
 6177|     21|            case XML_ATTRIBUTE_NODE:
  ------------------
  |  Branch (6177:13): [True: 21, False: 84.6k]
  ------------------
 6178|     21|	    case XML_NAMESPACE_DECL:
  ------------------
  |  Branch (6178:6): [True: 0, False: 84.6k]
  ------------------
 6179|     21|	    case XML_XINCLUDE_START:
  ------------------
  |  Branch (6179:6): [True: 0, False: 84.6k]
  ------------------
 6180|     21|	    case XML_XINCLUDE_END:
  ------------------
  |  Branch (6180:6): [True: 0, False: 84.6k]
  ------------------
 6181|     21|		return(NULL);
 6182|  84.6k|	}
 6183|      0|	return(NULL);
 6184|  84.6k|    }
 6185|   112k|    if ((cur->type == XML_DOCUMENT_NODE) ||
  ------------------
  |  Branch (6185:9): [True: 0, False: 112k]
  ------------------
 6186|   112k|        (cur->type == XML_HTML_DOCUMENT_NODE))
  ------------------
  |  Branch (6186:9): [True: 0, False: 112k]
  ------------------
 6187|      0|	return(NULL);
 6188|   112k|    return(cur->next);
 6189|   112k|}
xmlXPathNextDescendant:
 6271|  4.99M|xmlXPathNextDescendant(xmlXPathParserContext *ctxt, xmlNode *cur) {
 6272|  4.99M|    if ((ctxt == NULL) || (ctxt->context == NULL)) return(NULL);
  ------------------
  |  Branch (6272:9): [True: 0, False: 4.99M]
  |  Branch (6272:27): [True: 0, False: 4.99M]
  ------------------
 6273|  4.99M|    if (cur == NULL) {
  ------------------
  |  Branch (6273:9): [True: 111k, False: 4.88M]
  ------------------
 6274|   111k|	if (ctxt->context->node == NULL)
  ------------------
  |  Branch (6274:6): [True: 0, False: 111k]
  ------------------
 6275|      0|	    return(NULL);
 6276|   111k|	if ((ctxt->context->node->type == XML_ATTRIBUTE_NODE) ||
  ------------------
  |  Branch (6276:6): [True: 245, False: 111k]
  ------------------
 6277|   111k|	    (ctxt->context->node->type == XML_NAMESPACE_DECL))
  ------------------
  |  Branch (6277:6): [True: 345, False: 110k]
  ------------------
 6278|    590|	    return(NULL);
 6279|       |
 6280|   110k|        if (ctxt->context->node == (xmlNodePtr) ctxt->context->doc)
  ------------------
  |  Branch (6280:13): [True: 57.7k, False: 53.1k]
  ------------------
 6281|  57.7k|	    return(ctxt->context->doc->children);
 6282|  53.1k|        return(ctxt->context->node->children);
 6283|   110k|    }
 6284|       |
 6285|  4.88M|    if (cur->type == XML_NAMESPACE_DECL)
  ------------------
  |  Branch (6285:9): [True: 0, False: 4.88M]
  ------------------
 6286|      0|        return(NULL);
 6287|  4.88M|    if (cur->children != NULL) {
  ------------------
  |  Branch (6287:9): [True: 1.31M, False: 3.57M]
  ------------------
 6288|       |	/*
 6289|       |	 * Do not descend on entities declarations
 6290|       |	 */
 6291|  1.31M|	if (cur->children->type != XML_ENTITY_DECL) {
  ------------------
  |  Branch (6291:6): [True: 1.31M, False: 1.97k]
  ------------------
 6292|  1.31M|	    cur = cur->children;
 6293|       |	    /*
 6294|       |	     * Skip DTDs
 6295|       |	     */
 6296|  1.31M|	    if (cur->type != XML_DTD_NODE)
  ------------------
  |  Branch (6296:10): [True: 1.31M, False: 1.13k]
  ------------------
 6297|  1.31M|		return(cur);
 6298|  1.31M|	}
 6299|  1.31M|    }
 6300|       |
 6301|  3.57M|    if (cur == ctxt->context->node) return(NULL);
  ------------------
  |  Branch (6301:9): [True: 8.13k, False: 3.56M]
  ------------------
 6302|       |
 6303|  3.56M|    while (cur->next != NULL) {
  ------------------
  |  Branch (6303:12): [True: 3.07M, False: 497k]
  ------------------
 6304|  3.07M|	cur = cur->next;
 6305|  3.07M|	if ((cur->type != XML_ENTITY_DECL) &&
  ------------------
  |  Branch (6305:6): [True: 3.07M, False: 496]
  ------------------
 6306|  3.07M|	    (cur->type != XML_DTD_NODE))
  ------------------
  |  Branch (6306:6): [True: 3.06M, False: 624]
  ------------------
 6307|  3.06M|	    return(cur);
 6308|  3.07M|    }
 6309|       |
 6310|  1.34M|    do {
 6311|  1.34M|        cur = cur->parent;
 6312|  1.34M|	if (cur == NULL) break;
  ------------------
  |  Branch (6312:6): [True: 0, False: 1.34M]
  ------------------
 6313|  1.34M|	if (cur == ctxt->context->node) return(NULL);
  ------------------
  |  Branch (6313:6): [True: 138k, False: 1.21M]
  ------------------
 6314|  1.21M|	if (cur->next != NULL) {
  ------------------
  |  Branch (6314:6): [True: 359k, False: 851k]
  ------------------
 6315|   359k|	    cur = cur->next;
 6316|   359k|	    return(cur);
 6317|   359k|	}
 6318|  1.21M|    } while (cur != NULL);
  ------------------
  |  Branch (6318:14): [True: 851k, False: 0]
  ------------------
 6319|      0|    return(cur);
 6320|   497k|}
xmlXPathNextDescendantOrSelf:
 6334|  3.44M|xmlXPathNextDescendantOrSelf(xmlXPathParserContext *ctxt, xmlNode *cur) {
 6335|  3.44M|    if ((ctxt == NULL) || (ctxt->context == NULL)) return(NULL);
  ------------------
  |  Branch (6335:9): [True: 0, False: 3.44M]
  |  Branch (6335:27): [True: 0, False: 3.44M]
  ------------------
 6336|  3.44M|    if (cur == NULL)
  ------------------
  |  Branch (6336:9): [True: 146k, False: 3.30M]
  ------------------
 6337|   146k|        return(ctxt->context->node);
 6338|       |
 6339|  3.30M|    if (ctxt->context->node == NULL)
  ------------------
  |  Branch (6339:9): [True: 0, False: 3.30M]
  ------------------
 6340|      0|        return(NULL);
 6341|  3.30M|    if ((ctxt->context->node->type == XML_ATTRIBUTE_NODE) ||
  ------------------
  |  Branch (6341:9): [True: 640, False: 3.29M]
  ------------------
 6342|  3.29M|        (ctxt->context->node->type == XML_NAMESPACE_DECL))
  ------------------
  |  Branch (6342:9): [True: 37.0k, False: 3.26M]
  ------------------
 6343|  37.6k|        return(NULL);
 6344|       |
 6345|  3.26M|    return(xmlXPathNextDescendant(ctxt, cur));
 6346|  3.30M|}
xmlXPathNextParent:
 6357|   259k|xmlXPathNextParent(xmlXPathParserContext *ctxt, xmlNode *cur) {
 6358|   259k|    if ((ctxt == NULL) || (ctxt->context == NULL)) return(NULL);
  ------------------
  |  Branch (6358:9): [True: 0, False: 259k]
  |  Branch (6358:27): [True: 0, False: 259k]
  ------------------
 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|   259k|    if (cur == NULL) {
  ------------------
  |  Branch (6364:9): [True: 133k, False: 126k]
  ------------------
 6365|   133k|	if (ctxt->context->node == NULL) return(NULL);
  ------------------
  |  Branch (6365:6): [True: 0, False: 133k]
  ------------------
 6366|   133k|	switch (ctxt->context->node->type) {
  ------------------
  |  Branch (6366:10): [True: 133k, False: 0]
  ------------------
 6367|  86.5k|            case XML_ELEMENT_NODE:
  ------------------
  |  Branch (6367:13): [True: 86.5k, False: 46.7k]
  ------------------
 6368|   122k|            case XML_TEXT_NODE:
  ------------------
  |  Branch (6368:13): [True: 35.5k, False: 97.7k]
  ------------------
 6369|   123k|            case XML_CDATA_SECTION_NODE:
  ------------------
  |  Branch (6369:13): [True: 1.18k, False: 132k]
  ------------------
 6370|   123k|            case XML_ENTITY_REF_NODE:
  ------------------
  |  Branch (6370:13): [True: 0, False: 133k]
  ------------------
 6371|   123k|            case XML_ENTITY_NODE:
  ------------------
  |  Branch (6371:13): [True: 0, False: 133k]
  ------------------
 6372|   124k|            case XML_PI_NODE:
  ------------------
  |  Branch (6372:13): [True: 1.24k, False: 132k]
  ------------------
 6373|   126k|            case XML_COMMENT_NODE:
  ------------------
  |  Branch (6373:13): [True: 2.12k, False: 131k]
  ------------------
 6374|   126k|            case XML_NOTATION_NODE:
  ------------------
  |  Branch (6374:13): [True: 0, False: 133k]
  ------------------
 6375|   126k|            case XML_DTD_NODE:
  ------------------
  |  Branch (6375:13): [True: 0, False: 133k]
  ------------------
 6376|   126k|	    case XML_ELEMENT_DECL:
  ------------------
  |  Branch (6376:6): [True: 0, False: 133k]
  ------------------
 6377|   126k|	    case XML_ATTRIBUTE_DECL:
  ------------------
  |  Branch (6377:6): [True: 0, False: 133k]
  ------------------
 6378|   126k|	    case XML_XINCLUDE_START:
  ------------------
  |  Branch (6378:6): [True: 0, False: 133k]
  ------------------
 6379|   126k|	    case XML_XINCLUDE_END:
  ------------------
  |  Branch (6379:6): [True: 0, False: 133k]
  ------------------
 6380|   126k|	    case XML_ENTITY_DECL:
  ------------------
  |  Branch (6380:6): [True: 0, False: 133k]
  ------------------
 6381|   126k|		if (ctxt->context->node->parent == NULL)
  ------------------
  |  Branch (6381:7): [True: 0, False: 126k]
  ------------------
 6382|      0|		    return((xmlNodePtr) ctxt->context->doc);
 6383|   126k|		if ((ctxt->context->node->parent->type == XML_ELEMENT_NODE) &&
  ------------------
  |  Branch (6383:7): [True: 121k, False: 5.22k]
  ------------------
 6384|   121k|		    ((ctxt->context->node->parent->name[0] == ' ') ||
  ------------------
  |  Branch (6384:8): [True: 0, False: 121k]
  ------------------
 6385|   121k|		     (xmlStrEqual(ctxt->context->node->parent->name,
  ------------------
  |  Branch (6385:8): [True: 0, False: 121k]
  ------------------
 6386|   121k|				 BAD_CAST "fake node libxslt"))))
  ------------------
  |  |   34|   121k|#define BAD_CAST (xmlChar *)
  ------------------
 6387|      0|		    return(NULL);
 6388|   126k|		return(ctxt->context->node->parent);
 6389|    825|            case XML_ATTRIBUTE_NODE: {
  ------------------
  |  Branch (6389:13): [True: 825, False: 132k]
  ------------------
 6390|    825|		xmlAttrPtr att = (xmlAttrPtr) ctxt->context->node;
 6391|       |
 6392|    825|		return(att->parent);
 6393|   126k|	    }
 6394|  5.71k|            case XML_DOCUMENT_NODE:
  ------------------
  |  Branch (6394:13): [True: 5.71k, False: 127k]
  ------------------
 6395|  5.71k|            case XML_DOCUMENT_TYPE_NODE:
  ------------------
  |  Branch (6395:13): [True: 0, False: 133k]
  ------------------
 6396|  5.71k|            case XML_DOCUMENT_FRAG_NODE:
  ------------------
  |  Branch (6396:13): [True: 0, False: 133k]
  ------------------
 6397|  5.71k|            case XML_HTML_DOCUMENT_NODE:
  ------------------
  |  Branch (6397:13): [True: 0, False: 133k]
  ------------------
 6398|  5.71k|                return(NULL);
 6399|     71|	    case XML_NAMESPACE_DECL: {
  ------------------
  |  Branch (6399:6): [True: 71, False: 133k]
  ------------------
 6400|     71|		xmlNsPtr ns = (xmlNsPtr) ctxt->context->node;
 6401|       |
 6402|     71|		if ((ns->next != NULL) &&
  ------------------
  |  Branch (6402:7): [True: 71, False: 0]
  ------------------
 6403|     71|		    (ns->next->type != XML_NAMESPACE_DECL))
  ------------------
  |  Branch (6403:7): [True: 71, False: 0]
  ------------------
 6404|     71|		    return((xmlNodePtr) ns->next);
 6405|      0|                return(NULL);
 6406|     71|	    }
 6407|   133k|	}
 6408|   133k|    }
 6409|   126k|    return(NULL);
 6410|   259k|}
xmlXPathNextAncestor:
 6425|   198k|xmlXPathNextAncestor(xmlXPathParserContext *ctxt, xmlNode *cur) {
 6426|   198k|    if ((ctxt == NULL) || (ctxt->context == NULL)) return(NULL);
  ------------------
  |  Branch (6426:9): [True: 0, False: 198k]
  |  Branch (6426:27): [True: 0, False: 198k]
  ------------------
 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|   198k|    if (cur == NULL) {
  ------------------
  |  Branch (6432:9): [True: 37.9k, False: 160k]
  ------------------
 6433|  37.9k|	if (ctxt->context->node == NULL) return(NULL);
  ------------------
  |  Branch (6433:6): [True: 0, False: 37.9k]
  ------------------
 6434|  37.9k|	switch (ctxt->context->node->type) {
  ------------------
  |  Branch (6434:10): [True: 37.9k, False: 0]
  ------------------
 6435|  34.1k|            case XML_ELEMENT_NODE:
  ------------------
  |  Branch (6435:13): [True: 34.1k, False: 3.74k]
  ------------------
 6436|  36.1k|            case XML_TEXT_NODE:
  ------------------
  |  Branch (6436:13): [True: 1.94k, False: 35.9k]
  ------------------
 6437|  36.2k|            case XML_CDATA_SECTION_NODE:
  ------------------
  |  Branch (6437:13): [True: 86, False: 37.8k]
  ------------------
 6438|  36.2k|            case XML_ENTITY_REF_NODE:
  ------------------
  |  Branch (6438:13): [True: 0, False: 37.9k]
  ------------------
 6439|  36.2k|            case XML_ENTITY_NODE:
  ------------------
  |  Branch (6439:13): [True: 0, False: 37.9k]
  ------------------
 6440|  36.9k|            case XML_PI_NODE:
  ------------------
  |  Branch (6440:13): [True: 732, False: 37.1k]
  ------------------
 6441|  37.1k|            case XML_COMMENT_NODE:
  ------------------
  |  Branch (6441:13): [True: 224, False: 37.6k]
  ------------------
 6442|  37.1k|	    case XML_DTD_NODE:
  ------------------
  |  Branch (6442:6): [True: 0, False: 37.9k]
  ------------------
 6443|  37.1k|	    case XML_ELEMENT_DECL:
  ------------------
  |  Branch (6443:6): [True: 0, False: 37.9k]
  ------------------
 6444|  37.1k|	    case XML_ATTRIBUTE_DECL:
  ------------------
  |  Branch (6444:6): [True: 0, False: 37.9k]
  ------------------
 6445|  37.1k|	    case XML_ENTITY_DECL:
  ------------------
  |  Branch (6445:6): [True: 0, False: 37.9k]
  ------------------
 6446|  37.1k|            case XML_NOTATION_NODE:
  ------------------
  |  Branch (6446:13): [True: 0, False: 37.9k]
  ------------------
 6447|  37.1k|	    case XML_XINCLUDE_START:
  ------------------
  |  Branch (6447:6): [True: 0, False: 37.9k]
  ------------------
 6448|  37.1k|	    case XML_XINCLUDE_END:
  ------------------
  |  Branch (6448:6): [True: 0, False: 37.9k]
  ------------------
 6449|  37.1k|		if (ctxt->context->node->parent == NULL)
  ------------------
  |  Branch (6449:7): [True: 0, False: 37.1k]
  ------------------
 6450|      0|		    return((xmlNodePtr) ctxt->context->doc);
 6451|  37.1k|		if ((ctxt->context->node->parent->type == XML_ELEMENT_NODE) &&
  ------------------
  |  Branch (6451:7): [True: 35.7k, False: 1.40k]
  ------------------
 6452|  35.7k|		    ((ctxt->context->node->parent->name[0] == ' ') ||
  ------------------
  |  Branch (6452:8): [True: 0, False: 35.7k]
  ------------------
 6453|  35.7k|		     (xmlStrEqual(ctxt->context->node->parent->name,
  ------------------
  |  Branch (6453:8): [True: 0, False: 35.7k]
  ------------------
 6454|  35.7k|				 BAD_CAST "fake node libxslt"))))
  ------------------
  |  |   34|  35.7k|#define BAD_CAST (xmlChar *)
  ------------------
 6455|      0|		    return(NULL);
 6456|  37.1k|		return(ctxt->context->node->parent);
 6457|     36|            case XML_ATTRIBUTE_NODE: {
  ------------------
  |  Branch (6457:13): [True: 36, False: 37.8k]
  ------------------
 6458|     36|		xmlAttrPtr tmp = (xmlAttrPtr) ctxt->context->node;
 6459|       |
 6460|     36|		return(tmp->parent);
 6461|  37.1k|	    }
 6462|    721|            case XML_DOCUMENT_NODE:
  ------------------
  |  Branch (6462:13): [True: 721, False: 37.1k]
  ------------------
 6463|    721|            case XML_DOCUMENT_TYPE_NODE:
  ------------------
  |  Branch (6463:13): [True: 0, False: 37.9k]
  ------------------
 6464|    721|            case XML_DOCUMENT_FRAG_NODE:
  ------------------
  |  Branch (6464:13): [True: 0, False: 37.9k]
  ------------------
 6465|    721|            case XML_HTML_DOCUMENT_NODE:
  ------------------
  |  Branch (6465:13): [True: 0, False: 37.9k]
  ------------------
 6466|    721|                return(NULL);
 6467|      0|	    case XML_NAMESPACE_DECL: {
  ------------------
  |  Branch (6467:6): [True: 0, False: 37.9k]
  ------------------
 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|  37.9k|	}
 6477|      0|	return(NULL);
 6478|  37.9k|    }
 6479|   160k|    if (cur == ctxt->context->doc->children)
  ------------------
  |  Branch (6479:9): [True: 7.56k, False: 152k]
  ------------------
 6480|  7.56k|	return((xmlNodePtr) ctxt->context->doc);
 6481|   152k|    if (cur == (xmlNodePtr) ctxt->context->doc)
  ------------------
  |  Branch (6481:9): [True: 43.7k, False: 108k]
  ------------------
 6482|  43.7k|	return(NULL);
 6483|   108k|    switch (cur->type) {
  ------------------
  |  Branch (6483:13): [True: 108k, False: 0]
  ------------------
 6484|   105k|	case XML_ELEMENT_NODE:
  ------------------
  |  Branch (6484:2): [True: 105k, False: 3.47k]
  ------------------
 6485|   108k|	case XML_TEXT_NODE:
  ------------------
  |  Branch (6485:2): [True: 2.94k, False: 105k]
  ------------------
 6486|   108k|	case XML_CDATA_SECTION_NODE:
  ------------------
  |  Branch (6486:2): [True: 257, False: 108k]
  ------------------
 6487|   108k|	case XML_ENTITY_REF_NODE:
  ------------------
  |  Branch (6487:2): [True: 0, False: 108k]
  ------------------
 6488|   108k|	case XML_ENTITY_NODE:
  ------------------
  |  Branch (6488:2): [True: 0, False: 108k]
  ------------------
 6489|   108k|	case XML_PI_NODE:
  ------------------
  |  Branch (6489:2): [True: 200, False: 108k]
  ------------------
 6490|   108k|	case XML_COMMENT_NODE:
  ------------------
  |  Branch (6490:2): [True: 28, False: 108k]
  ------------------
 6491|   108k|	case XML_NOTATION_NODE:
  ------------------
  |  Branch (6491:2): [True: 0, False: 108k]
  ------------------
 6492|   108k|	case XML_DTD_NODE:
  ------------------
  |  Branch (6492:2): [True: 0, False: 108k]
  ------------------
 6493|   108k|        case XML_ELEMENT_DECL:
  ------------------
  |  Branch (6493:9): [True: 0, False: 108k]
  ------------------
 6494|   108k|        case XML_ATTRIBUTE_DECL:
  ------------------
  |  Branch (6494:9): [True: 0, False: 108k]
  ------------------
 6495|   108k|        case XML_ENTITY_DECL:
  ------------------
  |  Branch (6495:9): [True: 0, False: 108k]
  ------------------
 6496|   108k|	case XML_XINCLUDE_START:
  ------------------
  |  Branch (6496:2): [True: 0, False: 108k]
  ------------------
 6497|   108k|	case XML_XINCLUDE_END:
  ------------------
  |  Branch (6497:2): [True: 0, False: 108k]
  ------------------
 6498|   108k|	    if (cur->parent == NULL)
  ------------------
  |  Branch (6498:10): [True: 0, False: 108k]
  ------------------
 6499|      0|		return(NULL);
 6500|   108k|	    if ((cur->parent->type == XML_ELEMENT_NODE) &&
  ------------------
  |  Branch (6500:10): [True: 74.1k, False: 34.6k]
  ------------------
 6501|  74.1k|		((cur->parent->name[0] == ' ') ||
  ------------------
  |  Branch (6501:4): [True: 0, False: 74.1k]
  ------------------
 6502|  74.1k|		 (xmlStrEqual(cur->parent->name,
  ------------------
  |  Branch (6502:4): [True: 0, False: 74.1k]
  ------------------
 6503|  74.1k|			      BAD_CAST "fake node libxslt"))))
  ------------------
  |  |   34|  74.1k|#define BAD_CAST (xmlChar *)
  ------------------
 6504|      0|		return(NULL);
 6505|   108k|	    return(cur->parent);
 6506|     42|	case XML_ATTRIBUTE_NODE: {
  ------------------
  |  Branch (6506:2): [True: 42, False: 108k]
  ------------------
 6507|     42|	    xmlAttrPtr att = (xmlAttrPtr) cur;
 6508|       |
 6509|     42|	    return(att->parent);
 6510|   108k|	}
 6511|      0|	case XML_NAMESPACE_DECL: {
  ------------------
  |  Branch (6511:2): [True: 0, False: 108k]
  ------------------
 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: 108k]
  ------------------
 6521|      0|	case XML_DOCUMENT_TYPE_NODE:
  ------------------
  |  Branch (6521:2): [True: 0, False: 108k]
  ------------------
 6522|      0|	case XML_DOCUMENT_FRAG_NODE:
  ------------------
  |  Branch (6522:2): [True: 0, False: 108k]
  ------------------
 6523|      0|	case XML_HTML_DOCUMENT_NODE:
  ------------------
  |  Branch (6523:2): [True: 0, False: 108k]
  ------------------
 6524|      0|	    return(NULL);
 6525|   108k|    }
 6526|      0|    return(NULL);
 6527|   108k|}
xmlXPathNextAncestorOrSelf:
 6541|  37.8k|xmlXPathNextAncestorOrSelf(xmlXPathParserContext *ctxt, xmlNode *cur) {
 6542|  37.8k|    if ((ctxt == NULL) || (ctxt->context == NULL)) return(NULL);
  ------------------
  |  Branch (6542:9): [True: 0, False: 37.8k]
  |  Branch (6542:27): [True: 0, False: 37.8k]
  ------------------
 6543|  37.8k|    if (cur == NULL)
  ------------------
  |  Branch (6543:9): [True: 6.53k, False: 31.2k]
  ------------------
 6544|  6.53k|        return(ctxt->context->node);
 6545|  31.2k|    return(xmlXPathNextAncestor(ctxt, cur));
 6546|  37.8k|}
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|  44.9k|xmlXPathNextFollowing(xmlXPathParserContext *ctxt, xmlNode *cur) {
 6623|  44.9k|    if ((ctxt == NULL) || (ctxt->context == NULL)) return(NULL);
  ------------------
  |  Branch (6623:9): [True: 0, False: 44.9k]
  |  Branch (6623:27): [True: 0, False: 44.9k]
  ------------------
 6624|  44.9k|    if ((cur != NULL) && (cur->type  != XML_ATTRIBUTE_NODE) &&
  ------------------
  |  Branch (6624:9): [True: 42.6k, False: 2.33k]
  |  Branch (6624:26): [True: 42.6k, False: 0]
  ------------------
 6625|  42.6k|        (cur->type != XML_NAMESPACE_DECL) && (cur->children != NULL))
  ------------------
  |  Branch (6625:9): [True: 42.6k, False: 0]
  |  Branch (6625:46): [True: 3.67k, False: 38.9k]
  ------------------
 6626|  3.67k|        return(cur->children);
 6627|       |
 6628|  41.3k|    if (cur == NULL) {
  ------------------
  |  Branch (6628:9): [True: 2.33k, False: 38.9k]
  ------------------
 6629|  2.33k|        cur = ctxt->context->node;
 6630|  2.33k|        if (cur->type == XML_ATTRIBUTE_NODE) {
  ------------------
  |  Branch (6630:13): [True: 37, False: 2.29k]
  ------------------
 6631|     37|            cur = cur->parent;
 6632|  2.29k|        } else if (cur->type == XML_NAMESPACE_DECL) {
  ------------------
  |  Branch (6632:20): [True: 0, False: 2.29k]
  ------------------
 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|  2.33k|    }
 6641|       |
 6642|       |    /* ERROR */
 6643|  41.3k|    if (cur == NULL)
  ------------------
  |  Branch (6643:9): [True: 0, False: 41.3k]
  ------------------
 6644|      0|        return(NULL);
 6645|       |
 6646|  41.3k|    if (cur->type == XML_DOCUMENT_NODE)
  ------------------
  |  Branch (6646:9): [True: 267, False: 41.0k]
  ------------------
 6647|    267|        return(NULL);
 6648|       |
 6649|  41.0k|    if (cur->next != NULL)
  ------------------
  |  Branch (6649:9): [True: 35.3k, False: 5.74k]
  ------------------
 6650|  35.3k|        return(cur->next);
 6651|       |
 6652|  7.71k|    do {
 6653|  7.71k|        cur = cur->parent;
 6654|  7.71k|        if (cur == NULL)
  ------------------
  |  Branch (6654:13): [True: 0, False: 7.71k]
  ------------------
 6655|      0|            break;
 6656|  7.71k|        if (cur == (xmlNodePtr) ctxt->context->doc)
  ------------------
  |  Branch (6656:13): [True: 2.06k, False: 5.64k]
  ------------------
 6657|  2.06k|            return(NULL);
 6658|  5.64k|        if (cur->next != NULL && cur->type != XML_DOCUMENT_NODE)
  ------------------
  |  Branch (6658:13): [True: 3.67k, False: 1.97k]
  |  Branch (6658:34): [True: 3.67k, False: 0]
  ------------------
 6659|  3.67k|            return(cur->next);
 6660|  5.64k|    } while (cur != NULL);
  ------------------
  |  Branch (6660:14): [True: 1.97k, False: 0]
  ------------------
 6661|       |
 6662|      0|    return(cur);
 6663|  5.74k|}
xmlXPathNextNamespace:
 6814|   115k|xmlXPathNextNamespace(xmlXPathParserContext *ctxt, xmlNode *cur) {
 6815|   115k|    if ((ctxt == NULL) || (ctxt->context == NULL)) return(NULL);
  ------------------
  |  Branch (6815:9): [True: 0, False: 115k]
  |  Branch (6815:27): [True: 0, False: 115k]
  ------------------
 6816|   115k|    if (ctxt->context->node->type != XML_ELEMENT_NODE) return(NULL);
  ------------------
  |  Branch (6816:9): [True: 5.81k, False: 109k]
  ------------------
 6817|   109k|    if (cur == NULL) {
  ------------------
  |  Branch (6817:9): [True: 31.5k, False: 78.1k]
  ------------------
 6818|  31.5k|        if (ctxt->context->tmpNsList != NULL)
  ------------------
  |  Branch (6818:13): [True: 2.83k, False: 28.7k]
  ------------------
 6819|  2.83k|	    xmlFree(ctxt->context->tmpNsList);
 6820|  31.5k|	ctxt->context->tmpNsNr = 0;
 6821|  31.5k|        if (xmlGetNsListSafe(ctxt->context->doc, ctxt->context->node,
  ------------------
  |  Branch (6821:13): [True: 9, False: 31.5k]
  ------------------
 6822|  31.5k|                             &ctxt->context->tmpNsList) < 0) {
 6823|      9|            xmlXPathPErrMemory(ctxt);
 6824|      9|            return(NULL);
 6825|      9|        }
 6826|  31.5k|        if (ctxt->context->tmpNsList != NULL) {
  ------------------
  |  Branch (6826:13): [True: 30.9k, False: 546]
  ------------------
 6827|  83.3k|            while (ctxt->context->tmpNsList[ctxt->context->tmpNsNr] != NULL) {
  ------------------
  |  Branch (6827:20): [True: 52.3k, False: 30.9k]
  ------------------
 6828|  52.3k|                ctxt->context->tmpNsNr++;
 6829|  52.3k|            }
 6830|  30.9k|        }
 6831|  31.5k|	return((xmlNodePtr) xmlXPathXMLNamespace);
 6832|  31.5k|    }
 6833|  78.1k|    if (ctxt->context->tmpNsNr > 0) {
  ------------------
  |  Branch (6833:9): [True: 49.7k, False: 28.4k]
  ------------------
 6834|  49.7k|	return (xmlNodePtr)ctxt->context->tmpNsList[--ctxt->context->tmpNsNr];
 6835|  49.7k|    } else {
 6836|  28.4k|	if (ctxt->context->tmpNsList != NULL)
  ------------------
  |  Branch (6836:6): [True: 27.9k, False: 472]
  ------------------
 6837|  27.9k|	    xmlFree(ctxt->context->tmpNsList);
 6838|  28.4k|	ctxt->context->tmpNsList = NULL;
 6839|       |	return(NULL);
 6840|  28.4k|    }
 6841|  78.1k|}
xmlXPathNextAttribute:
 6852|   242k|xmlXPathNextAttribute(xmlXPathParserContext *ctxt, xmlNode *cur) {
 6853|   242k|    if ((ctxt == NULL) || (ctxt->context == NULL)) return(NULL);
  ------------------
  |  Branch (6853:9): [True: 0, False: 242k]
  |  Branch (6853:27): [True: 0, False: 242k]
  ------------------
 6854|   242k|    if (ctxt->context->node == NULL)
  ------------------
  |  Branch (6854:9): [True: 0, False: 242k]
  ------------------
 6855|      0|	return(NULL);
 6856|   242k|    if (ctxt->context->node->type != XML_ELEMENT_NODE)
  ------------------
  |  Branch (6856:9): [True: 41.8k, False: 200k]
  ------------------
 6857|  41.8k|	return(NULL);
 6858|   200k|    if (cur == NULL) {
  ------------------
  |  Branch (6858:9): [True: 190k, False: 10.1k]
  ------------------
 6859|   190k|        if (ctxt->context->node == (xmlNodePtr) ctxt->context->doc)
  ------------------
  |  Branch (6859:13): [True: 0, False: 190k]
  ------------------
 6860|      0|	    return(NULL);
 6861|   190k|        return((xmlNodePtr)ctxt->context->node->properties);
 6862|   190k|    }
 6863|  10.1k|    return((xmlNodePtr)cur->next);
 6864|   200k|}
xmlXPathRoot:
 6887|   372k|xmlXPathRoot(xmlXPathParserContext *ctxt) {
 6888|   372k|    if ((ctxt == NULL) || (ctxt->context == NULL))
  ------------------
  |  Branch (6888:9): [True: 0, False: 372k]
  |  Branch (6888:27): [True: 0, False: 372k]
  ------------------
 6889|      0|	return;
 6890|   372k|    xmlXPathValuePush(ctxt, xmlXPathCacheNewNodeSet(ctxt,
 6891|   372k|                                            (xmlNodePtr) ctxt->context->doc));
 6892|   372k|}
xmlXPathLastFunction:
 6911|    488|xmlXPathLastFunction(xmlXPathParserContext *ctxt, int nargs) {
 6912|  1.46k|    CHECK_ARITY(0);
  ------------------
  |  |  280|    488|    if (ctxt == NULL) return;						\
  |  |  ------------------
  |  |  |  Branch (280:9): [True: 0, False: 488]
  |  |  ------------------
  |  |  281|    488|    if (nargs != (x))							\
  |  |  ------------------
  |  |  |  Branch (281:9): [True: 1, False: 487]
  |  |  ------------------
  |  |  282|    488|        XP_ERROR(XPATH_INVALID_ARITY);					\
  |  |  ------------------
  |  |  |  |  244|      1|    { xmlXPathErr(ctxt, X); return; }
  |  |  ------------------
  |  |  283|    487|    if (ctxt->valueNr < (x))						\
  |  |  ------------------
  |  |  |  Branch (283:9): [True: 0, False: 487]
  |  |  ------------------
  |  |  284|    487|        XP_ERROR(XPATH_STACK_ERROR);
  |  |  ------------------
  |  |  |  |  244|      0|    { xmlXPathErr(ctxt, X); return; }
  |  |  ------------------
  ------------------
 6913|  1.46k|    if (ctxt->context->contextSize >= 0) {
  ------------------
  |  Branch (6913:9): [True: 487, False: 0]
  ------------------
 6914|    487|	xmlXPathValuePush(ctxt,
 6915|    487|	    xmlXPathCacheNewFloat(ctxt, (double) ctxt->context->contextSize));
 6916|    487|    } else {
 6917|      0|	XP_ERROR(XPATH_INVALID_CTXT_SIZE);
  ------------------
  |  |  244|      0|    { xmlXPathErr(ctxt, X); return; }
  ------------------
 6918|      0|    }
 6919|  1.46k|}
xmlXPathPositionFunction:
 6932|    111|xmlXPathPositionFunction(xmlXPathParserContext *ctxt, int nargs) {
 6933|    331|    CHECK_ARITY(0);
  ------------------
  |  |  280|    111|    if (ctxt == NULL) return;						\
  |  |  ------------------
  |  |  |  Branch (280:9): [True: 0, False: 111]
  |  |  ------------------
  |  |  281|    111|    if (nargs != (x))							\
  |  |  ------------------
  |  |  |  Branch (281:9): [True: 1, False: 110]
  |  |  ------------------
  |  |  282|    111|        XP_ERROR(XPATH_INVALID_ARITY);					\
  |  |  ------------------
  |  |  |  |  244|      1|    { xmlXPathErr(ctxt, X); return; }
  |  |  ------------------
  |  |  283|    110|    if (ctxt->valueNr < (x))						\
  |  |  ------------------
  |  |  |  Branch (283:9): [True: 0, False: 110]
  |  |  ------------------
  |  |  284|    110|        XP_ERROR(XPATH_STACK_ERROR);
  |  |  ------------------
  |  |  |  |  244|      0|    { xmlXPathErr(ctxt, X); return; }
  |  |  ------------------
  ------------------
 6934|    331|    if (ctxt->context->proximityPosition >= 0) {
  ------------------
  |  Branch (6934:9): [True: 110, False: 0]
  ------------------
 6935|    110|	xmlXPathValuePush(ctxt, xmlXPathCacheNewFloat(ctxt,
 6936|    110|            (double) ctxt->context->proximityPosition));
 6937|    110|    } else {
 6938|      0|	XP_ERROR(XPATH_INVALID_CTXT_POSITION);
  ------------------
  |  |  244|      0|    { xmlXPathErr(ctxt, X); return; }
  ------------------
 6939|      0|    }
 6940|    331|}
xmlXPathCountFunction:
 6950|     62|xmlXPathCountFunction(xmlXPathParserContext *ctxt, int nargs) {
 6951|     62|    xmlXPathObjectPtr cur;
 6952|       |
 6953|    176|    CHECK_ARITY(1);
  ------------------
  |  |  280|     62|    if (ctxt == NULL) return;						\
  |  |  ------------------
  |  |  |  Branch (280:9): [True: 0, False: 62]
  |  |  ------------------
  |  |  281|     62|    if (nargs != (x))							\
  |  |  ------------------
  |  |  |  Branch (281:9): [True: 5, False: 57]
  |  |  ------------------
  |  |  282|     62|        XP_ERROR(XPATH_INVALID_ARITY);					\
  |  |  ------------------
  |  |  |  |  244|      5|    { xmlXPathErr(ctxt, X); return; }
  |  |  ------------------
  |  |  283|     57|    if (ctxt->valueNr < (x))						\
  |  |  ------------------
  |  |  |  Branch (283:9): [True: 0, False: 57]
  |  |  ------------------
  |  |  284|     57|        XP_ERROR(XPATH_STACK_ERROR);
  |  |  ------------------
  |  |  |  |  244|      0|    { xmlXPathErr(ctxt, X); return; }
  |  |  ------------------
  ------------------
 6954|    176|    if ((ctxt->value == NULL) ||
  ------------------
  |  Branch (6954:9): [True: 0, False: 57]
  ------------------
 6955|     57|	((ctxt->value->type != XPATH_NODESET) &&
  ------------------
  |  Branch (6955:3): [True: 3, False: 54]
  ------------------
 6956|      3|	 (ctxt->value->type != XPATH_XSLT_TREE)))
  ------------------
  |  Branch (6956:3): [True: 3, False: 0]
  ------------------
 6957|     54|	XP_ERROR(XPATH_INVALID_TYPE);
  ------------------
  |  |  244|      3|    { xmlXPathErr(ctxt, X); return; }
  ------------------
 6958|     54|    cur = xmlXPathValuePop(ctxt);
 6959|       |
 6960|     54|    if ((cur == NULL) || (cur->nodesetval == NULL))
  ------------------
  |  Branch (6960:9): [True: 0, False: 54]
  |  Branch (6960:26): [True: 0, False: 54]
  ------------------
 6961|      0|	xmlXPathValuePush(ctxt, xmlXPathCacheNewFloat(ctxt, 0.0));
 6962|     54|    else
 6963|     54|	xmlXPathValuePush(ctxt, xmlXPathCacheNewFloat(ctxt,
 6964|     54|	    (double) cur->nodesetval->nodeNr));
 6965|     54|    xmlXPathReleaseObject(ctxt->context, cur);
 6966|     54|}
xmlXPathIdFunction:
 7047|  8.33k|xmlXPathIdFunction(xmlXPathParserContext *ctxt, int nargs) {
 7048|  8.33k|    xmlChar *tokens;
 7049|  8.33k|    xmlNodeSetPtr ret;
 7050|  8.33k|    xmlXPathObjectPtr obj;
 7051|       |
 7052|  24.9k|    CHECK_ARITY(1);
  ------------------
  |  |  280|  8.33k|    if (ctxt == NULL) return;						\
  |  |  ------------------
  |  |  |  Branch (280:9): [True: 0, False: 8.33k]
  |  |  ------------------
  |  |  281|  8.33k|    if (nargs != (x))							\
  |  |  ------------------
  |  |  |  Branch (281:9): [True: 3, False: 8.33k]
  |  |  ------------------
  |  |  282|  8.33k|        XP_ERROR(XPATH_INVALID_ARITY);					\
  |  |  ------------------
  |  |  |  |  244|      3|    { xmlXPathErr(ctxt, X); return; }
  |  |  ------------------
  |  |  283|  8.33k|    if (ctxt->valueNr < (x))						\
  |  |  ------------------
  |  |  |  Branch (283:9): [True: 6, False: 8.32k]
  |  |  ------------------
  |  |  284|  8.33k|        XP_ERROR(XPATH_STACK_ERROR);
  |  |  ------------------
  |  |  |  |  244|      6|    { xmlXPathErr(ctxt, X); return; }
  |  |  ------------------
  ------------------
 7053|  24.9k|    obj = xmlXPathValuePop(ctxt);
 7054|  24.9k|    if (obj == NULL) XP_ERROR(XPATH_INVALID_OPERAND);
  ------------------
  |  |  244|      0|    { xmlXPathErr(ctxt, X); return; }
  ------------------
  |  Branch (7054:9): [True: 0, False: 8.32k]
  ------------------
 7055|  8.32k|    if ((obj->type == XPATH_NODESET) || (obj->type == XPATH_XSLT_TREE)) {
  ------------------
  |  Branch (7055:9): [True: 1.97k, False: 6.35k]
  |  Branch (7055:41): [True: 0, False: 6.35k]
  ------------------
 7056|  1.97k|	xmlNodeSetPtr ns;
 7057|  1.97k|	int i;
 7058|       |
 7059|  1.97k|	ret = xmlXPathNodeSetCreate(NULL);
 7060|  1.97k|        if (ret == NULL)
  ------------------
  |  Branch (7060:13): [True: 2, False: 1.97k]
  ------------------
 7061|      2|            xmlXPathPErrMemory(ctxt);
 7062|       |
 7063|  1.97k|	if (obj->nodesetval != NULL) {
  ------------------
  |  Branch (7063:6): [True: 1.97k, False: 0]
  ------------------
 7064|  5.13k|	    for (i = 0; i < obj->nodesetval->nodeNr; i++) {
  ------------------
  |  Branch (7064:18): [True: 3.16k, False: 1.97k]
  ------------------
 7065|  3.16k|		tokens =
 7066|  3.16k|		    xmlXPathCastNodeToString(obj->nodesetval->nodeTab[i]);
 7067|  3.16k|                if (tokens == NULL)
  ------------------
  |  Branch (7067:21): [True: 12, False: 3.15k]
  ------------------
 7068|     12|                    xmlXPathPErrMemory(ctxt);
 7069|  3.16k|		ns = xmlXPathGetElementsByIds(ctxt->context->doc, tokens);
 7070|  3.16k|                if (ns == NULL)
  ------------------
  |  Branch (7070:21): [True: 27, False: 3.13k]
  ------------------
 7071|     27|                    xmlXPathPErrMemory(ctxt);
 7072|  3.16k|		ret = xmlXPathNodeSetMerge(ret, ns);
 7073|  3.16k|                if (ret == NULL)
  ------------------
  |  Branch (7073:21): [True: 1, False: 3.16k]
  ------------------
 7074|      1|                    xmlXPathPErrMemory(ctxt);
 7075|  3.16k|		xmlXPathFreeNodeSet(ns);
 7076|  3.16k|		if (tokens != NULL)
  ------------------
  |  Branch (7076:7): [True: 3.15k, False: 12]
  ------------------
 7077|  3.15k|		    xmlFree(tokens);
 7078|  3.16k|	    }
 7079|  1.97k|	}
 7080|  1.97k|	xmlXPathReleaseObject(ctxt->context, obj);
 7081|  1.97k|	xmlXPathValuePush(ctxt, xmlXPathCacheWrapNodeSet(ctxt, ret));
 7082|  1.97k|	return;
 7083|  1.97k|    }
 7084|  6.35k|    tokens = xmlXPathCastToString(obj);
 7085|  6.35k|    if (tokens == NULL)
  ------------------
  |  Branch (7085:9): [True: 8, False: 6.34k]
  ------------------
 7086|      8|        xmlXPathPErrMemory(ctxt);
 7087|  6.35k|    xmlXPathReleaseObject(ctxt->context, obj);
 7088|  6.35k|    ret = xmlXPathGetElementsByIds(ctxt->context->doc, tokens);
 7089|  6.35k|    if (ret == NULL)
  ------------------
  |  Branch (7089:9): [True: 22, False: 6.33k]
  ------------------
 7090|     22|        xmlXPathPErrMemory(ctxt);
 7091|  6.35k|    xmlFree(tokens);
 7092|  6.35k|    xmlXPathValuePush(ctxt, xmlXPathCacheWrapNodeSet(ctxt, ret));
 7093|  6.35k|}
xmlXPathLocalNameFunction:
 7108|  2.37k|xmlXPathLocalNameFunction(xmlXPathParserContext *ctxt, int nargs) {
 7109|  2.37k|    xmlXPathObjectPtr cur;
 7110|       |
 7111|  2.37k|    if (ctxt == NULL) return;
  ------------------
  |  Branch (7111:9): [True: 0, False: 2.37k]
  ------------------
 7112|       |
 7113|  2.37k|    if (nargs == 0) {
  ------------------
  |  Branch (7113:9): [True: 0, False: 2.37k]
  ------------------
 7114|      0|	xmlXPathValuePush(ctxt, xmlXPathCacheNewNodeSet(ctxt, ctxt->context->node));
 7115|      0|	nargs = 1;
 7116|      0|    }
 7117|       |
 7118|  7.12k|    CHECK_ARITY(1);
  ------------------
  |  |  280|  2.37k|    if (ctxt == NULL) return;						\
  |  |  ------------------
  |  |  |  Branch (280:9): [True: 0, False: 2.37k]
  |  |  ------------------
  |  |  281|  2.37k|    if (nargs != (x))							\
  |  |  ------------------
  |  |  |  Branch (281:9): [True: 0, False: 2.37k]
  |  |  ------------------
  |  |  282|  2.37k|        XP_ERROR(XPATH_INVALID_ARITY);					\
  |  |  ------------------
  |  |  |  |  244|      0|    { xmlXPathErr(ctxt, X); return; }
  |  |  ------------------
  |  |  283|  2.37k|    if (ctxt->valueNr < (x))						\
  |  |  ------------------
  |  |  |  Branch (283:9): [True: 1, False: 2.37k]
  |  |  ------------------
  |  |  284|  2.37k|        XP_ERROR(XPATH_STACK_ERROR);
  |  |  ------------------
  |  |  |  |  244|      1|    { xmlXPathErr(ctxt, X); return; }
  |  |  ------------------
  ------------------
 7119|  7.12k|    if ((ctxt->value == NULL) ||
  ------------------
  |  Branch (7119:9): [True: 0, False: 2.37k]
  ------------------
 7120|  2.37k|	((ctxt->value->type != XPATH_NODESET) &&
  ------------------
  |  Branch (7120:3): [True: 1, False: 2.37k]
  ------------------
 7121|      1|	 (ctxt->value->type != XPATH_XSLT_TREE)))
  ------------------
  |  Branch (7121:3): [True: 1, False: 0]
  ------------------
 7122|  2.37k|	XP_ERROR(XPATH_INVALID_TYPE);
  ------------------
  |  |  244|      1|    { xmlXPathErr(ctxt, X); return; }
  ------------------
 7123|  2.37k|    cur = xmlXPathValuePop(ctxt);
 7124|       |
 7125|  2.37k|    if ((cur->nodesetval == NULL) || (cur->nodesetval->nodeNr == 0)) {
  ------------------
  |  Branch (7125:9): [True: 0, False: 2.37k]
  |  Branch (7125:38): [True: 1, False: 2.37k]
  ------------------
 7126|      1|	xmlXPathValuePush(ctxt, xmlXPathCacheNewCString(ctxt, ""));
 7127|  2.37k|    } else {
 7128|  2.37k|	int i = 0; /* Should be first in document order !!!!! */
 7129|  2.37k|	switch (cur->nodesetval->nodeTab[i]->type) {
 7130|      1|	case XML_ELEMENT_NODE:
  ------------------
  |  Branch (7130:2): [True: 1, False: 2.37k]
  ------------------
 7131|      1|	case XML_ATTRIBUTE_NODE:
  ------------------
  |  Branch (7131:2): [True: 0, False: 2.37k]
  ------------------
 7132|      1|	case XML_PI_NODE:
  ------------------
  |  Branch (7132:2): [True: 0, False: 2.37k]
  ------------------
 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: 2.37k]
  ------------------
 7140|      0|	    xmlXPathValuePush(ctxt, xmlXPathCacheNewString(ctxt,
 7141|      0|			((xmlNsPtr)cur->nodesetval->nodeTab[i])->prefix));
 7142|      0|	    break;
 7143|  2.37k|	default:
  ------------------
  |  Branch (7143:2): [True: 2.37k, False: 1]
  ------------------
 7144|  2.37k|	    xmlXPathValuePush(ctxt, xmlXPathCacheNewCString(ctxt, ""));
 7145|  2.37k|	}
 7146|  2.37k|    }
 7147|  2.37k|    xmlXPathReleaseObject(ctxt->context, cur);
 7148|  2.37k|}
xmlXPathStringFunction:
 7312|  33.4k|xmlXPathStringFunction(xmlXPathParserContext *ctxt, int nargs) {
 7313|  33.4k|    xmlXPathObjectPtr cur;
 7314|  33.4k|    xmlChar *stringval;
 7315|       |
 7316|  33.4k|    if (ctxt == NULL) return;
  ------------------
  |  Branch (7316:9): [True: 0, False: 33.4k]
  ------------------
 7317|  33.4k|    if (nargs == 0) {
  ------------------
  |  Branch (7317:9): [True: 24, False: 33.4k]
  ------------------
 7318|     24|        stringval = xmlXPathCastNodeToString(ctxt->context->node);
 7319|     24|        if (stringval == NULL)
  ------------------
  |  Branch (7319:13): [True: 1, False: 23]
  ------------------
 7320|      1|            xmlXPathPErrMemory(ctxt);
 7321|     24|        xmlXPathValuePush(ctxt, xmlXPathCacheWrapString(ctxt, stringval));
 7322|     24|	return;
 7323|     24|    }
 7324|       |
 7325|   133k|    CHECK_ARITY(1);
  ------------------
  |  |  280|  33.4k|    if (ctxt == NULL) return;						\
  |  |  ------------------
  |  |  |  Branch (280:9): [True: 0, False: 33.4k]
  |  |  ------------------
  |  |  281|  33.4k|    if (nargs != (x))							\
  |  |  ------------------
  |  |  |  Branch (281:9): [True: 6, False: 33.4k]
  |  |  ------------------
  |  |  282|  33.4k|        XP_ERROR(XPATH_INVALID_ARITY);					\
  |  |  ------------------
  |  |  |  |  244|      6|    { xmlXPathErr(ctxt, X); return; }
  |  |  ------------------
  |  |  283|  33.4k|    if (ctxt->valueNr < (x))						\
  |  |  ------------------
  |  |  |  Branch (283:9): [True: 0, False: 33.4k]
  |  |  ------------------
  |  |  284|  33.4k|        XP_ERROR(XPATH_STACK_ERROR);
  |  |  ------------------
  |  |  |  |  244|      0|    { xmlXPathErr(ctxt, X); return; }
  |  |  ------------------
  ------------------
 7326|   133k|    cur = xmlXPathValuePop(ctxt);
 7327|   133k|    if (cur == NULL) XP_ERROR(XPATH_INVALID_OPERAND);
  ------------------
  |  |  244|      0|    { xmlXPathErr(ctxt, X); return; }
  ------------------
  |  Branch (7327:9): [True: 0, False: 33.4k]
  ------------------
 7328|  33.4k|    if (cur->type != XPATH_STRING) {
  ------------------
  |  Branch (7328:9): [True: 33.4k, False: 13]
  ------------------
 7329|  33.4k|        stringval = xmlXPathCastToString(cur);
 7330|  33.4k|        if (stringval == NULL)
  ------------------
  |  Branch (7330:13): [True: 19, False: 33.4k]
  ------------------
 7331|     19|            xmlXPathPErrMemory(ctxt);
 7332|  33.4k|        xmlXPathReleaseObject(ctxt->context, cur);
 7333|  33.4k|        cur = xmlXPathCacheWrapString(ctxt, stringval);
 7334|  33.4k|    }
 7335|  33.4k|    xmlXPathValuePush(ctxt, cur);
 7336|  33.4k|}
xmlXPathStringLengthFunction:
 7350|    120|xmlXPathStringLengthFunction(xmlXPathParserContext *ctxt, int nargs) {
 7351|    120|    xmlXPathObjectPtr cur;
 7352|       |
 7353|    120|    if (nargs == 0) {
  ------------------
  |  Branch (7353:9): [True: 16, False: 104]
  ------------------
 7354|     16|        if ((ctxt == NULL) || (ctxt->context == NULL))
  ------------------
  |  Branch (7354:13): [True: 0, False: 16]
  |  Branch (7354:31): [True: 0, False: 16]
  ------------------
 7355|      0|	    return;
 7356|     16|	if (ctxt->context->node == NULL) {
  ------------------
  |  Branch (7356:6): [True: 0, False: 16]
  ------------------
 7357|      0|	    xmlXPathValuePush(ctxt, xmlXPathCacheNewFloat(ctxt, 0));
 7358|     16|	} else {
 7359|     16|	    xmlChar *content;
 7360|       |
 7361|     16|	    content = xmlXPathCastNodeToString(ctxt->context->node);
 7362|     16|            if (content == NULL)
  ------------------
  |  Branch (7362:17): [True: 1, False: 15]
  ------------------
 7363|      1|                xmlXPathPErrMemory(ctxt);
 7364|     16|	    xmlXPathValuePush(ctxt, xmlXPathCacheNewFloat(ctxt,
 7365|     16|		xmlUTF8Strlen(content)));
 7366|     16|	    xmlFree(content);
 7367|     16|	}
 7368|     16|	return;
 7369|     16|    }
 7370|    410|    CHECK_ARITY(1);
  ------------------
  |  |  280|    104|    if (ctxt == NULL) return;						\
  |  |  ------------------
  |  |  |  Branch (280:9): [True: 0, False: 104]
  |  |  ------------------
  |  |  281|    104|    if (nargs != (x))							\
  |  |  ------------------
  |  |  |  Branch (281:9): [True: 3, False: 101]
  |  |  ------------------
  |  |  282|    104|        XP_ERROR(XPATH_INVALID_ARITY);					\
  |  |  ------------------
  |  |  |  |  244|      3|    { xmlXPathErr(ctxt, X); return; }
  |  |  ------------------
  |  |  283|    101|    if (ctxt->valueNr < (x))						\
  |  |  ------------------
  |  |  |  Branch (283:9): [True: 0, False: 101]
  |  |  ------------------
  |  |  284|    101|        XP_ERROR(XPATH_STACK_ERROR);
  |  |  ------------------
  |  |  |  |  244|      0|    { xmlXPathErr(ctxt, X); return; }
  |  |  ------------------
  ------------------
 7371|    410|    CAST_TO_STRING;
  ------------------
  |  |  290|    101|    if ((ctxt->value != NULL) && (ctxt->value->type != XPATH_STRING))	\
  |  |  ------------------
  |  |  |  Branch (290:9): [True: 101, False: 0]
  |  |  |  Branch (290:34): [True: 91, False: 10]
  |  |  ------------------
  |  |  291|    101|        xmlXPathStringFunction(ctxt, 1);
  ------------------
 7372|    410|    CHECK_TYPE(XPATH_STRING);
  ------------------
  |  |  261|    101|    if ((ctxt->value == NULL) || (ctxt->value->type != typeval))	\
  |  |  ------------------
  |  |  |  Branch (261:9): [True: 1, False: 100]
  |  |  |  Branch (261:34): [True: 0, False: 100]
  |  |  ------------------
  |  |  262|    101|        XP_ERROR(XPATH_INVALID_TYPE)
  |  |  ------------------
  |  |  |  |  244|      1|    { xmlXPathErr(ctxt, X); return; }
  |  |  ------------------
  ------------------
 7373|    100|    cur = xmlXPathValuePop(ctxt);
 7374|    100|    xmlXPathValuePush(ctxt, xmlXPathCacheNewFloat(ctxt,
 7375|    100|	xmlUTF8Strlen(cur->stringval)));
 7376|    100|    xmlXPathReleaseObject(ctxt->context, cur);
 7377|    100|}
xmlXPathConcatFunction:
 7388|    437|xmlXPathConcatFunction(xmlXPathParserContext *ctxt, int nargs) {
 7389|    437|    xmlXPathObjectPtr cur, newobj;
 7390|    437|    xmlChar *tmp;
 7391|       |
 7392|    437|    if (ctxt == NULL) return;
  ------------------
  |  Branch (7392:9): [True: 0, False: 437]
  ------------------
 7393|    437|    if (nargs < 2) {
  ------------------
  |  Branch (7393:9): [True: 3, False: 434]
  ------------------
 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|    434|    CAST_TO_STRING;
  ------------------
  |  |  290|    434|    if ((ctxt->value != NULL) && (ctxt->value->type != XPATH_STRING))	\
  |  |  ------------------
  |  |  |  Branch (290:9): [True: 434, False: 0]
  |  |  |  Branch (290:34): [True: 393, False: 41]
  |  |  ------------------
  |  |  291|    434|        xmlXPathStringFunction(ctxt, 1);
  ------------------
 7398|    434|    cur = xmlXPathValuePop(ctxt);
 7399|    434|    if ((cur == NULL) || (cur->type != XPATH_STRING)) {
  ------------------
  |  Branch (7399:9): [True: 0, False: 434]
  |  Branch (7399:26): [True: 2, False: 432]
  ------------------
 7400|      2|	xmlXPathReleaseObject(ctxt->context, cur);
 7401|      2|	return;
 7402|      2|    }
 7403|    432|    nargs--;
 7404|       |
 7405|  1.75k|    while (nargs > 0) {
  ------------------
  |  Branch (7405:12): [True: 1.32k, False: 429]
  ------------------
 7406|  1.32k|	CAST_TO_STRING;
  ------------------
  |  |  290|  1.32k|    if ((ctxt->value != NULL) && (ctxt->value->type != XPATH_STRING))	\
  |  |  ------------------
  |  |  |  Branch (290:9): [True: 1.32k, False: 0]
  |  |  |  Branch (290:34): [True: 1.31k, False: 10]
  |  |  ------------------
  |  |  291|  1.32k|        xmlXPathStringFunction(ctxt, 1);
  ------------------
 7407|  1.32k|	newobj = xmlXPathValuePop(ctxt);
 7408|  1.32k|	if ((newobj == NULL) || (newobj->type != XPATH_STRING)) {
  ------------------
  |  Branch (7408:6): [True: 1, False: 1.32k]
  |  Branch (7408:26): [True: 2, False: 1.32k]
  ------------------
 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.32k|	tmp = xmlStrcat(newobj->stringval, cur->stringval);
 7414|  1.32k|        if (tmp == NULL)
  ------------------
  |  Branch (7414:13): [True: 2, False: 1.32k]
  ------------------
 7415|      2|            xmlXPathPErrMemory(ctxt);
 7416|  1.32k|	newobj->stringval = cur->stringval;
 7417|  1.32k|	cur->stringval = tmp;
 7418|  1.32k|	xmlXPathReleaseObject(ctxt->context, newobj);
 7419|  1.32k|	nargs--;
 7420|  1.32k|    }
 7421|    429|    xmlXPathValuePush(ctxt, cur);
 7422|    429|}
xmlXPathStartsWithFunction:
 7467|    102|xmlXPathStartsWithFunction(xmlXPathParserContext *ctxt, int nargs) {
 7468|    102|    xmlXPathObjectPtr hay, needle;
 7469|    102|    int n;
 7470|       |
 7471|    298|    CHECK_ARITY(2);
  ------------------
  |  |  280|    102|    if (ctxt == NULL) return;						\
  |  |  ------------------
  |  |  |  Branch (280:9): [True: 0, False: 102]
  |  |  ------------------
  |  |  281|    102|    if (nargs != (x))							\
  |  |  ------------------
  |  |  |  Branch (281:9): [True: 4, False: 98]
  |  |  ------------------
  |  |  282|    102|        XP_ERROR(XPATH_INVALID_ARITY);					\
  |  |  ------------------
  |  |  |  |  244|      4|    { xmlXPathErr(ctxt, X); return; }
  |  |  ------------------
  |  |  283|     98|    if (ctxt->valueNr < (x))						\
  |  |  ------------------
  |  |  |  Branch (283:9): [True: 0, False: 98]
  |  |  ------------------
  |  |  284|     98|        XP_ERROR(XPATH_STACK_ERROR);
  |  |  ------------------
  |  |  |  |  244|      0|    { xmlXPathErr(ctxt, X); return; }
  |  |  ------------------
  ------------------
 7472|    298|    CAST_TO_STRING;
  ------------------
  |  |  290|     98|    if ((ctxt->value != NULL) && (ctxt->value->type != XPATH_STRING))	\
  |  |  ------------------
  |  |  |  Branch (290:9): [True: 98, False: 0]
  |  |  |  Branch (290:34): [True: 33, False: 65]
  |  |  ------------------
  |  |  291|     98|        xmlXPathStringFunction(ctxt, 1);
  ------------------
 7473|    298|    CHECK_TYPE(XPATH_STRING);
  ------------------
  |  |  261|     98|    if ((ctxt->value == NULL) || (ctxt->value->type != typeval))	\
  |  |  ------------------
  |  |  |  Branch (261:9): [True: 0, False: 98]
  |  |  |  Branch (261:34): [True: 1, False: 97]
  |  |  ------------------
  |  |  262|     98|        XP_ERROR(XPATH_INVALID_TYPE)
  |  |  ------------------
  |  |  |  |  244|      1|    { xmlXPathErr(ctxt, X); return; }
  |  |  ------------------
  ------------------
 7474|     97|    needle = xmlXPathValuePop(ctxt);
 7475|     97|    CAST_TO_STRING;
  ------------------
  |  |  290|     97|    if ((ctxt->value != NULL) && (ctxt->value->type != XPATH_STRING))	\
  |  |  ------------------
  |  |  |  Branch (290:9): [True: 97, False: 0]
  |  |  |  Branch (290:34): [True: 97, False: 0]
  |  |  ------------------
  |  |  291|     97|        xmlXPathStringFunction(ctxt, 1);
  ------------------
 7476|     97|    hay = xmlXPathValuePop(ctxt);
 7477|       |
 7478|     97|    if ((hay == NULL) || (hay->type != XPATH_STRING)) {
  ------------------
  |  Branch (7478:9): [True: 0, False: 97]
  |  Branch (7478:26): [True: 1, False: 96]
  ------------------
 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|     96|    n = xmlStrlen(needle->stringval);
 7484|     96|    if (xmlStrncmp(hay->stringval, needle->stringval, n))
  ------------------
  |  Branch (7484:9): [True: 83, False: 13]
  ------------------
 7485|     83|        xmlXPathValuePush(ctxt, xmlXPathCacheNewBoolean(ctxt, 0));
 7486|     13|    else
 7487|     13|        xmlXPathValuePush(ctxt, xmlXPathCacheNewBoolean(ctxt, 1));
 7488|     96|    xmlXPathReleaseObject(ctxt->context, hay);
 7489|     96|    xmlXPathReleaseObject(ctxt->context, needle);
 7490|     96|}
xmlXPathSubstringFunction:
 7520|  3.23k|xmlXPathSubstringFunction(xmlXPathParserContext *ctxt, int nargs) {
 7521|  3.23k|    xmlXPathObjectPtr str, start, len;
 7522|  3.23k|    double le=0, in;
 7523|  3.23k|    int i = 1, j = INT_MAX;
 7524|       |
 7525|  3.23k|    if (nargs < 2) {
  ------------------
  |  Branch (7525:9): [True: 9, False: 3.22k]
  ------------------
 7526|      9|	CHECK_ARITY(2);
  ------------------
  |  |  280|      9|    if (ctxt == NULL) return;						\
  |  |  ------------------
  |  |  |  Branch (280:9): [True: 0, False: 9]
  |  |  ------------------
  |  |  281|      9|    if (nargs != (x))							\
  |  |  ------------------
  |  |  |  Branch (281:9): [True: 9, False: 0]
  |  |  ------------------
  |  |  282|      9|        XP_ERROR(XPATH_INVALID_ARITY);					\
  |  |  ------------------
  |  |  |  |  244|      9|    { 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|      9|    }
 7528|  3.22k|    if (nargs > 3) {
  ------------------
  |  Branch (7528:9): [True: 4, False: 3.22k]
  ------------------
 7529|      4|	CHECK_ARITY(3);
  ------------------
  |  |  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; }
  |  |  ------------------
  ------------------
 7530|      4|    }
 7531|       |    /*
 7532|       |     * take care of possible last (position) argument
 7533|       |    */
 7534|  3.22k|    if (nargs == 3) {
  ------------------
  |  Branch (7534:9): [True: 1.91k, False: 1.30k]
  ------------------
 7535|  1.91k|	CAST_TO_NUMBER;
  ------------------
  |  |  297|  1.91k|    if ((ctxt->value != NULL) && (ctxt->value->type != XPATH_NUMBER))	\
  |  |  ------------------
  |  |  |  Branch (297:9): [True: 1.91k, False: 0]
  |  |  |  Branch (297:34): [True: 526, False: 1.39k]
  |  |  ------------------
  |  |  298|  1.91k|        xmlXPathNumberFunction(ctxt, 1);
  ------------------
 7536|  1.91k|	CHECK_TYPE(XPATH_NUMBER);
  ------------------
  |  |  261|  1.91k|    if ((ctxt->value == NULL) || (ctxt->value->type != typeval))	\
  |  |  ------------------
  |  |  |  Branch (261:9): [True: 0, False: 1.91k]
  |  |  |  Branch (261:34): [True: 1, False: 1.91k]
  |  |  ------------------
  |  |  262|  1.91k|        XP_ERROR(XPATH_INVALID_TYPE)
  |  |  ------------------
  |  |  |  |  244|      1|    { xmlXPathErr(ctxt, X); return; }
  |  |  ------------------
  ------------------
 7537|  1.91k|	len = xmlXPathValuePop(ctxt);
 7538|  1.91k|	le = len->floatval;
 7539|  1.91k|	xmlXPathReleaseObject(ctxt->context, len);
 7540|  1.91k|    }
 7541|       |
 7542|  3.22k|    CAST_TO_NUMBER;
  ------------------
  |  |  297|  3.22k|    if ((ctxt->value != NULL) && (ctxt->value->type != XPATH_NUMBER))	\
  |  |  ------------------
  |  |  |  Branch (297:9): [True: 3.22k, False: 0]
  |  |  |  Branch (297:34): [True: 478, False: 2.74k]
  |  |  ------------------
  |  |  298|  3.22k|        xmlXPathNumberFunction(ctxt, 1);
  ------------------
 7543|  3.22k|    CHECK_TYPE(XPATH_NUMBER);
  ------------------
  |  |  261|  3.22k|    if ((ctxt->value == NULL) || (ctxt->value->type != typeval))	\
  |  |  ------------------
  |  |  |  Branch (261:9): [True: 0, False: 3.22k]
  |  |  |  Branch (261:34): [True: 1, False: 3.21k]
  |  |  ------------------
  |  |  262|  3.22k|        XP_ERROR(XPATH_INVALID_TYPE)
  |  |  ------------------
  |  |  |  |  244|      1|    { xmlXPathErr(ctxt, X); return; }
  |  |  ------------------
  ------------------
 7544|  3.21k|    start = xmlXPathValuePop(ctxt);
 7545|  3.21k|    in = start->floatval;
 7546|  3.21k|    xmlXPathReleaseObject(ctxt->context, start);
 7547|  3.21k|    CAST_TO_STRING;
  ------------------
  |  |  290|  3.21k|    if ((ctxt->value != NULL) && (ctxt->value->type != XPATH_STRING))	\
  |  |  ------------------
  |  |  |  Branch (290:9): [True: 3.21k, False: 2]
  |  |  |  Branch (290:34): [True: 3.21k, False: 1]
  |  |  ------------------
  |  |  291|  3.21k|        xmlXPathStringFunction(ctxt, 1);
  ------------------
 7548|  3.21k|    CHECK_TYPE(XPATH_STRING);
  ------------------
  |  |  261|  3.21k|    if ((ctxt->value == NULL) || (ctxt->value->type != typeval))	\
  |  |  ------------------
  |  |  |  Branch (261:9): [True: 4, False: 3.21k]
  |  |  |  Branch (261:34): [True: 5, False: 3.21k]
  |  |  ------------------
  |  |  262|  3.21k|        XP_ERROR(XPATH_INVALID_TYPE)
  |  |  ------------------
  |  |  |  |  244|      9|    { xmlXPathErr(ctxt, X); return; }
  |  |  ------------------
  ------------------
 7549|  3.21k|    str = xmlXPathValuePop(ctxt);
 7550|       |
 7551|  3.21k|    if (!(in < INT_MAX)) { /* Logical NOT to handle NaNs */
  ------------------
  |  Branch (7551:9): [True: 737, False: 2.47k]
  ------------------
 7552|    737|        i = INT_MAX;
 7553|  2.47k|    } else if (in >= 1.0) {
  ------------------
  |  Branch (7553:16): [True: 1.86k, False: 607]
  ------------------
 7554|  1.86k|        i = (int)in;
 7555|  1.86k|        if (in - floor(in) >= 0.5)
  ------------------
  |  Branch (7555:13): [True: 672, False: 1.19k]
  ------------------
 7556|    672|            i += 1;
 7557|  1.86k|    }
 7558|       |
 7559|  3.21k|    if (nargs == 3) {
  ------------------
  |  Branch (7559:9): [True: 1.91k, False: 1.29k]
  ------------------
 7560|  1.91k|        double rin, rle, end;
 7561|       |
 7562|  1.91k|        rin = floor(in);
 7563|  1.91k|        if (in - rin >= 0.5)
  ------------------
  |  Branch (7563:13): [True: 285, False: 1.62k]
  ------------------
 7564|    285|            rin += 1.0;
 7565|       |
 7566|  1.91k|        rle = floor(le);
 7567|  1.91k|        if (le - rle >= 0.5)
  ------------------
  |  Branch (7567:13): [True: 648, False: 1.26k]
  ------------------
 7568|    648|            rle += 1.0;
 7569|       |
 7570|  1.91k|        end = rin + rle;
 7571|  1.91k|        if (!(end >= 1.0)) { /* Logical NOT to handle NaNs */
  ------------------
  |  Branch (7571:13): [True: 835, False: 1.07k]
  ------------------
 7572|    835|            j = 1;
 7573|  1.07k|        } else if (end < INT_MAX) {
  ------------------
  |  Branch (7573:20): [True: 710, False: 366]
  ------------------
 7574|    710|            j = (int)end;
 7575|    710|        }
 7576|  1.91k|    }
 7577|       |
 7578|  3.21k|    i -= 1;
 7579|  3.21k|    j -= 1;
 7580|       |
 7581|  3.21k|    if ((i < j) && (i < xmlUTF8Strlen(str->stringval))) {
  ------------------
  |  Branch (7581:9): [True: 2.08k, False: 1.13k]
  |  Branch (7581:20): [True: 915, False: 1.16k]
  ------------------
 7582|    915|        xmlChar *ret = xmlUTF8Strsub(str->stringval, i, j - i);
 7583|    915|        if (ret == NULL)
  ------------------
  |  Branch (7583:13): [True: 5, False: 910]
  ------------------
 7584|      5|            xmlXPathPErrMemory(ctxt);
 7585|    915|	xmlXPathValuePush(ctxt, xmlXPathCacheNewString(ctxt, ret));
 7586|    915|	xmlFree(ret);
 7587|  2.29k|    } else {
 7588|  2.29k|	xmlXPathValuePush(ctxt, xmlXPathCacheNewCString(ctxt, ""));
 7589|  2.29k|    }
 7590|       |
 7591|  3.21k|    xmlXPathReleaseObject(ctxt->context, str);
 7592|  3.21k|}
xmlXPathTranslateFunction:
 7762|  7.38k|xmlXPathTranslateFunction(xmlXPathParserContext *ctxt, int nargs) {
 7763|  7.38k|    xmlXPathObjectPtr str = NULL;
 7764|  7.38k|    xmlXPathObjectPtr from = NULL;
 7765|  7.38k|    xmlXPathObjectPtr to = NULL;
 7766|  7.38k|    xmlBufPtr target;
 7767|  7.38k|    int offset, max;
 7768|  7.38k|    int ch;
 7769|  7.38k|    const xmlChar *point;
 7770|  7.38k|    xmlChar *cptr, *content;
 7771|       |
 7772|  22.1k|    CHECK_ARITY(3);
  ------------------
  |  |  280|  7.38k|    if (ctxt == NULL) return;						\
  |  |  ------------------
  |  |  |  Branch (280:9): [True: 0, False: 7.38k]
  |  |  ------------------
  |  |  281|  7.38k|    if (nargs != (x))							\
  |  |  ------------------
  |  |  |  Branch (281:9): [True: 6, False: 7.37k]
  |  |  ------------------
  |  |  282|  7.38k|        XP_ERROR(XPATH_INVALID_ARITY);					\
  |  |  ------------------
  |  |  |  |  244|      6|    { xmlXPathErr(ctxt, X); return; }
  |  |  ------------------
  |  |  283|  7.37k|    if (ctxt->valueNr < (x))						\
  |  |  ------------------
  |  |  |  Branch (283:9): [True: 0, False: 7.37k]
  |  |  ------------------
  |  |  284|  7.37k|        XP_ERROR(XPATH_STACK_ERROR);
  |  |  ------------------
  |  |  |  |  244|      0|    { xmlXPathErr(ctxt, X); return; }
  |  |  ------------------
  ------------------
 7773|       |
 7774|  22.1k|    CAST_TO_STRING;
  ------------------
  |  |  290|  7.37k|    if ((ctxt->value != NULL) && (ctxt->value->type != XPATH_STRING))	\
  |  |  ------------------
  |  |  |  Branch (290:9): [True: 7.37k, False: 0]
  |  |  |  Branch (290:34): [True: 7.37k, False: 0]
  |  |  ------------------
  |  |  291|  7.37k|        xmlXPathStringFunction(ctxt, 1);
  ------------------
 7775|  22.1k|    to = xmlXPathValuePop(ctxt);
 7776|  22.1k|    CAST_TO_STRING;
  ------------------
  |  |  290|  7.37k|    if ((ctxt->value != NULL) && (ctxt->value->type != XPATH_STRING))	\
  |  |  ------------------
  |  |  |  Branch (290:9): [True: 7.37k, False: 0]
  |  |  |  Branch (290:34): [True: 7.37k, False: 0]
  |  |  ------------------
  |  |  291|  7.37k|        xmlXPathStringFunction(ctxt, 1);
  ------------------
 7777|  22.1k|    from = xmlXPathValuePop(ctxt);
 7778|  22.1k|    CAST_TO_STRING;
  ------------------
  |  |  290|  7.37k|    if ((ctxt->value != NULL) && (ctxt->value->type != XPATH_STRING))	\
  |  |  ------------------
  |  |  |  Branch (290:9): [True: 7.37k, False: 2]
  |  |  |  Branch (290:34): [True: 7.37k, False: 1]
  |  |  ------------------
  |  |  291|  7.37k|        xmlXPathStringFunction(ctxt, 1);
  ------------------
 7779|  22.1k|    str = xmlXPathValuePop(ctxt);
 7780|  22.1k|    if (ctxt->error != 0)
  ------------------
  |  Branch (7780:9): [True: 16, False: 7.35k]
  ------------------
 7781|     16|        goto error;
 7782|       |
 7783|       |    /*
 7784|       |     * Account for quadratic runtime
 7785|       |     */
 7786|  7.35k|    if (ctxt->context->opLimit != 0) {
  ------------------
  |  Branch (7786:9): [True: 7.35k, False: 0]
  ------------------
 7787|  7.35k|        unsigned long f1 = xmlStrlen(from->stringval);
 7788|  7.35k|        unsigned long f2 = xmlStrlen(str->stringval);
 7789|       |
 7790|  7.35k|        if ((f1 > 0) && (f2 > 0)) {
  ------------------
  |  Branch (7790:13): [True: 6.81k, False: 547]
  |  Branch (7790:25): [True: 6.52k, False: 290]
  ------------------
 7791|  6.52k|            unsigned long p;
 7792|       |
 7793|  6.52k|            f1 = f1 / 10 + 1;
 7794|  6.52k|            f2 = f2 / 10 + 1;
 7795|  6.52k|            p = f1 > ULONG_MAX / f2 ? ULONG_MAX : f1 * f2;
  ------------------
  |  Branch (7795:17): [True: 0, False: 6.52k]
  ------------------
 7796|  6.52k|            if (xmlXPathCheckOpLimit(ctxt, p) < 0)
  ------------------
  |  Branch (7796:17): [True: 3, False: 6.51k]
  ------------------
 7797|      3|                goto error;
 7798|  6.52k|        }
 7799|  7.35k|    }
 7800|       |
 7801|  7.35k|    target = xmlBufCreate(50);
 7802|  7.35k|    if (target == NULL) {
  ------------------
  |  Branch (7802:9): [True: 6, False: 7.35k]
  ------------------
 7803|      6|        xmlXPathPErrMemory(ctxt);
 7804|      6|        goto error;
 7805|      6|    }
 7806|       |
 7807|  7.35k|    max = xmlUTF8Strlen(to->stringval);
 7808|  98.9k|    for (cptr = str->stringval; (ch=*cptr); ) {
  ------------------
  |  Branch (7808:33): [True: 91.6k, False: 7.35k]
  ------------------
 7809|  91.6k|        offset = xmlUTF8Strloc(from->stringval, cptr);
 7810|  91.6k|        if (offset >= 0) {
  ------------------
  |  Branch (7810:13): [True: 30.5k, False: 61.0k]
  ------------------
 7811|  30.5k|            if (offset < max) {
  ------------------
  |  Branch (7811:17): [True: 27.2k, False: 3.33k]
  ------------------
 7812|  27.2k|                point = xmlUTF8Strpos(to->stringval, offset);
 7813|  27.2k|                if (point)
  ------------------
  |  Branch (7813:21): [True: 27.2k, False: 0]
  ------------------
 7814|  27.2k|                    xmlBufAdd(target, point, xmlUTF8Strsize(point, 1));
 7815|  27.2k|            }
 7816|  30.5k|        } else
 7817|  61.0k|            xmlBufAdd(target, cptr, xmlUTF8Strsize(cptr, 1));
 7818|       |
 7819|       |        /* Step to next character in input */
 7820|  91.6k|        cptr++;
 7821|  91.6k|        if ( ch & 0x80 ) {
  ------------------
  |  Branch (7821:14): [True: 0, False: 91.6k]
  ------------------
 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|  91.6k|    }
 7837|       |
 7838|  7.35k|    content = xmlBufDetach(target);
 7839|  7.35k|    if (content == NULL)
  ------------------
  |  Branch (7839:9): [True: 0, False: 7.35k]
  ------------------
 7840|      0|        xmlXPathPErrMemory(ctxt);
 7841|  7.35k|    else
 7842|  7.35k|        xmlXPathValuePush(ctxt, xmlXPathCacheWrapString(ctxt, content));
 7843|  7.35k|    xmlBufFree(target);
 7844|  7.37k|error:
 7845|  7.37k|    xmlXPathReleaseObject(ctxt->context, str);
 7846|  7.37k|    xmlXPathReleaseObject(ctxt->context, from);
 7847|  7.37k|    xmlXPathReleaseObject(ctxt->context, to);
 7848|  7.37k|}
xmlXPathBooleanFunction:
 7863|  13.9k|xmlXPathBooleanFunction(xmlXPathParserContext *ctxt, int nargs) {
 7864|  13.9k|    xmlXPathObjectPtr cur;
 7865|       |
 7866|  41.9k|    CHECK_ARITY(1);
  ------------------
  |  |  280|  13.9k|    if (ctxt == NULL) return;						\
  |  |  ------------------
  |  |  |  Branch (280:9): [True: 0, False: 13.9k]
  |  |  ------------------
  |  |  281|  13.9k|    if (nargs != (x))							\
  |  |  ------------------
  |  |  |  Branch (281:9): [True: 0, False: 13.9k]
  |  |  ------------------
  |  |  282|  13.9k|        XP_ERROR(XPATH_INVALID_ARITY);					\
  |  |  ------------------
  |  |  |  |  244|      0|    { xmlXPathErr(ctxt, X); return; }
  |  |  ------------------
  |  |  283|  13.9k|    if (ctxt->valueNr < (x))						\
  |  |  ------------------
  |  |  |  Branch (283:9): [True: 0, False: 13.9k]
  |  |  ------------------
  |  |  284|  13.9k|        XP_ERROR(XPATH_STACK_ERROR);
  |  |  ------------------
  |  |  |  |  244|      0|    { xmlXPathErr(ctxt, X); return; }
  |  |  ------------------
  ------------------
 7867|  41.9k|    cur = xmlXPathValuePop(ctxt);
 7868|  41.9k|    if (cur == NULL) XP_ERROR(XPATH_INVALID_OPERAND);
  ------------------
  |  |  244|      0|    { xmlXPathErr(ctxt, X); return; }
  ------------------
  |  Branch (7868:9): [True: 0, False: 13.9k]
  ------------------
 7869|  13.9k|    if (cur->type != XPATH_BOOLEAN) {
  ------------------
  |  Branch (7869:9): [True: 11.3k, False: 2.60k]
  ------------------
 7870|  11.3k|        int boolval = xmlXPathCastToBoolean(cur);
 7871|       |
 7872|  11.3k|        xmlXPathReleaseObject(ctxt->context, cur);
 7873|  11.3k|        cur = xmlXPathCacheNewBoolean(ctxt, boolval);
 7874|  11.3k|    }
 7875|  13.9k|    xmlXPathValuePush(ctxt, cur);
 7876|  13.9k|}
xmlXPathNotFunction:
 7888|      9|xmlXPathNotFunction(xmlXPathParserContext *ctxt, int nargs) {
 7889|     25|    CHECK_ARITY(1);
  ------------------
  |  |  280|      9|    if (ctxt == NULL) return;						\
  |  |  ------------------
  |  |  |  Branch (280:9): [True: 0, False: 9]
  |  |  ------------------
  |  |  281|      9|    if (nargs != (x))							\
  |  |  ------------------
  |  |  |  Branch (281:9): [True: 1, False: 8]
  |  |  ------------------
  |  |  282|      9|        XP_ERROR(XPATH_INVALID_ARITY);					\
  |  |  ------------------
  |  |  |  |  244|      1|    { xmlXPathErr(ctxt, X); return; }
  |  |  ------------------
  |  |  283|      8|    if (ctxt->valueNr < (x))						\
  |  |  ------------------
  |  |  |  Branch (283:9): [True: 0, False: 8]
  |  |  ------------------
  |  |  284|      8|        XP_ERROR(XPATH_STACK_ERROR);
  |  |  ------------------
  |  |  |  |  244|      0|    { xmlXPathErr(ctxt, X); return; }
  |  |  ------------------
  ------------------
 7890|     25|    CAST_TO_BOOLEAN;
  ------------------
  |  |  304|      8|    if ((ctxt->value != NULL) && (ctxt->value->type != XPATH_BOOLEAN))	\
  |  |  ------------------
  |  |  |  Branch (304:9): [True: 8, False: 0]
  |  |  |  Branch (304:34): [True: 5, False: 3]
  |  |  ------------------
  |  |  305|      8|        xmlXPathBooleanFunction(ctxt, 1);
  ------------------
 7891|     25|    CHECK_TYPE(XPATH_BOOLEAN);
  ------------------
  |  |  261|      8|    if ((ctxt->value == NULL) || (ctxt->value->type != typeval))	\
  |  |  ------------------
  |  |  |  Branch (261:9): [True: 0, False: 8]
  |  |  |  Branch (261:34): [True: 1, False: 7]
  |  |  ------------------
  |  |  262|      8|        XP_ERROR(XPATH_INVALID_TYPE)
  |  |  ------------------
  |  |  |  |  244|      1|    { xmlXPathErr(ctxt, X); return; }
  |  |  ------------------
  ------------------
 7892|      7|    ctxt->value->boolval = ! ctxt->value->boolval;
 7893|      7|}
xmlXPathTrueFunction:
 7903|     17|xmlXPathTrueFunction(xmlXPathParserContext *ctxt, int nargs) {
 7904|     45|    CHECK_ARITY(0);
  ------------------
  |  |  280|     17|    if (ctxt == NULL) return;						\
  |  |  ------------------
  |  |  |  Branch (280:9): [True: 0, False: 17]
  |  |  ------------------
  |  |  281|     17|    if (nargs != (x))							\
  |  |  ------------------
  |  |  |  Branch (281:9): [True: 3, False: 14]
  |  |  ------------------
  |  |  282|     17|        XP_ERROR(XPATH_INVALID_ARITY);					\
  |  |  ------------------
  |  |  |  |  244|      3|    { 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|     45|    xmlXPathValuePush(ctxt, xmlXPathCacheNewBoolean(ctxt, 1));
 7906|     45|}
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|  6.17k|xmlXPathLangFunction(xmlXPathParserContext *ctxt, int nargs) {
 7943|  6.17k|    xmlXPathObjectPtr val;
 7944|  6.17k|    xmlNodePtr cur;
 7945|  6.17k|    xmlChar *theLang = NULL;
 7946|  6.17k|    const xmlChar *lang;
 7947|  6.17k|    int ret = 0;
 7948|  6.17k|    int i;
 7949|       |
 7950|  18.5k|    CHECK_ARITY(1);
  ------------------
  |  |  280|  6.17k|    if (ctxt == NULL) return;						\
  |  |  ------------------
  |  |  |  Branch (280:9): [True: 0, False: 6.17k]
  |  |  ------------------
  |  |  281|  6.17k|    if (nargs != (x))							\
  |  |  ------------------
  |  |  |  Branch (281:9): [True: 5, False: 6.17k]
  |  |  ------------------
  |  |  282|  6.17k|        XP_ERROR(XPATH_INVALID_ARITY);					\
  |  |  ------------------
  |  |  |  |  244|      5|    { xmlXPathErr(ctxt, X); return; }
  |  |  ------------------
  |  |  283|  6.17k|    if (ctxt->valueNr < (x))						\
  |  |  ------------------
  |  |  |  Branch (283:9): [True: 0, False: 6.17k]
  |  |  ------------------
  |  |  284|  6.17k|        XP_ERROR(XPATH_STACK_ERROR);
  |  |  ------------------
  |  |  |  |  244|      0|    { xmlXPathErr(ctxt, X); return; }
  |  |  ------------------
  ------------------
 7951|  18.5k|    CAST_TO_STRING;
  ------------------
  |  |  290|  6.17k|    if ((ctxt->value != NULL) && (ctxt->value->type != XPATH_STRING))	\
  |  |  ------------------
  |  |  |  Branch (290:9): [True: 6.17k, False: 0]
  |  |  |  Branch (290:34): [True: 6.16k, False: 10]
  |  |  ------------------
  |  |  291|  6.17k|        xmlXPathStringFunction(ctxt, 1);
  ------------------
 7952|  18.5k|    CHECK_TYPE(XPATH_STRING);
  ------------------
  |  |  261|  6.17k|    if ((ctxt->value == NULL) || (ctxt->value->type != typeval))	\
  |  |  ------------------
  |  |  |  Branch (261:9): [True: 1, False: 6.17k]
  |  |  |  Branch (261:34): [True: 1, False: 6.17k]
  |  |  ------------------
  |  |  262|  6.17k|        XP_ERROR(XPATH_INVALID_TYPE)
  |  |  ------------------
  |  |  |  |  244|      2|    { xmlXPathErr(ctxt, X); return; }
  |  |  ------------------
  ------------------
 7953|  6.17k|    val = xmlXPathValuePop(ctxt);
 7954|  6.17k|    lang = val->stringval;
 7955|  6.17k|    cur = ctxt->context->node;
 7956|  54.2k|    while (cur != NULL) {
  ------------------
  |  Branch (7956:12): [True: 48.0k, False: 6.17k]
  ------------------
 7957|  48.0k|        if (xmlNodeGetAttrValue(cur, BAD_CAST "lang", XML_XML_NAMESPACE,
  ------------------
  |  |   34|  48.0k|#define BAD_CAST (xmlChar *)
  ------------------
                      if (xmlNodeGetAttrValue(cur, BAD_CAST "lang", XML_XML_NAMESPACE,
  ------------------
  |  |  146|  48.0k|    (const xmlChar *) "http://www.w3.org/XML/1998/namespace"
  ------------------
  |  Branch (7957:13): [True: 0, False: 48.0k]
  ------------------
 7958|  48.0k|                                &theLang) < 0)
 7959|      0|            xmlXPathPErrMemory(ctxt);
 7960|  48.0k|        if (theLang != NULL)
  ------------------
  |  Branch (7960:13): [True: 0, False: 48.0k]
  ------------------
 7961|      0|            break;
 7962|  48.0k|        cur = cur->parent;
 7963|  48.0k|    }
 7964|  6.17k|    if ((theLang != NULL) && (lang != NULL)) {
  ------------------
  |  Branch (7964:9): [True: 0, False: 6.17k]
  |  Branch (7964:30): [True: 0, False: 0]
  ------------------
 7965|      0|        for (i = 0;lang[i] != 0;i++)
  ------------------
  |  Branch (7965:20): [True: 0, False: 0]
  ------------------
 7966|      0|            if (toupper(lang[i]) != toupper(theLang[i]))
  ------------------
  |  Branch (7966:17): [True: 0, False: 0]
  |  Branch (7966:17): [True: 0, False: 0]
  |  Branch (7966:17): [Folded, False: 0]
  |  Branch (7966:17): [True: 0, False: 0]
  |  Branch (7966:37): [True: 0, False: 0]
  |  Branch (7966:37): [True: 0, False: 0]
  |  Branch (7966:37): [Folded, False: 0]
  ------------------
 7967|      0|                goto not_equal;
 7968|      0|        if ((theLang[i] == 0) || (theLang[i] == '-'))
  ------------------
  |  Branch (7968:13): [True: 0, False: 0]
  |  Branch (7968:34): [True: 0, False: 0]
  ------------------
 7969|      0|            ret = 1;
 7970|      0|    }
 7971|  6.17k|not_equal:
 7972|  6.17k|    if (theLang != NULL)
  ------------------
  |  Branch (7972:9): [True: 0, False: 6.17k]
  ------------------
 7973|      0|	xmlFree((void *)theLang);
 7974|       |
 7975|  6.17k|    xmlXPathReleaseObject(ctxt->context, val);
 7976|  6.17k|    xmlXPathValuePush(ctxt, xmlXPathCacheNewBoolean(ctxt, ret));
 7977|  6.17k|}
xmlXPathNumberFunction:
 7987|   318k|xmlXPathNumberFunction(xmlXPathParserContext *ctxt, int nargs) {
 7988|   318k|    xmlXPathObjectPtr cur;
 7989|   318k|    double res;
 7990|       |
 7991|   318k|    if (ctxt == NULL) return;
  ------------------
  |  Branch (7991:9): [True: 0, False: 318k]
  ------------------
 7992|   318k|    if (nargs == 0) {
  ------------------
  |  Branch (7992:9): [True: 0, False: 318k]
  ------------------
 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.27M|    CHECK_ARITY(1);
  ------------------
  |  |  280|   318k|    if (ctxt == NULL) return;						\
  |  |  ------------------
  |  |  |  Branch (280:9): [True: 0, False: 318k]
  |  |  ------------------
  |  |  281|   318k|    if (nargs != (x))							\
  |  |  ------------------
  |  |  |  Branch (281:9): [True: 0, False: 318k]
  |  |  ------------------
  |  |  282|   318k|        XP_ERROR(XPATH_INVALID_ARITY);					\
  |  |  ------------------
  |  |  |  |  244|      0|    { xmlXPathErr(ctxt, X); return; }
  |  |  ------------------
  |  |  283|   318k|    if (ctxt->valueNr < (x))						\
  |  |  ------------------
  |  |  |  Branch (283:9): [True: 8, False: 318k]
  |  |  ------------------
  |  |  284|   318k|        XP_ERROR(XPATH_STACK_ERROR);
  |  |  ------------------
  |  |  |  |  244|      8|    { xmlXPathErr(ctxt, X); return; }
  |  |  ------------------
  ------------------
 8008|  1.27M|    cur = xmlXPathValuePop(ctxt);
 8009|  1.27M|    if (cur->type != XPATH_NUMBER) {
  ------------------
  |  Branch (8009:9): [True: 318k, False: 5]
  ------------------
 8010|   318k|        double floatval;
 8011|       |
 8012|   318k|        floatval = xmlXPathCastToNumberInternal(ctxt, cur);
 8013|   318k|        xmlXPathReleaseObject(ctxt->context, cur);
 8014|   318k|        cur = xmlXPathCacheNewFloat(ctxt, floatval);
 8015|   318k|    }
 8016|  1.27M|    xmlXPathValuePush(ctxt, cur);
 8017|  1.27M|}
xmlXPathSumFunction:
 8029|     35|xmlXPathSumFunction(xmlXPathParserContext *ctxt, int nargs) {
 8030|     35|    xmlXPathObjectPtr cur;
 8031|     35|    int i;
 8032|     35|    double res = 0.0;
 8033|       |
 8034|     99|    CHECK_ARITY(1);
  ------------------
  |  |  280|     35|    if (ctxt == NULL) return;						\
  |  |  ------------------
  |  |  |  Branch (280:9): [True: 0, False: 35]
  |  |  ------------------
  |  |  281|     35|    if (nargs != (x))							\
  |  |  ------------------
  |  |  |  Branch (281:9): [True: 3, False: 32]
  |  |  ------------------
  |  |  282|     35|        XP_ERROR(XPATH_INVALID_ARITY);					\
  |  |  ------------------
  |  |  |  |  244|      3|    { xmlXPathErr(ctxt, X); return; }
  |  |  ------------------
  |  |  283|     32|    if (ctxt->valueNr < (x))						\
  |  |  ------------------
  |  |  |  Branch (283:9): [True: 0, False: 32]
  |  |  ------------------
  |  |  284|     32|        XP_ERROR(XPATH_STACK_ERROR);
  |  |  ------------------
  |  |  |  |  244|      0|    { xmlXPathErr(ctxt, X); return; }
  |  |  ------------------
  ------------------
 8035|     99|    if ((ctxt->value == NULL) ||
  ------------------
  |  Branch (8035:9): [True: 0, False: 32]
  ------------------
 8036|     32|	((ctxt->value->type != XPATH_NODESET) &&
  ------------------
  |  Branch (8036:3): [True: 3, False: 29]
  ------------------
 8037|      3|	 (ctxt->value->type != XPATH_XSLT_TREE)))
  ------------------
  |  Branch (8037:3): [True: 3, False: 0]
  ------------------
 8038|     29|	XP_ERROR(XPATH_INVALID_TYPE);
  ------------------
  |  |  244|      3|    { xmlXPathErr(ctxt, X); return; }
  ------------------
 8039|     29|    cur = xmlXPathValuePop(ctxt);
 8040|       |
 8041|     29|    if ((cur->nodesetval != NULL) && (cur->nodesetval->nodeNr != 0)) {
  ------------------
  |  Branch (8041:9): [True: 29, False: 0]
  |  Branch (8041:38): [True: 9, False: 20]
  ------------------
 8042|     33|	for (i = 0; i < cur->nodesetval->nodeNr; i++) {
  ------------------
  |  Branch (8042:14): [True: 24, False: 9]
  ------------------
 8043|     24|	    res += xmlXPathNodeToNumberInternal(ctxt,
 8044|     24|                                                cur->nodesetval->nodeTab[i]);
 8045|     24|	}
 8046|      9|    }
 8047|     29|    xmlXPathValuePush(ctxt, xmlXPathCacheNewFloat(ctxt, res));
 8048|     29|    xmlXPathReleaseObject(ctxt->context, cur);
 8049|     29|}
xmlXPathFloorFunction:
 8061|     45|xmlXPathFloorFunction(xmlXPathParserContext *ctxt, int nargs) {
 8062|    127|    CHECK_ARITY(1);
  ------------------
  |  |  280|     45|    if (ctxt == NULL) return;						\
  |  |  ------------------
  |  |  |  Branch (280:9): [True: 0, False: 45]
  |  |  ------------------
  |  |  281|     45|    if (nargs != (x))							\
  |  |  ------------------
  |  |  |  Branch (281:9): [True: 4, False: 41]
  |  |  ------------------
  |  |  282|     45|        XP_ERROR(XPATH_INVALID_ARITY);					\
  |  |  ------------------
  |  |  |  |  244|      4|    { xmlXPathErr(ctxt, X); return; }
  |  |  ------------------
  |  |  283|     41|    if (ctxt->valueNr < (x))						\
  |  |  ------------------
  |  |  |  Branch (283:9): [True: 0, False: 41]
  |  |  ------------------
  |  |  284|     41|        XP_ERROR(XPATH_STACK_ERROR);
  |  |  ------------------
  |  |  |  |  244|      0|    { xmlXPathErr(ctxt, X); return; }
  |  |  ------------------
  ------------------
 8063|    127|    CAST_TO_NUMBER;
  ------------------
  |  |  297|     41|    if ((ctxt->value != NULL) && (ctxt->value->type != XPATH_NUMBER))	\
  |  |  ------------------
  |  |  |  Branch (297:9): [True: 41, False: 0]
  |  |  |  Branch (297:34): [True: 23, False: 18]
  |  |  ------------------
  |  |  298|     41|        xmlXPathNumberFunction(ctxt, 1);
  ------------------
 8064|    127|    CHECK_TYPE(XPATH_NUMBER);
  ------------------
  |  |  261|     41|    if ((ctxt->value == NULL) || (ctxt->value->type != typeval))	\
  |  |  ------------------
  |  |  |  Branch (261:9): [True: 0, False: 41]
  |  |  |  Branch (261:34): [True: 1, False: 40]
  |  |  ------------------
  |  |  262|     41|        XP_ERROR(XPATH_INVALID_TYPE)
  |  |  ------------------
  |  |  |  |  244|      1|    { xmlXPathErr(ctxt, X); return; }
  |  |  ------------------
  ------------------
 8065|       |
 8066|     40|    ctxt->value->floatval = floor(ctxt->value->floatval);
 8067|     40|}
xmlXPathParseNCName:
 8147|   102k|xmlXPathParseNCName(xmlXPathParserContext *ctxt) {
 8148|   102k|    const xmlChar *end;
 8149|   102k|    xmlChar *ret;
 8150|       |
 8151|   102k|    if ((ctxt == NULL) || (ctxt->cur == NULL)) return(NULL);
  ------------------
  |  Branch (8151:9): [True: 0, False: 102k]
  |  Branch (8151:27): [True: 0, False: 102k]
  ------------------
 8152|       |
 8153|   102k|    end = xmlScanName(ctxt->cur, XML_MAX_NAME_LENGTH, XML_SCAN_NC);
  ------------------
  |  |   65|   102k|#define XML_MAX_NAME_LENGTH 50000
  ------------------
                  end = xmlScanName(ctxt->cur, XML_MAX_NAME_LENGTH, XML_SCAN_NC);
  ------------------
  |  |   69|   102k|#define XML_SCAN_NC         1
  ------------------
 8154|   102k|    if (end == NULL) {
  ------------------
  |  Branch (8154:9): [True: 1, False: 102k]
  ------------------
 8155|      1|        XP_ERRORNULL(XPATH_EXPR_ERROR);
  ------------------
  |  |  633|      1|    { xmlXPathErr(ctxt, X); return(NULL); }
  ------------------
 8156|      0|    }
 8157|   102k|    if (end == ctxt->cur)
  ------------------
  |  Branch (8157:9): [True: 3.58k, False: 99.1k]
  ------------------
 8158|  3.58k|        return(NULL);
 8159|       |
 8160|  99.1k|    ret = xmlStrndup(ctxt->cur, end - ctxt->cur);
 8161|  99.1k|    if (ret == NULL)
  ------------------
  |  Branch (8161:9): [True: 76, False: 99.1k]
  ------------------
 8162|     76|        xmlXPathPErrMemory(ctxt);
 8163|  99.1k|    ctxt->cur = end;
 8164|  99.1k|    return(ret);
 8165|   102k|}
xmlXPathParseName:
 8199|  14.8k|xmlXPathParseName(xmlXPathParserContext *ctxt) {
 8200|  14.8k|    const xmlChar *end;
 8201|  14.8k|    xmlChar *ret;
 8202|       |
 8203|  14.8k|    if ((ctxt == NULL) || (ctxt->cur == NULL)) return(NULL);
  ------------------
  |  Branch (8203:9): [True: 0, False: 14.8k]
  |  Branch (8203:27): [True: 0, False: 14.8k]
  ------------------
 8204|       |
 8205|  14.8k|    end = xmlScanName(ctxt->cur, XML_MAX_NAME_LENGTH, 0);
  ------------------
  |  |   65|  14.8k|#define XML_MAX_NAME_LENGTH 50000
  ------------------
 8206|  14.8k|    if (end == NULL) {
  ------------------
  |  Branch (8206:9): [True: 1, False: 14.8k]
  ------------------
 8207|      1|        XP_ERRORNULL(XPATH_EXPR_ERROR);
  ------------------
  |  |  633|      1|    { xmlXPathErr(ctxt, X); return(NULL); }
  ------------------
 8208|      0|    }
 8209|  14.8k|    if (end == ctxt->cur)
  ------------------
  |  Branch (8209:9): [True: 2.57k, False: 12.3k]
  ------------------
 8210|  2.57k|        return(NULL);
 8211|       |
 8212|  12.3k|    ret = xmlStrndup(ctxt->cur, end - ctxt->cur);
 8213|  12.3k|    if (ret == NULL)
  ------------------
  |  Branch (8213:9): [True: 31, False: 12.2k]
  ------------------
 8214|     31|        xmlXPathPErrMemory(ctxt);
 8215|  12.3k|    ctxt->cur = end;
 8216|  12.3k|    return(ret);
 8217|  14.8k|}
xmlXPathStringEvalNumber:
 8236|   595k|xmlXPathStringEvalNumber(const xmlChar *str) {
 8237|   595k|    const xmlChar *cur = str;
 8238|   595k|    double ret;
 8239|   595k|    int ok = 0;
 8240|   595k|    int isneg = 0;
 8241|   595k|    int exponent = 0;
 8242|   595k|    int is_exponent_negative = 0;
 8243|   595k|#ifdef __GNUC__
 8244|   595k|    unsigned long tmp = 0;
 8245|   595k|    double temp;
 8246|   595k|#endif
 8247|   595k|    if (cur == NULL) return(0);
  ------------------
  |  Branch (8247:9): [True: 0, False: 595k]
  ------------------
 8248|   595k|    while (IS_BLANK_CH(*cur)) cur++;
 8249|   595k|    if (*cur == '-') {
  ------------------
  |  Branch (8249:9): [True: 60.9k, False: 534k]
  ------------------
 8250|  60.9k|	isneg = 1;
 8251|  60.9k|	cur++;
 8252|  60.9k|    }
 8253|   595k|    if ((*cur != '.') && ((*cur < '0') || (*cur > '9'))) {
  ------------------
  |  Branch (8253:9): [True: 527k, False: 68.5k]
  |  Branch (8253:27): [True: 465k, False: 62.1k]
  |  Branch (8253:43): [True: 45.2k, False: 16.9k]
  ------------------
 8254|   510k|        return(xmlXPathNAN);
 8255|   510k|    }
 8256|       |
 8257|  85.4k|#ifdef __GNUC__
 8258|       |    /*
 8259|       |     * tmp/temp is a workaround against a gcc compiler bug
 8260|       |     * http://veillard.com/gcc.bug
 8261|       |     */
 8262|  85.4k|    ret = 0;
 8263|   131k|    while ((*cur >= '0') && (*cur <= '9')) {
  ------------------
  |  Branch (8263:12): [True: 48.1k, False: 83.0k]
  |  Branch (8263:29): [True: 45.6k, False: 2.44k]
  ------------------
 8264|  45.6k|	ret = ret * 10;
 8265|  45.6k|	tmp = (*cur - '0');
 8266|  45.6k|	ok = 1;
 8267|  45.6k|	cur++;
 8268|  45.6k|	temp = (double) tmp;
 8269|  45.6k|	ret = ret + temp;
 8270|  45.6k|    }
 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|  85.4k|    if (*cur == '.') {
  ------------------
  |  Branch (8280:9): [True: 72.9k, False: 12.5k]
  ------------------
 8281|  72.9k|	int v, frac = 0, max;
 8282|  72.9k|	double fraction = 0;
 8283|       |
 8284|  72.9k|        cur++;
 8285|  72.9k|	if (((*cur < '0') || (*cur > '9')) && (!ok)) {
  ------------------
  |  Branch (8285:7): [True: 6.08k, False: 66.8k]
  |  Branch (8285:23): [True: 9.03k, False: 57.7k]
  |  Branch (8285:40): [True: 14.6k, False: 523]
  ------------------
 8286|  14.6k|	    return(xmlXPathNAN);
 8287|  14.6k|	}
 8288|  98.3k|        while (*cur == '0') {
  ------------------
  |  Branch (8288:16): [True: 40.0k, False: 58.3k]
  ------------------
 8289|  40.0k|	    frac = frac + 1;
 8290|  40.0k|	    cur++;
 8291|  40.0k|        }
 8292|  58.3k|        max = frac + MAX_FRAC;
  ------------------
  |  | 8219|  58.3k|#define MAX_FRAC 20
  ------------------
 8293|   162k|	while (((*cur >= '0') && (*cur <= '9')) && (frac < max)) {
  ------------------
  |  Branch (8293:10): [True: 136k, False: 26.2k]
  |  Branch (8293:27): [True: 104k, False: 31.5k]
  |  Branch (8293:45): [True: 104k, False: 509]
  ------------------
 8294|   104k|	    v = (*cur - '0');
 8295|   104k|	    fraction = fraction * 10 + v;
 8296|   104k|	    frac = frac + 1;
 8297|   104k|	    cur++;
 8298|   104k|	}
 8299|  58.3k|	fraction /= pow(10.0, frac);
 8300|  58.3k|	ret = ret + fraction;
 8301|  77.6k|	while ((*cur >= '0') && (*cur <= '9'))
  ------------------
  |  Branch (8301:9): [True: 51.3k, False: 26.2k]
  |  Branch (8301:26): [True: 19.3k, False: 32.0k]
  ------------------
 8302|  19.3k|	    cur++;
 8303|  58.3k|    }
 8304|  70.8k|    if ((*cur == 'e') || (*cur == 'E')) {
  ------------------
  |  Branch (8304:9): [True: 4.57k, False: 66.3k]
  |  Branch (8304:26): [True: 10.4k, False: 55.8k]
  ------------------
 8305|  15.0k|      cur++;
 8306|  15.0k|      if (*cur == '-') {
  ------------------
  |  Branch (8306:11): [True: 3.05k, False: 11.9k]
  ------------------
 8307|  3.05k|	is_exponent_negative = 1;
 8308|  3.05k|	cur++;
 8309|  11.9k|      } else if (*cur == '+') {
  ------------------
  |  Branch (8309:18): [True: 5.70k, False: 6.26k]
  ------------------
 8310|  5.70k|        cur++;
 8311|  5.70k|      }
 8312|  73.6k|      while ((*cur >= '0') && (*cur <= '9')) {
  ------------------
  |  Branch (8312:14): [True: 59.0k, False: 14.5k]
  |  Branch (8312:31): [True: 58.6k, False: 427]
  ------------------
 8313|  58.6k|        if (exponent < 1000000)
  ------------------
  |  Branch (8313:13): [True: 56.9k, False: 1.64k]
  ------------------
 8314|  56.9k|	  exponent = exponent * 10 + (*cur - '0');
 8315|  58.6k|	cur++;
 8316|  58.6k|      }
 8317|  15.0k|    }
 8318|  70.8k|    while (IS_BLANK_CH(*cur)) cur++;
 8319|  70.8k|    if (*cur != 0) return(xmlXPathNAN);
  ------------------
  |  Branch (8319:9): [True: 34.7k, False: 36.1k]
  ------------------
 8320|  36.1k|    if (isneg) ret = -ret;
  ------------------
  |  Branch (8320:9): [True: 23.7k, False: 12.3k]
  ------------------
 8321|  36.1k|    if (is_exponent_negative) exponent = -exponent;
  ------------------
  |  Branch (8321:9): [True: 2.96k, False: 33.1k]
  ------------------
 8322|  36.1k|    ret *= pow(10.0, (double)exponent);
 8323|  36.1k|    return(ret);
 8324|  70.8k|}
xmlXPathIsNodeType:
 8548|  12.7k|xmlXPathIsNodeType(const xmlChar *name) {
 8549|  12.7k|    if (name == NULL)
  ------------------
  |  Branch (8549:9): [True: 0, False: 12.7k]
  ------------------
 8550|      0|	return(0);
 8551|       |
 8552|  12.7k|    if (xmlStrEqual(name, BAD_CAST "node"))
  ------------------
  |  |   34|  12.7k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (8552:9): [True: 29, False: 12.7k]
  ------------------
 8553|     29|	return(1);
 8554|  12.7k|    if (xmlStrEqual(name, BAD_CAST "text"))
  ------------------
  |  |   34|  12.7k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (8554:9): [True: 48, False: 12.6k]
  ------------------
 8555|     48|	return(1);
 8556|  12.6k|    if (xmlStrEqual(name, BAD_CAST "comment"))
  ------------------
  |  |   34|  12.6k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (8556:9): [True: 16, False: 12.6k]
  ------------------
 8557|     16|	return(1);
 8558|  12.6k|    if (xmlStrEqual(name, BAD_CAST "processing-instruction"))
  ------------------
  |  |   34|  12.6k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (8558:9): [True: 123, False: 12.5k]
  ------------------
 8559|    123|	return(1);
 8560|  12.5k|    return(0);
 8561|  12.6k|}
xmlXPathEvaluatePredicateResult:
11626|   252k|                                xmlXPathObject *res) {
11627|   252k|    if ((ctxt == NULL) || (res == NULL)) return(0);
  ------------------
  |  Branch (11627:9): [True: 0, False: 252k]
  |  Branch (11627:27): [True: 0, False: 252k]
  ------------------
11628|   252k|    switch (res->type) {
11629|      0|        case XPATH_BOOLEAN:
  ------------------
  |  Branch (11629:9): [True: 0, False: 252k]
  ------------------
11630|      0|	    return(res->boolval);
11631|  60.2k|        case XPATH_NUMBER:
  ------------------
  |  Branch (11631:9): [True: 60.2k, False: 192k]
  ------------------
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|  60.2k|	    return(res->floatval == ctxt->context->proximityPosition);
11637|      0|#endif
11638|   183k|        case XPATH_NODESET:
  ------------------
  |  Branch (11638:9): [True: 183k, False: 69.4k]
  ------------------
11639|   183k|        case XPATH_XSLT_TREE:
  ------------------
  |  Branch (11639:9): [True: 0, False: 252k]
  ------------------
11640|   183k|	    if (res->nodesetval == NULL)
  ------------------
  |  Branch (11640:10): [True: 0, False: 183k]
  ------------------
11641|      0|		return(0);
11642|   183k|	    return(res->nodesetval->nodeNr != 0);
11643|  9.23k|        case XPATH_STRING:
  ------------------
  |  Branch (11643:9): [True: 9.23k, False: 243k]
  ------------------
11644|  9.23k|	    return((res->stringval != NULL) && (res->stringval[0] != 0));
  ------------------
  |  Branch (11644:13): [True: 9.23k, False: 0]
  |  Branch (11644:41): [True: 7.99k, False: 1.23k]
  ------------------
11645|      0|        default:
  ------------------
  |  Branch (11645:9): [True: 0, False: 252k]
  ------------------
11646|      0|	    break;
11647|   252k|    }
11648|      0|    return(0);
11649|   252k|}
xmlXPathEvalExpr:
12002|  9.35k|xmlXPathEvalExpr(xmlXPathParserContext *ctxt) {
12003|       |#ifdef XPATH_STREAMING
12004|       |    xmlXPathCompExprPtr comp;
12005|       |#endif
12006|  9.35k|    int oldDepth = 0;
12007|       |
12008|  9.35k|    if ((ctxt == NULL) || (ctxt->context == NULL))
  ------------------
  |  Branch (12008:9): [True: 0, False: 9.35k]
  |  Branch (12008:27): [True: 0, False: 9.35k]
  ------------------
12009|      0|        return;
12010|  9.35k|    if (ctxt->context->lastError.code != 0)
  ------------------
  |  Branch (12010:9): [True: 68, False: 9.28k]
  ------------------
12011|     68|        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|  9.28k|    {
12027|  9.28k|        if (ctxt->context != NULL)
  ------------------
  |  Branch (12027:13): [True: 9.28k, False: 0]
  ------------------
12028|  9.28k|            oldDepth = ctxt->context->depth;
12029|  9.28k|	xmlXPathCompileExpr(ctxt, 1);
12030|  9.28k|        if (ctxt->context != NULL)
  ------------------
  |  Branch (12030:13): [True: 9.28k, False: 0]
  ------------------
12031|  9.28k|            ctxt->context->depth = oldDepth;
12032|  9.28k|        CHECK_ERROR;
  ------------------
  |  |  230|  9.28k|    if (ctxt->error != XPATH_EXPRESSION_OK) return
  |  |  ------------------
  |  |  |  Branch (230:9): [True: 1.86k, False: 7.42k]
  |  |  ------------------
  ------------------
12033|       |
12034|       |        /* Check for trailing characters. */
12035|  7.42k|        if (*ctxt->cur != 0)
  ------------------
  |  Branch (12035:13): [True: 366, False: 7.06k]
  ------------------
12036|  7.06k|            XP_ERROR(XPATH_EXPR_ERROR);
  ------------------
  |  |  244|    366|    { xmlXPathErr(ctxt, X); return; }
  ------------------
12037|       |
12038|  7.06k|	if ((ctxt->comp->nbStep > 1) && (ctxt->comp->last >= 0)) {
  ------------------
  |  Branch (12038:6): [True: 7.02k, False: 34]
  |  Branch (12038:34): [True: 7.02k, False: 0]
  ------------------
12039|  7.02k|            if (ctxt->context != NULL)
  ------------------
  |  Branch (12039:17): [True: 7.02k, False: 0]
  ------------------
12040|  7.02k|                oldDepth = ctxt->context->depth;
12041|  7.02k|	    xmlXPathOptimizeExpression(ctxt,
12042|  7.02k|		&ctxt->comp->steps[ctxt->comp->last]);
12043|  7.02k|            if (ctxt->context != NULL)
  ------------------
  |  Branch (12043:17): [True: 7.02k, False: 0]
  ------------------
12044|  7.02k|                ctxt->context->depth = oldDepth;
12045|  7.02k|        }
12046|  7.06k|    }
12047|       |
12048|      0|    xmlXPathRunEval(ctxt, 0);
12049|  7.06k|}
xpath.c:xmlXPathNameFunction:
 7223|  7.01k|{
 7224|  7.01k|    xmlXPathObjectPtr cur;
 7225|       |
 7226|  7.01k|    if (nargs == 0) {
  ------------------
  |  Branch (7226:9): [True: 3.54k, False: 3.47k]
  ------------------
 7227|  3.54k|	xmlXPathValuePush(ctxt, xmlXPathCacheNewNodeSet(ctxt, ctxt->context->node));
 7228|  3.54k|        nargs = 1;
 7229|  3.54k|    }
 7230|       |
 7231|  21.0k|    CHECK_ARITY(1);
  ------------------
  |  |  280|  7.01k|    if (ctxt == NULL) return;						\
  |  |  ------------------
  |  |  |  Branch (280:9): [True: 0, False: 7.01k]
  |  |  ------------------
  |  |  281|  7.01k|    if (nargs != (x))							\
  |  |  ------------------
  |  |  |  Branch (281:9): [True: 3, False: 7.00k]
  |  |  ------------------
  |  |  282|  7.01k|        XP_ERROR(XPATH_INVALID_ARITY);					\
  |  |  ------------------
  |  |  |  |  244|      3|    { xmlXPathErr(ctxt, X); return; }
  |  |  ------------------
  |  |  283|  7.00k|    if (ctxt->valueNr < (x))						\
  |  |  ------------------
  |  |  |  Branch (283:9): [True: 1, False: 7.00k]
  |  |  ------------------
  |  |  284|  7.00k|        XP_ERROR(XPATH_STACK_ERROR);
  |  |  ------------------
  |  |  |  |  244|      1|    { xmlXPathErr(ctxt, X); return; }
  |  |  ------------------
  ------------------
 7232|  21.0k|    if ((ctxt->value == NULL) ||
  ------------------
  |  Branch (7232:9): [True: 0, False: 7.00k]
  ------------------
 7233|  7.00k|        ((ctxt->value->type != XPATH_NODESET) &&
  ------------------
  |  Branch (7233:10): [True: 3, False: 7.00k]
  ------------------
 7234|      3|         (ctxt->value->type != XPATH_XSLT_TREE)))
  ------------------
  |  Branch (7234:10): [True: 3, False: 0]
  ------------------
 7235|  7.00k|        XP_ERROR(XPATH_INVALID_TYPE);
  ------------------
  |  |  244|      3|    { xmlXPathErr(ctxt, X); return; }
  ------------------
 7236|  7.00k|    cur = xmlXPathValuePop(ctxt);
 7237|       |
 7238|  7.00k|    if ((cur->nodesetval == NULL) || (cur->nodesetval->nodeNr == 0)) {
  ------------------
  |  Branch (7238:9): [True: 0, False: 7.00k]
  |  Branch (7238:38): [True: 2.31k, False: 4.68k]
  ------------------
 7239|  2.31k|        xmlXPathValuePush(ctxt, xmlXPathCacheNewCString(ctxt, ""));
 7240|  4.68k|    } else {
 7241|  4.68k|        int i = 0;              /* Should be first in document order !!!!! */
 7242|       |
 7243|  4.68k|        switch (cur->nodesetval->nodeTab[i]->type) {
 7244|  2.31k|            case XML_ELEMENT_NODE:
  ------------------
  |  Branch (7244:13): [True: 2.31k, False: 2.37k]
  ------------------
 7245|  2.31k|            case XML_ATTRIBUTE_NODE:
  ------------------
  |  Branch (7245:13): [True: 0, False: 4.68k]
  ------------------
 7246|  2.31k|		if (cur->nodesetval->nodeTab[i]->name[0] == ' ')
  ------------------
  |  Branch (7246:7): [True: 0, False: 2.31k]
  ------------------
 7247|      0|		    xmlXPathValuePush(ctxt,
 7248|      0|			xmlXPathCacheNewCString(ctxt, ""));
 7249|  2.31k|		else if ((cur->nodesetval->nodeTab[i]->ns == NULL) ||
  ------------------
  |  Branch (7249:12): [True: 2.00k, False: 310]
  ------------------
 7250|  2.27k|                         (cur->nodesetval->nodeTab[i]->ns->prefix == NULL)) {
  ------------------
  |  Branch (7250:26): [True: 270, False: 40]
  ------------------
 7251|  2.27k|		    xmlXPathValuePush(ctxt, xmlXPathCacheNewString(ctxt,
 7252|  2.27k|			    cur->nodesetval->nodeTab[i]->name));
 7253|  2.27k|		} else {
 7254|     40|		    xmlChar *fullname;
 7255|       |
 7256|     40|		    fullname = xmlBuildQName(cur->nodesetval->nodeTab[i]->name,
 7257|     40|				     cur->nodesetval->nodeTab[i]->ns->prefix,
 7258|     40|				     NULL, 0);
 7259|     40|		    if (fullname == cur->nodesetval->nodeTab[i]->name)
  ------------------
  |  Branch (7259:11): [True: 0, False: 40]
  ------------------
 7260|      0|			fullname = xmlStrdup(cur->nodesetval->nodeTab[i]->name);
 7261|     40|		    if (fullname == NULL)
  ------------------
  |  Branch (7261:11): [True: 1, False: 39]
  ------------------
 7262|      1|                        xmlXPathPErrMemory(ctxt);
 7263|     40|		    xmlXPathValuePush(ctxt, xmlXPathCacheWrapString(ctxt, fullname));
 7264|     40|                }
 7265|  2.31k|                break;
 7266|  2.37k|            default:
  ------------------
  |  Branch (7266:13): [True: 2.37k, False: 2.31k]
  ------------------
 7267|  2.37k|		xmlXPathValuePush(ctxt, xmlXPathCacheNewNodeSet(ctxt,
 7268|  2.37k|		    cur->nodesetval->nodeTab[i]));
 7269|  2.37k|                xmlXPathLocalNameFunction(ctxt, 1);
 7270|  4.68k|        }
 7271|  4.68k|    }
 7272|  7.00k|    xmlXPathReleaseObject(ctxt->context, cur);
 7273|  7.00k|}
xpath.c:xmlXPathSFComputeHash:
  186|  7.73k|xmlXPathSFComputeHash(const xmlChar *name) {
  187|  7.73k|    unsigned hashValue = 5381;
  188|  7.73k|    const xmlChar *ptr;
  189|       |
  190|  45.9k|    for (ptr = name; *ptr; ptr++)
  ------------------
  |  Branch (190:22): [True: 38.2k, False: 7.73k]
  ------------------
  191|  38.2k|        hashValue = hashValue * 33 + *ptr;
  192|       |
  193|  7.73k|    return(hashValue);
  194|  7.73k|}
xpath.c:wrap_cmp:
  606|  3.33M|    {
  607|  3.33M|        int res = xmlXPathCmpNodesExt(x, y);
  608|  3.33M|        return res == -2 ? res : -res;
  ------------------
  |  Branch (608:16): [True: 0, False: 3.33M]
  ------------------
  609|  3.33M|    }
xpath.c:xmlXPathCmpNodesExt:
  309|  3.33M|xmlXPathCmpNodesExt(xmlNodePtr node1, xmlNodePtr node2) {
  310|  3.33M|    int depth1, depth2;
  311|  3.33M|    int misc = 0, precedence1 = 0, precedence2 = 0;
  312|  3.33M|    xmlNodePtr miscNode1 = NULL, miscNode2 = NULL;
  313|  3.33M|    xmlNodePtr cur, root;
  314|  3.33M|    XML_INTPTR_T l1, l2;
  ------------------
  |  |   52|  3.33M|  #define XML_INTPTR_T intptr_t
  ------------------
  315|       |
  316|  3.33M|    if ((node1 == NULL) || (node2 == NULL))
  ------------------
  |  Branch (316:9): [True: 0, False: 3.33M]
  |  Branch (316:28): [True: 0, False: 3.33M]
  ------------------
  317|      0|	return(-2);
  318|       |
  319|  3.33M|    if (node1 == node2)
  ------------------
  |  Branch (319:9): [True: 0, False: 3.33M]
  ------------------
  320|      0|	return(0);
  321|       |
  322|       |    /*
  323|       |     * a couple of optimizations which will avoid computations in most cases
  324|       |     */
  325|  3.33M|    switch (node1->type) {
  326|  2.67M|	case XML_ELEMENT_NODE:
  ------------------
  |  Branch (326:2): [True: 2.67M, False: 662k]
  ------------------
  327|  2.67M|	    if (node2->type == XML_ELEMENT_NODE) {
  ------------------
  |  Branch (327:10): [True: 2.16M, False: 513k]
  ------------------
  328|  2.16M|		if ((0 > XML_NODE_SORT_VALUE(node1)) &&
  ------------------
  |  |  295|  2.16M|#define XML_NODE_SORT_VALUE(n) XML_PTR_TO_INT((n)->content)
  |  |  ------------------
  |  |  |  |   58|  2.16M|#define XML_PTR_TO_INT(p) ((XML_INTPTR_T) (p))
  |  |  ------------------
  ------------------
  |  Branch (328:7): [True: 0, False: 2.16M]
  ------------------
  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.16M|		    goto turtle_comparison;
  340|  2.16M|	    }
  341|   513k|	    break;
  342|   513k|	case XML_ATTRIBUTE_NODE:
  ------------------
  |  Branch (342:2): [True: 6.96k, False: 3.33M]
  ------------------
  343|  6.96k|	    precedence1 = 1; /* element is owner */
  344|  6.96k|	    miscNode1 = node1;
  345|  6.96k|	    node1 = node1->parent;
  346|  6.96k|	    misc = 1;
  347|  6.96k|	    break;
  348|   548k|	case XML_TEXT_NODE:
  ------------------
  |  Branch (348:2): [True: 548k, False: 2.79M]
  ------------------
  349|   566k|	case XML_CDATA_SECTION_NODE:
  ------------------
  |  Branch (349:2): [True: 17.1k, False: 3.32M]
  ------------------
  350|   570k|	case XML_COMMENT_NODE:
  ------------------
  |  Branch (350:2): [True: 4.19k, False: 3.33M]
  ------------------
  351|   619k|	case XML_PI_NODE: {
  ------------------
  |  Branch (351:2): [True: 49.2k, False: 3.29M]
  ------------------
  352|   619k|	    miscNode1 = node1;
  353|       |	    /*
  354|       |	    * Find nearest element node.
  355|       |	    */
  356|   619k|	    if (node1->prev != NULL) {
  ------------------
  |  Branch (356:10): [True: 256k, False: 362k]
  ------------------
  357|  5.25M|		do {
  358|  5.25M|		    node1 = node1->prev;
  359|  5.25M|		    if (node1->type == XML_ELEMENT_NODE) {
  ------------------
  |  Branch (359:11): [True: 252k, False: 4.99M]
  ------------------
  360|   252k|			precedence1 = 3; /* element in prev-sibl axis */
  361|   252k|			break;
  362|   252k|		    }
  363|  4.99M|		    if (node1->prev == NULL) {
  ------------------
  |  Branch (363:11): [True: 3.64k, False: 4.99M]
  ------------------
  364|  3.64k|			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|  3.64k|			node1 = node1->parent;
  370|  3.64k|			break;
  371|  3.64k|		    }
  372|  4.99M|		} while (1);
  ------------------
  |  Branch (372:12): [True: 4.99M, Folded]
  ------------------
  373|   362k|	    } else {
  374|   362k|		precedence1 = 2; /* element is parent */
  375|   362k|		node1 = node1->parent;
  376|   362k|	    }
  377|   619k|	    if ((node1 == NULL) || (node1->type != XML_ELEMENT_NODE) ||
  ------------------
  |  Branch (377:10): [True: 0, False: 619k]
  |  Branch (377:29): [True: 635, False: 618k]
  ------------------
  378|   619k|		(0 <= XML_NODE_SORT_VALUE(node1))) {
  ------------------
  |  |  295|   618k|#define XML_NODE_SORT_VALUE(n) XML_PTR_TO_INT((n)->content)
  |  |  ------------------
  |  |  |  |   58|   618k|#define XML_PTR_TO_INT(p) ((XML_INTPTR_T) (p))
  |  |  ------------------
  ------------------
  |  Branch (378:3): [True: 618k, False: 0]
  ------------------
  379|       |		/*
  380|       |		* Fallback for whatever case.
  381|       |		*/
  382|   619k|		node1 = miscNode1;
  383|   619k|		precedence1 = 0;
  384|   619k|	    } else
  385|      0|		misc = 1;
  386|   619k|	}
  387|   619k|	    break;
  388|  6.14k|	case XML_NAMESPACE_DECL:
  ------------------
  |  Branch (388:2): [True: 6.14k, False: 3.33M]
  ------------------
  389|       |	    /*
  390|       |	    * TODO: why do we return 1 for namespace nodes?
  391|       |	    */
  392|  6.14k|	    return(1);
  393|  30.2k|	default:
  ------------------
  |  Branch (393:2): [True: 30.2k, False: 3.30M]
  ------------------
  394|  30.2k|	    break;
  395|  3.33M|    }
  396|  1.16M|    switch (node2->type) {
  397|   402k|	case XML_ELEMENT_NODE:
  ------------------
  |  Branch (397:2): [True: 402k, False: 767k]
  ------------------
  398|   402k|	    break;
  399|  11.6k|	case XML_ATTRIBUTE_NODE:
  ------------------
  |  Branch (399:2): [True: 11.6k, False: 1.15M]
  ------------------
  400|  11.6k|	    precedence2 = 1; /* element is owner */
  401|  11.6k|	    miscNode2 = node2;
  402|  11.6k|	    node2 = node2->parent;
  403|  11.6k|	    misc = 1;
  404|  11.6k|	    break;
  405|   602k|	case XML_TEXT_NODE:
  ------------------
  |  Branch (405:2): [True: 602k, False: 567k]
  ------------------
  406|   621k|	case XML_CDATA_SECTION_NODE:
  ------------------
  |  Branch (406:2): [True: 18.3k, False: 1.15M]
  ------------------
  407|   625k|	case XML_COMMENT_NODE:
  ------------------
  |  Branch (407:2): [True: 4.19k, False: 1.16M]
  ------------------
  408|   674k|	case XML_PI_NODE: {
  ------------------
  |  Branch (408:2): [True: 49.2k, False: 1.12M]
  ------------------
  409|   674k|	    miscNode2 = node2;
  410|   674k|	    if (node2->prev != NULL) {
  ------------------
  |  Branch (410:10): [True: 275k, False: 399k]
  ------------------
  411|  5.27M|		do {
  412|  5.27M|		    node2 = node2->prev;
  413|  5.27M|		    if (node2->type == XML_ELEMENT_NODE) {
  ------------------
  |  Branch (413:11): [True: 271k, False: 5.00M]
  ------------------
  414|   271k|			precedence2 = 3; /* element in prev-sibl axis */
  415|   271k|			break;
  416|   271k|		    }
  417|  5.00M|		    if (node2->prev == NULL) {
  ------------------
  |  Branch (417:11): [True: 3.74k, False: 4.99M]
  ------------------
  418|  3.74k|			precedence2 = 2; /* element is parent */
  419|  3.74k|			node2 = node2->parent;
  420|  3.74k|			break;
  421|  3.74k|		    }
  422|  5.00M|		} while (1);
  ------------------
  |  Branch (422:12): [True: 4.99M, Folded]
  ------------------
  423|   399k|	    } else {
  424|   399k|		precedence2 = 2; /* element is parent */
  425|   399k|		node2 = node2->parent;
  426|   399k|	    }
  427|   674k|	    if ((node2 == NULL) || (node2->type != XML_ELEMENT_NODE) ||
  ------------------
  |  Branch (427:10): [True: 0, False: 674k]
  |  Branch (427:29): [True: 580, False: 673k]
  ------------------
  428|   673k|		(0 <= XML_NODE_SORT_VALUE(node2)))
  ------------------
  |  |  295|   673k|#define XML_NODE_SORT_VALUE(n) XML_PTR_TO_INT((n)->content)
  |  |  ------------------
  |  |  |  |   58|   673k|#define XML_PTR_TO_INT(p) ((XML_INTPTR_T) (p))
  |  |  ------------------
  ------------------
  |  Branch (428:3): [True: 673k, False: 0]
  ------------------
  429|   674k|	    {
  430|   674k|		node2 = miscNode2;
  431|   674k|		precedence2 = 0;
  432|   674k|	    } else
  433|      0|		misc = 1;
  434|   674k|	}
  435|   674k|	    break;
  436|    138|	case XML_NAMESPACE_DECL:
  ------------------
  |  Branch (436:2): [True: 138, False: 1.16M]
  ------------------
  437|    138|	    return(1);
  438|  80.9k|	default:
  ------------------
  |  Branch (438:2): [True: 80.9k, False: 1.08M]
  ------------------
  439|  80.9k|	    break;
  440|  1.16M|    }
  441|  1.16M|    if (misc) {
  ------------------
  |  Branch (441:9): [True: 16.6k, False: 1.15M]
  ------------------
  442|  16.6k|	if (node1 == node2) {
  ------------------
  |  Branch (442:6): [True: 1.97k, False: 14.6k]
  ------------------
  443|  1.97k|	    if (precedence1 == precedence2) {
  ------------------
  |  Branch (443:10): [True: 837, False: 1.13k]
  ------------------
  444|       |		/*
  445|       |		* The ugly case; but normally there aren't many
  446|       |		* adjacent non-element nodes around.
  447|       |		*/
  448|    837|		cur = miscNode2->prev;
  449|    972|		while (cur != NULL) {
  ------------------
  |  Branch (449:10): [True: 402, False: 570]
  ------------------
  450|    402|		    if (cur == miscNode1)
  ------------------
  |  Branch (450:11): [True: 267, False: 135]
  ------------------
  451|    267|			return(1);
  452|    135|		    if (cur->type == XML_ELEMENT_NODE)
  ------------------
  |  Branch (452:11): [True: 0, False: 135]
  ------------------
  453|      0|			return(-1);
  454|    135|		    cur = cur->prev;
  455|    135|		}
  456|    570|		return (-1);
  457|  1.13k|	    } 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.13k|		if (precedence1 < precedence2)
  ------------------
  |  Branch (463:7): [True: 359, False: 778]
  ------------------
  464|    359|		    return(1);
  465|    778|		else
  466|    778|		    return(-1);
  467|  1.13k|	    }
  468|  1.97k|	}
  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|  14.6k|	if ((precedence2 == 3) && (precedence1 > 1)) {
  ------------------
  |  Branch (478:6): [True: 0, False: 14.6k]
  |  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|  14.6k|	if ((precedence1 == 3) && (precedence2 > 1)) {
  ------------------
  |  Branch (486:6): [True: 0, False: 14.6k]
  |  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|  14.6k|    }
  495|       |
  496|       |    /*
  497|       |     * Speedup using document order if available.
  498|       |     */
  499|  1.16M|    if ((node1->type == XML_ELEMENT_NODE) &&
  ------------------
  |  Branch (499:9): [True: 518k, False: 649k]
  ------------------
  500|   518k|	(node2->type == XML_ELEMENT_NODE) &&
  ------------------
  |  Branch (500:2): [True: 12.3k, False: 505k]
  ------------------
  501|  12.3k|	(0 > XML_NODE_SORT_VALUE(node1)) &&
  ------------------
  |  |  295|  12.3k|#define XML_NODE_SORT_VALUE(n) XML_PTR_TO_INT((n)->content)
  |  |  ------------------
  |  |  |  |   58|  12.3k|#define XML_PTR_TO_INT(p) ((XML_INTPTR_T) (p))
  |  |  ------------------
  ------------------
  |  Branch (501:2): [True: 0, False: 12.3k]
  ------------------
  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.33M|turtle_comparison:
  514|       |
  515|  3.33M|    if (node1 == node2->prev)
  ------------------
  |  Branch (515:9): [True: 1.09M, False: 2.23M]
  ------------------
  516|  1.09M|	return(1);
  517|  2.23M|    if (node1 == node2->next)
  ------------------
  |  Branch (517:9): [True: 46.6k, False: 2.18M]
  ------------------
  518|  46.6k|	return(-1);
  519|       |    /*
  520|       |     * compute depth to root
  521|       |     */
  522|  56.8M|    for (depth2 = 0, cur = node2; cur->parent != NULL; cur = cur->parent) {
  ------------------
  |  Branch (522:35): [True: 55.2M, False: 1.53M]
  ------------------
  523|  55.2M|	if (cur->parent == node1)
  ------------------
  |  Branch (523:6): [True: 651k, False: 54.6M]
  ------------------
  524|   651k|	    return(1);
  525|  54.6M|	depth2++;
  526|  54.6M|    }
  527|  1.53M|    root = cur;
  528|  49.1M|    for (depth1 = 0, cur = node1; cur->parent != NULL; cur = cur->parent) {
  ------------------
  |  Branch (528:35): [True: 47.9M, False: 1.19M]
  ------------------
  529|  47.9M|	if (cur->parent == node2)
  ------------------
  |  Branch (529:6): [True: 338k, False: 47.6M]
  ------------------
  530|   338k|	    return(-1);
  531|  47.6M|	depth1++;
  532|  47.6M|    }
  533|       |    /*
  534|       |     * Distinct document (or distinct entities :-( ) case.
  535|       |     */
  536|  1.19M|    if (root != cur) {
  ------------------
  |  Branch (536:9): [True: 0, False: 1.19M]
  ------------------
  537|      0|	return(-2);
  538|      0|    }
  539|       |    /*
  540|       |     * get the nearest common ancestor.
  541|       |     */
  542|  4.31M|    while (depth1 > depth2) {
  ------------------
  |  Branch (542:12): [True: 3.11M, False: 1.19M]
  ------------------
  543|  3.11M|	depth1--;
  544|  3.11M|	node1 = node1->parent;
  545|  3.11M|    }
  546|  7.29M|    while (depth2 > depth1) {
  ------------------
  |  Branch (546:12): [True: 6.09M, False: 1.19M]
  ------------------
  547|  6.09M|	depth2--;
  548|  6.09M|	node2 = node2->parent;
  549|  6.09M|    }
  550|  2.65M|    while (node1->parent != node2->parent) {
  ------------------
  |  Branch (550:12): [True: 1.45M, False: 1.19M]
  ------------------
  551|  1.45M|	node1 = node1->parent;
  552|  1.45M|	node2 = node2->parent;
  553|       |	/* should not happen but just in case ... */
  554|  1.45M|	if ((node1 == NULL) || (node2 == NULL))
  ------------------
  |  Branch (554:6): [True: 0, False: 1.45M]
  |  Branch (554:25): [True: 0, False: 1.45M]
  ------------------
  555|      0|	    return(-2);
  556|  1.45M|    }
  557|       |    /*
  558|       |     * Find who's first.
  559|       |     */
  560|  1.19M|    if (node1 == node2->prev)
  ------------------
  |  Branch (560:9): [True: 342k, False: 855k]
  ------------------
  561|   342k|	return(1);
  562|   855k|    if (node1 == node2->next)
  ------------------
  |  Branch (562:9): [True: 398k, False: 456k]
  ------------------
  563|   398k|	return(-1);
  564|       |    /*
  565|       |     * Speedup using document order if available.
  566|       |     */
  567|   456k|    if ((node1->type == XML_ELEMENT_NODE) &&
  ------------------
  |  Branch (567:9): [True: 451k, False: 5.43k]
  ------------------
  568|   451k|	(node2->type == XML_ELEMENT_NODE) &&
  ------------------
  |  Branch (568:2): [True: 444k, False: 7.13k]
  ------------------
  569|   444k|	(0 > XML_NODE_SORT_VALUE(node1)) &&
  ------------------
  |  |  295|   444k|#define XML_NODE_SORT_VALUE(n) XML_PTR_TO_INT((n)->content)
  |  |  ------------------
  |  |  |  |   58|   444k|#define XML_PTR_TO_INT(p) ((XML_INTPTR_T) (p))
  |  |  ------------------
  ------------------
  |  Branch (569:2): [True: 0, False: 444k]
  ------------------
  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|  4.94M|    for (cur = node1->next;cur != NULL;cur = cur->next)
  ------------------
  |  Branch (581:28): [True: 4.74M, False: 198k]
  ------------------
  582|  4.74M|	if (cur == node2)
  ------------------
  |  Branch (582:6): [True: 257k, False: 4.48M]
  ------------------
  583|   257k|	    return(1);
  584|   198k|    return(-1); /* assume there is no sibling list corruption */
  585|   456k|}
xpath.c:xmlXPathErrFmt:
  707|  7.84k|xmlXPathErrFmt(xmlXPathParserContext *ctxt, int code, const char *fmt, ...) {
  708|  7.84k|    va_list ap;
  709|  7.84k|    xmlStructuredErrorFunc schannel = NULL;
  710|  7.84k|    xmlGenericErrorFunc channel = NULL;
  711|  7.84k|    void *data = NULL;
  712|  7.84k|    xmlNodePtr node = NULL;
  713|  7.84k|    int res;
  714|       |
  715|  7.84k|    if (ctxt == NULL)
  ------------------
  |  Branch (715:9): [True: 0, False: 7.84k]
  ------------------
  716|      0|        return;
  717|  7.84k|    if ((code < 0) || (code > MAXERRNO))
  ------------------
  |  |  668|  7.84k|#define MAXERRNO ((int)(sizeof(xmlXPathErrorMessages) /	\
  |  |  669|  7.84k|		   sizeof(xmlXPathErrorMessages[0])) - 1)
  ------------------
  |  Branch (717:9): [True: 0, False: 7.84k]
  |  Branch (717:23): [True: 0, False: 7.84k]
  ------------------
  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.84k|    if (ctxt->error != 0)
  ------------------
  |  Branch (720:9): [True: 3.03k, False: 4.80k]
  ------------------
  721|  3.03k|        return;
  722|       |
  723|  4.80k|    ctxt->error = code;
  724|       |
  725|  4.80k|    if (ctxt->context != NULL) {
  ------------------
  |  Branch (725:9): [True: 4.80k, False: 0]
  ------------------
  726|  4.80k|        xmlErrorPtr err = &ctxt->context->lastError;
  727|       |
  728|       |        /* Don't overwrite memory error. */
  729|  4.80k|        if (err->code == XML_ERR_NO_MEMORY)
  ------------------
  |  Branch (729:13): [True: 0, False: 4.80k]
  ------------------
  730|      0|            return;
  731|       |
  732|       |        /* cleanup current last error */
  733|  4.80k|        xmlResetError(err);
  734|       |
  735|  4.80k|        err->domain = XML_FROM_XPATH;
  736|  4.80k|        err->code = code + XML_XPATH_EXPRESSION_OK - XPATH_EXPRESSION_OK;
  737|  4.80k|        err->level = XML_ERR_ERROR;
  738|  4.80k|        if (ctxt->base != NULL) {
  ------------------
  |  Branch (738:13): [True: 4.80k, False: 0]
  ------------------
  739|  4.80k|            err->str1 = (char *) xmlStrdup(ctxt->base);
  740|  4.80k|            if (err->str1 == NULL) {
  ------------------
  |  Branch (740:17): [True: 35, False: 4.77k]
  ------------------
  741|     35|                xmlXPathPErrMemory(ctxt);
  742|     35|                return;
  743|     35|            }
  744|  4.80k|        }
  745|  4.77k|        err->int1 = ctxt->cur - ctxt->base;
  746|  4.77k|        err->node = ctxt->context->debugNode;
  747|       |
  748|  4.77k|        schannel = ctxt->context->error;
  749|  4.77k|        data = ctxt->context->userData;
  750|  4.77k|        node = ctxt->context->debugNode;
  751|  4.77k|    }
  752|       |
  753|  4.77k|    if (schannel == NULL) {
  ------------------
  |  Branch (753:9): [True: 0, False: 4.77k]
  ------------------
  754|      0|        channel = xmlGenericError;
  ------------------
  |  |  976|      0|  #define xmlGenericError (*__xmlGenericError())
  ------------------
  755|      0|        data = xmlGenericErrorContext;
  ------------------
  |  |  983|      0|  #define xmlGenericErrorContext (*__xmlGenericErrorContext())
  ------------------
  756|      0|    }
  757|       |
  758|  4.77k|    va_start(ap, fmt);
  759|  4.77k|    res = xmlVRaiseError(schannel, channel, data, NULL, node, XML_FROM_XPATH,
  760|  4.77k|                         code + XML_XPATH_EXPRESSION_OK - XPATH_EXPRESSION_OK,
  761|  4.77k|                         XML_ERR_ERROR, NULL, 0,
  762|  4.77k|                         (const char *) ctxt->base, NULL, NULL,
  763|  4.77k|                         ctxt->cur - ctxt->base, 0,
  764|  4.77k|                         fmt, ap);
  765|  4.77k|    va_end(ap);
  766|  4.77k|    if (res < 0)
  ------------------
  |  Branch (766:9): [True: 42, False: 4.73k]
  ------------------
  767|     42|        xmlXPathPErrMemory(ctxt);
  768|  4.77k|}
xpath.c:xmlXPathCastToNumberInternal:
 1931|   551k|                             xmlXPathObjectPtr val) {
 1932|   551k|    double ret = 0.0;
 1933|       |
 1934|   551k|    if (val == NULL)
  ------------------
  |  Branch (1934:9): [True: 0, False: 551k]
  ------------------
 1935|      0|	return(xmlXPathNAN);
 1936|   551k|    switch (val->type) {
  ------------------
  |  Branch (1936:13): [True: 551k, False: 0]
  ------------------
 1937|      0|    case XPATH_UNDEFINED:
  ------------------
  |  Branch (1937:5): [True: 0, False: 551k]
  ------------------
 1938|      0|	ret = xmlXPathNAN;
 1939|      0|	break;
 1940|   369k|    case XPATH_NODESET:
  ------------------
  |  Branch (1940:5): [True: 369k, False: 181k]
  ------------------
 1941|   369k|    case XPATH_XSLT_TREE: {
  ------------------
  |  Branch (1941:5): [True: 0, False: 551k]
  ------------------
 1942|   369k|        xmlChar *str;
 1943|       |
 1944|   369k|	str = xmlXPathCastNodeSetToString(val->nodesetval);
 1945|   369k|        if (str == NULL) {
  ------------------
  |  Branch (1945:13): [True: 60, False: 369k]
  ------------------
 1946|     60|            xmlXPathPErrMemory(ctxt);
 1947|     60|            ret = xmlXPathNAN;
 1948|   369k|        } else {
 1949|   369k|	    ret = xmlXPathCastStringToNumber(str);
 1950|   369k|            xmlFree(str);
 1951|   369k|        }
 1952|   369k|	break;
 1953|   369k|    }
 1954|   115k|    case XPATH_STRING:
  ------------------
  |  Branch (1954:5): [True: 115k, False: 436k]
  ------------------
 1955|   115k|	ret = xmlXPathCastStringToNumber(val->stringval);
 1956|   115k|	break;
 1957|  40.5k|    case XPATH_NUMBER:
  ------------------
  |  Branch (1957:5): [True: 40.5k, False: 510k]
  ------------------
 1958|  40.5k|	ret = val->floatval;
 1959|  40.5k|	break;
 1960|  25.8k|    case XPATH_BOOLEAN:
  ------------------
  |  Branch (1960:5): [True: 25.8k, False: 525k]
  ------------------
 1961|  25.8k|	ret = xmlXPathCastBooleanToNumber(val->boolval);
 1962|  25.8k|	break;
 1963|      0|    case XPATH_USERS:
  ------------------
  |  Branch (1963:5): [True: 0, False: 551k]
  ------------------
 1964|       |	/* TODO */
 1965|      0|	ret = xmlXPathNAN;
 1966|      0|	break;
 1967|   551k|    }
 1968|   551k|    return(ret);
 1969|   551k|}
xpath.c:xmlXPathNodeSetDupNs:
 2604|   146k|xmlXPathNodeSetDupNs(xmlNodePtr node, xmlNsPtr ns) {
 2605|   146k|    xmlNsPtr cur;
 2606|       |
 2607|   146k|    if ((ns == NULL) || (ns->type != XML_NAMESPACE_DECL))
  ------------------
  |  Branch (2607:9): [True: 0, False: 146k]
  |  Branch (2607:25): [True: 0, False: 146k]
  ------------------
 2608|      0|	return(NULL);
 2609|   146k|    if ((node == NULL) || (node->type == XML_NAMESPACE_DECL))
  ------------------
  |  Branch (2609:9): [True: 0, False: 146k]
  |  Branch (2609:27): [True: 0, False: 146k]
  ------------------
 2610|      0|	return((xmlNodePtr) ns);
 2611|       |
 2612|       |    /*
 2613|       |     * Allocate a new Namespace and fill the fields.
 2614|       |     */
 2615|   146k|    cur = (xmlNsPtr) xmlMalloc(sizeof(xmlNs));
 2616|   146k|    if (cur == NULL)
  ------------------
  |  Branch (2616:9): [True: 20, False: 145k]
  ------------------
 2617|     20|	return(NULL);
 2618|   145k|    memset(cur, 0, sizeof(xmlNs));
 2619|   145k|    cur->type = XML_NAMESPACE_DECL;
 2620|   145k|    if (ns->href != NULL) {
  ------------------
  |  Branch (2620:9): [True: 96.1k, False: 49.8k]
  ------------------
 2621|  96.1k|	cur->href = xmlStrdup(ns->href);
 2622|  96.1k|        if (cur->href == NULL) {
  ------------------
  |  Branch (2622:13): [True: 16, False: 96.1k]
  ------------------
 2623|     16|            xmlFree(cur);
 2624|     16|            return(NULL);
 2625|     16|        }
 2626|  96.1k|    }
 2627|   145k|    if (ns->prefix != NULL) {
  ------------------
  |  Branch (2627:9): [True: 103k, False: 42.2k]
  ------------------
 2628|   103k|	cur->prefix = xmlStrdup(ns->prefix);
 2629|   103k|        if (cur->prefix == NULL) {
  ------------------
  |  Branch (2629:13): [True: 13, False: 103k]
  ------------------
 2630|     13|            xmlFree((xmlChar *) cur->href);
 2631|     13|            xmlFree(cur);
 2632|     13|            return(NULL);
 2633|     13|        }
 2634|   103k|    }
 2635|   145k|    cur->next = (xmlNsPtr) node;
 2636|   145k|    return((xmlNodePtr) cur);
 2637|   145k|}
xpath.c:xmlXPathNodeSetGrow:
 2735|  1.37M|xmlXPathNodeSetGrow(xmlNodeSetPtr cur) {
 2736|  1.37M|    xmlNodePtr *temp;
 2737|  1.37M|    int newSize;
 2738|       |
 2739|  1.37M|    newSize = xmlGrowCapacity(cur->nodeMax, sizeof(temp[0]),
 2740|  1.37M|                              XML_NODESET_DEFAULT, XPATH_MAX_NODESET_LENGTH);
  ------------------
  |  | 2593|  1.37M|#define XML_NODESET_DEFAULT	10
  ------------------
                                            XML_NODESET_DEFAULT, XPATH_MAX_NODESET_LENGTH);
  ------------------
  |  |  105|  1.37M|#define XPATH_MAX_NODESET_LENGTH 10000000
  ------------------
 2741|  1.37M|    if (newSize < 0)
  ------------------
  |  Branch (2741:9): [True: 0, False: 1.37M]
  ------------------
 2742|      0|        return(-1);
 2743|  1.37M|    temp = xmlRealloc(cur->nodeTab, newSize * sizeof(temp[0]));
 2744|  1.37M|    if (temp == NULL)
  ------------------
  |  Branch (2744:9): [True: 269, False: 1.37M]
  ------------------
 2745|    269|        return(-1);
 2746|  1.37M|    cur->nodeMax = newSize;
 2747|  1.37M|    cur->nodeTab = temp;
 2748|       |
 2749|  1.37M|    return(0);
 2750|  1.37M|}
xpath.c:xmlXPathReleaseObject:
 4257|  3.37M|{
 4258|  3.37M|    if (obj == NULL)
  ------------------
  |  Branch (4258:9): [True: 15, False: 3.37M]
  ------------------
 4259|     15|	return;
 4260|  3.37M|    if ((ctxt == NULL) || (ctxt->cache == NULL)) {
  ------------------
  |  Branch (4260:9): [True: 0, False: 3.37M]
  |  Branch (4260:27): [True: 3.37M, False: 0]
  ------------------
 4261|  3.37M|	 xmlXPathFreeObject(obj);
 4262|  3.37M|    } 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.37M|}
xpath.c:xmlXPathFormatNumber:
 2229|  11.0k|{
 2230|  11.0k|    switch (xmlXPathIsInf(number)) {
 2231|      0|    case 1:
  ------------------
  |  Branch (2231:5): [True: 0, False: 11.0k]
  ------------------
 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: 11.0k]
  ------------------
 2236|      0|	if (buffersize > (int)sizeof("-Infinity"))
  ------------------
  |  Branch (2236:6): [True: 0, False: 0]
  ------------------
 2237|      0|	    snprintf(buffer, buffersize, "-Infinity");
 2238|      0|	break;
 2239|  11.0k|    default:
  ------------------
  |  Branch (2239:5): [True: 11.0k, False: 0]
  ------------------
 2240|  11.0k|	if (xmlXPathIsNaN(number)) {
  ------------------
  |  Branch (2240:6): [True: 0, False: 11.0k]
  ------------------
 2241|      0|	    if (buffersize > (int)sizeof("NaN"))
  ------------------
  |  Branch (2241:10): [True: 0, False: 0]
  ------------------
 2242|      0|		snprintf(buffer, buffersize, "NaN");
 2243|  11.0k|	} else if (number == 0) {
  ------------------
  |  Branch (2243:13): [True: 0, False: 11.0k]
  ------------------
 2244|       |            /* Omit sign for negative zero. */
 2245|      0|	    snprintf(buffer, buffersize, "0");
 2246|  11.0k|	} else if ((number > INT_MIN) && (number < INT_MAX) &&
  ------------------
  |  Branch (2246:13): [True: 6.85k, False: 4.23k]
  |  Branch (2246:35): [True: 4.40k, False: 2.44k]
  ------------------
 2247|  4.40k|                   (number == (int) number)) {
  ------------------
  |  Branch (2247:20): [True: 2.58k, False: 1.82k]
  ------------------
 2248|  2.58k|	    char work[30];
 2249|  2.58k|	    char *ptr, *cur;
 2250|  2.58k|	    int value = (int) number;
 2251|       |
 2252|  2.58k|            ptr = &buffer[0];
 2253|  2.58k|	    if (value == 0) {
  ------------------
  |  Branch (2253:10): [True: 0, False: 2.58k]
  ------------------
 2254|      0|		*ptr++ = '0';
 2255|  2.58k|	    } else {
 2256|  2.58k|		snprintf(work, 29, "%d", value);
 2257|  2.58k|		cur = &work[0];
 2258|  21.4k|		while ((*cur) && (ptr - buffer < buffersize)) {
  ------------------
  |  Branch (2258:10): [True: 18.8k, False: 2.58k]
  |  Branch (2258:20): [True: 18.8k, False: 0]
  ------------------
 2259|  18.8k|		    *ptr++ = *cur++;
 2260|  18.8k|		}
 2261|  2.58k|	    }
 2262|  2.58k|	    if (ptr - buffer < buffersize) {
  ------------------
  |  Branch (2262:10): [True: 2.58k, False: 0]
  ------------------
 2263|  2.58k|		*ptr = 0;
 2264|  2.58k|	    } else if (buffersize > 0) {
  ------------------
  |  Branch (2264:17): [True: 0, False: 0]
  ------------------
 2265|      0|		ptr--;
 2266|      0|		*ptr = 0;
 2267|      0|	    }
 2268|  8.50k|	} 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|  8.50k|	    char work[DBL_DIG + EXPONENT_DIGITS + 3 + LOWER_DOUBLE_EXP];
 2279|  8.50k|	    int integer_place, fraction_place;
 2280|  8.50k|	    char *ptr;
 2281|  8.50k|	    char *after_fraction;
 2282|  8.50k|	    double absolute_value;
 2283|  8.50k|	    int size;
 2284|       |
 2285|  8.50k|	    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|  8.50k|	    if ( ((absolute_value > UPPER_DOUBLE) ||
  ------------------
  |  | 2212|  8.50k|#define UPPER_DOUBLE 1E9
  ------------------
  |  Branch (2292:12): [True: 7.10k, False: 1.40k]
  ------------------
 2293|  1.40k|		  (absolute_value < LOWER_DOUBLE)) &&
  ------------------
  |  | 2213|  1.40k|#define LOWER_DOUBLE 1E-5
  ------------------
  |  Branch (2293:5): [True: 71, False: 1.33k]
  ------------------
 2294|  7.17k|		 (absolute_value != 0.0) ) {
  ------------------
  |  Branch (2294:4): [True: 7.17k, False: 0]
  ------------------
 2295|       |		/* Use scientific notation */
 2296|  7.17k|		integer_place = DBL_DIG + EXPONENT_DIGITS + 1;
  ------------------
  |  | 2218|  7.17k|#define EXPONENT_DIGITS (3 + 2)
  ------------------
 2297|  7.17k|		fraction_place = DBL_DIG - 1;
 2298|  7.17k|		size = snprintf(work, sizeof(work),"%*.*e",
 2299|  7.17k|			 integer_place, fraction_place, number);
 2300|  35.8k|		while ((size > 0) && (work[size] != 'e')) size--;
  ------------------
  |  Branch (2300:10): [True: 35.8k, False: 0]
  |  Branch (2300:24): [True: 28.6k, False: 7.17k]
  ------------------
 2301|       |
 2302|  7.17k|	    }
 2303|  1.33k|	    else {
 2304|       |		/* Use regular notation */
 2305|  1.33k|		if (absolute_value > 0.0) {
  ------------------
  |  Branch (2305:7): [True: 1.33k, False: 0]
  ------------------
 2306|  1.33k|		    integer_place = (int)log10(absolute_value);
 2307|  1.33k|		    if (integer_place > 0)
  ------------------
  |  Branch (2307:11): [True: 1.17k, False: 163]
  ------------------
 2308|  1.17k|		        fraction_place = DBL_DIG - integer_place - 1;
 2309|    163|		    else
 2310|    163|		        fraction_place = DBL_DIG - integer_place;
 2311|  1.33k|		} else {
 2312|      0|		    fraction_place = 1;
 2313|      0|		}
 2314|  1.33k|		size = snprintf(work, sizeof(work), "%0.*f",
 2315|  1.33k|				fraction_place, number);
 2316|  1.33k|	    }
 2317|       |
 2318|       |	    /* Remove leading spaces sometimes inserted by snprintf */
 2319|  11.3k|	    while (work[0] == ' ') {
  ------------------
  |  Branch (2319:13): [True: 2.86k, False: 8.50k]
  ------------------
 2320|  60.1k|	        for (ptr = &work[0];(ptr[0] = ptr[1]);ptr++);
  ------------------
  |  Branch (2320:30): [True: 57.3k, False: 2.86k]
  ------------------
 2321|  2.86k|		size--;
 2322|  2.86k|	    }
 2323|       |
 2324|       |	    /* Remove fractional trailing zeroes */
 2325|  8.50k|	    after_fraction = work + size;
 2326|  8.50k|	    ptr = after_fraction;
 2327|  34.8k|	    while (*(--ptr) == '0')
  ------------------
  |  Branch (2327:13): [True: 26.3k, False: 8.50k]
  ------------------
 2328|  26.3k|		;
 2329|  8.50k|	    if (*ptr != '.')
  ------------------
  |  Branch (2329:10): [True: 7.35k, False: 1.15k]
  ------------------
 2330|  7.35k|	        ptr++;
 2331|  37.2k|	    while ((*ptr++ = *after_fraction++) != 0);
  ------------------
  |  Branch (2331:13): [True: 28.6k, False: 8.50k]
  ------------------
 2332|       |
 2333|       |	    /* Finally copy result back to caller */
 2334|  8.50k|	    size = strlen(work) + 1;
 2335|  8.50k|	    if (size > buffersize) {
  ------------------
  |  Branch (2335:10): [True: 0, False: 8.50k]
  ------------------
 2336|      0|		work[buffersize - 1] = 0;
 2337|      0|		size = buffersize;
 2338|      0|	    }
 2339|  8.50k|	    memmove(buffer, work, size);
 2340|  8.50k|	}
 2341|  11.0k|	break;
 2342|  11.0k|    }
 2343|  11.0k|}
xpath.c:xmlXPathNodeToNumberInternal:
 4532|   110k|xmlXPathNodeToNumberInternal(xmlXPathParserContextPtr ctxt, xmlNodePtr node) {
 4533|   110k|    xmlChar *strval;
 4534|   110k|    double ret;
 4535|       |
 4536|   110k|    if (node == NULL)
  ------------------
  |  Branch (4536:9): [True: 0, False: 110k]
  ------------------
 4537|      0|	return(xmlXPathNAN);
 4538|   110k|    strval = xmlXPathCastNodeToString(node);
 4539|   110k|    if (strval == NULL) {
  ------------------
  |  Branch (4539:9): [True: 13, False: 110k]
  ------------------
 4540|     13|        xmlXPathPErrMemory(ctxt);
 4541|     13|	return(xmlXPathNAN);
 4542|     13|    }
 4543|   110k|    ret = xmlXPathCastStringToNumber(strval);
 4544|   110k|    xmlFree(strval);
 4545|       |
 4546|   110k|    return(ret);
 4547|   110k|}
xpath.c:xmlXPathNewCompExpr:
  940|  10.4k|xmlXPathNewCompExpr(void) {
  941|  10.4k|    xmlXPathCompExprPtr cur;
  942|       |
  943|  10.4k|    cur = (xmlXPathCompExprPtr) xmlMalloc(sizeof(xmlXPathCompExpr));
  944|  10.4k|    if (cur == NULL)
  ------------------
  |  Branch (944:9): [True: 28, False: 10.3k]
  ------------------
  945|     28|	return(NULL);
  946|  10.3k|    memset(cur, 0, sizeof(xmlXPathCompExpr));
  947|  10.3k|#ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
  948|  10.3k|    cur->maxStep = 1;
  949|       |#else
  950|       |    cur->maxStep = 10;
  951|       |#endif
  952|  10.3k|    cur->nbStep = 0;
  953|  10.3k|    cur->steps = (xmlXPathStepOp *) xmlMalloc(cur->maxStep *
  954|  10.3k|	                                   sizeof(xmlXPathStepOp));
  955|  10.3k|    if (cur->steps == NULL) {
  ------------------
  |  Branch (955:9): [True: 19, False: 10.3k]
  ------------------
  956|     19|	xmlFree(cur);
  957|     19|	return(NULL);
  958|     19|    }
  959|  10.3k|    memset(cur->steps, 0, cur->maxStep * sizeof(xmlXPathStepOp));
  960|  10.3k|    cur->last = -1;
  961|  10.3k|    return(cur);
  962|  10.3k|}
xpath.c:xmlXPathEqualNodeSets:
 5433|  35.9k|                      xmlXPathObjectPtr arg2, int neq) {
 5434|  35.9k|    int i, j;
 5435|  35.9k|    unsigned int *hashs1;
 5436|  35.9k|    unsigned int *hashs2;
 5437|  35.9k|    xmlChar **values1;
 5438|  35.9k|    xmlChar **values2;
 5439|  35.9k|    int ret = 0;
 5440|  35.9k|    xmlNodeSetPtr ns1;
 5441|  35.9k|    xmlNodeSetPtr ns2;
 5442|       |
 5443|  35.9k|    if ((arg1 == NULL) ||
  ------------------
  |  Branch (5443:9): [True: 0, False: 35.9k]
  ------------------
 5444|  35.9k|	((arg1->type != XPATH_NODESET) && (arg1->type != XPATH_XSLT_TREE)))
  ------------------
  |  Branch (5444:3): [True: 0, False: 35.9k]
  |  Branch (5444:36): [True: 0, False: 0]
  ------------------
 5445|      0|        return(0);
 5446|  35.9k|    if ((arg2 == NULL) ||
  ------------------
  |  Branch (5446:9): [True: 0, False: 35.9k]
  ------------------
 5447|  35.9k|	((arg2->type != XPATH_NODESET) && (arg2->type != XPATH_XSLT_TREE)))
  ------------------
  |  Branch (5447:3): [True: 0, False: 35.9k]
  |  Branch (5447:36): [True: 0, False: 0]
  ------------------
 5448|      0|        return(0);
 5449|       |
 5450|  35.9k|    ns1 = arg1->nodesetval;
 5451|  35.9k|    ns2 = arg2->nodesetval;
 5452|       |
 5453|  35.9k|    if ((ns1 == NULL) || (ns1->nodeNr <= 0))
  ------------------
  |  Branch (5453:9): [True: 0, False: 35.9k]
  |  Branch (5453:26): [True: 14.5k, False: 21.3k]
  ------------------
 5454|  14.5k|	return(0);
 5455|  21.3k|    if ((ns2 == NULL) || (ns2->nodeNr <= 0))
  ------------------
  |  Branch (5455:9): [True: 0, False: 21.3k]
  |  Branch (5455:26): [True: 427, False: 20.9k]
  ------------------
 5456|    427|	return(0);
 5457|       |
 5458|       |    /*
 5459|       |     * for equal, check if there is a node pertaining to both sets
 5460|       |     */
 5461|  20.9k|    if (neq == 0)
  ------------------
  |  Branch (5461:9): [True: 20.4k, False: 501]
  ------------------
 5462|  42.2k|	for (i = 0;i < ns1->nodeNr;i++)
  ------------------
  |  Branch (5462:13): [True: 22.3k, False: 19.9k]
  ------------------
 5463|  67.5k|	    for (j = 0;j < ns2->nodeNr;j++)
  ------------------
  |  Branch (5463:17): [True: 45.7k, False: 21.7k]
  ------------------
 5464|  45.7k|		if (ns1->nodeTab[i] == ns2->nodeTab[j])
  ------------------
  |  Branch (5464:7): [True: 527, False: 45.2k]
  ------------------
 5465|    527|		    return(1);
 5466|       |
 5467|  20.4k|    values1 = (xmlChar **) xmlMalloc(ns1->nodeNr * sizeof(xmlChar *));
 5468|  20.4k|    if (values1 == NULL) {
  ------------------
  |  Branch (5468:9): [True: 2, False: 20.4k]
  ------------------
 5469|      2|        xmlXPathPErrMemory(ctxt);
 5470|      2|	return(0);
 5471|      2|    }
 5472|  20.4k|    hashs1 = (unsigned int *) xmlMalloc(ns1->nodeNr * sizeof(unsigned int));
 5473|  20.4k|    if (hashs1 == NULL) {
  ------------------
  |  Branch (5473:9): [True: 3, False: 20.4k]
  ------------------
 5474|      3|        xmlXPathPErrMemory(ctxt);
 5475|      3|	xmlFree(values1);
 5476|      3|	return(0);
 5477|      3|    }
 5478|  20.4k|    memset(values1, 0, ns1->nodeNr * sizeof(xmlChar *));
 5479|  20.4k|    values2 = (xmlChar **) xmlMalloc(ns2->nodeNr * sizeof(xmlChar *));
 5480|  20.4k|    if (values2 == NULL) {
  ------------------
  |  Branch (5480:9): [True: 1, False: 20.4k]
  ------------------
 5481|      1|        xmlXPathPErrMemory(ctxt);
 5482|      1|	xmlFree(hashs1);
 5483|      1|	xmlFree(values1);
 5484|      1|	return(0);
 5485|      1|    }
 5486|  20.4k|    hashs2 = (unsigned int *) xmlMalloc(ns2->nodeNr * sizeof(unsigned int));
 5487|  20.4k|    if (hashs2 == NULL) {
  ------------------
  |  Branch (5487:9): [True: 1, False: 20.4k]
  ------------------
 5488|      1|        xmlXPathPErrMemory(ctxt);
 5489|      1|	xmlFree(hashs1);
 5490|      1|	xmlFree(values1);
 5491|      1|	xmlFree(values2);
 5492|      1|	return(0);
 5493|      1|    }
 5494|  20.4k|    memset(values2, 0, ns2->nodeNr * sizeof(xmlChar *));
 5495|  40.8k|    for (i = 0;i < ns1->nodeNr;i++) {
  ------------------
  |  Branch (5495:16): [True: 22.0k, False: 18.7k]
  ------------------
 5496|  22.0k|	hashs1[i] = xmlXPathNodeValHash(ns1->nodeTab[i]);
 5497|  64.6k|	for (j = 0;j < ns2->nodeNr;j++) {
  ------------------
  |  Branch (5497:13): [True: 44.2k, False: 20.3k]
  ------------------
 5498|  44.2k|	    if (i == 0)
  ------------------
  |  Branch (5498:10): [True: 42.1k, False: 2.08k]
  ------------------
 5499|  42.1k|		hashs2[j] = xmlXPathNodeValHash(ns2->nodeTab[j]);
 5500|  44.2k|	    if (hashs1[i] != hashs2[j]) {
  ------------------
  |  Branch (5500:10): [True: 41.5k, False: 2.70k]
  ------------------
 5501|  41.5k|		if (neq) {
  ------------------
  |  Branch (5501:7): [True: 238, False: 41.3k]
  ------------------
 5502|    238|		    ret = 1;
 5503|    238|		    break;
 5504|    238|		}
 5505|  41.5k|	    }
 5506|  2.70k|	    else {
 5507|  2.70k|		if (values1[i] == NULL) {
  ------------------
  |  Branch (5507:7): [True: 2.16k, False: 538]
  ------------------
 5508|  2.16k|		    values1[i] = xmlNodeGetContent(ns1->nodeTab[i]);
 5509|  2.16k|                    if (values1[i] == NULL)
  ------------------
  |  Branch (5509:25): [True: 5, False: 2.16k]
  ------------------
 5510|      5|                        xmlXPathPErrMemory(ctxt);
 5511|  2.16k|                }
 5512|  2.70k|		if (values2[j] == NULL) {
  ------------------
  |  Branch (5512:7): [True: 1.84k, False: 857]
  ------------------
 5513|  1.84k|		    values2[j] = xmlNodeGetContent(ns2->nodeTab[j]);
 5514|  1.84k|                    if (values2[j] == NULL)
  ------------------
  |  Branch (5514:25): [True: 5, False: 1.84k]
  ------------------
 5515|      5|                        xmlXPathPErrMemory(ctxt);
 5516|  1.84k|                }
 5517|  2.70k|		ret = xmlStrEqual(values1[i], values2[j]) ^ neq;
 5518|  2.70k|		if (ret)
  ------------------
  |  Branch (5518:7): [True: 1.40k, False: 1.29k]
  ------------------
 5519|  1.40k|		    break;
 5520|  2.70k|	    }
 5521|  44.2k|	}
 5522|  22.0k|	if (ret)
  ------------------
  |  Branch (5522:6): [True: 1.64k, False: 20.3k]
  ------------------
 5523|  1.64k|	    break;
 5524|  22.0k|    }
 5525|  43.3k|    for (i = 0;i < ns1->nodeNr;i++)
  ------------------
  |  Branch (5525:16): [True: 22.9k, False: 20.4k]
  ------------------
 5526|  22.9k|	if (values1[i] != NULL)
  ------------------
  |  Branch (5526:6): [True: 2.16k, False: 20.7k]
  ------------------
 5527|  2.16k|	    xmlFree(values1[i]);
 5528|  64.3k|    for (j = 0;j < ns2->nodeNr;j++)
  ------------------
  |  Branch (5528:16): [True: 43.8k, False: 20.4k]
  ------------------
 5529|  43.8k|	if (values2[j] != NULL)
  ------------------
  |  Branch (5529:6): [True: 1.84k, False: 42.0k]
  ------------------
 5530|  1.84k|	    xmlFree(values2[j]);
 5531|  20.4k|    xmlFree(values1);
 5532|  20.4k|    xmlFree(values2);
 5533|  20.4k|    xmlFree(hashs1);
 5534|  20.4k|    xmlFree(hashs2);
 5535|  20.4k|    return(ret);
 5536|  20.4k|}
xpath.c:xmlXPathNodeValHash:
 4920|  78.3k|xmlXPathNodeValHash(xmlNodePtr node) {
 4921|  78.3k|    int len = 2;
 4922|  78.3k|    const xmlChar * string = NULL;
 4923|  78.3k|    xmlNodePtr tmp = NULL;
 4924|  78.3k|    unsigned int ret = 0;
 4925|       |
 4926|  78.3k|    if (node == NULL)
  ------------------
  |  Branch (4926:9): [True: 0, False: 78.3k]
  ------------------
 4927|      0|	return(0);
 4928|       |
 4929|  78.3k|    if (node->type == XML_DOCUMENT_NODE) {
  ------------------
  |  Branch (4929:9): [True: 20.5k, False: 57.8k]
  ------------------
 4930|  20.5k|	tmp = xmlDocGetRootElement((xmlDocPtr) node);
 4931|  20.5k|	if (tmp == NULL)
  ------------------
  |  Branch (4931:6): [True: 0, False: 20.5k]
  ------------------
 4932|      0|	    node = node->children;
 4933|  20.5k|	else
 4934|  20.5k|	    node = tmp;
 4935|       |
 4936|  20.5k|	if (node == NULL)
  ------------------
  |  Branch (4936:6): [True: 0, False: 20.5k]
  ------------------
 4937|      0|	    return(0);
 4938|  20.5k|    }
 4939|       |
 4940|  78.3k|    switch (node->type) {
 4941|    655|	case XML_COMMENT_NODE:
  ------------------
  |  Branch (4941:2): [True: 655, False: 77.7k]
  ------------------
 4942|  1.55k|	case XML_PI_NODE:
  ------------------
  |  Branch (4942:2): [True: 904, False: 77.4k]
  ------------------
 4943|  2.32k|	case XML_CDATA_SECTION_NODE:
  ------------------
  |  Branch (4943:2): [True: 767, False: 77.6k]
  ------------------
 4944|  8.30k|	case XML_TEXT_NODE:
  ------------------
  |  Branch (4944:2): [True: 5.97k, False: 72.4k]
  ------------------
 4945|  8.30k|	    string = node->content;
 4946|  8.30k|	    if (string == NULL)
  ------------------
  |  Branch (4946:10): [True: 904, False: 7.39k]
  ------------------
 4947|    904|		return(0);
 4948|  7.39k|	    if (string[0] == 0)
  ------------------
  |  Branch (4948:10): [True: 29, False: 7.36k]
  ------------------
 4949|     29|		return(0);
 4950|  7.36k|	    return(string[0] + (string[1] << 8));
 4951|    289|	case XML_NAMESPACE_DECL:
  ------------------
  |  Branch (4951:2): [True: 289, False: 78.1k]
  ------------------
 4952|    289|	    string = ((xmlNsPtr)node)->href;
 4953|    289|	    if (string == NULL)
  ------------------
  |  Branch (4953:10): [True: 140, False: 149]
  ------------------
 4954|    140|		return(0);
 4955|    149|	    if (string[0] == 0)
  ------------------
  |  Branch (4955:10): [True: 0, False: 149]
  ------------------
 4956|      0|		return(0);
 4957|    149|	    return(string[0] + (string[1] << 8));
 4958|    919|	case XML_ATTRIBUTE_NODE:
  ------------------
  |  Branch (4958:2): [True: 919, False: 77.4k]
  ------------------
 4959|    919|	    tmp = ((xmlAttrPtr) node)->children;
 4960|    919|	    break;
 4961|  68.8k|	case XML_ELEMENT_NODE:
  ------------------
  |  Branch (4961:2): [True: 68.8k, False: 9.51k]
  ------------------
 4962|  68.8k|	    tmp = node->children;
 4963|  68.8k|	    break;
 4964|      0|	default:
  ------------------
  |  Branch (4964:2): [True: 0, False: 78.3k]
  ------------------
 4965|      0|	    return(0);
 4966|  78.3k|    }
 4967|   327k|    while (tmp != NULL) {
  ------------------
  |  Branch (4967:12): [True: 288k, False: 38.8k]
  ------------------
 4968|   288k|	switch (tmp->type) {
 4969|  17.4k|	    case XML_CDATA_SECTION_NODE:
  ------------------
  |  Branch (4969:6): [True: 17.4k, False: 271k]
  ------------------
 4970|  53.0k|	    case XML_TEXT_NODE:
  ------------------
  |  Branch (4970:6): [True: 35.6k, False: 253k]
  ------------------
 4971|  53.0k|		string = tmp->content;
 4972|  53.0k|		break;
 4973|   235k|	    default:
  ------------------
  |  Branch (4973:6): [True: 235k, False: 53.0k]
  ------------------
 4974|   235k|                string = NULL;
 4975|   235k|		break;
 4976|   288k|	}
 4977|   288k|	if ((string != NULL) && (string[0] != 0)) {
  ------------------
  |  Branch (4977:6): [True: 53.0k, False: 235k]
  |  Branch (4977:26): [True: 52.8k, False: 252]
  ------------------
 4978|  52.8k|	    if (len == 1) {
  ------------------
  |  Branch (4978:10): [True: 20.5k, False: 32.3k]
  ------------------
 4979|  20.5k|		return(ret + (string[0] << 8));
 4980|  20.5k|	    }
 4981|  32.3k|	    if (string[1] == 0) {
  ------------------
  |  Branch (4981:10): [True: 21.8k, False: 10.4k]
  ------------------
 4982|  21.8k|		len = 1;
 4983|  21.8k|		ret = string[0];
 4984|  21.8k|	    } else {
 4985|  10.4k|		return(string[0] + (string[1] << 8));
 4986|  10.4k|	    }
 4987|  32.3k|	}
 4988|       |	/*
 4989|       |	 * Skip to next node
 4990|       |	 */
 4991|   257k|        if ((tmp->children != NULL) &&
  ------------------
  |  Branch (4991:13): [True: 49.4k, False: 208k]
  ------------------
 4992|  49.4k|            (tmp->type != XML_DTD_NODE) &&
  ------------------
  |  Branch (4992:13): [True: 49.4k, False: 0]
  ------------------
 4993|  49.4k|            (tmp->type != XML_ENTITY_REF_NODE) &&
  ------------------
  |  Branch (4993:13): [True: 49.4k, False: 0]
  ------------------
 4994|  49.4k|            (tmp->children->type != XML_ENTITY_DECL)) {
  ------------------
  |  Branch (4994:13): [True: 49.4k, False: 0]
  ------------------
 4995|  49.4k|            tmp = tmp->children;
 4996|  49.4k|            continue;
 4997|  49.4k|	}
 4998|   208k|	if (tmp == node)
  ------------------
  |  Branch (4998:6): [True: 0, False: 208k]
  ------------------
 4999|      0|	    break;
 5000|       |
 5001|   208k|	if (tmp->next != NULL) {
  ------------------
  |  Branch (5001:6): [True: 206k, False: 2.21k]
  ------------------
 5002|   206k|	    tmp = tmp->next;
 5003|   206k|	    continue;
 5004|   206k|	}
 5005|       |
 5006|  4.06k|	do {
 5007|  4.06k|	    tmp = tmp->parent;
 5008|  4.06k|	    if (tmp == NULL)
  ------------------
  |  Branch (5008:10): [True: 0, False: 4.06k]
  ------------------
 5009|      0|		break;
 5010|  4.06k|	    if (tmp == node) {
  ------------------
  |  Branch (5010:10): [True: 1.77k, False: 2.29k]
  ------------------
 5011|  1.77k|		tmp = NULL;
 5012|  1.77k|		break;
 5013|  1.77k|	    }
 5014|  2.29k|	    if (tmp->next != NULL) {
  ------------------
  |  Branch (5014:10): [True: 443, False: 1.85k]
  ------------------
 5015|    443|		tmp = tmp->next;
 5016|    443|		break;
 5017|    443|	    }
 5018|  2.29k|	} while (tmp != NULL);
  ------------------
  |  Branch (5018:11): [True: 1.85k, False: 0]
  ------------------
 5019|  2.21k|    }
 5020|  38.8k|    return(ret);
 5021|  69.8k|}
xpath.c:xmlXPathEqualNodeSetFloat:
 5370|  31.8k|    xmlXPathObjectPtr arg, double f, int neq) {
 5371|  31.8k|  int i, ret=0;
 5372|  31.8k|  xmlNodeSetPtr ns;
 5373|  31.8k|  xmlChar *str2;
 5374|  31.8k|  xmlXPathObjectPtr val;
 5375|  31.8k|  double v;
 5376|       |
 5377|  31.8k|    if ((arg == NULL) ||
  ------------------
  |  Branch (5377:9): [True: 0, False: 31.8k]
  ------------------
 5378|  31.8k|	((arg->type != XPATH_NODESET) && (arg->type != XPATH_XSLT_TREE)))
  ------------------
  |  Branch (5378:3): [True: 0, False: 31.8k]
  |  Branch (5378:35): [True: 0, False: 0]
  ------------------
 5379|      0|        return(0);
 5380|       |
 5381|  31.8k|    ns = arg->nodesetval;
 5382|  31.8k|    if (ns != NULL) {
  ------------------
  |  Branch (5382:9): [True: 31.8k, False: 0]
  ------------------
 5383|  85.9k|	for (i=0;i<ns->nodeNr;i++) {
  ------------------
  |  Branch (5383:11): [True: 54.5k, False: 31.4k]
  ------------------
 5384|  54.5k|	    str2 = xmlXPathCastNodeToString(ns->nodeTab[i]);
 5385|  54.5k|	    if (str2 != NULL) {
  ------------------
  |  Branch (5385:10): [True: 54.5k, False: 17]
  ------------------
 5386|  54.5k|		xmlXPathValuePush(ctxt, xmlXPathCacheNewString(ctxt, str2));
 5387|  54.5k|		xmlFree(str2);
 5388|  54.5k|		xmlXPathNumberFunction(ctxt, 1);
 5389|  54.5k|                CHECK_ERROR0;
  ------------------
  |  |  236|  54.5k|    if (ctxt->error != XPATH_EXPRESSION_OK) return(0)
  |  |  ------------------
  |  |  |  Branch (236:9): [True: 23, False: 54.4k]
  |  |  ------------------
  ------------------
 5390|  54.4k|		val = xmlXPathValuePop(ctxt);
 5391|  54.4k|		v = val->floatval;
 5392|  54.4k|		xmlXPathReleaseObject(ctxt->context, val);
 5393|  54.4k|		if (!xmlXPathIsNaN(v)) {
  ------------------
  |  Branch (5393:7): [True: 2.13k, False: 52.3k]
  ------------------
 5394|  2.13k|		    if ((!neq) && (v==f)) {
  ------------------
  |  Branch (5394:11): [True: 2.00k, False: 129]
  |  Branch (5394:21): [True: 279, False: 1.73k]
  ------------------
 5395|    279|			ret = 1;
 5396|    279|			break;
 5397|  1.85k|		    } else if ((neq) && (v!=f)) {
  ------------------
  |  Branch (5397:18): [True: 129, False: 1.73k]
  |  Branch (5397:27): [True: 105, False: 24]
  ------------------
 5398|    105|			ret = 1;
 5399|    105|			break;
 5400|    105|		    }
 5401|  52.3k|		} else {	/* NaN is unequal to any value */
 5402|  52.3k|		    if (neq)
  ------------------
  |  Branch (5402:11): [True: 950, False: 51.3k]
  ------------------
 5403|    950|			ret = 1;
 5404|  52.3k|		}
 5405|  54.4k|	    } else {
 5406|     17|                xmlXPathPErrMemory(ctxt);
 5407|     17|            }
 5408|  54.5k|	}
 5409|  31.8k|    }
 5410|       |
 5411|  31.7k|    return(ret);
 5412|  31.8k|}
xpath.c:xmlXPathEqualNodeSetString:
 5314|  6.52k|{
 5315|  6.52k|    int i;
 5316|  6.52k|    xmlNodeSetPtr ns;
 5317|  6.52k|    xmlChar *str2;
 5318|  6.52k|    unsigned int hash;
 5319|       |
 5320|  6.52k|    if ((str == NULL) || (arg == NULL) ||
  ------------------
  |  Branch (5320:9): [True: 0, False: 6.52k]
  |  Branch (5320:26): [True: 0, False: 6.52k]
  ------------------
 5321|  6.52k|        ((arg->type != XPATH_NODESET) && (arg->type != XPATH_XSLT_TREE)))
  ------------------
  |  Branch (5321:10): [True: 0, False: 6.52k]
  |  Branch (5321:42): [True: 0, False: 0]
  ------------------
 5322|      0|        return (0);
 5323|  6.52k|    ns = arg->nodesetval;
 5324|       |    /*
 5325|       |     * A NULL nodeset compared with a string is always false
 5326|       |     * (since there is no node equal, and no node not equal)
 5327|       |     */
 5328|  6.52k|    if ((ns == NULL) || (ns->nodeNr <= 0) )
  ------------------
  |  Branch (5328:9): [True: 0, False: 6.52k]
  |  Branch (5328:25): [True: 5.33k, False: 1.19k]
  ------------------
 5329|  5.33k|        return (0);
 5330|  1.19k|    hash = xmlXPathStringHash(str);
 5331|  14.7k|    for (i = 0; i < ns->nodeNr; i++) {
  ------------------
  |  Branch (5331:17): [True: 14.1k, False: 531]
  ------------------
 5332|  14.1k|        if (xmlXPathNodeValHash(ns->nodeTab[i]) == hash) {
  ------------------
  |  Branch (5332:13): [True: 934, False: 13.2k]
  ------------------
 5333|    934|            str2 = xmlNodeGetContent(ns->nodeTab[i]);
 5334|    934|            if (str2 == NULL) {
  ------------------
  |  Branch (5334:17): [True: 4, False: 930]
  ------------------
 5335|      4|                xmlXPathPErrMemory(ctxt);
 5336|      4|                return(0);
 5337|      4|            }
 5338|    930|            if (xmlStrEqual(str, str2)) {
  ------------------
  |  Branch (5338:17): [True: 604, False: 326]
  ------------------
 5339|    604|                xmlFree(str2);
 5340|    604|		if (neq)
  ------------------
  |  Branch (5340:7): [True: 563, False: 41]
  ------------------
 5341|    563|		    continue;
 5342|     41|                return (1);
 5343|    604|            } else if (neq) {
  ------------------
  |  Branch (5343:24): [True: 245, False: 81]
  ------------------
 5344|    245|		xmlFree(str2);
 5345|    245|		return (1);
 5346|    245|	    }
 5347|     81|            xmlFree(str2);
 5348|  13.2k|        } else if (neq)
  ------------------
  |  Branch (5348:20): [True: 377, False: 12.8k]
  ------------------
 5349|    377|	    return (1);
 5350|  14.1k|    }
 5351|    531|    return (0);
 5352|  1.19k|}
xpath.c:xmlXPathStringHash:
 5031|  1.19k|xmlXPathStringHash(const xmlChar * string) {
 5032|  1.19k|    if (string == NULL)
  ------------------
  |  Branch (5032:9): [True: 0, False: 1.19k]
  ------------------
 5033|      0|	return(0);
 5034|  1.19k|    if (string[0] == 0)
  ------------------
  |  Branch (5034:9): [True: 75, False: 1.12k]
  ------------------
 5035|     75|	return(0);
 5036|  1.12k|    return(string[0] + (string[1] << 8));
 5037|  1.19k|}
xpath.c:xmlXPathEqualValuesCommon:
 5540|   217k|  xmlXPathObjectPtr arg1, xmlXPathObjectPtr arg2) {
 5541|   217k|    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|   217k|    switch (arg1->type) {
  ------------------
  |  Branch (5546:13): [True: 217k, False: 0]
  ------------------
 5547|      0|        case XPATH_UNDEFINED:
  ------------------
  |  Branch (5547:9): [True: 0, False: 217k]
  ------------------
 5548|      0|	    break;
 5549|   119k|        case XPATH_BOOLEAN:
  ------------------
  |  Branch (5549:9): [True: 119k, False: 97.7k]
  ------------------
 5550|   119k|	    switch (arg2->type) {
  ------------------
  |  Branch (5550:14): [True: 119k, False: 0]
  ------------------
 5551|      0|	        case XPATH_UNDEFINED:
  ------------------
  |  Branch (5551:10): [True: 0, False: 119k]
  ------------------
 5552|      0|		    break;
 5553|  80.5k|		case XPATH_BOOLEAN:
  ------------------
  |  Branch (5553:3): [True: 80.5k, False: 39.2k]
  ------------------
 5554|  80.5k|		    ret = (arg1->boolval == arg2->boolval);
 5555|  80.5k|		    break;
 5556|  24.9k|		case XPATH_NUMBER:
  ------------------
  |  Branch (5556:3): [True: 24.9k, False: 94.8k]
  ------------------
 5557|  24.9k|		    ret = (arg1->boolval ==
 5558|  24.9k|			   xmlXPathCastNumberToBoolean(arg2->floatval));
 5559|  24.9k|		    break;
 5560|  14.2k|		case XPATH_STRING:
  ------------------
  |  Branch (5560:3): [True: 14.2k, False: 105k]
  ------------------
 5561|  14.2k|		    if ((arg2->stringval == NULL) ||
  ------------------
  |  Branch (5561:11): [True: 0, False: 14.2k]
  ------------------
 5562|  14.2k|			(arg2->stringval[0] == 0)) ret = 0;
  ------------------
  |  Branch (5562:4): [True: 3.75k, False: 10.4k]
  ------------------
 5563|  10.4k|		    else
 5564|  10.4k|			ret = 1;
 5565|  14.2k|		    ret = (arg1->boolval == ret);
 5566|  14.2k|		    break;
 5567|      0|		case XPATH_USERS:
  ------------------
  |  Branch (5567:3): [True: 0, False: 119k]
  ------------------
 5568|       |		    /* TODO */
 5569|      0|		    break;
 5570|      0|		case XPATH_NODESET:
  ------------------
  |  Branch (5570:3): [True: 0, False: 119k]
  ------------------
 5571|      0|		case XPATH_XSLT_TREE:
  ------------------
  |  Branch (5571:3): [True: 0, False: 119k]
  ------------------
 5572|      0|		    break;
 5573|   119k|	    }
 5574|   119k|	    break;
 5575|   119k|        case XPATH_NUMBER:
  ------------------
  |  Branch (5575:9): [True: 96.3k, False: 121k]
  ------------------
 5576|  96.3k|	    switch (arg2->type) {
  ------------------
  |  Branch (5576:14): [True: 96.3k, False: 0]
  ------------------
 5577|      0|	        case XPATH_UNDEFINED:
  ------------------
  |  Branch (5577:10): [True: 0, False: 96.3k]
  ------------------
 5578|      0|		    break;
 5579|  22.6k|		case XPATH_BOOLEAN:
  ------------------
  |  Branch (5579:3): [True: 22.6k, False: 73.6k]
  ------------------
 5580|  22.6k|		    ret = (arg2->boolval==
 5581|  22.6k|			   xmlXPathCastNumberToBoolean(arg1->floatval));
 5582|  22.6k|		    break;
 5583|    697|		case XPATH_STRING:
  ------------------
  |  Branch (5583:3): [True: 697, False: 95.6k]
  ------------------
 5584|    697|		    xmlXPathValuePush(ctxt, arg2);
 5585|    697|		    xmlXPathNumberFunction(ctxt, 1);
 5586|    697|		    arg2 = xmlXPathValuePop(ctxt);
 5587|    697|                    if (ctxt->error)
  ------------------
  |  Branch (5587:25): [True: 1, False: 696]
  ------------------
 5588|      1|                        break;
 5589|       |                    /* Falls through. */
 5590|  73.6k|		case XPATH_NUMBER:
  ------------------
  |  Branch (5590:3): [True: 72.9k, False: 23.3k]
  ------------------
 5591|       |		    /* Hand check NaN and Infinity equalities */
 5592|  73.6k|		    if (xmlXPathIsNaN(arg1->floatval) ||
  ------------------
  |  Branch (5592:11): [True: 3.87k, False: 69.7k]
  ------------------
 5593|  69.7k|			    xmlXPathIsNaN(arg2->floatval)) {
  ------------------
  |  Branch (5593:8): [True: 896, False: 68.8k]
  ------------------
 5594|  4.77k|		        ret = 0;
 5595|  68.8k|		    } else if (xmlXPathIsInf(arg1->floatval) == 1) {
  ------------------
  |  Branch (5595:18): [True: 489, False: 68.3k]
  ------------------
 5596|    489|		        if (xmlXPathIsInf(arg2->floatval) == 1)
  ------------------
  |  Branch (5596:15): [True: 81, False: 408]
  ------------------
 5597|     81|			    ret = 1;
 5598|    408|			else
 5599|    408|			    ret = 0;
 5600|  68.3k|		    } else if (xmlXPathIsInf(arg1->floatval) == -1) {
  ------------------
  |  Branch (5600:18): [True: 798, False: 67.6k]
  ------------------
 5601|    798|			if (xmlXPathIsInf(arg2->floatval) == -1)
  ------------------
  |  Branch (5601:8): [True: 47, False: 751]
  ------------------
 5602|     47|			    ret = 1;
 5603|    751|			else
 5604|    751|			    ret = 0;
 5605|  67.6k|		    } else if (xmlXPathIsInf(arg2->floatval) == 1) {
  ------------------
  |  Branch (5605:18): [True: 259, False: 67.3k]
  ------------------
 5606|    259|			if (xmlXPathIsInf(arg1->floatval) == 1)
  ------------------
  |  Branch (5606:8): [True: 0, False: 259]
  ------------------
 5607|      0|			    ret = 1;
 5608|    259|			else
 5609|    259|			    ret = 0;
 5610|  67.3k|		    } else if (xmlXPathIsInf(arg2->floatval) == -1) {
  ------------------
  |  Branch (5610:18): [True: 508, False: 66.8k]
  ------------------
 5611|    508|			if (xmlXPathIsInf(arg1->floatval) == -1)
  ------------------
  |  Branch (5611:8): [True: 0, False: 508]
  ------------------
 5612|      0|			    ret = 1;
 5613|    508|			else
 5614|    508|			    ret = 0;
 5615|  66.8k|		    } else {
 5616|  66.8k|		        ret = (arg1->floatval == arg2->floatval);
 5617|  66.8k|		    }
 5618|  73.6k|		    break;
 5619|      0|		case XPATH_USERS:
  ------------------
  |  Branch (5619:3): [True: 0, False: 96.3k]
  ------------------
 5620|       |		    /* TODO */
 5621|      0|		    break;
 5622|      0|		case XPATH_NODESET:
  ------------------
  |  Branch (5622:3): [True: 0, False: 96.3k]
  ------------------
 5623|      0|		case XPATH_XSLT_TREE:
  ------------------
  |  Branch (5623:3): [True: 0, False: 96.3k]
  ------------------
 5624|      0|		    break;
 5625|  96.3k|	    }
 5626|  96.3k|	    break;
 5627|  96.3k|        case XPATH_STRING:
  ------------------
  |  Branch (5627:9): [True: 1.46k, False: 216k]
  ------------------
 5628|  1.46k|	    switch (arg2->type) {
  ------------------
  |  Branch (5628:14): [True: 1.46k, False: 0]
  ------------------
 5629|      0|	        case XPATH_UNDEFINED:
  ------------------
  |  Branch (5629:10): [True: 0, False: 1.46k]
  ------------------
 5630|      0|		    break;
 5631|    554|		case XPATH_BOOLEAN:
  ------------------
  |  Branch (5631:3): [True: 554, False: 910]
  ------------------
 5632|    554|		    if ((arg1->stringval == NULL) ||
  ------------------
  |  Branch (5632:11): [True: 0, False: 554]
  ------------------
 5633|    554|			(arg1->stringval[0] == 0)) ret = 0;
  ------------------
  |  Branch (5633:4): [True: 277, False: 277]
  ------------------
 5634|    277|		    else
 5635|    277|			ret = 1;
 5636|    554|		    ret = (arg2->boolval == ret);
 5637|    554|		    break;
 5638|     74|		case XPATH_STRING:
  ------------------
  |  Branch (5638:3): [True: 74, False: 1.39k]
  ------------------
 5639|     74|		    ret = xmlStrEqual(arg1->stringval, arg2->stringval);
 5640|     74|		    break;
 5641|    836|		case XPATH_NUMBER:
  ------------------
  |  Branch (5641:3): [True: 836, False: 628]
  ------------------
 5642|    836|		    xmlXPathValuePush(ctxt, arg1);
 5643|    836|		    xmlXPathNumberFunction(ctxt, 1);
 5644|    836|		    arg1 = xmlXPathValuePop(ctxt);
 5645|    836|                    if (ctxt->error)
  ------------------
  |  Branch (5645:25): [True: 4, False: 832]
  ------------------
 5646|      4|                        break;
 5647|       |		    /* Hand check NaN and Infinity equalities */
 5648|    832|		    if (xmlXPathIsNaN(arg1->floatval) ||
  ------------------
  |  Branch (5648:11): [True: 496, False: 336]
  ------------------
 5649|    733|			    xmlXPathIsNaN(arg2->floatval)) {
  ------------------
  |  Branch (5649:8): [True: 237, False: 99]
  ------------------
 5650|    733|		        ret = 0;
 5651|    733|		    } else if (xmlXPathIsInf(arg1->floatval) == 1) {
  ------------------
  |  Branch (5651:18): [True: 1, False: 98]
  ------------------
 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|     98|		    } else if (xmlXPathIsInf(arg1->floatval) == -1) {
  ------------------
  |  Branch (5656:18): [True: 1, False: 97]
  ------------------
 5657|      1|			if (xmlXPathIsInf(arg2->floatval) == -1)
  ------------------
  |  Branch (5657:8): [True: 0, False: 1]
  ------------------
 5658|      0|			    ret = 1;
 5659|      1|			else
 5660|      1|			    ret = 0;
 5661|     97|		    } else if (xmlXPathIsInf(arg2->floatval) == 1) {
  ------------------
  |  Branch (5661:18): [True: 10, False: 87]
  ------------------
 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|     87|		    } else if (xmlXPathIsInf(arg2->floatval) == -1) {
  ------------------
  |  Branch (5666:18): [True: 4, False: 83]
  ------------------
 5667|      4|			if (xmlXPathIsInf(arg1->floatval) == -1)
  ------------------
  |  Branch (5667:8): [True: 0, False: 4]
  ------------------
 5668|      0|			    ret = 1;
 5669|      4|			else
 5670|      4|			    ret = 0;
 5671|     83|		    } else {
 5672|     83|		        ret = (arg1->floatval == arg2->floatval);
 5673|     83|		    }
 5674|    832|		    break;
 5675|      0|		case XPATH_USERS:
  ------------------
  |  Branch (5675:3): [True: 0, False: 1.46k]
  ------------------
 5676|       |		    /* TODO */
 5677|      0|		    break;
 5678|      0|		case XPATH_NODESET:
  ------------------
  |  Branch (5678:3): [True: 0, False: 1.46k]
  ------------------
 5679|      0|		case XPATH_XSLT_TREE:
  ------------------
  |  Branch (5679:3): [True: 0, False: 1.46k]
  ------------------
 5680|      0|		    break;
 5681|  1.46k|	    }
 5682|  1.46k|	    break;
 5683|  1.46k|        case XPATH_USERS:
  ------------------
  |  Branch (5683:9): [True: 0, False: 217k]
  ------------------
 5684|       |	    /* TODO */
 5685|      0|	    break;
 5686|      0|	case XPATH_NODESET:
  ------------------
  |  Branch (5686:2): [True: 0, False: 217k]
  ------------------
 5687|      0|	case XPATH_XSLT_TREE:
  ------------------
  |  Branch (5687:2): [True: 0, False: 217k]
  ------------------
 5688|      0|	    break;
 5689|   217k|    }
 5690|   217k|    xmlXPathReleaseObject(ctxt->context, arg1);
 5691|   217k|    xmlXPathReleaseObject(ctxt->context, arg2);
 5692|   217k|    return(ret);
 5693|   217k|}
xpath.c:xmlXPathCompareNodeSets:
 5178|  83.5k|	                xmlXPathObjectPtr arg1, xmlXPathObjectPtr arg2) {
 5179|  83.5k|    int i, j, init = 0;
 5180|  83.5k|    double val1;
 5181|  83.5k|    double *values2;
 5182|  83.5k|    int ret = 0;
 5183|  83.5k|    xmlNodeSetPtr ns1;
 5184|  83.5k|    xmlNodeSetPtr ns2;
 5185|       |
 5186|  83.5k|    if ((arg1 == NULL) ||
  ------------------
  |  Branch (5186:9): [True: 0, False: 83.5k]
  ------------------
 5187|  83.5k|	((arg1->type != XPATH_NODESET) && (arg1->type != XPATH_XSLT_TREE))) {
  ------------------
  |  Branch (5187:3): [True: 0, False: 83.5k]
  |  Branch (5187:36): [True: 0, False: 0]
  ------------------
 5188|      0|	xmlXPathFreeObject(arg2);
 5189|      0|        return(0);
 5190|      0|    }
 5191|  83.5k|    if ((arg2 == NULL) ||
  ------------------
  |  Branch (5191:9): [True: 0, False: 83.5k]
  ------------------
 5192|  83.5k|	((arg2->type != XPATH_NODESET) && (arg2->type != XPATH_XSLT_TREE))) {
  ------------------
  |  Branch (5192:3): [True: 0, False: 83.5k]
  |  Branch (5192:36): [True: 0, False: 0]
  ------------------
 5193|      0|	xmlXPathFreeObject(arg1);
 5194|      0|	xmlXPathFreeObject(arg2);
 5195|      0|        return(0);
 5196|      0|    }
 5197|       |
 5198|  83.5k|    ns1 = arg1->nodesetval;
 5199|  83.5k|    ns2 = arg2->nodesetval;
 5200|       |
 5201|  83.5k|    if ((ns1 == NULL) || (ns1->nodeNr <= 0)) {
  ------------------
  |  Branch (5201:9): [True: 0, False: 83.5k]
  |  Branch (5201:26): [True: 52.1k, False: 31.3k]
  ------------------
 5202|  52.1k|	xmlXPathFreeObject(arg1);
 5203|  52.1k|	xmlXPathFreeObject(arg2);
 5204|  52.1k|	return(0);
 5205|  52.1k|    }
 5206|  31.3k|    if ((ns2 == NULL) || (ns2->nodeNr <= 0)) {
  ------------------
  |  Branch (5206:9): [True: 0, False: 31.3k]
  |  Branch (5206:26): [True: 27.0k, False: 4.26k]
  ------------------
 5207|  27.0k|	xmlXPathFreeObject(arg1);
 5208|  27.0k|	xmlXPathFreeObject(arg2);
 5209|  27.0k|	return(0);
 5210|  27.0k|    }
 5211|       |
 5212|  4.26k|    values2 = (double *) xmlMalloc(ns2->nodeNr * sizeof(double));
 5213|  4.26k|    if (values2 == NULL) {
  ------------------
  |  Branch (5213:9): [True: 2, False: 4.26k]
  ------------------
 5214|      2|        xmlXPathPErrMemory(ctxt);
 5215|      2|	xmlXPathFreeObject(arg1);
 5216|      2|	xmlXPathFreeObject(arg2);
 5217|      2|	return(0);
 5218|      2|    }
 5219|  61.9k|    for (i = 0;i < ns1->nodeNr;i++) {
  ------------------
  |  Branch (5219:16): [True: 59.8k, False: 2.10k]
  ------------------
 5220|  59.8k|	val1 = xmlXPathNodeToNumberInternal(ctxt, ns1->nodeTab[i]);
 5221|  59.8k|	if (xmlXPathIsNaN(val1))
  ------------------
  |  Branch (5221:6): [True: 54.5k, False: 5.30k]
  ------------------
 5222|  54.5k|	    continue;
 5223|  60.0k|	for (j = 0;j < ns2->nodeNr;j++) {
  ------------------
  |  Branch (5223:13): [True: 56.9k, False: 3.14k]
  ------------------
 5224|  56.9k|	    if (init == 0) {
  ------------------
  |  Branch (5224:10): [True: 51.0k, False: 5.93k]
  ------------------
 5225|  51.0k|		values2[j] = xmlXPathNodeToNumberInternal(ctxt,
 5226|  51.0k|                                                          ns2->nodeTab[j]);
 5227|  51.0k|	    }
 5228|  56.9k|	    if (xmlXPathIsNaN(values2[j]))
  ------------------
  |  Branch (5228:10): [True: 50.8k, False: 6.11k]
  ------------------
 5229|  50.8k|		continue;
 5230|  6.11k|	    if (inf && strict)
  ------------------
  |  Branch (5230:10): [True: 538, False: 5.57k]
  |  Branch (5230:17): [True: 238, False: 300]
  ------------------
 5231|    238|		ret = (val1 < values2[j]);
 5232|  5.87k|	    else if (inf && !strict)
  ------------------
  |  Branch (5232:15): [True: 300, False: 5.57k]
  |  Branch (5232:22): [True: 300, False: 0]
  ------------------
 5233|    300|		ret = (val1 <= values2[j]);
 5234|  5.57k|	    else if (!inf && strict)
  ------------------
  |  Branch (5234:15): [True: 5.57k, False: 0]
  |  Branch (5234:23): [True: 5.27k, False: 301]
  ------------------
 5235|  5.27k|		ret = (val1 > values2[j]);
 5236|    301|	    else if (!inf && !strict)
  ------------------
  |  Branch (5236:15): [True: 301, False: 0]
  |  Branch (5236:23): [True: 301, False: 0]
  ------------------
 5237|    301|		ret = (val1 >= values2[j]);
 5238|  6.11k|	    if (ret)
  ------------------
  |  Branch (5238:10): [True: 2.16k, False: 3.95k]
  ------------------
 5239|  2.16k|		break;
 5240|  6.11k|	}
 5241|  5.30k|	if (ret)
  ------------------
  |  Branch (5241:6): [True: 2.16k, False: 3.14k]
  ------------------
 5242|  2.16k|	    break;
 5243|  3.14k|	init = 1;
 5244|  3.14k|    }
 5245|  4.26k|    xmlFree(values2);
 5246|  4.26k|    xmlXPathFreeObject(arg1);
 5247|  4.26k|    xmlXPathFreeObject(arg2);
 5248|  4.26k|    return(ret);
 5249|  4.26k|}
xpath.c:xmlXPathCompareNodeSetValue:
 5272|  74.0k|	                    xmlXPathObjectPtr arg, xmlXPathObjectPtr val) {
 5273|  74.0k|    if ((val == NULL) || (arg == NULL) ||
  ------------------
  |  Branch (5273:9): [True: 0, False: 74.0k]
  |  Branch (5273:26): [True: 0, False: 74.0k]
  ------------------
 5274|  74.0k|	((arg->type != XPATH_NODESET) && (arg->type != XPATH_XSLT_TREE)))
  ------------------
  |  Branch (5274:3): [True: 0, False: 74.0k]
  |  Branch (5274:35): [True: 0, False: 0]
  ------------------
 5275|      0|        return(0);
 5276|       |
 5277|  74.0k|    switch(val->type) {
 5278|  65.2k|        case XPATH_NUMBER:
  ------------------
  |  Branch (5278:9): [True: 65.2k, False: 8.86k]
  ------------------
 5279|  65.2k|	    return(xmlXPathCompareNodeSetFloat(ctxt, inf, strict, arg, val));
 5280|      0|        case XPATH_NODESET:
  ------------------
  |  Branch (5280:9): [True: 0, False: 74.0k]
  ------------------
 5281|      0|        case XPATH_XSLT_TREE:
  ------------------
  |  Branch (5281:9): [True: 0, False: 74.0k]
  ------------------
 5282|      0|	    return(xmlXPathCompareNodeSets(ctxt, inf, strict, arg, val));
 5283|  1.06k|        case XPATH_STRING:
  ------------------
  |  Branch (5283:9): [True: 1.06k, False: 73.0k]
  ------------------
 5284|  1.06k|	    return(xmlXPathCompareNodeSetString(ctxt, inf, strict, arg, val));
 5285|  7.79k|        case XPATH_BOOLEAN:
  ------------------
  |  Branch (5285:9): [True: 7.79k, False: 66.2k]
  ------------------
 5286|  7.79k|	    xmlXPathValuePush(ctxt, arg);
 5287|  7.79k|	    xmlXPathBooleanFunction(ctxt, 1);
 5288|  7.79k|	    xmlXPathValuePush(ctxt, val);
 5289|  7.79k|	    return(xmlXPathCompareValues(ctxt, inf, strict));
 5290|      0|	default:
  ------------------
  |  Branch (5290:2): [True: 0, False: 74.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|  74.0k|    }
 5295|      0|    return(0);
 5296|  74.0k|}
xpath.c:xmlXPathCompareNodeSetFloat:
 5061|  65.2k|	                    xmlXPathObjectPtr arg, xmlXPathObjectPtr f) {
 5062|  65.2k|    int i, ret = 0;
 5063|  65.2k|    xmlNodeSetPtr ns;
 5064|  65.2k|    xmlChar *str2;
 5065|       |
 5066|  65.2k|    if ((f == NULL) || (arg == NULL) ||
  ------------------
  |  Branch (5066:9): [True: 0, False: 65.2k]
  |  Branch (5066:24): [True: 0, False: 65.2k]
  ------------------
 5067|  65.2k|	((arg->type != XPATH_NODESET) && (arg->type != XPATH_XSLT_TREE))) {
  ------------------
  |  Branch (5067:3): [True: 0, False: 65.2k]
  |  Branch (5067:35): [True: 0, False: 0]
  ------------------
 5068|      0|	xmlXPathReleaseObject(ctxt->context, arg);
 5069|      0|	xmlXPathReleaseObject(ctxt->context, f);
 5070|      0|        return(0);
 5071|      0|    }
 5072|  65.2k|    ns = arg->nodesetval;
 5073|  65.2k|    if (ns != NULL) {
  ------------------
  |  Branch (5073:9): [True: 65.2k, False: 0]
  ------------------
 5074|   109k|	for (i = 0;i < ns->nodeNr;i++) {
  ------------------
  |  Branch (5074:13): [True: 45.7k, False: 64.1k]
  ------------------
 5075|  45.7k|	     str2 = xmlXPathCastNodeToString(ns->nodeTab[i]);
 5076|  45.7k|	     if (str2 != NULL) {
  ------------------
  |  Branch (5076:11): [True: 45.7k, False: 8]
  ------------------
 5077|  45.7k|		 xmlXPathValuePush(ctxt, xmlXPathCacheNewString(ctxt, str2));
 5078|  45.7k|		 xmlFree(str2);
 5079|  45.7k|		 xmlXPathNumberFunction(ctxt, 1);
 5080|  45.7k|		 xmlXPathValuePush(ctxt, xmlXPathCacheObjectCopy(ctxt, f));
 5081|  45.7k|		 ret = xmlXPathCompareValues(ctxt, inf, strict);
 5082|  45.7k|		 if (ret)
  ------------------
  |  Branch (5082:8): [True: 1.03k, False: 44.6k]
  ------------------
 5083|  1.03k|		     break;
 5084|  45.7k|	     } else {
 5085|      8|                 xmlXPathPErrMemory(ctxt);
 5086|      8|             }
 5087|  45.7k|	}
 5088|  65.2k|    }
 5089|  65.2k|    xmlXPathReleaseObject(ctxt->context, arg);
 5090|  65.2k|    xmlXPathReleaseObject(ctxt->context, f);
 5091|  65.2k|    return(ret);
 5092|  65.2k|}
xpath.c:xmlXPathCacheObjectCopy:
 1881|   285k|{
 1882|   285k|    xmlXPathObjectPtr ret;
 1883|   285k|    xmlXPathContextPtr ctxt = pctxt->context;
 1884|       |
 1885|   285k|    if (val == NULL)
  ------------------
  |  Branch (1885:9): [True: 0, False: 285k]
  ------------------
 1886|      0|	return(NULL);
 1887|       |
 1888|   285k|    if ((ctxt != NULL) && (ctxt->cache != NULL)) {
  ------------------
  |  Branch (1888:9): [True: 285k, False: 0]
  |  Branch (1888:27): [True: 0, False: 285k]
  ------------------
 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|   285k|    ret = xmlXPathObjectCopy(val);
 1911|   285k|    if (ret == NULL)
  ------------------
  |  Branch (1911:9): [True: 74, False: 285k]
  ------------------
 1912|     74|        xmlXPathPErrMemory(pctxt);
 1913|   285k|    return(ret);
 1914|   285k|}
xpath.c:xmlXPathCompareNodeSetString:
 5115|  1.06k|	                    xmlXPathObjectPtr arg, xmlXPathObjectPtr s) {
 5116|  1.06k|    int i, ret = 0;
 5117|  1.06k|    xmlNodeSetPtr ns;
 5118|  1.06k|    xmlChar *str2;
 5119|       |
 5120|  1.06k|    if ((s == NULL) || (arg == NULL) ||
  ------------------
  |  Branch (5120:9): [True: 0, False: 1.06k]
  |  Branch (5120:24): [True: 0, False: 1.06k]
  ------------------
 5121|  1.06k|	((arg->type != XPATH_NODESET) && (arg->type != XPATH_XSLT_TREE))) {
  ------------------
  |  Branch (5121:3): [True: 0, False: 1.06k]
  |  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.06k|    ns = arg->nodesetval;
 5127|  1.06k|    if (ns != NULL) {
  ------------------
  |  Branch (5127:9): [True: 1.06k, False: 0]
  ------------------
 5128|  2.08k|	for (i = 0;i < ns->nodeNr;i++) {
  ------------------
  |  Branch (5128:13): [True: 1.01k, False: 1.06k]
  ------------------
 5129|  1.01k|	     str2 = xmlXPathCastNodeToString(ns->nodeTab[i]);
 5130|  1.01k|	     if (str2 != NULL) {
  ------------------
  |  Branch (5130:11): [True: 1.01k, False: 1]
  ------------------
 5131|  1.01k|		 xmlXPathValuePush(ctxt,
 5132|  1.01k|			   xmlXPathCacheNewString(ctxt, str2));
 5133|  1.01k|		 xmlFree(str2);
 5134|  1.01k|		 xmlXPathValuePush(ctxt, xmlXPathCacheObjectCopy(ctxt, s));
 5135|  1.01k|		 ret = xmlXPathCompareValues(ctxt, inf, strict);
 5136|  1.01k|		 if (ret)
  ------------------
  |  Branch (5136:8): [True: 0, False: 1.01k]
  ------------------
 5137|      0|		     break;
 5138|  1.01k|	     } else {
 5139|      1|                 xmlXPathPErrMemory(ctxt);
 5140|      1|             }
 5141|  1.01k|	}
 5142|  1.06k|    }
 5143|  1.06k|    xmlXPathReleaseObject(ctxt->context, arg);
 5144|  1.06k|    xmlXPathReleaseObject(ctxt->context, s);
 5145|  1.06k|    return(ret);
 5146|  1.06k|}
xpath.c:xmlXPathCacheNewNodeSet:
 1689|  1.16M|{
 1690|  1.16M|    xmlXPathObjectPtr ret;
 1691|  1.16M|    xmlXPathContextPtr ctxt = pctxt->context;
 1692|       |
 1693|  1.16M|    if ((ctxt != NULL) && (ctxt->cache != NULL)) {
  ------------------
  |  Branch (1693:9): [True: 1.16M, False: 0]
  |  Branch (1693:27): [True: 0, False: 1.16M]
  ------------------
 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.16M|    ret = xmlXPathNewNodeSet(val);
 1741|  1.16M|    if (ret == NULL)
  ------------------
  |  Branch (1741:9): [True: 415, False: 1.16M]
  ------------------
 1742|    415|        xmlXPathPErrMemory(pctxt);
 1743|  1.16M|    return(ret);
 1744|  1.16M|}
xpath.c:xmlXPathCacheNewFloat:
 1847|   360k|{
 1848|   360k|    xmlXPathObjectPtr ret;
 1849|   360k|    xmlXPathContextPtr ctxt = pctxt->context;
 1850|       |
 1851|   360k|    if ((ctxt != NULL) && (ctxt->cache != NULL)) {
  ------------------
  |  Branch (1851:9): [True: 360k, False: 0]
  |  Branch (1851:27): [True: 0, False: 360k]
  ------------------
 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|   360k|    ret = xmlXPathNewFloat(val);
 1866|   360k|    if (ret == NULL)
  ------------------
  |  Branch (1866:9): [True: 125, False: 360k]
  ------------------
 1867|    125|        xmlXPathPErrMemory(pctxt);
 1868|   360k|    return(ret);
 1869|   360k|}
xpath.c:xmlXPathGetElementsByIds:
 6976|  9.51k|xmlXPathGetElementsByIds (xmlDocPtr doc, const xmlChar *ids) {
 6977|  9.51k|    xmlNodeSetPtr ret;
 6978|  9.51k|    const xmlChar *cur = ids;
 6979|  9.51k|    xmlChar *ID;
 6980|  9.51k|    xmlAttrPtr attr;
 6981|  9.51k|    xmlNodePtr elem = NULL;
 6982|       |
 6983|  9.51k|    if (ids == NULL) return(NULL);
  ------------------
  |  Branch (6983:9): [True: 20, False: 9.49k]
  ------------------
 6984|       |
 6985|  9.49k|    ret = xmlXPathNodeSetCreate(NULL);
 6986|  9.49k|    if (ret == NULL)
  ------------------
  |  Branch (6986:9): [True: 9, False: 9.48k]
  ------------------
 6987|      9|        return(ret);
 6988|       |
 6989|  9.48k|    while (IS_BLANK_CH(*cur)) cur++;
 6990|  22.6k|    while (*cur != 0) {
  ------------------
  |  Branch (6990:12): [True: 13.2k, False: 9.46k]
  ------------------
 6991|   127k|	while ((!IS_BLANK_CH(*cur)) && (*cur != 0))
  ------------------
  |  |  137|   127k|#define IS_BLANK_CH(c)  xmlIsBlank_ch(c)
  |  |  ------------------
  |  |  |  |   90|   127k|#define xmlIsBlank_ch(c)	(((c) == 0x20) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (90:27): [True: 5.04k, False: 122k]
  |  |  |  |  ------------------
  |  |  |  |   91|   127k|				 ((0x9 <= (c)) && ((c) <= 0xa)) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (91:7): [True: 115k, False: 7.37k]
  |  |  |  |  |  Branch (91:23): [True: 565, False: 114k]
  |  |  |  |  ------------------
  |  |  |  |   92|   127k|				 ((c) == 0xd))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (92:6): [True: 244, False: 121k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (6991:33): [True: 114k, False: 7.37k]
  ------------------
 6992|   114k|	    cur++;
 6993|       |
 6994|  13.2k|        ID = xmlStrndup(ids, cur - ids);
 6995|  13.2k|	if (ID == NULL) {
  ------------------
  |  Branch (6995:6): [True: 18, False: 13.2k]
  ------------------
 6996|     18|            xmlXPathFreeNodeSet(ret);
 6997|     18|            return(NULL);
 6998|     18|        }
 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|  13.2k|        attr = xmlGetID(doc, ID);
 7007|  13.2k|        xmlFree(ID);
 7008|  13.2k|        if (attr != NULL) {
  ------------------
  |  Branch (7008:13): [True: 1.03k, False: 12.1k]
  ------------------
 7009|  1.03k|            if (attr->type == XML_ATTRIBUTE_NODE)
  ------------------
  |  Branch (7009:17): [True: 1.03k, False: 0]
  ------------------
 7010|  1.03k|                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.03k|            if (elem != NULL) {
  ------------------
  |  Branch (7015:17): [True: 1.03k, False: 0]
  ------------------
 7016|  1.03k|                if (xmlXPathNodeSetAdd(ret, elem) < 0) {
  ------------------
  |  Branch (7016:21): [True: 2, False: 1.03k]
  ------------------
 7017|      2|                    xmlXPathFreeNodeSet(ret);
 7018|      2|                    return(NULL);
 7019|      2|                }
 7020|  1.03k|            }
 7021|  1.03k|        }
 7022|       |
 7023|  15.7k|	while (IS_BLANK_CH(*cur)) cur++;
 7024|  13.2k|	ids = cur;
 7025|  13.2k|    }
 7026|  9.46k|    return(ret);
 7027|  9.48k|}
xpath.c:xmlXPathCacheWrapNodeSet:
 1620|  1.05M|{
 1621|  1.05M|    xmlXPathObjectPtr ret;
 1622|  1.05M|    xmlXPathContextPtr ctxt = pctxt->context;
 1623|       |
 1624|  1.05M|    if ((ctxt != NULL) && (ctxt->cache != NULL)) {
  ------------------
  |  Branch (1624:9): [True: 1.05M, False: 0]
  |  Branch (1624:27): [True: 0, False: 1.05M]
  ------------------
 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.05M|    ret = xmlXPathWrapNodeSet(val);
 1640|  1.05M|    if (ret == NULL)
  ------------------
  |  Branch (1640:9): [True: 184, False: 1.05M]
  ------------------
 1641|    184|        xmlXPathPErrMemory(pctxt);
 1642|  1.05M|    return(ret);
 1643|  1.05M|}
xpath.c:xmlXPathCacheNewCString:
 1799|  6.98k|{
 1800|  6.98k|    return xmlXPathCacheNewString(pctxt, BAD_CAST val);
  ------------------
  |  |   34|  6.98k|#define BAD_CAST (xmlChar *)
  ------------------
 1801|  6.98k|}
xpath.c:xmlXPathCacheNewString:
 1756|   112k|{
 1757|   112k|    xmlXPathObjectPtr ret;
 1758|   112k|    xmlXPathContextPtr ctxt = pctxt->context;
 1759|       |
 1760|   112k|    if ((ctxt != NULL) && (ctxt->cache != NULL)) {
  ------------------
  |  Branch (1760:9): [True: 112k, False: 0]
  |  Branch (1760:27): [True: 0, False: 112k]
  ------------------
 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|   112k|    ret = xmlXPathNewString(val);
 1784|   112k|    if (ret == NULL)
  ------------------
  |  Branch (1784:9): [True: 40, False: 112k]
  ------------------
 1785|     40|        xmlXPathPErrMemory(pctxt);
 1786|   112k|    return(ret);
 1787|   112k|}
xpath.c:xmlXPathCacheWrapString:
 1655|  40.8k|{
 1656|  40.8k|    xmlXPathObjectPtr ret;
 1657|  40.8k|    xmlXPathContextPtr ctxt = pctxt->context;
 1658|       |
 1659|  40.8k|    if ((ctxt != NULL) && (ctxt->cache != NULL)) {
  ------------------
  |  Branch (1659:9): [True: 40.8k, False: 0]
  |  Branch (1659:27): [True: 0, False: 40.8k]
  ------------------
 1660|      0|	xmlXPathContextCachePtr cache = (xmlXPathContextCachePtr) ctxt->cache;
 1661|       |
 1662|      0|	if (cache->miscObjs != NULL) {
  ------------------
  |  Branch (1662:6): [True: 0, False: 0]
  ------------------
 1663|      0|	    ret = cache->miscObjs;
 1664|      0|            cache->miscObjs = (void *) ret->stringval;
 1665|      0|            cache->numMisc -= 1;
 1666|      0|	    ret->type = XPATH_STRING;
 1667|      0|	    ret->stringval = val;
 1668|      0|	    return(ret);
 1669|      0|	}
 1670|      0|    }
 1671|       |
 1672|  40.8k|    ret = xmlXPathWrapString(val);
 1673|  40.8k|    if (ret == NULL)
  ------------------
  |  Branch (1673:9): [True: 35, False: 40.8k]
  ------------------
 1674|     35|        xmlXPathPErrMemory(pctxt);
 1675|  40.8k|    return(ret);
 1676|  40.8k|}
xpath.c:xmlXPathCacheNewBoolean:
 1813|   561k|{
 1814|   561k|    xmlXPathObjectPtr ret;
 1815|   561k|    xmlXPathContextPtr ctxt = pctxt->context;
 1816|       |
 1817|   561k|    if ((ctxt != NULL) && (ctxt->cache != NULL)) {
  ------------------
  |  Branch (1817:9): [True: 561k, False: 0]
  |  Branch (1817:27): [True: 0, False: 561k]
  ------------------
 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|   561k|    ret = xmlXPathNewBoolean(val);
 1832|   561k|    if (ret == NULL)
  ------------------
  |  Branch (1832:9): [True: 72, False: 561k]
  ------------------
 1833|     72|        xmlXPathPErrMemory(pctxt);
 1834|   561k|    return(ret);
 1835|   561k|}
xpath.c:xmlXPathCheckOpLimit:
  803|  13.7M|xmlXPathCheckOpLimit(xmlXPathParserContextPtr ctxt, unsigned long opCount) {
  804|  13.7M|    xmlXPathContextPtr xpctxt = ctxt->context;
  805|       |
  806|  13.7M|    if ((opCount > xpctxt->opLimit) ||
  ------------------
  |  Branch (806:9): [True: 0, False: 13.7M]
  ------------------
  807|  13.7M|        (xpctxt->opCount > xpctxt->opLimit - opCount)) {
  ------------------
  |  Branch (807:9): [True: 110, False: 13.7M]
  ------------------
  808|    110|        xpctxt->opCount = xpctxt->opLimit;
  809|    110|        xmlXPathErr(ctxt, XPATH_OP_LIMIT_EXCEEDED);
  810|    110|        return(-1);
  811|    110|    }
  812|       |
  813|  13.7M|    xpctxt->opCount += opCount;
  814|  13.7M|    return(0);
  815|  13.7M|}
xpath.c:xmlXPathCompileExpr:
 9088|  47.0k|xmlXPathCompileExpr(xmlXPathParserContextPtr ctxt, int sort) {
 9089|  47.0k|    xmlXPathContextPtr xpctxt = ctxt->context;
 9090|       |
 9091|  47.0k|    if (xpctxt != NULL) {
  ------------------
  |  Branch (9091:9): [True: 47.0k, False: 0]
  ------------------
 9092|  47.0k|        if (xpctxt->depth >= XPATH_MAX_RECURSION_DEPTH)
  ------------------
  |  |  112|  47.0k|#define XPATH_MAX_RECURSION_DEPTH 500
  ------------------
  |  Branch (9092:13): [True: 383, False: 46.6k]
  ------------------
 9093|  46.6k|            XP_ERROR(XPATH_RECURSION_LIMIT_EXCEEDED);
  ------------------
  |  |  244|    383|    { xmlXPathErr(ctxt, X); return; }
  ------------------
 9094|       |        /*
 9095|       |         * Parsing a single '(' pushes about 10 functions on the call stack
 9096|       |         * before recursing!
 9097|       |         */
 9098|  46.6k|        xpctxt->depth += 10;
 9099|  46.6k|    }
 9100|       |
 9101|  46.6k|    xmlXPathCompAndExpr(ctxt);
 9102|  46.6k|    CHECK_ERROR;
  ------------------
  |  |  230|  46.6k|    if (ctxt->error != XPATH_EXPRESSION_OK) return
  |  |  ------------------
  |  |  |  Branch (230:9): [True: 4.84k, False: 41.7k]
  |  |  ------------------
  ------------------
 9103|  41.7k|    SKIP_BLANKS;
  ------------------
  |  | 2199|  41.7k|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  | 2202|  46.6k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2202:15): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 9104|  44.3k|    while ((CUR == 'o') && (NXT(1) == 'r')) {
  ------------------
  |  | 2193|  44.3k|#define CUR (*ctxt->cur)
  ------------------
                  while ((CUR == 'o') && (NXT(1) == 'r')) {
  ------------------
  |  | 2195|  2.74k|#define NXT(val) ctxt->cur[(val)]
  ------------------
  |  Branch (9104:12): [True: 2.74k, False: 41.5k]
  |  Branch (9104:28): [True: 2.74k, False: 5]
  ------------------
 9105|  2.74k|	int op1 = ctxt->comp->last;
 9106|  2.74k|        SKIP(2);
  ------------------
  |  | 2194|  2.74k|#define SKIP(val) ctxt->cur += (val)
  ------------------
 9107|  2.74k|	SKIP_BLANKS;
  ------------------
  |  | 2199|  2.74k|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  | 2202|  1.79k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2202:15): [True: 1.79k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 9108|  2.74k|        xmlXPathCompAndExpr(ctxt);
 9109|  2.74k|	CHECK_ERROR;
  ------------------
  |  |  230|  2.74k|    if (ctxt->error != XPATH_EXPRESSION_OK) return
  |  |  ------------------
  |  |  |  Branch (230:9): [True: 213, False: 2.52k]
  |  |  ------------------
  ------------------
 9110|  2.52k|	PUSH_BINARY_EXPR(XPATH_OP_OR, op1, ctxt->comp->last, 0, 0);
  ------------------
  |  | 1094|  2.52k|#define PUSH_BINARY_EXPR(op, ch1, ch2, val, val2)			\
  |  | 1095|  2.52k|xmlXPathCompExprAdd(ctxt, (ch1), (ch2), (op),			\
  |  | 1096|  2.52k|			(val), (val2), 0 ,NULL ,NULL)
  ------------------
 9111|  2.52k|	SKIP_BLANKS;
  ------------------
  |  | 2199|  2.52k|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  | 2202|  2.52k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2202:15): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 9112|  2.52k|    }
 9113|  41.5k|    if ((sort) && (ctxt->comp->steps[ctxt->comp->last].op != XPATH_OP_VALUE)) {
  ------------------
  |  Branch (9113:9): [True: 35.1k, False: 6.41k]
  |  Branch (9113:19): [True: 25.5k, False: 9.57k]
  ------------------
 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|  25.5k|	PUSH_UNARY_EXPR(XPATH_OP_SORT, ctxt->comp->last , 0, 0);
  ------------------
  |  | 1091|  25.5k|#define PUSH_UNARY_EXPR(op, ch, val, val2)				\
  |  | 1092|  25.5k|xmlXPathCompExprAdd(ctxt, (ch), -1, (op), (val), (val2), 0 ,NULL ,NULL)
  ------------------
 9121|  25.5k|    }
 9122|       |
 9123|  41.5k|    if (xpctxt != NULL)
  ------------------
  |  Branch (9123:9): [True: 41.5k, False: 0]
  ------------------
 9124|  41.5k|        xpctxt->depth -= 10;
 9125|  41.5k|}
xpath.c:xmlXPathCompAndExpr:
 9062|  49.3k|xmlXPathCompAndExpr(xmlXPathParserContextPtr ctxt) {
 9063|  49.3k|    xmlXPathCompEqualityExpr(ctxt);
 9064|  49.3k|    CHECK_ERROR;
  ------------------
  |  |  230|  49.3k|    if (ctxt->error != XPATH_EXPRESSION_OK) return
  |  |  ------------------
  |  |  |  Branch (230:9): [True: 5.01k, False: 44.3k]
  |  |  ------------------
  ------------------
 9065|  44.3k|    SKIP_BLANKS;
  ------------------
  |  | 2199|  44.3k|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  | 2202|  49.3k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2202:15): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 9066|  44.6k|    while ((CUR == 'a') && (NXT(1) == 'n') && (NXT(2) == 'd')) {
  ------------------
  |  | 2193|  44.6k|#define CUR (*ctxt->cur)
  ------------------
                  while ((CUR == 'a') && (NXT(1) == 'n') && (NXT(2) == 'd')) {
  ------------------
  |  | 2195|    347|#define NXT(val) ctxt->cur[(val)]
  ------------------
                  while ((CUR == 'a') && (NXT(1) == 'n') && (NXT(2) == 'd')) {
  ------------------
  |  | 2195|    322|#define NXT(val) ctxt->cur[(val)]
  ------------------
  |  Branch (9066:12): [True: 347, False: 44.2k]
  |  Branch (9066:28): [True: 322, False: 25]
  |  Branch (9066:47): [True: 318, False: 4]
  ------------------
 9067|    318|	int op1 = ctxt->comp->last;
 9068|    318|        SKIP(3);
  ------------------
  |  | 2194|    318|#define SKIP(val) ctxt->cur += (val)
  ------------------
 9069|    318|	SKIP_BLANKS;
  ------------------
  |  | 2199|  3.19k|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  | 2202|  3.19k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2202:15): [True: 3.19k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 9070|    318|        xmlXPathCompEqualityExpr(ctxt);
 9071|    318|	CHECK_ERROR;
  ------------------
  |  |  230|    318|    if (ctxt->error != XPATH_EXPRESSION_OK) return
  |  |  ------------------
  |  |  |  Branch (230:9): [True: 50, False: 268]
  |  |  ------------------
  ------------------
 9072|    268|	PUSH_BINARY_EXPR(XPATH_OP_AND, op1, ctxt->comp->last, 0, 0);
  ------------------
  |  | 1094|    268|#define PUSH_BINARY_EXPR(op, ch1, ch2, val, val2)			\
  |  | 1095|    268|xmlXPathCompExprAdd(ctxt, (ch1), (ch2), (op),			\
  |  | 1096|    268|			(val), (val2), 0 ,NULL ,NULL)
  ------------------
 9073|    268|	SKIP_BLANKS;
  ------------------
  |  | 2199|    268|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  | 2202|    268|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2202:15): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 9074|    268|    }
 9075|  44.3k|}
xpath.c:xmlXPathCompEqualityExpr:
 9033|  49.6k|xmlXPathCompEqualityExpr(xmlXPathParserContextPtr ctxt) {
 9034|  49.6k|    xmlXPathCompRelationalExpr(ctxt);
 9035|  49.6k|    CHECK_ERROR;
  ------------------
  |  |  230|  49.6k|    if (ctxt->error != XPATH_EXPRESSION_OK) return
  |  |  ------------------
  |  |  |  Branch (230:9): [True: 4.38k, False: 45.3k]
  |  |  ------------------
  ------------------
 9036|  45.3k|    SKIP_BLANKS;
  ------------------
  |  | 2199|  45.3k|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  | 2202|  49.6k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2202:15): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 9037|  76.6k|    while ((CUR == '=') || ((CUR == '!') && (NXT(1) == '='))) {
  ------------------
  |  | 2193|  76.6k|#define CUR (*ctxt->cur)
  ------------------
                  while ((CUR == '=') || ((CUR == '!') && (NXT(1) == '='))) {
  ------------------
  |  | 2193|  46.1k|#define CUR (*ctxt->cur)
  ------------------
                  while ((CUR == '=') || ((CUR == '!') && (NXT(1) == '='))) {
  ------------------
  |  | 2195|  1.56k|#define NXT(val) ctxt->cur[(val)]
  ------------------
  |  Branch (9037:12): [True: 30.4k, False: 46.1k]
  |  Branch (9037:29): [True: 1.56k, False: 44.6k]
  |  Branch (9037:45): [True: 1.55k, False: 15]
  ------------------
 9038|  32.0k|	int eq;
 9039|  32.0k|	int op1 = ctxt->comp->last;
 9040|       |
 9041|  32.0k|        if (CUR == '=') eq = 1;
  ------------------
  |  | 2193|  32.0k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (9041:13): [True: 30.4k, False: 1.55k]
  ------------------
 9042|  1.55k|	else eq = 0;
 9043|  32.0k|	NEXT;
  ------------------
  |  | 2202|  32.0k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  ------------------
  |  |  |  Branch (2202:15): [True: 32.0k, False: 0]
  |  |  ------------------
  ------------------
 9044|  32.0k|	if (!eq) NEXT;
  ------------------
  |  | 2202|  1.55k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  ------------------
  |  |  |  Branch (2202:15): [True: 1.55k, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (9044:6): [True: 1.55k, False: 30.4k]
  ------------------
 9045|  32.0k|	SKIP_BLANKS;
  ------------------
  |  | 2199|  89.9k|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  | 2202|  89.9k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2202:15): [True: 89.9k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 9046|  32.0k|        xmlXPathCompRelationalExpr(ctxt);
 9047|  32.0k|	CHECK_ERROR;
  ------------------
  |  |  230|  32.0k|    if (ctxt->error != XPATH_EXPRESSION_OK) return
  |  |  ------------------
  |  |  |  Branch (230:9): [True: 675, False: 31.3k]
  |  |  ------------------
  ------------------
 9048|  31.3k|	PUSH_BINARY_EXPR(XPATH_OP_EQUAL, op1, ctxt->comp->last, eq, 0);
  ------------------
  |  | 1094|  31.3k|#define PUSH_BINARY_EXPR(op, ch1, ch2, val, val2)			\
  |  | 1095|  31.3k|xmlXPathCompExprAdd(ctxt, (ch1), (ch2), (op),			\
  |  | 1096|  31.3k|			(val), (val2), 0 ,NULL ,NULL)
  ------------------
 9049|  31.3k|	SKIP_BLANKS;
  ------------------
  |  | 2199|  31.3k|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  | 2202|  31.3k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2202:15): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 9050|  31.3k|    }
 9051|  45.3k|}
xpath.c:xmlXPathCompRelationalExpr:
 8996|  81.7k|xmlXPathCompRelationalExpr(xmlXPathParserContextPtr ctxt) {
 8997|  81.7k|    xmlXPathCompAdditiveExpr(ctxt);
 8998|  81.7k|    CHECK_ERROR;
  ------------------
  |  |  230|  81.7k|    if (ctxt->error != XPATH_EXPRESSION_OK) return
  |  |  ------------------
  |  |  |  Branch (230:9): [True: 4.39k, False: 77.3k]
  |  |  ------------------
  ------------------
 8999|  77.3k|    SKIP_BLANKS;
  ------------------
  |  | 2199|  77.3k|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  | 2202|  81.7k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2202:15): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 9000|  95.4k|    while ((CUR == '<') || (CUR == '>')) {
  ------------------
  |  | 2193|  95.4k|#define CUR (*ctxt->cur)
  ------------------
                  while ((CUR == '<') || (CUR == '>')) {
  ------------------
  |  | 2193|  93.7k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (9000:12): [True: 1.65k, False: 93.7k]
  |  Branch (9000:28): [True: 17.1k, False: 76.6k]
  ------------------
 9001|  18.7k|	int inf, strict;
 9002|  18.7k|	int op1 = ctxt->comp->last;
 9003|       |
 9004|  18.7k|        if (CUR == '<') inf = 1;
  ------------------
  |  | 2193|  18.7k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (9004:13): [True: 1.65k, False: 17.1k]
  ------------------
 9005|  17.1k|	else inf = 0;
 9006|  18.7k|	if (NXT(1) == '=') strict = 0;
  ------------------
  |  | 2195|  18.7k|#define NXT(val) ctxt->cur[(val)]
  ------------------
  |  Branch (9006:6): [True: 1.24k, False: 17.5k]
  ------------------
 9007|  17.5k|	else strict = 1;
 9008|  18.7k|	NEXT;
  ------------------
  |  | 2202|  18.7k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  ------------------
  |  |  |  Branch (2202:15): [True: 18.7k, False: 0]
  |  |  ------------------
  ------------------
 9009|  18.7k|	if (!strict) NEXT;
  ------------------
  |  | 2202|  1.24k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  ------------------
  |  |  |  Branch (2202:15): [True: 1.24k, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (9009:6): [True: 1.24k, False: 17.5k]
  ------------------
 9010|  18.7k|	SKIP_BLANKS;
  ------------------
  |  | 2199|  18.7k|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  | 2202|  4.03k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2202:15): [True: 4.03k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 9011|  18.7k|        xmlXPathCompAdditiveExpr(ctxt);
 9012|  18.7k|	CHECK_ERROR;
  ------------------
  |  |  230|  18.7k|    if (ctxt->error != XPATH_EXPRESSION_OK) return
  |  |  ------------------
  |  |  |  Branch (230:9): [True: 663, False: 18.0k]
  |  |  ------------------
  ------------------
 9013|  18.0k|	PUSH_BINARY_EXPR(XPATH_OP_CMP, op1, ctxt->comp->last, inf, strict);
  ------------------
  |  | 1094|  18.0k|#define PUSH_BINARY_EXPR(op, ch1, ch2, val, val2)			\
  |  | 1095|  18.0k|xmlXPathCompExprAdd(ctxt, (ch1), (ch2), (op),			\
  |  | 1096|  18.0k|			(val), (val2), 0 ,NULL ,NULL)
  ------------------
 9014|  18.0k|	SKIP_BLANKS;
  ------------------
  |  | 2199|  18.0k|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  | 2202|  18.0k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2202:15): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 9015|  18.0k|    }
 9016|  77.3k|}
xpath.c:xmlXPathCompAdditiveExpr:
 8958|   100k|xmlXPathCompAdditiveExpr(xmlXPathParserContextPtr ctxt) {
 8959|       |
 8960|   100k|    xmlXPathCompMultiplicativeExpr(ctxt);
 8961|   100k|    CHECK_ERROR;
  ------------------
  |  |  230|   100k|    if (ctxt->error != XPATH_EXPRESSION_OK) return
  |  |  ------------------
  |  |  |  Branch (230:9): [True: 4.42k, False: 96.0k]
  |  |  ------------------
  ------------------
 8962|  96.0k|    SKIP_BLANKS;
  ------------------
  |  | 2199|  96.0k|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  | 2202|   100k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2202:15): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 8963|   140k|    while ((CUR == '+') || (CUR == '-')) {
  ------------------
  |  | 2193|   140k|#define CUR (*ctxt->cur)
  ------------------
                  while ((CUR == '+') || (CUR == '-')) {
  ------------------
  |  | 2193|   135k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (8963:12): [True: 4.60k, False: 135k]
  |  Branch (8963:28): [True: 40.4k, False: 95.4k]
  ------------------
 8964|  45.0k|	int plus;
 8965|  45.0k|	int op1 = ctxt->comp->last;
 8966|       |
 8967|  45.0k|        if (CUR == '+') plus = 1;
  ------------------
  |  | 2193|  45.0k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (8967:13): [True: 4.60k, False: 40.4k]
  ------------------
 8968|  40.4k|	else plus = 0;
 8969|  45.0k|	NEXT;
  ------------------
  |  | 2202|  45.0k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  ------------------
  |  |  |  Branch (2202:15): [True: 45.0k, False: 0]
  |  |  ------------------
  ------------------
 8970|  45.0k|	SKIP_BLANKS;
  ------------------
  |  | 2199|  45.0k|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  | 2202|  3.55k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2202:15): [True: 3.55k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 8971|  45.0k|        xmlXPathCompMultiplicativeExpr(ctxt);
 8972|  45.0k|	CHECK_ERROR;
  ------------------
  |  |  230|  45.0k|    if (ctxt->error != XPATH_EXPRESSION_OK) return
  |  |  ------------------
  |  |  |  Branch (230:9): [True: 630, False: 44.3k]
  |  |  ------------------
  ------------------
 8973|  44.3k|	PUSH_BINARY_EXPR(XPATH_OP_PLUS, op1, ctxt->comp->last, plus, 0);
  ------------------
  |  | 1094|  44.3k|#define PUSH_BINARY_EXPR(op, ch1, ch2, val, val2)			\
  |  | 1095|  44.3k|xmlXPathCompExprAdd(ctxt, (ch1), (ch2), (op),			\
  |  | 1096|  44.3k|			(val), (val2), 0 ,NULL ,NULL)
  ------------------
 8974|  44.3k|	SKIP_BLANKS;
  ------------------
  |  | 2199|  44.3k|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  | 2202|  44.3k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2202:15): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 8975|  44.3k|    }
 8976|  96.0k|}
xpath.c:xmlXPathCompMultiplicativeExpr:
 8919|   145k|xmlXPathCompMultiplicativeExpr(xmlXPathParserContextPtr ctxt) {
 8920|   145k|    xmlXPathCompUnaryExpr(ctxt);
 8921|   145k|    CHECK_ERROR;
  ------------------
  |  |  230|   145k|    if (ctxt->error != XPATH_EXPRESSION_OK) return
  |  |  ------------------
  |  |  |  Branch (230:9): [True: 4.65k, False: 140k]
  |  |  ------------------
  ------------------
 8922|   140k|    SKIP_BLANKS;
  ------------------
  |  | 2199|   140k|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  | 2202|   145k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2202:15): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 8923|  1.07M|    while ((CUR == '*') ||
  ------------------
  |  | 2193|  1.07M|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (8923:12): [True: 931k, False: 141k]
  ------------------
 8924|   141k|           ((CUR == 'd') && (NXT(1) == 'i') && (NXT(2) == 'v')) ||
  ------------------
  |  | 2193|   141k|#define CUR (*ctxt->cur)
  ------------------
                         ((CUR == 'd') && (NXT(1) == 'i') && (NXT(2) == 'v')) ||
  ------------------
  |  | 2195|    789|#define NXT(val) ctxt->cur[(val)]
  ------------------
                         ((CUR == 'd') && (NXT(1) == 'i') && (NXT(2) == 'v')) ||
  ------------------
  |  | 2195|    769|#define NXT(val) ctxt->cur[(val)]
  ------------------
  |  Branch (8924:13): [True: 789, False: 140k]
  |  Branch (8924:29): [True: 769, False: 20]
  |  Branch (8924:48): [True: 733, False: 36]
  ------------------
 8925|   932k|           ((CUR == 'm') && (NXT(1) == 'o') && (NXT(2) == 'd'))) {
  ------------------
  |  | 2193|   140k|#define CUR (*ctxt->cur)
  ------------------
                         ((CUR == 'm') && (NXT(1) == 'o') && (NXT(2) == 'd'))) {
  ------------------
  |  | 2195|    164|#define NXT(val) ctxt->cur[(val)]
  ------------------
                         ((CUR == 'm') && (NXT(1) == 'o') && (NXT(2) == 'd'))) {
  ------------------
  |  | 2195|    154|#define NXT(val) ctxt->cur[(val)]
  ------------------
  |  Branch (8925:13): [True: 164, False: 140k]
  |  Branch (8925:29): [True: 154, False: 10]
  |  Branch (8925:48): [True: 141, False: 13]
  ------------------
 8926|   932k|	int op = -1;
 8927|   932k|	int op1 = ctxt->comp->last;
 8928|       |
 8929|   932k|        if (CUR == '*') {
  ------------------
  |  | 2193|   932k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (8929:13): [True: 931k, False: 874]
  ------------------
 8930|   931k|	    op = 0;
 8931|   931k|	    NEXT;
  ------------------
  |  | 2202|   931k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  ------------------
  |  |  |  Branch (2202:15): [True: 931k, False: 0]
  |  |  ------------------
  ------------------
 8932|   931k|	} else if (CUR == 'd') {
  ------------------
  |  | 2193|    874|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (8932:13): [True: 733, False: 141]
  ------------------
 8933|    733|	    op = 1;
 8934|    733|	    SKIP(3);
  ------------------
  |  | 2194|    733|#define SKIP(val) ctxt->cur += (val)
  ------------------
 8935|    733|	} else if (CUR == 'm') {
  ------------------
  |  | 2193|    141|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (8935:13): [True: 141, False: 0]
  ------------------
 8936|    141|	    op = 2;
 8937|    141|	    SKIP(3);
  ------------------
  |  | 2194|    141|#define SKIP(val) ctxt->cur += (val)
  ------------------
 8938|    141|	}
 8939|   932k|	SKIP_BLANKS;
  ------------------
  |  | 2199|   932k|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  | 2202|  9.06k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2202:15): [True: 9.06k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 8940|   932k|        xmlXPathCompUnaryExpr(ctxt);
 8941|   932k|	CHECK_ERROR;
  ------------------
  |  |  230|   932k|    if (ctxt->error != XPATH_EXPRESSION_OK) return
  |  |  ------------------
  |  |  |  Branch (230:9): [True: 397, False: 932k]
  |  |  ------------------
  ------------------
 8942|   932k|	PUSH_BINARY_EXPR(XPATH_OP_MULT, op1, ctxt->comp->last, op, 0);
  ------------------
  |  | 1094|   932k|#define PUSH_BINARY_EXPR(op, ch1, ch2, val, val2)			\
  |  | 1095|   932k|xmlXPathCompExprAdd(ctxt, (ch1), (ch2), (op),			\
  |  | 1096|   932k|			(val), (val2), 0 ,NULL ,NULL)
  ------------------
 8943|   932k|	SKIP_BLANKS;
  ------------------
  |  | 2199|   932k|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  | 2202|   932k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2202:15): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 8944|   932k|    }
 8945|   140k|}
xpath.c:xmlXPathCompUnaryExpr:
 8884|  1.07M|xmlXPathCompUnaryExpr(xmlXPathParserContextPtr ctxt) {
 8885|  1.07M|    int minus = 0;
 8886|  1.07M|    int found = 0;
 8887|       |
 8888|  1.07M|    SKIP_BLANKS;
  ------------------
  |  | 2199|  1.07M|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  | 2202|  13.6k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2202:15): [True: 13.6k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 8889|  1.14M|    while (CUR == '-') {
  ------------------
  |  | 2193|  1.14M|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (8889:12): [True: 63.2k, False: 1.07M]
  ------------------
 8890|  63.2k|        minus = 1 - minus;
 8891|  63.2k|	found = 1;
 8892|  63.2k|	NEXT;
  ------------------
  |  | 2202|  63.2k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  ------------------
  |  |  |  Branch (2202:15): [True: 63.2k, False: 0]
  |  |  ------------------
  ------------------
 8893|  63.2k|	SKIP_BLANKS;
  ------------------
  |  | 2199|  63.2k|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  | 2202|  6.41k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2202:15): [True: 6.41k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 8894|  63.2k|    }
 8895|       |
 8896|  1.07M|    xmlXPathCompUnionExpr(ctxt);
 8897|  1.07M|    CHECK_ERROR;
  ------------------
  |  |  230|  1.07M|    if (ctxt->error != XPATH_EXPRESSION_OK) return
  |  |  ------------------
  |  |  |  Branch (230:9): [True: 5.04k, False: 1.07M]
  |  |  ------------------
  ------------------
 8898|  1.07M|    if (found) {
  ------------------
  |  Branch (8898:9): [True: 43.2k, False: 1.02M]
  ------------------
 8899|  43.2k|	if (minus)
  ------------------
  |  Branch (8899:6): [True: 37.8k, False: 5.45k]
  ------------------
 8900|  37.8k|	    PUSH_UNARY_EXPR(XPATH_OP_PLUS, ctxt->comp->last, 2, 0);
  ------------------
  |  | 1091|  37.8k|#define PUSH_UNARY_EXPR(op, ch, val, val2)				\
  |  | 1092|  37.8k|xmlXPathCompExprAdd(ctxt, (ch), -1, (op), (val), (val2), 0 ,NULL ,NULL)
  ------------------
 8901|  5.45k|	else
 8902|       |	    PUSH_UNARY_EXPR(XPATH_OP_PLUS, ctxt->comp->last, 3, 0);
  ------------------
  |  | 1091|  5.45k|#define PUSH_UNARY_EXPR(op, ch, val, val2)				\
  |  | 1092|  5.45k|xmlXPathCompExprAdd(ctxt, (ch), -1, (op), (val), (val2), 0 ,NULL ,NULL)
  ------------------
 8903|  43.2k|    }
 8904|  1.07M|}
xpath.c:xmlXPathCompUnionExpr:
 8856|  1.07M|xmlXPathCompUnionExpr(xmlXPathParserContextPtr ctxt) {
 8857|  1.07M|    xmlXPathCompPathExpr(ctxt);
 8858|  1.07M|    CHECK_ERROR;
  ------------------
  |  |  230|  1.07M|    if (ctxt->error != XPATH_EXPRESSION_OK) return
  |  |  ------------------
  |  |  |  Branch (230:9): [True: 4.85k, False: 1.07M]
  |  |  ------------------
  ------------------
 8859|  1.07M|    SKIP_BLANKS;
  ------------------
  |  | 2199|  1.07M|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  | 2202|  1.07M|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2202:15): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 8860|  1.09M|    while (CUR == '|') {
  ------------------
  |  | 2193|  1.09M|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (8860:12): [True: 17.5k, False: 1.07M]
  ------------------
 8861|  17.5k|	int op1 = ctxt->comp->last;
 8862|  17.5k|	PUSH_LEAVE_EXPR(XPATH_OP_NODE, 0, 0);
  ------------------
  |  | 1088|  17.5k|#define PUSH_LEAVE_EXPR(op, val, val2)					\
  |  | 1089|  17.5k|xmlXPathCompExprAdd(ctxt, -1, -1, (op), (val), (val2), 0 ,NULL ,NULL)
  ------------------
 8863|       |
 8864|  17.5k|	NEXT;
  ------------------
  |  | 2202|  17.5k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  ------------------
  |  |  |  Branch (2202:15): [True: 17.5k, False: 0]
  |  |  ------------------
  ------------------
 8865|  17.5k|	SKIP_BLANKS;
  ------------------
  |  | 2199|  17.5k|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  | 2202|  3.62k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2202:15): [True: 3.62k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 8866|  17.5k|	xmlXPathCompPathExpr(ctxt);
 8867|       |
 8868|  17.5k|	PUSH_BINARY_EXPR(XPATH_OP_UNION, op1, ctxt->comp->last, 0, 0);
  ------------------
  |  | 1094|  17.5k|#define PUSH_BINARY_EXPR(op, ch1, ch2, val, val2)			\
  |  | 1095|  17.5k|xmlXPathCompExprAdd(ctxt, (ch1), (ch2), (op),			\
  |  | 1096|  17.5k|			(val), (val2), 0 ,NULL ,NULL)
  ------------------
 8869|       |
 8870|  17.5k|	SKIP_BLANKS;
  ------------------
  |  | 2199|  17.5k|    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|  17.5k|    }
 8872|  1.07M|}
xpath.c:xmlXPathCompPathExpr:
 8734|  1.09M|xmlXPathCompPathExpr(xmlXPathParserContextPtr ctxt) {
 8735|  1.09M|    int lc = 1;           /* Should we branch to LocationPath ?         */
 8736|  1.09M|    xmlChar *name = NULL; /* we may have to preparse a name to find out */
 8737|       |
 8738|  1.09M|    SKIP_BLANKS;
  ------------------
  |  | 2199|  1.09M|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  | 2202|      0|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2202:15): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 8739|  1.09M|    if ((CUR == '$') || (CUR == '(') ||
  ------------------
  |  | 2193|  1.09M|#define CUR (*ctxt->cur)
  ------------------
                  if ((CUR == '$') || (CUR == '(') ||
  ------------------
  |  | 2193|  1.09M|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (8739:9): [True: 1.01k, False: 1.09M]
  |  Branch (8739:25): [True: 4.66k, False: 1.08M]
  ------------------
 8740|  1.08M|	(IS_ASCII_DIGIT(CUR)) ||
  ------------------
  |  |  230|  1.08M|#define IS_ASCII_DIGIT(c)	((0x30 <= (c)) && ((c) <= 0x39))
  |  |  ------------------
  |  |  |  Branch (230:28): [True: 110k, False: 979k]
  |  |  |  Branch (230:45): [True: 38.4k, False: 71.6k]
  |  |  ------------------
  ------------------
 8741|  1.05M|        (CUR == '\'') || (CUR == '"') ||
  ------------------
  |  | 2193|  1.05M|#define CUR (*ctxt->cur)
  ------------------
                      (CUR == '\'') || (CUR == '"') ||
  ------------------
  |  | 2193|  1.05M|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (8741:9): [True: 1.13k, False: 1.05M]
  |  Branch (8741:26): [True: 113, False: 1.05M]
  ------------------
 8742|  1.05M|	(CUR == '.' && IS_ASCII_DIGIT(NXT(1)))) {
  ------------------
  |  | 2193|  1.05M|#define CUR (*ctxt->cur)
  ------------------
              	(CUR == '.' && IS_ASCII_DIGIT(NXT(1)))) {
  ------------------
  |  |  230|  7.71k|#define IS_ASCII_DIGIT(c)	((0x30 <= (c)) && ((c) <= 0x39))
  |  |  ------------------
  |  |  |  Branch (230:28): [True: 4.54k, False: 3.17k]
  |  |  |  Branch (230:45): [True: 2.61k, False: 1.92k]
  |  |  ------------------
  ------------------
  |  Branch (8742:3): [True: 7.71k, False: 1.04M]
  ------------------
 8743|  48.0k|	lc = 0;
 8744|  1.04M|    } else if (CUR == '*') {
  ------------------
  |  | 2193|  1.04M|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (8744:16): [True: 915k, False: 132k]
  ------------------
 8745|       |	/* relative or absolute location path */
 8746|   915k|	lc = 1;
 8747|   915k|    } else if (CUR == '/') {
  ------------------
  |  | 2193|   132k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (8747:16): [True: 55.2k, False: 77.1k]
  ------------------
 8748|       |	/* relative or absolute location path */
 8749|  55.2k|	lc = 1;
 8750|  77.1k|    } else if (CUR == '@') {
  ------------------
  |  | 2193|  77.1k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (8750:16): [True: 644, False: 76.5k]
  ------------------
 8751|       |	/* relative abbreviated attribute location path */
 8752|    644|	lc = 1;
 8753|  76.5k|    } else if (CUR == '.') {
  ------------------
  |  | 2193|  76.5k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (8753:16): [True: 5.09k, False: 71.4k]
  ------------------
 8754|       |	/* relative abbreviated attribute location path */
 8755|  5.09k|	lc = 1;
 8756|  71.4k|    } else {
 8757|       |	/*
 8758|       |	 * Problem is finding if we have a name here whether it's:
 8759|       |	 *   - a nodetype
 8760|       |	 *   - a function call in which case it's followed by '('
 8761|       |	 *   - an axis in which case it's followed by ':'
 8762|       |	 *   - a element name
 8763|       |	 * We do an a priori analysis here rather than having to
 8764|       |	 * maintain parsed token content through the recursive function
 8765|       |	 * calls. This looks uglier but makes the code easier to
 8766|       |	 * read/write/debug.
 8767|       |	 */
 8768|  71.4k|	SKIP_BLANKS;
  ------------------
  |  | 2199|  71.4k|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  | 2202|      0|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2202:15): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 8769|  71.4k|	name = xmlXPathScanName(ctxt);
 8770|  71.4k|	if ((name != NULL) && (xmlStrstr(name, (xmlChar *) "::") != NULL)) {
  ------------------
  |  Branch (8770:6): [True: 68.7k, False: 2.62k]
  |  Branch (8770:24): [True: 947, False: 67.8k]
  ------------------
 8771|    947|	    lc = 1;
 8772|    947|	    xmlFree(name);
 8773|  70.4k|	} else if (name != NULL) {
  ------------------
  |  Branch (8773:13): [True: 67.8k, False: 2.62k]
  ------------------
 8774|  67.8k|	    int len =xmlStrlen(name);
 8775|       |
 8776|       |
 8777|   916k|	    while (NXT(len) != 0) {
  ------------------
  |  | 2195|   916k|#define NXT(val) ctxt->cur[(val)]
  ------------------
  |  Branch (8777:13): [True: 915k, False: 859]
  ------------------
 8778|   915k|		if (NXT(len) == '/') {
  ------------------
  |  | 2195|   915k|#define NXT(val) ctxt->cur[(val)]
  ------------------
  |  Branch (8778:7): [True: 3.18k, False: 912k]
  ------------------
 8779|       |		    /* element name */
 8780|  3.18k|		    lc = 1;
 8781|  3.18k|		    break;
 8782|   912k|		} else if (IS_BLANK_CH(NXT(len))) {
  ------------------
  |  |  137|   912k|#define IS_BLANK_CH(c)  xmlIsBlank_ch(c)
  |  |  ------------------
  |  |  |  |   90|   912k|#define xmlIsBlank_ch(c)	(((c) == 0x20) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (90:27): [True: 847k, False: 65.1k]
  |  |  |  |  ------------------
  |  |  |  |   91|   912k|				 ((0x9 <= (c)) && ((c) <= 0xa)) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (91:7): [True: 65.1k, False: 3]
  |  |  |  |  |  Branch (91:23): [True: 1.15k, False: 63.9k]
  |  |  |  |  ------------------
  |  |  |  |   92|   912k|				 ((c) == 0xd))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (92:6): [True: 192, False: 63.8k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 8783|       |		    /* ignore blanks */
 8784|   848k|		    ;
 8785|   848k|		} else if (NXT(len) == ':') {
  ------------------
  |  | 2195|  63.8k|#define NXT(val) ctxt->cur[(val)]
  ------------------
  |  Branch (8785:14): [True: 549, False: 63.2k]
  ------------------
 8786|    549|		    lc = 1;
 8787|    549|		    break;
 8788|  63.2k|		} else if ((NXT(len) == '(')) {
  ------------------
  |  | 2195|  63.2k|#define NXT(val) ctxt->cur[(val)]
  ------------------
  |  Branch (8788:14): [True: 12.7k, False: 50.4k]
  ------------------
 8789|       |		    /* Node Type or Function */
 8790|  12.7k|		    if (xmlXPathIsNodeType(name)) {
  ------------------
  |  Branch (8790:11): [True: 216, False: 12.5k]
  ------------------
 8791|    216|			lc = 1;
 8792|  12.5k|		    } else {
 8793|  12.5k|			lc = 0;
 8794|  12.5k|		    }
 8795|  12.7k|                    break;
 8796|  50.4k|		} else if ((NXT(len) == '[')) {
  ------------------
  |  | 2195|  50.4k|#define NXT(val) ctxt->cur[(val)]
  ------------------
  |  Branch (8796:14): [True: 971, False: 49.5k]
  ------------------
 8797|       |		    /* element name */
 8798|    971|		    lc = 1;
 8799|    971|		    break;
 8800|  49.5k|		} else if ((NXT(len) == '<') || (NXT(len) == '>') ||
  ------------------
  |  | 2195|  49.5k|#define NXT(val) ctxt->cur[(val)]
  ------------------
              		} else if ((NXT(len) == '<') || (NXT(len) == '>') ||
  ------------------
  |  | 2195|  48.8k|#define NXT(val) ctxt->cur[(val)]
  ------------------
  |  Branch (8800:14): [True: 635, False: 48.8k]
  |  Branch (8800:35): [True: 6.55k, False: 42.3k]
  ------------------
 8801|  42.3k|			   (NXT(len) == '=')) {
  ------------------
  |  | 2195|  42.3k|#define NXT(val) ctxt->cur[(val)]
  ------------------
  |  Branch (8801:7): [True: 5.40k, False: 36.9k]
  ------------------
 8802|  12.5k|		    lc = 1;
 8803|  12.5k|		    break;
 8804|  36.9k|		} else {
 8805|  36.9k|		    lc = 1;
 8806|  36.9k|		    break;
 8807|  36.9k|		}
 8808|   848k|		len++;
 8809|   848k|	    }
 8810|  67.8k|	    if (NXT(len) == 0) {
  ------------------
  |  | 2195|  67.8k|#define NXT(val) ctxt->cur[(val)]
  ------------------
  |  Branch (8810:10): [True: 859, False: 66.9k]
  ------------------
 8811|       |		/* element name */
 8812|    859|		lc = 1;
 8813|    859|	    }
 8814|  67.8k|	    xmlFree(name);
 8815|  67.8k|	} else {
 8816|       |	    /* make sure all cases are covered explicitly */
 8817|  2.62k|	    XP_ERROR(XPATH_EXPR_ERROR);
  ------------------
  |  |  244|  2.62k|    { xmlXPathErr(ctxt, X); return; }
  ------------------
 8818|      0|	}
 8819|  71.4k|    }
 8820|       |
 8821|  1.09M|    if (lc) {
  ------------------
  |  Branch (8821:9): [True: 1.03M, False: 60.5k]
  ------------------
 8822|  1.03M|	if (CUR == '/') {
  ------------------
  |  | 2193|  1.03M|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (8822:6): [True: 55.2k, False: 977k]
  ------------------
 8823|  55.2k|	    PUSH_LEAVE_EXPR(XPATH_OP_ROOT, 0, 0);
  ------------------
  |  | 1088|  55.2k|#define PUSH_LEAVE_EXPR(op, val, val2)					\
  |  | 1089|  55.2k|xmlXPathCompExprAdd(ctxt, -1, -1, (op), (val), (val2), 0 ,NULL ,NULL)
  ------------------
 8824|   977k|	} else {
 8825|   977k|	    PUSH_LEAVE_EXPR(XPATH_OP_NODE, 0, 0);
  ------------------
  |  | 1088|   977k|#define PUSH_LEAVE_EXPR(op, val, val2)					\
  |  | 1089|   977k|xmlXPathCompExprAdd(ctxt, -1, -1, (op), (val), (val2), 0 ,NULL ,NULL)
  ------------------
 8826|   977k|	}
 8827|  1.03M|	xmlXPathCompLocationPath(ctxt);
 8828|  1.03M|    } else {
 8829|  60.5k|	xmlXPathCompFilterExpr(ctxt);
 8830|  60.5k|	CHECK_ERROR;
  ------------------
  |  |  230|  60.5k|    if (ctxt->error != XPATH_EXPRESSION_OK) return
  |  |  ------------------
  |  |  |  Branch (230:9): [True: 2.04k, False: 58.5k]
  |  |  ------------------
  ------------------
 8831|  58.5k|	if ((CUR == '/') && (NXT(1) == '/')) {
  ------------------
  |  | 2193|  58.5k|#define CUR (*ctxt->cur)
  ------------------
              	if ((CUR == '/') && (NXT(1) == '/')) {
  ------------------
  |  | 2195|  2.00k|#define NXT(val) ctxt->cur[(val)]
  ------------------
  |  Branch (8831:6): [True: 2.00k, False: 56.5k]
  |  Branch (8831:22): [True: 545, False: 1.45k]
  ------------------
 8832|    545|	    SKIP(2);
  ------------------
  |  | 2194|    545|#define SKIP(val) ctxt->cur += (val)
  ------------------
 8833|    545|	    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: 1.89k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 8834|       |
 8835|    545|	    PUSH_LONG_EXPR(XPATH_OP_COLLECT, AXIS_DESCENDANT_OR_SELF,
  ------------------
  |  | 1085|    545|    xmlXPathCompExprAdd(ctxt, ctxt->comp->last, -1,		\
  |  | 1086|    545|	                (op), (val), (val2), (val3), (val4), (val5))
  ------------------
 8836|    545|		    NODE_TEST_TYPE, NODE_TYPE_NODE, NULL, NULL);
 8837|       |
 8838|    545|	    xmlXPathCompRelativeLocationPath(ctxt);
 8839|  57.9k|	} else if (CUR == '/') {
  ------------------
  |  | 2193|  57.9k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (8839:13): [True: 1.45k, False: 56.5k]
  ------------------
 8840|  1.45k|	    xmlXPathCompRelativeLocationPath(ctxt);
 8841|  1.45k|	}
 8842|  58.5k|    }
 8843|  1.09M|    SKIP_BLANKS;
  ------------------
  |  | 2199|  1.09M|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  | 2202|  1.10M|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2202:15): [True: 12.1k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 8844|  1.09M|}
xpath.c:xmlXPathScanName:
 8705|  71.4k|xmlXPathScanName(xmlXPathParserContextPtr ctxt) {
 8706|  71.4k|    const xmlChar *end;
 8707|  71.4k|    xmlChar *ret;
 8708|       |
 8709|  71.4k|    end = xmlScanName(ctxt->cur, XML_MAX_NAME_LENGTH, 0);
  ------------------
  |  |   65|  71.4k|#define XML_MAX_NAME_LENGTH 50000
  ------------------
 8710|  71.4k|    if (end == NULL) {
  ------------------
  |  Branch (8710:9): [True: 1, False: 71.4k]
  ------------------
 8711|      1|        XP_ERRORNULL(XPATH_EXPR_ERROR);
  ------------------
  |  |  633|      1|    { xmlXPathErr(ctxt, X); return(NULL); }
  ------------------
 8712|      0|    }
 8713|  71.4k|    if (end == ctxt->cur)
  ------------------
  |  Branch (8713:9): [True: 2.56k, False: 68.8k]
  ------------------
 8714|  2.56k|        return(NULL);
 8715|       |
 8716|  68.8k|    ret = xmlStrndup(ctxt->cur, end - ctxt->cur);
 8717|  68.8k|    if (ret == NULL)
  ------------------
  |  Branch (8717:9): [True: 53, False: 68.7k]
  ------------------
 8718|     53|        xmlXPathPErrMemory(ctxt);
 8719|  68.8k|    return(ret);
 8720|  71.4k|}
xpath.c:xmlXPathCompLocationPath:
 9524|  1.03M|xmlXPathCompLocationPath(xmlXPathParserContextPtr ctxt) {
 9525|  1.03M|    SKIP_BLANKS;
  ------------------
  |  | 2199|  1.03M|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  | 2202|      0|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2202:15): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 9526|  1.03M|    if (CUR != '/') {
  ------------------
  |  | 2193|  1.03M|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (9526:9): [True: 977k, False: 55.2k]
  ------------------
 9527|   977k|        xmlXPathCompRelativeLocationPath(ctxt);
 9528|   977k|    } else {
 9529|   112k|	while (CUR == '/') {
  ------------------
  |  | 2193|   112k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (9529:9): [True: 57.4k, False: 54.6k]
  ------------------
 9530|  57.4k|	    if ((CUR == '/') && (NXT(1) == '/')) {
  ------------------
  |  | 2193|  57.4k|#define CUR (*ctxt->cur)
  ------------------
              	    if ((CUR == '/') && (NXT(1) == '/')) {
  ------------------
  |  | 2195|  57.4k|#define NXT(val) ctxt->cur[(val)]
  ------------------
  |  Branch (9530:10): [True: 57.4k, False: 0]
  |  Branch (9530:26): [True: 10.4k, False: 47.0k]
  ------------------
 9531|  10.4k|		SKIP(2);
  ------------------
  |  | 2194|  10.4k|#define SKIP(val) ctxt->cur += (val)
  ------------------
 9532|  10.4k|		SKIP_BLANKS;
  ------------------
  |  | 2199|  10.4k|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  | 2202|  8.00k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2202:15): [True: 8.00k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 9533|  10.4k|		PUSH_LONG_EXPR(XPATH_OP_COLLECT, AXIS_DESCENDANT_OR_SELF,
  ------------------
  |  | 1085|  10.4k|    xmlXPathCompExprAdd(ctxt, ctxt->comp->last, -1,		\
  |  | 1086|  10.4k|	                (op), (val), (val2), (val3), (val4), (val5))
  ------------------
 9534|  10.4k|			     NODE_TEST_TYPE, NODE_TYPE_NODE, NULL, NULL);
 9535|  10.4k|		xmlXPathCompRelativeLocationPath(ctxt);
 9536|  47.0k|	    } else if (CUR == '/') {
  ------------------
  |  | 2193|  47.0k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (9536:17): [True: 47.0k, False: 0]
  ------------------
 9537|  47.0k|		NEXT;
  ------------------
  |  | 2202|  47.0k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  ------------------
  |  |  |  Branch (2202:15): [True: 47.0k, False: 0]
  |  |  ------------------
  ------------------
 9538|  47.0k|		SKIP_BLANKS;
  ------------------
  |  | 2199|  47.0k|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  | 2202|  34.0k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2202:15): [True: 34.0k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 9539|  47.0k|		if ((CUR != 0) &&
  ------------------
  |  | 2193|  47.0k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (9539:7): [True: 46.3k, False: 726]
  ------------------
 9540|  46.3k|		    ((IS_ASCII_LETTER(CUR)) || (CUR >= 0x80) ||
  ------------------
  |  |  222|  46.3k|#define IS_ASCII_LETTER(c)	((0x61 <= ((c) | 0x20)) && \
  |  |  ------------------
  |  |  |  Branch (222:29): [True: 8.04k, False: 38.2k]
  |  |  ------------------
  |  |  223|  46.3k|                                 (((c) | 0x20) <= 0x7a))
  |  |  ------------------
  |  |  |  Branch (223:34): [True: 6.08k, False: 1.95k]
  |  |  ------------------
  ------------------
              		    ((IS_ASCII_LETTER(CUR)) || (CUR >= 0x80) ||
  ------------------
  |  | 2193|  40.2k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (9540:34): [True: 493, False: 39.7k]
  ------------------
 9541|  39.7k|                     (CUR == '_') || (CUR == '.') ||
  ------------------
  |  | 2193|  39.7k|#define CUR (*ctxt->cur)
  ------------------
                                   (CUR == '_') || (CUR == '.') ||
  ------------------
  |  | 2193|  39.2k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (9541:22): [True: 520, False: 39.2k]
  |  Branch (9541:38): [True: 2.25k, False: 36.9k]
  ------------------
 9542|  36.9k|		     (CUR == '@') || (CUR == '*')))
  ------------------
  |  | 2193|  36.9k|#define CUR (*ctxt->cur)
  ------------------
              		     (CUR == '@') || (CUR == '*')))
  ------------------
  |  | 2193|  36.7k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (9542:8): [True: 271, False: 36.7k]
  |  Branch (9542:24): [True: 31.6k, False: 5.08k]
  ------------------
 9543|  41.2k|		    xmlXPathCompRelativeLocationPath(ctxt);
 9544|  47.0k|	    }
 9545|  57.4k|	    CHECK_ERROR;
  ------------------
  |  |  230|  57.4k|    if (ctxt->error != XPATH_EXPRESSION_OK) return
  |  |  ------------------
  |  |  |  Branch (230:9): [True: 605, False: 56.8k]
  |  |  ------------------
  ------------------
 9546|  57.4k|	}
 9547|  55.2k|    }
 9548|  1.03M|}
xpath.c:xmlXPathCompFilterExpr:
 8683|  60.5k|xmlXPathCompFilterExpr(xmlXPathParserContextPtr ctxt) {
 8684|  60.5k|    xmlXPathCompPrimaryExpr(ctxt);
 8685|  60.5k|    CHECK_ERROR;
  ------------------
  |  |  230|  60.5k|    if (ctxt->error != XPATH_EXPRESSION_OK) return
  |  |  ------------------
  |  |  |  Branch (230:9): [True: 1.57k, False: 58.9k]
  |  |  ------------------
  ------------------
 8686|  58.9k|    SKIP_BLANKS;
  ------------------
  |  | 2199|  58.9k|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  | 2202|  60.5k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2202:15): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 8687|       |
 8688|  69.9k|    while (CUR == '[') {
  ------------------
  |  | 2193|  69.9k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (8688:12): [True: 10.9k, False: 58.9k]
  ------------------
 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|  58.9k|}
xpath.c:xmlXPathCompPrimaryExpr:
 8645|  60.5k|xmlXPathCompPrimaryExpr(xmlXPathParserContextPtr ctxt) {
 8646|  60.5k|    SKIP_BLANKS;
  ------------------
  |  | 2199|  60.5k|    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|  60.5k|    if (CUR == '$') xmlXPathCompVariableReference(ctxt);
  ------------------
  |  | 2193|  60.5k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (8647:9): [True: 1.01k, False: 59.5k]
  ------------------
 8648|  59.5k|    else if (CUR == '(') {
  ------------------
  |  | 2193|  59.5k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (8648:14): [True: 4.66k, False: 54.8k]
  ------------------
 8649|  4.66k|	NEXT;
  ------------------
  |  | 2202|  4.66k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  ------------------
  |  |  |  Branch (2202:15): [True: 4.66k, False: 0]
  |  |  ------------------
  ------------------
 8650|  4.66k|	SKIP_BLANKS;
  ------------------
  |  | 2199|  8.96k|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  | 2202|  8.96k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2202:15): [True: 8.96k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 8651|  4.66k|	xmlXPathCompileExpr(ctxt, 1);
 8652|  4.66k|	CHECK_ERROR;
  ------------------
  |  |  230|  4.66k|    if (ctxt->error != XPATH_EXPRESSION_OK) return
  |  |  ------------------
  |  |  |  Branch (230:9): [True: 280, False: 4.38k]
  |  |  ------------------
  ------------------
 8653|  4.38k|	if (CUR != ')') {
  ------------------
  |  | 2193|  4.38k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (8653:6): [True: 29, False: 4.35k]
  ------------------
 8654|     29|	    XP_ERROR(XPATH_EXPR_ERROR);
  ------------------
  |  |  244|     29|    { xmlXPathErr(ctxt, X); return; }
  ------------------
 8655|      0|	}
 8656|  4.35k|	NEXT;
  ------------------
  |  | 2202|  4.35k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  ------------------
  |  |  |  Branch (2202:15): [True: 4.35k, False: 0]
  |  |  ------------------
  ------------------
 8657|  4.35k|	SKIP_BLANKS;
  ------------------
  |  | 2199|  18.4k|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  | 2202|  22.7k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2202:15): [True: 18.4k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 8658|  54.8k|    } else if (IS_ASCII_DIGIT(CUR) || (CUR == '.' && IS_ASCII_DIGIT(NXT(1)))) {
  ------------------
  |  |  230|   109k|#define IS_ASCII_DIGIT(c)	((0x30 <= (c)) && ((c) <= 0x39))
  |  |  ------------------
  |  |  |  Branch (230:28): [True: 51.0k, False: 3.85k]
  |  |  |  Branch (230:45): [True: 38.4k, False: 12.5k]
  |  |  ------------------
  ------------------
                  } else if (IS_ASCII_DIGIT(CUR) || (CUR == '.' && IS_ASCII_DIGIT(NXT(1)))) {
  ------------------
  |  | 2193|  16.4k|#define CUR (*ctxt->cur)
  ------------------
                  } else if (IS_ASCII_DIGIT(CUR) || (CUR == '.' && IS_ASCII_DIGIT(NXT(1)))) {
  ------------------
  |  |  230|  2.61k|#define IS_ASCII_DIGIT(c)	((0x30 <= (c)) && ((c) <= 0x39))
  |  |  ------------------
  |  |  |  Branch (230:28): [True: 2.61k, False: 0]
  |  |  |  Branch (230:45): [True: 2.61k, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (8658:40): [True: 2.61k, False: 13.7k]
  ------------------
 8659|  41.0k|	xmlXPathCompNumber(ctxt);
 8660|  41.0k|    } else if ((CUR == '\'') || (CUR == '"')) {
  ------------------
  |  | 2193|  13.7k|#define CUR (*ctxt->cur)
  ------------------
                  } else if ((CUR == '\'') || (CUR == '"')) {
  ------------------
  |  | 2193|  12.6k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (8660:16): [True: 1.13k, False: 12.6k]
  |  Branch (8660:33): [True: 113, False: 12.5k]
  ------------------
 8661|  1.24k|	xmlXPathCompLiteral(ctxt);
 8662|  12.5k|    } else {
 8663|  12.5k|	xmlXPathCompFunctionCall(ctxt);
 8664|  12.5k|    }
 8665|  60.2k|    SKIP_BLANKS;
  ------------------
  |  | 2199|  88.1k|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  | 2202|   148k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2202:15): [True: 88.1k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 8666|  60.2k|}
xpath.c:xmlXPathCompVariableReference:
 8511|  1.01k|xmlXPathCompVariableReference(xmlXPathParserContextPtr ctxt) {
 8512|  1.01k|    xmlChar *name;
 8513|  1.01k|    xmlChar *prefix;
 8514|       |
 8515|  1.01k|    SKIP_BLANKS;
  ------------------
  |  | 2199|  1.01k|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  | 2202|      0|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2202:15): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 8516|  1.01k|    if (CUR != '$') {
  ------------------
  |  | 2193|  1.01k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (8516:9): [True: 0, False: 1.01k]
  ------------------
 8517|      0|	XP_ERROR(XPATH_VARIABLE_REF_ERROR);
  ------------------
  |  |  244|      0|    { xmlXPathErr(ctxt, X); return; }
  ------------------
 8518|      0|    }
 8519|  1.01k|    NEXT;
  ------------------
  |  | 2202|  1.01k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  ------------------
  |  |  |  Branch (2202:15): [True: 1.01k, False: 0]
  |  |  ------------------
  ------------------
 8520|  1.01k|    name = xmlXPathParseQName(ctxt, &prefix);
 8521|  1.01k|    if (name == NULL) {
  ------------------
  |  Branch (8521:9): [True: 56, False: 959]
  ------------------
 8522|     56|        xmlFree(prefix);
 8523|     56|	XP_ERROR(XPATH_VARIABLE_REF_ERROR);
  ------------------
  |  |  244|     56|    { xmlXPathErr(ctxt, X); return; }
  ------------------
 8524|      0|    }
 8525|    959|    ctxt->comp->last = -1;
 8526|    959|    if (PUSH_LONG_EXPR(XPATH_OP_VARIABLE, 0, 0, 0, name, prefix) == -1) {
  ------------------
  |  | 1085|    959|    xmlXPathCompExprAdd(ctxt, ctxt->comp->last, -1,		\
  |  | 1086|    959|	                (op), (val), (val2), (val3), (val4), (val5))
  ------------------
  |  Branch (8526:9): [True: 1, False: 958]
  ------------------
 8527|      1|        xmlFree(prefix);
 8528|      1|        xmlFree(name);
 8529|      1|    }
 8530|    959|    SKIP_BLANKS;
  ------------------
  |  | 2199|  5.27k|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  | 2202|  6.23k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2202:15): [True: 5.27k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 8531|    959|    if ((ctxt->context != NULL) && (ctxt->context->flags & XML_XPATH_NOVAR)) {
  ------------------
  |  |  241|    959|#define XML_XPATH_NOVAR	  (1<<1)
  ------------------
  |  Branch (8531:9): [True: 959, False: 0]
  |  Branch (8531:36): [True: 0, False: 959]
  ------------------
 8532|      0|	XP_ERROR(XPATH_FORBID_VARIABLE_ERROR);
  ------------------
  |  |  244|      0|    { xmlXPathErr(ctxt, X); return; }
  ------------------
 8533|      0|    }
 8534|    959|}
xpath.c:xmlXPathParseQName:
 8178|  13.5k|xmlXPathParseQName(xmlXPathParserContextPtr ctxt, xmlChar **prefix) {
 8179|  13.5k|    xmlChar *ret = NULL;
 8180|       |
 8181|  13.5k|    *prefix = NULL;
 8182|  13.5k|    ret = xmlXPathParseNCName(ctxt);
 8183|  13.5k|    if (ret && CUR == ':') {
  ------------------
  |  | 2193|  13.4k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (8183:9): [True: 13.4k, False: 74]
  |  Branch (8183:16): [True: 1.14k, False: 12.3k]
  ------------------
 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|  13.5k|    return(ret);
 8189|  13.5k|}
xpath.c:xmlXPathCompNumber:
 8337|  41.0k|{
 8338|  41.0k|    double ret = 0.0;
 8339|  41.0k|    int ok = 0;
 8340|  41.0k|    int exponent = 0;
 8341|  41.0k|    int is_exponent_negative = 0;
 8342|  41.0k|    xmlXPathObjectPtr num;
 8343|  41.0k|#ifdef __GNUC__
 8344|  41.0k|    unsigned long tmp = 0;
 8345|  41.0k|    double temp;
 8346|  41.0k|#endif
 8347|       |
 8348|  41.0k|    CHECK_ERROR;
  ------------------
  |  |  230|  41.0k|    if (ctxt->error != XPATH_EXPRESSION_OK) return
  |  |  ------------------
  |  |  |  Branch (230:9): [True: 27, False: 41.0k]
  |  |  ------------------
  ------------------
 8349|  41.0k|    if ((CUR != '.') && ((CUR < '0') || (CUR > '9'))) {
  ------------------
  |  | 2193|  41.0k|#define CUR (*ctxt->cur)
  ------------------
                  if ((CUR != '.') && ((CUR < '0') || (CUR > '9'))) {
  ------------------
  |  | 2193|  38.4k|#define CUR (*ctxt->cur)
  ------------------
                  if ((CUR != '.') && ((CUR < '0') || (CUR > '9'))) {
  ------------------
  |  | 2193|  38.4k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (8349:9): [True: 38.4k, False: 2.61k]
  |  Branch (8349:26): [True: 0, False: 38.4k]
  |  Branch (8349:41): [True: 0, False: 38.4k]
  ------------------
 8350|      0|        XP_ERROR(XPATH_NUMBER_ERROR);
  ------------------
  |  |  244|      0|    { xmlXPathErr(ctxt, X); return; }
  ------------------
 8351|      0|    }
 8352|  41.0k|#ifdef __GNUC__
 8353|       |    /*
 8354|       |     * tmp/temp is a workaround against a gcc compiler bug
 8355|       |     * http://veillard.com/gcc.bug
 8356|       |     */
 8357|  41.0k|    ret = 0;
 8358|   134k|    while ((CUR >= '0') && (CUR <= '9')) {
  ------------------
  |  | 2193|   134k|#define CUR (*ctxt->cur)
  ------------------
                  while ((CUR >= '0') && (CUR <= '9')) {
  ------------------
  |  | 2193|   109k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (8358:12): [True: 109k, False: 25.1k]
  |  Branch (8358:28): [True: 93.1k, False: 15.9k]
  ------------------
 8359|  93.1k|	ret = ret * 10;
 8360|  93.1k|	tmp = (CUR - '0');
  ------------------
  |  | 2193|  93.1k|#define CUR (*ctxt->cur)
  ------------------
 8361|  93.1k|        ok = 1;
 8362|  93.1k|        NEXT;
  ------------------
  |  | 2202|  93.1k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  ------------------
  |  |  |  Branch (2202:15): [True: 93.1k, False: 0]
  |  |  ------------------
  ------------------
 8363|  93.1k|	temp = (double) tmp;
 8364|  93.1k|	ret = ret + temp;
 8365|  93.1k|    }
 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|  41.0k|    if (CUR == '.') {
  ------------------
  |  | 2193|  41.0k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (8374:9): [True: 4.62k, False: 36.4k]
  ------------------
 8375|  4.62k|	int v, frac = 0, max;
 8376|  4.62k|	double fraction = 0;
 8377|       |
 8378|  4.62k|        NEXT;
  ------------------
  |  | 2202|  4.62k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  ------------------
  |  |  |  Branch (2202:15): [True: 4.62k, False: 0]
  |  |  ------------------
  ------------------
 8379|  4.62k|        if (((CUR < '0') || (CUR > '9')) && (!ok)) {
  ------------------
  |  | 2193|  4.62k|#define CUR (*ctxt->cur)
  ------------------
                      if (((CUR < '0') || (CUR > '9')) && (!ok)) {
  ------------------
  |  | 2193|  3.86k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (8379:14): [True: 767, False: 3.86k]
  |  Branch (8379:29): [True: 633, False: 3.22k]
  |  Branch (8379:45): [True: 0, False: 1.40k]
  ------------------
 8380|      0|            XP_ERROR(XPATH_NUMBER_ERROR);
  ------------------
  |  |  244|      0|    { xmlXPathErr(ctxt, X); return; }
  ------------------
 8381|      0|        }
 8382|  6.88k|        while (CUR == '0') {
  ------------------
  |  | 2193|  6.88k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (8382:16): [True: 2.25k, False: 4.62k]
  ------------------
 8383|  2.25k|            frac = frac + 1;
 8384|  2.25k|            NEXT;
  ------------------
  |  | 2202|  2.25k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  ------------------
  |  |  |  Branch (2202:15): [True: 2.25k, False: 0]
  |  |  ------------------
  ------------------
 8385|  2.25k|        }
 8386|  4.62k|        max = frac + MAX_FRAC;
  ------------------
  |  | 8219|  4.62k|#define MAX_FRAC 20
  ------------------
 8387|  18.7k|        while ((CUR >= '0') && (CUR <= '9') && (frac < max)) {
  ------------------
  |  | 2193|  18.7k|#define CUR (*ctxt->cur)
  ------------------
                      while ((CUR >= '0') && (CUR <= '9') && (frac < max)) {
  ------------------
  |  | 2193|  16.5k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (8387:16): [True: 16.5k, False: 2.24k]
  |  Branch (8387:32): [True: 14.1k, False: 2.32k]
  |  Branch (8387:48): [True: 14.1k, False: 64]
  ------------------
 8388|  14.1k|	    v = (CUR - '0');
  ------------------
  |  | 2193|  14.1k|#define CUR (*ctxt->cur)
  ------------------
 8389|  14.1k|	    fraction = fraction * 10 + v;
 8390|  14.1k|	    frac = frac + 1;
 8391|  14.1k|            NEXT;
  ------------------
  |  | 2202|  14.1k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  ------------------
  |  |  |  Branch (2202:15): [True: 14.1k, False: 0]
  |  |  ------------------
  ------------------
 8392|  14.1k|        }
 8393|  4.62k|        fraction /= pow(10.0, frac);
 8394|  4.62k|        ret = ret + fraction;
 8395|  5.11k|        while ((CUR >= '0') && (CUR <= '9'))
  ------------------
  |  | 2193|  5.11k|#define CUR (*ctxt->cur)
  ------------------
                      while ((CUR >= '0') && (CUR <= '9'))
  ------------------
  |  | 2193|  2.82k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (8395:16): [True: 2.82k, False: 2.29k]
  |  Branch (8395:32): [True: 490, False: 2.33k]
  ------------------
 8396|    490|            NEXT;
  ------------------
  |  | 2202|  5.11k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  ------------------
  |  |  |  Branch (2202:15): [True: 490, False: 0]
  |  |  ------------------
  ------------------
 8397|  4.62k|    }
 8398|  41.0k|    if ((CUR == 'e') || (CUR == 'E')) {
  ------------------
  |  | 2193|  41.0k|#define CUR (*ctxt->cur)
  ------------------
                  if ((CUR == 'e') || (CUR == 'E')) {
  ------------------
  |  | 2193|  39.8k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (8398:9): [True: 1.18k, False: 39.8k]
  |  Branch (8398:25): [True: 4.30k, False: 35.5k]
  ------------------
 8399|  5.49k|        NEXT;
  ------------------
  |  | 2202|  5.49k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  ------------------
  |  |  |  Branch (2202:15): [True: 5.49k, False: 0]
  |  |  ------------------
  ------------------
 8400|  5.49k|        if (CUR == '-') {
  ------------------
  |  | 2193|  5.49k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (8400:13): [True: 654, False: 4.83k]
  ------------------
 8401|    654|            is_exponent_negative = 1;
 8402|    654|            NEXT;
  ------------------
  |  | 2202|    654|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  ------------------
  |  |  |  Branch (2202:15): [True: 654, False: 0]
  |  |  ------------------
  ------------------
 8403|  4.83k|        } else if (CUR == '+') {
  ------------------
  |  | 2193|  4.83k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (8403:20): [True: 1.24k, False: 3.59k]
  ------------------
 8404|  1.24k|	    NEXT;
  ------------------
  |  | 2202|  1.24k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  ------------------
  |  |  |  Branch (2202:15): [True: 1.24k, False: 0]
  |  |  ------------------
  ------------------
 8405|  1.24k|	}
 8406|  22.8k|        while ((CUR >= '0') && (CUR <= '9')) {
  ------------------
  |  | 2193|  22.8k|#define CUR (*ctxt->cur)
  ------------------
                      while ((CUR >= '0') && (CUR <= '9')) {
  ------------------
  |  | 2193|  18.8k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (8406:16): [True: 18.8k, False: 3.90k]
  |  Branch (8406:32): [True: 17.3k, False: 1.58k]
  ------------------
 8407|  17.3k|            if (exponent < 1000000)
  ------------------
  |  Branch (8407:17): [True: 16.1k, False: 1.12k]
  ------------------
 8408|  16.1k|                exponent = exponent * 10 + (CUR - '0');
  ------------------
  |  | 2193|  16.1k|#define CUR (*ctxt->cur)
  ------------------
 8409|  17.3k|            NEXT;
  ------------------
  |  | 2202|  17.3k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  ------------------
  |  |  |  Branch (2202:15): [True: 17.3k, False: 0]
  |  |  ------------------
  ------------------
 8410|  17.3k|        }
 8411|  5.49k|        if (is_exponent_negative)
  ------------------
  |  Branch (8411:13): [True: 654, False: 4.83k]
  ------------------
 8412|    654|            exponent = -exponent;
 8413|  5.49k|        ret *= pow(10.0, (double) exponent);
 8414|  5.49k|    }
 8415|  41.0k|    num = xmlXPathCacheNewFloat(ctxt, ret);
 8416|  41.0k|    if (num == NULL) {
  ------------------
  |  Branch (8416:9): [True: 29, False: 41.0k]
  ------------------
 8417|     29|	ctxt->error = XPATH_MEMORY_ERROR;
 8418|  41.0k|    } else if (PUSH_LONG_EXPR(XPATH_OP_VALUE, XPATH_NUMBER, 0, 0, num,
  ------------------
  |  | 1085|  41.0k|    xmlXPathCompExprAdd(ctxt, ctxt->comp->last, -1,		\
  |  | 1086|  41.0k|	                (op), (val), (val2), (val3), (val4), (val5))
  ------------------
  |  Branch (8418:16): [True: 10, False: 41.0k]
  ------------------
 8419|  41.0k|                              NULL) == -1) {
 8420|     10|        xmlXPathReleaseObject(ctxt->context, num);
 8421|     10|    }
 8422|  41.0k|}
xpath.c:xmlXPathCompLiteral:
 8478|  1.24k|xmlXPathCompLiteral(xmlXPathParserContextPtr ctxt) {
 8479|  1.24k|    xmlChar *ret = NULL;
 8480|  1.24k|    xmlXPathObjectPtr lit;
 8481|       |
 8482|  1.24k|    ret = xmlXPathParseLiteral(ctxt);
 8483|  1.24k|    if (ret == NULL)
  ------------------
  |  Branch (8483:9): [True: 143, False: 1.10k]
  ------------------
 8484|    143|        return;
 8485|  1.10k|    lit = xmlXPathCacheNewString(ctxt, ret);
 8486|  1.10k|    if (lit == NULL) {
  ------------------
  |  Branch (8486:9): [True: 6, False: 1.09k]
  ------------------
 8487|      6|        ctxt->error = XPATH_MEMORY_ERROR;
 8488|  1.09k|    } else if (PUSH_LONG_EXPR(XPATH_OP_VALUE, XPATH_STRING, 0, 0, lit,
  ------------------
  |  | 1085|  1.09k|    xmlXPathCompExprAdd(ctxt, ctxt->comp->last, -1,		\
  |  | 1086|  1.09k|	                (op), (val), (val2), (val3), (val4), (val5))
  ------------------
  |  Branch (8488:16): [True: 4, False: 1.09k]
  ------------------
 8489|  1.09k|                              NULL) == -1) {
 8490|      4|        xmlXPathReleaseObject(ctxt->context, lit);
 8491|      4|    }
 8492|  1.10k|    xmlFree(ret);
 8493|  1.10k|}
xpath.c:xmlXPathParseLiteral:
 8434|  1.34k|xmlXPathParseLiteral(xmlXPathParserContextPtr ctxt) {
 8435|  1.34k|    const xmlChar *q;
 8436|  1.34k|    xmlChar *ret = NULL;
 8437|  1.34k|    int quote;
 8438|       |
 8439|  1.34k|    if (CUR == '"') {
  ------------------
  |  | 2193|  1.34k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (8439:9): [True: 115, False: 1.23k]
  ------------------
 8440|    115|        quote = '"';
 8441|  1.23k|    } else if (CUR == '\'') {
  ------------------
  |  | 2193|  1.23k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (8441:16): [True: 1.22k, False: 6]
  ------------------
 8442|  1.22k|        quote = '\'';
 8443|  1.22k|    } else {
 8444|      6|	XP_ERRORNULL(XPATH_START_LITERAL_ERROR);
  ------------------
  |  |  633|      6|    { xmlXPathErr(ctxt, X); return(NULL); }
  ------------------
 8445|      0|    }
 8446|       |
 8447|  1.34k|    NEXT;
  ------------------
  |  | 2202|  1.34k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  ------------------
  |  |  |  Branch (2202:15): [True: 1.34k, False: 0]
  |  |  ------------------
  ------------------
 8448|  1.34k|    q = CUR_PTR;
  ------------------
  |  | 2196|  1.34k|#define CUR_PTR ctxt->cur
  ------------------
 8449|  82.0k|    while (CUR != quote) {
  ------------------
  |  | 2193|  82.0k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (8449:12): [True: 80.8k, False: 1.19k]
  ------------------
 8450|  80.8k|        int ch;
 8451|  80.8k|        int len = 4;
 8452|       |
 8453|  80.8k|        if (CUR == 0)
  ------------------
  |  | 2193|  80.8k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (8453:13): [True: 115, False: 80.7k]
  ------------------
 8454|  80.7k|            XP_ERRORNULL(XPATH_UNFINISHED_LITERAL_ERROR);
  ------------------
  |  |  633|    115|    { xmlXPathErr(ctxt, X); return(NULL); }
  ------------------
 8455|  80.7k|        ch = xmlGetUTF8Char(CUR_PTR, &len);
  ------------------
  |  | 2196|  80.7k|#define CUR_PTR ctxt->cur
  ------------------
 8456|  80.7k|        if ((ch < 0) || (IS_CHAR(ch) == 0))
  ------------------
  |  |  115|  80.7k|#define IS_CHAR(c)   xmlIsCharQ(c)
  |  |  ------------------
  |  |  |  |  117|  80.7k|#define xmlIsCharQ(c)		(((c) < 0x100) ? \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (117:25): [True: 80.1k, False: 568]
  |  |  |  |  ------------------
  |  |  |  |  118|  80.7k|				 xmlIsChar_ch((c)) :\
  |  |  |  |  ------------------
  |  |  |  |  |  |  108|  80.1k|#define xmlIsChar_ch(c)		(((0x9 <= (c)) && ((c) <= 0xa)) || \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (108:28): [True: 80.1k, False: 25]
  |  |  |  |  |  |  |  Branch (108:44): [True: 252, False: 79.9k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  109|  80.1k|				 ((c) == 0xd) || \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (109:6): [True: 93, False: 79.8k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  110|  80.1k|				  (0x20 <= (c)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (110:7): [True: 79.8k, False: 26]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  119|  80.7k|				(((0x100 <= (c)) && ((c) <= 0xd7ff)) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (119:7): [True: 568, False: 0]
  |  |  |  |  |  Branch (119:25): [True: 305, False: 263]
  |  |  |  |  ------------------
  |  |  |  |  120|    568|				 ((0xe000 <= (c)) && ((c) <= 0xfffd)) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (120:7): [True: 263, False: 0]
  |  |  |  |  |  Branch (120:26): [True: 28, False: 235]
  |  |  |  |  ------------------
  |  |  |  |  121|    568|				 ((0x10000 <= (c)) && ((c) <= 0x10ffff))))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (121:7): [True: 235, False: 0]
  |  |  |  |  |  Branch (121:27): [True: 235, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (8456:13): [True: 6, False: 80.7k]
  |  Branch (8456:25): [True: 26, False: 80.7k]
  ------------------
 8457|  80.7k|            XP_ERRORNULL(XPATH_INVALID_CHAR_ERROR);
  ------------------
  |  |  633|     32|    { xmlXPathErr(ctxt, X); return(NULL); }
  ------------------
 8458|  80.7k|        CUR_PTR += len;
  ------------------
  |  | 2196|  80.7k|#define CUR_PTR ctxt->cur
  ------------------
 8459|  80.7k|    }
 8460|  1.19k|    ret = xmlStrndup(q, CUR_PTR - q);
  ------------------
  |  | 2196|  1.19k|#define CUR_PTR ctxt->cur
  ------------------
 8461|  1.19k|    if (ret == NULL)
  ------------------
  |  Branch (8461:9): [True: 2, False: 1.19k]
  ------------------
 8462|      2|        xmlXPathPErrMemory(ctxt);
 8463|  1.19k|    NEXT;
  ------------------
  |  | 2202|  1.19k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  ------------------
  |  |  |  Branch (2202:15): [True: 1.19k, False: 0]
  |  |  ------------------
  ------------------
 8464|  1.19k|    return(ret);
 8465|  1.34k|}
xpath.c:xmlXPathCompFunctionCall:
 8573|  12.5k|xmlXPathCompFunctionCall(xmlXPathParserContextPtr ctxt) {
 8574|  12.5k|    xmlChar *name;
 8575|  12.5k|    xmlChar *prefix;
 8576|  12.5k|    int nbargs = 0;
 8577|  12.5k|    int sort = 1;
 8578|       |
 8579|  12.5k|    name = xmlXPathParseQName(ctxt, &prefix);
 8580|  12.5k|    if (name == NULL) {
  ------------------
  |  Branch (8580:9): [True: 21, False: 12.5k]
  ------------------
 8581|     21|	xmlFree(prefix);
 8582|     21|	XP_ERROR(XPATH_EXPR_ERROR);
  ------------------
  |  |  244|     21|    { xmlXPathErr(ctxt, X); return; }
  ------------------
 8583|      0|    }
 8584|  12.5k|    SKIP_BLANKS;
  ------------------
  |  | 2199|   423k|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  | 2202|   435k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2202:15): [True: 423k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 8585|       |
 8586|  12.5k|    if (CUR != '(') {
  ------------------
  |  | 2193|  12.5k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (8586:9): [True: 6, False: 12.5k]
  ------------------
 8587|      6|	xmlFree(name);
 8588|      6|	xmlFree(prefix);
 8589|      6|	XP_ERROR(XPATH_EXPR_ERROR);
  ------------------
  |  |  244|      6|    { xmlXPathErr(ctxt, X); return; }
  ------------------
 8590|      0|    }
 8591|  12.5k|    NEXT;
  ------------------
  |  | 2202|  12.5k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  ------------------
  |  |  |  Branch (2202:15): [True: 12.5k, False: 0]
  |  |  ------------------
  ------------------
 8592|  12.5k|    SKIP_BLANKS;
  ------------------
  |  | 2199|   134k|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  | 2202|   146k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2202:15): [True: 134k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 8593|       |
 8594|       |    /*
 8595|       |    * Optimization for count(): we don't need the node-set to be sorted.
 8596|       |    */
 8597|  12.5k|    if ((prefix == NULL) && (name[0] == 'c') &&
  ------------------
  |  Branch (8597:9): [True: 11.6k, False: 840]
  |  Branch (8597:29): [True: 943, False: 10.7k]
  ------------------
 8598|    943|	xmlStrEqual(name, BAD_CAST "count"))
  ------------------
  |  |   34|    943|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (8598:2): [True: 66, False: 877]
  ------------------
 8599|     66|    {
 8600|     66|	sort = 0;
 8601|     66|    }
 8602|  12.5k|    ctxt->comp->last = -1;
 8603|  12.5k|    if (CUR != ')') {
  ------------------
  |  | 2193|  12.5k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (8603:9): [True: 10.0k, False: 2.50k]
  ------------------
 8604|  13.9k|	while (CUR != 0) {
  ------------------
  |  | 2193|  13.9k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (8604:9): [True: 13.9k, False: 3]
  ------------------
 8605|  13.9k|	    int op1 = ctxt->comp->last;
 8606|  13.9k|	    ctxt->comp->last = -1;
 8607|  13.9k|	    xmlXPathCompileExpr(ctxt, sort);
 8608|  13.9k|	    if (ctxt->error != XPATH_EXPRESSION_OK) {
  ------------------
  |  Branch (8608:10): [True: 839, False: 13.0k]
  ------------------
 8609|    839|		xmlFree(name);
 8610|    839|		xmlFree(prefix);
 8611|    839|		return;
 8612|    839|	    }
 8613|  13.0k|	    PUSH_BINARY_EXPR(XPATH_OP_ARG, op1, ctxt->comp->last, 0, 0);
  ------------------
  |  | 1094|  13.0k|#define PUSH_BINARY_EXPR(op, ch1, ch2, val, val2)			\
  |  | 1095|  13.0k|xmlXPathCompExprAdd(ctxt, (ch1), (ch2), (op),			\
  |  | 1096|  13.0k|			(val), (val2), 0 ,NULL ,NULL)
  ------------------
 8614|  13.0k|	    nbargs++;
 8615|  13.0k|	    if (CUR == ')') break;
  ------------------
  |  | 2193|  13.0k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (8615:10): [True: 9.06k, False: 4.00k]
  ------------------
 8616|  4.00k|	    if (CUR != ',') {
  ------------------
  |  | 2193|  4.00k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (8616:10): [True: 107, False: 3.90k]
  ------------------
 8617|    107|		xmlFree(name);
 8618|    107|		xmlFree(prefix);
 8619|    107|		XP_ERROR(XPATH_EXPR_ERROR);
  ------------------
  |  |  244|    107|    { xmlXPathErr(ctxt, X); return; }
  ------------------
 8620|      0|	    }
 8621|  3.90k|	    NEXT;
  ------------------
  |  | 2202|  3.90k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  ------------------
  |  |  |  Branch (2202:15): [True: 3.90k, False: 0]
  |  |  ------------------
  ------------------
 8622|  3.90k|	    SKIP_BLANKS;
  ------------------
  |  | 2199|  3.90k|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  | 2202|  7.41k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2202:15): [True: 3.51k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 8623|  3.90k|	}
 8624|  10.0k|    }
 8625|  11.5k|    if (PUSH_LONG_EXPR(XPATH_OP_FUNCTION, nbargs, 0, 0, name, prefix) == -1) {
  ------------------
  |  | 1085|  11.5k|    xmlXPathCompExprAdd(ctxt, ctxt->comp->last, -1,		\
  |  | 1086|  11.5k|	                (op), (val), (val2), (val3), (val4), (val5))
  ------------------
  |  Branch (8625:9): [True: 3, False: 11.5k]
  ------------------
 8626|      3|        xmlFree(prefix);
 8627|      3|        xmlFree(name);
 8628|      3|    }
 8629|  11.5k|    NEXT;
  ------------------
  |  | 2202|  11.5k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  ------------------
  |  |  |  Branch (2202:15): [True: 11.5k, False: 3]
  |  |  ------------------
  ------------------
 8630|  11.5k|    SKIP_BLANKS;
  ------------------
  |  | 2199|   136k|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  | 2202|   148k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2202:15): [True: 136k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 8631|  11.5k|}
xpath.c:xmlXPathCompPredicate:
 9137|  19.1k|xmlXPathCompPredicate(xmlXPathParserContextPtr ctxt, int filter) {
 9138|  19.1k|    int op1 = ctxt->comp->last;
 9139|       |
 9140|  19.1k|    SKIP_BLANKS;
  ------------------
  |  | 2199|  19.1k|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  | 2202|      0|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2202:15): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 9141|  19.1k|    if (CUR != '[') {
  ------------------
  |  | 2193|  19.1k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (9141:9): [True: 0, False: 19.1k]
  ------------------
 9142|      0|	XP_ERROR(XPATH_INVALID_PREDICATE_ERROR);
  ------------------
  |  |  244|      0|    { xmlXPathErr(ctxt, X); return; }
  ------------------
 9143|      0|    }
 9144|  19.1k|    NEXT;
  ------------------
  |  | 2202|  19.1k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  ------------------
  |  |  |  Branch (2202:15): [True: 19.1k, False: 0]
  |  |  ------------------
  ------------------
 9145|  19.1k|    SKIP_BLANKS;
  ------------------
  |  | 2199|  19.1k|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  | 2202|  35.2k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2202:15): [True: 16.1k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 9146|       |
 9147|  19.1k|    ctxt->comp->last = -1;
 9148|       |    /*
 9149|       |    * This call to xmlXPathCompileExpr() will deactivate sorting
 9150|       |    * of the predicate result.
 9151|       |    * TODO: Sorting is still activated for filters, since I'm not
 9152|       |    *  sure if needed. Normally sorting should not be needed, since
 9153|       |    *  a filter can only diminish the number of items in a sequence,
 9154|       |    *  but won't change its order; so if the initial sequence is sorted,
 9155|       |    *  subsequent sorting is not needed.
 9156|       |    */
 9157|  19.1k|    if (! filter)
  ------------------
  |  Branch (9157:9): [True: 8.16k, False: 10.9k]
  ------------------
 9158|  8.16k|	xmlXPathCompileExpr(ctxt, 0);
 9159|  10.9k|    else
 9160|  10.9k|	xmlXPathCompileExpr(ctxt, 1);
 9161|  19.1k|    CHECK_ERROR;
  ------------------
  |  |  230|  19.1k|    if (ctxt->error != XPATH_EXPRESSION_OK) return
  |  |  ------------------
  |  |  |  Branch (230:9): [True: 2.47k, False: 16.6k]
  |  |  ------------------
  ------------------
 9162|       |
 9163|  16.6k|    if (CUR != ']') {
  ------------------
  |  | 2193|  16.6k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (9163:9): [True: 253, False: 16.4k]
  ------------------
 9164|    253|	XP_ERROR(XPATH_INVALID_PREDICATE_ERROR);
  ------------------
  |  |  244|    253|    { xmlXPathErr(ctxt, X); return; }
  ------------------
 9165|      0|    }
 9166|       |
 9167|  16.4k|    if (filter)
  ------------------
  |  Branch (9167:9): [True: 10.2k, False: 6.13k]
  ------------------
 9168|  10.2k|	PUSH_BINARY_EXPR(XPATH_OP_FILTER, op1, ctxt->comp->last, 0, 0);
  ------------------
  |  | 1094|  10.2k|#define PUSH_BINARY_EXPR(op, ch1, ch2, val, val2)			\
  |  | 1095|  10.2k|xmlXPathCompExprAdd(ctxt, (ch1), (ch2), (op),			\
  |  | 1096|  10.2k|			(val), (val2), 0 ,NULL ,NULL)
  ------------------
 9169|  6.13k|    else
 9170|  6.13k|	PUSH_BINARY_EXPR(XPATH_OP_PREDICATE, op1, ctxt->comp->last, 0, 0);
  ------------------
  |  | 1094|  6.13k|#define PUSH_BINARY_EXPR(op, ch1, ch2, val, val2)			\
  |  | 1095|  6.13k|xmlXPathCompExprAdd(ctxt, (ch1), (ch2), (op),			\
  |  | 1096|  6.13k|			(val), (val2), 0 ,NULL ,NULL)
  ------------------
 9171|       |
 9172|  16.4k|    NEXT;
  ------------------
  |  | 2202|  16.4k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  ------------------
  |  |  |  Branch (2202:15): [True: 16.4k, False: 0]
  |  |  ------------------
  ------------------
 9173|  16.4k|    SKIP_BLANKS;
  ------------------
  |  | 2199|  48.9k|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  | 2202|  65.3k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2202:15): [True: 48.9k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 9174|  16.4k|}
xpath.c:xmlXPathCompRelativeLocationPath:
 9481|  1.03M|(xmlXPathParserContextPtr ctxt) {
 9482|  1.03M|    SKIP_BLANKS;
  ------------------
  |  | 2199|  1.03M|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  | 2202|      0|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2202:15): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 9483|  1.03M|    if ((CUR == '/') && (NXT(1) == '/')) {
  ------------------
  |  | 2193|  1.03M|#define CUR (*ctxt->cur)
  ------------------
                  if ((CUR == '/') && (NXT(1) == '/')) {
  ------------------
  |  | 2195|  7.00k|#define NXT(val) ctxt->cur[(val)]
  ------------------
  |  Branch (9483:9): [True: 7.00k, False: 1.02M]
  |  Branch (9483:25): [True: 2.89k, False: 4.11k]
  ------------------
 9484|  2.89k|	SKIP(2);
  ------------------
  |  | 2194|  2.89k|#define SKIP(val) ctxt->cur += (val)
  ------------------
 9485|  2.89k|	SKIP_BLANKS;
  ------------------
  |  | 2199|  9.30k|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  | 2202|  9.30k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2202:15): [True: 9.30k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 9486|  2.89k|	PUSH_LONG_EXPR(XPATH_OP_COLLECT, AXIS_DESCENDANT_OR_SELF,
  ------------------
  |  | 1085|  2.89k|    xmlXPathCompExprAdd(ctxt, ctxt->comp->last, -1,		\
  |  | 1086|  2.89k|	                (op), (val), (val2), (val3), (val4), (val5))
  ------------------
 9487|  2.89k|		         NODE_TEST_TYPE, NODE_TYPE_NODE, NULL, NULL);
 9488|  1.02M|    } else if (CUR == '/') {
  ------------------
  |  | 2193|  1.02M|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (9488:16): [True: 4.11k, False: 1.02M]
  ------------------
 9489|  4.11k|	    NEXT;
  ------------------
  |  | 2202|  4.11k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  ------------------
  |  |  |  Branch (2202:15): [True: 4.11k, False: 0]
  |  |  ------------------
  ------------------
 9490|  4.11k|	SKIP_BLANKS;
  ------------------
  |  | 2199|  19.3k|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  | 2202|  19.3k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2202:15): [True: 19.3k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 9491|  4.11k|    }
 9492|  1.03M|    xmlXPathCompStep(ctxt);
 9493|  1.03M|    CHECK_ERROR;
  ------------------
  |  |  230|  1.03M|    if (ctxt->error != XPATH_EXPRESSION_OK) return
  |  |  ------------------
  |  |  |  Branch (230:9): [True: 1.30k, False: 1.02M]
  |  |  ------------------
  ------------------
 9494|  1.02M|    SKIP_BLANKS;
  ------------------
  |  | 2199|  1.02M|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  | 2202|  1.03M|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2202:15): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 9495|  1.04M|    while (CUR == '/') {
  ------------------
  |  | 2193|  1.04M|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (9495:12): [True: 19.1k, False: 1.02M]
  ------------------
 9496|  19.1k|	if ((CUR == '/') && (NXT(1) == '/')) {
  ------------------
  |  | 2193|  19.1k|#define CUR (*ctxt->cur)
  ------------------
              	if ((CUR == '/') && (NXT(1) == '/')) {
  ------------------
  |  | 2195|  19.1k|#define NXT(val) ctxt->cur[(val)]
  ------------------
  |  Branch (9496:6): [True: 19.1k, False: 0]
  |  Branch (9496:22): [True: 4.12k, False: 15.0k]
  ------------------
 9497|  4.12k|	    SKIP(2);
  ------------------
  |  | 2194|  4.12k|#define SKIP(val) ctxt->cur += (val)
  ------------------
 9498|  4.12k|	    SKIP_BLANKS;
  ------------------
  |  | 2199|  6.19k|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  | 2202|  6.19k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2202:15): [True: 6.19k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 9499|  4.12k|	    PUSH_LONG_EXPR(XPATH_OP_COLLECT, AXIS_DESCENDANT_OR_SELF,
  ------------------
  |  | 1085|  4.12k|    xmlXPathCompExprAdd(ctxt, ctxt->comp->last, -1,		\
  |  | 1086|  4.12k|	                (op), (val), (val2), (val3), (val4), (val5))
  ------------------
 9500|  4.12k|			     NODE_TEST_TYPE, NODE_TYPE_NODE, NULL, NULL);
 9501|  4.12k|	    xmlXPathCompStep(ctxt);
 9502|  15.0k|	} else if (CUR == '/') {
  ------------------
  |  | 2193|  15.0k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (9502:13): [True: 15.0k, False: 0]
  ------------------
 9503|  15.0k|	    NEXT;
  ------------------
  |  | 2202|  15.0k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  ------------------
  |  |  |  Branch (2202:15): [True: 15.0k, False: 0]
  |  |  ------------------
  ------------------
 9504|  15.0k|	    SKIP_BLANKS;
  ------------------
  |  | 2199|  15.0k|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  | 2202|  6.59k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2202:15): [True: 6.59k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 9505|  15.0k|	    xmlXPathCompStep(ctxt);
 9506|  15.0k|	}
 9507|  19.1k|	SKIP_BLANKS;
  ------------------
  |  | 2199|  19.1k|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  | 2202|    614|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2202:15): [True: 614, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 9508|  19.1k|    }
 9509|  1.02M|}
xpath.c:xmlXPathCompStep:
 9390|  1.04M|xmlXPathCompStep(xmlXPathParserContextPtr ctxt) {
 9391|  1.04M|    SKIP_BLANKS;
  ------------------
  |  | 2199|  1.04M|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  | 2202|      0|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2202:15): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 9392|  1.04M|    if ((CUR == '.') && (NXT(1) == '.')) {
  ------------------
  |  | 2193|  1.04M|#define CUR (*ctxt->cur)
  ------------------
                  if ((CUR == '.') && (NXT(1) == '.')) {
  ------------------
  |  | 2195|  17.0k|#define NXT(val) ctxt->cur[(val)]
  ------------------
  |  Branch (9392:9): [True: 17.0k, False: 1.03M]
  |  Branch (9392:25): [True: 4.52k, False: 12.5k]
  ------------------
 9393|  4.52k|	SKIP(2);
  ------------------
  |  | 2194|  4.52k|#define SKIP(val) ctxt->cur += (val)
  ------------------
 9394|  4.52k|	SKIP_BLANKS;
  ------------------
  |  | 2199|  4.52k|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  | 2202|  2.67k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2202:15): [True: 2.67k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 9395|  4.52k|	PUSH_LONG_EXPR(XPATH_OP_COLLECT, AXIS_PARENT,
  ------------------
  |  | 1085|  4.52k|    xmlXPathCompExprAdd(ctxt, ctxt->comp->last, -1,		\
  |  | 1086|  4.52k|	                (op), (val), (val2), (val3), (val4), (val5))
  ------------------
 9396|  4.52k|		    NODE_TEST_TYPE, NODE_TYPE_NODE, NULL, NULL);
 9397|  1.04M|    } else if (CUR == '.') {
  ------------------
  |  | 2193|  1.04M|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (9397:16): [True: 12.5k, False: 1.03M]
  ------------------
 9398|  12.5k|	NEXT;
  ------------------
  |  | 2202|  12.5k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  ------------------
  |  |  |  Branch (2202:15): [True: 12.5k, False: 0]
  |  |  ------------------
  ------------------
 9399|  12.5k|	SKIP_BLANKS;
  ------------------
  |  | 2199|  27.1k|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  | 2202|  27.1k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2202:15): [True: 27.1k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 9400|  1.03M|    } else {
 9401|  1.03M|	xmlChar *name = NULL;
 9402|  1.03M|	xmlChar *prefix = NULL;
 9403|  1.03M|	xmlXPathTestVal test = (xmlXPathTestVal) 0;
 9404|  1.03M|	xmlXPathAxisVal axis = (xmlXPathAxisVal) 0;
 9405|  1.03M|	xmlXPathTypeVal type = (xmlXPathTypeVal) 0;
 9406|  1.03M|	int op1;
 9407|       |
 9408|  1.03M|	if (CUR == '*') {
  ------------------
  |  | 2193|  1.03M|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (9408:6): [True: 952k, False: 80.8k]
  ------------------
 9409|   952k|	    axis = AXIS_CHILD;
 9410|   952k|	} else {
 9411|  80.8k|	    if (name == NULL)
  ------------------
  |  Branch (9411:10): [True: 80.8k, False: 0]
  ------------------
 9412|  80.8k|		name = xmlXPathParseNCName(ctxt);
 9413|  80.8k|	    if (name != NULL) {
  ------------------
  |  Branch (9413:10): [True: 77.6k, False: 3.20k]
  ------------------
 9414|  77.6k|		axis = xmlXPathIsAxisName(name);
 9415|  77.6k|		if (axis != 0) {
  ------------------
  |  Branch (9415:7): [True: 4.59k, False: 73.0k]
  ------------------
 9416|  4.59k|		    SKIP_BLANKS;
  ------------------
  |  | 2199|  65.3k|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  | 2202|  65.3k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2202:15): [True: 65.3k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 9417|  4.59k|		    if ((CUR == ':') && (NXT(1) == ':')) {
  ------------------
  |  | 2193|  4.59k|#define CUR (*ctxt->cur)
  ------------------
              		    if ((CUR == ':') && (NXT(1) == ':')) {
  ------------------
  |  | 2195|  2.82k|#define NXT(val) ctxt->cur[(val)]
  ------------------
  |  Branch (9417:11): [True: 2.82k, False: 1.76k]
  |  Branch (9417:27): [True: 2.63k, False: 192]
  ------------------
 9418|  2.63k|			SKIP(2);
  ------------------
  |  | 2194|  2.63k|#define SKIP(val) ctxt->cur += (val)
  ------------------
 9419|  2.63k|			xmlFree(name);
 9420|  2.63k|			name = NULL;
 9421|  2.63k|		    } else {
 9422|       |			/* an element name can conflict with an axis one :-\ */
 9423|  1.96k|			axis = AXIS_CHILD;
 9424|  1.96k|		    }
 9425|  73.0k|		} else {
 9426|  73.0k|		    axis = AXIS_CHILD;
 9427|  73.0k|		}
 9428|  77.6k|	    } else if (CUR == '@') {
  ------------------
  |  | 2193|  3.20k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (9428:17): [True: 2.52k, False: 675]
  ------------------
 9429|  2.52k|		NEXT;
  ------------------
  |  | 2202|  2.52k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  ------------------
  |  |  |  Branch (2202:15): [True: 2.52k, False: 0]
  |  |  ------------------
  ------------------
 9430|  2.52k|		axis = AXIS_ATTRIBUTE;
 9431|  2.52k|	    } else {
 9432|    675|		axis = AXIS_CHILD;
 9433|    675|	    }
 9434|  80.8k|	}
 9435|       |
 9436|  1.03M|        if (ctxt->error != XPATH_EXPRESSION_OK) {
  ------------------
  |  Branch (9436:13): [True: 919, False: 1.03M]
  ------------------
 9437|    919|            xmlFree(name);
 9438|    919|            return;
 9439|    919|        }
 9440|       |
 9441|  1.03M|	name = xmlXPathCompNodeTest(ctxt, &test, &type, &prefix, name);
 9442|  1.03M|	if (test == 0)
  ------------------
  |  Branch (9442:6): [True: 385, False: 1.03M]
  ------------------
 9443|    385|	    return;
 9444|       |
 9445|  1.03M|        if ((prefix != NULL) && (ctxt->context != NULL) &&
  ------------------
  |  Branch (9445:13): [True: 2.30k, False: 1.02M]
  |  Branch (9445:33): [True: 2.30k, False: 0]
  ------------------
 9446|  2.30k|	    (ctxt->context->flags & XML_XPATH_CHECKNS)) {
  ------------------
  |  |  237|  2.30k|#define XML_XPATH_CHECKNS (1<<0)
  ------------------
  |  Branch (9446:6): [True: 0, False: 2.30k]
  ------------------
 9447|      0|	    if (xmlXPathNsLookup(ctxt->context, prefix) == NULL) {
  ------------------
  |  Branch (9447:10): [True: 0, False: 0]
  ------------------
 9448|      0|		xmlXPathErrFmt(ctxt, XPATH_UNDEF_PREFIX_ERROR,
 9449|      0|                               "Undefined namespace prefix: %s\n", prefix);
 9450|      0|	    }
 9451|      0|	}
 9452|       |
 9453|  1.03M|	op1 = ctxt->comp->last;
 9454|  1.03M|	ctxt->comp->last = -1;
 9455|       |
 9456|  1.03M|	SKIP_BLANKS;
  ------------------
  |  | 2199|  1.03M|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  | 2202|  1.04M|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2202:15): [True: 12.1k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 9457|  1.03M|	while (CUR == '[') {
  ------------------
  |  | 2193|  1.03M|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (9457:9): [True: 8.16k, False: 1.03M]
  ------------------
 9458|  8.16k|	    xmlXPathCompPredicate(ctxt, 0);
 9459|  8.16k|	}
 9460|       |
 9461|  1.03M|        if (PUSH_FULL_EXPR(XPATH_OP_COLLECT, op1, ctxt->comp->last, axis,
  ------------------
  |  | 1082|  1.03M|    xmlXPathCompExprAdd(ctxt, (op1), (op2),			\
  |  | 1083|  1.03M|	                (op), (val), (val2), (val3), (val4), (val5))
  ------------------
  |  Branch (9461:13): [True: 25, False: 1.03M]
  ------------------
 9462|  1.03M|                           test, type, (void *)prefix, (void *)name) == -1) {
 9463|     25|            xmlFree(prefix);
 9464|     25|            xmlFree(name);
 9465|     25|        }
 9466|  1.03M|    }
 9467|  1.04M|}
xpath.c:xmlXPathIsAxisName:
 9321|  77.6k|xmlXPathIsAxisName(const xmlChar *name) {
 9322|  77.6k|    xmlXPathAxisVal ret = (xmlXPathAxisVal) 0;
 9323|  77.6k|    switch (name[0]) {
  ------------------
  |  Branch (9323:13): [True: 29.4k, False: 48.1k]
  ------------------
 9324|  16.3k|	case 'a':
  ------------------
  |  Branch (9324:2): [True: 16.3k, False: 61.2k]
  ------------------
 9325|  16.3k|	    if (xmlStrEqual(name, BAD_CAST "ancestor"))
  ------------------
  |  |   34|  16.3k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (9325:10): [True: 2.18k, False: 14.2k]
  ------------------
 9326|  2.18k|		ret = AXIS_ANCESTOR;
 9327|  16.3k|	    if (xmlStrEqual(name, BAD_CAST "ancestor-or-self"))
  ------------------
  |  |   34|  16.3k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (9327:10): [True: 138, False: 16.2k]
  ------------------
 9328|    138|		ret = AXIS_ANCESTOR_OR_SELF;
 9329|  16.3k|	    if (xmlStrEqual(name, BAD_CAST "attribute"))
  ------------------
  |  |   34|  16.3k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (9329:10): [True: 68, False: 16.3k]
  ------------------
 9330|     68|		ret = AXIS_ATTRIBUTE;
 9331|  16.3k|	    break;
 9332|  1.89k|	case 'c':
  ------------------
  |  Branch (9332:2): [True: 1.89k, False: 75.7k]
  ------------------
 9333|  1.89k|	    if (xmlStrEqual(name, BAD_CAST "child"))
  ------------------
  |  |   34|  1.89k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (9333:10): [True: 68, False: 1.82k]
  ------------------
 9334|     68|		ret = AXIS_CHILD;
 9335|  1.89k|	    break;
 9336|  1.23k|	case 'd':
  ------------------
  |  Branch (9336:2): [True: 1.23k, False: 76.3k]
  ------------------
 9337|  1.23k|	    if (xmlStrEqual(name, BAD_CAST "descendant"))
  ------------------
  |  |   34|  1.23k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (9337:10): [True: 73, False: 1.15k]
  ------------------
 9338|     73|		ret = AXIS_DESCENDANT;
 9339|  1.23k|	    if (xmlStrEqual(name, BAD_CAST "descendant-or-self"))
  ------------------
  |  |   34|  1.23k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (9339:10): [True: 10, False: 1.22k]
  ------------------
 9340|     10|		ret = AXIS_DESCENDANT_OR_SELF;
 9341|  1.23k|	    break;
 9342|  1.90k|	case 'f':
  ------------------
  |  Branch (9342:2): [True: 1.90k, False: 75.7k]
  ------------------
 9343|  1.90k|	    if (xmlStrEqual(name, BAD_CAST "following"))
  ------------------
  |  |   34|  1.90k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (9343:10): [True: 306, False: 1.60k]
  ------------------
 9344|    306|		ret = AXIS_FOLLOWING;
 9345|  1.90k|	    if (xmlStrEqual(name, BAD_CAST "following-sibling"))
  ------------------
  |  |   34|  1.90k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (9345:10): [True: 66, False: 1.84k]
  ------------------
 9346|     66|		ret = AXIS_FOLLOWING_SIBLING;
 9347|  1.90k|	    break;
 9348|  3.75k|	case 'n':
  ------------------
  |  Branch (9348:2): [True: 3.75k, False: 73.8k]
  ------------------
 9349|  3.75k|	    if (xmlStrEqual(name, BAD_CAST "namespace"))
  ------------------
  |  |   34|  3.75k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (9349:10): [True: 377, False: 3.38k]
  ------------------
 9350|    377|		ret = AXIS_NAMESPACE;
 9351|  3.75k|	    break;
 9352|  1.18k|	case 'p':
  ------------------
  |  Branch (9352:2): [True: 1.18k, False: 76.4k]
  ------------------
 9353|  1.18k|	    if (xmlStrEqual(name, BAD_CAST "parent"))
  ------------------
  |  |   34|  1.18k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (9353:10): [True: 164, False: 1.01k]
  ------------------
 9354|    164|		ret = AXIS_PARENT;
 9355|  1.18k|	    if (xmlStrEqual(name, BAD_CAST "preceding"))
  ------------------
  |  |   34|  1.18k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (9355:10): [True: 71, False: 1.11k]
  ------------------
 9356|     71|		ret = AXIS_PRECEDING;
 9357|  1.18k|	    if (xmlStrEqual(name, BAD_CAST "preceding-sibling"))
  ------------------
  |  |   34|  1.18k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (9357:10): [True: 18, False: 1.16k]
  ------------------
 9358|     18|		ret = AXIS_PRECEDING_SIBLING;
 9359|  1.18k|	    break;
 9360|  3.08k|	case 's':
  ------------------
  |  Branch (9360:2): [True: 3.08k, False: 74.5k]
  ------------------
 9361|  3.08k|	    if (xmlStrEqual(name, BAD_CAST "self"))
  ------------------
  |  |   34|  3.08k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (9361:10): [True: 1.05k, False: 2.03k]
  ------------------
 9362|  1.05k|		ret = AXIS_SELF;
 9363|  3.08k|	    break;
 9364|  77.6k|    }
 9365|  77.6k|    return(ret);
 9366|  77.6k|}
xpath.c:xmlXPathCompNodeTest:
 9201|  1.03M|		     xmlChar *name) {
 9202|  1.03M|    int blanks;
 9203|       |
 9204|  1.03M|    if ((test == NULL) || (type == NULL) || (prefix == NULL)) {
  ------------------
  |  Branch (9204:9): [True: 0, False: 1.03M]
  |  Branch (9204:27): [True: 0, False: 1.03M]
  |  Branch (9204:45): [True: 0, False: 1.03M]
  ------------------
 9205|      0|	return(NULL);
 9206|      0|    }
 9207|  1.03M|    *type = (xmlXPathTypeVal) 0;
 9208|  1.03M|    *test = (xmlXPathTestVal) 0;
 9209|  1.03M|    *prefix = NULL;
 9210|  1.03M|    SKIP_BLANKS;
  ------------------
  |  | 2199|  1.03M|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  | 2202|  1.44M|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2202:15): [True: 416k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 9211|       |
 9212|  1.03M|    if ((name == NULL) && (CUR == '*')) {
  ------------------
  |  | 2193|   957k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (9212:9): [True: 957k, False: 74.4k]
  |  Branch (9212:27): [True: 952k, False: 4.86k]
  ------------------
 9213|       |	/*
 9214|       |	 * All elements
 9215|       |	 */
 9216|   952k|	NEXT;
  ------------------
  |  | 2202|   952k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  ------------------
  |  |  |  Branch (2202:15): [True: 952k, False: 0]
  |  |  ------------------
  ------------------
 9217|   952k|	*test = NODE_TEST_ALL;
 9218|   952k|	return(NULL);
 9219|   952k|    }
 9220|       |
 9221|  79.3k|    if (name == NULL)
  ------------------
  |  Branch (9221:9): [True: 4.86k, False: 74.4k]
  ------------------
 9222|  4.86k|	name = xmlXPathParseNCName(ctxt);
 9223|  79.3k|    if (name == NULL) {
  ------------------
  |  Branch (9223:9): [True: 305, False: 79.0k]
  ------------------
 9224|    305|	XP_ERRORNULL(XPATH_EXPR_ERROR);
  ------------------
  |  |  633|    305|    { xmlXPathErr(ctxt, X); return(NULL); }
  ------------------
 9225|      0|    }
 9226|       |
 9227|  79.0k|    blanks = IS_BLANK_CH(CUR);
  ------------------
  |  |  137|  79.0k|#define IS_BLANK_CH(c)  xmlIsBlank_ch(c)
  |  |  ------------------
  |  |  |  |   90|  79.0k|#define xmlIsBlank_ch(c)	(((c) == 0x20) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (90:27): [True: 1.60k, False: 77.4k]
  |  |  |  |  ------------------
  |  |  |  |   91|  79.0k|				 ((0x9 <= (c)) && ((c) <= 0xa)) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (91:7): [True: 75.7k, False: 1.69k]
  |  |  |  |  |  Branch (91:23): [True: 20, False: 75.7k]
  |  |  |  |  ------------------
  |  |  |  |   92|  79.0k|				 ((c) == 0xd))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (92:6): [True: 7, False: 77.4k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 9228|  79.0k|    SKIP_BLANKS;
  ------------------
  |  | 2199|  79.0k|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  | 2202|  93.9k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2202:15): [True: 14.9k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 9229|  79.0k|    if (CUR == '(') {
  ------------------
  |  | 2193|  79.0k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (9229:9): [True: 903, False: 78.1k]
  ------------------
 9230|    903|	NEXT;
  ------------------
  |  | 2202|    903|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  ------------------
  |  |  |  Branch (2202:15): [True: 903, False: 0]
  |  |  ------------------
  ------------------
 9231|       |	/*
 9232|       |	 * NodeType or PI search
 9233|       |	 */
 9234|    903|	if (xmlStrEqual(name, BAD_CAST "comment"))
  ------------------
  |  |   34|    903|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (9234:6): [True: 20, False: 883]
  ------------------
 9235|     20|	    *type = NODE_TYPE_COMMENT;
 9236|    883|	else if (xmlStrEqual(name, BAD_CAST "node"))
  ------------------
  |  |   34|    883|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (9236:11): [True: 50, False: 833]
  ------------------
 9237|     50|	    *type = NODE_TYPE_NODE;
 9238|    833|	else if (xmlStrEqual(name, BAD_CAST "processing-instruction"))
  ------------------
  |  |   34|    833|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (9238:11): [True: 122, False: 711]
  ------------------
 9239|    122|	    *type = NODE_TYPE_PI;
 9240|    711|	else if (xmlStrEqual(name, BAD_CAST "text"))
  ------------------
  |  |   34|    711|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (9240:11): [True: 631, False: 80]
  ------------------
 9241|    631|	    *type = NODE_TYPE_TEXT;
 9242|     80|	else {
 9243|     80|	    if (name != NULL)
  ------------------
  |  Branch (9243:10): [True: 80, False: 0]
  ------------------
 9244|     80|		xmlFree(name);
 9245|     80|	    XP_ERRORNULL(XPATH_EXPR_ERROR);
  ------------------
  |  |  633|     80|    { xmlXPathErr(ctxt, X); return(NULL); }
  ------------------
 9246|      0|	}
 9247|       |
 9248|    823|	*test = NODE_TEST_TYPE;
 9249|       |
 9250|    823|	SKIP_BLANKS;
  ------------------
  |  | 2199|  1.53k|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  | 2202|  2.35k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2202:15): [True: 1.53k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 9251|    823|	if (*type == NODE_TYPE_PI) {
  ------------------
  |  Branch (9251:6): [True: 122, False: 701]
  ------------------
 9252|       |	    /*
 9253|       |	     * Specific case: search a PI by name.
 9254|       |	     */
 9255|    122|	    if (name != NULL)
  ------------------
  |  Branch (9255:10): [True: 122, False: 0]
  ------------------
 9256|    122|		xmlFree(name);
 9257|    122|	    name = NULL;
 9258|    122|	    if (CUR != ')') {
  ------------------
  |  | 2193|    122|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (9258:10): [True: 103, False: 19]
  ------------------
 9259|    103|		name = xmlXPathParseLiteral(ctxt);
 9260|    103|		*test = NODE_TEST_PI;
 9261|    103|		SKIP_BLANKS;
  ------------------
  |  | 2199|    619|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  | 2202|    619|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2202:15): [True: 619, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 9262|    103|	    }
 9263|    122|	}
 9264|    823|	if (CUR != ')') {
  ------------------
  |  | 2193|    823|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (9264:6): [True: 49, False: 774]
  ------------------
 9265|     49|	    if (name != NULL)
  ------------------
  |  Branch (9265:10): [True: 37, False: 12]
  ------------------
 9266|     37|		xmlFree(name);
 9267|     49|	    XP_ERRORNULL(XPATH_UNCLOSED_ERROR);
  ------------------
  |  |  633|     49|    { xmlXPathErr(ctxt, X); return(NULL); }
  ------------------
 9268|      0|	}
 9269|    774|	NEXT;
  ------------------
  |  | 2202|    774|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  ------------------
  |  |  |  Branch (2202:15): [True: 774, False: 0]
  |  |  ------------------
  ------------------
 9270|    774|	return(name);
 9271|    823|    }
 9272|  78.1k|    *test = NODE_TEST_NAME;
 9273|  78.1k|    if ((!blanks) && (CUR == ':')) {
  ------------------
  |  | 2193|  76.5k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (9273:9): [True: 76.5k, False: 1.62k]
  |  Branch (9273:22): [True: 2.30k, False: 74.2k]
  ------------------
 9274|  2.30k|	NEXT;
  ------------------
  |  | 2202|  2.30k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  ------------------
  |  |  |  Branch (2202:15): [True: 2.30k, 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.30k|	*prefix = name;
 9284|       |
 9285|  2.30k|	if (CUR == '*') {
  ------------------
  |  | 2193|  2.30k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (9285:6): [True: 449, False: 1.86k]
  ------------------
 9286|       |	    /*
 9287|       |	     * All elements
 9288|       |	     */
 9289|    449|	    NEXT;
  ------------------
  |  | 2202|    449|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  ------------------
  |  |  |  Branch (2202:15): [True: 449, False: 0]
  |  |  ------------------
  ------------------
 9290|    449|	    *test = NODE_TEST_ALL;
 9291|    449|	    return(NULL);
 9292|    449|	}
 9293|       |
 9294|  1.86k|	name = xmlXPathParseNCName(ctxt);
 9295|  1.86k|	if (name == NULL) {
  ------------------
  |  Branch (9295:6): [True: 69, False: 1.79k]
  ------------------
 9296|     69|	    XP_ERRORNULL(XPATH_EXPR_ERROR);
  ------------------
  |  |  633|     69|    { xmlXPathErr(ctxt, X); return(NULL); }
  ------------------
 9297|      0|	}
 9298|  1.86k|    }
 9299|  77.6k|    return(name);
 9300|  78.1k|}
xpath.c:xmlXPathCompExprAdd:
 1031|  3.30M|   int value2, int value3, void *value4, void *value5) {
 1032|  3.30M|    xmlXPathCompExprPtr comp = ctxt->comp;
 1033|  3.30M|    if (comp->nbStep >= comp->maxStep) {
  ------------------
  |  Branch (1033:9): [True: 55.0k, False: 3.24M]
  ------------------
 1034|  55.0k|	xmlXPathStepOp *real;
 1035|  55.0k|        int newSize;
 1036|       |
 1037|  55.0k|        newSize = xmlGrowCapacity(comp->maxStep, sizeof(real[0]),
 1038|  55.0k|                                  10, XPATH_MAX_STEPS);
  ------------------
  |  |   88|  55.0k|#define XPATH_MAX_STEPS 1000000
  ------------------
 1039|  55.0k|        if (newSize < 0) {
  ------------------
  |  Branch (1039:13): [True: 0, False: 55.0k]
  ------------------
 1040|      0|	    xmlXPathPErrMemory(ctxt);
 1041|      0|	    return(-1);
 1042|      0|        }
 1043|  55.0k|	real = xmlRealloc(comp->steps, newSize * sizeof(real[0]));
 1044|  55.0k|	if (real == NULL) {
  ------------------
  |  Branch (1044:6): [True: 116, False: 54.9k]
  ------------------
 1045|    116|	    xmlXPathPErrMemory(ctxt);
 1046|    116|	    return(-1);
 1047|    116|	}
 1048|  54.9k|	comp->steps = real;
 1049|  54.9k|	comp->maxStep = newSize;
 1050|  54.9k|    }
 1051|  3.30M|    comp->last = comp->nbStep;
 1052|  3.30M|    comp->steps[comp->nbStep].ch1 = ch1;
 1053|  3.30M|    comp->steps[comp->nbStep].ch2 = ch2;
 1054|  3.30M|    comp->steps[comp->nbStep].op = op;
 1055|  3.30M|    comp->steps[comp->nbStep].value = value;
 1056|  3.30M|    comp->steps[comp->nbStep].value2 = value2;
 1057|  3.30M|    comp->steps[comp->nbStep].value3 = value3;
 1058|  3.30M|    if ((comp->dict != NULL) &&
  ------------------
  |  Branch (1058:9): [True: 0, False: 3.30M]
  ------------------
 1059|      0|        ((op == XPATH_OP_FUNCTION) || (op == XPATH_OP_VARIABLE) ||
  ------------------
  |  Branch (1059:10): [True: 0, False: 0]
  |  Branch (1059:39): [True: 0, False: 0]
  ------------------
 1060|      0|	 (op == XPATH_OP_COLLECT))) {
  ------------------
  |  Branch (1060:3): [True: 0, False: 0]
  ------------------
 1061|      0|        if (value4 != NULL) {
  ------------------
  |  Branch (1061:13): [True: 0, False: 0]
  ------------------
 1062|      0|	    comp->steps[comp->nbStep].value4 = (xmlChar *)
 1063|      0|	        (void *)xmlDictLookup(comp->dict, value4, -1);
 1064|      0|	    xmlFree(value4);
 1065|      0|	} else
 1066|      0|	    comp->steps[comp->nbStep].value4 = NULL;
 1067|      0|        if (value5 != NULL) {
  ------------------
  |  Branch (1067:13): [True: 0, False: 0]
  ------------------
 1068|      0|	    comp->steps[comp->nbStep].value5 = (xmlChar *)
 1069|      0|	        (void *)xmlDictLookup(comp->dict, value5, -1);
 1070|      0|	    xmlFree(value5);
 1071|      0|	} else
 1072|      0|	    comp->steps[comp->nbStep].value5 = NULL;
 1073|  3.30M|    } else {
 1074|  3.30M|	comp->steps[comp->nbStep].value4 = value4;
 1075|  3.30M|	comp->steps[comp->nbStep].value5 = value5;
 1076|  3.30M|    }
 1077|       |    comp->steps[comp->nbStep].cache = NULL;
 1078|  3.30M|    return(comp->nbStep++);
 1079|  3.30M|}
xpath.c:xmlXPathOptimizeExpression:
11740|  1.86M|{
11741|  1.86M|    xmlXPathCompExprPtr comp = pctxt->comp;
11742|  1.86M|    xmlXPathContextPtr ctxt;
11743|       |
11744|       |    /*
11745|       |    * Try to rewrite "descendant-or-self::node()/foo" to an optimized
11746|       |    * internal representation.
11747|       |    */
11748|       |
11749|  1.86M|    if ((op->op == XPATH_OP_COLLECT /* 11 */) &&
  ------------------
  |  Branch (11749:9): [True: 587k, False: 1.28M]
  ------------------
11750|   587k|        (op->ch1 != -1) &&
  ------------------
  |  Branch (11750:9): [True: 587k, False: 0]
  ------------------
11751|   587k|        (op->ch2 == -1 /* no predicate */))
  ------------------
  |  Branch (11751:9): [True: 582k, False: 5.51k]
  ------------------
11752|   582k|    {
11753|   582k|        xmlXPathStepOpPtr prevop = &comp->steps[op->ch1];
11754|       |
11755|   582k|        if ((prevop->op == XPATH_OP_COLLECT /* 11 */) &&
  ------------------
  |  Branch (11755:13): [True: 17.1k, False: 565k]
  ------------------
11756|  17.1k|            ((xmlXPathAxisVal) prevop->value ==
  ------------------
  |  Branch (11756:13): [True: 7.70k, False: 9.39k]
  ------------------
11757|  17.1k|                AXIS_DESCENDANT_OR_SELF) &&
11758|  7.70k|            (prevop->ch2 == -1) &&
  ------------------
  |  Branch (11758:13): [True: 7.70k, False: 0]
  ------------------
11759|  7.70k|            ((xmlXPathTestVal) prevop->value2 == NODE_TEST_TYPE) &&
  ------------------
  |  Branch (11759:13): [True: 7.70k, False: 0]
  ------------------
11760|  7.70k|            ((xmlXPathTypeVal) prevop->value3 == NODE_TYPE_NODE))
  ------------------
  |  Branch (11760:13): [True: 7.70k, False: 0]
  ------------------
11761|  7.70k|        {
11762|       |            /*
11763|       |            * This is a "descendant-or-self::node()" without predicates.
11764|       |            * Try to eliminate it.
11765|       |            */
11766|       |
11767|  7.70k|            switch ((xmlXPathAxisVal) op->value) {
11768|  2.05k|                case AXIS_CHILD:
  ------------------
  |  Branch (11768:17): [True: 2.05k, False: 5.64k]
  ------------------
11769|  2.05k|                case AXIS_DESCENDANT:
  ------------------
  |  Branch (11769:17): [True: 0, False: 7.70k]
  ------------------
11770|       |                    /*
11771|       |                    * Convert "descendant-or-self::node()/child::" or
11772|       |                    * "descendant-or-self::node()/descendant::" to
11773|       |                    * "descendant::"
11774|       |                    */
11775|  2.05k|                    op->ch1   = prevop->ch1;
11776|  2.05k|                    op->value = AXIS_DESCENDANT;
11777|  2.05k|                    break;
11778|      0|                case AXIS_SELF:
  ------------------
  |  Branch (11778:17): [True: 0, False: 7.70k]
  ------------------
11779|  1.86k|                case AXIS_DESCENDANT_OR_SELF:
  ------------------
  |  Branch (11779:17): [True: 1.86k, False: 5.83k]
  ------------------
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.86k|                    op->ch1   = prevop->ch1;
11786|  1.86k|                    op->value = AXIS_DESCENDANT_OR_SELF;
11787|  1.86k|                    break;
11788|  3.77k|                default:
  ------------------
  |  Branch (11788:17): [True: 3.77k, False: 3.92k]
  ------------------
11789|  3.77k|                    break;
11790|  7.70k|            }
11791|  7.70k|	}
11792|   582k|    }
11793|       |
11794|       |    /* OP_VALUE has invalid ch1. */
11795|  1.86M|    if (op->op == XPATH_OP_VALUE)
  ------------------
  |  Branch (11795:9): [True: 30.5k, False: 1.83M]
  ------------------
11796|  30.5k|        return;
11797|       |
11798|       |    /* Recurse */
11799|  1.83M|    ctxt = pctxt->context;
11800|  1.83M|    if (ctxt != NULL) {
  ------------------
  |  Branch (11800:9): [True: 1.83M, False: 0]
  ------------------
11801|  1.83M|        if (ctxt->depth >= XPATH_MAX_RECURSION_DEPTH)
  ------------------
  |  |  112|  1.83M|#define XPATH_MAX_RECURSION_DEPTH 500
  ------------------
  |  Branch (11801:13): [True: 2.07k, False: 1.83M]
  ------------------
11802|  2.07k|            return;
11803|  1.83M|        ctxt->depth += 1;
11804|  1.83M|    }
11805|  1.83M|    if (op->ch1 != -1)
  ------------------
  |  Branch (11805:9): [True: 1.24M, False: 590k]
  ------------------
11806|  1.24M|        xmlXPathOptimizeExpression(pctxt, &comp->steps[op->ch1]);
11807|  1.83M|    if (op->ch2 != -1)
  ------------------
  |  Branch (11807:9): [True: 616k, False: 1.22M]
  ------------------
11808|   616k|	xmlXPathOptimizeExpression(pctxt, &comp->steps[op->ch2]);
11809|  1.83M|    if (ctxt != NULL)
  ------------------
  |  Branch (11809:9): [True: 1.83M, False: 0]
  ------------------
11810|  1.83M|        ctxt->depth -= 1;
11811|  1.83M|}
xpath.c:xmlXPathRunEval:
11496|  7.06k|{
11497|  7.06k|    xmlXPathCompExprPtr comp;
11498|  7.06k|    int oldDepth;
11499|       |
11500|  7.06k|    if ((ctxt == NULL) || (ctxt->comp == NULL))
  ------------------
  |  Branch (11500:9): [True: 0, False: 7.06k]
  |  Branch (11500:27): [True: 0, False: 7.06k]
  ------------------
11501|      0|	return(-1);
11502|       |
11503|  7.06k|    if (ctxt->valueTab == NULL) {
  ------------------
  |  Branch (11503:9): [True: 0, False: 7.06k]
  ------------------
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|  7.06k|    comp = ctxt->comp;
11553|  7.06k|    if (comp->last < 0) {
  ------------------
  |  Branch (11553:9): [True: 0, False: 7.06k]
  ------------------
11554|      0|        xmlXPathErr(ctxt, XPATH_STACK_ERROR);
11555|      0|	return(-1);
11556|      0|    }
11557|  7.06k|    oldDepth = ctxt->context->depth;
11558|  7.06k|    if (toBool)
  ------------------
  |  Branch (11558:9): [True: 0, False: 7.06k]
  ------------------
11559|      0|	return(xmlXPathCompOpEvalToBoolean(ctxt,
11560|      0|	    &comp->steps[comp->last], 0));
11561|  7.06k|    else
11562|  7.06k|	xmlXPathCompOpEval(ctxt, &comp->steps[comp->last]);
11563|  7.06k|    ctxt->context->depth = oldDepth;
11564|       |
11565|  7.06k|    return(0);
11566|  7.06k|}
xpath.c:xmlXPathCompOpEvalToBoolean:
11177|   474k|{
11178|   474k|    xmlXPathObjectPtr resObj = NULL;
11179|       |
11180|   476k|start:
11181|   476k|    if (OP_LIMIT_EXCEEDED(ctxt, 1))
  ------------------
  |  |  818|   476k|    ((ctxt->context->opLimit != 0) && (xmlXPathCheckOpLimit(ctxt, n) < 0))
  |  |  ------------------
  |  |  |  Branch (818:6): [True: 476k, False: 0]
  |  |  |  Branch (818:39): [True: 6, False: 476k]
  |  |  ------------------
  ------------------
11182|      6|        return(0);
11183|       |    /* comp = ctxt->comp; */
11184|   476k|    switch (op->op) {
11185|      0|        case XPATH_OP_END:
  ------------------
  |  Branch (11185:9): [True: 0, False: 476k]
  ------------------
11186|      0|            return (0);
11187|  31.6k|	case XPATH_OP_VALUE:
  ------------------
  |  Branch (11187:2): [True: 31.6k, False: 444k]
  ------------------
11188|  31.6k|	    resObj = (xmlXPathObjectPtr) op->value4;
11189|  31.6k|	    if (isPredicate)
  ------------------
  |  Branch (11189:10): [True: 31.6k, False: 0]
  ------------------
11190|  31.6k|		return(xmlXPathEvaluatePredicateResult(ctxt, resObj));
11191|      0|	    return(xmlXPathCastToBoolean(resObj));
11192|  2.34k|	case XPATH_OP_SORT:
  ------------------
  |  Branch (11192:2): [True: 2.34k, False: 474k]
  ------------------
11193|       |	    /*
11194|       |	    * We don't need sorting for boolean results. Skip this one.
11195|       |	    */
11196|  2.34k|            if (op->ch1 != -1) {
  ------------------
  |  Branch (11196:17): [True: 2.34k, False: 0]
  ------------------
11197|  2.34k|		op = &ctxt->comp->steps[op->ch1];
11198|  2.34k|		goto start;
11199|  2.34k|	    }
11200|      0|	    return(0);
11201|   143k|	case XPATH_OP_COLLECT:
  ------------------
  |  Branch (11201:2): [True: 143k, False: 333k]
  ------------------
11202|   143k|	    if (op->ch1 == -1)
  ------------------
  |  Branch (11202:10): [True: 0, False: 143k]
  ------------------
11203|      0|		return(0);
11204|       |
11205|   143k|            xmlXPathCompOpEval(ctxt, &ctxt->comp->steps[op->ch1]);
11206|   143k|	    if (ctxt->error != XPATH_EXPRESSION_OK)
  ------------------
  |  Branch (11206:10): [True: 162, False: 142k]
  ------------------
11207|    162|		return(-1);
11208|       |
11209|   142k|            xmlXPathNodeCollectAndTest(ctxt, op, NULL, NULL, 1);
11210|   142k|	    if (ctxt->error != XPATH_EXPRESSION_OK)
  ------------------
  |  Branch (11210:10): [True: 335, False: 142k]
  ------------------
11211|    335|		return(-1);
11212|       |
11213|   142k|	    resObj = xmlXPathValuePop(ctxt);
11214|   142k|	    if (resObj == NULL)
  ------------------
  |  Branch (11214:10): [True: 0, False: 142k]
  ------------------
11215|      0|		return(-1);
11216|   142k|	    break;
11217|   299k|	default:
  ------------------
  |  Branch (11217:2): [True: 299k, False: 177k]
  ------------------
11218|       |	    /*
11219|       |	    * Fallback to call xmlXPathCompOpEval().
11220|       |	    */
11221|   299k|	    xmlXPathCompOpEval(ctxt, op);
11222|   299k|	    if (ctxt->error != XPATH_EXPRESSION_OK)
  ------------------
  |  Branch (11222:10): [True: 1.18k, False: 298k]
  ------------------
11223|  1.18k|		return(-1);
11224|       |
11225|   298k|	    resObj = xmlXPathValuePop(ctxt);
11226|   298k|	    if (resObj == NULL)
  ------------------
  |  Branch (11226:10): [True: 0, False: 298k]
  ------------------
11227|      0|		return(-1);
11228|   298k|	    break;
11229|   476k|    }
11230|       |
11231|   440k|    if (resObj) {
  ------------------
  |  Branch (11231:9): [True: 440k, False: 0]
  ------------------
11232|   440k|	int res;
11233|       |
11234|   440k|	if (resObj->type == XPATH_BOOLEAN) {
  ------------------
  |  Branch (11234:6): [True: 219k, False: 220k]
  ------------------
11235|   219k|	    res = resObj->boolval;
11236|   220k|	} else if (isPredicate) {
  ------------------
  |  Branch (11236:13): [True: 220k, 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|   220k|	    res = xmlXPathEvaluatePredicateResult(ctxt, resObj);
11246|   220k|	} else {
11247|      0|	    res = xmlXPathCastToBoolean(resObj);
11248|      0|	}
11249|   440k|	xmlXPathReleaseObject(ctxt->context, resObj);
11250|   440k|	return(res);
11251|   440k|    }
11252|       |
11253|      0|    return(0);
11254|   440k|}
xpath.c:xmlXPathNodeCollectAndTest:
 9793|  1.12M|{
 9794|       |
 9795|  1.12M|#define XP_TEST_HIT \
 9796|  1.12M|    if (hasAxisRange != 0) { \
 9797|  1.12M|	if (++pos == maxPos) { \
 9798|  1.12M|	    if (addNode(seq, cur) < 0) \
 9799|  1.12M|	        xmlXPathPErrMemory(ctxt); \
 9800|  1.12M|	    goto axis_range_end; } \
 9801|  1.12M|    } else { \
 9802|  1.12M|	if (addNode(seq, cur) < 0) \
 9803|  1.12M|	    xmlXPathPErrMemory(ctxt); \
 9804|  1.12M|	if (breakOnFirstHit) goto first_hit; }
 9805|       |
 9806|  1.12M|#define XP_TEST_HIT_NS \
 9807|  1.12M|    if (hasAxisRange != 0) { \
 9808|  1.12M|	if (++pos == maxPos) { \
 9809|  1.12M|	    hasNsNodes = 1; \
 9810|  1.12M|	    if (xmlXPathNodeSetAddNs(seq, xpctxt->node, (xmlNsPtr) cur) < 0) \
 9811|  1.12M|	        xmlXPathPErrMemory(ctxt); \
 9812|  1.12M|	goto axis_range_end; } \
 9813|  1.12M|    } else { \
 9814|  1.12M|	hasNsNodes = 1; \
 9815|  1.12M|	if (xmlXPathNodeSetAddNs(seq, xpctxt->node, (xmlNsPtr) cur) < 0) \
 9816|  1.12M|	    xmlXPathPErrMemory(ctxt); \
 9817|  1.12M|	if (breakOnFirstHit) goto first_hit; }
 9818|       |
 9819|  1.12M|    xmlXPathAxisVal axis = (xmlXPathAxisVal) op->value;
 9820|  1.12M|    xmlXPathTestVal test = (xmlXPathTestVal) op->value2;
 9821|  1.12M|    xmlXPathTypeVal type = (xmlXPathTypeVal) op->value3;
 9822|  1.12M|    const xmlChar *prefix = op->value4;
 9823|  1.12M|    const xmlChar *name = op->value5;
 9824|  1.12M|    const xmlChar *URI = NULL;
 9825|       |
 9826|  1.12M|    int total = 0, hasNsNodes = 0;
 9827|       |    /* The popped object holding the context nodes */
 9828|  1.12M|    xmlXPathObjectPtr obj;
 9829|       |    /* The set of context nodes for the node tests */
 9830|  1.12M|    xmlNodeSetPtr contextSeq;
 9831|  1.12M|    int contextIdx;
 9832|  1.12M|    xmlNodePtr contextNode;
 9833|       |    /* The final resulting node set wrt to all context nodes */
 9834|  1.12M|    xmlNodeSetPtr outSeq;
 9835|       |    /*
 9836|       |    * The temporary resulting node set wrt 1 context node.
 9837|       |    * Used to feed predicate evaluation.
 9838|       |    */
 9839|  1.12M|    xmlNodeSetPtr seq;
 9840|  1.12M|    xmlNodePtr cur;
 9841|       |    /* First predicate operator */
 9842|  1.12M|    xmlXPathStepOpPtr predOp;
 9843|  1.12M|    int maxPos; /* The requested position() (when a "[n]" predicate) */
 9844|  1.12M|    int hasPredicateRange, hasAxisRange, pos;
 9845|  1.12M|    int breakOnFirstHit;
 9846|       |
 9847|  1.12M|    xmlXPathTraversalFunction next = NULL;
 9848|  1.12M|    int (*addNode) (xmlNodeSetPtr, xmlNodePtr);
 9849|  1.12M|    xmlXPathNodeSetMergeFunction mergeAndClear;
 9850|  1.12M|    xmlNodePtr oldContextNode;
 9851|  1.12M|    xmlXPathContextPtr xpctxt = ctxt->context;
 9852|       |
 9853|       |
 9854|  1.12M|    CHECK_TYPE0(XPATH_NODESET);
  ------------------
  |  |  271|  1.12M|    if ((ctxt->value == NULL) || (ctxt->value->type != typeval))	\
  |  |  ------------------
  |  |  |  Branch (271:9): [True: 0, False: 1.12M]
  |  |  |  Branch (271:34): [True: 107, False: 1.12M]
  |  |  ------------------
  |  |  272|  1.12M|        XP_ERROR0(XPATH_INVALID_TYPE)
  |  |  ------------------
  |  |  |  |  252|    107|    { xmlXPathErr(ctxt, X); return(0); }
  |  |  ------------------
  ------------------
 9855|  1.12M|    obj = xmlXPathValuePop(ctxt);
 9856|       |    /*
 9857|       |    * Setup namespaces.
 9858|       |    */
 9859|  1.12M|    if (prefix != NULL) {
  ------------------
  |  Branch (9859:9): [True: 6.93k, False: 1.11M]
  ------------------
 9860|  6.93k|        URI = xmlXPathNsLookup(xpctxt, prefix);
 9861|  6.93k|        if (URI == NULL) {
  ------------------
  |  Branch (9861:13): [True: 151, False: 6.78k]
  ------------------
 9862|    151|	    xmlXPathReleaseObject(xpctxt, obj);
 9863|    151|            xmlXPathErrFmt(ctxt, XPATH_UNDEF_PREFIX_ERROR,
 9864|    151|                           "Undefined namespace prefix: %s\n", prefix);
 9865|    151|            return 0;
 9866|    151|	}
 9867|  6.93k|    }
 9868|       |    /*
 9869|       |    * Setup axis.
 9870|       |    *
 9871|       |    * MAYBE FUTURE TODO: merging optimizations:
 9872|       |    * - If the nodes to be traversed wrt to the initial nodes and
 9873|       |    *   the current axis cannot overlap, then we could avoid searching
 9874|       |    *   for duplicates during the merge.
 9875|       |    *   But the question is how/when to evaluate if they cannot overlap.
 9876|       |    *   Example: if we know that for two initial nodes, the one is
 9877|       |    *   not in the ancestor-or-self axis of the other, then we could safely
 9878|       |    *   avoid a duplicate-aware merge, if the axis to be traversed is e.g.
 9879|       |    *   the descendant-or-self axis.
 9880|       |    */
 9881|  1.12M|    mergeAndClear = xmlXPathNodeSetMergeAndClear;
 9882|  1.12M|    switch (axis) {
  ------------------
  |  Branch (9882:13): [True: 1.12M, False: 0]
  ------------------
 9883|    726|        case AXIS_ANCESTOR:
  ------------------
  |  Branch (9883:9): [True: 726, False: 1.12M]
  ------------------
 9884|    726|            first = NULL;
 9885|    726|            next = xmlXPathNextAncestor;
 9886|    726|            break;
 9887|    102|        case AXIS_ANCESTOR_OR_SELF:
  ------------------
  |  Branch (9887:9): [True: 102, False: 1.12M]
  ------------------
 9888|    102|            first = NULL;
 9889|    102|            next = xmlXPathNextAncestorOrSelf;
 9890|    102|            break;
 9891|  19.0k|        case AXIS_ATTRIBUTE:
  ------------------
  |  Branch (9891:9): [True: 19.0k, False: 1.10M]
  ------------------
 9892|  19.0k|            first = NULL;
 9893|  19.0k|	    last = NULL;
 9894|  19.0k|            next = xmlXPathNextAttribute;
 9895|  19.0k|	    mergeAndClear = xmlXPathNodeSetMergeAndClearNoDupls;
 9896|  19.0k|            break;
 9897|   886k|        case AXIS_CHILD:
  ------------------
  |  Branch (9897:9): [True: 886k, False: 238k]
  ------------------
 9898|   886k|	    last = NULL;
 9899|   886k|	    if (((test == NODE_TEST_NAME) || (test == NODE_TEST_ALL)) &&
  ------------------
  |  Branch (9899:11): [True: 698k, False: 188k]
  |  Branch (9899:39): [True: 183k, False: 4.56k]
  ------------------
 9900|   882k|		(type == NODE_TYPE_NODE))
  ------------------
  |  Branch (9900:3): [True: 882k, False: 0]
  ------------------
 9901|   882k|	    {
 9902|       |		/*
 9903|       |		* Optimization if an element node type is 'element'.
 9904|       |		*/
 9905|   882k|		next = xmlXPathNextChildElement;
 9906|   882k|	    } else
 9907|  4.56k|		next = xmlXPathNextChild;
 9908|   886k|	    mergeAndClear = xmlXPathNodeSetMergeAndClearNoDupls;
 9909|   886k|            break;
 9910|  59.5k|        case AXIS_DESCENDANT:
  ------------------
  |  Branch (9910:9): [True: 59.5k, False: 1.06M]
  ------------------
 9911|  59.5k|	    last = NULL;
 9912|  59.5k|            next = xmlXPathNextDescendant;
 9913|  59.5k|            break;
 9914|   124k|        case AXIS_DESCENDANT_OR_SELF:
  ------------------
  |  Branch (9914:9): [True: 124k, False: 1.00M]
  ------------------
 9915|   124k|	    last = NULL;
 9916|   124k|            next = xmlXPathNextDescendantOrSelf;
 9917|   124k|            break;
 9918|    639|        case AXIS_FOLLOWING:
  ------------------
  |  Branch (9918:9): [True: 639, False: 1.12M]
  ------------------
 9919|    639|	    last = NULL;
 9920|    639|            next = xmlXPathNextFollowing;
 9921|    639|            break;
 9922|      0|        case AXIS_FOLLOWING_SIBLING:
  ------------------
  |  Branch (9922:9): [True: 0, False: 1.12M]
  ------------------
 9923|      0|	    last = NULL;
 9924|      0|            next = xmlXPathNextFollowingSibling;
 9925|      0|            break;
 9926|  1.57k|        case AXIS_NAMESPACE:
  ------------------
  |  Branch (9926:9): [True: 1.57k, False: 1.12M]
  ------------------
 9927|  1.57k|            first = NULL;
 9928|  1.57k|	    last = NULL;
 9929|  1.57k|            next = (xmlXPathTraversalFunction) xmlXPathNextNamespace;
 9930|  1.57k|	    mergeAndClear = xmlXPathNodeSetMergeAndClearNoDupls;
 9931|  1.57k|            break;
 9932|  32.1k|        case AXIS_PARENT:
  ------------------
  |  Branch (9932:9): [True: 32.1k, False: 1.09M]
  ------------------
 9933|  32.1k|            first = NULL;
 9934|  32.1k|            next = xmlXPathNextParent;
 9935|  32.1k|            break;
 9936|     64|        case AXIS_PRECEDING:
  ------------------
  |  Branch (9936:9): [True: 64, False: 1.12M]
  ------------------
 9937|     64|            first = NULL;
 9938|     64|            next = xmlXPathNextPrecedingInternal;
 9939|     64|            break;
 9940|      3|        case AXIS_PRECEDING_SIBLING:
  ------------------
  |  Branch (9940:9): [True: 3, False: 1.12M]
  ------------------
 9941|      3|            first = NULL;
 9942|      3|            next = xmlXPathNextPrecedingSibling;
 9943|      3|            break;
 9944|    552|        case AXIS_SELF:
  ------------------
  |  Branch (9944:9): [True: 552, False: 1.12M]
  ------------------
 9945|    552|            first = NULL;
 9946|    552|	    last = NULL;
 9947|    552|            next = xmlXPathNextSelf;
 9948|    552|	    mergeAndClear = xmlXPathNodeSetMergeAndClearNoDupls;
 9949|    552|            break;
 9950|  1.12M|    }
 9951|       |
 9952|  1.12M|    if (next == NULL) {
  ------------------
  |  Branch (9952:9): [True: 0, False: 1.12M]
  ------------------
 9953|      0|	xmlXPathReleaseObject(xpctxt, obj);
 9954|      0|        return(0);
 9955|      0|    }
 9956|  1.12M|    contextSeq = obj->nodesetval;
 9957|  1.12M|    if ((contextSeq == NULL) || (contextSeq->nodeNr <= 0)) {
  ------------------
  |  Branch (9957:9): [True: 0, False: 1.12M]
  |  Branch (9957:33): [True: 76.2k, False: 1.04M]
  ------------------
 9958|  76.2k|        xmlXPathValuePush(ctxt, obj);
 9959|  76.2k|        return(0);
 9960|  76.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|  1.04M|    maxPos = 0;
 9980|  1.04M|    predOp = NULL;
 9981|  1.04M|    hasPredicateRange = 0;
 9982|  1.04M|    hasAxisRange = 0;
 9983|  1.04M|    if (op->ch2 != -1) {
  ------------------
  |  Branch (9983:9): [True: 118k, False: 931k]
  ------------------
 9984|       |	/*
 9985|       |	* There's at least one predicate. 16 == XPATH_OP_PREDICATE
 9986|       |	*/
 9987|   118k|	predOp = &ctxt->comp->steps[op->ch2];
 9988|   118k|	if (xmlXPathIsPositionalPredicate(ctxt, predOp, &maxPos)) {
  ------------------
  |  Branch (9988:6): [True: 60.6k, False: 57.8k]
  ------------------
 9989|  60.6k|	    if (predOp->ch1 != -1) {
  ------------------
  |  Branch (9989:10): [True: 35.9k, False: 24.6k]
  ------------------
 9990|       |		/*
 9991|       |		* Use the next inner predicate operator.
 9992|       |		*/
 9993|  35.9k|		predOp = &ctxt->comp->steps[predOp->ch1];
 9994|  35.9k|		hasPredicateRange = 1;
 9995|  35.9k|	    } else {
 9996|       |		/*
 9997|       |		* There's no other predicate than the [n] predicate.
 9998|       |		*/
 9999|  24.6k|		predOp = NULL;
10000|  24.6k|		hasAxisRange = 1;
10001|  24.6k|	    }
10002|  60.6k|	}
10003|   118k|    }
10004|  1.04M|    breakOnFirstHit = ((toBool) && (predOp == NULL)) ? 1 : 0;
  ------------------
  |  Branch (10004:24): [True: 141k, False: 907k]
  |  Branch (10004:36): [True: 117k, False: 24.4k]
  ------------------
10005|       |    /*
10006|       |    * Axis traversal -----------------------------------------------------
10007|       |    */
10008|       |    /*
10009|       |     * 2.3 Node Tests
10010|       |     *  - For the attribute axis, the principal node type is attribute.
10011|       |     *  - For the namespace axis, the principal node type is namespace.
10012|       |     *  - For other axes, the principal node type is element.
10013|       |     *
10014|       |     * A node test * is true for any node of the
10015|       |     * principal node type. For example, child::* will
10016|       |     * select all element children of the context node
10017|       |     */
10018|  1.04M|    oldContextNode = xpctxt->node;
10019|  1.04M|    addNode = xmlXPathNodeSetAddUnique;
10020|  1.04M|    outSeq = NULL;
10021|  1.04M|    seq = NULL;
10022|  1.04M|    contextNode = NULL;
10023|  1.04M|    contextIdx = 0;
10024|       |
10025|       |
10026|  3.29M|    while (((contextIdx < contextSeq->nodeNr) || (contextNode != NULL)) &&
  ------------------
  |  Branch (10026:13): [True: 2.33M, False: 964k]
  |  Branch (10026:50): [True: 0, False: 964k]
  ------------------
10027|  2.33M|           (ctxt->error == XPATH_EXPRESSION_OK)) {
  ------------------
  |  Branch (10027:12): [True: 2.33M, False: 83]
  ------------------
10028|  2.33M|	xpctxt->node = contextSeq->nodeTab[contextIdx++];
10029|       |
10030|  2.33M|	if (seq == NULL) {
  ------------------
  |  Branch (10030:6): [True: 1.07M, False: 1.26M]
  ------------------
10031|  1.07M|	    seq = xmlXPathNodeSetCreate(NULL);
10032|  1.07M|	    if (seq == NULL) {
  ------------------
  |  Branch (10032:10): [True: 124, False: 1.07M]
  ------------------
10033|    124|                xmlXPathPErrMemory(ctxt);
10034|    124|		total = 0;
10035|    124|		goto error;
10036|    124|	    }
10037|  1.07M|	}
10038|       |	/*
10039|       |	* Traverse the axis and test the nodes.
10040|       |	*/
10041|  2.33M|	pos = 0;
10042|  2.33M|	cur = NULL;
10043|  2.33M|	hasNsNodes = 0;
10044|  9.30M|        do {
10045|  9.30M|            if (OP_LIMIT_EXCEEDED(ctxt, 1))
  ------------------
  |  |  818|  9.30M|    ((ctxt->context->opLimit != 0) && (xmlXPathCheckOpLimit(ctxt, n) < 0))
  |  |  ------------------
  |  |  |  Branch (818:6): [True: 9.30M, False: 0]
  |  |  |  Branch (818:39): [True: 39, False: 9.30M]
  |  |  ------------------
  ------------------
10046|     39|                goto error;
10047|       |
10048|  9.30M|            cur = next(ctxt, cur);
10049|  9.30M|            if (cur == NULL)
  ------------------
  |  Branch (10049:17): [True: 2.24M, False: 7.05M]
  ------------------
10050|  2.24M|                break;
10051|       |
10052|       |	    /*
10053|       |	    * QUESTION TODO: What does the "first" and "last" stuff do?
10054|       |	    */
10055|  7.05M|            if ((first != NULL) && (*first != NULL)) {
  ------------------
  |  Branch (10055:17): [True: 8.30k, False: 7.04M]
  |  Branch (10055:36): [True: 5.56k, False: 2.74k]
  ------------------
10056|  5.56k|		if (*first == cur)
  ------------------
  |  Branch (10056:7): [True: 384, False: 5.18k]
  ------------------
10057|    384|		    break;
10058|  5.18k|		if (((total % 256) == 0) &&
  ------------------
  |  Branch (10058:7): [True: 5.12k, False: 60]
  ------------------
10059|  5.12k|#ifdef XP_OPTIMIZED_NON_ELEM_COMPARISON
10060|  5.12k|		    (xmlXPathCmpNodesExt(*first, cur) >= 0))
  ------------------
  |  Branch (10060:7): [True: 4.61k, False: 507]
  ------------------
10061|       |#else
10062|       |		    (xmlXPathCmpNodes(*first, cur) >= 0))
10063|       |#endif
10064|  4.61k|		{
10065|  4.61k|		    break;
10066|  4.61k|		}
10067|  5.18k|	    }
10068|  7.04M|	    if ((last != NULL) && (*last != NULL)) {
  ------------------
  |  Branch (10068:10): [True: 3.01k, False: 7.04M]
  |  Branch (10068:28): [True: 1.20k, False: 1.80k]
  ------------------
10069|  1.20k|		if (*last == cur)
  ------------------
  |  Branch (10069:7): [True: 103, False: 1.10k]
  ------------------
10070|    103|		    break;
10071|  1.10k|		if (((total % 256) == 0) &&
  ------------------
  |  Branch (10071:7): [True: 1.00k, False: 99]
  ------------------
10072|  1.00k|#ifdef XP_OPTIMIZED_NON_ELEM_COMPARISON
10073|  1.00k|		    (xmlXPathCmpNodesExt(cur, *last) >= 0))
  ------------------
  |  Branch (10073:7): [True: 927, False: 80]
  ------------------
10074|       |#else
10075|       |		    (xmlXPathCmpNodes(cur, *last) >= 0))
10076|       |#endif
10077|    927|		{
10078|    927|		    break;
10079|    927|		}
10080|  1.10k|	    }
10081|       |
10082|  7.04M|            total++;
10083|       |
10084|  7.04M|	    switch (test) {
  ------------------
  |  Branch (10084:14): [True: 7.04M, False: 0]
  ------------------
10085|      0|                case NODE_TEST_NONE:
  ------------------
  |  Branch (10085:17): [True: 0, False: 7.04M]
  ------------------
10086|      0|		    total = 0;
10087|      0|		    goto error;
10088|  3.54M|                case NODE_TEST_TYPE:
  ------------------
  |  Branch (10088:17): [True: 3.54M, False: 3.50M]
  ------------------
10089|  3.54M|		    if (type == NODE_TYPE_NODE) {
  ------------------
  |  Branch (10089:11): [True: 3.42M, False: 112k]
  ------------------
10090|  3.42M|			switch (cur->type) {
10091|   101k|			    case XML_DOCUMENT_NODE:
  ------------------
  |  Branch (10091:8): [True: 101k, False: 3.32M]
  ------------------
10092|   101k|			    case XML_HTML_DOCUMENT_NODE:
  ------------------
  |  Branch (10092:8): [True: 0, False: 3.42M]
  ------------------
10093|  2.56M|			    case XML_ELEMENT_NODE:
  ------------------
  |  Branch (10093:8): [True: 2.46M, False: 966k]
  ------------------
10094|  2.56M|			    case XML_ATTRIBUTE_NODE:
  ------------------
  |  Branch (10094:8): [True: 640, False: 3.42M]
  ------------------
10095|  2.61M|			    case XML_PI_NODE:
  ------------------
  |  Branch (10095:8): [True: 56.0k, False: 3.37M]
  ------------------
10096|  2.63M|			    case XML_COMMENT_NODE:
  ------------------
  |  Branch (10096:8): [True: 20.4k, False: 3.40M]
  ------------------
10097|  2.67M|			    case XML_CDATA_SECTION_NODE:
  ------------------
  |  Branch (10097:8): [True: 36.9k, False: 3.39M]
  ------------------
10098|  3.38M|			    case XML_TEXT_NODE:
  ------------------
  |  Branch (10098:8): [True: 713k, False: 2.71M]
  ------------------
10099|  3.38M|				XP_TEST_HIT
  ------------------
  |  | 9796|  3.38M|    if (hasAxisRange != 0) { \
  |  |  ------------------
  |  |  |  Branch (9796:9): [True: 340, False: 3.38M]
  |  |  ------------------
  |  | 9797|    340|	if (++pos == maxPos) { \
  |  |  ------------------
  |  |  |  Branch (9797:6): [True: 84, False: 256]
  |  |  ------------------
  |  | 9798|     84|	    if (addNode(seq, cur) < 0) \
  |  |  ------------------
  |  |  |  Branch (9798:10): [True: 1, False: 83]
  |  |  ------------------
  |  | 9799|     84|	        xmlXPathPErrMemory(ctxt); \
  |  | 9800|     84|	    goto axis_range_end; } \
  |  | 9801|  3.38M|    } else { \
  |  | 9802|  3.38M|	if (addNode(seq, cur) < 0) \
  |  |  ------------------
  |  |  |  Branch (9802:6): [True: 84, False: 3.38M]
  |  |  ------------------
  |  | 9803|  3.38M|	    xmlXPathPErrMemory(ctxt); \
  |  | 9804|  3.38M|	if (breakOnFirstHit) goto first_hit; }
  |  |  ------------------
  |  |  |  Branch (9804:6): [True: 708, False: 3.38M]
  |  |  ------------------
  ------------------
10100|  3.38M|				break;
10101|  3.38M|			    case XML_NAMESPACE_DECL: {
  ------------------
  |  Branch (10101:8): [True: 37.0k, False: 3.39M]
  ------------------
10102|  37.0k|				if (axis == AXIS_NAMESPACE) {
  ------------------
  |  Branch (10102:9): [True: 0, False: 37.0k]
  ------------------
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|  37.0k|				} else {
10105|  37.0k|	                            hasNsNodes = 1;
10106|  37.0k|				    XP_TEST_HIT
  ------------------
  |  | 9796|  37.0k|    if (hasAxisRange != 0) { \
  |  |  ------------------
  |  |  |  Branch (9796:9): [True: 0, False: 37.0k]
  |  |  ------------------
  |  | 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|  37.0k|    } else { \
  |  | 9802|  37.0k|	if (addNode(seq, cur) < 0) \
  |  |  ------------------
  |  |  |  Branch (9802:6): [True: 6, False: 37.0k]
  |  |  ------------------
  |  | 9803|  37.0k|	    xmlXPathPErrMemory(ctxt); \
  |  | 9804|  37.0k|	if (breakOnFirstHit) goto first_hit; }
  |  |  ------------------
  |  |  |  Branch (9804:6): [True: 0, False: 37.0k]
  |  |  ------------------
  ------------------
10107|  37.0k|				}
10108|  37.0k|				break;
10109|  37.0k|                            }
10110|  37.0k|			    default:
  ------------------
  |  Branch (10110:8): [True: 1.15k, False: 3.42M]
  ------------------
10111|  1.15k|				break;
10112|  3.42M|			}
10113|  3.42M|		    } else if (cur->type == (xmlElementType) type) {
  ------------------
  |  Branch (10113:18): [True: 55.8k, False: 56.8k]
  ------------------
10114|  55.8k|			if (cur->type == XML_NAMESPACE_DECL)
  ------------------
  |  Branch (10114:8): [True: 0, False: 55.8k]
  ------------------
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|  55.8k|			else
10117|  55.8k|			    XP_TEST_HIT
  ------------------
  |  | 9796|  55.8k|    if (hasAxisRange != 0) { \
  |  |  ------------------
  |  |  |  Branch (9796:9): [True: 1.76k, False: 54.0k]
  |  |  ------------------
  |  | 9797|  1.76k|	if (++pos == maxPos) { \
  |  |  ------------------
  |  |  |  Branch (9797:6): [True: 296, False: 1.47k]
  |  |  ------------------
  |  | 9798|    296|	    if (addNode(seq, cur) < 0) \
  |  |  ------------------
  |  |  |  Branch (9798:10): [True: 1, False: 295]
  |  |  ------------------
  |  | 9799|    296|	        xmlXPathPErrMemory(ctxt); \
  |  | 9800|    296|	    goto axis_range_end; } \
  |  | 9801|  54.0k|    } else { \
  |  | 9802|  54.0k|	if (addNode(seq, cur) < 0) \
  |  |  ------------------
  |  |  |  Branch (9802:6): [True: 1, False: 54.0k]
  |  |  ------------------
  |  | 9803|  54.0k|	    xmlXPathPErrMemory(ctxt); \
  |  | 9804|  54.0k|	if (breakOnFirstHit) goto first_hit; }
  |  |  ------------------
  |  |  |  Branch (9804:6): [True: 255, False: 53.8k]
  |  |  ------------------
  ------------------
10118|  56.8k|		    } else if ((type == NODE_TYPE_TEXT) &&
  ------------------
  |  Branch (10118:18): [True: 56.8k, False: 24]
  ------------------
10119|  56.8k|			 (cur->type == XML_CDATA_SECTION_NODE))
  ------------------
  |  Branch (10119:5): [True: 15.7k, False: 41.1k]
  ------------------
10120|  15.7k|		    {
10121|  15.7k|			XP_TEST_HIT
  ------------------
  |  | 9796|  15.7k|    if (hasAxisRange != 0) { \
  |  |  ------------------
  |  |  |  Branch (9796:9): [True: 401, False: 15.3k]
  |  |  ------------------
  |  | 9797|    401|	if (++pos == maxPos) { \
  |  |  ------------------
  |  |  |  Branch (9797:6): [True: 39, False: 362]
  |  |  ------------------
  |  | 9798|     39|	    if (addNode(seq, cur) < 0) \
  |  |  ------------------
  |  |  |  Branch (9798:10): [True: 1, False: 38]
  |  |  ------------------
  |  | 9799|     39|	        xmlXPathPErrMemory(ctxt); \
  |  | 9800|     39|	    goto axis_range_end; } \
  |  | 9801|  15.3k|    } else { \
  |  | 9802|  15.3k|	if (addNode(seq, cur) < 0) \
  |  |  ------------------
  |  |  |  Branch (9802:6): [True: 2, False: 15.3k]
  |  |  ------------------
  |  | 9803|  15.3k|	    xmlXPathPErrMemory(ctxt); \
  |  | 9804|  15.3k|	if (breakOnFirstHit) goto first_hit; }
  |  |  ------------------
  |  |  |  Branch (9804:6): [True: 205, False: 15.1k]
  |  |  ------------------
  ------------------
10122|  15.7k|		    }
10123|  3.53M|		    break;
10124|  3.53M|                case NODE_TEST_PI:
  ------------------
  |  Branch (10124:17): [True: 160, False: 7.04M]
  ------------------
10125|    160|                    if ((cur->type == XML_PI_NODE) &&
  ------------------
  |  Branch (10125:25): [True: 46, False: 114]
  ------------------
10126|     46|                        ((name == NULL) || xmlStrEqual(name, cur->name)))
  ------------------
  |  Branch (10126:26): [True: 0, False: 46]
  |  Branch (10126:44): [True: 12, False: 34]
  ------------------
10127|     12|		    {
10128|     12|			XP_TEST_HIT
  ------------------
  |  | 9796|     12|    if (hasAxisRange != 0) { \
  |  |  ------------------
  |  |  |  Branch (9796:9): [True: 0, False: 12]
  |  |  ------------------
  |  | 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|     12|    } else { \
  |  | 9802|     12|	if (addNode(seq, cur) < 0) \
  |  |  ------------------
  |  |  |  Branch (9802:6): [True: 1, False: 11]
  |  |  ------------------
  |  | 9803|     12|	    xmlXPathPErrMemory(ctxt); \
  |  | 9804|     12|	if (breakOnFirstHit) goto first_hit; }
  |  |  ------------------
  |  |  |  Branch (9804:6): [True: 0, False: 12]
  |  |  ------------------
  ------------------
10129|     12|                    }
10130|    160|                    break;
10131|  1.59M|                case NODE_TEST_ALL:
  ------------------
  |  Branch (10131:17): [True: 1.59M, False: 5.45M]
  ------------------
10132|  1.59M|                    if (axis == AXIS_ATTRIBUTE) {
  ------------------
  |  Branch (10132:25): [True: 12.2k, False: 1.57M]
  ------------------
10133|  12.2k|                        if (cur->type == XML_ATTRIBUTE_NODE)
  ------------------
  |  Branch (10133:29): [True: 12.2k, False: 0]
  ------------------
10134|  12.2k|			{
10135|  12.2k|                            if (prefix == NULL)
  ------------------
  |  Branch (10135:33): [True: 11.4k, False: 792]
  ------------------
10136|  11.4k|			    {
10137|  11.4k|				XP_TEST_HIT
  ------------------
  |  | 9796|  11.4k|    if (hasAxisRange != 0) { \
  |  |  ------------------
  |  |  |  Branch (9796:9): [True: 3.75k, False: 7.66k]
  |  |  ------------------
  |  | 9797|  3.75k|	if (++pos == maxPos) { \
  |  |  ------------------
  |  |  |  Branch (9797:6): [True: 1.41k, False: 2.33k]
  |  |  ------------------
  |  | 9798|  1.41k|	    if (addNode(seq, cur) < 0) \
  |  |  ------------------
  |  |  |  Branch (9798:10): [True: 1, False: 1.41k]
  |  |  ------------------
  |  | 9799|  1.41k|	        xmlXPathPErrMemory(ctxt); \
  |  | 9800|  1.41k|	    goto axis_range_end; } \
  |  | 9801|  7.66k|    } else { \
  |  | 9802|  7.66k|	if (addNode(seq, cur) < 0) \
  |  |  ------------------
  |  |  |  Branch (9802:6): [True: 2, False: 7.66k]
  |  |  ------------------
  |  | 9803|  7.66k|	    xmlXPathPErrMemory(ctxt); \
  |  | 9804|  7.66k|	if (breakOnFirstHit) goto first_hit; }
  |  |  ------------------
  |  |  |  Branch (9804:6): [True: 3.36k, False: 4.30k]
  |  |  ------------------
  ------------------
10138|  11.4k|                            } else if ((cur->ns != NULL) &&
  ------------------
  |  Branch (10138:40): [True: 590, False: 202]
  ------------------
10139|    590|				(xmlStrEqual(URI, cur->ns->href)))
  ------------------
  |  Branch (10139:5): [True: 590, False: 0]
  ------------------
10140|    590|			    {
10141|    590|				XP_TEST_HIT
  ------------------
  |  | 9796|    590|    if (hasAxisRange != 0) { \
  |  |  ------------------
  |  |  |  Branch (9796:9): [True: 340, False: 250]
  |  |  ------------------
  |  | 9797|    340|	if (++pos == maxPos) { \
  |  |  ------------------
  |  |  |  Branch (9797:6): [True: 73, False: 267]
  |  |  ------------------
  |  | 9798|     73|	    if (addNode(seq, cur) < 0) \
  |  |  ------------------
  |  |  |  Branch (9798:10): [True: 1, False: 72]
  |  |  ------------------
  |  | 9799|     73|	        xmlXPathPErrMemory(ctxt); \
  |  | 9800|     73|	    goto axis_range_end; } \
  |  | 9801|    340|    } else { \
  |  | 9802|    250|	if (addNode(seq, cur) < 0) \
  |  |  ------------------
  |  |  |  Branch (9802:6): [True: 1, False: 249]
  |  |  ------------------
  |  | 9803|    250|	    xmlXPathPErrMemory(ctxt); \
  |  | 9804|    250|	if (breakOnFirstHit) goto first_hit; }
  |  |  ------------------
  |  |  |  Branch (9804:6): [True: 48, False: 202]
  |  |  ------------------
  ------------------
10142|    590|                            }
10143|  12.2k|                        }
10144|  1.57M|                    } else if (axis == AXIS_NAMESPACE) {
  ------------------
  |  Branch (10144:32): [True: 75.8k, False: 1.50M]
  ------------------
10145|  75.8k|                        if (cur->type == XML_NAMESPACE_DECL)
  ------------------
  |  Branch (10145:29): [True: 75.8k, False: 0]
  ------------------
10146|  75.8k|			{
10147|  75.8k|			    XP_TEST_HIT_NS
  ------------------
  |  | 9807|  75.8k|    if (hasAxisRange != 0) { \
  |  |  ------------------
  |  |  |  Branch (9807:9): [True: 3.49k, False: 72.3k]
  |  |  ------------------
  |  | 9808|  3.49k|	if (++pos == maxPos) { \
  |  |  ------------------
  |  |  |  Branch (9808:6): [True: 2.92k, False: 572]
  |  |  ------------------
  |  | 9809|  2.92k|	    hasNsNodes = 1; \
  |  | 9810|  2.92k|	    if (xmlXPathNodeSetAddNs(seq, xpctxt->node, (xmlNsPtr) cur) < 0) \
  |  |  ------------------
  |  |  |  Branch (9810:10): [True: 6, False: 2.91k]
  |  |  ------------------
  |  | 9811|  2.92k|	        xmlXPathPErrMemory(ctxt); \
  |  | 9812|  2.92k|	goto axis_range_end; } \
  |  | 9813|  72.3k|    } else { \
  |  | 9814|  72.3k|	hasNsNodes = 1; \
  |  | 9815|  72.3k|	if (xmlXPathNodeSetAddNs(seq, xpctxt->node, (xmlNsPtr) cur) < 0) \
  |  |  ------------------
  |  |  |  Branch (9815:6): [True: 14, False: 72.3k]
  |  |  ------------------
  |  | 9816|  72.3k|	    xmlXPathPErrMemory(ctxt); \
  |  | 9817|  72.3k|	if (breakOnFirstHit) goto first_hit; }
  |  |  ------------------
  |  |  |  Branch (9817:6): [True: 0, False: 72.3k]
  |  |  ------------------
  ------------------
10148|  75.8k|                        }
10149|  1.50M|                    } else {
10150|  1.50M|                        if (cur->type == XML_ELEMENT_NODE) {
  ------------------
  |  Branch (10150:29): [True: 1.39M, False: 112k]
  ------------------
10151|  1.39M|                            if (prefix == NULL)
  ------------------
  |  Branch (10151:33): [True: 1.37M, False: 15.0k]
  ------------------
10152|  1.37M|			    {
10153|  1.37M|				XP_TEST_HIT
  ------------------
  |  | 9796|  1.37M|    if (hasAxisRange != 0) { \
  |  |  ------------------
  |  |  |  Branch (9796:9): [True: 16.2k, False: 1.35M]
  |  |  ------------------
  |  | 9797|  16.2k|	if (++pos == maxPos) { \
  |  |  ------------------
  |  |  |  Branch (9797:6): [True: 14.0k, False: 2.14k]
  |  |  ------------------
  |  | 9798|  14.0k|	    if (addNode(seq, cur) < 0) \
  |  |  ------------------
  |  |  |  Branch (9798:10): [True: 1, False: 14.0k]
  |  |  ------------------
  |  | 9799|  14.0k|	        xmlXPathPErrMemory(ctxt); \
  |  | 9800|  14.0k|	    goto axis_range_end; } \
  |  | 9801|  1.35M|    } else { \
  |  | 9802|  1.35M|	if (addNode(seq, cur) < 0) \
  |  |  ------------------
  |  |  |  Branch (9802:6): [True: 33, False: 1.35M]
  |  |  ------------------
  |  | 9803|  1.35M|	    xmlXPathPErrMemory(ctxt); \
  |  | 9804|  1.35M|	if (breakOnFirstHit) goto first_hit; }
  |  |  ------------------
  |  |  |  Branch (9804:6): [True: 45.1k, False: 1.31M]
  |  |  ------------------
  ------------------
10154|       |
10155|  1.37M|                            } else if ((cur->ns != NULL) &&
  ------------------
  |  Branch (10155:40): [True: 2.36k, False: 12.6k]
  ------------------
10156|  2.36k|				(xmlStrEqual(URI, cur->ns->href)))
  ------------------
  |  Branch (10156:5): [True: 1.21k, False: 1.14k]
  ------------------
10157|  1.21k|			    {
10158|  1.21k|				XP_TEST_HIT
  ------------------
  |  | 9796|  1.21k|    if (hasAxisRange != 0) { \
  |  |  ------------------
  |  |  |  Branch (9796:9): [True: 337, False: 879]
  |  |  ------------------
  |  | 9797|    337|	if (++pos == maxPos) { \
  |  |  ------------------
  |  |  |  Branch (9797:6): [True: 71, False: 266]
  |  |  ------------------
  |  | 9798|     71|	    if (addNode(seq, cur) < 0) \
  |  |  ------------------
  |  |  |  Branch (9798:10): [True: 1, False: 70]
  |  |  ------------------
  |  | 9799|     71|	        xmlXPathPErrMemory(ctxt); \
  |  | 9800|     71|	    goto axis_range_end; } \
  |  | 9801|    879|    } else { \
  |  | 9802|    879|	if (addNode(seq, cur) < 0) \
  |  |  ------------------
  |  |  |  Branch (9802:6): [True: 2, False: 877]
  |  |  ------------------
  |  | 9803|    879|	    xmlXPathPErrMemory(ctxt); \
  |  | 9804|    879|	if (breakOnFirstHit) goto first_hit; }
  |  |  ------------------
  |  |  |  Branch (9804:6): [True: 479, False: 400]
  |  |  ------------------
  ------------------
10159|  1.21k|                            }
10160|  1.39M|                        }
10161|  1.50M|                    }
10162|  1.52M|                    break;
10163|  1.52M|                case NODE_TEST_NS:{
  ------------------
  |  Branch (10163:17): [True: 0, False: 7.04M]
  ------------------
10164|       |                        /* TODO */
10165|      0|                        break;
10166|  1.59M|                    }
10167|  1.91M|                case NODE_TEST_NAME:
  ------------------
  |  Branch (10167:17): [True: 1.91M, False: 5.13M]
  ------------------
10168|  1.91M|                    if (axis == AXIS_ATTRIBUTE) {
  ------------------
  |  Branch (10168:25): [True: 3.77k, False: 1.91M]
  ------------------
10169|  3.77k|                        if (cur->type != XML_ATTRIBUTE_NODE)
  ------------------
  |  Branch (10169:29): [True: 0, False: 3.77k]
  ------------------
10170|      0|			    break;
10171|  1.91M|		    } else if (axis == AXIS_NAMESPACE) {
  ------------------
  |  Branch (10171:18): [True: 5.44k, False: 1.90M]
  ------------------
10172|  5.44k|                        if (cur->type != XML_NAMESPACE_DECL)
  ------------------
  |  Branch (10172:29): [True: 0, False: 5.44k]
  ------------------
10173|      0|			    break;
10174|  1.90M|		    } else {
10175|  1.90M|		        if (cur->type != XML_ELEMENT_NODE)
  ------------------
  |  Branch (10175:15): [True: 338k, False: 1.56M]
  ------------------
10176|   338k|			    break;
10177|  1.90M|		    }
10178|  1.57M|                    switch (cur->type) {
10179|  1.56M|                        case XML_ELEMENT_NODE:
  ------------------
  |  Branch (10179:25): [True: 1.56M, False: 9.21k]
  ------------------
10180|  1.56M|                            if (xmlStrEqual(name, cur->name)) {
  ------------------
  |  Branch (10180:33): [True: 349k, False: 1.22M]
  ------------------
10181|   349k|                                if (prefix == NULL) {
  ------------------
  |  Branch (10181:37): [True: 345k, False: 3.95k]
  ------------------
10182|   345k|                                    if (cur->ns == NULL)
  ------------------
  |  Branch (10182:41): [True: 345k, False: 573]
  ------------------
10183|   345k|				    {
10184|   345k|					XP_TEST_HIT
  ------------------
  |  | 9796|   345k|    if (hasAxisRange != 0) { \
  |  |  ------------------
  |  |  |  Branch (9796:9): [True: 17.8k, False: 327k]
  |  |  ------------------
  |  | 9797|  17.8k|	if (++pos == maxPos) { \
  |  |  ------------------
  |  |  |  Branch (9797:6): [True: 7.04k, False: 10.8k]
  |  |  ------------------
  |  | 9798|  7.04k|	    if (addNode(seq, cur) < 0) \
  |  |  ------------------
  |  |  |  Branch (9798:10): [True: 1, False: 7.04k]
  |  |  ------------------
  |  | 9799|  7.04k|	        xmlXPathPErrMemory(ctxt); \
  |  | 9800|  7.04k|	    goto axis_range_end; } \
  |  | 9801|   327k|    } else { \
  |  | 9802|   327k|	if (addNode(seq, cur) < 0) \
  |  |  ------------------
  |  |  |  Branch (9802:6): [True: 12, False: 327k]
  |  |  ------------------
  |  | 9803|   327k|	    xmlXPathPErrMemory(ctxt); \
  |  | 9804|   327k|	if (breakOnFirstHit) goto first_hit; }
  |  |  ------------------
  |  |  |  Branch (9804:6): [True: 151, False: 327k]
  |  |  ------------------
  ------------------
10185|   345k|                                    }
10186|   345k|                                } else {
10187|  3.95k|                                    if ((cur->ns != NULL) &&
  ------------------
  |  Branch (10187:41): [True: 309, False: 3.64k]
  ------------------
10188|    309|                                        (xmlStrEqual(URI, cur->ns->href)))
  ------------------
  |  Branch (10188:41): [True: 78, False: 231]
  ------------------
10189|     78|				    {
10190|     78|					XP_TEST_HIT
  ------------------
  |  | 9796|     78|    if (hasAxisRange != 0) { \
  |  |  ------------------
  |  |  |  Branch (9796:9): [True: 0, False: 78]
  |  |  ------------------
  |  | 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|     78|    } else { \
  |  | 9802|     78|	if (addNode(seq, cur) < 0) \
  |  |  ------------------
  |  |  |  Branch (9802:6): [True: 1, False: 77]
  |  |  ------------------
  |  | 9803|     78|	    xmlXPathPErrMemory(ctxt); \
  |  | 9804|     78|	if (breakOnFirstHit) goto first_hit; }
  |  |  ------------------
  |  |  |  Branch (9804:6): [True: 0, False: 78]
  |  |  ------------------
  ------------------
10191|     78|                                    }
10192|  3.95k|                                }
10193|   349k|                            }
10194|  1.56M|                            break;
10195|  1.56M|                        case XML_ATTRIBUTE_NODE:{
  ------------------
  |  Branch (10195:25): [True: 3.77k, False: 1.57M]
  ------------------
10196|  3.77k|                                xmlAttrPtr attr = (xmlAttrPtr) cur;
10197|       |
10198|  3.77k|                                if (xmlStrEqual(name, attr->name)) {
  ------------------
  |  Branch (10198:37): [True: 2.66k, False: 1.10k]
  ------------------
10199|  2.66k|                                    if (prefix == NULL) {
  ------------------
  |  Branch (10199:41): [True: 2.59k, False: 76]
  ------------------
10200|  2.59k|                                        if ((attr->ns == NULL) ||
  ------------------
  |  Branch (10200:45): [True: 2.52k, False: 67]
  ------------------
10201|     67|                                            (attr->ns->prefix == NULL))
  ------------------
  |  Branch (10201:45): [True: 0, False: 67]
  ------------------
10202|  2.52k|					{
10203|  2.52k|					    XP_TEST_HIT
  ------------------
  |  | 9796|  2.52k|    if (hasAxisRange != 0) { \
  |  |  ------------------
  |  |  |  Branch (9796:9): [True: 2.02k, False: 498]
  |  |  ------------------
  |  | 9797|  2.02k|	if (++pos == maxPos) { \
  |  |  ------------------
  |  |  |  Branch (9797:6): [True: 856, False: 1.17k]
  |  |  ------------------
  |  | 9798|    856|	    if (addNode(seq, cur) < 0) \
  |  |  ------------------
  |  |  |  Branch (9798:10): [True: 1, False: 855]
  |  |  ------------------
  |  | 9799|    856|	        xmlXPathPErrMemory(ctxt); \
  |  | 9800|    856|	    goto axis_range_end; } \
  |  | 9801|  2.02k|    } else { \
  |  | 9802|    498|	if (addNode(seq, cur) < 0) \
  |  |  ------------------
  |  |  |  Branch (9802:6): [True: 2, False: 496]
  |  |  ------------------
  |  | 9803|    498|	    xmlXPathPErrMemory(ctxt); \
  |  | 9804|    498|	if (breakOnFirstHit) goto first_hit; }
  |  |  ------------------
  |  |  |  Branch (9804:6): [True: 74, False: 424]
  |  |  ------------------
  ------------------
10204|  2.52k|                                        }
10205|  2.59k|                                    } else {
10206|     76|                                        if ((attr->ns != NULL) &&
  ------------------
  |  Branch (10206:45): [True: 2, False: 74]
  ------------------
10207|      2|                                            (xmlStrEqual(URI,
  ------------------
  |  Branch (10207:45): [True: 2, False: 0]
  ------------------
10208|      2|					      attr->ns->href)))
10209|      2|					{
10210|      2|					    XP_TEST_HIT
  ------------------
  |  | 9796|      2|    if (hasAxisRange != 0) { \
  |  |  ------------------
  |  |  |  Branch (9796:9): [True: 0, False: 2]
  |  |  ------------------
  |  | 9797|      0|	if (++pos == maxPos) { \
  |  |  ------------------
  |  |  |  Branch (9797:6): [True: 0, False: 0]
  |  |  ------------------
  |  | 9798|      0|	    if (addNode(seq, cur) < 0) \
  |  |  ------------------
  |  |  |  Branch (9798:10): [True: 0, False: 0]
  |  |  ------------------
  |  | 9799|      0|	        xmlXPathPErrMemory(ctxt); \
  |  | 9800|      0|	    goto axis_range_end; } \
  |  | 9801|      2|    } else { \
  |  | 9802|      2|	if (addNode(seq, cur) < 0) \
  |  |  ------------------
  |  |  |  Branch (9802:6): [True: 1, False: 1]
  |  |  ------------------
  |  | 9803|      2|	    xmlXPathPErrMemory(ctxt); \
  |  | 9804|      2|	if (breakOnFirstHit) goto first_hit; }
  |  |  ------------------
  |  |  |  Branch (9804:6): [True: 0, False: 2]
  |  |  ------------------
  ------------------
10211|      2|                                        }
10212|     76|                                    }
10213|  2.66k|                                }
10214|  2.84k|                                break;
10215|  3.77k|                            }
10216|  5.44k|                        case XML_NAMESPACE_DECL:
  ------------------
  |  Branch (10216:25): [True: 5.44k, False: 1.57M]
  ------------------
10217|  5.44k|                            if (cur->type == XML_NAMESPACE_DECL) {
  ------------------
  |  Branch (10217:33): [True: 5.44k, False: 0]
  ------------------
10218|  5.44k|                                xmlNsPtr ns = (xmlNsPtr) cur;
10219|       |
10220|  5.44k|                                if ((ns->prefix != NULL) && (name != NULL)
  ------------------
  |  Branch (10220:37): [True: 4.66k, False: 779]
  |  Branch (10220:61): [True: 4.66k, False: 0]
  ------------------
10221|  4.66k|                                    && (xmlStrEqual(ns->prefix, name)))
  ------------------
  |  Branch (10221:40): [True: 1.06k, False: 3.60k]
  ------------------
10222|  1.06k|				{
10223|  1.06k|				    XP_TEST_HIT_NS
  ------------------
  |  | 9807|  1.06k|    if (hasAxisRange != 0) { \
  |  |  ------------------
  |  |  |  Branch (9807:9): [True: 226, False: 837]
  |  |  ------------------
  |  | 9808|    226|	if (++pos == maxPos) { \
  |  |  ------------------
  |  |  |  Branch (9808:6): [True: 142, False: 84]
  |  |  ------------------
  |  | 9809|    142|	    hasNsNodes = 1; \
  |  | 9810|    142|	    if (xmlXPathNodeSetAddNs(seq, xpctxt->node, (xmlNsPtr) cur) < 0) \
  |  |  ------------------
  |  |  |  Branch (9810:10): [True: 1, False: 141]
  |  |  ------------------
  |  | 9811|    142|	        xmlXPathPErrMemory(ctxt); \
  |  | 9812|    142|	goto axis_range_end; } \
  |  | 9813|    837|    } else { \
  |  | 9814|    837|	hasNsNodes = 1; \
  |  | 9815|    837|	if (xmlXPathNodeSetAddNs(seq, xpctxt->node, (xmlNsPtr) cur) < 0) \
  |  |  ------------------
  |  |  |  Branch (9815:6): [True: 2, False: 835]
  |  |  ------------------
  |  | 9816|    837|	    xmlXPathPErrMemory(ctxt); \
  |  | 9817|    837|	if (breakOnFirstHit) goto first_hit; }
  |  |  ------------------
  |  |  |  Branch (9817:6): [True: 0, False: 837]
  |  |  ------------------
  ------------------
10224|  1.06k|                                }
10225|  5.44k|                            }
10226|  5.30k|                            break;
10227|  5.30k|                        default:
  ------------------
  |  Branch (10227:25): [True: 0, False: 1.57M]
  ------------------
10228|      0|                            break;
10229|  1.57M|                    }
10230|  1.57M|                    break;
10231|  7.04M|	    } /* switch(test) */
10232|  7.04M|        } while ((cur != NULL) && (ctxt->error == XPATH_EXPRESSION_OK));
  ------------------
  |  Branch (10232:18): [True: 6.97M, False: 0]
  |  Branch (10232:35): [True: 6.97M, False: 160]
  ------------------
10233|       |
10234|  2.25M|	goto apply_predicates;
10235|       |
10236|  2.25M|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|  27.0k|	if (outSeq == NULL) {
  ------------------
  |  Branch (10243:6): [True: 20.5k, False: 6.47k]
  ------------------
10244|  20.5k|	    outSeq = seq;
10245|  20.5k|	    seq = NULL;
10246|  20.5k|	} else {
10247|  6.47k|	    outSeq = mergeAndClear(outSeq, seq);
10248|  6.47k|            if (outSeq == NULL)
  ------------------
  |  Branch (10248:17): [True: 5, False: 6.46k]
  ------------------
10249|      5|                xmlXPathPErrMemory(ctxt);
10250|  6.47k|        }
10251|       |	/*
10252|       |	* Break if only a true/false result was requested.
10253|       |	*/
10254|  27.0k|	if (toBool)
  ------------------
  |  Branch (10254:6): [True: 16.5k, False: 10.4k]
  ------------------
10255|  16.5k|	    break;
10256|  10.4k|	continue;
10257|       |
10258|  50.4k|first_hit: /* ---------------------------------------------------------- */
10259|       |	/*
10260|       |	* Break if only a true/false result was requested and
10261|       |	* no predicates existed and a node test succeeded.
10262|       |	*/
10263|  50.4k|	if (outSeq == NULL) {
  ------------------
  |  Branch (10263:6): [True: 50.4k, False: 0]
  ------------------
10264|  50.4k|	    outSeq = seq;
10265|  50.4k|	    seq = NULL;
10266|  50.4k|	} else {
10267|      0|	    outSeq = mergeAndClear(outSeq, seq);
10268|      0|            if (outSeq == NULL)
  ------------------
  |  Branch (10268:17): [True: 0, False: 0]
  ------------------
10269|      0|                xmlXPathPErrMemory(ctxt);
10270|      0|        }
10271|  50.4k|	break;
10272|       |
10273|  2.25M|apply_predicates: /* --------------------------------------------------- */
10274|  2.25M|        if (ctxt->error != XPATH_EXPRESSION_OK)
  ------------------
  |  Branch (10274:13): [True: 169, False: 2.25M]
  ------------------
10275|    169|	    goto error;
10276|       |
10277|       |        /*
10278|       |	* Apply predicates.
10279|       |	*/
10280|  2.25M|        if ((predOp != NULL) && (seq->nodeNr > 0)) {
  ------------------
  |  Branch (10280:13): [True: 604k, False: 1.64M]
  |  Branch (10280:33): [True: 125k, False: 479k]
  ------------------
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|   125k|	    if (hasPredicateRange != 0)
  ------------------
  |  Branch (10309:10): [True: 11.3k, False: 113k]
  ------------------
10310|  11.3k|		xmlXPathCompOpEvalPredicate(ctxt, predOp, seq, maxPos, maxPos,
10311|  11.3k|					    hasNsNodes);
10312|   113k|	    else
10313|   113k|		xmlXPathCompOpEvalPredicate(ctxt, predOp, seq, 1, seq->nodeNr,
10314|   113k|					    hasNsNodes);
10315|       |
10316|   125k|	    if (ctxt->error != XPATH_EXPRESSION_OK) {
  ------------------
  |  Branch (10316:10): [True: 1.64k, False: 123k]
  ------------------
10317|  1.64k|		total = 0;
10318|  1.64k|		goto error;
10319|  1.64k|	    }
10320|   125k|        }
10321|       |
10322|  2.25M|        if (seq->nodeNr > 0) {
  ------------------
  |  Branch (10322:13): [True: 551k, False: 1.70M]
  ------------------
10323|       |	    /*
10324|       |	    * Add to result set.
10325|       |	    */
10326|   551k|	    if (outSeq == NULL) {
  ------------------
  |  Branch (10326:10): [True: 235k, False: 316k]
  ------------------
10327|   235k|		outSeq = seq;
10328|   235k|		seq = NULL;
10329|   316k|	    } else {
10330|   316k|		outSeq = mergeAndClear(outSeq, seq);
10331|   316k|                if (outSeq == NULL)
  ------------------
  |  Branch (10331:21): [True: 85, False: 315k]
  ------------------
10332|     85|                    xmlXPathPErrMemory(ctxt);
10333|   316k|	    }
10334|       |
10335|   551k|            if (toBool)
  ------------------
  |  Branch (10335:17): [True: 16.3k, False: 535k]
  ------------------
10336|  16.3k|                break;
10337|   551k|	}
10338|  2.25M|    }
10339|       |
10340|  1.04M|error:
10341|  1.04M|    if ((obj->boolval) && (obj->user != NULL)) {
  ------------------
  |  Branch (10341:9): [True: 0, False: 1.04M]
  |  Branch (10341:27): [True: 0, False: 0]
  ------------------
10342|       |	/*
10343|       |	* QUESTION TODO: What does this do and why?
10344|       |	* TODO: Do we have to do this also for the "error"
10345|       |	* cleanup further down?
10346|       |	*/
10347|      0|	ctxt->value->boolval = 1;
10348|      0|	ctxt->value->user = obj->user;
10349|      0|	obj->user = NULL;
10350|      0|	obj->boolval = 0;
10351|      0|    }
10352|  1.04M|    xmlXPathReleaseObject(xpctxt, obj);
10353|       |
10354|       |    /*
10355|       |    * Ensure we return at least an empty set.
10356|       |    */
10357|  1.04M|    if (outSeq == NULL) {
  ------------------
  |  Branch (10357:9): [True: 743k, False: 306k]
  ------------------
10358|   743k|	if ((seq != NULL) && (seq->nodeNr == 0)) {
  ------------------
  |  Branch (10358:6): [True: 742k, False: 119]
  |  Branch (10358:23): [True: 742k, False: 130]
  ------------------
10359|   742k|	    outSeq = seq;
10360|   742k|        } else {
10361|    249|	    outSeq = xmlXPathNodeSetCreate(NULL);
10362|    249|            if (outSeq == NULL)
  ------------------
  |  Branch (10362:17): [True: 1, False: 248]
  ------------------
10363|      1|                xmlXPathPErrMemory(ctxt);
10364|    249|        }
10365|   743k|    }
10366|  1.04M|    if ((seq != NULL) && (seq != outSeq)) {
  ------------------
  |  Branch (10366:9): [True: 764k, False: 285k]
  |  Branch (10366:26): [True: 21.4k, False: 742k]
  ------------------
10367|  21.4k|	 xmlXPathFreeNodeSet(seq);
10368|  21.4k|    }
10369|       |    /*
10370|       |    * Hand over the result. Better to push the set also in
10371|       |    * case of errors.
10372|       |    */
10373|  1.04M|    xmlXPathValuePush(ctxt, xmlXPathCacheWrapNodeSet(ctxt, outSeq));
10374|       |    /*
10375|       |    * Reset the context node.
10376|       |    */
10377|  1.04M|    xpctxt->node = oldContextNode;
10378|       |    /*
10379|       |    * When traversing the namespace axis in "toBool" mode, it's
10380|       |    * possible that tmpNsList wasn't freed.
10381|       |    */
10382|  1.04M|    if (xpctxt->tmpNsList != NULL) {
  ------------------
  |  Branch (10382:9): [True: 174, False: 1.04M]
  ------------------
10383|    174|        xmlFree(xpctxt->tmpNsList);
10384|    174|        xpctxt->tmpNsList = NULL;
10385|    174|    }
10386|       |
10387|  1.04M|    return(total);
10388|  1.04M|}
xpath.c:xmlXPathNodeSetMergeAndClear:
 2958|   195k|{
 2959|   195k|    {
 2960|   195k|	int i, j, initNbSet1;
 2961|   195k|	xmlNodePtr n1, n2;
 2962|       |
 2963|   195k|	initNbSet1 = set1->nodeNr;
 2964|   564k|	for (i = 0;i < set2->nodeNr;i++) {
  ------------------
  |  Branch (2964:13): [True: 369k, False: 195k]
  ------------------
 2965|   369k|	    n2 = set2->nodeTab[i];
 2966|       |	    /*
 2967|       |	    * Skip duplicates.
 2968|       |	    */
 2969|  18.4M|	    for (j = 0; j < initNbSet1; j++) {
  ------------------
  |  Branch (2969:18): [True: 18.3M, False: 113k]
  ------------------
 2970|  18.3M|		n1 = set1->nodeTab[j];
 2971|  18.3M|		if (n1 == n2) {
  ------------------
  |  Branch (2971:7): [True: 255k, False: 18.0M]
  ------------------
 2972|   255k|		    goto skip_node;
 2973|  18.0M|		} else if ((n1->type == XML_NAMESPACE_DECL) &&
  ------------------
  |  Branch (2973:14): [True: 3.29M, False: 14.7M]
  ------------------
 2974|  3.29M|		    (n2->type == XML_NAMESPACE_DECL))
  ------------------
  |  Branch (2974:7): [True: 3.29M, False: 0]
  ------------------
 2975|  3.29M|		{
 2976|  3.29M|		    if ((((xmlNsPtr) n1)->next == ((xmlNsPtr) n2)->next) &&
  ------------------
  |  Branch (2976:11): [True: 35.0k, False: 3.26M]
  ------------------
 2977|  35.0k|			(xmlStrEqual(((xmlNsPtr) n1)->prefix,
  ------------------
  |  Branch (2977:4): [True: 0, False: 35.0k]
  ------------------
 2978|  35.0k|			((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|  3.29M|		}
 2987|  18.3M|	    }
 2988|       |	    /*
 2989|       |	    * grow the nodeTab if needed
 2990|       |	    */
 2991|   113k|            if (set1->nodeNr >= set1->nodeMax) {
  ------------------
  |  Branch (2991:17): [True: 18.2k, False: 95.6k]
  ------------------
 2992|  18.2k|                if (xmlXPathNodeSetGrow(set1) < 0)
  ------------------
  |  Branch (2992:21): [True: 42, False: 18.1k]
  ------------------
 2993|     42|                    goto error;
 2994|  18.2k|            }
 2995|   113k|	    set1->nodeTab[set1->nodeNr++] = n2;
 2996|   369k|skip_node:
 2997|   369k|            set2->nodeTab[i] = NULL;
 2998|   369k|	}
 2999|   195k|    }
 3000|   195k|    set2->nodeNr = 0;
 3001|   195k|    return(set1);
 3002|       |
 3003|     42|error:
 3004|     42|    xmlXPathFreeNodeSet(set1);
 3005|     42|    xmlXPathNodeSetClear(set2, 1);
 3006|       |    return(NULL);
 3007|   195k|}
xpath.c:xmlXPathNodeSetClear:
 3154|  2.86k|{
 3155|  2.86k|    xmlXPathNodeSetClearFromPos(set, 0, hasNsNodes);
 3156|  2.86k|}
xpath.c:xmlXPathNodeSetClearFromPos:
 3127|  3.13k|{
 3128|  3.13k|    if ((set == NULL) || (pos >= set->nodeNr))
  ------------------
  |  Branch (3128:9): [True: 0, False: 3.13k]
  |  Branch (3128:26): [True: 0, False: 3.13k]
  ------------------
 3129|      0|	return;
 3130|  3.13k|    else if ((hasNsNodes)) {
  ------------------
  |  Branch (3130:14): [True: 357, False: 2.77k]
  ------------------
 3131|    357|	int i;
 3132|    357|	xmlNodePtr node;
 3133|       |
 3134|  3.51k|	for (i = pos; i < set->nodeNr; i++) {
  ------------------
  |  Branch (3134:16): [True: 3.15k, False: 357]
  ------------------
 3135|  3.15k|	    node = set->nodeTab[i];
 3136|  3.15k|	    if ((node != NULL) &&
  ------------------
  |  Branch (3136:10): [True: 2.46k, False: 687]
  ------------------
 3137|  2.46k|		(node->type == XML_NAMESPACE_DECL))
  ------------------
  |  Branch (3137:3): [True: 43, False: 2.42k]
  ------------------
 3138|     43|		xmlXPathNodeSetFreeNs((xmlNsPtr) node);
 3139|  3.15k|	}
 3140|    357|    }
 3141|  3.13k|    set->nodeNr = pos;
 3142|  3.13k|}
xpath.c:xmlXPathNodeSetMergeAndClearNoDupls:
 3021|   127k|{
 3022|   127k|    {
 3023|   127k|	int i;
 3024|   127k|	xmlNodePtr n2;
 3025|       |
 3026|   392k|	for (i = 0;i < set2->nodeNr;i++) {
  ------------------
  |  Branch (3026:13): [True: 265k, False: 126k]
  ------------------
 3027|   265k|	    n2 = set2->nodeTab[i];
 3028|   265k|            if (set1->nodeNr >= set1->nodeMax) {
  ------------------
  |  Branch (3028:17): [True: 39.8k, False: 225k]
  ------------------
 3029|  39.8k|                if (xmlXPathNodeSetGrow(set1) < 0)
  ------------------
  |  Branch (3029:21): [True: 48, False: 39.8k]
  ------------------
 3030|     48|                    goto error;
 3031|  39.8k|            }
 3032|   265k|	    set1->nodeTab[set1->nodeNr++] = n2;
 3033|   265k|            set2->nodeTab[i] = NULL;
 3034|   265k|	}
 3035|   127k|    }
 3036|   126k|    set2->nodeNr = 0;
 3037|   126k|    return(set1);
 3038|       |
 3039|     48|error:
 3040|     48|    xmlXPathFreeNodeSet(set1);
 3041|     48|    xmlXPathNodeSetClear(set2, 1);
 3042|       |    return(NULL);
 3043|   127k|}
xpath.c:xmlXPathNextChildElement:
 6200|  3.01M|xmlXPathNextChildElement(xmlXPathParserContextPtr ctxt, xmlNodePtr cur) {
 6201|  3.01M|    if ((ctxt == NULL) || (ctxt->context == NULL)) return(NULL);
  ------------------
  |  Branch (6201:9): [True: 0, False: 3.01M]
  |  Branch (6201:27): [True: 0, False: 3.01M]
  ------------------
 6202|  3.01M|    if (cur == NULL) {
  ------------------
  |  Branch (6202:9): [True: 1.53M, False: 1.48M]
  ------------------
 6203|  1.53M|	cur = ctxt->context->node;
 6204|  1.53M|	if (cur == NULL) return(NULL);
  ------------------
  |  Branch (6204:6): [True: 0, False: 1.53M]
  ------------------
 6205|       |	/*
 6206|       |	* Get the first element child.
 6207|       |	*/
 6208|  1.53M|	switch (cur->type) {
 6209|  1.17M|            case XML_ELEMENT_NODE:
  ------------------
  |  Branch (6209:13): [True: 1.17M, False: 364k]
  ------------------
 6210|  1.17M|	    case XML_DOCUMENT_FRAG_NODE:
  ------------------
  |  Branch (6210:6): [True: 0, False: 1.53M]
  ------------------
 6211|  1.17M|	    case XML_ENTITY_REF_NODE: /* URGENT TODO: entify-refs as well? */
  ------------------
  |  Branch (6211:6): [True: 0, False: 1.53M]
  ------------------
 6212|  1.17M|            case XML_ENTITY_NODE:
  ------------------
  |  Branch (6212:13): [True: 0, False: 1.53M]
  ------------------
 6213|  1.17M|		cur = cur->children;
 6214|  1.17M|		if (cur != NULL) {
  ------------------
  |  Branch (6214:7): [True: 408k, False: 764k]
  ------------------
 6215|   408k|		    if (cur->type == XML_ELEMENT_NODE)
  ------------------
  |  Branch (6215:11): [True: 203k, False: 204k]
  ------------------
 6216|   203k|			return(cur);
 6217|   215k|		    do {
 6218|   215k|			cur = cur->next;
 6219|   215k|		    } while ((cur != NULL) &&
  ------------------
  |  Branch (6219:16): [True: 130k, False: 84.9k]
  ------------------
 6220|   130k|			(cur->type != XML_ELEMENT_NODE));
  ------------------
  |  Branch (6220:4): [True: 10.5k, False: 120k]
  ------------------
 6221|   204k|		    return(cur);
 6222|   408k|		}
 6223|   764k|		return(NULL);
 6224|   184k|            case XML_DOCUMENT_NODE:
  ------------------
  |  Branch (6224:13): [True: 184k, False: 1.35M]
  ------------------
 6225|   184k|            case XML_HTML_DOCUMENT_NODE:
  ------------------
  |  Branch (6225:13): [True: 0, False: 1.53M]
  ------------------
 6226|   184k|		return(xmlDocGetRootElement((xmlDocPtr) cur));
 6227|   179k|	    default:
  ------------------
  |  Branch (6227:6): [True: 179k, False: 1.35M]
  ------------------
 6228|   179k|		return(NULL);
 6229|  1.53M|	}
 6230|      0|	return(NULL);
 6231|  1.53M|    }
 6232|       |    /*
 6233|       |    * Get the next sibling element node.
 6234|       |    */
 6235|  1.48M|    switch (cur->type) {
 6236|  1.48M|	case XML_ELEMENT_NODE:
  ------------------
  |  Branch (6236:2): [True: 1.48M, False: 0]
  ------------------
 6237|  1.48M|	case XML_TEXT_NODE:
  ------------------
  |  Branch (6237:2): [True: 0, False: 1.48M]
  ------------------
 6238|  1.48M|	case XML_ENTITY_REF_NODE:
  ------------------
  |  Branch (6238:2): [True: 0, False: 1.48M]
  ------------------
 6239|  1.48M|	case XML_ENTITY_NODE:
  ------------------
  |  Branch (6239:2): [True: 0, False: 1.48M]
  ------------------
 6240|  1.48M|	case XML_CDATA_SECTION_NODE:
  ------------------
  |  Branch (6240:2): [True: 0, False: 1.48M]
  ------------------
 6241|  1.48M|	case XML_PI_NODE:
  ------------------
  |  Branch (6241:2): [True: 0, False: 1.48M]
  ------------------
 6242|  1.48M|	case XML_COMMENT_NODE:
  ------------------
  |  Branch (6242:2): [True: 0, False: 1.48M]
  ------------------
 6243|  1.48M|	case XML_XINCLUDE_END:
  ------------------
  |  Branch (6243:2): [True: 0, False: 1.48M]
  ------------------
 6244|  1.48M|	    break;
 6245|       |	/* case XML_DTD_NODE: */ /* URGENT TODO: DTD-node as well? */
 6246|      0|	default:
  ------------------
  |  Branch (6246:2): [True: 0, False: 1.48M]
  ------------------
 6247|      0|	    return(NULL);
 6248|  1.48M|    }
 6249|  1.48M|    if (cur->next != NULL) {
  ------------------
  |  Branch (6249:9): [True: 1.09M, False: 383k]
  ------------------
 6250|  1.09M|	if (cur->next->type == XML_ELEMENT_NODE)
  ------------------
  |  Branch (6250:6): [True: 918k, False: 179k]
  ------------------
 6251|   918k|	    return(cur->next);
 6252|   179k|	cur = cur->next;
 6253|   188k|	do {
 6254|   188k|	    cur = cur->next;
 6255|   188k|	} while ((cur != NULL) && (cur->type != XML_ELEMENT_NODE));
  ------------------
  |  Branch (6255:11): [True: 90.5k, False: 97.8k]
  |  Branch (6255:28): [True: 8.42k, False: 82.0k]
  ------------------
 6256|   179k|	return(cur);
 6257|  1.09M|    }
 6258|   383k|    return(NULL);
 6259|  1.48M|}
xpath.c:xmlXPathNextPrecedingInternal:
 6756|  34.7k|{
 6757|  34.7k|    if ((ctxt == NULL) || (ctxt->context == NULL)) return(NULL);
  ------------------
  |  Branch (6757:9): [True: 0, False: 34.7k]
  |  Branch (6757:27): [True: 0, False: 34.7k]
  ------------------
 6758|  34.7k|    if (cur == NULL) {
  ------------------
  |  Branch (6758:9): [True: 1.51k, False: 33.2k]
  ------------------
 6759|  1.51k|        cur = ctxt->context->node;
 6760|  1.51k|        if (cur == NULL)
  ------------------
  |  Branch (6760:13): [True: 0, False: 1.51k]
  ------------------
 6761|      0|            return (NULL);
 6762|  1.51k|        if (cur->type == XML_ATTRIBUTE_NODE) {
  ------------------
  |  Branch (6762:13): [True: 0, False: 1.51k]
  ------------------
 6763|      0|            cur = cur->parent;
 6764|  1.51k|        } else if (cur->type == XML_NAMESPACE_DECL) {
  ------------------
  |  Branch (6764:20): [True: 0, False: 1.51k]
  ------------------
 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|  1.51k|        ctxt->ancestor = cur->parent;
 6773|  1.51k|    }
 6774|       |
 6775|  34.7k|    if (cur->type == XML_NAMESPACE_DECL || cur->type == XML_DOCUMENT_NODE)
  ------------------
  |  Branch (6775:9): [True: 0, False: 34.7k]
  |  Branch (6775:44): [True: 64, False: 34.6k]
  ------------------
 6776|     64|        return(NULL);
 6777|       |
 6778|  34.6k|    if ((cur->prev != NULL) && (cur->prev->type == XML_DTD_NODE))
  ------------------
  |  Branch (6778:9): [True: 16.3k, False: 18.3k]
  |  Branch (6778:32): [True: 513, False: 15.8k]
  ------------------
 6779|    513|	cur = cur->prev;
 6780|       |
 6781|  38.3k|    while (cur->prev == NULL) {
  ------------------
  |  Branch (6781:12): [True: 20.8k, False: 17.4k]
  ------------------
 6782|  20.8k|        cur = cur->parent;
 6783|  20.8k|        if (cur == NULL)
  ------------------
  |  Branch (6783:13): [True: 721, False: 20.1k]
  ------------------
 6784|    721|            return (NULL);
 6785|  20.1k|        if (cur == ctxt->context->doc->children)
  ------------------
  |  Branch (6785:13): [True: 733, False: 19.4k]
  ------------------
 6786|    733|            return (NULL);
 6787|  19.4k|        if (cur != ctxt->ancestor)
  ------------------
  |  Branch (6787:13): [True: 15.7k, False: 3.70k]
  ------------------
 6788|  15.7k|            return (cur);
 6789|  3.70k|        ctxt->ancestor = cur->parent;
 6790|  3.70k|    }
 6791|       |
 6792|  17.4k|    if (cur->type == XML_DOCUMENT_NODE)
  ------------------
  |  Branch (6792:9): [True: 0, False: 17.4k]
  ------------------
 6793|      0|        return(NULL);
 6794|       |
 6795|  17.4k|    cur = cur->prev;
 6796|  33.2k|    while (cur->last != NULL)
  ------------------
  |  Branch (6796:12): [True: 15.7k, False: 17.4k]
  ------------------
 6797|  15.7k|        cur = cur->last;
 6798|  17.4k|    return (cur);
 6799|  17.4k|}
xpath.c:xmlXPathIsPositionalPredicate:
 9736|   118k|{
 9737|       |
 9738|   118k|    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|   118k|    if ((op->op != XPATH_OP_PREDICATE) && (op->op != XPATH_OP_FILTER))
  ------------------
  |  Branch (9753:9): [True: 0, False: 118k]
  |  Branch (9753:43): [True: 0, False: 0]
  ------------------
 9754|      0|	return(0);
 9755|       |
 9756|   118k|    if (op->ch2 != -1) {
  ------------------
  |  Branch (9756:9): [True: 118k, False: 0]
  ------------------
 9757|   118k|	exprOp = &ctxt->comp->steps[op->ch2];
 9758|   118k|    } else
 9759|      0|	return(0);
 9760|       |
 9761|   118k|    if ((exprOp != NULL) &&
  ------------------
  |  Branch (9761:9): [True: 118k, False: 0]
  ------------------
 9762|   118k|	(exprOp->op == XPATH_OP_VALUE) &&
  ------------------
  |  Branch (9762:2): [True: 61.6k, False: 56.8k]
  ------------------
 9763|  61.6k|	(exprOp->value4 != NULL) &&
  ------------------
  |  Branch (9763:2): [True: 61.6k, False: 0]
  ------------------
 9764|  61.6k|	(((xmlXPathObjectPtr) exprOp->value4)->type == XPATH_NUMBER))
  ------------------
  |  Branch (9764:2): [True: 61.0k, False: 567]
  ------------------
 9765|  61.0k|    {
 9766|  61.0k|        double floatval = ((xmlXPathObjectPtr) exprOp->value4)->floatval;
 9767|       |
 9768|       |	/*
 9769|       |	* We have a "[n]" predicate here.
 9770|       |	* TODO: Unfortunately this simplistic test here is not
 9771|       |	* able to detect a position() predicate in compound
 9772|       |	* expressions like "[@attr = 'a" and position() = 1],
 9773|       |	* and even not the usage of position() in
 9774|       |	* "[position() = 1]"; thus - obviously - a position-range,
 9775|       |	* like it "[position() < 5]", is also not detected.
 9776|       |	* Maybe we could rewrite the AST to ease the optimization.
 9777|       |	*/
 9778|       |
 9779|  61.0k|        if ((floatval > INT_MIN) && (floatval < INT_MAX)) {
  ------------------
  |  Branch (9779:13): [True: 61.0k, False: 37]
  |  Branch (9779:37): [True: 60.8k, False: 138]
  ------------------
 9780|  60.8k|	    *maxPos = (int) floatval;
 9781|  60.8k|            if (floatval == (double) *maxPos)
  ------------------
  |  Branch (9781:17): [True: 60.6k, False: 222]
  ------------------
 9782|  60.6k|                return(1);
 9783|  60.8k|        }
 9784|  61.0k|    }
 9785|  57.8k|    return(0);
 9786|   118k|}
xpath.c:xmlXPathCompOpEvalPredicate:
 9710|   127k|{
 9711|   127k|    if (op->ch1 != -1) {
  ------------------
  |  Branch (9711:9): [True: 2.18k, False: 125k]
  ------------------
 9712|  2.18k|	xmlXPathCompExprPtr comp = ctxt->comp;
 9713|       |	/*
 9714|       |	* Process inner predicates first.
 9715|       |	*/
 9716|  2.18k|	if (comp->steps[op->ch1].op != XPATH_OP_PREDICATE) {
  ------------------
  |  Branch (9716:6): [True: 0, False: 2.18k]
  ------------------
 9717|      0|            XP_ERROR(XPATH_INVALID_OPERAND);
  ------------------
  |  |  244|      0|    { xmlXPathErr(ctxt, X); return; }
  ------------------
 9718|      0|	}
 9719|  2.18k|        if (ctxt->context->depth >= XPATH_MAX_RECURSION_DEPTH)
  ------------------
  |  |  112|  2.18k|#define XPATH_MAX_RECURSION_DEPTH 500
  ------------------
  |  Branch (9719:13): [True: 0, False: 2.18k]
  ------------------
 9720|  2.18k|            XP_ERROR(XPATH_RECURSION_LIMIT_EXCEEDED);
  ------------------
  |  |  244|      0|    { xmlXPathErr(ctxt, X); return; }
  ------------------
 9721|  2.18k|        ctxt->context->depth += 1;
 9722|  2.18k|	xmlXPathCompOpEvalPredicate(ctxt, &comp->steps[op->ch1], set,
 9723|  2.18k|                                    1, set->nodeNr, hasNsNodes);
 9724|  2.18k|        ctxt->context->depth -= 1;
 9725|  2.18k|	CHECK_ERROR;
  ------------------
  |  |  230|  2.18k|    if (ctxt->error != XPATH_EXPRESSION_OK) return
  |  |  ------------------
  |  |  |  Branch (230:9): [True: 73, False: 2.11k]
  |  |  ------------------
  ------------------
 9726|  2.18k|    }
 9727|       |
 9728|   127k|    if (op->ch2 != -1)
  ------------------
  |  Branch (9728:9): [True: 127k, False: 0]
  ------------------
 9729|   127k|        xmlXPathNodeSetFilter(ctxt, set, op->ch2, minPos, maxPos, hasNsNodes);
 9730|   127k|}
xpath.c:xmlXPathNodeSetFilter:
 9577|   132k|{
 9578|   132k|    xmlXPathContextPtr xpctxt;
 9579|   132k|    xmlNodePtr oldnode;
 9580|   132k|    xmlDocPtr olddoc;
 9581|   132k|    xmlXPathStepOpPtr filterOp;
 9582|   132k|    int oldcs, oldpp;
 9583|   132k|    int i, j, pos;
 9584|       |
 9585|   132k|    if ((set == NULL) || (set->nodeNr == 0))
  ------------------
  |  Branch (9585:9): [True: 0, False: 132k]
  |  Branch (9585:26): [True: 2.15k, False: 130k]
  ------------------
 9586|  2.15k|        return;
 9587|       |
 9588|       |    /*
 9589|       |    * Check if the node set contains a sufficient number of nodes for
 9590|       |    * the requested range.
 9591|       |    */
 9592|   130k|    if (set->nodeNr < minPos) {
  ------------------
  |  Branch (9592:9): [True: 2.77k, False: 127k]
  ------------------
 9593|  2.77k|        xmlXPathNodeSetClear(set, hasNsNodes);
 9594|  2.77k|        return;
 9595|  2.77k|    }
 9596|       |
 9597|   127k|    xpctxt = ctxt->context;
 9598|   127k|    oldnode = xpctxt->node;
 9599|   127k|    olddoc = xpctxt->doc;
 9600|   127k|    oldcs = xpctxt->contextSize;
 9601|   127k|    oldpp = xpctxt->proximityPosition;
 9602|   127k|    filterOp = &ctxt->comp->steps[filterOpIndex];
 9603|       |
 9604|   127k|    xpctxt->contextSize = set->nodeNr;
 9605|       |
 9606|   525k|    for (i = 0, j = 0, pos = 1; i < set->nodeNr; i++) {
  ------------------
  |  Branch (9606:33): [True: 474k, False: 51.2k]
  ------------------
 9607|   474k|        xmlNodePtr node = set->nodeTab[i];
 9608|   474k|        int res;
 9609|       |
 9610|   474k|        xpctxt->node = node;
 9611|   474k|        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|   474k|        if ((node->type != XML_NAMESPACE_DECL) &&
  ------------------
  |  Branch (9619:13): [True: 442k, False: 31.9k]
  ------------------
 9620|   442k|            (node->doc != NULL))
  ------------------
  |  Branch (9620:13): [True: 442k, False: 0]
  ------------------
 9621|   442k|            xpctxt->doc = node->doc;
 9622|       |
 9623|   474k|        res = xmlXPathCompOpEvalToBoolean(ctxt, filterOp, 1);
 9624|       |
 9625|   474k|        if (ctxt->error != XPATH_EXPRESSION_OK)
  ------------------
  |  Branch (9625:13): [True: 1.68k, False: 472k]
  ------------------
 9626|  1.68k|            break;
 9627|   472k|        if (res < 0) {
  ------------------
  |  Branch (9627:13): [True: 0, False: 472k]
  ------------------
 9628|       |            /* Shouldn't happen */
 9629|      0|            xmlXPathErr(ctxt, XPATH_EXPR_ERROR);
 9630|      0|            break;
 9631|      0|        }
 9632|       |
 9633|   472k|        if ((res != 0) && ((pos >= minPos) && (pos <= maxPos))) {
  ------------------
  |  Branch (9633:13): [True: 213k, False: 258k]
  |  Branch (9633:28): [True: 191k, False: 22.0k]
  |  Branch (9633:47): [True: 181k, False: 10.5k]
  ------------------
 9634|   181k|            if (i != j) {
  ------------------
  |  Branch (9634:17): [True: 7.98k, False: 173k]
  ------------------
 9635|  7.98k|                set->nodeTab[j] = node;
 9636|  7.98k|                set->nodeTab[i] = NULL;
 9637|  7.98k|            }
 9638|       |
 9639|   181k|            j += 1;
 9640|   291k|        } else {
 9641|       |            /* Remove the entry from the initial node set. */
 9642|   291k|            set->nodeTab[i] = NULL;
 9643|   291k|            if (node->type == XML_NAMESPACE_DECL)
  ------------------
  |  Branch (9643:17): [True: 28.9k, False: 262k]
  ------------------
 9644|  28.9k|                xmlXPathNodeSetFreeNs((xmlNsPtr) node);
 9645|   291k|        }
 9646|       |
 9647|   472k|        if (res != 0) {
  ------------------
  |  Branch (9647:13): [True: 213k, False: 258k]
  ------------------
 9648|   213k|            if (pos == maxPos) {
  ------------------
  |  Branch (9648:17): [True: 74.3k, False: 139k]
  ------------------
 9649|  74.3k|                i += 1;
 9650|  74.3k|                break;
 9651|  74.3k|            }
 9652|       |
 9653|   139k|            pos += 1;
 9654|   139k|        }
 9655|   472k|    }
 9656|       |
 9657|       |    /* Free remaining nodes. */
 9658|   127k|    if (hasNsNodes) {
  ------------------
  |  Branch (9658:9): [True: 14.1k, False: 113k]
  ------------------
 9659|  15.1k|        for (; i < set->nodeNr; i++) {
  ------------------
  |  Branch (9659:16): [True: 945, False: 14.1k]
  ------------------
 9660|    945|            xmlNodePtr node = set->nodeTab[i];
 9661|    945|            if ((node != NULL) && (node->type == XML_NAMESPACE_DECL))
  ------------------
  |  Branch (9661:17): [True: 945, False: 0]
  |  Branch (9661:35): [True: 38, False: 907]
  ------------------
 9662|     38|                xmlXPathNodeSetFreeNs((xmlNsPtr) node);
 9663|    945|        }
 9664|  14.1k|    }
 9665|       |
 9666|   127k|    set->nodeNr = j;
 9667|       |
 9668|       |    /* If too many elements were removed, shrink table to preserve memory. */
 9669|   127k|    if ((set->nodeMax > XML_NODESET_DEFAULT) &&
  ------------------
  |  | 2593|   127k|#define XML_NODESET_DEFAULT	10
  ------------------
  |  Branch (9669:9): [True: 13.6k, False: 113k]
  ------------------
 9670|  13.6k|        (set->nodeNr < set->nodeMax / 2)) {
  ------------------
  |  Branch (9670:9): [True: 8.45k, False: 5.19k]
  ------------------
 9671|  8.45k|        xmlNodePtr *tmp;
 9672|  8.45k|        int nodeMax = set->nodeNr;
 9673|       |
 9674|  8.45k|        if (nodeMax < XML_NODESET_DEFAULT)
  ------------------
  |  | 2593|  8.45k|#define XML_NODESET_DEFAULT	10
  ------------------
  |  Branch (9674:13): [True: 8.36k, False: 90]
  ------------------
 9675|  8.36k|            nodeMax = XML_NODESET_DEFAULT;
  ------------------
  |  | 2593|  8.36k|#define XML_NODESET_DEFAULT	10
  ------------------
 9676|  8.45k|        tmp = (xmlNodePtr *) xmlRealloc(set->nodeTab,
 9677|  8.45k|                nodeMax * sizeof(xmlNodePtr));
 9678|  8.45k|        if (tmp == NULL) {
  ------------------
  |  Branch (9678:13): [True: 1, False: 8.45k]
  ------------------
 9679|      1|            xmlXPathPErrMemory(ctxt);
 9680|  8.45k|        } else {
 9681|  8.45k|            set->nodeTab = tmp;
 9682|  8.45k|            set->nodeMax = nodeMax;
 9683|  8.45k|        }
 9684|  8.45k|    }
 9685|       |
 9686|   127k|    xpctxt->node = oldnode;
 9687|   127k|    xpctxt->doc = olddoc;
 9688|   127k|    xpctxt->contextSize = oldcs;
 9689|   127k|    xpctxt->proximityPosition = oldpp;
 9690|   127k|}
xpath.c:xmlXPathCompOpEval:
10750|  3.57M|{
10751|  3.57M|    int total = 0;
10752|  3.57M|    int equal, ret;
10753|  3.57M|    xmlXPathCompExprPtr comp;
10754|  3.57M|    xmlXPathObjectPtr arg1, arg2;
10755|       |
10756|  3.57M|    CHECK_ERROR0;
  ------------------
  |  |  236|  3.57M|    if (ctxt->error != XPATH_EXPRESSION_OK) return(0)
  |  |  ------------------
  |  |  |  Branch (236:9): [True: 1, False: 3.57M]
  |  |  ------------------
  ------------------
10757|  3.57M|    if (OP_LIMIT_EXCEEDED(ctxt, 1))
  ------------------
  |  |  818|  3.57M|    ((ctxt->context->opLimit != 0) && (xmlXPathCheckOpLimit(ctxt, n) < 0))
  |  |  ------------------
  |  |  |  Branch (818:6): [True: 3.57M, False: 0]
  |  |  |  Branch (818:39): [True: 48, False: 3.57M]
  |  |  ------------------
  ------------------
10758|     48|        return(0);
10759|  3.57M|    if (ctxt->context->depth >= XPATH_MAX_RECURSION_DEPTH)
  ------------------
  |  |  112|  3.57M|#define XPATH_MAX_RECURSION_DEPTH 500
  ------------------
  |  Branch (10759:9): [True: 25, False: 3.57M]
  ------------------
10760|  3.57M|        XP_ERROR0(XPATH_RECURSION_LIMIT_EXCEEDED);
  ------------------
  |  |  252|     25|    { xmlXPathErr(ctxt, X); return(0); }
  ------------------
10761|  3.57M|    ctxt->context->depth += 1;
10762|  3.57M|    comp = ctxt->comp;
10763|  3.57M|    switch (op->op) {
10764|      0|        case XPATH_OP_END:
  ------------------
  |  Branch (10764:9): [True: 0, False: 3.57M]
  ------------------
10765|      0|            break;
10766|  2.01k|        case XPATH_OP_AND:
  ------------------
  |  Branch (10766:9): [True: 2.01k, False: 3.57M]
  ------------------
10767|  2.01k|            total += xmlXPathCompOpEval(ctxt, &comp->steps[op->ch1]);
10768|  2.01k|	    CHECK_ERROR0;
  ------------------
  |  |  236|  2.01k|    if (ctxt->error != XPATH_EXPRESSION_OK) return(0)
  |  |  ------------------
  |  |  |  Branch (236:9): [True: 21, False: 1.99k]
  |  |  ------------------
  ------------------
10769|  1.99k|            xmlXPathBooleanFunction(ctxt, 1);
10770|  1.99k|            if ((ctxt->value == NULL) || (ctxt->value->boolval == 0))
  ------------------
  |  Branch (10770:17): [True: 1, False: 1.99k]
  |  Branch (10770:42): [True: 1.06k, False: 930]
  ------------------
10771|  1.06k|                break;
10772|    930|            arg2 = xmlXPathValuePop(ctxt);
10773|    930|            total += xmlXPathCompOpEval(ctxt, &comp->steps[op->ch2]);
10774|    930|	    if (ctxt->error) {
  ------------------
  |  Branch (10774:10): [True: 38, False: 892]
  ------------------
10775|     38|		xmlXPathFreeObject(arg2);
10776|     38|		break;
10777|     38|	    }
10778|    892|            xmlXPathBooleanFunction(ctxt, 1);
10779|    892|            if (ctxt->value != NULL)
  ------------------
  |  Branch (10779:17): [True: 890, False: 2]
  ------------------
10780|    890|                ctxt->value->boolval &= arg2->boolval;
10781|    892|	    xmlXPathReleaseObject(ctxt->context, arg2);
10782|    892|            break;
10783|  2.40k|        case XPATH_OP_OR:
  ------------------
  |  Branch (10783:9): [True: 2.40k, False: 3.57M]
  ------------------
10784|  2.40k|            total += xmlXPathCompOpEval(ctxt, &comp->steps[op->ch1]);
10785|  2.40k|	    CHECK_ERROR0;
  ------------------
  |  |  236|  2.40k|    if (ctxt->error != XPATH_EXPRESSION_OK) return(0)
  |  |  ------------------
  |  |  |  Branch (236:9): [True: 499, False: 1.90k]
  |  |  ------------------
  ------------------
10786|  1.90k|            xmlXPathBooleanFunction(ctxt, 1);
10787|  1.90k|            if ((ctxt->value == NULL) || (ctxt->value->boolval == 1))
  ------------------
  |  Branch (10787:17): [True: 2, False: 1.90k]
  |  Branch (10787:42): [True: 388, False: 1.51k]
  ------------------
10788|    390|                break;
10789|  1.51k|            arg2 = xmlXPathValuePop(ctxt);
10790|  1.51k|            total += xmlXPathCompOpEval(ctxt, &comp->steps[op->ch2]);
10791|  1.51k|	    if (ctxt->error) {
  ------------------
  |  Branch (10791:10): [True: 116, False: 1.39k]
  ------------------
10792|    116|		xmlXPathFreeObject(arg2);
10793|    116|		break;
10794|    116|	    }
10795|  1.39k|            xmlXPathBooleanFunction(ctxt, 1);
10796|  1.39k|            if (ctxt->value != NULL)
  ------------------
  |  Branch (10796:17): [True: 1.39k, False: 4]
  ------------------
10797|  1.39k|                ctxt->value->boolval |= arg2->boolval;
10798|  1.39k|	    xmlXPathReleaseObject(ctxt->context, arg2);
10799|  1.39k|            break;
10800|   379k|        case XPATH_OP_EQUAL:
  ------------------
  |  Branch (10800:9): [True: 379k, False: 3.19M]
  ------------------
10801|   379k|            total += xmlXPathCompOpEval(ctxt, &comp->steps[op->ch1]);
10802|   379k|	    CHECK_ERROR0;
  ------------------
  |  |  236|   379k|    if (ctxt->error != XPATH_EXPRESSION_OK) return(0)
  |  |  ------------------
  |  |  |  Branch (236:9): [True: 4.72k, False: 375k]
  |  |  ------------------
  ------------------
10803|   375k|            total += xmlXPathCompOpEval(ctxt, &comp->steps[op->ch2]);
10804|   375k|	    CHECK_ERROR0;
  ------------------
  |  |  236|   375k|    if (ctxt->error != XPATH_EXPRESSION_OK) return(0)
  |  |  ------------------
  |  |  |  Branch (236:9): [True: 1.69k, False: 373k]
  |  |  ------------------
  ------------------
10805|   373k|	    if (op->value)
  ------------------
  |  Branch (10805:10): [True: 369k, False: 4.38k]
  ------------------
10806|   369k|		equal = xmlXPathEqualValues(ctxt);
10807|  4.38k|	    else
10808|  4.38k|		equal = xmlXPathNotEqualValues(ctxt);
10809|   373k|	    xmlXPathValuePush(ctxt, xmlXPathCacheNewBoolean(ctxt, equal));
10810|   373k|            break;
10811|   171k|        case XPATH_OP_CMP:
  ------------------
  |  Branch (10811:9): [True: 171k, False: 3.40M]
  ------------------
10812|   171k|            total += xmlXPathCompOpEval(ctxt, &comp->steps[op->ch1]);
10813|   171k|	    CHECK_ERROR0;
  ------------------
  |  |  236|   171k|    if (ctxt->error != XPATH_EXPRESSION_OK) return(0)
  |  |  ------------------
  |  |  |  Branch (236:9): [True: 1.04k, False: 170k]
  |  |  ------------------
  ------------------
10814|   170k|            total += xmlXPathCompOpEval(ctxt, &comp->steps[op->ch2]);
10815|   170k|	    CHECK_ERROR0;
  ------------------
  |  |  236|   170k|    if (ctxt->error != XPATH_EXPRESSION_OK) return(0)
  |  |  ------------------
  |  |  |  Branch (236:9): [True: 791, False: 169k]
  |  |  ------------------
  ------------------
10816|   169k|            ret = xmlXPathCompareValues(ctxt, op->value, op->value2);
10817|   169k|	    xmlXPathValuePush(ctxt, xmlXPathCacheNewBoolean(ctxt, ret));
10818|   169k|            break;
10819|   229k|        case XPATH_OP_PLUS:
  ------------------
  |  Branch (10819:9): [True: 229k, False: 3.34M]
  ------------------
10820|   229k|            total += xmlXPathCompOpEval(ctxt, &comp->steps[op->ch1]);
10821|   229k|	    CHECK_ERROR0;
  ------------------
  |  |  236|   229k|    if (ctxt->error != XPATH_EXPRESSION_OK) return(0)
  |  |  ------------------
  |  |  |  Branch (236:9): [True: 6.55k, False: 223k]
  |  |  ------------------
  ------------------
10822|   223k|            if (op->ch2 != -1) {
  ------------------
  |  Branch (10822:17): [True: 115k, False: 107k]
  ------------------
10823|   115k|                total += xmlXPathCompOpEval(ctxt, &comp->steps[op->ch2]);
10824|   115k|	    }
10825|   223k|	    CHECK_ERROR0;
  ------------------
  |  |  236|   223k|    if (ctxt->error != XPATH_EXPRESSION_OK) return(0)
  |  |  ------------------
  |  |  |  Branch (236:9): [True: 984, False: 222k]
  |  |  ------------------
  ------------------
10826|   222k|            if (op->value == 0)
  ------------------
  |  Branch (10826:17): [True: 42.9k, False: 179k]
  ------------------
10827|  42.9k|                xmlXPathSubValues(ctxt);
10828|   179k|            else if (op->value == 1)
  ------------------
  |  Branch (10828:22): [True: 71.2k, False: 107k]
  ------------------
10829|  71.2k|                xmlXPathAddValues(ctxt);
10830|   107k|            else if (op->value == 2)
  ------------------
  |  Branch (10830:22): [True: 99.4k, False: 8.49k]
  ------------------
10831|  99.4k|                xmlXPathValueFlipSign(ctxt);
10832|  8.49k|            else if (op->value == 3) {
  ------------------
  |  Branch (10832:22): [True: 8.49k, False: 0]
  ------------------
10833|  8.49k|                CAST_TO_NUMBER;
  ------------------
  |  |  297|  8.49k|    if ((ctxt->value != NULL) && (ctxt->value->type != XPATH_NUMBER))	\
  |  |  ------------------
  |  |  |  Branch (297:9): [True: 8.49k, False: 0]
  |  |  |  Branch (297:34): [True: 7.43k, False: 1.06k]
  |  |  ------------------
  |  |  298|  8.49k|        xmlXPathNumberFunction(ctxt, 1);
  ------------------
10834|  8.49k|                CHECK_TYPE0(XPATH_NUMBER);
  ------------------
  |  |  271|  8.49k|    if ((ctxt->value == NULL) || (ctxt->value->type != typeval))	\
  |  |  ------------------
  |  |  |  Branch (271:9): [True: 2, False: 8.49k]
  |  |  |  Branch (271:34): [True: 2, False: 8.49k]
  |  |  ------------------
  |  |  272|  8.49k|        XP_ERROR0(XPATH_INVALID_TYPE)
  |  |  ------------------
  |  |  |  |  252|      4|    { xmlXPathErr(ctxt, X); return(0); }
  |  |  ------------------
  ------------------
10835|  8.49k|            }
10836|   222k|            break;
10837|   222k|        case XPATH_OP_MULT:
  ------------------
  |  Branch (10837:9): [True: 128k, False: 3.44M]
  ------------------
10838|   128k|            total += xmlXPathCompOpEval(ctxt, &comp->steps[op->ch1]);
10839|   128k|	    CHECK_ERROR0;
  ------------------
  |  |  236|   128k|    if (ctxt->error != XPATH_EXPRESSION_OK) return(0)
  |  |  ------------------
  |  |  |  Branch (236:9): [True: 9.46k, False: 118k]
  |  |  ------------------
  ------------------
10840|   118k|            total += xmlXPathCompOpEval(ctxt, &comp->steps[op->ch2]);
10841|   118k|	    CHECK_ERROR0;
  ------------------
  |  |  236|   118k|    if (ctxt->error != XPATH_EXPRESSION_OK) return(0)
  |  |  ------------------
  |  |  |  Branch (236:9): [True: 377, False: 118k]
  |  |  ------------------
  ------------------
10842|   118k|            if (op->value == 0)
  ------------------
  |  Branch (10842:17): [True: 115k, False: 2.80k]
  ------------------
10843|   115k|                xmlXPathMultValues(ctxt);
10844|  2.80k|            else if (op->value == 1)
  ------------------
  |  Branch (10844:22): [True: 1.29k, False: 1.51k]
  ------------------
10845|  1.29k|                xmlXPathDivValues(ctxt);
10846|  1.51k|            else if (op->value == 2)
  ------------------
  |  Branch (10846:22): [True: 1.51k, False: 0]
  ------------------
10847|  1.51k|                xmlXPathModValues(ctxt);
10848|   118k|            break;
10849|   128k|        case XPATH_OP_UNION:
  ------------------
  |  Branch (10849:9): [True: 128k, False: 3.44M]
  ------------------
10850|   128k|            total += xmlXPathCompOpEval(ctxt, &comp->steps[op->ch1]);
10851|   128k|	    CHECK_ERROR0;
  ------------------
  |  |  236|   128k|    if (ctxt->error != XPATH_EXPRESSION_OK) return(0)
  |  |  ------------------
  |  |  |  Branch (236:9): [True: 502, False: 128k]
  |  |  ------------------
  ------------------
10852|   128k|            total += xmlXPathCompOpEval(ctxt, &comp->steps[op->ch2]);
10853|   128k|	    CHECK_ERROR0;
  ------------------
  |  |  236|   128k|    if (ctxt->error != XPATH_EXPRESSION_OK) return(0)
  |  |  ------------------
  |  |  |  Branch (236:9): [True: 358, False: 127k]
  |  |  ------------------
  ------------------
10854|       |
10855|   127k|            arg2 = xmlXPathValuePop(ctxt);
10856|   127k|            arg1 = xmlXPathValuePop(ctxt);
10857|   127k|            if ((arg1 == NULL) || (arg1->type != XPATH_NODESET) ||
  ------------------
  |  Branch (10857:17): [True: 0, False: 127k]
  |  Branch (10857:35): [True: 42, False: 127k]
  ------------------
10858|   127k|                (arg2 == NULL) || (arg2->type != XPATH_NODESET)) {
  ------------------
  |  Branch (10858:17): [True: 0, False: 127k]
  |  Branch (10858:35): [True: 11, False: 127k]
  ------------------
10859|     53|	        xmlXPathReleaseObject(ctxt->context, arg1);
10860|     53|	        xmlXPathReleaseObject(ctxt->context, arg2);
10861|     53|                XP_ERROR0(XPATH_INVALID_TYPE);
  ------------------
  |  |  252|     53|    { xmlXPathErr(ctxt, X); return(0); }
  ------------------
10862|      0|            }
10863|   127k|            if ((ctxt->context->opLimit != 0) &&
  ------------------
  |  Branch (10863:17): [True: 127k, False: 0]
  ------------------
10864|   127k|                (((arg1->nodesetval != NULL) &&
  ------------------
  |  Branch (10864:19): [True: 127k, False: 0]
  ------------------
10865|   127k|                  (xmlXPathCheckOpLimit(ctxt,
  ------------------
  |  Branch (10865:19): [True: 10, False: 127k]
  ------------------
10866|   127k|                                        arg1->nodesetval->nodeNr) < 0)) ||
10867|   127k|                 ((arg2->nodesetval != NULL) &&
  ------------------
  |  Branch (10867:19): [True: 127k, False: 0]
  ------------------
10868|   127k|                  (xmlXPathCheckOpLimit(ctxt,
  ------------------
  |  Branch (10868:19): [True: 2, False: 127k]
  ------------------
10869|   127k|                                        arg2->nodesetval->nodeNr) < 0)))) {
10870|     12|	        xmlXPathReleaseObject(ctxt->context, arg1);
10871|     12|	        xmlXPathReleaseObject(ctxt->context, arg2);
10872|     12|                break;
10873|     12|            }
10874|       |
10875|   127k|	    if (((arg2->nodesetval != NULL) &&
  ------------------
  |  Branch (10875:11): [True: 127k, False: 0]
  ------------------
10876|   127k|		 (arg2->nodesetval->nodeNr != 0)))
  ------------------
  |  Branch (10876:4): [True: 51.6k, False: 76.0k]
  ------------------
10877|  51.6k|	    {
10878|  51.6k|		arg1->nodesetval = xmlXPathNodeSetMerge(arg1->nodesetval,
10879|  51.6k|							arg2->nodesetval);
10880|  51.6k|                if (arg1->nodesetval == NULL)
  ------------------
  |  Branch (10880:21): [True: 35, False: 51.5k]
  ------------------
10881|     35|                    xmlXPathPErrMemory(ctxt);
10882|  51.6k|	    }
10883|       |
10884|   127k|            xmlXPathValuePush(ctxt, arg1);
10885|   127k|	    xmlXPathReleaseObject(ctxt->context, arg2);
10886|   127k|            break;
10887|   371k|        case XPATH_OP_ROOT:
  ------------------
  |  Branch (10887:9): [True: 371k, False: 3.20M]
  ------------------
10888|   371k|            xmlXPathRoot(ctxt);
10889|   371k|            break;
10890|   787k|        case XPATH_OP_NODE:
  ------------------
  |  Branch (10890:9): [True: 787k, False: 2.78M]
  ------------------
10891|   787k|            if (op->ch1 != -1)
  ------------------
  |  Branch (10891:17): [True: 0, False: 787k]
  ------------------
10892|      0|                total += xmlXPathCompOpEval(ctxt, &comp->steps[op->ch1]);
10893|   787k|	    CHECK_ERROR0;
  ------------------
  |  |  236|   787k|    if (ctxt->error != XPATH_EXPRESSION_OK) return(0)
  |  |  ------------------
  |  |  |  Branch (236:9): [True: 0, False: 787k]
  |  |  ------------------
  ------------------
10894|   787k|            if (op->ch2 != -1)
  ------------------
  |  Branch (10894:17): [True: 0, False: 787k]
  ------------------
10895|      0|                total += xmlXPathCompOpEval(ctxt, &comp->steps[op->ch2]);
10896|   787k|	    CHECK_ERROR0;
  ------------------
  |  |  236|   787k|    if (ctxt->error != XPATH_EXPRESSION_OK) return(0)
  |  |  ------------------
  |  |  |  Branch (236:9): [True: 0, False: 787k]
  |  |  ------------------
  ------------------
10897|   787k|	    xmlXPathValuePush(ctxt, xmlXPathCacheNewNodeSet(ctxt,
10898|   787k|                                                    ctxt->context->node));
10899|   787k|            break;
10900|   958k|        case XPATH_OP_COLLECT:{
  ------------------
  |  Branch (10900:9): [True: 958k, False: 2.61M]
  ------------------
10901|   958k|                if (op->ch1 == -1)
  ------------------
  |  Branch (10901:21): [True: 0, False: 958k]
  ------------------
10902|      0|                    break;
10903|       |
10904|   958k|                total += xmlXPathCompOpEval(ctxt, &comp->steps[op->ch1]);
10905|   958k|		CHECK_ERROR0;
  ------------------
  |  |  236|   958k|    if (ctxt->error != XPATH_EXPRESSION_OK) return(0)
  |  |  ------------------
  |  |  |  Branch (236:9): [True: 1.43k, False: 957k]
  |  |  ------------------
  ------------------
10906|       |
10907|   957k|                total += xmlXPathNodeCollectAndTest(ctxt, op, NULL, NULL, 0);
10908|   957k|                break;
10909|   958k|            }
10910|   238k|        case XPATH_OP_VALUE:
  ------------------
  |  Branch (10910:9): [True: 238k, False: 3.33M]
  ------------------
10911|   238k|            xmlXPathValuePush(ctxt, xmlXPathCacheObjectCopy(ctxt, op->value4));
10912|   238k|            break;
10913|     57|        case XPATH_OP_VARIABLE:{
  ------------------
  |  Branch (10913:9): [True: 57, False: 3.57M]
  ------------------
10914|     57|		xmlXPathObjectPtr val;
10915|       |
10916|     57|                if (op->ch1 != -1)
  ------------------
  |  Branch (10916:21): [True: 0, False: 57]
  ------------------
10917|      0|                    total +=
10918|      0|                        xmlXPathCompOpEval(ctxt, &comp->steps[op->ch1]);
10919|     57|                if (op->value5 == NULL) {
  ------------------
  |  Branch (10919:21): [True: 34, False: 23]
  ------------------
10920|     34|		    val = xmlXPathVariableLookup(ctxt->context, op->value4);
10921|     34|		    if (val == NULL) {
  ------------------
  |  Branch (10921:11): [True: 34, False: 0]
  ------------------
10922|     34|                        xmlXPathErrFmt(ctxt, XPATH_UNDEF_VARIABLE_ERROR,
10923|     34|                                       "Undefined variable: %s\n", op->value4);
10924|     34|                        return 0;
10925|     34|                    }
10926|      0|                    xmlXPathValuePush(ctxt, val);
10927|     23|		} else {
10928|     23|                    const xmlChar *URI;
10929|       |
10930|     23|                    URI = xmlXPathNsLookup(ctxt->context, op->value5);
10931|     23|                    if (URI == NULL) {
  ------------------
  |  Branch (10931:25): [True: 12, False: 11]
  ------------------
10932|     12|                        xmlXPathErrFmt(ctxt, XPATH_UNDEF_PREFIX_ERROR,
10933|     12|                                       "Undefined namespace prefix: %s\n",
10934|     12|                                       op->value5);
10935|     12|                        return 0;
10936|     12|                    }
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|     57|            }
10949|  34.7k|        case XPATH_OP_FUNCTION:{
  ------------------
  |  Branch (10949:9): [True: 34.7k, False: 3.54M]
  ------------------
10950|  34.7k|                xmlXPathFunction func;
10951|  34.7k|                const xmlChar *oldFunc, *oldFuncURI;
10952|  34.7k|		int i;
10953|  34.7k|                int frame;
10954|       |
10955|  34.7k|                frame = ctxt->valueNr;
10956|  34.7k|                if (op->ch1 != -1) {
  ------------------
  |  Branch (10956:21): [True: 30.4k, False: 4.27k]
  ------------------
10957|  30.4k|                    total +=
10958|  30.4k|                        xmlXPathCompOpEval(ctxt, &comp->steps[op->ch1]);
10959|  30.4k|                    if (ctxt->error != XPATH_EXPRESSION_OK)
  ------------------
  |  Branch (10959:25): [True: 993, False: 29.4k]
  ------------------
10960|    993|                        break;
10961|  30.4k|                }
10962|  33.7k|		if (ctxt->valueNr < frame + op->value)
  ------------------
  |  Branch (10962:7): [True: 0, False: 33.7k]
  ------------------
10963|  33.7k|		    XP_ERROR0(XPATH_INVALID_OPERAND);
  ------------------
  |  |  252|      0|    { xmlXPathErr(ctxt, X); return(0); }
  ------------------
10964|  84.8k|		for (i = 0; i < op->value; i++) {
  ------------------
  |  Branch (10964:15): [True: 51.1k, False: 33.7k]
  ------------------
10965|  51.1k|		    if (ctxt->valueTab[(ctxt->valueNr - 1) - i] == NULL)
  ------------------
  |  Branch (10965:11): [True: 0, False: 51.1k]
  ------------------
10966|  51.1k|			XP_ERROR0(XPATH_INVALID_OPERAND);
  ------------------
  |  |  252|      0|    { xmlXPathErr(ctxt, X); return(0); }
  ------------------
10967|  51.1k|                }
10968|  33.7k|                if (op->cache != NULL)
  ------------------
  |  Branch (10968:21): [True: 25.9k, False: 7.78k]
  ------------------
10969|  25.9k|                    func = op->cache;
10970|  7.78k|                else {
10971|  7.78k|                    const xmlChar *URI = NULL;
10972|       |
10973|  7.78k|                    if (op->value5 == NULL) {
  ------------------
  |  Branch (10973:25): [True: 7.67k, False: 106]
  ------------------
10974|  7.67k|                        func = xmlXPathFunctionLookup(ctxt->context,
10975|  7.67k|                                                      op->value4);
10976|  7.67k|                        if (func == NULL) {
  ------------------
  |  Branch (10976:29): [True: 454, False: 7.22k]
  ------------------
10977|    454|                            xmlXPathErrFmt(ctxt, XPATH_UNKNOWN_FUNC_ERROR,
10978|    454|                                           "Unregistered function: %s\n",
10979|    454|                                           op->value4);
10980|    454|                            return 0;
10981|    454|                        }
10982|  7.67k|                    } else {
10983|    106|                        URI = xmlXPathNsLookup(ctxt->context, op->value5);
10984|    106|                        if (URI == NULL) {
  ------------------
  |  Branch (10984:29): [True: 91, False: 15]
  ------------------
10985|     91|                            xmlXPathErrFmt(ctxt, XPATH_UNDEF_PREFIX_ERROR,
10986|     91|                                           "Undefined namespace prefix: %s\n",
10987|     91|                                           op->value5);
10988|     91|                            return 0;
10989|     91|                        }
10990|     15|                        func = xmlXPathFunctionLookupNS(ctxt->context,
10991|     15|                                                        op->value4, URI);
10992|     15|                        if (func == NULL) {
  ------------------
  |  Branch (10992:29): [True: 15, False: 0]
  ------------------
10993|     15|                            xmlXPathErrFmt(ctxt, XPATH_UNKNOWN_FUNC_ERROR,
10994|     15|                                           "Unregistered function: %s:%s\n",
10995|     15|                                           op->value5, op->value4);
10996|     15|                            return 0;
10997|     15|                        }
10998|     15|                    }
10999|  7.22k|                    op->cache = func;
11000|  7.22k|                    op->cacheURI = (void *) URI;
11001|  7.22k|                }
11002|  33.1k|                oldFunc = ctxt->context->function;
11003|  33.1k|                oldFuncURI = ctxt->context->functionURI;
11004|  33.1k|                ctxt->context->function = op->value4;
11005|  33.1k|                ctxt->context->functionURI = op->cacheURI;
11006|  33.1k|                func(ctxt, op->value);
11007|  33.1k|                ctxt->context->function = oldFunc;
11008|  33.1k|                ctxt->context->functionURI = oldFuncURI;
11009|  33.1k|                if ((ctxt->error == XPATH_EXPRESSION_OK) &&
  ------------------
  |  Branch (11009:21): [True: 32.9k, False: 232]
  ------------------
11010|  32.9k|                    (ctxt->valueNr != frame + 1))
  ------------------
  |  Branch (11010:21): [True: 0, False: 32.9k]
  ------------------
11011|  33.1k|                    XP_ERROR0(XPATH_STACK_ERROR);
  ------------------
  |  |  252|      0|    { xmlXPathErr(ctxt, X); return(0); }
  ------------------
11012|  33.1k|                break;
11013|  33.1k|            }
11014|  52.8k|        case XPATH_OP_ARG:
  ------------------
  |  Branch (11014:9): [True: 52.8k, False: 3.52M]
  ------------------
11015|  52.8k|            if (op->ch1 != -1) {
  ------------------
  |  Branch (11015:17): [True: 22.4k, False: 30.4k]
  ------------------
11016|  22.4k|                total += xmlXPathCompOpEval(ctxt, &comp->steps[op->ch1]);
11017|  22.4k|	        CHECK_ERROR0;
  ------------------
  |  |  236|  22.4k|    if (ctxt->error != XPATH_EXPRESSION_OK) return(0)
  |  |  ------------------
  |  |  |  Branch (236:9): [True: 358, False: 22.0k]
  |  |  ------------------
  ------------------
11018|  22.4k|            }
11019|  52.5k|            if (op->ch2 != -1) {
  ------------------
  |  Branch (11019:17): [True: 52.5k, False: 0]
  ------------------
11020|  52.5k|                total += xmlXPathCompOpEval(ctxt, &comp->steps[op->ch2]);
11021|  52.5k|	        CHECK_ERROR0;
  ------------------
  |  |  236|  52.5k|    if (ctxt->error != XPATH_EXPRESSION_OK) return(0)
  |  |  ------------------
  |  |  |  Branch (236:9): [True: 993, False: 51.5k]
  |  |  ------------------
  ------------------
11022|  52.5k|	    }
11023|  51.5k|            break;
11024|  51.5k|        case XPATH_OP_PREDICATE:
  ------------------
  |  Branch (11024:9): [True: 0, False: 3.57M]
  ------------------
11025|  12.5k|        case XPATH_OP_FILTER:{
  ------------------
  |  Branch (11025:9): [True: 12.5k, False: 3.56M]
  ------------------
11026|  12.5k|                xmlXPathObjectPtr obj;
11027|  12.5k|                xmlNodeSetPtr set;
11028|       |
11029|       |                /*
11030|       |                 * Optimization for ()[1] selection i.e. the first elem
11031|       |                 */
11032|  12.5k|                if ((op->ch1 != -1) && (op->ch2 != -1) &&
  ------------------
  |  Branch (11032:21): [True: 12.5k, False: 0]
  |  Branch (11032:40): [True: 12.5k, False: 0]
  ------------------
11033|  12.5k|#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|  12.5k|                    ((comp->steps[op->ch1].op == XPATH_OP_SORT) || /* 18 */
  ------------------
  |  Branch (11043:22): [True: 6.82k, False: 5.74k]
  ------------------
11044|  5.74k|		     (comp->steps[op->ch1].op == XPATH_OP_FILTER)) && /* 17 */
  ------------------
  |  Branch (11044:8): [True: 5.66k, False: 81]
  ------------------
11045|       |#else
11046|       |		    (comp->steps[op->ch1].op == XPATH_OP_SORT) &&
11047|       |#endif
11048|  12.4k|                    (comp->steps[op->ch2].op == XPATH_OP_VALUE)) { /* 12 */
  ------------------
  |  Branch (11048:21): [True: 7.78k, False: 4.70k]
  ------------------
11049|  7.78k|                    xmlXPathObjectPtr val;
11050|       |
11051|  7.78k|                    val = comp->steps[op->ch2].value4;
11052|  7.78k|                    if ((val != NULL) && (val->type == XPATH_NUMBER) &&
  ------------------
  |  Branch (11052:25): [True: 7.78k, False: 0]
  |  Branch (11052:42): [True: 7.77k, False: 17]
  ------------------
11053|  7.77k|                        (val->floatval == 1.0)) {
  ------------------
  |  Branch (11053:25): [True: 6.54k, False: 1.23k]
  ------------------
11054|  6.54k|                        xmlNodePtr first = NULL;
11055|       |
11056|  6.54k|                        total +=
11057|  6.54k|                            xmlXPathCompOpEvalFirst(ctxt,
11058|  6.54k|                                                    &comp->steps[op->ch1],
11059|  6.54k|                                                    &first);
11060|  6.54k|			CHECK_ERROR0;
  ------------------
  |  |  236|  6.54k|    if (ctxt->error != XPATH_EXPRESSION_OK) return(0)
  |  |  ------------------
  |  |  |  Branch (236:9): [True: 1.25k, False: 5.29k]
  |  |  ------------------
  ------------------
11061|       |                        /*
11062|       |                         * The nodeset should be in document order,
11063|       |                         * Keep only the first value
11064|       |                         */
11065|  5.29k|                        if ((ctxt->value != NULL) &&
  ------------------
  |  Branch (11065:29): [True: 5.29k, False: 0]
  ------------------
11066|  5.29k|                            (ctxt->value->type == XPATH_NODESET) &&
  ------------------
  |  Branch (11066:29): [True: 5.17k, False: 119]
  ------------------
11067|  5.17k|                            (ctxt->value->nodesetval != NULL) &&
  ------------------
  |  Branch (11067:29): [True: 5.17k, False: 0]
  ------------------
11068|  5.17k|                            (ctxt->value->nodesetval->nodeNr > 1))
  ------------------
  |  Branch (11068:29): [True: 267, False: 4.90k]
  ------------------
11069|    267|                            xmlXPathNodeSetClearFromPos(ctxt->value->nodesetval,
11070|    267|                                                        1, 1);
11071|  5.29k|                        break;
11072|  6.54k|                    }
11073|  7.78k|                }
11074|       |                /*
11075|       |                 * Optimization for ()[last()] selection i.e. the last elem
11076|       |                 */
11077|  6.03k|                if ((op->ch1 != -1) && (op->ch2 != -1) &&
  ------------------
  |  Branch (11077:21): [True: 6.03k, False: 0]
  |  Branch (11077:40): [True: 6.03k, False: 0]
  ------------------
11078|  6.03k|                    (comp->steps[op->ch1].op == XPATH_OP_SORT) &&
  ------------------
  |  Branch (11078:21): [True: 4.82k, False: 1.20k]
  ------------------
11079|  4.82k|                    (comp->steps[op->ch2].op == XPATH_OP_SORT)) {
  ------------------
  |  Branch (11079:21): [True: 4.31k, False: 513]
  ------------------
11080|  4.31k|                    int f = comp->steps[op->ch2].ch1;
11081|       |
11082|  4.31k|                    if ((f != -1) &&
  ------------------
  |  Branch (11082:25): [True: 4.31k, False: 0]
  ------------------
11083|  4.31k|                        (comp->steps[f].op == XPATH_OP_FUNCTION) &&
  ------------------
  |  Branch (11083:25): [True: 2.52k, False: 1.78k]
  ------------------
11084|  2.52k|                        (comp->steps[f].value5 == NULL) &&
  ------------------
  |  Branch (11084:25): [True: 2.30k, False: 217]
  ------------------
11085|  2.30k|                        (comp->steps[f].value == 0) &&
  ------------------
  |  Branch (11085:25): [True: 2.17k, False: 136]
  ------------------
11086|  2.17k|                        (comp->steps[f].value4 != NULL) &&
  ------------------
  |  Branch (11086:25): [True: 2.17k, False: 0]
  ------------------
11087|  2.17k|                        (xmlStrEqual
  ------------------
  |  Branch (11087:25): [True: 1.88k, False: 284]
  ------------------
11088|  2.17k|                         (comp->steps[f].value4, BAD_CAST "last"))) {
  ------------------
  |  |   34|  2.17k|#define BAD_CAST (xmlChar *)
  ------------------
11089|  1.88k|                        xmlNodePtr last = NULL;
11090|       |
11091|  1.88k|                        total +=
11092|  1.88k|                            xmlXPathCompOpEvalLast(ctxt,
11093|  1.88k|                                                   &comp->steps[op->ch1],
11094|  1.88k|                                                   &last);
11095|  1.88k|			CHECK_ERROR0;
  ------------------
  |  |  236|  1.88k|    if (ctxt->error != XPATH_EXPRESSION_OK) return(0)
  |  |  ------------------
  |  |  |  Branch (236:9): [True: 32, False: 1.85k]
  |  |  ------------------
  ------------------
11096|       |                        /*
11097|       |                         * The nodeset should be in document order,
11098|       |                         * Keep only the last value
11099|       |                         */
11100|  1.85k|                        if ((ctxt->value != NULL) &&
  ------------------
  |  Branch (11100:29): [True: 1.85k, False: 0]
  ------------------
11101|  1.85k|                            (ctxt->value->type == XPATH_NODESET) &&
  ------------------
  |  Branch (11101:29): [True: 1.81k, False: 40]
  ------------------
11102|  1.81k|                            (ctxt->value->nodesetval != NULL) &&
  ------------------
  |  Branch (11102:29): [True: 1.81k, False: 0]
  ------------------
11103|  1.81k|                            (ctxt->value->nodesetval->nodeTab != NULL) &&
  ------------------
  |  Branch (11103:29): [True: 1.60k, False: 207]
  ------------------
11104|  1.60k|                            (ctxt->value->nodesetval->nodeNr > 1))
  ------------------
  |  Branch (11104:29): [True: 355, False: 1.25k]
  ------------------
11105|    355|                            xmlXPathNodeSetKeepLast(ctxt->value->nodesetval);
11106|  1.85k|                        break;
11107|  1.88k|                    }
11108|  4.31k|                }
11109|       |		/*
11110|       |		* Process inner predicates first.
11111|       |		* Example "index[parent::book][1]":
11112|       |		* ...
11113|       |		*   PREDICATE   <-- we are here "[1]"
11114|       |		*     PREDICATE <-- process "[parent::book]" first
11115|       |		*       SORT
11116|       |		*         COLLECT  'parent' 'name' 'node' book
11117|       |		*           NODE
11118|       |		*     ELEM Object is a number : 1
11119|       |		*/
11120|  4.14k|                if (op->ch1 != -1)
  ------------------
  |  Branch (11120:21): [True: 4.14k, False: 0]
  ------------------
11121|  4.14k|                    total +=
11122|  4.14k|                        xmlXPathCompOpEval(ctxt, &comp->steps[op->ch1]);
11123|  4.14k|		CHECK_ERROR0;
  ------------------
  |  |  236|  4.14k|    if (ctxt->error != XPATH_EXPRESSION_OK) return(0)
  |  |  ------------------
  |  |  |  Branch (236:9): [True: 502, False: 3.64k]
  |  |  ------------------
  ------------------
11124|  3.64k|                if (op->ch2 == -1)
  ------------------
  |  Branch (11124:21): [True: 0, False: 3.64k]
  ------------------
11125|      0|                    break;
11126|  3.64k|                if (ctxt->value == NULL)
  ------------------
  |  Branch (11126:21): [True: 0, False: 3.64k]
  ------------------
11127|      0|                    break;
11128|       |
11129|       |                /*
11130|       |                 * In case of errors, xmlXPathNodeSetFilter can pop additional
11131|       |                 * nodes from the stack. We have to temporarily remove the
11132|       |                 * nodeset object from the stack to avoid freeing it
11133|       |                 * prematurely.
11134|       |                 */
11135|  3.64k|                CHECK_TYPE0(XPATH_NODESET);
  ------------------
  |  |  271|  3.64k|    if ((ctxt->value == NULL) || (ctxt->value->type != typeval))	\
  |  |  ------------------
  |  |  |  Branch (271:9): [True: 0, False: 3.64k]
  |  |  |  Branch (271:34): [True: 31, False: 3.61k]
  |  |  ------------------
  |  |  272|  3.64k|        XP_ERROR0(XPATH_INVALID_TYPE)
  |  |  ------------------
  |  |  |  |  252|     31|    { xmlXPathErr(ctxt, X); return(0); }
  |  |  ------------------
  ------------------
11136|  3.61k|                obj = xmlXPathValuePop(ctxt);
11137|  3.61k|                set = obj->nodesetval;
11138|  3.61k|                if (set != NULL)
  ------------------
  |  Branch (11138:21): [True: 3.61k, False: 0]
  ------------------
11139|  3.61k|                    xmlXPathNodeSetFilter(ctxt, set, op->ch2,
11140|  3.61k|                                          1, set->nodeNr, 1);
11141|  3.61k|                xmlXPathValuePush(ctxt, obj);
11142|  3.61k|                break;
11143|  3.64k|            }
11144|  76.8k|        case XPATH_OP_SORT:
  ------------------
  |  Branch (11144:9): [True: 76.8k, False: 3.49M]
  ------------------
11145|  76.8k|            if (op->ch1 != -1)
  ------------------
  |  Branch (11145:17): [True: 76.8k, False: 0]
  ------------------
11146|  76.8k|                total += xmlXPathCompOpEval(ctxt, &comp->steps[op->ch1]);
11147|  76.8k|	    CHECK_ERROR0;
  ------------------
  |  |  236|  76.8k|    if (ctxt->error != XPATH_EXPRESSION_OK) return(0)
  |  |  ------------------
  |  |  |  Branch (236:9): [True: 4.23k, False: 72.6k]
  |  |  ------------------
  ------------------
11148|  72.6k|            if ((ctxt->value != NULL) &&
  ------------------
  |  Branch (11148:17): [True: 72.6k, False: 0]
  ------------------
11149|  72.6k|                (ctxt->value->type == XPATH_NODESET) &&
  ------------------
  |  Branch (11149:17): [True: 51.5k, False: 21.0k]
  ------------------
11150|  51.5k|                (ctxt->value->nodesetval != NULL) &&
  ------------------
  |  Branch (11150:17): [True: 51.5k, False: 0]
  ------------------
11151|  51.5k|		(ctxt->value->nodesetval->nodeNr > 1))
  ------------------
  |  Branch (11151:3): [True: 4.10k, False: 47.4k]
  ------------------
11152|  4.10k|	    {
11153|  4.10k|                xmlXPathNodeSetSort(ctxt->value->nodesetval);
11154|  4.10k|	    }
11155|  72.6k|            break;
11156|      0|        default:
  ------------------
  |  Branch (11156:9): [True: 0, False: 3.57M]
  ------------------
11157|      0|            XP_ERROR0(XPATH_INVALID_OPERAND);
  ------------------
  |  |  252|      0|    { xmlXPathErr(ctxt, X); return(0); }
  ------------------
11158|      0|            break;
11159|  3.57M|    }
11160|       |
11161|  3.53M|    ctxt->context->depth -= 1;
11162|  3.53M|    return (total);
11163|  3.57M|}
xpath.c:xmlXPathCompOpEvalFirst:
10406|  22.3k|{
10407|  22.3k|    int total = 0, cur;
10408|  22.3k|    xmlXPathCompExprPtr comp;
10409|  22.3k|    xmlXPathObjectPtr arg1, arg2;
10410|       |
10411|  22.3k|    CHECK_ERROR0;
  ------------------
  |  |  236|  22.3k|    if (ctxt->error != XPATH_EXPRESSION_OK) return(0)
  |  |  ------------------
  |  |  |  Branch (236:9): [True: 0, False: 22.3k]
  |  |  ------------------
  ------------------
10412|  22.3k|    if (OP_LIMIT_EXCEEDED(ctxt, 1))
  ------------------
  |  |  818|  22.3k|    ((ctxt->context->opLimit != 0) && (xmlXPathCheckOpLimit(ctxt, n) < 0))
  |  |  ------------------
  |  |  |  Branch (818:6): [True: 22.3k, False: 0]
  |  |  |  Branch (818:39): [True: 0, False: 22.3k]
  |  |  ------------------
  ------------------
10413|      0|        return(0);
10414|  22.3k|    if (ctxt->context->depth >= XPATH_MAX_RECURSION_DEPTH)
  ------------------
  |  |  112|  22.3k|#define XPATH_MAX_RECURSION_DEPTH 500
  ------------------
  |  Branch (10414:9): [True: 2, False: 22.3k]
  ------------------
10415|  22.3k|        XP_ERROR0(XPATH_RECURSION_LIMIT_EXCEEDED);
  ------------------
  |  |  252|      2|    { xmlXPathErr(ctxt, X); return(0); }
  ------------------
10416|  22.3k|    ctxt->context->depth += 1;
10417|  22.3k|    comp = ctxt->comp;
10418|  22.3k|    switch (op->op) {
10419|      0|        case XPATH_OP_END:
  ------------------
  |  Branch (10419:9): [True: 0, False: 22.3k]
  ------------------
10420|      0|            break;
10421|  6.98k|        case XPATH_OP_UNION:
  ------------------
  |  Branch (10421:9): [True: 6.98k, False: 15.3k]
  ------------------
10422|  6.98k|            total =
10423|  6.98k|                xmlXPathCompOpEvalFirst(ctxt, &comp->steps[op->ch1],
10424|  6.98k|                                        first);
10425|  6.98k|	    CHECK_ERROR0;
  ------------------
  |  |  236|  6.98k|    if (ctxt->error != XPATH_EXPRESSION_OK) return(0)
  |  |  ------------------
  |  |  |  Branch (236:9): [True: 306, False: 6.67k]
  |  |  ------------------
  ------------------
10426|  6.67k|            if ((ctxt->value != NULL)
  ------------------
  |  Branch (10426:17): [True: 6.67k, False: 0]
  ------------------
10427|  6.67k|                && (ctxt->value->type == XPATH_NODESET)
  ------------------
  |  Branch (10427:20): [True: 6.67k, False: 3]
  ------------------
10428|  6.67k|                && (ctxt->value->nodesetval != NULL)
  ------------------
  |  Branch (10428:20): [True: 6.67k, False: 0]
  ------------------
10429|  6.67k|                && (ctxt->value->nodesetval->nodeNr >= 1)) {
  ------------------
  |  Branch (10429:20): [True: 5.49k, False: 1.18k]
  ------------------
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|  5.49k|		if (ctxt->value->nodesetval->nodeNr > 1)
  ------------------
  |  Branch (10440:7): [True: 3.72k, False: 1.76k]
  ------------------
10441|  3.72k|		    xmlXPathNodeSetSort(ctxt->value->nodesetval);
10442|  5.49k|                *first = ctxt->value->nodesetval->nodeTab[0];
10443|  5.49k|            }
10444|  6.67k|            cur =
10445|  6.67k|                xmlXPathCompOpEvalFirst(ctxt, &comp->steps[op->ch2],
10446|  6.67k|                                        first);
10447|  6.67k|	    CHECK_ERROR0;
  ------------------
  |  |  236|  6.67k|    if (ctxt->error != XPATH_EXPRESSION_OK) return(0)
  |  |  ------------------
  |  |  |  Branch (236:9): [True: 38, False: 6.63k]
  |  |  ------------------
  ------------------
10448|       |
10449|  6.63k|            arg2 = xmlXPathValuePop(ctxt);
10450|  6.63k|            arg1 = xmlXPathValuePop(ctxt);
10451|  6.63k|            if ((arg1 == NULL) || (arg1->type != XPATH_NODESET) ||
  ------------------
  |  Branch (10451:17): [True: 0, False: 6.63k]
  |  Branch (10451:35): [True: 3, False: 6.63k]
  ------------------
10452|  6.63k|                (arg2 == NULL) || (arg2->type != XPATH_NODESET)) {
  ------------------
  |  Branch (10452:17): [True: 0, False: 6.63k]
  |  Branch (10452:35): [True: 1, False: 6.63k]
  ------------------
10453|      4|	        xmlXPathReleaseObject(ctxt->context, arg1);
10454|      4|	        xmlXPathReleaseObject(ctxt->context, arg2);
10455|      4|                XP_ERROR0(XPATH_INVALID_TYPE);
  ------------------
  |  |  252|      4|    { xmlXPathErr(ctxt, X); return(0); }
  ------------------
10456|      0|            }
10457|  6.63k|            if ((ctxt->context->opLimit != 0) &&
  ------------------
  |  Branch (10457:17): [True: 6.63k, False: 0]
  ------------------
10458|  6.63k|                (((arg1->nodesetval != NULL) &&
  ------------------
  |  Branch (10458:19): [True: 6.63k, False: 0]
  ------------------
10459|  6.63k|                  (xmlXPathCheckOpLimit(ctxt,
  ------------------
  |  Branch (10459:19): [True: 0, False: 6.63k]
  ------------------
10460|  6.63k|                                        arg1->nodesetval->nodeNr) < 0)) ||
10461|  6.63k|                 ((arg2->nodesetval != NULL) &&
  ------------------
  |  Branch (10461:19): [True: 6.63k, False: 0]
  ------------------
10462|  6.63k|                  (xmlXPathCheckOpLimit(ctxt,
  ------------------
  |  Branch (10462:19): [True: 0, False: 6.63k]
  ------------------
10463|  6.63k|                                        arg2->nodesetval->nodeNr) < 0)))) {
10464|      0|	        xmlXPathReleaseObject(ctxt->context, arg1);
10465|      0|	        xmlXPathReleaseObject(ctxt->context, arg2);
10466|      0|                break;
10467|      0|            }
10468|       |
10469|  6.63k|            if ((arg2->nodesetval != NULL) &&
  ------------------
  |  Branch (10469:17): [True: 6.63k, False: 0]
  ------------------
10470|  6.63k|                (arg2->nodesetval->nodeNr != 0)) {
  ------------------
  |  Branch (10470:17): [True: 568, False: 6.06k]
  ------------------
10471|    568|                arg1->nodesetval = xmlXPathNodeSetMerge(arg1->nodesetval,
10472|    568|                                                        arg2->nodesetval);
10473|    568|                if (arg1->nodesetval == NULL)
  ------------------
  |  Branch (10473:21): [True: 1, False: 567]
  ------------------
10474|      1|                    xmlXPathPErrMemory(ctxt);
10475|    568|            }
10476|  6.63k|            xmlXPathValuePush(ctxt, arg1);
10477|  6.63k|	    xmlXPathReleaseObject(ctxt->context, arg2);
10478|  6.63k|            total += cur;
10479|  6.63k|            break;
10480|    124|        case XPATH_OP_ROOT:
  ------------------
  |  Branch (10480:9): [True: 124, False: 22.1k]
  ------------------
10481|    124|            xmlXPathRoot(ctxt);
10482|    124|            break;
10483|    627|        case XPATH_OP_NODE:
  ------------------
  |  Branch (10483:9): [True: 627, False: 21.6k]
  ------------------
10484|    627|            if (op->ch1 != -1)
  ------------------
  |  Branch (10484:17): [True: 0, False: 627]
  ------------------
10485|      0|                total += xmlXPathCompOpEval(ctxt, &comp->steps[op->ch1]);
10486|    627|	    CHECK_ERROR0;
  ------------------
  |  |  236|    627|    if (ctxt->error != XPATH_EXPRESSION_OK) return(0)
  |  |  ------------------
  |  |  |  Branch (236:9): [True: 0, False: 627]
  |  |  ------------------
  ------------------
10487|    627|            if (op->ch2 != -1)
  ------------------
  |  Branch (10487:17): [True: 0, False: 627]
  ------------------
10488|      0|                total += xmlXPathCompOpEval(ctxt, &comp->steps[op->ch2]);
10489|    627|	    CHECK_ERROR0;
  ------------------
  |  |  236|    627|    if (ctxt->error != XPATH_EXPRESSION_OK) return(0)
  |  |  ------------------
  |  |  |  Branch (236:9): [True: 0, False: 627]
  |  |  ------------------
  ------------------
10490|    627|	    xmlXPathValuePush(ctxt, xmlXPathCacheNewNodeSet(ctxt,
10491|    627|		ctxt->context->node));
10492|    627|            break;
10493|  7.30k|        case XPATH_OP_COLLECT:{
  ------------------
  |  Branch (10493:9): [True: 7.30k, False: 14.9k]
  ------------------
10494|  7.30k|                if (op->ch1 == -1)
  ------------------
  |  Branch (10494:21): [True: 0, False: 7.30k]
  ------------------
10495|      0|                    break;
10496|       |
10497|  7.30k|                total = xmlXPathCompOpEval(ctxt, &comp->steps[op->ch1]);
10498|  7.30k|		CHECK_ERROR0;
  ------------------
  |  |  236|  7.30k|    if (ctxt->error != XPATH_EXPRESSION_OK) return(0)
  |  |  ------------------
  |  |  |  Branch (236:9): [True: 8, False: 7.30k]
  |  |  ------------------
  ------------------
10499|       |
10500|  7.30k|                total += xmlXPathNodeCollectAndTest(ctxt, op, first, NULL, 0);
10501|  7.30k|                break;
10502|  7.30k|            }
10503|      5|        case XPATH_OP_VALUE:
  ------------------
  |  Branch (10503:9): [True: 5, False: 22.2k]
  ------------------
10504|      5|            xmlXPathValuePush(ctxt, xmlXPathCacheObjectCopy(ctxt, op->value4));
10505|      5|            break;
10506|  2.10k|        case XPATH_OP_SORT:
  ------------------
  |  Branch (10506:9): [True: 2.10k, False: 20.1k]
  ------------------
10507|  2.10k|            if (op->ch1 != -1)
  ------------------
  |  Branch (10507:17): [True: 2.10k, False: 0]
  ------------------
10508|  2.10k|                total +=
10509|  2.10k|                    xmlXPathCompOpEvalFirst(ctxt, &comp->steps[op->ch1],
10510|  2.10k|                                            first);
10511|  2.10k|	    CHECK_ERROR0;
  ------------------
  |  |  236|  2.10k|    if (ctxt->error != XPATH_EXPRESSION_OK) return(0)
  |  |  ------------------
  |  |  |  Branch (236:9): [True: 55, False: 2.04k]
  |  |  ------------------
  ------------------
10512|  2.04k|            if ((ctxt->value != NULL)
  ------------------
  |  Branch (10512:17): [True: 2.04k, False: 0]
  ------------------
10513|  2.04k|                && (ctxt->value->type == XPATH_NODESET)
  ------------------
  |  Branch (10513:20): [True: 1.93k, False: 109]
  ------------------
10514|  1.93k|                && (ctxt->value->nodesetval != NULL)
  ------------------
  |  Branch (10514:20): [True: 1.93k, False: 0]
  ------------------
10515|  1.93k|		&& (ctxt->value->nodesetval->nodeNr > 1))
  ------------------
  |  Branch (10515:6): [True: 325, False: 1.61k]
  ------------------
10516|    325|                xmlXPathNodeSetSort(ctxt->value->nodesetval);
10517|  2.04k|            break;
10518|      0|#ifdef XP_OPTIMIZED_FILTER_FIRST
10519|  5.03k|	case XPATH_OP_FILTER:
  ------------------
  |  Branch (10519:2): [True: 5.03k, False: 17.2k]
  ------------------
10520|  5.03k|                total += xmlXPathCompOpEvalFilterFirst(ctxt, op, first);
10521|  5.03k|            break;
10522|      0|#endif
10523|    114|        default:
  ------------------
  |  Branch (10523:9): [True: 114, False: 22.1k]
  ------------------
10524|    114|            total += xmlXPathCompOpEval(ctxt, op);
10525|    114|            break;
10526|  22.3k|    }
10527|       |
10528|  21.8k|    ctxt->context->depth -= 1;
10529|  21.8k|    return(total);
10530|  22.3k|}
xpath.c:xmlXPathCompOpEvalFilterFirst:
10668|  5.03k|{
10669|  5.03k|    int total = 0;
10670|  5.03k|    xmlXPathCompExprPtr comp;
10671|  5.03k|    xmlXPathObjectPtr obj;
10672|  5.03k|    xmlNodeSetPtr set;
10673|       |
10674|  5.03k|    CHECK_ERROR0;
  ------------------
  |  |  236|  5.03k|    if (ctxt->error != XPATH_EXPRESSION_OK) return(0)
  |  |  ------------------
  |  |  |  Branch (236:9): [True: 0, False: 5.03k]
  |  |  ------------------
  ------------------
10675|  5.03k|    comp = ctxt->comp;
10676|       |    /*
10677|       |    * Optimization for ()[last()] selection i.e. the last elem
10678|       |    */
10679|  5.03k|    if ((op->ch1 != -1) && (op->ch2 != -1) &&
  ------------------
  |  Branch (10679:9): [True: 5.03k, False: 0]
  |  Branch (10679:28): [True: 5.03k, False: 0]
  ------------------
10680|  5.03k|	(comp->steps[op->ch1].op == XPATH_OP_SORT) &&
  ------------------
  |  Branch (10680:2): [True: 3.67k, False: 1.35k]
  ------------------
10681|  3.67k|	(comp->steps[op->ch2].op == XPATH_OP_SORT)) {
  ------------------
  |  Branch (10681:2): [True: 2.94k, False: 730]
  ------------------
10682|  2.94k|	int f = comp->steps[op->ch2].ch1;
10683|       |
10684|  2.94k|	if ((f != -1) &&
  ------------------
  |  Branch (10684:6): [True: 2.94k, False: 0]
  ------------------
10685|  2.94k|	    (comp->steps[f].op == XPATH_OP_FUNCTION) &&
  ------------------
  |  Branch (10685:6): [True: 2.61k, False: 338]
  ------------------
10686|  2.61k|	    (comp->steps[f].value5 == NULL) &&
  ------------------
  |  Branch (10686:6): [True: 2.59k, False: 19]
  ------------------
10687|  2.59k|	    (comp->steps[f].value == 0) &&
  ------------------
  |  Branch (10687:6): [True: 2.51k, False: 81]
  ------------------
10688|  2.51k|	    (comp->steps[f].value4 != NULL) &&
  ------------------
  |  Branch (10688:6): [True: 2.51k, False: 0]
  ------------------
10689|  2.51k|	    (xmlStrEqual
  ------------------
  |  Branch (10689:6): [True: 2.44k, False: 69]
  ------------------
10690|  2.51k|	    (comp->steps[f].value4, BAD_CAST "last"))) {
  ------------------
  |  |   34|  2.51k|#define BAD_CAST (xmlChar *)
  ------------------
10691|  2.44k|	    xmlNodePtr last = NULL;
10692|       |
10693|  2.44k|	    total +=
10694|  2.44k|		xmlXPathCompOpEvalLast(ctxt,
10695|  2.44k|		    &comp->steps[op->ch1],
10696|  2.44k|		    &last);
10697|  2.44k|	    CHECK_ERROR0;
  ------------------
  |  |  236|  2.44k|    if (ctxt->error != XPATH_EXPRESSION_OK) return(0)
  |  |  ------------------
  |  |  |  Branch (236:9): [True: 9, False: 2.43k]
  |  |  ------------------
  ------------------
10698|       |	    /*
10699|       |	    * The nodeset should be in document order,
10700|       |	    * Keep only the last value
10701|       |	    */
10702|  2.43k|	    if ((ctxt->value != NULL) &&
  ------------------
  |  Branch (10702:10): [True: 2.43k, False: 0]
  ------------------
10703|  2.43k|		(ctxt->value->type == XPATH_NODESET) &&
  ------------------
  |  Branch (10703:3): [True: 2.42k, False: 10]
  ------------------
10704|  2.42k|		(ctxt->value->nodesetval != NULL) &&
  ------------------
  |  Branch (10704:3): [True: 2.42k, False: 0]
  ------------------
10705|  2.42k|		(ctxt->value->nodesetval->nodeTab != NULL) &&
  ------------------
  |  Branch (10705:3): [True: 2.16k, False: 259]
  ------------------
10706|  2.16k|		(ctxt->value->nodesetval->nodeNr > 1)) {
  ------------------
  |  Branch (10706:3): [True: 1.07k, False: 1.08k]
  ------------------
10707|  1.07k|                xmlXPathNodeSetKeepLast(ctxt->value->nodesetval);
10708|  1.07k|		*first = *(ctxt->value->nodesetval->nodeTab);
10709|  1.07k|	    }
10710|  2.43k|	    return (total);
10711|  2.44k|	}
10712|  2.94k|    }
10713|       |
10714|  2.59k|    if (op->ch1 != -1)
  ------------------
  |  Branch (10714:9): [True: 2.59k, False: 0]
  ------------------
10715|  2.59k|	total += xmlXPathCompOpEval(ctxt, &comp->steps[op->ch1]);
10716|  2.59k|    CHECK_ERROR0;
  ------------------
  |  |  236|  2.59k|    if (ctxt->error != XPATH_EXPRESSION_OK) return(0)
  |  |  ------------------
  |  |  |  Branch (236:9): [True: 1.19k, False: 1.40k]
  |  |  ------------------
  ------------------
10717|  1.40k|    if (op->ch2 == -1)
  ------------------
  |  Branch (10717:9): [True: 0, False: 1.40k]
  ------------------
10718|      0|	return (total);
10719|  1.40k|    if (ctxt->value == NULL)
  ------------------
  |  Branch (10719:9): [True: 0, False: 1.40k]
  ------------------
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.40k|    CHECK_TYPE0(XPATH_NODESET);
  ------------------
  |  |  271|  1.40k|    if ((ctxt->value == NULL) || (ctxt->value->type != typeval))	\
  |  |  ------------------
  |  |  |  Branch (271:9): [True: 0, False: 1.40k]
  |  |  |  Branch (271:34): [True: 10, False: 1.39k]
  |  |  ------------------
  |  |  272|  1.40k|        XP_ERROR0(XPATH_INVALID_TYPE)
  |  |  ------------------
  |  |  |  |  252|     10|    { xmlXPathErr(ctxt, X); return(0); }
  |  |  ------------------
  ------------------
10728|  1.39k|    obj = xmlXPathValuePop(ctxt);
10729|  1.39k|    set = obj->nodesetval;
10730|  1.39k|    if (set != NULL) {
  ------------------
  |  Branch (10730:9): [True: 1.39k, False: 0]
  ------------------
10731|  1.39k|        xmlXPathNodeSetFilter(ctxt, set, op->ch2, 1, 1, 1);
10732|  1.39k|        if (set->nodeNr > 0)
  ------------------
  |  Branch (10732:13): [True: 708, False: 685]
  ------------------
10733|    708|            *first = set->nodeTab[0];
10734|  1.39k|    }
10735|  1.39k|    xmlXPathValuePush(ctxt, obj);
10736|       |
10737|  1.39k|    return (total);
10738|  1.40k|}
xpath.c:xmlXPathCompOpEvalLast:
10544|  40.0k|{
10545|  40.0k|    int total = 0, cur;
10546|  40.0k|    xmlXPathCompExprPtr comp;
10547|  40.0k|    xmlXPathObjectPtr arg1, arg2;
10548|       |
10549|  40.0k|    CHECK_ERROR0;
  ------------------
  |  |  236|  40.0k|    if (ctxt->error != XPATH_EXPRESSION_OK) return(0)
  |  |  ------------------
  |  |  |  Branch (236:9): [True: 0, False: 40.0k]
  |  |  ------------------
  ------------------
10550|  40.0k|    if (OP_LIMIT_EXCEEDED(ctxt, 1))
  ------------------
  |  |  818|  40.0k|    ((ctxt->context->opLimit != 0) && (xmlXPathCheckOpLimit(ctxt, n) < 0))
  |  |  ------------------
  |  |  |  Branch (818:6): [True: 40.0k, False: 0]
  |  |  |  Branch (818:39): [True: 1, False: 40.0k]
  |  |  ------------------
  ------------------
10551|      1|        return(0);
10552|  40.0k|    if (ctxt->context->depth >= XPATH_MAX_RECURSION_DEPTH)
  ------------------
  |  |  112|  40.0k|#define XPATH_MAX_RECURSION_DEPTH 500
  ------------------
  |  Branch (10552:9): [True: 0, False: 40.0k]
  ------------------
10553|  40.0k|        XP_ERROR0(XPATH_RECURSION_LIMIT_EXCEEDED);
  ------------------
  |  |  252|      0|    { xmlXPathErr(ctxt, X); return(0); }
  ------------------
10554|  40.0k|    ctxt->context->depth += 1;
10555|  40.0k|    comp = ctxt->comp;
10556|  40.0k|    switch (op->op) {
10557|      0|        case XPATH_OP_END:
  ------------------
  |  Branch (10557:9): [True: 0, False: 40.0k]
  ------------------
10558|      0|            break;
10559|  15.7k|        case XPATH_OP_UNION:
  ------------------
  |  Branch (10559:9): [True: 15.7k, False: 24.3k]
  ------------------
10560|  15.7k|            total =
10561|  15.7k|                xmlXPathCompOpEvalLast(ctxt, &comp->steps[op->ch1], last);
10562|  15.7k|	    CHECK_ERROR0;
  ------------------
  |  |  236|  15.7k|    if (ctxt->error != XPATH_EXPRESSION_OK) return(0)
  |  |  ------------------
  |  |  |  Branch (236:9): [True: 97, False: 15.6k]
  |  |  ------------------
  ------------------
10563|  15.6k|            if ((ctxt->value != NULL)
  ------------------
  |  Branch (10563:17): [True: 15.6k, False: 0]
  ------------------
10564|  15.6k|                && (ctxt->value->type == XPATH_NODESET)
  ------------------
  |  Branch (10564:20): [True: 15.6k, False: 1]
  ------------------
10565|  15.6k|                && (ctxt->value->nodesetval != NULL)
  ------------------
  |  Branch (10565:20): [True: 15.6k, False: 0]
  ------------------
10566|  15.6k|                && (ctxt->value->nodesetval->nodeNr >= 1)) {
  ------------------
  |  Branch (10566:20): [True: 11.1k, False: 4.56k]
  ------------------
10567|       |                /*
10568|       |                 * limit tree traversing to first node in the result
10569|       |                 */
10570|  11.1k|		if (ctxt->value->nodesetval->nodeNr > 1)
  ------------------
  |  Branch (10570:7): [True: 2.38k, False: 8.71k]
  ------------------
10571|  2.38k|		    xmlXPathNodeSetSort(ctxt->value->nodesetval);
10572|  11.1k|                *last =
10573|  11.1k|                    ctxt->value->nodesetval->nodeTab[ctxt->value->
10574|  11.1k|                                                     nodesetval->nodeNr -
10575|  11.1k|                                                     1];
10576|  11.1k|            }
10577|  15.6k|            cur =
10578|  15.6k|                xmlXPathCompOpEvalLast(ctxt, &comp->steps[op->ch2], last);
10579|  15.6k|	    CHECK_ERROR0;
  ------------------
  |  |  236|  15.6k|    if (ctxt->error != XPATH_EXPRESSION_OK) return(0)
  |  |  ------------------
  |  |  |  Branch (236:9): [True: 25, False: 15.6k]
  |  |  ------------------
  ------------------
10580|  15.6k|            if ((ctxt->value != NULL)
  ------------------
  |  Branch (10580:17): [True: 15.6k, False: 0]
  ------------------
10581|  15.6k|                && (ctxt->value->type == XPATH_NODESET)
  ------------------
  |  Branch (10581:20): [True: 15.6k, False: 2]
  ------------------
10582|  15.6k|                && (ctxt->value->nodesetval != NULL)
  ------------------
  |  Branch (10582:20): [True: 15.6k, False: 0]
  ------------------
10583|  15.6k|                && (ctxt->value->nodesetval->nodeNr >= 1)) { /* TODO: NOP ? */
  ------------------
  |  Branch (10583:20): [True: 4.49k, False: 11.1k]
  ------------------
10584|  4.49k|            }
10585|       |
10586|  15.6k|            arg2 = xmlXPathValuePop(ctxt);
10587|  15.6k|            arg1 = xmlXPathValuePop(ctxt);
10588|  15.6k|            if ((arg1 == NULL) || (arg1->type != XPATH_NODESET) ||
  ------------------
  |  Branch (10588:17): [True: 0, False: 15.6k]
  |  Branch (10588:35): [True: 1, False: 15.6k]
  ------------------
10589|  15.6k|                (arg2 == NULL) || (arg2->type != XPATH_NODESET)) {
  ------------------
  |  Branch (10589:17): [True: 0, False: 15.6k]
  |  Branch (10589:35): [True: 1, False: 15.6k]
  ------------------
10590|      2|	        xmlXPathReleaseObject(ctxt->context, arg1);
10591|      2|	        xmlXPathReleaseObject(ctxt->context, arg2);
10592|      2|                XP_ERROR0(XPATH_INVALID_TYPE);
  ------------------
  |  |  252|      2|    { xmlXPathErr(ctxt, X); return(0); }
  ------------------
10593|      0|            }
10594|  15.6k|            if ((ctxt->context->opLimit != 0) &&
  ------------------
  |  Branch (10594:17): [True: 15.6k, False: 0]
  ------------------
10595|  15.6k|                (((arg1->nodesetval != NULL) &&
  ------------------
  |  Branch (10595:19): [True: 15.6k, False: 0]
  ------------------
10596|  15.6k|                  (xmlXPathCheckOpLimit(ctxt,
  ------------------
  |  Branch (10596:19): [True: 1, False: 15.6k]
  ------------------
10597|  15.6k|                                        arg1->nodesetval->nodeNr) < 0)) ||
10598|  15.6k|                 ((arg2->nodesetval != NULL) &&
  ------------------
  |  Branch (10598:19): [True: 15.6k, False: 0]
  ------------------
10599|  15.6k|                  (xmlXPathCheckOpLimit(ctxt,
  ------------------
  |  Branch (10599:19): [True: 0, False: 15.6k]
  ------------------
10600|  15.6k|                                        arg2->nodesetval->nodeNr) < 0)))) {
10601|      1|	        xmlXPathReleaseObject(ctxt->context, arg1);
10602|      1|	        xmlXPathReleaseObject(ctxt->context, arg2);
10603|      1|                break;
10604|      1|            }
10605|       |
10606|  15.6k|            if ((arg2->nodesetval != NULL) &&
  ------------------
  |  Branch (10606:17): [True: 15.6k, False: 0]
  ------------------
10607|  15.6k|                (arg2->nodesetval->nodeNr != 0)) {
  ------------------
  |  Branch (10607:17): [True: 4.49k, False: 11.1k]
  ------------------
10608|  4.49k|                arg1->nodesetval = xmlXPathNodeSetMerge(arg1->nodesetval,
10609|  4.49k|                                                        arg2->nodesetval);
10610|  4.49k|                if (arg1->nodesetval == NULL)
  ------------------
  |  Branch (10610:21): [True: 2, False: 4.49k]
  ------------------
10611|      2|                    xmlXPathPErrMemory(ctxt);
10612|  4.49k|            }
10613|  15.6k|            xmlXPathValuePush(ctxt, arg1);
10614|  15.6k|	    xmlXPathReleaseObject(ctxt->context, arg2);
10615|  15.6k|            total += cur;
10616|  15.6k|            break;
10617|    233|        case XPATH_OP_ROOT:
  ------------------
  |  Branch (10617:9): [True: 233, False: 39.8k]
  ------------------
10618|    233|            xmlXPathRoot(ctxt);
10619|    233|            break;
10620|  1.06k|        case XPATH_OP_NODE:
  ------------------
  |  Branch (10620:9): [True: 1.06k, False: 39.0k]
  ------------------
10621|  1.06k|            if (op->ch1 != -1)
  ------------------
  |  Branch (10621:17): [True: 0, False: 1.06k]
  ------------------
10622|      0|                total += xmlXPathCompOpEval(ctxt, &comp->steps[op->ch1]);
10623|  1.06k|	    CHECK_ERROR0;
  ------------------
  |  |  236|  1.06k|    if (ctxt->error != XPATH_EXPRESSION_OK) return(0)
  |  |  ------------------
  |  |  |  Branch (236:9): [True: 0, False: 1.06k]
  |  |  ------------------
  ------------------
10624|  1.06k|            if (op->ch2 != -1)
  ------------------
  |  Branch (10624:17): [True: 0, False: 1.06k]
  ------------------
10625|      0|                total += xmlXPathCompOpEval(ctxt, &comp->steps[op->ch2]);
10626|  1.06k|	    CHECK_ERROR0;
  ------------------
  |  |  236|  1.06k|    if (ctxt->error != XPATH_EXPRESSION_OK) return(0)
  |  |  ------------------
  |  |  |  Branch (236:9): [True: 0, False: 1.06k]
  |  |  ------------------
  ------------------
10627|  1.06k|	    xmlXPathValuePush(ctxt, xmlXPathCacheNewNodeSet(ctxt,
10628|  1.06k|		ctxt->context->node));
10629|  1.06k|            break;
10630|  18.6k|        case XPATH_OP_COLLECT:{
  ------------------
  |  Branch (10630:9): [True: 18.6k, False: 21.4k]
  ------------------
10631|  18.6k|                if (op->ch1 == -1)
  ------------------
  |  Branch (10631:21): [True: 0, False: 18.6k]
  ------------------
10632|      0|                    break;
10633|       |
10634|  18.6k|                total += xmlXPathCompOpEval(ctxt, &comp->steps[op->ch1]);
10635|  18.6k|		CHECK_ERROR0;
  ------------------
  |  |  236|  18.6k|    if (ctxt->error != XPATH_EXPRESSION_OK) return(0)
  |  |  ------------------
  |  |  |  Branch (236:9): [True: 15, False: 18.6k]
  |  |  ------------------
  ------------------
10636|       |
10637|  18.6k|                total += xmlXPathNodeCollectAndTest(ctxt, op, NULL, last, 0);
10638|  18.6k|                break;
10639|  18.6k|            }
10640|      4|        case XPATH_OP_VALUE:
  ------------------
  |  Branch (10640:9): [True: 4, False: 40.0k]
  ------------------
10641|      4|            xmlXPathValuePush(ctxt, xmlXPathCacheObjectCopy(ctxt, op->value4));
10642|      4|            break;
10643|  4.32k|        case XPATH_OP_SORT:
  ------------------
  |  Branch (10643:9): [True: 4.32k, False: 35.7k]
  ------------------
10644|  4.32k|            if (op->ch1 != -1)
  ------------------
  |  Branch (10644:17): [True: 4.32k, False: 0]
  ------------------
10645|  4.32k|                total +=
10646|  4.32k|                    xmlXPathCompOpEvalLast(ctxt, &comp->steps[op->ch1],
10647|  4.32k|                                           last);
10648|  4.32k|	    CHECK_ERROR0;
  ------------------
  |  |  236|  4.32k|    if (ctxt->error != XPATH_EXPRESSION_OK) return(0)
  |  |  ------------------
  |  |  |  Branch (236:9): [True: 41, False: 4.28k]
  |  |  ------------------
  ------------------
10649|  4.28k|            if ((ctxt->value != NULL)
  ------------------
  |  Branch (10649:17): [True: 4.28k, False: 0]
  ------------------
10650|  4.28k|                && (ctxt->value->type == XPATH_NODESET)
  ------------------
  |  Branch (10650:20): [True: 4.23k, False: 50]
  ------------------
10651|  4.23k|                && (ctxt->value->nodesetval != NULL)
  ------------------
  |  Branch (10651:20): [True: 4.23k, False: 0]
  ------------------
10652|  4.23k|		&& (ctxt->value->nodesetval->nodeNr > 1))
  ------------------
  |  Branch (10652:6): [True: 1.43k, False: 2.80k]
  ------------------
10653|  1.43k|                xmlXPathNodeSetSort(ctxt->value->nodesetval);
10654|  4.28k|            break;
10655|     53|        default:
  ------------------
  |  Branch (10655:9): [True: 53, False: 40.0k]
  ------------------
10656|     53|            total += xmlXPathCompOpEval(ctxt, op);
10657|     53|            break;
10658|  40.0k|    }
10659|       |
10660|  39.9k|    ctxt->context->depth -= 1;
10661|  39.9k|    return (total);
10662|  40.0k|}
xpath.c:xmlXPathNodeSetKeepLast:
 3167|  1.43k|{
 3168|  1.43k|    int i;
 3169|  1.43k|    xmlNodePtr node;
 3170|       |
 3171|  1.43k|    if ((set == NULL) || (set->nodeNr <= 1))
  ------------------
  |  Branch (3171:9): [True: 0, False: 1.43k]
  |  Branch (3171:26): [True: 0, False: 1.43k]
  ------------------
 3172|      0|	return;
 3173|  10.4k|    for (i = 0; i < set->nodeNr - 1; i++) {
  ------------------
  |  Branch (3173:17): [True: 8.97k, False: 1.43k]
  ------------------
 3174|  8.97k|        node = set->nodeTab[i];
 3175|  8.97k|        if ((node != NULL) &&
  ------------------
  |  Branch (3175:13): [True: 8.97k, False: 0]
  ------------------
 3176|  8.97k|            (node->type == XML_NAMESPACE_DECL))
  ------------------
  |  Branch (3176:13): [True: 0, False: 8.97k]
  ------------------
 3177|      0|            xmlXPathNodeSetFreeNs((xmlNsPtr) node);
 3178|  8.97k|    }
 3179|  1.43k|    set->nodeTab[0] = set->nodeTab[set->nodeNr-1];
 3180|  1.43k|    set->nodeNr = 1;
 3181|  1.43k|}

xmlXPtrEval:
  607|  10.4k|xmlXPtrEval(const xmlChar *str, xmlXPathContext *ctx) {
  608|  10.4k|    xmlXPathParserContextPtr ctxt;
  609|  10.4k|    xmlXPathObjectPtr res = NULL, tmp;
  610|  10.4k|    xmlXPathObjectPtr init = NULL;
  611|  10.4k|    int stack = 0;
  612|       |
  613|  10.4k|    xmlInitParser();
  614|       |
  615|  10.4k|    if ((ctx == NULL) || (str == NULL))
  ------------------
  |  Branch (615:9): [True: 0, False: 10.4k]
  |  Branch (615:26): [True: 0, False: 10.4k]
  ------------------
  616|      0|	return(NULL);
  617|       |
  618|  10.4k|    xmlResetError(&ctx->lastError);
  619|       |
  620|  10.4k|    ctxt = xmlXPathNewParserContext(str, ctx);
  621|  10.4k|    if (ctxt == NULL) {
  ------------------
  |  Branch (621:9): [True: 77, False: 10.3k]
  ------------------
  622|     77|        xmlXPathErrMemory(ctx);
  623|     77|	return(NULL);
  624|     77|    }
  625|  10.3k|    xmlXPtrEvalXPointer(ctxt);
  626|  10.3k|    if (ctx->lastError.code != XML_ERR_OK)
  ------------------
  |  Branch (626:9): [True: 7.02k, False: 3.34k]
  ------------------
  627|  7.02k|        goto error;
  628|       |
  629|  3.34k|    if ((ctxt->value != NULL) &&
  ------------------
  |  Branch (629:9): [True: 1.01k, False: 2.32k]
  ------------------
  630|  1.01k|	(ctxt->value->type != XPATH_NODESET)) {
  ------------------
  |  Branch (630:2): [True: 0, False: 1.01k]
  ------------------
  631|      0|        xmlXPtrErr(ctxt, XML_XPTR_EVAL_FAILED,
  632|      0|		"xmlXPtrEval: evaluation failed to return a node set\n",
  633|      0|		   NULL);
  634|  3.34k|    } else {
  635|  3.34k|	res = xmlXPathValuePop(ctxt);
  636|  3.34k|    }
  637|       |
  638|  3.34k|    do {
  639|  3.34k|        tmp = xmlXPathValuePop(ctxt);
  640|  3.34k|	if (tmp != NULL) {
  ------------------
  |  Branch (640:6): [True: 0, False: 3.34k]
  ------------------
  641|      0|	    if (tmp != init) {
  ------------------
  |  Branch (641:10): [True: 0, False: 0]
  ------------------
  642|      0|		if (tmp->type == XPATH_NODESET) {
  ------------------
  |  Branch (642:7): [True: 0, False: 0]
  ------------------
  643|       |		    /*
  644|       |		     * Evaluation may push a root nodeset which is unused
  645|       |		     */
  646|      0|		    xmlNodeSetPtr set;
  647|      0|		    set = tmp->nodesetval;
  648|      0|		    if ((set == NULL) || (set->nodeNr != 1) ||
  ------------------
  |  Branch (648:11): [True: 0, False: 0]
  |  Branch (648:28): [True: 0, False: 0]
  ------------------
  649|      0|			(set->nodeTab[0] != (xmlNodePtr) ctx->doc))
  ------------------
  |  Branch (649:4): [True: 0, False: 0]
  ------------------
  650|      0|			stack++;
  651|      0|		} else
  652|      0|		    stack++;
  653|      0|	    }
  654|      0|	    xmlXPathFreeObject(tmp);
  655|      0|        }
  656|  3.34k|    } while (tmp != NULL);
  ------------------
  |  Branch (656:14): [True: 0, False: 3.34k]
  ------------------
  657|  3.34k|    if (stack != 0) {
  ------------------
  |  Branch (657:9): [True: 0, False: 3.34k]
  ------------------
  658|      0|        xmlXPtrErr(ctxt, XML_XPTR_EXTRA_OBJECTS,
  659|      0|		   "xmlXPtrEval: object(s) left on the eval stack\n",
  660|      0|		   NULL);
  661|      0|    }
  662|  3.34k|    if (ctx->lastError.code != XML_ERR_OK) {
  ------------------
  |  Branch (662:9): [True: 0, False: 3.34k]
  ------------------
  663|      0|	xmlXPathFreeObject(res);
  664|      0|	res = NULL;
  665|      0|    }
  666|       |
  667|  10.3k|error:
  668|  10.3k|    xmlXPathFreeParserContext(ctxt);
  669|  10.3k|    return(res);
  670|  3.34k|}
xpointer.c:xmlXPtrEvalXPointer:
  528|  10.3k|xmlXPtrEvalXPointer(xmlXPathParserContextPtr ctxt) {
  529|  10.3k|    if (ctxt->valueTab == NULL) {
  ------------------
  |  Branch (529:9): [True: 10.3k, False: 0]
  ------------------
  530|       |	/* Allocate the value stack */
  531|  10.3k|	ctxt->valueTab = (xmlXPathObjectPtr *)
  532|  10.3k|			 xmlMalloc(10 * sizeof(xmlXPathObjectPtr));
  533|  10.3k|	if (ctxt->valueTab == NULL) {
  ------------------
  |  Branch (533:6): [True: 38, False: 10.3k]
  ------------------
  534|     38|	    xmlXPathPErrMemory(ctxt);
  535|     38|	    return;
  536|     38|	}
  537|  10.3k|	ctxt->valueNr = 0;
  538|  10.3k|	ctxt->valueMax = 10;
  539|  10.3k|	ctxt->value = NULL;
  540|  10.3k|    }
  541|  10.3k|    SKIP_BLANKS;
  ------------------
  |  |  178|  10.3k|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  |  181|  12.8k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (181:15): [True: 2.47k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  542|  10.3k|    if (CUR == '/') {
  ------------------
  |  |  173|  10.3k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (542:9): [True: 206, False: 10.1k]
  ------------------
  543|    206|	xmlXPathRoot(ctxt);
  544|    206|        xmlXPtrEvalChildSeq(ctxt, NULL);
  545|  10.1k|    } else {
  546|  10.1k|	xmlChar *name;
  547|       |
  548|  10.1k|	name = xmlXPathParseName(ctxt);
  549|  10.1k|	if (name == NULL)
  ------------------
  |  Branch (549:6): [True: 77, False: 10.0k]
  ------------------
  550|  10.0k|	    XP_ERROR(XPATH_EXPR_ERROR);
  ------------------
  |  |  244|     77|    { xmlXPathErr(ctxt, X); return; }
  ------------------
  551|  10.0k|	if (CUR == '(') {
  ------------------
  |  |  173|  10.0k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (551:6): [True: 9.60k, False: 437]
  ------------------
  552|  9.60k|	    xmlXPtrEvalFullXPtr(ctxt, name);
  553|       |	    /* Short evaluation */
  554|  9.60k|	    return;
  555|  9.60k|	} else {
  556|       |	    /* this handle both Bare Names and Child Sequences */
  557|    437|	    xmlXPtrEvalChildSeq(ctxt, name);
  558|    437|	}
  559|  10.0k|    }
  560|    643|    SKIP_BLANKS;
  ------------------
  |  |  178|  2.48k|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  |  181|  12.8k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (181:15): [True: 2.48k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  561|    643|    if (CUR != 0)
  ------------------
  |  |  173|    643|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (561:9): [True: 386, False: 257]
  ------------------
  562|    386|	XP_ERROR(XPATH_EXPR_ERROR);
  ------------------
  |  |  244|    386|    { xmlXPathErr(ctxt, X); return; }
  ------------------
  563|    257|}
xpointer.c:xmlXPtrEvalChildSeq:
  478|    681|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|    681|    if ((name == NULL) && (CUR == '/') && (NXT(1) != '1')) {
  ------------------
  |  |  173|    209|#define CUR (*ctxt->cur)
  ------------------
                  if ((name == NULL) && (CUR == '/') && (NXT(1) != '1')) {
  ------------------
  |  |  175|    209|#define NXT(val) ctxt->cur[(val)]
  ------------------
  |  Branch (483:9): [True: 209, False: 472]
  |  Branch (483:27): [True: 209, False: 0]
  |  Branch (483:43): [True: 62, False: 147]
  ------------------
  484|     62|        xmlXPtrErr(ctxt, XML_XPTR_CHILDSEQ_START,
  485|     62|		   "warning: ChildSeq not starting by /1\n", NULL);
  486|     62|    }
  487|       |
  488|    681|    if (name != NULL) {
  ------------------
  |  Branch (488:9): [True: 472, False: 209]
  ------------------
  489|    472|	xmlXPathValuePush(ctxt, xmlXPathNewString(name));
  490|    472|	xmlFree(name);
  491|    472|	xmlXPathIdFunction(ctxt, 1);
  492|    472|	CHECK_ERROR;
  ------------------
  |  |  230|    472|    if (ctxt->error != XPATH_EXPRESSION_OK) return
  |  |  ------------------
  |  |  |  Branch (230:9): [True: 17, False: 455]
  |  |  ------------------
  ------------------
  493|    472|    }
  494|       |
  495|  2.06k|    while (CUR == '/') {
  ------------------
  |  |  173|  2.06k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (495:12): [True: 1.40k, False: 664]
  ------------------
  496|  1.40k|	int child = 0, overflow = 0;
  497|  1.40k|	NEXT;
  ------------------
  |  |  181|  1.40k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  ------------------
  |  |  |  Branch (181:15): [True: 1.40k, False: 0]
  |  |  ------------------
  ------------------
  498|       |
  499|  4.65k|	while ((CUR >= '0') && (CUR <= '9')) {
  ------------------
  |  |  173|  4.65k|#define CUR (*ctxt->cur)
  ------------------
              	while ((CUR >= '0') && (CUR <= '9')) {
  ------------------
  |  |  173|  3.49k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (499:9): [True: 3.49k, False: 1.15k]
  |  Branch (499:25): [True: 3.25k, False: 243]
  ------------------
  500|  3.25k|            int d = CUR - '0';
  ------------------
  |  |  173|  3.25k|#define CUR (*ctxt->cur)
  ------------------
  501|  3.25k|            if (child > INT_MAX / 10)
  ------------------
  |  Branch (501:17): [True: 792, False: 2.46k]
  ------------------
  502|    792|                overflow = 1;
  503|  2.46k|            else
  504|  2.46k|                child *= 10;
  505|  3.25k|            if (child > INT_MAX - d)
  ------------------
  |  Branch (505:17): [True: 220, False: 3.03k]
  ------------------
  506|    220|                overflow = 1;
  507|  3.03k|            else
  508|  3.03k|                child += d;
  509|  3.25k|	    NEXT;
  ------------------
  |  |  181|  3.25k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  ------------------
  |  |  |  Branch (181:15): [True: 3.25k, False: 0]
  |  |  ------------------
  ------------------
  510|  3.25k|	}
  511|  1.40k|        if (overflow)
  ------------------
  |  Branch (511:13): [True: 57, False: 1.34k]
  ------------------
  512|     57|            child = 0;
  513|  1.40k|	xmlXPtrGetChildNo(ctxt, child);
  514|  1.40k|    }
  515|    664|}
xpointer.c:xmlXPtrGetChildNo:
  191|  1.40k|xmlXPtrGetChildNo(xmlXPathParserContextPtr ctxt, int indx) {
  192|  1.40k|    xmlNodePtr cur = NULL;
  193|  1.40k|    xmlXPathObjectPtr obj;
  194|  1.40k|    xmlNodeSetPtr oldset;
  195|       |
  196|  1.40k|    CHECK_TYPE(XPATH_NODESET);
  ------------------
  |  |  261|  1.40k|    if ((ctxt->value == NULL) || (ctxt->value->type != typeval))	\
  |  |  ------------------
  |  |  |  Branch (261:9): [True: 282, False: 1.11k]
  |  |  |  Branch (261:34): [True: 0, False: 1.11k]
  |  |  ------------------
  |  |  262|  1.40k|        XP_ERROR(XPATH_INVALID_TYPE)
  |  |  ------------------
  |  |  |  |  244|    282|    { xmlXPathErr(ctxt, X); return; }
  |  |  ------------------
  ------------------
  197|  1.11k|    obj = xmlXPathValuePop(ctxt);
  198|  1.11k|    oldset = obj->nodesetval;
  199|  1.11k|    if ((indx <= 0) || (oldset == NULL) || (oldset->nodeNr != 1)) {
  ------------------
  |  Branch (199:9): [True: 688, False: 430]
  |  Branch (199:24): [True: 0, False: 430]
  |  Branch (199:44): [True: 153, False: 277]
  ------------------
  200|    841|	xmlXPathFreeObject(obj);
  201|    841|	xmlXPathValuePush(ctxt, xmlXPathNewNodeSet(NULL));
  202|    841|	return;
  203|    841|    }
  204|    277|    cur = xmlXPtrGetNthChild(oldset->nodeTab[0], indx);
  205|    277|    if (cur == NULL) {
  ------------------
  |  Branch (205:9): [True: 162, False: 115]
  ------------------
  206|    162|	xmlXPathFreeObject(obj);
  207|    162|	xmlXPathValuePush(ctxt, xmlXPathNewNodeSet(NULL));
  208|    162|	return;
  209|    162|    }
  210|    115|    oldset->nodeTab[0] = cur;
  211|    115|    xmlXPathValuePush(ctxt, obj);
  212|    115|}
xpointer.c:xmlXPtrGetNthChild:
  124|    277|xmlXPtrGetNthChild(xmlNodePtr cur, int no) {
  125|    277|    int i;
  126|    277|    if ((cur == NULL) || (cur->type == XML_NAMESPACE_DECL))
  ------------------
  |  Branch (126:9): [True: 0, False: 277]
  |  Branch (126:26): [True: 0, False: 277]
  ------------------
  127|      0|	return(cur);
  128|    277|    cur = cur->children;
  129|  2.32k|    for (i = 0;i <= no;cur = cur->next) {
  ------------------
  |  Branch (129:16): [True: 2.32k, False: 0]
  ------------------
  130|  2.32k|	if (cur == NULL)
  ------------------
  |  Branch (130:6): [True: 162, False: 2.16k]
  ------------------
  131|    162|	    return(cur);
  132|  2.16k|	if ((cur->type == XML_ELEMENT_NODE) ||
  ------------------
  |  Branch (132:6): [True: 1.63k, False: 524]
  ------------------
  133|    524|	    (cur->type == XML_DOCUMENT_NODE) ||
  ------------------
  |  Branch (133:6): [True: 0, False: 524]
  ------------------
  134|  1.63k|	    (cur->type == XML_HTML_DOCUMENT_NODE)) {
  ------------------
  |  Branch (134:6): [True: 0, False: 524]
  ------------------
  135|  1.63k|	    i++;
  136|  1.63k|	    if (i == no)
  ------------------
  |  Branch (136:10): [True: 115, False: 1.52k]
  ------------------
  137|    115|		break;
  138|  1.63k|	}
  139|  2.16k|    }
  140|    115|    return(cur);
  141|    277|}
xpointer.c:xmlXPtrEvalFullXPtr:
  415|  9.60k|xmlXPtrEvalFullXPtr(xmlXPathParserContextPtr ctxt, xmlChar *name) {
  416|  9.60k|    if (name == NULL)
  ------------------
  |  Branch (416:9): [True: 0, False: 9.60k]
  ------------------
  417|      0|    name = xmlXPathParseName(ctxt);
  418|  9.60k|    if (name == NULL)
  ------------------
  |  Branch (418:9): [True: 0, False: 9.60k]
  ------------------
  419|  9.60k|	XP_ERROR(XPATH_EXPR_ERROR);
  ------------------
  |  |  244|      0|    { xmlXPathErr(ctxt, X); return; }
  ------------------
  420|  14.3k|    while (name != NULL) {
  ------------------
  |  Branch (420:12): [True: 11.8k, False: 2.53k]
  ------------------
  421|  11.8k|	ctxt->error = XPATH_EXPRESSION_OK;
  422|  11.8k|	xmlXPtrEvalXPtrPart(ctxt, name);
  423|       |
  424|       |	/* in case of syntax error, break here */
  425|  11.8k|	if ((ctxt->error != XPATH_EXPRESSION_OK) &&
  ------------------
  |  Branch (425:6): [True: 6.90k, False: 4.90k]
  ------------------
  426|  6.90k|            (ctxt->error != XML_XPTR_UNKNOWN_SCHEME))
  ------------------
  |  Branch (426:13): [True: 6.31k, False: 595]
  ------------------
  427|  6.31k|	    return;
  428|       |
  429|       |	/*
  430|       |	 * If the returned value is a non-empty nodeset
  431|       |	 * or location set, return here.
  432|       |	 */
  433|  5.50k|	if (ctxt->value != NULL) {
  ------------------
  |  Branch (433:6): [True: 4.36k, False: 1.14k]
  ------------------
  434|  4.36k|	    xmlXPathObjectPtr obj = ctxt->value;
  435|       |
  436|  4.36k|	    switch (obj->type) {
  437|  1.60k|		case XPATH_NODESET: {
  ------------------
  |  Branch (437:3): [True: 1.60k, False: 2.75k]
  ------------------
  438|  1.60k|		    xmlNodeSetPtr loc = ctxt->value->nodesetval;
  439|  1.60k|		    if ((loc != NULL) && (loc->nodeNr > 0))
  ------------------
  |  Branch (439:11): [True: 1.60k, False: 0]
  |  Branch (439:28): [True: 762, False: 841]
  ------------------
  440|    762|			return;
  441|    841|		    break;
  442|  1.60k|		}
  443|  2.75k|		default:
  ------------------
  |  Branch (443:3): [True: 2.75k, False: 1.60k]
  ------------------
  444|  2.75k|		    break;
  445|  4.36k|	    }
  446|       |
  447|       |	    /*
  448|       |	     * Evaluating to improper values is equivalent to
  449|       |	     * a sub-resource error, clean-up the stack
  450|       |	     */
  451|  7.20k|	    do {
  452|  7.20k|		obj = xmlXPathValuePop(ctxt);
  453|  7.20k|		if (obj != NULL) {
  ------------------
  |  Branch (453:7): [True: 3.60k, False: 3.60k]
  ------------------
  454|  3.60k|		    xmlXPathFreeObject(obj);
  455|  3.60k|		}
  456|  7.20k|	    } while (obj != NULL);
  ------------------
  |  Branch (456:15): [True: 3.60k, False: 3.60k]
  ------------------
  457|  3.60k|	}
  458|       |
  459|       |	/*
  460|       |	 * Is there another XPointer part.
  461|       |	 */
  462|  4.74k|	SKIP_BLANKS;
  ------------------
  |  |  178|  8.36k|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  |  181|  13.8k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (181:15): [True: 8.36k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  463|  4.74k|	name = xmlXPathParseName(ctxt);
  464|  4.74k|    }
  465|  9.60k|}
xpointer.c:xmlXPtrEvalXPtrPart:
  248|  11.8k|xmlXPtrEvalXPtrPart(xmlXPathParserContextPtr ctxt, xmlChar *name) {
  249|  11.8k|    xmlChar *buffer, *cur;
  250|  11.8k|    int len;
  251|  11.8k|    int level;
  252|       |
  253|  11.8k|    if (name == NULL)
  ------------------
  |  Branch (253:9): [True: 0, False: 11.8k]
  ------------------
  254|      0|    name = xmlXPathParseName(ctxt);
  255|  11.8k|    if (name == NULL)
  ------------------
  |  Branch (255:9): [True: 0, False: 11.8k]
  ------------------
  256|  11.8k|	XP_ERROR(XPATH_EXPR_ERROR);
  ------------------
  |  |  244|      0|    { xmlXPathErr(ctxt, X); return; }
  ------------------
  257|       |
  258|  11.8k|    if (CUR != '(') {
  ------------------
  |  |  173|  11.8k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (258:9): [True: 1.09k, False: 10.7k]
  ------------------
  259|  1.09k|        xmlFree(name);
  260|  1.09k|	XP_ERROR(XPATH_EXPR_ERROR);
  ------------------
  |  |  244|  1.09k|    { xmlXPathErr(ctxt, X); return; }
  ------------------
  261|      0|    }
  262|  10.7k|    NEXT;
  ------------------
  |  |  181|  10.7k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  ------------------
  |  |  |  Branch (181:15): [True: 10.7k, False: 0]
  |  |  ------------------
  ------------------
  263|  10.7k|    level = 1;
  264|       |
  265|  10.7k|    len = xmlStrlen(ctxt->cur);
  266|       |    /* Overflow in xmlStrlen */
  267|  10.7k|    if (len == 0 && ctxt->cur != NULL && *ctxt->cur != 0) {
  ------------------
  |  Branch (267:9): [True: 37, False: 10.6k]
  |  Branch (267:21): [True: 37, False: 0]
  |  Branch (267:42): [True: 0, False: 37]
  ------------------
  268|      0|        xmlXPathPErrMemory(ctxt);
  269|      0|        xmlFree(name);
  270|      0|        return;
  271|      0|    }
  272|       |
  273|  10.7k|    len++;
  274|  10.7k|    buffer = xmlMalloc(len);
  275|  10.7k|    if (buffer == NULL) {
  ------------------
  |  Branch (275:9): [True: 25, False: 10.6k]
  ------------------
  276|     25|        xmlXPathPErrMemory(ctxt);
  277|     25|        xmlFree(name);
  278|     25|	return;
  279|     25|    }
  280|       |
  281|  10.6k|    cur = buffer;
  282|  5.03M|    while (CUR != 0) {
  ------------------
  |  |  173|  5.03M|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (282:12): [True: 5.03M, False: 191]
  ------------------
  283|  5.03M|	if (CUR == ')') {
  ------------------
  |  |  173|  5.03M|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (283:6): [True: 30.5k, False: 5.00M]
  ------------------
  284|  30.5k|	    level--;
  285|  30.5k|	    if (level == 0) {
  ------------------
  |  Branch (285:10): [True: 10.5k, False: 20.0k]
  ------------------
  286|  10.5k|		NEXT;
  ------------------
  |  |  181|  10.5k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  ------------------
  |  |  |  Branch (181:15): [True: 10.5k, False: 0]
  |  |  ------------------
  ------------------
  287|  10.5k|		break;
  288|  10.5k|	    }
  289|  5.00M|	} else if (CUR == '(') {
  ------------------
  |  |  173|  5.00M|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (289:13): [True: 20.3k, False: 4.98M]
  ------------------
  290|  20.3k|	    level++;
  291|  4.98M|	} else if (CUR == '^') {
  ------------------
  |  |  173|  4.98M|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (291:13): [True: 13.9k, False: 4.97M]
  ------------------
  292|  13.9k|            if ((NXT(1) == ')') || (NXT(1) == '(') || (NXT(1) == '^')) {
  ------------------
  |  |  175|  13.9k|#define NXT(val) ctxt->cur[(val)]
  ------------------
                          if ((NXT(1) == ')') || (NXT(1) == '(') || (NXT(1) == '^')) {
  ------------------
  |  |  175|  13.5k|#define NXT(val) ctxt->cur[(val)]
  ------------------
                          if ((NXT(1) == ')') || (NXT(1) == '(') || (NXT(1) == '^')) {
  ------------------
  |  |  175|  13.2k|#define NXT(val) ctxt->cur[(val)]
  ------------------
  |  Branch (292:17): [True: 354, False: 13.5k]
  |  Branch (292:36): [True: 363, False: 13.2k]
  |  Branch (292:55): [True: 12.6k, False: 594]
  ------------------
  293|  13.3k|                NEXT;
  ------------------
  |  |  181|  13.3k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  ------------------
  |  |  |  Branch (181:15): [True: 13.3k, False: 0]
  |  |  ------------------
  ------------------
  294|  13.3k|            }
  295|  13.9k|	}
  296|  5.02M|        *cur++ = CUR;
  ------------------
  |  |  173|  5.02M|#define CUR (*ctxt->cur)
  ------------------
  297|  5.02M|	NEXT;
  ------------------
  |  |  181|  5.02M|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  ------------------
  |  |  |  Branch (181:15): [True: 5.02M, False: 0]
  |  |  ------------------
  ------------------
  298|  5.02M|    }
  299|  10.6k|    *cur = 0;
  300|       |
  301|  10.6k|    if ((level != 0) && (CUR == 0)) {
  ------------------
  |  |  173|    191|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (301:9): [True: 191, False: 10.5k]
  |  Branch (301:25): [True: 191, False: 0]
  ------------------
  302|    191|        xmlFree(name);
  303|    191|	xmlFree(buffer);
  304|    191|	XP_ERROR(XPTR_SYNTAX_ERROR);
  ------------------
  |  |  244|    191|    { xmlXPathErr(ctxt, X); return; }
  ------------------
  305|      0|    }
  306|       |
  307|  10.5k|    if (xmlStrEqual(name, (xmlChar *) "xpointer") ||
  ------------------
  |  Branch (307:9): [True: 9.33k, False: 1.16k]
  ------------------
  308|  9.35k|        xmlStrEqual(name, (xmlChar *) "xpath1")) {
  ------------------
  |  Branch (308:9): [True: 19, False: 1.14k]
  ------------------
  309|  9.35k|	const xmlChar *oldBase = ctxt->base;
  310|  9.35k|	const xmlChar *oldCur = ctxt->cur;
  311|       |
  312|  9.35k|	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|  9.35k|	ctxt->context->node = (xmlNodePtr)ctxt->context->doc;
  320|  9.35k|	ctxt->context->proximityPosition = 1;
  321|  9.35k|	ctxt->context->contextSize = 1;
  322|  9.35k|	xmlXPathEvalExpr(ctxt);
  323|  9.35k|	ctxt->base = oldBase;
  324|  9.35k|        ctxt->cur = oldCur;
  325|  9.35k|    } else if (xmlStrEqual(name, (xmlChar *) "element")) {
  ------------------
  |  Branch (325:16): [True: 41, False: 1.10k]
  ------------------
  326|     41|	const xmlChar *oldBase = ctxt->base;
  327|     41|	const xmlChar *oldCur = ctxt->cur;
  328|     41|	xmlChar *name2;
  329|       |
  330|     41|	ctxt->cur = ctxt->base = buffer;
  331|     41|	if (buffer[0] == '/') {
  ------------------
  |  Branch (331:6): [True: 3, False: 38]
  ------------------
  332|      3|	    xmlXPathRoot(ctxt);
  333|      3|	    xmlXPtrEvalChildSeq(ctxt, NULL);
  334|     38|	} else {
  335|     38|	    name2 = xmlXPathParseName(ctxt);
  336|     38|	    if (name2 == NULL) {
  ------------------
  |  Branch (336:10): [True: 3, False: 35]
  ------------------
  337|      3|                ctxt->base = oldBase;
  338|      3|                ctxt->cur = oldCur;
  339|      3|		xmlFree(buffer);
  340|      3|                xmlFree(name);
  341|      3|		XP_ERROR(XPATH_EXPR_ERROR);
  ------------------
  |  |  244|      3|    { xmlXPathErr(ctxt, X); return; }
  ------------------
  342|      0|	    }
  343|     35|	    xmlXPtrEvalChildSeq(ctxt, name2);
  344|     35|	}
  345|     38|	ctxt->base = oldBase;
  346|     38|        ctxt->cur = oldCur;
  347|     38|#ifdef XPTR_XMLNS_SCHEME
  348|  1.10k|    } else if (xmlStrEqual(name, (xmlChar *) "xmlns")) {
  ------------------
  |  Branch (348:16): [True: 507, False: 598]
  ------------------
  349|    507|	const xmlChar *oldBase = ctxt->base;
  350|    507|	const xmlChar *oldCur = ctxt->cur;
  351|    507|	xmlChar *prefix;
  352|       |
  353|    507|	ctxt->cur = ctxt->base = buffer;
  354|    507|        prefix = xmlXPathParseNCName(ctxt);
  355|    507|	if (prefix == NULL) {
  ------------------
  |  Branch (355:6): [True: 7, False: 500]
  ------------------
  356|      7|            ctxt->base = oldBase;
  357|      7|            ctxt->cur = oldCur;
  358|      7|	    xmlFree(buffer);
  359|      7|	    xmlFree(name);
  360|      7|	    XP_ERROR(XPTR_SYNTAX_ERROR);
  ------------------
  |  |  244|      7|    { xmlXPathErr(ctxt, X); return; }
  ------------------
  361|      0|	}
  362|    500|	SKIP_BLANKS;
  ------------------
  |  |  178|  6.76k|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  |  181|  7.27k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (181:15): [True: 6.76k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  363|    500|	if (CUR != '=') {
  ------------------
  |  |  173|    500|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (363:6): [True: 17, False: 483]
  ------------------
  364|     17|            ctxt->base = oldBase;
  365|     17|            ctxt->cur = oldCur;
  366|     17|	    xmlFree(prefix);
  367|     17|	    xmlFree(buffer);
  368|     17|	    xmlFree(name);
  369|     17|	    XP_ERROR(XPTR_SYNTAX_ERROR);
  ------------------
  |  |  244|     17|    { xmlXPathErr(ctxt, X); return; }
  ------------------
  370|      0|	}
  371|    483|	NEXT;
  ------------------
  |  |  181|    483|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  ------------------
  |  |  |  Branch (181:15): [True: 483, False: 0]
  |  |  ------------------
  ------------------
  372|    483|	SKIP_BLANKS;
  ------------------
  |  |  178|  2.05k|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  |  181|  2.53k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (181:15): [True: 2.05k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  373|       |
  374|    483|	if (xmlXPathRegisterNs(ctxt->context, prefix, ctxt->cur) < 0)
  ------------------
  |  Branch (374:6): [True: 5, False: 478]
  ------------------
  375|      5|            xmlXPathPErrMemory(ctxt);
  376|    483|        ctxt->base = oldBase;
  377|    483|        ctxt->cur = oldCur;
  378|    483|	xmlFree(prefix);
  379|    483|#endif /* XPTR_XMLNS_SCHEME */
  380|    598|    } else {
  381|    598|        xmlXPtrErr(ctxt, XML_XPTR_UNKNOWN_SCHEME,
  382|    598|		   "unsupported scheme '%s'\n", name);
  383|    598|    }
  384|  10.4k|    xmlFree(buffer);
  385|  10.4k|    xmlFree(name);
  386|  10.4k|}
xpointer.c:xmlXPtrErr:
   67|    660|{
   68|    660|    xmlStructuredErrorFunc serror = NULL;
   69|    660|    void *data = NULL;
   70|    660|    xmlNodePtr node = NULL;
   71|    660|    int res;
   72|       |
   73|    660|    if (ctxt == NULL)
  ------------------
  |  Branch (73:9): [True: 0, False: 660]
  ------------------
   74|      0|        return;
   75|       |    /* Only report the first error */
   76|    660|    if (ctxt->error != 0)
  ------------------
  |  Branch (76:9): [True: 3, False: 657]
  ------------------
   77|      3|        return;
   78|       |
   79|    657|    ctxt->error = code;
   80|       |
   81|    657|    if (ctxt->context != NULL) {
  ------------------
  |  Branch (81:9): [True: 657, False: 0]
  ------------------
   82|    657|        xmlErrorPtr err = &ctxt->context->lastError;
   83|       |
   84|       |        /* cleanup current last error */
   85|    657|        xmlResetError(err);
   86|       |
   87|    657|        err->domain = XML_FROM_XPOINTER;
   88|    657|        err->code = code;
   89|    657|        err->level = XML_ERR_ERROR;
   90|    657|        err->str1 = (char *) xmlStrdup(ctxt->base);
   91|    657|        if (err->str1 == NULL) {
  ------------------
  |  Branch (91:13): [True: 2, False: 655]
  ------------------
   92|      2|            xmlXPathPErrMemory(ctxt);
   93|      2|            return;
   94|      2|        }
   95|    655|        err->int1 = ctxt->cur - ctxt->base;
   96|    655|        err->node = ctxt->context->debugNode;
   97|       |
   98|    655|        serror = ctxt->context->error;
   99|    655|        data = ctxt->context->userData;
  100|    655|        node = ctxt->context->debugNode;
  101|    655|    }
  102|       |
  103|    655|    res = xmlRaiseError(serror, NULL, data, NULL, node,
  104|    655|                        XML_FROM_XPOINTER, code, XML_ERR_ERROR, NULL, 0,
  105|    655|                        (const char *) extra, (const char *) ctxt->base,
  106|    655|                        NULL, ctxt->cur - ctxt->base, 0,
  107|    655|                        msg, extra);
  108|    655|    if (res < 0)
  ------------------
  |  Branch (108:9): [True: 3, False: 652]
  ------------------
  109|      3|        xmlXPathPErrMemory(ctxt);
  110|    655|}

