htmlIsBooleanAttr:
  362|  13.3k|{
  363|  13.3k|    const char *str = NULL;
  364|       |
  365|  13.3k|    if (name == NULL)
  ------------------
  |  Branch (365:9): [True: 0, False: 13.3k]
  ------------------
  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|  13.3k|    switch (name[0] | 0x20) {
  ------------------
  |  Branch (388:13): [True: 8.67k, False: 4.63k]
  ------------------
  389|  2.03k|        case 'c':
  ------------------
  |  Branch (389:9): [True: 2.03k, False: 11.2k]
  ------------------
  390|  2.03k|            name += 1;
  391|  2.03k|            switch (name[0] | 0x20) {
  ------------------
  |  Branch (391:21): [True: 498, False: 1.53k]
  ------------------
  392|    234|                case 'h': str = "ecked"; break;
  ------------------
  |  Branch (392:17): [True: 234, False: 1.80k]
  ------------------
  393|    264|                case 'o': str = "mpact"; break;
  ------------------
  |  Branch (393:17): [True: 264, False: 1.77k]
  ------------------
  394|  2.03k|            }
  395|  2.03k|            break;
  396|  2.50k|        case 'd':
  ------------------
  |  Branch (396:9): [True: 2.50k, False: 10.7k]
  ------------------
  397|  2.50k|            name += 1;
  398|  2.50k|            switch (name[0] | 0x20) {
  ------------------
  |  Branch (398:21): [True: 534, False: 1.97k]
  ------------------
  399|    409|                case 'e':
  ------------------
  |  Branch (399:17): [True: 409, False: 2.10k]
  ------------------
  400|    409|                    name += 1;
  401|    409|                    switch (name[0] | 0x20) {
  ------------------
  |  Branch (401:29): [True: 161, False: 248]
  ------------------
  402|     79|                        case 'c': str = "lare"; break;
  ------------------
  |  Branch (402:25): [True: 79, False: 330]
  ------------------
  403|     82|                        case 'f': str = "er"; break;
  ------------------
  |  Branch (403:25): [True: 82, False: 327]
  ------------------
  404|    409|                    }
  405|    409|                    break;
  406|    409|                case 'i': str = "sabled"; break;
  ------------------
  |  Branch (406:17): [True: 125, False: 2.38k]
  ------------------
  407|  2.50k|            }
  408|  2.50k|            break;
  409|  2.50k|        case 'i':
  ------------------
  |  Branch (409:9): [True: 762, False: 12.5k]
  ------------------
  410|    762|            str = "smap";
  411|    762|            break;
  412|    233|        case 'm':
  ------------------
  |  Branch (412:9): [True: 233, False: 13.0k]
  ------------------
  413|    233|            str = "ultiple";
  414|    233|            break;
  415|  2.68k|        case 'n':
  ------------------
  |  Branch (415:9): [True: 2.68k, False: 10.6k]
  ------------------
  416|  2.68k|            name += 1;
  417|  2.68k|            if ((name[0] | 0x20) != 'o')
  ------------------
  |  Branch (417:17): [True: 1.39k, False: 1.28k]
  ------------------
  418|  1.39k|                break;
  419|  1.28k|            name += 1;
  420|  1.28k|            switch (name[0] | 0x20) {
  ------------------
  |  Branch (420:21): [True: 1.09k, False: 195]
  ------------------
  421|    198|                case 'h': str = "ref"; break;
  ------------------
  |  Branch (421:17): [True: 198, False: 1.08k]
  ------------------
  422|    476|                case 'r': str = "esize"; break;
  ------------------
  |  Branch (422:17): [True: 476, False: 809]
  ------------------
  423|    197|                case 's': str = "hade"; break;
  ------------------
  |  Branch (423:17): [True: 197, False: 1.08k]
  ------------------
  424|    219|                case 'w': str = "rap"; break;
  ------------------
  |  Branch (424:17): [True: 219, False: 1.06k]
  ------------------
  425|  1.28k|            }
  426|  1.28k|            break;
  427|  1.28k|        case 'r':
  ------------------
  |  Branch (427:9): [True: 223, False: 13.0k]
  ------------------
  428|    223|            str = "eadonly";
  429|    223|            break;
  430|    224|        case 's':
  ------------------
  |  Branch (430:9): [True: 224, False: 13.0k]
  ------------------
  431|    224|            str = "elected";
  432|    224|            break;
  433|  13.3k|    }
  434|       |
  435|  13.3k|    if (str == NULL)
  ------------------
  |  Branch (435:9): [True: 9.99k, False: 3.31k]
  ------------------
  436|  9.99k|        return(0);
  437|       |
  438|  3.31k|    return(xmlStrcasecmp(name + 1, BAD_CAST str) == 0);
  ------------------
  |  |   34|  3.31k|#define BAD_CAST (xmlChar *)
  ------------------
  439|  13.3k|}

xmlSAX2InternalSubset:
  242|  21.6k|{
  243|  21.6k|    xmlParserCtxtPtr ctxt = (xmlParserCtxtPtr) ctx;
  244|  21.6k|    xmlDtdPtr dtd;
  245|  21.6k|    if (ctx == NULL) return;
  ------------------
  |  Branch (245:9): [True: 0, False: 21.6k]
  ------------------
  246|       |
  247|  21.6k|    if (ctxt->myDoc == NULL)
  ------------------
  |  Branch (247:9): [True: 0, False: 21.6k]
  ------------------
  248|      0|	return;
  249|  21.6k|    if ((ctxt->html) && (ctxt->instate != XML_PARSER_MISC))
  ------------------
  |  Branch (249:9): [True: 0, False: 21.6k]
  |  Branch (249:25): [True: 0, False: 0]
  ------------------
  250|      0|        return;
  251|  21.6k|    dtd = xmlGetIntSubset(ctxt->myDoc);
  252|  21.6k|    if (dtd != NULL) {
  ------------------
  |  Branch (252:9): [True: 0, False: 21.6k]
  ------------------
  253|      0|	xmlUnlinkNode((xmlNodePtr) dtd);
  254|      0|	xmlFreeDtd(dtd);
  255|      0|	ctxt->myDoc->intSubset = NULL;
  256|      0|    }
  257|  21.6k|    ctxt->myDoc->intSubset =
  258|  21.6k|	xmlCreateIntSubset(ctxt->myDoc, name, publicId, systemId);
  259|  21.6k|    if (ctxt->myDoc->intSubset == NULL)
  ------------------
  |  Branch (259:9): [True: 7, False: 21.6k]
  ------------------
  260|      7|        xmlSAX2ErrMemory(ctxt);
  261|  21.6k|}
xmlSAX2ExternalSubset:
  274|  19.1k|{
  275|  19.1k|    xmlParserCtxtPtr ctxt = (xmlParserCtxtPtr) ctx;
  276|  19.1k|    if (ctx == NULL) return;
  ------------------
  |  Branch (276:9): [True: 0, False: 19.1k]
  ------------------
  277|  19.1k|    if ((systemId != NULL) &&
  ------------------
  |  Branch (277:9): [True: 3.82k, False: 15.3k]
  ------------------
  278|  3.82k|        ((ctxt->options & XML_PARSE_NO_XXE) == 0) &&
  ------------------
  |  Branch (278:9): [True: 3.54k, False: 278]
  ------------------
  279|  3.54k|        (((ctxt->validate) || (ctxt->loadsubset & ~XML_SKIP_IDS)) &&
  ------------------
  |  |  210|  1.36k|#define XML_SKIP_IDS		8
  ------------------
  |  Branch (279:11): [True: 2.17k, False: 1.36k]
  |  Branch (279:31): [True: 1.12k, False: 249]
  ------------------
  280|  3.29k|	 (ctxt->wellFormed && ctxt->myDoc))) {
  ------------------
  |  Branch (280:4): [True: 3.23k, False: 64]
  |  Branch (280:24): [True: 3.23k, False: 0]
  ------------------
  281|       |	/*
  282|       |	 * Try to fetch and parse the external subset.
  283|       |	 */
  284|  3.23k|	xmlParserInputPtr oldinput;
  285|  3.23k|	int oldinputNr;
  286|  3.23k|	int oldinputMax;
  287|  3.23k|	xmlParserInputPtr *oldinputTab;
  288|  3.23k|	xmlParserInputPtr input = NULL;
  289|  3.23k|	xmlChar *oldencoding;
  290|  3.23k|        unsigned long consumed;
  291|  3.23k|        size_t buffered;
  292|  3.23k|#ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
  293|  3.23k|        int inputMax = 1;
  294|       |#else
  295|       |        int inputMax = 5;
  296|       |#endif
  297|       |
  298|       |	/*
  299|       |	 * Ask the Entity resolver to load the damn thing
  300|       |	 */
  301|  3.23k|	if ((ctxt->sax != NULL) && (ctxt->sax->resolveEntity != NULL))
  ------------------
  |  Branch (301:6): [True: 3.23k, False: 0]
  |  Branch (301:29): [True: 3.23k, False: 0]
  ------------------
  302|  3.23k|	    input = ctxt->sax->resolveEntity(ctxt->userData, publicId,
  303|  3.23k|	                                     systemId);
  304|  3.23k|	if (input == NULL) {
  ------------------
  |  Branch (304:6): [True: 1.11k, False: 2.11k]
  ------------------
  305|  1.11k|	    return;
  306|  1.11k|	}
  307|       |
  308|  2.11k|	if (xmlNewDtd(ctxt->myDoc, name, publicId, systemId) == NULL) {
  ------------------
  |  Branch (308:6): [True: 2, False: 2.11k]
  ------------------
  309|      2|            xmlSAX2ErrMemory(ctxt);
  310|      2|            xmlFreeInputStream(input);
  311|      2|            return;
  312|      2|        }
  313|       |
  314|       |	/*
  315|       |	 * make sure we won't destroy the main document context
  316|       |	 */
  317|  2.11k|	oldinput = ctxt->input;
  318|  2.11k|	oldinputNr = ctxt->inputNr;
  319|  2.11k|	oldinputMax = ctxt->inputMax;
  320|  2.11k|	oldinputTab = ctxt->inputTab;
  321|  2.11k|	oldencoding = ctxt->encoding;
  322|  2.11k|	ctxt->encoding = NULL;
  323|       |
  324|  2.11k|	ctxt->inputTab = xmlMalloc(inputMax * sizeof(xmlParserInputPtr));
  325|  2.11k|	if (ctxt->inputTab == NULL) {
  ------------------
  |  Branch (325:6): [True: 1, False: 2.11k]
  ------------------
  326|      1|	    xmlSAX2ErrMemory(ctxt);
  327|      1|            goto error;
  328|      1|	}
  329|  2.11k|	ctxt->inputNr = 0;
  330|  2.11k|	ctxt->inputMax = inputMax;
  331|  2.11k|	ctxt->input = NULL;
  332|  2.11k|	if (xmlCtxtPushInput(ctxt, input) < 0)
  ------------------
  |  Branch (332:6): [True: 1, False: 2.11k]
  ------------------
  333|      1|            goto error;
  334|       |
  335|  2.11k|	if (input->filename == NULL)
  ------------------
  |  Branch (335:6): [True: 0, False: 2.11k]
  ------------------
  336|      0|	    input->filename = (char *) xmlCanonicPath(systemId);
  337|  2.11k|	input->line = 1;
  338|  2.11k|	input->col = 1;
  339|  2.11k|	input->base = ctxt->input->cur;
  340|  2.11k|	input->cur = ctxt->input->cur;
  341|  2.11k|	input->free = NULL;
  342|       |
  343|       |	/*
  344|       |	 * let's parse that entity knowing it's an external subset.
  345|       |	 */
  346|  2.11k|	xmlParseExternalSubset(ctxt, publicId, systemId);
  347|       |
  348|       |        /*
  349|       |	 * Free up the external entities
  350|       |	 */
  351|       |
  352|  2.18k|	while (ctxt->inputNr > 1)
  ------------------
  |  Branch (352:9): [True: 70, False: 2.11k]
  ------------------
  353|     70|	    xmlFreeInputStream(xmlCtxtPopInput(ctxt));
  354|       |
  355|  2.11k|        consumed = ctxt->input->consumed;
  356|  2.11k|        buffered = ctxt->input->cur - ctxt->input->base;
  357|  2.11k|        if (buffered > ULONG_MAX - consumed)
  ------------------
  |  Branch (357:13): [True: 0, False: 2.11k]
  ------------------
  358|      0|            consumed = ULONG_MAX;
  359|  2.11k|        else
  360|  2.11k|            consumed += buffered;
  361|  2.11k|        if (consumed > ULONG_MAX - ctxt->sizeentities)
  ------------------
  |  Branch (361:13): [True: 0, False: 2.11k]
  ------------------
  362|      0|            ctxt->sizeentities = ULONG_MAX;
  363|  2.11k|        else
  364|  2.11k|            ctxt->sizeentities += consumed;
  365|       |
  366|  2.11k|error:
  367|  2.11k|	xmlFreeInputStream(input);
  368|  2.11k|        xmlFree(ctxt->inputTab);
  369|       |
  370|       |	/*
  371|       |	 * Restore the parsing context of the main entity
  372|       |	 */
  373|  2.11k|	ctxt->input = oldinput;
  374|  2.11k|	ctxt->inputNr = oldinputNr;
  375|  2.11k|	ctxt->inputMax = oldinputMax;
  376|  2.11k|	ctxt->inputTab = oldinputTab;
  377|  2.11k|	if (ctxt->encoding != NULL)
  ------------------
  |  Branch (377:6): [True: 69, False: 2.04k]
  ------------------
  378|     69|	    xmlFree(ctxt->encoding);
  379|  2.11k|	ctxt->encoding = oldencoding;
  380|       |	/* ctxt->wellFormed = oldwellFormed; */
  381|  2.11k|    }
  382|  19.1k|}
xmlSAX2ResolveEntity:
  396|  3.23k|{
  397|  3.23k|    xmlParserCtxtPtr ctxt = (xmlParserCtxtPtr) ctx;
  398|  3.23k|    xmlParserInputPtr ret = NULL;
  399|  3.23k|    xmlChar *URI = NULL;
  400|       |
  401|  3.23k|    if (ctx == NULL) return(NULL);
  ------------------
  |  Branch (401:9): [True: 0, False: 3.23k]
  ------------------
  402|       |
  403|  3.23k|    if (systemId != NULL) {
  ------------------
  |  Branch (403:9): [True: 3.23k, False: 0]
  ------------------
  404|  3.23k|        const xmlChar *base = NULL;
  405|  3.23k|        int res;
  406|       |
  407|  3.23k|        if (ctxt->input != NULL)
  ------------------
  |  Branch (407:13): [True: 3.23k, False: 0]
  ------------------
  408|  3.23k|            base = BAD_CAST ctxt->input->filename;
  ------------------
  |  |   34|  3.23k|#define BAD_CAST (xmlChar *)
  ------------------
  409|       |
  410|       |        /*
  411|       |         * We don't really need the 'directory' struct member, but some
  412|       |         * users set it manually to a base URI for memory streams.
  413|       |         */
  414|  3.23k|        if (base == NULL)
  ------------------
  |  Branch (414:13): [True: 2.36k, False: 871]
  ------------------
  415|  2.36k|            base = BAD_CAST ctxt->directory;
  ------------------
  |  |   34|  2.36k|#define BAD_CAST (xmlChar *)
  ------------------
  416|       |
  417|  3.23k|        if ((xmlStrlen(systemId) > XML_MAX_URI_LENGTH) ||
  ------------------
  |  |   11|  3.23k|#define XML_MAX_URI_LENGTH 2000
  ------------------
  |  Branch (417:13): [True: 1, False: 3.23k]
  ------------------
  418|  3.23k|            (xmlStrlen(base) > XML_MAX_URI_LENGTH)) {
  ------------------
  |  |   11|  3.23k|#define XML_MAX_URI_LENGTH 2000
  ------------------
  |  Branch (418:13): [True: 0, False: 3.23k]
  ------------------
  419|      1|            xmlFatalErr(ctxt, XML_ERR_RESOURCE_LIMIT, "URI too long");
  420|      1|            return(NULL);
  421|      1|        }
  422|  3.23k|        res = xmlBuildURISafe(systemId, base, &URI);
  423|  3.23k|        if (URI == NULL) {
  ------------------
  |  Branch (423:13): [True: 142, False: 3.09k]
  ------------------
  424|    142|            if (res < 0)
  ------------------
  |  Branch (424:17): [True: 4, False: 138]
  ------------------
  425|      4|                xmlSAX2ErrMemory(ctxt);
  426|    138|            else
  427|    138|                xmlWarnMsg(ctxt, XML_ERR_INVALID_URI,
  428|    138|                           "Can't resolve URI: %s\n", systemId);
  429|    142|            return(NULL);
  430|    142|        }
  431|  3.09k|        if (xmlStrlen(URI) > XML_MAX_URI_LENGTH) {
  ------------------
  |  |   11|  3.09k|#define XML_MAX_URI_LENGTH 2000
  ------------------
  |  Branch (431:13): [True: 0, False: 3.09k]
  ------------------
  432|      0|            xmlFatalErr(ctxt, XML_ERR_RESOURCE_LIMIT, "URI too long");
  433|      0|            xmlFree(URI);
  434|      0|            return(NULL);
  435|      0|        }
  436|  3.09k|    }
  437|       |
  438|  3.09k|    ret = xmlLoadResource(ctxt, (const char *) URI,
  439|  3.09k|                          (const char *) publicId, XML_RESOURCE_DTD);
  440|       |
  441|  3.09k|    xmlFree(URI);
  442|  3.09k|    return(ret);
  443|  3.23k|}
xmlSAX2GetEntity:
  454|  2.55M|{
  455|  2.55M|    xmlParserCtxtPtr ctxt = (xmlParserCtxtPtr) ctx;
  456|  2.55M|    xmlEntityPtr ret = NULL;
  457|       |
  458|  2.55M|    if (ctx == NULL) return(NULL);
  ------------------
  |  Branch (458:9): [True: 0, False: 2.55M]
  ------------------
  459|       |
  460|  2.55M|    if (ctxt->inSubset == 0) {
  ------------------
  |  Branch (460:9): [True: 2.20M, False: 347k]
  ------------------
  461|  2.20M|	ret = xmlGetPredefinedEntity(name);
  462|  2.20M|	if (ret != NULL)
  ------------------
  |  Branch (462:6): [True: 556k, False: 1.64M]
  ------------------
  463|   556k|	    return(ret);
  464|  2.20M|    }
  465|  1.99M|    if ((ctxt->myDoc != NULL) && (ctxt->myDoc->standalone == 1)) {
  ------------------
  |  Branch (465:9): [True: 1.99M, False: 194]
  |  Branch (465:34): [True: 1.41k, False: 1.99M]
  ------------------
  466|  1.41k|	if (ctxt->inSubset == 2) {
  ------------------
  |  Branch (466:6): [True: 218, False: 1.19k]
  ------------------
  467|    218|	    ctxt->myDoc->standalone = 0;
  468|    218|	    ret = xmlGetDocEntity(ctxt->myDoc, name);
  469|    218|	    ctxt->myDoc->standalone = 1;
  470|  1.19k|	} else {
  471|  1.19k|	    ret = xmlGetDocEntity(ctxt->myDoc, name);
  472|  1.19k|	    if (ret == NULL) {
  ------------------
  |  Branch (472:10): [True: 876, False: 317]
  ------------------
  473|    876|		ctxt->myDoc->standalone = 0;
  474|    876|		ret = xmlGetDocEntity(ctxt->myDoc, name);
  475|    876|		if (ret != NULL) {
  ------------------
  |  Branch (475:7): [True: 230, False: 646]
  ------------------
  476|    230|		    xmlFatalErrMsg(ctxt, XML_ERR_NOT_STANDALONE,
  477|    230|	 "Entity(%s) document marked standalone but requires external subset\n",
  478|    230|				   name, NULL);
  479|    230|		}
  480|    876|		ctxt->myDoc->standalone = 1;
  481|    876|	    }
  482|  1.19k|	}
  483|  1.99M|    } else {
  484|  1.99M|	ret = xmlGetDocEntity(ctxt->myDoc, name);
  485|  1.99M|    }
  486|  1.99M|    return(ret);
  487|  2.55M|}
xmlSAX2GetParameterEntity:
  498|   531k|{
  499|   531k|    xmlParserCtxtPtr ctxt = (xmlParserCtxtPtr) ctx;
  500|   531k|    xmlEntityPtr ret;
  501|       |
  502|   531k|    if (ctx == NULL) return(NULL);
  ------------------
  |  Branch (502:9): [True: 0, False: 531k]
  ------------------
  503|       |
  504|   531k|    ret = xmlGetParameterEntity(ctxt->myDoc, name);
  505|   531k|    return(ret);
  506|   531k|}
xmlSAX2EntityDecl:
  522|   148k|{
  523|   148k|    xmlEntityPtr ent;
  524|   148k|    xmlParserCtxtPtr ctxt = (xmlParserCtxtPtr) ctx;
  525|   148k|    int extSubset;
  526|   148k|    int res;
  527|       |
  528|   148k|    if ((ctxt == NULL) || (ctxt->myDoc == NULL))
  ------------------
  |  Branch (528:9): [True: 0, False: 148k]
  |  Branch (528:27): [True: 0, False: 148k]
  ------------------
  529|      0|        return;
  530|       |
  531|   148k|    extSubset = ctxt->inSubset == 2;
  532|   148k|    res = xmlAddEntity(ctxt->myDoc, extSubset, name, type, publicId, systemId,
  533|   148k|                       content, &ent);
  534|   148k|    switch (res) {
  535|  23.6k|        case XML_ERR_OK:
  ------------------
  |  Branch (535:9): [True: 23.6k, False: 124k]
  ------------------
  536|  23.6k|            break;
  537|     35|        case XML_ERR_NO_MEMORY:
  ------------------
  |  Branch (537:9): [True: 35, False: 148k]
  ------------------
  538|     35|            xmlSAX2ErrMemory(ctxt);
  539|     35|            return;
  540|   120k|        case XML_WAR_ENTITY_REDEFINED:
  ------------------
  |  Branch (540:9): [True: 120k, False: 27.5k]
  ------------------
  541|   120k|            if (ctxt->pedantic) {
  ------------------
  |  Branch (541:17): [True: 9.74k, False: 110k]
  ------------------
  542|  9.74k|                if (extSubset)
  ------------------
  |  Branch (542:21): [True: 941, False: 8.80k]
  ------------------
  543|    941|                    xmlWarnMsg(ctxt, res, "Entity(%s) already defined in the"
  544|    941|                               " external subset\n", name);
  545|  8.80k|                else
  546|  8.80k|                    xmlWarnMsg(ctxt, res, "Entity(%s) already defined in the"
  547|  8.80k|                               " internal subset\n", name);
  548|  9.74k|            }
  549|   120k|            return;
  550|  3.89k|        case XML_ERR_REDECL_PREDEF_ENTITY:
  ------------------
  |  Branch (550:9): [True: 3.89k, False: 144k]
  ------------------
  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.89k|            xmlWarnMsg(ctxt, res, "Invalid redeclaration of predefined"
  556|  3.89k|                       " entity '%s'", name);
  557|  3.89k|            return;
  558|      0|        default:
  ------------------
  |  Branch (558:9): [True: 0, False: 148k]
  ------------------
  559|      0|            xmlFatalErrMsg(ctxt, XML_ERR_INTERNAL_ERROR,
  560|      0|                           "Unexpected error code from xmlAddEntity\n",
  561|      0|                           NULL, NULL);
  562|      0|            return;
  563|   148k|    }
  564|       |
  565|  23.6k|    if ((ent->URI == NULL) && (systemId != NULL)) {
  ------------------
  |  Branch (565:9): [True: 23.6k, False: 0]
  |  Branch (565:31): [True: 7.85k, False: 15.7k]
  ------------------
  566|  7.85k|        xmlChar *URI;
  567|  7.85k|        const char *base = NULL;
  568|  7.85k|        int i;
  569|       |
  570|  15.0k|        for (i = ctxt->inputNr - 1; i >= 0; i--) {
  ------------------
  |  Branch (570:37): [True: 7.91k, False: 7.14k]
  ------------------
  571|  7.91k|            if (ctxt->inputTab[i]->filename != NULL) {
  ------------------
  |  Branch (571:17): [True: 703, False: 7.21k]
  ------------------
  572|    703|                base = ctxt->inputTab[i]->filename;
  573|    703|                break;
  574|    703|            }
  575|  7.91k|        }
  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.85k|        if (base == NULL)
  ------------------
  |  Branch (581:13): [True: 7.14k, False: 703]
  ------------------
  582|  7.14k|            base = ctxt->directory;
  583|       |
  584|  7.85k|        res = xmlBuildURISafe(systemId, (const xmlChar *) base, &URI);
  585|       |
  586|  7.85k|        if (URI == NULL) {
  ------------------
  |  Branch (586:13): [True: 104, False: 7.74k]
  ------------------
  587|    104|            if (res < 0) {
  ------------------
  |  Branch (587:17): [True: 1, False: 103]
  ------------------
  588|      1|                xmlSAX2ErrMemory(ctxt);
  589|    103|            } else {
  590|    103|                xmlWarnMsg(ctxt, XML_ERR_INVALID_URI,
  591|    103|                           "Can't resolve URI: %s\n", systemId);
  592|    103|            }
  593|  7.74k|        } else if (xmlStrlen(URI) > XML_MAX_URI_LENGTH) {
  ------------------
  |  |   11|  7.74k|#define XML_MAX_URI_LENGTH 2000
  ------------------
  |  Branch (593:20): [True: 3, False: 7.74k]
  ------------------
  594|      3|            xmlFatalErr(ctxt, XML_ERR_RESOURCE_LIMIT, "URI too long");
  595|      3|            xmlFree(URI);
  596|  7.74k|        } else {
  597|  7.74k|            ent->URI = URI;
  598|  7.74k|        }
  599|  7.85k|    }
  600|  23.6k|}
xmlSAX2AttributeDecl:
  617|  74.8k|{
  618|  74.8k|    xmlParserCtxtPtr ctxt = (xmlParserCtxtPtr) ctx;
  619|  74.8k|    xmlAttributePtr attr;
  620|  74.8k|    const xmlChar *name = NULL;
  621|  74.8k|    xmlChar *prefix = NULL;
  622|       |
  623|       |    /* Avoid unused variable warning if features are disabled. */
  624|  74.8k|    (void) attr;
  625|       |
  626|  74.8k|    if ((ctxt == NULL) || (ctxt->myDoc == NULL))
  ------------------
  |  Branch (626:9): [True: 0, False: 74.8k]
  |  Branch (626:27): [True: 0, False: 74.8k]
  ------------------
  627|      0|        return;
  628|       |
  629|  74.8k|    if ((xmlStrEqual(fullname, BAD_CAST "xml:id")) &&
  ------------------
  |  |   34|  74.8k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (629:9): [True: 779, False: 74.0k]
  ------------------
  630|    779|        (type != XML_ATTRIBUTE_ID)) {
  ------------------
  |  Branch (630:9): [True: 506, False: 273]
  ------------------
  631|    506|	xmlErrId(ctxt, XML_DTD_XMLID_TYPE,
  632|    506|	      "xml:id : attribute type should be ID\n", NULL);
  633|    506|    }
  634|  74.8k|    name = xmlSplitQName4(fullname, &prefix);
  635|  74.8k|    if (name == NULL)
  ------------------
  |  Branch (635:9): [True: 9, False: 74.7k]
  ------------------
  636|      9|        xmlSAX2ErrMemory(ctxt);
  637|  74.8k|    ctxt->vctxt.valid = 1;
  638|  74.8k|    if (ctxt->inSubset == 1)
  ------------------
  |  Branch (638:9): [True: 44.7k, False: 30.0k]
  ------------------
  639|  44.7k|	attr = xmlAddAttributeDecl(&ctxt->vctxt, ctxt->myDoc->intSubset, elem,
  640|  44.7k|	       name, prefix, (xmlAttributeType) type,
  641|  44.7k|	       (xmlAttributeDefault) def, defaultValue, tree);
  642|  30.0k|    else if (ctxt->inSubset == 2)
  ------------------
  |  Branch (642:14): [True: 30.0k, False: 0]
  ------------------
  643|  30.0k|	attr = xmlAddAttributeDecl(&ctxt->vctxt, ctxt->myDoc->extSubset, elem,
  644|  30.0k|	   name, prefix, (xmlAttributeType) type,
  645|  30.0k|	   (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|  74.8k|#ifdef LIBXML_VALID_ENABLED
  655|  74.8k|    if (ctxt->vctxt.valid == 0)
  ------------------
  |  Branch (655:9): [True: 10.7k, False: 64.0k]
  ------------------
  656|  10.7k|	ctxt->valid = 0;
  657|  74.8k|    if ((attr != NULL) && (ctxt->validate) && (ctxt->wellFormed) &&
  ------------------
  |  Branch (657:9): [True: 31.4k, False: 43.3k]
  |  Branch (657:27): [True: 23.6k, False: 7.85k]
  |  Branch (657:47): [True: 19.2k, False: 4.38k]
  ------------------
  658|  19.2k|        (ctxt->myDoc->intSubset != NULL))
  ------------------
  |  Branch (658:9): [True: 19.2k, False: 0]
  ------------------
  659|  19.2k|	ctxt->valid &= xmlValidateAttributeDecl(&ctxt->vctxt, ctxt->myDoc,
  660|  19.2k|	                                        attr);
  661|  74.8k|#endif /* LIBXML_VALID_ENABLED */
  662|  74.8k|    if (prefix != NULL)
  ------------------
  |  Branch (662:9): [True: 6.01k, False: 68.7k]
  ------------------
  663|  6.01k|	xmlFree(prefix);
  664|  74.8k|}
xmlSAX2ElementDecl:
  677|  17.6k|{
  678|  17.6k|    xmlParserCtxtPtr ctxt = (xmlParserCtxtPtr) ctx;
  679|  17.6k|    xmlElementPtr elem = NULL;
  680|       |
  681|       |    /* Avoid unused variable warning if features are disabled. */
  682|  17.6k|    (void) elem;
  683|       |
  684|  17.6k|    if ((ctxt == NULL) || (ctxt->myDoc == NULL))
  ------------------
  |  Branch (684:9): [True: 0, False: 17.6k]
  |  Branch (684:27): [True: 0, False: 17.6k]
  ------------------
  685|      0|        return;
  686|       |
  687|  17.6k|    if (ctxt->inSubset == 1)
  ------------------
  |  Branch (687:9): [True: 11.5k, False: 6.08k]
  ------------------
  688|  11.5k|        elem = xmlAddElementDecl(&ctxt->vctxt, ctxt->myDoc->intSubset,
  689|  11.5k|                                 name, (xmlElementTypeVal) type, content);
  690|  6.08k|    else if (ctxt->inSubset == 2)
  ------------------
  |  Branch (690:14): [True: 6.08k, False: 0]
  ------------------
  691|  6.08k|        elem = xmlAddElementDecl(&ctxt->vctxt, ctxt->myDoc->extSubset,
  692|  6.08k|                                 name, (xmlElementTypeVal) type, content);
  693|      0|    else {
  694|      0|        xmlFatalErrMsg(ctxt, XML_ERR_INTERNAL_ERROR,
  695|      0|	     "SAX.xmlSAX2ElementDecl(%s) called while not in subset\n",
  696|      0|	               name, NULL);
  697|      0|        return;
  698|      0|    }
  699|  17.6k|#ifdef LIBXML_VALID_ENABLED
  700|  17.6k|    if (elem == NULL)
  ------------------
  |  Branch (700:9): [True: 5.45k, False: 12.1k]
  ------------------
  701|  5.45k|        ctxt->valid = 0;
  702|  17.6k|    if (ctxt->validate && ctxt->wellFormed &&
  ------------------
  |  Branch (702:9): [True: 13.4k, False: 4.24k]
  |  Branch (702:27): [True: 9.98k, False: 3.42k]
  ------------------
  703|  9.98k|        ctxt->myDoc && ctxt->myDoc->intSubset)
  ------------------
  |  Branch (703:9): [True: 9.98k, False: 0]
  |  Branch (703:24): [True: 9.98k, False: 0]
  ------------------
  704|  9.98k|        ctxt->valid &=
  705|  9.98k|            xmlValidateElementDecl(&ctxt->vctxt, ctxt->myDoc, elem);
  706|  17.6k|#endif /* LIBXML_VALID_ENABLED */
  707|  17.6k|}
xmlSAX2NotationDecl:
  720|  2.46k|{
  721|  2.46k|    xmlParserCtxtPtr ctxt = (xmlParserCtxtPtr) ctx;
  722|  2.46k|    xmlNotationPtr nota = NULL;
  723|       |
  724|       |    /* Avoid unused variable warning if features are disabled. */
  725|  2.46k|    (void) nota;
  726|       |
  727|  2.46k|    if ((ctxt == NULL) || (ctxt->myDoc == NULL))
  ------------------
  |  Branch (727:9): [True: 0, False: 2.46k]
  |  Branch (727:27): [True: 0, False: 2.46k]
  ------------------
  728|      0|        return;
  729|       |
  730|  2.46k|    if ((publicId == NULL) && (systemId == NULL)) {
  ------------------
  |  Branch (730:9): [True: 1.16k, False: 1.29k]
  |  Branch (730:31): [True: 88, False: 1.07k]
  ------------------
  731|     88|	xmlFatalErrMsg(ctxt, XML_ERR_NOTATION_PROCESSING,
  732|     88|	     "SAX.xmlSAX2NotationDecl(%s) externalID or PublicID missing\n",
  733|     88|	               name, NULL);
  734|     88|	return;
  735|  2.37k|    } else if (ctxt->inSubset == 1)
  ------------------
  |  Branch (735:16): [True: 2.12k, False: 252]
  ------------------
  736|  2.12k|	nota = xmlAddNotationDecl(&ctxt->vctxt, ctxt->myDoc->intSubset, name,
  737|  2.12k|                              publicId, systemId);
  738|    252|    else if (ctxt->inSubset == 2)
  ------------------
  |  Branch (738:14): [True: 252, False: 0]
  ------------------
  739|    252|	nota = xmlAddNotationDecl(&ctxt->vctxt, ctxt->myDoc->extSubset, name,
  740|    252|                              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.37k|#ifdef LIBXML_VALID_ENABLED
  748|  2.37k|    if (nota == NULL) ctxt->valid = 0;
  ------------------
  |  Branch (748:9): [True: 2.10k, False: 269]
  ------------------
  749|  2.37k|    if ((ctxt->validate) && (ctxt->wellFormed) &&
  ------------------
  |  Branch (749:9): [True: 1.39k, False: 981]
  |  Branch (749:29): [True: 328, False: 1.06k]
  ------------------
  750|    328|        (ctxt->myDoc->intSubset != NULL))
  ------------------
  |  Branch (750:9): [True: 328, False: 0]
  ------------------
  751|    328|	ctxt->valid &= xmlValidateNotationDecl(&ctxt->vctxt, ctxt->myDoc,
  752|    328|	                                       nota);
  753|  2.37k|#endif /* LIBXML_VALID_ENABLED */
  754|  2.37k|}
xmlSAX2UnparsedEntityDecl:
  769|    549|{
  770|    549|    xmlSAX2EntityDecl(ctx, name, XML_EXTERNAL_GENERAL_UNPARSED_ENTITY,
  771|    549|                      publicId, systemId, (xmlChar *) notationName);
  772|    549|}
xmlSAX2SetDocumentLocator:
  783|  51.8k|{
  784|  51.8k|}
xmlSAX2StartDocument:
  793|  51.4k|{
  794|  51.4k|    xmlParserCtxtPtr ctxt = (xmlParserCtxtPtr) ctx;
  795|  51.4k|    xmlDocPtr doc;
  796|       |
  797|  51.4k|    if (ctx == NULL) return;
  ------------------
  |  Branch (797:9): [True: 0, False: 51.4k]
  ------------------
  798|       |
  799|  51.4k|#ifdef LIBXML_HTML_ENABLED
  800|  51.4k|    if (ctxt->html) {
  ------------------
  |  Branch (800:9): [True: 0, False: 51.4k]
  ------------------
  801|      0|	if (ctxt->myDoc == NULL)
  ------------------
  |  Branch (801:6): [True: 0, False: 0]
  ------------------
  802|      0|	    ctxt->myDoc = htmlNewDocNoDtD(NULL, NULL);
  803|      0|	if (ctxt->myDoc == NULL) {
  ------------------
  |  Branch (803:6): [True: 0, False: 0]
  ------------------
  804|      0|	    xmlSAX2ErrMemory(ctxt);
  805|      0|	    return;
  806|      0|	}
  807|      0|	ctxt->myDoc->properties = XML_DOC_HTML;
  808|      0|	ctxt->myDoc->parseFlags = ctxt->options;
  809|      0|    } else
  810|  51.4k|#endif
  811|  51.4k|    {
  812|  51.4k|	doc = ctxt->myDoc = xmlNewDoc(ctxt->version);
  813|  51.4k|	if (doc != NULL) {
  ------------------
  |  Branch (813:6): [True: 51.4k, False: 22]
  ------------------
  814|  51.4k|	    doc->properties = 0;
  815|  51.4k|	    if (ctxt->options & XML_PARSE_OLD10)
  ------------------
  |  Branch (815:10): [True: 19.5k, False: 31.8k]
  ------------------
  816|  19.5k|	        doc->properties |= XML_DOC_OLD10;
  817|  51.4k|	    doc->parseFlags = ctxt->options;
  818|  51.4k|	    doc->standalone = ctxt->standalone;
  819|  51.4k|	} else {
  820|     22|	    xmlSAX2ErrMemory(ctxt);
  821|     22|	    return;
  822|     22|	}
  823|  51.4k|	if ((ctxt->dictNames) && (doc != NULL)) {
  ------------------
  |  Branch (823:6): [True: 29.9k, False: 21.4k]
  |  Branch (823:27): [True: 29.9k, False: 0]
  ------------------
  824|  29.9k|	    doc->dict = ctxt->dict;
  825|  29.9k|	    xmlDictReference(doc->dict);
  826|  29.9k|	}
  827|  51.4k|    }
  828|  51.4k|    if ((ctxt->myDoc != NULL) && (ctxt->myDoc->URL == NULL) &&
  ------------------
  |  Branch (828:9): [True: 51.4k, False: 0]
  |  Branch (828:34): [True: 51.4k, False: 0]
  ------------------
  829|  51.4k|	(ctxt->input != NULL) && (ctxt->input->filename != NULL)) {
  ------------------
  |  Branch (829:2): [True: 51.4k, False: 0]
  |  Branch (829:27): [True: 9.73k, False: 41.6k]
  ------------------
  830|  9.73k|	ctxt->myDoc->URL = xmlPathToURI((const xmlChar *)ctxt->input->filename);
  831|  9.73k|	if (ctxt->myDoc->URL == NULL)
  ------------------
  |  Branch (831:6): [True: 8, False: 9.72k]
  ------------------
  832|      8|	    xmlSAX2ErrMemory(ctxt);
  833|  9.73k|    }
  834|  51.4k|}
xmlSAX2EndDocument:
  843|  28.4k|{
  844|  28.4k|    xmlParserCtxtPtr ctxt = (xmlParserCtxtPtr) ctx;
  845|  28.4k|    xmlDocPtr doc;
  846|       |
  847|  28.4k|    if (ctx == NULL) return;
  ------------------
  |  Branch (847:9): [True: 0, False: 28.4k]
  ------------------
  848|  28.4k|#ifdef LIBXML_VALID_ENABLED
  849|  28.4k|    if (ctxt->validate && ctxt->wellFormed &&
  ------------------
  |  Branch (849:9): [True: 5.09k, False: 23.3k]
  |  Branch (849:27): [True: 666, False: 4.42k]
  ------------------
  850|    666|        ctxt->myDoc && ctxt->myDoc->intSubset)
  ------------------
  |  Branch (850:9): [True: 666, False: 0]
  |  Branch (850:24): [True: 666, False: 0]
  ------------------
  851|    666|	ctxt->valid &= xmlValidateDocumentFinal(&ctxt->vctxt, ctxt->myDoc);
  852|  28.4k|#endif /* LIBXML_VALID_ENABLED */
  853|       |
  854|  28.4k|    doc = ctxt->myDoc;
  855|  28.4k|    if (doc == NULL)
  ------------------
  |  Branch (855:9): [True: 83, False: 28.3k]
  ------------------
  856|     83|        return;
  857|       |
  858|  28.3k|    if (doc->encoding == NULL) {
  ------------------
  |  Branch (858:9): [True: 28.3k, False: 0]
  ------------------
  859|  28.3k|        const xmlChar *encoding = xmlGetActualEncoding(ctxt);
  860|       |
  861|  28.3k|        if (encoding != NULL) {
  ------------------
  |  Branch (861:13): [True: 269, False: 28.0k]
  ------------------
  862|    269|            doc->encoding = xmlStrdup(encoding);
  863|    269|            if (doc->encoding == NULL)
  ------------------
  |  Branch (863:17): [True: 3, False: 266]
  ------------------
  864|      3|                xmlSAX2ErrMemory(ctxt);
  865|    269|        }
  866|  28.3k|    }
  867|       |
  868|  28.3k|#ifdef LIBXML_HTML_ENABLED
  869|  28.3k|    if (ctxt->html) {
  ------------------
  |  Branch (869:9): [True: 0, False: 28.3k]
  ------------------
  870|      0|        if (((ctxt->options & HTML_PARSE_NODEFDTD) == 0) &&
  ------------------
  |  Branch (870:13): [True: 0, False: 0]
  ------------------
  871|      0|            (doc->intSubset == NULL)) {
  ------------------
  |  Branch (871:13): [True: 0, False: 0]
  ------------------
  872|      0|            doc->intSubset = xmlCreateIntSubset(doc, BAD_CAST "html",
  ------------------
  |  |   34|      0|#define BAD_CAST (xmlChar *)
  ------------------
  873|      0|                    BAD_CAST "-//W3C//DTD HTML 4.0 Transitional//EN",
  ------------------
  |  |   34|      0|#define BAD_CAST (xmlChar *)
  ------------------
  874|      0|                    BAD_CAST "http://www.w3.org/TR/REC-html40/loose.dtd");
  ------------------
  |  |   34|      0|#define BAD_CAST (xmlChar *)
  ------------------
  875|      0|            if (doc->intSubset == NULL)
  ------------------
  |  Branch (875:17): [True: 0, False: 0]
  ------------------
  876|      0|                xmlSAX2ErrMemory(ctxt);
  877|      0|        }
  878|      0|    } else
  879|  28.3k|#endif /* LIBXML_HTML_ENABLED */
  880|  28.3k|    {
  881|  28.3k|        if (ctxt->wellFormed) {
  ------------------
  |  Branch (881:13): [True: 13.8k, False: 14.5k]
  ------------------
  882|  13.8k|            doc->properties |= XML_DOC_WELLFORMED;
  883|  13.8k|            if (ctxt->valid)
  ------------------
  |  Branch (883:17): [True: 7.42k, False: 6.41k]
  ------------------
  884|  7.42k|                doc->properties |= XML_DOC_DTDVALID;
  885|  13.8k|            if (ctxt->nsWellFormed)
  ------------------
  |  Branch (885:17): [True: 11.1k, False: 2.64k]
  ------------------
  886|  11.1k|                doc->properties |= XML_DOC_NSVALID;
  887|  13.8k|        }
  888|       |
  889|  28.3k|        if (ctxt->options & XML_PARSE_OLD10)
  ------------------
  |  Branch (889:13): [True: 11.3k, False: 17.0k]
  ------------------
  890|  11.3k|            doc->properties |= XML_DOC_OLD10;
  891|  28.3k|    }
  892|  28.3k|}
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|   191k|{
 1749|   191k|    xmlParserCtxtPtr ctxt = (xmlParserCtxtPtr) ctx;
 1750|       |
 1751|   191k|    if (ctxt == NULL)
  ------------------
  |  Branch (1751:9): [True: 0, False: 191k]
  ------------------
 1752|      0|        return;
 1753|       |
 1754|   191k|#if defined(LIBXML_SAX1_ENABLED) && defined(LIBXML_VALID_ENABLED)
 1755|   191k|    if (!ctxt->html && ctxt->validate && ctxt->wellFormed &&
  ------------------
  |  Branch (1755:9): [True: 191k, False: 0]
  |  Branch (1755:24): [True: 45.9k, False: 145k]
  |  Branch (1755:42): [True: 29.3k, False: 16.6k]
  ------------------
 1756|  29.3k|        ctxt->myDoc && ctxt->myDoc->intSubset)
  ------------------
  |  Branch (1756:9): [True: 29.3k, False: 0]
  |  Branch (1756:24): [True: 29.3k, False: 0]
  ------------------
 1757|  29.3k|        ctxt->valid &= xmlValidateOneElement(&ctxt->vctxt, ctxt->myDoc,
 1758|  29.3k|					     ctxt->node);
 1759|   191k|#endif /* LIBXML_VALID_ENABLED */
 1760|       |
 1761|   191k|#if defined(LIBXML_SAX1_ENABLED) || defined(LIBXML_HTML_ENABLED)
 1762|   191k|    ctxt->nodemem = -1;
 1763|       |
 1764|       |    /*
 1765|       |     * end of parsing of this node.
 1766|       |     */
 1767|   191k|    nodePop(ctxt);
 1768|   191k|#endif
 1769|   191k|}
xmlSAX2StartElementNs:
 2155|   622k|{
 2156|   622k|    xmlParserCtxtPtr ctxt = (xmlParserCtxtPtr) ctx;
 2157|   622k|    xmlNodePtr ret;
 2158|   622k|    xmlNsPtr last = NULL, ns;
 2159|   622k|    const xmlChar *uri, *pref;
 2160|   622k|    xmlChar *lname = NULL;
 2161|   622k|    int i, j;
 2162|       |
 2163|   622k|    if (ctx == NULL) return;
  ------------------
  |  Branch (2163:9): [True: 0, False: 622k]
  ------------------
 2164|       |
 2165|   622k|#ifdef LIBXML_VALID_ENABLED
 2166|       |    /*
 2167|       |     * First check on validity:
 2168|       |     */
 2169|   622k|    if (ctxt->validate &&
  ------------------
  |  Branch (2169:9): [True: 138k, False: 484k]
  ------------------
 2170|   138k|        ((ctxt->myDoc == NULL) ||
  ------------------
  |  Branch (2170:10): [True: 0, False: 138k]
  ------------------
 2171|   138k|         ((ctxt->myDoc->extSubset == NULL) &&
  ------------------
  |  Branch (2171:11): [True: 133k, False: 4.28k]
  ------------------
 2172|   133k|          ((ctxt->myDoc->intSubset == NULL) ||
  ------------------
  |  Branch (2172:12): [True: 5.75k, False: 128k]
  ------------------
 2173|   128k|	   ((ctxt->myDoc->intSubset->notations == NULL) &&
  ------------------
  |  Branch (2173:6): [True: 127k, False: 831]
  ------------------
 2174|   127k|	    (ctxt->myDoc->intSubset->elements == NULL) &&
  ------------------
  |  Branch (2174:6): [True: 12.1k, False: 115k]
  ------------------
 2175|  12.1k|	    (ctxt->myDoc->intSubset->attributes == NULL) &&
  ------------------
  |  Branch (2175:6): [True: 12.1k, False: 0]
  ------------------
 2176|  12.1k|	    (ctxt->myDoc->intSubset->entities == NULL)))))) {
  ------------------
  |  Branch (2176:6): [True: 902, False: 11.2k]
  ------------------
 2177|  6.65k|	xmlErrValid(ctxt, XML_DTD_NO_DTD,
 2178|  6.65k|	  "Validation failed: no DTD found !", NULL, NULL);
 2179|  6.65k|	ctxt->validate = 0;
 2180|  6.65k|    }
 2181|   622k|#endif /* LIBXML_VALID_ENABLED */
 2182|       |
 2183|       |    /*
 2184|       |     * Take care of the rare case of an undefined namespace prefix
 2185|       |     */
 2186|   622k|    if ((prefix != NULL) && (URI == NULL)) {
  ------------------
  |  Branch (2186:9): [True: 92.1k, False: 530k]
  |  Branch (2186:29): [True: 28.2k, False: 63.8k]
  ------------------
 2187|  28.2k|        if (ctxt->dictNames) {
  ------------------
  |  Branch (2187:13): [True: 12.2k, False: 16.0k]
  ------------------
 2188|  12.2k|	    const xmlChar *fullname;
 2189|       |
 2190|  12.2k|	    fullname = xmlDictQLookup(ctxt->dict, prefix, localname);
 2191|  12.2k|	    if (fullname == NULL) {
  ------------------
  |  Branch (2191:10): [True: 2, False: 12.2k]
  ------------------
 2192|      2|                xmlSAX2ErrMemory(ctxt);
 2193|      2|                return;
 2194|      2|            }
 2195|  12.2k|	    localname = fullname;
 2196|  16.0k|	} else {
 2197|  16.0k|	    lname = xmlBuildQName(localname, prefix, NULL, 0);
 2198|  16.0k|            if (lname == NULL) {
  ------------------
  |  Branch (2198:17): [True: 1, False: 16.0k]
  ------------------
 2199|      1|                xmlSAX2ErrMemory(ctxt);
 2200|      1|                return;
 2201|      1|            }
 2202|  16.0k|	}
 2203|  28.2k|    }
 2204|       |    /*
 2205|       |     * allocate the node
 2206|       |     */
 2207|   622k|    if (ctxt->freeElems != NULL) {
  ------------------
  |  Branch (2207:9): [True: 2.03k, False: 620k]
  ------------------
 2208|  2.03k|        ret = ctxt->freeElems;
 2209|  2.03k|	ctxt->freeElems = ret->next;
 2210|  2.03k|	ctxt->freeElemsNr--;
 2211|  2.03k|	memset(ret, 0, sizeof(xmlNode));
 2212|  2.03k|        ret->doc = ctxt->myDoc;
 2213|  2.03k|	ret->type = XML_ELEMENT_NODE;
 2214|       |
 2215|  2.03k|	if (ctxt->dictNames)
  ------------------
  |  Branch (2215:6): [True: 990, False: 1.04k]
  ------------------
 2216|    990|	    ret->name = localname;
 2217|  1.04k|	else {
 2218|  1.04k|	    if (lname == NULL)
  ------------------
  |  Branch (2218:10): [True: 795, False: 253]
  ------------------
 2219|    795|		ret->name = xmlStrdup(localname);
 2220|    253|	    else
 2221|    253|	        ret->name = lname;
 2222|  1.04k|	    if (ret->name == NULL) {
  ------------------
  |  Branch (2222:10): [True: 1, False: 1.04k]
  ------------------
 2223|      1|	        xmlSAX2ErrMemory(ctxt);
 2224|      1|                xmlFree(ret);
 2225|      1|		return;
 2226|      1|	    }
 2227|  1.04k|	}
 2228|  2.03k|	if ((xmlRegisterCallbacks) && (xmlRegisterNodeDefaultValue))
  ------------------
  |  |  932|      0|    (*__xmlRegisterNodeDefaultValue())
  ------------------
  |  Branch (2228:6): [True: 0, False: 2.03k]
  |  Branch (2228:32): [True: 0, False: 0]
  ------------------
 2229|      0|	    xmlRegisterNodeDefaultValue(ret);
  ------------------
  |  |  932|      0|    (*__xmlRegisterNodeDefaultValue())
  ------------------
 2230|   620k|    } else {
 2231|   620k|	if (ctxt->dictNames)
  ------------------
  |  Branch (2231:6): [True: 383k, False: 237k]
  ------------------
 2232|   383k|	    ret = xmlNewDocNodeEatName(ctxt->myDoc, NULL,
 2233|   383k|	                               (xmlChar *) localname, NULL);
 2234|   237k|	else if (lname == NULL)
  ------------------
  |  Branch (2234:11): [True: 221k, False: 15.8k]
  ------------------
 2235|   221k|	    ret = xmlNewDocNode(ctxt->myDoc, NULL, localname, NULL);
 2236|  15.8k|	else
 2237|  15.8k|	    ret = xmlNewDocNodeEatName(ctxt->myDoc, NULL, lname, NULL);
 2238|   620k|	if (ret == NULL) {
  ------------------
  |  Branch (2238:6): [True: 69, False: 620k]
  ------------------
 2239|     69|	    xmlSAX2ErrMemory(ctxt);
 2240|     69|	    return;
 2241|     69|	}
 2242|   620k|    }
 2243|       |
 2244|       |    /*
 2245|       |     * Build the namespace list
 2246|       |     */
 2247|   882k|    for (i = 0,j = 0;j < nb_namespaces;j++) {
  ------------------
  |  Branch (2247:22): [True: 260k, False: 622k]
  ------------------
 2248|   260k|        pref = namespaces[i++];
 2249|   260k|	uri = namespaces[i++];
 2250|   260k|	ns = xmlNewNs(NULL, uri, pref);
 2251|   260k|	if (ns != NULL) {
  ------------------
  |  Branch (2251:6): [True: 260k, False: 66]
  ------------------
 2252|   260k|	    if (last == NULL) {
  ------------------
  |  Branch (2252:10): [True: 109k, False: 150k]
  ------------------
 2253|   109k|	        ret->nsDef = last = ns;
 2254|   150k|	    } else {
 2255|   150k|	        last->next = ns;
 2256|   150k|		last = ns;
 2257|   150k|	    }
 2258|   260k|	    if ((URI != NULL) && (prefix == pref))
  ------------------
  |  Branch (2258:10): [True: 216k, False: 43.0k]
  |  Branch (2258:27): [True: 78.7k, False: 138k]
  ------------------
 2259|  78.7k|		ret->ns = ns;
 2260|   260k|	} else {
 2261|     66|            xmlSAX2ErrMemory(ctxt);
 2262|     66|	    continue;
 2263|     66|	}
 2264|       |
 2265|   260k|        xmlParserNsUpdateSax(ctxt, pref, ns);
 2266|       |
 2267|   260k|#ifdef LIBXML_VALID_ENABLED
 2268|   260k|	if ((!ctxt->html) && ctxt->validate && ctxt->wellFormed &&
  ------------------
  |  Branch (2268:6): [True: 260k, False: 0]
  |  Branch (2268:23): [True: 136k, False: 123k]
  |  Branch (2268:41): [True: 8.61k, False: 127k]
  ------------------
 2269|  8.61k|	    ctxt->myDoc && ctxt->myDoc->intSubset) {
  ------------------
  |  Branch (2269:6): [True: 8.61k, False: 0]
  |  Branch (2269:21): [True: 8.61k, False: 0]
  ------------------
 2270|  8.61k|	    ctxt->valid &= xmlValidateOneNamespace(&ctxt->vctxt, ctxt->myDoc,
 2271|  8.61k|	                                           ret, prefix, ns, uri);
 2272|  8.61k|	}
 2273|   260k|#endif /* LIBXML_VALID_ENABLED */
 2274|   260k|    }
 2275|   622k|    ctxt->nodemem = -1;
 2276|       |
 2277|       |    /*
 2278|       |     * Link the child element
 2279|       |     */
 2280|   622k|    xmlSAX2AppendChild(ctxt, ret);
 2281|       |
 2282|       |    /*
 2283|       |     * We are parsing a new node.
 2284|       |     */
 2285|   622k|    if (nodePush(ctxt, ret) < 0) {
  ------------------
  |  Branch (2285:9): [True: 41, False: 622k]
  ------------------
 2286|     41|        xmlUnlinkNode(ret);
 2287|     41|        xmlFreeNode(ret);
 2288|     41|        return;
 2289|     41|    }
 2290|       |
 2291|       |    /*
 2292|       |     * Insert the defaulted attributes from the DTD only if requested:
 2293|       |     */
 2294|   622k|    if ((nb_defaulted != 0) &&
  ------------------
  |  Branch (2294:9): [True: 79.2k, False: 543k]
  ------------------
 2295|  79.2k|        ((ctxt->loadsubset & XML_COMPLETE_ATTRS) == 0))
  ------------------
  |  |  209|  79.2k|#define XML_COMPLETE_ATTRS	4
  ------------------
  |  Branch (2295:9): [True: 19.9k, False: 59.3k]
  ------------------
 2296|  19.9k|	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|   622k|    if ((URI != NULL) && (ret->ns == NULL)) {
  ------------------
  |  Branch (2302:9): [True: 109k, False: 513k]
  |  Branch (2302:26): [True: 31.0k, False: 78.7k]
  ------------------
 2303|  31.0k|        ret->ns = xmlParserNsLookupSax(ctxt, prefix);
 2304|  31.0k|	if ((ret->ns == NULL) && (xmlStrEqual(prefix, BAD_CAST "xml"))) {
  ------------------
  |  |   34|    457|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (2304:6): [True: 457, False: 30.5k]
  |  Branch (2304:27): [True: 439, False: 18]
  ------------------
 2305|    439|            int res;
 2306|       |
 2307|    439|	    res = xmlSearchNsSafe(ret, prefix, &ret->ns);
 2308|    439|            if (res < 0)
  ------------------
  |  Branch (2308:17): [True: 7, False: 432]
  ------------------
 2309|      7|                xmlSAX2ErrMemory(ctxt);
 2310|    439|	}
 2311|  31.0k|	if (ret->ns == NULL) {
  ------------------
  |  Branch (2311:6): [True: 25, False: 30.9k]
  ------------------
 2312|     25|	    ns = xmlNewNs(ret, NULL, prefix);
 2313|     25|	    if (ns == NULL) {
  ------------------
  |  Branch (2313:10): [True: 0, False: 25]
  ------------------
 2314|       |
 2315|      0|	        xmlSAX2ErrMemory(ctxt);
 2316|      0|		return;
 2317|      0|	    }
 2318|     25|            if (prefix != NULL)
  ------------------
  |  Branch (2318:17): [True: 10, False: 15]
  ------------------
 2319|     10|                xmlNsWarnMsg(ctxt, XML_NS_ERR_UNDEFINED_NAMESPACE,
 2320|     10|                             "Namespace prefix %s was not found\n",
 2321|     10|                             prefix, NULL);
 2322|     15|            else
 2323|     15|                xmlNsWarnMsg(ctxt, XML_NS_ERR_UNDEFINED_NAMESPACE,
 2324|     15|                             "Namespace default prefix was not found\n",
 2325|     15|                             NULL, NULL);
 2326|     25|	}
 2327|  31.0k|    }
 2328|       |
 2329|       |    /*
 2330|       |     * process all the other attributes
 2331|       |     */
 2332|   622k|    if (nb_attributes > 0) {
  ------------------
  |  Branch (2332:9): [True: 93.9k, False: 528k]
  ------------------
 2333|  93.9k|        xmlAttrPtr prev = NULL;
 2334|       |
 2335|   368k|        for (j = 0,i = 0;i < nb_attributes;i++,j+=5) {
  ------------------
  |  Branch (2335:26): [True: 274k, False: 93.9k]
  ------------------
 2336|   274k|            xmlAttrPtr attr = NULL;
 2337|       |
 2338|       |	    /*
 2339|       |	     * Handle the rare case of an undefined attribute prefix
 2340|       |	     */
 2341|   274k|	    if ((attributes[j+1] != NULL) && (attributes[j+2] == NULL)) {
  ------------------
  |  Branch (2341:10): [True: 117k, False: 157k]
  |  Branch (2341:39): [True: 58.5k, False: 58.9k]
  ------------------
 2342|  58.5k|		if (ctxt->dictNames) {
  ------------------
  |  Branch (2342:7): [True: 16.7k, False: 41.8k]
  ------------------
 2343|  16.7k|		    const xmlChar *fullname;
 2344|       |
 2345|  16.7k|		    fullname = xmlDictQLookup(ctxt->dict, attributes[j+1],
 2346|  16.7k|		                              attributes[j]);
 2347|  16.7k|		    if (fullname == NULL) {
  ------------------
  |  Branch (2347:11): [True: 1, False: 16.7k]
  ------------------
 2348|      1|                        xmlSAX2ErrMemory(ctxt);
 2349|      1|                        return;
 2350|      1|                    }
 2351|  16.7k|                    attr = xmlSAX2AttributeNs(ctxt, fullname, NULL,
 2352|  16.7k|                                              attributes[j+3],
 2353|  16.7k|                                              attributes[j+4]);
 2354|  16.7k|                    goto have_attr;
 2355|  41.8k|		} else {
 2356|  41.8k|		    lname = xmlBuildQName(attributes[j], attributes[j+1],
 2357|  41.8k|		                          NULL, 0);
 2358|  41.8k|		    if (lname == NULL) {
  ------------------
  |  Branch (2358:11): [True: 4, False: 41.8k]
  ------------------
 2359|      4|                        xmlSAX2ErrMemory(ctxt);
 2360|      4|                        return;
 2361|      4|                    }
 2362|  41.8k|                    attr = xmlSAX2AttributeNs(ctxt, lname, NULL,
 2363|  41.8k|                                              attributes[j+3],
 2364|  41.8k|                                              attributes[j+4]);
 2365|  41.8k|                    xmlFree(lname);
 2366|  41.8k|                    goto have_attr;
 2367|  41.8k|		}
 2368|  58.5k|	    }
 2369|   216k|            attr = xmlSAX2AttributeNs(ctxt, attributes[j], attributes[j+1],
 2370|   216k|                                      attributes[j+3], attributes[j+4]);
 2371|   274k|have_attr:
 2372|   274k|            if (attr == NULL)
  ------------------
  |  Branch (2372:17): [True: 20, False: 274k]
  ------------------
 2373|     20|                continue;
 2374|       |
 2375|       |            /* link at the end to preserve order */
 2376|   274k|            if (prev == NULL) {
  ------------------
  |  Branch (2376:17): [True: 93.9k, False: 180k]
  ------------------
 2377|  93.9k|                ctxt->node->properties = attr;
 2378|   180k|            } else {
 2379|   180k|                prev->next = attr;
 2380|   180k|                attr->prev = prev;
 2381|   180k|            }
 2382|       |
 2383|   274k|            prev = attr;
 2384|   274k|	}
 2385|  93.9k|    }
 2386|       |
 2387|   622k|#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|   622k|    if ((ctxt->validate) &&
  ------------------
  |  Branch (2392:9): [True: 131k, False: 491k]
  ------------------
 2393|   131k|        ((ctxt->vctxt.flags & XML_VCTXT_DTD_VALIDATED) == 0)) {
  ------------------
  |  |   16|   131k|#define XML_VCTXT_DTD_VALIDATED (1u << 0)
  ------------------
  |  Branch (2393:9): [True: 4.40k, False: 126k]
  ------------------
 2394|  4.40k|	int chk;
 2395|       |
 2396|  4.40k|	chk = xmlValidateDtdFinal(&ctxt->vctxt, ctxt->myDoc);
 2397|  4.40k|	if (chk <= 0)
  ------------------
  |  Branch (2397:6): [True: 47, False: 4.35k]
  ------------------
 2398|     47|	    ctxt->valid = 0;
 2399|  4.40k|	if (chk < 0)
  ------------------
  |  Branch (2399:6): [True: 0, False: 4.40k]
  ------------------
 2400|      0|	    ctxt->wellFormed = 0;
 2401|  4.40k|	ctxt->valid &= xmlValidateRoot(&ctxt->vctxt, ctxt->myDoc);
 2402|  4.40k|	ctxt->vctxt.flags |= XML_VCTXT_DTD_VALIDATED;
  ------------------
  |  |   16|  4.40k|#define XML_VCTXT_DTD_VALIDATED (1u << 0)
  ------------------
 2403|  4.40k|    }
 2404|   622k|#endif /* LIBXML_VALID_ENABLED */
 2405|   622k|}
xmlSAX2EndElementNs:
 2421|   423k|{
 2422|   423k|    xmlParserCtxtPtr ctxt = (xmlParserCtxtPtr) ctx;
 2423|       |
 2424|   423k|    if (ctx == NULL) return;
  ------------------
  |  Branch (2424:9): [True: 0, False: 423k]
  ------------------
 2425|   423k|    ctxt->nodemem = -1;
 2426|       |
 2427|   423k|#ifdef LIBXML_VALID_ENABLED
 2428|   423k|    if (ctxt->validate && ctxt->wellFormed &&
  ------------------
  |  Branch (2428:9): [True: 56.3k, False: 367k]
  |  Branch (2428:27): [True: 40.8k, False: 15.4k]
  ------------------
 2429|  40.8k|        ctxt->myDoc && ctxt->myDoc->intSubset)
  ------------------
  |  Branch (2429:9): [True: 40.8k, False: 0]
  |  Branch (2429:24): [True: 40.8k, False: 0]
  ------------------
 2430|  40.8k|        ctxt->valid &= xmlValidateOneElement(&ctxt->vctxt, ctxt->myDoc,
 2431|  40.8k|                                             ctxt->node);
 2432|   423k|#endif /* LIBXML_VALID_ENABLED */
 2433|       |
 2434|       |    /*
 2435|       |     * end of parsing of this node.
 2436|       |     */
 2437|   423k|    nodePop(ctxt);
 2438|   423k|}
xmlSAX2Reference:
 2448|  45.0k|{
 2449|  45.0k|    xmlParserCtxtPtr ctxt = (xmlParserCtxtPtr) ctx;
 2450|  45.0k|    xmlNodePtr ret;
 2451|       |
 2452|  45.0k|    if (ctx == NULL) return;
  ------------------
  |  Branch (2452:9): [True: 0, False: 45.0k]
  ------------------
 2453|  45.0k|    ret = xmlNewReference(ctxt->myDoc, name);
 2454|  45.0k|    if (ret == NULL) {
  ------------------
  |  Branch (2454:9): [True: 12, False: 45.0k]
  ------------------
 2455|     12|        xmlSAX2ErrMemory(ctxt);
 2456|     12|        return;
 2457|     12|    }
 2458|       |
 2459|  45.0k|    xmlSAX2AppendChild(ctxt, ret);
 2460|  45.0k|}
xmlSAX2Characters:
 2606|   781k|{
 2607|   781k|    xmlSAX2Text((xmlParserCtxtPtr) ctx, ch, len, XML_TEXT_NODE);
 2608|   781k|}
xmlSAX2ProcessingInstruction:
 2633|   163k|{
 2634|   163k|    xmlParserCtxtPtr ctxt = (xmlParserCtxtPtr) ctx;
 2635|   163k|    xmlNodePtr ret;
 2636|       |
 2637|   163k|    if (ctx == NULL) return;
  ------------------
  |  Branch (2637:9): [True: 0, False: 163k]
  ------------------
 2638|       |
 2639|   163k|    ret = xmlNewDocPI(ctxt->myDoc, target, data);
 2640|   163k|    if (ret == NULL) {
  ------------------
  |  Branch (2640:9): [True: 9, False: 163k]
  ------------------
 2641|      9|        xmlSAX2ErrMemory(ctxt);
 2642|      9|        return;
 2643|      9|    }
 2644|       |
 2645|   163k|    xmlSAX2AppendChild(ctxt, ret);
 2646|   163k|}
xmlSAX2Comment:
 2656|   339k|{
 2657|   339k|    xmlParserCtxtPtr ctxt = (xmlParserCtxtPtr) ctx;
 2658|   339k|    xmlNodePtr ret;
 2659|       |
 2660|   339k|    if (ctx == NULL) return;
  ------------------
  |  Branch (2660:9): [True: 0, False: 339k]
  ------------------
 2661|       |
 2662|   339k|    ret = xmlNewDocComment(ctxt->myDoc, value);
 2663|   339k|    if (ret == NULL) {
  ------------------
  |  Branch (2663:9): [True: 8, False: 339k]
  ------------------
 2664|      8|        xmlSAX2ErrMemory(ctxt);
 2665|      8|        return;
 2666|      8|    }
 2667|       |
 2668|   339k|    xmlSAX2AppendChild(ctxt, ret);
 2669|   339k|}
xmlSAX2CDataBlock:
 2680|  74.1k|{
 2681|  74.1k|    xmlSAX2Text((xmlParserCtxtPtr) ctx, value, len, XML_CDATA_SECTION_NODE);
 2682|  74.1k|}
xmlSAXVersion:
 2711|  96.6k|{
 2712|  96.6k|    if (hdlr == NULL) return(-1);
  ------------------
  |  Branch (2712:9): [True: 0, False: 96.6k]
  ------------------
 2713|  96.6k|    if (version == 2) {
  ------------------
  |  Branch (2713:9): [True: 96.6k, False: 0]
  ------------------
 2714|  96.6k|	hdlr->startElementNs = xmlSAX2StartElementNs;
 2715|  96.6k|	hdlr->endElementNs = xmlSAX2EndElementNs;
 2716|  96.6k|	hdlr->serror = NULL;
 2717|  96.6k|	hdlr->initialized = XML_SAX2_MAGIC;
  ------------------
  |  |  953|  96.6k|#define XML_SAX2_MAGIC 0xDEEDBEAF
  ------------------
 2718|  96.6k|#ifdef LIBXML_SAX1_ENABLED
 2719|  96.6k|    } else if (version == 1) {
  ------------------
  |  Branch (2719:16): [True: 0, False: 0]
  ------------------
 2720|      0|	hdlr->initialized = 1;
 2721|      0|#endif /* LIBXML_SAX1_ENABLED */
 2722|      0|    } else
 2723|      0|        return(-1);
 2724|  96.6k|#ifdef LIBXML_SAX1_ENABLED
 2725|  96.6k|    hdlr->startElement = xmlSAX2StartElement;
 2726|  96.6k|    hdlr->endElement = xmlSAX2EndElement;
 2727|       |#else
 2728|       |    hdlr->startElement = NULL;
 2729|       |    hdlr->endElement = NULL;
 2730|       |#endif /* LIBXML_SAX1_ENABLED */
 2731|  96.6k|    hdlr->internalSubset = xmlSAX2InternalSubset;
 2732|  96.6k|    hdlr->externalSubset = xmlSAX2ExternalSubset;
 2733|  96.6k|    hdlr->isStandalone = xmlSAX2IsStandalone;
 2734|  96.6k|    hdlr->hasInternalSubset = xmlSAX2HasInternalSubset;
 2735|  96.6k|    hdlr->hasExternalSubset = xmlSAX2HasExternalSubset;
 2736|  96.6k|    hdlr->resolveEntity = xmlSAX2ResolveEntity;
 2737|  96.6k|    hdlr->getEntity = xmlSAX2GetEntity;
 2738|  96.6k|    hdlr->getParameterEntity = xmlSAX2GetParameterEntity;
 2739|  96.6k|    hdlr->entityDecl = xmlSAX2EntityDecl;
 2740|  96.6k|    hdlr->attributeDecl = xmlSAX2AttributeDecl;
 2741|  96.6k|    hdlr->elementDecl = xmlSAX2ElementDecl;
 2742|  96.6k|    hdlr->notationDecl = xmlSAX2NotationDecl;
 2743|  96.6k|    hdlr->unparsedEntityDecl = xmlSAX2UnparsedEntityDecl;
 2744|  96.6k|    hdlr->setDocumentLocator = xmlSAX2SetDocumentLocator;
 2745|  96.6k|    hdlr->startDocument = xmlSAX2StartDocument;
 2746|  96.6k|    hdlr->endDocument = xmlSAX2EndDocument;
 2747|  96.6k|    hdlr->reference = xmlSAX2Reference;
 2748|  96.6k|    hdlr->characters = xmlSAX2Characters;
 2749|  96.6k|    hdlr->cdataBlock = xmlSAX2CDataBlock;
 2750|  96.6k|    hdlr->ignorableWhitespace = xmlSAX2Characters;
 2751|  96.6k|    hdlr->processingInstruction = xmlSAX2ProcessingInstruction;
 2752|  96.6k|    hdlr->comment = xmlSAX2Comment;
 2753|  96.6k|    hdlr->warning = xmlParserWarning;
 2754|  96.6k|    hdlr->error = xmlParserError;
 2755|  96.6k|    hdlr->fatalError = xmlParserError;
 2756|       |
 2757|  96.6k|    return(0);
 2758|  96.6k|}
SAX2.c:xmlSAX2ErrMemory:
   42|    826|xmlSAX2ErrMemory(xmlParserCtxtPtr ctxt) {
   43|    826|    xmlCtxtErrMemory(ctxt);
   44|    826|}
SAX2.c:xmlWarnMsg:
  111|  13.8k|{
  112|  13.8k|    xmlCtxtErr(ctxt, NULL, XML_FROM_PARSER, error, XML_ERR_WARNING,
  113|  13.8k|               str1, NULL, NULL, 0, msg, str1);
  114|  13.8k|}
SAX2.c:xmlFatalErrMsg:
   79|    318|{
   80|    318|    xmlCtxtErr(ctxt, NULL, XML_FROM_PARSER, error, XML_ERR_FATAL,
   81|       |               str1, str2, NULL, 0, msg, str1, str2);
   82|    318|}
SAX2.c:xmlErrId:
   95|  3.18k|{
   96|  3.18k|    xmlCtxtErr(ctxt, NULL, XML_FROM_PARSER, error, XML_ERR_ERROR,
   97|  3.18k|               str1, NULL, NULL, 0, msg, str1);
   98|  3.18k|}
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: 99.7k, False: 196k]
  |  Branch (1439:27): [True: 92.1k, False: 7.60k]
  ------------------
 1440|  92.1k|        ((ctxt->myDoc->intSubset == NULL) ||
  ------------------
  |  Branch (1440:10): [True: 4.95k, False: 87.1k]
  ------------------
 1441|  87.1k|	 ((ctxt->myDoc->intSubset->notations == NULL) &&
  ------------------
  |  Branch (1441:4): [True: 86.3k, False: 863]
  ------------------
 1442|  86.3k|	  (ctxt->myDoc->intSubset->elements == NULL) &&
  ------------------
  |  Branch (1442:4): [True: 7.52k, False: 78.8k]
  ------------------
 1443|  7.52k|	  (ctxt->myDoc->intSubset->attributes == NULL) &&
  ------------------
  |  Branch (1443:4): [True: 7.52k, False: 0]
  ------------------
 1444|  7.52k|	  (ctxt->myDoc->intSubset->entities == NULL)))) {
  ------------------
  |  Branch (1444:4): [True: 1.09k, False: 6.42k]
  ------------------
 1445|  6.05k|	xmlErrValid(ctxt, XML_ERR_NO_DTD,
 1446|  6.05k|	  "Validation failed: no DTD found !", NULL, NULL);
 1447|  6.05k|	ctxt->validate = 0;
 1448|  6.05k|    }
 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: 2, False: 296k]
  ------------------
 1456|      2|        xmlSAX2ErrMemory(ctxt);
 1457|      2|        return;
 1458|      2|    }
 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: 53, False: 296k]
  ------------------
 1467|     53|	xmlFree(prefix);
 1468|     53|	xmlSAX2ErrMemory(ctxt);
 1469|     53|        return;
 1470|     53|    }
 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: 17.8k, False: 278k]
  ------------------
 1476|  17.8k|        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: 32, False: 296k]
  ------------------
 1487|     32|        xmlUnlinkNode(ret);
 1488|     32|        xmlFreeNode(ret);
 1489|     32|        if (prefix != NULL)
  ------------------
  |  Branch (1489:13): [True: 4, False: 28]
  ------------------
 1490|      4|            xmlFree(prefix);
 1491|     32|        return;
 1492|     32|    }
 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: 141k, False: 154k]
  ------------------
 1499|   154k|        (ctxt->myDoc->extSubset != NULL)) {
  ------------------
  |  Branch (1499:9): [True: 0, False: 154k]
  ------------------
 1500|   141k|        xmlCheckDefaultedAttributes(ctxt, name, prefix, atts);
 1501|   141k|    }
 1502|       |
 1503|       |    /*
 1504|       |     * process all the attributes whose name start with "xmlns"
 1505|       |     */
 1506|   296k|    if (atts != NULL) {
  ------------------
  |  Branch (1506:9): [True: 64.4k, False: 231k]
  ------------------
 1507|  64.4k|        i = 0;
 1508|  64.4k|        att = atts[i++];
 1509|  64.4k|        value = atts[i++];
 1510|   146k|        while ((att != NULL) && (value != NULL)) {
  ------------------
  |  Branch (1510:16): [True: 82.2k, False: 64.4k]
  |  Branch (1510:33): [True: 82.2k, False: 0]
  ------------------
 1511|  82.2k|            if ((att[0] == 'x') && (att[1] == 'm') && (att[2] == 'l') &&
  ------------------
  |  Branch (1511:17): [True: 60.9k, False: 21.3k]
  |  Branch (1511:36): [True: 52.6k, False: 8.31k]
  |  Branch (1511:55): [True: 51.6k, False: 955]
  ------------------
 1512|  51.6k|                (att[3] == 'n') && (att[4] == 's'))
  ------------------
  |  Branch (1512:17): [True: 43.0k, False: 8.56k]
  |  Branch (1512:36): [True: 42.8k, False: 253]
  ------------------
 1513|  42.8k|                xmlSAX1Attribute(ctxt, att, value, prefix);
 1514|       |
 1515|  82.2k|            att = atts[i++];
 1516|  82.2k|            value = atts[i++];
 1517|  82.2k|        }
 1518|  64.4k|    }
 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: 4, False: 296k]
  ------------------
 1526|      4|        xmlSAX2ErrMemory(ctxt);
 1527|   296k|    if ((ns == NULL) && (parent != NULL)) {
  ------------------
  |  Branch (1527:9): [True: 235k, False: 60.2k]
  |  Branch (1527:25): [True: 235k, False: 0]
  ------------------
 1528|   235k|        res = xmlSearchNsSafe(parent, prefix, &ns);
 1529|   235k|        if (res < 0)
  ------------------
  |  Branch (1529:13): [True: 0, False: 235k]
  ------------------
 1530|      0|            xmlSAX2ErrMemory(ctxt);
 1531|   235k|    }
 1532|   296k|    if ((prefix != NULL) && (ns == NULL)) {
  ------------------
  |  Branch (1532:9): [True: 51.5k, False: 244k]
  |  Branch (1532:29): [True: 8.79k, False: 42.8k]
  ------------------
 1533|  8.79k|        xmlNsWarnMsg(ctxt, XML_NS_ERR_UNDEFINED_NAMESPACE,
 1534|  8.79k|                     "Namespace prefix %s is not defined\n",
 1535|  8.79k|                     prefix, NULL);
 1536|  8.79k|        ns = xmlNewNs(ret, NULL, prefix);
 1537|  8.79k|        if (ns == NULL)
  ------------------
  |  Branch (1537:13): [True: 5, False: 8.78k]
  ------------------
 1538|      5|            xmlSAX2ErrMemory(ctxt);
 1539|  8.79k|    }
 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: 69.0k, False: 227k]
  |  Branch (1545:25): [True: 60.2k, False: 8.78k]
  ------------------
 1546|  60.2k|        ((ns->href[0] != 0) || (ns->prefix != NULL)))
  ------------------
  |  Branch (1546:10): [True: 53.8k, False: 6.41k]
  |  Branch (1546:32): [True: 270, False: 6.14k]
  ------------------
 1547|  54.1k|        xmlSetNs(ret, ns);
 1548|       |
 1549|       |    /*
 1550|       |     * process all the other attributes
 1551|       |     */
 1552|   296k|    if (atts != NULL) {
  ------------------
  |  Branch (1552:9): [True: 64.4k, False: 231k]
  ------------------
 1553|  64.4k|        i = 0;
 1554|  64.4k|	att = atts[i++];
 1555|  64.4k|	value = atts[i++];
 1556|   146k|        while ((att != NULL) && (value != NULL)) {
  ------------------
  |  Branch (1556:16): [True: 82.2k, False: 64.4k]
  |  Branch (1556:33): [True: 82.2k, False: 0]
  ------------------
 1557|  82.2k|            if ((att[0] != 'x') || (att[1] != 'm') || (att[2] != 'l') ||
  ------------------
  |  Branch (1557:17): [True: 21.3k, False: 60.9k]
  |  Branch (1557:36): [True: 8.31k, False: 52.6k]
  |  Branch (1557:55): [True: 955, False: 51.6k]
  ------------------
 1558|  51.6k|                (att[3] != 'n') || (att[4] != 's'))
  ------------------
  |  Branch (1558:17): [True: 8.56k, False: 43.0k]
  |  Branch (1558:36): [True: 253, False: 42.8k]
  ------------------
 1559|  39.4k|                xmlSAX1Attribute(ctxt, att, value, NULL);
 1560|       |
 1561|       |            /*
 1562|       |             * Next ones
 1563|       |             */
 1564|  82.2k|            att = atts[i++];
 1565|  82.2k|            value = atts[i++];
 1566|  82.2k|        }
 1567|  64.4k|    }
 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: 93.6k, False: 202k]
  ------------------
 1575|  93.6k|        ((ctxt->vctxt.flags & XML_VCTXT_DTD_VALIDATED) == 0)) {
  ------------------
  |  |   16|  93.6k|#define XML_VCTXT_DTD_VALIDATED (1u << 0)
  ------------------
  |  Branch (1575:9): [True: 2.79k, False: 90.8k]
  ------------------
 1576|  2.79k|	int chk;
 1577|       |
 1578|  2.79k|	chk = xmlValidateDtdFinal(&ctxt->vctxt, ctxt->myDoc);
 1579|  2.79k|	if (chk <= 0)
  ------------------
  |  Branch (1579:6): [True: 44, False: 2.75k]
  ------------------
 1580|     44|	    ctxt->valid = 0;
 1581|  2.79k|	if (chk < 0)
  ------------------
  |  Branch (1581:6): [True: 0, False: 2.79k]
  ------------------
 1582|      0|	    ctxt->wellFormed = 0;
 1583|  2.79k|	ctxt->valid &= xmlValidateRoot(&ctxt->vctxt, ctxt->myDoc);
 1584|  2.79k|	ctxt->vctxt.flags |= XML_VCTXT_DTD_VALIDATED;
  ------------------
  |  |   16|  2.79k|#define XML_VCTXT_DTD_VALIDATED (1u << 0)
  ------------------
 1585|  2.79k|    }
 1586|   296k|#endif /* LIBXML_VALID_ENABLED */
 1587|       |
 1588|   296k|    if (prefix != NULL)
  ------------------
  |  Branch (1588:9): [True: 51.5k, False: 244k]
  ------------------
 1589|  51.5k|	xmlFree(prefix);
 1590|       |
 1591|   296k|}
SAX2.c:xmlCheckDefaultedAttributes:
 1257|   141k|	const xmlChar *prefix, const xmlChar **atts) {
 1258|   141k|    xmlElementPtr elemDecl;
 1259|   141k|    const xmlChar *att;
 1260|   141k|    int internal = 1;
 1261|   141k|    int i;
 1262|       |
 1263|   141k|    elemDecl = xmlGetDtdQElementDesc(ctxt->myDoc->intSubset, name, prefix);
 1264|   141k|    if (elemDecl == NULL) {
  ------------------
  |  Branch (1264:9): [True: 83.2k, False: 58.7k]
  ------------------
 1265|  83.2k|	elemDecl = xmlGetDtdQElementDesc(ctxt->myDoc->extSubset, name, prefix);
 1266|  83.2k|	internal = 0;
 1267|  83.2k|    }
 1268|       |
 1269|   200k|process_external_subset:
 1270|       |
 1271|   200k|    if (elemDecl != NULL) {
  ------------------
  |  Branch (1271:9): [True: 62.8k, False: 137k]
  ------------------
 1272|  62.8k|	xmlAttributePtr attr = elemDecl->attributes;
 1273|       |
 1274|  62.8k|#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|  62.8k|	if ((ctxt->myDoc->standalone == 1) &&
  ------------------
  |  Branch (1282:6): [True: 2.96k, False: 59.9k]
  ------------------
 1283|  2.96k|	    (ctxt->myDoc->extSubset != NULL) &&
  ------------------
  |  Branch (1283:6): [True: 2.71k, False: 255]
  ------------------
 1284|  2.71k|	    (ctxt->validate)) {
  ------------------
  |  Branch (1284:6): [True: 2.50k, False: 202]
  ------------------
 1285|  5.06k|	    while (attr != NULL) {
  ------------------
  |  Branch (1285:13): [True: 2.55k, False: 2.50k]
  ------------------
 1286|  2.55k|		if ((attr->defaultValue != NULL) &&
  ------------------
  |  Branch (1286:7): [True: 1.06k, False: 1.49k]
  ------------------
 1287|  1.06k|		    (xmlGetDtdQAttrDesc(ctxt->myDoc->extSubset,
  ------------------
  |  Branch (1287:7): [True: 852, False: 212]
  ------------------
 1288|  1.06k|					attr->elem, attr->name,
 1289|  1.06k|					attr->prefix) == attr) &&
 1290|    852|		    (xmlGetDtdQAttrDesc(ctxt->myDoc->intSubset,
  ------------------
  |  Branch (1290:7): [True: 852, False: 0]
  ------------------
 1291|    852|					attr->elem, attr->name,
 1292|    852|					attr->prefix) == NULL)) {
 1293|    852|		    xmlChar *fulln;
 1294|       |
 1295|    852|		    if (attr->prefix != NULL) {
  ------------------
  |  Branch (1295:11): [True: 69, False: 783]
  ------------------
 1296|     69|			fulln = xmlStrdup(attr->prefix);
 1297|     69|                        if (fulln != NULL)
  ------------------
  |  Branch (1297:29): [True: 68, False: 1]
  ------------------
 1298|     68|			    fulln = xmlStrcat(fulln, BAD_CAST ":");
  ------------------
  |  |   34|     68|#define BAD_CAST (xmlChar *)
  ------------------
 1299|     69|                        if (fulln != NULL)
  ------------------
  |  Branch (1299:29): [True: 68, False: 1]
  ------------------
 1300|     68|			    fulln = xmlStrcat(fulln, attr->name);
 1301|    783|		    } else {
 1302|    783|			fulln = xmlStrdup(attr->name);
 1303|    783|		    }
 1304|    852|                    if (fulln == NULL) {
  ------------------
  |  Branch (1304:25): [True: 2, False: 850]
  ------------------
 1305|      2|                        xmlSAX2ErrMemory(ctxt);
 1306|      2|                        break;
 1307|      2|                    }
 1308|       |
 1309|       |		    /*
 1310|       |		     * Check that the attribute is not declared in the
 1311|       |		     * serialization
 1312|       |		     */
 1313|    850|		    att = NULL;
 1314|    850|		    if (atts != NULL) {
  ------------------
  |  Branch (1314:11): [True: 409, False: 441]
  ------------------
 1315|    409|			i = 0;
 1316|    409|			att = atts[i];
 1317|    783|			while (att != NULL) {
  ------------------
  |  Branch (1317:11): [True: 443, False: 340]
  ------------------
 1318|    443|			    if (xmlStrEqual(att, fulln))
  ------------------
  |  Branch (1318:12): [True: 69, False: 374]
  ------------------
 1319|     69|				break;
 1320|    374|			    i += 2;
 1321|    374|			    att = atts[i];
 1322|    374|			}
 1323|    409|		    }
 1324|    850|		    if (att == NULL) {
  ------------------
  |  Branch (1324:11): [True: 781, False: 69]
  ------------------
 1325|    781|		        xmlErrValid(ctxt, XML_DTD_STANDALONE_DEFAULTED,
 1326|    781|      "standalone: attribute %s on %s defaulted from external subset\n",
 1327|    781|				    fulln,
 1328|    781|				    attr->elem);
 1329|    781|		    }
 1330|    850|                    xmlFree(fulln);
 1331|    850|		}
 1332|  2.55k|		attr = attr->nexth;
 1333|  2.55k|	    }
 1334|  2.50k|	}
 1335|  62.8k|#endif
 1336|       |
 1337|       |	/*
 1338|       |	 * Actually insert defaulted values when needed
 1339|       |	 */
 1340|  62.8k|	attr = elemDecl->attributes;
 1341|   150k|	while (attr != NULL) {
  ------------------
  |  Branch (1341:9): [True: 87.9k, False: 62.8k]
  ------------------
 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|  87.9k|	    if (attr->defaultValue != NULL) {
  ------------------
  |  Branch (1347:10): [True: 77.7k, False: 10.1k]
  ------------------
 1348|       |		/*
 1349|       |		 * the element should be instantiated in the tree if:
 1350|       |		 *  - this is a namespace prefix
 1351|       |		 *  - the user required for completion in the tree
 1352|       |		 *    like XSLT
 1353|       |		 *  - there isn't already an attribute definition
 1354|       |		 *    in the internal subset overriding it.
 1355|       |		 */
 1356|  77.7k|		if (((attr->prefix != NULL) &&
  ------------------
  |  Branch (1356:8): [True: 21.3k, False: 56.3k]
  ------------------
 1357|  21.3k|		     (xmlStrEqual(attr->prefix, BAD_CAST "xmlns"))) ||
  ------------------
  |  |   34|  21.3k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (1357:8): [True: 11.3k, False: 10.0k]
  ------------------
 1358|  66.4k|		    ((attr->prefix == NULL) &&
  ------------------
  |  Branch (1358:8): [True: 56.3k, False: 10.0k]
  ------------------
 1359|  56.3k|		     (xmlStrEqual(attr->name, BAD_CAST "xmlns"))) ||
  ------------------
  |  |   34|  56.3k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (1359:8): [True: 2.75k, False: 53.6k]
  ------------------
 1360|  63.6k|		    (ctxt->loadsubset & XML_COMPLETE_ATTRS)) {
  ------------------
  |  |  209|  63.6k|#define XML_COMPLETE_ATTRS	4
  ------------------
  |  Branch (1360:7): [True: 37.8k, False: 25.8k]
  ------------------
 1361|  51.9k|		    xmlAttributePtr tst;
 1362|       |
 1363|  51.9k|		    tst = xmlGetDtdQAttrDesc(ctxt->myDoc->intSubset,
 1364|  51.9k|					     attr->elem, attr->name,
 1365|  51.9k|					     attr->prefix);
 1366|  51.9k|		    if ((tst == attr) || (tst == NULL)) {
  ------------------
  |  Branch (1366:11): [True: 50.0k, False: 1.85k]
  |  Branch (1366:28): [True: 1.85k, False: 0]
  ------------------
 1367|  51.9k|		        xmlChar fn[50];
 1368|  51.9k|			xmlChar *fulln;
 1369|       |
 1370|  51.9k|                        fulln = xmlBuildQName(attr->name, attr->prefix, fn, 50);
 1371|  51.9k|			if (fulln == NULL) {
  ------------------
  |  Branch (1371:8): [True: 4, False: 51.9k]
  ------------------
 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|  51.9k|			att = NULL;
 1381|  51.9k|			if (atts != NULL) {
  ------------------
  |  Branch (1381:8): [True: 1.87k, False: 50.0k]
  ------------------
 1382|  1.87k|			    i = 0;
 1383|  1.87k|			    att = atts[i];
 1384|  4.06k|			    while (att != NULL) {
  ------------------
  |  Branch (1384:15): [True: 2.66k, False: 1.40k]
  ------------------
 1385|  2.66k|				if (xmlStrEqual(att, fulln))
  ------------------
  |  Branch (1385:9): [True: 476, False: 2.19k]
  ------------------
 1386|    476|				    break;
 1387|  2.19k|				i += 2;
 1388|  2.19k|				att = atts[i];
 1389|  2.19k|			    }
 1390|  1.87k|			}
 1391|  51.9k|			if (att == NULL) {
  ------------------
  |  Branch (1391:8): [True: 51.4k, False: 476]
  ------------------
 1392|  51.4k|			    xmlSAX1Attribute(ctxt, fulln,
 1393|  51.4k|					     attr->defaultValue, prefix);
 1394|  51.4k|			}
 1395|  51.9k|			if ((fulln != fn) && (fulln != attr->name))
  ------------------
  |  Branch (1395:8): [True: 49.2k, False: 2.70k]
  |  Branch (1395:25): [True: 15.3k, False: 33.8k]
  ------------------
 1396|  15.3k|			    xmlFree(fulln);
 1397|  51.9k|		    }
 1398|  51.9k|		}
 1399|  77.7k|	    }
 1400|  87.9k|	    attr = attr->nexth;
 1401|  87.9k|	}
 1402|  62.8k|	if (internal == 1) {
  ------------------
  |  Branch (1402:6): [True: 58.7k, False: 4.13k]
  ------------------
 1403|  58.7k|	    elemDecl = xmlGetDtdQElementDesc(ctxt->myDoc->extSubset,
 1404|  58.7k|		                             name, prefix);
 1405|  58.7k|	    internal = 0;
 1406|  58.7k|	    goto process_external_subset;
 1407|  58.7k|	}
 1408|  62.8k|    }
 1409|   200k|}
SAX2.c:xmlSAX1Attribute:
  960|   133k|{
  961|   133k|    xmlAttrPtr ret;
  962|   133k|    const xmlChar *name;
  963|   133k|    xmlChar *ns;
  964|   133k|    xmlNsPtr namespace;
  965|       |
  966|       |    /*
  967|       |     * Split the full name into a namespace prefix and the tag name
  968|       |     */
  969|   133k|    name = xmlSplitQName4(fullname, &ns);
  970|   133k|    if (name == NULL) {
  ------------------
  |  Branch (970:9): [True: 11, False: 133k]
  ------------------
  971|     11|        xmlSAX2ErrMemory(ctxt);
  972|     11|        return;
  973|     11|    }
  974|       |
  975|       |    /*
  976|       |     * Check whether it's a namespace definition
  977|       |     */
  978|   133k|    if ((ns == NULL) &&
  ------------------
  |  Branch (978:9): [True: 65.1k, False: 68.5k]
  ------------------
  979|  65.1k|        (name[0] == 'x') && (name[1] == 'm') && (name[2] == 'l') &&
  ------------------
  |  Branch (979:9): [True: 20.2k, False: 44.8k]
  |  Branch (979:29): [True: 11.2k, False: 9.05k]
  |  Branch (979:49): [True: 9.90k, False: 1.31k]
  ------------------
  980|  9.90k|        (name[3] == 'n') && (name[4] == 's') && (name[5] == 0)) {
  ------------------
  |  Branch (980:9): [True: 9.13k, False: 775]
  |  Branch (980:29): [True: 8.68k, False: 446]
  |  Branch (980:49): [True: 8.36k, False: 322]
  ------------------
  981|  8.36k|	xmlNsPtr nsret;
  982|  8.36k|	xmlChar *val;
  983|       |
  984|       |        /* Avoid unused variable warning if features are disabled. */
  985|  8.36k|        (void) nsret;
  986|       |
  987|  8.36k|        if (!ctxt->replaceEntities) {
  ------------------
  |  Branch (987:13): [True: 4.17k, False: 4.19k]
  ------------------
  988|       |            /* TODO: normalize if needed */
  989|  4.17k|	    val = xmlExpandEntitiesInAttValue(ctxt, value, /* normalize */ 0);
  990|  4.17k|	    if (val == NULL) {
  ------------------
  |  Branch (990:10): [True: 7, False: 4.16k]
  ------------------
  991|      7|	        xmlSAX2ErrMemory(ctxt);
  992|      7|		return;
  993|      7|	    }
  994|  4.19k|	} else {
  995|  4.19k|	    val = (xmlChar *) value;
  996|  4.19k|	}
  997|       |
  998|  8.35k|	if (val[0] != 0) {
  ------------------
  |  Branch (998:6): [True: 4.66k, False: 3.69k]
  ------------------
  999|  4.66k|	    xmlURIPtr uri;
 1000|       |
 1001|  4.66k|	    if (xmlParseURISafe((const char *)val, &uri) < 0)
  ------------------
  |  Branch (1001:10): [True: 17, False: 4.65k]
  ------------------
 1002|     17|                xmlSAX2ErrMemory(ctxt);
 1003|  4.66k|	    if (uri == NULL) {
  ------------------
  |  Branch (1003:10): [True: 2.09k, False: 2.57k]
  ------------------
 1004|  2.09k|                xmlNsWarnMsg(ctxt, XML_WAR_NS_URI,
 1005|  2.09k|                             "xmlns:%s: %s not a valid URI\n", name, value);
 1006|  2.57k|	    } else {
 1007|  2.57k|		if (uri->scheme == NULL) {
  ------------------
  |  Branch (1007:7): [True: 2.15k, False: 422]
  ------------------
 1008|  2.15k|                    xmlNsWarnMsg(ctxt, XML_WAR_NS_URI_RELATIVE,
 1009|  2.15k|                                 "xmlns:%s: URI %s is not absolute\n",
 1010|  2.15k|                                 name, value);
 1011|  2.15k|		}
 1012|  2.57k|		xmlFreeURI(uri);
 1013|  2.57k|	    }
 1014|  4.66k|	}
 1015|       |
 1016|       |	/* a default namespace definition */
 1017|  8.35k|	nsret = xmlNewNs(ctxt->node, val, NULL);
 1018|  8.35k|        if (nsret == NULL) {
  ------------------
  |  Branch (1018:13): [True: 15, False: 8.34k]
  ------------------
 1019|     15|            xmlSAX2ErrMemory(ctxt);
 1020|     15|        }
 1021|  8.34k|#ifdef LIBXML_VALID_ENABLED
 1022|       |	/*
 1023|       |	 * Validate also for namespace decls, they are attributes from
 1024|       |	 * an XML-1.0 perspective
 1025|       |	 */
 1026|  8.34k|        else if (ctxt->validate && ctxt->wellFormed &&
  ------------------
  |  Branch (1026:18): [True: 2.08k, False: 6.25k]
  |  Branch (1026:36): [True: 1.03k, False: 1.05k]
  ------------------
 1027|  1.03k|                 ctxt->myDoc && ctxt->myDoc->intSubset) {
  ------------------
  |  Branch (1027:18): [True: 1.03k, False: 0]
  |  Branch (1027:33): [True: 1.03k, False: 0]
  ------------------
 1028|  1.03k|	    ctxt->valid &= xmlValidateOneNamespace(&ctxt->vctxt, ctxt->myDoc,
 1029|  1.03k|					   ctxt->node, prefix, nsret, val);
 1030|  1.03k|        }
 1031|  8.35k|#endif /* LIBXML_VALID_ENABLED */
 1032|  8.35k|	if (val != value)
  ------------------
  |  Branch (1032:6): [True: 4.16k, False: 4.19k]
  ------------------
 1033|  4.16k|	    xmlFree(val);
 1034|  8.35k|	return;
 1035|  8.36k|    }
 1036|   125k|    if ((ns != NULL) && (ns[0] == 'x') && (ns[1] == 'm') && (ns[2] == 'l') &&
  ------------------
  |  Branch (1036:9): [True: 68.5k, False: 56.7k]
  |  Branch (1036:25): [True: 62.7k, False: 5.76k]
  |  Branch (1036:43): [True: 61.4k, False: 1.28k]
  |  Branch (1036:61): [True: 60.3k, False: 1.06k]
  ------------------
 1037|  60.3k|        (ns[3] == 'n') && (ns[4] == 's') && (ns[5] == 0)) {
  ------------------
  |  Branch (1037:9): [True: 49.7k, False: 10.6k]
  |  Branch (1037:27): [True: 49.4k, False: 252]
  |  Branch (1037:45): [True: 48.3k, False: 1.08k]
  ------------------
 1038|  48.3k|	xmlNsPtr nsret;
 1039|  48.3k|	xmlChar *val;
 1040|       |
 1041|       |        /* Avoid unused variable warning if features are disabled. */
 1042|  48.3k|        (void) nsret;
 1043|       |
 1044|  48.3k|        if (!ctxt->replaceEntities) {
  ------------------
  |  Branch (1044:13): [True: 13.6k, False: 34.7k]
  ------------------
 1045|       |            /* TODO: normalize if needed */
 1046|  13.6k|	    val = xmlExpandEntitiesInAttValue(ctxt, value, /* normalize */ 0);
 1047|  13.6k|	    if (val == NULL) {
  ------------------
  |  Branch (1047:10): [True: 2, False: 13.6k]
  ------------------
 1048|      2|	        xmlSAX2ErrMemory(ctxt);
 1049|      2|	        xmlFree(ns);
 1050|      2|		return;
 1051|      2|	    }
 1052|  34.7k|	} else {
 1053|  34.7k|	    val = (xmlChar *) value;
 1054|  34.7k|	}
 1055|       |
 1056|  48.3k|	if (val[0] == 0) {
  ------------------
  |  Branch (1056:6): [True: 419, False: 47.9k]
  ------------------
 1057|    419|	    xmlNsErrMsg(ctxt, XML_NS_ERR_EMPTY,
 1058|    419|		        "Empty namespace name for prefix %s\n", name, NULL);
 1059|    419|	}
 1060|  48.3k|	if ((ctxt->pedantic != 0) && (val[0] != 0)) {
  ------------------
  |  Branch (1060:6): [True: 26.4k, False: 21.9k]
  |  Branch (1060:31): [True: 26.1k, False: 255]
  ------------------
 1061|  26.1k|	    xmlURIPtr uri;
 1062|       |
 1063|  26.1k|	    if (xmlParseURISafe((const char *)val, &uri) < 0)
  ------------------
  |  Branch (1063:10): [True: 8, False: 26.1k]
  ------------------
 1064|      8|                xmlSAX2ErrMemory(ctxt);
 1065|  26.1k|	    if (uri == NULL) {
  ------------------
  |  Branch (1065:10): [True: 1.66k, False: 24.5k]
  ------------------
 1066|  1.66k|	        xmlNsWarnMsg(ctxt, XML_WAR_NS_URI,
 1067|  1.66k|			 "xmlns:%s: %s not a valid URI\n", name, value);
 1068|  24.5k|	    } else {
 1069|  24.5k|		if (uri->scheme == NULL) {
  ------------------
  |  Branch (1069:7): [True: 22.4k, False: 2.11k]
  ------------------
 1070|  22.4k|		    xmlNsWarnMsg(ctxt, XML_WAR_NS_URI_RELATIVE,
 1071|  22.4k|			   "xmlns:%s: URI %s is not absolute\n", name, value);
 1072|  22.4k|		}
 1073|  24.5k|		xmlFreeURI(uri);
 1074|  24.5k|	    }
 1075|  26.1k|	}
 1076|       |
 1077|       |	/* a standard namespace definition */
 1078|  48.3k|	nsret = xmlNewNs(ctxt->node, val, name);
 1079|  48.3k|	xmlFree(ns);
 1080|       |
 1081|  48.3k|        if (nsret == NULL) {
  ------------------
  |  Branch (1081:13): [True: 9, False: 48.3k]
  ------------------
 1082|      9|            xmlSAX2ErrMemory(ctxt);
 1083|      9|        }
 1084|  48.3k|#ifdef LIBXML_VALID_ENABLED
 1085|       |	/*
 1086|       |	 * Validate also for namespace decls, they are attributes from
 1087|       |	 * an XML-1.0 perspective
 1088|       |	 */
 1089|  48.3k|        else if (ctxt->validate && ctxt->wellFormed &&
  ------------------
  |  Branch (1089:18): [True: 9.65k, False: 38.6k]
  |  Branch (1089:36): [True: 3.40k, False: 6.25k]
  ------------------
 1090|  3.40k|	         ctxt->myDoc && ctxt->myDoc->intSubset) {
  ------------------
  |  Branch (1090:11): [True: 3.40k, False: 0]
  |  Branch (1090:26): [True: 3.40k, False: 0]
  ------------------
 1091|  3.40k|	    ctxt->valid &= xmlValidateOneNamespace(&ctxt->vctxt, ctxt->myDoc,
 1092|  3.40k|					   ctxt->node, prefix, nsret, value);
 1093|  3.40k|        }
 1094|  48.3k|#endif /* LIBXML_VALID_ENABLED */
 1095|  48.3k|	if (val != value)
  ------------------
  |  Branch (1095:6): [True: 13.6k, False: 34.7k]
  ------------------
 1096|  13.6k|	    xmlFree(val);
 1097|  48.3k|	return;
 1098|  48.3k|    }
 1099|       |
 1100|  76.9k|    if (ns != NULL) {
  ------------------
  |  Branch (1100:9): [True: 20.1k, False: 56.7k]
  ------------------
 1101|  20.1k|        int res;
 1102|       |
 1103|  20.1k|	res = xmlSearchNsSafe(ctxt->node, ns, &namespace);
 1104|  20.1k|        if (res < 0)
  ------------------
  |  Branch (1104:13): [True: 9, False: 20.1k]
  ------------------
 1105|      9|            xmlSAX2ErrMemory(ctxt);
 1106|       |
 1107|  20.1k|	if (namespace == NULL) {
  ------------------
  |  Branch (1107:6): [True: 7.08k, False: 13.0k]
  ------------------
 1108|  7.08k|	    xmlNsErrMsg(ctxt, XML_NS_ERR_UNDEFINED_NAMESPACE,
 1109|  7.08k|		    "Namespace prefix %s of attribute %s is not defined\n",
 1110|  7.08k|		             ns, name);
 1111|  13.0k|	} else {
 1112|  13.0k|            xmlAttrPtr prop;
 1113|       |
 1114|  13.0k|            prop = ctxt->node->properties;
 1115|  37.4k|            while (prop != NULL) {
  ------------------
  |  Branch (1115:20): [True: 24.6k, False: 12.8k]
  ------------------
 1116|  24.6k|                if (prop->ns != NULL) {
  ------------------
  |  Branch (1116:21): [True: 11.1k, False: 13.4k]
  ------------------
 1117|  11.1k|                    if ((xmlStrEqual(name, prop->name)) &&
  ------------------
  |  Branch (1117:25): [True: 412, False: 10.7k]
  ------------------
 1118|    412|                        ((namespace == prop->ns) ||
  ------------------
  |  Branch (1118:26): [True: 0, False: 412]
  ------------------
 1119|    412|                         (xmlStrEqual(namespace->href, prop->ns->href)))) {
  ------------------
  |  Branch (1119:26): [True: 208, False: 204]
  ------------------
 1120|    208|                        xmlCtxtErr(ctxt, NULL, XML_FROM_PARSER,
 1121|    208|                                   XML_ERR_ATTRIBUTE_REDEFINED, XML_ERR_FATAL,
 1122|    208|                                   name, NULL, NULL, 0,
 1123|    208|                                   "Attribute %s in %s redefined\n",
 1124|    208|                                   name, namespace->href);
 1125|    208|                        goto error;
 1126|    208|                    }
 1127|  11.1k|                }
 1128|  24.4k|                prop = prop->next;
 1129|  24.4k|            }
 1130|  13.0k|        }
 1131|  56.7k|    } else {
 1132|  56.7k|	namespace = NULL;
 1133|  56.7k|    }
 1134|       |
 1135|       |    /* !!!!!! <a toto:arg="" xmlns:toto="http://toto.com"> */
 1136|  76.7k|    ret = xmlNewNsProp(ctxt->node, namespace, name, NULL);
 1137|  76.7k|    if (ret == NULL) {
  ------------------
  |  Branch (1137:9): [True: 26, False: 76.6k]
  ------------------
 1138|     26|        xmlSAX2ErrMemory(ctxt);
 1139|     26|        goto error;
 1140|     26|    }
 1141|       |
 1142|  76.6k|    if (ctxt->replaceEntities == 0) {
  ------------------
  |  Branch (1142:9): [True: 41.9k, False: 34.7k]
  ------------------
 1143|  41.9k|        if (xmlNodeParseAttValue(ret->doc, ret, value, SIZE_MAX, NULL) < 0)
  ------------------
  |  Branch (1143:13): [True: 38, False: 41.9k]
  ------------------
 1144|     38|            xmlSAX2ErrMemory(ctxt);
 1145|  41.9k|    } else if (value != NULL) {
  ------------------
  |  Branch (1145:16): [True: 34.7k, False: 0]
  ------------------
 1146|  34.7k|        ret->children = xmlNewDocText(ctxt->myDoc, value);
 1147|  34.7k|        if (ret->children == NULL) {
  ------------------
  |  Branch (1147:13): [True: 25, False: 34.6k]
  ------------------
 1148|     25|            xmlSAX2ErrMemory(ctxt);
 1149|  34.6k|        } else {
 1150|  34.6k|            ret->last = ret->children;
 1151|  34.6k|            ret->children->parent = (xmlNodePtr) ret;
 1152|  34.6k|        }
 1153|  34.7k|    }
 1154|       |
 1155|  76.6k|#ifdef LIBXML_VALID_ENABLED
 1156|  76.6k|    if (ctxt->validate && ctxt->wellFormed &&
  ------------------
  |  Branch (1156:9): [True: 29.3k, False: 47.3k]
  |  Branch (1156:27): [True: 8.45k, False: 20.8k]
  ------------------
 1157|  8.45k|        ctxt->myDoc && ctxt->myDoc->intSubset) {
  ------------------
  |  Branch (1157:9): [True: 8.45k, False: 0]
  |  Branch (1157:24): [True: 8.45k, False: 0]
  ------------------
 1158|       |
 1159|       |	/*
 1160|       |	 * If we don't substitute entities, the validation should be
 1161|       |	 * done on a value with replaced entities anyway.
 1162|       |	 */
 1163|  8.45k|        if (!ctxt->replaceEntities) {
  ------------------
  |  Branch (1163:13): [True: 4.43k, False: 4.02k]
  ------------------
 1164|  4.43k|	    xmlChar *val;
 1165|       |
 1166|       |            /* TODO: normalize if needed */
 1167|  4.43k|	    val = xmlExpandEntitiesInAttValue(ctxt, value, /* normalize */ 0);
 1168|       |
 1169|  4.43k|	    if (val == NULL)
  ------------------
  |  Branch (1169:10): [True: 2, False: 4.43k]
  ------------------
 1170|      2|		ctxt->valid &= xmlValidateOneAttribute(&ctxt->vctxt,
 1171|      2|				ctxt->myDoc, ctxt->node, ret, value);
 1172|  4.43k|	    else {
 1173|  4.43k|		xmlChar *nvalnorm;
 1174|       |
 1175|       |		/*
 1176|       |		 * Do the last stage of the attribute normalization
 1177|       |		 * It need to be done twice ... it's an extra burden related
 1178|       |		 * to the ability to keep xmlSAX2References in attributes
 1179|       |		 */
 1180|  4.43k|                nvalnorm = xmlValidCtxtNormalizeAttributeValue(
 1181|  4.43k|                                 &ctxt->vctxt, ctxt->myDoc,
 1182|  4.43k|                                 ctxt->node, fullname, val);
 1183|  4.43k|		if (nvalnorm != NULL) {
  ------------------
  |  Branch (1183:7): [True: 2.60k, False: 1.82k]
  ------------------
 1184|  2.60k|		    xmlFree(val);
 1185|  2.60k|		    val = nvalnorm;
 1186|  2.60k|		}
 1187|       |
 1188|  4.43k|		ctxt->valid &= xmlValidateOneAttribute(&ctxt->vctxt,
 1189|  4.43k|			        ctxt->myDoc, ctxt->node, ret, val);
 1190|  4.43k|                xmlFree(val);
 1191|  4.43k|	    }
 1192|  4.43k|	} else {
 1193|       |            /*
 1194|       |             * When replacing entities, make sure that IDs in
 1195|       |             * entities aren't registered. This also shouldn't be
 1196|       |             * done when entities aren't replaced, but this would
 1197|       |             * require to rework IDREF checks.
 1198|       |             */
 1199|  4.02k|            if (ctxt->input->entity != NULL)
  ------------------
  |  Branch (1199:17): [True: 453, False: 3.57k]
  ------------------
 1200|    453|                ctxt->vctxt.flags |= XML_VCTXT_IN_ENTITY;
  ------------------
  |  |   28|    453|#define XML_VCTXT_IN_ENTITY (1u << 3)
  ------------------
 1201|       |
 1202|  4.02k|	    ctxt->valid &= xmlValidateOneAttribute(&ctxt->vctxt, ctxt->myDoc,
 1203|  4.02k|					       ctxt->node, ret, value);
 1204|       |
 1205|  4.02k|            ctxt->vctxt.flags &= ~XML_VCTXT_IN_ENTITY;
  ------------------
  |  |   28|  4.02k|#define XML_VCTXT_IN_ENTITY (1u << 3)
  ------------------
 1206|  4.02k|	}
 1207|  8.45k|    } else
 1208|  68.2k|#endif /* LIBXML_VALID_ENABLED */
 1209|  68.2k|           if (((ctxt->loadsubset & XML_SKIP_IDS) == 0) &&
  ------------------
  |  |  210|  68.2k|#define XML_SKIP_IDS		8
  ------------------
  |  Branch (1209:16): [True: 43.3k, False: 24.8k]
  ------------------
 1210|  43.3k|               (ctxt->input->entity == NULL) &&
  ------------------
  |  Branch (1210:16): [True: 40.6k, False: 2.71k]
  ------------------
 1211|       |               /* Don't create IDs containing entity references */
 1212|  40.6k|               (ret->children != NULL) &&
  ------------------
  |  Branch (1212:16): [True: 38.5k, False: 2.09k]
  ------------------
 1213|  38.5k|               (ret->children->type == XML_TEXT_NODE) &&
  ------------------
  |  Branch (1213:16): [True: 38.2k, False: 316]
  ------------------
 1214|  38.2k|               (ret->children->next == NULL)) {
  ------------------
  |  Branch (1214:16): [True: 37.9k, False: 275]
  ------------------
 1215|  37.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|  37.9k|	if (xmlStrEqual(fullname, BAD_CAST "xml:id")) {
  ------------------
  |  |   34|  37.9k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (1220:6): [True: 1.51k, False: 36.4k]
  ------------------
 1221|       |	    /*
 1222|       |	     * Add the xml:id value
 1223|       |	     *
 1224|       |	     * Open issue: normalization of the value.
 1225|       |	     */
 1226|  1.51k|	    if (xmlValidateNCName(content, 1) != 0) {
  ------------------
  |  Branch (1226:10): [True: 1.03k, False: 485]
  ------------------
 1227|  1.03k|	        xmlErrId(ctxt, XML_DTD_XMLID_VALUE,
 1228|  1.03k|		         "xml:id : attribute value %s is not an NCName\n",
 1229|  1.03k|		         content);
 1230|  1.03k|	    }
 1231|  1.51k|	    xmlAddID(&ctxt->vctxt, ctxt->myDoc, content, ret);
 1232|  36.4k|	} else {
 1233|  36.4k|            int res = xmlIsID(ctxt->myDoc, ctxt->node, ret);
 1234|       |
 1235|  36.4k|            if (res < 0)
  ------------------
  |  Branch (1235:17): [True: 1, False: 36.4k]
  ------------------
 1236|      1|                xmlCtxtErrMemory(ctxt);
 1237|  36.4k|            else if (res > 0)
  ------------------
  |  Branch (1237:22): [True: 3.05k, False: 33.4k]
  ------------------
 1238|  3.05k|                xmlAddID(&ctxt->vctxt, ctxt->myDoc, content, ret);
 1239|  33.4k|            else if (xmlIsRef(ctxt->myDoc, ctxt->node, ret))
  ------------------
  |  Branch (1239:22): [True: 14.1k, False: 19.2k]
  ------------------
 1240|  14.1k|                xmlAddRef(&ctxt->vctxt, ctxt->myDoc, content, ret);
 1241|  36.4k|        }
 1242|  37.9k|    }
 1243|       |
 1244|  76.9k|error:
 1245|  76.9k|    if (ns != NULL)
  ------------------
  |  Branch (1245:9): [True: 20.1k, False: 56.7k]
  ------------------
 1246|  20.1k|	xmlFree(ns);
 1247|  76.9k|}
SAX2.c:xmlNsErrMsg:
  942|  7.50k|{
  943|  7.50k|    xmlCtxtErr(ctxt, NULL, XML_FROM_NAMESPACE, error, XML_ERR_ERROR,
  944|       |               str1, str2, NULL, 0, msg, str1, str2);
  945|  7.50k|}
SAX2.c:xmlErrValid:
   59|  13.4k|{
   60|  13.4k|    xmlCtxtErr(ctxt, NULL, XML_FROM_DTD, error, XML_ERR_ERROR,
   61|  13.4k|               str1, str2, NULL, 0, msg, str1, str2);
   62|  13.4k|    if (ctxt != NULL)
  ------------------
  |  Branch (62:9): [True: 13.4k, False: 0]
  ------------------
   63|  13.4k|	ctxt->valid = 0;
   64|  13.4k|}
SAX2.c:xmlSAX2AppendChild:
  895|  1.99M|xmlSAX2AppendChild(xmlParserCtxtPtr ctxt, xmlNodePtr node) {
  896|  1.99M|    xmlNodePtr parent;
  897|  1.99M|    xmlNodePtr last;
  898|       |
  899|  1.99M|    if (ctxt->inSubset == 1) {
  ------------------
  |  Branch (899:9): [True: 138k, False: 1.85M]
  ------------------
  900|   138k|	parent = (xmlNodePtr) ctxt->myDoc->intSubset;
  901|  1.85M|    } else if (ctxt->inSubset == 2) {
  ------------------
  |  Branch (901:16): [True: 101k, False: 1.75M]
  ------------------
  902|   101k|	parent = (xmlNodePtr) ctxt->myDoc->extSubset;
  903|  1.75M|    } else {
  904|  1.75M|        parent = ctxt->node;
  905|  1.75M|        if (parent == NULL)
  ------------------
  |  Branch (905:13): [True: 132k, False: 1.62M]
  ------------------
  906|   132k|            parent = (xmlNodePtr) ctxt->myDoc;
  907|  1.75M|    }
  908|       |
  909|  1.99M|    last = parent->last;
  910|  1.99M|    if (last == NULL) {
  ------------------
  |  Branch (910:9): [True: 266k, False: 1.72M]
  ------------------
  911|   266k|        parent->children = node;
  912|  1.72M|    } else {
  913|  1.72M|        last->next = node;
  914|  1.72M|        node->prev = last;
  915|  1.72M|    }
  916|       |
  917|  1.99M|    parent->last = node;
  918|  1.99M|    node->parent = parent;
  919|       |
  920|  1.99M|    if ((node->type != XML_TEXT_NODE) &&
  ------------------
  |  Branch (920:9): [True: 1.54M, False: 456k]
  ------------------
  921|  1.54M|	(ctxt->input != NULL)) {
  ------------------
  |  Branch (921:2): [True: 1.54M, False: 0]
  ------------------
  922|  1.54M|        if ((unsigned) ctxt->input->line < (unsigned) USHRT_MAX)
  ------------------
  |  Branch (922:13): [True: 1.46M, False: 79.5k]
  ------------------
  923|  1.46M|            node->line = ctxt->input->line;
  924|  79.5k|        else
  925|  79.5k|            node->line = USHRT_MAX;
  926|  1.54M|    }
  927|  1.99M|}
SAX2.c:xmlNsWarnMsg:
  128|  37.1k|{
  129|  37.1k|    xmlCtxtErr(ctxt, NULL, XML_FROM_NAMESPACE, error, XML_ERR_WARNING,
  130|       |               str1, str2, NULL, 0, msg, str1, str2);
  131|  37.1k|}
SAX2.c:xmlSAX2AttributeNs:
 1908|   274k|{
 1909|   274k|    xmlAttrPtr ret;
 1910|   274k|    xmlNsPtr namespace = NULL;
 1911|   274k|    xmlChar *dup = NULL;
 1912|       |
 1913|       |    /*
 1914|       |     * Note: if prefix == NULL, the attribute is not in the default namespace
 1915|       |     */
 1916|   274k|    if (prefix != NULL) {
  ------------------
  |  Branch (1916:9): [True: 58.9k, False: 215k]
  ------------------
 1917|  58.9k|	namespace = xmlParserNsLookupSax(ctxt, prefix);
 1918|  58.9k|	if ((namespace == NULL) && (xmlStrEqual(prefix, BAD_CAST "xml"))) {
  ------------------
  |  |   34|  45.1k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (1918:6): [True: 45.1k, False: 13.7k]
  |  Branch (1918:29): [True: 45.0k, False: 74]
  ------------------
 1919|  45.0k|            int res;
 1920|       |
 1921|  45.0k|	    res = xmlSearchNsSafe(ctxt->node, prefix, &namespace);
 1922|  45.0k|            if (res < 0)
  ------------------
  |  Branch (1922:17): [True: 8, False: 45.0k]
  ------------------
 1923|      8|                xmlSAX2ErrMemory(ctxt);
 1924|  45.0k|	}
 1925|  58.9k|    }
 1926|       |
 1927|       |    /*
 1928|       |     * allocate the node
 1929|       |     */
 1930|   274k|    if (ctxt->freeAttrs != NULL) {
  ------------------
  |  Branch (1930:9): [True: 1.29k, False: 273k]
  ------------------
 1931|  1.29k|        ret = ctxt->freeAttrs;
 1932|  1.29k|	ctxt->freeAttrs = ret->next;
 1933|  1.29k|	ctxt->freeAttrsNr--;
 1934|   273k|    } else {
 1935|   273k|        ret = xmlMalloc(sizeof(*ret));
 1936|   273k|        if (ret == NULL) {
  ------------------
  |  Branch (1936:13): [True: 20, False: 273k]
  ------------------
 1937|     20|            xmlSAX2ErrMemory(ctxt);
 1938|     20|            return(NULL);
 1939|     20|        }
 1940|   273k|    }
 1941|       |
 1942|   274k|    memset(ret, 0, sizeof(xmlAttr));
 1943|   274k|    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|   274k|    ret->parent = ctxt->node;
 1955|   274k|    ret->doc = ctxt->node->doc;
 1956|   274k|    ret->ns = namespace;
 1957|       |
 1958|   274k|    if (ctxt->dictNames) {
  ------------------
  |  Branch (1958:9): [True: 130k, False: 144k]
  ------------------
 1959|   130k|        ret->name = localname;
 1960|   144k|    } else {
 1961|   144k|        ret->name = xmlStrdup(localname);
 1962|   144k|        if (ret->name == NULL)
  ------------------
  |  Branch (1962:13): [True: 75, False: 144k]
  ------------------
 1963|     75|            xmlSAX2ErrMemory(ctxt);
 1964|   144k|    }
 1965|       |
 1966|   274k|    if ((xmlRegisterCallbacks) && (xmlRegisterNodeDefaultValue))
  ------------------
  |  |  932|      0|    (*__xmlRegisterNodeDefaultValue())
  ------------------
  |  Branch (1966:9): [True: 0, False: 274k]
  |  Branch (1966:35): [True: 0, False: 0]
  ------------------
 1967|      0|        xmlRegisterNodeDefaultValue((xmlNodePtr)ret);
  ------------------
  |  |  932|      0|    (*__xmlRegisterNodeDefaultValue())
  ------------------
 1968|       |
 1969|   274k|    if ((ctxt->replaceEntities == 0) && (!ctxt->html)) {
  ------------------
  |  Branch (1969:9): [True: 63.8k, False: 210k]
  |  Branch (1969:41): [True: 63.8k, False: 0]
  ------------------
 1970|  63.8k|	xmlNodePtr tmp;
 1971|       |
 1972|       |	/*
 1973|       |	 * We know that if there is an entity reference, then
 1974|       |	 * the string has been dup'ed and terminates with 0
 1975|       |	 * otherwise with ' or "
 1976|       |	 */
 1977|  63.8k|	if (*valueend != 0) {
  ------------------
  |  Branch (1977:6): [True: 25.0k, False: 38.7k]
  ------------------
 1978|  25.0k|	    tmp = xmlSAX2TextNode(ctxt, ret->doc, value, valueend - value);
 1979|  25.0k|	    ret->children = tmp;
 1980|  25.0k|	    ret->last = tmp;
 1981|  25.0k|	    if (tmp != NULL) {
  ------------------
  |  Branch (1981:10): [True: 25.0k, False: 15]
  ------------------
 1982|  25.0k|		tmp->parent = (xmlNodePtr) ret;
 1983|  25.0k|	    }
 1984|  38.7k|	} else if (valueend > value) {
  ------------------
  |  Branch (1984:13): [True: 37.5k, False: 1.25k]
  ------------------
 1985|  37.5k|            if (xmlNodeParseAttValue(ret->doc, ret, value, valueend - value,
  ------------------
  |  Branch (1985:17): [True: 51, False: 37.4k]
  ------------------
 1986|  37.5k|                                     NULL) < 0)
 1987|     51|                xmlSAX2ErrMemory(ctxt);
 1988|  37.5k|	}
 1989|   210k|    } else if (value != NULL) {
  ------------------
  |  Branch (1989:16): [True: 210k, False: 0]
  ------------------
 1990|   210k|	xmlNodePtr tmp;
 1991|       |
 1992|   210k|	tmp = xmlSAX2TextNode(ctxt, ret->doc, value, valueend - value);
 1993|   210k|	ret->children = tmp;
 1994|   210k|	ret->last = tmp;
 1995|   210k|	if (tmp != NULL) {
  ------------------
  |  Branch (1995:6): [True: 210k, False: 26]
  ------------------
 1996|   210k|	    tmp->parent = (xmlNodePtr) ret;
 1997|   210k|	}
 1998|   210k|    }
 1999|       |
 2000|   274k|#ifdef LIBXML_VALID_ENABLED
 2001|   274k|    if ((!ctxt->html) && ctxt->validate && ctxt->wellFormed &&
  ------------------
  |  Branch (2001:9): [True: 274k, False: 0]
  |  Branch (2001:26): [True: 193k, False: 80.8k]
  |  Branch (2001:44): [True: 92.6k, False: 101k]
  ------------------
 2002|  92.6k|        ctxt->myDoc && ctxt->myDoc->intSubset) {
  ------------------
  |  Branch (2002:9): [True: 92.6k, False: 0]
  |  Branch (2002:24): [True: 92.6k, False: 0]
  ------------------
 2003|       |	/*
 2004|       |	 * If we don't substitute entities, the validation should be
 2005|       |	 * done on a value with replaced entities anyway.
 2006|       |	 */
 2007|  92.6k|        if (!ctxt->replaceEntities) {
  ------------------
  |  Branch (2007:13): [True: 10.9k, False: 81.6k]
  ------------------
 2008|  10.9k|	    dup = xmlSAX2DecodeAttrEntities(ctxt, value, valueend);
 2009|  10.9k|	    if (dup == NULL) {
  ------------------
  |  Branch (2009:10): [True: 8.48k, False: 2.45k]
  ------------------
 2010|  8.48k|	        if (*valueend == 0) {
  ------------------
  |  Branch (2010:14): [True: 6.18k, False: 2.30k]
  ------------------
 2011|  6.18k|		    ctxt->valid &= xmlValidateOneAttribute(&ctxt->vctxt,
 2012|  6.18k|				    ctxt->myDoc, ctxt->node, ret, value);
 2013|  6.18k|		} 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.30k|		    dup = xmlStrndup(value, valueend - value);
 2020|  2.30k|                    if (dup == NULL)
  ------------------
  |  Branch (2020:25): [True: 1, False: 2.30k]
  ------------------
 2021|      1|                        xmlSAX2ErrMemory(ctxt);
 2022|       |
 2023|  2.30k|		    ctxt->valid &= xmlValidateOneAttribute(&ctxt->vctxt,
 2024|  2.30k|				    ctxt->myDoc, ctxt->node, ret, dup);
 2025|  2.30k|		}
 2026|  8.48k|	    } 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.45k|		if (ctxt->attsSpecial != NULL) {
  ------------------
  |  Branch (2034:7): [True: 2.03k, False: 418]
  ------------------
 2035|  2.03k|		    xmlChar *nvalnorm;
 2036|  2.03k|		    xmlChar fn[50];
 2037|  2.03k|		    xmlChar *fullname;
 2038|       |
 2039|  2.03k|		    fullname = xmlBuildQName(localname, prefix, fn, 50);
 2040|  2.03k|                    if (fullname == NULL) {
  ------------------
  |  Branch (2040:25): [True: 1, False: 2.03k]
  ------------------
 2041|      1|                        xmlSAX2ErrMemory(ctxt);
 2042|  2.03k|                    } else {
 2043|  2.03k|			ctxt->vctxt.valid = 1;
 2044|  2.03k|		        nvalnorm = xmlValidCtxtNormalizeAttributeValue(
 2045|  2.03k|			                 &ctxt->vctxt, ctxt->myDoc,
 2046|  2.03k|					 ctxt->node, fullname, dup);
 2047|  2.03k|			if (ctxt->vctxt.valid != 1)
  ------------------
  |  Branch (2047:8): [True: 18, False: 2.02k]
  ------------------
 2048|     18|			    ctxt->valid = 0;
 2049|       |
 2050|  2.03k|			if ((fullname != fn) && (fullname != localname))
  ------------------
  |  Branch (2050:8): [True: 1.83k, False: 203]
  |  Branch (2050:28): [True: 573, False: 1.26k]
  ------------------
 2051|    573|			    xmlFree(fullname);
 2052|  2.03k|			if (nvalnorm != NULL) {
  ------------------
  |  Branch (2052:8): [True: 1.82k, False: 210]
  ------------------
 2053|  1.82k|			    xmlFree(dup);
 2054|  1.82k|			    dup = nvalnorm;
 2055|  1.82k|			}
 2056|  2.03k|		    }
 2057|  2.03k|		}
 2058|       |
 2059|  2.45k|		ctxt->valid &= xmlValidateOneAttribute(&ctxt->vctxt,
 2060|  2.45k|			        ctxt->myDoc, ctxt->node, ret, dup);
 2061|  2.45k|	    }
 2062|  81.6k|	} else {
 2063|       |	    /*
 2064|       |	     * if entities already have been substituted, then
 2065|       |	     * the attribute as passed is already normalized
 2066|       |	     */
 2067|  81.6k|	    dup = xmlStrndup(value, valueend - value);
 2068|  81.6k|            if (dup == NULL)
  ------------------
  |  Branch (2068:17): [True: 10, False: 81.6k]
  ------------------
 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|  81.6k|            if (ctxt->input->entity != NULL)
  ------------------
  |  Branch (2077:17): [True: 1.15k, False: 80.5k]
  ------------------
 2078|  1.15k|                ctxt->vctxt.flags |= XML_VCTXT_IN_ENTITY;
  ------------------
  |  |   28|  1.15k|#define XML_VCTXT_IN_ENTITY (1u << 3)
  ------------------
 2079|       |
 2080|  81.6k|	    ctxt->valid &= xmlValidateOneAttribute(&ctxt->vctxt,
 2081|  81.6k|	                             ctxt->myDoc, ctxt->node, ret, dup);
 2082|       |
 2083|  81.6k|            ctxt->vctxt.flags &= ~XML_VCTXT_IN_ENTITY;
  ------------------
  |  |   28|  81.6k|#define XML_VCTXT_IN_ENTITY (1u << 3)
  ------------------
 2084|  81.6k|	}
 2085|  92.6k|    } else
 2086|   182k|#endif /* LIBXML_VALID_ENABLED */
 2087|   182k|           if (((ctxt->loadsubset & XML_SKIP_IDS) == 0) &&
  ------------------
  |  |  210|   182k|#define XML_SKIP_IDS		8
  ------------------
  |  Branch (2087:16): [True: 100k, False: 81.8k]
  ------------------
 2088|   100k|               (ctxt->input->entity == NULL) &&
  ------------------
  |  Branch (2088:16): [True: 90.9k, False: 9.19k]
  ------------------
 2089|       |               /* Don't create IDs containing entity references */
 2090|  90.9k|               (ret->children != NULL) &&
  ------------------
  |  Branch (2090:16): [True: 90.5k, False: 443]
  ------------------
 2091|  90.5k|               (ret->children->type == XML_TEXT_NODE) &&
  ------------------
  |  Branch (2091:16): [True: 89.9k, False: 578]
  ------------------
 2092|  89.9k|               (ret->children->next == NULL)) {
  ------------------
  |  Branch (2092:16): [True: 89.3k, False: 614]
  ------------------
 2093|  89.3k|        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|  89.3k|        if ((prefix == ctxt->str_xml) &&
  ------------------
  |  Branch (2098:13): [True: 19.9k, False: 69.4k]
  ------------------
 2099|  19.9k|	           (localname[0] == 'i') && (localname[1] == 'd') &&
  ------------------
  |  Branch (2099:13): [True: 4.34k, False: 15.5k]
  |  Branch (2099:38): [True: 3.96k, False: 377]
  ------------------
 2100|  3.96k|		   (localname[2] == 0)) {
  ------------------
  |  Branch (2100:6): [True: 2.23k, False: 1.73k]
  ------------------
 2101|       |	    /*
 2102|       |	     * Add the xml:id value
 2103|       |	     *
 2104|       |	     * Open issue: normalization of the value.
 2105|       |	     */
 2106|  2.23k|	    if (xmlValidateNCName(content, 1) != 0) {
  ------------------
  |  Branch (2106:10): [True: 1.65k, False: 581]
  ------------------
 2107|  1.65k|	        xmlErrId(ctxt, XML_DTD_XMLID_VALUE,
 2108|  1.65k|                         "xml:id : attribute value %s is not an NCName\n",
 2109|  1.65k|                         content);
 2110|  1.65k|	    }
 2111|  2.23k|	    xmlAddID(&ctxt->vctxt, ctxt->myDoc, content, ret);
 2112|  87.1k|	} else {
 2113|  87.1k|            int res = xmlIsID(ctxt->myDoc, ctxt->node, ret);
 2114|       |
 2115|  87.1k|            if (res < 0)
  ------------------
  |  Branch (2115:17): [True: 1, False: 87.1k]
  ------------------
 2116|      1|                xmlCtxtErrMemory(ctxt);
 2117|  87.1k|            else if (res > 0)
  ------------------
  |  Branch (2117:22): [True: 3.73k, False: 83.3k]
  ------------------
 2118|  3.73k|                xmlAddID(&ctxt->vctxt, ctxt->myDoc, content, ret);
 2119|  83.3k|            else if (xmlIsRef(ctxt->myDoc, ctxt->node, ret))
  ------------------
  |  Branch (2119:22): [True: 12.6k, False: 70.7k]
  ------------------
 2120|  12.6k|                xmlAddRef(&ctxt->vctxt, ctxt->myDoc, content, ret);
 2121|  87.1k|	}
 2122|  89.3k|    }
 2123|   274k|    if (dup != NULL)
  ------------------
  |  Branch (2123:9): [True: 86.4k, False: 188k]
  ------------------
 2124|  86.4k|	xmlFree(dup);
 2125|       |
 2126|   274k|    return(ret);
 2127|   274k|}
SAX2.c:xmlSAX2TextNode:
 1783|   793k|                int len) {
 1784|   793k|    xmlNodePtr ret;
 1785|   793k|    const xmlChar *intern = NULL;
 1786|       |
 1787|       |    /*
 1788|       |     * Allocate
 1789|       |     */
 1790|   793k|    if (ctxt->freeElems != NULL) {
  ------------------
  |  Branch (1790:9): [True: 1.99k, False: 791k]
  ------------------
 1791|  1.99k|	ret = ctxt->freeElems;
 1792|  1.99k|	ctxt->freeElems = ret->next;
 1793|  1.99k|	ctxt->freeElemsNr--;
 1794|   791k|    } else {
 1795|   791k|	ret = (xmlNodePtr) xmlMalloc(sizeof(xmlNode));
 1796|   791k|    }
 1797|   793k|    if (ret == NULL) {
  ------------------
  |  Branch (1797:9): [True: 95, False: 793k]
  ------------------
 1798|     95|        xmlCtxtErrMemory(ctxt);
 1799|     95|	return(NULL);
 1800|     95|    }
 1801|   793k|    memset(ret, 0, sizeof(xmlNode));
 1802|       |    /*
 1803|       |     * intern the formatting blanks found between tags, or the
 1804|       |     * very short strings
 1805|       |     */
 1806|   793k|    if ((!ctxt->html) && (ctxt->dictNames)) {
  ------------------
  |  Branch (1806:9): [True: 793k, False: 0]
  |  Branch (1806:26): [True: 410k, False: 382k]
  ------------------
 1807|   410k|        xmlChar cur = str[len];
 1808|       |
 1809|   410k|	if ((len < (int) (2 * sizeof(void *))) &&
  ------------------
  |  Branch (1809:6): [True: 299k, False: 110k]
  ------------------
 1810|   299k|	    (ctxt->options & XML_PARSE_COMPACT)) {
  ------------------
  |  Branch (1810:6): [True: 299k, False: 0]
  ------------------
 1811|       |	    /* store the string in the node overriding properties and nsDef */
 1812|   299k|	    xmlChar *tmp = (xmlChar *) &(ret->properties);
 1813|   299k|	    memcpy(tmp, str, len);
 1814|   299k|	    tmp[len] = 0;
 1815|   299k|	    intern = tmp;
 1816|   299k|	} else if ((len <= 3) && ((cur == '"') || (cur == '\'') ||
  ------------------
  |  Branch (1816:13): [True: 0, False: 110k]
  |  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|   110k|	} else if (IS_BLANK_CH(*str) && (len < 60) && (cur == '<') &&
  ------------------
  |  |  137|   110k|#define IS_BLANK_CH(c)  xmlIsBlank_ch(c)
  |  |  ------------------
  |  |  |  |   90|   221k|#define xmlIsBlank_ch(c)	(((c) == 0x20) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (90:27): [True: 3.04k, False: 107k]
  |  |  |  |  ------------------
  |  |  |  |   91|   110k|				 ((0x9 <= (c)) && ((c) <= 0xa)) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (91:7): [True: 107k, False: 206]
  |  |  |  |  |  Branch (91:23): [True: 3.39k, False: 104k]
  |  |  |  |  ------------------
  |  |  |  |   92|   221k|				 ((c) == 0xd))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (92:6): [True: 204, False: 104k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (1824:34): [True: 5.26k, False: 1.37k]
  |  Branch (1824:48): [True: 4.07k, False: 1.19k]
  ------------------
 1825|  4.07k|	           (str[len + 1] != '!')) {
  ------------------
  |  Branch (1825:13): [True: 3.55k, False: 517]
  ------------------
 1826|  3.55k|	    int i;
 1827|       |
 1828|  37.0k|	    for (i = 1;i < len;i++) {
  ------------------
  |  Branch (1828:17): [True: 35.6k, False: 1.30k]
  ------------------
 1829|  35.6k|		if (!IS_BLANK_CH(str[i])) goto skip;
  ------------------
  |  |  137|  35.6k|#define IS_BLANK_CH(c)  xmlIsBlank_ch(c)
  |  |  ------------------
  |  |  |  |   90|  35.6k|#define xmlIsBlank_ch(c)	(((c) == 0x20) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (90:27): [True: 25.9k, False: 9.73k]
  |  |  |  |  ------------------
  |  |  |  |   91|  35.6k|				 ((0x9 <= (c)) && ((c) <= 0xa)) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (91:7): [True: 9.73k, False: 0]
  |  |  |  |  |  Branch (91:23): [True: 7.48k, False: 2.25k]
  |  |  |  |  ------------------
  |  |  |  |   92|  35.6k|				 ((c) == 0xd))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (92:6): [True: 0, False: 2.25k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1830|  35.6k|	    }
 1831|  1.30k|	    intern = xmlDictLookup(ctxt->dict, str, len);
 1832|  1.30k|            if (intern == NULL) {
  ------------------
  |  Branch (1832:17): [True: 1, False: 1.30k]
  ------------------
 1833|      1|                xmlSAX2ErrMemory(ctxt);
 1834|      1|                xmlFree(ret);
 1835|      1|                return(NULL);
 1836|      1|            }
 1837|  1.30k|	}
 1838|   410k|    }
 1839|   793k|skip:
 1840|   793k|    ret->type = XML_TEXT_NODE;
 1841|   793k|    ret->doc = doc;
 1842|       |
 1843|   793k|    ret->name = xmlStringText;
 1844|   793k|    if (intern == NULL) {
  ------------------
  |  Branch (1844:9): [True: 491k, False: 301k]
  ------------------
 1845|   491k|	ret->content = xmlStrndup(str, len);
 1846|   491k|	if (ret->content == NULL) {
  ------------------
  |  Branch (1846:6): [True: 34, False: 491k]
  ------------------
 1847|     34|	    xmlSAX2ErrMemory(ctxt);
 1848|     34|	    xmlFree(ret);
 1849|     34|	    return(NULL);
 1850|     34|	}
 1851|   491k|    } else
 1852|   301k|	ret->content = (xmlChar *) intern;
 1853|       |
 1854|   793k|    if ((xmlRegisterCallbacks) && (xmlRegisterNodeDefaultValue))
  ------------------
  |  |  932|      0|    (*__xmlRegisterNodeDefaultValue())
  ------------------
  |  Branch (1854:9): [True: 0, False: 793k]
  |  Branch (1854:35): [True: 0, False: 0]
  ------------------
 1855|      0|	xmlRegisterNodeDefaultValue(ret);
  ------------------
  |  |  932|      0|    (*__xmlRegisterNodeDefaultValue())
  ------------------
 1856|   793k|    return(ret);
 1857|   793k|}
SAX2.c:xmlSAX2DecodeAttrEntities:
 1871|  10.9k|                          const xmlChar *end) {
 1872|  10.9k|    const xmlChar *in;
 1873|       |
 1874|  10.9k|    in = str;
 1875|   100k|    while (in < end)
  ------------------
  |  Branch (1875:12): [True: 91.5k, False: 8.48k]
  ------------------
 1876|  91.5k|        if (*in++ == '&')
  ------------------
  |  Branch (1876:13): [True: 2.45k, False: 89.0k]
  ------------------
 1877|  2.45k|	    goto decode;
 1878|  8.48k|    return(NULL);
 1879|  2.45k|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.45k|    return(xmlExpandEntitiesInAttValue(ctxt, str, /* normalize */ 0));
 1886|  10.9k|}
SAX2.c:xmlSAX2Text:
 2473|   856k|{
 2474|   856k|    xmlNodePtr lastChild;
 2475|   856k|    xmlNodePtr parent;
 2476|       |
 2477|   856k|    if (ctxt == NULL)
  ------------------
  |  Branch (2477:9): [True: 0, False: 856k]
  ------------------
 2478|      0|        return;
 2479|       |
 2480|   856k|    parent = ctxt->node;
 2481|   856k|    if (parent == NULL)
  ------------------
  |  Branch (2481:9): [True: 0, False: 856k]
  ------------------
 2482|      0|        return;
 2483|   856k|    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|   856k|    if ((lastChild == NULL) ||
  ------------------
  |  Branch (2492:9): [True: 101k, False: 754k]
  ------------------
 2493|   754k|        (lastChild->type != type) ||
  ------------------
  |  Branch (2493:9): [True: 528k, False: 225k]
  ------------------
 2494|   631k|        ((!ctxt->html) && (type != XML_TEXT_NODE))) {
  ------------------
  |  Branch (2494:10): [True: 225k, False: 0]
  |  Branch (2494:27): [True: 956, False: 224k]
  ------------------
 2495|   631k|        xmlNode *node;
 2496|       |
 2497|   631k|        if (type == XML_TEXT_NODE)
  ------------------
  |  Branch (2497:13): [True: 557k, False: 74.1k]
  ------------------
 2498|   557k|            node = xmlSAX2TextNode(ctxt, parent->doc, ch, len);
 2499|  74.1k|        else
 2500|  74.1k|            node = xmlNewCDataBlock(parent->doc, ch, len);
 2501|   631k|	if (node == NULL) {
  ------------------
  |  Branch (2501:6): [True: 93, False: 631k]
  ------------------
 2502|     93|	    xmlSAX2ErrMemory(ctxt);
 2503|     93|	    return;
 2504|     93|	}
 2505|       |
 2506|   631k|        if (lastChild == NULL) {
  ------------------
  |  Branch (2506:13): [True: 101k, False: 529k]
  ------------------
 2507|   101k|            parent->children = node;
 2508|   101k|            parent->last = node;
 2509|   101k|            node->parent = parent;
 2510|   529k|        } else {
 2511|   529k|            xmlSAX2AppendChild(ctxt, node);
 2512|   529k|        }
 2513|       |
 2514|   631k|        ctxt->nodelen = len;
 2515|   631k|        ctxt->nodemem = len + 1;
 2516|   631k|        lastChild = node;
 2517|   631k|    } else {
 2518|   224k|        xmlChar *content;
 2519|   224k|        int oldSize, newSize, capacity;
 2520|   224k|        int maxSize = (ctxt->options & XML_PARSE_HUGE) ?
  ------------------
  |  Branch (2520:23): [True: 100k, False: 124k]
  ------------------
 2521|   100k|                      XML_MAX_HUGE_LENGTH :
  ------------------
  |  |   55|   100k|#define XML_MAX_HUGE_LENGTH 1000000000
  ------------------
 2522|   224k|                      XML_MAX_TEXT_LENGTH;
  ------------------
  |  |   50|   124k|#define XML_MAX_TEXT_LENGTH 10000000
  ------------------
 2523|       |
 2524|   224k|        content = lastChild->content;
 2525|   224k|        oldSize = ctxt->nodelen;
 2526|   224k|        capacity = ctxt->nodemem;
 2527|       |
 2528|       |        /* Shouldn't happen */
 2529|   224k|        if ((content == NULL) || (capacity <= 0)) {
  ------------------
  |  Branch (2529:13): [True: 0, False: 224k]
  |  Branch (2529:34): [True: 0, False: 224k]
  ------------------
 2530|      0|            xmlFatalErr(ctxt, XML_ERR_INTERNAL_ERROR,
 2531|      0|                        "xmlSAX2Text: no content");
 2532|      0|            return;
 2533|      0|        }
 2534|       |
 2535|   224k|        if ((len > maxSize) || (oldSize > maxSize - len)) {
  ------------------
  |  Branch (2535:13): [True: 0, False: 224k]
  |  Branch (2535:32): [True: 0, False: 224k]
  ------------------
 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|   224k|        newSize = oldSize + len;
 2542|       |
 2543|   224k|        if (newSize >= capacity) {
  ------------------
  |  Branch (2543:13): [True: 61.3k, False: 163k]
  ------------------
 2544|  61.3k|            if (newSize <= 20)
  ------------------
  |  Branch (2544:17): [True: 30.2k, False: 31.0k]
  ------------------
 2545|  30.2k|                capacity = 40;
 2546|  31.0k|            else
 2547|  31.0k|                capacity = newSize > INT_MAX / 2 ? INT_MAX : newSize * 2;
  ------------------
  |  Branch (2547:28): [True: 0, False: 31.0k]
  ------------------
 2548|       |
 2549|       |            /*
 2550|       |             * If the content was stored in properties or in
 2551|       |             * the dictionary, don't realloc.
 2552|       |             */
 2553|  61.3k|            if ((content == (xmlChar *) &lastChild->properties) ||
  ------------------
  |  Branch (2553:17): [True: 18.5k, False: 42.7k]
  ------------------
 2554|  42.7k|                ((ctxt->nodemem == oldSize + 1) &&
  ------------------
  |  Branch (2554:18): [True: 30.2k, False: 12.5k]
  ------------------
 2555|  30.2k|                 (xmlDictOwns(ctxt->dict, content)))) {
  ------------------
  |  Branch (2555:18): [True: 221, False: 29.9k]
  ------------------
 2556|  18.7k|                xmlChar *newContent;
 2557|       |
 2558|  18.7k|                newContent = xmlMalloc(capacity);
 2559|  18.7k|                if (newContent == NULL) {
  ------------------
  |  Branch (2559:21): [True: 11, False: 18.7k]
  ------------------
 2560|     11|                    xmlSAX2ErrMemory(ctxt);
 2561|     11|                    return;
 2562|     11|                }
 2563|       |
 2564|  18.7k|                memcpy(newContent, content, oldSize);
 2565|  18.7k|                lastChild->properties = NULL;
 2566|  18.7k|                content = newContent;
 2567|  42.5k|            } else {
 2568|  42.5k|                content = xmlRealloc(content, capacity);
 2569|  42.5k|                if (content == NULL) {
  ------------------
  |  Branch (2569:21): [True: 12, False: 42.5k]
  ------------------
 2570|     12|                    xmlSAX2ErrMemory(ctxt);
 2571|     12|                    return;
 2572|     12|                }
 2573|  42.5k|            }
 2574|       |
 2575|  61.3k|            ctxt->nodemem = capacity;
 2576|  61.3k|            lastChild->content = content;
 2577|  61.3k|        }
 2578|       |
 2579|   224k|        memcpy(&content[oldSize], ch, len);
 2580|   224k|        content[newSize] = 0;
 2581|   224k|        ctxt->nodelen = newSize;
 2582|   224k|    }
 2583|       |
 2584|   855k|    if ((lastChild != NULL) &&
  ------------------
  |  Branch (2584:9): [True: 855k, False: 0]
  ------------------
 2585|   855k|        (type == XML_TEXT_NODE) &&
  ------------------
  |  Branch (2585:9): [True: 781k, False: 74.1k]
  ------------------
 2586|   781k|        (ctxt->input != NULL)) {
  ------------------
  |  Branch (2586:9): [True: 781k, False: 0]
  ------------------
 2587|   781k|        if ((unsigned) ctxt->input->line < (unsigned) USHRT_MAX)
  ------------------
  |  Branch (2587:13): [True: 724k, False: 57.5k]
  ------------------
 2588|   724k|            lastChild->line = ctxt->input->line;
 2589|  57.5k|        else {
 2590|  57.5k|            lastChild->line = USHRT_MAX;
 2591|  57.5k|            if (ctxt->options & XML_PARSE_BIG_LINES)
  ------------------
  |  Branch (2591:17): [True: 24.6k, False: 32.9k]
  ------------------
 2592|  24.6k|                lastChild->psvi = XML_INT_TO_PTR(ctxt->input->line);
  ------------------
  |  |   59|  24.6k|#define XML_INT_TO_PTR(i) ((void *) (XML_INTPTR_T) (i))
  ------------------
 2593|  57.5k|        }
 2594|   781k|    }
 2595|   855k|}

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

xmlInitCatalogInternal:
 3228|      2|xmlInitCatalogInternal(void) {
 3229|      2|    if (getenv("XML_DEBUG_CATALOG"))
  ------------------
  |  Branch (3229:9): [True: 0, False: 2]
  ------------------
 3230|      0|	xmlDebugCatalogs = 1;
 3231|      2|    xmlInitRMutex(&xmlCatalogMutex);
 3232|      2|}
xmlInitializeCatalog:
 3238|      2|xmlInitializeCatalog(void) {
 3239|      2|    if (xmlCatalogInitialized != 0)
  ------------------
  |  Branch (3239:9): [True: 0, False: 2]
  ------------------
 3240|      0|	return;
 3241|       |
 3242|      2|    xmlInitParser();
 3243|       |
 3244|      2|    xmlRMutexLock(&xmlCatalogMutex);
 3245|       |
 3246|      2|    if (xmlDefaultCatalog == NULL) {
  ------------------
  |  Branch (3246:9): [True: 2, False: 0]
  ------------------
 3247|      2|	const char *catalogs;
 3248|      2|	char *path;
 3249|      2|	const char *cur, *paths;
 3250|      2|	xmlCatalogPtr catal;
 3251|      2|	xmlCatalogEntryPtr *nextent;
 3252|       |
 3253|      2|	catalogs = (const char *) getenv("XML_CATALOG_FILES");
 3254|      2|	if (catalogs == NULL)
  ------------------
  |  Branch (3254:6): [True: 2, False: 0]
  ------------------
 3255|      2|	    catalogs = XML_XML_DEFAULT_CATALOG;
  ------------------
  |  |   58|      2|#define XML_XML_DEFAULT_CATALOG "file://" XML_SYSCONFDIR "/xml/catalog"
  ------------------
 3256|       |
 3257|      2|	catal = xmlCreateNewCatalog(XML_XML_CATALOG_TYPE,
 3258|      2|		xmlCatalogDefaultPrefer);
 3259|      2|	if (catal != NULL) {
  ------------------
  |  Branch (3259:6): [True: 2, False: 0]
  ------------------
 3260|       |	    /* the XML_CATALOG_FILES envvar is allowed to contain a
 3261|       |	       space-separated list of entries. */
 3262|      2|	    cur = catalogs;
 3263|      2|	    nextent = &catal->xml;
 3264|      4|	    while (*cur != '\0') {
  ------------------
  |  Branch (3264:13): [True: 2, False: 2]
  ------------------
 3265|      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]
  |  |  ------------------
  ------------------
 3266|      0|		    cur++;
 3267|      2|		if (*cur != 0) {
  ------------------
  |  Branch (3267:7): [True: 2, False: 0]
  ------------------
 3268|      2|		    paths = cur;
 3269|     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 (3269:14): [True: 66, False: 2]
  ------------------
 3270|     66|			cur++;
 3271|      2|		    path = (char *) xmlStrndup((const xmlChar *)paths, cur - paths);
 3272|      2|		    if (path != NULL) {
  ------------------
  |  Branch (3272:11): [True: 2, False: 0]
  ------------------
 3273|      2|			*nextent = xmlNewCatalogEntry(XML_CATA_CATALOG, NULL,
 3274|      2|				NULL, BAD_CAST path, xmlCatalogDefaultPrefer, NULL);
  ------------------
  |  |   34|      2|#define BAD_CAST (xmlChar *)
  ------------------
 3275|      2|			if (*nextent != NULL)
  ------------------
  |  Branch (3275:8): [True: 2, False: 0]
  ------------------
 3276|      2|			    nextent = &((*nextent)->next);
 3277|      2|			xmlFree(path);
 3278|      2|		    }
 3279|      2|		}
 3280|      2|	    }
 3281|      2|	    xmlDefaultCatalog = catal;
 3282|      2|	}
 3283|      2|    }
 3284|       |
 3285|      2|    xmlRMutexUnlock(&xmlCatalogMutex);
 3286|       |
 3287|      2|    xmlCatalogInitialized = 1;
 3288|      2|}
xmlCatalogGetDefaults:
 3603|   339k|xmlCatalogGetDefaults(void) {
 3604|   339k|    return(xmlCatalogDefaultAllow);
 3605|   339k|}
xmlCatalogSetDefaults:
 3617|      2|xmlCatalogSetDefaults(xmlCatalogAllow allow) {
 3618|      2|    if (xmlDebugCatalogs) {
  ------------------
  |  Branch (3618:9): [True: 0, False: 2]
  ------------------
 3619|      0|	switch (allow) {
  ------------------
  |  Branch (3619:10): [True: 0, False: 0]
  ------------------
 3620|      0|	    case XML_CATA_ALLOW_NONE:
  ------------------
  |  Branch (3620:6): [True: 0, False: 0]
  ------------------
 3621|      0|		xmlCatalogPrintDebug(
 3622|      0|			"Disabling catalog usage\n");
 3623|      0|		break;
 3624|      0|	    case XML_CATA_ALLOW_GLOBAL:
  ------------------
  |  Branch (3624:6): [True: 0, False: 0]
  ------------------
 3625|      0|		xmlCatalogPrintDebug(
 3626|      0|			"Allowing only global catalogs\n");
 3627|      0|		break;
 3628|      0|	    case XML_CATA_ALLOW_DOCUMENT:
  ------------------
  |  Branch (3628:6): [True: 0, False: 0]
  ------------------
 3629|      0|		xmlCatalogPrintDebug(
 3630|      0|			"Allowing only catalogs from the document\n");
 3631|      0|		break;
 3632|      0|	    case XML_CATA_ALLOW_ALL:
  ------------------
  |  Branch (3632:6): [True: 0, False: 0]
  ------------------
 3633|      0|		xmlCatalogPrintDebug(
 3634|      0|			"Allowing all catalogs\n");
 3635|      0|		break;
 3636|      0|	}
 3637|      0|    }
 3638|      2|    xmlCatalogDefaultAllow = allow;
 3639|      2|}
catalog.c:xmlCreateNewCatalog:
  473|      2|xmlCreateNewCatalog(xmlCatalogType type, xmlCatalogPrefer prefer) {
  474|      2|    xmlCatalogPtr ret;
  475|       |
  476|      2|    ret = (xmlCatalogPtr) xmlMalloc(sizeof(xmlCatalog));
  477|      2|    if (ret == NULL) {
  ------------------
  |  Branch (477:9): [True: 0, False: 2]
  ------------------
  478|      0|        xmlCatalogErrMemory();
  479|      0|	return(NULL);
  480|      0|    }
  481|      2|    memset(ret, 0, sizeof(xmlCatalog));
  482|      2|    ret->type = type;
  483|      2|    ret->prefer = prefer;
  484|      2|#ifdef LIBXML_SGML_CATALOG_ENABLED
  485|      2|    ret->catalNr = 0;
  486|      2|    ret->catalMax = XML_MAX_SGML_CATA_DEPTH;
  ------------------
  |  |  133|      2|#define XML_MAX_SGML_CATA_DEPTH 10
  ------------------
  487|      2|    if (ret->type == XML_SGML_CATALOG_TYPE)
  ------------------
  |  Branch (487:9): [True: 0, False: 2]
  ------------------
  488|      0|	ret->sgml = xmlHashCreate(10);
  489|      2|#endif
  490|      2|    return(ret);
  491|      2|}
catalog.c:xmlNewCatalogEntry:
  337|      2|	   xmlCatalogEntryPtr group) {
  338|      2|    xmlCatalogEntryPtr ret;
  339|      2|    xmlChar *normid = NULL;
  340|       |
  341|      2|    ret = (xmlCatalogEntryPtr) xmlMalloc(sizeof(xmlCatalogEntry));
  342|      2|    if (ret == NULL) {
  ------------------
  |  Branch (342:9): [True: 0, False: 2]
  ------------------
  343|      0|        xmlCatalogErrMemory();
  344|      0|	return(NULL);
  345|      0|    }
  346|      2|    ret->next = NULL;
  347|      2|    ret->parent = NULL;
  348|      2|    ret->children = NULL;
  349|      2|    ret->type = type;
  350|      2|    if (type == XML_CATA_PUBLIC || type == XML_CATA_DELEGATE_PUBLIC) {
  ------------------
  |  Branch (350:9): [True: 0, False: 2]
  |  Branch (350:36): [True: 0, False: 2]
  ------------------
  351|      0|        normid = xmlCatalogNormalizePublic(name);
  352|      0|        if (normid != NULL)
  ------------------
  |  Branch (352:13): [True: 0, False: 0]
  ------------------
  353|      0|            name = (*normid != 0 ? normid : NULL);
  ------------------
  |  Branch (353:21): [True: 0, False: 0]
  ------------------
  354|      0|    }
  355|      2|    if (name != NULL)
  ------------------
  |  Branch (355:9): [True: 0, False: 2]
  ------------------
  356|      0|	ret->name = xmlStrdup(name);
  357|      2|    else
  358|      2|	ret->name = NULL;
  359|      2|    if (normid != NULL)
  ------------------
  |  Branch (359:9): [True: 0, False: 2]
  ------------------
  360|      0|        xmlFree(normid);
  361|      2|    if (value != NULL)
  ------------------
  |  Branch (361:9): [True: 0, False: 2]
  ------------------
  362|      0|	ret->value = xmlStrdup(value);
  363|      2|    else
  364|      2|	ret->value = NULL;
  365|      2|    if (URL == NULL)
  ------------------
  |  Branch (365:9): [True: 0, False: 2]
  ------------------
  366|      0|	URL = value;
  367|      2|    if (URL != NULL)
  ------------------
  |  Branch (367:9): [True: 2, False: 0]
  ------------------
  368|      2|	ret->URL = xmlStrdup(URL);
  369|      0|    else
  370|      0|	ret->URL = NULL;
  371|      2|    ret->prefer = prefer;
  372|      2|    ret->dealloc = 0;
  373|      2|    ret->depth = 0;
  374|      2|    ret->group = group;
  375|      2|    return(ret);
  376|      2|}

xmlCharInRange:
   32|  5.59M|xmlCharInRange (unsigned int val, const xmlChRangeGroup *rptr) {
   33|  5.59M|    int low, high, mid;
   34|  5.59M|    const xmlChSRange *sptr;
   35|  5.59M|    const xmlChLRange *lptr;
   36|       |
   37|  5.59M|    if (rptr == NULL) return(0);
  ------------------
  |  Branch (37:9): [True: 0, False: 5.59M]
  ------------------
   38|  5.59M|    if (val < 0x10000) {	/* is val in 'short' or 'long'  array? */
  ------------------
  |  Branch (38:9): [True: 5.55M, False: 38.6k]
  ------------------
   39|  5.55M|	if (rptr->nbShortRange == 0)
  ------------------
  |  Branch (39:6): [True: 0, False: 5.55M]
  ------------------
   40|      0|	    return 0;
   41|  5.55M|	low = 0;
   42|  5.55M|	high = rptr->nbShortRange - 1;
   43|  5.55M|	sptr = rptr->shortRange;
   44|  44.4M|	while (low <= high) {
  ------------------
  |  Branch (44:9): [True: 44.4M, False: 14.0k]
  ------------------
   45|  44.4M|	    mid = (low + high) / 2;
   46|  44.4M|	    if ((unsigned short) val < sptr[mid].low) {
  ------------------
  |  Branch (46:10): [True: 22.1M, False: 22.2M]
  ------------------
   47|  22.1M|		high = mid - 1;
   48|  22.2M|	    } else {
   49|  22.2M|		if ((unsigned short) val > sptr[mid].high) {
  ------------------
  |  Branch (49:7): [True: 16.7M, False: 5.54M]
  ------------------
   50|  16.7M|		    low = mid + 1;
   51|  16.7M|		} else {
   52|  5.54M|		    return 1;
   53|  5.54M|		}
   54|  22.2M|	    }
   55|  44.4M|	}
   56|  5.55M|    } else {
   57|  38.6k|	if (rptr->nbLongRange == 0) {
  ------------------
  |  Branch (57:6): [True: 38.6k, False: 0]
  ------------------
   58|  38.6k|	    return 0;
   59|  38.6k|	}
   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.0k|    return 0;
   77|  5.59M|}

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

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

xmlFreeEntity:
   85|   148k|{
   86|   148k|    xmlDictPtr dict = NULL;
   87|       |
   88|   148k|    if (entity == NULL)
  ------------------
  |  Branch (88:9): [True: 0, False: 148k]
  ------------------
   89|      0|        return;
   90|       |
   91|   148k|    if (entity->doc != NULL)
  ------------------
  |  Branch (91:9): [True: 144k, False: 4.22k]
  ------------------
   92|   144k|        dict = entity->doc->dict;
   93|       |
   94|       |
   95|   148k|    if ((entity->children) &&
  ------------------
  |  Branch (95:9): [True: 4.58k, False: 144k]
  ------------------
   96|  4.58k|        (entity == (xmlEntityPtr) entity->children->parent))
  ------------------
  |  Branch (96:9): [True: 4.58k, False: 0]
  ------------------
   97|  4.58k|        xmlFreeNodeList(entity->children);
   98|   148k|    if ((entity->name != NULL) &&
  ------------------
  |  Branch (98:9): [True: 148k, False: 6]
  ------------------
   99|   148k|        ((dict == NULL) || (!xmlDictOwns(dict, entity->name))))
  ------------------
  |  Branch (99:10): [True: 91.1k, False: 57.4k]
  |  Branch (99:28): [True: 0, False: 57.4k]
  ------------------
  100|  91.1k|        xmlFree((char *) entity->name);
  101|   148k|    if (entity->ExternalID != NULL)
  ------------------
  |  Branch (101:9): [True: 4.51k, False: 144k]
  ------------------
  102|  4.51k|        xmlFree((char *) entity->ExternalID);
  103|   148k|    if (entity->SystemID != NULL)
  ------------------
  |  Branch (103:9): [True: 14.1k, False: 134k]
  ------------------
  104|  14.1k|        xmlFree((char *) entity->SystemID);
  105|   148k|    if (entity->URI != NULL)
  ------------------
  |  Branch (105:9): [True: 10.0k, False: 138k]
  ------------------
  106|  10.0k|        xmlFree((char *) entity->URI);
  107|   148k|    if (entity->content != NULL)
  ------------------
  |  Branch (107:9): [True: 131k, False: 17.5k]
  ------------------
  108|   131k|        xmlFree((char *) entity->content);
  109|   148k|    if (entity->orig != NULL)
  ------------------
  |  Branch (109:9): [True: 17.3k, False: 131k]
  ------------------
  110|  17.3k|        xmlFree((char *) entity->orig);
  111|   148k|    xmlFree(entity);
  112|   148k|}
xmlAddEntity:
  188|   148k|	  const xmlChar *content, xmlEntity **out) {
  189|   148k|    xmlDtdPtr dtd;
  190|   148k|    xmlDictPtr dict = NULL;
  191|   148k|    xmlEntitiesTablePtr table = NULL;
  192|   148k|    xmlEntityPtr ret, predef;
  193|   148k|    int res;
  194|       |
  195|   148k|    if (out != NULL)
  ------------------
  |  Branch (195:9): [True: 148k, False: 0]
  ------------------
  196|   148k|        *out = NULL;
  197|   148k|    if ((doc == NULL) || (name == NULL))
  ------------------
  |  Branch (197:9): [True: 0, False: 148k]
  |  Branch (197:26): [True: 0, False: 148k]
  ------------------
  198|      0|	return(XML_ERR_ARGUMENT);
  199|   148k|    dict = doc->dict;
  200|       |
  201|   148k|    if (extSubset)
  ------------------
  |  Branch (201:9): [True: 5.77k, False: 142k]
  ------------------
  202|  5.77k|        dtd = doc->extSubset;
  203|   142k|    else
  204|   142k|        dtd = doc->intSubset;
  205|   148k|    if (dtd == NULL)
  ------------------
  |  Branch (205:9): [True: 0, False: 148k]
  ------------------
  206|      0|        return(XML_DTD_NO_DTD);
  207|       |
  208|   148k|    switch (type) {
  209|  64.5k|        case XML_INTERNAL_GENERAL_ENTITY:
  ------------------
  |  Branch (209:9): [True: 64.5k, False: 83.7k]
  ------------------
  210|  73.8k|        case XML_EXTERNAL_GENERAL_PARSED_ENTITY:
  ------------------
  |  Branch (210:9): [True: 9.33k, False: 138k]
  ------------------
  211|  74.3k|        case XML_EXTERNAL_GENERAL_UNPARSED_ENTITY:
  ------------------
  |  Branch (211:9): [True: 549, False: 147k]
  ------------------
  212|  74.3k|            predef = xmlGetPredefinedEntity(name);
  213|  74.3k|            if (predef != NULL) {
  ------------------
  |  Branch (213:17): [True: 4.45k, False: 69.9k]
  ------------------
  214|  4.45k|                int valid = 0;
  215|       |
  216|       |                /* 4.6 Predefined Entities */
  217|  4.45k|                if ((type == XML_INTERNAL_GENERAL_ENTITY) &&
  ------------------
  |  Branch (217:21): [True: 3.65k, False: 795]
  ------------------
  218|  3.65k|                    (content != NULL)) {
  ------------------
  |  Branch (218:21): [True: 2.55k, False: 1.10k]
  ------------------
  219|  2.55k|                    int c = predef->content[0];
  220|       |
  221|  2.55k|                    if (((content[0] == c) && (content[1] == 0)) &&
  ------------------
  |  Branch (221:26): [True: 1.25k, False: 1.29k]
  |  Branch (221:47): [True: 548, False: 711]
  ------------------
  222|    548|                        ((c == '>') || (c == '\'') || (c == '"'))) {
  ------------------
  |  Branch (222:26): [True: 144, False: 404]
  |  Branch (222:40): [True: 100, False: 304]
  |  Branch (222:55): [True: 88, False: 216]
  ------------------
  223|    332|                        valid = 1;
  224|  2.22k|                    } else if ((content[0] == '&') && (content[1] == '#')) {
  ------------------
  |  Branch (224:32): [True: 1.01k, False: 1.20k]
  |  Branch (224:55): [True: 740, False: 277]
  ------------------
  225|    740|                        if (content[2] == 'x') {
  ------------------
  |  Branch (225:29): [True: 209, False: 531]
  ------------------
  226|    209|                            xmlChar *hex = BAD_CAST "0123456789ABCDEF";
  ------------------
  |  |   34|    209|#define BAD_CAST (xmlChar *)
  ------------------
  227|    209|                            xmlChar ref[] = "00;";
  228|       |
  229|    209|                            ref[0] = hex[c / 16 % 16];
  230|    209|                            ref[1] = hex[c % 16];
  231|    209|                            if (xmlStrcasecmp(&content[3], ref) == 0)
  ------------------
  |  Branch (231:33): [True: 10, False: 199]
  ------------------
  232|     10|                                valid = 1;
  233|    531|                        } else {
  234|    531|                            xmlChar ref[] = "00;";
  235|       |
  236|    531|                            ref[0] = '0' + c / 10 % 10;
  237|    531|                            ref[1] = '0' + c % 10;
  238|    531|                            if (xmlStrEqual(&content[2], ref))
  ------------------
  |  Branch (238:33): [True: 220, False: 311]
  ------------------
  239|    220|                                valid = 1;
  240|    531|                        }
  241|    740|                    }
  242|  2.55k|                }
  243|  4.45k|                if (!valid)
  ------------------
  |  Branch (243:21): [True: 3.89k, False: 562]
  ------------------
  244|  3.89k|                    return(XML_ERR_REDECL_PREDEF_ENTITY);
  245|  4.45k|            }
  246|  70.5k|	    if (dtd->entities == NULL) {
  ------------------
  |  Branch (246:10): [True: 5.68k, False: 64.8k]
  ------------------
  247|  5.68k|		dtd->entities = xmlHashCreateDict(0, dict);
  248|  5.68k|                if (dtd->entities == NULL)
  ------------------
  |  Branch (248:21): [True: 8, False: 5.67k]
  ------------------
  249|      8|                    return(XML_ERR_NO_MEMORY);
  250|  5.68k|            }
  251|  70.4k|	    table = dtd->entities;
  252|  70.4k|	    break;
  253|  67.4k|        case XML_INTERNAL_PARAMETER_ENTITY:
  ------------------
  |  Branch (253:9): [True: 67.4k, False: 80.8k]
  ------------------
  254|  73.8k|        case XML_EXTERNAL_PARAMETER_ENTITY:
  ------------------
  |  Branch (254:9): [True: 6.45k, False: 141k]
  ------------------
  255|  73.8k|	    if (dtd->pentities == NULL) {
  ------------------
  |  Branch (255:10): [True: 3.65k, False: 70.2k]
  ------------------
  256|  3.65k|		dtd->pentities = xmlHashCreateDict(0, dict);
  257|  3.65k|                if (dtd->pentities == NULL)
  ------------------
  |  Branch (257:21): [True: 1, False: 3.65k]
  ------------------
  258|      1|                    return(XML_ERR_NO_MEMORY);
  259|  3.65k|            }
  260|  73.8k|	    table = dtd->pentities;
  261|  73.8k|	    break;
  262|      0|        default:
  ------------------
  |  Branch (262:9): [True: 0, False: 148k]
  ------------------
  263|      0|	    return(XML_ERR_ARGUMENT);
  264|   148k|    }
  265|   144k|    ret = xmlCreateEntity(dtd->doc, name, type, publicId, systemId, content);
  266|   144k|    if (ret == NULL)
  ------------------
  |  Branch (266:9): [True: 22, False: 144k]
  ------------------
  267|     22|        return(XML_ERR_NO_MEMORY);
  268|       |
  269|   144k|    res = xmlHashAdd(table, name, ret);
  270|   144k|    if (res < 0) {
  ------------------
  |  Branch (270:9): [True: 10, False: 144k]
  ------------------
  271|     10|        xmlFreeEntity(ret);
  272|     10|        return(XML_ERR_NO_MEMORY);
  273|   144k|    } else if (res == 0) {
  ------------------
  |  Branch (273:16): [True: 120k, False: 23.7k]
  ------------------
  274|       |	/*
  275|       |	 * entity was already defined at another level.
  276|       |	 */
  277|   120k|        xmlFreeEntity(ret);
  278|   120k|	return(XML_WAR_ENTITY_REDEFINED);
  279|   120k|    }
  280|       |
  281|       |    /*
  282|       |     * Link it to the DTD
  283|       |     */
  284|  23.7k|    ret->parent = dtd;
  285|  23.7k|    ret->doc = dtd->doc;
  286|  23.7k|    if (dtd->last == NULL) {
  ------------------
  |  Branch (286:9): [True: 6.66k, False: 17.1k]
  ------------------
  287|  6.66k|	dtd->children = dtd->last = (xmlNodePtr) ret;
  288|  17.1k|    } else {
  289|  17.1k|	dtd->last->next = (xmlNodePtr) ret;
  290|  17.1k|	ret->prev = dtd->last;
  291|  17.1k|	dtd->last = (xmlNodePtr) ret;
  292|  17.1k|    }
  293|       |
  294|  23.7k|    if (out != NULL)
  ------------------
  |  Branch (294:9): [True: 23.7k, False: 0]
  ------------------
  295|  23.7k|        *out = ret;
  296|  23.7k|    return(0);
  297|   144k|}
xmlGetPredefinedEntity:
  306|  4.28M|xmlGetPredefinedEntity(const xmlChar *name) {
  307|  4.28M|    if (name == NULL) return(NULL);
  ------------------
  |  Branch (307:9): [True: 4, False: 4.28M]
  ------------------
  308|  4.28M|    switch (name[0]) {
  309|   383k|        case 'l':
  ------------------
  |  Branch (309:9): [True: 383k, False: 3.90M]
  ------------------
  310|   383k|	    if (xmlStrEqual(name, BAD_CAST "lt"))
  ------------------
  |  |   34|   383k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (310:10): [True: 34.4k, False: 349k]
  ------------------
  311|  34.4k|	        return(&xmlEntityLt);
  312|   349k|	    break;
  313|  1.19M|        case 'g':
  ------------------
  |  Branch (313:9): [True: 1.19M, False: 3.09M]
  ------------------
  314|  1.19M|	    if (xmlStrEqual(name, BAD_CAST "gt"))
  ------------------
  |  |   34|  1.19M|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (314:10): [True: 1.17M, False: 25.4k]
  ------------------
  315|  1.17M|	        return(&xmlEntityGt);
  316|  25.4k|	    break;
  317|  71.9k|        case 'a':
  ------------------
  |  Branch (317:9): [True: 71.9k, False: 4.21M]
  ------------------
  318|  71.9k|	    if (xmlStrEqual(name, BAD_CAST "amp"))
  ------------------
  |  |   34|  71.9k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (318:10): [True: 10.3k, False: 61.6k]
  ------------------
  319|  10.3k|	        return(&xmlEntityAmp);
  320|  61.6k|	    if (xmlStrEqual(name, BAD_CAST "apos"))
  ------------------
  |  |   34|  61.6k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (320:10): [True: 7.66k, False: 53.9k]
  ------------------
  321|  7.66k|	        return(&xmlEntityApos);
  322|  53.9k|	    break;
  323|  53.9k|        case 'q':
  ------------------
  |  Branch (323:9): [True: 7.74k, False: 4.28M]
  ------------------
  324|  7.74k|	    if (xmlStrEqual(name, BAD_CAST "quot"))
  ------------------
  |  |   34|  7.74k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (324:10): [True: 6.72k, False: 1.01k]
  ------------------
  325|  6.72k|	        return(&xmlEntityQuot);
  326|  1.01k|	    break;
  327|  2.62M|	default:
  ------------------
  |  Branch (327:2): [True: 2.62M, False: 1.66M]
  ------------------
  328|  2.62M|	    break;
  329|  4.28M|    }
  330|  3.05M|    return(NULL);
  331|  4.28M|}
xmlAddDocEntity:
  372|    177|	        const xmlChar *content) {
  373|    177|    xmlEntityPtr ret;
  374|       |
  375|    177|    xmlAddEntity(doc, 0, name, type, publicId, systemId, content, &ret);
  376|    177|    return(ret);
  377|    177|}
xmlGetParameterEntity:
  428|   531k|xmlGetParameterEntity(xmlDoc *doc, const xmlChar *name) {
  429|   531k|    xmlEntitiesTablePtr table;
  430|   531k|    xmlEntityPtr ret;
  431|       |
  432|   531k|    if (doc == NULL)
  ------------------
  |  Branch (432:9): [True: 71, False: 531k]
  ------------------
  433|     71|	return(NULL);
  434|   531k|    if ((doc->intSubset != NULL) && (doc->intSubset->pentities != NULL)) {
  ------------------
  |  Branch (434:9): [True: 531k, False: 69]
  |  Branch (434:37): [True: 514k, False: 17.1k]
  ------------------
  435|   514k|	table = (xmlEntitiesTablePtr) doc->intSubset->pentities;
  436|   514k|	ret = xmlGetEntityFromTable(table, name);
  437|   514k|	if (ret != NULL)
  ------------------
  |  Branch (437:6): [True: 393k, False: 121k]
  ------------------
  438|   393k|	    return(ret);
  439|   514k|    }
  440|   138k|    if ((doc->extSubset != NULL) && (doc->extSubset->pentities != NULL)) {
  ------------------
  |  Branch (440:9): [True: 17.8k, False: 120k]
  |  Branch (440:37): [True: 17.5k, False: 269]
  ------------------
  441|  17.5k|	table = (xmlEntitiesTablePtr) doc->extSubset->pentities;
  442|  17.5k|	return(xmlGetEntityFromTable(table, name));
  443|  17.5k|    }
  444|   121k|    return(NULL);
  445|   138k|}
xmlGetDocEntity:
  476|  2.07M|xmlGetDocEntity(const xmlDoc *doc, const xmlChar *name) {
  477|  2.07M|    xmlEntityPtr cur;
  478|  2.07M|    xmlEntitiesTablePtr table;
  479|       |
  480|  2.07M|    if (doc != NULL) {
  ------------------
  |  Branch (480:9): [True: 2.07M, False: 1.23k]
  ------------------
  481|  2.07M|	if ((doc->intSubset != NULL) && (doc->intSubset->entities != NULL)) {
  ------------------
  |  Branch (481:6): [True: 2.05M, False: 18.6k]
  |  Branch (481:34): [True: 1.95M, False: 103k]
  ------------------
  482|  1.95M|	    table = (xmlEntitiesTablePtr) doc->intSubset->entities;
  483|  1.95M|	    cur = xmlGetEntityFromTable(table, name);
  484|  1.95M|	    if (cur != NULL)
  ------------------
  |  Branch (484:10): [True: 1.65M, False: 293k]
  ------------------
  485|  1.65M|		return(cur);
  486|  1.95M|	}
  487|   416k|	if (doc->standalone != 1) {
  ------------------
  |  Branch (487:6): [True: 415k, False: 929]
  ------------------
  488|   415k|	    if ((doc->extSubset != NULL) &&
  ------------------
  |  Branch (488:10): [True: 6.73k, False: 408k]
  ------------------
  489|  6.73k|		(doc->extSubset->entities != NULL)) {
  ------------------
  |  Branch (489:3): [True: 5.34k, False: 1.39k]
  ------------------
  490|  5.34k|		table = (xmlEntitiesTablePtr) doc->extSubset->entities;
  491|  5.34k|		cur = xmlGetEntityFromTable(table, name);
  492|  5.34k|		if (cur != NULL)
  ------------------
  |  Branch (492:7): [True: 3.79k, False: 1.54k]
  ------------------
  493|  3.79k|		    return(cur);
  494|  5.34k|	    }
  495|   415k|	}
  496|   416k|    }
  497|   413k|    return(xmlGetPredefinedEntity(name));
  498|  2.07M|}
xmlFreeEntitiesTable:
  588|  11.9k|xmlFreeEntitiesTable(xmlEntitiesTable *table) {
  589|  11.9k|    xmlHashFree(table, xmlFreeEntityWrapper);
  590|  11.9k|}
xmlCopyEntitiesTable:
  665|  2.67k|xmlCopyEntitiesTable(xmlEntitiesTable *table) {
  666|  2.67k|    return(xmlHashCopySafe(table, xmlCopyEntity, xmlFreeEntityWrapper));
  667|  2.67k|}
entities.c:xmlCreateEntity:
  120|   144k|	        const xmlChar *content) {
  121|   144k|    xmlEntityPtr ret;
  122|       |
  123|   144k|    ret = (xmlEntityPtr) xmlMalloc(sizeof(xmlEntity));
  124|   144k|    if (ret == NULL)
  ------------------
  |  Branch (124:9): [True: 6, False: 144k]
  ------------------
  125|      6|	return(NULL);
  126|   144k|    memset(ret, 0, sizeof(xmlEntity));
  127|   144k|    ret->doc = doc;
  128|   144k|    ret->type = XML_ENTITY_DECL;
  129|       |
  130|       |    /*
  131|       |     * fill the structure.
  132|       |     */
  133|   144k|    ret->etype = (xmlEntityType) type;
  134|   144k|    if ((doc == NULL) || (doc->dict == NULL))
  ------------------
  |  Branch (134:9): [True: 0, False: 144k]
  |  Branch (134:26): [True: 86.9k, False: 57.4k]
  ------------------
  135|  86.9k|	ret->name = xmlStrdup(name);
  136|  57.4k|    else
  137|  57.4k|        ret->name = xmlDictLookup(doc->dict, name, -1);
  138|   144k|    if (ret->name == NULL)
  ------------------
  |  Branch (138:9): [True: 3, False: 144k]
  ------------------
  139|      3|        goto error;
  140|   144k|    if (publicId != NULL) {
  ------------------
  |  Branch (140:9): [True: 3.65k, False: 140k]
  ------------------
  141|  3.65k|        ret->ExternalID = xmlStrdup(publicId);
  142|  3.65k|        if (ret->ExternalID == NULL)
  ------------------
  |  Branch (142:13): [True: 1, False: 3.65k]
  ------------------
  143|      1|            goto error;
  144|  3.65k|    }
  145|   144k|    if (systemId != NULL) {
  ------------------
  |  Branch (145:9): [True: 11.9k, False: 132k]
  ------------------
  146|  11.9k|        ret->SystemID = xmlStrdup(systemId);
  147|  11.9k|        if (ret->SystemID == NULL)
  ------------------
  |  Branch (147:13): [True: 3, False: 11.9k]
  ------------------
  148|      3|            goto error;
  149|  11.9k|    }
  150|   144k|    if (content != NULL) {
  ------------------
  |  Branch (150:9): [True: 128k, False: 15.9k]
  ------------------
  151|   128k|        ret->length = xmlStrlen(content);
  152|   128k|	ret->content = xmlStrndup(content, ret->length);
  153|   128k|        if (ret->content == NULL)
  ------------------
  |  Branch (153:13): [True: 9, False: 128k]
  ------------------
  154|      9|            goto error;
  155|   128k|     } else {
  156|  15.9k|        ret->length = 0;
  157|  15.9k|        ret->content = NULL;
  158|  15.9k|    }
  159|   144k|    ret->URI = NULL; /* to be computed by the layer knowing
  160|       |			the defining entity */
  161|   144k|    ret->orig = NULL;
  162|       |
  163|   144k|    return(ret);
  164|       |
  165|     16|error:
  166|     16|    xmlFreeEntity(ret);
  167|       |    return(NULL);
  168|   144k|}
entities.c:xmlGetEntityFromTable:
  415|  2.49M|xmlGetEntityFromTable(xmlEntitiesTablePtr table, const xmlChar *name) {
  416|  2.49M|    return((xmlEntityPtr) xmlHashLookup(table, name));
  417|  2.49M|}
entities.c:xmlFreeEntityWrapper:
  575|  27.9k|xmlFreeEntityWrapper(void *entity, const xmlChar *name ATTRIBUTE_UNUSED) {
  576|  27.9k|    if (entity != NULL)
  ------------------
  |  Branch (576:9): [True: 27.9k, False: 0]
  ------------------
  577|  27.9k|	xmlFreeEntity((xmlEntityPtr) entity);
  578|  27.9k|}
entities.c:xmlCopyEntity:
  600|  4.24k|xmlCopyEntity(void *payload, const xmlChar *name ATTRIBUTE_UNUSED) {
  601|  4.24k|    xmlEntityPtr ent = (xmlEntityPtr) payload;
  602|  4.24k|    xmlEntityPtr cur;
  603|       |
  604|  4.24k|    cur = (xmlEntityPtr) xmlMalloc(sizeof(xmlEntity));
  605|  4.24k|    if (cur == NULL)
  ------------------
  |  Branch (605:9): [True: 16, False: 4.22k]
  ------------------
  606|     16|	return(NULL);
  607|  4.22k|    memset(cur, 0, sizeof(xmlEntity));
  608|  4.22k|    cur->type = XML_ENTITY_DECL;
  609|       |
  610|  4.22k|    cur->etype = ent->etype;
  611|  4.22k|    if (ent->name != NULL) {
  ------------------
  |  Branch (611:9): [True: 4.22k, False: 0]
  ------------------
  612|  4.22k|	cur->name = xmlStrdup(ent->name);
  613|  4.22k|        if (cur->name == NULL)
  ------------------
  |  Branch (613:13): [True: 3, False: 4.22k]
  ------------------
  614|      3|            goto error;
  615|  4.22k|    }
  616|  4.22k|    if (ent->ExternalID != NULL) {
  ------------------
  |  Branch (616:9): [True: 862, False: 3.36k]
  ------------------
  617|    862|	cur->ExternalID = xmlStrdup(ent->ExternalID);
  618|    862|        if (cur->ExternalID == NULL)
  ------------------
  |  Branch (618:13): [True: 2, False: 860]
  ------------------
  619|      2|            goto error;
  620|    862|    }
  621|  4.22k|    if (ent->SystemID != NULL) {
  ------------------
  |  Branch (621:9): [True: 2.25k, False: 1.96k]
  ------------------
  622|  2.25k|	cur->SystemID = xmlStrdup(ent->SystemID);
  623|  2.25k|        if (cur->SystemID == NULL)
  ------------------
  |  Branch (623:13): [True: 6, False: 2.25k]
  ------------------
  624|      6|            goto error;
  625|  2.25k|    }
  626|  4.21k|    if (ent->content != NULL) {
  ------------------
  |  Branch (626:9): [True: 2.54k, False: 1.67k]
  ------------------
  627|  2.54k|	cur->content = xmlStrdup(ent->content);
  628|  2.54k|        if (cur->content == NULL)
  ------------------
  |  Branch (628:13): [True: 6, False: 2.53k]
  ------------------
  629|      6|            goto error;
  630|  2.54k|    }
  631|  4.20k|    if (ent->orig != NULL) {
  ------------------
  |  Branch (631:9): [True: 2.06k, False: 2.14k]
  ------------------
  632|  2.06k|	cur->orig = xmlStrdup(ent->orig);
  633|  2.06k|        if (cur->orig == NULL)
  ------------------
  |  Branch (633:13): [True: 6, False: 2.06k]
  ------------------
  634|      6|            goto error;
  635|  2.06k|    }
  636|  4.20k|    if (ent->URI != NULL) {
  ------------------
  |  Branch (636:9): [True: 2.25k, False: 1.94k]
  ------------------
  637|  2.25k|	cur->URI = xmlStrdup(ent->URI);
  638|  2.25k|        if (cur->URI == NULL)
  ------------------
  |  Branch (638:13): [True: 4, False: 2.24k]
  ------------------
  639|      4|            goto error;
  640|  2.25k|    }
  641|       |    /* Handle XML_TEXT_NODE children for XML_ENTITY_DECL */
  642|  4.19k|    if (ent->children != NULL) {
  ------------------
  |  Branch (642:9): [True: 905, False: 3.29k]
  ------------------
  643|    905|        cur->children = xmlStaticCopyNodeList(ent->children, cur->doc, (xmlNodePtr)cur);
  644|       |        /* Update last pointers */
  645|    905|        cur->last = cur->children;
  646|  5.63k|        while (cur->last && cur->last->next) cur->last = cur->last->next;
  ------------------
  |  Branch (646:16): [True: 5.63k, False: 5]
  |  Branch (646:29): [True: 4.73k, False: 900]
  ------------------
  647|    905|    }
  648|       |
  649|  4.19k|    return(cur);
  650|       |
  651|     27|error:
  652|     27|    xmlFreeEntity(cur);
  653|       |    return(NULL);
  654|  4.20k|}

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

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

LLVMFuzzerInitialize:
   92|      2|                     char ***argv ATTRIBUTE_UNUSED) {
   93|      2|    xmlFuzzMemSetup();
   94|      2|    xmlInitParser();
   95|      2|#ifdef LIBXML_CATALOG_ENABLED
   96|      2|    xmlInitializeCatalog();
   97|      2|    xmlCatalogSetDefaults(XML_CATA_ALLOW_NONE);
   98|      2|#endif
   99|       |
  100|      2|    return 0;
  101|      2|}
LLVMFuzzerTestOneInput:
  104|  43.0k|LLVMFuzzerTestOneInput(const char *data, size_t size) {
  105|  43.0k|    xmlTextReaderPtr reader;
  106|  43.0k|    xmlDocPtr doc = NULL;
  107|  43.0k|    const xmlError *error;
  108|  43.0k|    const char *docBuffer;
  109|  43.0k|    const unsigned char *program;
  110|  43.0k|    size_t failurePos, docSize, programSize, i;
  111|  43.0k|    size_t totalStringSize = 0;
  112|  43.0k|    int opts;
  113|  43.0k|    int oomReport = 0;
  114|       |
  115|  43.0k|    xmlFuzzDataInit(data, size);
  116|  43.0k|    opts = (int) xmlFuzzReadInt(4);
  117|  43.0k|    failurePos = xmlFuzzReadInt(4) % (size + 100);
  118|       |
  119|  43.0k|    program = (const unsigned char *) xmlFuzzReadString(&programSize);
  120|  43.0k|    if (programSize > 1000)
  ------------------
  |  Branch (120:9): [True: 18, False: 42.9k]
  ------------------
  121|     18|        programSize = 1000;
  122|       |
  123|  43.0k|    xmlFuzzReadEntities();
  124|  43.0k|    docBuffer = xmlFuzzMainEntity(&docSize);
  125|  43.0k|    if (docBuffer == NULL)
  ------------------
  |  Branch (125:9): [True: 114, False: 42.9k]
  ------------------
  126|    114|        goto exit;
  127|       |
  128|       |#ifdef DEBUG
  129|       |    fprintf(stderr, "Input document (%d bytes):\n", (int) docSize);
  130|       |    for (i = 0; (size_t) i < docSize; i++) {
  131|       |        int c = (unsigned char) docBuffer[i];
  132|       |
  133|       |        if ((c == '\n' || (c >= 0x20 && c <= 0x7E)))
  134|       |            putc(c, stderr);
  135|       |        else
  136|       |            fprintf(stderr, "\\x%02X", c);
  137|       |    }
  138|       |    fprintf(stderr, "\nEOF\n");
  139|       |#endif
  140|       |
  141|  42.9k|    xmlFuzzInjectFailure(failurePos);
  142|  42.9k|    reader = xmlReaderForMemory(docBuffer, docSize, NULL, NULL, opts);
  143|  42.9k|    if (reader == NULL)
  ------------------
  |  Branch (143:9): [True: 70, False: 42.8k]
  ------------------
  144|     70|        goto exit;
  145|       |
  146|  42.8k|    xmlTextReaderSetStructuredErrorHandler(reader, xmlFuzzSErrorFunc, NULL);
  147|  42.8k|    xmlTextReaderSetResourceLoader(reader, xmlFuzzResourceLoader, NULL);
  148|       |
  149|  42.8k|    i = 0;
  150|   764k|    while (i < programSize) {
  ------------------
  |  Branch (150:12): [True: 722k, False: 41.3k]
  ------------------
  151|   722k|        int op = program[i++];
  152|       |
  153|   722k|#define READ_BYTE() (i < programSize ? program[i++] : 0)
  154|   722k|#define FREE_STRING(str) \
  155|   722k|    do { \
  156|   722k|        if (str != NULL) { \
  157|   722k|            totalStringSize += strlen((char *) str); \
  158|   722k|            xmlFree(str); \
  159|   722k|        } \
  160|   722k|    } while (0)
  161|       |
  162|   722k|        switch (op & 0x3F) {
  163|  49.8k|            case OP_READ:
  ------------------
  |  Branch (163:13): [True: 49.8k, False: 673k]
  ------------------
  164|   241k|            default:
  ------------------
  |  Branch (164:13): [True: 191k, False: 531k]
  ------------------
  165|   241k|                startOp("Read");
  166|   241k|                xmlTextReaderRead(reader);
  167|   241k|                break;
  168|       |
  169|  13.2k|            case OP_READ_INNER_XML: {
  ------------------
  |  Branch (169:13): [True: 13.2k, False: 709k]
  ------------------
  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: 8.98k, False: 4.31k]
  |  |  ------------------
  |  |  157|  8.98k|            totalStringSize += strlen((char *) str); \
  |  |  158|  8.98k|            xmlFree(str); \
  |  |  159|  8.98k|        } \
  |  |  160|  13.2k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (160:14): [Folded, False: 13.2k]
  |  |  ------------------
  ------------------
  175|  13.2k|                break;
  176|  49.8k|            }
  177|       |
  178|  37.3k|            case OP_READ_OUTER_XML: {
  ------------------
  |  Branch (178:13): [True: 37.3k, False: 685k]
  ------------------
  179|  37.3k|                xmlChar *result;
  180|       |
  181|  37.3k|                startOp("ReadOuterXml");
  182|  37.3k|                result = xmlTextReaderReadOuterXml(reader);
  183|  37.3k|                FREE_STRING(result);
  ------------------
  |  |  155|  37.3k|    do { \
  |  |  156|  37.3k|        if (str != NULL) { \
  |  |  ------------------
  |  |  |  Branch (156:13): [True: 29.3k, False: 7.94k]
  |  |  ------------------
  |  |  157|  29.3k|            totalStringSize += strlen((char *) str); \
  |  |  158|  29.3k|            xmlFree(str); \
  |  |  159|  29.3k|        } \
  |  |  160|  37.3k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (160:14): [Folded, False: 37.3k]
  |  |  ------------------
  ------------------
  184|  37.3k|                break;
  185|  49.8k|            }
  186|       |
  187|  9.75k|            case OP_READ_STRING: {
  ------------------
  |  Branch (187:13): [True: 9.75k, False: 713k]
  ------------------
  188|  9.75k|                xmlChar *result;
  189|       |
  190|  9.75k|                startOp("ReadString");
  191|  9.75k|                result = xmlTextReaderReadString(reader);
  192|  9.75k|                FREE_STRING(result);
  ------------------
  |  |  155|  9.75k|    do { \
  |  |  156|  9.75k|        if (str != NULL) { \
  |  |  ------------------
  |  |  |  Branch (156:13): [True: 2.56k, False: 7.18k]
  |  |  ------------------
  |  |  157|  2.56k|            totalStringSize += strlen((char *) str); \
  |  |  158|  2.56k|            xmlFree(str); \
  |  |  159|  2.56k|        } \
  |  |  160|  9.75k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (160:14): [Folded, False: 9.75k]
  |  |  ------------------
  ------------------
  193|  9.75k|                break;
  194|  49.8k|            }
  195|       |
  196|  10.0k|            case OP_READ_ATTRIBUTE_VALUE:
  ------------------
  |  Branch (196:13): [True: 10.0k, False: 712k]
  ------------------
  197|  10.0k|                startOp("ReadAttributeValue");
  198|  10.0k|                xmlTextReaderReadAttributeValue(reader);
  199|  10.0k|                break;
  200|       |
  201|  7.83k|            case OP_ATTRIBUTE_COUNT:
  ------------------
  |  Branch (201:13): [True: 7.83k, False: 715k]
  ------------------
  202|  7.83k|                startOp("AttributeCount");
  203|  7.83k|                xmlTextReaderAttributeCount(reader);
  204|  7.83k|                break;
  205|       |
  206|  3.37k|            case OP_DEPTH:
  ------------------
  |  Branch (206:13): [True: 3.37k, False: 719k]
  ------------------
  207|  3.37k|                startOp("Depth");
  208|  3.37k|                xmlTextReaderDepth(reader);
  209|  3.37k|                break;
  210|       |
  211|  2.83k|            case OP_HAS_ATTRIBUTES:
  ------------------
  |  Branch (211:13): [True: 2.83k, False: 720k]
  ------------------
  212|  2.83k|                startOp("HasAttributes");
  213|  2.83k|                xmlTextReaderHasAttributes(reader);
  214|  2.83k|                break;
  215|       |
  216|  10.6k|            case OP_HAS_VALUE:
  ------------------
  |  Branch (216:13): [True: 10.6k, False: 712k]
  ------------------
  217|  10.6k|                startOp("HasValue");
  218|  10.6k|                xmlTextReaderHasValue(reader);
  219|  10.6k|                break;
  220|       |
  221|  6.84k|            case OP_IS_DEFAULT:
  ------------------
  |  Branch (221:13): [True: 6.84k, False: 716k]
  ------------------
  222|  6.84k|                startOp("IsDefault");
  223|  6.84k|                xmlTextReaderIsDefault(reader);
  224|  6.84k|                break;
  225|       |
  226|  8.99k|            case OP_IS_EMPTY_ELEMENT:
  ------------------
  |  Branch (226:13): [True: 8.99k, False: 713k]
  ------------------
  227|  8.99k|                startOp("IsEmptyElement");
  228|  8.99k|                xmlTextReaderIsEmptyElement(reader);
  229|  8.99k|                break;
  230|       |
  231|  10.9k|            case OP_NODE_TYPE:
  ------------------
  |  Branch (231:13): [True: 10.9k, False: 711k]
  ------------------
  232|  10.9k|                startOp("NodeType");
  233|  10.9k|                xmlTextReaderNodeType(reader);
  234|  10.9k|                break;
  235|       |
  236|  3.03k|            case OP_QUOTE_CHAR:
  ------------------
  |  Branch (236:13): [True: 3.03k, False: 719k]
  ------------------
  237|  3.03k|                startOp("QuoteChar");
  238|  3.03k|                xmlTextReaderQuoteChar(reader);
  239|  3.03k|                break;
  240|       |
  241|  4.38k|            case OP_READ_STATE:
  ------------------
  |  Branch (241:13): [True: 4.38k, False: 718k]
  ------------------
  242|  4.38k|                startOp("ReadState");
  243|  4.38k|                xmlTextReaderReadState(reader);
  244|  4.38k|                break;
  245|       |
  246|  4.21k|            case OP_IS_NAMESPACE_DECL:
  ------------------
  |  Branch (246:13): [True: 4.21k, False: 718k]
  ------------------
  247|  4.21k|                startOp("IsNamespaceDecl");
  248|  4.21k|                xmlTextReaderIsNamespaceDecl(reader);
  249|  4.21k|                break;
  250|       |
  251|  42.2k|            case OP_CONST_BASE_URI:
  ------------------
  |  Branch (251:13): [True: 42.2k, False: 680k]
  ------------------
  252|  42.2k|                startOp("ConstBaseUri");
  253|  42.2k|                xmlTextReaderConstBaseUri(reader);
  254|  42.2k|                break;
  255|       |
  256|  1.84k|            case OP_CONST_LOCAL_NAME:
  ------------------
  |  Branch (256:13): [True: 1.84k, False: 721k]
  ------------------
  257|  1.84k|                startOp("ConstLocalName");
  258|  1.84k|                xmlTextReaderConstLocalName(reader);
  259|  1.84k|                break;
  260|       |
  261|  2.91k|            case OP_CONST_NAME:
  ------------------
  |  Branch (261:13): [True: 2.91k, False: 719k]
  ------------------
  262|  2.91k|                startOp("ConstName");
  263|  2.91k|                xmlTextReaderConstName(reader);
  264|  2.91k|                break;
  265|       |
  266|  5.22k|            case OP_CONST_NAMESPACE_URI:
  ------------------
  |  Branch (266:13): [True: 5.22k, False: 717k]
  ------------------
  267|  5.22k|                startOp("ConstNamespaceUri");
  268|  5.22k|                xmlTextReaderConstNamespaceUri(reader);
  269|  5.22k|                break;
  270|       |
  271|  11.7k|            case OP_CONST_PREFIX:
  ------------------
  |  Branch (271:13): [True: 11.7k, False: 711k]
  ------------------
  272|  11.7k|                startOp("ConstPrefix");
  273|  11.7k|                xmlTextReaderConstPrefix(reader);
  274|  11.7k|                break;
  275|       |
  276|  7.26k|            case OP_CONST_XML_LANG:
  ------------------
  |  Branch (276:13): [True: 7.26k, False: 715k]
  ------------------
  277|  7.26k|                startOp("ConstXmlLang");
  278|  7.26k|                xmlTextReaderConstXmlLang(reader);
  279|  7.26k|                oomReport = -1;
  280|  7.26k|                break;
  281|       |
  282|  6.04k|            case OP_CONST_VALUE:
  ------------------
  |  Branch (282:13): [True: 6.04k, False: 716k]
  ------------------
  283|  6.04k|                startOp("ConstValue");
  284|  6.04k|                xmlTextReaderConstValue(reader);
  285|  6.04k|                break;
  286|       |
  287|  7.11k|            case OP_BASE_URI: {
  ------------------
  |  Branch (287:13): [True: 7.11k, False: 715k]
  ------------------
  288|  7.11k|                xmlChar *result;
  289|       |
  290|  7.11k|                startOp("BaseUri");
  291|  7.11k|                result = xmlTextReaderBaseUri(reader);
  292|  7.11k|                FREE_STRING(result);
  ------------------
  |  |  155|  7.11k|    do { \
  |  |  156|  7.11k|        if (str != NULL) { \
  |  |  ------------------
  |  |  |  Branch (156:13): [True: 2.43k, False: 4.68k]
  |  |  ------------------
  |  |  157|  2.43k|            totalStringSize += strlen((char *) str); \
  |  |  158|  2.43k|            xmlFree(str); \
  |  |  159|  2.43k|        } \
  |  |  160|  7.11k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (160:14): [Folded, False: 7.11k]
  |  |  ------------------
  ------------------
  293|  7.11k|                break;
  294|  49.8k|            }
  295|       |
  296|  5.70k|            case OP_LOCAL_NAME: {
  ------------------
  |  Branch (296:13): [True: 5.70k, False: 717k]
  ------------------
  297|  5.70k|                xmlChar *result;
  298|       |
  299|  5.70k|                startOp("LocalName");
  300|  5.70k|                result = xmlTextReaderLocalName(reader);
  301|  5.70k|                FREE_STRING(result);
  ------------------
  |  |  155|  5.70k|    do { \
  |  |  156|  5.70k|        if (str != NULL) { \
  |  |  ------------------
  |  |  |  Branch (156:13): [True: 3.79k, False: 1.91k]
  |  |  ------------------
  |  |  157|  3.79k|            totalStringSize += strlen((char *) str); \
  |  |  158|  3.79k|            xmlFree(str); \
  |  |  159|  3.79k|        } \
  |  |  160|  5.70k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (160:14): [Folded, False: 5.70k]
  |  |  ------------------
  ------------------
  302|  5.70k|                break;
  303|  49.8k|            }
  304|       |
  305|  5.75k|            case OP_NAME: {
  ------------------
  |  Branch (305:13): [True: 5.75k, False: 717k]
  ------------------
  306|  5.75k|                xmlChar *result;
  307|       |
  308|  5.75k|                startOp("Name");
  309|  5.75k|                result = xmlTextReaderName(reader);
  310|  5.75k|                FREE_STRING(result);
  ------------------
  |  |  155|  5.75k|    do { \
  |  |  156|  5.75k|        if (str != NULL) { \
  |  |  ------------------
  |  |  |  Branch (156:13): [True: 3.83k, False: 1.92k]
  |  |  ------------------
  |  |  157|  3.83k|            totalStringSize += strlen((char *) str); \
  |  |  158|  3.83k|            xmlFree(str); \
  |  |  159|  3.83k|        } \
  |  |  160|  5.75k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (160:14): [Folded, False: 5.75k]
  |  |  ------------------
  ------------------
  311|  5.75k|                break;
  312|  49.8k|            }
  313|       |
  314|  3.69k|            case OP_NAMESPACE_URI: {
  ------------------
  |  Branch (314:13): [True: 3.69k, False: 719k]
  ------------------
  315|  3.69k|                xmlChar *result;
  316|       |
  317|  3.69k|                startOp("NamespaceUri");
  318|  3.69k|                result = xmlTextReaderNamespaceUri(reader);
  319|  3.69k|                FREE_STRING(result);
  ------------------
  |  |  155|  3.69k|    do { \
  |  |  156|  3.69k|        if (str != NULL) { \
  |  |  ------------------
  |  |  |  Branch (156:13): [True: 596, False: 3.10k]
  |  |  ------------------
  |  |  157|    596|            totalStringSize += strlen((char *) str); \
  |  |  158|    596|            xmlFree(str); \
  |  |  159|    596|        } \
  |  |  160|  3.69k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (160:14): [Folded, False: 3.69k]
  |  |  ------------------
  ------------------
  320|  3.69k|                break;
  321|  49.8k|            }
  322|       |
  323|  5.10k|            case OP_PREFIX: {
  ------------------
  |  Branch (323:13): [True: 5.10k, False: 717k]
  ------------------
  324|  5.10k|                xmlChar *result;
  325|       |
  326|  5.10k|                startOp("Prefix");
  327|  5.10k|                result = xmlTextReaderPrefix(reader);
  328|  5.10k|                FREE_STRING(result);
  ------------------
  |  |  155|  5.10k|    do { \
  |  |  156|  5.10k|        if (str != NULL) { \
  |  |  ------------------
  |  |  |  Branch (156:13): [True: 981, False: 4.12k]
  |  |  ------------------
  |  |  157|    981|            totalStringSize += strlen((char *) str); \
  |  |  158|    981|            xmlFree(str); \
  |  |  159|    981|        } \
  |  |  160|  5.10k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (160:14): [Folded, False: 5.10k]
  |  |  ------------------
  ------------------
  329|  5.10k|                break;
  330|  49.8k|            }
  331|       |
  332|  3.31k|            case OP_XML_LANG: {
  ------------------
  |  Branch (332:13): [True: 3.31k, False: 719k]
  ------------------
  333|  3.31k|                xmlChar *result;
  334|       |
  335|  3.31k|                startOp("XmlLang");
  336|  3.31k|                result = xmlTextReaderXmlLang(reader);
  337|  3.31k|                oomReport = -1;
  338|  3.31k|                FREE_STRING(result);
  ------------------
  |  |  155|  3.31k|    do { \
  |  |  156|  3.31k|        if (str != NULL) { \
  |  |  ------------------
  |  |  |  Branch (156:13): [True: 235, False: 3.07k]
  |  |  ------------------
  |  |  157|    235|            totalStringSize += strlen((char *) str); \
  |  |  158|    235|            xmlFree(str); \
  |  |  159|    235|        } \
  |  |  160|  3.31k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (160:14): [Folded, False: 3.31k]
  |  |  ------------------
  ------------------
  339|  3.31k|                break;
  340|  49.8k|            }
  341|       |
  342|  9.17k|            case OP_VALUE: {
  ------------------
  |  Branch (342:13): [True: 9.17k, False: 713k]
  ------------------
  343|  9.17k|                xmlChar *result;
  344|       |
  345|  9.17k|                startOp("Value");
  346|  9.17k|                result = xmlTextReaderValue(reader);
  347|  9.17k|                FREE_STRING(result);
  ------------------
  |  |  155|  9.17k|    do { \
  |  |  156|  9.17k|        if (str != NULL) { \
  |  |  ------------------
  |  |  |  Branch (156:13): [True: 2.65k, False: 6.52k]
  |  |  ------------------
  |  |  157|  2.65k|            totalStringSize += strlen((char *) str); \
  |  |  158|  2.65k|            xmlFree(str); \
  |  |  159|  2.65k|        } \
  |  |  160|  9.17k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (160:14): [Folded, False: 9.17k]
  |  |  ------------------
  ------------------
  348|  9.17k|                break;
  349|  49.8k|            }
  350|       |
  351|  1.44k|            case OP_CLOSE:
  ------------------
  |  Branch (351:13): [True: 1.44k, False: 721k]
  ------------------
  352|  1.44k|                startOp("Close");
  353|  1.44k|                if (doc == NULL)
  ------------------
  |  Branch (353:21): [True: 591, False: 856]
  ------------------
  354|    591|                    doc = xmlTextReaderCurrentDoc(reader);
  355|  1.44k|                xmlTextReaderClose(reader);
  356|  1.44k|                break;
  357|       |
  358|  7.34k|            case OP_GET_ATTRIBUTE_NO: {
  ------------------
  |  Branch (358:13): [True: 7.34k, False: 715k]
  ------------------
  359|  7.34k|                xmlChar *result;
  360|  7.34k|                int no = READ_BYTE();
  ------------------
  |  |  153|  7.34k|#define READ_BYTE() (i < programSize ? program[i++] : 0)
  |  |  ------------------
  |  |  |  Branch (153:22): [True: 7.25k, False: 93]
  |  |  ------------------
  ------------------
  361|       |
  362|  7.34k|                startOp("GetAttributeNo");
  363|  7.34k|                result = xmlTextReaderGetAttributeNo(reader, no);
  364|  7.34k|                FREE_STRING(result);
  ------------------
  |  |  155|  7.34k|    do { \
  |  |  156|  7.34k|        if (str != NULL) { \
  |  |  ------------------
  |  |  |  Branch (156:13): [True: 619, False: 6.73k]
  |  |  ------------------
  |  |  157|    619|            totalStringSize += strlen((char *) str); \
  |  |  158|    619|            xmlFree(str); \
  |  |  159|    619|        } \
  |  |  160|  7.34k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (160:14): [Folded, False: 7.34k]
  |  |  ------------------
  ------------------
  365|  7.34k|                break;
  366|  49.8k|            }
  367|       |
  368|  27.0k|            case OP_GET_ATTRIBUTE: {
  ------------------
  |  Branch (368:13): [True: 27.0k, False: 695k]
  ------------------
  369|  27.0k|                const xmlChar *name = xmlTextReaderConstName(reader);
  370|  27.0k|                xmlChar *result;
  371|       |
  372|  27.0k|                startOp("GetAttribute");
  373|  27.0k|                result = xmlTextReaderGetAttribute(reader, name);
  374|  27.0k|                FREE_STRING(result);
  ------------------
  |  |  155|  27.0k|    do { \
  |  |  156|  27.0k|        if (str != NULL) { \
  |  |  ------------------
  |  |  |  Branch (156:13): [True: 929, False: 26.1k]
  |  |  ------------------
  |  |  157|    929|            totalStringSize += strlen((char *) str); \
  |  |  158|    929|            xmlFree(str); \
  |  |  159|    929|        } \
  |  |  160|  27.0k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (160:14): [Folded, False: 27.0k]
  |  |  ------------------
  ------------------
  375|  27.0k|                break;
  376|  49.8k|            }
  377|       |
  378|  22.1k|            case OP_GET_ATTRIBUTE_NS: {
  ------------------
  |  Branch (378:13): [True: 22.1k, False: 700k]
  ------------------
  379|  22.1k|                const xmlChar *localName, *namespaceUri;
  380|  22.1k|                xmlChar *result;
  381|       |
  382|  22.1k|                startOp("GetAttributeNs");
  383|  22.1k|                localName = xmlTextReaderConstLocalName(reader);
  384|  22.1k|                namespaceUri = xmlTextReaderConstNamespaceUri(reader);
  385|  22.1k|                result = xmlTextReaderGetAttributeNs(reader, localName,
  386|  22.1k|                                                     namespaceUri);
  387|  22.1k|                FREE_STRING(result);
  ------------------
  |  |  155|  22.1k|    do { \
  |  |  156|  22.1k|        if (str != NULL) { \
  |  |  ------------------
  |  |  |  Branch (156:13): [True: 994, False: 21.1k]
  |  |  ------------------
  |  |  157|    994|            totalStringSize += strlen((char *) str); \
  |  |  158|    994|            xmlFree(str); \
  |  |  159|    994|        } \
  |  |  160|  22.1k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (160:14): [Folded, False: 22.1k]
  |  |  ------------------
  ------------------
  388|  22.1k|                break;
  389|  49.8k|            }
  390|       |
  391|  3.28k|            case OP_GET_REMAINDER:
  ------------------
  |  Branch (391:13): [True: 3.28k, False: 719k]
  ------------------
  392|  3.28k|                startOp("GetRemainder");
  393|  3.28k|                if (doc == NULL)
  ------------------
  |  Branch (393:21): [True: 1.94k, False: 1.34k]
  ------------------
  394|  1.94k|                    doc = xmlTextReaderCurrentDoc(reader);
  395|  3.28k|                xmlFreeParserInputBuffer(xmlTextReaderGetRemainder(reader));
  396|  3.28k|                break;
  397|       |
  398|  7.62k|            case OP_LOOKUP_NAMESPACE: {
  ------------------
  |  Branch (398:13): [True: 7.62k, False: 715k]
  ------------------
  399|  7.62k|                const xmlChar *prefix = xmlTextReaderConstPrefix(reader);
  400|  7.62k|                xmlChar *result;
  401|       |
  402|  7.62k|                startOp("LookupNamespace");
  403|  7.62k|                result = xmlTextReaderLookupNamespace(reader, prefix);
  404|  7.62k|                FREE_STRING(result);
  ------------------
  |  |  155|  7.62k|    do { \
  |  |  156|  7.62k|        if (str != NULL) { \
  |  |  ------------------
  |  |  |  Branch (156:13): [True: 815, False: 6.81k]
  |  |  ------------------
  |  |  157|    815|            totalStringSize += strlen((char *) str); \
  |  |  158|    815|            xmlFree(str); \
  |  |  159|    815|        } \
  |  |  160|  7.62k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (160:14): [Folded, False: 7.62k]
  |  |  ------------------
  ------------------
  405|  7.62k|                break;
  406|  49.8k|            }
  407|       |
  408|  7.70k|            case OP_MOVE_TO_ATTRIBUTE_NO: {
  ------------------
  |  Branch (408:13): [True: 7.70k, False: 715k]
  ------------------
  409|  7.70k|                int no = READ_BYTE();
  ------------------
  |  |  153|  7.70k|#define READ_BYTE() (i < programSize ? program[i++] : 0)
  |  |  ------------------
  |  |  |  Branch (153:22): [True: 7.60k, False: 93]
  |  |  ------------------
  ------------------
  410|       |
  411|  7.70k|                startOp("MoveToAttributeNo");
  412|  7.70k|                xmlTextReaderMoveToAttributeNo(reader, no);
  413|  7.70k|                break;
  414|  49.8k|            }
  415|       |
  416|  12.4k|            case OP_MOVE_TO_ATTRIBUTE: {
  ------------------
  |  Branch (416:13): [True: 12.4k, False: 710k]
  ------------------
  417|  12.4k|                const xmlChar *name = xmlTextReaderConstName(reader);
  418|       |
  419|  12.4k|                startOp("MoveToAttribute");
  420|  12.4k|                xmlTextReaderMoveToAttribute(reader, name);
  421|  12.4k|                break;
  422|  49.8k|            }
  423|       |
  424|  10.1k|            case OP_MOVE_TO_ATTRIBUTE_NS: {
  ------------------
  |  Branch (424:13): [True: 10.1k, False: 712k]
  ------------------
  425|  10.1k|                const xmlChar *localName, *namespaceUri;
  426|       |
  427|  10.1k|                startOp("MoveToAttributeNs");
  428|  10.1k|                localName = xmlTextReaderConstLocalName(reader);
  429|  10.1k|                namespaceUri = xmlTextReaderConstNamespaceUri(reader);
  430|  10.1k|                xmlTextReaderMoveToAttributeNs(reader, localName,
  431|  10.1k|                                               namespaceUri);
  432|  10.1k|                break;
  433|  49.8k|            }
  434|       |
  435|  13.6k|            case OP_MOVE_TO_FIRST_ATTRIBUTE:
  ------------------
  |  Branch (435:13): [True: 13.6k, False: 709k]
  ------------------
  436|  13.6k|                startOp("MoveToFirstAttribute");
  437|  13.6k|                xmlTextReaderMoveToFirstAttribute(reader);
  438|  13.6k|                break;
  439|       |
  440|  6.74k|            case OP_MOVE_TO_NEXT_ATTRIBUTE:
  ------------------
  |  Branch (440:13): [True: 6.74k, False: 716k]
  ------------------
  441|  6.74k|                startOp("MoveToNextAttribute");
  442|  6.74k|                xmlTextReaderMoveToNextAttribute(reader);
  443|  6.74k|                break;
  444|       |
  445|  4.77k|            case OP_MOVE_TO_ELEMENT:
  ------------------
  |  Branch (445:13): [True: 4.77k, False: 718k]
  ------------------
  446|  4.77k|                startOp("MoveToElement");
  447|  4.77k|                xmlTextReaderMoveToElement(reader);
  448|  4.77k|                break;
  449|       |
  450|  2.04k|            case OP_NORMALIZATION:
  ------------------
  |  Branch (450:13): [True: 2.04k, False: 720k]
  ------------------
  451|  2.04k|                startOp("Normalization");
  452|  2.04k|                xmlTextReaderNormalization(reader);
  453|  2.04k|                break;
  454|       |
  455|  3.41k|            case OP_CONST_ENCODING:
  ------------------
  |  Branch (455:13): [True: 3.41k, False: 719k]
  ------------------
  456|  3.41k|                startOp("ConstEncoding");
  457|  3.41k|                xmlTextReaderConstEncoding(reader);
  458|  3.41k|                break;
  459|       |
  460|  7.70k|            case OP_GET_PARSER_PROP: {
  ------------------
  |  Branch (460:13): [True: 7.70k, False: 715k]
  ------------------
  461|  7.70k|                int prop = READ_BYTE();
  ------------------
  |  |  153|  7.70k|#define READ_BYTE() (i < programSize ? program[i++] : 0)
  |  |  ------------------
  |  |  |  Branch (153:22): [True: 7.51k, False: 192]
  |  |  ------------------
  ------------------
  462|       |
  463|  7.70k|                startOp("GetParserProp");
  464|  7.70k|                xmlTextReaderGetParserProp(reader, prop);
  465|  7.70k|                break;
  466|  49.8k|            }
  467|       |
  468|  12.9k|            case OP_CURRENT_NODE:
  ------------------
  |  Branch (468:13): [True: 12.9k, False: 709k]
  ------------------
  469|  12.9k|                startOp("CurrentNode");
  470|  12.9k|                xmlTextReaderCurrentNode(reader);
  471|  12.9k|                break;
  472|       |
  473|  5.45k|            case OP_GET_PARSER_LINE_NUMBER:
  ------------------
  |  Branch (473:13): [True: 5.45k, False: 717k]
  ------------------
  474|  5.45k|                startOp("GetParserLineNumber");
  475|  5.45k|                xmlTextReaderGetParserLineNumber(reader);
  476|  5.45k|                break;
  477|       |
  478|  8.55k|            case OP_GET_PARSER_COLUMN_NUMBER:
  ------------------
  |  Branch (478:13): [True: 8.55k, False: 714k]
  ------------------
  479|  8.55k|                startOp("GetParserColumnNumber");
  480|  8.55k|                xmlTextReaderGetParserColumnNumber(reader);
  481|  8.55k|                break;
  482|       |
  483|  8.76k|            case OP_PRESERVE:
  ------------------
  |  Branch (483:13): [True: 8.76k, False: 714k]
  ------------------
  484|  8.76k|                startOp("Preserve");
  485|  8.76k|                xmlTextReaderPreserve(reader);
  486|  8.76k|                break;
  487|       |
  488|  6.86k|            case OP_CURRENT_DOC: {
  ------------------
  |  Branch (488:13): [True: 6.86k, False: 716k]
  ------------------
  489|  6.86k|                xmlDocPtr result;
  490|       |
  491|  6.86k|                startOp("CurrentDoc");
  492|  6.86k|                result = xmlTextReaderCurrentDoc(reader);
  493|  6.86k|                if (doc == NULL)
  ------------------
  |  Branch (493:21): [True: 2.88k, False: 3.97k]
  ------------------
  494|  2.88k|                    doc = result;
  495|  6.86k|                break;
  496|  49.8k|            }
  497|       |
  498|  7.58k|            case OP_EXPAND:
  ------------------
  |  Branch (498:13): [True: 7.58k, False: 715k]
  ------------------
  499|  7.58k|                startOp("Expand");
  500|  7.58k|                xmlTextReaderExpand(reader);
  501|  7.58k|                break;
  502|       |
  503|  18.3k|            case OP_NEXT:
  ------------------
  |  Branch (503:13): [True: 18.3k, False: 704k]
  ------------------
  504|  18.3k|                startOp("Next");
  505|  18.3k|                xmlTextReaderNext(reader);
  506|  18.3k|                break;
  507|       |
  508|  7.35k|            case OP_NEXT_SIBLING:
  ------------------
  |  Branch (508:13): [True: 7.35k, False: 715k]
  ------------------
  509|  7.35k|                startOp("NextSibling");
  510|  7.35k|                xmlTextReaderNextSibling(reader);
  511|  7.35k|                break;
  512|       |
  513|  3.39k|            case OP_IS_VALID:
  ------------------
  |  Branch (513:13): [True: 3.39k, False: 719k]
  ------------------
  514|  3.39k|                startOp("IsValid");
  515|  3.39k|                xmlTextReaderIsValid(reader);
  516|  3.39k|                break;
  517|       |
  518|  4.10k|            case OP_CONST_XML_VERSION:
  ------------------
  |  Branch (518:13): [True: 4.10k, False: 718k]
  ------------------
  519|  4.10k|                startOp("ConstXmlVersion");
  520|  4.10k|                xmlTextReaderConstXmlVersion(reader);
  521|  4.10k|                break;
  522|       |
  523|  3.87k|            case OP_STANDALONE:
  ------------------
  |  Branch (523:13): [True: 3.87k, False: 719k]
  ------------------
  524|  3.87k|                startOp("Standalone");
  525|  3.87k|                xmlTextReaderStandalone(reader);
  526|  3.87k|                break;
  527|       |
  528|  6.13k|            case OP_BYTE_CONSUMED:
  ------------------
  |  Branch (528:13): [True: 6.13k, False: 716k]
  ------------------
  529|  6.13k|                startOp("ByteConsumed");
  530|  6.13k|                xmlTextReaderByteConsumed(reader);
  531|  6.13k|                oomReport = -1;
  532|  6.13k|                break;
  533|   722k|        }
  534|       |
  535|   722k|        if (totalStringSize > docSize * 2)
  ------------------
  |  Branch (535:13): [True: 1.46k, False: 721k]
  ------------------
  536|  1.46k|            break;
  537|   722k|    }
  538|       |
  539|  42.8k|    error = xmlTextReaderGetLastError(reader);
  540|  42.8k|    if (error->code == XML_ERR_NO_MEMORY)
  ------------------
  |  Branch (540:9): [True: 10.0k, False: 32.7k]
  ------------------
  541|  10.0k|        oomReport = 1;
  542|  42.8k|    xmlFuzzCheckFailureReport("reader", oomReport, error->code == XML_IO_EIO);
  543|       |
  544|  42.8k|    xmlFreeTextReader(reader);
  545|       |
  546|  42.8k|    if (doc != NULL)
  ------------------
  |  Branch (546:9): [True: 3.67k, False: 39.1k]
  ------------------
  547|  3.67k|        xmlFreeDoc(doc);
  548|       |
  549|  43.0k|exit:
  550|  43.0k|    xmlFuzzInjectFailure(0);
  551|  43.0k|    xmlFuzzDataCleanup();
  552|  43.0k|    xmlResetLastError();
  553|  43.0k|    return(0);
  554|  42.8k|}
reader.c:startOp:
   83|   722k|startOp(const char *name) {
   84|   722k|    (void) name;
   85|       |#ifdef DEBUG
   86|       |    fprintf(stderr, "%s\n", name);
   87|       |#endif
   88|   722k|}

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|  53.7k|__xmlDoValidityCheckingDefaultValue(void) {
  634|  53.7k|    return(&xmlGetThreadLocalStorage(0)->doValidityCheckingDefaultValue);
  635|  53.7k|}
__xmlGetWarningsDefaultValue:
  638|   765k|__xmlGetWarningsDefaultValue(void) {
  639|   765k|    return(&xmlGetThreadLocalStorage(0)->getWarningsDefaultValue);
  640|   765k|}
__xmlKeepBlanksDefaultValue:
  643|  53.7k|__xmlKeepBlanksDefaultValue(void) {
  644|  53.7k|    return(&xmlGetThreadLocalStorage(0)->keepBlanksDefaultValue);
  645|  53.7k|}
__xmlLoadExtDtdDefaultValue:
  653|  53.7k|__xmlLoadExtDtdDefaultValue(void) {
  654|  53.7k|    return(&xmlGetThreadLocalStorage(0)->loadExtDtdDefaultValue);
  655|  53.7k|}
__xmlPedanticParserDefaultValue:
  658|  53.7k|__xmlPedanticParserDefaultValue(void) {
  659|  53.7k|    return(&xmlGetThreadLocalStorage(0)->pedanticParserDefaultValue);
  660|  53.7k|}
__xmlSubstituteEntitiesDefaultValue:
  663|  53.7k|__xmlSubstituteEntitiesDefaultValue(void) {
  664|  53.7k|    return(&xmlGetThreadLocalStorage(0)->substituteEntitiesDefaultValue);
  665|  53.7k|}
__xmlTreeIndentString:
  674|  42.6k|__xmlTreeIndentString(void) {
  675|  42.6k|    return(&xmlGetThreadLocalStorage(0)->treeIndentString);
  676|  42.6k|}
__xmlSaveNoEmptyTags:
  679|  42.6k|__xmlSaveNoEmptyTags(void) {
  680|  42.6k|    return(&xmlGetThreadLocalStorage(0)->saveNoEmptyTags);
  681|  42.6k|}
__xmlStructuredError:
  695|   431k|__xmlStructuredError(void) {
  696|   431k|    return(&xmlGetThreadLocalStorage(0)->structuredError);
  697|   431k|}
xmlGetLocalRngState:
  755|   143k|xmlGetLocalRngState(void) {
  756|   143k|    return(xmlGetThreadLocalStorage(0)->localRngState);
  757|   143k|}
xmlGetLastErrorInternal:
  785|   799k|xmlGetLastErrorInternal(void) {
  786|   799k|    return(&xmlGetThreadLocalStorage(0)->lastError);
  787|   799k|}
globals.c:xmlPosixStrdup:
  200|   693k|xmlPosixStrdup(const char *cur) {
  201|   693k|    return((char*) xmlCharStrdup(cur));
  202|   693k|}
globals.c:xmlGetThreadLocalStorage:
  525|  2.49M|xmlGetThreadLocalStorage(int allowFailure) {
  526|  2.49M|    xmlGlobalState *gs;
  527|       |
  528|  2.49M|    (void) allowFailure;
  529|       |
  530|  2.49M|    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.49M|    if (gs == NULL)
  ------------------
  |  Branch (538:9): [True: 1, False: 2.49M]
  ------------------
  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.49M|    return(gs);
  549|  2.49M|}
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|  89.7k|xmlHashCreate(int size) {
  159|  89.7k|    xmlHashTablePtr hash;
  160|       |
  161|  89.7k|    xmlInitParser();
  162|       |
  163|  89.7k|    hash = xmlMalloc(sizeof(*hash));
  164|  89.7k|    if (hash == NULL)
  ------------------
  |  Branch (164:9): [True: 46, False: 89.6k]
  ------------------
  165|     46|        return(NULL);
  166|  89.6k|    hash->dict = NULL;
  167|  89.6k|    hash->size = 0;
  168|  89.6k|    hash->table = NULL;
  169|  89.6k|    hash->nbElems = 0;
  170|  89.6k|    hash->randomSeed = xmlRandom();
  171|  89.6k|#ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
  172|  89.6k|    hash->randomSeed = 0;
  173|  89.6k|#endif
  174|       |
  175|       |    /*
  176|       |     * Unless a larger size is passed, the backing table is created
  177|       |     * lazily with MIN_HASH_SIZE capacity. In practice, there are many
  178|       |     * hash tables which are never filled.
  179|       |     */
  180|  89.6k|    if (size > MIN_HASH_SIZE) {
  ------------------
  |  |   30|  89.6k|#define MIN_HASH_SIZE 8
  ------------------
  |  Branch (180:9): [True: 7.40k, False: 82.2k]
  ------------------
  181|  7.40k|        unsigned newSize = MIN_HASH_SIZE * 2;
  ------------------
  |  |   30|  7.40k|#define MIN_HASH_SIZE 8
  ------------------
  182|       |
  183|  7.53k|        while ((newSize < (unsigned) size) && (newSize < MAX_HASH_SIZE))
  ------------------
  |  |   31|    124|#define MAX_HASH_SIZE (1u << 31)
  ------------------
  |  Branch (183:16): [True: 124, False: 7.40k]
  |  Branch (183:47): [True: 124, False: 0]
  ------------------
  184|    124|            newSize *= 2;
  185|       |
  186|  7.40k|        if (xmlHashGrow(hash, newSize) != 0) {
  ------------------
  |  Branch (186:13): [True: 2, False: 7.40k]
  ------------------
  187|      2|            xmlFree(hash);
  188|      2|            return(NULL);
  189|      2|        }
  190|  7.40k|    }
  191|       |
  192|  89.6k|    return(hash);
  193|  89.6k|}
xmlHashCreateDict:
  205|  30.9k|xmlHashCreateDict(int size, xmlDict *dict) {
  206|  30.9k|    xmlHashTablePtr hash;
  207|       |
  208|  30.9k|    hash = xmlHashCreate(size);
  209|  30.9k|    if (hash != NULL) {
  ------------------
  |  Branch (209:9): [True: 30.9k, False: 24]
  ------------------
  210|  30.9k|        hash->dict = dict;
  211|  30.9k|        xmlDictReference(dict);
  212|  30.9k|    }
  213|  30.9k|    return(hash);
  214|  30.9k|}
xmlHashFree:
  224|   112k|xmlHashFree(xmlHashTable *hash, xmlHashDeallocator dealloc) {
  225|   112k|    if (hash == NULL)
  ------------------
  |  Branch (225:9): [True: 23.0k, False: 89.6k]
  ------------------
  226|  23.0k|        return;
  227|       |
  228|  89.6k|    if (hash->table) {
  ------------------
  |  Branch (228:9): [True: 89.2k, False: 393]
  ------------------
  229|  89.2k|        const xmlHashEntry *end = &hash->table[hash->size];
  230|  89.2k|        const xmlHashEntry *entry;
  231|       |
  232|   955k|        for (entry = hash->table; entry < end; entry++) {
  ------------------
  |  Branch (232:35): [True: 866k, False: 89.2k]
  ------------------
  233|   866k|            if (entry->hashValue == 0)
  ------------------
  |  Branch (233:17): [True: 681k, False: 184k]
  ------------------
  234|   681k|                continue;
  235|   184k|            if ((dealloc != NULL) && (entry->payload != NULL))
  ------------------
  |  Branch (235:17): [True: 161k, False: 23.4k]
  |  Branch (235:38): [True: 161k, False: 0]
  ------------------
  236|   161k|                dealloc(entry->payload, entry->key);
  237|   184k|            if (hash->dict == NULL) {
  ------------------
  |  Branch (237:17): [True: 110k, False: 74.4k]
  ------------------
  238|   110k|                if (entry->key)
  ------------------
  |  Branch (238:21): [True: 110k, False: 0]
  ------------------
  239|   110k|                    xmlFree(entry->key);
  240|   110k|                if (entry->key2)
  ------------------
  |  Branch (240:21): [True: 6.86k, False: 103k]
  ------------------
  241|  6.86k|                    xmlFree(entry->key2);
  242|   110k|                if (entry->key3)
  ------------------
  |  Branch (242:21): [True: 19.5k, False: 90.6k]
  ------------------
  243|  19.5k|                    xmlFree(entry->key3);
  244|   110k|            }
  245|   184k|        }
  246|       |
  247|  89.2k|        xmlFree(hash->table);
  248|  89.2k|    }
  249|       |
  250|  89.6k|    if (hash->dict)
  ------------------
  |  Branch (250:9): [True: 21.0k, False: 68.6k]
  ------------------
  251|  21.0k|        xmlDictFree(hash->dict);
  252|       |
  253|  89.6k|    xmlFree(hash);
  254|  89.6k|}
xmlHashDefaultDeallocator:
  592|  62.3k|xmlHashDefaultDeallocator(void *entry, const xmlChar *key ATTRIBUTE_UNUSED) {
  593|  62.3k|    xmlFree(entry);
  594|  62.3k|}
xmlHashAdd:
  610|   147k|xmlHashAdd(xmlHashTable *hash, const xmlChar *key, void *payload) {
  611|   147k|    return(xmlHashUpdateInternal(hash, key, NULL, NULL, payload, NULL, 0));
  612|   147k|}
xmlHashAdd2:
  629|  78.7k|                 const xmlChar *key2, void *payload) {
  630|  78.7k|    return(xmlHashUpdateInternal(hash, key, key2, NULL, payload, NULL, 0));
  631|  78.7k|}
xmlHashAdd3:
  650|  95.1k|                 void *payload) {
  651|       |    return(xmlHashUpdateInternal(hash, key, key2, key3, payload, NULL, 0));
  652|  95.1k|}
xmlHashAddEntry:
  669|  62.2k|xmlHashAddEntry(xmlHashTable *hash, const xmlChar *key, void *payload) {
  670|  62.2k|    int res = xmlHashUpdateInternal(hash, key, NULL, NULL, payload, NULL, 0);
  671|       |
  672|  62.2k|    if (res == 0)
  ------------------
  |  Branch (672:9): [True: 0, False: 62.2k]
  ------------------
  673|      0|        res = -1;
  674|  62.2k|    else if (res == 1)
  ------------------
  |  Branch (674:14): [True: 62.1k, False: 14]
  ------------------
  675|  62.1k|        res = 0;
  676|       |
  677|  62.2k|    return(res);
  678|  62.2k|}
xmlHashUpdateEntry:
  742|    615|                   void *payload, xmlHashDeallocator dealloc) {
  743|    615|    int res = xmlHashUpdateInternal(hash, key, NULL, NULL, payload,
  744|    615|                                    dealloc, 1);
  745|       |
  746|    615|    if (res == 1)
  ------------------
  |  Branch (746:9): [True: 66, False: 549]
  ------------------
  747|     66|        res = 0;
  748|       |
  749|    615|    return(res);
  750|    615|}
xmlHashUpdateEntry2:
  767|  4.50k|                   xmlHashDeallocator dealloc) {
  768|  4.50k|    int res = xmlHashUpdateInternal(hash, key, key2, NULL, payload,
  769|  4.50k|                                    dealloc, 1);
  770|       |
  771|  4.50k|    if (res == 1)
  ------------------
  |  Branch (771:9): [True: 3.75k, False: 755]
  ------------------
  772|  3.75k|        res = 0;
  773|       |
  774|  4.50k|    return(res);
  775|  4.50k|}
xmlHashLookup:
  811|  2.95M|xmlHashLookup(xmlHashTable *hash, const xmlChar *key) {
  812|  2.95M|    return(xmlHashLookup3(hash, key, NULL, NULL));
  813|  2.95M|}
xmlHashLookup2:
  825|   783k|              const xmlChar *key2) {
  826|       |    return(xmlHashLookup3(hash, key, key2, NULL));
  827|   783k|}
xmlHashQLookup2:
  856|  26.9k|                const xmlChar *name2) {
  857|  26.9k|    return(xmlHashQLookup3(hash, prefix, name, prefix2, name2, NULL, NULL));
  858|  26.9k|}
xmlHashLookup3:
  871|  4.45M|               const xmlChar *key2, const xmlChar *key3) {
  872|  4.45M|    const xmlHashEntry *entry;
  873|  4.45M|    unsigned hashValue;
  874|  4.45M|    int found;
  875|       |
  876|  4.45M|    if ((hash == NULL) || (hash->size == 0) || (key == NULL))
  ------------------
  |  Branch (876:9): [True: 12.5k, False: 4.44M]
  |  Branch (876:27): [True: 56.1k, False: 4.38M]
  |  Branch (876:48): [True: 9, False: 4.38M]
  ------------------
  877|  68.6k|        return(NULL);
  878|  4.38M|    hashValue = xmlHashValue(hash->randomSeed, key, key2, key3, NULL);
  879|  4.38M|    entry = xmlHashFindEntry(hash, key, key2, key3, hashValue, &found);
  880|  4.38M|    if (found)
  ------------------
  |  Branch (880:9): [True: 3.48M, False: 906k]
  ------------------
  881|  3.48M|        return(entry->payload);
  882|   906k|    return(NULL);
  883|  4.38M|}
xmlHashQLookup3:
  902|  26.9k|                const xmlChar *prefix3, const xmlChar *name3) {
  903|  26.9k|    const xmlHashEntry *entry;
  904|  26.9k|    unsigned hashValue, mask, pos, displ;
  905|       |
  906|  26.9k|    if ((hash == NULL) || (hash->size == 0) || (name == NULL))
  ------------------
  |  Branch (906:9): [True: 0, False: 26.9k]
  |  Branch (906:27): [True: 0, False: 26.9k]
  |  Branch (906:48): [True: 0, False: 26.9k]
  ------------------
  907|      0|        return(NULL);
  908|       |
  909|  26.9k|    hashValue = xmlHashQNameValue(hash->randomSeed, prefix, name, prefix2,
  910|  26.9k|                                  name2, prefix3, name3);
  911|  26.9k|    mask = hash->size - 1;
  912|  26.9k|    pos = hashValue & mask;
  913|  26.9k|    entry = &hash->table[pos];
  914|       |
  915|  26.9k|    if (entry->hashValue != 0) {
  ------------------
  |  Branch (915:9): [True: 8.74k, False: 18.1k]
  ------------------
  916|  8.74k|        displ = 0;
  917|  8.74k|        hashValue |= MAX_HASH_SIZE;
  ------------------
  |  |   31|  8.74k|#define MAX_HASH_SIZE (1u << 31)
  ------------------
  918|       |
  919|  9.50k|        do {
  920|  9.50k|            if ((hashValue == entry->hashValue) &&
  ------------------
  |  Branch (920:17): [True: 5.26k, False: 4.24k]
  ------------------
  921|  5.26k|                (xmlStrQEqual(prefix, name, entry->key)) &&
  ------------------
  |  Branch (921:17): [True: 5.26k, False: 0]
  ------------------
  922|  5.26k|                (xmlStrQEqual(prefix2, name2, entry->key2)) &&
  ------------------
  |  Branch (922:17): [True: 5.26k, False: 0]
  ------------------
  923|  5.26k|                (xmlStrQEqual(prefix3, name3, entry->key3)))
  ------------------
  |  Branch (923:17): [True: 5.26k, False: 0]
  ------------------
  924|  5.26k|                return(entry->payload);
  925|       |
  926|  4.24k|            displ++;
  927|  4.24k|            pos++;
  928|  4.24k|            entry++;
  929|  4.24k|            if ((pos & mask) == 0)
  ------------------
  |  Branch (929:17): [True: 268, False: 3.97k]
  ------------------
  930|    268|                entry = hash->table;
  931|  4.24k|        } while ((entry->hashValue != 0) &&
  ------------------
  |  Branch (931:18): [True: 1.47k, False: 2.76k]
  ------------------
  932|  1.47k|                 (((pos - entry->hashValue) & mask) >= displ));
  ------------------
  |  Branch (932:18): [True: 764, False: 715]
  ------------------
  933|  8.74k|    }
  934|       |
  935|  21.6k|    return(NULL);
  936|  26.9k|}
xmlHashScan:
  959|  8.45k|xmlHashScan(xmlHashTable *hash, xmlHashScanner scan, void *data) {
  960|  8.45k|    stubData sdata;
  961|  8.45k|    sdata.data = data;
  962|  8.45k|    sdata.scan = scan;
  963|  8.45k|    xmlHashScanFull(hash, stubHashScannerFull, &sdata);
  964|  8.45k|}
xmlHashScanFull:
  974|  12.2k|xmlHashScanFull(xmlHashTable *hash, xmlHashScannerFull scan, void *data) {
  975|  12.2k|    const xmlHashEntry *entry, *end;
  976|  12.2k|    xmlHashEntry old;
  977|  12.2k|    unsigned i;
  978|       |
  979|  12.2k|    if ((hash == NULL) || (hash->size == 0) || (scan == NULL))
  ------------------
  |  Branch (979:9): [True: 477, False: 11.7k]
  |  Branch (979:27): [True: 0, False: 11.7k]
  |  Branch (979:48): [True: 0, False: 11.7k]
  ------------------
  980|    477|        return;
  981|       |
  982|       |    /*
  983|       |     * We must handle the case that a scanned entry is removed when executing
  984|       |     * the callback (xmlCleanSpecialAttr and possibly other places).
  985|       |     *
  986|       |     * Find the start of a probe sequence to avoid scanning entries twice if
  987|       |     * a deletion happens.
  988|       |     */
  989|  11.7k|    entry = hash->table;
  990|  11.7k|    end = &hash->table[hash->size];
  991|  15.5k|    while (entry->hashValue != 0) {
  ------------------
  |  Branch (991:12): [True: 3.74k, False: 11.7k]
  ------------------
  992|  3.74k|        if (++entry >= end)
  ------------------
  |  Branch (992:13): [True: 0, False: 3.74k]
  ------------------
  993|      0|            entry = hash->table;
  994|  3.74k|    }
  995|       |
  996|   180k|    for (i = 0; i < hash->size; i++) {
  ------------------
  |  Branch (996:17): [True: 168k, False: 11.7k]
  ------------------
  997|   168k|        if ((entry->hashValue != 0) && (entry->payload != NULL)) {
  ------------------
  |  Branch (997:13): [True: 44.6k, False: 124k]
  |  Branch (997:40): [True: 44.6k, False: 0]
  ------------------
  998|       |            /*
  999|       |             * Make sure to rescan after a possible deletion.
 1000|       |             */
 1001|  45.2k|            do {
 1002|  45.2k|                old = *entry;
 1003|  45.2k|                scan(entry->payload, data, entry->key, entry->key2, entry->key3);
 1004|  45.2k|            } while ((entry->hashValue != 0) &&
  ------------------
  |  Branch (1004:22): [True: 44.1k, False: 1.10k]
  ------------------
 1005|  44.1k|                     (entry->payload != NULL) &&
  ------------------
  |  Branch (1005:22): [True: 44.1k, False: 0]
  ------------------
 1006|  44.1k|                     ((entry->key != old.key) ||
  ------------------
  |  Branch (1006:23): [True: 553, False: 43.5k]
  ------------------
 1007|  43.5k|                      (entry->key2 != old.key2) ||
  ------------------
  |  Branch (1007:23): [True: 58, False: 43.5k]
  ------------------
 1008|  43.5k|                      (entry->key3 != old.key3)));
  ------------------
  |  Branch (1008:23): [True: 0, False: 43.5k]
  ------------------
 1009|  44.6k|        }
 1010|   168k|        if (++entry >= end)
  ------------------
  |  Branch (1010:13): [True: 11.7k, False: 157k]
  ------------------
 1011|  11.7k|            entry = hash->table;
 1012|   168k|    }
 1013|  11.7k|}
xmlHashScan3:
 1030|  1.24k|             xmlHashScanner scan, void *data) {
 1031|  1.24k|    stubData sdata;
 1032|  1.24k|    sdata.data = data;
 1033|  1.24k|    sdata.scan = scan;
 1034|  1.24k|    xmlHashScanFull3(hash, key, key2, key3, stubHashScannerFull, &sdata);
 1035|  1.24k|}
xmlHashScanFull3:
 1052|  1.24k|                 xmlHashScannerFull scan, void *data) {
 1053|  1.24k|    const xmlHashEntry *entry, *end;
 1054|  1.24k|    xmlHashEntry old;
 1055|  1.24k|    unsigned i;
 1056|       |
 1057|  1.24k|    if ((hash == NULL) || (hash->size == 0) || (scan == NULL))
  ------------------
  |  Branch (1057:9): [True: 568, False: 673]
  |  Branch (1057:27): [True: 0, False: 673]
  |  Branch (1057:48): [True: 0, False: 673]
  ------------------
 1058|    568|        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|    673|    entry = hash->table;
 1068|    673|    end = &hash->table[hash->size];
 1069|  1.32k|    while (entry->hashValue != 0) {
  ------------------
  |  Branch (1069:12): [True: 648, False: 673]
  ------------------
 1070|    648|        if (++entry >= end)
  ------------------
  |  Branch (1070:13): [True: 0, False: 648]
  ------------------
 1071|      0|            entry = hash->table;
 1072|    648|    }
 1073|       |
 1074|   276k|    for (i = 0; i < hash->size; i++) {
  ------------------
  |  Branch (1074:17): [True: 276k, False: 673]
  ------------------
 1075|   276k|        if ((entry->hashValue != 0) && (entry->payload != NULL)) {
  ------------------
  |  Branch (1075:13): [True: 143k, False: 132k]
  |  Branch (1075:40): [True: 143k, False: 0]
  ------------------
 1076|       |            /*
 1077|       |             * Make sure to rescan after a possible deletion.
 1078|       |             */
 1079|   143k|            do {
 1080|   143k|                if (((key != NULL) && (strcmp((const char *) key,
  ------------------
  |  Branch (1080:22): [True: 0, False: 143k]
  |  Branch (1080:39): [True: 0, False: 0]
  ------------------
 1081|      0|                                              (const char *) entry->key) != 0)) ||
 1082|   143k|                    ((key2 != NULL) && (!xmlFastStrEqual(key2, entry->key2))) ||
  ------------------
  |  Branch (1082:22): [True: 0, False: 143k]
  |  Branch (1082:40): [True: 0, False: 0]
  ------------------
 1083|   143k|                    ((key3 != NULL) && (!xmlFastStrEqual(key3, entry->key3))))
  ------------------
  |  Branch (1083:22): [True: 143k, False: 0]
  |  Branch (1083:40): [True: 143k, False: 117]
  ------------------
 1084|   143k|                    break;
 1085|    117|                old = *entry;
 1086|    117|                scan(entry->payload, data, entry->key, entry->key2, entry->key3);
 1087|    117|            } while ((entry->hashValue != 0) &&
  ------------------
  |  Branch (1087:22): [True: 117, False: 0]
  ------------------
 1088|    117|                     (entry->payload != NULL) &&
  ------------------
  |  Branch (1088:22): [True: 117, False: 0]
  ------------------
 1089|    117|                     ((entry->key != old.key) ||
  ------------------
  |  Branch (1089:23): [True: 0, False: 117]
  ------------------
 1090|    117|                      (entry->key2 != old.key2) ||
  ------------------
  |  Branch (1090:23): [True: 0, False: 117]
  ------------------
 1091|    117|                      (entry->key3 != old.key3)));
  ------------------
  |  Branch (1091:23): [True: 0, False: 117]
  ------------------
 1092|   143k|        }
 1093|   276k|        if (++entry >= end)
  ------------------
  |  Branch (1093:13): [True: 673, False: 275k]
  ------------------
 1094|    673|            entry = hash->table;
 1095|   276k|    }
 1096|    673|}
xmlHashCopySafe:
 1111|  14.3k|                xmlHashDeallocator deallocFunc) {
 1112|  14.3k|    const xmlHashEntry *entry, *end;
 1113|  14.3k|    xmlHashTablePtr ret;
 1114|       |
 1115|  14.3k|    if ((hash == NULL) || (copyFunc == NULL))
  ------------------
  |  Branch (1115:9): [True: 0, False: 14.3k]
  |  Branch (1115:27): [True: 0, False: 14.3k]
  ------------------
 1116|      0|        return(NULL);
 1117|       |
 1118|  14.3k|    ret = xmlHashCreate(hash->size);
 1119|  14.3k|    if (ret == NULL)
  ------------------
  |  Branch (1119:9): [True: 17, False: 14.2k]
  ------------------
 1120|     17|        return(NULL);
 1121|       |
 1122|  14.2k|    if (hash->size == 0)
  ------------------
  |  Branch (1122:9): [True: 0, False: 14.2k]
  ------------------
 1123|      0|        return(ret);
 1124|       |
 1125|  14.2k|    end = &hash->table[hash->size];
 1126|       |
 1127|   132k|    for (entry = hash->table; entry < end; entry++) {
  ------------------
  |  Branch (1127:31): [True: 118k, False: 13.9k]
  ------------------
 1128|   118k|        if (entry->hashValue != 0) {
  ------------------
  |  Branch (1128:13): [True: 24.2k, False: 94.0k]
  ------------------
 1129|  24.2k|            void *copy;
 1130|       |
 1131|  24.2k|            copy = copyFunc(entry->payload, entry->key);
 1132|  24.2k|            if (copy == NULL)
  ------------------
  |  Branch (1132:17): [True: 224, False: 24.0k]
  ------------------
 1133|    224|                goto error;
 1134|  24.0k|            if (xmlHashAdd3(ret, entry->key, entry->key2, entry->key3,
  ------------------
  |  Branch (1134:17): [True: 95, False: 23.9k]
  ------------------
 1135|  24.0k|                            copy) <= 0) {
 1136|     95|                if (deallocFunc != NULL)
  ------------------
  |  Branch (1136:21): [True: 95, False: 0]
  ------------------
 1137|     95|                    deallocFunc(copy, entry->key);
 1138|     95|                goto error;
 1139|     95|            }
 1140|  24.0k|        }
 1141|   118k|    }
 1142|       |
 1143|  13.9k|    return(ret);
 1144|       |
 1145|    319|error:
 1146|    319|    xmlHashFree(ret, deallocFunc);
 1147|       |    return(NULL);
 1148|  14.2k|}
xmlHashSize:
 1173|  3.81k|xmlHashSize(xmlHashTable *hash) {
 1174|  3.81k|    if (hash == NULL)
  ------------------
  |  Branch (1174:9): [True: 0, False: 3.81k]
  ------------------
 1175|      0|        return(-1);
 1176|  3.81k|    return(hash->nbElems);
 1177|  3.81k|}
xmlHashRemoveEntry:
 1189|  2.91k|                       xmlHashDeallocator dealloc) {
 1190|  2.91k|    return(xmlHashRemoveEntry3(hash, key, NULL, NULL, dealloc));
 1191|  2.91k|}
xmlHashRemoveEntry2:
 1206|  1.90k|                    const xmlChar *key2, xmlHashDeallocator dealloc) {
 1207|       |    return(xmlHashRemoveEntry3(hash, key, key2, NULL, dealloc));
 1208|  1.90k|}
xmlHashRemoveEntry3:
 1226|  4.81k|                    xmlHashDeallocator dealloc) {
 1227|  4.81k|    xmlHashEntry *entry, *cur, *next;
 1228|  4.81k|    unsigned hashValue, mask, pos, nextpos;
 1229|  4.81k|    int found;
 1230|       |
 1231|  4.81k|    if ((hash == NULL) || (hash->size == 0) || (key == NULL))
  ------------------
  |  Branch (1231:9): [True: 0, False: 4.81k]
  |  Branch (1231:27): [True: 0, False: 4.81k]
  |  Branch (1231:48): [True: 0, False: 4.81k]
  ------------------
 1232|      0|        return(-1);
 1233|       |
 1234|  4.81k|    hashValue = xmlHashValue(hash->randomSeed, key, key2, key3, NULL);
 1235|  4.81k|    entry = xmlHashFindEntry(hash, key, key2, key3, hashValue, &found);
 1236|  4.81k|    if (!found)
  ------------------
  |  Branch (1236:9): [True: 0, False: 4.81k]
  ------------------
 1237|      0|        return(-1);
 1238|       |
 1239|  4.81k|    if ((dealloc != NULL) && (entry->payload != NULL))
  ------------------
  |  Branch (1239:9): [True: 2.91k, False: 1.90k]
  |  Branch (1239:30): [True: 2.91k, False: 0]
  ------------------
 1240|  2.91k|        dealloc(entry->payload, entry->key);
 1241|  4.81k|    if (hash->dict == NULL) {
  ------------------
  |  Branch (1241:9): [True: 2.98k, False: 1.82k]
  ------------------
 1242|  2.98k|        if (entry->key)
  ------------------
  |  Branch (1242:13): [True: 2.98k, False: 0]
  ------------------
 1243|  2.98k|            xmlFree(entry->key);
 1244|  2.98k|        if (entry->key2)
  ------------------
  |  Branch (1244:13): [True: 4, False: 2.98k]
  ------------------
 1245|      4|            xmlFree(entry->key2);
 1246|  2.98k|        if (entry->key3)
  ------------------
  |  Branch (1246:13): [True: 0, False: 2.98k]
  ------------------
 1247|      0|            xmlFree(entry->key3);
 1248|  2.98k|    }
 1249|       |
 1250|       |    /*
 1251|       |     * Find end of probe sequence. Entries at their initial probe
 1252|       |     * position start a new sequence.
 1253|       |     */
 1254|  4.81k|    mask = hash->size - 1;
 1255|  4.81k|    pos = entry - hash->table;
 1256|  4.81k|    cur = entry;
 1257|       |
 1258|  9.26k|    while (1) {
  ------------------
  |  Branch (1258:12): [True: 9.26k, Folded]
  ------------------
 1259|  9.26k|        nextpos = pos + 1;
 1260|  9.26k|        next = cur + 1;
 1261|  9.26k|        if ((nextpos & mask) == 0)
  ------------------
  |  Branch (1261:13): [True: 901, False: 8.36k]
  ------------------
 1262|    901|            next = hash->table;
 1263|       |
 1264|  9.26k|        if ((next->hashValue == 0) ||
  ------------------
  |  Branch (1264:13): [True: 3.46k, False: 5.80k]
  ------------------
 1265|  5.80k|            (((next->hashValue - nextpos) & mask) == 0))
  ------------------
  |  Branch (1265:13): [True: 1.35k, False: 4.45k]
  ------------------
 1266|  4.81k|            break;
 1267|       |
 1268|  4.45k|        cur = next;
 1269|  4.45k|        pos = nextpos;
 1270|  4.45k|    }
 1271|       |
 1272|       |    /*
 1273|       |     * Backward shift
 1274|       |     */
 1275|  4.81k|    next = entry + 1;
 1276|       |
 1277|  4.81k|    if (cur < entry) {
  ------------------
  |  Branch (1277:9): [True: 381, False: 4.43k]
  ------------------
 1278|    381|        xmlHashEntry *end = &hash->table[hash->size];
 1279|       |
 1280|    381|        memmove(entry, next, (char *) end - (char *) next);
 1281|    381|        entry = hash->table;
 1282|    381|        end[-1] = *entry;
 1283|    381|        next = entry + 1;
 1284|    381|    }
 1285|       |
 1286|  4.81k|    memmove(entry, next, (char *) cur - (char *) entry);
 1287|       |
 1288|       |    /*
 1289|       |     * Update entry
 1290|       |     */
 1291|  4.81k|    cur->hashValue = 0;
 1292|       |
 1293|  4.81k|    hash->nbElems--;
 1294|       |
 1295|  4.81k|    return(0);
 1296|  4.81k|}
hash.c:xmlHashGrow:
  345|  91.9k|xmlHashGrow(xmlHashTablePtr hash, unsigned size) {
  346|  91.9k|    const xmlHashEntry *oldentry, *oldend, *end;
  347|  91.9k|    xmlHashEntry *table;
  348|  91.9k|    unsigned oldsize, i;
  349|       |
  350|       |    /* Add 0 to avoid spurious -Wtype-limits warning on 64-bit GCC */
  351|  91.9k|    if ((size_t) size + 0 > SIZE_MAX / sizeof(table[0]))
  ------------------
  |  Branch (351:9): [True: 0, False: 91.9k]
  ------------------
  352|      0|        return(-1);
  353|  91.9k|    table = xmlMalloc(size * sizeof(table[0]));
  354|  91.9k|    if (table == NULL)
  ------------------
  |  Branch (354:9): [True: 48, False: 91.9k]
  ------------------
  355|     48|        return(-1);
  356|  91.9k|    memset(table, 0, size * sizeof(table[0]));
  357|       |
  358|  91.9k|    oldsize = hash->size;
  359|  91.9k|    if (oldsize == 0)
  ------------------
  |  Branch (359:9): [True: 89.2k, False: 2.63k]
  ------------------
  360|  89.2k|        goto done;
  361|       |
  362|  2.63k|    oldend = &hash->table[oldsize];
  363|  2.63k|    end = &table[size];
  364|       |
  365|       |    /*
  366|       |     * Robin Hood sorting order is maintained if we
  367|       |     *
  368|       |     * - compute hash indices with modulo
  369|       |     * - resize by an integer factor
  370|       |     * - start to copy from the beginning of a probe sequence
  371|       |     */
  372|  2.63k|    oldentry = hash->table;
  373|  16.6k|    while (oldentry->hashValue != 0) {
  ------------------
  |  Branch (373:12): [True: 13.9k, False: 2.63k]
  ------------------
  374|  13.9k|        if (++oldentry >= oldend)
  ------------------
  |  Branch (374:13): [True: 0, False: 13.9k]
  ------------------
  375|      0|            oldentry = hash->table;
  376|  13.9k|    }
  377|       |
  378|  93.0k|    for (i = 0; i < oldsize; i++) {
  ------------------
  |  Branch (378:17): [True: 90.4k, False: 2.63k]
  ------------------
  379|  90.4k|        if (oldentry->hashValue != 0) {
  ------------------
  |  Branch (379:13): [True: 79.1k, False: 11.3k]
  ------------------
  380|  79.1k|            xmlHashEntry *entry = &table[oldentry->hashValue & (size - 1)];
  381|       |
  382|   106k|            while (entry->hashValue != 0) {
  ------------------
  |  Branch (382:20): [True: 27.3k, False: 79.1k]
  ------------------
  383|  27.3k|                if (++entry >= end)
  ------------------
  |  Branch (383:21): [True: 422, False: 26.9k]
  ------------------
  384|    422|                    entry = table;
  385|  27.3k|            }
  386|  79.1k|            *entry = *oldentry;
  387|  79.1k|        }
  388|       |
  389|  90.4k|        if (++oldentry >= oldend)
  ------------------
  |  Branch (389:13): [True: 2.63k, False: 87.8k]
  ------------------
  390|  2.63k|            oldentry = hash->table;
  391|  90.4k|    }
  392|       |
  393|  2.63k|    xmlFree(hash->table);
  394|       |
  395|  91.9k|done:
  396|  91.9k|    hash->table = table;
  397|  91.9k|    hash->size = size;
  398|       |
  399|  91.9k|    return(0);
  400|  2.63k|}
hash.c:xmlHashUpdateInternal:
  417|   388k|                      void *payload, xmlHashDeallocator dealloc, int update) {
  418|   388k|    xmlChar *copy, *copy2, *copy3;
  419|   388k|    xmlHashEntry *entry = NULL;
  420|   388k|    size_t lengths[3] = {0, 0, 0};
  421|   388k|    unsigned hashValue, newSize;
  422|       |
  423|   388k|    if ((hash == NULL) || (key == NULL))
  ------------------
  |  Branch (423:9): [True: 0, False: 388k]
  |  Branch (423:27): [True: 0, False: 388k]
  ------------------
  424|      0|        return(-1);
  425|       |
  426|   388k|    hashValue = xmlHashValue(hash->randomSeed, key, key2, key3, lengths);
  427|       |
  428|       |    /*
  429|       |     * Check for an existing entry
  430|       |     */
  431|   388k|    if (hash->size == 0) {
  ------------------
  |  Branch (431:9): [True: 81.9k, False: 306k]
  ------------------
  432|  81.9k|        newSize = MIN_HASH_SIZE;
  ------------------
  |  |   30|  81.9k|#define MIN_HASH_SIZE 8
  ------------------
  433|   306k|    } else {
  434|   306k|        int found = 0;
  435|       |
  436|   306k|        entry = xmlHashFindEntry(hash, key, key2, key3, hashValue, &found);
  437|       |
  438|   306k|        if (found) {
  ------------------
  |  Branch (438:13): [True: 199k, False: 107k]
  ------------------
  439|   199k|            if (update) {
  ------------------
  |  Branch (439:17): [True: 1.30k, False: 197k]
  ------------------
  440|  1.30k|                if (dealloc)
  ------------------
  |  Branch (440:21): [True: 547, False: 754]
  ------------------
  441|    547|                    dealloc(entry->payload, entry->key);
  442|  1.30k|                entry->payload = payload;
  443|  1.30k|            }
  444|       |
  445|   199k|            return(0);
  446|   199k|        }
  447|       |
  448|   107k|        if (hash->nbElems + 1 > hash->size / MAX_FILL_DENOM * MAX_FILL_NUM) {
  ------------------
  |  |   29|   107k|#define MAX_FILL_DENOM 8
  ------------------
                      if (hash->nbElems + 1 > hash->size / MAX_FILL_DENOM * MAX_FILL_NUM) {
  ------------------
  |  |   28|   107k|#define MAX_FILL_NUM 7
  ------------------
  |  Branch (448:13): [True: 2.63k, False: 105k]
  ------------------
  449|       |            /* This guarantees that nbElems < INT_MAX */
  450|  2.63k|            if (hash->size >= MAX_HASH_SIZE)
  ------------------
  |  |   31|  2.63k|#define MAX_HASH_SIZE (1u << 31)
  ------------------
  |  Branch (450:17): [True: 0, False: 2.63k]
  ------------------
  451|      0|                return(-1);
  452|  2.63k|            newSize = hash->size * 2;
  453|   105k|        } else {
  454|   105k|            newSize = 0;
  455|   105k|        }
  456|   107k|    }
  457|       |
  458|       |    /*
  459|       |     * Grow the hash table if needed
  460|       |     */
  461|   189k|    if (newSize > 0) {
  ------------------
  |  Branch (461:9): [True: 84.5k, False: 105k]
  ------------------
  462|  84.5k|        unsigned mask, displ, pos;
  463|       |
  464|  84.5k|        if (xmlHashGrow(hash, newSize) != 0)
  ------------------
  |  Branch (464:13): [True: 46, False: 84.5k]
  ------------------
  465|     46|            return(-1);
  466|       |
  467|       |        /*
  468|       |         * Find new entry
  469|       |         */
  470|  84.5k|        mask = hash->size - 1;
  471|  84.5k|        displ = 0;
  472|  84.5k|        pos = hashValue & mask;
  473|  84.5k|        entry = &hash->table[pos];
  474|       |
  475|  84.5k|        if (entry->hashValue != 0) {
  ------------------
  |  Branch (475:13): [True: 1.12k, False: 83.4k]
  ------------------
  476|  1.56k|            do {
  477|  1.56k|                displ++;
  478|  1.56k|                pos++;
  479|  1.56k|                entry++;
  480|  1.56k|                if ((pos & mask) == 0)
  ------------------
  |  Branch (480:21): [True: 101, False: 1.46k]
  ------------------
  481|    101|                    entry = hash->table;
  482|  1.56k|            } while ((entry->hashValue != 0) &&
  ------------------
  |  Branch (482:22): [True: 889, False: 674]
  ------------------
  483|    889|                     ((pos - entry->hashValue) & mask) >= displ);
  ------------------
  |  Branch (483:22): [True: 442, False: 447]
  ------------------
  484|  1.12k|        }
  485|  84.5k|    }
  486|       |
  487|       |    /*
  488|       |     * Copy keys
  489|       |     */
  490|   189k|    if (hash->dict != NULL) {
  ------------------
  |  Branch (490:9): [True: 76.2k, False: 113k]
  ------------------
  491|  76.2k|        if (xmlDictOwns(hash->dict, key)) {
  ------------------
  |  Branch (491:13): [True: 76.2k, False: 0]
  ------------------
  492|  76.2k|            copy = (xmlChar *) key;
  493|  76.2k|        } else {
  494|      0|            copy = (xmlChar *) xmlDictLookup(hash->dict, key, -1);
  495|      0|            if (copy == NULL)
  ------------------
  |  Branch (495:17): [True: 0, False: 0]
  ------------------
  496|      0|                return(-1);
  497|      0|        }
  498|       |
  499|  76.2k|        if ((key2 == NULL) || (xmlDictOwns(hash->dict, key2))) {
  ------------------
  |  Branch (499:13): [True: 47.4k, False: 28.7k]
  |  Branch (499:31): [True: 28.0k, False: 681]
  ------------------
  500|  75.5k|            copy2 = (xmlChar *) key2;
  501|  75.5k|        } else {
  502|    681|            copy2 = (xmlChar *) xmlDictLookup(hash->dict, key2, -1);
  503|    681|            if (copy2 == NULL)
  ------------------
  |  Branch (503:17): [True: 1, False: 680]
  ------------------
  504|      1|                return(-1);
  505|    681|        }
  506|  76.2k|        if ((key3 == NULL) || (xmlDictOwns(hash->dict, key3))) {
  ------------------
  |  Branch (506:13): [True: 55.4k, False: 20.7k]
  |  Branch (506:31): [True: 20.7k, False: 0]
  ------------------
  507|  76.2k|            copy3 = (xmlChar *) key3;
  508|  76.2k|        } else {
  509|      0|            copy3 = (xmlChar *) xmlDictLookup(hash->dict, key3, -1);
  510|      0|            if (copy3 == NULL)
  ------------------
  |  Branch (510:17): [True: 0, False: 0]
  ------------------
  511|      0|                return(-1);
  512|      0|        }
  513|   113k|    } else {
  514|   113k|        copy = xmlMalloc(lengths[0] + 1);
  515|   113k|        if (copy == NULL)
  ------------------
  |  Branch (515:13): [True: 76, False: 113k]
  ------------------
  516|     76|            return(-1);
  517|   113k|        memcpy(copy, key, lengths[0] + 1);
  518|       |
  519|   113k|        if (key2 != NULL) {
  ------------------
  |  Branch (519:13): [True: 6.87k, False: 106k]
  ------------------
  520|  6.87k|            copy2 = xmlMalloc(lengths[1] + 1);
  521|  6.87k|            if (copy2 == NULL) {
  ------------------
  |  Branch (521:17): [True: 4, False: 6.86k]
  ------------------
  522|      4|                xmlFree(copy);
  523|      4|                return(-1);
  524|      4|            }
  525|  6.86k|            memcpy(copy2, key2, lengths[1] + 1);
  526|   106k|        } else {
  527|   106k|            copy2 = NULL;
  528|   106k|        }
  529|       |
  530|   113k|        if (key3 != NULL) {
  ------------------
  |  Branch (530:13): [True: 19.6k, False: 93.5k]
  ------------------
  531|  19.6k|            copy3 = xmlMalloc(lengths[2] + 1);
  532|  19.6k|            if (copy3 == NULL) {
  ------------------
  |  Branch (532:17): [True: 16, False: 19.5k]
  ------------------
  533|     16|                xmlFree(copy);
  534|     16|                xmlFree(copy2);
  535|     16|                return(-1);
  536|     16|            }
  537|  19.5k|            memcpy(copy3, key3, lengths[2] + 1);
  538|  93.5k|        } else {
  539|  93.5k|            copy3 = NULL;
  540|  93.5k|        }
  541|   113k|    }
  542|       |
  543|       |    /*
  544|       |     * Shift the remainder of the probe sequence to the right
  545|       |     */
  546|   189k|    if (entry->hashValue != 0) {
  ------------------
  |  Branch (546:9): [True: 22.9k, False: 166k]
  ------------------
  547|  22.9k|        const xmlHashEntry *end = &hash->table[hash->size];
  548|  22.9k|        const xmlHashEntry *cur = entry;
  549|       |
  550|   114k|        do {
  551|   114k|            cur++;
  552|   114k|            if (cur >= end)
  ------------------
  |  Branch (552:17): [True: 2.76k, False: 111k]
  ------------------
  553|  2.76k|                cur = hash->table;
  554|   114k|        } while (cur->hashValue != 0);
  ------------------
  |  Branch (554:18): [True: 91.6k, False: 22.9k]
  ------------------
  555|       |
  556|  22.9k|        if (cur < entry) {
  ------------------
  |  Branch (556:13): [True: 2.76k, False: 20.2k]
  ------------------
  557|       |            /*
  558|       |             * If we traversed the end of the buffer, handle the part
  559|       |             * at the start of the buffer.
  560|       |             */
  561|  2.76k|            memmove(&hash->table[1], hash->table,
  562|  2.76k|                    (char *) cur - (char *) hash->table);
  563|  2.76k|            cur = end - 1;
  564|  2.76k|            hash->table[0] = *cur;
  565|  2.76k|        }
  566|       |
  567|  22.9k|        memmove(&entry[1], entry, (char *) cur - (char *) entry);
  568|  22.9k|    }
  569|       |
  570|       |    /*
  571|       |     * Populate entry
  572|       |     */
  573|   189k|    entry->key = copy;
  574|   189k|    entry->key2 = copy2;
  575|   189k|    entry->key3 = copy3;
  576|   189k|    entry->payload = payload;
  577|       |    /* OR with MAX_HASH_SIZE to make sure that the value is non-zero */
  578|   189k|    entry->hashValue = hashValue | MAX_HASH_SIZE;
  ------------------
  |  |   31|   189k|#define MAX_HASH_SIZE (1u << 31)
  ------------------
  579|       |
  580|   189k|    hash->nbElems++;
  581|       |
  582|   189k|    return(1);
  583|   189k|}
hash.c:xmlHashValue:
   62|  4.78M|             const xmlChar *key3, size_t *lengths) {
   63|  4.78M|    unsigned h1, h2;
   64|  4.78M|    size_t i;
   65|       |
   66|  4.78M|    HASH_INIT(h1, h2, seed);
  ------------------
  |  |   23|  4.78M|    do { \
  |  |   24|  4.78M|        h1 = seed ^ 0x3b00; \
  |  |   25|  4.78M|        h2 = HASH_ROL(seed, 15); \
  |  |  ------------------
  |  |  |  |   12|  4.78M|#define HASH_ROL(x,n) ((x) << (n) | ((x) & 0xFFFFFFFF) >> (32 - (n)))
  |  |  ------------------
  |  |   26|  4.78M|    } while (0)
  |  |  ------------------
  |  |  |  Branch (26:14): [Folded, False: 4.78M]
  |  |  ------------------
  ------------------
   67|       |
   68|  50.5M|    for (i = 0; key[i] != 0; i++) {
  ------------------
  |  Branch (68:17): [True: 45.7M, False: 4.78M]
  ------------------
   69|  45.7M|        HASH_UPDATE(h1, h2, key[i]);
  ------------------
  |  |   29|  45.7M|    do { \
  |  |   30|  45.7M|        h1 += ch; \
  |  |   31|  45.7M|        h1 += h1 << 3; \
  |  |   32|  45.7M|        h2 += h1; \
  |  |   33|  45.7M|        h2 = HASH_ROL(h2, 7); \
  |  |  ------------------
  |  |  |  |   12|  45.7M|#define HASH_ROL(x,n) ((x) << (n) | ((x) & 0xFFFFFFFF) >> (32 - (n)))
  |  |  ------------------
  |  |   34|  45.7M|        h2 += h2 << 2; \
  |  |   35|  45.7M|    } while (0)
  |  |  ------------------
  |  |  |  Branch (35:14): [Folded, False: 45.7M]
  |  |  ------------------
  ------------------
   70|  45.7M|    }
   71|  4.78M|    if (lengths)
  ------------------
  |  Branch (71:9): [True: 388k, False: 4.39M]
  ------------------
   72|   388k|        lengths[0] = i;
   73|       |
   74|  4.78M|    HASH_UPDATE(h1, h2, 0);
  ------------------
  |  |   29|  4.78M|    do { \
  |  |   30|  4.78M|        h1 += ch; \
  |  |   31|  4.78M|        h1 += h1 << 3; \
  |  |   32|  4.78M|        h2 += h1; \
  |  |   33|  4.78M|        h2 = HASH_ROL(h2, 7); \
  |  |  ------------------
  |  |  |  |   12|  4.78M|#define HASH_ROL(x,n) ((x) << (n) | ((x) & 0xFFFFFFFF) >> (32 - (n)))
  |  |  ------------------
  |  |   34|  4.78M|        h2 += h2 << 2; \
  |  |   35|  4.78M|    } while (0)
  |  |  ------------------
  |  |  |  Branch (35:14): [Folded, False: 4.78M]
  |  |  ------------------
  ------------------
   75|       |
   76|  4.78M|    if (key2 != NULL) {
  ------------------
  |  Branch (76:9): [True: 212k, False: 4.56M]
  ------------------
   77|  1.23M|        for (i = 0; key2[i] != 0; i++) {
  ------------------
  |  Branch (77:21): [True: 1.01M, False: 212k]
  ------------------
   78|  1.01M|            HASH_UPDATE(h1, h2, key2[i]);
  ------------------
  |  |   29|  1.01M|    do { \
  |  |   30|  1.01M|        h1 += ch; \
  |  |   31|  1.01M|        h1 += h1 << 3; \
  |  |   32|  1.01M|        h2 += h1; \
  |  |   33|  1.01M|        h2 = HASH_ROL(h2, 7); \
  |  |  ------------------
  |  |  |  |   12|  1.01M|#define HASH_ROL(x,n) ((x) << (n) | ((x) & 0xFFFFFFFF) >> (32 - (n)))
  |  |  ------------------
  |  |   34|  1.01M|        h2 += h2 << 2; \
  |  |   35|  1.01M|    } while (0)
  |  |  ------------------
  |  |  |  Branch (35:14): [Folded, False: 1.01M]
  |  |  ------------------
  ------------------
   79|  1.01M|        }
   80|   212k|        if (lengths)
  ------------------
  |  Branch (80:13): [True: 72.8k, False: 139k]
  ------------------
   81|  72.8k|            lengths[1] = i;
   82|   212k|    }
   83|       |
   84|  4.78M|    HASH_UPDATE(h1, h2, 0);
  ------------------
  |  |   29|  4.78M|    do { \
  |  |   30|  4.78M|        h1 += ch; \
  |  |   31|  4.78M|        h1 += h1 << 3; \
  |  |   32|  4.78M|        h2 += h1; \
  |  |   33|  4.78M|        h2 = HASH_ROL(h2, 7); \
  |  |  ------------------
  |  |  |  |   12|  4.78M|#define HASH_ROL(x,n) ((x) << (n) | ((x) & 0xFFFFFFFF) >> (32 - (n)))
  |  |  ------------------
  |  |   34|  4.78M|        h2 += h2 << 2; \
  |  |   35|  4.78M|    } while (0)
  |  |  ------------------
  |  |  |  Branch (35:14): [Folded, False: 4.78M]
  |  |  ------------------
  ------------------
   85|       |
   86|  4.78M|    if (key3 != NULL) {
  ------------------
  |  Branch (86:9): [True: 797k, False: 3.98M]
  ------------------
   87|  2.04M|        for (i = 0; key3[i] != 0; i++) {
  ------------------
  |  Branch (87:21): [True: 1.24M, False: 797k]
  ------------------
   88|  1.24M|            HASH_UPDATE(h1, h2, key3[i]);
  ------------------
  |  |   29|  1.24M|    do { \
  |  |   30|  1.24M|        h1 += ch; \
  |  |   31|  1.24M|        h1 += h1 << 3; \
  |  |   32|  1.24M|        h2 += h1; \
  |  |   33|  1.24M|        h2 = HASH_ROL(h2, 7); \
  |  |  ------------------
  |  |  |  |   12|  1.24M|#define HASH_ROL(x,n) ((x) << (n) | ((x) & 0xFFFFFFFF) >> (32 - (n)))
  |  |  ------------------
  |  |   34|  1.24M|        h2 += h2 << 2; \
  |  |   35|  1.24M|    } while (0)
  |  |  ------------------
  |  |  |  Branch (35:14): [Folded, False: 1.24M]
  |  |  ------------------
  ------------------
   89|  1.24M|        }
   90|   797k|        if (lengths)
  ------------------
  |  Branch (90:13): [True: 80.0k, False: 717k]
  ------------------
   91|  80.0k|            lengths[2] = i;
   92|   797k|    }
   93|       |
   94|  4.78M|    HASH_FINISH(h1, h2);
  ------------------
  |  |   39|  4.78M|    do { \
  |  |   40|  4.78M|        h1 ^= h2; \
  |  |   41|  4.78M|        h1 += HASH_ROL(h2, 14); \
  |  |  ------------------
  |  |  |  |   12|  4.78M|#define HASH_ROL(x,n) ((x) << (n) | ((x) & 0xFFFFFFFF) >> (32 - (n)))
  |  |  ------------------
  |  |   42|  4.78M|        h2 ^= h1; h2 += HASH_ROR(h1, 6); \
  |  |  ------------------
  |  |  |  |   13|  4.78M|#define HASH_ROR(x,n) (((x) & 0xFFFFFFFF) >> (n) | (x) << (32 - (n)))
  |  |  ------------------
  |  |   43|  4.78M|        h1 ^= h2; h1 += HASH_ROL(h2, 5); \
  |  |  ------------------
  |  |  |  |   12|  4.78M|#define HASH_ROL(x,n) ((x) << (n) | ((x) & 0xFFFFFFFF) >> (32 - (n)))
  |  |  ------------------
  |  |   44|  4.78M|        h2 ^= h1; h2 += HASH_ROR(h1, 8); \
  |  |  ------------------
  |  |  |  |   13|  4.78M|#define HASH_ROR(x,n) (((x) & 0xFFFFFFFF) >> (n) | (x) << (32 - (n)))
  |  |  ------------------
  |  |   45|  4.78M|        h2 &= 0xFFFFFFFF; \
  |  |   46|  4.78M|    } while (0)
  |  |  ------------------
  |  |  |  Branch (46:14): [Folded, False: 4.78M]
  |  |  ------------------
  ------------------
   95|       |
   96|  4.78M|    return(h2);
   97|  4.78M|}
hash.c:xmlHashFindEntry:
  287|  4.69M|                 unsigned hashValue, int *pfound) {
  288|  4.69M|    xmlHashEntry *entry;
  289|  4.69M|    unsigned mask, pos, displ;
  290|  4.69M|    int found = 0;
  291|       |
  292|  4.69M|    mask = hash->size - 1;
  293|  4.69M|    pos = hashValue & mask;
  294|  4.69M|    entry = &hash->table[pos];
  295|       |
  296|  4.69M|    if (entry->hashValue != 0) {
  ------------------
  |  Branch (296:9): [True: 4.07M, False: 622k]
  ------------------
  297|       |        /*
  298|       |         * Robin hood hashing: abort if the displacement of the entry
  299|       |         * is smaller than the displacement of the key we look for.
  300|       |         * This also stops at the correct position when inserting.
  301|       |         */
  302|  4.07M|        displ = 0;
  303|  4.07M|        hashValue |= MAX_HASH_SIZE;
  ------------------
  |  |   31|  4.07M|#define MAX_HASH_SIZE (1u << 31)
  ------------------
  304|       |
  305|  4.78M|        do {
  306|  4.78M|            if (entry->hashValue == hashValue) {
  ------------------
  |  Branch (306:17): [True: 3.68M, False: 1.09M]
  ------------------
  307|  3.68M|                if (hash->dict) {
  ------------------
  |  Branch (307:21): [True: 1.97M, False: 1.71M]
  ------------------
  308|  1.97M|                    if ((entry->key == key) &&
  ------------------
  |  Branch (308:25): [True: 1.11M, False: 860k]
  ------------------
  309|  1.11M|                        (entry->key2 == key2) &&
  ------------------
  |  Branch (309:25): [True: 1.09M, False: 12.9k]
  ------------------
  310|  1.09M|                        (entry->key3 == key3)) {
  ------------------
  |  Branch (310:25): [True: 1.09M, False: 821]
  ------------------
  311|  1.09M|                        found = 1;
  312|  1.09M|                        break;
  313|  1.09M|                    }
  314|  1.97M|                }
  315|  2.58M|                if ((strcmp((const char *) entry->key,
  ------------------
  |  Branch (315:21): [True: 2.58M, False: 202]
  ------------------
  316|  2.58M|                            (const char *) key) == 0) &&
  317|  2.58M|                    (xmlFastStrEqual(entry->key2, key2)) &&
  ------------------
  |  Branch (317:21): [True: 2.58M, False: 0]
  ------------------
  318|  2.58M|                    (xmlFastStrEqual(entry->key3, key3))) {
  ------------------
  |  Branch (318:21): [True: 2.58M, False: 0]
  ------------------
  319|  2.58M|                    found = 1;
  320|  2.58M|                    break;
  321|  2.58M|                }
  322|  2.58M|            }
  323|       |
  324|  1.09M|            displ++;
  325|  1.09M|            pos++;
  326|  1.09M|            entry++;
  327|  1.09M|            if ((pos & mask) == 0)
  ------------------
  |  Branch (327:17): [True: 97.2k, False: 998k]
  ------------------
  328|  97.2k|                entry = hash->table;
  329|  1.09M|        } while ((entry->hashValue != 0) &&
  ------------------
  |  Branch (329:18): [True: 848k, False: 247k]
  ------------------
  330|   848k|                 (((pos - entry->hashValue) & mask) >= displ));
  ------------------
  |  Branch (330:18): [True: 704k, False: 143k]
  ------------------
  331|  4.07M|    }
  332|       |
  333|  4.69M|    *pfound = found;
  334|  4.69M|    return(entry);
  335|  4.69M|}
hash.c:xmlHashQNameValue:
  104|  26.9k|                  const xmlChar *prefix3, const xmlChar *name3) {
  105|  26.9k|    unsigned h1, h2, ch;
  106|       |
  107|  26.9k|    HASH_INIT(h1, h2, seed);
  ------------------
  |  |   23|  26.9k|    do { \
  |  |   24|  26.9k|        h1 = seed ^ 0x3b00; \
  |  |   25|  26.9k|        h2 = HASH_ROL(seed, 15); \
  |  |  ------------------
  |  |  |  |   12|  26.9k|#define HASH_ROL(x,n) ((x) << (n) | ((x) & 0xFFFFFFFF) >> (32 - (n)))
  |  |  ------------------
  |  |   26|  26.9k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (26:14): [Folded, False: 26.9k]
  |  |  ------------------
  ------------------
  108|       |
  109|  26.9k|    if (prefix != NULL) {
  ------------------
  |  Branch (109:9): [True: 7.38k, False: 19.5k]
  ------------------
  110|  25.3k|        while ((ch = *prefix++) != 0) {
  ------------------
  |  Branch (110:16): [True: 17.9k, False: 7.38k]
  ------------------
  111|  17.9k|            HASH_UPDATE(h1, h2, ch);
  ------------------
  |  |   29|  17.9k|    do { \
  |  |   30|  17.9k|        h1 += ch; \
  |  |   31|  17.9k|        h1 += h1 << 3; \
  |  |   32|  17.9k|        h2 += h1; \
  |  |   33|  17.9k|        h2 = HASH_ROL(h2, 7); \
  |  |  ------------------
  |  |  |  |   12|  17.9k|#define HASH_ROL(x,n) ((x) << (n) | ((x) & 0xFFFFFFFF) >> (32 - (n)))
  |  |  ------------------
  |  |   34|  17.9k|        h2 += h2 << 2; \
  |  |   35|  17.9k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (35:14): [Folded, False: 17.9k]
  |  |  ------------------
  ------------------
  112|  17.9k|        }
  113|  7.38k|        HASH_UPDATE(h1, h2, ':');
  ------------------
  |  |   29|  7.38k|    do { \
  |  |   30|  7.38k|        h1 += ch; \
  |  |   31|  7.38k|        h1 += h1 << 3; \
  |  |   32|  7.38k|        h2 += h1; \
  |  |   33|  7.38k|        h2 = HASH_ROL(h2, 7); \
  |  |  ------------------
  |  |  |  |   12|  7.38k|#define HASH_ROL(x,n) ((x) << (n) | ((x) & 0xFFFFFFFF) >> (32 - (n)))
  |  |  ------------------
  |  |   34|  7.38k|        h2 += h2 << 2; \
  |  |   35|  7.38k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (35:14): [Folded, False: 7.38k]
  |  |  ------------------
  ------------------
  114|  7.38k|    }
  115|  26.9k|    if (name != NULL) {
  ------------------
  |  Branch (115:9): [True: 26.9k, False: 0]
  ------------------
  116|  4.20M|        while ((ch = *name++) != 0) {
  ------------------
  |  Branch (116:16): [True: 4.17M, False: 26.9k]
  ------------------
  117|  4.17M|            HASH_UPDATE(h1, h2, ch);
  ------------------
  |  |   29|  4.17M|    do { \
  |  |   30|  4.17M|        h1 += ch; \
  |  |   31|  4.17M|        h1 += h1 << 3; \
  |  |   32|  4.17M|        h2 += h1; \
  |  |   33|  4.17M|        h2 = HASH_ROL(h2, 7); \
  |  |  ------------------
  |  |  |  |   12|  4.17M|#define HASH_ROL(x,n) ((x) << (n) | ((x) & 0xFFFFFFFF) >> (32 - (n)))
  |  |  ------------------
  |  |   34|  4.17M|        h2 += h2 << 2; \
  |  |   35|  4.17M|    } while (0)
  |  |  ------------------
  |  |  |  Branch (35:14): [Folded, False: 4.17M]
  |  |  ------------------
  ------------------
  118|  4.17M|        }
  119|  26.9k|    }
  120|  26.9k|    HASH_UPDATE(h1, h2, 0);
  ------------------
  |  |   29|  26.9k|    do { \
  |  |   30|  26.9k|        h1 += ch; \
  |  |   31|  26.9k|        h1 += h1 << 3; \
  |  |   32|  26.9k|        h2 += h1; \
  |  |   33|  26.9k|        h2 = HASH_ROL(h2, 7); \
  |  |  ------------------
  |  |  |  |   12|  26.9k|#define HASH_ROL(x,n) ((x) << (n) | ((x) & 0xFFFFFFFF) >> (32 - (n)))
  |  |  ------------------
  |  |   34|  26.9k|        h2 += h2 << 2; \
  |  |   35|  26.9k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (35:14): [Folded, False: 26.9k]
  |  |  ------------------
  ------------------
  121|  26.9k|    if (prefix2 != NULL) {
  ------------------
  |  Branch (121:9): [True: 11.7k, False: 15.1k]
  ------------------
  122|  55.9k|        while ((ch = *prefix2++) != 0) {
  ------------------
  |  Branch (122:16): [True: 44.1k, False: 11.7k]
  ------------------
  123|  44.1k|            HASH_UPDATE(h1, h2, ch);
  ------------------
  |  |   29|  44.1k|    do { \
  |  |   30|  44.1k|        h1 += ch; \
  |  |   31|  44.1k|        h1 += h1 << 3; \
  |  |   32|  44.1k|        h2 += h1; \
  |  |   33|  44.1k|        h2 = HASH_ROL(h2, 7); \
  |  |  ------------------
  |  |  |  |   12|  44.1k|#define HASH_ROL(x,n) ((x) << (n) | ((x) & 0xFFFFFFFF) >> (32 - (n)))
  |  |  ------------------
  |  |   34|  44.1k|        h2 += h2 << 2; \
  |  |   35|  44.1k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (35:14): [Folded, False: 44.1k]
  |  |  ------------------
  ------------------
  124|  44.1k|        }
  125|  11.7k|        HASH_UPDATE(h1, h2, ':');
  ------------------
  |  |   29|  11.7k|    do { \
  |  |   30|  11.7k|        h1 += ch; \
  |  |   31|  11.7k|        h1 += h1 << 3; \
  |  |   32|  11.7k|        h2 += h1; \
  |  |   33|  11.7k|        h2 = HASH_ROL(h2, 7); \
  |  |  ------------------
  |  |  |  |   12|  11.7k|#define HASH_ROL(x,n) ((x) << (n) | ((x) & 0xFFFFFFFF) >> (32 - (n)))
  |  |  ------------------
  |  |   34|  11.7k|        h2 += h2 << 2; \
  |  |   35|  11.7k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (35:14): [Folded, False: 11.7k]
  |  |  ------------------
  ------------------
  126|  11.7k|    }
  127|  26.9k|    if (name2 != NULL) {
  ------------------
  |  Branch (127:9): [True: 26.9k, False: 0]
  ------------------
  128|  2.65M|        while ((ch = *name2++) != 0) {
  ------------------
  |  Branch (128:16): [True: 2.63M, False: 26.9k]
  ------------------
  129|  2.63M|            HASH_UPDATE(h1, h2, ch);
  ------------------
  |  |   29|  2.63M|    do { \
  |  |   30|  2.63M|        h1 += ch; \
  |  |   31|  2.63M|        h1 += h1 << 3; \
  |  |   32|  2.63M|        h2 += h1; \
  |  |   33|  2.63M|        h2 = HASH_ROL(h2, 7); \
  |  |  ------------------
  |  |  |  |   12|  2.63M|#define HASH_ROL(x,n) ((x) << (n) | ((x) & 0xFFFFFFFF) >> (32 - (n)))
  |  |  ------------------
  |  |   34|  2.63M|        h2 += h2 << 2; \
  |  |   35|  2.63M|    } while (0)
  |  |  ------------------
  |  |  |  Branch (35:14): [Folded, False: 2.63M]
  |  |  ------------------
  ------------------
  130|  2.63M|        }
  131|  26.9k|    }
  132|  26.9k|    HASH_UPDATE(h1, h2, 0);
  ------------------
  |  |   29|  26.9k|    do { \
  |  |   30|  26.9k|        h1 += ch; \
  |  |   31|  26.9k|        h1 += h1 << 3; \
  |  |   32|  26.9k|        h2 += h1; \
  |  |   33|  26.9k|        h2 = HASH_ROL(h2, 7); \
  |  |  ------------------
  |  |  |  |   12|  26.9k|#define HASH_ROL(x,n) ((x) << (n) | ((x) & 0xFFFFFFFF) >> (32 - (n)))
  |  |  ------------------
  |  |   34|  26.9k|        h2 += h2 << 2; \
  |  |   35|  26.9k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (35:14): [Folded, False: 26.9k]
  |  |  ------------------
  ------------------
  133|  26.9k|    if (prefix3 != NULL) {
  ------------------
  |  Branch (133:9): [True: 0, False: 26.9k]
  ------------------
  134|      0|        while ((ch = *prefix3++) != 0) {
  ------------------
  |  Branch (134:16): [True: 0, False: 0]
  ------------------
  135|      0|            HASH_UPDATE(h1, h2, ch);
  ------------------
  |  |   29|      0|    do { \
  |  |   30|      0|        h1 += ch; \
  |  |   31|      0|        h1 += h1 << 3; \
  |  |   32|      0|        h2 += h1; \
  |  |   33|      0|        h2 = HASH_ROL(h2, 7); \
  |  |  ------------------
  |  |  |  |   12|      0|#define HASH_ROL(x,n) ((x) << (n) | ((x) & 0xFFFFFFFF) >> (32 - (n)))
  |  |  ------------------
  |  |   34|      0|        h2 += h2 << 2; \
  |  |   35|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (35:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
  136|      0|        }
  137|      0|        HASH_UPDATE(h1, h2, ':');
  ------------------
  |  |   29|      0|    do { \
  |  |   30|      0|        h1 += ch; \
  |  |   31|      0|        h1 += h1 << 3; \
  |  |   32|      0|        h2 += h1; \
  |  |   33|      0|        h2 = HASH_ROL(h2, 7); \
  |  |  ------------------
  |  |  |  |   12|      0|#define HASH_ROL(x,n) ((x) << (n) | ((x) & 0xFFFFFFFF) >> (32 - (n)))
  |  |  ------------------
  |  |   34|      0|        h2 += h2 << 2; \
  |  |   35|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (35:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
  138|      0|    }
  139|  26.9k|    if (name3 != NULL) {
  ------------------
  |  Branch (139:9): [True: 0, False: 26.9k]
  ------------------
  140|      0|        while ((ch = *name3++) != 0) {
  ------------------
  |  Branch (140:16): [True: 0, False: 0]
  ------------------
  141|      0|            HASH_UPDATE(h1, h2, ch);
  ------------------
  |  |   29|      0|    do { \
  |  |   30|      0|        h1 += ch; \
  |  |   31|      0|        h1 += h1 << 3; \
  |  |   32|      0|        h2 += h1; \
  |  |   33|      0|        h2 = HASH_ROL(h2, 7); \
  |  |  ------------------
  |  |  |  |   12|      0|#define HASH_ROL(x,n) ((x) << (n) | ((x) & 0xFFFFFFFF) >> (32 - (n)))
  |  |  ------------------
  |  |   34|      0|        h2 += h2 << 2; \
  |  |   35|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (35:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
  142|      0|        }
  143|      0|    }
  144|       |
  145|  26.9k|    HASH_FINISH(h1, h2);
  ------------------
  |  |   39|  26.9k|    do { \
  |  |   40|  26.9k|        h1 ^= h2; \
  |  |   41|  26.9k|        h1 += HASH_ROL(h2, 14); \
  |  |  ------------------
  |  |  |  |   12|  26.9k|#define HASH_ROL(x,n) ((x) << (n) | ((x) & 0xFFFFFFFF) >> (32 - (n)))
  |  |  ------------------
  |  |   42|  26.9k|        h2 ^= h1; h2 += HASH_ROR(h1, 6); \
  |  |  ------------------
  |  |  |  |   13|  26.9k|#define HASH_ROR(x,n) (((x) & 0xFFFFFFFF) >> (n) | (x) << (32 - (n)))
  |  |  ------------------
  |  |   43|  26.9k|        h1 ^= h2; h1 += HASH_ROL(h2, 5); \
  |  |  ------------------
  |  |  |  |   12|  26.9k|#define HASH_ROL(x,n) ((x) << (n) | ((x) & 0xFFFFFFFF) >> (32 - (n)))
  |  |  ------------------
  |  |   44|  26.9k|        h2 ^= h1; h2 += HASH_ROR(h1, 8); \
  |  |  ------------------
  |  |  |  |   13|  26.9k|#define HASH_ROR(x,n) (((x) & 0xFFFFFFFF) >> (n) | (x) << (32 - (n)))
  |  |  ------------------
  |  |   45|  26.9k|        h2 &= 0xFFFFFFFF; \
  |  |   46|  26.9k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (46:14): [Folded, False: 26.9k]
  |  |  ------------------
  ------------------
  146|       |
  147|  26.9k|    return(h2);
  148|  26.9k|}
hash.c:stubHashScannerFull:
  946|  20.1k|                    const xmlChar *key3 ATTRIBUTE_UNUSED) {
  947|  20.1k|    stubData *sdata = (stubData *) data;
  948|  20.1k|    sdata->scan(payload, sdata->data, key);
  949|  20.1k|}
hash.c:xmlFastStrEqual:
  263|  5.31M|xmlFastStrEqual(const xmlChar *s1, const xmlChar *s2) {
  264|  5.31M|    if (s1 == NULL)
  ------------------
  |  Branch (264:9): [True: 4.71M, False: 605k]
  ------------------
  265|  4.71M|        return(s2 == NULL);
  266|   605k|    else
  267|   605k|        return((s2 != NULL) &&
  ------------------
  |  Branch (267:16): [True: 605k, False: 0]
  ------------------
  268|   605k|               (strcmp((const char *) s1, (const char *) s2) == 0));
  ------------------
  |  Branch (268:16): [True: 462k, False: 143k]
  ------------------
  269|  5.31M|}

tree.c:xmlGrowCapacity:
   32|  71.9k|xmlGrowCapacity(int capacity, size_t elemSize, int min, int max) {
   33|  71.9k|    int extra;
   34|       |
   35|  71.9k|    if (capacity <= 0) {
  ------------------
  |  Branch (35:9): [True: 71.5k, False: 419]
  ------------------
   36|  71.5k|#ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
   37|  71.5k|        (void) min;
   38|  71.5k|        return(1);
   39|       |#else
   40|       |        return(min);
   41|       |#endif
   42|  71.5k|    }
   43|       |
   44|    419|    if ((capacity >= max) ||
  ------------------
  |  Branch (44:9): [True: 0, False: 419]
  ------------------
   45|    419|        ((size_t) capacity > SIZE_MAX / 2 / elemSize))
  ------------------
  |  Branch (45:9): [True: 0, False: 419]
  ------------------
   46|      0|        return(-1);
   47|       |
   48|       |    /* Grow by 50% */
   49|    419|    extra = (capacity + 1) / 2;
   50|       |
   51|    419|    if (capacity > max - extra)
  ------------------
  |  Branch (51:9): [True: 0, False: 419]
  ------------------
   52|      0|        return(max);
   53|       |
   54|    419|    return(capacity + extra);
   55|    419|}
uri.c:xmlGrowCapacity:
   32|  20.7k|xmlGrowCapacity(int capacity, size_t elemSize, int min, int max) {
   33|  20.7k|    int extra;
   34|       |
   35|  20.7k|    if (capacity <= 0) {
  ------------------
  |  Branch (35:9): [True: 0, False: 20.7k]
  ------------------
   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|  20.7k|    if ((capacity >= max) ||
  ------------------
  |  Branch (44:9): [True: 27, False: 20.7k]
  ------------------
   45|  20.7k|        ((size_t) capacity > SIZE_MAX / 2 / elemSize))
  ------------------
  |  Branch (45:9): [True: 0, False: 20.7k]
  ------------------
   46|     27|        return(-1);
   47|       |
   48|       |    /* Grow by 50% */
   49|  20.7k|    extra = (capacity + 1) / 2;
   50|       |
   51|  20.7k|    if (capacity > max - extra)
  ------------------
  |  Branch (51:9): [True: 49, False: 20.6k]
  ------------------
   52|     49|        return(max);
   53|       |
   54|  20.6k|    return(capacity + extra);
   55|  20.7k|}
valid.c:xmlGrowCapacity:
   32|  9.33k|xmlGrowCapacity(int capacity, size_t elemSize, int min, int max) {
   33|  9.33k|    int extra;
   34|       |
   35|  9.33k|    if (capacity <= 0) {
  ------------------
  |  Branch (35:9): [True: 3.62k, False: 5.71k]
  ------------------
   36|  3.62k|#ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
   37|  3.62k|        (void) min;
   38|  3.62k|        return(1);
   39|       |#else
   40|       |        return(min);
   41|       |#endif
   42|  3.62k|    }
   43|       |
   44|  5.71k|    if ((capacity >= max) ||
  ------------------
  |  Branch (44:9): [True: 0, False: 5.71k]
  ------------------
   45|  5.71k|        ((size_t) capacity > SIZE_MAX / 2 / elemSize))
  ------------------
  |  Branch (45:9): [True: 0, False: 5.71k]
  ------------------
   46|      0|        return(-1);
   47|       |
   48|       |    /* Grow by 50% */
   49|  5.71k|    extra = (capacity + 1) / 2;
   50|       |
   51|  5.71k|    if (capacity > max - extra)
  ------------------
  |  Branch (51:9): [True: 0, False: 5.71k]
  ------------------
   52|      0|        return(max);
   53|       |
   54|  5.71k|    return(capacity + extra);
   55|  5.71k|}
xmlreader.c:xmlGrowCapacity:
   32|    505|xmlGrowCapacity(int capacity, size_t elemSize, int min, int max) {
   33|    505|    int extra;
   34|       |
   35|    505|    if (capacity <= 0) {
  ------------------
  |  Branch (35:9): [True: 236, False: 269]
  ------------------
   36|    236|#ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
   37|    236|        (void) min;
   38|    236|        return(1);
   39|       |#else
   40|       |        return(min);
   41|       |#endif
   42|    236|    }
   43|       |
   44|    269|    if ((capacity >= max) ||
  ------------------
  |  Branch (44:9): [True: 0, False: 269]
  ------------------
   45|    269|        ((size_t) capacity > SIZE_MAX / 2 / elemSize))
  ------------------
  |  Branch (45:9): [True: 0, False: 269]
  ------------------
   46|      0|        return(-1);
   47|       |
   48|       |    /* Grow by 50% */
   49|    269|    extra = (capacity + 1) / 2;
   50|       |
   51|    269|    if (capacity > max - extra)
  ------------------
  |  Branch (51:9): [True: 0, False: 269]
  ------------------
   52|      0|        return(max);
   53|       |
   54|    269|    return(capacity + extra);
   55|    269|}
xmlregexp.c:xmlGrowCapacity:
   32|  2.82M|xmlGrowCapacity(int capacity, size_t elemSize, int min, int max) {
   33|  2.82M|    int extra;
   34|       |
   35|  2.82M|    if (capacity <= 0) {
  ------------------
  |  Branch (35:9): [True: 1.32M, False: 1.50M]
  ------------------
   36|  1.32M|#ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
   37|  1.32M|        (void) min;
   38|  1.32M|        return(1);
   39|       |#else
   40|       |        return(min);
   41|       |#endif
   42|  1.32M|    }
   43|       |
   44|  1.50M|    if ((capacity >= max) ||
  ------------------
  |  Branch (44:9): [True: 0, False: 1.50M]
  ------------------
   45|  1.50M|        ((size_t) capacity > SIZE_MAX / 2 / elemSize))
  ------------------
  |  Branch (45:9): [True: 0, False: 1.50M]
  ------------------
   46|      0|        return(-1);
   47|       |
   48|       |    /* Grow by 50% */
   49|  1.50M|    extra = (capacity + 1) / 2;
   50|       |
   51|  1.50M|    if (capacity > max - extra)
  ------------------
  |  Branch (51:9): [True: 0, False: 1.50M]
  ------------------
   52|      0|        return(max);
   53|       |
   54|  1.50M|    return(capacity + extra);
   55|  1.50M|}
xinclude.c:xmlGrowCapacity:
   32|  25.7k|xmlGrowCapacity(int capacity, size_t elemSize, int min, int max) {
   33|  25.7k|    int extra;
   34|       |
   35|  25.7k|    if (capacity <= 0) {
  ------------------
  |  Branch (35:9): [True: 22.5k, False: 3.16k]
  ------------------
   36|  22.5k|#ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
   37|  22.5k|        (void) min;
   38|  22.5k|        return(1);
   39|       |#else
   40|       |        return(min);
   41|       |#endif
   42|  22.5k|    }
   43|       |
   44|  3.16k|    if ((capacity >= max) ||
  ------------------
  |  Branch (44:9): [True: 0, False: 3.16k]
  ------------------
   45|  3.16k|        ((size_t) capacity > SIZE_MAX / 2 / elemSize))
  ------------------
  |  Branch (45:9): [True: 0, False: 3.16k]
  ------------------
   46|      0|        return(-1);
   47|       |
   48|       |    /* Grow by 50% */
   49|  3.16k|    extra = (capacity + 1) / 2;
   50|       |
   51|  3.16k|    if (capacity > max - extra)
  ------------------
  |  Branch (51:9): [True: 0, False: 3.16k]
  ------------------
   52|      0|        return(max);
   53|       |
   54|  3.16k|    return(capacity + extra);
   55|  3.16k|}
xpath.c:xmlGrowCapacity:
   32|  1.48M|xmlGrowCapacity(int capacity, size_t elemSize, int min, int max) {
   33|  1.48M|    int extra;
   34|       |
   35|  1.48M|    if (capacity <= 0) {
  ------------------
  |  Branch (35:9): [True: 457k, False: 1.02M]
  ------------------
   36|   457k|#ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
   37|   457k|        (void) min;
   38|   457k|        return(1);
   39|       |#else
   40|       |        return(min);
   41|       |#endif
   42|   457k|    }
   43|       |
   44|  1.02M|    if ((capacity >= max) ||
  ------------------
  |  Branch (44:9): [True: 0, False: 1.02M]
  ------------------
   45|  1.02M|        ((size_t) capacity > SIZE_MAX / 2 / elemSize))
  ------------------
  |  Branch (45:9): [True: 0, False: 1.02M]
  ------------------
   46|      0|        return(-1);
   47|       |
   48|       |    /* Grow by 50% */
   49|  1.02M|    extra = (capacity + 1) / 2;
   50|       |
   51|  1.02M|    if (capacity > max - extra)
  ------------------
  |  Branch (51:9): [True: 2, False: 1.02M]
  ------------------
   52|      2|        return(max);
   53|       |
   54|  1.02M|    return(capacity + extra);
   55|  1.02M|}
parser.c:xmlGrowCapacity:
   32|   376k|xmlGrowCapacity(int capacity, size_t elemSize, int min, int max) {
   33|   376k|    int extra;
   34|       |
   35|   376k|    if (capacity <= 0) {
  ------------------
  |  Branch (35:9): [True: 38.5k, False: 337k]
  ------------------
   36|  38.5k|#ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
   37|  38.5k|        (void) min;
   38|  38.5k|        return(1);
   39|       |#else
   40|       |        return(min);
   41|       |#endif
   42|  38.5k|    }
   43|       |
   44|   337k|    if ((capacity >= max) ||
  ------------------
  |  Branch (44:9): [True: 231, False: 337k]
  ------------------
   45|   337k|        ((size_t) capacity > SIZE_MAX / 2 / elemSize))
  ------------------
  |  Branch (45:9): [True: 0, False: 337k]
  ------------------
   46|    231|        return(-1);
   47|       |
   48|       |    /* Grow by 50% */
   49|   337k|    extra = (capacity + 1) / 2;
   50|       |
   51|   337k|    if (capacity > max - extra)
  ------------------
  |  Branch (51:9): [True: 408, False: 336k]
  ------------------
   52|    408|        return(max);
   53|       |
   54|   336k|    return(capacity + extra);
   55|   337k|}

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

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

xmlWarningMsg:
  276|  19.3k|{
  277|  19.3k|    xmlCtxtErr(ctxt, NULL, XML_FROM_PARSER, error, XML_ERR_WARNING,
  278|       |               str1, str2, NULL, 0, msg, str1, str2);
  279|  19.3k|}
xmlAttrNormalizeSpace:
  989|  31.7k|{
  990|  31.7k|    if ((src == NULL) || (dst == NULL))
  ------------------
  |  Branch (990:9): [True: 0, False: 31.7k]
  |  Branch (990:26): [True: 0, False: 31.7k]
  ------------------
  991|      0|        return(NULL);
  992|       |
  993|  40.0k|    while (*src == 0x20) src++;
  ------------------
  |  Branch (993:12): [True: 8.28k, False: 31.7k]
  ------------------
  994|  2.22M|    while (*src != 0) {
  ------------------
  |  Branch (994:12): [True: 2.19M, False: 31.7k]
  ------------------
  995|  2.19M|	if (*src == 0x20) {
  ------------------
  |  Branch (995:6): [True: 26.2k, False: 2.17M]
  ------------------
  996|   247k|	    while (*src == 0x20) src++;
  ------------------
  |  Branch (996:13): [True: 221k, False: 26.2k]
  ------------------
  997|  26.2k|	    if (*src != 0)
  ------------------
  |  Branch (997:10): [True: 25.6k, False: 690]
  ------------------
  998|  25.6k|		*dst++ = 0x20;
  999|  2.17M|	} else {
 1000|  2.17M|	    *dst++ = *src++;
 1001|  2.17M|	}
 1002|  2.19M|    }
 1003|  31.7k|    *dst = 0;
 1004|  31.7k|    if (dst == src)
  ------------------
  |  Branch (1004:9): [True: 26.9k, False: 4.74k]
  ------------------
 1005|  26.9k|       return(NULL);
 1006|  4.74k|    return(dst);
 1007|  31.7k|}
xmlAttrNormalize:
 1024|  2.27k|{
 1025|  2.27k|    xmlChar *out = NULL;
 1026|  2.27k|    xmlChar *dst = NULL;
 1027|       |
 1028|  2.27k|    if (src == NULL)
  ------------------
  |  Branch (1028:9): [True: 0, False: 2.27k]
  ------------------
 1029|      0|        return(NULL);
 1030|       |
 1031|  2.27k|    out = src;
 1032|  2.27k|    dst = out;
 1033|  37.2k|    while (*src != 0) {
  ------------------
  |  Branch (1033:12): [True: 34.9k, False: 2.27k]
  ------------------
 1034|  34.9k|        if (*src < 0x20) {
  ------------------
  |  Branch (1034:13): [True: 232, False: 34.7k]
  ------------------
 1035|    232|            src++;
 1036|    232|            *dst++ = 0x20;
 1037|  34.7k|        } else {
 1038|  34.7k|            *dst++ = *src++;
 1039|  34.7k|        }
 1040|  34.9k|    }
 1041|  2.27k|    *dst = 0;
 1042|  2.27k|    return(out);
 1043|  2.27k|}
xmlCheckLanguageID:
 1304|  19.7k|{
 1305|  19.7k|    const xmlChar *cur = lang, *nxt;
 1306|       |
 1307|  19.7k|    if (cur == NULL)
  ------------------
  |  Branch (1307:9): [True: 296, False: 19.4k]
  ------------------
 1308|    296|        return (0);
 1309|  19.4k|    if (((cur[0] == 'i') && (cur[1] == '-')) ||
  ------------------
  |  Branch (1309:10): [True: 456, False: 18.9k]
  |  Branch (1309:29): [True: 200, False: 256]
  ------------------
 1310|  19.2k|        ((cur[0] == 'I') && (cur[1] == '-')) ||
  ------------------
  |  Branch (1310:10): [True: 10.6k, False: 8.61k]
  |  Branch (1310:29): [True: 415, False: 10.2k]
  ------------------
 1311|  18.8k|        ((cur[0] == 'x') && (cur[1] == '-')) ||
  ------------------
  |  Branch (1311:10): [True: 704, False: 18.1k]
  |  Branch (1311:29): [True: 341, False: 363]
  ------------------
 1312|  18.4k|        ((cur[0] == 'X') && (cur[1] == '-'))) {
  ------------------
  |  Branch (1312:10): [True: 356, False: 18.1k]
  |  Branch (1312:29): [True: 222, False: 134]
  ------------------
 1313|       |        /*
 1314|       |         * Still allow IANA code and user code which were coming
 1315|       |         * from the previous version of the XML-1.0 specification
 1316|       |         * it's deprecated but we should not fail
 1317|       |         */
 1318|  1.17k|        cur += 2;
 1319|  5.22k|        while (((cur[0] >= 'A') && (cur[0] <= 'Z')) ||
  ------------------
  |  Branch (1319:17): [True: 4.25k, False: 969]
  |  Branch (1319:36): [True: 1.37k, False: 2.87k]
  ------------------
 1320|  3.84k|               ((cur[0] >= 'a') && (cur[0] <= 'z')))
  ------------------
  |  Branch (1320:17): [True: 2.86k, False: 980]
  |  Branch (1320:36): [True: 2.66k, False: 198]
  ------------------
 1321|  4.04k|            cur++;
 1322|  1.17k|        return(cur[0] == 0);
 1323|  1.17k|    }
 1324|  18.2k|    nxt = cur;
 1325|  73.6k|    while (((nxt[0] >= 'A') && (nxt[0] <= 'Z')) ||
  ------------------
  |  Branch (1325:13): [True: 56.6k, False: 17.0k]
  |  Branch (1325:32): [True: 48.2k, False: 8.36k]
  ------------------
 1326|  25.4k|           ((nxt[0] >= 'a') && (nxt[0] <= 'z')))
  ------------------
  |  Branch (1326:13): [True: 8.32k, False: 17.1k]
  |  Branch (1326:32): [True: 7.18k, False: 1.13k]
  ------------------
 1327|  55.4k|           nxt++;
 1328|  18.2k|    if (nxt - cur >= 4) {
  ------------------
  |  Branch (1328:9): [True: 1.13k, False: 17.1k]
  ------------------
 1329|       |        /*
 1330|       |         * Reserved
 1331|       |         */
 1332|  1.13k|        if ((nxt - cur > 8) || (nxt[0] != 0))
  ------------------
  |  Branch (1332:13): [True: 309, False: 822]
  |  Branch (1332:32): [True: 377, False: 445]
  ------------------
 1333|    686|            return(0);
 1334|    445|        return(1);
 1335|  1.13k|    }
 1336|  17.1k|    if (nxt - cur < 2)
  ------------------
  |  Branch (1336:9): [True: 1.38k, False: 15.7k]
  ------------------
 1337|  1.38k|        return(0);
 1338|       |    /* we got an ISO 639 code */
 1339|  15.7k|    if (nxt[0] == 0)
  ------------------
  |  Branch (1339:9): [True: 645, False: 15.0k]
  ------------------
 1340|    645|        return(1);
 1341|  15.0k|    if (nxt[0] != '-')
  ------------------
  |  Branch (1341:9): [True: 771, False: 14.3k]
  ------------------
 1342|    771|        return(0);
 1343|       |
 1344|  14.3k|    nxt++;
 1345|  14.3k|    cur = nxt;
 1346|       |    /* now we can have extlang or script or region or variant */
 1347|  14.3k|    if ((nxt[0] >= '0') && (nxt[0] <= '9'))
  ------------------
  |  Branch (1347:9): [True: 13.5k, False: 735]
  |  Branch (1347:28): [True: 2.46k, False: 11.1k]
  ------------------
 1348|  2.46k|        goto region_m49;
 1349|       |
 1350|  48.7k|    while (((nxt[0] >= 'A') && (nxt[0] <= 'Z')) ||
  ------------------
  |  Branch (1350:13): [True: 37.3k, False: 11.4k]
  |  Branch (1350:32): [True: 33.7k, False: 3.61k]
  ------------------
 1351|  15.0k|           ((nxt[0] >= 'a') && (nxt[0] <= 'z')))
  ------------------
  |  Branch (1351:13): [True: 3.59k, False: 11.4k]
  |  Branch (1351:32): [True: 3.19k, False: 400]
  ------------------
 1352|  36.8k|           nxt++;
 1353|  11.8k|    if (nxt - cur == 4)
  ------------------
  |  Branch (1353:9): [True: 1.89k, False: 9.97k]
  ------------------
 1354|  1.89k|        goto script;
 1355|  9.97k|    if (nxt - cur == 2)
  ------------------
  |  Branch (1355:9): [True: 1.39k, False: 8.58k]
  ------------------
 1356|  1.39k|        goto region;
 1357|  8.58k|    if ((nxt - cur >= 5) && (nxt - cur <= 8))
  ------------------
  |  Branch (1357:9): [True: 609, False: 7.97k]
  |  Branch (1357:29): [True: 502, False: 107]
  ------------------
 1358|    502|        goto variant;
 1359|  8.07k|    if (nxt - cur != 3)
  ------------------
  |  Branch (1359:9): [True: 1.07k, False: 7.00k]
  ------------------
 1360|  1.07k|        return(0);
 1361|       |    /* we parsed an extlang */
 1362|  7.00k|    if (nxt[0] == 0)
  ------------------
  |  Branch (1362:9): [True: 204, False: 6.80k]
  ------------------
 1363|    204|        return(1);
 1364|  6.80k|    if (nxt[0] != '-')
  ------------------
  |  Branch (1364:9): [True: 1.97k, False: 4.83k]
  ------------------
 1365|  1.97k|        return(0);
 1366|       |
 1367|  4.83k|    nxt++;
 1368|  4.83k|    cur = nxt;
 1369|       |    /* now we can have script or region or variant */
 1370|  4.83k|    if ((nxt[0] >= '0') && (nxt[0] <= '9'))
  ------------------
  |  Branch (1370:9): [True: 4.47k, False: 352]
  |  Branch (1370:28): [True: 500, False: 3.97k]
  ------------------
 1371|    500|        goto region_m49;
 1372|       |
 1373|  21.8k|    while (((nxt[0] >= 'A') && (nxt[0] <= 'Z')) ||
  ------------------
  |  Branch (1373:13): [True: 18.0k, False: 3.76k]
  |  Branch (1373:32): [True: 13.3k, False: 4.71k]
  ------------------
 1374|  8.48k|           ((nxt[0] >= 'a') && (nxt[0] <= 'z')))
  ------------------
  |  Branch (1374:13): [True: 4.70k, False: 3.77k]
  |  Branch (1374:32): [True: 4.15k, False: 557]
  ------------------
 1375|  17.4k|           nxt++;
 1376|  4.33k|    if (nxt - cur == 2)
  ------------------
  |  Branch (1376:9): [True: 1.66k, False: 2.67k]
  ------------------
 1377|  1.66k|        goto region;
 1378|  2.67k|    if ((nxt - cur >= 5) && (nxt - cur <= 8))
  ------------------
  |  Branch (1378:9): [True: 1.00k, False: 1.66k]
  |  Branch (1378:29): [True: 713, False: 295]
  ------------------
 1379|    713|        goto variant;
 1380|  1.95k|    if (nxt - cur != 4)
  ------------------
  |  Branch (1380:9): [True: 756, False: 1.20k]
  ------------------
 1381|    756|        return(0);
 1382|       |    /* we parsed a script */
 1383|  3.09k|script:
 1384|  3.09k|    if (nxt[0] == 0)
  ------------------
  |  Branch (1384:9): [True: 961, False: 2.13k]
  ------------------
 1385|    961|        return(1);
 1386|  2.13k|    if (nxt[0] != '-')
  ------------------
  |  Branch (1386:9): [True: 346, False: 1.78k]
  ------------------
 1387|    346|        return(0);
 1388|       |
 1389|  1.78k|    nxt++;
 1390|  1.78k|    cur = nxt;
 1391|       |    /* now we can have region or variant */
 1392|  1.78k|    if ((nxt[0] >= '0') && (nxt[0] <= '9'))
  ------------------
  |  Branch (1392:9): [True: 1.57k, False: 207]
  |  Branch (1392:28): [True: 361, False: 1.21k]
  ------------------
 1393|    361|        goto region_m49;
 1394|       |
 1395|  6.68k|    while (((nxt[0] >= 'A') && (nxt[0] <= 'Z')) ||
  ------------------
  |  Branch (1395:13): [True: 5.62k, False: 1.06k]
  |  Branch (1395:32): [True: 2.67k, False: 2.95k]
  ------------------
 1396|  4.01k|           ((nxt[0] >= 'a') && (nxt[0] <= 'z')))
  ------------------
  |  Branch (1396:13): [True: 2.94k, False: 1.06k]
  |  Branch (1396:32): [True: 2.59k, False: 358]
  ------------------
 1397|  5.26k|           nxt++;
 1398|       |
 1399|  1.42k|    if ((nxt - cur >= 5) && (nxt - cur <= 8))
  ------------------
  |  Branch (1399:9): [True: 412, False: 1.01k]
  |  Branch (1399:29): [True: 210, False: 202]
  ------------------
 1400|    210|        goto variant;
 1401|  1.21k|    if (nxt - cur != 2)
  ------------------
  |  Branch (1401:9): [True: 527, False: 686]
  ------------------
 1402|    527|        return(0);
 1403|       |    /* we parsed a region */
 1404|  3.98k|region:
 1405|  3.98k|    if (nxt[0] == 0)
  ------------------
  |  Branch (1405:9): [True: 589, False: 3.40k]
  ------------------
 1406|    589|        return(1);
 1407|  3.40k|    if (nxt[0] != '-')
  ------------------
  |  Branch (1407:9): [True: 2.59k, False: 804]
  ------------------
 1408|  2.59k|        return(0);
 1409|       |
 1410|    804|    nxt++;
 1411|    804|    cur = nxt;
 1412|       |    /* now we can just have a variant */
 1413|  6.06k|    while (((nxt[0] >= 'A') && (nxt[0] <= 'Z')) ||
  ------------------
  |  Branch (1413:13): [True: 5.29k, False: 767]
  |  Branch (1413:32): [True: 2.22k, False: 3.06k]
  ------------------
 1414|  3.83k|           ((nxt[0] >= 'a') && (nxt[0] <= 'z')))
  ------------------
  |  Branch (1414:13): [True: 3.05k, False: 781]
  |  Branch (1414:32): [True: 3.03k, False: 23]
  ------------------
 1415|  5.25k|           nxt++;
 1416|       |
 1417|    804|    if ((nxt - cur < 5) || (nxt - cur > 8))
  ------------------
  |  Branch (1417:9): [True: 297, False: 507]
  |  Branch (1417:28): [True: 293, False: 214]
  ------------------
 1418|    590|        return(0);
 1419|       |
 1420|       |    /* we parsed a variant */
 1421|  1.63k|variant:
 1422|  1.63k|    if (nxt[0] == 0)
  ------------------
  |  Branch (1422:9): [True: 558, False: 1.08k]
  ------------------
 1423|    558|        return(1);
 1424|  1.08k|    if (nxt[0] != '-')
  ------------------
  |  Branch (1424:9): [True: 780, False: 301]
  ------------------
 1425|    780|        return(0);
 1426|       |    /* extensions and private use subtags not checked */
 1427|    301|    return (1);
 1428|       |
 1429|  3.32k|region_m49:
 1430|  3.32k|    if (((nxt[1] >= '0') && (nxt[1] <= '9')) &&
  ------------------
  |  Branch (1430:10): [True: 3.06k, False: 261]
  |  Branch (1430:29): [True: 2.26k, False: 797]
  ------------------
 1431|  2.26k|        ((nxt[2] >= '0') && (nxt[2] <= '9'))) {
  ------------------
  |  Branch (1431:10): [True: 1.22k, False: 1.03k]
  |  Branch (1431:29): [True: 248, False: 978]
  ------------------
 1432|    248|        nxt += 3;
 1433|    248|        goto region;
 1434|    248|    }
 1435|  3.07k|    return(0);
 1436|  3.32k|}
xmlParserNsCreate:
 1453|  53.7k|xmlParserNsCreate(void) {
 1454|  53.7k|    xmlParserNsData *nsdb = xmlMalloc(sizeof(*nsdb));
 1455|       |
 1456|  53.7k|    if (nsdb == NULL)
  ------------------
  |  Branch (1456:9): [True: 5, False: 53.7k]
  ------------------
 1457|      5|        return(NULL);
 1458|  53.7k|    memset(nsdb, 0, sizeof(*nsdb));
 1459|  53.7k|    nsdb->defaultNsIndex = INT_MAX;
 1460|       |
 1461|  53.7k|    return(nsdb);
 1462|  53.7k|}
xmlParserNsFree:
 1470|  53.7k|xmlParserNsFree(xmlParserNsData *nsdb) {
 1471|  53.7k|    if (nsdb == NULL)
  ------------------
  |  Branch (1471:9): [True: 0, False: 53.7k]
  ------------------
 1472|      0|        return;
 1473|       |
 1474|  53.7k|    xmlFree(nsdb->extra);
 1475|  53.7k|    xmlFree(nsdb->hash);
 1476|  53.7k|    xmlFree(nsdb);
 1477|  53.7k|}
xmlParserNsLookupSax:
 1603|  89.9k|xmlParserNsLookupSax(xmlParserCtxt *ctxt, const xmlChar *prefix) {
 1604|  89.9k|    xmlHashedString hprefix;
 1605|  89.9k|    int nsIndex;
 1606|       |
 1607|  89.9k|    if (prefix == ctxt->str_xml)
  ------------------
  |  Branch (1607:9): [True: 45.4k, False: 44.4k]
  ------------------
 1608|  45.4k|        return(NULL);
 1609|       |
 1610|  44.4k|    hprefix.name = prefix;
 1611|  44.4k|    if (prefix != NULL)
  ------------------
  |  Branch (1611:9): [True: 30.3k, False: 14.0k]
  ------------------
 1612|  30.3k|        hprefix.hashValue = xmlDictComputeHash(ctxt->dict, prefix);
 1613|  14.0k|    else
 1614|  14.0k|        hprefix.hashValue = 0;
 1615|  44.4k|    nsIndex = xmlParserNsLookup(ctxt, &hprefix, NULL);
 1616|  44.4k|    if ((nsIndex == INT_MAX) || (nsIndex < ctxt->nsdb->minNsIndex))
  ------------------
  |  Branch (1616:9): [True: 0, False: 44.4k]
  |  Branch (1616:33): [True: 0, False: 44.4k]
  ------------------
 1617|      0|        return(NULL);
 1618|       |
 1619|  44.4k|    return(ctxt->nsdb->extra[nsIndex].saxData);
 1620|  44.4k|}
xmlParserNsUpdateSax:
 1634|   260k|                     void *saxData) {
 1635|   260k|    xmlHashedString hprefix;
 1636|   260k|    int nsIndex;
 1637|       |
 1638|   260k|    if (prefix == ctxt->str_xml)
  ------------------
  |  Branch (1638:9): [True: 0, False: 260k]
  ------------------
 1639|      0|        return(-1);
 1640|       |
 1641|   260k|    hprefix.name = prefix;
 1642|   260k|    if (prefix != NULL)
  ------------------
  |  Branch (1642:9): [True: 225k, False: 35.0k]
  ------------------
 1643|   225k|        hprefix.hashValue = xmlDictComputeHash(ctxt->dict, prefix);
 1644|  35.0k|    else
 1645|  35.0k|        hprefix.hashValue = 0;
 1646|   260k|    nsIndex = xmlParserNsLookup(ctxt, &hprefix, NULL);
 1647|   260k|    if ((nsIndex == INT_MAX) || (nsIndex < ctxt->nsdb->minNsIndex))
  ------------------
  |  Branch (1647:9): [True: 0, False: 260k]
  |  Branch (1647:33): [True: 0, False: 260k]
  ------------------
 1648|      0|        return(-1);
 1649|       |
 1650|   260k|    ctxt->nsdb->extra[nsIndex].saxData = saxData;
 1651|   260k|    return(0);
 1652|   260k|}
xmlCtxtPushInput:
 1929|   391k|{
 1930|   391k|    char *directory = NULL;
 1931|   391k|    int maxDepth;
 1932|       |
 1933|   391k|    if ((ctxt == NULL) || (value == NULL))
  ------------------
  |  Branch (1933:9): [True: 0, False: 391k]
  |  Branch (1933:27): [True: 2.10k, False: 389k]
  ------------------
 1934|  2.10k|        return(-1);
 1935|       |
 1936|   389k|    maxDepth = (ctxt->options & XML_PARSE_HUGE) ? 40 : 20;
  ------------------
  |  Branch (1936:16): [True: 106k, False: 282k]
  ------------------
 1937|       |
 1938|   389k|    if (ctxt->inputNr >= ctxt->inputMax) {
  ------------------
  |  Branch (1938:9): [True: 8.36k, False: 381k]
  ------------------
 1939|  8.36k|        xmlParserInputPtr *tmp;
 1940|  8.36k|        int newSize;
 1941|       |
 1942|  8.36k|        newSize = xmlGrowCapacity(ctxt->inputMax, sizeof(tmp[0]),
 1943|  8.36k|                                  5, maxDepth);
 1944|  8.36k|        if (newSize < 0) {
  ------------------
  |  Branch (1944:13): [True: 1, False: 8.36k]
  ------------------
 1945|      1|            xmlFatalErrMsg(ctxt, XML_ERR_RESOURCE_LIMIT,
 1946|      1|                           "Maximum entity nesting depth exceeded");
 1947|      1|            return(-1);
 1948|      1|        }
 1949|  8.36k|        tmp = xmlRealloc(ctxt->inputTab, newSize * sizeof(tmp[0]));
 1950|  8.36k|        if (tmp == NULL) {
  ------------------
  |  Branch (1950:13): [True: 3, False: 8.36k]
  ------------------
 1951|      3|            xmlErrMemory(ctxt);
 1952|      3|            return(-1);
 1953|      3|        }
 1954|  8.36k|        ctxt->inputTab = tmp;
 1955|  8.36k|        ctxt->inputMax = newSize;
 1956|  8.36k|    }
 1957|       |
 1958|   389k|    if ((ctxt->inputNr == 0) && (value->filename != NULL)) {
  ------------------
  |  Branch (1958:9): [True: 246k, False: 143k]
  |  Branch (1958:33): [True: 203k, False: 42.8k]
  ------------------
 1959|   203k|        directory = xmlParserGetDirectory(value->filename);
 1960|   203k|        if (directory == NULL) {
  ------------------
  |  Branch (1960:13): [True: 8, False: 203k]
  ------------------
 1961|      8|            xmlErrMemory(ctxt);
 1962|      8|            return(-1);
 1963|      8|        }
 1964|   203k|    }
 1965|       |
 1966|   389k|    if (ctxt->input_id >= INT_MAX) {
  ------------------
  |  Branch (1966:9): [True: 0, False: 389k]
  ------------------
 1967|      0|        xmlFatalErrMsg(ctxt, XML_ERR_RESOURCE_LIMIT, "Input ID overflow\n");
 1968|      0|        return(-1);
 1969|      0|    }
 1970|       |
 1971|   389k|    ctxt->inputTab[ctxt->inputNr] = value;
 1972|   389k|    ctxt->input = value;
 1973|       |
 1974|   389k|    if (ctxt->inputNr == 0) {
  ------------------
  |  Branch (1974:9): [True: 246k, False: 143k]
  ------------------
 1975|   246k|        xmlFree(ctxt->directory);
 1976|   246k|        ctxt->directory = directory;
 1977|   246k|    }
 1978|       |
 1979|       |    /*
 1980|       |     * The input ID is unused internally, but there are entity
 1981|       |     * loaders in downstream code that detect the main document
 1982|       |     * by checking for "input_id == 1".
 1983|       |     */
 1984|   389k|    value->id = ctxt->input_id++;
 1985|       |
 1986|   389k|    return(ctxt->inputNr++);
 1987|   389k|}
xmlCtxtPopInput:
 1997|   494k|{
 1998|   494k|    xmlParserInputPtr ret;
 1999|       |
 2000|   494k|    if (ctxt == NULL)
  ------------------
  |  Branch (2000:9): [True: 0, False: 494k]
  ------------------
 2001|      0|        return(NULL);
 2002|   494k|    if (ctxt->inputNr <= 0)
  ------------------
  |  Branch (2002:9): [True: 107k, False: 387k]
  ------------------
 2003|   107k|        return (NULL);
 2004|   387k|    ctxt->inputNr--;
 2005|   387k|    if (ctxt->inputNr > 0)
  ------------------
  |  Branch (2005:9): [True: 143k, False: 243k]
  ------------------
 2006|   143k|        ctxt->input = ctxt->inputTab[ctxt->inputNr - 1];
 2007|   243k|    else
 2008|   243k|        ctxt->input = NULL;
 2009|   387k|    ret = ctxt->inputTab[ctxt->inputNr];
 2010|       |    ctxt->inputTab[ctxt->inputNr] = NULL;
 2011|   387k|    return (ret);
 2012|   494k|}
nodePush:
 2025|   925k|{
 2026|   925k|    if (ctxt == NULL)
  ------------------
  |  Branch (2026:9): [True: 0, False: 925k]
  ------------------
 2027|      0|        return(0);
 2028|       |
 2029|   925k|    if (ctxt->nodeNr >= ctxt->nodeMax) {
  ------------------
  |  Branch (2029:9): [True: 53.7k, False: 872k]
  ------------------
 2030|  53.7k|        int maxDepth = (ctxt->options & XML_PARSE_HUGE) ? 2048 : 256;
  ------------------
  |  Branch (2030:24): [True: 27.2k, False: 26.4k]
  ------------------
 2031|  53.7k|        xmlNodePtr *tmp;
 2032|  53.7k|        int newSize;
 2033|       |
 2034|  53.7k|        newSize = xmlGrowCapacity(ctxt->nodeMax, sizeof(tmp[0]),
 2035|  53.7k|                                  10, maxDepth);
 2036|  53.7k|        if (newSize < 0) {
  ------------------
  |  Branch (2036:13): [True: 55, False: 53.6k]
  ------------------
 2037|     55|            xmlFatalErrMsgInt(ctxt, XML_ERR_RESOURCE_LIMIT,
 2038|     55|                    "Excessive depth in document: %d,"
 2039|     55|                    " use XML_PARSE_HUGE option\n",
 2040|     55|                    ctxt->nodeNr);
 2041|     55|            return(-1);
 2042|     55|        }
 2043|       |
 2044|  53.6k|	tmp = xmlRealloc(ctxt->nodeTab, newSize * sizeof(tmp[0]));
 2045|  53.6k|        if (tmp == NULL) {
  ------------------
  |  Branch (2045:13): [True: 19, False: 53.6k]
  ------------------
 2046|     19|            xmlErrMemory(ctxt);
 2047|     19|            return (-1);
 2048|     19|        }
 2049|  53.6k|        ctxt->nodeTab = tmp;
 2050|  53.6k|	ctxt->nodeMax = newSize;
 2051|  53.6k|    }
 2052|       |
 2053|   925k|    ctxt->nodeTab[ctxt->nodeNr] = value;
 2054|   925k|    ctxt->node = value;
 2055|   925k|    return (ctxt->nodeNr++);
 2056|   925k|}
nodePop:
 2068|   828k|{
 2069|   828k|    xmlNodePtr ret;
 2070|       |
 2071|   828k|    if (ctxt == NULL) return(NULL);
  ------------------
  |  Branch (2071:9): [True: 0, False: 828k]
  ------------------
 2072|   828k|    if (ctxt->nodeNr <= 0)
  ------------------
  |  Branch (2072:9): [True: 53.5k, False: 774k]
  ------------------
 2073|  53.5k|        return (NULL);
 2074|   774k|    ctxt->nodeNr--;
 2075|   774k|    if (ctxt->nodeNr > 0)
  ------------------
  |  Branch (2075:9): [True: 755k, False: 19.1k]
  ------------------
 2076|   755k|        ctxt->node = ctxt->nodeTab[ctxt->nodeNr - 1];
 2077|  19.1k|    else
 2078|  19.1k|        ctxt->node = NULL;
 2079|   774k|    ret = ctxt->nodeTab[ctxt->nodeNr];
 2080|       |    ctxt->nodeTab[ctxt->nodeNr] = NULL;
 2081|   774k|    return (ret);
 2082|   828k|}
xmlSkipBlankChars:
 2355|  5.14M|xmlSkipBlankChars(xmlParserCtxt *ctxt) {
 2356|  5.14M|    const xmlChar *cur;
 2357|  5.14M|    int res = 0;
 2358|       |
 2359|  5.14M|    cur = ctxt->input->cur;
 2360|  5.14M|    while (IS_BLANK_CH(*cur)) {
 2361|  2.34M|        if (*cur == '\n') {
  ------------------
  |  Branch (2361:13): [True: 724k, False: 1.62M]
  ------------------
 2362|   724k|            ctxt->input->line++; ctxt->input->col = 1;
 2363|  1.62M|        } else {
 2364|  1.62M|            ctxt->input->col++;
 2365|  1.62M|        }
 2366|  2.34M|        cur++;
 2367|  2.34M|        if (res < INT_MAX)
  ------------------
  |  Branch (2367:13): [True: 2.34M, False: 0]
  ------------------
 2368|  2.34M|            res++;
 2369|  2.34M|        if (*cur == 0) {
  ------------------
  |  Branch (2369:13): [True: 34.4k, False: 2.31M]
  ------------------
 2370|  34.4k|            ctxt->input->cur = cur;
 2371|  34.4k|            xmlParserGrow(ctxt);
 2372|  34.4k|            cur = ctxt->input->cur;
 2373|  34.4k|        }
 2374|  2.34M|    }
 2375|  5.14M|    ctxt->input->cur = cur;
 2376|       |
 2377|  5.14M|    if (res > 4)
  ------------------
  |  Branch (2377:9): [True: 45.4k, False: 5.09M]
  ------------------
 2378|  45.4k|        GROW;
  ------------------
  |  | 2308|  45.4k|    if ((!PARSER_PROGRESSIVE(ctxt)) && \
  |  |  ------------------
  |  |  |  |   47|  45.4k|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|  45.4k|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2308:9): [True: 43.3k, False: 2.15k]
  |  |  ------------------
  |  | 2309|  45.4k|        (ctxt->input->end - ctxt->input->cur < INPUT_CHUNK)) \
  |  |  ------------------
  |  |  |  |   63|  43.3k|#define INPUT_CHUNK	250
  |  |  ------------------
  |  |  |  Branch (2309:9): [True: 3.01k, False: 40.3k]
  |  |  ------------------
  |  | 2310|  45.4k|	xmlParserGrow(ctxt);
  ------------------
 2379|       |
 2380|  5.14M|    return(res);
 2381|  5.14M|}
xmlParseCharRef:
 2566|  58.5k|xmlParseCharRef(xmlParserCtxt *ctxt) {
 2567|  58.5k|    int val = 0;
 2568|  58.5k|    int count = 0;
 2569|       |
 2570|       |    /*
 2571|       |     * Using RAW/CUR/NEXT is okay since we are working on ASCII range here
 2572|       |     */
 2573|  58.5k|    if ((RAW == '&') && (NXT(1) == '#') &&
  ------------------
  |  | 2261|  58.5k|#define RAW (*ctxt->input->cur)
  ------------------
                  if ((RAW == '&') && (NXT(1) == '#') &&
  ------------------
  |  | 2263|  58.5k|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
  |  Branch (2573:9): [True: 58.5k, False: 0]
  |  Branch (2573:25): [True: 58.5k, False: 0]
  ------------------
 2574|  58.5k|        (NXT(2) == 'x')) {
  ------------------
  |  | 2263|  58.5k|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
  |  Branch (2574:9): [True: 16.9k, False: 41.6k]
  ------------------
 2575|  16.9k|	SKIP(3);
  ------------------
  |  | 2285|  16.9k|#define SKIP(val) do {							\
  |  | 2286|  16.9k|    ctxt->input->cur += (val),ctxt->input->col+=(val);			\
  |  | 2287|  16.9k|    if (*ctxt->input->cur == 0)						\
  |  |  ------------------
  |  |  |  Branch (2287:9): [True: 232, False: 16.7k]
  |  |  ------------------
  |  | 2288|  16.9k|        xmlParserGrow(ctxt);						\
  |  | 2289|  16.9k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2289:12): [Folded, False: 16.9k]
  |  |  ------------------
  ------------------
 2576|  16.9k|	GROW;
  ------------------
  |  | 2308|  16.9k|    if ((!PARSER_PROGRESSIVE(ctxt)) && \
  |  |  ------------------
  |  |  |  |   47|  16.9k|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|  16.9k|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2308:9): [True: 13.3k, False: 3.58k]
  |  |  ------------------
  |  | 2309|  16.9k|        (ctxt->input->end - ctxt->input->cur < INPUT_CHUNK)) \
  |  |  ------------------
  |  |  |  |   63|  13.3k|#define INPUT_CHUNK	250
  |  |  ------------------
  |  |  |  Branch (2309:9): [True: 1.61k, False: 11.7k]
  |  |  ------------------
  |  | 2310|  16.9k|	xmlParserGrow(ctxt);
  ------------------
 2577|  65.9k|	while ((RAW != ';') && (PARSER_STOPPED(ctxt) == 0)) {
  ------------------
  |  | 2261|  65.9k|#define RAW (*ctxt->input->cur)
  ------------------
              	while ((RAW != ';') && (PARSER_STOPPED(ctxt) == 0)) {
  ------------------
  |  |   44|  51.5k|#define PARSER_STOPPED(ctxt) ((ctxt)->disableSAX > 1)
  ------------------
  |  Branch (2577:9): [True: 51.5k, False: 14.3k]
  |  Branch (2577:25): [True: 51.5k, False: 0]
  ------------------
 2578|  51.5k|	    if (count++ > 20) {
  ------------------
  |  Branch (2578:10): [True: 868, False: 50.6k]
  ------------------
 2579|    868|		count = 0;
 2580|    868|		GROW;
  ------------------
  |  | 2308|    868|    if ((!PARSER_PROGRESSIVE(ctxt)) && \
  |  |  ------------------
  |  |  |  |   47|    868|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|    868|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2308:9): [True: 531, False: 337]
  |  |  ------------------
  |  | 2309|    868|        (ctxt->input->end - ctxt->input->cur < INPUT_CHUNK)) \
  |  |  ------------------
  |  |  |  |   63|    531|#define INPUT_CHUNK	250
  |  |  ------------------
  |  |  |  Branch (2309:9): [True: 316, False: 215]
  |  |  ------------------
  |  | 2310|    868|	xmlParserGrow(ctxt);
  ------------------
 2581|    868|	    }
 2582|  51.5k|	    if ((RAW >= '0') && (RAW <= '9'))
  ------------------
  |  | 2261|  51.5k|#define RAW (*ctxt->input->cur)
  ------------------
              	    if ((RAW >= '0') && (RAW <= '9'))
  ------------------
  |  | 2261|  50.6k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (2582:10): [True: 50.6k, False: 938]
  |  Branch (2582:26): [True: 32.0k, False: 18.5k]
  ------------------
 2583|  32.0k|	        val = val * 16 + (CUR - '0');
  ------------------
  |  | 2262|  32.0k|#define CUR (*ctxt->input->cur)
  ------------------
 2584|  19.4k|	    else if ((RAW >= 'a') && (RAW <= 'f') && (count < 20))
  ------------------
  |  | 2261|  19.4k|#define RAW (*ctxt->input->cur)
  ------------------
              	    else if ((RAW >= 'a') && (RAW <= 'f') && (count < 20))
  ------------------
  |  | 2261|  14.6k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (2584:15): [True: 14.6k, False: 4.77k]
  |  Branch (2584:31): [True: 13.6k, False: 1.08k]
  |  Branch (2584:47): [True: 13.3k, False: 210]
  ------------------
 2585|  13.3k|	        val = val * 16 + (CUR - 'a') + 10;
  ------------------
  |  | 2262|  13.3k|#define CUR (*ctxt->input->cur)
  ------------------
 2586|  6.07k|	    else if ((RAW >= 'A') && (RAW <= 'F') && (count < 20))
  ------------------
  |  | 2261|  6.07k|#define RAW (*ctxt->input->cur)
  ------------------
              	    else if ((RAW >= 'A') && (RAW <= 'F') && (count < 20))
  ------------------
  |  | 2261|  5.07k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (2586:15): [True: 5.07k, False: 1.00k]
  |  Branch (2586:31): [True: 3.71k, False: 1.35k]
  |  Branch (2586:47): [True: 3.45k, False: 260]
  ------------------
 2587|  3.45k|	        val = val * 16 + (CUR - 'A') + 10;
  ------------------
  |  | 2262|  3.45k|#define CUR (*ctxt->input->cur)
  ------------------
 2588|  2.61k|	    else {
 2589|  2.61k|		xmlFatalErr(ctxt, XML_ERR_INVALID_HEX_CHARREF, NULL);
 2590|  2.61k|		val = 0;
 2591|  2.61k|		break;
 2592|  2.61k|	    }
 2593|  48.9k|	    if (val > 0x110000)
  ------------------
  |  Branch (2593:10): [True: 12.4k, False: 36.5k]
  ------------------
 2594|  12.4k|	        val = 0x110000;
 2595|       |
 2596|  48.9k|	    NEXT;
  ------------------
  |  | 2316|  48.9k|#define NEXT xmlNextChar(ctxt)
  ------------------
 2597|  48.9k|	    count++;
 2598|  48.9k|	}
 2599|  16.9k|	if (RAW == ';') {
  ------------------
  |  | 2261|  16.9k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (2599:6): [True: 14.3k, False: 2.61k]
  ------------------
 2600|       |	    /* on purpose to avoid reentrancy problems with NEXT and SKIP */
 2601|  14.3k|	    ctxt->input->col++;
 2602|  14.3k|	    ctxt->input->cur++;
 2603|  14.3k|	}
 2604|  41.6k|    } else if  ((RAW == '&') && (NXT(1) == '#')) {
  ------------------
  |  | 2261|  41.6k|#define RAW (*ctxt->input->cur)
  ------------------
                  } else if  ((RAW == '&') && (NXT(1) == '#')) {
  ------------------
  |  | 2263|  41.6k|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
  |  Branch (2604:17): [True: 41.6k, False: 0]
  |  Branch (2604:33): [True: 41.6k, False: 0]
  ------------------
 2605|  41.6k|	SKIP(2);
  ------------------
  |  | 2285|  41.6k|#define SKIP(val) do {							\
  |  | 2286|  41.6k|    ctxt->input->cur += (val),ctxt->input->col+=(val);			\
  |  | 2287|  41.6k|    if (*ctxt->input->cur == 0)						\
  |  |  ------------------
  |  |  |  Branch (2287:9): [True: 499, False: 41.1k]
  |  |  ------------------
  |  | 2288|  41.6k|        xmlParserGrow(ctxt);						\
  |  | 2289|  41.6k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2289:12): [Folded, False: 41.6k]
  |  |  ------------------
  ------------------
 2606|  41.6k|	GROW;
  ------------------
  |  | 2308|  41.6k|    if ((!PARSER_PROGRESSIVE(ctxt)) && \
  |  |  ------------------
  |  |  |  |   47|  41.6k|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|  41.6k|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2308:9): [True: 25.5k, False: 16.0k]
  |  |  ------------------
  |  | 2309|  41.6k|        (ctxt->input->end - ctxt->input->cur < INPUT_CHUNK)) \
  |  |  ------------------
  |  |  |  |   63|  25.5k|#define INPUT_CHUNK	250
  |  |  ------------------
  |  |  |  Branch (2309:9): [True: 10.7k, False: 14.7k]
  |  |  ------------------
  |  | 2310|  41.6k|	xmlParserGrow(ctxt);
  ------------------
 2607|   137k|	while (RAW != ';') { /* loop blocked by count */
  ------------------
  |  | 2261|   137k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (2607:9): [True: 99.8k, False: 38.1k]
  ------------------
 2608|  99.8k|	    if (count++ > 20) {
  ------------------
  |  Branch (2608:10): [True: 1.21k, False: 98.5k]
  ------------------
 2609|  1.21k|		count = 0;
 2610|  1.21k|		GROW;
  ------------------
  |  | 2308|  1.21k|    if ((!PARSER_PROGRESSIVE(ctxt)) && \
  |  |  ------------------
  |  |  |  |   47|  1.21k|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|  1.21k|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2308:9): [True: 921, False: 291]
  |  |  ------------------
  |  | 2309|  1.21k|        (ctxt->input->end - ctxt->input->cur < INPUT_CHUNK)) \
  |  |  ------------------
  |  |  |  |   63|    921|#define INPUT_CHUNK	250
  |  |  ------------------
  |  |  |  Branch (2309:9): [True: 578, False: 343]
  |  |  ------------------
  |  | 2310|  1.21k|	xmlParserGrow(ctxt);
  ------------------
 2611|  1.21k|	    }
 2612|  99.8k|	    if ((RAW >= '0') && (RAW <= '9'))
  ------------------
  |  | 2261|  99.8k|#define RAW (*ctxt->input->cur)
  ------------------
              	    if ((RAW >= '0') && (RAW <= '9'))
  ------------------
  |  | 2261|  97.7k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (2612:10): [True: 97.7k, False: 2.03k]
  |  Branch (2612:26): [True: 96.3k, False: 1.41k]
  ------------------
 2613|  96.3k|	        val = val * 10 + (CUR - '0');
  ------------------
  |  | 2262|  96.3k|#define CUR (*ctxt->input->cur)
  ------------------
 2614|  3.45k|	    else {
 2615|  3.45k|		xmlFatalErr(ctxt, XML_ERR_INVALID_DEC_CHARREF, NULL);
 2616|  3.45k|		val = 0;
 2617|  3.45k|		break;
 2618|  3.45k|	    }
 2619|  96.3k|	    if (val > 0x110000)
  ------------------
  |  Branch (2619:10): [True: 12.7k, False: 83.5k]
  ------------------
 2620|  12.7k|	        val = 0x110000;
 2621|       |
 2622|  96.3k|	    NEXT;
  ------------------
  |  | 2316|  96.3k|#define NEXT xmlNextChar(ctxt)
  ------------------
 2623|  96.3k|	    count++;
 2624|  96.3k|	}
 2625|  41.6k|	if (RAW == ';') {
  ------------------
  |  | 2261|  41.6k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (2625:6): [True: 38.1k, False: 3.45k]
  ------------------
 2626|       |	    /* on purpose to avoid reentrancy problems with NEXT and SKIP */
 2627|  38.1k|	    ctxt->input->col++;
 2628|  38.1k|	    ctxt->input->cur++;
 2629|  38.1k|	}
 2630|  41.6k|    } else {
 2631|      0|        if (RAW == '&')
  ------------------
  |  | 2261|      0|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (2631:13): [True: 0, False: 0]
  ------------------
 2632|      0|            SKIP(1);
  ------------------
  |  | 2285|      0|#define SKIP(val) do {							\
  |  | 2286|      0|    ctxt->input->cur += (val),ctxt->input->col+=(val);			\
  |  | 2287|      0|    if (*ctxt->input->cur == 0)						\
  |  |  ------------------
  |  |  |  Branch (2287:9): [True: 0, False: 0]
  |  |  ------------------
  |  | 2288|      0|        xmlParserGrow(ctxt);						\
  |  | 2289|      0|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2289:12): [Folded, False: 0]
  |  |  ------------------
  ------------------
 2633|      0|        xmlFatalErr(ctxt, XML_ERR_INVALID_CHARREF, NULL);
 2634|      0|    }
 2635|       |
 2636|       |    /*
 2637|       |     * [ WFC: Legal Character ]
 2638|       |     * Characters referred to using character references must match the
 2639|       |     * production for Char.
 2640|       |     */
 2641|  58.5k|    if (val >= 0x110000) {
  ------------------
  |  Branch (2641:9): [True: 691, False: 57.8k]
  ------------------
 2642|    691|        xmlFatalErrMsgInt(ctxt, XML_ERR_INVALID_CHAR,
 2643|    691|                "xmlParseCharRef: character reference out of bounds\n",
 2644|    691|	        val);
 2645|    691|        val = 0xFFFD;
 2646|  57.8k|    } else if (!IS_CHAR(val)) {
  ------------------
  |  |  115|  57.8k|#define IS_CHAR(c)   xmlIsCharQ(c)
  |  |  ------------------
  |  |  |  |  117|  57.8k|#define xmlIsCharQ(c)		(((c) < 0x100) ? \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (117:25): [True: 55.6k, False: 2.27k]
  |  |  |  |  ------------------
  |  |  |  |  118|  57.8k|				 xmlIsChar_ch((c)) :\
  |  |  |  |  ------------------
  |  |  |  |  |  |  108|  55.6k|#define xmlIsChar_ch(c)		(((0x9 <= (c)) && ((c) <= 0xa)) || \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (108:28): [True: 48.0k, False: 7.60k]
  |  |  |  |  |  |  |  Branch (108:44): [True: 15.8k, False: 32.2k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  109|  55.6k|				 ((c) == 0xd) || \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (109:6): [True: 5.91k, False: 33.9k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  110|  55.6k|				  (0x20 <= (c)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (110:7): [True: 25.7k, False: 8.14k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  119|  57.8k|				(((0x100 <= (c)) && ((c) <= 0xd7ff)) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (119:7): [True: 2.27k, False: 0]
  |  |  |  |  |  Branch (119:25): [True: 511, False: 1.76k]
  |  |  |  |  ------------------
  |  |  |  |  120|  2.27k|				 ((0xe000 <= (c)) && ((c) <= 0xfffd)) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (120:7): [True: 1.25k, False: 512]
  |  |  |  |  |  Branch (120:26): [True: 299, False: 952]
  |  |  |  |  ------------------
  |  |  |  |  121|  2.27k|				 ((0x10000 <= (c)) && ((c) <= 0x10ffff))))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (121:7): [True: 872, False: 592]
  |  |  |  |  |  Branch (121:27): [True: 872, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (2646:16): [True: 8.73k, False: 49.1k]
  ------------------
 2647|  8.73k|        xmlFatalErrMsgInt(ctxt, XML_ERR_INVALID_CHAR,
 2648|  8.73k|                          "xmlParseCharRef: invalid xmlChar value %d\n",
 2649|  8.73k|	                  val);
 2650|  8.73k|    }
 2651|  58.5k|    return(val);
 2652|  58.5k|}
xmlScanName:
 3088|  2.99M|xmlScanName(const xmlChar *ptr, size_t maxSize, int flags) {
 3089|  2.99M|    int stop = flags & XML_SCAN_NC ? ':' : 0;
  ------------------
  |  |   69|  2.99M|#define XML_SCAN_NC         1
  ------------------
  |  Branch (3089:16): [True: 104k, False: 2.88M]
  ------------------
 3090|  2.99M|    int old10 = flags & XML_SCAN_OLD10 ? 1 : 0;
  ------------------
  |  |   71|  2.99M|#define XML_SCAN_OLD10      4
  ------------------
  |  Branch (3090:17): [True: 1.25M, False: 1.73M]
  ------------------
 3091|       |
 3092|  13.7M|    while (1) {
  ------------------
  |  Branch (3092:12): [True: 13.7M, Folded]
  ------------------
 3093|  13.7M|        int c, len;
 3094|       |
 3095|  13.7M|        c = *ptr;
 3096|  13.7M|        if (c < 0x80) {
  ------------------
  |  Branch (3096:13): [True: 10.5M, False: 3.18M]
  ------------------
 3097|  10.5M|            if (c == stop)
  ------------------
  |  Branch (3097:17): [True: 103k, False: 10.4M]
  ------------------
 3098|   103k|                break;
 3099|  10.4M|            len = 1;
 3100|  10.4M|        } else {
 3101|  3.18M|            len = 4;
 3102|  3.18M|            c = xmlGetUTF8Char(ptr, &len);
 3103|  3.18M|            if (c < 0)
  ------------------
  |  Branch (3103:17): [True: 5.00k, False: 3.17M]
  ------------------
 3104|  5.00k|                break;
 3105|  3.18M|        }
 3106|       |
 3107|  13.6M|        if (flags & XML_SCAN_NMTOKEN ?
  ------------------
  |  |   70|  13.6M|#define XML_SCAN_NMTOKEN    2
  ------------------
  |  Branch (3107:13): [True: 10.7M, False: 2.90M]
  |  Branch (3107:13): [True: 2.88M, False: 10.7M]
  ------------------
 3108|  10.7M|                !xmlIsNameChar(c, old10) :
 3109|  13.6M|                !xmlIsNameStartChar(c, old10))
 3110|  2.88M|            break;
 3111|       |
 3112|  10.7M|        if ((size_t) len > maxSize)
  ------------------
  |  Branch (3112:13): [True: 84, False: 10.7M]
  ------------------
 3113|     84|            return(NULL);
 3114|  10.7M|        ptr += len;
 3115|  10.7M|        maxSize -= len;
 3116|  10.7M|        flags |= XML_SCAN_NMTOKEN;
  ------------------
  |  |   70|  10.7M|#define XML_SCAN_NMTOKEN    2
  ------------------
 3117|  10.7M|    }
 3118|       |
 3119|  2.99M|    return(ptr);
 3120|  2.99M|}
xmlParseName:
 3187|  2.73M|xmlParseName(xmlParserCtxt *ctxt) {
 3188|  2.73M|    const xmlChar *in;
 3189|  2.73M|    const xmlChar *ret;
 3190|  2.73M|    size_t count = 0;
 3191|  2.73M|    size_t maxLength = (ctxt->options & XML_PARSE_HUGE) ?
  ------------------
  |  Branch (3191:24): [True: 1.24M, False: 1.49M]
  ------------------
 3192|  1.24M|                       XML_MAX_TEXT_LENGTH :
  ------------------
  |  |   50|  1.24M|#define XML_MAX_TEXT_LENGTH 10000000
  ------------------
 3193|  2.73M|                       XML_MAX_NAME_LENGTH;
  ------------------
  |  |   65|  4.23M|#define XML_MAX_NAME_LENGTH 50000
  ------------------
 3194|       |
 3195|  2.73M|    GROW;
  ------------------
  |  | 2308|  2.73M|    if ((!PARSER_PROGRESSIVE(ctxt)) && \
  |  |  ------------------
  |  |  |  |   47|  2.73M|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|  2.73M|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2308:9): [True: 1.59M, False: 1.14M]
  |  |  ------------------
  |  | 2309|  2.73M|        (ctxt->input->end - ctxt->input->cur < INPUT_CHUNK)) \
  |  |  ------------------
  |  |  |  |   63|  1.59M|#define INPUT_CHUNK	250
  |  |  ------------------
  |  |  |  Branch (2309:9): [True: 669k, False: 926k]
  |  |  ------------------
  |  | 2310|  2.73M|	xmlParserGrow(ctxt);
  ------------------
 3196|       |
 3197|       |    /*
 3198|       |     * Accelerator for simple ASCII names
 3199|       |     */
 3200|  2.73M|    in = ctxt->input->cur;
 3201|  2.73M|    if (((*in >= 0x61) && (*in <= 0x7A)) ||
  ------------------
  |  Branch (3201:10): [True: 2.41M, False: 320k]
  |  Branch (3201:27): [True: 2.38M, False: 28.9k]
  ------------------
 3202|   349k|	((*in >= 0x41) && (*in <= 0x5A)) ||
  ------------------
  |  Branch (3202:3): [True: 174k, False: 175k]
  |  Branch (3202:20): [True: 142k, False: 32.3k]
  ------------------
 3203|  2.53M|	(*in == '_') || (*in == ':')) {
  ------------------
  |  Branch (3203:2): [True: 1.30k, False: 206k]
  |  Branch (3203:18): [True: 6.91k, False: 199k]
  ------------------
 3204|  2.53M|	in++;
 3205|  14.8M|	while (((*in >= 0x61) && (*in <= 0x7A)) ||
  ------------------
  |  Branch (3205:10): [True: 3.59M, False: 11.2M]
  |  Branch (3205:27): [True: 3.51M, False: 83.2k]
  ------------------
 3206|  11.3M|	       ((*in >= 0x41) && (*in <= 0x5A)) ||
  ------------------
  |  Branch (3206:10): [True: 5.65M, False: 5.68M]
  |  Branch (3206:27): [True: 5.56M, False: 94.9k]
  ------------------
 3207|  5.77M|	       ((*in >= 0x30) && (*in <= 0x39)) ||
  ------------------
  |  Branch (3207:10): [True: 4.67M, False: 1.10M]
  |  Branch (3207:27): [True: 2.93M, False: 1.73M]
  ------------------
 3208|  2.83M|	       (*in == '_') || (*in == '-') ||
  ------------------
  |  Branch (3208:9): [True: 6.27k, False: 2.83M]
  |  Branch (3208:25): [True: 123k, False: 2.70M]
  ------------------
 3209|  2.70M|	       (*in == ':') || (*in == '.'))
  ------------------
  |  Branch (3209:9): [True: 151k, False: 2.55M]
  |  Branch (3209:25): [True: 18.9k, False: 2.53M]
  ------------------
 3210|  12.3M|	    in++;
 3211|  2.53M|	if ((*in > 0) && (*in < 0x80)) {
  ------------------
  |  Branch (3211:6): [True: 2.51M, False: 28.7k]
  |  Branch (3211:19): [True: 2.47M, False: 31.0k]
  ------------------
 3212|  2.47M|	    count = in - ctxt->input->cur;
 3213|  2.47M|            if (count > maxLength) {
  ------------------
  |  Branch (3213:17): [True: 85, False: 2.47M]
  ------------------
 3214|     85|                xmlFatalErr(ctxt, XML_ERR_NAME_TOO_LONG, "Name");
 3215|     85|                return(NULL);
 3216|     85|            }
 3217|  2.47M|	    ret = xmlDictLookup(ctxt->dict, ctxt->input->cur, count);
 3218|  2.47M|	    ctxt->input->cur = in;
 3219|  2.47M|	    ctxt->input->col += count;
 3220|  2.47M|	    if (ret == NULL)
  ------------------
  |  Branch (3220:10): [True: 7, False: 2.47M]
  ------------------
 3221|      7|	        xmlErrMemory(ctxt);
 3222|  2.47M|	    return(ret);
 3223|  2.47M|	}
 3224|  2.53M|    }
 3225|       |    /* accelerator for special cases */
 3226|   259k|    return(xmlParseNameComplex(ctxt));
 3227|  2.73M|}
xmlParseNmtoken:
 3417|  55.5k|xmlParseNmtoken(xmlParserCtxt *ctxt) {
 3418|  55.5k|    xmlChar buf[XML_MAX_NAMELEN + 5];
 3419|  55.5k|    xmlChar *ret;
 3420|  55.5k|    int len = 0, l;
 3421|  55.5k|    int c;
 3422|  55.5k|    int maxLength = (ctxt->options & XML_PARSE_HUGE) ?
  ------------------
  |  Branch (3422:21): [True: 22.0k, False: 33.5k]
  ------------------
 3423|  22.0k|                    XML_MAX_TEXT_LENGTH :
  ------------------
  |  |   50|  22.0k|#define XML_MAX_TEXT_LENGTH 10000000
  ------------------
 3424|  55.5k|                    XML_MAX_NAME_LENGTH;
  ------------------
  |  |   65|  33.5k|#define XML_MAX_NAME_LENGTH 50000
  ------------------
 3425|  55.5k|    int old10 = (ctxt->options & XML_PARSE_OLD10) ? 1 : 0;
  ------------------
  |  Branch (3425:17): [True: 16.0k, False: 39.4k]
  ------------------
 3426|       |
 3427|  55.5k|    c = xmlCurrentChar(ctxt, &l);
 3428|       |
 3429|   216k|    while (xmlIsNameChar(c, old10)) {
  ------------------
  |  Branch (3429:12): [True: 162k, False: 54.5k]
  ------------------
 3430|   162k|	COPY_BUF(buf, len, c);
  ------------------
  |  | 2333|   162k|    if (v < 0x80) b[i++] = v;						\
  |  |  ------------------
  |  |  |  Branch (2333:9): [True: 127k, False: 34.5k]
  |  |  ------------------
  |  | 2334|   162k|    else i += xmlCopyCharMultiByte(&b[i],v)
  ------------------
 3431|   162k|	NEXTL(l);
  ------------------
  |  | 2325|   162k|#define NEXTL(l) do {							\
  |  | 2326|   162k|    if (*(ctxt->input->cur) == '\n') {					\
  |  |  ------------------
  |  |  |  Branch (2326:9): [True: 0, False: 162k]
  |  |  ------------------
  |  | 2327|      0|	ctxt->input->line++; ctxt->input->col = 1;			\
  |  | 2328|   162k|    } else ctxt->input->col++;						\
  |  | 2329|   162k|    ctxt->input->cur += l;				\
  |  | 2330|   162k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2330:12): [Folded, False: 162k]
  |  |  ------------------
  ------------------
 3432|   162k|	c = xmlCurrentChar(ctxt, &l);
 3433|   162k|	if (len >= XML_MAX_NAMELEN) {
  ------------------
  |  |   87|   162k|#define XML_MAX_NAMELEN 100
  ------------------
  |  Branch (3433:6): [True: 1.03k, False: 161k]
  ------------------
 3434|       |	    /*
 3435|       |	     * Okay someone managed to make a huge token, so he's ready to pay
 3436|       |	     * for the processing speed.
 3437|       |	     */
 3438|  1.03k|	    xmlChar *buffer;
 3439|  1.03k|	    int max = len * 2;
 3440|       |
 3441|  1.03k|	    buffer = xmlMalloc(max);
 3442|  1.03k|	    if (buffer == NULL) {
  ------------------
  |  Branch (3442:10): [True: 1, False: 1.03k]
  ------------------
 3443|      1|	        xmlErrMemory(ctxt);
 3444|      1|		return(NULL);
 3445|      1|	    }
 3446|  1.03k|	    memcpy(buffer, buf, len);
 3447|  3.46M|	    while (xmlIsNameChar(c, old10)) {
  ------------------
  |  Branch (3447:13): [True: 3.46M, False: 954]
  ------------------
 3448|  3.46M|		if (len + 10 > max) {
  ------------------
  |  Branch (3448:7): [True: 2.29k, False: 3.45M]
  ------------------
 3449|  2.29k|		    xmlChar *tmp;
 3450|  2.29k|                    int newSize;
 3451|       |
 3452|  2.29k|                    newSize = xmlGrowCapacity(max, 1, 1, maxLength);
 3453|  2.29k|                    if (newSize < 0) {
  ------------------
  |  Branch (3453:25): [True: 81, False: 2.21k]
  ------------------
 3454|     81|                        xmlFatalErr(ctxt, XML_ERR_NAME_TOO_LONG, "NmToken");
 3455|     81|                        xmlFree(buffer);
 3456|     81|                        return(NULL);
 3457|     81|                    }
 3458|  2.21k|		    tmp = xmlRealloc(buffer, newSize);
 3459|  2.21k|		    if (tmp == NULL) {
  ------------------
  |  Branch (3459:11): [True: 1, False: 2.21k]
  ------------------
 3460|      1|			xmlErrMemory(ctxt);
 3461|      1|			xmlFree(buffer);
 3462|      1|			return(NULL);
 3463|      1|		    }
 3464|  2.21k|		    buffer = tmp;
 3465|  2.21k|                    max = newSize;
 3466|  2.21k|		}
 3467|  3.46M|		COPY_BUF(buffer, len, c);
  ------------------
  |  | 2333|  3.46M|    if (v < 0x80) b[i++] = v;						\
  |  |  ------------------
  |  |  |  Branch (2333:9): [True: 780k, False: 2.68M]
  |  |  ------------------
  |  | 2334|  3.46M|    else i += xmlCopyCharMultiByte(&b[i],v)
  ------------------
 3468|  3.46M|		NEXTL(l);
  ------------------
  |  | 2325|  3.46M|#define NEXTL(l) do {							\
  |  | 2326|  3.46M|    if (*(ctxt->input->cur) == '\n') {					\
  |  |  ------------------
  |  |  |  Branch (2326:9): [True: 0, False: 3.46M]
  |  |  ------------------
  |  | 2327|      0|	ctxt->input->line++; ctxt->input->col = 1;			\
  |  | 2328|  3.46M|    } else ctxt->input->col++;						\
  |  | 2329|  3.46M|    ctxt->input->cur += l;				\
  |  | 2330|  3.46M|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2330:12): [Folded, False: 3.46M]
  |  |  ------------------
  ------------------
 3469|  3.46M|		c = xmlCurrentChar(ctxt, &l);
 3470|  3.46M|	    }
 3471|    954|	    buffer[len] = 0;
 3472|    954|	    return(buffer);
 3473|  1.03k|	}
 3474|   162k|    }
 3475|  54.5k|    if (len == 0)
  ------------------
  |  Branch (3475:9): [True: 6.96k, False: 47.5k]
  ------------------
 3476|  6.96k|        return(NULL);
 3477|  47.5k|    if (len > maxLength) {
  ------------------
  |  Branch (3477:9): [True: 0, False: 47.5k]
  ------------------
 3478|      0|        xmlFatalErr(ctxt, XML_ERR_NAME_TOO_LONG, "NmToken");
 3479|      0|        return(NULL);
 3480|      0|    }
 3481|  47.5k|    ret = xmlStrndup(buf, len);
 3482|  47.5k|    if (ret == NULL)
  ------------------
  |  Branch (3482:9): [True: 3, False: 47.5k]
  ------------------
 3483|      3|        xmlErrMemory(ctxt);
 3484|  47.5k|    return(ret);
 3485|  47.5k|}
xmlParseEntityValue:
 3647|   141k|xmlParseEntityValue(xmlParserCtxt *ctxt, xmlChar **orig) {
 3648|   141k|    unsigned maxLength = (ctxt->options & XML_PARSE_HUGE) ?
  ------------------
  |  Branch (3648:26): [True: 39.4k, False: 102k]
  ------------------
 3649|  39.4k|                         XML_MAX_HUGE_LENGTH :
  ------------------
  |  |   55|  39.4k|#define XML_MAX_HUGE_LENGTH 1000000000
  ------------------
 3650|   141k|                         XML_MAX_TEXT_LENGTH;
  ------------------
  |  |   50|   244k|#define XML_MAX_TEXT_LENGTH 10000000
  ------------------
 3651|   141k|    xmlSBuf buf;
 3652|   141k|    const xmlChar *start;
 3653|   141k|    int quote, length;
 3654|       |
 3655|   141k|    xmlSBufInit(&buf, maxLength);
 3656|       |
 3657|   141k|    GROW;
  ------------------
  |  | 2308|   141k|    if ((!PARSER_PROGRESSIVE(ctxt)) && \
  |  |  ------------------
  |  |  |  |   47|   141k|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|   141k|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2308:9): [True: 128k, False: 12.9k]
  |  |  ------------------
  |  | 2309|   141k|        (ctxt->input->end - ctxt->input->cur < INPUT_CHUNK)) \
  |  |  ------------------
  |  |  |  |   63|   128k|#define INPUT_CHUNK	250
  |  |  ------------------
  |  |  |  Branch (2309:9): [True: 22.1k, False: 106k]
  |  |  ------------------
  |  | 2310|   141k|	xmlParserGrow(ctxt);
  ------------------
 3658|       |
 3659|   141k|    quote = CUR;
  ------------------
  |  | 2262|   141k|#define CUR (*ctxt->input->cur)
  ------------------
 3660|   141k|    if ((quote != '"') && (quote != '\'')) {
  ------------------
  |  Branch (3660:9): [True: 4.26k, False: 137k]
  |  Branch (3660:27): [True: 0, False: 4.26k]
  ------------------
 3661|      0|	xmlFatalErr(ctxt, XML_ERR_ATTRIBUTE_NOT_STARTED, NULL);
 3662|      0|	return(NULL);
 3663|      0|    }
 3664|   141k|    CUR_PTR++;
  ------------------
  |  | 2264|   141k|#define CUR_PTR ctxt->input->cur
  ------------------
 3665|       |
 3666|   141k|    length = 0;
 3667|       |
 3668|       |    /*
 3669|       |     * Copy raw content of the entity into a buffer
 3670|       |     */
 3671|   137M|    while (1) {
  ------------------
  |  Branch (3671:12): [True: 137M, Folded]
  ------------------
 3672|   137M|        int c;
 3673|       |
 3674|   137M|        if (PARSER_STOPPED(ctxt))
  ------------------
  |  |   44|   137M|#define PARSER_STOPPED(ctxt) ((ctxt)->disableSAX > 1)
  |  |  ------------------
  |  |  |  Branch (44:30): [True: 3, False: 137M]
  |  |  ------------------
  ------------------
 3675|      3|            goto error;
 3676|       |
 3677|   137M|        if (CUR_PTR >= ctxt->input->end) {
  ------------------
  |  | 2264|   137M|#define CUR_PTR ctxt->input->cur
  ------------------
  |  Branch (3677:13): [True: 3.04k, False: 137M]
  ------------------
 3678|  3.04k|            xmlFatalErrMsg(ctxt, XML_ERR_ENTITY_NOT_FINISHED, NULL);
 3679|  3.04k|            goto error;
 3680|  3.04k|        }
 3681|       |
 3682|   137M|        c = CUR;
  ------------------
  |  | 2262|   137M|#define CUR (*ctxt->input->cur)
  ------------------
 3683|       |
 3684|   137M|        if (c == 0) {
  ------------------
  |  Branch (3684:13): [True: 387, False: 137M]
  ------------------
 3685|    387|            xmlFatalErrMsg(ctxt, XML_ERR_INVALID_CHAR,
 3686|    387|                    "invalid character in entity value\n");
 3687|    387|            goto error;
 3688|    387|        }
 3689|   137M|        if (c == quote)
  ------------------
  |  Branch (3689:13): [True: 138k, False: 137M]
  ------------------
 3690|   138k|            break;
 3691|   137M|        NEXTL(1);
  ------------------
  |  | 2325|   137M|#define NEXTL(l) do {							\
  |  | 2326|   137M|    if (*(ctxt->input->cur) == '\n') {					\
  |  |  ------------------
  |  |  |  Branch (2326:9): [True: 5.20M, False: 132M]
  |  |  ------------------
  |  | 2327|  5.20M|	ctxt->input->line++; ctxt->input->col = 1;			\
  |  | 2328|   132M|    } else ctxt->input->col++;						\
  |  | 2329|   137M|    ctxt->input->cur += l;				\
  |  | 2330|   137M|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2330:12): [Folded, False: 137M]
  |  |  ------------------
  ------------------
 3692|   137M|        length += 1;
 3693|       |
 3694|       |        /*
 3695|       |         * TODO: Check growth threshold
 3696|       |         */
 3697|   137M|        if (ctxt->input->end - CUR_PTR < 10)
  ------------------
  |  | 2264|   137M|#define CUR_PTR ctxt->input->cur
  ------------------
  |  Branch (3697:13): [True: 78.4k, False: 137M]
  ------------------
 3698|  78.4k|            GROW;
  ------------------
  |  | 2308|  78.4k|    if ((!PARSER_PROGRESSIVE(ctxt)) && \
  |  |  ------------------
  |  |  |  |   47|  78.4k|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|  78.4k|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2308:9): [True: 75.0k, False: 3.32k]
  |  |  ------------------
  |  | 2309|  78.4k|        (ctxt->input->end - ctxt->input->cur < INPUT_CHUNK)) \
  |  |  ------------------
  |  |  |  |   63|  75.0k|#define INPUT_CHUNK	250
  |  |  ------------------
  |  |  |  Branch (2309:9): [True: 75.0k, False: 0]
  |  |  ------------------
  |  | 2310|  78.4k|	xmlParserGrow(ctxt);
  ------------------
 3699|   137M|    }
 3700|       |
 3701|   138k|    start = CUR_PTR - length;
  ------------------
  |  | 2264|   138k|#define CUR_PTR ctxt->input->cur
  ------------------
 3702|       |
 3703|   138k|    if (orig != NULL) {
  ------------------
  |  Branch (3703:9): [True: 138k, False: 0]
  ------------------
 3704|   138k|        *orig = xmlStrndup(start, length);
 3705|   138k|        if (*orig == NULL)
  ------------------
  |  Branch (3705:13): [True: 1, False: 138k]
  ------------------
 3706|      1|            xmlErrMemory(ctxt);
 3707|   138k|    }
 3708|       |
 3709|   138k|    xmlExpandPEsInEntityValue(ctxt, &buf, start, length, ctxt->inputNr);
 3710|       |
 3711|   138k|    NEXTL(1);
  ------------------
  |  | 2325|   138k|#define NEXTL(l) do {							\
  |  | 2326|   138k|    if (*(ctxt->input->cur) == '\n') {					\
  |  |  ------------------
  |  |  |  Branch (2326:9): [True: 0, False: 138k]
  |  |  ------------------
  |  | 2327|      0|	ctxt->input->line++; ctxt->input->col = 1;			\
  |  | 2328|   138k|    } else ctxt->input->col++;						\
  |  | 2329|   138k|    ctxt->input->cur += l;				\
  |  | 2330|   138k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2330:12): [Folded, False: 138k]
  |  |  ------------------
  ------------------
 3712|       |
 3713|   138k|    return(xmlSBufFinish(&buf, NULL, ctxt, "entity length too long"));
 3714|       |
 3715|  3.43k|error:
 3716|  3.43k|    xmlSBufCleanup(&buf, ctxt, "entity length too long");
 3717|       |    return(NULL);
 3718|   141k|}
xmlExpandEntitiesInAttValue:
 4000|  24.6k|                            int normalize) {
 4001|  24.6k|    unsigned maxLength = (ctxt->options & XML_PARSE_HUGE) ?
  ------------------
  |  Branch (4001:26): [True: 10.4k, False: 14.2k]
  ------------------
 4002|  10.4k|                         XML_MAX_HUGE_LENGTH :
  ------------------
  |  |   55|  10.4k|#define XML_MAX_HUGE_LENGTH 1000000000
  ------------------
 4003|  24.6k|                         XML_MAX_TEXT_LENGTH;
  ------------------
  |  |   50|  38.9k|#define XML_MAX_TEXT_LENGTH 10000000
  ------------------
 4004|  24.6k|    xmlSBuf buf;
 4005|  24.6k|    int inSpace = 1;
 4006|       |
 4007|  24.6k|    xmlSBufInit(&buf, maxLength);
 4008|       |
 4009|  24.6k|    xmlExpandEntityInAttValue(ctxt, &buf, str, NULL, normalize, &inSpace,
 4010|  24.6k|                              ctxt->inputNr, /* check */ 0);
 4011|       |
 4012|  24.6k|    if ((normalize) && (inSpace) && (buf.size > 0))
  ------------------
  |  Branch (4012:9): [True: 0, False: 24.6k]
  |  Branch (4012:24): [True: 0, False: 0]
  |  Branch (4012:37): [True: 0, False: 0]
  ------------------
 4013|      0|        buf.size--;
 4014|       |
 4015|       |    return(xmlSBufFinish(&buf, NULL, ctxt, "AttValue length too long"));
 4016|  24.6k|}
xmlParseAttValue:
 4333|   180k|xmlParseAttValue(xmlParserCtxt *ctxt) {
 4334|   180k|    if ((ctxt == NULL) || (ctxt->input == NULL)) return(NULL);
  ------------------
  |  Branch (4334:9): [True: 0, False: 180k]
  |  Branch (4334:27): [True: 0, False: 180k]
  ------------------
 4335|   180k|    return(xmlParseAttValueInternal(ctxt, NULL, NULL, 0, 0));
 4336|   180k|}
xmlParseSystemLiteral:
 4350|  21.7k|xmlParseSystemLiteral(xmlParserCtxt *ctxt) {
 4351|  21.7k|    xmlChar *buf = NULL;
 4352|  21.7k|    int len = 0;
 4353|  21.7k|    int size = XML_PARSER_BUFFER_SIZE;
  ------------------
  |  |  172|  21.7k|#define XML_PARSER_BUFFER_SIZE 100
  ------------------
 4354|  21.7k|    int cur, l;
 4355|  21.7k|    int maxLength = (ctxt->options & XML_PARSE_HUGE) ?
  ------------------
  |  Branch (4355:21): [True: 8.69k, False: 13.0k]
  ------------------
 4356|  8.69k|                    XML_MAX_TEXT_LENGTH :
  ------------------
  |  |   50|  8.69k|#define XML_MAX_TEXT_LENGTH 10000000
  ------------------
 4357|  21.7k|                    XML_MAX_NAME_LENGTH;
  ------------------
  |  |   65|  13.0k|#define XML_MAX_NAME_LENGTH 50000
  ------------------
 4358|  21.7k|    xmlChar stop;
 4359|       |
 4360|  21.7k|    if (RAW == '"') {
  ------------------
  |  | 2261|  21.7k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (4360:9): [True: 10.9k, False: 10.8k]
  ------------------
 4361|  10.9k|        NEXT;
  ------------------
  |  | 2316|  10.9k|#define NEXT xmlNextChar(ctxt)
  ------------------
 4362|  10.9k|	stop = '"';
 4363|  10.9k|    } else if (RAW == '\'') {
  ------------------
  |  | 2261|  10.8k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (4363:16): [True: 8.30k, False: 2.51k]
  ------------------
 4364|  8.30k|        NEXT;
  ------------------
  |  | 2316|  8.30k|#define NEXT xmlNextChar(ctxt)
  ------------------
 4365|  8.30k|	stop = '\'';
 4366|  8.30k|    } else {
 4367|  2.51k|	xmlFatalErr(ctxt, XML_ERR_LITERAL_NOT_STARTED, NULL);
 4368|  2.51k|	return(NULL);
 4369|  2.51k|    }
 4370|       |
 4371|  19.2k|    buf = xmlMalloc(size);
 4372|  19.2k|    if (buf == NULL) {
  ------------------
  |  Branch (4372:9): [True: 4, False: 19.2k]
  ------------------
 4373|      4|        xmlErrMemory(ctxt);
 4374|      4|	return(NULL);
 4375|      4|    }
 4376|  19.2k|    cur = xmlCurrentCharRecover(ctxt, &l);
 4377|  4.33M|    while ((IS_CHAR(cur)) && (cur != stop)) { /* checked */
  ------------------
  |  |  115|  4.33M|#define IS_CHAR(c)   xmlIsCharQ(c)
  |  |  ------------------
  |  |  |  |  117|  4.33M|#define xmlIsCharQ(c)		(((c) < 0x100) ? \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (117:25): [True: 1.14M, False: 3.18M]
  |  |  |  |  ------------------
  |  |  |  |  118|  4.33M|				 xmlIsChar_ch((c)) :\
  |  |  |  |  ------------------
  |  |  |  |  |  |  108|  1.14M|#define xmlIsChar_ch(c)		(((0x9 <= (c)) && ((c) <= 0xa)) || \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (108:28): [True: 1.14M, False: 2.55k]
  |  |  |  |  |  |  |  Branch (108:44): [True: 2.07k, False: 1.14M]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  109|  1.14M|				 ((c) == 0xd) || \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (109:6): [True: 0, False: 1.14M]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  110|  1.14M|				  (0x20 <= (c)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (110:7): [True: 1.14M, False: 2.56k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  119|  4.33M|				(((0x100 <= (c)) && ((c) <= 0xd7ff)) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (119:7): [True: 3.18M, False: 0]
  |  |  |  |  |  Branch (119:25): [True: 8.96k, False: 3.17M]
  |  |  |  |  ------------------
  |  |  |  |  120|  3.18M|				 ((0xe000 <= (c)) && ((c) <= 0xfffd)) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (120:7): [True: 3.17M, False: 0]
  |  |  |  |  |  Branch (120:26): [True: 3.17M, False: 528]
  |  |  |  |  ------------------
  |  |  |  |  121|  3.18M|				 ((0x10000 <= (c)) && ((c) <= 0x10ffff))))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (121:7): [True: 527, False: 1]
  |  |  |  |  |  Branch (121:27): [True: 527, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (4377:12): [True: 4.33M, False: 2.56k]
  |  Branch (4377:30): [True: 4.31M, False: 16.5k]
  ------------------
 4378|  4.31M|	if (len + 5 >= size) {
  ------------------
  |  Branch (4378:6): [True: 4.04k, False: 4.31M]
  ------------------
 4379|  4.04k|	    xmlChar *tmp;
 4380|  4.04k|            int newSize;
 4381|       |
 4382|  4.04k|            newSize = xmlGrowCapacity(size, 1, 1, maxLength);
 4383|  4.04k|            if (newSize < 0) {
  ------------------
  |  Branch (4383:17): [True: 91, False: 3.95k]
  ------------------
 4384|     91|                xmlFatalErr(ctxt, XML_ERR_NAME_TOO_LONG, "SystemLiteral");
 4385|     91|                xmlFree(buf);
 4386|     91|                return(NULL);
 4387|     91|            }
 4388|  3.95k|	    tmp = xmlRealloc(buf, newSize);
 4389|  3.95k|	    if (tmp == NULL) {
  ------------------
  |  Branch (4389:10): [True: 1, False: 3.95k]
  ------------------
 4390|      1|	        xmlFree(buf);
 4391|      1|		xmlErrMemory(ctxt);
 4392|      1|		return(NULL);
 4393|      1|	    }
 4394|  3.95k|	    buf = tmp;
 4395|  3.95k|            size = newSize;
 4396|  3.95k|	}
 4397|  4.31M|	COPY_BUF(buf, len, cur);
  ------------------
  |  | 2333|  4.31M|    if (v < 0x80) b[i++] = v;						\
  |  |  ------------------
  |  |  |  Branch (2333:9): [True: 175k, False: 4.13M]
  |  |  ------------------
  |  | 2334|  4.31M|    else i += xmlCopyCharMultiByte(&b[i],v)
  ------------------
 4398|  4.31M|	NEXTL(l);
  ------------------
  |  | 2325|  4.31M|#define NEXTL(l) do {							\
  |  | 2326|  4.31M|    if (*(ctxt->input->cur) == '\n') {					\
  |  |  ------------------
  |  |  |  Branch (2326:9): [True: 1.50k, False: 4.31M]
  |  |  ------------------
  |  | 2327|  1.50k|	ctxt->input->line++; ctxt->input->col = 1;			\
  |  | 2328|  4.31M|    } else ctxt->input->col++;						\
  |  | 2329|  4.31M|    ctxt->input->cur += l;				\
  |  | 2330|  4.31M|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2330:12): [Folded, False: 4.31M]
  |  |  ------------------
  ------------------
 4399|  4.31M|	cur = xmlCurrentCharRecover(ctxt, &l);
 4400|  4.31M|    }
 4401|  19.1k|    buf[len] = 0;
 4402|  19.1k|    if (!IS_CHAR(cur)) {
  ------------------
  |  |  115|  19.1k|#define IS_CHAR(c)   xmlIsCharQ(c)
  |  |  ------------------
  |  |  |  |  117|  19.1k|#define xmlIsCharQ(c)		(((c) < 0x100) ? \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (117:25): [True: 19.1k, False: 1]
  |  |  |  |  ------------------
  |  |  |  |  118|  19.1k|				 xmlIsChar_ch((c)) :\
  |  |  |  |  ------------------
  |  |  |  |  |  |  108|  19.1k|#define xmlIsChar_ch(c)		(((0x9 <= (c)) && ((c) <= 0xa)) || \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (108:28): [True: 16.6k, False: 2.55k]
  |  |  |  |  |  |  |  Branch (108:44): [True: 0, False: 16.6k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  109|  19.1k|				 ((c) == 0xd) || \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (109:6): [True: 0, False: 19.1k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  110|  19.1k|				  (0x20 <= (c)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (110:7): [True: 16.5k, False: 2.56k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  119|  19.1k|				(((0x100 <= (c)) && ((c) <= 0xd7ff)) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (119:7): [True: 1, False: 0]
  |  |  |  |  |  Branch (119:25): [True: 0, False: 1]
  |  |  |  |  ------------------
  |  |  |  |  120|      1|				 ((0xe000 <= (c)) && ((c) <= 0xfffd)) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (120:7): [True: 1, False: 0]
  |  |  |  |  |  Branch (120:26): [True: 0, False: 1]
  |  |  |  |  ------------------
  |  |  |  |  121|      1|				 ((0x10000 <= (c)) && ((c) <= 0x10ffff))))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (121:7): [True: 0, False: 1]
  |  |  |  |  |  Branch (121:27): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (4402:9): [True: 2.56k, False: 16.5k]
  ------------------
 4403|  2.56k|	xmlFatalErr(ctxt, XML_ERR_LITERAL_NOT_FINISHED, NULL);
 4404|  16.5k|    } else {
 4405|  16.5k|	NEXT;
  ------------------
  |  | 2316|  16.5k|#define NEXT xmlNextChar(ctxt)
  ------------------
 4406|  16.5k|    }
 4407|  19.1k|    return(buf);
 4408|  19.2k|}
xmlParsePubidLiteral:
 4422|  7.97k|xmlParsePubidLiteral(xmlParserCtxt *ctxt) {
 4423|  7.97k|    xmlChar *buf = NULL;
 4424|  7.97k|    int len = 0;
 4425|  7.97k|    int size = XML_PARSER_BUFFER_SIZE;
  ------------------
  |  |  172|  7.97k|#define XML_PARSER_BUFFER_SIZE 100
  ------------------
 4426|  7.97k|    int maxLength = (ctxt->options & XML_PARSE_HUGE) ?
  ------------------
  |  Branch (4426:21): [True: 1.99k, False: 5.97k]
  ------------------
 4427|  1.99k|                    XML_MAX_TEXT_LENGTH :
  ------------------
  |  |   50|  1.99k|#define XML_MAX_TEXT_LENGTH 10000000
  ------------------
 4428|  7.97k|                    XML_MAX_NAME_LENGTH;
  ------------------
  |  |   65|  5.97k|#define XML_MAX_NAME_LENGTH 50000
  ------------------
 4429|  7.97k|    xmlChar cur;
 4430|  7.97k|    xmlChar stop;
 4431|       |
 4432|  7.97k|    if (RAW == '"') {
  ------------------
  |  | 2261|  7.97k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (4432:9): [True: 1.05k, False: 6.92k]
  ------------------
 4433|  1.05k|        NEXT;
  ------------------
  |  | 2316|  1.05k|#define NEXT xmlNextChar(ctxt)
  ------------------
 4434|  1.05k|	stop = '"';
 4435|  6.92k|    } else if (RAW == '\'') {
  ------------------
  |  | 2261|  6.92k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (4435:16): [True: 6.46k, False: 459]
  ------------------
 4436|  6.46k|        NEXT;
  ------------------
  |  | 2316|  6.46k|#define NEXT xmlNextChar(ctxt)
  ------------------
 4437|  6.46k|	stop = '\'';
 4438|  6.46k|    } else {
 4439|    459|	xmlFatalErr(ctxt, XML_ERR_LITERAL_NOT_STARTED, NULL);
 4440|    459|	return(NULL);
 4441|    459|    }
 4442|  7.51k|    buf = xmlMalloc(size);
 4443|  7.51k|    if (buf == NULL) {
  ------------------
  |  Branch (4443:9): [True: 1, False: 7.51k]
  ------------------
 4444|      1|	xmlErrMemory(ctxt);
 4445|      1|	return(NULL);
 4446|      1|    }
 4447|  7.51k|    cur = CUR;
  ------------------
  |  | 2262|  7.51k|#define CUR (*ctxt->input->cur)
  ------------------
 4448|   657k|    while ((IS_PUBIDCHAR_CH(cur)) && (cur != stop) &&
  ------------------
  |  |  246|   657k|#define IS_PUBIDCHAR_CH(c) xmlIsPubidChar_ch(c)
  |  |  ------------------
  |  |  |  |  180|   657k|#define xmlIsPubidChar_ch(c)	(xmlIsPubidChar_tab[(c)])
  |  |  ------------------
  ------------------
  |  Branch (4448:12): [True: 656k, False: 1.70k]
  |  Branch (4448:38): [True: 650k, False: 5.80k]
  ------------------
 4449|   650k|           (PARSER_STOPPED(ctxt) == 0)) { /* checked */
  ------------------
  |  |   44|   650k|#define PARSER_STOPPED(ctxt) ((ctxt)->disableSAX > 1)
  ------------------
  |  Branch (4449:12): [True: 650k, False: 2]
  ------------------
 4450|   650k|	if (len + 1 >= size) {
  ------------------
  |  Branch (4450:6): [True: 538, False: 649k]
  ------------------
 4451|    538|	    xmlChar *tmp;
 4452|    538|            int newSize;
 4453|       |
 4454|    538|	    newSize = xmlGrowCapacity(size, 1, 1, maxLength);
 4455|    538|            if (newSize < 0) {
  ------------------
  |  Branch (4455:17): [True: 1, False: 537]
  ------------------
 4456|      1|                xmlFatalErr(ctxt, XML_ERR_NAME_TOO_LONG, "Public ID");
 4457|      1|                xmlFree(buf);
 4458|      1|                return(NULL);
 4459|      1|            }
 4460|    537|	    tmp = xmlRealloc(buf, newSize);
 4461|    537|	    if (tmp == NULL) {
  ------------------
  |  Branch (4461:10): [True: 2, False: 535]
  ------------------
 4462|      2|		xmlErrMemory(ctxt);
 4463|      2|		xmlFree(buf);
 4464|      2|		return(NULL);
 4465|      2|	    }
 4466|    535|	    buf = tmp;
 4467|    535|            size = newSize;
 4468|    535|	}
 4469|   650k|	buf[len++] = cur;
 4470|   650k|	NEXT;
  ------------------
  |  | 2316|   650k|#define NEXT xmlNextChar(ctxt)
  ------------------
 4471|   650k|	cur = CUR;
  ------------------
  |  | 2262|   650k|#define CUR (*ctxt->input->cur)
  ------------------
 4472|   650k|    }
 4473|  7.51k|    buf[len] = 0;
 4474|  7.51k|    if (cur != stop) {
  ------------------
  |  Branch (4474:9): [True: 973, False: 6.54k]
  ------------------
 4475|    973|	xmlFatalErr(ctxt, XML_ERR_LITERAL_NOT_FINISHED, NULL);
 4476|  6.54k|    } else {
 4477|  6.54k|	NEXTL(1);
  ------------------
  |  | 2325|  6.54k|#define NEXTL(l) do {							\
  |  | 2326|  6.54k|    if (*(ctxt->input->cur) == '\n') {					\
  |  |  ------------------
  |  |  |  Branch (2326:9): [True: 0, False: 6.54k]
  |  |  ------------------
  |  | 2327|      0|	ctxt->input->line++; ctxt->input->col = 1;			\
  |  | 2328|  6.54k|    } else ctxt->input->col++;						\
  |  | 2329|  6.54k|    ctxt->input->cur += l;				\
  |  | 2330|  6.54k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2330:12): [Folded, False: 6.54k]
  |  |  ------------------
  ------------------
 4478|  6.54k|    }
 4479|  7.51k|    return(buf);
 4480|  7.51k|}
xmlParseExternalID:
 4792|  45.9k|xmlParseExternalID(xmlParserCtxt *ctxt, xmlChar **publicId, int strict) {
 4793|  45.9k|    xmlChar *URI = NULL;
 4794|       |
 4795|  45.9k|    *publicId = NULL;
 4796|  45.9k|    if (CMP6(CUR_PTR, 'S', 'Y', 'S', 'T', 'E', 'M')) {
  ------------------
  |  | 2273|  45.9k|  ( CMP5( s, c1, c2, c3, c4, c5 ) && ((unsigned char *) s)[ 5 ] == c6 )
  |  |  ------------------
  |  |  |  | 2271|  91.8k|  ( CMP4( s, c1, c2, c3, c4 ) && ((unsigned char *) s)[ 4 ] == c5 )
  |  |  |  |  ------------------
  |  |  |  |  |  | 2268|  91.8k|  ( ((unsigned char *) s)[ 0 ] == c1 && ((unsigned char *) s)[ 1 ] == c2 && \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (2268:5): [True: 15.5k, False: 30.3k]
  |  |  |  |  |  |  |  Branch (2268:41): [True: 15.5k, False: 6]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 2269|  45.9k|    ((unsigned char *) s)[ 2 ] == c3 && ((unsigned char *) s)[ 3 ] == c4 )
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (2269:5): [True: 15.5k, False: 5]
  |  |  |  |  |  |  |  Branch (2269:41): [True: 15.5k, False: 9]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2271:34): [True: 15.5k, False: 7]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2273:38): [True: 15.5k, False: 5]
  |  |  ------------------
  ------------------
 4797|  15.5k|        SKIP(6);
  ------------------
  |  | 2285|  15.5k|#define SKIP(val) do {							\
  |  | 2286|  15.5k|    ctxt->input->cur += (val),ctxt->input->col+=(val);			\
  |  | 2287|  15.5k|    if (*ctxt->input->cur == 0)						\
  |  |  ------------------
  |  |  |  Branch (2287:9): [True: 217, False: 15.3k]
  |  |  ------------------
  |  | 2288|  15.5k|        xmlParserGrow(ctxt);						\
  |  | 2289|  15.5k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2289:12): [Folded, False: 15.5k]
  |  |  ------------------
  ------------------
 4798|  15.5k|	if (SKIP_BLANKS == 0) {
  ------------------
  |  | 2312|  15.5k|#define SKIP_BLANKS xmlSkipBlankChars(ctxt)
  ------------------
  |  Branch (4798:6): [True: 809, False: 14.7k]
  ------------------
 4799|    809|	    xmlFatalErrMsg(ctxt, XML_ERR_SPACE_REQUIRED,
 4800|    809|	                   "Space required after 'SYSTEM'\n");
 4801|    809|	}
 4802|  15.5k|	URI = xmlParseSystemLiteral(ctxt);
 4803|  15.5k|	if (URI == NULL) {
  ------------------
  |  Branch (4803:6): [True: 780, False: 14.7k]
  ------------------
 4804|    780|	    xmlFatalErr(ctxt, XML_ERR_URI_REQUIRED, NULL);
 4805|    780|        }
 4806|  30.3k|    } else if (CMP6(CUR_PTR, 'P', 'U', 'B', 'L', 'I', 'C')) {
  ------------------
  |  | 2273|  30.3k|  ( CMP5( s, c1, c2, c3, c4, c5 ) && ((unsigned char *) s)[ 5 ] == c6 )
  |  |  ------------------
  |  |  |  | 2271|  60.7k|  ( CMP4( s, c1, c2, c3, c4 ) && ((unsigned char *) s)[ 4 ] == c5 )
  |  |  |  |  ------------------
  |  |  |  |  |  | 2268|  60.7k|  ( ((unsigned char *) s)[ 0 ] == c1 && ((unsigned char *) s)[ 1 ] == c2 && \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (2268:5): [True: 8.00k, False: 22.3k]
  |  |  |  |  |  |  |  Branch (2268:41): [True: 7.99k, False: 3]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 2269|  30.3k|    ((unsigned char *) s)[ 2 ] == c3 && ((unsigned char *) s)[ 3 ] == c4 )
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (2269:5): [True: 7.99k, False: 6]
  |  |  |  |  |  |  |  Branch (2269:41): [True: 7.99k, False: 3]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2271:34): [True: 7.98k, False: 10]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2273:38): [True: 7.97k, False: 3]
  |  |  ------------------
  ------------------
 4807|  7.97k|        SKIP(6);
  ------------------
  |  | 2285|  7.97k|#define SKIP(val) do {							\
  |  | 2286|  7.97k|    ctxt->input->cur += (val),ctxt->input->col+=(val);			\
  |  | 2287|  7.97k|    if (*ctxt->input->cur == 0)						\
  |  |  ------------------
  |  |  |  Branch (2287:9): [True: 256, False: 7.72k]
  |  |  ------------------
  |  | 2288|  7.97k|        xmlParserGrow(ctxt);						\
  |  | 2289|  7.97k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2289:12): [Folded, False: 7.97k]
  |  |  ------------------
  ------------------
 4808|  7.97k|	if (SKIP_BLANKS == 0) {
  ------------------
  |  | 2312|  7.97k|#define SKIP_BLANKS xmlSkipBlankChars(ctxt)
  ------------------
  |  Branch (4808:6): [True: 2.29k, False: 5.68k]
  ------------------
 4809|  2.29k|	    xmlFatalErrMsg(ctxt, XML_ERR_SPACE_REQUIRED,
 4810|  2.29k|		    "Space required after 'PUBLIC'\n");
 4811|  2.29k|	}
 4812|  7.97k|	*publicId = xmlParsePubidLiteral(ctxt);
 4813|  7.97k|	if (*publicId == NULL) {
  ------------------
  |  Branch (4813:6): [True: 463, False: 7.51k]
  ------------------
 4814|    463|	    xmlFatalErr(ctxt, XML_ERR_PUBID_REQUIRED, NULL);
 4815|    463|	}
 4816|  7.97k|	if (strict) {
  ------------------
  |  Branch (4816:6): [True: 6.15k, False: 1.82k]
  ------------------
 4817|       |	    /*
 4818|       |	     * We don't handle [83] so "S SystemLiteral" is required.
 4819|       |	     */
 4820|  6.15k|	    if (SKIP_BLANKS == 0) {
  ------------------
  |  | 2312|  6.15k|#define SKIP_BLANKS xmlSkipBlankChars(ctxt)
  ------------------
  |  Branch (4820:10): [True: 1.95k, False: 4.20k]
  ------------------
 4821|  1.95k|		xmlFatalErrMsg(ctxt, XML_ERR_SPACE_REQUIRED,
 4822|  1.95k|			"Space required after the Public Identifier\n");
 4823|  1.95k|	    }
 4824|  6.15k|	} else {
 4825|       |	    /*
 4826|       |	     * We handle [83] so we return immediately, if
 4827|       |	     * "S SystemLiteral" is not detected. We skip blanks if no
 4828|       |             * system literal was found, but this is harmless since we must
 4829|       |             * be at the end of a NotationDecl.
 4830|       |	     */
 4831|  1.82k|	    if (SKIP_BLANKS == 0) return(NULL);
  ------------------
  |  | 2312|  1.82k|#define SKIP_BLANKS xmlSkipBlankChars(ctxt)
  ------------------
  |  Branch (4831:10): [True: 1.66k, False: 154]
  ------------------
 4832|    154|	    if ((CUR != '\'') && (CUR != '"')) return(NULL);
  ------------------
  |  | 2262|    154|#define CUR (*ctxt->input->cur)
  ------------------
              	    if ((CUR != '\'') && (CUR != '"')) return(NULL);
  ------------------
  |  | 2262|     92|#define CUR (*ctxt->input->cur)
  ------------------
  |  Branch (4832:10): [True: 92, False: 62]
  |  Branch (4832:27): [True: 82, False: 10]
  ------------------
 4833|    154|	}
 4834|  6.22k|	URI = xmlParseSystemLiteral(ctxt);
 4835|  6.22k|	if (URI == NULL) {
  ------------------
  |  Branch (4835:6): [True: 1.83k, False: 4.39k]
  ------------------
 4836|  1.83k|	    xmlFatalErr(ctxt, XML_ERR_URI_REQUIRED, NULL);
 4837|  1.83k|        }
 4838|  6.22k|    }
 4839|  44.1k|    return(URI);
 4840|  45.9k|}
xmlParseComment:
 4969|   360k|xmlParseComment(xmlParserCtxt *ctxt) {
 4970|   360k|    xmlChar *buf = NULL;
 4971|   360k|    size_t size = XML_PARSER_BUFFER_SIZE;
  ------------------
  |  |  172|   360k|#define XML_PARSER_BUFFER_SIZE 100
  ------------------
 4972|   360k|    size_t len = 0;
 4973|   360k|    size_t maxLength = (ctxt->options & XML_PARSE_HUGE) ?
  ------------------
  |  Branch (4973:24): [True: 59.2k, False: 301k]
  ------------------
 4974|  59.2k|                       XML_MAX_HUGE_LENGTH :
  ------------------
  |  |   55|  59.2k|#define XML_MAX_HUGE_LENGTH 1000000000
  ------------------
 4975|   360k|                       XML_MAX_TEXT_LENGTH;
  ------------------
  |  |   50|   661k|#define XML_MAX_TEXT_LENGTH 10000000
  ------------------
 4976|   360k|    const xmlChar *in;
 4977|   360k|    size_t nbchar = 0;
 4978|   360k|    int ccol;
 4979|       |
 4980|       |    /*
 4981|       |     * Check that there is a comment right here.
 4982|       |     */
 4983|   360k|    if ((RAW != '<') || (NXT(1) != '!'))
  ------------------
  |  | 2261|   360k|#define RAW (*ctxt->input->cur)
  ------------------
                  if ((RAW != '<') || (NXT(1) != '!'))
  ------------------
  |  | 2263|   360k|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
  |  Branch (4983:9): [True: 0, False: 360k]
  |  Branch (4983:25): [True: 0, False: 360k]
  ------------------
 4984|      0|        return;
 4985|   360k|    SKIP(2);
  ------------------
  |  | 2285|   360k|#define SKIP(val) do {							\
  |  | 2286|   360k|    ctxt->input->cur += (val),ctxt->input->col+=(val);			\
  |  | 2287|   360k|    if (*ctxt->input->cur == 0)						\
  |  |  ------------------
  |  |  |  Branch (2287:9): [True: 0, False: 360k]
  |  |  ------------------
  |  | 2288|   360k|        xmlParserGrow(ctxt);						\
  |  | 2289|   360k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2289:12): [Folded, False: 360k]
  |  |  ------------------
  ------------------
 4986|   360k|    if ((RAW != '-') || (NXT(1) != '-'))
  ------------------
  |  | 2261|   360k|#define RAW (*ctxt->input->cur)
  ------------------
                  if ((RAW != '-') || (NXT(1) != '-'))
  ------------------
  |  | 2263|   360k|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
  |  Branch (4986:9): [True: 0, False: 360k]
  |  Branch (4986:25): [True: 17, False: 360k]
  ------------------
 4987|     17|        return;
 4988|   360k|    SKIP(2);
  ------------------
  |  | 2285|   360k|#define SKIP(val) do {							\
  |  | 2286|   360k|    ctxt->input->cur += (val),ctxt->input->col+=(val);			\
  |  | 2287|   360k|    if (*ctxt->input->cur == 0)						\
  |  |  ------------------
  |  |  |  Branch (2287:9): [True: 613, False: 359k]
  |  |  ------------------
  |  | 2288|   360k|        xmlParserGrow(ctxt);						\
  |  | 2289|   360k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2289:12): [Folded, False: 360k]
  |  |  ------------------
  ------------------
 4989|   360k|    GROW;
  ------------------
  |  | 2308|   360k|    if ((!PARSER_PROGRESSIVE(ctxt)) && \
  |  |  ------------------
  |  |  |  |   47|   360k|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|   360k|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2308:9): [True: 260k, False: 100k]
  |  |  ------------------
  |  | 2309|   360k|        (ctxt->input->end - ctxt->input->cur < INPUT_CHUNK)) \
  |  |  ------------------
  |  |  |  |   63|   260k|#define INPUT_CHUNK	250
  |  |  ------------------
  |  |  |  Branch (2309:9): [True: 128k, False: 132k]
  |  |  ------------------
  |  | 2310|   360k|	xmlParserGrow(ctxt);
  ------------------
 4990|       |
 4991|       |    /*
 4992|       |     * Accelerated common case where input don't need to be
 4993|       |     * modified before passing it to the handler.
 4994|       |     */
 4995|   360k|    in = ctxt->input->cur;
 4996|   361k|    do {
 4997|   361k|	if (*in == 0xA) {
  ------------------
  |  Branch (4997:6): [True: 542, False: 360k]
  ------------------
 4998|  5.90k|	    do {
 4999|  5.90k|		ctxt->input->line++; ctxt->input->col = 1;
 5000|  5.90k|		in++;
 5001|  5.90k|	    } while (*in == 0xA);
  ------------------
  |  Branch (5001:15): [True: 5.36k, False: 542]
  ------------------
 5002|    542|	}
 5003|  1.11M|get_more:
 5004|  1.11M|        ccol = ctxt->input->col;
 5005|  7.23M|	while (((*in > '-') && (*in <= 0x7F)) ||
  ------------------
  |  Branch (5005:10): [True: 4.99M, False: 2.24M]
  |  Branch (5005:25): [True: 4.91M, False: 77.3k]
  ------------------
 5006|  2.32M|	       ((*in >= 0x20) && (*in < '-')) ||
  ------------------
  |  Branch (5006:10): [True: 2.19M, False: 133k]
  |  Branch (5006:27): [True: 1.20M, False: 987k]
  ------------------
 5007|  6.12M|	       (*in == 0x09)) {
  ------------------
  |  Branch (5007:9): [True: 6.74k, False: 1.11M]
  ------------------
 5008|  6.12M|		    in++;
 5009|  6.12M|		    ccol++;
 5010|  6.12M|	}
 5011|  1.11M|	ctxt->input->col = ccol;
 5012|  1.11M|	if (*in == 0xA) {
  ------------------
  |  Branch (5012:6): [True: 47.0k, False: 1.06M]
  ------------------
 5013|   449k|	    do {
 5014|   449k|		ctxt->input->line++; ctxt->input->col = 1;
 5015|   449k|		in++;
 5016|   449k|	    } while (*in == 0xA);
  ------------------
  |  Branch (5016:15): [True: 402k, False: 47.0k]
  ------------------
 5017|  47.0k|	    goto get_more;
 5018|  47.0k|	}
 5019|  1.06M|	nbchar = in - ctxt->input->cur;
 5020|       |	/*
 5021|       |	 * save current set of data
 5022|       |	 */
 5023|  1.06M|	if (nbchar > 0) {
  ------------------
  |  Branch (5023:6): [True: 823k, False: 243k]
  ------------------
 5024|   823k|            if (nbchar > maxLength - len) {
  ------------------
  |  Branch (5024:17): [True: 0, False: 823k]
  ------------------
 5025|      0|                xmlFatalErrMsgStr(ctxt, XML_ERR_COMMENT_NOT_FINISHED,
 5026|      0|                                  "Comment too big found", NULL);
 5027|      0|                xmlFree(buf);
 5028|      0|                return;
 5029|      0|            }
 5030|   823k|            if (buf == NULL) {
  ------------------
  |  Branch (5030:17): [True: 171k, False: 651k]
  ------------------
 5031|   171k|                if ((*in == '-') && (in[1] == '-'))
  ------------------
  |  Branch (5031:21): [True: 99.8k, False: 71.7k]
  |  Branch (5031:37): [True: 50.9k, False: 48.9k]
  ------------------
 5032|  50.9k|                    size = nbchar + 1;
 5033|   120k|                else
 5034|   120k|                    size = XML_PARSER_BUFFER_SIZE + nbchar;
  ------------------
  |  |  172|   120k|#define XML_PARSER_BUFFER_SIZE 100
  ------------------
 5035|   171k|                buf = xmlMalloc(size);
 5036|   171k|                if (buf == NULL) {
  ------------------
  |  Branch (5036:21): [True: 6, False: 171k]
  ------------------
 5037|      6|                    xmlErrMemory(ctxt);
 5038|      6|                    return;
 5039|      6|                }
 5040|   171k|                len = 0;
 5041|   651k|            } else if (len + nbchar + 1 >= size) {
  ------------------
  |  Branch (5041:24): [True: 11.9k, False: 639k]
  ------------------
 5042|  11.9k|                xmlChar *new_buf;
 5043|  11.9k|                size += len + nbchar + XML_PARSER_BUFFER_SIZE;
  ------------------
  |  |  172|  11.9k|#define XML_PARSER_BUFFER_SIZE 100
  ------------------
 5044|  11.9k|                new_buf = xmlRealloc(buf, size);
 5045|  11.9k|                if (new_buf == NULL) {
  ------------------
  |  Branch (5045:21): [True: 1, False: 11.9k]
  ------------------
 5046|      1|                    xmlErrMemory(ctxt);
 5047|      1|                    xmlFree(buf);
 5048|      1|                    return;
 5049|      1|                }
 5050|  11.9k|                buf = new_buf;
 5051|  11.9k|            }
 5052|   823k|            memcpy(&buf[len], ctxt->input->cur, nbchar);
 5053|   823k|            len += nbchar;
 5054|   823k|            buf[len] = 0;
 5055|   823k|	}
 5056|  1.06M|	ctxt->input->cur = in;
 5057|  1.06M|	if (*in == 0xA) {
  ------------------
  |  Branch (5057:6): [True: 0, False: 1.06M]
  ------------------
 5058|      0|	    in++;
 5059|      0|	    ctxt->input->line++; ctxt->input->col = 1;
 5060|      0|	}
 5061|  1.06M|	if (*in == 0xD) {
  ------------------
  |  Branch (5061:6): [True: 75.8k, False: 991k]
  ------------------
 5062|  75.8k|	    in++;
 5063|  75.8k|	    if (*in == 0xA) {
  ------------------
  |  Branch (5063:10): [True: 14.4k, False: 61.3k]
  ------------------
 5064|  14.4k|		ctxt->input->cur = in;
 5065|  14.4k|		in++;
 5066|  14.4k|		ctxt->input->line++; ctxt->input->col = 1;
 5067|  14.4k|		goto get_more;
 5068|  14.4k|	    }
 5069|  61.3k|	    in--;
 5070|  61.3k|	}
 5071|  1.05M|	SHRINK;
  ------------------
  |  | 2304|  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 (2304:9): [True: 942k, False: 110k]
  |  |  ------------------
  |  | 2305|  1.05M|	xmlParserShrink(ctxt);
  ------------------
 5072|  1.05M|	GROW;
  ------------------
  |  | 2308|  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 (2308:9): [True: 942k, False: 110k]
  |  |  ------------------
  |  | 2309|  1.05M|        (ctxt->input->end - ctxt->input->cur < INPUT_CHUNK)) \
  |  |  ------------------
  |  |  |  |   63|   942k|#define INPUT_CHUNK	250
  |  |  ------------------
  |  |  |  Branch (2309:9): [True: 137k, False: 804k]
  |  |  ------------------
  |  | 2310|  1.05M|	xmlParserGrow(ctxt);
  ------------------
 5073|  1.05M|	in = ctxt->input->cur;
 5074|  1.05M|	if (*in == '-') {
  ------------------
  |  Branch (5074:6): [True: 910k, False: 142k]
  ------------------
 5075|   910k|	    if (in[1] == '-') {
  ------------------
  |  Branch (5075:10): [True: 547k, False: 362k]
  ------------------
 5076|   547k|	        if (in[2] == '>') {
  ------------------
  |  Branch (5076:14): [True: 218k, False: 329k]
  ------------------
 5077|   218k|		    SKIP(3);
  ------------------
  |  | 2285|   218k|#define SKIP(val) do {							\
  |  | 2286|   218k|    ctxt->input->cur += (val),ctxt->input->col+=(val);			\
  |  | 2287|   218k|    if (*ctxt->input->cur == 0)						\
  |  |  ------------------
  |  |  |  Branch (2287:9): [True: 627, False: 218k]
  |  |  ------------------
  |  | 2288|   218k|        xmlParserGrow(ctxt);						\
  |  | 2289|   218k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2289:12): [Folded, False: 218k]
  |  |  ------------------
  ------------------
 5078|   218k|		    if ((ctxt->sax != NULL) && (ctxt->sax->comment != NULL) &&
  ------------------
  |  Branch (5078:11): [True: 218k, False: 0]
  |  Branch (5078:34): [True: 218k, False: 0]
  ------------------
 5079|   218k|		        (!ctxt->disableSAX)) {
  ------------------
  |  Branch (5079:11): [True: 213k, False: 4.71k]
  ------------------
 5080|   213k|			if (buf != NULL)
  ------------------
  |  Branch (5080:8): [True: 45.5k, False: 168k]
  ------------------
 5081|  45.5k|			    ctxt->sax->comment(ctxt->userData, buf);
 5082|   168k|			else
 5083|   168k|			    ctxt->sax->comment(ctxt->userData, BAD_CAST "");
  ------------------
  |  |   34|   168k|#define BAD_CAST (xmlChar *)
  ------------------
 5084|   213k|		    }
 5085|   218k|		    if (buf != NULL)
  ------------------
  |  Branch (5085:11): [True: 48.8k, False: 169k]
  ------------------
 5086|  48.8k|		        xmlFree(buf);
 5087|   218k|		    return;
 5088|   218k|		}
 5089|   329k|		if (buf != NULL) {
  ------------------
  |  Branch (5089:7): [True: 280k, False: 48.6k]
  ------------------
 5090|   280k|		    xmlFatalErrMsgStr(ctxt, XML_ERR_HYPHEN_IN_COMMENT,
 5091|   280k|		                      "Double hyphen within comment: "
 5092|   280k|                                      "<!--%.50s\n",
 5093|   280k|				      buf);
 5094|   280k|		} else
 5095|  48.6k|		    xmlFatalErrMsgStr(ctxt, XML_ERR_HYPHEN_IN_COMMENT,
 5096|  48.6k|		                      "Double hyphen within comment\n", NULL);
 5097|   329k|		in++;
 5098|   329k|		ctxt->input->col++;
 5099|   329k|	    }
 5100|   691k|	    in++;
 5101|   691k|	    ctxt->input->col++;
 5102|   691k|	    goto get_more;
 5103|   910k|	}
 5104|  1.05M|    } while (((*in >= 0x20) && (*in <= 0x7F)) || (*in == 0x09) || (*in == 0x0a));
  ------------------
  |  Branch (5104:15): [True: 77.6k, False: 64.8k]
  |  Branch (5104:32): [True: 312, False: 77.3k]
  |  Branch (5104:50): [True: 296, False: 141k]
  |  Branch (5104:67): [True: 0, False: 141k]
  ------------------
 5105|   141k|    xmlParseCommentComplex(ctxt, buf, len, size);
 5106|   141k|}
xmlParsePITarget:
 5121|   180k|xmlParsePITarget(xmlParserCtxt *ctxt) {
 5122|   180k|    const xmlChar *name;
 5123|       |
 5124|   180k|    name = xmlParseName(ctxt);
 5125|   180k|    if ((name != NULL) &&
  ------------------
  |  Branch (5125:9): [True: 176k, False: 4.48k]
  ------------------
 5126|   176k|        ((name[0] == 'x') || (name[0] == 'X')) &&
  ------------------
  |  Branch (5126:10): [True: 20.7k, False: 155k]
  |  Branch (5126:30): [True: 529, False: 154k]
  ------------------
 5127|  21.2k|        ((name[1] == 'm') || (name[1] == 'M')) &&
  ------------------
  |  Branch (5127:10): [True: 18.6k, False: 2.59k]
  |  Branch (5127:30): [True: 374, False: 2.22k]
  ------------------
 5128|  19.0k|        ((name[2] == 'l') || (name[2] == 'L'))) {
  ------------------
  |  Branch (5128:10): [True: 9.36k, False: 9.67k]
  |  Branch (5128:30): [True: 360, False: 9.31k]
  ------------------
 5129|  9.72k|	int i;
 5130|  9.72k|	if ((name[0] == 'x') && (name[1] == 'm') &&
  ------------------
  |  Branch (5130:6): [True: 9.47k, False: 247]
  |  Branch (5130:26): [True: 9.26k, False: 219]
  ------------------
 5131|  9.26k|	    (name[2] == 'l') && (name[3] == 0)) {
  ------------------
  |  Branch (5131:6): [True: 8.90k, False: 354]
  |  Branch (5131:26): [True: 7.51k, False: 1.39k]
  ------------------
 5132|  7.51k|	    xmlFatalErrMsg(ctxt, XML_ERR_RESERVED_XML_NAME,
 5133|  7.51k|		 "XML declaration allowed only at the start of the document\n");
 5134|  7.51k|	    return(name);
 5135|  7.51k|	} else if (name[3] == 0) {
  ------------------
  |  Branch (5135:13): [True: 598, False: 1.61k]
  ------------------
 5136|    598|	    xmlFatalErr(ctxt, XML_ERR_RESERVED_XML_NAME, NULL);
 5137|    598|	    return(name);
 5138|    598|	}
 5139|  4.27k|	for (i = 0;;i++) {
 5140|  4.27k|	    if (xmlW3CPIs[i] == NULL) break;
  ------------------
  |  Branch (5140:10): [True: 1.32k, False: 2.94k]
  ------------------
 5141|  2.94k|	    if (xmlStrEqual(name, (const xmlChar *)xmlW3CPIs[i]))
  ------------------
  |  Branch (5141:10): [True: 287, False: 2.65k]
  ------------------
 5142|    287|	        return(name);
 5143|  2.94k|	}
 5144|  1.32k|	xmlWarningMsg(ctxt, XML_ERR_RESERVED_XML_NAME,
 5145|  1.32k|		      "xmlParsePITarget: invalid name prefix 'xml'\n",
 5146|  1.32k|		      NULL, NULL);
 5147|  1.32k|    }
 5148|   172k|    if ((name != NULL) && (xmlStrchr(name, ':') != NULL)) {
  ------------------
  |  Branch (5148:9): [True: 167k, False: 4.48k]
  |  Branch (5148:27): [True: 532, False: 167k]
  ------------------
 5149|    532|	xmlNsErr(ctxt, XML_NS_ERR_COLON,
 5150|    532|		 "colons are forbidden from PI names '%s'\n", name, NULL, NULL);
 5151|    532|    }
 5152|   172k|    return(name);
 5153|   180k|}
xmlParsePI:
 5235|   180k|xmlParsePI(xmlParserCtxt *ctxt) {
 5236|   180k|    xmlChar *buf = NULL;
 5237|   180k|    size_t len = 0;
 5238|   180k|    size_t size = XML_PARSER_BUFFER_SIZE;
  ------------------
  |  |  172|   180k|#define XML_PARSER_BUFFER_SIZE 100
  ------------------
 5239|   180k|    size_t maxLength = (ctxt->options & XML_PARSE_HUGE) ?
  ------------------
  |  Branch (5239:24): [True: 50.9k, False: 129k]
  ------------------
 5240|  50.9k|                       XML_MAX_HUGE_LENGTH :
  ------------------
  |  |   55|  50.9k|#define XML_MAX_HUGE_LENGTH 1000000000
  ------------------
 5241|   180k|                       XML_MAX_TEXT_LENGTH;
  ------------------
  |  |   50|   310k|#define XML_MAX_TEXT_LENGTH 10000000
  ------------------
 5242|   180k|    int cur, l;
 5243|   180k|    const xmlChar *target;
 5244|       |
 5245|   180k|    if ((RAW == '<') && (NXT(1) == '?')) {
  ------------------
  |  | 2261|   180k|#define RAW (*ctxt->input->cur)
  ------------------
                  if ((RAW == '<') && (NXT(1) == '?')) {
  ------------------
  |  | 2263|   180k|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
  |  Branch (5245:9): [True: 180k, False: 0]
  |  Branch (5245:25): [True: 180k, False: 0]
  ------------------
 5246|       |	/*
 5247|       |	 * this is a Processing Instruction.
 5248|       |	 */
 5249|   180k|	SKIP(2);
  ------------------
  |  | 2285|   180k|#define SKIP(val) do {							\
  |  | 2286|   180k|    ctxt->input->cur += (val),ctxt->input->col+=(val);			\
  |  | 2287|   180k|    if (*ctxt->input->cur == 0)						\
  |  |  ------------------
  |  |  |  Branch (2287:9): [True: 340, False: 180k]
  |  |  ------------------
  |  | 2288|   180k|        xmlParserGrow(ctxt);						\
  |  | 2289|   180k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2289:12): [Folded, False: 180k]
  |  |  ------------------
  ------------------
 5250|       |
 5251|       |	/*
 5252|       |	 * Parse the target name and check for special support like
 5253|       |	 * namespace.
 5254|       |	 */
 5255|   180k|        target = xmlParsePITarget(ctxt);
 5256|   180k|	if (target != NULL) {
  ------------------
  |  Branch (5256:6): [True: 176k, False: 4.48k]
  ------------------
 5257|   176k|	    if ((RAW == '?') && (NXT(1) == '>')) {
  ------------------
  |  | 2261|   176k|#define RAW (*ctxt->input->cur)
  ------------------
              	    if ((RAW == '?') && (NXT(1) == '>')) {
  ------------------
  |  | 2263|   148k|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
  |  Branch (5257:10): [True: 148k, False: 27.5k]
  |  Branch (5257:26): [True: 148k, False: 478]
  ------------------
 5258|   148k|		SKIP(2);
  ------------------
  |  | 2285|   148k|#define SKIP(val) do {							\
  |  | 2286|   148k|    ctxt->input->cur += (val),ctxt->input->col+=(val);			\
  |  | 2287|   148k|    if (*ctxt->input->cur == 0)						\
  |  |  ------------------
  |  |  |  Branch (2287:9): [True: 1.72k, False: 146k]
  |  |  ------------------
  |  | 2288|   148k|        xmlParserGrow(ctxt);						\
  |  | 2289|   148k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2289:12): [Folded, False: 148k]
  |  |  ------------------
  ------------------
 5259|       |
 5260|       |		/*
 5261|       |		 * SAX: PI detected.
 5262|       |		 */
 5263|   148k|		if ((ctxt->sax) && (!ctxt->disableSAX) &&
  ------------------
  |  Branch (5263:7): [True: 148k, False: 0]
  |  Branch (5263:22): [True: 146k, False: 1.69k]
  ------------------
 5264|   146k|		    (ctxt->sax->processingInstruction != NULL))
  ------------------
  |  Branch (5264:7): [True: 146k, False: 0]
  ------------------
 5265|   146k|		    ctxt->sax->processingInstruction(ctxt->userData,
 5266|   146k|		                                     target, NULL);
 5267|   148k|		return;
 5268|   148k|	    }
 5269|  28.0k|	    buf = xmlMalloc(size);
 5270|  28.0k|	    if (buf == NULL) {
  ------------------
  |  Branch (5270:10): [True: 15, False: 28.0k]
  ------------------
 5271|     15|		xmlErrMemory(ctxt);
 5272|     15|		return;
 5273|     15|	    }
 5274|  28.0k|	    if (SKIP_BLANKS == 0) {
  ------------------
  |  | 2312|  28.0k|#define SKIP_BLANKS xmlSkipBlankChars(ctxt)
  ------------------
  |  Branch (5274:10): [True: 9.44k, False: 18.5k]
  ------------------
 5275|  9.44k|		xmlFatalErrMsgStr(ctxt, XML_ERR_SPACE_REQUIRED,
 5276|  9.44k|			  "ParsePI: PI %s space expected\n", target);
 5277|  9.44k|	    }
 5278|  28.0k|	    cur = xmlCurrentCharRecover(ctxt, &l);
 5279|  8.44M|	    while (IS_CHAR(cur) && /* checked */
  ------------------
  |  |  115|  8.44M|#define IS_CHAR(c)   xmlIsCharQ(c)
  |  |  ------------------
  |  |  |  |  117|  16.8M|#define xmlIsCharQ(c)		(((c) < 0x100) ? \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (117:24): [True: 8.43M, False: 10.3k]
  |  |  |  |  |  Branch (117:25): [True: 965k, False: 7.48M]
  |  |  |  |  ------------------
  |  |  |  |  118|  16.8M|				 xmlIsChar_ch((c)) :\
  |  |  |  |  ------------------
  |  |  |  |  |  |  108|   965k|#define xmlIsChar_ch(c)		(((0x9 <= (c)) && ((c) <= 0xa)) || \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (108:28): [True: 955k, False: 9.99k]
  |  |  |  |  |  |  |  Branch (108:44): [True: 181k, False: 773k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  109|   965k|				 ((c) == 0xd) || \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (109:6): [True: 0, False: 783k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  110|   965k|				  (0x20 <= (c)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (110:7): [True: 773k, False: 10.1k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  119|  16.8M|				(((0x100 <= (c)) && ((c) <= 0xd7ff)) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (119:7): [True: 7.48M, False: 0]
  |  |  |  |  |  Branch (119:25): [True: 2.69M, False: 4.78M]
  |  |  |  |  ------------------
  |  |  |  |  120|  7.48M|				 ((0xe000 <= (c)) && ((c) <= 0xfffd)) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (120:7): [True: 4.78M, False: 0]
  |  |  |  |  |  Branch (120:26): [True: 4.78M, False: 1.84k]
  |  |  |  |  ------------------
  |  |  |  |  121|  7.48M|				 ((0x10000 <= (c)) && ((c) <= 0x10ffff))))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (121:7): [True: 1.63k, False: 214]
  |  |  |  |  |  Branch (121:27): [True: 1.63k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 5280|  8.43M|		   ((cur != '?') || (NXT(1) != '>'))) {
  ------------------
  |  | 2263|  19.5k|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
  |  Branch (5280:7): [True: 8.41M, False: 19.5k]
  |  Branch (5280:23): [True: 1.90k, False: 17.6k]
  ------------------
 5281|  8.42M|		if (len + 5 >= size) {
  ------------------
  |  Branch (5281:7): [True: 16.2k, False: 8.40M]
  ------------------
 5282|  16.2k|		    xmlChar *tmp;
 5283|  16.2k|                    int newSize;
 5284|       |
 5285|  16.2k|                    newSize = xmlGrowCapacity(size, 1, 1, maxLength);
 5286|  16.2k|                    if (newSize < 0) {
  ------------------
  |  Branch (5286:25): [True: 0, False: 16.2k]
  ------------------
 5287|      0|                        xmlFatalErrMsgStr(ctxt, XML_ERR_PI_NOT_FINISHED,
 5288|      0|                                          "PI %s too big found", target);
 5289|      0|                        xmlFree(buf);
 5290|      0|                        return;
 5291|      0|                    }
 5292|  16.2k|		    tmp = xmlRealloc(buf, newSize);
 5293|  16.2k|		    if (tmp == NULL) {
  ------------------
  |  Branch (5293:11): [True: 6, False: 16.2k]
  ------------------
 5294|      6|			xmlErrMemory(ctxt);
 5295|      6|			xmlFree(buf);
 5296|      6|			return;
 5297|      6|		    }
 5298|  16.2k|		    buf = tmp;
 5299|  16.2k|                    size = newSize;
 5300|  16.2k|		}
 5301|  8.42M|		COPY_BUF(buf, len, cur);
  ------------------
  |  | 2333|  8.42M|    if (v < 0x80) b[i++] = v;						\
  |  |  ------------------
  |  |  |  Branch (2333:9): [True: 817k, False: 7.60M]
  |  |  ------------------
  |  | 2334|  8.42M|    else i += xmlCopyCharMultiByte(&b[i],v)
  ------------------
 5302|  8.42M|		NEXTL(l);
  ------------------
  |  | 2325|  8.42M|#define NEXTL(l) do {							\
  |  | 2326|  8.42M|    if (*(ctxt->input->cur) == '\n') {					\
  |  |  ------------------
  |  |  |  Branch (2326:9): [True: 179k, False: 8.24M]
  |  |  ------------------
  |  | 2327|   179k|	ctxt->input->line++; ctxt->input->col = 1;			\
  |  | 2328|  8.24M|    } else ctxt->input->col++;						\
  |  | 2329|  8.42M|    ctxt->input->cur += l;				\
  |  | 2330|  8.42M|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2330:12): [Folded, False: 8.42M]
  |  |  ------------------
  ------------------
 5303|  8.42M|		cur = xmlCurrentCharRecover(ctxt, &l);
 5304|  8.42M|	    }
 5305|  28.0k|	    buf[len] = 0;
 5306|  28.0k|	    if (cur != '?') {
  ------------------
  |  Branch (5306:10): [True: 10.3k, False: 17.6k]
  ------------------
 5307|  10.3k|		xmlFatalErrMsgStr(ctxt, XML_ERR_PI_NOT_FINISHED,
 5308|  10.3k|		      "ParsePI: PI %s never end ...\n", target);
 5309|  17.6k|	    } else {
 5310|  17.6k|		SKIP(2);
  ------------------
  |  | 2285|  17.6k|#define SKIP(val) do {							\
  |  | 2286|  17.6k|    ctxt->input->cur += (val),ctxt->input->col+=(val);			\
  |  | 2287|  17.6k|    if (*ctxt->input->cur == 0)						\
  |  |  ------------------
  |  |  |  Branch (2287:9): [True: 280, False: 17.3k]
  |  |  ------------------
  |  | 2288|  17.6k|        xmlParserGrow(ctxt);						\
  |  | 2289|  17.6k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2289:12): [Folded, False: 17.6k]
  |  |  ------------------
  ------------------
 5311|       |
 5312|  17.6k|#ifdef LIBXML_CATALOG_ENABLED
 5313|  17.6k|		if ((ctxt->inSubset == 0) &&
  ------------------
  |  Branch (5313:7): [True: 8.06k, False: 9.60k]
  ------------------
 5314|  8.06k|		    (xmlStrEqual(target, XML_CATALOG_PI))) {
  ------------------
  |  |   44|  8.06k|    (const xmlChar *) "oasis-xml-catalog"
  ------------------
  |  Branch (5314:7): [True: 392, False: 7.67k]
  ------------------
 5315|    392|		    xmlCatalogAllow allow = xmlCatalogGetDefaults();
 5316|       |
 5317|    392|		    if ((ctxt->options & XML_PARSE_CATALOG_PI) &&
  ------------------
  |  Branch (5317:11): [True: 194, False: 198]
  ------------------
 5318|    194|                        ((allow == XML_CATA_ALLOW_DOCUMENT) ||
  ------------------
  |  Branch (5318:26): [True: 0, False: 194]
  ------------------
 5319|    194|			 (allow == XML_CATA_ALLOW_ALL)))
  ------------------
  |  Branch (5319:5): [True: 0, False: 194]
  ------------------
 5320|      0|			xmlParseCatalogPI(ctxt, buf);
 5321|    392|		}
 5322|  17.6k|#endif
 5323|       |
 5324|       |		/*
 5325|       |		 * SAX: PI detected.
 5326|       |		 */
 5327|  17.6k|		if ((ctxt->sax) && (!ctxt->disableSAX) &&
  ------------------
  |  Branch (5327:7): [True: 17.6k, False: 0]
  |  Branch (5327:22): [True: 16.5k, False: 1.11k]
  ------------------
 5328|  16.5k|		    (ctxt->sax->processingInstruction != NULL))
  ------------------
  |  Branch (5328:7): [True: 16.5k, False: 0]
  ------------------
 5329|  16.5k|		    ctxt->sax->processingInstruction(ctxt->userData,
 5330|  16.5k|		                                     target, buf);
 5331|  17.6k|	    }
 5332|  28.0k|	    xmlFree(buf);
 5333|  28.0k|	} else {
 5334|       |	    xmlFatalErr(ctxt, XML_ERR_PI_NOT_STARTED, NULL);
 5335|  4.48k|	}
 5336|   180k|    }
 5337|   180k|}
xmlParseNotationDecl:
 5359|  4.81k|xmlParseNotationDecl(xmlParserCtxt *ctxt) {
 5360|  4.81k|    const xmlChar *name;
 5361|  4.81k|    xmlChar *Pubid;
 5362|  4.81k|    xmlChar *Systemid;
 5363|       |
 5364|  4.81k|    if ((CUR != '<') || (NXT(1) != '!'))
  ------------------
  |  | 2262|  4.81k|#define CUR (*ctxt->input->cur)
  ------------------
                  if ((CUR != '<') || (NXT(1) != '!'))
  ------------------
  |  | 2263|  4.81k|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
  |  Branch (5364:9): [True: 0, False: 4.81k]
  |  Branch (5364:25): [True: 0, False: 4.81k]
  ------------------
 5365|      0|        return;
 5366|  4.81k|    SKIP(2);
  ------------------
  |  | 2285|  4.81k|#define SKIP(val) do {							\
  |  | 2286|  4.81k|    ctxt->input->cur += (val),ctxt->input->col+=(val);			\
  |  | 2287|  4.81k|    if (*ctxt->input->cur == 0)						\
  |  |  ------------------
  |  |  |  Branch (2287:9): [True: 0, False: 4.81k]
  |  |  ------------------
  |  | 2288|  4.81k|        xmlParserGrow(ctxt);						\
  |  | 2289|  4.81k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2289:12): [Folded, False: 4.81k]
  |  |  ------------------
  ------------------
 5367|       |
 5368|  4.81k|    if (CMP8(CUR_PTR, 'N', 'O', 'T', 'A', 'T', 'I', 'O', 'N')) {
  ------------------
  |  | 2277|  4.81k|  ( CMP7( s, c1, c2, c3, c4, c5, c6, c7 ) && ((unsigned char *) s)[ 7 ] == c8 )
  |  |  ------------------
  |  |  |  | 2275|  9.62k|  ( CMP6( s, c1, c2, c3, c4, c5, c6 ) && ((unsigned char *) s)[ 6 ] == c7 )
  |  |  |  |  ------------------
  |  |  |  |  |  | 2273|  9.62k|  ( CMP5( s, c1, c2, c3, c4, c5 ) && ((unsigned char *) s)[ 5 ] == c6 )
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  | 2271|  9.62k|  ( CMP4( s, c1, c2, c3, c4 ) && ((unsigned char *) s)[ 4 ] == c5 )
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  | 2268|  9.62k|  ( ((unsigned char *) s)[ 0 ] == c1 && ((unsigned char *) s)[ 1 ] == c2 && \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (2268:5): [True: 4.81k, False: 0]
  |  |  |  |  |  |  |  |  |  |  |  Branch (2268:41): [True: 4.80k, False: 7]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  | 2269|  4.81k|    ((unsigned char *) s)[ 2 ] == c3 && ((unsigned char *) s)[ 3 ] == c4 )
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (2269:5): [True: 4.79k, False: 8]
  |  |  |  |  |  |  |  |  |  |  |  Branch (2269:41): [True: 4.78k, False: 7]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (2271:34): [True: 4.78k, False: 9]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (2273:38): [True: 4.77k, False: 9]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2275:42): [True: 4.76k, False: 9]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2277:46): [True: 4.75k, False: 7]
  |  |  ------------------
  ------------------
 5369|  4.75k|#ifdef LIBXML_VALID_ENABLED
 5370|  4.75k|	int oldInputNr = ctxt->inputNr;
 5371|  4.75k|#endif
 5372|       |
 5373|  4.75k|	SKIP(8);
  ------------------
  |  | 2285|  4.75k|#define SKIP(val) do {							\
  |  | 2286|  4.75k|    ctxt->input->cur += (val),ctxt->input->col+=(val);			\
  |  | 2287|  4.75k|    if (*ctxt->input->cur == 0)						\
  |  |  ------------------
  |  |  |  Branch (2287:9): [True: 83, False: 4.67k]
  |  |  ------------------
  |  | 2288|  4.75k|        xmlParserGrow(ctxt);						\
  |  | 2289|  4.75k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2289:12): [Folded, False: 4.75k]
  |  |  ------------------
  ------------------
 5374|  4.75k|	if (SKIP_BLANKS_PE == 0) {
  ------------------
  |  | 2314|  4.75k|#define SKIP_BLANKS_PE xmlSkipBlankCharsPE(ctxt)
  ------------------
  |  Branch (5374:6): [True: 383, False: 4.37k]
  ------------------
 5375|    383|	    xmlFatalErrMsg(ctxt, XML_ERR_SPACE_REQUIRED,
 5376|    383|			   "Space required after '<!NOTATION'\n");
 5377|    383|	    return;
 5378|    383|	}
 5379|       |
 5380|  4.37k|        name = xmlParseName(ctxt);
 5381|  4.37k|	if (name == NULL) {
  ------------------
  |  Branch (5381:6): [True: 407, False: 3.96k]
  ------------------
 5382|    407|	    xmlFatalErr(ctxt, XML_ERR_NOTATION_NOT_STARTED, NULL);
 5383|    407|	    return;
 5384|    407|	}
 5385|  3.96k|	if (xmlStrchr(name, ':') != NULL) {
  ------------------
  |  Branch (5385:6): [True: 435, False: 3.53k]
  ------------------
 5386|    435|	    xmlNsErr(ctxt, XML_NS_ERR_COLON,
 5387|    435|		     "colons are forbidden from notation names '%s'\n",
 5388|    435|		     name, NULL, NULL);
 5389|    435|	}
 5390|  3.96k|	if (SKIP_BLANKS_PE == 0) {
  ------------------
  |  | 2314|  3.96k|#define SKIP_BLANKS_PE xmlSkipBlankCharsPE(ctxt)
  ------------------
  |  Branch (5390:6): [True: 289, False: 3.67k]
  ------------------
 5391|    289|	    xmlFatalErrMsg(ctxt, XML_ERR_SPACE_REQUIRED,
 5392|    289|		     "Space required after the NOTATION name'\n");
 5393|    289|	    return;
 5394|    289|	}
 5395|       |
 5396|       |	/*
 5397|       |	 * Parse the IDs.
 5398|       |	 */
 5399|  3.67k|	Systemid = xmlParseExternalID(ctxt, &Pubid, 0);
 5400|  3.67k|	SKIP_BLANKS_PE;
  ------------------
  |  | 2314|  3.67k|#define SKIP_BLANKS_PE xmlSkipBlankCharsPE(ctxt)
  ------------------
 5401|       |
 5402|  3.67k|	if (RAW == '>') {
  ------------------
  |  | 2261|  3.67k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (5402:6): [True: 2.82k, False: 847]
  ------------------
 5403|  2.82k|#ifdef LIBXML_VALID_ENABLED
 5404|  2.82k|	    if ((ctxt->validate) && (ctxt->inputNr > oldInputNr)) {
  ------------------
  |  Branch (5404:10): [True: 1.55k, False: 1.27k]
  |  Branch (5404:30): [True: 3, False: 1.54k]
  ------------------
 5405|      3|		xmlValidityError(ctxt, XML_ERR_ENTITY_BOUNDARY,
 5406|      3|	                         "Notation declaration doesn't start and stop"
 5407|      3|                                 " in the same entity\n",
 5408|      3|                                 NULL, NULL);
 5409|      3|	    }
 5410|  2.82k|#endif
 5411|  2.82k|	    NEXT;
  ------------------
  |  | 2316|  2.82k|#define NEXT xmlNextChar(ctxt)
  ------------------
 5412|  2.82k|	    if ((ctxt->sax != NULL) && (!ctxt->disableSAX) &&
  ------------------
  |  Branch (5412:10): [True: 2.82k, False: 0]
  |  Branch (5412:33): [True: 2.46k, False: 367]
  ------------------
 5413|  2.46k|		(ctxt->sax->notationDecl != NULL))
  ------------------
  |  Branch (5413:3): [True: 2.46k, False: 0]
  ------------------
 5414|  2.46k|		ctxt->sax->notationDecl(ctxt->userData, name, Pubid, Systemid);
 5415|  2.82k|	} else {
 5416|    847|	    xmlFatalErr(ctxt, XML_ERR_NOTATION_NOT_FINISHED, NULL);
 5417|    847|	}
 5418|  3.67k|	if (Systemid != NULL) xmlFree(Systemid);
  ------------------
  |  Branch (5418:6): [True: 1.48k, False: 2.18k]
  ------------------
 5419|  3.67k|	if (Pubid != NULL) xmlFree(Pubid);
  ------------------
  |  Branch (5419:6): [True: 1.77k, False: 1.89k]
  ------------------
 5420|  3.67k|    }
 5421|  4.81k|}
xmlParseEntityDecl:
 5447|   202k|xmlParseEntityDecl(xmlParserCtxt *ctxt) {
 5448|   202k|    const xmlChar *name = NULL;
 5449|   202k|    xmlChar *value = NULL;
 5450|   202k|    xmlChar *URI = NULL, *literal = NULL;
 5451|   202k|    const xmlChar *ndata = NULL;
 5452|   202k|    int isParameter = 0;
 5453|   202k|    xmlChar *orig = NULL;
 5454|       |
 5455|   202k|    if ((CUR != '<') || (NXT(1) != '!'))
  ------------------
  |  | 2262|   202k|#define CUR (*ctxt->input->cur)
  ------------------
                  if ((CUR != '<') || (NXT(1) != '!'))
  ------------------
  |  | 2263|   202k|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
  |  Branch (5455:9): [True: 0, False: 202k]
  |  Branch (5455:25): [True: 0, False: 202k]
  ------------------
 5456|      0|        return;
 5457|   202k|    SKIP(2);
  ------------------
  |  | 2285|   202k|#define SKIP(val) do {							\
  |  | 2286|   202k|    ctxt->input->cur += (val),ctxt->input->col+=(val);			\
  |  | 2287|   202k|    if (*ctxt->input->cur == 0)						\
  |  |  ------------------
  |  |  |  Branch (2287:9): [True: 0, False: 202k]
  |  |  ------------------
  |  | 2288|   202k|        xmlParserGrow(ctxt);						\
  |  | 2289|   202k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2289:12): [Folded, False: 202k]
  |  |  ------------------
  ------------------
 5458|       |
 5459|       |    /* GROW; done in the caller */
 5460|   202k|    if (CMP6(CUR_PTR, 'E', 'N', 'T', 'I', 'T', 'Y')) {
  ------------------
  |  | 2273|   202k|  ( CMP5( s, c1, c2, c3, c4, c5 ) && ((unsigned char *) s)[ 5 ] == c6 )
  |  |  ------------------
  |  |  |  | 2271|   404k|  ( CMP4( s, c1, c2, c3, c4 ) && ((unsigned char *) s)[ 4 ] == c5 )
  |  |  |  |  ------------------
  |  |  |  |  |  | 2268|   404k|  ( ((unsigned char *) s)[ 0 ] == c1 && ((unsigned char *) s)[ 1 ] == c2 && \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (2268:5): [True: 202k, False: 0]
  |  |  |  |  |  |  |  Branch (2268:41): [True: 202k, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 2269|   202k|    ((unsigned char *) s)[ 2 ] == c3 && ((unsigned char *) s)[ 3 ] == c4 )
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (2269:5): [True: 202k, False: 25]
  |  |  |  |  |  |  |  Branch (2269:41): [True: 202k, False: 13]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2271:34): [True: 202k, False: 16]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2273:38): [True: 202k, False: 14]
  |  |  ------------------
  ------------------
 5461|   202k|#ifdef LIBXML_VALID_ENABLED
 5462|   202k|	int oldInputNr = ctxt->inputNr;
 5463|   202k|#endif
 5464|       |
 5465|   202k|	SKIP(6);
  ------------------
  |  | 2285|   202k|#define SKIP(val) do {							\
  |  | 2286|   202k|    ctxt->input->cur += (val),ctxt->input->col+=(val);			\
  |  | 2287|   202k|    if (*ctxt->input->cur == 0)						\
  |  |  ------------------
  |  |  |  Branch (2287:9): [True: 225, False: 201k]
  |  |  ------------------
  |  | 2288|   202k|        xmlParserGrow(ctxt);						\
  |  | 2289|   202k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2289:12): [Folded, False: 202k]
  |  |  ------------------
  ------------------
 5466|   202k|	if (SKIP_BLANKS_PE == 0) {
  ------------------
  |  | 2314|   202k|#define SKIP_BLANKS_PE xmlSkipBlankCharsPE(ctxt)
  ------------------
  |  Branch (5466:6): [True: 3.09k, False: 198k]
  ------------------
 5467|  3.09k|	    xmlFatalErrMsg(ctxt, XML_ERR_SPACE_REQUIRED,
 5468|  3.09k|			   "Space required after '<!ENTITY'\n");
 5469|  3.09k|	}
 5470|       |
 5471|   202k|	if (RAW == '%') {
  ------------------
  |  | 2261|   202k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (5471:6): [True: 83.4k, False: 118k]
  ------------------
 5472|  83.4k|	    NEXT;
  ------------------
  |  | 2316|  83.4k|#define NEXT xmlNextChar(ctxt)
  ------------------
 5473|  83.4k|	    if (SKIP_BLANKS_PE == 0) {
  ------------------
  |  | 2314|  83.4k|#define SKIP_BLANKS_PE xmlSkipBlankCharsPE(ctxt)
  ------------------
  |  Branch (5473:10): [True: 429, False: 83.0k]
  ------------------
 5474|    429|		xmlFatalErrMsg(ctxt, XML_ERR_SPACE_REQUIRED,
 5475|    429|			       "Space required after '%%'\n");
 5476|    429|	    }
 5477|  83.4k|	    isParameter = 1;
 5478|  83.4k|	}
 5479|       |
 5480|   202k|        name = xmlParseName(ctxt);
 5481|   202k|	if (name == NULL) {
  ------------------
  |  Branch (5481:6): [True: 39.8k, False: 162k]
  ------------------
 5482|  39.8k|	    xmlFatalErrMsg(ctxt, XML_ERR_NAME_REQUIRED,
 5483|  39.8k|	                   "xmlParseEntityDecl: no name\n");
 5484|  39.8k|            return;
 5485|  39.8k|	}
 5486|   162k|	if (xmlStrchr(name, ':') != NULL) {
  ------------------
  |  Branch (5486:6): [True: 2.10k, False: 160k]
  ------------------
 5487|  2.10k|	    xmlNsErr(ctxt, XML_NS_ERR_COLON,
 5488|  2.10k|		     "colons are forbidden from entities names '%s'\n",
 5489|  2.10k|		     name, NULL, NULL);
 5490|  2.10k|	}
 5491|   162k|	if (SKIP_BLANKS_PE == 0) {
  ------------------
  |  | 2314|   162k|#define SKIP_BLANKS_PE xmlSkipBlankCharsPE(ctxt)
  ------------------
  |  Branch (5491:6): [True: 4.05k, False: 158k]
  ------------------
 5492|  4.05k|	    xmlFatalErrMsg(ctxt, XML_ERR_SPACE_REQUIRED,
 5493|  4.05k|			   "Space required after the entity name\n");
 5494|  4.05k|	}
 5495|       |
 5496|       |	/*
 5497|       |	 * handle the various case of definitions...
 5498|       |	 */
 5499|   162k|	if (isParameter) {
  ------------------
  |  Branch (5499:6): [True: 82.5k, False: 79.5k]
  ------------------
 5500|  82.5k|	    if ((RAW == '"') || (RAW == '\'')) {
  ------------------
  |  | 2261|  82.5k|#define RAW (*ctxt->input->cur)
  ------------------
              	    if ((RAW == '"') || (RAW == '\'')) {
  ------------------
  |  | 2261|  10.6k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (5500:10): [True: 71.9k, False: 10.6k]
  |  Branch (5500:26): [True: 1.60k, False: 9.04k]
  ------------------
 5501|  73.5k|	        value = xmlParseEntityValue(ctxt, &orig);
 5502|  73.5k|		if (value) {
  ------------------
  |  Branch (5502:7): [True: 72.2k, False: 1.31k]
  ------------------
 5503|  72.2k|		    if ((ctxt->sax != NULL) &&
  ------------------
  |  Branch (5503:11): [True: 72.2k, False: 0]
  ------------------
 5504|  72.2k|			(!ctxt->disableSAX) && (ctxt->sax->entityDecl != NULL))
  ------------------
  |  Branch (5504:4): [True: 67.4k, False: 4.79k]
  |  Branch (5504:27): [True: 67.4k, False: 0]
  ------------------
 5505|  67.4k|			ctxt->sax->entityDecl(ctxt->userData, name,
 5506|  67.4k|		                    XML_INTERNAL_PARAMETER_ENTITY,
 5507|  67.4k|				    NULL, NULL, value);
 5508|  72.2k|		}
 5509|  73.5k|	    } else {
 5510|  9.04k|	        URI = xmlParseExternalID(ctxt, &literal, 1);
 5511|  9.04k|		if ((URI == NULL) && (literal == NULL)) {
  ------------------
  |  Branch (5511:7): [True: 1.39k, False: 7.65k]
  |  Branch (5511:24): [True: 1.06k, False: 324]
  ------------------
 5512|  1.06k|		    xmlFatalErr(ctxt, XML_ERR_VALUE_REQUIRED, NULL);
 5513|  1.06k|		}
 5514|  9.04k|		if (URI) {
  ------------------
  |  Branch (5514:7): [True: 7.65k, False: 1.39k]
  ------------------
 5515|  7.65k|                    if (xmlStrchr(URI, '#')) {
  ------------------
  |  Branch (5515:25): [True: 443, False: 7.20k]
  ------------------
 5516|    443|                        xmlFatalErr(ctxt, XML_ERR_URI_FRAGMENT, NULL);
 5517|  7.20k|                    } else {
 5518|  7.20k|                        if ((ctxt->sax != NULL) &&
  ------------------
  |  Branch (5518:29): [True: 7.20k, False: 0]
  ------------------
 5519|  7.20k|                            (!ctxt->disableSAX) &&
  ------------------
  |  Branch (5519:29): [True: 6.45k, False: 754]
  ------------------
 5520|  6.45k|                            (ctxt->sax->entityDecl != NULL))
  ------------------
  |  Branch (5520:29): [True: 6.45k, False: 0]
  ------------------
 5521|  6.45k|                            ctxt->sax->entityDecl(ctxt->userData, name,
 5522|  6.45k|                                        XML_EXTERNAL_PARAMETER_ENTITY,
 5523|  6.45k|                                        literal, URI, NULL);
 5524|  7.20k|                    }
 5525|  7.65k|		}
 5526|  9.04k|	    }
 5527|  82.5k|	} else {
 5528|  79.5k|	    if ((RAW == '"') || (RAW == '\'')) {
  ------------------
  |  | 2261|  79.5k|#define RAW (*ctxt->input->cur)
  ------------------
              	    if ((RAW == '"') || (RAW == '\'')) {
  ------------------
  |  | 2261|  14.0k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (5528:10): [True: 65.5k, False: 14.0k]
  |  Branch (5528:26): [True: 2.65k, False: 11.3k]
  ------------------
 5529|  68.2k|	        value = xmlParseEntityValue(ctxt, &orig);
 5530|  68.2k|		if ((ctxt->sax != NULL) &&
  ------------------
  |  Branch (5530:7): [True: 68.2k, False: 0]
  ------------------
 5531|  68.2k|		    (!ctxt->disableSAX) && (ctxt->sax->entityDecl != NULL))
  ------------------
  |  Branch (5531:7): [True: 64.3k, False: 3.82k]
  |  Branch (5531:30): [True: 64.3k, False: 0]
  ------------------
 5532|  64.3k|		    ctxt->sax->entityDecl(ctxt->userData, name,
 5533|  64.3k|				XML_INTERNAL_GENERAL_ENTITY,
 5534|  64.3k|				NULL, NULL, value);
 5535|       |		/*
 5536|       |		 * For expat compatibility in SAX mode.
 5537|       |		 */
 5538|  68.2k|		if ((ctxt->myDoc == NULL) ||
  ------------------
  |  Branch (5538:7): [True: 10, False: 68.2k]
  ------------------
 5539|  68.2k|		    (xmlStrEqual(ctxt->myDoc->version, SAX_COMPAT_MODE))) {
  ------------------
  |  |  173|  68.2k|#define SAX_COMPAT_MODE BAD_CAST "SAX compatibility mode document"
  |  |  ------------------
  |  |  |  |   34|  68.2k|#define BAD_CAST (xmlChar *)
  |  |  ------------------
  ------------------
  |  Branch (5539:7): [True: 67, False: 68.1k]
  ------------------
 5540|     77|		    if (ctxt->myDoc == NULL) {
  ------------------
  |  Branch (5540:11): [True: 10, False: 67]
  ------------------
 5541|     10|			ctxt->myDoc = xmlNewDoc(SAX_COMPAT_MODE);
  ------------------
  |  |  173|     10|#define SAX_COMPAT_MODE BAD_CAST "SAX compatibility mode document"
  |  |  ------------------
  |  |  |  |   34|     10|#define BAD_CAST (xmlChar *)
  |  |  ------------------
  ------------------
 5542|     10|			if (ctxt->myDoc == NULL) {
  ------------------
  |  Branch (5542:8): [True: 1, False: 9]
  ------------------
 5543|      1|			    xmlErrMemory(ctxt);
 5544|      1|			    goto done;
 5545|      1|			}
 5546|      9|			ctxt->myDoc->properties = XML_DOC_INTERNAL;
 5547|      9|		    }
 5548|     76|		    if (ctxt->myDoc->intSubset == NULL) {
  ------------------
  |  Branch (5548:11): [True: 9, False: 67]
  ------------------
 5549|      9|			ctxt->myDoc->intSubset = xmlNewDtd(ctxt->myDoc,
 5550|      9|					    BAD_CAST "fake", NULL, NULL);
  ------------------
  |  |   34|      9|#define BAD_CAST (xmlChar *)
  ------------------
 5551|      9|                        if (ctxt->myDoc->intSubset == NULL) {
  ------------------
  |  Branch (5551:29): [True: 1, False: 8]
  ------------------
 5552|      1|                            xmlErrMemory(ctxt);
 5553|      1|                            goto done;
 5554|      1|                        }
 5555|      9|                    }
 5556|       |
 5557|     75|		    xmlSAX2EntityDecl(ctxt, name, XML_INTERNAL_GENERAL_ENTITY,
 5558|     75|			              NULL, NULL, value);
 5559|     75|		}
 5560|  68.2k|	    } else {
 5561|  11.3k|	        URI = xmlParseExternalID(ctxt, &literal, 1);
 5562|  11.3k|		if ((URI == NULL) && (literal == NULL)) {
  ------------------
  |  Branch (5562:7): [True: 5.24k, False: 6.11k]
  |  Branch (5562:24): [True: 4.17k, False: 1.06k]
  ------------------
 5563|  4.17k|		    xmlFatalErr(ctxt, XML_ERR_VALUE_REQUIRED, NULL);
 5564|  4.17k|		}
 5565|  11.3k|		if (URI) {
  ------------------
  |  Branch (5565:7): [True: 6.11k, False: 5.24k]
  ------------------
 5566|  6.11k|                    if (xmlStrchr(URI, '#')) {
  ------------------
  |  Branch (5566:25): [True: 216, False: 5.90k]
  ------------------
 5567|    216|                        xmlFatalErr(ctxt, XML_ERR_URI_FRAGMENT, NULL);
 5568|    216|                    }
 5569|  6.11k|		}
 5570|  11.3k|		if ((RAW != '>') && (SKIP_BLANKS_PE == 0)) {
  ------------------
  |  | 2261|  11.3k|#define RAW (*ctxt->input->cur)
  ------------------
              		if ((RAW != '>') && (SKIP_BLANKS_PE == 0)) {
  ------------------
  |  | 2314|  6.98k|#define SKIP_BLANKS_PE xmlSkipBlankCharsPE(ctxt)
  ------------------
  |  Branch (5570:7): [True: 6.98k, False: 4.36k]
  |  Branch (5570:23): [True: 5.21k, False: 1.77k]
  ------------------
 5571|  5.21k|		    xmlFatalErrMsg(ctxt, XML_ERR_SPACE_REQUIRED,
 5572|  5.21k|				   "Space required before 'NDATA'\n");
 5573|  5.21k|		}
 5574|  11.3k|		if (CMP5(CUR_PTR, 'N', 'D', 'A', 'T', 'A')) {
  ------------------
  |  | 2271|  11.3k|  ( CMP4( s, c1, c2, c3, c4 ) && ((unsigned char *) s)[ 4 ] == c5 )
  |  |  ------------------
  |  |  |  | 2268|  22.7k|  ( ((unsigned char *) s)[ 0 ] == c1 && ((unsigned char *) s)[ 1 ] == c2 && \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2268:5): [True: 850, False: 10.5k]
  |  |  |  |  |  Branch (2268:41): [True: 844, False: 6]
  |  |  |  |  ------------------
  |  |  |  | 2269|  11.3k|    ((unsigned char *) s)[ 2 ] == c3 && ((unsigned char *) s)[ 3 ] == c4 )
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2269:5): [True: 835, False: 9]
  |  |  |  |  |  Branch (2269:41): [True: 829, False: 6]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2271:34): [True: 827, False: 2]
  |  |  ------------------
  ------------------
 5575|    827|		    SKIP(5);
  ------------------
  |  | 2285|    827|#define SKIP(val) do {							\
  |  | 2286|    827|    ctxt->input->cur += (val),ctxt->input->col+=(val);			\
  |  | 2287|    827|    if (*ctxt->input->cur == 0)						\
  |  |  ------------------
  |  |  |  Branch (2287:9): [True: 88, False: 739]
  |  |  ------------------
  |  | 2288|    827|        xmlParserGrow(ctxt);						\
  |  | 2289|    827|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2289:12): [Folded, False: 827]
  |  |  ------------------
  ------------------
 5576|    827|		    if (SKIP_BLANKS_PE == 0) {
  ------------------
  |  | 2314|    827|#define SKIP_BLANKS_PE xmlSkipBlankCharsPE(ctxt)
  ------------------
  |  Branch (5576:11): [True: 248, False: 579]
  ------------------
 5577|    248|			xmlFatalErrMsg(ctxt, XML_ERR_SPACE_REQUIRED,
 5578|    248|				       "Space required after 'NDATA'\n");
 5579|    248|		    }
 5580|    827|		    ndata = xmlParseName(ctxt);
 5581|    827|		    if ((ctxt->sax != NULL) && (!ctxt->disableSAX) &&
  ------------------
  |  Branch (5581:11): [True: 827, False: 0]
  |  Branch (5581:34): [True: 549, False: 278]
  ------------------
 5582|    549|		        (ctxt->sax->unparsedEntityDecl != NULL))
  ------------------
  |  Branch (5582:11): [True: 549, False: 0]
  ------------------
 5583|    549|			ctxt->sax->unparsedEntityDecl(ctxt->userData, name,
 5584|    549|				    literal, URI, ndata);
 5585|  10.5k|		} else {
 5586|  10.5k|		    if ((ctxt->sax != NULL) &&
  ------------------
  |  Branch (5586:11): [True: 10.5k, False: 0]
  ------------------
 5587|  10.5k|		        (!ctxt->disableSAX) && (ctxt->sax->entityDecl != NULL))
  ------------------
  |  Branch (5587:11): [True: 8.99k, False: 1.53k]
  |  Branch (5587:34): [True: 8.99k, False: 0]
  ------------------
 5588|  8.99k|			ctxt->sax->entityDecl(ctxt->userData, name,
 5589|  8.99k|				    XML_EXTERNAL_GENERAL_PARSED_ENTITY,
 5590|  8.99k|				    literal, URI, NULL);
 5591|       |		    /*
 5592|       |		     * For expat compatibility in SAX mode.
 5593|       |		     * assuming the entity replacement was asked for
 5594|       |		     */
 5595|  10.5k|		    if ((ctxt->replaceEntities != 0) &&
  ------------------
  |  Branch (5595:11): [True: 6.68k, False: 3.85k]
  ------------------
 5596|  6.68k|			((ctxt->myDoc == NULL) ||
  ------------------
  |  Branch (5596:5): [True: 11, False: 6.66k]
  ------------------
 5597|  6.66k|			(xmlStrEqual(ctxt->myDoc->version, SAX_COMPAT_MODE)))) {
  ------------------
  |  |  173|  6.66k|#define SAX_COMPAT_MODE BAD_CAST "SAX compatibility mode document"
  |  |  ------------------
  |  |  |  |   34|  6.66k|#define BAD_CAST (xmlChar *)
  |  |  ------------------
  ------------------
  |  Branch (5597:4): [True: 201, False: 6.46k]
  ------------------
 5598|    212|			if (ctxt->myDoc == NULL) {
  ------------------
  |  Branch (5598:8): [True: 11, False: 201]
  ------------------
 5599|     11|			    ctxt->myDoc = xmlNewDoc(SAX_COMPAT_MODE);
  ------------------
  |  |  173|     11|#define SAX_COMPAT_MODE BAD_CAST "SAX compatibility mode document"
  |  |  ------------------
  |  |  |  |   34|     11|#define BAD_CAST (xmlChar *)
  |  |  ------------------
  ------------------
 5600|     11|			    if (ctxt->myDoc == NULL) {
  ------------------
  |  Branch (5600:12): [True: 1, False: 10]
  ------------------
 5601|      1|			        xmlErrMemory(ctxt);
 5602|      1|				goto done;
 5603|      1|			    }
 5604|     10|			    ctxt->myDoc->properties = XML_DOC_INTERNAL;
 5605|     10|			}
 5606|       |
 5607|    211|			if (ctxt->myDoc->intSubset == NULL) {
  ------------------
  |  Branch (5607:8): [True: 10, False: 201]
  ------------------
 5608|     10|			    ctxt->myDoc->intSubset = xmlNewDtd(ctxt->myDoc,
 5609|     10|						BAD_CAST "fake", NULL, NULL);
  ------------------
  |  |   34|     10|#define BAD_CAST (xmlChar *)
  ------------------
 5610|     10|                            if (ctxt->myDoc->intSubset == NULL) {
  ------------------
  |  Branch (5610:33): [True: 1, False: 9]
  ------------------
 5611|      1|                                xmlErrMemory(ctxt);
 5612|      1|                                goto done;
 5613|      1|                            }
 5614|     10|                        }
 5615|    210|			xmlSAX2EntityDecl(ctxt, name,
 5616|    210|				          XML_EXTERNAL_GENERAL_PARSED_ENTITY,
 5617|    210|				          literal, URI, NULL);
 5618|    210|		    }
 5619|  10.5k|		}
 5620|  11.3k|	    }
 5621|  79.5k|	}
 5622|   162k|	SKIP_BLANKS_PE;
  ------------------
  |  | 2314|   162k|#define SKIP_BLANKS_PE xmlSkipBlankCharsPE(ctxt)
  ------------------
 5623|   162k|	if (RAW != '>') {
  ------------------
  |  | 2261|   162k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (5623:6): [True: 14.3k, False: 147k]
  ------------------
 5624|  14.3k|	    xmlFatalErrMsgStr(ctxt, XML_ERR_ENTITY_NOT_FINISHED,
 5625|  14.3k|	            "xmlParseEntityDecl: entity %s not terminated\n", name);
 5626|   147k|	} else {
 5627|   147k|#ifdef LIBXML_VALID_ENABLED
 5628|   147k|	    if ((ctxt->validate) && (ctxt->inputNr > oldInputNr)) {
  ------------------
  |  Branch (5628:10): [True: 113k, False: 34.3k]
  |  Branch (5628:30): [True: 6, False: 113k]
  ------------------
 5629|      6|		xmlValidityError(ctxt, XML_ERR_ENTITY_BOUNDARY,
 5630|      6|	                         "Entity declaration doesn't start and stop in"
 5631|      6|                                 " the same entity\n",
 5632|      6|                                 NULL, NULL);
 5633|      6|	    }
 5634|   147k|#endif
 5635|   147k|	    NEXT;
  ------------------
  |  | 2316|   147k|#define NEXT xmlNextChar(ctxt)
  ------------------
 5636|   147k|	}
 5637|   162k|	if (orig != NULL) {
  ------------------
  |  Branch (5637:6): [True: 138k, False: 23.8k]
  ------------------
 5638|       |	    /*
 5639|       |	     * Ugly mechanism to save the raw entity value.
 5640|       |	     */
 5641|   138k|	    xmlEntityPtr cur = NULL;
 5642|       |
 5643|   138k|	    if (isParameter) {
  ------------------
  |  Branch (5643:10): [True: 72.2k, False: 66.0k]
  ------------------
 5644|  72.2k|	        if ((ctxt->sax != NULL) &&
  ------------------
  |  Branch (5644:14): [True: 72.2k, False: 0]
  ------------------
 5645|  72.2k|		    (ctxt->sax->getParameterEntity != NULL))
  ------------------
  |  Branch (5645:7): [True: 72.2k, False: 0]
  ------------------
 5646|  72.2k|		    cur = ctxt->sax->getParameterEntity(ctxt->userData, name);
 5647|  72.2k|	    } else {
 5648|  66.0k|	        if ((ctxt->sax != NULL) &&
  ------------------
  |  Branch (5648:14): [True: 66.0k, False: 0]
  ------------------
 5649|  66.0k|		    (ctxt->sax->getEntity != NULL))
  ------------------
  |  Branch (5649:7): [True: 66.0k, False: 0]
  ------------------
 5650|  66.0k|		    cur = ctxt->sax->getEntity(ctxt->userData, name);
 5651|  66.0k|		if ((cur == NULL) && (ctxt->userData==ctxt)) {
  ------------------
  |  Branch (5651:7): [True: 3.36k, False: 62.7k]
  |  Branch (5651:24): [True: 3.36k, False: 0]
  ------------------
 5652|  3.36k|		    cur = xmlSAX2GetEntity(ctxt, name);
 5653|  3.36k|		}
 5654|  66.0k|	    }
 5655|   138k|            if ((cur != NULL) && (cur->orig == NULL)) {
  ------------------
  |  Branch (5655:17): [True: 130k, False: 7.97k]
  |  Branch (5655:34): [True: 15.2k, False: 115k]
  ------------------
 5656|  15.2k|		cur->orig = orig;
 5657|  15.2k|                orig = NULL;
 5658|  15.2k|	    }
 5659|   138k|	}
 5660|       |
 5661|   162k|done:
 5662|   162k|	if (value != NULL) xmlFree(value);
  ------------------
  |  Branch (5662:6): [True: 138k, False: 23.8k]
  ------------------
 5663|   162k|	if (URI != NULL) xmlFree(URI);
  ------------------
  |  Branch (5663:6): [True: 13.7k, False: 148k]
  ------------------
 5664|   162k|	if (literal != NULL) xmlFree(literal);
  ------------------
  |  Branch (5664:6): [True: 4.91k, False: 157k]
  ------------------
 5665|   162k|        if (orig != NULL) xmlFree(orig);
  ------------------
  |  Branch (5665:13): [True: 123k, False: 39.1k]
  ------------------
 5666|   162k|    }
 5667|   202k|}
xmlParseDefaultDecl:
 5699|   123k|xmlParseDefaultDecl(xmlParserCtxt *ctxt, xmlChar **value) {
 5700|   123k|    int val;
 5701|   123k|    xmlChar *ret;
 5702|       |
 5703|   123k|    *value = NULL;
 5704|   123k|    if (CMP9(CUR_PTR, '#', 'R', 'E', 'Q', 'U', 'I', 'R', 'E', 'D')) {
  ------------------
  |  | 2279|   123k|  ( CMP8( s, c1, c2, c3, c4, c5, c6, c7, c8 ) && \
  |  |  ------------------
  |  |  |  | 2277|   246k|  ( CMP7( s, c1, c2, c3, c4, c5, c6, c7 ) && ((unsigned char *) s)[ 7 ] == c8 )
  |  |  |  |  ------------------
  |  |  |  |  |  | 2275|   246k|  ( CMP6( s, c1, c2, c3, c4, c5, c6 ) && ((unsigned char *) s)[ 6 ] == c7 )
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  | 2273|   246k|  ( CMP5( s, c1, c2, c3, c4, c5 ) && ((unsigned char *) s)[ 5 ] == c6 )
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  | 2271|   246k|  ( CMP4( s, c1, c2, c3, c4 ) && ((unsigned char *) s)[ 4 ] == c5 )
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  | 2268|   246k|  ( ((unsigned char *) s)[ 0 ] == c1 && ((unsigned char *) s)[ 1 ] == c2 && \
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  Branch (2268:5): [True: 58.4k, False: 64.7k]
  |  |  |  |  |  |  |  |  |  |  |  |  |  Branch (2268:41): [True: 4.13k, False: 54.3k]
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  | 2269|   123k|    ((unsigned char *) s)[ 2 ] == c3 && ((unsigned char *) s)[ 3 ] == c4 )
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  Branch (2269:5): [True: 4.13k, False: 8]
  |  |  |  |  |  |  |  |  |  |  |  |  |  Branch (2269:41): [True: 4.12k, False: 7]
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (2271:34): [True: 4.11k, False: 7]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (2273:38): [True: 4.11k, False: 6]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (2275:42): [True: 4.10k, False: 9]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2277:46): [True: 4.09k, False: 8]
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 2280|   123k|    ((unsigned char *) s)[ 8 ] == c9 )
  |  |  ------------------
  |  |  |  Branch (2280:5): [True: 4.08k, False: 6]
  |  |  ------------------
  ------------------
 5705|  4.08k|	SKIP(9);
  ------------------
  |  | 2285|  4.08k|#define SKIP(val) do {							\
  |  | 2286|  4.08k|    ctxt->input->cur += (val),ctxt->input->col+=(val);			\
  |  | 2287|  4.08k|    if (*ctxt->input->cur == 0)						\
  |  |  ------------------
  |  |  |  Branch (2287:9): [True: 316, False: 3.77k]
  |  |  ------------------
  |  | 2288|  4.08k|        xmlParserGrow(ctxt);						\
  |  | 2289|  4.08k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2289:12): [Folded, False: 4.08k]
  |  |  ------------------
  ------------------
 5706|  4.08k|	return(XML_ATTRIBUTE_REQUIRED);
 5707|  4.08k|    }
 5708|   119k|    if (CMP8(CUR_PTR, '#', 'I', 'M', 'P', 'L', 'I', 'E', 'D')) {
  ------------------
  |  | 2277|   119k|  ( CMP7( s, c1, c2, c3, c4, c5, c6, c7 ) && ((unsigned char *) s)[ 7 ] == c8 )
  |  |  ------------------
  |  |  |  | 2275|   238k|  ( CMP6( s, c1, c2, c3, c4, c5, c6 ) && ((unsigned char *) s)[ 6 ] == c7 )
  |  |  |  |  ------------------
  |  |  |  |  |  | 2273|   238k|  ( CMP5( s, c1, c2, c3, c4, c5 ) && ((unsigned char *) s)[ 5 ] == c6 )
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  | 2271|   238k|  ( CMP4( s, c1, c2, c3, c4 ) && ((unsigned char *) s)[ 4 ] == c5 )
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  | 2268|   238k|  ( ((unsigned char *) s)[ 0 ] == c1 && ((unsigned char *) s)[ 1 ] == c2 && \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (2268:5): [True: 54.3k, False: 64.7k]
  |  |  |  |  |  |  |  |  |  |  |  Branch (2268:41): [True: 37.9k, False: 16.4k]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  | 2269|   119k|    ((unsigned char *) s)[ 2 ] == c3 && ((unsigned char *) s)[ 3 ] == c4 )
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (2269:5): [True: 37.9k, False: 7]
  |  |  |  |  |  |  |  |  |  |  |  Branch (2269:41): [True: 37.9k, False: 8]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (2271:34): [True: 37.9k, False: 4]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (2273:38): [True: 37.9k, False: 7]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2275:42): [True: 37.9k, False: 4]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2277:46): [True: 37.9k, False: 4]
  |  |  ------------------
  ------------------
 5709|  37.9k|	SKIP(8);
  ------------------
  |  | 2285|  37.9k|#define SKIP(val) do {							\
  |  | 2286|  37.9k|    ctxt->input->cur += (val),ctxt->input->col+=(val);			\
  |  | 2287|  37.9k|    if (*ctxt->input->cur == 0)						\
  |  |  ------------------
  |  |  |  Branch (2287:9): [True: 1.35k, False: 36.5k]
  |  |  ------------------
  |  | 2288|  37.9k|        xmlParserGrow(ctxt);						\
  |  | 2289|  37.9k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2289:12): [Folded, False: 37.9k]
  |  |  ------------------
  ------------------
 5710|  37.9k|	return(XML_ATTRIBUTE_IMPLIED);
 5711|  37.9k|    }
 5712|  81.2k|    val = XML_ATTRIBUTE_NONE;
 5713|  81.2k|    if (CMP6(CUR_PTR, '#', 'F', 'I', 'X', 'E', 'D')) {
  ------------------
  |  | 2273|  81.2k|  ( CMP5( s, c1, c2, c3, c4, c5 ) && ((unsigned char *) s)[ 5 ] == c6 )
  |  |  ------------------
  |  |  |  | 2271|   162k|  ( CMP4( s, c1, c2, c3, c4 ) && ((unsigned char *) s)[ 4 ] == c5 )
  |  |  |  |  ------------------
  |  |  |  |  |  | 2268|   162k|  ( ((unsigned char *) s)[ 0 ] == c1 && ((unsigned char *) s)[ 1 ] == c2 && \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (2268:5): [True: 16.4k, False: 64.7k]
  |  |  |  |  |  |  |  Branch (2268:41): [True: 16.3k, False: 109]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 2269|  81.2k|    ((unsigned char *) s)[ 2 ] == c3 && ((unsigned char *) s)[ 3 ] == c4 )
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (2269:5): [True: 16.3k, False: 6]
  |  |  |  |  |  |  |  Branch (2269:41): [True: 16.3k, False: 8]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2271:34): [True: 16.3k, False: 7]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2273:38): [True: 16.3k, False: 8]
  |  |  ------------------
  ------------------
 5714|  16.3k|	SKIP(6);
  ------------------
  |  | 2285|  16.3k|#define SKIP(val) do {							\
  |  | 2286|  16.3k|    ctxt->input->cur += (val),ctxt->input->col+=(val);			\
  |  | 2287|  16.3k|    if (*ctxt->input->cur == 0)						\
  |  |  ------------------
  |  |  |  Branch (2287:9): [True: 238, False: 16.0k]
  |  |  ------------------
  |  | 2288|  16.3k|        xmlParserGrow(ctxt);						\
  |  | 2289|  16.3k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2289:12): [Folded, False: 16.3k]
  |  |  ------------------
  ------------------
 5715|  16.3k|	val = XML_ATTRIBUTE_FIXED;
 5716|  16.3k|	if (SKIP_BLANKS_PE == 0) {
  ------------------
  |  | 2314|  16.3k|#define SKIP_BLANKS_PE xmlSkipBlankCharsPE(ctxt)
  ------------------
  |  Branch (5716:6): [True: 848, False: 15.4k]
  ------------------
 5717|    848|	    xmlFatalErrMsg(ctxt, XML_ERR_SPACE_REQUIRED,
 5718|    848|			   "Space required after '#FIXED'\n");
 5719|    848|	}
 5720|  16.3k|    }
 5721|  81.2k|    ret = xmlParseAttValue(ctxt);
 5722|  81.2k|    if (ret == NULL) {
  ------------------
  |  Branch (5722:9): [True: 47.6k, False: 33.5k]
  ------------------
 5723|  47.6k|	xmlFatalErrMsg(ctxt, (xmlParserErrors)ctxt->errNo,
 5724|  47.6k|		       "Attribute default value declaration error\n");
 5725|  47.6k|    } else
 5726|  33.5k|        *value = ret;
 5727|  81.2k|    return(val);
 5728|   119k|}
xmlParseNotationType:
 5748|  4.79k|xmlParseNotationType(xmlParserCtxt *ctxt) {
 5749|  4.79k|    const xmlChar *name;
 5750|  4.79k|    xmlEnumerationPtr ret = NULL, last = NULL, cur, tmp;
 5751|       |
 5752|  4.79k|    if (RAW != '(') {
  ------------------
  |  | 2261|  4.79k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (5752:9): [True: 605, False: 4.18k]
  ------------------
 5753|    605|	xmlFatalErr(ctxt, XML_ERR_NOTATION_NOT_STARTED, NULL);
 5754|    605|	return(NULL);
 5755|    605|    }
 5756|  4.91k|    do {
 5757|  4.91k|        NEXT;
  ------------------
  |  | 2316|  4.91k|#define NEXT xmlNextChar(ctxt)
  ------------------
 5758|  4.91k|	SKIP_BLANKS_PE;
  ------------------
  |  | 2314|  4.91k|#define SKIP_BLANKS_PE xmlSkipBlankCharsPE(ctxt)
  ------------------
 5759|  4.91k|        name = xmlParseName(ctxt);
 5760|  4.91k|	if (name == NULL) {
  ------------------
  |  Branch (5760:6): [True: 213, False: 4.70k]
  ------------------
 5761|    213|	    xmlFatalErrMsg(ctxt, XML_ERR_NAME_REQUIRED,
 5762|    213|			   "Name expected in NOTATION declaration\n");
 5763|    213|            xmlFreeEnumeration(ret);
 5764|    213|	    return(NULL);
 5765|    213|	}
 5766|  4.70k|        tmp = NULL;
 5767|  4.70k|#ifdef LIBXML_VALID_ENABLED
 5768|  4.70k|        if (ctxt->validate) {
  ------------------
  |  Branch (5768:13): [True: 2.41k, False: 2.29k]
  ------------------
 5769|  2.41k|            tmp = ret;
 5770|  3.45k|            while (tmp != NULL) {
  ------------------
  |  Branch (5770:20): [True: 1.26k, False: 2.19k]
  ------------------
 5771|  1.26k|                if (xmlStrEqual(name, tmp->name)) {
  ------------------
  |  Branch (5771:21): [True: 219, False: 1.04k]
  ------------------
 5772|    219|                    xmlValidityError(ctxt, XML_DTD_DUP_TOKEN,
 5773|    219|              "standalone: attribute notation value token %s duplicated\n",
 5774|    219|                                     name, NULL);
 5775|    219|                    if (!xmlDictOwns(ctxt->dict, name))
  ------------------
  |  Branch (5775:25): [True: 0, False: 219]
  ------------------
 5776|      0|                        xmlFree((xmlChar *) name);
 5777|    219|                    break;
 5778|    219|                }
 5779|  1.04k|                tmp = tmp->next;
 5780|  1.04k|            }
 5781|  2.41k|        }
 5782|  4.70k|#endif /* LIBXML_VALID_ENABLED */
 5783|  4.70k|	if (tmp == NULL) {
  ------------------
  |  Branch (5783:6): [True: 4.48k, False: 219]
  ------------------
 5784|  4.48k|	    cur = xmlCreateEnumeration(name);
 5785|  4.48k|	    if (cur == NULL) {
  ------------------
  |  Branch (5785:10): [True: 2, False: 4.48k]
  ------------------
 5786|      2|                xmlErrMemory(ctxt);
 5787|      2|                xmlFreeEnumeration(ret);
 5788|      2|                return(NULL);
 5789|      2|            }
 5790|  4.48k|	    if (last == NULL) ret = last = cur;
  ------------------
  |  Branch (5790:10): [True: 3.97k, False: 509]
  ------------------
 5791|    509|	    else {
 5792|    509|		last->next = cur;
 5793|    509|		last = cur;
 5794|    509|	    }
 5795|  4.48k|	}
 5796|  4.70k|	SKIP_BLANKS_PE;
  ------------------
  |  | 2314|  4.70k|#define SKIP_BLANKS_PE xmlSkipBlankCharsPE(ctxt)
  ------------------
 5797|  4.70k|    } while (RAW == '|');
  ------------------
  |  | 2261|  4.70k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (5797:14): [True: 731, False: 3.97k]
  ------------------
 5798|  3.97k|    if (RAW != ')') {
  ------------------
  |  | 2261|  3.97k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (5798:9): [True: 729, False: 3.24k]
  ------------------
 5799|    729|	xmlFatalErr(ctxt, XML_ERR_NOTATION_NOT_FINISHED, NULL);
 5800|    729|        xmlFreeEnumeration(ret);
 5801|    729|	return(NULL);
 5802|    729|    }
 5803|  3.24k|    NEXT;
  ------------------
  |  | 2316|  3.24k|#define NEXT xmlNextChar(ctxt)
  ------------------
 5804|  3.24k|    return(ret);
 5805|  3.97k|}
xmlParseEnumerationType:
 5823|  34.4k|xmlParseEnumerationType(xmlParserCtxt *ctxt) {
 5824|  34.4k|    xmlChar *name;
 5825|  34.4k|    xmlEnumerationPtr ret = NULL, last = NULL, cur, tmp;
 5826|       |
 5827|  34.4k|    if (RAW != '(') {
  ------------------
  |  | 2261|  34.4k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (5827:9): [True: 1.66k, False: 32.8k]
  ------------------
 5828|  1.66k|	xmlFatalErr(ctxt, XML_ERR_ATTLIST_NOT_STARTED, NULL);
 5829|  1.66k|	return(NULL);
 5830|  1.66k|    }
 5831|  40.7k|    do {
 5832|  40.7k|        NEXT;
  ------------------
  |  | 2316|  40.7k|#define NEXT xmlNextChar(ctxt)
  ------------------
 5833|  40.7k|	SKIP_BLANKS_PE;
  ------------------
  |  | 2314|  40.7k|#define SKIP_BLANKS_PE xmlSkipBlankCharsPE(ctxt)
  ------------------
 5834|  40.7k|        name = xmlParseNmtoken(ctxt);
 5835|  40.7k|	if (name == NULL) {
  ------------------
  |  Branch (5835:6): [True: 293, False: 40.4k]
  ------------------
 5836|    293|	    xmlFatalErr(ctxt, XML_ERR_NMTOKEN_REQUIRED, NULL);
 5837|    293|	    return(ret);
 5838|    293|	}
 5839|  40.4k|        tmp = NULL;
 5840|  40.4k|#ifdef LIBXML_VALID_ENABLED
 5841|  40.4k|        if (ctxt->validate) {
  ------------------
  |  Branch (5841:13): [True: 32.7k, False: 7.75k]
  ------------------
 5842|  32.7k|            tmp = ret;
 5843|  49.1k|            while (tmp != NULL) {
  ------------------
  |  Branch (5843:20): [True: 16.7k, False: 32.3k]
  ------------------
 5844|  16.7k|                if (xmlStrEqual(name, tmp->name)) {
  ------------------
  |  Branch (5844:21): [True: 348, False: 16.3k]
  ------------------
 5845|    348|                    xmlValidityError(ctxt, XML_DTD_DUP_TOKEN,
 5846|    348|              "standalone: attribute enumeration value token %s duplicated\n",
 5847|    348|                                     name, NULL);
 5848|    348|                    if (!xmlDictOwns(ctxt->dict, name))
  ------------------
  |  Branch (5848:25): [True: 348, False: 0]
  ------------------
 5849|    348|                        xmlFree(name);
 5850|    348|                    break;
 5851|    348|                }
 5852|  16.3k|                tmp = tmp->next;
 5853|  16.3k|            }
 5854|  32.7k|        }
 5855|  40.4k|#endif /* LIBXML_VALID_ENABLED */
 5856|  40.4k|	if (tmp == NULL) {
  ------------------
  |  Branch (5856:6): [True: 40.1k, False: 348]
  ------------------
 5857|  40.1k|	    cur = xmlCreateEnumeration(name);
 5858|  40.1k|	    if (!xmlDictOwns(ctxt->dict, name))
  ------------------
  |  Branch (5858:10): [True: 40.1k, False: 0]
  ------------------
 5859|  40.1k|		xmlFree(name);
 5860|  40.1k|	    if (cur == NULL) {
  ------------------
  |  Branch (5860:10): [True: 2, False: 40.1k]
  ------------------
 5861|      2|                xmlErrMemory(ctxt);
 5862|      2|                xmlFreeEnumeration(ret);
 5863|      2|                return(NULL);
 5864|      2|            }
 5865|  40.1k|	    if (last == NULL) ret = last = cur;
  ------------------
  |  Branch (5865:10): [True: 32.5k, False: 7.63k]
  ------------------
 5866|  7.63k|	    else {
 5867|  7.63k|		last->next = cur;
 5868|  7.63k|		last = cur;
 5869|  7.63k|	    }
 5870|  40.1k|	}
 5871|  40.4k|	SKIP_BLANKS_PE;
  ------------------
  |  | 2314|  40.4k|#define SKIP_BLANKS_PE xmlSkipBlankCharsPE(ctxt)
  ------------------
 5872|  40.4k|    } while (RAW == '|');
  ------------------
  |  | 2261|  40.4k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (5872:14): [True: 7.98k, False: 32.5k]
  ------------------
 5873|  32.5k|    if (RAW != ')') {
  ------------------
  |  | 2261|  32.5k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (5873:9): [True: 1.20k, False: 31.3k]
  ------------------
 5874|  1.20k|	xmlFatalErr(ctxt, XML_ERR_ATTLIST_NOT_FINISHED, NULL);
 5875|  1.20k|	return(ret);
 5876|  1.20k|    }
 5877|  31.3k|    NEXT;
  ------------------
  |  | 2316|  31.3k|#define NEXT xmlNextChar(ctxt)
  ------------------
 5878|  31.3k|    return(ret);
 5879|  32.5k|}
xmlParseEnumeratedType:
 5896|  39.5k|xmlParseEnumeratedType(xmlParserCtxt *ctxt, xmlEnumeration **tree) {
 5897|  39.5k|    if (CMP8(CUR_PTR, 'N', 'O', 'T', 'A', 'T', 'I', 'O', 'N')) {
  ------------------
  |  | 2277|  39.5k|  ( CMP7( s, c1, c2, c3, c4, c5, c6, c7 ) && ((unsigned char *) s)[ 7 ] == c8 )
  |  |  ------------------
  |  |  |  | 2275|  79.1k|  ( CMP6( s, c1, c2, c3, c4, c5, c6 ) && ((unsigned char *) s)[ 6 ] == c7 )
  |  |  |  |  ------------------
  |  |  |  |  |  | 2273|  79.1k|  ( CMP5( s, c1, c2, c3, c4, c5 ) && ((unsigned char *) s)[ 5 ] == c6 )
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  | 2271|  79.1k|  ( CMP4( s, c1, c2, c3, c4 ) && ((unsigned char *) s)[ 4 ] == c5 )
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  | 2268|  79.1k|  ( ((unsigned char *) s)[ 0 ] == c1 && ((unsigned char *) s)[ 1 ] == c2 && \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (2268:5): [True: 5.18k, False: 34.4k]
  |  |  |  |  |  |  |  |  |  |  |  Branch (2268:41): [True: 5.14k, False: 40]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  | 2269|  39.5k|    ((unsigned char *) s)[ 2 ] == c3 && ((unsigned char *) s)[ 3 ] == c4 )
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (2269:5): [True: 5.13k, False: 7]
  |  |  |  |  |  |  |  |  |  |  |  Branch (2269:41): [True: 5.13k, False: 4]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (2271:34): [True: 5.12k, False: 5]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (2273:38): [True: 5.12k, False: 5]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2275:42): [True: 5.11k, False: 4]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2277:46): [True: 5.11k, False: 3]
  |  |  ------------------
  ------------------
 5898|  5.11k|	SKIP(8);
  ------------------
  |  | 2285|  5.11k|#define SKIP(val) do {							\
  |  | 2286|  5.11k|    ctxt->input->cur += (val),ctxt->input->col+=(val);			\
  |  | 2287|  5.11k|    if (*ctxt->input->cur == 0)						\
  |  |  ------------------
  |  |  |  Branch (2287:9): [True: 215, False: 4.89k]
  |  |  ------------------
  |  | 2288|  5.11k|        xmlParserGrow(ctxt);						\
  |  | 2289|  5.11k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2289:12): [Folded, False: 5.11k]
  |  |  ------------------
  ------------------
 5899|  5.11k|	if (SKIP_BLANKS_PE == 0) {
  ------------------
  |  | 2314|  5.11k|#define SKIP_BLANKS_PE xmlSkipBlankCharsPE(ctxt)
  ------------------
  |  Branch (5899:6): [True: 322, False: 4.79k]
  ------------------
 5900|    322|	    xmlFatalErrMsg(ctxt, XML_ERR_SPACE_REQUIRED,
 5901|    322|			   "Space required after 'NOTATION'\n");
 5902|    322|	    return(0);
 5903|    322|	}
 5904|  4.79k|	*tree = xmlParseNotationType(ctxt);
 5905|  4.79k|	if (*tree == NULL) return(0);
  ------------------
  |  Branch (5905:6): [True: 1.54k, False: 3.24k]
  ------------------
 5906|  3.24k|	return(XML_ATTRIBUTE_NOTATION);
 5907|  4.79k|    }
 5908|  34.4k|    *tree = xmlParseEnumerationType(ctxt);
 5909|  34.4k|    if (*tree == NULL) return(0);
  ------------------
  |  Branch (5909:9): [True: 1.95k, False: 32.5k]
  ------------------
 5910|  32.5k|    return(XML_ATTRIBUTE_ENUMERATION);
 5911|  34.4k|}
xmlParseAttributeType:
 5959|   129k|xmlParseAttributeType(xmlParserCtxt *ctxt, xmlEnumeration **tree) {
 5960|   129k|    if (CMP5(CUR_PTR, 'C', 'D', 'A', 'T', 'A')) {
  ------------------
  |  | 2271|   129k|  ( CMP4( s, c1, c2, c3, c4 ) && ((unsigned char *) s)[ 4 ] == c5 )
  |  |  ------------------
  |  |  |  | 2268|   259k|  ( ((unsigned char *) s)[ 0 ] == c1 && ((unsigned char *) s)[ 1 ] == c2 && \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2268:5): [True: 13.6k, False: 116k]
  |  |  |  |  |  Branch (2268:41): [True: 13.6k, False: 9]
  |  |  |  |  ------------------
  |  |  |  | 2269|   129k|    ((unsigned char *) s)[ 2 ] == c3 && ((unsigned char *) s)[ 3 ] == c4 )
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2269:5): [True: 13.5k, False: 12]
  |  |  |  |  |  Branch (2269:41): [True: 13.5k, False: 7]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2271:34): [True: 13.5k, False: 9]
  |  |  ------------------
  ------------------
 5961|  13.5k|	SKIP(5);
  ------------------
  |  | 2285|  13.5k|#define SKIP(val) do {							\
  |  | 2286|  13.5k|    ctxt->input->cur += (val),ctxt->input->col+=(val);			\
  |  | 2287|  13.5k|    if (*ctxt->input->cur == 0)						\
  |  |  ------------------
  |  |  |  Branch (2287:9): [True: 70, False: 13.5k]
  |  |  ------------------
  |  | 2288|  13.5k|        xmlParserGrow(ctxt);						\
  |  | 2289|  13.5k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2289:12): [Folded, False: 13.5k]
  |  |  ------------------
  ------------------
 5962|  13.5k|	return(XML_ATTRIBUTE_CDATA);
 5963|   116k|     } else if (CMP6(CUR_PTR, 'I', 'D', 'R', 'E', 'F', 'S')) {
  ------------------
  |  | 2273|   116k|  ( CMP5( s, c1, c2, c3, c4, c5 ) && ((unsigned char *) s)[ 5 ] == c6 )
  |  |  ------------------
  |  |  |  | 2271|   232k|  ( CMP4( s, c1, c2, c3, c4 ) && ((unsigned char *) s)[ 4 ] == c5 )
  |  |  |  |  ------------------
  |  |  |  |  |  | 2268|   232k|  ( ((unsigned char *) s)[ 0 ] == c1 && ((unsigned char *) s)[ 1 ] == c2 && \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (2268:5): [True: 25.0k, False: 91.0k]
  |  |  |  |  |  |  |  Branch (2268:41): [True: 25.0k, False: 10]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 2269|   116k|    ((unsigned char *) s)[ 2 ] == c3 && ((unsigned char *) s)[ 3 ] == c4 )
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (2269:5): [True: 12.8k, False: 12.2k]
  |  |  |  |  |  |  |  Branch (2269:41): [True: 12.8k, False: 7]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2271:34): [True: 12.8k, False: 7]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2273:38): [True: 1.87k, False: 10.9k]
  |  |  ------------------
  ------------------
 5964|  1.87k|	SKIP(6);
  ------------------
  |  | 2285|  1.87k|#define SKIP(val) do {							\
  |  | 2286|  1.87k|    ctxt->input->cur += (val),ctxt->input->col+=(val);			\
  |  | 2287|  1.87k|    if (*ctxt->input->cur == 0)						\
  |  |  ------------------
  |  |  |  Branch (2287:9): [True: 66, False: 1.81k]
  |  |  ------------------
  |  | 2288|  1.87k|        xmlParserGrow(ctxt);						\
  |  | 2289|  1.87k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2289:12): [Folded, False: 1.87k]
  |  |  ------------------
  ------------------
 5965|  1.87k|	return(XML_ATTRIBUTE_IDREFS);
 5966|   114k|     } else if (CMP5(CUR_PTR, 'I', 'D', 'R', 'E', 'F')) {
  ------------------
  |  | 2271|   114k|  ( CMP4( s, c1, c2, c3, c4 ) && ((unsigned char *) s)[ 4 ] == c5 )
  |  |  ------------------
  |  |  |  | 2268|   228k|  ( ((unsigned char *) s)[ 0 ] == c1 && ((unsigned char *) s)[ 1 ] == c2 && \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2268:5): [True: 23.2k, False: 91.0k]
  |  |  |  |  |  Branch (2268:41): [True: 23.2k, False: 10]
  |  |  |  |  ------------------
  |  |  |  | 2269|   114k|    ((unsigned char *) s)[ 2 ] == c3 && ((unsigned char *) s)[ 3 ] == c4 )
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2269:5): [True: 10.9k, False: 12.2k]
  |  |  |  |  |  Branch (2269:41): [True: 10.9k, False: 7]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2271:34): [True: 10.9k, False: 7]
  |  |  ------------------
  ------------------
 5967|  10.9k|	SKIP(5);
  ------------------
  |  | 2285|  10.9k|#define SKIP(val) do {							\
  |  | 2286|  10.9k|    ctxt->input->cur += (val),ctxt->input->col+=(val);			\
  |  | 2287|  10.9k|    if (*ctxt->input->cur == 0)						\
  |  |  ------------------
  |  |  |  Branch (2287:9): [True: 228, False: 10.6k]
  |  |  ------------------
  |  | 2288|  10.9k|        xmlParserGrow(ctxt);						\
  |  | 2289|  10.9k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2289:12): [Folded, False: 10.9k]
  |  |  ------------------
  ------------------
 5968|  10.9k|	return(XML_ATTRIBUTE_IDREF);
 5969|   103k|     } else if ((RAW == 'I') && (NXT(1) == 'D')) {
  ------------------
  |  | 2261|   103k|#define RAW (*ctxt->input->cur)
  ------------------
                   } else if ((RAW == 'I') && (NXT(1) == 'D')) {
  ------------------
  |  | 2263|  12.2k|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
  |  Branch (5969:17): [True: 12.2k, False: 91.0k]
  |  Branch (5969:33): [True: 12.2k, False: 10]
  ------------------
 5970|  12.2k|        SKIP(2);
  ------------------
  |  | 2285|  12.2k|#define SKIP(val) do {							\
  |  | 2286|  12.2k|    ctxt->input->cur += (val),ctxt->input->col+=(val);			\
  |  | 2287|  12.2k|    if (*ctxt->input->cur == 0)						\
  |  |  ------------------
  |  |  |  Branch (2287:9): [True: 209, False: 12.0k]
  |  |  ------------------
  |  | 2288|  12.2k|        xmlParserGrow(ctxt);						\
  |  | 2289|  12.2k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2289:12): [Folded, False: 12.2k]
  |  |  ------------------
  ------------------
 5971|  12.2k|	return(XML_ATTRIBUTE_ID);
 5972|  91.0k|     } else if (CMP6(CUR_PTR, 'E', 'N', 'T', 'I', 'T', 'Y')) {
  ------------------
  |  | 2273|  91.0k|  ( CMP5( s, c1, c2, c3, c4, c5 ) && ((unsigned char *) s)[ 5 ] == c6 )
  |  |  ------------------
  |  |  |  | 2271|   182k|  ( CMP4( s, c1, c2, c3, c4 ) && ((unsigned char *) s)[ 4 ] == c5 )
  |  |  |  |  ------------------
  |  |  |  |  |  | 2268|   182k|  ( ((unsigned char *) s)[ 0 ] == c1 && ((unsigned char *) s)[ 1 ] == c2 && \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (2268:5): [True: 5.82k, False: 85.2k]
  |  |  |  |  |  |  |  Branch (2268:41): [True: 5.82k, False: 6]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 2269|  91.0k|    ((unsigned char *) s)[ 2 ] == c3 && ((unsigned char *) s)[ 3 ] == c4 )
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (2269:5): [True: 5.82k, False: 3]
  |  |  |  |  |  |  |  Branch (2269:41): [True: 5.81k, False: 1]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2271:34): [True: 5.81k, False: 3]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2273:38): [True: 3.75k, False: 2.05k]
  |  |  ------------------
  ------------------
 5973|  3.75k|	SKIP(6);
  ------------------
  |  | 2285|  3.75k|#define SKIP(val) do {							\
  |  | 2286|  3.75k|    ctxt->input->cur += (val),ctxt->input->col+=(val);			\
  |  | 2287|  3.75k|    if (*ctxt->input->cur == 0)						\
  |  |  ------------------
  |  |  |  Branch (2287:9): [True: 68, False: 3.68k]
  |  |  ------------------
  |  | 2288|  3.75k|        xmlParserGrow(ctxt);						\
  |  | 2289|  3.75k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2289:12): [Folded, False: 3.75k]
  |  |  ------------------
  ------------------
 5974|  3.75k|	return(XML_ATTRIBUTE_ENTITY);
 5975|  87.3k|     } else if (CMP8(CUR_PTR, 'E', 'N', 'T', 'I', 'T', 'I', 'E', 'S')) {
  ------------------
  |  | 2277|  87.3k|  ( CMP7( s, c1, c2, c3, c4, c5, c6, c7 ) && ((unsigned char *) s)[ 7 ] == c8 )
  |  |  ------------------
  |  |  |  | 2275|   174k|  ( CMP6( s, c1, c2, c3, c4, c5, c6 ) && ((unsigned char *) s)[ 6 ] == c7 )
  |  |  |  |  ------------------
  |  |  |  |  |  | 2273|   174k|  ( CMP5( s, c1, c2, c3, c4, c5 ) && ((unsigned char *) s)[ 5 ] == c6 )
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  | 2271|   174k|  ( CMP4( s, c1, c2, c3, c4 ) && ((unsigned char *) s)[ 4 ] == c5 )
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  | 2268|   174k|  ( ((unsigned char *) s)[ 0 ] == c1 && ((unsigned char *) s)[ 1 ] == c2 && \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (2268:5): [True: 2.07k, False: 85.2k]
  |  |  |  |  |  |  |  |  |  |  |  Branch (2268:41): [True: 2.06k, False: 6]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  | 2269|  87.3k|    ((unsigned char *) s)[ 2 ] == c3 && ((unsigned char *) s)[ 3 ] == c4 )
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (2269:5): [True: 2.06k, False: 3]
  |  |  |  |  |  |  |  |  |  |  |  Branch (2269:41): [True: 2.06k, False: 1]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (2271:34): [True: 2.05k, False: 3]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (2273:38): [True: 2.05k, False: 6]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2275:42): [True: 2.05k, False: 1]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2277:46): [True: 2.05k, False: 1]
  |  |  ------------------
  ------------------
 5976|  2.05k|	SKIP(8);
  ------------------
  |  | 2285|  2.05k|#define SKIP(val) do {							\
  |  | 2286|  2.05k|    ctxt->input->cur += (val),ctxt->input->col+=(val);			\
  |  | 2287|  2.05k|    if (*ctxt->input->cur == 0)						\
  |  |  ------------------
  |  |  |  Branch (2287:9): [True: 207, False: 1.84k]
  |  |  ------------------
  |  | 2288|  2.05k|        xmlParserGrow(ctxt);						\
  |  | 2289|  2.05k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2289:12): [Folded, False: 2.05k]
  |  |  ------------------
  ------------------
 5977|  2.05k|	return(XML_ATTRIBUTE_ENTITIES);
 5978|  85.2k|     } else if (CMP8(CUR_PTR, 'N', 'M', 'T', 'O', 'K', 'E', 'N', 'S')) {
  ------------------
  |  | 2277|  85.2k|  ( CMP7( s, c1, c2, c3, c4, c5, c6, c7 ) && ((unsigned char *) s)[ 7 ] == c8 )
  |  |  ------------------
  |  |  |  | 2275|   170k|  ( CMP6( s, c1, c2, c3, c4, c5, c6 ) && ((unsigned char *) s)[ 6 ] == c7 )
  |  |  |  |  ------------------
  |  |  |  |  |  | 2273|   170k|  ( CMP5( s, c1, c2, c3, c4, c5 ) && ((unsigned char *) s)[ 5 ] == c6 )
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  | 2271|   170k|  ( CMP4( s, c1, c2, c3, c4 ) && ((unsigned char *) s)[ 4 ] == c5 )
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  | 2268|   170k|  ( ((unsigned char *) s)[ 0 ] == c1 && ((unsigned char *) s)[ 1 ] == c2 && \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (2268:5): [True: 50.8k, False: 34.4k]
  |  |  |  |  |  |  |  |  |  |  |  Branch (2268:41): [True: 45.7k, False: 5.14k]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  | 2269|  85.2k|    ((unsigned char *) s)[ 2 ] == c3 && ((unsigned char *) s)[ 3 ] == c4 )
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (2269:5): [True: 45.7k, False: 13]
  |  |  |  |  |  |  |  |  |  |  |  Branch (2269:41): [True: 45.7k, False: 7]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (2271:34): [True: 45.7k, False: 6]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (2273:38): [True: 45.7k, False: 6]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2275:42): [True: 45.6k, False: 6]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2277:46): [True: 39.9k, False: 5.76k]
  |  |  ------------------
  ------------------
 5979|  39.9k|	SKIP(8);
  ------------------
  |  | 2285|  39.9k|#define SKIP(val) do {							\
  |  | 2286|  39.9k|    ctxt->input->cur += (val),ctxt->input->col+=(val);			\
  |  | 2287|  39.9k|    if (*ctxt->input->cur == 0)						\
  |  |  ------------------
  |  |  |  Branch (2287:9): [True: 205, False: 39.7k]
  |  |  ------------------
  |  | 2288|  39.9k|        xmlParserGrow(ctxt);						\
  |  | 2289|  39.9k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2289:12): [Folded, False: 39.9k]
  |  |  ------------------
  ------------------
 5980|  39.9k|	return(XML_ATTRIBUTE_NMTOKENS);
 5981|  45.3k|     } else if (CMP7(CUR_PTR, 'N', 'M', 'T', 'O', 'K', 'E', 'N')) {
  ------------------
  |  | 2275|  45.3k|  ( CMP6( s, c1, c2, c3, c4, c5, c6 ) && ((unsigned char *) s)[ 6 ] == c7 )
  |  |  ------------------
  |  |  |  | 2273|  90.6k|  ( CMP5( s, c1, c2, c3, c4, c5 ) && ((unsigned char *) s)[ 5 ] == c6 )
  |  |  |  |  ------------------
  |  |  |  |  |  | 2271|  90.6k|  ( CMP4( s, c1, c2, c3, c4 ) && ((unsigned char *) s)[ 4 ] == c5 )
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  | 2268|  90.6k|  ( ((unsigned char *) s)[ 0 ] == c1 && ((unsigned char *) s)[ 1 ] == c2 && \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (2268:5): [True: 10.9k, False: 34.4k]
  |  |  |  |  |  |  |  |  |  Branch (2268:41): [True: 5.80k, False: 5.14k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  | 2269|  45.3k|    ((unsigned char *) s)[ 2 ] == c3 && ((unsigned char *) s)[ 3 ] == c4 )
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (2269:5): [True: 5.78k, False: 13]
  |  |  |  |  |  |  |  |  |  Branch (2269:41): [True: 5.78k, False: 7]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (2271:34): [True: 5.77k, False: 6]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2273:38): [True: 5.76k, False: 6]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2275:42): [True: 5.76k, False: 6]
  |  |  ------------------
  ------------------
 5982|  5.76k|	SKIP(7);
  ------------------
  |  | 2285|  5.76k|#define SKIP(val) do {							\
  |  | 2286|  5.76k|    ctxt->input->cur += (val),ctxt->input->col+=(val);			\
  |  | 2287|  5.76k|    if (*ctxt->input->cur == 0)						\
  |  |  ------------------
  |  |  |  Branch (2287:9): [True: 238, False: 5.52k]
  |  |  ------------------
  |  | 2288|  5.76k|        xmlParserGrow(ctxt);						\
  |  | 2289|  5.76k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2289:12): [Folded, False: 5.76k]
  |  |  ------------------
  ------------------
 5983|  5.76k|	return(XML_ATTRIBUTE_NMTOKEN);
 5984|  5.76k|     }
 5985|  39.5k|     return(xmlParseEnumeratedType(ctxt, tree));
 5986|   129k|}
xmlParseAttributeListDecl:
 5999|   108k|xmlParseAttributeListDecl(xmlParserCtxt *ctxt) {
 6000|   108k|    const xmlChar *elemName;
 6001|   108k|    const xmlChar *attrName;
 6002|   108k|    xmlEnumerationPtr tree;
 6003|       |
 6004|   108k|    if ((CUR != '<') || (NXT(1) != '!'))
  ------------------
  |  | 2262|   108k|#define CUR (*ctxt->input->cur)
  ------------------
                  if ((CUR != '<') || (NXT(1) != '!'))
  ------------------
  |  | 2263|   108k|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
  |  Branch (6004:9): [True: 0, False: 108k]
  |  Branch (6004:25): [True: 0, False: 108k]
  ------------------
 6005|      0|        return;
 6006|   108k|    SKIP(2);
  ------------------
  |  | 2285|   108k|#define SKIP(val) do {							\
  |  | 2286|   108k|    ctxt->input->cur += (val),ctxt->input->col+=(val);			\
  |  | 2287|   108k|    if (*ctxt->input->cur == 0)						\
  |  |  ------------------
  |  |  |  Branch (2287:9): [True: 0, False: 108k]
  |  |  ------------------
  |  | 2288|   108k|        xmlParserGrow(ctxt);						\
  |  | 2289|   108k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2289:12): [Folded, False: 108k]
  |  |  ------------------
  ------------------
 6007|       |
 6008|   108k|    if (CMP7(CUR_PTR, 'A', 'T', 'T', 'L', 'I', 'S', 'T')) {
  ------------------
  |  | 2275|   108k|  ( CMP6( s, c1, c2, c3, c4, c5, c6 ) && ((unsigned char *) s)[ 6 ] == c7 )
  |  |  ------------------
  |  |  |  | 2273|   216k|  ( CMP5( s, c1, c2, c3, c4, c5 ) && ((unsigned char *) s)[ 5 ] == c6 )
  |  |  |  |  ------------------
  |  |  |  |  |  | 2271|   216k|  ( CMP4( s, c1, c2, c3, c4 ) && ((unsigned char *) s)[ 4 ] == c5 )
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  | 2268|   216k|  ( ((unsigned char *) s)[ 0 ] == c1 && ((unsigned char *) s)[ 1 ] == c2 && \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (2268:5): [True: 108k, False: 0]
  |  |  |  |  |  |  |  |  |  Branch (2268:41): [True: 108k, False: 18]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  | 2269|   108k|    ((unsigned char *) s)[ 2 ] == c3 && ((unsigned char *) s)[ 3 ] == c4 )
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (2269:5): [True: 108k, False: 22]
  |  |  |  |  |  |  |  |  |  Branch (2269:41): [True: 108k, False: 12]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (2271:34): [True: 108k, False: 13]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2273:38): [True: 108k, False: 8]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2275:42): [True: 108k, False: 18]
  |  |  ------------------
  ------------------
 6009|   108k|#ifdef LIBXML_VALID_ENABLED
 6010|   108k|	int oldInputNr = ctxt->inputNr;
 6011|   108k|#endif
 6012|       |
 6013|   108k|	SKIP(7);
  ------------------
  |  | 2285|   108k|#define SKIP(val) do {							\
  |  | 2286|   108k|    ctxt->input->cur += (val),ctxt->input->col+=(val);			\
  |  | 2287|   108k|    if (*ctxt->input->cur == 0)						\
  |  |  ------------------
  |  |  |  Branch (2287:9): [True: 297, False: 107k]
  |  |  ------------------
  |  | 2288|   108k|        xmlParserGrow(ctxt);						\
  |  | 2289|   108k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2289:12): [Folded, False: 108k]
  |  |  ------------------
  ------------------
 6014|   108k|	if (SKIP_BLANKS_PE == 0) {
  ------------------
  |  | 2314|   108k|#define SKIP_BLANKS_PE xmlSkipBlankCharsPE(ctxt)
  ------------------
  |  Branch (6014:6): [True: 2.96k, False: 105k]
  ------------------
 6015|  2.96k|	    xmlFatalErrMsg(ctxt, XML_ERR_SPACE_REQUIRED,
 6016|  2.96k|		                 "Space required after '<!ATTLIST'\n");
 6017|  2.96k|	}
 6018|   108k|        elemName = xmlParseName(ctxt);
 6019|   108k|	if (elemName == NULL) {
  ------------------
  |  Branch (6019:6): [True: 824, False: 107k]
  ------------------
 6020|    824|	    xmlFatalErrMsg(ctxt, XML_ERR_NAME_REQUIRED,
 6021|    824|			   "ATTLIST: no name for Element\n");
 6022|    824|	    return;
 6023|    824|	}
 6024|   107k|	SKIP_BLANKS_PE;
  ------------------
  |  | 2314|   107k|#define SKIP_BLANKS_PE xmlSkipBlankCharsPE(ctxt)
  ------------------
 6025|   107k|	GROW;
  ------------------
  |  | 2308|   107k|    if ((!PARSER_PROGRESSIVE(ctxt)) && \
  |  |  ------------------
  |  |  |  |   47|   107k|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|   107k|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2308:9): [True: 100k, False: 6.59k]
  |  |  ------------------
  |  | 2309|   107k|        (ctxt->input->end - ctxt->input->cur < INPUT_CHUNK)) \
  |  |  ------------------
  |  |  |  |   63|   100k|#define INPUT_CHUNK	250
  |  |  ------------------
  |  |  |  Branch (2309:9): [True: 51.1k, False: 49.6k]
  |  |  ------------------
  |  | 2310|   107k|	xmlParserGrow(ctxt);
  ------------------
 6026|   188k|	while ((RAW != '>') && (PARSER_STOPPED(ctxt) == 0)) {
  ------------------
  |  | 2261|   188k|#define RAW (*ctxt->input->cur)
  ------------------
              	while ((RAW != '>') && (PARSER_STOPPED(ctxt) == 0)) {
  ------------------
  |  |   44|   141k|#define PARSER_STOPPED(ctxt) ((ctxt)->disableSAX > 1)
  ------------------
  |  Branch (6026:9): [True: 141k, False: 46.4k]
  |  Branch (6026:25): [True: 141k, False: 26]
  ------------------
 6027|   141k|	    int type;
 6028|   141k|	    int def;
 6029|   141k|	    xmlChar *defaultValue = NULL;
 6030|       |
 6031|   141k|	    GROW;
  ------------------
  |  | 2308|   141k|    if ((!PARSER_PROGRESSIVE(ctxt)) && \
  |  |  ------------------
  |  |  |  |   47|   141k|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|   141k|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2308:9): [True: 126k, False: 14.9k]
  |  |  ------------------
  |  | 2309|   141k|        (ctxt->input->end - ctxt->input->cur < INPUT_CHUNK)) \
  |  |  ------------------
  |  |  |  |   63|   126k|#define INPUT_CHUNK	250
  |  |  ------------------
  |  |  |  Branch (2309:9): [True: 62.7k, False: 64.1k]
  |  |  ------------------
  |  | 2310|   141k|	xmlParserGrow(ctxt);
  ------------------
 6032|   141k|            tree = NULL;
 6033|   141k|	    attrName = xmlParseName(ctxt);
 6034|   141k|	    if (attrName == NULL) {
  ------------------
  |  Branch (6034:10): [True: 10.1k, False: 131k]
  ------------------
 6035|  10.1k|		xmlFatalErrMsg(ctxt, XML_ERR_NAME_REQUIRED,
 6036|  10.1k|			       "ATTLIST: no name for Attribute\n");
 6037|  10.1k|		break;
 6038|  10.1k|	    }
 6039|   131k|	    GROW;
  ------------------
  |  | 2308|   131k|    if ((!PARSER_PROGRESSIVE(ctxt)) && \
  |  |  ------------------
  |  |  |  |   47|   131k|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|   131k|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2308:9): [True: 117k, False: 14.5k]
  |  |  ------------------
  |  | 2309|   131k|        (ctxt->input->end - ctxt->input->cur < INPUT_CHUNK)) \
  |  |  ------------------
  |  |  |  |   63|   117k|#define INPUT_CHUNK	250
  |  |  ------------------
  |  |  |  Branch (2309:9): [True: 59.6k, False: 57.5k]
  |  |  ------------------
  |  | 2310|   131k|	xmlParserGrow(ctxt);
  ------------------
 6040|   131k|	    if (SKIP_BLANKS_PE == 0) {
  ------------------
  |  | 2314|   131k|#define SKIP_BLANKS_PE xmlSkipBlankCharsPE(ctxt)
  ------------------
  |  Branch (6040:10): [True: 2.00k, False: 129k]
  ------------------
 6041|  2.00k|		xmlFatalErrMsg(ctxt, XML_ERR_SPACE_REQUIRED,
 6042|  2.00k|		        "Space required after the attribute name\n");
 6043|  2.00k|		break;
 6044|  2.00k|	    }
 6045|       |
 6046|   129k|	    type = xmlParseAttributeType(ctxt, &tree);
 6047|   129k|	    if (type <= 0) {
  ------------------
  |  Branch (6047:10): [True: 3.82k, False: 125k]
  ------------------
 6048|  3.82k|	        break;
 6049|  3.82k|	    }
 6050|       |
 6051|   125k|	    GROW;
  ------------------
  |  | 2308|   125k|    if ((!PARSER_PROGRESSIVE(ctxt)) && \
  |  |  ------------------
  |  |  |  |   47|   125k|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|   125k|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2308:9): [True: 111k, False: 14.1k]
  |  |  ------------------
  |  | 2309|   125k|        (ctxt->input->end - ctxt->input->cur < INPUT_CHUNK)) \
  |  |  ------------------
  |  |  |  |   63|   111k|#define INPUT_CHUNK	250
  |  |  ------------------
  |  |  |  Branch (2309:9): [True: 55.3k, False: 56.4k]
  |  |  ------------------
  |  | 2310|   125k|	xmlParserGrow(ctxt);
  ------------------
 6052|   125k|	    if (SKIP_BLANKS_PE == 0) {
  ------------------
  |  | 2314|   125k|#define SKIP_BLANKS_PE xmlSkipBlankCharsPE(ctxt)
  ------------------
  |  Branch (6052:10): [True: 2.68k, False: 123k]
  ------------------
 6053|  2.68k|		xmlFatalErrMsg(ctxt, XML_ERR_SPACE_REQUIRED,
 6054|  2.68k|			       "Space required after the attribute type\n");
 6055|  2.68k|	        if (tree != NULL)
  ------------------
  |  Branch (6055:14): [True: 1.22k, False: 1.46k]
  ------------------
 6056|  1.22k|		    xmlFreeEnumeration(tree);
 6057|  2.68k|		break;
 6058|  2.68k|	    }
 6059|       |
 6060|   123k|	    def = xmlParseDefaultDecl(ctxt, &defaultValue);
 6061|   123k|	    if (def <= 0) {
  ------------------
  |  Branch (6061:10): [True: 0, False: 123k]
  ------------------
 6062|      0|                if (defaultValue != NULL)
  ------------------
  |  Branch (6062:21): [True: 0, False: 0]
  ------------------
 6063|      0|		    xmlFree(defaultValue);
 6064|      0|	        if (tree != NULL)
  ------------------
  |  Branch (6064:14): [True: 0, False: 0]
  ------------------
 6065|      0|		    xmlFreeEnumeration(tree);
 6066|      0|	        break;
 6067|      0|	    }
 6068|   123k|	    if ((type != XML_ATTRIBUTE_CDATA) && (defaultValue != NULL))
  ------------------
  |  Branch (6068:10): [True: 109k, False: 13.5k]
  |  Branch (6068:43): [True: 31.7k, False: 77.9k]
  ------------------
 6069|  31.7k|	        xmlAttrNormalizeSpace(defaultValue, defaultValue);
 6070|       |
 6071|   123k|	    GROW;
  ------------------
  |  | 2308|   123k|    if ((!PARSER_PROGRESSIVE(ctxt)) && \
  |  |  ------------------
  |  |  |  |   47|   123k|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|   123k|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2308:9): [True: 109k, False: 14.0k]
  |  |  ------------------
  |  | 2309|   123k|        (ctxt->input->end - ctxt->input->cur < INPUT_CHUNK)) \
  |  |  ------------------
  |  |  |  |   63|   109k|#define INPUT_CHUNK	250
  |  |  ------------------
  |  |  |  Branch (2309:9): [True: 77.9k, False: 31.2k]
  |  |  ------------------
  |  | 2310|   123k|	xmlParserGrow(ctxt);
  ------------------
 6072|   123k|            if (RAW != '>') {
  ------------------
  |  | 2261|   123k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (6072:17): [True: 84.6k, False: 38.6k]
  ------------------
 6073|  84.6k|		if (SKIP_BLANKS_PE == 0) {
  ------------------
  |  | 2314|  84.6k|#define SKIP_BLANKS_PE xmlSkipBlankCharsPE(ctxt)
  ------------------
  |  Branch (6073:7): [True: 42.2k, False: 42.3k]
  ------------------
 6074|  42.2k|		    xmlFatalErrMsg(ctxt, XML_ERR_SPACE_REQUIRED,
 6075|  42.2k|			"Space required after the attribute default value\n");
 6076|  42.2k|		    if (defaultValue != NULL)
  ------------------
  |  Branch (6076:11): [True: 598, False: 41.6k]
  ------------------
 6077|    598|			xmlFree(defaultValue);
 6078|  42.2k|		    if (tree != NULL)
  ------------------
  |  Branch (6078:11): [True: 3.27k, False: 39.0k]
  ------------------
 6079|  3.27k|			xmlFreeEnumeration(tree);
 6080|  42.2k|		    break;
 6081|  42.2k|		}
 6082|  84.6k|	    }
 6083|  80.9k|	    if ((ctxt->sax != NULL) && (!ctxt->disableSAX) &&
  ------------------
  |  Branch (6083:10): [True: 80.9k, False: 0]
  |  Branch (6083:33): [True: 74.8k, False: 6.13k]
  ------------------
 6084|  74.8k|		(ctxt->sax->attributeDecl != NULL))
  ------------------
  |  Branch (6084:3): [True: 74.8k, False: 0]
  ------------------
 6085|  74.8k|		ctxt->sax->attributeDecl(ctxt->userData, elemName, attrName,
 6086|  74.8k|	                        type, def, defaultValue, tree);
 6087|  6.13k|	    else if (tree != NULL)
  ------------------
  |  Branch (6087:15): [True: 1.29k, False: 4.84k]
  ------------------
 6088|  1.29k|		xmlFreeEnumeration(tree);
 6089|       |
 6090|  80.9k|	    if ((ctxt->sax2) && (defaultValue != NULL) &&
  ------------------
  |  Branch (6090:10): [True: 60.7k, False: 20.1k]
  |  Branch (6090:26): [True: 23.3k, False: 37.4k]
  ------------------
 6091|  23.3k|	        (def != XML_ATTRIBUTE_IMPLIED) &&
  ------------------
  |  Branch (6091:10): [True: 23.3k, False: 0]
  ------------------
 6092|  23.3k|		(def != XML_ATTRIBUTE_REQUIRED)) {
  ------------------
  |  Branch (6092:3): [True: 23.3k, False: 0]
  ------------------
 6093|  23.3k|		xmlAddDefAttrs(ctxt, elemName, attrName, defaultValue);
 6094|  23.3k|	    }
 6095|  80.9k|	    if (ctxt->sax2) {
  ------------------
  |  Branch (6095:10): [True: 60.7k, False: 20.1k]
  ------------------
 6096|  60.7k|		xmlAddSpecialAttr(ctxt, elemName, attrName, type);
 6097|  60.7k|	    }
 6098|  80.9k|	    if (defaultValue != NULL)
  ------------------
  |  Branch (6098:10): [True: 32.9k, False: 48.0k]
  ------------------
 6099|  32.9k|	        xmlFree(defaultValue);
 6100|  80.9k|	    GROW;
  ------------------
  |  | 2308|  80.9k|    if ((!PARSER_PROGRESSIVE(ctxt)) && \
  |  |  ------------------
  |  |  |  |   47|  80.9k|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|  80.9k|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2308:9): [True: 67.0k, False: 13.8k]
  |  |  ------------------
  |  | 2309|  80.9k|        (ctxt->input->end - ctxt->input->cur < INPUT_CHUNK)) \
  |  |  ------------------
  |  |  |  |   63|  67.0k|#define INPUT_CHUNK	250
  |  |  ------------------
  |  |  |  Branch (2309:9): [True: 26.1k, False: 40.8k]
  |  |  ------------------
  |  | 2310|  80.9k|	xmlParserGrow(ctxt);
  ------------------
 6101|  80.9k|	}
 6102|   107k|	if (RAW == '>') {
  ------------------
  |  | 2261|   107k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (6102:6): [True: 48.1k, False: 59.3k]
  ------------------
 6103|  48.1k|#ifdef LIBXML_VALID_ENABLED
 6104|  48.1k|	    if ((ctxt->validate) && (ctxt->inputNr > oldInputNr)) {
  ------------------
  |  Branch (6104:10): [True: 40.5k, False: 7.61k]
  |  Branch (6104:30): [True: 91, False: 40.4k]
  ------------------
 6105|     91|		xmlValidityError(ctxt, XML_ERR_ENTITY_BOUNDARY,
 6106|     91|                                 "Attribute list declaration doesn't start and"
 6107|     91|                                 " stop in the same entity\n",
 6108|     91|                                 NULL, NULL);
 6109|     91|	    }
 6110|  48.1k|#endif
 6111|  48.1k|	    NEXT;
  ------------------
  |  | 2316|  48.1k|#define NEXT xmlNextChar(ctxt)
  ------------------
 6112|  48.1k|	}
 6113|   107k|    }
 6114|   108k|}
xmlParseElementMixedContentDecl:
 6179|  7.66k|xmlParseElementMixedContentDecl(xmlParserCtxt *ctxt, int openInputNr) {
 6180|  7.66k|    xmlElementContentPtr ret = NULL, cur = NULL, n;
 6181|  7.66k|    const xmlChar *elem = NULL;
 6182|       |
 6183|  7.66k|    GROW;
  ------------------
  |  | 2308|  7.66k|    if ((!PARSER_PROGRESSIVE(ctxt)) && \
  |  |  ------------------
  |  |  |  |   47|  7.66k|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|  7.66k|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2308:9): [True: 6.13k, False: 1.52k]
  |  |  ------------------
  |  | 2309|  7.66k|        (ctxt->input->end - ctxt->input->cur < INPUT_CHUNK)) \
  |  |  ------------------
  |  |  |  |   63|  6.13k|#define INPUT_CHUNK	250
  |  |  ------------------
  |  |  |  Branch (2309:9): [True: 3.21k, False: 2.92k]
  |  |  ------------------
  |  | 2310|  7.66k|	xmlParserGrow(ctxt);
  ------------------
 6184|  7.66k|    if (CMP7(CUR_PTR, '#', 'P', 'C', 'D', 'A', 'T', 'A')) {
  ------------------
  |  | 2275|  7.66k|  ( CMP6( s, c1, c2, c3, c4, c5, c6 ) && ((unsigned char *) s)[ 6 ] == c7 )
  |  |  ------------------
  |  |  |  | 2273|  15.3k|  ( CMP5( s, c1, c2, c3, c4, c5 ) && ((unsigned char *) s)[ 5 ] == c6 )
  |  |  |  |  ------------------
  |  |  |  |  |  | 2271|  15.3k|  ( CMP4( s, c1, c2, c3, c4 ) && ((unsigned char *) s)[ 4 ] == c5 )
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  | 2268|  15.3k|  ( ((unsigned char *) s)[ 0 ] == c1 && ((unsigned char *) s)[ 1 ] == c2 && \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (2268:5): [True: 7.66k, False: 0]
  |  |  |  |  |  |  |  |  |  Branch (2268:41): [True: 7.66k, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  | 2269|  7.66k|    ((unsigned char *) s)[ 2 ] == c3 && ((unsigned char *) s)[ 3 ] == c4 )
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (2269:5): [True: 7.66k, False: 0]
  |  |  |  |  |  |  |  |  |  Branch (2269:41): [True: 7.66k, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (2271:34): [True: 7.66k, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2273:38): [True: 7.66k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2275:42): [True: 7.66k, False: 0]
  |  |  ------------------
  ------------------
 6185|  7.66k|	SKIP(7);
  ------------------
  |  | 2285|  7.66k|#define SKIP(val) do {							\
  |  | 2286|  7.66k|    ctxt->input->cur += (val),ctxt->input->col+=(val);			\
  |  | 2287|  7.66k|    if (*ctxt->input->cur == 0)						\
  |  |  ------------------
  |  |  |  Branch (2287:9): [True: 212, False: 7.45k]
  |  |  ------------------
  |  | 2288|  7.66k|        xmlParserGrow(ctxt);						\
  |  | 2289|  7.66k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2289:12): [Folded, False: 7.66k]
  |  |  ------------------
  ------------------
 6186|  7.66k|        xmlSkipBlankCharsPEBalanced(ctxt, openInputNr);
 6187|  7.66k|	if (RAW == ')') {
  ------------------
  |  | 2261|  7.66k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (6187:6): [True: 3.52k, False: 4.13k]
  ------------------
 6188|  3.52k|#ifdef LIBXML_VALID_ENABLED
 6189|  3.52k|	    if ((ctxt->validate) && (ctxt->inputNr > openInputNr)) {
  ------------------
  |  Branch (6189:10): [True: 2.62k, False: 898]
  |  Branch (6189:30): [True: 10, False: 2.61k]
  ------------------
 6190|     10|		xmlValidityError(ctxt, XML_ERR_ENTITY_BOUNDARY,
 6191|     10|                                 "Element content declaration doesn't start "
 6192|     10|                                 "and stop in the same entity\n",
 6193|     10|                                 NULL, NULL);
 6194|     10|	    }
 6195|  3.52k|#endif
 6196|  3.52k|	    NEXT;
  ------------------
  |  | 2316|  3.52k|#define NEXT xmlNextChar(ctxt)
  ------------------
 6197|  3.52k|	    ret = xmlNewDocElementContent(ctxt->myDoc, NULL, XML_ELEMENT_CONTENT_PCDATA);
 6198|  3.52k|	    if (ret == NULL)
  ------------------
  |  Branch (6198:10): [True: 1, False: 3.52k]
  ------------------
 6199|      1|                goto mem_error;
 6200|  3.52k|	    if (RAW == '*') {
  ------------------
  |  | 2261|  3.52k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (6200:10): [True: 273, False: 3.25k]
  ------------------
 6201|    273|		ret->ocur = XML_ELEMENT_CONTENT_MULT;
 6202|    273|		NEXT;
  ------------------
  |  | 2316|    273|#define NEXT xmlNextChar(ctxt)
  ------------------
 6203|    273|	    }
 6204|  3.52k|	    return(ret);
 6205|  3.52k|	}
 6206|  4.13k|	if ((RAW == '(') || (RAW == '|')) {
  ------------------
  |  | 2261|  4.13k|#define RAW (*ctxt->input->cur)
  ------------------
              	if ((RAW == '(') || (RAW == '|')) {
  ------------------
  |  | 2261|  4.13k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (6206:6): [True: 2, False: 4.13k]
  |  Branch (6206:22): [True: 3.04k, False: 1.09k]
  ------------------
 6207|  3.04k|	    ret = cur = xmlNewDocElementContent(ctxt->myDoc, NULL, XML_ELEMENT_CONTENT_PCDATA);
 6208|  3.04k|	    if (ret == NULL)
  ------------------
  |  Branch (6208:10): [True: 2, False: 3.04k]
  ------------------
 6209|      2|                goto mem_error;
 6210|  3.04k|	}
 6211|  25.9k|	while ((RAW == '|') && (PARSER_STOPPED(ctxt) == 0)) {
  ------------------
  |  | 2261|  25.9k|#define RAW (*ctxt->input->cur)
  ------------------
              	while ((RAW == '|') && (PARSER_STOPPED(ctxt) == 0)) {
  ------------------
  |  |   44|  21.9k|#define PARSER_STOPPED(ctxt) ((ctxt)->disableSAX > 1)
  ------------------
  |  Branch (6211:9): [True: 21.9k, False: 4.02k]
  |  Branch (6211:25): [True: 21.9k, False: 1]
  ------------------
 6212|  21.9k|	    NEXT;
  ------------------
  |  | 2316|  21.9k|#define NEXT xmlNextChar(ctxt)
  ------------------
 6213|  21.9k|            n = xmlNewDocElementContent(ctxt->myDoc, NULL, XML_ELEMENT_CONTENT_OR);
 6214|  21.9k|            if (n == NULL)
  ------------------
  |  Branch (6214:17): [True: 1, False: 21.9k]
  ------------------
 6215|      1|                goto mem_error;
 6216|  21.9k|	    if (elem == NULL) {
  ------------------
  |  Branch (6216:10): [True: 3.03k, False: 18.8k]
  ------------------
 6217|  3.03k|		n->c1 = cur;
 6218|  3.03k|		if (cur != NULL)
  ------------------
  |  Branch (6218:7): [True: 3.03k, False: 0]
  ------------------
 6219|  3.03k|		    cur->parent = n;
 6220|  3.03k|		ret = cur = n;
 6221|  18.8k|	    } else {
 6222|  18.8k|	        cur->c2 = n;
 6223|  18.8k|		n->parent = cur;
 6224|  18.8k|		n->c1 = xmlNewDocElementContent(ctxt->myDoc, elem, XML_ELEMENT_CONTENT_ELEMENT);
 6225|  18.8k|                if (n->c1 == NULL)
  ------------------
  |  Branch (6225:21): [True: 1, False: 18.8k]
  ------------------
 6226|      1|                    goto mem_error;
 6227|  18.8k|		n->c1->parent = n;
 6228|  18.8k|		cur = n;
 6229|  18.8k|	    }
 6230|  21.9k|            xmlSkipBlankCharsPEBalanced(ctxt, openInputNr);
 6231|  21.9k|	    elem = xmlParseName(ctxt);
 6232|  21.9k|	    if (elem == NULL) {
  ------------------
  |  Branch (6232:10): [True: 108, False: 21.8k]
  ------------------
 6233|    108|		xmlFatalErrMsg(ctxt, XML_ERR_NAME_REQUIRED,
 6234|    108|			"xmlParseElementMixedContentDecl : Name expected\n");
 6235|    108|		xmlFreeDocElementContent(ctxt->myDoc, ret);
 6236|    108|		return(NULL);
 6237|    108|	    }
 6238|  21.8k|            xmlSkipBlankCharsPEBalanced(ctxt, openInputNr);
 6239|  21.8k|	}
 6240|  4.02k|	if ((RAW == ')') && (NXT(1) == '*')) {
  ------------------
  |  | 2261|  4.02k|#define RAW (*ctxt->input->cur)
  ------------------
              	if ((RAW == ')') && (NXT(1) == '*')) {
  ------------------
  |  | 2263|  2.82k|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
  |  Branch (6240:6): [True: 2.82k, False: 1.20k]
  |  Branch (6240:22): [True: 2.81k, False: 10]
  ------------------
 6241|  2.81k|	    if (elem != NULL) {
  ------------------
  |  Branch (6241:10): [True: 2.81k, False: 0]
  ------------------
 6242|  2.81k|		cur->c2 = xmlNewDocElementContent(ctxt->myDoc, elem,
 6243|  2.81k|		                               XML_ELEMENT_CONTENT_ELEMENT);
 6244|  2.81k|		if (cur->c2 == NULL)
  ------------------
  |  Branch (6244:7): [True: 1, False: 2.81k]
  ------------------
 6245|      1|                    goto mem_error;
 6246|  2.81k|		cur->c2->parent = cur;
 6247|  2.81k|            }
 6248|  2.81k|            if (ret != NULL)
  ------------------
  |  Branch (6248:17): [True: 2.81k, False: 0]
  ------------------
 6249|  2.81k|                ret->ocur = XML_ELEMENT_CONTENT_MULT;
 6250|  2.81k|#ifdef LIBXML_VALID_ENABLED
 6251|  2.81k|	    if ((ctxt->validate) && (ctxt->inputNr > openInputNr)) {
  ------------------
  |  Branch (6251:10): [True: 2.12k, False: 685]
  |  Branch (6251:30): [True: 3, False: 2.12k]
  ------------------
 6252|      3|		xmlValidityError(ctxt, XML_ERR_ENTITY_BOUNDARY,
 6253|      3|                                 "Element content declaration doesn't start "
 6254|      3|                                 "and stop in the same entity\n",
 6255|      3|                                 NULL, NULL);
 6256|      3|	    }
 6257|  2.81k|#endif
 6258|  2.81k|	    SKIP(2);
  ------------------
  |  | 2285|  2.81k|#define SKIP(val) do {							\
  |  | 2286|  2.81k|    ctxt->input->cur += (val),ctxt->input->col+=(val);			\
  |  | 2287|  2.81k|    if (*ctxt->input->cur == 0)						\
  |  |  ------------------
  |  |  |  Branch (2287:9): [True: 393, False: 2.42k]
  |  |  ------------------
  |  | 2288|  2.81k|        xmlParserGrow(ctxt);						\
  |  | 2289|  2.81k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2289:12): [Folded, False: 2.81k]
  |  |  ------------------
  ------------------
 6259|  2.81k|	} else {
 6260|  1.21k|	    xmlFreeDocElementContent(ctxt->myDoc, ret);
 6261|  1.21k|	    xmlFatalErr(ctxt, XML_ERR_MIXED_NOT_STARTED, NULL);
 6262|  1.21k|	    return(NULL);
 6263|  1.21k|	}
 6264|       |
 6265|  4.02k|    } else {
 6266|      0|	xmlFatalErr(ctxt, XML_ERR_PCDATA_REQUIRED, NULL);
 6267|      0|    }
 6268|  2.81k|    return(ret);
 6269|       |
 6270|      6|mem_error:
 6271|      6|    xmlErrMemory(ctxt);
 6272|      6|    xmlFreeDocElementContent(ctxt->myDoc, ret);
 6273|       |    return(NULL);
 6274|  7.66k|}
xmlParseElementContentDecl:
 6629|  18.5k|                           xmlElementContent **result) {
 6630|       |
 6631|  18.5k|    xmlElementContentPtr tree = NULL;
 6632|  18.5k|    int openInputNr = ctxt->inputNr;
 6633|  18.5k|    int res;
 6634|       |
 6635|  18.5k|    *result = NULL;
 6636|       |
 6637|  18.5k|    if (RAW != '(') {
  ------------------
  |  | 2261|  18.5k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (6637:9): [True: 0, False: 18.5k]
  ------------------
 6638|      0|	xmlFatalErrMsgStr(ctxt, XML_ERR_ELEMCONTENT_NOT_STARTED,
 6639|      0|		"xmlParseElementContentDecl : %s '(' expected\n", name);
 6640|      0|	return(-1);
 6641|      0|    }
 6642|  18.5k|    NEXT;
  ------------------
  |  | 2316|  18.5k|#define NEXT xmlNextChar(ctxt)
  ------------------
 6643|  18.5k|    xmlSkipBlankCharsPEBalanced(ctxt, openInputNr);
 6644|  18.5k|    if (CMP7(CUR_PTR, '#', 'P', 'C', 'D', 'A', 'T', 'A')) {
  ------------------
  |  | 2275|  18.5k|  ( CMP6( s, c1, c2, c3, c4, c5, c6 ) && ((unsigned char *) s)[ 6 ] == c7 )
  |  |  ------------------
  |  |  |  | 2273|  37.1k|  ( CMP5( s, c1, c2, c3, c4, c5 ) && ((unsigned char *) s)[ 5 ] == c6 )
  |  |  |  |  ------------------
  |  |  |  |  |  | 2271|  37.1k|  ( CMP4( s, c1, c2, c3, c4 ) && ((unsigned char *) s)[ 4 ] == c5 )
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  | 2268|  37.1k|  ( ((unsigned char *) s)[ 0 ] == c1 && ((unsigned char *) s)[ 1 ] == c2 && \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (2268:5): [True: 7.71k, False: 10.8k]
  |  |  |  |  |  |  |  |  |  Branch (2268:41): [True: 7.70k, False: 8]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  | 2269|  18.5k|    ((unsigned char *) s)[ 2 ] == c3 && ((unsigned char *) s)[ 3 ] == c4 )
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (2269:5): [True: 7.69k, False: 8]
  |  |  |  |  |  |  |  |  |  Branch (2269:41): [True: 7.68k, False: 6]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (2271:34): [True: 7.68k, False: 7]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2273:38): [True: 7.67k, False: 7]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2275:42): [True: 7.66k, False: 11]
  |  |  ------------------
  ------------------
 6645|  7.66k|        tree = xmlParseElementMixedContentDecl(ctxt, openInputNr);
 6646|  7.66k|	res = XML_ELEMENT_TYPE_MIXED;
 6647|  10.9k|    } else {
 6648|  10.9k|        tree = xmlParseElementChildrenContentDeclPriv(ctxt, openInputNr, 1);
 6649|  10.9k|	res = XML_ELEMENT_TYPE_ELEMENT;
 6650|  10.9k|    }
 6651|  18.5k|    if (tree == NULL)
  ------------------
  |  Branch (6651:9): [True: 4.47k, False: 14.0k]
  ------------------
 6652|  4.47k|        return(-1);
 6653|  14.0k|    SKIP_BLANKS_PE;
  ------------------
  |  | 2314|  14.0k|#define SKIP_BLANKS_PE xmlSkipBlankCharsPE(ctxt)
  ------------------
 6654|  14.0k|    *result = tree;
 6655|  14.0k|    return(res);
 6656|  18.5k|}
xmlParseElementDecl:
 6672|  27.6k|xmlParseElementDecl(xmlParserCtxt *ctxt) {
 6673|  27.6k|    const xmlChar *name;
 6674|  27.6k|    int ret = -1;
 6675|  27.6k|    xmlElementContentPtr content  = NULL;
 6676|       |
 6677|  27.6k|    if ((CUR != '<') || (NXT(1) != '!'))
  ------------------
  |  | 2262|  27.6k|#define CUR (*ctxt->input->cur)
  ------------------
                  if ((CUR != '<') || (NXT(1) != '!'))
  ------------------
  |  | 2263|  27.6k|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
  |  Branch (6677:9): [True: 0, False: 27.6k]
  |  Branch (6677:25): [True: 0, False: 27.6k]
  ------------------
 6678|      0|        return(ret);
 6679|  27.6k|    SKIP(2);
  ------------------
  |  | 2285|  27.6k|#define SKIP(val) do {							\
  |  | 2286|  27.6k|    ctxt->input->cur += (val),ctxt->input->col+=(val);			\
  |  | 2287|  27.6k|    if (*ctxt->input->cur == 0)						\
  |  |  ------------------
  |  |  |  Branch (2287:9): [True: 0, False: 27.6k]
  |  |  ------------------
  |  | 2288|  27.6k|        xmlParserGrow(ctxt);						\
  |  | 2289|  27.6k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2289:12): [Folded, False: 27.6k]
  |  |  ------------------
  ------------------
 6680|       |
 6681|       |    /* GROW; done in the caller */
 6682|  27.6k|    if (CMP7(CUR_PTR, 'E', 'L', 'E', 'M', 'E', 'N', 'T')) {
  ------------------
  |  | 2275|  27.6k|  ( CMP6( s, c1, c2, c3, c4, c5, c6 ) && ((unsigned char *) s)[ 6 ] == c7 )
  |  |  ------------------
  |  |  |  | 2273|  55.3k|  ( CMP5( s, c1, c2, c3, c4, c5 ) && ((unsigned char *) s)[ 5 ] == c6 )
  |  |  |  |  ------------------
  |  |  |  |  |  | 2271|  55.3k|  ( CMP4( s, c1, c2, c3, c4 ) && ((unsigned char *) s)[ 4 ] == c5 )
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  | 2268|  55.3k|  ( ((unsigned char *) s)[ 0 ] == c1 && ((unsigned char *) s)[ 1 ] == c2 && \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (2268:5): [True: 27.6k, False: 0]
  |  |  |  |  |  |  |  |  |  Branch (2268:41): [True: 27.6k, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  | 2269|  27.6k|    ((unsigned char *) s)[ 2 ] == c3 && ((unsigned char *) s)[ 3 ] == c4 )
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (2269:5): [True: 27.6k, False: 19]
  |  |  |  |  |  |  |  |  |  Branch (2269:41): [True: 27.6k, False: 11]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (2271:34): [True: 27.6k, False: 14]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2273:38): [True: 27.6k, False: 11]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2275:42): [True: 27.6k, False: 9]
  |  |  ------------------
  ------------------
 6683|  27.6k|#ifdef LIBXML_VALID_ENABLED
 6684|  27.6k|	int oldInputNr = ctxt->inputNr;
 6685|  27.6k|#endif
 6686|       |
 6687|  27.6k|	SKIP(7);
  ------------------
  |  | 2285|  27.6k|#define SKIP(val) do {							\
  |  | 2286|  27.6k|    ctxt->input->cur += (val),ctxt->input->col+=(val);			\
  |  | 2287|  27.6k|    if (*ctxt->input->cur == 0)						\
  |  |  ------------------
  |  |  |  Branch (2287:9): [True: 370, False: 27.2k]
  |  |  ------------------
  |  | 2288|  27.6k|        xmlParserGrow(ctxt);						\
  |  | 2289|  27.6k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2289:12): [Folded, False: 27.6k]
  |  |  ------------------
  ------------------
 6688|  27.6k|	if (SKIP_BLANKS_PE == 0) {
  ------------------
  |  | 2314|  27.6k|#define SKIP_BLANKS_PE xmlSkipBlankCharsPE(ctxt)
  ------------------
  |  Branch (6688:6): [True: 529, False: 27.0k]
  ------------------
 6689|    529|	    xmlFatalErrMsg(ctxt, XML_ERR_SPACE_REQUIRED,
 6690|    529|		           "Space required after 'ELEMENT'\n");
 6691|    529|	    return(-1);
 6692|    529|	}
 6693|  27.0k|        name = xmlParseName(ctxt);
 6694|  27.0k|	if (name == NULL) {
  ------------------
  |  Branch (6694:6): [True: 333, False: 26.7k]
  ------------------
 6695|    333|	    xmlFatalErrMsg(ctxt, XML_ERR_NAME_REQUIRED,
 6696|    333|			   "xmlParseElementDecl: no name for Element\n");
 6697|    333|	    return(-1);
 6698|    333|	}
 6699|  26.7k|	if (SKIP_BLANKS_PE == 0) {
  ------------------
  |  | 2314|  26.7k|#define SKIP_BLANKS_PE xmlSkipBlankCharsPE(ctxt)
  ------------------
  |  Branch (6699:6): [True: 2.57k, False: 24.1k]
  ------------------
 6700|  2.57k|	    xmlFatalErrMsg(ctxt, XML_ERR_SPACE_REQUIRED,
 6701|  2.57k|			   "Space required after the element name\n");
 6702|  2.57k|	}
 6703|  26.7k|	if (CMP5(CUR_PTR, 'E', 'M', 'P', 'T', 'Y')) {
  ------------------
  |  | 2271|  26.7k|  ( CMP4( s, c1, c2, c3, c4 ) && ((unsigned char *) s)[ 4 ] == c5 )
  |  |  ------------------
  |  |  |  | 2268|  53.4k|  ( ((unsigned char *) s)[ 0 ] == c1 && ((unsigned char *) s)[ 1 ] == c2 && \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2268:5): [True: 5.79k, False: 20.9k]
  |  |  |  |  |  Branch (2268:41): [True: 5.78k, False: 11]
  |  |  |  |  ------------------
  |  |  |  | 2269|  26.7k|    ((unsigned char *) s)[ 2 ] == c3 && ((unsigned char *) s)[ 3 ] == c4 )
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2269:5): [True: 5.77k, False: 9]
  |  |  |  |  |  Branch (2269:41): [True: 5.77k, False: 2]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2271:34): [True: 5.76k, False: 2]
  |  |  ------------------
  ------------------
 6704|  5.76k|	    SKIP(5);
  ------------------
  |  | 2285|  5.76k|#define SKIP(val) do {							\
  |  | 2286|  5.76k|    ctxt->input->cur += (val),ctxt->input->col+=(val);			\
  |  | 2287|  5.76k|    if (*ctxt->input->cur == 0)						\
  |  |  ------------------
  |  |  |  Branch (2287:9): [True: 80, False: 5.68k]
  |  |  ------------------
  |  | 2288|  5.76k|        xmlParserGrow(ctxt);						\
  |  | 2289|  5.76k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2289:12): [Folded, False: 5.76k]
  |  |  ------------------
  ------------------
 6705|       |	    /*
 6706|       |	     * Element must always be empty.
 6707|       |	     */
 6708|  5.76k|	    ret = XML_ELEMENT_TYPE_EMPTY;
 6709|  20.9k|	} else if ((RAW == 'A') && (NXT(1) == 'N') &&
  ------------------
  |  | 2261|  20.9k|#define RAW (*ctxt->input->cur)
  ------------------
              	} else if ((RAW == 'A') && (NXT(1) == 'N') &&
  ------------------
  |  | 2263|  1.12k|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
  |  Branch (6709:13): [True: 1.12k, False: 19.8k]
  |  Branch (6709:29): [True: 1.11k, False: 4]
  ------------------
 6710|  1.11k|	           (NXT(2) == 'Y')) {
  ------------------
  |  | 2263|  1.11k|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
  |  Branch (6710:13): [True: 1.11k, False: 3]
  ------------------
 6711|  1.11k|	    SKIP(3);
  ------------------
  |  | 2285|  1.11k|#define SKIP(val) do {							\
  |  | 2286|  1.11k|    ctxt->input->cur += (val),ctxt->input->col+=(val);			\
  |  | 2287|  1.11k|    if (*ctxt->input->cur == 0)						\
  |  |  ------------------
  |  |  |  Branch (2287:9): [True: 284, False: 830]
  |  |  ------------------
  |  | 2288|  1.11k|        xmlParserGrow(ctxt);						\
  |  | 2289|  1.11k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2289:12): [Folded, False: 1.11k]
  |  |  ------------------
  ------------------
 6712|       |	    /*
 6713|       |	     * Element is a generic container.
 6714|       |	     */
 6715|  1.11k|	    ret = XML_ELEMENT_TYPE_ANY;
 6716|  19.8k|	} else if (RAW == '(') {
  ------------------
  |  | 2261|  19.8k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (6716:13): [True: 18.5k, False: 1.29k]
  ------------------
 6717|  18.5k|	    ret = xmlParseElementContentDecl(ctxt, name, &content);
 6718|  18.5k|            if (ret <= 0)
  ------------------
  |  Branch (6718:17): [True: 4.47k, False: 14.0k]
  ------------------
 6719|  4.47k|                return(-1);
 6720|  18.5k|	} else {
 6721|       |	    /*
 6722|       |	     * [ WFC: PEs in Internal Subset ] error handling.
 6723|       |	     */
 6724|  1.29k|            xmlFatalErrMsg(ctxt, XML_ERR_ELEMCONTENT_NOT_STARTED,
 6725|  1.29k|                  "xmlParseElementDecl: 'EMPTY', 'ANY' or '(' expected\n");
 6726|  1.29k|	    return(-1);
 6727|  1.29k|	}
 6728|       |
 6729|  20.9k|	SKIP_BLANKS_PE;
  ------------------
  |  | 2314|  20.9k|#define SKIP_BLANKS_PE xmlSkipBlankCharsPE(ctxt)
  ------------------
 6730|       |
 6731|  20.9k|	if (RAW != '>') {
  ------------------
  |  | 2261|  20.9k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (6731:6): [True: 1.78k, False: 19.1k]
  ------------------
 6732|  1.78k|	    xmlFatalErr(ctxt, XML_ERR_GT_REQUIRED, NULL);
 6733|  1.78k|	    if (content != NULL) {
  ------------------
  |  Branch (6733:10): [True: 1.40k, False: 380]
  ------------------
 6734|  1.40k|		xmlFreeDocElementContent(ctxt->myDoc, content);
 6735|  1.40k|	    }
 6736|  19.1k|	} else {
 6737|  19.1k|#ifdef LIBXML_VALID_ENABLED
 6738|  19.1k|	    if ((ctxt->validate) && (ctxt->inputNr > oldInputNr)) {
  ------------------
  |  Branch (6738:10): [True: 14.4k, False: 4.77k]
  |  Branch (6738:30): [True: 70, False: 14.3k]
  ------------------
 6739|     70|		xmlValidityError(ctxt, XML_ERR_ENTITY_BOUNDARY,
 6740|     70|                                 "Element declaration doesn't start and stop in"
 6741|     70|                                 " the same entity\n",
 6742|     70|                                 NULL, NULL);
 6743|     70|	    }
 6744|  19.1k|#endif
 6745|       |
 6746|  19.1k|	    NEXT;
  ------------------
  |  | 2316|  19.1k|#define NEXT xmlNextChar(ctxt)
  ------------------
 6747|  19.1k|	    if ((ctxt->sax != NULL) && (!ctxt->disableSAX) &&
  ------------------
  |  Branch (6747:10): [True: 19.1k, False: 0]
  |  Branch (6747:33): [True: 17.6k, False: 1.53k]
  ------------------
 6748|  17.6k|		(ctxt->sax->elementDecl != NULL)) {
  ------------------
  |  Branch (6748:3): [True: 17.6k, False: 0]
  ------------------
 6749|  17.6k|		if (content != NULL)
  ------------------
  |  Branch (6749:7): [True: 11.5k, False: 6.08k]
  ------------------
 6750|  11.5k|		    content->parent = NULL;
 6751|  17.6k|	        ctxt->sax->elementDecl(ctxt->userData, name, ret,
 6752|  17.6k|		                       content);
 6753|  17.6k|		if ((content != NULL) && (content->parent == NULL)) {
  ------------------
  |  Branch (6753:7): [True: 11.5k, False: 6.08k]
  |  Branch (6753:28): [True: 2.47k, False: 9.09k]
  ------------------
 6754|       |		    /*
 6755|       |		     * this is a trick: if xmlAddElementDecl is called,
 6756|       |		     * instead of copying the full tree it is plugged directly
 6757|       |		     * if called from the parser. Avoid duplicating the
 6758|       |		     * interfaces or change the API/ABI
 6759|       |		     */
 6760|  2.47k|		    xmlFreeDocElementContent(ctxt->myDoc, content);
 6761|  2.47k|		}
 6762|  17.6k|	    } else if (content != NULL) {
  ------------------
  |  Branch (6762:17): [True: 1.11k, False: 418]
  ------------------
 6763|  1.11k|		xmlFreeDocElementContent(ctxt->myDoc, content);
 6764|  1.11k|	    }
 6765|  19.1k|	}
 6766|  20.9k|    }
 6767|  21.0k|    return(ret);
 6768|  27.6k|}
xmlParseMarkupDecl:
 6943|   611k|xmlParseMarkupDecl(xmlParserCtxt *ctxt) {
 6944|   611k|    GROW;
  ------------------
  |  | 2308|   611k|    if ((!PARSER_PROGRESSIVE(ctxt)) && \
  |  |  ------------------
  |  |  |  |   47|   611k|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|   611k|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2308:9): [True: 575k, False: 35.5k]
  |  |  ------------------
  |  | 2309|   611k|        (ctxt->input->end - ctxt->input->cur < INPUT_CHUNK)) \
  |  |  ------------------
  |  |  |  |   63|   575k|#define INPUT_CHUNK	250
  |  |  ------------------
  |  |  |  Branch (2309:9): [True: 246k, False: 329k]
  |  |  ------------------
  |  | 2310|   611k|	xmlParserGrow(ctxt);
  ------------------
 6945|   611k|    if (CUR == '<') {
  ------------------
  |  | 2262|   611k|#define CUR (*ctxt->input->cur)
  ------------------
  |  Branch (6945:9): [True: 611k, False: 0]
  ------------------
 6946|   611k|        if (NXT(1) == '!') {
  ------------------
  |  | 2263|   611k|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
  |  Branch (6946:13): [True: 591k, False: 19.9k]
  ------------------
 6947|   591k|	    switch (NXT(2)) {
  ------------------
  |  | 2263|   591k|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
 6948|   229k|	        case 'E':
  ------------------
  |  Branch (6948:10): [True: 229k, False: 361k]
  ------------------
 6949|   229k|		    if (NXT(3) == 'L')
  ------------------
  |  | 2263|   229k|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
  |  Branch (6949:11): [True: 27.6k, False: 202k]
  ------------------
 6950|  27.6k|			xmlParseElementDecl(ctxt);
 6951|   202k|		    else if (NXT(3) == 'N')
  ------------------
  |  | 2263|   202k|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
  |  Branch (6951:16): [True: 202k, False: 28]
  ------------------
 6952|   202k|			xmlParseEntityDecl(ctxt);
 6953|     28|                    else
 6954|     28|                        SKIP(2);
  ------------------
  |  | 2285|     28|#define SKIP(val) do {							\
  |  | 2286|     28|    ctxt->input->cur += (val),ctxt->input->col+=(val);			\
  |  | 2287|     28|    if (*ctxt->input->cur == 0)						\
  |  |  ------------------
  |  |  |  Branch (2287:9): [True: 0, False: 28]
  |  |  ------------------
  |  | 2288|     28|        xmlParserGrow(ctxt);						\
  |  | 2289|     28|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2289:12): [Folded, False: 28]
  |  |  ------------------
  ------------------
 6955|   229k|		    break;
 6956|   108k|	        case 'A':
  ------------------
  |  Branch (6956:10): [True: 108k, False: 483k]
  ------------------
 6957|   108k|		    xmlParseAttributeListDecl(ctxt);
 6958|   108k|		    break;
 6959|  4.81k|	        case 'N':
  ------------------
  |  Branch (6959:10): [True: 4.81k, False: 586k]
  ------------------
 6960|  4.81k|		    xmlParseNotationDecl(ctxt);
 6961|  4.81k|		    break;
 6962|   239k|	        case '-':
  ------------------
  |  Branch (6962:10): [True: 239k, False: 351k]
  ------------------
 6963|   239k|		    xmlParseComment(ctxt);
 6964|   239k|		    break;
 6965|  8.51k|		default:
  ------------------
  |  Branch (6965:3): [True: 8.51k, False: 582k]
  ------------------
 6966|  8.51k|                    xmlFatalErr(ctxt,
 6967|  8.51k|                                ctxt->inSubset == 2 ?
  ------------------
  |  Branch (6967:33): [True: 1.36k, False: 7.15k]
  ------------------
 6968|  1.36k|                                    XML_ERR_EXT_SUBSET_NOT_FINISHED :
 6969|  8.51k|                                    XML_ERR_INT_SUBSET_NOT_FINISHED,
 6970|  8.51k|                                NULL);
 6971|  8.51k|                    SKIP(2);
  ------------------
  |  | 2285|  8.51k|#define SKIP(val) do {							\
  |  | 2286|  8.51k|    ctxt->input->cur += (val),ctxt->input->col+=(val);			\
  |  | 2287|  8.51k|    if (*ctxt->input->cur == 0)						\
  |  |  ------------------
  |  |  |  Branch (2287:9): [True: 542, False: 7.97k]
  |  |  ------------------
  |  | 2288|  8.51k|        xmlParserGrow(ctxt);						\
  |  | 2289|  8.51k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2289:12): [Folded, False: 8.51k]
  |  |  ------------------
  ------------------
 6972|  8.51k|		    break;
 6973|   591k|	    }
 6974|   591k|	} else if (NXT(1) == '?') {
  ------------------
  |  | 2263|  19.9k|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
  |  Branch (6974:13): [True: 19.9k, False: 0]
  ------------------
 6975|  19.9k|	    xmlParsePI(ctxt);
 6976|  19.9k|	}
 6977|   611k|    }
 6978|   611k|}
xmlParseTextDecl:
 6990|   238k|xmlParseTextDecl(xmlParserCtxt *ctxt) {
 6991|   238k|    xmlChar *version;
 6992|       |
 6993|       |    /*
 6994|       |     * We know that '<?xml' is here.
 6995|       |     */
 6996|   238k|    if ((CMP5(CUR_PTR, '<', '?', 'x', 'm', 'l')) && (IS_BLANK_CH(NXT(5)))) {
  ------------------
  |  | 2271|   238k|  ( CMP4( s, c1, c2, c3, c4 ) && ((unsigned char *) s)[ 4 ] == c5 )
  |  |  ------------------
  |  |  |  | 2268|   476k|  ( ((unsigned char *) s)[ 0 ] == c1 && ((unsigned char *) s)[ 1 ] == c2 && \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2268:5): [True: 238k, False: 0]
  |  |  |  |  |  Branch (2268:41): [True: 238k, False: 0]
  |  |  |  |  ------------------
  |  |  |  | 2269|   238k|    ((unsigned char *) s)[ 2 ] == c3 && ((unsigned char *) s)[ 3 ] == c4 )
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2269:5): [True: 238k, False: 0]
  |  |  |  |  |  Branch (2269:41): [True: 238k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2271:34): [True: 238k, False: 0]
  |  |  ------------------
  ------------------
                  if ((CMP5(CUR_PTR, '<', '?', 'x', 'm', 'l')) && (IS_BLANK_CH(NXT(5)))) {
  ------------------
  |  |  137|   238k|#define IS_BLANK_CH(c)  xmlIsBlank_ch(c)
  |  |  ------------------
  |  |  |  |   90|   238k|#define xmlIsBlank_ch(c)	(((c) == 0x20) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (90:27): [True: 235k, False: 2.59k]
  |  |  |  |  ------------------
  |  |  |  |   91|   238k|				 ((0x9 <= (c)) && ((c) <= 0xa)) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (91:7): [True: 2.58k, False: 7]
  |  |  |  |  |  Branch (91:23): [True: 1.62k, False: 963]
  |  |  |  |  ------------------
  |  |  |  |   92|   238k|				 ((c) == 0xd))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (92:6): [True: 948, False: 22]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 6997|   238k|	SKIP(5);
  ------------------
  |  | 2285|   238k|#define SKIP(val) do {							\
  |  | 2286|   238k|    ctxt->input->cur += (val),ctxt->input->col+=(val);			\
  |  | 2287|   238k|    if (*ctxt->input->cur == 0)						\
  |  |  ------------------
  |  |  |  Branch (2287:9): [True: 0, False: 238k]
  |  |  ------------------
  |  | 2288|   238k|        xmlParserGrow(ctxt);						\
  |  | 2289|   238k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2289:12): [Folded, False: 238k]
  |  |  ------------------
  ------------------
 6998|   238k|    } else {
 6999|     22|	xmlFatalErr(ctxt, XML_ERR_XMLDECL_NOT_STARTED, NULL);
 7000|     22|	return;
 7001|     22|    }
 7002|       |
 7003|   238k|    if (SKIP_BLANKS == 0) {
  ------------------
  |  | 2312|   238k|#define SKIP_BLANKS xmlSkipBlankChars(ctxt)
  ------------------
  |  Branch (7003:9): [True: 0, False: 238k]
  ------------------
 7004|      0|	xmlFatalErrMsg(ctxt, XML_ERR_SPACE_REQUIRED,
 7005|      0|		       "Space needed after '<?xml'\n");
 7006|      0|    }
 7007|       |
 7008|       |    /*
 7009|       |     * We may have the VersionInfo here.
 7010|       |     */
 7011|   238k|    version = xmlParseVersionInfo(ctxt);
 7012|   238k|    if (version == NULL) {
  ------------------
  |  Branch (7012:9): [True: 230k, False: 7.33k]
  ------------------
 7013|   230k|	version = xmlCharStrdup(XML_DEFAULT_VERSION);
  ------------------
  |  |   42|   230k|#define XML_DEFAULT_VERSION	"1.0"
  ------------------
 7014|   230k|        if (version == NULL) {
  ------------------
  |  Branch (7014:13): [True: 8, False: 230k]
  ------------------
 7015|      8|            xmlErrMemory(ctxt);
 7016|      8|            return;
 7017|      8|        }
 7018|   230k|    } else {
 7019|  7.33k|	if (SKIP_BLANKS == 0) {
  ------------------
  |  | 2312|  7.33k|#define SKIP_BLANKS xmlSkipBlankChars(ctxt)
  ------------------
  |  Branch (7019:6): [True: 843, False: 6.49k]
  ------------------
 7020|    843|	    xmlFatalErrMsg(ctxt, XML_ERR_SPACE_REQUIRED,
 7021|    843|		           "Space needed here\n");
 7022|    843|	}
 7023|  7.33k|    }
 7024|   238k|    ctxt->input->version = version;
 7025|       |
 7026|       |    /*
 7027|       |     * We must have the encoding declaration
 7028|       |     */
 7029|   238k|    xmlParseEncodingDecl(ctxt);
 7030|       |
 7031|   238k|    SKIP_BLANKS;
  ------------------
  |  | 2312|   238k|#define SKIP_BLANKS xmlSkipBlankChars(ctxt)
  ------------------
 7032|   238k|    if ((RAW == '?') && (NXT(1) == '>')) {
  ------------------
  |  | 2261|   238k|#define RAW (*ctxt->input->cur)
  ------------------
                  if ((RAW == '?') && (NXT(1) == '>')) {
  ------------------
  |  | 2263|  3.65k|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
  |  Branch (7032:9): [True: 3.65k, False: 234k]
  |  Branch (7032:25): [True: 2.79k, False: 854]
  ------------------
 7033|  2.79k|        SKIP(2);
  ------------------
  |  | 2285|  2.79k|#define SKIP(val) do {							\
  |  | 2286|  2.79k|    ctxt->input->cur += (val),ctxt->input->col+=(val);			\
  |  | 2287|  2.79k|    if (*ctxt->input->cur == 0)						\
  |  |  ------------------
  |  |  |  Branch (2287:9): [True: 436, False: 2.36k]
  |  |  ------------------
  |  | 2288|  2.79k|        xmlParserGrow(ctxt);						\
  |  | 2289|  2.79k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2289:12): [Folded, False: 2.79k]
  |  |  ------------------
  ------------------
 7034|   235k|    } else if (RAW == '>') {
  ------------------
  |  | 2261|   235k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (7034:16): [True: 198, False: 235k]
  ------------------
 7035|       |        /* Deprecated old WD ... */
 7036|    198|	xmlFatalErr(ctxt, XML_ERR_XMLDECL_NOT_FINISHED, NULL);
 7037|    198|	NEXT;
  ------------------
  |  | 2316|    198|#define NEXT xmlNextChar(ctxt)
  ------------------
 7038|   235k|    } else {
 7039|   235k|        int c;
 7040|       |
 7041|   235k|	xmlFatalErr(ctxt, XML_ERR_XMLDECL_NOT_FINISHED, NULL);
 7042|   521M|        while ((PARSER_STOPPED(ctxt) == 0) && ((c = CUR) != 0)) {
  ------------------
  |  |   44|   521M|#define PARSER_STOPPED(ctxt) ((ctxt)->disableSAX > 1)
  ------------------
                      while ((PARSER_STOPPED(ctxt) == 0) && ((c = CUR) != 0)) {
  ------------------
  |  | 2262|   521M|#define CUR (*ctxt->input->cur)
  ------------------
  |  Branch (7042:16): [True: 521M, False: 44]
  |  Branch (7042:47): [True: 521M, False: 11.8k]
  ------------------
 7043|   521M|            NEXT;
  ------------------
  |  | 2316|   521M|#define NEXT xmlNextChar(ctxt)
  ------------------
 7044|   521M|            if (c == '>')
  ------------------
  |  Branch (7044:17): [True: 223k, False: 521M]
  ------------------
 7045|   223k|                break;
 7046|   521M|        }
 7047|   235k|    }
 7048|   238k|}
xmlParseExternalSubset:
 7065|  2.11k|                       const xmlChar *systemId) {
 7066|  2.11k|    int oldInputNr;
 7067|       |
 7068|  2.11k|    xmlCtxtInitializeLate(ctxt);
 7069|       |
 7070|  2.11k|    xmlDetectEncoding(ctxt);
 7071|       |
 7072|  2.11k|    if (CMP5(CUR_PTR, '<', '?', 'x', 'm', 'l')) {
  ------------------
  |  | 2271|  2.11k|  ( CMP4( s, c1, c2, c3, c4 ) && ((unsigned char *) s)[ 4 ] == c5 )
  |  |  ------------------
  |  |  |  | 2268|  4.22k|  ( ((unsigned char *) s)[ 0 ] == c1 && ((unsigned char *) s)[ 1 ] == c2 && \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2268:5): [True: 1.96k, False: 142]
  |  |  |  |  |  Branch (2268:41): [True: 271, False: 1.69k]
  |  |  |  |  ------------------
  |  |  |  | 2269|  2.11k|    ((unsigned char *) s)[ 2 ] == c3 && ((unsigned char *) s)[ 3 ] == c4 )
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2269:5): [True: 160, False: 111]
  |  |  |  |  |  Branch (2269:41): [True: 151, False: 9]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2271:34): [True: 132, False: 19]
  |  |  ------------------
  ------------------
 7073|    132|	xmlParseTextDecl(ctxt);
 7074|    132|    }
 7075|  2.11k|    if (ctxt->myDoc == NULL) {
  ------------------
  |  Branch (7075:9): [True: 0, False: 2.11k]
  ------------------
 7076|      0|        ctxt->myDoc = xmlNewDoc(BAD_CAST "1.0");
  ------------------
  |  |   34|      0|#define BAD_CAST (xmlChar *)
  ------------------
 7077|      0|	if (ctxt->myDoc == NULL) {
  ------------------
  |  Branch (7077:6): [True: 0, False: 0]
  ------------------
 7078|      0|	    xmlErrMemory(ctxt);
 7079|      0|	    return;
 7080|      0|	}
 7081|      0|	ctxt->myDoc->properties = XML_DOC_INTERNAL;
 7082|      0|    }
 7083|  2.11k|    if ((ctxt->myDoc->intSubset == NULL) &&
  ------------------
  |  Branch (7083:9): [True: 0, False: 2.11k]
  ------------------
 7084|      0|        (xmlCreateIntSubset(ctxt->myDoc, NULL, publicId, systemId) == NULL)) {
  ------------------
  |  Branch (7084:9): [True: 0, False: 0]
  ------------------
 7085|      0|        xmlErrMemory(ctxt);
 7086|      0|    }
 7087|       |
 7088|  2.11k|    ctxt->inSubset = 2;
 7089|  2.11k|    oldInputNr = ctxt->inputNr;
 7090|       |
 7091|  2.11k|    SKIP_BLANKS;
  ------------------
  |  | 2312|  2.11k|#define SKIP_BLANKS xmlSkipBlankChars(ctxt)
  ------------------
 7092|   150k|    while (!PARSER_STOPPED(ctxt)) {
  ------------------
  |  |   44|   150k|#define PARSER_STOPPED(ctxt) ((ctxt)->disableSAX > 1)
  ------------------
  |  Branch (7092:12): [True: 150k, False: 148]
  ------------------
 7093|   150k|        if (ctxt->input->cur >= ctxt->input->end) {
  ------------------
  |  Branch (7093:13): [True: 1.79k, False: 148k]
  ------------------
 7094|  1.79k|            if (ctxt->inputNr <= oldInputNr) {
  ------------------
  |  Branch (7094:17): [True: 736, False: 1.06k]
  ------------------
 7095|    736|                xmlParserCheckEOF(ctxt, XML_ERR_EXT_SUBSET_NOT_FINISHED);
 7096|    736|                break;
 7097|    736|            }
 7098|       |
 7099|  1.06k|            xmlPopPE(ctxt);
 7100|   148k|        } else if ((RAW == '<') && (NXT(1) == '!') && (NXT(2) == '[')) {
  ------------------
  |  | 2261|   148k|#define RAW (*ctxt->input->cur)
  ------------------
                      } else if ((RAW == '<') && (NXT(1) == '!') && (NXT(2) == '[')) {
  ------------------
  |  | 2263|   144k|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
                      } else if ((RAW == '<') && (NXT(1) == '!') && (NXT(2) == '[')) {
  ------------------
  |  | 2263|   134k|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
  |  Branch (7100:20): [True: 144k, False: 4.52k]
  |  Branch (7100:36): [True: 134k, False: 9.50k]
  |  Branch (7100:55): [True: 1.44k, False: 133k]
  ------------------
 7101|  1.44k|            xmlParseConditionalSections(ctxt);
 7102|   147k|        } else if ((RAW == '<') && ((NXT(1) == '!') || (NXT(1) == '?'))) {
  ------------------
  |  | 2261|   147k|#define RAW (*ctxt->input->cur)
  ------------------
                      } else if ((RAW == '<') && ((NXT(1) == '!') || (NXT(1) == '?'))) {
  ------------------
  |  | 2263|   142k|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
                      } else if ((RAW == '<') && ((NXT(1) == '!') || (NXT(1) == '?'))) {
  ------------------
  |  | 2263|  9.50k|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
  |  Branch (7102:20): [True: 142k, False: 4.52k]
  |  Branch (7102:37): [True: 133k, False: 9.50k]
  |  Branch (7102:56): [True: 9.41k, False: 96]
  ------------------
 7103|   142k|            xmlParseMarkupDecl(ctxt);
 7104|   142k|        } else if (RAW == '%') {
  ------------------
  |  | 2261|  4.62k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (7104:20): [True: 3.39k, False: 1.22k]
  ------------------
 7105|  3.39k|            xmlParsePERefInternal(ctxt, 1);
 7106|  3.39k|        } else {
 7107|  1.22k|            xmlFatalErr(ctxt, XML_ERR_EXT_SUBSET_NOT_FINISHED, NULL);
 7108|       |
 7109|  1.41k|            while (ctxt->inputNr > oldInputNr)
  ------------------
  |  Branch (7109:20): [True: 190, False: 1.22k]
  ------------------
 7110|    190|                xmlPopPE(ctxt);
 7111|  1.22k|            break;
 7112|  1.22k|        }
 7113|   148k|        SKIP_BLANKS;
  ------------------
  |  | 2312|   148k|#define SKIP_BLANKS xmlSkipBlankChars(ctxt)
  ------------------
 7114|   148k|        SHRINK;
  ------------------
  |  | 2304|   148k|    if (!PARSER_PROGRESSIVE(ctxt)) \
  |  |  ------------------
  |  |  |  |   47|   148k|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|   148k|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2304:9): [True: 148k, False: 0]
  |  |  ------------------
  |  | 2305|   148k|	xmlParserShrink(ctxt);
  ------------------
 7115|   148k|        GROW;
  ------------------
  |  | 2308|   148k|    if ((!PARSER_PROGRESSIVE(ctxt)) && \
  |  |  ------------------
  |  |  |  |   47|   148k|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|   148k|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2308:9): [True: 148k, False: 0]
  |  |  ------------------
  |  | 2309|   148k|        (ctxt->input->end - ctxt->input->cur < INPUT_CHUNK)) \
  |  |  ------------------
  |  |  |  |   63|   148k|#define INPUT_CHUNK	250
  |  |  ------------------
  |  |  |  Branch (2309:9): [True: 11.9k, False: 136k]
  |  |  ------------------
  |  | 2310|   148k|	xmlParserGrow(ctxt);
  ------------------
 7116|   148k|    }
 7117|  2.11k|}
xmlParseReference:
 7133|   122k|xmlParseReference(xmlParserCtxt *ctxt) {
 7134|   122k|    xmlEntityPtr ent = NULL;
 7135|   122k|    const xmlChar *name;
 7136|   122k|    xmlChar *val;
 7137|       |
 7138|   122k|    if (RAW != '&')
  ------------------
  |  | 2261|   122k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (7138:9): [True: 0, False: 122k]
  ------------------
 7139|      0|        return;
 7140|       |
 7141|       |    /*
 7142|       |     * Simple case of a CharRef
 7143|       |     */
 7144|   122k|    if (NXT(1) == '#') {
  ------------------
  |  | 2263|   122k|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
  |  Branch (7144:9): [True: 15.2k, False: 107k]
  ------------------
 7145|  15.2k|	int i = 0;
 7146|  15.2k|	xmlChar out[16];
 7147|  15.2k|	int value = xmlParseCharRef(ctxt);
 7148|       |
 7149|  15.2k|	if (value == 0)
  ------------------
  |  Branch (7149:6): [True: 4.94k, False: 10.2k]
  ------------------
 7150|  4.94k|	    return;
 7151|       |
 7152|       |        /*
 7153|       |         * Just encode the value in UTF-8
 7154|       |         */
 7155|  10.2k|        COPY_BUF(out, i, value);
  ------------------
  |  | 2333|  10.2k|    if (v < 0x80) b[i++] = v;						\
  |  |  ------------------
  |  |  |  Branch (2333:9): [True: 9.62k, False: 640]
  |  |  ------------------
  |  | 2334|  10.2k|    else i += xmlCopyCharMultiByte(&b[i],v)
  ------------------
 7156|  10.2k|        out[i] = 0;
 7157|  10.2k|        if ((ctxt->sax != NULL) && (ctxt->sax->characters != NULL) &&
  ------------------
  |  Branch (7157:13): [True: 10.2k, False: 0]
  |  Branch (7157:36): [True: 10.2k, False: 0]
  ------------------
 7158|  10.2k|            (!ctxt->disableSAX))
  ------------------
  |  Branch (7158:13): [True: 6.84k, False: 3.41k]
  ------------------
 7159|  6.84k|            ctxt->sax->characters(ctxt->userData, out, i);
 7160|  10.2k|	return;
 7161|  15.2k|    }
 7162|       |
 7163|       |    /*
 7164|       |     * We are seeing an entity reference
 7165|       |     */
 7166|   107k|    name = xmlParseEntityRefInternal(ctxt);
 7167|   107k|    if (name == NULL)
  ------------------
  |  Branch (7167:9): [True: 21.3k, False: 86.2k]
  ------------------
 7168|  21.3k|        return;
 7169|  86.2k|    ent = xmlLookupGeneralEntity(ctxt, name, /* isAttr */ 0);
 7170|  86.2k|    if (ent == NULL) {
  ------------------
  |  Branch (7170:9): [True: 55.4k, False: 30.8k]
  ------------------
 7171|       |        /*
 7172|       |         * Create a reference for undeclared entities.
 7173|       |         */
 7174|  55.4k|        if ((ctxt->replaceEntities == 0) &&
  ------------------
  |  Branch (7174:13): [True: 48.5k, False: 6.87k]
  ------------------
 7175|  48.5k|            (ctxt->sax != NULL) &&
  ------------------
  |  Branch (7175:13): [True: 48.5k, False: 0]
  ------------------
 7176|  48.5k|            (ctxt->disableSAX == 0) &&
  ------------------
  |  Branch (7176:13): [True: 38.4k, False: 10.1k]
  ------------------
 7177|  38.4k|            (ctxt->sax->reference != NULL)) {
  ------------------
  |  Branch (7177:13): [True: 38.4k, False: 0]
  ------------------
 7178|  38.4k|            ctxt->sax->reference(ctxt->userData, name);
 7179|  38.4k|        }
 7180|  55.4k|        return;
 7181|  55.4k|    }
 7182|  30.8k|    if (!ctxt->wellFormed)
  ------------------
  |  Branch (7182:9): [True: 7.63k, False: 23.1k]
  ------------------
 7183|  7.63k|	return;
 7184|       |
 7185|       |    /* special case of predefined entities */
 7186|  23.1k|    if ((ent->name == NULL) ||
  ------------------
  |  Branch (7186:9): [True: 0, False: 23.1k]
  ------------------
 7187|  23.1k|        (ent->etype == XML_INTERNAL_PREDEFINED_ENTITY)) {
  ------------------
  |  Branch (7187:9): [True: 1.37k, False: 21.8k]
  ------------------
 7188|  1.37k|	val = ent->content;
 7189|  1.37k|	if (val == NULL) return;
  ------------------
  |  Branch (7189:6): [True: 0, False: 1.37k]
  ------------------
 7190|       |	/*
 7191|       |	 * inline the entity.
 7192|       |	 */
 7193|  1.37k|	if ((ctxt->sax != NULL) && (ctxt->sax->characters != NULL) &&
  ------------------
  |  Branch (7193:6): [True: 1.37k, False: 0]
  |  Branch (7193:29): [True: 1.37k, False: 0]
  ------------------
 7194|  1.37k|	    (!ctxt->disableSAX))
  ------------------
  |  Branch (7194:6): [True: 1.37k, False: 0]
  ------------------
 7195|  1.37k|	    ctxt->sax->characters(ctxt->userData, val, xmlStrlen(val));
 7196|  1.37k|	return;
 7197|  1.37k|    }
 7198|       |
 7199|       |    /*
 7200|       |     * Some users try to parse entities on their own and used to set
 7201|       |     * the renamed "checked" member. Fix the flags to cover this
 7202|       |     * case.
 7203|       |     */
 7204|  21.8k|    if (((ent->flags & XML_ENT_PARSED) == 0) && (ent->children != NULL))
  ------------------
  |  |   19|  21.8k|#define XML_ENT_PARSED      (1u << 0)
  ------------------
  |  Branch (7204:9): [True: 5.29k, False: 16.5k]
  |  Branch (7204:49): [True: 0, False: 5.29k]
  ------------------
 7205|      0|        ent->flags |= XML_ENT_PARSED;
  ------------------
  |  |   19|      0|#define XML_ENT_PARSED      (1u << 0)
  ------------------
 7206|       |
 7207|       |    /*
 7208|       |     * The first reference to the entity trigger a parsing phase
 7209|       |     * where the ent->children is filled with the result from
 7210|       |     * the parsing.
 7211|       |     * Note: external parsed entities will not be loaded, it is not
 7212|       |     * required for a non-validating parser, unless the parsing option
 7213|       |     * of validating, or substituting entities were given. Doing so is
 7214|       |     * far more secure as the parser will only process data coming from
 7215|       |     * the document entity by default.
 7216|       |     *
 7217|       |     * FIXME: This doesn't work correctly since entities can be
 7218|       |     * expanded with different namespace declarations in scope.
 7219|       |     * For example:
 7220|       |     *
 7221|       |     * <!DOCTYPE doc [
 7222|       |     *   <!ENTITY ent "<ns:elem/>">
 7223|       |     * ]>
 7224|       |     * <doc>
 7225|       |     *   <decl1 xmlns:ns="urn:ns1">
 7226|       |     *     &ent;
 7227|       |     *   </decl1>
 7228|       |     *   <decl2 xmlns:ns="urn:ns2">
 7229|       |     *     &ent;
 7230|       |     *   </decl2>
 7231|       |     * </doc>
 7232|       |     *
 7233|       |     * Proposed fix:
 7234|       |     *
 7235|       |     * - Ignore current namespace declarations when parsing the
 7236|       |     *   entity. If a prefix can't be resolved, don't report an error
 7237|       |     *   but mark it as unresolved.
 7238|       |     * - Try to resolve these prefixes when expanding the entity.
 7239|       |     *   This will require a specialized version of xmlStaticCopyNode
 7240|       |     *   which can also make use of the namespace hash table to avoid
 7241|       |     *   quadratic behavior.
 7242|       |     *
 7243|       |     * Alternatively, we could simply reparse the entity on each
 7244|       |     * expansion like we already do with custom SAX callbacks.
 7245|       |     * External entity content should be cached in this case.
 7246|       |     */
 7247|  21.8k|    if ((ent->etype == XML_INTERNAL_GENERAL_ENTITY) ||
  ------------------
  |  Branch (7247:9): [True: 9.49k, False: 12.3k]
  ------------------
 7248|  12.3k|        (((ctxt->options & XML_PARSE_NO_XXE) == 0) &&
  ------------------
  |  Branch (7248:10): [True: 11.5k, False: 747]
  ------------------
 7249|  11.5k|         ((ctxt->replaceEntities) ||
  ------------------
  |  Branch (7249:11): [True: 8.88k, False: 2.68k]
  ------------------
 7250|  20.7k|          (ctxt->validate)))) {
  ------------------
  |  Branch (7250:11): [True: 2.35k, False: 334]
  ------------------
 7251|  20.7k|        if ((ent->flags & XML_ENT_PARSED) == 0) {
  ------------------
  |  |   19|  20.7k|#define XML_ENT_PARSED      (1u << 0)
  ------------------
  |  Branch (7251:13): [True: 4.21k, False: 16.5k]
  ------------------
 7252|  4.21k|            xmlCtxtParseEntity(ctxt, ent);
 7253|  16.5k|        } else if (ent->children == NULL) {
  ------------------
  |  Branch (7253:20): [True: 4.74k, False: 11.7k]
  ------------------
 7254|       |            /*
 7255|       |             * Probably running in SAX mode and the callbacks don't
 7256|       |             * build the entity content. Parse the entity again.
 7257|       |             *
 7258|       |             * This will also be triggered in normal tree builder mode
 7259|       |             * if an entity happens to be empty, causing unnecessary
 7260|       |             * reloads. It's hard to come up with a reliable check in
 7261|       |             * which mode we're running.
 7262|       |             */
 7263|  4.74k|            xmlCtxtParseEntity(ctxt, ent);
 7264|  4.74k|        }
 7265|  20.7k|    }
 7266|       |
 7267|       |    /*
 7268|       |     * We also check for amplification if entities aren't substituted.
 7269|       |     * They might be expanded later.
 7270|       |     */
 7271|  21.8k|    if (xmlParserEntityCheck(ctxt, ent->expandedSize))
  ------------------
  |  Branch (7271:9): [True: 49, False: 21.7k]
  ------------------
 7272|     49|        return;
 7273|       |
 7274|  21.7k|    if ((ctxt->sax == NULL) || (ctxt->disableSAX))
  ------------------
  |  Branch (7274:9): [True: 0, False: 21.7k]
  |  Branch (7274:32): [True: 948, False: 20.8k]
  ------------------
 7275|    948|        return;
 7276|       |
 7277|  20.8k|    if (ctxt->replaceEntities == 0) {
  ------------------
  |  Branch (7277:9): [True: 6.59k, False: 14.2k]
  ------------------
 7278|       |	/*
 7279|       |	 * Create a reference
 7280|       |	 */
 7281|  6.59k|        if (ctxt->sax->reference != NULL)
  ------------------
  |  Branch (7281:13): [True: 6.59k, False: 0]
  ------------------
 7282|  6.59k|	    ctxt->sax->reference(ctxt->userData, ent->name);
 7283|  14.2k|    } else if ((ent->children != NULL) && (ctxt->node != NULL)) {
  ------------------
  |  Branch (7283:16): [True: 9.68k, False: 4.53k]
  |  Branch (7283:43): [True: 9.68k, False: 0]
  ------------------
 7284|  9.68k|        xmlNodePtr copy, cur;
 7285|       |
 7286|       |        /*
 7287|       |         * Seems we are generating the DOM content, copy the tree
 7288|       |	 */
 7289|  9.68k|        cur = ent->children;
 7290|       |
 7291|       |        /*
 7292|       |         * Handle first text node with SAX to coalesce text efficiently
 7293|       |         */
 7294|  9.68k|        if ((cur->type == XML_TEXT_NODE) ||
  ------------------
  |  Branch (7294:13): [True: 8.25k, False: 1.42k]
  ------------------
 7295|  8.42k|            (cur->type == XML_CDATA_SECTION_NODE)) {
  ------------------
  |  Branch (7295:13): [True: 170, False: 1.25k]
  ------------------
 7296|  8.42k|            int len = xmlStrlen(cur->content);
 7297|       |
 7298|  8.42k|            if ((cur->type == XML_TEXT_NODE) ||
  ------------------
  |  Branch (7298:17): [True: 8.25k, False: 170]
  ------------------
 7299|  8.25k|                (ctxt->options & XML_PARSE_NOCDATA)) {
  ------------------
  |  Branch (7299:17): [True: 0, False: 170]
  ------------------
 7300|  8.25k|                if (ctxt->sax->characters != NULL)
  ------------------
  |  Branch (7300:21): [True: 8.25k, False: 0]
  ------------------
 7301|  8.25k|                    ctxt->sax->characters(ctxt->userData, cur->content, len);
 7302|  8.25k|            } else {
 7303|    170|                if (ctxt->sax->cdataBlock != NULL)
  ------------------
  |  Branch (7303:21): [True: 170, False: 0]
  ------------------
 7304|    170|                    ctxt->sax->cdataBlock(ctxt->userData, cur->content, len);
 7305|    170|            }
 7306|       |
 7307|  8.42k|            cur = cur->next;
 7308|  8.42k|        }
 7309|       |
 7310|   143k|        while (cur != NULL) {
  ------------------
  |  Branch (7310:16): [True: 136k, False: 6.89k]
  ------------------
 7311|   136k|            xmlNodePtr last;
 7312|       |
 7313|       |            /*
 7314|       |             * Handle last text node with SAX to coalesce text efficiently
 7315|       |             */
 7316|   136k|            if ((cur->next == NULL) &&
  ------------------
  |  Branch (7316:17): [True: 4.89k, False: 131k]
  ------------------
 7317|  4.89k|                ((cur->type == XML_TEXT_NODE) ||
  ------------------
  |  Branch (7317:18): [True: 1.92k, False: 2.97k]
  ------------------
 7318|  2.97k|                 (cur->type == XML_CDATA_SECTION_NODE))) {
  ------------------
  |  Branch (7318:18): [True: 821, False: 2.14k]
  ------------------
 7319|  2.74k|                int len = xmlStrlen(cur->content);
 7320|       |
 7321|  2.74k|                if ((cur->type == XML_TEXT_NODE) ||
  ------------------
  |  Branch (7321:21): [True: 1.92k, False: 821]
  ------------------
 7322|  1.92k|                    (ctxt->options & XML_PARSE_NOCDATA)) {
  ------------------
  |  Branch (7322:21): [True: 0, False: 821]
  ------------------
 7323|  1.92k|                    if (ctxt->sax->characters != NULL)
  ------------------
  |  Branch (7323:25): [True: 1.92k, False: 0]
  ------------------
 7324|  1.92k|                        ctxt->sax->characters(ctxt->userData, cur->content,
 7325|  1.92k|                                              len);
 7326|  1.92k|                } else {
 7327|    821|                    if (ctxt->sax->cdataBlock != NULL)
  ------------------
  |  Branch (7327:25): [True: 821, False: 0]
  ------------------
 7328|    821|                        ctxt->sax->cdataBlock(ctxt->userData, cur->content,
 7329|    821|                                              len);
 7330|    821|                }
 7331|       |
 7332|  2.74k|                break;
 7333|  2.74k|            }
 7334|       |
 7335|       |            /*
 7336|       |             * Reset coalesce buffer stats only for non-text nodes.
 7337|       |             */
 7338|   133k|            ctxt->nodemem = 0;
 7339|   133k|            ctxt->nodelen = 0;
 7340|       |
 7341|   133k|            copy = xmlDocCopyNode(cur, ctxt->myDoc, 1);
 7342|       |
 7343|   133k|            if (copy == NULL) {
  ------------------
  |  Branch (7343:17): [True: 46, False: 133k]
  ------------------
 7344|     46|                xmlErrMemory(ctxt);
 7345|     46|                break;
 7346|     46|            }
 7347|       |
 7348|   133k|            if (ctxt->parseMode == XML_PARSE_READER) {
  ------------------
  |  Branch (7348:17): [True: 132k, False: 1.14k]
  ------------------
 7349|       |                /* Needed for reader */
 7350|   132k|                copy->extra = cur->extra;
 7351|       |                /* Maybe needed for reader */
 7352|   132k|                copy->_private = cur->_private;
 7353|   132k|            }
 7354|       |
 7355|   133k|            copy->parent = ctxt->node;
 7356|   133k|            last = ctxt->node->last;
 7357|   133k|            if (last == NULL) {
  ------------------
  |  Branch (7357:17): [True: 314, False: 133k]
  ------------------
 7358|    314|                ctxt->node->children = copy;
 7359|   133k|            } else {
 7360|   133k|                last->next = copy;
 7361|   133k|                copy->prev = last;
 7362|   133k|            }
 7363|   133k|            ctxt->node->last = copy;
 7364|       |
 7365|   133k|            cur = cur->next;
 7366|   133k|        }
 7367|  9.68k|    }
 7368|  20.8k|}
xmlParseDocTypeDecl:
 7971|  21.8k|xmlParseDocTypeDecl(xmlParserCtxt *ctxt) {
 7972|  21.8k|    const xmlChar *name = NULL;
 7973|  21.8k|    xmlChar *publicId = NULL;
 7974|  21.8k|    xmlChar *URI = NULL;
 7975|       |
 7976|       |    /*
 7977|       |     * We know that '<!DOCTYPE' has been detected.
 7978|       |     */
 7979|  21.8k|    SKIP(9);
  ------------------
  |  | 2285|  21.8k|#define SKIP(val) do {							\
  |  | 2286|  21.8k|    ctxt->input->cur += (val),ctxt->input->col+=(val);			\
  |  | 2287|  21.8k|    if (*ctxt->input->cur == 0)						\
  |  |  ------------------
  |  |  |  Branch (2287:9): [True: 8, False: 21.8k]
  |  |  ------------------
  |  | 2288|  21.8k|        xmlParserGrow(ctxt);						\
  |  | 2289|  21.8k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2289:12): [Folded, False: 21.8k]
  |  |  ------------------
  ------------------
 7980|       |
 7981|  21.8k|    if (SKIP_BLANKS == 0) {
  ------------------
  |  | 2312|  21.8k|#define SKIP_BLANKS xmlSkipBlankChars(ctxt)
  ------------------
  |  Branch (7981:9): [True: 1.65k, False: 20.2k]
  ------------------
 7982|  1.65k|        xmlFatalErrMsg(ctxt, XML_ERR_SPACE_REQUIRED,
 7983|  1.65k|                       "Space required after 'DOCTYPE'\n");
 7984|  1.65k|    }
 7985|       |
 7986|       |    /*
 7987|       |     * Parse the DOCTYPE name.
 7988|       |     */
 7989|  21.8k|    name = xmlParseName(ctxt);
 7990|  21.8k|    if (name == NULL) {
  ------------------
  |  Branch (7990:9): [True: 1.34k, False: 20.5k]
  ------------------
 7991|  1.34k|	xmlFatalErrMsg(ctxt, XML_ERR_NAME_REQUIRED,
 7992|  1.34k|		       "xmlParseDocTypeDecl : no DOCTYPE name !\n");
 7993|  1.34k|    }
 7994|  21.8k|    ctxt->intSubName = name;
 7995|       |
 7996|  21.8k|    SKIP_BLANKS;
  ------------------
  |  | 2312|  21.8k|#define SKIP_BLANKS xmlSkipBlankChars(ctxt)
  ------------------
 7997|       |
 7998|       |    /*
 7999|       |     * Check for public and system identifier (URI)
 8000|       |     */
 8001|  21.8k|    URI = xmlParseExternalID(ctxt, &publicId, 1);
 8002|       |
 8003|  21.8k|    if ((URI != NULL) || (publicId != NULL)) {
  ------------------
  |  Branch (8003:9): [True: 3.90k, False: 17.9k]
  |  Branch (8003:26): [True: 20, False: 17.9k]
  ------------------
 8004|  3.92k|        ctxt->hasExternalSubset = 1;
 8005|  3.92k|    }
 8006|  21.8k|    ctxt->extSubURI = URI;
 8007|  21.8k|    ctxt->extSubSystem = publicId;
 8008|       |
 8009|  21.8k|    SKIP_BLANKS;
  ------------------
  |  | 2312|  21.8k|#define SKIP_BLANKS xmlSkipBlankChars(ctxt)
  ------------------
 8010|       |
 8011|       |    /*
 8012|       |     * Create and update the internal subset.
 8013|       |     */
 8014|  21.8k|    if ((ctxt->sax != NULL) && (ctxt->sax->internalSubset != NULL) &&
  ------------------
  |  Branch (8014:9): [True: 21.8k, False: 0]
  |  Branch (8014:32): [True: 21.8k, False: 0]
  ------------------
 8015|  21.8k|	(!ctxt->disableSAX))
  ------------------
  |  Branch (8015:2): [True: 21.6k, False: 179]
  ------------------
 8016|  21.6k|	ctxt->sax->internalSubset(ctxt->userData, name, publicId, URI);
 8017|       |
 8018|  21.8k|    if ((RAW != '[') && (RAW != '>')) {
  ------------------
  |  | 2261|  21.8k|#define RAW (*ctxt->input->cur)
  ------------------
                  if ((RAW != '[') && (RAW != '>')) {
  ------------------
  |  | 2261|  5.49k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (8018:9): [True: 5.49k, False: 16.3k]
  |  Branch (8018:25): [True: 281, False: 5.21k]
  ------------------
 8019|       |	xmlFatalErr(ctxt, XML_ERR_DOCTYPE_NOT_FINISHED, NULL);
 8020|    281|    }
 8021|  21.8k|}
xmlParseAttribute:
 8127|   142k|xmlParseAttribute(xmlParserCtxt *ctxt, xmlChar **value) {
 8128|   142k|    const xmlChar *name;
 8129|   142k|    xmlChar *val;
 8130|       |
 8131|   142k|    *value = NULL;
 8132|   142k|    GROW;
  ------------------
  |  | 2308|   142k|    if ((!PARSER_PROGRESSIVE(ctxt)) && \
  |  |  ------------------
  |  |  |  |   47|   142k|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|   142k|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2308:9): [True: 71.5k, False: 71.4k]
  |  |  ------------------
  |  | 2309|   142k|        (ctxt->input->end - ctxt->input->cur < INPUT_CHUNK)) \
  |  |  ------------------
  |  |  |  |   63|  71.5k|#define INPUT_CHUNK	250
  |  |  ------------------
  |  |  |  Branch (2309:9): [True: 12.7k, False: 58.7k]
  |  |  ------------------
  |  | 2310|   142k|	xmlParserGrow(ctxt);
  ------------------
 8133|   142k|    name = xmlParseName(ctxt);
 8134|   142k|    if (name == NULL) {
  ------------------
  |  Branch (8134:9): [True: 32.9k, False: 109k]
  ------------------
 8135|  32.9k|	xmlFatalErrMsg(ctxt, XML_ERR_NAME_REQUIRED,
 8136|  32.9k|	               "error parsing attribute name\n");
 8137|  32.9k|        return(NULL);
 8138|  32.9k|    }
 8139|       |
 8140|       |    /*
 8141|       |     * read the value
 8142|       |     */
 8143|   109k|    SKIP_BLANKS;
  ------------------
  |  | 2312|   109k|#define SKIP_BLANKS xmlSkipBlankChars(ctxt)
  ------------------
 8144|   109k|    if (RAW == '=') {
  ------------------
  |  | 2261|   109k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (8144:9): [True: 98.9k, False: 11.0k]
  ------------------
 8145|  98.9k|        NEXT;
  ------------------
  |  | 2316|  98.9k|#define NEXT xmlNextChar(ctxt)
  ------------------
 8146|  98.9k|	SKIP_BLANKS;
  ------------------
  |  | 2312|  98.9k|#define SKIP_BLANKS xmlSkipBlankChars(ctxt)
  ------------------
 8147|  98.9k|	val = xmlParseAttValue(ctxt);
 8148|  98.9k|    } else {
 8149|  11.0k|	xmlFatalErrMsgStr(ctxt, XML_ERR_ATTRIBUTE_WITHOUT_VALUE,
 8150|  11.0k|	       "Specification mandates value for attribute %s\n", name);
 8151|  11.0k|	return(name);
 8152|  11.0k|    }
 8153|       |
 8154|       |    /*
 8155|       |     * Check that xml:lang conforms to the specification
 8156|       |     * No more registered as an error, just generate a warning now
 8157|       |     * since this was deprecated in XML second edition
 8158|       |     */
 8159|  98.9k|    if ((ctxt->pedantic) && (xmlStrEqual(name, BAD_CAST "xml:lang"))) {
  ------------------
  |  |   34|  49.4k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (8159:9): [True: 49.4k, False: 49.5k]
  |  Branch (8159:29): [True: 8.96k, False: 40.4k]
  ------------------
 8160|  8.96k|	if (!xmlCheckLanguageID(val)) {
  ------------------
  |  Branch (8160:6): [True: 5.87k, False: 3.08k]
  ------------------
 8161|  5.87k|	    xmlWarningMsg(ctxt, XML_WAR_LANG_VALUE,
 8162|  5.87k|		          "Malformed value for xml:lang : %s\n",
 8163|  5.87k|			  val, NULL);
 8164|  5.87k|	}
 8165|  8.96k|    }
 8166|       |
 8167|       |    /*
 8168|       |     * Check that xml:space conforms to the specification
 8169|       |     */
 8170|  98.9k|    if (xmlStrEqual(name, BAD_CAST "xml:space")) {
  ------------------
  |  |   34|  98.9k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (8170:9): [True: 615, False: 98.3k]
  ------------------
 8171|    615|	if (xmlStrEqual(val, BAD_CAST "default"))
  ------------------
  |  |   34|    615|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (8171:6): [True: 200, False: 415]
  ------------------
 8172|    200|	    *(ctxt->space) = 0;
 8173|    415|	else if (xmlStrEqual(val, BAD_CAST "preserve"))
  ------------------
  |  |   34|    415|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (8173:11): [True: 196, False: 219]
  ------------------
 8174|    196|	    *(ctxt->space) = 1;
 8175|    219|	else {
 8176|    219|		xmlWarningMsg(ctxt, XML_WAR_SPACE_VALUE,
 8177|    219|"Invalid value \"%s\" for xml:space : \"default\" or \"preserve\" expected\n",
 8178|    219|                                 val, NULL);
 8179|    219|	}
 8180|    615|    }
 8181|       |
 8182|  98.9k|    *value = val;
 8183|  98.9k|    return(name);
 8184|   109k|}
xmlParseStartTag:
 8214|   340k|xmlParseStartTag(xmlParserCtxt *ctxt) {
 8215|   340k|    const xmlChar *name;
 8216|   340k|    const xmlChar *attname;
 8217|   340k|    xmlChar *attvalue;
 8218|   340k|    const xmlChar **atts = ctxt->atts;
 8219|   340k|    int nbatts = 0;
 8220|   340k|    int maxatts = ctxt->maxatts;
 8221|   340k|    int i;
 8222|       |
 8223|   340k|    if (RAW != '<') return(NULL);
  ------------------
  |  | 2261|   340k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (8223:9): [True: 0, False: 340k]
  ------------------
 8224|   340k|    NEXT1;
  ------------------
  |  | 2318|   340k|#define NEXT1 {								\
  |  | 2319|   340k|	ctxt->input->col++;						\
  |  | 2320|   340k|	ctxt->input->cur++;						\
  |  | 2321|   340k|	if (*ctxt->input->cur == 0)					\
  |  |  ------------------
  |  |  |  Branch (2321:6): [True: 817, False: 339k]
  |  |  ------------------
  |  | 2322|   340k|	    xmlParserGrow(ctxt);						\
  |  | 2323|   340k|    }
  ------------------
 8225|       |
 8226|   340k|    name = xmlParseName(ctxt);
 8227|   340k|    if (name == NULL) {
  ------------------
  |  Branch (8227:9): [True: 14.4k, False: 326k]
  ------------------
 8228|  14.4k|	xmlFatalErrMsg(ctxt, XML_ERR_NAME_REQUIRED,
 8229|  14.4k|	     "xmlParseStartTag: invalid element name\n");
 8230|  14.4k|        return(NULL);
 8231|  14.4k|    }
 8232|       |
 8233|       |    /*
 8234|       |     * Now parse the attributes, it ends up with the ending
 8235|       |     *
 8236|       |     * (S Attribute)* S?
 8237|       |     */
 8238|   326k|    SKIP_BLANKS;
  ------------------
  |  | 2312|   326k|#define SKIP_BLANKS xmlSkipBlankChars(ctxt)
  ------------------
 8239|   326k|    GROW;
  ------------------
  |  | 2308|   326k|    if ((!PARSER_PROGRESSIVE(ctxt)) && \
  |  |  ------------------
  |  |  |  |   47|   326k|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|   326k|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2308:9): [True: 198k, False: 127k]
  |  |  ------------------
  |  | 2309|   326k|        (ctxt->input->end - ctxt->input->cur < INPUT_CHUNK)) \
  |  |  ------------------
  |  |  |  |   63|   198k|#define INPUT_CHUNK	250
  |  |  ------------------
  |  |  |  Branch (2309:9): [True: 28.3k, False: 170k]
  |  |  ------------------
  |  | 2310|   326k|	xmlParserGrow(ctxt);
  ------------------
 8240|       |
 8241|   376k|    while (((RAW != '>') &&
  ------------------
  |  | 2261|   376k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (8241:13): [True: 235k, False: 140k]
  ------------------
 8242|   235k|	   ((RAW != '/') || (NXT(1) != '>')) &&
  ------------------
  |  | 2261|   235k|#define RAW (*ctxt->input->cur)
  ------------------
              	   ((RAW != '/') || (NXT(1) != '>')) &&
  ------------------
  |  | 2263|  88.1k|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
  |  Branch (8242:6): [True: 146k, False: 88.1k]
  |  Branch (8242:22): [True: 3.61k, False: 84.5k]
  ------------------
 8243|   150k|	   (IS_BYTE_CHAR(RAW))) && (PARSER_STOPPED(ctxt) == 0)) {
  ------------------
  |  |  103|   150k|#define IS_BYTE_CHAR(c)	 xmlIsChar_ch(c)
  |  |  ------------------
  |  |  |  |  108|   150k|#define xmlIsChar_ch(c)		(((0x9 <= (c)) && ((c) <= 0xa)) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (108:28): [True: 143k, False: 6.64k]
  |  |  |  |  |  Branch (108:44): [True: 0, False: 143k]
  |  |  |  |  ------------------
  |  |  |  |  109|   150k|				 ((c) == 0xd) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (109:6): [True: 0, False: 150k]
  |  |  |  |  ------------------
  |  |  |  |  110|   150k|				  (0x20 <= (c)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (110:7): [True: 143k, False: 7.42k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
              	   (IS_BYTE_CHAR(RAW))) && (PARSER_STOPPED(ctxt) == 0)) {
  ------------------
  |  |   44|   143k|#define PARSER_STOPPED(ctxt) ((ctxt)->disableSAX > 1)
  ------------------
  |  Branch (8243:29): [True: 142k, False: 169]
  ------------------
 8244|   142k|	attname = xmlParseAttribute(ctxt, &attvalue);
 8245|   142k|        if (attname == NULL)
  ------------------
  |  Branch (8245:13): [True: 32.9k, False: 109k]
  ------------------
 8246|  32.9k|	    break;
 8247|   109k|        if (attvalue != NULL) {
  ------------------
  |  Branch (8247:13): [True: 95.9k, False: 14.0k]
  ------------------
 8248|       |	    /*
 8249|       |	     * [ WFC: Unique Att Spec ]
 8250|       |	     * No attribute name may appear more than once in the same
 8251|       |	     * start-tag or empty-element tag.
 8252|       |	     */
 8253|   202k|	    for (i = 0; i < nbatts;i += 2) {
  ------------------
  |  Branch (8253:18): [True: 116k, False: 85.9k]
  ------------------
 8254|   116k|	        if (xmlStrEqual(atts[i], attname)) {
  ------------------
  |  Branch (8254:14): [True: 9.92k, False: 106k]
  ------------------
 8255|  9.92k|		    xmlErrAttributeDup(ctxt, NULL, attname);
 8256|  9.92k|		    goto failed;
 8257|  9.92k|		}
 8258|   116k|	    }
 8259|       |	    /*
 8260|       |	     * Add the pair to atts
 8261|       |	     */
 8262|  85.9k|	    if (nbatts + 4 > maxatts) {
  ------------------
  |  Branch (8262:10): [True: 20.4k, False: 65.5k]
  ------------------
 8263|  20.4k|	        const xmlChar **n;
 8264|  20.4k|                int newSize;
 8265|       |
 8266|  20.4k|                newSize = xmlGrowCapacity(maxatts, sizeof(n[0]) * 2,
 8267|  20.4k|                                          11, XML_MAX_ATTRS);
  ------------------
  |  |   93|  20.4k|#define XML_MAX_ATTRS 100000000 /* 100 million */
  ------------------
 8268|  20.4k|                if (newSize < 0) {
  ------------------
  |  Branch (8268:21): [True: 0, False: 20.4k]
  ------------------
 8269|      0|		    xmlErrMemory(ctxt);
 8270|      0|		    goto failed;
 8271|      0|		}
 8272|  20.4k|#ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
 8273|  20.4k|                if (newSize < 2)
  ------------------
  |  Branch (8273:21): [True: 12.6k, False: 7.82k]
  ------------------
 8274|  12.6k|                    newSize = 2;
 8275|  20.4k|#endif
 8276|  20.4k|	        n = xmlRealloc(atts, newSize * sizeof(n[0]) * 2);
 8277|  20.4k|		if (n == NULL) {
  ------------------
  |  Branch (8277:7): [True: 3, False: 20.4k]
  ------------------
 8278|      3|		    xmlErrMemory(ctxt);
 8279|      3|		    goto failed;
 8280|      3|		}
 8281|  20.4k|		atts = n;
 8282|  20.4k|                maxatts = newSize * 2;
 8283|  20.4k|		ctxt->atts = atts;
 8284|  20.4k|		ctxt->maxatts = maxatts;
 8285|  20.4k|	    }
 8286|       |
 8287|  85.9k|	    atts[nbatts++] = attname;
 8288|  85.9k|	    atts[nbatts++] = attvalue;
 8289|  85.9k|	    atts[nbatts] = NULL;
 8290|  85.9k|	    atts[nbatts + 1] = NULL;
 8291|       |
 8292|  85.9k|            attvalue = NULL;
 8293|  85.9k|	}
 8294|       |
 8295|   109k|failed:
 8296|       |
 8297|   109k|        if (attvalue != NULL)
  ------------------
  |  Branch (8297:13): [True: 9.92k, False: 100k]
  ------------------
 8298|  9.92k|            xmlFree(attvalue);
 8299|       |
 8300|   109k|	GROW
  ------------------
  |  | 2308|   109k|    if ((!PARSER_PROGRESSIVE(ctxt)) && \
  |  |  ------------------
  |  |  |  |   47|   109k|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|   109k|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2308:9): [True: 50.5k, False: 59.4k]
  |  |  ------------------
  |  | 2309|   109k|        (ctxt->input->end - ctxt->input->cur < INPUT_CHUNK)) \
  |  |  ------------------
  |  |  |  |   63|  50.5k|#define INPUT_CHUNK	250
  |  |  ------------------
  |  |  |  Branch (2309:9): [True: 11.1k, False: 39.3k]
  |  |  ------------------
  |  | 2310|   109k|	xmlParserGrow(ctxt);
  ------------------
 8301|   109k|	if ((RAW == '>') || (((RAW == '/') && (NXT(1) == '>'))))
  ------------------
  |  | 2261|   109k|#define RAW (*ctxt->input->cur)
  ------------------
              	if ((RAW == '>') || (((RAW == '/') && (NXT(1) == '>'))))
  ------------------
  |  | 2261|  87.2k|#define RAW (*ctxt->input->cur)
  ------------------
              	if ((RAW == '>') || (((RAW == '/') && (NXT(1) == '>'))))
  ------------------
  |  | 2263|  38.0k|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
  |  Branch (8301:6): [True: 22.6k, False: 87.2k]
  |  Branch (8301:24): [True: 38.0k, False: 49.1k]
  |  Branch (8301:40): [True: 37.5k, False: 576]
  ------------------
 8302|  60.1k|	    break;
 8303|  49.7k|	if (SKIP_BLANKS == 0) {
  ------------------
  |  | 2312|  49.7k|#define SKIP_BLANKS xmlSkipBlankChars(ctxt)
  ------------------
  |  Branch (8303:6): [True: 18.4k, False: 31.3k]
  ------------------
 8304|  18.4k|	    xmlFatalErrMsg(ctxt, XML_ERR_SPACE_REQUIRED,
 8305|  18.4k|			   "attributes construct error\n");
 8306|  18.4k|	}
 8307|  49.7k|	SHRINK;
  ------------------
  |  | 2304|  49.7k|    if (!PARSER_PROGRESSIVE(ctxt)) \
  |  |  ------------------
  |  |  |  |   47|  49.7k|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|  49.7k|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2304:9): [True: 15.6k, False: 34.0k]
  |  |  ------------------
  |  | 2305|  49.7k|	xmlParserShrink(ctxt);
  ------------------
 8308|  49.7k|        GROW;
  ------------------
  |  | 2308|  49.7k|    if ((!PARSER_PROGRESSIVE(ctxt)) && \
  |  |  ------------------
  |  |  |  |   47|  49.7k|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|  49.7k|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2308:9): [True: 15.6k, False: 34.0k]
  |  |  ------------------
  |  | 2309|  49.7k|        (ctxt->input->end - ctxt->input->cur < INPUT_CHUNK)) \
  |  |  ------------------
  |  |  |  |   63|  15.6k|#define INPUT_CHUNK	250
  |  |  ------------------
  |  |  |  Branch (2309:9): [True: 5.96k, False: 9.70k]
  |  |  ------------------
  |  | 2310|  49.7k|	xmlParserGrow(ctxt);
  ------------------
 8309|  49.7k|    }
 8310|       |
 8311|       |    /*
 8312|       |     * SAX: Start of Element !
 8313|       |     */
 8314|   326k|    if ((ctxt->sax != NULL) && (ctxt->sax->startElement != NULL) &&
  ------------------
  |  Branch (8314:9): [True: 326k, False: 0]
  |  Branch (8314:32): [True: 326k, False: 0]
  ------------------
 8315|   326k|	(!ctxt->disableSAX)) {
  ------------------
  |  Branch (8315:2): [True: 296k, False: 29.8k]
  ------------------
 8316|   296k|	if (nbatts > 0)
  ------------------
  |  Branch (8316:6): [True: 64.4k, False: 231k]
  ------------------
 8317|  64.4k|	    ctxt->sax->startElement(ctxt->userData, name, atts);
 8318|   231k|	else
 8319|   231k|	    ctxt->sax->startElement(ctxt->userData, name, NULL);
 8320|   296k|    }
 8321|       |
 8322|   326k|    if (atts != NULL) {
  ------------------
  |  Branch (8322:9): [True: 220k, False: 105k]
  ------------------
 8323|       |        /* Free only the content strings */
 8324|   306k|        for (i = 1;i < nbatts;i+=2)
  ------------------
  |  Branch (8324:20): [True: 85.9k, False: 220k]
  ------------------
 8325|  85.9k|	    if (atts[i] != NULL)
  ------------------
  |  Branch (8325:10): [True: 85.9k, False: 0]
  ------------------
 8326|  85.9k|	       xmlFree((xmlChar *) atts[i]);
 8327|   220k|    }
 8328|   326k|    return(name);
 8329|   326k|}
xmlParseCDSect:
 9480|  94.5k|xmlParseCDSect(xmlParserCtxt *ctxt) {
 9481|  94.5k|    xmlChar *buf = NULL;
 9482|  94.5k|    int len = 0;
 9483|  94.5k|    int size = XML_PARSER_BUFFER_SIZE;
  ------------------
  |  |  172|  94.5k|#define XML_PARSER_BUFFER_SIZE 100
  ------------------
 9484|  94.5k|    int r, rl;
 9485|  94.5k|    int	s, sl;
 9486|  94.5k|    int cur, l;
 9487|  94.5k|    int maxLength = (ctxt->options & XML_PARSE_HUGE) ?
  ------------------
  |  Branch (9487:21): [True: 9.76k, False: 84.7k]
  ------------------
 9488|  9.76k|                    XML_MAX_HUGE_LENGTH :
  ------------------
  |  |   55|  9.76k|#define XML_MAX_HUGE_LENGTH 1000000000
  ------------------
 9489|  94.5k|                    XML_MAX_TEXT_LENGTH;
  ------------------
  |  |   50|  84.7k|#define XML_MAX_TEXT_LENGTH 10000000
  ------------------
 9490|       |
 9491|  94.5k|    if ((CUR != '<') || (NXT(1) != '!') || (NXT(2) != '['))
  ------------------
  |  | 2262|  94.5k|#define CUR (*ctxt->input->cur)
  ------------------
                  if ((CUR != '<') || (NXT(1) != '!') || (NXT(2) != '['))
  ------------------
  |  | 2263|  94.5k|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
                  if ((CUR != '<') || (NXT(1) != '!') || (NXT(2) != '['))
  ------------------
  |  | 2263|  94.5k|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
  |  Branch (9491:9): [True: 0, False: 94.5k]
  |  Branch (9491:25): [True: 0, False: 94.5k]
  |  Branch (9491:44): [True: 0, False: 94.5k]
  ------------------
 9492|      0|        return;
 9493|  94.5k|    SKIP(3);
  ------------------
  |  | 2285|  94.5k|#define SKIP(val) do {							\
  |  | 2286|  94.5k|    ctxt->input->cur += (val),ctxt->input->col+=(val);			\
  |  | 2287|  94.5k|    if (*ctxt->input->cur == 0)						\
  |  |  ------------------
  |  |  |  Branch (2287:9): [True: 0, False: 94.5k]
  |  |  ------------------
  |  | 2288|  94.5k|        xmlParserGrow(ctxt);						\
  |  | 2289|  94.5k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2289:12): [Folded, False: 94.5k]
  |  |  ------------------
  ------------------
 9494|       |
 9495|  94.5k|    if (!CMP6(CUR_PTR, 'C', 'D', 'A', 'T', 'A', '['))
  ------------------
  |  | 2273|  94.5k|  ( CMP5( s, c1, c2, c3, c4, c5 ) && ((unsigned char *) s)[ 5 ] == c6 )
  |  |  ------------------
  |  |  |  | 2271|   189k|  ( CMP4( s, c1, c2, c3, c4 ) && ((unsigned char *) s)[ 4 ] == c5 )
  |  |  |  |  ------------------
  |  |  |  |  |  | 2268|   189k|  ( ((unsigned char *) s)[ 0 ] == c1 && ((unsigned char *) s)[ 1 ] == c2 && \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (2268:5): [True: 94.5k, False: 0]
  |  |  |  |  |  |  |  Branch (2268:41): [True: 94.5k, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 2269|  94.5k|    ((unsigned char *) s)[ 2 ] == c3 && ((unsigned char *) s)[ 3 ] == c4 )
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (2269:5): [True: 94.5k, False: 0]
  |  |  |  |  |  |  |  Branch (2269:41): [True: 94.5k, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2271:34): [True: 94.5k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2273:38): [True: 94.5k, False: 0]
  |  |  ------------------
  ------------------
 9496|      0|        return;
 9497|  94.5k|    SKIP(6);
  ------------------
  |  | 2285|  94.5k|#define SKIP(val) do {							\
  |  | 2286|  94.5k|    ctxt->input->cur += (val),ctxt->input->col+=(val);			\
  |  | 2287|  94.5k|    if (*ctxt->input->cur == 0)						\
  |  |  ------------------
  |  |  |  Branch (2287:9): [True: 595, False: 93.9k]
  |  |  ------------------
  |  | 2288|  94.5k|        xmlParserGrow(ctxt);						\
  |  | 2289|  94.5k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2289:12): [Folded, False: 94.5k]
  |  |  ------------------
  ------------------
 9498|       |
 9499|  94.5k|    r = xmlCurrentCharRecover(ctxt, &rl);
 9500|  94.5k|    if (!IS_CHAR(r)) {
  ------------------
  |  |  115|  94.5k|#define IS_CHAR(c)   xmlIsCharQ(c)
  |  |  ------------------
  |  |  |  |  117|  94.5k|#define xmlIsCharQ(c)		(((c) < 0x100) ? \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (117:25): [True: 92.7k, False: 1.77k]
  |  |  |  |  ------------------
  |  |  |  |  118|  94.5k|				 xmlIsChar_ch((c)) :\
  |  |  |  |  ------------------
  |  |  |  |  |  |  108|  92.7k|#define xmlIsChar_ch(c)		(((0x9 <= (c)) && ((c) <= 0xa)) || \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (108:28): [True: 92.1k, False: 602]
  |  |  |  |  |  |  |  Branch (108:44): [True: 725, False: 91.4k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  109|  92.7k|				 ((c) == 0xd) || \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (109:6): [True: 0, False: 92.0k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  110|  92.7k|				  (0x20 <= (c)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (110:7): [True: 91.4k, False: 621]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  119|  94.5k|				(((0x100 <= (c)) && ((c) <= 0xd7ff)) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (119:7): [True: 1.77k, False: 0]
  |  |  |  |  |  Branch (119:25): [True: 218, False: 1.55k]
  |  |  |  |  ------------------
  |  |  |  |  120|  1.77k|				 ((0xe000 <= (c)) && ((c) <= 0xfffd)) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (120:7): [True: 1.55k, False: 0]
  |  |  |  |  |  Branch (120:26): [True: 1.06k, False: 489]
  |  |  |  |  ------------------
  |  |  |  |  121|  1.77k|				 ((0x10000 <= (c)) && ((c) <= 0x10ffff))))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (121:7): [True: 293, False: 196]
  |  |  |  |  |  Branch (121:27): [True: 293, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (9500:9): [True: 817, False: 93.7k]
  ------------------
 9501|    817|	xmlFatalErr(ctxt, XML_ERR_CDATA_NOT_FINISHED, NULL);
 9502|    817|        goto out;
 9503|    817|    }
 9504|  93.7k|    NEXTL(rl);
  ------------------
  |  | 2325|  93.7k|#define NEXTL(l) do {							\
  |  | 2326|  93.7k|    if (*(ctxt->input->cur) == '\n') {					\
  |  |  ------------------
  |  |  |  Branch (2326:9): [True: 712, False: 93.0k]
  |  |  ------------------
  |  | 2327|    712|	ctxt->input->line++; ctxt->input->col = 1;			\
  |  | 2328|  93.0k|    } else ctxt->input->col++;						\
  |  | 2329|  93.7k|    ctxt->input->cur += l;				\
  |  | 2330|  93.7k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2330:12): [Folded, False: 93.7k]
  |  |  ------------------
  ------------------
 9505|  93.7k|    s = xmlCurrentCharRecover(ctxt, &sl);
 9506|  93.7k|    if (!IS_CHAR(s)) {
  ------------------
  |  |  115|  93.7k|#define IS_CHAR(c)   xmlIsCharQ(c)
  |  |  ------------------
  |  |  |  |  117|  93.7k|#define xmlIsCharQ(c)		(((c) < 0x100) ? \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (117:25): [True: 92.0k, False: 1.66k]
  |  |  |  |  ------------------
  |  |  |  |  118|  93.7k|				 xmlIsChar_ch((c)) :\
  |  |  |  |  ------------------
  |  |  |  |  |  |  108|  92.0k|#define xmlIsChar_ch(c)		(((0x9 <= (c)) && ((c) <= 0xa)) || \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (108:28): [True: 91.5k, False: 530]
  |  |  |  |  |  |  |  Branch (108:44): [True: 223, False: 91.3k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  109|  92.0k|				 ((c) == 0xd) || \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (109:6): [True: 0, False: 91.8k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  110|  92.0k|				  (0x20 <= (c)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (110:7): [True: 91.2k, False: 631]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  119|  93.7k|				(((0x100 <= (c)) && ((c) <= 0xd7ff)) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (119:7): [True: 1.66k, False: 0]
  |  |  |  |  |  Branch (119:25): [True: 409, False: 1.25k]
  |  |  |  |  ------------------
  |  |  |  |  120|  1.66k|				 ((0xe000 <= (c)) && ((c) <= 0xfffd)) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (120:7): [True: 1.25k, False: 0]
  |  |  |  |  |  Branch (120:26): [True: 812, False: 441]
  |  |  |  |  ------------------
  |  |  |  |  121|  1.66k|				 ((0x10000 <= (c)) && ((c) <= 0x10ffff))))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (121:7): [True: 236, False: 205]
  |  |  |  |  |  Branch (121:27): [True: 236, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (9506:9): [True: 836, False: 92.9k]
  ------------------
 9507|    836|	xmlFatalErr(ctxt, XML_ERR_CDATA_NOT_FINISHED, NULL);
 9508|    836|        goto out;
 9509|    836|    }
 9510|  92.9k|    NEXTL(sl);
  ------------------
  |  | 2325|  92.9k|#define NEXTL(l) do {							\
  |  | 2326|  92.9k|    if (*(ctxt->input->cur) == '\n') {					\
  |  |  ------------------
  |  |  |  Branch (2326:9): [True: 215, False: 92.6k]
  |  |  ------------------
  |  | 2327|    215|	ctxt->input->line++; ctxt->input->col = 1;			\
  |  | 2328|  92.6k|    } else ctxt->input->col++;						\
  |  | 2329|  92.9k|    ctxt->input->cur += l;				\
  |  | 2330|  92.9k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2330:12): [Folded, False: 92.9k]
  |  |  ------------------
  ------------------
 9511|  92.9k|    cur = xmlCurrentCharRecover(ctxt, &l);
 9512|  92.9k|    buf = xmlMalloc(size);
 9513|  92.9k|    if (buf == NULL) {
  ------------------
  |  Branch (9513:9): [True: 2, False: 92.9k]
  ------------------
 9514|      2|	xmlErrMemory(ctxt);
 9515|      2|        goto out;
 9516|      2|    }
 9517|  3.56M|    while (IS_CHAR(cur) &&
  ------------------
  |  |  115|  3.56M|#define IS_CHAR(c)   xmlIsCharQ(c)
  |  |  ------------------
  |  |  |  |  117|  7.13M|#define xmlIsCharQ(c)		(((c) < 0x100) ? \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (117:24): [True: 3.56M, False: 2.44k]
  |  |  |  |  |  Branch (117:25): [True: 339k, False: 3.22M]
  |  |  |  |  ------------------
  |  |  |  |  118|  7.13M|				 xmlIsChar_ch((c)) :\
  |  |  |  |  ------------------
  |  |  |  |  |  |  108|   339k|#define xmlIsChar_ch(c)		(((0x9 <= (c)) && ((c) <= 0xa)) || \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (108:28): [True: 338k, False: 1.24k]
  |  |  |  |  |  |  |  Branch (108:44): [True: 2.68k, False: 335k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  109|   339k|				 ((c) == 0xd) || \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (109:6): [True: 0, False: 337k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  110|   339k|				  (0x20 <= (c)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (110:7): [True: 334k, False: 2.23k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  119|  7.13M|				(((0x100 <= (c)) && ((c) <= 0xd7ff)) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (119:7): [True: 3.22M, False: 0]
  |  |  |  |  |  Branch (119:25): [True: 385, False: 3.22M]
  |  |  |  |  ------------------
  |  |  |  |  120|  3.22M|				 ((0xe000 <= (c)) && ((c) <= 0xfffd)) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (120:7): [True: 3.22M, False: 0]
  |  |  |  |  |  Branch (120:26): [True: 3.22M, False: 549]
  |  |  |  |  ------------------
  |  |  |  |  121|  3.22M|				 ((0x10000 <= (c)) && ((c) <= 0x10ffff))))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (121:7): [True: 336, False: 213]
  |  |  |  |  |  Branch (121:27): [True: 336, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 9518|  3.56M|           ((r != ']') || (s != ']') || (cur != '>'))) {
  ------------------
  |  Branch (9518:13): [True: 3.47M, False: 92.1k]
  |  Branch (9518:27): [True: 672, False: 91.4k]
  |  Branch (9518:41): [True: 1.02k, False: 90.4k]
  ------------------
 9519|  3.47M|	if (len + 5 >= size) {
  ------------------
  |  Branch (9519:6): [True: 884, False: 3.47M]
  ------------------
 9520|    884|	    xmlChar *tmp;
 9521|    884|            int newSize;
 9522|       |
 9523|    884|            newSize = xmlGrowCapacity(size, 1, 1, maxLength);
 9524|    884|            if (newSize < 0) {
  ------------------
  |  Branch (9524:17): [True: 0, False: 884]
  ------------------
 9525|      0|                xmlFatalErrMsg(ctxt, XML_ERR_CDATA_NOT_FINISHED,
 9526|      0|                               "CData section too big found\n");
 9527|      0|                goto out;
 9528|      0|            }
 9529|    884|	    tmp = xmlRealloc(buf, newSize);
 9530|    884|	    if (tmp == NULL) {
  ------------------
  |  Branch (9530:10): [True: 1, False: 883]
  ------------------
 9531|      1|		xmlErrMemory(ctxt);
 9532|      1|                goto out;
 9533|      1|	    }
 9534|    883|	    buf = tmp;
 9535|    883|	    size = newSize;
 9536|    883|	}
 9537|  3.47M|	COPY_BUF(buf, len, r);
  ------------------
  |  | 2333|  3.47M|    if (v < 0x80) b[i++] = v;						\
  |  |  ------------------
  |  |  |  Branch (2333:9): [True: 246k, False: 3.22M]
  |  |  ------------------
  |  | 2334|  3.47M|    else i += xmlCopyCharMultiByte(&b[i],v)
  ------------------
 9538|  3.47M|	r = s;
 9539|  3.47M|	rl = sl;
 9540|  3.47M|	s = cur;
 9541|  3.47M|	sl = l;
 9542|  3.47M|	NEXTL(l);
  ------------------
  |  | 2325|  3.47M|#define NEXTL(l) do {							\
  |  | 2326|  3.47M|    if (*(ctxt->input->cur) == '\n') {					\
  |  |  ------------------
  |  |  |  Branch (2326:9): [True: 2.27k, False: 3.47M]
  |  |  ------------------
  |  | 2327|  2.27k|	ctxt->input->line++; ctxt->input->col = 1;			\
  |  | 2328|  3.47M|    } else ctxt->input->col++;						\
  |  | 2329|  3.47M|    ctxt->input->cur += l;				\
  |  | 2330|  3.47M|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2330:12): [Folded, False: 3.47M]
  |  |  ------------------
  ------------------
 9543|  3.47M|	cur = xmlCurrentCharRecover(ctxt, &l);
 9544|  3.47M|    }
 9545|  92.9k|    buf[len] = 0;
 9546|  92.9k|    if (cur != '>') {
  ------------------
  |  Branch (9546:9): [True: 2.44k, False: 90.4k]
  ------------------
 9547|  2.44k|	xmlFatalErrMsgStr(ctxt, XML_ERR_CDATA_NOT_FINISHED,
 9548|  2.44k|	                     "CData section not finished\n%.50s\n", buf);
 9549|  2.44k|        goto out;
 9550|  2.44k|    }
 9551|  90.4k|    NEXTL(l);
  ------------------
  |  | 2325|  90.4k|#define NEXTL(l) do {							\
  |  | 2326|  90.4k|    if (*(ctxt->input->cur) == '\n') {					\
  |  |  ------------------
  |  |  |  Branch (2326:9): [True: 0, False: 90.4k]
  |  |  ------------------
  |  | 2327|      0|	ctxt->input->line++; ctxt->input->col = 1;			\
  |  | 2328|  90.4k|    } else ctxt->input->col++;						\
  |  | 2329|  90.4k|    ctxt->input->cur += l;				\
  |  | 2330|  90.4k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2330:12): [Folded, False: 90.4k]
  |  |  ------------------
  ------------------
 9552|       |
 9553|       |    /*
 9554|       |     * OK the buffer is to be consumed as cdata.
 9555|       |     */
 9556|  90.4k|    if ((ctxt->sax != NULL) && (!ctxt->disableSAX)) {
  ------------------
  |  Branch (9556:9): [True: 90.4k, False: 0]
  |  Branch (9556:32): [True: 90.1k, False: 323]
  ------------------
 9557|  90.1k|        if ((ctxt->sax->cdataBlock != NULL) &&
  ------------------
  |  Branch (9557:13): [True: 90.1k, False: 0]
  ------------------
 9558|  90.1k|            ((ctxt->options & XML_PARSE_NOCDATA) == 0)) {
  ------------------
  |  Branch (9558:13): [True: 73.1k, False: 16.9k]
  ------------------
 9559|  73.1k|            ctxt->sax->cdataBlock(ctxt->userData, buf, len);
 9560|  73.1k|        } else if (ctxt->sax->characters != NULL) {
  ------------------
  |  Branch (9560:20): [True: 16.9k, False: 0]
  ------------------
 9561|  16.9k|            ctxt->sax->characters(ctxt->userData, buf, len);
 9562|  16.9k|        }
 9563|  90.1k|    }
 9564|       |
 9565|  94.5k|out:
 9566|  94.5k|    xmlFree(buf);
 9567|  94.5k|}
xmlParseElement:
 9707|  9.67k|xmlParseElement(xmlParserCtxt *ctxt) {
 9708|  9.67k|    if (xmlParseElementStart(ctxt) != 0)
  ------------------
  |  Branch (9708:9): [True: 3.98k, False: 5.69k]
  ------------------
 9709|  3.98k|        return;
 9710|       |
 9711|  5.69k|    xmlParseContentInternal(ctxt);
 9712|       |
 9713|  5.69k|    if (ctxt->input->cur >= ctxt->input->end) {
  ------------------
  |  Branch (9713:9): [True: 677, False: 5.01k]
  ------------------
 9714|    677|        if (ctxt->wellFormed) {
  ------------------
  |  Branch (9714:13): [True: 5, False: 672]
  ------------------
 9715|      5|            const xmlChar *name = ctxt->nameTab[ctxt->nameNr - 1];
 9716|      5|            int line = ctxt->pushTab[ctxt->nameNr - 1].line;
 9717|      5|            xmlFatalErrMsgStrIntStr(ctxt, XML_ERR_TAG_NOT_FINISHED,
 9718|      5|                    "Premature end of data in tag %s line %d\n",
 9719|      5|                    name, line, NULL);
 9720|      5|        }
 9721|    677|        return;
 9722|    677|    }
 9723|       |
 9724|  5.01k|    xmlParseElementEnd(ctxt);
 9725|  5.01k|}
xmlParseVersionNum:
 9905|  13.4k|xmlParseVersionNum(xmlParserCtxt *ctxt) {
 9906|  13.4k|    xmlChar *buf = NULL;
 9907|  13.4k|    int len = 0;
 9908|  13.4k|    int size = 10;
 9909|  13.4k|    int maxLength = (ctxt->options & XML_PARSE_HUGE) ?
  ------------------
  |  Branch (9909:21): [True: 4.61k, False: 8.88k]
  ------------------
 9910|  4.61k|                    XML_MAX_TEXT_LENGTH :
  ------------------
  |  |   50|  4.61k|#define XML_MAX_TEXT_LENGTH 10000000
  ------------------
 9911|  13.4k|                    XML_MAX_NAME_LENGTH;
  ------------------
  |  |   65|  8.88k|#define XML_MAX_NAME_LENGTH 50000
  ------------------
 9912|  13.4k|    xmlChar cur;
 9913|       |
 9914|  13.4k|    buf = xmlMalloc(size);
 9915|  13.4k|    if (buf == NULL) {
  ------------------
  |  Branch (9915:9): [True: 6, False: 13.4k]
  ------------------
 9916|      6|	xmlErrMemory(ctxt);
 9917|      6|	return(NULL);
 9918|      6|    }
 9919|  13.4k|    cur = CUR;
  ------------------
  |  | 2262|  13.4k|#define CUR (*ctxt->input->cur)
  ------------------
 9920|  13.4k|    if (!((cur >= '0') && (cur <= '9'))) {
  ------------------
  |  Branch (9920:11): [True: 12.9k, False: 520]
  |  Branch (9920:27): [True: 12.7k, False: 222]
  ------------------
 9921|    742|	xmlFree(buf);
 9922|    742|	return(NULL);
 9923|    742|    }
 9924|  12.7k|    buf[len++] = cur;
 9925|  12.7k|    NEXT;
  ------------------
  |  | 2316|  12.7k|#define NEXT xmlNextChar(ctxt)
  ------------------
 9926|  12.7k|    cur=CUR;
  ------------------
  |  | 2262|  12.7k|#define CUR (*ctxt->input->cur)
  ------------------
 9927|  12.7k|    if (cur != '.') {
  ------------------
  |  Branch (9927:9): [True: 3.11k, False: 9.63k]
  ------------------
 9928|  3.11k|	xmlFree(buf);
 9929|  3.11k|	return(NULL);
 9930|  3.11k|    }
 9931|  9.63k|    buf[len++] = cur;
 9932|  9.63k|    NEXT;
  ------------------
  |  | 2316|  9.63k|#define NEXT xmlNextChar(ctxt)
  ------------------
 9933|  9.63k|    cur=CUR;
  ------------------
  |  | 2262|  9.63k|#define CUR (*ctxt->input->cur)
  ------------------
 9934|   205k|    while ((cur >= '0') && (cur <= '9')) {
  ------------------
  |  Branch (9934:12): [True: 195k, False: 9.44k]
  |  Branch (9934:28): [True: 195k, False: 183]
  ------------------
 9935|   195k|	if (len + 1 >= size) {
  ------------------
  |  Branch (9935:6): [True: 511, False: 195k]
  ------------------
 9936|    511|	    xmlChar *tmp;
 9937|    511|            int newSize;
 9938|       |
 9939|    511|            newSize = xmlGrowCapacity(size, 1, 1, maxLength);
 9940|    511|            if (newSize < 0) {
  ------------------
  |  Branch (9940:17): [True: 1, False: 510]
  ------------------
 9941|      1|                xmlFatalErr(ctxt, XML_ERR_NAME_TOO_LONG, "VersionNum");
 9942|      1|                xmlFree(buf);
 9943|      1|                return(NULL);
 9944|      1|            }
 9945|    510|	    tmp = xmlRealloc(buf, newSize);
 9946|    510|	    if (tmp == NULL) {
  ------------------
  |  Branch (9946:10): [True: 1, False: 509]
  ------------------
 9947|      1|		xmlErrMemory(ctxt);
 9948|      1|	        xmlFree(buf);
 9949|      1|		return(NULL);
 9950|      1|	    }
 9951|    509|	    buf = tmp;
 9952|    509|            size = newSize;
 9953|    509|	}
 9954|   195k|	buf[len++] = cur;
 9955|   195k|	NEXT;
  ------------------
  |  | 2316|   195k|#define NEXT xmlNextChar(ctxt)
  ------------------
 9956|   195k|	cur=CUR;
  ------------------
  |  | 2262|   195k|#define CUR (*ctxt->input->cur)
  ------------------
 9957|   195k|    }
 9958|  9.63k|    buf[len] = 0;
 9959|  9.63k|    return(buf);
 9960|  9.63k|}
xmlParseVersionInfo:
 9976|   241k|xmlParseVersionInfo(xmlParserCtxt *ctxt) {
 9977|   241k|    xmlChar *version = NULL;
 9978|       |
 9979|   241k|    if (CMP7(CUR_PTR, 'v', 'e', 'r', 's', 'i', 'o', 'n')) {
  ------------------
  |  | 2275|   241k|  ( CMP6( s, c1, c2, c3, c4, c5, c6 ) && ((unsigned char *) s)[ 6 ] == c7 )
  |  |  ------------------
  |  |  |  | 2273|   482k|  ( CMP5( s, c1, c2, c3, c4, c5 ) && ((unsigned char *) s)[ 5 ] == c6 )
  |  |  |  |  ------------------
  |  |  |  |  |  | 2271|   482k|  ( CMP4( s, c1, c2, c3, c4 ) && ((unsigned char *) s)[ 4 ] == c5 )
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  | 2268|   482k|  ( ((unsigned char *) s)[ 0 ] == c1 && ((unsigned char *) s)[ 1 ] == c2 && \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (2268:5): [True: 19.5k, False: 221k]
  |  |  |  |  |  |  |  |  |  Branch (2268:41): [True: 18.0k, False: 1.41k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  | 2269|   241k|    ((unsigned char *) s)[ 2 ] == c3 && ((unsigned char *) s)[ 3 ] == c4 )
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (2269:5): [True: 17.0k, False: 1.05k]
  |  |  |  |  |  |  |  |  |  Branch (2269:41): [True: 16.7k, False: 259]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (2271:34): [True: 16.2k, False: 553]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2273:38): [True: 15.1k, False: 1.07k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2275:42): [True: 14.7k, False: 396]
  |  |  ------------------
  ------------------
 9980|  14.7k|	SKIP(7);
  ------------------
  |  | 2285|  14.7k|#define SKIP(val) do {							\
  |  | 2286|  14.7k|    ctxt->input->cur += (val),ctxt->input->col+=(val);			\
  |  | 2287|  14.7k|    if (*ctxt->input->cur == 0)						\
  |  |  ------------------
  |  |  |  Branch (2287:9): [True: 275, False: 14.4k]
  |  |  ------------------
  |  | 2288|  14.7k|        xmlParserGrow(ctxt);						\
  |  | 2289|  14.7k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2289:12): [Folded, False: 14.7k]
  |  |  ------------------
  ------------------
 9981|  14.7k|	SKIP_BLANKS;
  ------------------
  |  | 2312|  14.7k|#define SKIP_BLANKS xmlSkipBlankChars(ctxt)
  ------------------
 9982|  14.7k|	if (RAW != '=') {
  ------------------
  |  | 2261|  14.7k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (9982:6): [True: 808, False: 13.9k]
  ------------------
 9983|    808|	    xmlFatalErr(ctxt, XML_ERR_EQUAL_REQUIRED, NULL);
 9984|    808|	    return(NULL);
 9985|    808|        }
 9986|  13.9k|	NEXT;
  ------------------
  |  | 2316|  13.9k|#define NEXT xmlNextChar(ctxt)
  ------------------
 9987|  13.9k|	SKIP_BLANKS;
  ------------------
  |  | 2312|  13.9k|#define SKIP_BLANKS xmlSkipBlankChars(ctxt)
  ------------------
 9988|  13.9k|	if (RAW == '"') {
  ------------------
  |  | 2261|  13.9k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (9988:6): [True: 2.64k, False: 11.2k]
  ------------------
 9989|  2.64k|	    NEXT;
  ------------------
  |  | 2316|  2.64k|#define NEXT xmlNextChar(ctxt)
  ------------------
 9990|  2.64k|	    version = xmlParseVersionNum(ctxt);
 9991|  2.64k|	    if (RAW != '"') {
  ------------------
  |  | 2261|  2.64k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (9991:10): [True: 494, False: 2.15k]
  ------------------
 9992|    494|		xmlFatalErr(ctxt, XML_ERR_STRING_NOT_CLOSED, NULL);
 9993|    494|	    } else
 9994|  2.15k|	        NEXT;
  ------------------
  |  | 2316|  2.15k|#define NEXT xmlNextChar(ctxt)
  ------------------
 9995|  11.2k|	} else if (RAW == '\''){
  ------------------
  |  | 2261|  11.2k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (9995:13): [True: 10.8k, False: 441]
  ------------------
 9996|  10.8k|	    NEXT;
  ------------------
  |  | 2316|  10.8k|#define NEXT xmlNextChar(ctxt)
  ------------------
 9997|  10.8k|	    version = xmlParseVersionNum(ctxt);
 9998|  10.8k|	    if (RAW != '\'') {
  ------------------
  |  | 2261|  10.8k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (9998:10): [True: 3.49k, False: 7.36k]
  ------------------
 9999|  3.49k|		xmlFatalErr(ctxt, XML_ERR_STRING_NOT_CLOSED, NULL);
10000|  3.49k|	    } else
10001|  7.36k|	        NEXT;
  ------------------
  |  | 2316|  7.36k|#define NEXT xmlNextChar(ctxt)
  ------------------
10002|  10.8k|	} else {
10003|    441|	    xmlFatalErr(ctxt, XML_ERR_STRING_NOT_STARTED, NULL);
10004|    441|	}
10005|  13.9k|    }
10006|   240k|    return(version);
10007|   241k|}
xmlParseEncName:
10020|  7.25k|xmlParseEncName(xmlParserCtxt *ctxt) {
10021|  7.25k|    xmlChar *buf = NULL;
10022|  7.25k|    int len = 0;
10023|  7.25k|    int size = 10;
10024|  7.25k|    int maxLength = (ctxt->options & XML_PARSE_HUGE) ?
  ------------------
  |  Branch (10024:21): [True: 3.07k, False: 4.18k]
  ------------------
10025|  3.07k|                    XML_MAX_TEXT_LENGTH :
  ------------------
  |  |   50|  3.07k|#define XML_MAX_TEXT_LENGTH 10000000
  ------------------
10026|  7.25k|                    XML_MAX_NAME_LENGTH;
  ------------------
  |  |   65|  4.18k|#define XML_MAX_NAME_LENGTH 50000
  ------------------
10027|  7.25k|    xmlChar cur;
10028|       |
10029|  7.25k|    cur = CUR;
  ------------------
  |  | 2262|  7.25k|#define CUR (*ctxt->input->cur)
  ------------------
10030|  7.25k|    if (((cur >= 'a') && (cur <= 'z')) ||
  ------------------
  |  Branch (10030:10): [True: 1.22k, False: 6.03k]
  |  Branch (10030:26): [True: 1.00k, False: 225]
  ------------------
10031|  6.82k|        ((cur >= 'A') && (cur <= 'Z'))) {
  ------------------
  |  Branch (10031:10): [True: 6.04k, False: 207]
  |  Branch (10031:26): [True: 5.82k, False: 225]
  ------------------
10032|  6.82k|	buf = xmlMalloc(size);
10033|  6.82k|	if (buf == NULL) {
  ------------------
  |  Branch (10033:6): [True: 1, False: 6.82k]
  ------------------
10034|      1|	    xmlErrMemory(ctxt);
10035|      1|	    return(NULL);
10036|      1|	}
10037|       |
10038|  6.82k|	buf[len++] = cur;
10039|  6.82k|	NEXT;
  ------------------
  |  | 2316|  6.82k|#define NEXT xmlNextChar(ctxt)
  ------------------
10040|  6.82k|	cur = CUR;
  ------------------
  |  | 2262|  6.82k|#define CUR (*ctxt->input->cur)
  ------------------
10041|   283k|	while (((cur >= 'a') && (cur <= 'z')) ||
  ------------------
  |  Branch (10041:10): [True: 3.12k, False: 280k]
  |  Branch (10041:26): [True: 2.77k, False: 345]
  ------------------
10042|   280k|	       ((cur >= 'A') && (cur <= 'Z')) ||
  ------------------
  |  Branch (10042:10): [True: 245k, False: 35.7k]
  |  Branch (10042:26): [True: 244k, False: 566]
  ------------------
10043|  36.3k|	       ((cur >= '0') && (cur <= '9')) ||
  ------------------
  |  Branch (10043:10): [True: 21.0k, False: 15.3k]
  |  Branch (10043:26): [True: 20.4k, False: 589]
  ------------------
10044|  15.9k|	       (cur == '.') || (cur == '_') ||
  ------------------
  |  Branch (10044:9): [True: 675, False: 15.2k]
  |  Branch (10044:25): [True: 219, False: 15.0k]
  ------------------
10045|   276k|	       (cur == '-')) {
  ------------------
  |  Branch (10045:9): [True: 8.19k, False: 6.82k]
  ------------------
10046|   276k|	    if (len + 1 >= size) {
  ------------------
  |  Branch (10046:10): [True: 3.88k, False: 272k]
  ------------------
10047|  3.88k|	        xmlChar *tmp;
10048|  3.88k|                int newSize;
10049|       |
10050|  3.88k|                newSize = xmlGrowCapacity(size, 1, 1, maxLength);
10051|  3.88k|                if (newSize < 0) {
  ------------------
  |  Branch (10051:21): [True: 1, False: 3.87k]
  ------------------
10052|      1|                    xmlFatalErr(ctxt, XML_ERR_NAME_TOO_LONG, "EncName");
10053|      1|                    xmlFree(buf);
10054|      1|                    return(NULL);
10055|      1|                }
10056|  3.87k|		tmp = xmlRealloc(buf, newSize);
10057|  3.87k|		if (tmp == NULL) {
  ------------------
  |  Branch (10057:7): [True: 2, False: 3.87k]
  ------------------
10058|      2|		    xmlErrMemory(ctxt);
10059|      2|		    xmlFree(buf);
10060|      2|		    return(NULL);
10061|      2|		}
10062|  3.87k|		buf = tmp;
10063|  3.87k|                size = newSize;
10064|  3.87k|	    }
10065|   276k|	    buf[len++] = cur;
10066|   276k|	    NEXT;
  ------------------
  |  | 2316|   276k|#define NEXT xmlNextChar(ctxt)
  ------------------
10067|   276k|	    cur = CUR;
  ------------------
  |  | 2262|   276k|#define CUR (*ctxt->input->cur)
  ------------------
10068|   276k|        }
10069|  6.82k|	buf[len] = 0;
10070|  6.82k|    } else {
10071|    432|	xmlFatalErr(ctxt, XML_ERR_ENCODING_NAME, NULL);
10072|    432|    }
10073|  7.25k|    return(buf);
10074|  7.25k|}
xmlParseEncodingDecl:
10091|   240k|xmlParseEncodingDecl(xmlParserCtxt *ctxt) {
10092|   240k|    xmlChar *encoding = NULL;
10093|       |
10094|   240k|    SKIP_BLANKS;
  ------------------
  |  | 2312|   240k|#define SKIP_BLANKS xmlSkipBlankChars(ctxt)
  ------------------
10095|   240k|    if (CMP8(CUR_PTR, 'e', 'n', 'c', 'o', 'd', 'i', 'n', 'g') == 0)
  ------------------
  |  | 2277|   240k|  ( CMP7( s, c1, c2, c3, c4, c5, c6, c7 ) && ((unsigned char *) s)[ 7 ] == c8 )
  |  |  ------------------
  |  |  |  | 2275|   480k|  ( CMP6( s, c1, c2, c3, c4, c5, c6 ) && ((unsigned char *) s)[ 6 ] == c7 )
  |  |  |  |  ------------------
  |  |  |  |  |  | 2273|   480k|  ( CMP5( s, c1, c2, c3, c4, c5 ) && ((unsigned char *) s)[ 5 ] == c6 )
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  | 2271|   480k|  ( CMP4( s, c1, c2, c3, c4 ) && ((unsigned char *) s)[ 4 ] == c5 )
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  | 2268|   480k|  ( ((unsigned char *) s)[ 0 ] == c1 && ((unsigned char *) s)[ 1 ] == c2 && \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (2268:5): [True: 10.4k, False: 229k]
  |  |  |  |  |  |  |  |  |  |  |  Branch (2268:41): [True: 10.1k, False: 326]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  | 2269|   240k|    ((unsigned char *) s)[ 2 ] == c3 && ((unsigned char *) s)[ 3 ] == c4 )
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (2269:5): [True: 9.90k, False: 207]
  |  |  |  |  |  |  |  |  |  |  |  Branch (2269:41): [True: 9.52k, False: 376]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (2271:34): [True: 9.32k, False: 200]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (2273:38): [True: 8.94k, False: 380]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2275:42): [True: 8.74k, False: 199]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2277:46): [True: 8.51k, False: 231]
  |  |  ------------------
  ------------------
  |  Branch (10095:9): [True: 231k, False: 8.51k]
  ------------------
10096|   231k|        return(NULL);
10097|       |
10098|  8.51k|    SKIP(8);
  ------------------
  |  | 2285|  8.51k|#define SKIP(val) do {							\
  |  | 2286|  8.51k|    ctxt->input->cur += (val),ctxt->input->col+=(val);			\
  |  | 2287|  8.51k|    if (*ctxt->input->cur == 0)						\
  |  |  ------------------
  |  |  |  Branch (2287:9): [True: 208, False: 8.30k]
  |  |  ------------------
  |  | 2288|  8.51k|        xmlParserGrow(ctxt);						\
  |  | 2289|  8.51k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2289:12): [Folded, False: 8.51k]
  |  |  ------------------
  ------------------
10099|  8.51k|    SKIP_BLANKS;
  ------------------
  |  | 2312|  8.51k|#define SKIP_BLANKS xmlSkipBlankChars(ctxt)
  ------------------
10100|  8.51k|    if (RAW != '=') {
  ------------------
  |  | 2261|  8.51k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (10100:9): [True: 573, False: 7.94k]
  ------------------
10101|    573|        xmlFatalErr(ctxt, XML_ERR_EQUAL_REQUIRED, NULL);
10102|    573|        return(NULL);
10103|    573|    }
10104|  7.94k|    NEXT;
  ------------------
  |  | 2316|  7.94k|#define NEXT xmlNextChar(ctxt)
  ------------------
10105|  7.94k|    SKIP_BLANKS;
  ------------------
  |  | 2312|  7.94k|#define SKIP_BLANKS xmlSkipBlankChars(ctxt)
  ------------------
10106|  7.94k|    if (RAW == '"') {
  ------------------
  |  | 2261|  7.94k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (10106:9): [True: 1.59k, False: 6.35k]
  ------------------
10107|  1.59k|        NEXT;
  ------------------
  |  | 2316|  1.59k|#define NEXT xmlNextChar(ctxt)
  ------------------
10108|  1.59k|        encoding = xmlParseEncName(ctxt);
10109|  1.59k|        if (RAW != '"') {
  ------------------
  |  | 2261|  1.59k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (10109:13): [True: 578, False: 1.01k]
  ------------------
10110|    578|            xmlFatalErr(ctxt, XML_ERR_STRING_NOT_CLOSED, NULL);
10111|    578|            xmlFree(encoding);
10112|    578|            return(NULL);
10113|    578|        } else
10114|  1.01k|            NEXT;
  ------------------
  |  | 2316|  1.01k|#define NEXT xmlNextChar(ctxt)
  ------------------
10115|  6.35k|    } else if (RAW == '\''){
  ------------------
  |  | 2261|  6.35k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (10115:16): [True: 5.66k, False: 685]
  ------------------
10116|  5.66k|        NEXT;
  ------------------
  |  | 2316|  5.66k|#define NEXT xmlNextChar(ctxt)
  ------------------
10117|  5.66k|        encoding = xmlParseEncName(ctxt);
10118|  5.66k|        if (RAW != '\'') {
  ------------------
  |  | 2261|  5.66k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (10118:13): [True: 306, False: 5.35k]
  ------------------
10119|    306|            xmlFatalErr(ctxt, XML_ERR_STRING_NOT_CLOSED, NULL);
10120|    306|            xmlFree(encoding);
10121|    306|            return(NULL);
10122|    306|        } else
10123|  5.35k|            NEXT;
  ------------------
  |  | 2316|  5.35k|#define NEXT xmlNextChar(ctxt)
  ------------------
10124|  5.66k|    } else {
10125|    685|        xmlFatalErr(ctxt, XML_ERR_STRING_NOT_STARTED, NULL);
10126|    685|    }
10127|       |
10128|  7.05k|    if (encoding == NULL)
  ------------------
  |  Branch (10128:9): [True: 687, False: 6.37k]
  ------------------
10129|    687|        return(NULL);
10130|       |
10131|  6.37k|    xmlSetDeclaredEncoding(ctxt, encoding);
10132|       |
10133|  6.37k|    return(ctxt->encoding);
10134|  7.05k|}
xmlParseSDDecl:
10168|  1.22k|xmlParseSDDecl(xmlParserCtxt *ctxt) {
10169|  1.22k|    int standalone = -2;
10170|       |
10171|  1.22k|    SKIP_BLANKS;
  ------------------
  |  | 2312|  1.22k|#define SKIP_BLANKS xmlSkipBlankChars(ctxt)
  ------------------
10172|  1.22k|    if (CMP10(CUR_PTR, 's', 't', 'a', 'n', 'd', 'a', 'l', 'o', 'n', 'e')) {
  ------------------
  |  | 2282|  1.22k|  ( CMP9( s, c1, c2, c3, c4, c5, c6, c7, c8, c9 ) && \
  |  |  ------------------
  |  |  |  | 2279|  2.45k|  ( CMP8( s, c1, c2, c3, c4, c5, c6, c7, c8 ) && \
  |  |  |  |  ------------------
  |  |  |  |  |  | 2277|  2.45k|  ( CMP7( s, c1, c2, c3, c4, c5, c6, c7 ) && ((unsigned char *) s)[ 7 ] == c8 )
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  | 2275|  2.45k|  ( CMP6( s, c1, c2, c3, c4, c5, c6 ) && ((unsigned char *) s)[ 6 ] == c7 )
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  | 2273|  2.45k|  ( CMP5( s, c1, c2, c3, c4, c5 ) && ((unsigned char *) s)[ 5 ] == c6 )
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  | 2271|  2.45k|  ( CMP4( s, c1, c2, c3, c4 ) && ((unsigned char *) s)[ 4 ] == c5 )
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  | 2268|  2.45k|  ( ((unsigned char *) s)[ 0 ] == c1 && ((unsigned char *) s)[ 1 ] == c2 && \
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  Branch (2268:5): [True: 312, False: 917]
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  Branch (2268:41): [True: 306, False: 6]
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  | 2269|  1.22k|    ((unsigned char *) s)[ 2 ] == c3 && ((unsigned char *) s)[ 3 ] == c4 )
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  Branch (2269:5): [True: 303, False: 3]
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  Branch (2269:41): [True: 301, False: 2]
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  Branch (2271:34): [True: 298, False: 3]
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (2273:38): [True: 297, False: 1]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (2275:42): [True: 296, False: 1]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (2277:46): [True: 295, False: 1]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 2280|  2.45k|    ((unsigned char *) s)[ 8 ] == c9 )
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2280:5): [True: 294, False: 1]
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 2283|  1.22k|    ((unsigned char *) s)[ 9 ] == c10 )
  |  |  ------------------
  |  |  |  Branch (2283:5): [True: 292, False: 2]
  |  |  ------------------
  ------------------
10173|    292|	SKIP(10);
  ------------------
  |  | 2285|    292|#define SKIP(val) do {							\
  |  | 2286|    292|    ctxt->input->cur += (val),ctxt->input->col+=(val);			\
  |  | 2287|    292|    if (*ctxt->input->cur == 0)						\
  |  |  ------------------
  |  |  |  Branch (2287:9): [True: 1, False: 291]
  |  |  ------------------
  |  | 2288|    292|        xmlParserGrow(ctxt);						\
  |  | 2289|    292|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2289:12): [Folded, False: 292]
  |  |  ------------------
  ------------------
10174|    292|        SKIP_BLANKS;
  ------------------
  |  | 2312|    292|#define SKIP_BLANKS xmlSkipBlankChars(ctxt)
  ------------------
10175|    292|	if (RAW != '=') {
  ------------------
  |  | 2261|    292|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (10175:6): [True: 3, False: 289]
  ------------------
10176|      3|	    xmlFatalErr(ctxt, XML_ERR_EQUAL_REQUIRED, NULL);
10177|      3|	    return(standalone);
10178|      3|        }
10179|    289|	NEXT;
  ------------------
  |  | 2316|    289|#define NEXT xmlNextChar(ctxt)
  ------------------
10180|    289|	SKIP_BLANKS;
  ------------------
  |  | 2312|    289|#define SKIP_BLANKS xmlSkipBlankChars(ctxt)
  ------------------
10181|    289|        if (RAW == '\''){
  ------------------
  |  | 2261|    289|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (10181:13): [True: 278, False: 11]
  ------------------
10182|    278|	    NEXT;
  ------------------
  |  | 2316|    278|#define NEXT xmlNextChar(ctxt)
  ------------------
10183|    278|	    if ((RAW == 'n') && (NXT(1) == 'o')) {
  ------------------
  |  | 2261|    278|#define RAW (*ctxt->input->cur)
  ------------------
              	    if ((RAW == 'n') && (NXT(1) == 'o')) {
  ------------------
  |  | 2263|      8|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
  |  Branch (10183:10): [True: 8, False: 270]
  |  Branch (10183:26): [True: 7, False: 1]
  ------------------
10184|      7|	        standalone = 0;
10185|      7|                SKIP(2);
  ------------------
  |  | 2285|      7|#define SKIP(val) do {							\
  |  | 2286|      7|    ctxt->input->cur += (val),ctxt->input->col+=(val);			\
  |  | 2287|      7|    if (*ctxt->input->cur == 0)						\
  |  |  ------------------
  |  |  |  Branch (2287:9): [True: 1, False: 6]
  |  |  ------------------
  |  | 2288|      7|        xmlParserGrow(ctxt);						\
  |  | 2289|      7|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2289:12): [Folded, False: 7]
  |  |  ------------------
  ------------------
10186|    271|	    } else if ((RAW == 'y') && (NXT(1) == 'e') &&
  ------------------
  |  | 2261|    271|#define RAW (*ctxt->input->cur)
  ------------------
              	    } else if ((RAW == 'y') && (NXT(1) == 'e') &&
  ------------------
  |  | 2263|    268|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
  |  Branch (10186:17): [True: 268, False: 3]
  |  Branch (10186:33): [True: 266, False: 2]
  ------------------
10187|    266|	               (NXT(2) == 's')) {
  ------------------
  |  | 2263|    266|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
  |  Branch (10187:17): [True: 265, False: 1]
  ------------------
10188|    265|	        standalone = 1;
10189|    265|		SKIP(3);
  ------------------
  |  | 2285|    265|#define SKIP(val) do {							\
  |  | 2286|    265|    ctxt->input->cur += (val),ctxt->input->col+=(val);			\
  |  | 2287|    265|    if (*ctxt->input->cur == 0)						\
  |  |  ------------------
  |  |  |  Branch (2287:9): [True: 1, False: 264]
  |  |  ------------------
  |  | 2288|    265|        xmlParserGrow(ctxt);						\
  |  | 2289|    265|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2289:12): [Folded, False: 265]
  |  |  ------------------
  ------------------
10190|    265|            } else {
10191|      6|		xmlFatalErr(ctxt, XML_ERR_STANDALONE_VALUE, NULL);
10192|      6|	    }
10193|    278|	    if (RAW != '\'') {
  ------------------
  |  | 2261|    278|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (10193:10): [True: 16, False: 262]
  ------------------
10194|     16|		xmlFatalErr(ctxt, XML_ERR_STRING_NOT_CLOSED, NULL);
10195|     16|	    } else
10196|    262|	        NEXT;
  ------------------
  |  | 2316|    262|#define NEXT xmlNextChar(ctxt)
  ------------------
10197|    278|	} else if (RAW == '"'){
  ------------------
  |  | 2261|     11|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (10197:13): [True: 9, False: 2]
  ------------------
10198|      9|	    NEXT;
  ------------------
  |  | 2316|      9|#define NEXT xmlNextChar(ctxt)
  ------------------
10199|      9|	    if ((RAW == 'n') && (NXT(1) == 'o')) {
  ------------------
  |  | 2261|      9|#define RAW (*ctxt->input->cur)
  ------------------
              	    if ((RAW == 'n') && (NXT(1) == 'o')) {
  ------------------
  |  | 2263|      3|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
  |  Branch (10199:10): [True: 3, False: 6]
  |  Branch (10199:26): [True: 2, False: 1]
  ------------------
10200|      2|	        standalone = 0;
10201|      2|		SKIP(2);
  ------------------
  |  | 2285|      2|#define SKIP(val) do {							\
  |  | 2286|      2|    ctxt->input->cur += (val),ctxt->input->col+=(val);			\
  |  | 2287|      2|    if (*ctxt->input->cur == 0)						\
  |  |  ------------------
  |  |  |  Branch (2287:9): [True: 1, False: 1]
  |  |  ------------------
  |  | 2288|      2|        xmlParserGrow(ctxt);						\
  |  | 2289|      2|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2289:12): [Folded, False: 2]
  |  |  ------------------
  ------------------
10202|      7|	    } else if ((RAW == 'y') && (NXT(1) == 'e') &&
  ------------------
  |  | 2261|      7|#define RAW (*ctxt->input->cur)
  ------------------
              	    } else if ((RAW == 'y') && (NXT(1) == 'e') &&
  ------------------
  |  | 2263|      5|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
  |  Branch (10202:17): [True: 5, False: 2]
  |  Branch (10202:33): [True: 4, False: 1]
  ------------------
10203|      4|	               (NXT(2) == 's')) {
  ------------------
  |  | 2263|      4|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
  |  Branch (10203:17): [True: 2, False: 2]
  ------------------
10204|      2|	        standalone = 1;
10205|      2|                SKIP(3);
  ------------------
  |  | 2285|      2|#define SKIP(val) do {							\
  |  | 2286|      2|    ctxt->input->cur += (val),ctxt->input->col+=(val);			\
  |  | 2287|      2|    if (*ctxt->input->cur == 0)						\
  |  |  ------------------
  |  |  |  Branch (2287:9): [True: 1, False: 1]
  |  |  ------------------
  |  | 2288|      2|        xmlParserGrow(ctxt);						\
  |  | 2289|      2|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2289:12): [Folded, False: 2]
  |  |  ------------------
  ------------------
10206|      5|            } else {
10207|      5|		xmlFatalErr(ctxt, XML_ERR_STANDALONE_VALUE, NULL);
10208|      5|	    }
10209|      9|	    if (RAW != '"') {
  ------------------
  |  | 2261|      9|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (10209:10): [True: 8, False: 1]
  ------------------
10210|      8|		xmlFatalErr(ctxt, XML_ERR_STRING_NOT_CLOSED, NULL);
10211|      8|	    } else
10212|      1|	        NEXT;
  ------------------
  |  | 2316|      1|#define NEXT xmlNextChar(ctxt)
  ------------------
10213|      9|	} else {
10214|      2|	    xmlFatalErr(ctxt, XML_ERR_STRING_NOT_STARTED, NULL);
10215|      2|        }
10216|    289|    }
10217|  1.22k|    return(standalone);
10218|  1.22k|}
xmlParseXMLDecl:
10230|  3.15k|xmlParseXMLDecl(xmlParserCtxt *ctxt) {
10231|  3.15k|    xmlChar *version;
10232|       |
10233|       |    /*
10234|       |     * This value for standalone indicates that the document has an
10235|       |     * XML declaration but it does not have a standalone attribute.
10236|       |     * It will be overwritten later if a standalone attribute is found.
10237|       |     */
10238|       |
10239|  3.15k|    ctxt->standalone = -2;
10240|       |
10241|       |    /*
10242|       |     * We know that '<?xml' is here.
10243|       |     */
10244|  3.15k|    SKIP(5);
  ------------------
  |  | 2285|  3.15k|#define SKIP(val) do {							\
  |  | 2286|  3.15k|    ctxt->input->cur += (val),ctxt->input->col+=(val);			\
  |  | 2287|  3.15k|    if (*ctxt->input->cur == 0)						\
  |  |  ------------------
  |  |  |  Branch (2287:9): [True: 0, False: 3.15k]
  |  |  ------------------
  |  | 2288|  3.15k|        xmlParserGrow(ctxt);						\
  |  | 2289|  3.15k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2289:12): [Folded, False: 3.15k]
  |  |  ------------------
  ------------------
10245|       |
10246|  3.15k|    if (!IS_BLANK_CH(RAW)) {
  ------------------
  |  |  137|  3.15k|#define IS_BLANK_CH(c)  xmlIsBlank_ch(c)
  |  |  ------------------
  |  |  |  |   90|  3.15k|#define xmlIsBlank_ch(c)	(((c) == 0x20) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (90:27): [True: 3.09k, False: 53]
  |  |  |  |  ------------------
  |  |  |  |   91|  3.15k|				 ((0x9 <= (c)) && ((c) <= 0xa)) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (91:7): [True: 53, False: 0]
  |  |  |  |  |  Branch (91:23): [True: 42, False: 11]
  |  |  |  |  ------------------
  |  |  |  |   92|  3.15k|				 ((c) == 0xd))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (92:6): [True: 11, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
10247|      0|	xmlFatalErrMsg(ctxt, XML_ERR_SPACE_REQUIRED,
10248|      0|	               "Blank needed after '<?xml'\n");
10249|      0|    }
10250|  3.15k|    SKIP_BLANKS;
  ------------------
  |  | 2312|  3.15k|#define SKIP_BLANKS xmlSkipBlankChars(ctxt)
  ------------------
10251|       |
10252|       |    /*
10253|       |     * We must have the VersionInfo here.
10254|       |     */
10255|  3.15k|    version = xmlParseVersionInfo(ctxt);
10256|  3.15k|    if (version == NULL) {
  ------------------
  |  Branch (10256:9): [True: 857, False: 2.29k]
  ------------------
10257|    857|	xmlFatalErr(ctxt, XML_ERR_VERSION_MISSING, NULL);
10258|  2.29k|    } else {
10259|  2.29k|	if (!xmlStrEqual(version, (const xmlChar *) XML_DEFAULT_VERSION)) {
  ------------------
  |  |   42|  2.29k|#define XML_DEFAULT_VERSION	"1.0"
  ------------------
  |  Branch (10259:6): [True: 254, False: 2.04k]
  ------------------
10260|       |	    /*
10261|       |	     * Changed here for XML-1.0 5th edition
10262|       |	     */
10263|    254|	    if (ctxt->options & XML_PARSE_OLD10) {
  ------------------
  |  Branch (10263:10): [True: 25, False: 229]
  ------------------
10264|     25|		xmlFatalErrMsgStr(ctxt, XML_ERR_UNKNOWN_VERSION,
10265|     25|			          "Unsupported version '%s'\n",
10266|     25|			          version);
10267|    229|	    } else {
10268|    229|	        if ((version[0] == '1') && ((version[1] == '.'))) {
  ------------------
  |  Branch (10268:14): [True: 199, False: 30]
  |  Branch (10268:37): [True: 199, False: 0]
  ------------------
10269|    199|		    xmlWarningMsg(ctxt, XML_WAR_UNKNOWN_VERSION,
10270|    199|		                  "Unsupported version '%s'\n",
10271|    199|				  version, NULL);
10272|    199|		} else {
10273|     30|		    xmlFatalErrMsgStr(ctxt, XML_ERR_UNKNOWN_VERSION,
10274|     30|				      "Unsupported version '%s'\n",
10275|     30|				      version);
10276|     30|		}
10277|    229|	    }
10278|    254|	}
10279|  2.29k|	if (ctxt->version != NULL)
  ------------------
  |  Branch (10279:6): [True: 0, False: 2.29k]
  ------------------
10280|      0|	    xmlFree(ctxt->version);
10281|  2.29k|	ctxt->version = version;
10282|  2.29k|    }
10283|       |
10284|       |    /*
10285|       |     * We may have the encoding declaration
10286|       |     */
10287|  3.15k|    if (!IS_BLANK_CH(RAW)) {
  ------------------
  |  |  137|  3.15k|#define IS_BLANK_CH(c)  xmlIsBlank_ch(c)
  |  |  ------------------
  |  |  |  |   90|  3.15k|#define xmlIsBlank_ch(c)	(((c) == 0x20) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (90:27): [True: 1.01k, False: 2.14k]
  |  |  |  |  ------------------
  |  |  |  |   91|  3.15k|				 ((0x9 <= (c)) && ((c) <= 0xa)) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (91:7): [True: 2.11k, False: 28]
  |  |  |  |  |  Branch (91:23): [True: 21, False: 2.09k]
  |  |  |  |  ------------------
  |  |  |  |   92|  3.15k|				 ((c) == 0xd))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (92:6): [True: 7, False: 2.11k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
10288|  2.11k|        if ((RAW == '?') && (NXT(1) == '>')) {
  ------------------
  |  | 2261|  2.11k|#define RAW (*ctxt->input->cur)
  ------------------
                      if ((RAW == '?') && (NXT(1) == '>')) {
  ------------------
  |  | 2263|  1.22k|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
  |  Branch (10288:13): [True: 1.22k, False: 884]
  |  Branch (10288:29): [True: 1.22k, False: 8]
  ------------------
10289|  1.22k|	    SKIP(2);
  ------------------
  |  | 2285|  1.22k|#define SKIP(val) do {							\
  |  | 2286|  1.22k|    ctxt->input->cur += (val),ctxt->input->col+=(val);			\
  |  | 2287|  1.22k|    if (*ctxt->input->cur == 0)						\
  |  |  ------------------
  |  |  |  Branch (2287:9): [True: 1, False: 1.21k]
  |  |  ------------------
  |  | 2288|  1.22k|        xmlParserGrow(ctxt);						\
  |  | 2289|  1.22k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2289:12): [Folded, False: 1.22k]
  |  |  ------------------
  ------------------
10290|  1.22k|	    return;
10291|  1.22k|	}
10292|    892|	xmlFatalErrMsg(ctxt, XML_ERR_SPACE_REQUIRED, "Blank needed here\n");
10293|    892|    }
10294|  1.93k|    xmlParseEncodingDecl(ctxt);
10295|       |
10296|       |    /*
10297|       |     * We may have the standalone status.
10298|       |     */
10299|  1.93k|    if ((ctxt->encoding != NULL) && (!IS_BLANK_CH(RAW))) {
  ------------------
  |  |  137|    835|#define IS_BLANK_CH(c)  xmlIsBlank_ch(c)
  |  |  ------------------
  |  |  |  |   90|    835|#define xmlIsBlank_ch(c)	(((c) == 0x20) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (90:27): [True: 39, False: 796]
  |  |  |  |  ------------------
  |  |  |  |   91|    835|				 ((0x9 <= (c)) && ((c) <= 0xa)) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (91:7): [True: 783, False: 13]
  |  |  |  |  |  Branch (91:23): [True: 16, False: 767]
  |  |  |  |  ------------------
  |  |  |  |   92|    835|				 ((c) == 0xd))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (92:6): [True: 3, False: 777]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (10299:9): [True: 835, False: 1.09k]
  ------------------
10300|    777|        if ((RAW == '?') && (NXT(1) == '>')) {
  ------------------
  |  | 2261|    777|#define RAW (*ctxt->input->cur)
  ------------------
                      if ((RAW == '?') && (NXT(1) == '>')) {
  ------------------
  |  | 2263|    723|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
  |  Branch (10300:13): [True: 723, False: 54]
  |  Branch (10300:29): [True: 703, False: 20]
  ------------------
10301|    703|	    SKIP(2);
  ------------------
  |  | 2285|    703|#define SKIP(val) do {							\
  |  | 2286|    703|    ctxt->input->cur += (val),ctxt->input->col+=(val);			\
  |  | 2287|    703|    if (*ctxt->input->cur == 0)						\
  |  |  ------------------
  |  |  |  Branch (2287:9): [True: 2, False: 701]
  |  |  ------------------
  |  | 2288|    703|        xmlParserGrow(ctxt);						\
  |  | 2289|    703|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2289:12): [Folded, False: 703]
  |  |  ------------------
  ------------------
10302|    703|	    return;
10303|    703|	}
10304|     74|	xmlFatalErrMsg(ctxt, XML_ERR_SPACE_REQUIRED, "Blank needed here\n");
10305|     74|    }
10306|       |
10307|       |    /*
10308|       |     * We can grow the input buffer freely at that point
10309|       |     */
10310|  1.22k|    GROW;
  ------------------
  |  | 2308|  1.22k|    if ((!PARSER_PROGRESSIVE(ctxt)) && \
  |  |  ------------------
  |  |  |  |   47|  1.22k|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|  1.22k|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2308:9): [True: 64, False: 1.16k]
  |  |  ------------------
  |  | 2309|  1.22k|        (ctxt->input->end - ctxt->input->cur < INPUT_CHUNK)) \
  |  |  ------------------
  |  |  |  |   63|     64|#define INPUT_CHUNK	250
  |  |  ------------------
  |  |  |  Branch (2309:9): [True: 48, False: 16]
  |  |  ------------------
  |  | 2310|  1.22k|	xmlParserGrow(ctxt);
  ------------------
10311|       |
10312|  1.22k|    SKIP_BLANKS;
  ------------------
  |  | 2312|  1.22k|#define SKIP_BLANKS xmlSkipBlankChars(ctxt)
  ------------------
10313|  1.22k|    ctxt->standalone = xmlParseSDDecl(ctxt);
10314|       |
10315|  1.22k|    SKIP_BLANKS;
  ------------------
  |  | 2312|  1.22k|#define SKIP_BLANKS xmlSkipBlankChars(ctxt)
  ------------------
10316|  1.22k|    if ((RAW == '?') && (NXT(1) == '>')) {
  ------------------
  |  | 2261|  1.22k|#define RAW (*ctxt->input->cur)
  ------------------
                  if ((RAW == '?') && (NXT(1) == '>')) {
  ------------------
  |  | 2263|    337|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
  |  Branch (10316:9): [True: 337, False: 892]
  |  Branch (10316:25): [True: 303, False: 34]
  ------------------
10317|    303|        SKIP(2);
  ------------------
  |  | 2285|    303|#define SKIP(val) do {							\
  |  | 2286|    303|    ctxt->input->cur += (val),ctxt->input->col+=(val);			\
  |  | 2287|    303|    if (*ctxt->input->cur == 0)						\
  |  |  ------------------
  |  |  |  Branch (2287:9): [True: 1, False: 302]
  |  |  ------------------
  |  | 2288|    303|        xmlParserGrow(ctxt);						\
  |  | 2289|    303|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2289:12): [Folded, False: 303]
  |  |  ------------------
  ------------------
10318|    926|    } else if (RAW == '>') {
  ------------------
  |  | 2261|    926|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (10318:16): [True: 20, False: 906]
  ------------------
10319|       |        /* Deprecated old WD ... */
10320|     20|	xmlFatalErr(ctxt, XML_ERR_XMLDECL_NOT_FINISHED, NULL);
10321|     20|	NEXT;
  ------------------
  |  | 2316|     20|#define NEXT xmlNextChar(ctxt)
  ------------------
10322|    906|    } else {
10323|    906|        int c;
10324|       |
10325|    906|	xmlFatalErr(ctxt, XML_ERR_XMLDECL_NOT_FINISHED, NULL);
10326|   146k|        while ((PARSER_STOPPED(ctxt) == 0) &&
  ------------------
  |  |   44|   146k|#define PARSER_STOPPED(ctxt) ((ctxt)->disableSAX > 1)
  ------------------
  |  Branch (10326:16): [True: 146k, False: 33]
  ------------------
10327|   146k|               ((c = CUR) != 0)) {
  ------------------
  |  | 2262|   146k|#define CUR (*ctxt->input->cur)
  ------------------
  |  Branch (10327:16): [True: 146k, False: 412]
  ------------------
10328|   146k|            NEXT;
  ------------------
  |  | 2316|   146k|#define NEXT xmlNextChar(ctxt)
  ------------------
10329|   146k|            if (c == '>')
  ------------------
  |  Branch (10329:17): [True: 461, False: 145k]
  ------------------
10330|    461|                break;
10331|   146k|        }
10332|    906|    }
10333|  1.22k|}
xmlParseMisc:
10373|  22.3k|xmlParseMisc(xmlParserCtxt *ctxt) {
10374|  24.4k|    while (PARSER_STOPPED(ctxt) == 0) {
  ------------------
  |  |   44|  24.4k|#define PARSER_STOPPED(ctxt) ((ctxt)->disableSAX > 1)
  ------------------
  |  Branch (10374:12): [True: 24.2k, False: 228]
  ------------------
10375|  24.2k|        SKIP_BLANKS;
  ------------------
  |  | 2312|  24.2k|#define SKIP_BLANKS xmlSkipBlankChars(ctxt)
  ------------------
10376|  24.2k|        GROW;
  ------------------
  |  | 2308|  24.2k|    if ((!PARSER_PROGRESSIVE(ctxt)) && \
  |  |  ------------------
  |  |  |  |   47|  24.2k|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|  24.2k|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2308:9): [True: 24.2k, False: 0]
  |  |  ------------------
  |  | 2309|  24.2k|        (ctxt->input->end - ctxt->input->cur < INPUT_CHUNK)) \
  |  |  ------------------
  |  |  |  |   63|  24.2k|#define INPUT_CHUNK	250
  |  |  ------------------
  |  |  |  Branch (2309:9): [True: 19.4k, False: 4.78k]
  |  |  ------------------
  |  | 2310|  24.2k|	xmlParserGrow(ctxt);
  ------------------
10377|  24.2k|        if ((RAW == '<') && (NXT(1) == '?')) {
  ------------------
  |  | 2261|  24.2k|#define RAW (*ctxt->input->cur)
  ------------------
                      if ((RAW == '<') && (NXT(1) == '?')) {
  ------------------
  |  | 2263|  15.2k|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
  |  Branch (10377:13): [True: 15.2k, False: 9.00k]
  |  Branch (10377:29): [True: 991, False: 14.2k]
  ------------------
10378|    991|	    xmlParsePI(ctxt);
10379|  23.2k|        } else if (CMP4(CUR_PTR, '<', '!', '-', '-')) {
  ------------------
  |  | 2268|  23.2k|  ( ((unsigned char *) s)[ 0 ] == c1 && ((unsigned char *) s)[ 1 ] == c2 && \
  |  |  ------------------
  |  |  |  Branch (2268:5): [True: 14.2k, False: 9.00k]
  |  |  |  Branch (2268:41): [True: 4.08k, False: 10.1k]
  |  |  ------------------
  |  | 2269|  23.2k|    ((unsigned char *) s)[ 2 ] == c3 && ((unsigned char *) s)[ 3 ] == c4 )
  |  |  ------------------
  |  |  |  Branch (2269:5): [True: 1.09k, False: 2.99k]
  |  |  |  Branch (2269:41): [True: 1.09k, False: 1]
  |  |  ------------------
  ------------------
10380|  1.09k|	    xmlParseComment(ctxt);
10381|  22.1k|        } else {
10382|  22.1k|            break;
10383|  22.1k|        }
10384|  24.2k|    }
10385|  22.3k|}
xmlParseDocument:
10418|  9.80k|xmlParseDocument(xmlParserCtxt *ctxt) {
10419|  9.80k|    if ((ctxt == NULL) || (ctxt->input == NULL))
  ------------------
  |  Branch (10419:9): [True: 0, False: 9.80k]
  |  Branch (10419:27): [True: 0, False: 9.80k]
  ------------------
10420|      0|        return(-1);
10421|       |
10422|  9.80k|    GROW;
  ------------------
  |  | 2308|  9.80k|    if ((!PARSER_PROGRESSIVE(ctxt)) && \
  |  |  ------------------
  |  |  |  |   47|  9.80k|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|  9.80k|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2308:9): [True: 9.80k, False: 0]
  |  |  ------------------
  |  | 2309|  9.80k|        (ctxt->input->end - ctxt->input->cur < INPUT_CHUNK)) \
  |  |  ------------------
  |  |  |  |   63|  9.80k|#define INPUT_CHUNK	250
  |  |  ------------------
  |  |  |  Branch (2309:9): [True: 7.18k, False: 2.61k]
  |  |  ------------------
  |  | 2310|  9.80k|	xmlParserGrow(ctxt);
  ------------------
10423|       |
10424|       |    /*
10425|       |     * SAX: detecting the level.
10426|       |     */
10427|  9.80k|    xmlCtxtInitializeLate(ctxt);
10428|       |
10429|  9.80k|    if ((ctxt->sax) && (ctxt->sax->setDocumentLocator)) {
  ------------------
  |  Branch (10429:9): [True: 9.80k, False: 0]
  |  Branch (10429:24): [True: 9.80k, False: 0]
  ------------------
10430|  9.80k|        ctxt->sax->setDocumentLocator(ctxt->userData,
10431|  9.80k|                (xmlSAXLocator *) &xmlDefaultSAXLocator);
10432|  9.80k|    }
10433|       |
10434|  9.80k|    xmlDetectEncoding(ctxt);
10435|       |
10436|  9.80k|    if (CUR == 0) {
  ------------------
  |  | 2262|  9.80k|#define CUR (*ctxt->input->cur)
  ------------------
  |  Branch (10436:9): [True: 3, False: 9.79k]
  ------------------
10437|      3|	xmlFatalErr(ctxt, XML_ERR_DOCUMENT_EMPTY, NULL);
10438|      3|	return(-1);
10439|      3|    }
10440|       |
10441|  9.79k|    GROW;
  ------------------
  |  | 2308|  9.79k|    if ((!PARSER_PROGRESSIVE(ctxt)) && \
  |  |  ------------------
  |  |  |  |   47|  9.79k|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|  9.79k|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2308:9): [True: 9.79k, False: 0]
  |  |  ------------------
  |  | 2309|  9.79k|        (ctxt->input->end - ctxt->input->cur < INPUT_CHUNK)) \
  |  |  ------------------
  |  |  |  |   63|  9.79k|#define INPUT_CHUNK	250
  |  |  ------------------
  |  |  |  Branch (2309:9): [True: 7.18k, False: 2.61k]
  |  |  ------------------
  |  | 2310|  9.79k|	xmlParserGrow(ctxt);
  ------------------
10442|  9.79k|    if ((CMP5(CUR_PTR, '<', '?', 'x', 'm', 'l')) && (IS_BLANK_CH(NXT(5)))) {
  ------------------
  |  | 2271|  9.79k|  ( CMP4( s, c1, c2, c3, c4 ) && ((unsigned char *) s)[ 4 ] == c5 )
  |  |  ------------------
  |  |  |  | 2268|  19.5k|  ( ((unsigned char *) s)[ 0 ] == c1 && ((unsigned char *) s)[ 1 ] == c2 && \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2268:5): [True: 9.63k, False: 168]
  |  |  |  |  |  Branch (2268:41): [True: 662, False: 8.96k]
  |  |  |  |  ------------------
  |  |  |  | 2269|  9.79k|    ((unsigned char *) s)[ 2 ] == c3 && ((unsigned char *) s)[ 3 ] == c4 )
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2269:5): [True: 381, False: 281]
  |  |  |  |  |  Branch (2269:41): [True: 196, False: 185]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2271:34): [True: 185, False: 11]
  |  |  ------------------
  ------------------
                  if ((CMP5(CUR_PTR, '<', '?', 'x', 'm', 'l')) && (IS_BLANK_CH(NXT(5)))) {
  ------------------
  |  |  137|    185|#define IS_BLANK_CH(c)  xmlIsBlank_ch(c)
  |  |  ------------------
  |  |  |  |   90|    185|#define xmlIsBlank_ch(c)	(((c) == 0x20) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (90:27): [True: 174, False: 11]
  |  |  |  |  ------------------
  |  |  |  |   91|    185|				 ((0x9 <= (c)) && ((c) <= 0xa)) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (91:7): [True: 10, False: 1]
  |  |  |  |  |  Branch (91:23): [True: 7, False: 3]
  |  |  |  |  ------------------
  |  |  |  |   92|    185|				 ((c) == 0xd))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (92:6): [True: 2, False: 2]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
10443|       |
10444|       |	/*
10445|       |	 * Note that we will switch encoding on the fly.
10446|       |	 */
10447|    183|	xmlParseXMLDecl(ctxt);
10448|    183|	SKIP_BLANKS;
  ------------------
  |  | 2312|    183|#define SKIP_BLANKS xmlSkipBlankChars(ctxt)
  ------------------
10449|  9.61k|    } else {
10450|  9.61k|	ctxt->version = xmlCharStrdup(XML_DEFAULT_VERSION);
  ------------------
  |  |   42|  9.61k|#define XML_DEFAULT_VERSION	"1.0"
  ------------------
10451|  9.61k|        if (ctxt->version == NULL) {
  ------------------
  |  Branch (10451:13): [True: 1, False: 9.61k]
  ------------------
10452|      1|            xmlErrMemory(ctxt);
10453|      1|            return(-1);
10454|      1|        }
10455|  9.61k|    }
10456|  9.79k|    if ((ctxt->sax) && (ctxt->sax->startDocument) && (!ctxt->disableSAX))
  ------------------
  |  Branch (10456:9): [True: 9.79k, False: 0]
  |  Branch (10456:24): [True: 9.79k, False: 0]
  |  Branch (10456:54): [True: 9.73k, False: 61]
  ------------------
10457|  9.73k|        ctxt->sax->startDocument(ctxt->userData);
10458|  9.79k|    if ((ctxt->myDoc != NULL) && (ctxt->input != NULL) &&
  ------------------
  |  Branch (10458:9): [True: 9.73k, False: 65]
  |  Branch (10458:34): [True: 9.73k, False: 0]
  ------------------
10459|  9.73k|        (ctxt->input->buf != NULL) && (ctxt->input->buf->compressed >= 0)) {
  ------------------
  |  Branch (10459:9): [True: 9.73k, False: 0]
  |  Branch (10459:39): [True: 0, False: 9.73k]
  ------------------
10460|      0|	ctxt->myDoc->compression = ctxt->input->buf->compressed;
10461|      0|    }
10462|       |
10463|       |    /*
10464|       |     * The Misc part of the Prolog
10465|       |     */
10466|  9.79k|    xmlParseMisc(ctxt);
10467|       |
10468|       |    /*
10469|       |     * Then possibly doc type declaration(s) and more Misc
10470|       |     * (doctypedecl Misc*)?
10471|       |     */
10472|  9.79k|    GROW;
  ------------------
  |  | 2308|  9.79k|    if ((!PARSER_PROGRESSIVE(ctxt)) && \
  |  |  ------------------
  |  |  |  |   47|  9.79k|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|  9.79k|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2308:9): [True: 9.79k, False: 0]
  |  |  ------------------
  |  | 2309|  9.79k|        (ctxt->input->end - ctxt->input->cur < INPUT_CHUNK)) \
  |  |  ------------------
  |  |  |  |   63|  9.79k|#define INPUT_CHUNK	250
  |  |  ------------------
  |  |  |  Branch (2309:9): [True: 7.21k, False: 2.58k]
  |  |  ------------------
  |  | 2310|  9.79k|	xmlParserGrow(ctxt);
  ------------------
10473|  9.79k|    if (CMP9(CUR_PTR, '<', '!', 'D', 'O', 'C', 'T', 'Y', 'P', 'E')) {
  ------------------
  |  | 2279|  9.79k|  ( CMP8( s, c1, c2, c3, c4, c5, c6, c7, c8 ) && \
  |  |  ------------------
  |  |  |  | 2277|  19.5k|  ( CMP7( s, c1, c2, c3, c4, c5, c6, c7 ) && ((unsigned char *) s)[ 7 ] == c8 )
  |  |  |  |  ------------------
  |  |  |  |  |  | 2275|  19.5k|  ( CMP6( s, c1, c2, c3, c4, c5, c6 ) && ((unsigned char *) s)[ 6 ] == c7 )
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  | 2273|  19.5k|  ( CMP5( s, c1, c2, c3, c4, c5 ) && ((unsigned char *) s)[ 5 ] == c6 )
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  | 2271|  19.5k|  ( CMP4( s, c1, c2, c3, c4 ) && ((unsigned char *) s)[ 4 ] == c5 )
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  | 2268|  19.5k|  ( ((unsigned char *) s)[ 0 ] == c1 && ((unsigned char *) s)[ 1 ] == c2 && \
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  Branch (2268:5): [True: 9.78k, False: 16]
  |  |  |  |  |  |  |  |  |  |  |  |  |  Branch (2268:41): [True: 2.93k, False: 6.84k]
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  | 2269|  9.79k|    ((unsigned char *) s)[ 2 ] == c3 && ((unsigned char *) s)[ 3 ] == c4 )
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  Branch (2269:5): [True: 2.91k, False: 15]
  |  |  |  |  |  |  |  |  |  |  |  |  |  Branch (2269:41): [True: 2.91k, False: 6]
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (2271:34): [True: 2.90k, False: 8]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (2273:38): [True: 2.89k, False: 14]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (2275:42): [True: 2.88k, False: 10]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2277:46): [True: 2.87k, False: 4]
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 2280|  9.79k|    ((unsigned char *) s)[ 8 ] == c9 )
  |  |  ------------------
  |  |  |  Branch (2280:5): [True: 2.87k, False: 3]
  |  |  ------------------
  ------------------
10474|       |
10475|  2.87k|	ctxt->inSubset = 1;
10476|  2.87k|	xmlParseDocTypeDecl(ctxt);
10477|  2.87k|	if (RAW == '[') {
  ------------------
  |  | 2261|  2.87k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (10477:6): [True: 1.24k, False: 1.62k]
  ------------------
10478|  1.24k|	    xmlParseInternalSubset(ctxt);
10479|  1.62k|	} else if (RAW == '>') {
  ------------------
  |  | 2261|  1.62k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (10479:13): [True: 1.58k, False: 45]
  ------------------
10480|  1.58k|            NEXT;
  ------------------
  |  | 2316|  1.58k|#define NEXT xmlNextChar(ctxt)
  ------------------
10481|  1.58k|        }
10482|       |
10483|       |	/*
10484|       |	 * Create and update the external subset.
10485|       |	 */
10486|  2.87k|	ctxt->inSubset = 2;
10487|  2.87k|	if ((ctxt->sax != NULL) && (ctxt->sax->externalSubset != NULL) &&
  ------------------
  |  Branch (10487:6): [True: 2.87k, False: 0]
  |  Branch (10487:29): [True: 2.87k, False: 0]
  ------------------
10488|  2.87k|	    (!ctxt->disableSAX))
  ------------------
  |  Branch (10488:6): [True: 2.76k, False: 106]
  ------------------
10489|  2.76k|	    ctxt->sax->externalSubset(ctxt->userData, ctxt->intSubName,
10490|  2.76k|	                              ctxt->extSubSystem, ctxt->extSubURI);
10491|  2.87k|	ctxt->inSubset = 0;
10492|       |
10493|  2.87k|        xmlCleanSpecialAttr(ctxt);
10494|       |
10495|  2.87k|	xmlParseMisc(ctxt);
10496|  2.87k|    }
10497|       |
10498|       |    /*
10499|       |     * Time to start parsing the tree itself
10500|       |     */
10501|  9.79k|    GROW;
  ------------------
  |  | 2308|  9.79k|    if ((!PARSER_PROGRESSIVE(ctxt)) && \
  |  |  ------------------
  |  |  |  |   47|  9.79k|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|  9.79k|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2308:9): [True: 9.79k, False: 0]
  |  |  ------------------
  |  | 2309|  9.79k|        (ctxt->input->end - ctxt->input->cur < INPUT_CHUNK)) \
  |  |  ------------------
  |  |  |  |   63|  9.79k|#define INPUT_CHUNK	250
  |  |  ------------------
  |  |  |  Branch (2309:9): [True: 7.42k, False: 2.37k]
  |  |  ------------------
  |  | 2310|  9.79k|	xmlParserGrow(ctxt);
  ------------------
10502|  9.79k|    if (RAW != '<') {
  ------------------
  |  | 2261|  9.79k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (10502:9): [True: 121, False: 9.67k]
  ------------------
10503|    121|        if (ctxt->wellFormed)
  ------------------
  |  Branch (10503:13): [True: 12, False: 109]
  ------------------
10504|     12|            xmlFatalErrMsg(ctxt, XML_ERR_DOCUMENT_EMPTY,
10505|     12|                           "Start tag expected, '<' not found\n");
10506|  9.67k|    } else {
10507|  9.67k|	xmlParseElement(ctxt);
10508|       |
10509|       |	/*
10510|       |	 * The Misc part at the end
10511|       |	 */
10512|  9.67k|	xmlParseMisc(ctxt);
10513|       |
10514|  9.67k|        xmlParserCheckEOF(ctxt, XML_ERR_DOCUMENT_END);
10515|  9.67k|    }
10516|       |
10517|  9.79k|    ctxt->instate = XML_PARSER_EOF;
10518|  9.79k|    xmlFinishDocument(ctxt);
10519|       |
10520|  9.79k|    if (! ctxt->wellFormed) {
  ------------------
  |  Branch (10520:9): [True: 1.30k, False: 8.49k]
  ------------------
10521|  1.30k|	ctxt->valid = 0;
10522|  1.30k|	return(-1);
10523|  1.30k|    }
10524|       |
10525|  8.49k|    return(0);
10526|  9.79k|}
xmlParseChunk:
11275|   425k|              int terminate) {
11276|   425k|    size_t curBase;
11277|   425k|    size_t maxLength;
11278|   425k|    size_t pos;
11279|   425k|    int end_in_lf = 0;
11280|   425k|    int res;
11281|       |
11282|   425k|    if ((ctxt == NULL) || (size < 0))
  ------------------
  |  Branch (11282:9): [True: 0, False: 425k]
  |  Branch (11282:27): [True: 0, False: 425k]
  ------------------
11283|      0|        return(XML_ERR_ARGUMENT);
11284|   425k|    if ((chunk == NULL) && (size > 0))
  ------------------
  |  Branch (11284:9): [True: 0, False: 425k]
  |  Branch (11284:28): [True: 0, False: 0]
  ------------------
11285|      0|        return(XML_ERR_ARGUMENT);
11286|   425k|    if ((ctxt->input == NULL) || (ctxt->input->buf == NULL))
  ------------------
  |  Branch (11286:9): [True: 0, False: 425k]
  |  Branch (11286:34): [True: 0, False: 425k]
  ------------------
11287|      0|        return(XML_ERR_ARGUMENT);
11288|   425k|    if (ctxt->disableSAX != 0)
  ------------------
  |  Branch (11288:9): [True: 2.73k, False: 423k]
  ------------------
11289|  2.73k|        return(ctxt->errNo);
11290|       |
11291|   423k|    ctxt->input->flags |= XML_INPUT_PROGRESSIVE;
  ------------------
  |  |   41|   423k|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  ------------------
11292|   423k|    if (ctxt->instate == XML_PARSER_START)
  ------------------
  |  Branch (11292:9): [True: 43.0k, False: 380k]
  ------------------
11293|  43.0k|        xmlCtxtInitializeLate(ctxt);
11294|   423k|    if ((size > 0) && (chunk != NULL) && (!terminate) &&
  ------------------
  |  Branch (11294:9): [True: 390k, False: 32.7k]
  |  Branch (11294:23): [True: 390k, False: 0]
  |  Branch (11294:42): [True: 390k, False: 0]
  ------------------
11295|   390k|        (chunk[size - 1] == '\r')) {
  ------------------
  |  Branch (11295:9): [True: 1.80k, False: 388k]
  ------------------
11296|  1.80k|	end_in_lf = 1;
11297|  1.80k|	size--;
11298|  1.80k|    }
11299|       |
11300|       |    /*
11301|       |     * Also push an empty chunk to make sure that the raw buffer
11302|       |     * will be flushed if there is an encoder.
11303|       |     */
11304|   423k|    pos = ctxt->input->cur - ctxt->input->base;
11305|   423k|    res = xmlParserInputBufferPush(ctxt->input->buf, size, chunk);
11306|   423k|    xmlBufUpdateInput(ctxt->input->buf->buffer, ctxt->input, pos);
11307|   423k|    if (res < 0) {
  ------------------
  |  Branch (11307:9): [True: 239, False: 422k]
  ------------------
11308|    239|        xmlCtxtErrIO(ctxt, ctxt->input->buf->error, NULL);
11309|    239|        return(ctxt->errNo);
11310|    239|    }
11311|       |
11312|   422k|    xmlParseTryOrFinish(ctxt, terminate);
11313|       |
11314|   422k|    curBase = ctxt->input->cur - ctxt->input->base;
11315|   422k|    maxLength = (ctxt->options & XML_PARSE_HUGE) ?
  ------------------
  |  Branch (11315:17): [True: 214k, False: 208k]
  ------------------
11316|   214k|                XML_MAX_HUGE_LENGTH :
  ------------------
  |  |   55|   214k|#define XML_MAX_HUGE_LENGTH 1000000000
  ------------------
11317|   422k|                XML_MAX_LOOKUP_LIMIT;
  ------------------
  |  |   81|   631k|#define XML_MAX_LOOKUP_LIMIT 10000000
  ------------------
11318|   422k|    if (curBase > maxLength) {
  ------------------
  |  Branch (11318:9): [True: 0, False: 422k]
  ------------------
11319|      0|        xmlFatalErr(ctxt, XML_ERR_RESOURCE_LIMIT,
11320|      0|                    "Buffer size limit exceeded, try XML_PARSE_HUGE\n");
11321|      0|    }
11322|       |
11323|   422k|    if ((ctxt->errNo != XML_ERR_OK) && (ctxt->disableSAX != 0))
  ------------------
  |  Branch (11323:9): [True: 81.9k, False: 341k]
  |  Branch (11323:40): [True: 12.6k, False: 69.2k]
  ------------------
11324|  12.6k|        return(ctxt->errNo);
11325|       |
11326|   410k|    if (end_in_lf == 1) {
  ------------------
  |  Branch (11326:9): [True: 1.79k, False: 408k]
  ------------------
11327|  1.79k|	pos = ctxt->input->cur - ctxt->input->base;
11328|  1.79k|	res = xmlParserInputBufferPush(ctxt->input->buf, 1, "\r");
11329|  1.79k|	xmlBufUpdateInput(ctxt->input->buf->buffer, ctxt->input, pos);
11330|  1.79k|        if (res < 0) {
  ------------------
  |  Branch (11330:13): [True: 3, False: 1.79k]
  ------------------
11331|      3|            xmlCtxtErrIO(ctxt, ctxt->input->buf->error, NULL);
11332|      3|            return(ctxt->errNo);
11333|      3|        }
11334|  1.79k|    }
11335|   410k|    if (terminate) {
  ------------------
  |  Branch (11335:9): [True: 22.4k, False: 387k]
  ------------------
11336|       |	/*
11337|       |	 * Check for termination
11338|       |	 */
11339|  22.4k|        if ((ctxt->instate != XML_PARSER_EOF) &&
  ------------------
  |  Branch (11339:13): [True: 12.2k, False: 10.1k]
  ------------------
11340|  12.2k|            (ctxt->instate != XML_PARSER_EPILOG)) {
  ------------------
  |  Branch (11340:13): [True: 5.89k, False: 6.36k]
  ------------------
11341|  5.89k|            if (ctxt->nameNr > 0) {
  ------------------
  |  Branch (11341:17): [True: 4.09k, False: 1.80k]
  ------------------
11342|  4.09k|                const xmlChar *name = ctxt->nameTab[ctxt->nameNr - 1];
11343|  4.09k|                int line = ctxt->pushTab[ctxt->nameNr - 1].line;
11344|  4.09k|                xmlFatalErrMsgStrIntStr(ctxt, XML_ERR_TAG_NOT_FINISHED,
11345|  4.09k|                        "Premature end of data in tag %s line %d\n",
11346|  4.09k|                        name, line, NULL);
11347|  4.09k|            } else if (ctxt->instate == XML_PARSER_START) {
  ------------------
  |  Branch (11347:24): [True: 29, False: 1.77k]
  ------------------
11348|     29|                xmlFatalErr(ctxt, XML_ERR_DOCUMENT_EMPTY, NULL);
11349|  1.77k|            } else {
11350|  1.77k|                xmlFatalErrMsg(ctxt, XML_ERR_DOCUMENT_EMPTY,
11351|  1.77k|                               "Start tag expected, '<' not found\n");
11352|  1.77k|            }
11353|  16.5k|        } else {
11354|  16.5k|            xmlParserCheckEOF(ctxt, XML_ERR_DOCUMENT_END);
11355|  16.5k|        }
11356|  22.4k|	if (ctxt->instate != XML_PARSER_EOF) {
  ------------------
  |  Branch (11356:6): [True: 11.9k, False: 10.4k]
  ------------------
11357|  11.9k|            ctxt->instate = XML_PARSER_EOF;
11358|  11.9k|            xmlFinishDocument(ctxt);
11359|  11.9k|	}
11360|  22.4k|    }
11361|   410k|    if (ctxt->wellFormed == 0)
  ------------------
  |  Branch (11361:9): [True: 23.0k, False: 387k]
  ------------------
11362|  23.0k|	return((xmlParserErrors) ctxt->errNo);
11363|   387k|    else
11364|   387k|        return(0);
11365|   410k|}
xmlCreatePushParserCtxt:
11396|  42.8k|                        const char *chunk, int size, const char *filename) {
11397|  42.8k|    xmlParserCtxtPtr ctxt;
11398|  42.8k|    xmlParserInputPtr input;
11399|       |
11400|  42.8k|    ctxt = xmlNewSAXParserCtxt(sax, user_data);
11401|  42.8k|    if (ctxt == NULL)
  ------------------
  |  Branch (11401:9): [True: 26, False: 42.8k]
  ------------------
11402|     26|	return(NULL);
11403|       |
11404|  42.8k|    ctxt->options &= ~XML_PARSE_NODICT;
11405|  42.8k|    ctxt->dictNames = 1;
11406|       |
11407|  42.8k|    input = xmlNewPushInput(filename, chunk, size);
11408|  42.8k|    if (input == NULL) {
  ------------------
  |  Branch (11408:9): [True: 15, False: 42.8k]
  ------------------
11409|     15|	xmlFreeParserCtxt(ctxt);
11410|     15|	return(NULL);
11411|     15|    }
11412|  42.8k|    if (xmlCtxtPushInput(ctxt, input) < 0) {
  ------------------
  |  Branch (11412:9): [True: 0, False: 42.8k]
  ------------------
11413|      0|        xmlFreeInputStream(input);
11414|      0|        xmlFreeParserCtxt(ctxt);
11415|      0|        return(NULL);
11416|      0|    }
11417|       |
11418|  42.8k|    return(ctxt);
11419|  42.8k|}
xmlStopParser:
11428|  44.8k|xmlStopParser(xmlParserCtxt *ctxt) {
11429|  44.8k|    if (ctxt == NULL)
  ------------------
  |  Branch (11429:9): [True: 0, False: 44.8k]
  ------------------
11430|      0|        return;
11431|       |
11432|       |    /* This stops the parser */
11433|  44.8k|    ctxt->disableSAX = 2;
11434|       |
11435|       |    /*
11436|       |     * xmlStopParser is often called from error handlers,
11437|       |     * so we can't raise an error here to avoid infinite
11438|       |     * loops. Just make sure that an error condition is
11439|       |     * reported.
11440|       |     */
11441|  44.8k|    if (ctxt->errNo == XML_ERR_OK) {
  ------------------
  |  Branch (11441:9): [True: 4.24k, False: 40.5k]
  ------------------
11442|  4.24k|        ctxt->errNo = XML_ERR_USER_STOP;
11443|  4.24k|        ctxt->lastError.code = XML_ERR_USER_STOP;
11444|  4.24k|        ctxt->wellFormed = 0;
11445|  4.24k|    }
11446|  44.8k|}
xmlCtxtUseOptions:
13304|  53.7k|{
13305|  53.7k|    int keepMask;
13306|       |
13307|  53.7k|#ifdef LIBXML_HTML_ENABLED
13308|  53.7k|    if ((ctxt != NULL) && (ctxt->html))
  ------------------
  |  Branch (13308:9): [True: 53.7k, False: 0]
  |  Branch (13308:27): [True: 0, False: 53.7k]
  ------------------
13309|      0|        return(htmlCtxtUseOptions(ctxt, options));
13310|  53.7k|#endif
13311|       |
13312|       |    /*
13313|       |     * For historic reasons, some options can only be enabled.
13314|       |     */
13315|  53.7k|    keepMask = XML_PARSE_NOERROR |
13316|  53.7k|               XML_PARSE_NOWARNING |
13317|  53.7k|               XML_PARSE_NONET |
13318|  53.7k|               XML_PARSE_NSCLEAN |
13319|  53.7k|               XML_PARSE_NOCDATA |
13320|  53.7k|               XML_PARSE_COMPACT |
13321|  53.7k|               XML_PARSE_OLD10 |
13322|  53.7k|               XML_PARSE_HUGE |
13323|  53.7k|               XML_PARSE_OLDSAX |
13324|  53.7k|               XML_PARSE_IGNORE_ENC |
13325|  53.7k|               XML_PARSE_BIG_LINES;
13326|       |
13327|  53.7k|    return(xmlCtxtSetOptionsInternal(ctxt, options, keepMask));
13328|  53.7k|}
parser.c:xmlParserNsLookup:
 1525|  1.69M|                  xmlParserNsBucket **bucketPtr) {
 1526|  1.69M|    xmlParserNsBucket *bucket, *tombstone;
 1527|  1.69M|    unsigned index, hashValue;
 1528|       |
 1529|  1.69M|    if (prefix->name == NULL)
  ------------------
  |  Branch (1529:9): [True: 691k, False: 1.00M]
  ------------------
 1530|   691k|        return(ctxt->nsdb->defaultNsIndex);
 1531|       |
 1532|  1.00M|    if (ctxt->nsdb->hashSize == 0)
  ------------------
  |  Branch (1532:9): [True: 32.3k, False: 968k]
  ------------------
 1533|  32.3k|        return(INT_MAX);
 1534|       |
 1535|   968k|    hashValue = prefix->hashValue;
 1536|   968k|    index = hashValue & (ctxt->nsdb->hashSize - 1);
 1537|   968k|    bucket = &ctxt->nsdb->hash[index];
 1538|   968k|    tombstone = NULL;
 1539|       |
 1540|  1.53M|    while (bucket->hashValue) {
  ------------------
  |  Branch (1540:12): [True: 1.33M, False: 191k]
  ------------------
 1541|  1.33M|        if (bucket->index == INT_MAX) {
  ------------------
  |  Branch (1541:13): [True: 116k, False: 1.22M]
  ------------------
 1542|   116k|            if (tombstone == NULL)
  ------------------
  |  Branch (1542:17): [True: 96.3k, False: 20.0k]
  ------------------
 1543|  96.3k|                tombstone = bucket;
 1544|  1.22M|        } else if (bucket->hashValue == hashValue) {
  ------------------
  |  Branch (1544:20): [True: 776k, False: 447k]
  ------------------
 1545|   776k|            if (ctxt->nsTab[bucket->index * 2] == prefix->name) {
  ------------------
  |  Branch (1545:17): [True: 776k, False: 0]
  ------------------
 1546|   776k|                if (bucketPtr != NULL)
  ------------------
  |  Branch (1546:21): [True: 429k, False: 346k]
  ------------------
 1547|   429k|                    *bucketPtr = bucket;
 1548|   776k|                return(bucket->index);
 1549|   776k|            }
 1550|   776k|        }
 1551|       |
 1552|   563k|        index++;
 1553|   563k|        bucket++;
 1554|   563k|        if (index == ctxt->nsdb->hashSize) {
  ------------------
  |  Branch (1554:13): [True: 127k, False: 436k]
  ------------------
 1555|   127k|            index = 0;
 1556|   127k|            bucket = ctxt->nsdb->hash;
 1557|   127k|        }
 1558|   563k|    }
 1559|       |
 1560|   191k|    if (bucketPtr != NULL)
  ------------------
  |  Branch (1560:9): [True: 67.0k, False: 124k]
  ------------------
 1561|  67.0k|        *bucketPtr = tombstone ? tombstone : bucket;
  ------------------
  |  Branch (1561:22): [True: 63.1k, False: 3.90k]
  ------------------
 1562|       |    return(INT_MAX);
 1563|   968k|}
parser.c:xmlFatalErrMsg:
  259|  26.2M|{
  260|  26.2M|    xmlCtxtErr(ctxt, NULL, XML_FROM_PARSER, error, XML_ERR_FATAL,
  261|  26.2M|               NULL, NULL, NULL, 0, "%s", msg);
  262|  26.2M|}
parser.c:xmlErrMemory:
  224|    466|xmlErrMemory(xmlParserCtxtPtr ctxt) {
  225|    466|    xmlCtxtErrMemory(ctxt);
  226|    466|}
parser.c:xmlFatalErrMsgInt:
  313|  7.28M|{
  314|  7.28M|    xmlCtxtErr(ctxt, NULL, XML_FROM_PARSER, error, XML_ERR_FATAL,
  315|  7.28M|               NULL, NULL, NULL, val, msg, val);
  316|  7.28M|}
parser.c:xmlIsNameChar:
 3068|  28.5M|xmlIsNameChar(int c, int old10) {
 3069|  28.5M|    if (!old10)
  ------------------
  |  Branch (3069:9): [True: 19.2M, False: 9.32M]
  ------------------
 3070|  19.2M|        return(xmlIsNameCharNew(c));
 3071|  9.32M|    else
 3072|  9.32M|        return(xmlIsNameCharOld(c));
 3073|  28.5M|}
parser.c:xmlIsNameCharNew:
 3010|  19.2M|xmlIsNameCharNew(int c) {
 3011|       |    /*
 3012|       |     * Use the new checks of production [4] [4a] amd [5] of the
 3013|       |     * Update 5 of XML-1.0
 3014|       |     */
 3015|  19.2M|    if ((c != ' ') && (c != '>') && (c != '/') && /* accelerators */
  ------------------
  |  Branch (3015:9): [True: 19.1M, False: 71.0k]
  |  Branch (3015:23): [True: 19.1M, False: 21.2k]
  |  Branch (3015:37): [True: 19.1M, False: 10.9k]
  ------------------
 3016|  19.1M|        (((c >= 'a') && (c <= 'z')) ||
  ------------------
  |  Branch (3016:11): [True: 11.3M, False: 7.76M]
  |  Branch (3016:25): [True: 1.69M, False: 9.65M]
  ------------------
 3017|  17.4M|         ((c >= 'A') && (c <= 'Z')) ||
  ------------------
  |  Branch (3017:11): [True: 14.6M, False: 2.79M]
  |  Branch (3017:25): [True: 4.93M, False: 9.68M]
  ------------------
 3018|  12.4M|         ((c >= '0') && (c <= '9')) || /* !start */
  ------------------
  |  Branch (3018:11): [True: 12.2M, False: 210k]
  |  Branch (3018:25): [True: 1.07M, False: 11.2M]
  ------------------
 3019|  11.4M|         (c == '_') || (c == ':') ||
  ------------------
  |  Branch (3019:10): [True: 18.4k, False: 11.3M]
  |  Branch (3019:24): [True: 17.1k, False: 11.3M]
  ------------------
 3020|  11.3M|         (c == '-') || (c == '.') || (c == 0xB7) || /* !start */
  ------------------
  |  Branch (3020:10): [True: 67.4k, False: 11.3M]
  |  Branch (3020:24): [True: 23.6k, False: 11.2M]
  |  Branch (3020:38): [True: 353, False: 11.2M]
  ------------------
 3021|  11.2M|         ((c >= 0xC0) && (c <= 0xD6)) ||
  ------------------
  |  Branch (3021:11): [True: 9.64M, False: 1.63M]
  |  Branch (3021:26): [True: 124k, False: 9.52M]
  ------------------
 3022|  11.1M|         ((c >= 0xD8) && (c <= 0xF6)) ||
  ------------------
  |  Branch (3022:11): [True: 9.52M, False: 1.63M]
  |  Branch (3022:26): [True: 6.06k, False: 9.51M]
  ------------------
 3023|  11.1M|         ((c >= 0xF8) && (c <= 0x2FF)) ||
  ------------------
  |  Branch (3023:11): [True: 9.51M, False: 1.63M]
  |  Branch (3023:26): [True: 8.64k, False: 9.50M]
  ------------------
 3024|  11.1M|         ((c >= 0x300) && (c <= 0x36F)) || /* !start */
  ------------------
  |  Branch (3024:11): [True: 9.50M, False: 1.63M]
  |  Branch (3024:27): [True: 3.44k, False: 9.50M]
  ------------------
 3025|  11.1M|         ((c >= 0x370) && (c <= 0x37D)) ||
  ------------------
  |  Branch (3025:11): [True: 9.50M, False: 1.63M]
  |  Branch (3025:27): [True: 339, False: 9.50M]
  ------------------
 3026|  11.1M|         ((c >= 0x37F) && (c <= 0x1FFF)) ||
  ------------------
  |  Branch (3026:11): [True: 9.50M, False: 1.63M]
  |  Branch (3026:27): [True: 5.21M, False: 4.29M]
  ------------------
 3027|  5.93M|         ((c >= 0x200C) && (c <= 0x200D)) ||
  ------------------
  |  Branch (3027:11): [True: 4.29M, False: 1.63M]
  |  Branch (3027:28): [True: 244, False: 4.29M]
  ------------------
 3028|  5.93M|         ((c >= 0x203F) && (c <= 0x2040)) || /* !start */
  ------------------
  |  Branch (3028:11): [True: 4.29M, False: 1.63M]
  |  Branch (3028:28): [True: 204, False: 4.29M]
  ------------------
 3029|  5.93M|         ((c >= 0x2070) && (c <= 0x218F)) ||
  ------------------
  |  Branch (3029:11): [True: 4.29M, False: 1.63M]
  |  Branch (3029:28): [True: 2.15k, False: 4.28M]
  ------------------
 3030|  5.92M|         ((c >= 0x2C00) && (c <= 0x2FEF)) ||
  ------------------
  |  Branch (3030:11): [True: 4.28M, False: 1.64M]
  |  Branch (3030:28): [True: 2.70k, False: 4.28M]
  ------------------
 3031|  5.92M|         ((c >= 0x3001) && (c <= 0xD7FF)) ||
  ------------------
  |  Branch (3031:11): [True: 4.28M, False: 1.64M]
  |  Branch (3031:28): [True: 45.0k, False: 4.24M]
  ------------------
 3032|  5.88M|         ((c >= 0xF900) && (c <= 0xFDCF)) ||
  ------------------
  |  Branch (3032:11): [True: 4.24M, False: 1.64M]
  |  Branch (3032:28): [True: 350, False: 4.23M]
  ------------------
 3033|  5.87M|         ((c >= 0xFDF0) && (c <= 0xFFFD)) ||
  ------------------
  |  Branch (3033:11): [True: 4.23M, False: 1.64M]
  |  Branch (3033:28): [True: 4.21M, False: 25.3k]
  ------------------
 3034|  1.66M|         ((c >= 0x10000) && (c <= 0xEFFFF))))
  ------------------
  |  Branch (3034:11): [True: 25.2k, False: 1.64M]
  |  Branch (3034:29): [True: 4.48k, False: 20.7k]
  ------------------
 3035|  17.4M|         return(1);
 3036|  1.76M|    return(0);
 3037|  19.2M|}
parser.c:xmlIsNameCharOld:
 3048|  9.32M|xmlIsNameCharOld(int c) {
 3049|  9.32M|    if ((c != ' ') && (c != '>') && (c != '/') && /* accelerators */
  ------------------
  |  Branch (3049:9): [True: 9.31M, False: 4.78k]
  |  Branch (3049:23): [True: 9.31M, False: 1.68k]
  |  Branch (3049:37): [True: 9.31M, False: 466]
  ------------------
 3050|  9.31M|        ((IS_LETTER(c)) || (IS_DIGIT(c)) ||
  ------------------
  |  |  208|  9.31M|#define IS_LETTER(c) (IS_BASECHAR(c) || IS_IDEOGRAPHIC(c))
  |  |  ------------------
  |  |  |  |  145|  9.31M|#define IS_BASECHAR(c) xmlIsBaseCharQ(c)
  |  |  |  |  ------------------
  |  |  |  |  |  |   81|  18.6M|#define xmlIsBaseCharQ(c)	(((c) < 0x100) ? \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (81:27): [True: 7.77M, False: 1.54M]
  |  |  |  |  |  |  |  Branch (81:28): [True: 3.76M, False: 5.55M]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   82|  18.6M|				 xmlIsBaseChar_ch((c)) : \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|  3.76M|#define xmlIsBaseChar_ch(c)	(((0x41 <= (c)) && ((c) <= 0x5a)) || \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (70:31): [True: 2.23M, False: 1.52M]
  |  |  |  |  |  |  |  |  |  Branch (70:48): [True: 197k, False: 2.04M]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   71|  3.76M|				 ((0x61 <= (c)) && ((c) <= 0x7a)) || \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (71:7): [True: 2.03M, False: 1.52M]
  |  |  |  |  |  |  |  |  |  Branch (71:24): [True: 1.12M, False: 916k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   72|  3.76M|				 ((0xc0 <= (c)) && ((c) <= 0xd6)) || \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (72:7): [True: 913k, False: 1.52M]
  |  |  |  |  |  |  |  |  |  Branch (72:24): [True: 904k, False: 9.58k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   73|  3.76M|				 ((0xd8 <= (c)) && ((c) <= 0xf6)) || \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (73:7): [True: 9.57k, False: 1.52M]
  |  |  |  |  |  |  |  |  |  Branch (73:24): [True: 3.22k, False: 6.35k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   74|  3.76M|				  (0xf8 <= (c)))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (74:7): [True: 6.35k, False: 1.52M]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   83|  18.6M|				 xmlCharInRange((c), &xmlIsBaseCharGroup))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define IS_LETTER(c) (IS_BASECHAR(c) || IS_IDEOGRAPHIC(c))
  |  |  ------------------
  |  |  |  |  200|  1.54M|#define IS_IDEOGRAPHIC(c) xmlIsIdeographicQ(c)
  |  |  |  |  ------------------
  |  |  |  |  |  |  169|  1.54M|#define xmlIsIdeographicQ(c)	(((c) < 0x100) ? \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (169:30): [True: 1.35k, False: 1.54M]
  |  |  |  |  |  |  |  Branch (169:31): [True: 1.52M, False: 12.2k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  170|  1.54M|				 0 :\
  |  |  |  |  |  |  171|  1.54M|				(((0x4e00 <= (c)) && ((c) <= 0x9fa5)) || \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (171:7): [True: 9.15k, False: 3.07k]
  |  |  |  |  |  |  |  Branch (171:26): [True: 715, False: 8.44k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  172|  12.2k|				 ((c) == 0x3007) || \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (172:6): [True: 202, False: 11.3k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  173|  12.2k|				 ((0x3021 <= (c)) && ((c) <= 0x3029))))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (173:7): [True: 8.97k, False: 2.34k]
  |  |  |  |  |  |  |  Branch (173:26): [True: 441, False: 8.53k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                      ((IS_LETTER(c)) || (IS_DIGIT(c)) ||
  ------------------
  |  |  153|  1.54M|#define IS_DIGIT(c) xmlIsDigitQ(c)
  |  |  ------------------
  |  |  |  |  144|  1.54M|#define xmlIsDigitQ(c)		(((c) < 0x100) ? \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (144:26): [True: 1.52M, False: 10.8k]
  |  |  |  |  ------------------
  |  |  |  |  145|  1.54M|				 xmlIsDigit_ch((c)) : \
  |  |  |  |  ------------------
  |  |  |  |  |  |  137|  1.52M|#define xmlIsDigit_ch(c)	(((0x30 <= (c)) && ((c) <= 0x39)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (137:28): [True: 1.50M, False: 26.3k]
  |  |  |  |  |  |  |  Branch (137:45): [True: 291k, False: 1.21M]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  146|  1.54M|				 xmlCharInRange((c), &xmlIsDigitGroup))
  |  |  ------------------
  ------------------
  |  Branch (3050:28): [True: 291k, False: 1.24M]
  ------------------
 3051|  1.24M|         (c == '.') || (c == '-') ||
  ------------------
  |  Branch (3051:10): [True: 1.03k, False: 1.24M]
  |  Branch (3051:24): [True: 3.20k, False: 1.24M]
  ------------------
 3052|  1.24M|         (c == '_') || (c == ':') ||
  ------------------
  |  Branch (3052:10): [True: 4.31k, False: 1.23M]
  |  Branch (3052:24): [True: 6.29k, False: 1.23M]
  ------------------
 3053|  1.23M|         (IS_COMBINING(c)) ||
  ------------------
  |  |  168|  1.23M|#define IS_COMBINING(c) xmlIsCombiningQ(c)
  |  |  ------------------
  |  |  |  |  128|  1.23M|#define xmlIsCombiningQ(c)	(((c) < 0x100) ? \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (128:29): [True: 1.22M, False: 10.3k]
  |  |  |  |  ------------------
  |  |  |  |  129|  1.23M|				 0 : \
  |  |  |  |  130|  1.23M|				 xmlCharInRange((c), &xmlIsCombiningGroup))
  |  |  ------------------
  ------------------
  |  Branch (3053:10): [True: 1.07k, False: 1.23M]
  ------------------
 3054|  1.23M|         (IS_EXTENDER(c))))
  ------------------
  |  |  185|  1.23M|#define IS_EXTENDER(c) xmlIsExtenderQ(c)
  |  |  ------------------
  |  |  |  |  160|  1.23M|#define xmlIsExtenderQ(c)	(((c) < 0x100) ? \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (160:28): [True: 1.22M, False: 9.32k]
  |  |  |  |  ------------------
  |  |  |  |  161|  1.23M|				 xmlIsExtender_ch((c)) : \
  |  |  |  |  ------------------
  |  |  |  |  |  |  153|  1.22M|#define xmlIsExtender_ch(c)	(((c) == 0xb7))
  |  |  |  |  ------------------
  |  |  |  |  162|  1.23M|				 xmlCharInRange((c), &xmlIsExtenderGroup))
  |  |  ------------------
  ------------------
  |  Branch (3054:10): [True: 977, False: 1.23M]
  ------------------
 3055|  8.08M|        return(1);
 3056|  1.23M|    return(0);
 3057|  9.32M|}
parser.c:xmlIsNameStartChar:
 3060|  3.26M|xmlIsNameStartChar(int c, int old10) {
 3061|  3.26M|    if (!old10)
  ------------------
  |  Branch (3061:9): [True: 1.94M, False: 1.32M]
  ------------------
 3062|  1.94M|        return(xmlIsNameStartCharNew(c));
 3063|  1.32M|    else
 3064|  1.32M|        return(xmlIsNameStartCharOld(c));
 3065|  3.26M|}
parser.c:xmlIsNameStartCharNew:
 2984|  1.94M|xmlIsNameStartCharNew(int c) {
 2985|       |    /*
 2986|       |     * Use the new checks of production [4] [4a] amd [5] of the
 2987|       |     * Update 5 of XML-1.0
 2988|       |     */
 2989|  1.94M|    if ((c != ' ') && (c != '>') && (c != '/') && /* accelerators */
  ------------------
  |  Branch (2989:9): [True: 1.94M, False: 2.57k]
  |  Branch (2989:23): [True: 1.93M, False: 3.65k]
  |  Branch (2989:37): [True: 1.93M, False: 2.82k]
  ------------------
 2990|  1.93M|        (((c >= 'a') && (c <= 'z')) ||
  ------------------
  |  Branch (2990:11): [True: 1.69M, False: 235k]
  |  Branch (2990:25): [True: 1.65M, False: 39.1k]
  ------------------
 2991|   275k|         ((c >= 'A') && (c <= 'Z')) ||
  ------------------
  |  Branch (2991:11): [True: 106k, False: 168k]
  |  Branch (2991:25): [True: 57.6k, False: 48.7k]
  ------------------
 2992|   217k|         (c == '_') || (c == ':') ||
  ------------------
  |  Branch (2992:10): [True: 6.19k, False: 211k]
  |  Branch (2992:24): [True: 4.17k, False: 207k]
  ------------------
 2993|   207k|         ((c >= 0xC0) && (c <= 0xD6)) ||
  ------------------
  |  Branch (2993:11): [True: 35.6k, False: 171k]
  |  Branch (2993:26): [True: 478, False: 35.1k]
  ------------------
 2994|   206k|         ((c >= 0xD8) && (c <= 0xF6)) ||
  ------------------
  |  Branch (2994:11): [True: 35.1k, False: 171k]
  |  Branch (2994:26): [True: 857, False: 34.3k]
  ------------------
 2995|   205k|         ((c >= 0xF8) && (c <= 0x2FF)) ||
  ------------------
  |  Branch (2995:11): [True: 34.3k, False: 171k]
  |  Branch (2995:26): [True: 1.72k, False: 32.5k]
  ------------------
 2996|   204k|         ((c >= 0x370) && (c <= 0x37D)) ||
  ------------------
  |  Branch (2996:11): [True: 32.5k, False: 171k]
  |  Branch (2996:27): [True: 231, False: 32.3k]
  ------------------
 2997|   203k|         ((c >= 0x37F) && (c <= 0x1FFF)) ||
  ------------------
  |  Branch (2997:11): [True: 32.3k, False: 171k]
  |  Branch (2997:27): [True: 3.06k, False: 29.2k]
  ------------------
 2998|   200k|         ((c >= 0x200C) && (c <= 0x200D)) ||
  ------------------
  |  Branch (2998:11): [True: 29.2k, False: 171k]
  |  Branch (2998:28): [True: 290, False: 28.9k]
  ------------------
 2999|   200k|         ((c >= 0x2070) && (c <= 0x218F)) ||
  ------------------
  |  Branch (2999:11): [True: 28.9k, False: 171k]
  |  Branch (2999:28): [True: 360, False: 28.5k]
  ------------------
 3000|   200k|         ((c >= 0x2C00) && (c <= 0x2FEF)) ||
  ------------------
  |  Branch (3000:11): [True: 28.5k, False: 171k]
  |  Branch (3000:28): [True: 298, False: 28.2k]
  ------------------
 3001|   199k|         ((c >= 0x3001) && (c <= 0xD7FF)) ||
  ------------------
  |  Branch (3001:11): [True: 28.2k, False: 171k]
  |  Branch (3001:28): [True: 2.55k, False: 25.6k]
  ------------------
 3002|   197k|         ((c >= 0xF900) && (c <= 0xFDCF)) ||
  ------------------
  |  Branch (3002:11): [True: 25.6k, False: 171k]
  |  Branch (3002:28): [True: 281, False: 25.3k]
  ------------------
 3003|   197k|         ((c >= 0xFDF0) && (c <= 0xFFFD)) ||
  ------------------
  |  Branch (3003:11): [True: 25.3k, False: 171k]
  |  Branch (3003:28): [True: 7.77k, False: 17.5k]
  ------------------
 3004|   189k|         ((c >= 0x10000) && (c <= 0xEFFFF))))
  ------------------
  |  Branch (3004:11): [True: 17.5k, False: 171k]
  |  Branch (3004:29): [True: 2.27k, False: 15.3k]
  ------------------
 3005|  1.74M|        return(1);
 3006|   196k|    return(0);
 3007|  1.94M|}
parser.c:xmlIsNameStartCharOld:
 3040|  1.32M|xmlIsNameStartCharOld(int c) {
 3041|  1.32M|    if ((c != ' ') && (c != '>') && (c != '/') && /* accelerators */
  ------------------
  |  Branch (3041:9): [True: 1.32M, False: 2.32k]
  |  Branch (3041:23): [True: 1.31M, False: 2.73k]
  |  Branch (3041:37): [True: 1.31M, False: 2.48k]
  ------------------
 3042|  1.31M|        ((IS_LETTER(c) || (c == '_') || (c == ':'))))
  ------------------
  |  |  208|  2.63M|#define IS_LETTER(c) (IS_BASECHAR(c) || IS_IDEOGRAPHIC(c))
  |  |  ------------------
  |  |  |  |  145|  1.31M|#define IS_BASECHAR(c) xmlIsBaseCharQ(c)
  |  |  |  |  ------------------
  |  |  |  |  |  |   81|  2.63M|#define xmlIsBaseCharQ(c)	(((c) < 0x100) ? \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (81:27): [True: 1.22M, False: 92.5k]
  |  |  |  |  |  |  |  Branch (81:28): [True: 1.30M, False: 13.2k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   82|  2.63M|				 xmlIsBaseChar_ch((c)) : \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|  1.30M|#define xmlIsBaseChar_ch(c)	(((0x41 <= (c)) && ((c) <= 0x5a)) || \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (70:31): [True: 1.22M, False: 77.2k]
  |  |  |  |  |  |  |  |  |  Branch (70:48): [True: 9.84k, False: 1.21M]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   71|  1.30M|				 ((0x61 <= (c)) && ((c) <= 0x7a)) || \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (71:7): [True: 1.21M, False: 78.9k]
  |  |  |  |  |  |  |  |  |  Branch (71:24): [True: 1.21M, False: 3.25k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   72|  1.30M|				 ((0xc0 <= (c)) && ((c) <= 0xd6)) || \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (72:7): [True: 1.53k, False: 80.6k]
  |  |  |  |  |  |  |  |  |  Branch (72:24): [True: 382, False: 1.15k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   73|  1.30M|				 ((0xd8 <= (c)) && ((c) <= 0xf6)) || \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (73:7): [True: 1.15k, False: 80.6k]
  |  |  |  |  |  |  |  |  |  Branch (73:24): [True: 726, False: 427]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   74|  1.30M|				  (0xf8 <= (c)))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (74:7): [True: 426, False: 80.6k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   83|  2.63M|				 xmlCharInRange((c), &xmlIsBaseCharGroup))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define IS_LETTER(c) (IS_BASECHAR(c) || IS_IDEOGRAPHIC(c))
  |  |  ------------------
  |  |  |  |  200|  92.5k|#define IS_IDEOGRAPHIC(c) xmlIsIdeographicQ(c)
  |  |  |  |  ------------------
  |  |  |  |  |  |  169|  92.5k|#define xmlIsIdeographicQ(c)	(((c) < 0x100) ? \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (169:30): [True: 1.27k, False: 91.2k]
  |  |  |  |  |  |  |  Branch (169:31): [True: 80.6k, False: 11.9k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  170|  92.5k|				 0 :\
  |  |  |  |  |  |  171|  92.5k|				(((0x4e00 <= (c)) && ((c) <= 0x9fa5)) || \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (171:7): [True: 10.5k, False: 1.39k]
  |  |  |  |  |  |  |  Branch (171:26): [True: 666, False: 9.85k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  172|  11.9k|				 ((c) == 0x3007) || \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (172:6): [True: 200, False: 11.0k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  173|  11.9k|				 ((0x3021 <= (c)) && ((c) <= 0x3029))))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (173:7): [True: 10.2k, False: 765]
  |  |  |  |  |  |  |  Branch (173:26): [True: 411, False: 9.87k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (3042:27): [True: 366, False: 90.8k]
  |  Branch (3042:41): [True: 3.07k, False: 87.8k]
  ------------------
 3043|  1.22M|        return(1);
 3044|  95.3k|    return(0);
 3045|  1.32M|}
parser.c:xmlParseNameComplex:
 3123|   259k|xmlParseNameComplex(xmlParserCtxtPtr ctxt) {
 3124|   259k|    const xmlChar *ret;
 3125|   259k|    int len = 0, l;
 3126|   259k|    int c;
 3127|   259k|    int maxLength = (ctxt->options & XML_PARSE_HUGE) ?
  ------------------
  |  Branch (3127:21): [True: 97.3k, False: 161k]
  ------------------
 3128|  97.3k|                    XML_MAX_TEXT_LENGTH :
  ------------------
  |  |   50|  97.3k|#define XML_MAX_TEXT_LENGTH 10000000
  ------------------
 3129|   259k|                    XML_MAX_NAME_LENGTH;
  ------------------
  |  |   65|   161k|#define XML_MAX_NAME_LENGTH 50000
  ------------------
 3130|   259k|    int old10 = (ctxt->options & XML_PARSE_OLD10) ? 1 : 0;
  ------------------
  |  Branch (3130:17): [True: 75.1k, False: 183k]
  ------------------
 3131|       |
 3132|       |    /*
 3133|       |     * Handler for more complex cases
 3134|       |     */
 3135|   259k|    c = xmlCurrentChar(ctxt, &l);
 3136|   259k|    if (!xmlIsNameStartChar(c, old10))
  ------------------
  |  Branch (3136:9): [True: 189k, False: 69.3k]
  ------------------
 3137|   189k|        return(NULL);
 3138|  69.3k|    len += l;
 3139|  69.3k|    NEXTL(l);
  ------------------
  |  | 2325|  69.3k|#define NEXTL(l) do {							\
  |  | 2326|  69.3k|    if (*(ctxt->input->cur) == '\n') {					\
  |  |  ------------------
  |  |  |  Branch (2326:9): [True: 0, False: 69.3k]
  |  |  ------------------
  |  | 2327|      0|	ctxt->input->line++; ctxt->input->col = 1;			\
  |  | 2328|  69.3k|    } else ctxt->input->col++;						\
  |  | 2329|  69.3k|    ctxt->input->cur += l;				\
  |  | 2330|  69.3k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2330:12): [Folded, False: 69.3k]
  |  |  ------------------
  ------------------
 3140|  69.3k|    c = xmlCurrentChar(ctxt, &l);
 3141|  6.15M|    while (xmlIsNameChar(c, old10)) {
  ------------------
  |  Branch (3141:12): [True: 6.08M, False: 69.3k]
  ------------------
 3142|  6.08M|        if (len <= INT_MAX - l)
  ------------------
  |  Branch (3142:13): [True: 6.08M, False: 0]
  ------------------
 3143|  6.08M|            len += l;
 3144|  6.08M|        NEXTL(l);
  ------------------
  |  | 2325|  6.08M|#define NEXTL(l) do {							\
  |  | 2326|  6.08M|    if (*(ctxt->input->cur) == '\n') {					\
  |  |  ------------------
  |  |  |  Branch (2326:9): [True: 0, False: 6.08M]
  |  |  ------------------
  |  | 2327|      0|	ctxt->input->line++; ctxt->input->col = 1;			\
  |  | 2328|  6.08M|    } else ctxt->input->col++;						\
  |  | 2329|  6.08M|    ctxt->input->cur += l;				\
  |  | 2330|  6.08M|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2330:12): [Folded, False: 6.08M]
  |  |  ------------------
  ------------------
 3145|  6.08M|        c = xmlCurrentChar(ctxt, &l);
 3146|  6.08M|    }
 3147|  69.3k|    if (len > maxLength) {
  ------------------
  |  Branch (3147:9): [True: 66, False: 69.3k]
  ------------------
 3148|     66|        xmlFatalErr(ctxt, XML_ERR_NAME_TOO_LONG, "Name");
 3149|     66|        return(NULL);
 3150|     66|    }
 3151|  69.3k|    if (ctxt->input->cur - ctxt->input->base < len) {
  ------------------
  |  Branch (3151:9): [True: 0, False: 69.3k]
  ------------------
 3152|       |        /*
 3153|       |         * There were a couple of bugs where PERefs lead to to a change
 3154|       |         * of the buffer. Check the buffer size to avoid passing an invalid
 3155|       |         * pointer to xmlDictLookup.
 3156|       |         */
 3157|      0|        xmlFatalErr(ctxt, XML_ERR_INTERNAL_ERROR,
 3158|      0|                    "unexpected change of input buffer");
 3159|      0|        return (NULL);
 3160|      0|    }
 3161|  69.3k|    if ((*ctxt->input->cur == '\n') && (ctxt->input->cur[-1] == '\r'))
  ------------------
  |  Branch (3161:9): [True: 710, False: 68.5k]
  |  Branch (3161:40): [True: 270, False: 440]
  ------------------
 3162|    270|        ret = xmlDictLookup(ctxt->dict, ctxt->input->cur - (len + 1), len);
 3163|  69.0k|    else
 3164|  69.0k|        ret = xmlDictLookup(ctxt->dict, ctxt->input->cur - len, len);
 3165|  69.3k|    if (ret == NULL)
  ------------------
  |  Branch (3165:9): [True: 3, False: 69.3k]
  ------------------
 3166|      3|        xmlErrMemory(ctxt);
 3167|  69.3k|    return(ret);
 3168|  69.3k|}
parser.c:xmlSBufInit:
  683|   551k|xmlSBufInit(xmlSBuf *buf, unsigned max) {
  684|       |    buf->mem = NULL;
  685|   551k|    buf->size = 0;
  686|   551k|    buf->cap = 0;
  687|   551k|    buf->max = max;
  688|   551k|    buf->code = XML_ERR_OK;
  689|   551k|}
parser.c:xmlExpandPEsInEntityValue:
 3498|   339k|                          const xmlChar *str, int length, int depth) {
 3499|   339k|    int maxDepth = (ctxt->options & XML_PARSE_HUGE) ? 40 : 20;
  ------------------
  |  Branch (3499:20): [True: 89.5k, False: 249k]
  ------------------
 3500|   339k|    const xmlChar *end, *chunk;
 3501|   339k|    int c, l;
 3502|       |
 3503|   339k|    if (str == NULL)
  ------------------
  |  Branch (3503:9): [True: 192k, False: 147k]
  ------------------
 3504|   192k|        return;
 3505|       |
 3506|   147k|    depth += 1;
 3507|   147k|    if (depth > maxDepth) {
  ------------------
  |  Branch (3507:9): [True: 0, False: 147k]
  ------------------
 3508|      0|	xmlFatalErrMsg(ctxt, XML_ERR_RESOURCE_LIMIT,
 3509|      0|                       "Maximum entity nesting depth exceeded");
 3510|      0|	return;
 3511|      0|    }
 3512|       |
 3513|   147k|    end = str + length;
 3514|   147k|    chunk = str;
 3515|       |
 3516|   123M|    while ((str < end) && (!PARSER_STOPPED(ctxt))) {
  ------------------
  |  |   44|   123M|#define PARSER_STOPPED(ctxt) ((ctxt)->disableSAX > 1)
  ------------------
  |  Branch (3516:12): [True: 123M, False: 58.1k]
  |  Branch (3516:27): [True: 123M, False: 89]
  ------------------
 3517|   123M|        c = *str;
 3518|       |
 3519|   123M|        if (c >= 0x80) {
  ------------------
  |  Branch (3519:13): [True: 61.9M, False: 61.1M]
  ------------------
 3520|  61.9M|            l = xmlUTF8MultibyteLen(ctxt, str,
 3521|  61.9M|                    "invalid character in entity value\n");
 3522|  61.9M|            if (l == 0) {
  ------------------
  |  Branch (3522:17): [True: 22.3M, False: 39.6M]
  ------------------
 3523|  22.3M|                if (chunk < str)
  ------------------
  |  Branch (3523:21): [True: 150k, False: 22.1M]
  ------------------
 3524|   150k|                    xmlSBufAddString(buf, chunk, str - chunk);
 3525|  22.3M|                xmlSBufAddReplChar(buf);
 3526|  22.3M|                str += 1;
 3527|  22.3M|                chunk = str;
 3528|  39.6M|            } else {
 3529|  39.6M|                str += l;
 3530|  39.6M|            }
 3531|  61.9M|        } else if (c == '&') {
  ------------------
  |  Branch (3531:20): [True: 112k, False: 61.0M]
  ------------------
 3532|   112k|            if (str[1] == '#') {
  ------------------
  |  Branch (3532:17): [True: 22.2k, False: 90.3k]
  ------------------
 3533|  22.2k|                if (chunk < str)
  ------------------
  |  Branch (3533:21): [True: 17.3k, False: 4.82k]
  ------------------
 3534|  17.3k|                    xmlSBufAddString(buf, chunk, str - chunk);
 3535|       |
 3536|  22.2k|                c = xmlParseStringCharRef(ctxt, &str);
 3537|  22.2k|                if (c == 0)
  ------------------
  |  Branch (3537:21): [True: 3.40k, False: 18.8k]
  ------------------
 3538|  3.40k|                    return;
 3539|       |
 3540|  18.8k|                xmlSBufAddChar(buf, c);
 3541|       |
 3542|  18.8k|                chunk = str;
 3543|  90.3k|            } else {
 3544|  90.3k|                xmlChar *name;
 3545|       |
 3546|       |                /*
 3547|       |                 * General entity references are checked for
 3548|       |                 * syntactic validity.
 3549|       |                 */
 3550|  90.3k|                str++;
 3551|  90.3k|                name = xmlParseStringName(ctxt, &str);
 3552|       |
 3553|  90.3k|                if ((name == NULL) || (*str++ != ';')) {
  ------------------
  |  Branch (3553:21): [True: 1.74k, False: 88.6k]
  |  Branch (3553:39): [True: 15.5k, False: 73.0k]
  ------------------
 3554|  17.3k|                    xmlFatalErrMsg(ctxt, XML_ERR_ENTITY_CHAR_ERROR,
 3555|  17.3k|                            "EntityValue: '&' forbidden except for entities "
 3556|  17.3k|                            "references\n");
 3557|  17.3k|                    xmlFree(name);
 3558|  17.3k|                    return;
 3559|  17.3k|                }
 3560|       |
 3561|  73.0k|                xmlFree(name);
 3562|  73.0k|            }
 3563|  61.0M|        } else if (c == '%') {
  ------------------
  |  Branch (3563:20): [True: 269k, False: 60.7M]
  ------------------
 3564|   269k|            xmlEntityPtr ent;
 3565|       |
 3566|   269k|            if (chunk < str)
  ------------------
  |  Branch (3566:17): [True: 127k, False: 142k]
  ------------------
 3567|   127k|                xmlSBufAddString(buf, chunk, str - chunk);
 3568|       |
 3569|   269k|            ent = xmlParseStringPEReference(ctxt, &str);
 3570|   269k|            if (ent == NULL)
  ------------------
  |  Branch (3570:17): [True: 67.9k, False: 201k]
  ------------------
 3571|  67.9k|                return;
 3572|       |
 3573|   201k|            if (!PARSER_EXTERNAL(ctxt)) {
  ------------------
  |  |   55|   201k|    (((ctxt)->inSubset == 2) || \
  |  |  ------------------
  |  |  |  Branch (55:6): [True: 8.04k, False: 193k]
  |  |  ------------------
  |  |   56|   201k|     (((ctxt)->input->entity != NULL) && \
  |  |  ------------------
  |  |  |  Branch (56:7): [True: 193k, False: 196]
  |  |  ------------------
  |  |   57|   193k|      ((ctxt)->input->entity->etype == XML_EXTERNAL_PARAMETER_ENTITY)))
  |  |  ------------------
  |  |  |  Branch (57:7): [True: 193k, False: 0]
  |  |  ------------------
  ------------------
 3574|    196|                xmlFatalErr(ctxt, XML_ERR_ENTITY_PE_INTERNAL, NULL);
 3575|    196|                return;
 3576|    196|            }
 3577|       |
 3578|   201k|            if (ent->content == NULL) {
  ------------------
  |  Branch (3578:17): [True: 192k, False: 8.76k]
  ------------------
 3579|       |                /*
 3580|       |                 * Note: external parsed entities will not be loaded,
 3581|       |                 * it is not required for a non-validating parser to
 3582|       |                 * complete external PEReferences coming from the
 3583|       |                 * internal subset
 3584|       |                 */
 3585|   192k|                if (((ctxt->options & XML_PARSE_NO_XXE) == 0) &&
  ------------------
  |  Branch (3585:21): [True: 192k, False: 0]
  ------------------
 3586|   192k|                    ((ctxt->replaceEntities) ||
  ------------------
  |  Branch (3586:22): [True: 176k, False: 15.8k]
  ------------------
 3587|   192k|                     (ctxt->validate))) {
  ------------------
  |  Branch (3587:22): [True: 15.6k, False: 209]
  ------------------
 3588|   192k|                    xmlLoadEntityContent(ctxt, ent);
 3589|   192k|                } else {
 3590|    209|                    xmlWarningMsg(ctxt, XML_ERR_ENTITY_PROCESSING,
 3591|    209|                                  "not validating will not read content for "
 3592|    209|                                  "PE entity %s\n", ent->name, NULL);
 3593|    209|                }
 3594|   192k|            }
 3595|       |
 3596|       |            /*
 3597|       |             * TODO: Skip if ent->content is still NULL.
 3598|       |             */
 3599|       |
 3600|   201k|            if (xmlParserEntityCheck(ctxt, ent->length))
  ------------------
  |  Branch (3600:17): [True: 24, False: 201k]
  ------------------
 3601|     24|                return;
 3602|       |
 3603|   201k|            if (ent->flags & XML_ENT_EXPANDING) {
  ------------------
  |  |   22|   201k|#define XML_ENT_EXPANDING   (1u << 3)
  ------------------
  |  Branch (3603:17): [True: 73, False: 201k]
  ------------------
 3604|     73|                xmlFatalErr(ctxt, XML_ERR_ENTITY_LOOP, NULL);
 3605|     73|                return;
 3606|     73|            }
 3607|       |
 3608|   201k|            ent->flags |= XML_ENT_EXPANDING;
  ------------------
  |  |   22|   201k|#define XML_ENT_EXPANDING   (1u << 3)
  ------------------
 3609|   201k|            xmlExpandPEsInEntityValue(ctxt, buf, ent->content, ent->length,
 3610|   201k|                                      depth);
 3611|   201k|            ent->flags &= ~XML_ENT_EXPANDING;
  ------------------
  |  |   22|   201k|#define XML_ENT_EXPANDING   (1u << 3)
  ------------------
 3612|       |
 3613|   201k|            chunk = str;
 3614|  60.7M|        } else {
 3615|       |            /* Normal ASCII char */
 3616|  60.7M|            if (!IS_BYTE_CHAR(c)) {
  ------------------
  |  |  103|  60.7M|#define IS_BYTE_CHAR(c)	 xmlIsChar_ch(c)
  |  |  ------------------
  |  |  |  |  108|  60.7M|#define xmlIsChar_ch(c)		(((0x9 <= (c)) && ((c) <= 0xa)) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (108:28): [True: 59.7M, False: 993k]
  |  |  |  |  |  Branch (108:44): [True: 18.1M, False: 41.6M]
  |  |  |  |  ------------------
  |  |  |  |  109|  60.7M|				 ((c) == 0xd) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (109:6): [True: 54.7k, False: 42.5M]
  |  |  |  |  ------------------
  |  |  |  |  110|  60.7M|				  (0x20 <= (c)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (110:7): [True: 41.5M, False: 1.04M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3617|  1.04M|                xmlFatalErrMsg(ctxt, XML_ERR_INVALID_CHAR,
 3618|  1.04M|                        "invalid character in entity value\n");
 3619|  1.04M|                if (chunk < str)
  ------------------
  |  Branch (3619:21): [True: 13.5k, False: 1.02M]
  ------------------
 3620|  13.5k|                    xmlSBufAddString(buf, chunk, str - chunk);
 3621|  1.04M|                xmlSBufAddReplChar(buf);
 3622|  1.04M|                str += 1;
 3623|  1.04M|                chunk = str;
 3624|  59.7M|            } else {
 3625|  59.7M|                str += 1;
 3626|  59.7M|            }
 3627|  60.7M|        }
 3628|   123M|    }
 3629|       |
 3630|  58.2k|    if (chunk < str)
  ------------------
  |  Branch (3630:9): [True: 55.0k, False: 3.20k]
  ------------------
 3631|  55.0k|        xmlSBufAddString(buf, chunk, str - chunk);
 3632|  58.2k|}
parser.c:xmlUTF8MultibyteLen:
  818|   124M|                    const char *errMsg) {
  819|   124M|    int c = str[0];
  820|   124M|    int c1 = str[1];
  821|       |
  822|   124M|    if ((c1 & 0xC0) != 0x80)
  ------------------
  |  Branch (822:9): [True: 65.1M, False: 59.5M]
  ------------------
  823|  65.1M|        goto encoding_error;
  824|       |
  825|  59.5M|    if (c < 0xE0) {
  ------------------
  |  Branch (825:9): [True: 15.2M, False: 44.3M]
  ------------------
  826|       |        /* 2-byte sequence */
  827|  15.2M|        if (c < 0xC2)
  ------------------
  |  Branch (827:13): [True: 14.0M, False: 1.21M]
  ------------------
  828|  14.0M|            goto encoding_error;
  829|       |
  830|  1.21M|        return(2);
  831|  44.3M|    } else {
  832|  44.3M|        int c2 = str[2];
  833|       |
  834|  44.3M|        if ((c2 & 0xC0) != 0x80)
  ------------------
  |  Branch (834:13): [True: 6.26k, False: 44.3M]
  ------------------
  835|  6.26k|            goto encoding_error;
  836|       |
  837|  44.3M|        if (c < 0xF0) {
  ------------------
  |  Branch (837:13): [True: 44.2M, False: 61.2k]
  ------------------
  838|       |            /* 3-byte sequence */
  839|  44.2M|            if (c == 0xE0) {
  ------------------
  |  Branch (839:17): [True: 4.91M, False: 39.3M]
  ------------------
  840|       |                /* overlong */
  841|  4.91M|                if (c1 < 0xA0)
  ------------------
  |  Branch (841:21): [True: 2.52k, False: 4.91M]
  ------------------
  842|  2.52k|                    goto encoding_error;
  843|  39.3M|            } else if (c == 0xED) {
  ------------------
  |  Branch (843:24): [True: 856, False: 39.3M]
  ------------------
  844|       |                /* surrogate */
  845|    856|                if (c1 >= 0xA0)
  ------------------
  |  Branch (845:21): [True: 532, False: 324]
  ------------------
  846|    532|                    goto encoding_error;
  847|  39.3M|            } else if (c == 0xEF) {
  ------------------
  |  Branch (847:24): [True: 33.4M, False: 5.89M]
  ------------------
  848|       |                /* U+FFFE and U+FFFF are invalid Chars */
  849|  33.4M|                if ((c1 == 0xBF) && (c2 >= 0xBE))
  ------------------
  |  Branch (849:21): [True: 33.4M, False: 1.61k]
  |  Branch (849:37): [True: 505, False: 33.4M]
  ------------------
  850|    505|                    xmlFatalErrMsg(ctxt, XML_ERR_INVALID_CHAR, errMsg);
  851|  33.4M|            }
  852|       |
  853|  44.2M|            return(3);
  854|  44.2M|        } else {
  855|       |            /* 4-byte sequence */
  856|  61.2k|            if ((str[3] & 0xC0) != 0x80)
  ------------------
  |  Branch (856:17): [True: 2.14k, False: 59.0k]
  ------------------
  857|  2.14k|                goto encoding_error;
  858|  59.0k|            if (c == 0xF0) {
  ------------------
  |  Branch (858:17): [True: 1.57k, False: 57.4k]
  ------------------
  859|       |                /* overlong */
  860|  1.57k|                if (c1 < 0x90)
  ------------------
  |  Branch (860:21): [True: 567, False: 1.00k]
  ------------------
  861|    567|                    goto encoding_error;
  862|  57.4k|            } else if (c >= 0xF4) {
  ------------------
  |  Branch (862:24): [True: 7.87k, False: 49.6k]
  ------------------
  863|       |                /* greater than 0x10FFFF */
  864|  7.87k|                if ((c > 0xF4) || (c1 >= 0x90))
  ------------------
  |  Branch (864:21): [True: 7.06k, False: 806]
  |  Branch (864:35): [True: 306, False: 500]
  ------------------
  865|  7.37k|                    goto encoding_error;
  866|  7.87k|            }
  867|       |
  868|  51.1k|            return(4);
  869|  59.0k|        }
  870|  44.3M|    }
  871|       |
  872|  79.1M|encoding_error:
  873|       |    /* Only report the first error */
  874|  79.1M|    if ((ctxt->input->flags & XML_INPUT_ENCODING_ERROR) == 0) {
  ------------------
  |  |   40|  79.1M|#define XML_INPUT_ENCODING_ERROR    (1u << 5)
  ------------------
  |  Branch (874:9): [True: 25.1k, False: 79.1M]
  ------------------
  875|  25.1k|        xmlCtxtErrIO(ctxt, XML_ERR_INVALID_ENCODING, NULL);
  876|  25.1k|        ctxt->input->flags |= XML_INPUT_ENCODING_ERROR;
  ------------------
  |  |   40|  25.1k|#define XML_INPUT_ENCODING_ERROR    (1u << 5)
  ------------------
  877|  25.1k|    }
  878|       |
  879|  79.1M|    return(0);
  880|  59.5M|}
parser.c:xmlSBufAddString:
  719|   126M|xmlSBufAddString(xmlSBuf *buf, const xmlChar *str, unsigned len) {
  720|   126M|    if (buf->max - buf->size < len) {
  ------------------
  |  Branch (720:9): [True: 0, False: 126M]
  ------------------
  721|      0|        if (buf->code == XML_ERR_OK)
  ------------------
  |  Branch (721:13): [True: 0, False: 0]
  ------------------
  722|      0|            buf->code = XML_ERR_RESOURCE_LIMIT;
  723|      0|        return;
  724|      0|    }
  725|       |
  726|   126M|    if (buf->cap - buf->size <= len) {
  ------------------
  |  Branch (726:9): [True: 480k, False: 126M]
  ------------------
  727|   480k|        if (xmlSBufGrow(buf, len) < 0)
  ------------------
  |  Branch (727:13): [True: 96, False: 480k]
  ------------------
  728|     96|            return;
  729|   480k|    }
  730|       |
  731|   126M|    if (len > 0)
  ------------------
  |  Branch (731:9): [True: 126M, False: 0]
  ------------------
  732|   126M|        memcpy(buf->mem + buf->size, str, len);
  733|   126M|    buf->size += len;
  734|   126M|}
parser.c:xmlSBufGrow:
  692|   486k|xmlSBufGrow(xmlSBuf *buf, unsigned len) {
  693|   486k|    xmlChar *mem;
  694|   486k|    unsigned cap;
  695|       |
  696|   486k|    if (len >= UINT_MAX / 2 - buf->size) {
  ------------------
  |  Branch (696:9): [True: 0, False: 486k]
  ------------------
  697|      0|        if (buf->code == XML_ERR_OK)
  ------------------
  |  Branch (697:13): [True: 0, False: 0]
  ------------------
  698|      0|            buf->code = XML_ERR_RESOURCE_LIMIT;
  699|      0|        return(-1);
  700|      0|    }
  701|       |
  702|   486k|    cap = (buf->size + len) * 2;
  703|   486k|    if (cap < 240)
  ------------------
  |  Branch (703:9): [True: 329k, False: 157k]
  ------------------
  704|   329k|        cap = 240;
  705|       |
  706|   486k|    mem = xmlRealloc(buf->mem, cap);
  707|   486k|    if (mem == NULL) {
  ------------------
  |  Branch (707:9): [True: 103, False: 486k]
  ------------------
  708|    103|        buf->code = XML_ERR_NO_MEMORY;
  709|    103|        return(-1);
  710|    103|    }
  711|       |
  712|   486k|    buf->mem = mem;
  713|   486k|    buf->cap = cap;
  714|       |
  715|   486k|    return(0);
  716|   486k|}
parser.c:xmlSBufAddReplChar:
  767|   104M|xmlSBufAddReplChar(xmlSBuf *buf) {
  768|   104M|    xmlSBufAddCString(buf, "\xEF\xBF\xBD", 3);
  769|   104M|}
parser.c:xmlSBufAddCString:
  737|   119M|xmlSBufAddCString(xmlSBuf *buf, const char *str, unsigned len) {
  738|   119M|    xmlSBufAddString(buf, (const xmlChar *) str, len);
  739|   119M|}
parser.c:xmlParseStringCharRef:
 2671|  1.02M|xmlParseStringCharRef(xmlParserCtxtPtr ctxt, const xmlChar **str) {
 2672|  1.02M|    const xmlChar *ptr;
 2673|  1.02M|    xmlChar cur;
 2674|  1.02M|    int val = 0;
 2675|       |
 2676|  1.02M|    if ((str == NULL) || (*str == NULL)) return(0);
  ------------------
  |  Branch (2676:9): [True: 0, False: 1.02M]
  |  Branch (2676:26): [True: 0, False: 1.02M]
  ------------------
 2677|  1.02M|    ptr = *str;
 2678|  1.02M|    cur = *ptr;
 2679|  1.02M|    if ((cur == '&') && (ptr[1] == '#') && (ptr[2] == 'x')) {
  ------------------
  |  Branch (2679:9): [True: 1.02M, False: 0]
  |  Branch (2679:25): [True: 1.02M, False: 0]
  |  Branch (2679:44): [True: 12.3k, False: 1.00M]
  ------------------
 2680|  12.3k|	ptr += 3;
 2681|  12.3k|	cur = *ptr;
 2682|  41.5k|	while (cur != ';') { /* Non input consuming loop */
  ------------------
  |  Branch (2682:9): [True: 29.9k, False: 11.5k]
  ------------------
 2683|  29.9k|	    if ((cur >= '0') && (cur <= '9'))
  ------------------
  |  Branch (2683:10): [True: 29.6k, False: 278]
  |  Branch (2683:26): [True: 16.0k, False: 13.6k]
  ------------------
 2684|  16.0k|	        val = val * 16 + (cur - '0');
 2685|  13.9k|	    else if ((cur >= 'a') && (cur <= 'f'))
  ------------------
  |  Branch (2685:15): [True: 4.88k, False: 9.04k]
  |  Branch (2685:31): [True: 4.53k, False: 352]
  ------------------
 2686|  4.53k|	        val = val * 16 + (cur - 'a') + 10;
 2687|  9.39k|	    else if ((cur >= 'A') && (cur <= 'F'))
  ------------------
  |  Branch (2687:15): [True: 9.11k, False: 282]
  |  Branch (2687:31): [True: 8.57k, False: 540]
  ------------------
 2688|  8.57k|	        val = val * 16 + (cur - 'A') + 10;
 2689|    822|	    else {
 2690|    822|		xmlFatalErr(ctxt, XML_ERR_INVALID_HEX_CHARREF, NULL);
 2691|    822|		val = 0;
 2692|    822|		break;
 2693|    822|	    }
 2694|  29.1k|	    if (val > 0x110000)
  ------------------
  |  Branch (2694:10): [True: 847, False: 28.2k]
  ------------------
 2695|    847|	        val = 0x110000;
 2696|       |
 2697|  29.1k|	    ptr++;
 2698|  29.1k|	    cur = *ptr;
 2699|  29.1k|	}
 2700|  12.3k|	if (cur == ';')
  ------------------
  |  Branch (2700:6): [True: 11.5k, False: 822]
  ------------------
 2701|  11.5k|	    ptr++;
 2702|  1.00M|    } else if  ((cur == '&') && (ptr[1] == '#')){
  ------------------
  |  Branch (2702:17): [True: 1.00M, False: 0]
  |  Branch (2702:33): [True: 1.00M, False: 0]
  ------------------
 2703|  1.00M|	ptr += 2;
 2704|  1.00M|	cur = *ptr;
 2705|  3.03M|	while (cur != ';') { /* Non input consuming loops */
  ------------------
  |  Branch (2705:9): [True: 2.02M, False: 1.00M]
  ------------------
 2706|  2.02M|	    if ((cur >= '0') && (cur <= '9'))
  ------------------
  |  Branch (2706:10): [True: 2.02M, False: 443]
  |  Branch (2706:26): [True: 2.02M, False: 1.05k]
  ------------------
 2707|  2.02M|	        val = val * 10 + (cur - '0');
 2708|  1.50k|	    else {
 2709|  1.50k|		xmlFatalErr(ctxt, XML_ERR_INVALID_DEC_CHARREF, NULL);
 2710|  1.50k|		val = 0;
 2711|  1.50k|		break;
 2712|  1.50k|	    }
 2713|  2.02M|	    if (val > 0x110000)
  ------------------
  |  Branch (2713:10): [True: 1.61k, False: 2.02M]
  ------------------
 2714|  1.61k|	        val = 0x110000;
 2715|       |
 2716|  2.02M|	    ptr++;
 2717|  2.02M|	    cur = *ptr;
 2718|  2.02M|	}
 2719|  1.00M|	if (cur == ';')
  ------------------
  |  Branch (2719:6): [True: 1.00M, False: 1.50k]
  ------------------
 2720|  1.00M|	    ptr++;
 2721|  1.00M|    } else {
 2722|      0|	xmlFatalErr(ctxt, XML_ERR_INVALID_CHARREF, NULL);
 2723|      0|	return(0);
 2724|      0|    }
 2725|  1.02M|    *str = ptr;
 2726|       |
 2727|       |    /*
 2728|       |     * [ WFC: Legal Character ]
 2729|       |     * Characters referred to using character references must match the
 2730|       |     * production for Char.
 2731|       |     */
 2732|  1.02M|    if (val >= 0x110000) {
  ------------------
  |  Branch (2732:9): [True: 214, False: 1.02M]
  ------------------
 2733|    214|        xmlFatalErrMsgInt(ctxt, XML_ERR_INVALID_CHAR,
 2734|    214|                "xmlParseStringCharRef: character reference out of bounds\n",
 2735|    214|                val);
 2736|  1.02M|    } else if (IS_CHAR(val)) {
  ------------------
  |  |  115|  1.02M|#define IS_CHAR(c)   xmlIsCharQ(c)
  |  |  ------------------
  |  |  |  |  117|  1.02M|#define xmlIsCharQ(c)		(((c) < 0x100) ? \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (117:24): [True: 1.01M, False: 3.19k]
  |  |  |  |  |  Branch (117:25): [True: 1.01M, False: 5.94k]
  |  |  |  |  ------------------
  |  |  |  |  118|  1.02M|				 xmlIsChar_ch((c)) :\
  |  |  |  |  ------------------
  |  |  |  |  |  |  108|  1.01M|#define xmlIsChar_ch(c)		(((0x9 <= (c)) && ((c) <= 0xa)) || \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (108:28): [True: 1.01M, False: 2.92k]
  |  |  |  |  |  |  |  Branch (108:44): [True: 763, False: 1.01M]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  109|  1.01M|				 ((c) == 0xd) || \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (109:6): [True: 13.9k, False: 1.00M]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  110|  1.01M|				  (0x20 <= (c)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (110:7): [True: 997k, False: 2.98k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  119|  1.02M|				(((0x100 <= (c)) && ((c) <= 0xd7ff)) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (119:7): [True: 5.94k, False: 0]
  |  |  |  |  |  Branch (119:25): [True: 4.00k, False: 1.94k]
  |  |  |  |  ------------------
  |  |  |  |  120|  5.94k|				 ((0xe000 <= (c)) && ((c) <= 0xfffd)) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (120:7): [True: 1.73k, False: 210]
  |  |  |  |  |  Branch (120:26): [True: 555, False: 1.18k]
  |  |  |  |  ------------------
  |  |  |  |  121|  5.94k|				 ((0x10000 <= (c)) && ((c) <= 0x10ffff))))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (121:7): [True: 1.17k, False: 211]
  |  |  |  |  |  Branch (121:27): [True: 1.17k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2737|  1.01M|        return(val);
 2738|  1.01M|    } else {
 2739|  3.19k|        xmlFatalErrMsgInt(ctxt, XML_ERR_INVALID_CHAR,
 2740|  3.19k|			  "xmlParseStringCharRef: invalid xmlChar value %d\n",
 2741|  3.19k|			  val);
 2742|  3.19k|    }
 2743|  3.41k|    return(0);
 2744|  1.02M|}
parser.c:xmlSBufAddChar:
  742|  1.04M|xmlSBufAddChar(xmlSBuf *buf, int c) {
  743|  1.04M|    xmlChar *end;
  744|       |
  745|  1.04M|    if (buf->max - buf->size < 4) {
  ------------------
  |  Branch (745:9): [True: 0, False: 1.04M]
  ------------------
  746|      0|        if (buf->code == XML_ERR_OK)
  ------------------
  |  Branch (746:13): [True: 0, False: 0]
  ------------------
  747|      0|            buf->code = XML_ERR_RESOURCE_LIMIT;
  748|      0|        return;
  749|      0|    }
  750|       |
  751|  1.04M|    if (buf->cap - buf->size <= 4) {
  ------------------
  |  Branch (751:9): [True: 5.65k, False: 1.04M]
  ------------------
  752|  5.65k|        if (xmlSBufGrow(buf, 4) < 0)
  ------------------
  |  Branch (752:13): [True: 7, False: 5.64k]
  ------------------
  753|      7|            return;
  754|  5.65k|    }
  755|       |
  756|  1.04M|    end = buf->mem + buf->size;
  757|       |
  758|  1.04M|    if (c < 0x80) {
  ------------------
  |  Branch (758:9): [True: 1.04M, False: 5.42k]
  ------------------
  759|  1.04M|        *end = (xmlChar) c;
  760|  1.04M|        buf->size += 1;
  761|  1.04M|    } else {
  762|  5.42k|        buf->size += xmlCopyCharMultiByte(end, c);
  763|  5.42k|    }
  764|  1.04M|}
parser.c:xmlParseStringName:
 3377|  2.67M|xmlParseStringName(xmlParserCtxtPtr ctxt, const xmlChar** str) {
 3378|  2.67M|    xmlChar *ret;
 3379|  2.67M|    const xmlChar *cur = *str;
 3380|  2.67M|    int flags = 0;
 3381|  2.67M|    int maxLength = (ctxt->options & XML_PARSE_HUGE) ?
  ------------------
  |  Branch (3381:21): [True: 1.79M, False: 875k]
  ------------------
 3382|  1.79M|                    XML_MAX_TEXT_LENGTH :
  ------------------
  |  |   50|  1.79M|#define XML_MAX_TEXT_LENGTH 10000000
  ------------------
 3383|  2.67M|                    XML_MAX_NAME_LENGTH;
  ------------------
  |  |   65|   875k|#define XML_MAX_NAME_LENGTH 50000
  ------------------
 3384|       |
 3385|  2.67M|    if (ctxt->options & XML_PARSE_OLD10)
  ------------------
  |  Branch (3385:9): [True: 1.19M, False: 1.47M]
  ------------------
 3386|  1.19M|        flags |= XML_SCAN_OLD10;
  ------------------
  |  |   71|  1.19M|#define XML_SCAN_OLD10      4
  ------------------
 3387|       |
 3388|  2.67M|    cur = xmlScanName(*str, maxLength, flags);
 3389|  2.67M|    if (cur == NULL) {
  ------------------
  |  Branch (3389:9): [True: 75, False: 2.67M]
  ------------------
 3390|     75|        xmlFatalErr(ctxt, XML_ERR_NAME_TOO_LONG, "NCName");
 3391|     75|        return(NULL);
 3392|     75|    }
 3393|  2.67M|    if (cur == *str)
  ------------------
  |  Branch (3393:9): [True: 4.57k, False: 2.66M]
  ------------------
 3394|  4.57k|        return(NULL);
 3395|       |
 3396|  2.66M|    ret = xmlStrndup(*str, cur - *str);
 3397|  2.66M|    if (ret == NULL)
  ------------------
  |  Branch (3397:9): [True: 27, False: 2.66M]
  ------------------
 3398|     27|        xmlErrMemory(ctxt);
 3399|  2.66M|    *str = cur;
 3400|  2.66M|    return(ret);
 3401|  2.67M|}
parser.c:xmlParseStringPEReference:
 7898|   269k|xmlParseStringPEReference(xmlParserCtxtPtr ctxt, const xmlChar **str) {
 7899|   269k|    const xmlChar *ptr;
 7900|   269k|    xmlChar cur;
 7901|   269k|    xmlChar *name;
 7902|   269k|    xmlEntityPtr entity = NULL;
 7903|       |
 7904|   269k|    if ((str == NULL) || (*str == NULL)) return(NULL);
  ------------------
  |  Branch (7904:9): [True: 0, False: 269k]
  |  Branch (7904:26): [True: 0, False: 269k]
  ------------------
 7905|   269k|    ptr = *str;
 7906|   269k|    cur = *ptr;
 7907|   269k|    if (cur != '%')
  ------------------
  |  Branch (7907:9): [True: 0, False: 269k]
  ------------------
 7908|      0|        return(NULL);
 7909|   269k|    ptr++;
 7910|   269k|    name = xmlParseStringName(ctxt, &ptr);
 7911|   269k|    if (name == NULL) {
  ------------------
  |  Branch (7911:9): [True: 2.90k, False: 266k]
  ------------------
 7912|  2.90k|	xmlFatalErrMsg(ctxt, XML_ERR_NAME_REQUIRED,
 7913|  2.90k|		       "xmlParseStringPEReference: no name\n");
 7914|  2.90k|	*str = ptr;
 7915|  2.90k|	return(NULL);
 7916|  2.90k|    }
 7917|   266k|    cur = *ptr;
 7918|   266k|    if (cur != ';') {
  ------------------
  |  Branch (7918:9): [True: 3.61k, False: 262k]
  ------------------
 7919|  3.61k|	xmlFatalErr(ctxt, XML_ERR_ENTITYREF_SEMICOL_MISSING, NULL);
 7920|  3.61k|	xmlFree(name);
 7921|  3.61k|	*str = ptr;
 7922|  3.61k|	return(NULL);
 7923|  3.61k|    }
 7924|   262k|    ptr++;
 7925|       |
 7926|       |    /* Must be set before xmlHandleUndeclaredEntity */
 7927|   262k|    ctxt->hasPErefs = 1;
 7928|       |
 7929|       |    /*
 7930|       |     * Request the entity from SAX
 7931|       |     */
 7932|   262k|    if ((ctxt->sax != NULL) &&
  ------------------
  |  Branch (7932:9): [True: 262k, False: 0]
  ------------------
 7933|   262k|	(ctxt->sax->getParameterEntity != NULL))
  ------------------
  |  Branch (7933:2): [True: 262k, False: 0]
  ------------------
 7934|   262k|	entity = ctxt->sax->getParameterEntity(ctxt->userData, name);
 7935|       |
 7936|   262k|    if (entity == NULL) {
  ------------------
  |  Branch (7936:9): [True: 61.4k, False: 201k]
  ------------------
 7937|  61.4k|        xmlHandleUndeclaredEntity(ctxt, name);
 7938|   201k|    } else {
 7939|       |	/*
 7940|       |	 * Internal checking in case the entity quest barfed
 7941|       |	 */
 7942|   201k|	if ((entity->etype != XML_INTERNAL_PARAMETER_ENTITY) &&
  ------------------
  |  Branch (7942:6): [True: 192k, False: 8.50k]
  ------------------
 7943|   192k|	    (entity->etype != XML_EXTERNAL_PARAMETER_ENTITY)) {
  ------------------
  |  Branch (7943:6): [True: 0, False: 192k]
  ------------------
 7944|      0|	    xmlWarningMsg(ctxt, XML_WAR_UNDECLARED_ENTITY,
 7945|      0|			  "%%%s; is not a parameter entity\n",
 7946|      0|			  name, NULL);
 7947|      0|	}
 7948|   201k|    }
 7949|       |
 7950|   262k|    xmlFree(name);
 7951|   262k|    *str = ptr;
 7952|   262k|    return(entity);
 7953|   266k|}
parser.c:xmlHandleUndeclaredEntity:
 7371|   446k|xmlHandleUndeclaredEntity(xmlParserCtxtPtr ctxt, const xmlChar *name) {
 7372|       |    /*
 7373|       |     * [ WFC: Entity Declared ]
 7374|       |     * In a document without any DTD, a document with only an
 7375|       |     * internal DTD subset which contains no parameter entity
 7376|       |     * references, or a document with "standalone='yes'", the
 7377|       |     * Name given in the entity reference must match that in an
 7378|       |     * entity declaration, except that well-formed documents
 7379|       |     * need not declare any of the following entities: amp, lt,
 7380|       |     * gt, apos, quot.
 7381|       |     * The declaration of a parameter entity must precede any
 7382|       |     * reference to it.
 7383|       |     * Similarly, the declaration of a general entity must
 7384|       |     * precede any reference to it which appears in a default
 7385|       |     * value in an attribute-list declaration. Note that if
 7386|       |     * entities are declared in the external subset or in
 7387|       |     * external parameter entities, a non-validating processor
 7388|       |     * is not obligated to read and process their declarations;
 7389|       |     * for such documents, the rule that an entity must be
 7390|       |     * declared is a well-formedness constraint only if
 7391|       |     * standalone='yes'.
 7392|       |     */
 7393|   446k|    if ((ctxt->standalone == 1) ||
  ------------------
  |  Branch (7393:9): [True: 802, False: 446k]
  ------------------
 7394|   446k|        ((ctxt->hasExternalSubset == 0) &&
  ------------------
  |  Branch (7394:10): [True: 438k, False: 8.07k]
  ------------------
 7395|   438k|         (ctxt->hasPErefs == 0))) {
  ------------------
  |  Branch (7395:10): [True: 137k, False: 300k]
  ------------------
 7396|   138k|        xmlFatalErrMsgStr(ctxt, XML_ERR_UNDECLARED_ENTITY,
 7397|   138k|                          "Entity '%s' not defined\n", name);
 7398|   138k|#ifdef LIBXML_VALID_ENABLED
 7399|   308k|    } else if (ctxt->validate) {
  ------------------
  |  Branch (7399:16): [True: 257k, False: 51.8k]
  ------------------
 7400|       |        /*
 7401|       |         * [ VC: Entity Declared ]
 7402|       |         * In a document with an external subset or external
 7403|       |         * parameter entities with "standalone='no'", ...
 7404|       |         * ... The declaration of a parameter entity must
 7405|       |         * precede any reference to it...
 7406|       |         */
 7407|   257k|        xmlValidityError(ctxt, XML_ERR_UNDECLARED_ENTITY,
 7408|   257k|                         "Entity '%s' not defined\n", name, NULL);
 7409|   257k|#endif
 7410|   257k|    } else if ((ctxt->loadsubset & ~XML_SKIP_IDS) ||
  ------------------
  |  |  210|  51.8k|#define XML_SKIP_IDS		8
  ------------------
  |  Branch (7410:16): [True: 35.0k, False: 16.8k]
  ------------------
 7411|  16.8k|               ((ctxt->replaceEntities) &&
  ------------------
  |  Branch (7411:17): [True: 16.1k, False: 726]
  ------------------
 7412|  50.1k|                ((ctxt->options & XML_PARSE_NO_XXE) == 0))) {
  ------------------
  |  Branch (7412:17): [True: 15.1k, False: 955]
  ------------------
 7413|       |        /*
 7414|       |         * Also raise a non-fatal error
 7415|       |         *
 7416|       |         * - if the external subset is loaded and all entity declarations
 7417|       |         *   should be available, or
 7418|       |         * - entity substition was requested without restricting
 7419|       |         *   external entity access.
 7420|       |         */
 7421|  50.1k|        xmlErrMsgStr(ctxt, XML_WAR_UNDECLARED_ENTITY,
 7422|  50.1k|                     "Entity '%s' not defined\n", name);
 7423|  50.1k|    } else {
 7424|  1.68k|        xmlWarningMsg(ctxt, XML_WAR_UNDECLARED_ENTITY,
 7425|  1.68k|                      "Entity '%s' not defined\n", name, NULL);
 7426|  1.68k|    }
 7427|       |
 7428|   446k|    ctxt->valid = 0;
 7429|   446k|}
parser.c:xmlErrMsgStr:
  364|  50.1k|{
  365|  50.1k|    xmlCtxtErr(ctxt, NULL, XML_FROM_PARSER, error, XML_ERR_ERROR,
  366|  50.1k|               val, NULL, NULL, 0, msg, val);
  367|  50.1k|}
parser.c:xmlLoadEntityContent:
 7735|   192k|xmlLoadEntityContent(xmlParserCtxtPtr ctxt, xmlEntityPtr entity) {
 7736|   192k|    xmlParserInputPtr oldinput, input = NULL;
 7737|   192k|    xmlParserInputPtr *oldinputTab;
 7738|   192k|    xmlChar *oldencoding;
 7739|   192k|    xmlChar *content = NULL;
 7740|   192k|    xmlResourceType rtype;
 7741|   192k|    size_t length, i;
 7742|   192k|    int oldinputNr, oldinputMax;
 7743|   192k|    int ret = -1;
 7744|   192k|    int res;
 7745|       |
 7746|   192k|    if ((ctxt == NULL) || (entity == NULL) ||
  ------------------
  |  Branch (7746:9): [True: 0, False: 192k]
  |  Branch (7746:27): [True: 0, False: 192k]
  ------------------
 7747|   192k|        ((entity->etype != XML_EXTERNAL_PARAMETER_ENTITY) &&
  ------------------
  |  Branch (7747:10): [True: 0, False: 192k]
  ------------------
 7748|      0|	 (entity->etype != XML_EXTERNAL_GENERAL_PARSED_ENTITY)) ||
  ------------------
  |  Branch (7748:3): [True: 0, False: 0]
  ------------------
 7749|   192k|	(entity->content != NULL)) {
  ------------------
  |  Branch (7749:2): [True: 0, False: 192k]
  ------------------
 7750|      0|	xmlFatalErr(ctxt, XML_ERR_ARGUMENT,
 7751|      0|	            "xmlLoadEntityContent parameter error");
 7752|      0|        return(-1);
 7753|      0|    }
 7754|       |
 7755|   192k|    if (entity->etype == XML_EXTERNAL_PARAMETER_ENTITY)
  ------------------
  |  Branch (7755:9): [True: 192k, False: 0]
  ------------------
 7756|   192k|        rtype = XML_RESOURCE_PARAMETER_ENTITY;
 7757|      0|    else
 7758|      0|        rtype = XML_RESOURCE_GENERAL_ENTITY;
 7759|       |
 7760|   192k|    input = xmlLoadResource(ctxt, (char *) entity->URI,
 7761|   192k|                            (char *) entity->ExternalID, rtype);
 7762|   192k|    if (input == NULL)
  ------------------
  |  Branch (7762:9): [True: 1.00k, False: 191k]
  ------------------
 7763|  1.00k|        return(-1);
 7764|       |
 7765|   191k|    oldinput = ctxt->input;
 7766|   191k|    oldinputNr = ctxt->inputNr;
 7767|   191k|    oldinputMax = ctxt->inputMax;
 7768|   191k|    oldinputTab = ctxt->inputTab;
 7769|   191k|    oldencoding = ctxt->encoding;
 7770|       |
 7771|   191k|    ctxt->input = NULL;
 7772|   191k|    ctxt->inputNr = 0;
 7773|   191k|    ctxt->inputMax = 1;
 7774|   191k|    ctxt->encoding = NULL;
 7775|   191k|    ctxt->inputTab = xmlMalloc(sizeof(xmlParserInputPtr));
 7776|   191k|    if (ctxt->inputTab == NULL) {
  ------------------
  |  Branch (7776:9): [True: 5, False: 191k]
  ------------------
 7777|      5|        xmlErrMemory(ctxt);
 7778|      5|        xmlFreeInputStream(input);
 7779|      5|        goto error;
 7780|      5|    }
 7781|       |
 7782|   191k|    xmlBufResetInput(input->buf->buffer, input);
 7783|       |
 7784|   191k|    if (xmlCtxtPushInput(ctxt, input) < 0) {
  ------------------
  |  Branch (7784:9): [True: 6, False: 191k]
  ------------------
 7785|      6|        xmlFreeInputStream(input);
 7786|      6|        goto error;
 7787|      6|    }
 7788|       |
 7789|   191k|    xmlDetectEncoding(ctxt);
 7790|       |
 7791|       |    /*
 7792|       |     * Parse a possible text declaration first
 7793|       |     */
 7794|   191k|    if ((CMP5(CUR_PTR, '<', '?', 'x', 'm', 'l')) && (IS_BLANK_CH(NXT(5)))) {
  ------------------
  |  | 2271|   191k|  ( CMP4( s, c1, c2, c3, c4 ) && ((unsigned char *) s)[ 4 ] == c5 )
  |  |  ------------------
  |  |  |  | 2268|   382k|  ( ((unsigned char *) s)[ 0 ] == c1 && ((unsigned char *) s)[ 1 ] == c2 && \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2268:5): [True: 187k, False: 3.94k]
  |  |  |  |  |  Branch (2268:41): [True: 185k, False: 2.01k]
  |  |  |  |  ------------------
  |  |  |  | 2269|   191k|    ((unsigned char *) s)[ 2 ] == c3 && ((unsigned char *) s)[ 3 ] == c4 )
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2269:5): [True: 184k, False: 322]
  |  |  |  |  |  Branch (2269:41): [True: 184k, False: 247]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2271:34): [True: 184k, False: 466]
  |  |  ------------------
  ------------------
                  if ((CMP5(CUR_PTR, '<', '?', 'x', 'm', 'l')) && (IS_BLANK_CH(NXT(5)))) {
  ------------------
  |  |  137|   184k|#define IS_BLANK_CH(c)  xmlIsBlank_ch(c)
  |  |  ------------------
  |  |  |  |   90|   184k|#define xmlIsBlank_ch(c)	(((c) == 0x20) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (90:27): [True: 182k, False: 1.86k]
  |  |  |  |  ------------------
  |  |  |  |   91|   184k|				 ((0x9 <= (c)) && ((c) <= 0xa)) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (91:7): [True: 1.65k, False: 215]
  |  |  |  |  |  Branch (91:23): [True: 1.10k, False: 548]
  |  |  |  |  ------------------
  |  |  |  |   92|   184k|				 ((c) == 0xd))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (92:6): [True: 507, False: 256]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 7795|   184k|	xmlParseTextDecl(ctxt);
 7796|       |        /*
 7797|       |         * An XML-1.0 document can't reference an entity not XML-1.0
 7798|       |         */
 7799|   184k|        if ((xmlStrEqual(ctxt->version, BAD_CAST "1.0")) &&
  ------------------
  |  |   34|   184k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (7799:13): [True: 10.9k, False: 173k]
  ------------------
 7800|  10.9k|            (!xmlStrEqual(ctxt->input->version, BAD_CAST "1.0"))) {
  ------------------
  |  |   34|  10.9k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (7800:13): [True: 255, False: 10.6k]
  ------------------
 7801|    255|            xmlFatalErrMsg(ctxt, XML_ERR_VERSION_MISMATCH,
 7802|    255|                           "Version mismatch between document and entity\n");
 7803|    255|        }
 7804|   184k|    }
 7805|       |
 7806|   191k|    length = input->cur - input->base;
 7807|   191k|    xmlBufShrink(input->buf->buffer, length);
 7808|   191k|    xmlSaturatedAdd(&ctxt->sizeentities, length);
 7809|       |
 7810|   214k|    while ((res = xmlParserInputBufferGrow(input->buf, 4096)) > 0)
  ------------------
  |  Branch (7810:12): [True: 23.1k, False: 191k]
  ------------------
 7811|  23.1k|        ;
 7812|       |
 7813|   191k|    xmlBufResetInput(input->buf->buffer, input);
 7814|       |
 7815|   191k|    if (res < 0) {
  ------------------
  |  Branch (7815:9): [True: 959, False: 190k]
  ------------------
 7816|    959|        xmlCtxtErrIO(ctxt, input->buf->error, NULL);
 7817|    959|        goto error;
 7818|    959|    }
 7819|       |
 7820|   190k|    length = xmlBufUse(input->buf->buffer);
 7821|   190k|    if (length > INT_MAX) {
  ------------------
  |  Branch (7821:9): [True: 0, False: 190k]
  ------------------
 7822|      0|        xmlErrMemory(ctxt);
 7823|      0|        goto error;
 7824|      0|    }
 7825|       |
 7826|   190k|    content = xmlStrndup(xmlBufContent(input->buf->buffer), length);
 7827|   190k|    if (content == NULL) {
  ------------------
  |  Branch (7827:9): [True: 5, False: 190k]
  ------------------
 7828|      5|        xmlErrMemory(ctxt);
 7829|      5|        goto error;
 7830|      5|    }
 7831|       |
 7832|  35.9M|    for (i = 0; i < length; ) {
  ------------------
  |  Branch (7832:17): [True: 35.9M, False: 147]
  ------------------
 7833|  35.9M|        int clen = length - i;
 7834|  35.9M|        int c = xmlGetUTF8Char(content + i, &clen);
 7835|       |
 7836|  35.9M|        if ((c < 0) || (!IS_CHAR(c))) {
  ------------------
  |  |  115|  35.8M|#define IS_CHAR(c)   xmlIsCharQ(c)
  |  |  ------------------
  |  |  |  |  117|  35.8M|#define xmlIsCharQ(c)		(((c) < 0x100) ? \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (117:25): [True: 18.2M, False: 17.6M]
  |  |  |  |  ------------------
  |  |  |  |  118|  35.8M|				 xmlIsChar_ch((c)) :\
  |  |  |  |  ------------------
  |  |  |  |  |  |  108|  18.2M|#define xmlIsChar_ch(c)		(((0x9 <= (c)) && ((c) <= 0xa)) || \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (108:28): [True: 18.1M, False: 54.9k]
  |  |  |  |  |  |  |  Branch (108:44): [True: 330k, False: 17.8M]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  109|  18.2M|				 ((c) == 0xd) || \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (109:6): [True: 211k, False: 17.6M]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  110|  18.2M|				  (0x20 <= (c)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (110:7): [True: 17.6M, False: 55.4k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  119|  35.8M|				(((0x100 <= (c)) && ((c) <= 0xd7ff)) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (119:7): [True: 17.6M, False: 0]
  |  |  |  |  |  Branch (119:25): [True: 17.5M, False: 14.2k]
  |  |  |  |  ------------------
  |  |  |  |  120|  17.6M|				 ((0xe000 <= (c)) && ((c) <= 0xfffd)) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (120:7): [True: 14.2k, False: 0]
  |  |  |  |  |  Branch (120:26): [True: 11.7k, False: 2.51k]
  |  |  |  |  ------------------
  |  |  |  |  121|  17.6M|				 ((0x10000 <= (c)) && ((c) <= 0x10ffff))))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (121:7): [True: 1.77k, False: 738]
  |  |  |  |  |  Branch (121:27): [True: 1.77k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (7836:13): [True: 133k, False: 35.8M]
  |  Branch (7836:24): [True: 56.1k, False: 35.7M]
  ------------------
 7837|   190k|            xmlFatalErrMsgInt(ctxt, XML_ERR_INVALID_CHAR,
 7838|   190k|                              "xmlLoadEntityContent: invalid char value %d\n",
 7839|   190k|                              content[i]);
 7840|   190k|            goto error;
 7841|   190k|        }
 7842|  35.7M|        i += clen;
 7843|  35.7M|    }
 7844|       |
 7845|    147|    xmlSaturatedAdd(&ctxt->sizeentities, length);
 7846|    147|    entity->content = content;
 7847|    147|    entity->length = length;
 7848|    147|    content = NULL;
 7849|    147|    ret = 0;
 7850|       |
 7851|   191k|error:
 7852|   382k|    while (ctxt->inputNr > 0)
  ------------------
  |  Branch (7852:12): [True: 191k, False: 191k]
  ------------------
 7853|   191k|        xmlFreeInputStream(xmlCtxtPopInput(ctxt));
 7854|   191k|    xmlFree(ctxt->inputTab);
 7855|   191k|    xmlFree(ctxt->encoding);
 7856|       |
 7857|   191k|    ctxt->input = oldinput;
 7858|   191k|    ctxt->inputNr = oldinputNr;
 7859|   191k|    ctxt->inputMax = oldinputMax;
 7860|   191k|    ctxt->inputTab = oldinputTab;
 7861|   191k|    ctxt->encoding = oldencoding;
 7862|       |
 7863|   191k|    xmlFree(content);
 7864|       |
 7865|   191k|    return(ret);
 7866|    147|}
parser.c:xmlSBufFinish:
  781|   317k|              const char *errMsg) {
  782|   317k|    if (buf->mem == NULL) {
  ------------------
  |  Branch (782:9): [True: 31.2k, False: 285k]
  ------------------
  783|  31.2k|        buf->mem = xmlMalloc(1);
  784|  31.2k|        if (buf->mem == NULL) {
  ------------------
  |  Branch (784:13): [True: 10, False: 31.2k]
  ------------------
  785|     10|            buf->code = XML_ERR_NO_MEMORY;
  786|  31.2k|        } else {
  787|  31.2k|            buf->mem[0] = 0;
  788|  31.2k|        }
  789|   285k|    } else {
  790|   285k|        buf->mem[buf->size] = 0;
  791|   285k|    }
  792|       |
  793|   317k|    if (buf->code == XML_ERR_OK) {
  ------------------
  |  Branch (793:9): [True: 316k, False: 72]
  ------------------
  794|   316k|        if (sizeOut != NULL)
  ------------------
  |  Branch (794:13): [True: 24.5k, False: 292k]
  ------------------
  795|  24.5k|            *sizeOut = buf->size;
  796|   316k|        return(buf->mem);
  797|   316k|    }
  798|       |
  799|     72|    xmlSBufReportError(buf, ctxt, errMsg);
  800|       |
  801|     72|    xmlFree(buf->mem);
  802|       |
  803|     72|    if (sizeOut != NULL)
  ------------------
  |  Branch (803:9): [True: 9, False: 63]
  ------------------
  804|      9|        *sizeOut = 0;
  805|       |    return(NULL);
  806|   317k|}
parser.c:xmlSBufReportError:
  772|    113|xmlSBufReportError(xmlSBuf *buf, xmlParserCtxtPtr ctxt, const char *errMsg) {
  773|    113|    if (buf->code == XML_ERR_NO_MEMORY)
  ------------------
  |  Branch (773:9): [True: 113, False: 0]
  ------------------
  774|    113|        xmlCtxtErrMemory(ctxt);
  775|      0|    else
  776|      0|        xmlFatalErr(ctxt, buf->code, errMsg);
  777|    113|}
parser.c:xmlSBufCleanup:
  809|   229k|xmlSBufCleanup(xmlSBuf *buf, xmlParserCtxtPtr ctxt, const char *errMsg) {
  810|   229k|    if (buf->code != XML_ERR_OK)
  ------------------
  |  Branch (810:9): [True: 41, False: 229k]
  ------------------
  811|     41|        xmlSBufReportError(buf, ctxt, errMsg);
  812|       |
  813|   229k|    xmlFree(buf->mem);
  814|   229k|}
parser.c:xmlExpandEntityInAttValue:
 3839|  1.52M|                          int *inSpace, int depth, int check) {
 3840|  1.52M|    int maxDepth = (ctxt->options & XML_PARSE_HUGE) ? 40 : 20;
  ------------------
  |  Branch (3840:20): [True: 1.08M, False: 444k]
  ------------------
 3841|  1.52M|    int c, chunkSize;
 3842|  1.52M|    int normChange = 0;
 3843|       |
 3844|  1.52M|    if (str == NULL)
  ------------------
  |  Branch (3844:9): [True: 276, False: 1.52M]
  ------------------
 3845|    276|        return(0);
 3846|       |
 3847|  1.52M|    depth += 1;
 3848|  1.52M|    if (depth > maxDepth) {
  ------------------
  |  Branch (3848:9): [True: 1, False: 1.52M]
  ------------------
 3849|      1|	xmlFatalErrMsg(ctxt, XML_ERR_RESOURCE_LIMIT,
 3850|      1|                       "Maximum entity nesting depth exceeded");
 3851|      1|	return(0);
 3852|      1|    }
 3853|       |
 3854|  1.52M|    if (pent != NULL) {
  ------------------
  |  Branch (3854:9): [True: 1.50M, False: 24.6k]
  ------------------
 3855|  1.50M|        if (pent->flags & XML_ENT_EXPANDING) {
  ------------------
  |  |   22|  1.50M|#define XML_ENT_EXPANDING   (1u << 3)
  ------------------
  |  Branch (3855:13): [True: 4, False: 1.50M]
  ------------------
 3856|      4|            xmlFatalErr(ctxt, XML_ERR_ENTITY_LOOP, NULL);
 3857|      4|            return(0);
 3858|      4|        }
 3859|       |
 3860|  1.50M|        if (check) {
  ------------------
  |  Branch (3860:13): [True: 1.49M, False: 6.37k]
  ------------------
 3861|  1.49M|            if (xmlParserEntityCheck(ctxt, pent->length))
  ------------------
  |  Branch (3861:17): [True: 51, False: 1.49M]
  ------------------
 3862|     51|                return(0);
 3863|  1.49M|        }
 3864|  1.50M|    }
 3865|       |
 3866|  1.52M|    chunkSize = 0;
 3867|       |
 3868|       |    /*
 3869|       |     * Note that entity values are already validated. No special
 3870|       |     * handling for multi-byte characters is needed.
 3871|       |     */
 3872|   295M|    while (!PARSER_STOPPED(ctxt)) {
  ------------------
  |  |   44|   295M|#define PARSER_STOPPED(ctxt) ((ctxt)->disableSAX > 1)
  ------------------
  |  Branch (3872:12): [True: 295M, False: 266]
  ------------------
 3873|   295M|        c = *str;
 3874|       |
 3875|   295M|	if (c != '&') {
  ------------------
  |  Branch (3875:6): [True: 292M, False: 3.29M]
  ------------------
 3876|   292M|            if (c == 0)
  ------------------
  |  Branch (3876:17): [True: 1.50M, False: 290M]
  ------------------
 3877|  1.50M|                break;
 3878|       |
 3879|       |            /*
 3880|       |             * If this function is called without an entity, it is used to
 3881|       |             * expand entities in an attribute content where less-than was
 3882|       |             * already unscaped and is allowed.
 3883|       |             */
 3884|   290M|            if ((pent != NULL) && (c == '<')) {
  ------------------
  |  Branch (3884:17): [True: 284M, False: 5.69M]
  |  Branch (3884:35): [True: 20.0k, False: 284M]
  ------------------
 3885|  20.0k|                xmlFatalErrMsgStr(ctxt, XML_ERR_LT_IN_ATTRIBUTE,
 3886|  20.0k|                        "'<' in entity '%s' is not allowed in attributes "
 3887|  20.0k|                        "values\n", pent->name);
 3888|  20.0k|                break;
 3889|  20.0k|            }
 3890|       |
 3891|   290M|            if (c <= 0x20) {
  ------------------
  |  Branch (3891:17): [True: 15.6M, False: 274M]
  ------------------
 3892|  15.6M|                if ((normalize) && (*inSpace)) {
  ------------------
  |  Branch (3892:21): [True: 114k, False: 15.5M]
  |  Branch (3892:36): [True: 25.9k, False: 89.0k]
  ------------------
 3893|       |                    /* Skip char */
 3894|  25.9k|                    if (chunkSize > 0) {
  ------------------
  |  Branch (3894:25): [True: 10.9k, False: 15.0k]
  ------------------
 3895|  10.9k|                        xmlSBufAddString(buf, str - chunkSize, chunkSize);
 3896|  10.9k|                        chunkSize = 0;
 3897|  10.9k|                    }
 3898|  25.9k|                    normChange = 1;
 3899|  15.6M|                } else if (c < 0x20) {
  ------------------
  |  Branch (3899:28): [True: 6.62M, False: 9.01M]
  ------------------
 3900|  6.62M|                    if (chunkSize > 0) {
  ------------------
  |  Branch (3900:25): [True: 1.05M, False: 5.56M]
  ------------------
 3901|  1.05M|                        xmlSBufAddString(buf, str - chunkSize, chunkSize);
 3902|  1.05M|                        chunkSize = 0;
 3903|  1.05M|                    }
 3904|       |
 3905|  6.62M|                    xmlSBufAddCString(buf, " ", 1);
 3906|  9.01M|                } else {
 3907|  9.01M|                    chunkSize += 1;
 3908|  9.01M|                }
 3909|       |
 3910|  15.6M|                *inSpace = 1;
 3911|   274M|            } else {
 3912|   274M|                chunkSize += 1;
 3913|   274M|                *inSpace = 0;
 3914|   274M|            }
 3915|       |
 3916|   290M|            str += 1;
 3917|   290M|        } else if (str[1] == '#') {
  ------------------
  |  Branch (3917:20): [True: 995k, False: 2.29M]
  ------------------
 3918|   995k|            int val;
 3919|       |
 3920|   995k|            if (chunkSize > 0) {
  ------------------
  |  Branch (3920:17): [True: 985k, False: 9.91k]
  ------------------
 3921|   985k|                xmlSBufAddString(buf, str - chunkSize, chunkSize);
 3922|   985k|                chunkSize = 0;
 3923|   985k|            }
 3924|       |
 3925|   995k|	    val = xmlParseStringCharRef(ctxt, &str);
 3926|   995k|	    if (val == 0) {
  ------------------
  |  Branch (3926:10): [True: 3, False: 995k]
  ------------------
 3927|      3|                if (pent != NULL)
  ------------------
  |  Branch (3927:21): [True: 3, False: 0]
  ------------------
 3928|      3|                    pent->content[0] = 0;
 3929|      3|                break;
 3930|      3|            }
 3931|       |
 3932|   995k|            if (val == ' ') {
  ------------------
  |  Branch (3932:17): [True: 4.59k, False: 990k]
  ------------------
 3933|  4.59k|                if ((normalize) && (*inSpace))
  ------------------
  |  Branch (3933:21): [True: 1.01k, False: 3.57k]
  |  Branch (3933:36): [True: 573, False: 446]
  ------------------
 3934|    573|                    normChange = 1;
 3935|  4.02k|                else
 3936|  4.02k|                    xmlSBufAddCString(buf, " ", 1);
 3937|  4.59k|                *inSpace = 1;
 3938|   990k|            } else {
 3939|   990k|                xmlSBufAddChar(buf, val);
 3940|   990k|                *inSpace = 0;
 3941|   990k|            }
 3942|  2.29M|	} else {
 3943|  2.29M|            xmlChar *name;
 3944|  2.29M|            xmlEntityPtr ent;
 3945|       |
 3946|  2.29M|            if (chunkSize > 0) {
  ------------------
  |  Branch (3946:17): [True: 1.22M, False: 1.06M]
  ------------------
 3947|  1.22M|                xmlSBufAddString(buf, str - chunkSize, chunkSize);
 3948|  1.22M|                chunkSize = 0;
 3949|  1.22M|            }
 3950|       |
 3951|  2.29M|	    name = xmlParseStringEntityRef(ctxt, &str);
 3952|  2.29M|            if (name == NULL) {
  ------------------
  |  Branch (3952:17): [True: 22, False: 2.29M]
  ------------------
 3953|     22|                if (pent != NULL)
  ------------------
  |  Branch (3953:21): [True: 21, False: 1]
  ------------------
 3954|     21|                    pent->content[0] = 0;
 3955|     22|                break;
 3956|     22|            }
 3957|       |
 3958|  2.29M|            ent = xmlLookupGeneralEntity(ctxt, name, /* inAttr */ 1);
 3959|  2.29M|            xmlFree(name);
 3960|       |
 3961|  2.29M|	    if ((ent != NULL) &&
  ------------------
  |  Branch (3961:10): [True: 2.21M, False: 84.0k]
  ------------------
 3962|  2.21M|		(ent->etype == XML_INTERNAL_PREDEFINED_ENTITY)) {
  ------------------
  |  Branch (3962:3): [True: 1.18M, False: 1.02M]
  ------------------
 3963|  1.18M|		if (ent->content == NULL) {
  ------------------
  |  Branch (3963:7): [True: 0, False: 1.18M]
  ------------------
 3964|      0|		    xmlFatalErrMsg(ctxt, XML_ERR_INTERNAL_ERROR,
 3965|      0|			    "predefined entity has no content\n");
 3966|      0|                    break;
 3967|      0|                }
 3968|       |
 3969|  1.18M|                xmlSBufAddString(buf, ent->content, ent->length);
 3970|       |
 3971|  1.18M|                *inSpace = 0;
 3972|  1.18M|	    } else if ((ent != NULL) && (ent->content != NULL)) {
  ------------------
  |  Branch (3972:17): [True: 1.02M, False: 84.0k]
  |  Branch (3972:34): [True: 1.02M, False: 331]
  ------------------
 3973|  1.02M|                if (pent != NULL)
  ------------------
  |  Branch (3973:21): [True: 1.02M, False: 1.37k]
  ------------------
 3974|  1.02M|                    pent->flags |= XML_ENT_EXPANDING;
  ------------------
  |  |   22|  1.02M|#define XML_ENT_EXPANDING   (1u << 3)
  ------------------
 3975|  1.02M|		normChange |= xmlExpandEntityInAttValue(ctxt, buf,
 3976|  1.02M|                        ent->content, ent, normalize, inSpace, depth, check);
 3977|  1.02M|                if (pent != NULL)
  ------------------
  |  Branch (3977:21): [True: 1.02M, False: 1.37k]
  ------------------
 3978|  1.02M|                    pent->flags &= ~XML_ENT_EXPANDING;
  ------------------
  |  |   22|  1.02M|#define XML_ENT_EXPANDING   (1u << 3)
  ------------------
 3979|  1.02M|	    }
 3980|  2.29M|        }
 3981|   295M|    }
 3982|       |
 3983|  1.52M|    if (chunkSize > 0)
  ------------------
  |  Branch (3983:9): [True: 981k, False: 547k]
  ------------------
 3984|   981k|        xmlSBufAddString(buf, str - chunkSize, chunkSize);
 3985|       |
 3986|  1.52M|    return(normChange);
 3987|  1.52M|}
parser.c:xmlParseStringEntityRef:
 7573|  2.31M|xmlParseStringEntityRef(xmlParserCtxtPtr ctxt, const xmlChar ** str) {
 7574|  2.31M|    xmlChar *name;
 7575|  2.31M|    const xmlChar *ptr;
 7576|  2.31M|    xmlChar cur;
 7577|       |
 7578|  2.31M|    if ((str == NULL) || (*str == NULL))
  ------------------
  |  Branch (7578:9): [True: 0, False: 2.31M]
  |  Branch (7578:26): [True: 0, False: 2.31M]
  ------------------
 7579|      0|        return(NULL);
 7580|  2.31M|    ptr = *str;
 7581|  2.31M|    cur = *ptr;
 7582|  2.31M|    if (cur != '&')
  ------------------
  |  Branch (7582:9): [True: 0, False: 2.31M]
  ------------------
 7583|      0|	return(NULL);
 7584|       |
 7585|  2.31M|    ptr++;
 7586|  2.31M|    name = xmlParseStringName(ctxt, &ptr);
 7587|  2.31M|    if (name == NULL) {
  ------------------
  |  Branch (7587:9): [True: 29, False: 2.31M]
  ------------------
 7588|     29|	xmlFatalErrMsg(ctxt, XML_ERR_NAME_REQUIRED,
 7589|     29|		       "xmlParseStringEntityRef: no name\n");
 7590|     29|	*str = ptr;
 7591|     29|	return(NULL);
 7592|     29|    }
 7593|  2.31M|    if (*ptr != ';') {
  ------------------
  |  Branch (7593:9): [True: 7, False: 2.31M]
  ------------------
 7594|      7|	xmlFatalErr(ctxt, XML_ERR_ENTITYREF_SEMICOL_MISSING, NULL);
 7595|      7|        xmlFree(name);
 7596|      7|	*str = ptr;
 7597|      7|	return(NULL);
 7598|      7|    }
 7599|  2.31M|    ptr++;
 7600|       |
 7601|  2.31M|    *str = ptr;
 7602|  2.31M|    return(name);
 7603|  2.31M|}
parser.c:xmlParseAttValueInternal:
 4056|   385k|                         int special, int isNamespace) {
 4057|   385k|    unsigned maxLength = (ctxt->options & XML_PARSE_HUGE) ?
  ------------------
  |  Branch (4057:26): [True: 175k, False: 209k]
  ------------------
 4058|   175k|                         XML_MAX_HUGE_LENGTH :
  ------------------
  |  |   55|   175k|#define XML_MAX_HUGE_LENGTH 1000000000
  ------------------
 4059|   385k|                         XML_MAX_TEXT_LENGTH;
  ------------------
  |  |   50|   595k|#define XML_MAX_TEXT_LENGTH 10000000
  ------------------
 4060|   385k|    xmlSBuf buf;
 4061|   385k|    xmlChar *ret;
 4062|   385k|    int c, l, quote, entFlags, chunkSize;
 4063|   385k|    int inSpace = 1;
 4064|   385k|    int replaceEntities;
 4065|   385k|    int normalize = (special & XML_SPECIAL_TYPE_MASK) > XML_ATTRIBUTE_CDATA;
  ------------------
  |  |   96|   385k|#define XML_SPECIAL_TYPE_MASK   (XML_SPECIAL_EXTERNAL - 1)
  |  |  ------------------
  |  |  |  |   95|   385k|#define XML_SPECIAL_EXTERNAL    (1 << 20)
  |  |  ------------------
  ------------------
 4066|   385k|    int attvalFlags = 0;
 4067|       |
 4068|       |    /* Always expand namespace URIs */
 4069|   385k|    replaceEntities = (ctxt->replaceEntities) || (isNamespace);
  ------------------
  |  Branch (4069:23): [True: 256k, False: 128k]
  |  Branch (4069:50): [True: 20.7k, False: 107k]
  ------------------
 4070|       |
 4071|   385k|    xmlSBufInit(&buf, maxLength);
 4072|       |
 4073|   385k|    GROW;
  ------------------
  |  | 2308|   385k|    if ((!PARSER_PROGRESSIVE(ctxt)) && \
  |  |  ------------------
  |  |  |  |   47|   385k|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|   385k|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2308:9): [True: 205k, False: 180k]
  |  |  ------------------
  |  | 2309|   385k|        (ctxt->input->end - ctxt->input->cur < INPUT_CHUNK)) \
  |  |  ------------------
  |  |  |  |   63|   205k|#define INPUT_CHUNK	250
  |  |  ------------------
  |  |  |  Branch (2309:9): [True: 58.8k, False: 146k]
  |  |  ------------------
  |  | 2310|   385k|	xmlParserGrow(ctxt);
  ------------------
 4074|       |
 4075|   385k|    quote = CUR;
  ------------------
  |  | 2262|   385k|#define CUR (*ctxt->input->cur)
  ------------------
 4076|   385k|    if ((quote != '"') && (quote != '\'')) {
  ------------------
  |  Branch (4076:9): [True: 243k, False: 141k]
  |  Branch (4076:27): [True: 5.34k, False: 238k]
  ------------------
 4077|  5.34k|	xmlFatalErr(ctxt, XML_ERR_ATTRIBUTE_NOT_STARTED, NULL);
 4078|  5.34k|	return(NULL);
 4079|  5.34k|    }
 4080|   380k|    NEXTL(1);
  ------------------
  |  | 2325|   380k|#define NEXTL(l) do {							\
  |  | 2326|   380k|    if (*(ctxt->input->cur) == '\n') {					\
  |  |  ------------------
  |  |  |  Branch (2326:9): [True: 0, False: 380k]
  |  |  ------------------
  |  | 2327|      0|	ctxt->input->line++; ctxt->input->col = 1;			\
  |  | 2328|   380k|    } else ctxt->input->col++;						\
  |  | 2329|   380k|    ctxt->input->cur += l;				\
  |  | 2330|   380k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2330:12): [Folded, False: 380k]
  |  |  ------------------
  ------------------
 4081|       |
 4082|   380k|    if (ctxt->inSubset == 0)
  ------------------
  |  Branch (4082:9): [True: 300k, False: 79.8k]
  ------------------
 4083|   300k|        entFlags = XML_ENT_CHECKED | XML_ENT_VALIDATED;
  ------------------
  |  |   20|   300k|#define XML_ENT_CHECKED     (1u << 1)
  ------------------
                      entFlags = XML_ENT_CHECKED | XML_ENT_VALIDATED;
  ------------------
  |  |   21|   300k|#define XML_ENT_VALIDATED   (1u << 2)
  ------------------
 4084|  79.8k|    else
 4085|  79.8k|        entFlags = XML_ENT_VALIDATED;
  ------------------
  |  |   21|  79.8k|#define XML_ENT_VALIDATED   (1u << 2)
  ------------------
 4086|       |
 4087|   380k|    inSpace = 1;
 4088|   380k|    chunkSize = 0;
 4089|       |
 4090|   155M|    while (1) {
  ------------------
  |  Branch (4090:12): [True: 155M, Folded]
  ------------------
 4091|   155M|        if (PARSER_STOPPED(ctxt))
  ------------------
  |  |   44|   155M|#define PARSER_STOPPED(ctxt) ((ctxt)->disableSAX > 1)
  |  |  ------------------
  |  |  |  Branch (44:30): [True: 140, False: 155M]
  |  |  ------------------
  ------------------
 4092|    140|            goto error;
 4093|       |
 4094|   155M|        if (CUR_PTR >= ctxt->input->end) {
  ------------------
  |  | 2264|   155M|#define CUR_PTR ctxt->input->cur
  ------------------
  |  Branch (4094:13): [True: 47.0k, False: 155M]
  ------------------
 4095|  47.0k|            xmlFatalErrMsg(ctxt, XML_ERR_ATTRIBUTE_NOT_FINISHED,
 4096|  47.0k|                           "AttValue: ' expected\n");
 4097|  47.0k|            goto error;
 4098|  47.0k|        }
 4099|       |
 4100|       |        /*
 4101|       |         * TODO: Check growth threshold
 4102|       |         */
 4103|   155M|        if (ctxt->input->end - CUR_PTR < 10)
  ------------------
  |  | 2264|   155M|#define CUR_PTR ctxt->input->cur
  ------------------
  |  Branch (4103:13): [True: 522k, False: 155M]
  ------------------
 4104|   522k|            GROW;
  ------------------
  |  | 2308|   522k|    if ((!PARSER_PROGRESSIVE(ctxt)) && \
  |  |  ------------------
  |  |  |  |   47|   522k|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|   522k|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2308:9): [True: 465k, False: 56.9k]
  |  |  ------------------
  |  | 2309|   522k|        (ctxt->input->end - ctxt->input->cur < INPUT_CHUNK)) \
  |  |  ------------------
  |  |  |  |   63|   465k|#define INPUT_CHUNK	250
  |  |  ------------------
  |  |  |  Branch (2309:9): [True: 465k, False: 0]
  |  |  ------------------
  |  | 2310|   522k|	xmlParserGrow(ctxt);
  ------------------
 4105|       |
 4106|   155M|        c = CUR;
  ------------------
  |  | 2262|   155M|#define CUR (*ctxt->input->cur)
  ------------------
 4107|       |
 4108|   155M|        if (c >= 0x80) {
  ------------------
  |  Branch (4108:13): [True: 62.6M, False: 93.1M]
  ------------------
 4109|  62.6M|            l = xmlUTF8MultibyteLen(ctxt, CUR_PTR,
  ------------------
  |  | 2264|  62.6M|#define CUR_PTR ctxt->input->cur
  ------------------
 4110|  62.6M|                    "invalid character in attribute value\n");
 4111|  62.6M|            if (l == 0) {
  ------------------
  |  Branch (4111:17): [True: 56.8M, False: 5.84M]
  ------------------
 4112|  56.8M|                if (chunkSize > 0) {
  ------------------
  |  Branch (4112:21): [True: 303k, False: 56.5M]
  ------------------
 4113|   303k|                    xmlSBufAddString(&buf, CUR_PTR - chunkSize, chunkSize);
  ------------------
  |  | 2264|   303k|#define CUR_PTR ctxt->input->cur
  ------------------
 4114|   303k|                    chunkSize = 0;
 4115|   303k|                }
 4116|  56.8M|                xmlSBufAddReplChar(&buf);
 4117|  56.8M|                NEXTL(1);
  ------------------
  |  | 2325|  56.8M|#define NEXTL(l) do {							\
  |  | 2326|  56.8M|    if (*(ctxt->input->cur) == '\n') {					\
  |  |  ------------------
  |  |  |  Branch (2326:9): [True: 0, False: 56.8M]
  |  |  ------------------
  |  | 2327|      0|	ctxt->input->line++; ctxt->input->col = 1;			\
  |  | 2328|  56.8M|    } else ctxt->input->col++;						\
  |  | 2329|  56.8M|    ctxt->input->cur += l;				\
  |  | 2330|  56.8M|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2330:12): [Folded, False: 56.8M]
  |  |  ------------------
  ------------------
 4118|  56.8M|            } else {
 4119|  5.84M|                chunkSize += l;
 4120|  5.84M|                NEXTL(l);
  ------------------
  |  | 2325|  5.84M|#define NEXTL(l) do {							\
  |  | 2326|  5.84M|    if (*(ctxt->input->cur) == '\n') {					\
  |  |  ------------------
  |  |  |  Branch (2326:9): [True: 0, False: 5.84M]
  |  |  ------------------
  |  | 2327|      0|	ctxt->input->line++; ctxt->input->col = 1;			\
  |  | 2328|  5.84M|    } else ctxt->input->col++;						\
  |  | 2329|  5.84M|    ctxt->input->cur += l;				\
  |  | 2330|  5.84M|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2330:12): [Folded, False: 5.84M]
  |  |  ------------------
  ------------------
 4121|  5.84M|            }
 4122|       |
 4123|  62.6M|            inSpace = 0;
 4124|  93.1M|        } else if (c != '&') {
  ------------------
  |  Branch (4124:20): [True: 92.2M, False: 922k]
  ------------------
 4125|  92.2M|            if (c > 0x20) {
  ------------------
  |  Branch (4125:17): [True: 57.6M, False: 34.5M]
  ------------------
 4126|  57.6M|                if (c == quote)
  ------------------
  |  Branch (4126:21): [True: 331k, False: 57.3M]
  ------------------
 4127|   331k|                    break;
 4128|       |
 4129|  57.3M|                if (c == '<')
  ------------------
  |  Branch (4129:21): [True: 608k, False: 56.7M]
  ------------------
 4130|   608k|                    xmlFatalErr(ctxt, XML_ERR_LT_IN_ATTRIBUTE, NULL);
 4131|       |
 4132|  57.3M|                chunkSize += 1;
 4133|  57.3M|                inSpace = 0;
 4134|  57.3M|            } else if (!IS_BYTE_CHAR(c)) {
  ------------------
  |  |  103|  34.5M|#define IS_BYTE_CHAR(c)	 xmlIsChar_ch(c)
  |  |  ------------------
  |  |  |  |  108|  34.5M|#define xmlIsChar_ch(c)		(((0x9 <= (c)) && ((c) <= 0xa)) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (108:28): [True: 9.99M, False: 24.5M]
  |  |  |  |  |  Branch (108:44): [True: 7.25M, False: 2.74M]
  |  |  |  |  ------------------
  |  |  |  |  109|  34.5M|				 ((c) == 0xd) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (109:6): [True: 602k, False: 26.7M]
  |  |  |  |  ------------------
  |  |  |  |  110|  34.5M|				  (0x20 <= (c)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (110:7): [True: 2.07M, False: 24.6M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 4135|  24.6M|                xmlFatalErrMsg(ctxt, XML_ERR_INVALID_CHAR,
 4136|  24.6M|                        "invalid character in attribute value\n");
 4137|  24.6M|                if (chunkSize > 0) {
  ------------------
  |  Branch (4137:21): [True: 74.5k, False: 24.5M]
  ------------------
 4138|  74.5k|                    xmlSBufAddString(&buf, CUR_PTR - chunkSize, chunkSize);
  ------------------
  |  | 2264|  74.5k|#define CUR_PTR ctxt->input->cur
  ------------------
 4139|  74.5k|                    chunkSize = 0;
 4140|  74.5k|                }
 4141|  24.6M|                xmlSBufAddReplChar(&buf);
 4142|  24.6M|                inSpace = 0;
 4143|  24.6M|            } else {
 4144|       |                /* Whitespace */
 4145|  9.92M|                if ((normalize) && (inSpace)) {
  ------------------
  |  Branch (4145:21): [True: 61.2k, False: 9.86M]
  |  Branch (4145:36): [True: 50.2k, False: 11.0k]
  ------------------
 4146|       |                    /* Skip char */
 4147|  50.2k|                    if (chunkSize > 0) {
  ------------------
  |  Branch (4147:25): [True: 1.23k, False: 49.0k]
  ------------------
 4148|  1.23k|                        xmlSBufAddString(&buf, CUR_PTR - chunkSize, chunkSize);
  ------------------
  |  | 2264|  1.23k|#define CUR_PTR ctxt->input->cur
  ------------------
 4149|  1.23k|                        chunkSize = 0;
 4150|  1.23k|                    }
 4151|  50.2k|                    attvalFlags |= XML_ATTVAL_NORM_CHANGE;
  ------------------
  |  |   99|  50.2k|#define XML_ATTVAL_NORM_CHANGE  (1 << 1)
  ------------------
 4152|  9.87M|                } else if (c < 0x20) {
  ------------------
  |  Branch (4152:28): [True: 7.81M, False: 2.06M]
  ------------------
 4153|       |                    /* Convert to space */
 4154|  7.81M|                    if (chunkSize > 0) {
  ------------------
  |  Branch (4154:25): [True: 325k, False: 7.48M]
  ------------------
 4155|   325k|                        xmlSBufAddString(&buf, CUR_PTR - chunkSize, chunkSize);
  ------------------
  |  | 2264|   325k|#define CUR_PTR ctxt->input->cur
  ------------------
 4156|   325k|                        chunkSize = 0;
 4157|   325k|                    }
 4158|       |
 4159|  7.81M|                    xmlSBufAddCString(&buf, " ", 1);
 4160|  7.81M|                } else {
 4161|  2.06M|                    chunkSize += 1;
 4162|  2.06M|                }
 4163|       |
 4164|  9.92M|                inSpace = 1;
 4165|       |
 4166|  9.92M|                if ((c == 0xD) && (NXT(1) == 0xA))
  ------------------
  |  | 2263|   602k|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
  |  Branch (4166:21): [True: 602k, False: 9.32M]
  |  Branch (4166:35): [True: 162k, False: 440k]
  ------------------
 4167|   162k|                    CUR_PTR++;
  ------------------
  |  | 2264|   162k|#define CUR_PTR ctxt->input->cur
  ------------------
 4168|  9.92M|            }
 4169|       |
 4170|  91.9M|            NEXTL(1);
  ------------------
  |  | 2325|  91.9M|#define NEXTL(l) do {							\
  |  | 2326|  91.9M|    if (*(ctxt->input->cur) == '\n') {					\
  |  |  ------------------
  |  |  |  Branch (2326:9): [True: 7.14M, False: 84.7M]
  |  |  ------------------
  |  | 2327|  7.14M|	ctxt->input->line++; ctxt->input->col = 1;			\
  |  | 2328|  84.7M|    } else ctxt->input->col++;						\
  |  | 2329|  91.9M|    ctxt->input->cur += l;				\
  |  | 2330|  91.9M|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2330:12): [Folded, False: 91.9M]
  |  |  ------------------
  ------------------
 4171|  91.9M|        } else if (NXT(1) == '#') {
  ------------------
  |  | 2263|   922k|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
  |  Branch (4171:20): [True: 43.3k, False: 879k]
  ------------------
 4172|  43.3k|            int val;
 4173|       |
 4174|  43.3k|            if (chunkSize > 0) {
  ------------------
  |  Branch (4174:17): [True: 33.6k, False: 9.68k]
  ------------------
 4175|  33.6k|                xmlSBufAddString(&buf, CUR_PTR - chunkSize, chunkSize);
  ------------------
  |  | 2264|  33.6k|#define CUR_PTR ctxt->input->cur
  ------------------
 4176|  33.6k|                chunkSize = 0;
 4177|  33.6k|            }
 4178|       |
 4179|  43.3k|            val = xmlParseCharRef(ctxt);
 4180|  43.3k|            if (val == 0)
  ------------------
  |  Branch (4180:17): [True: 1.59k, False: 41.7k]
  ------------------
 4181|  1.59k|                goto error;
 4182|       |
 4183|  41.7k|            if ((val == '&') && (!replaceEntities)) {
  ------------------
  |  Branch (4183:17): [True: 3.66k, False: 38.1k]
  |  Branch (4183:33): [True: 1.93k, False: 1.72k]
  ------------------
 4184|       |                /*
 4185|       |                 * The reparsing will be done in xmlNodeParseContent()
 4186|       |                 * called from SAX2.c
 4187|       |                 */
 4188|  1.93k|                xmlSBufAddCString(&buf, "&#38;", 5);
 4189|  1.93k|                inSpace = 0;
 4190|  39.8k|            } else if (val == ' ') {
  ------------------
  |  Branch (4190:24): [True: 1.60k, False: 38.2k]
  ------------------
 4191|  1.60k|                if ((normalize) && (inSpace))
  ------------------
  |  Branch (4191:21): [True: 415, False: 1.18k]
  |  Branch (4191:36): [True: 199, False: 216]
  ------------------
 4192|    199|                    attvalFlags |= XML_ATTVAL_NORM_CHANGE;
  ------------------
  |  |   99|    199|#define XML_ATTVAL_NORM_CHANGE  (1 << 1)
  ------------------
 4193|  1.40k|                else
 4194|  1.40k|                    xmlSBufAddCString(&buf, " ", 1);
 4195|  1.60k|                inSpace = 1;
 4196|  38.2k|            } else {
 4197|  38.2k|                xmlSBufAddChar(&buf, val);
 4198|  38.2k|                inSpace = 0;
 4199|  38.2k|            }
 4200|   879k|        } else {
 4201|   879k|            const xmlChar *name;
 4202|   879k|            xmlEntityPtr ent;
 4203|       |
 4204|   879k|            if (chunkSize > 0) {
  ------------------
  |  Branch (4204:17): [True: 551k, False: 327k]
  ------------------
 4205|   551k|                xmlSBufAddString(&buf, CUR_PTR - chunkSize, chunkSize);
  ------------------
  |  | 2264|   551k|#define CUR_PTR ctxt->input->cur
  ------------------
 4206|   551k|                chunkSize = 0;
 4207|   551k|            }
 4208|       |
 4209|   879k|            name = xmlParseEntityRefInternal(ctxt);
 4210|   879k|            if (name == NULL) {
  ------------------
  |  Branch (4210:17): [True: 151k, False: 727k]
  ------------------
 4211|       |                /*
 4212|       |                 * Probably a literal '&' which wasn't escaped.
 4213|       |                 * TODO: Handle gracefully in recovery mode.
 4214|       |                 */
 4215|   151k|                continue;
 4216|   151k|            }
 4217|       |
 4218|   727k|            ent = xmlLookupGeneralEntity(ctxt, name, /* isAttr */ 1);
 4219|   727k|            if (ent == NULL)
  ------------------
  |  Branch (4219:17): [True: 185k, False: 542k]
  ------------------
 4220|   185k|                continue;
 4221|       |
 4222|   542k|            if (ent->etype == XML_INTERNAL_PREDEFINED_ENTITY) {
  ------------------
  |  Branch (4222:17): [True: 32.7k, False: 509k]
  ------------------
 4223|  32.7k|                if ((ent->content[0] == '&') && (!replaceEntities))
  ------------------
  |  Branch (4223:21): [True: 2.34k, False: 30.4k]
  |  Branch (4223:49): [True: 1.48k, False: 860]
  ------------------
 4224|  1.48k|                    xmlSBufAddCString(&buf, "&#38;", 5);
 4225|  31.2k|                else
 4226|  31.2k|                    xmlSBufAddString(&buf, ent->content, ent->length);
 4227|  32.7k|                inSpace = 0;
 4228|   509k|            } else if (replaceEntities) {
  ------------------
  |  Branch (4228:24): [True: 476k, False: 33.0k]
  ------------------
 4229|   476k|                if (xmlExpandEntityInAttValue(ctxt, &buf,
  ------------------
  |  Branch (4229:21): [True: 7.18k, False: 469k]
  ------------------
 4230|   476k|                        ent->content, ent, normalize, &inSpace, ctxt->inputNr,
 4231|   476k|                        /* check */ 1) > 0)
 4232|  7.18k|                    attvalFlags |= XML_ATTVAL_NORM_CHANGE;
  ------------------
  |  |   99|  7.18k|#define XML_ATTVAL_NORM_CHANGE  (1 << 1)
  ------------------
 4233|   476k|            } else {
 4234|  33.0k|                if ((ent->flags & entFlags) != entFlags)
  ------------------
  |  Branch (4234:21): [True: 1.07k, False: 31.9k]
  ------------------
 4235|  1.07k|                    xmlCheckEntityInAttValue(ctxt, ent, ctxt->inputNr);
 4236|       |
 4237|  33.0k|                if (xmlParserEntityCheck(ctxt, ent->expandedSize)) {
  ------------------
  |  Branch (4237:21): [True: 117, False: 32.9k]
  ------------------
 4238|    117|                    ent->content[0] = 0;
 4239|    117|                    goto error;
 4240|    117|                }
 4241|       |
 4242|       |                /*
 4243|       |                 * Just output the reference
 4244|       |                 */
 4245|  32.9k|                xmlSBufAddCString(&buf, "&", 1);
 4246|  32.9k|                xmlSBufAddString(&buf, ent->name, xmlStrlen(ent->name));
 4247|  32.9k|                xmlSBufAddCString(&buf, ";", 1);
 4248|       |
 4249|  32.9k|                inSpace = 0;
 4250|  32.9k|            }
 4251|   542k|	}
 4252|   155M|    }
 4253|       |
 4254|   331k|    if ((buf.mem == NULL) && (outFlags != NULL)) {
  ------------------
  |  Branch (4254:9): [True: 280k, False: 50.5k]
  |  Branch (4254:30): [True: 177k, False: 103k]
  ------------------
 4255|   177k|        ret = (xmlChar *) CUR_PTR - chunkSize;
  ------------------
  |  | 2264|   177k|#define CUR_PTR ctxt->input->cur
  ------------------
 4256|       |
 4257|   177k|        if (attlen != NULL)
  ------------------
  |  Branch (4257:13): [True: 177k, False: 0]
  ------------------
 4258|   177k|            *attlen = chunkSize;
 4259|   177k|        if ((normalize) && (inSpace) && (chunkSize > 0)) {
  ------------------
  |  Branch (4259:13): [True: 2.94k, False: 174k]
  |  Branch (4259:28): [True: 694, False: 2.24k]
  |  Branch (4259:41): [True: 350, False: 344]
  ------------------
 4260|    350|            attvalFlags |= XML_ATTVAL_NORM_CHANGE;
  ------------------
  |  |   99|    350|#define XML_ATTVAL_NORM_CHANGE  (1 << 1)
  ------------------
 4261|    350|            *attlen -= 1;
 4262|    350|        }
 4263|       |
 4264|       |        /* Report potential error */
 4265|   177k|        xmlSBufCleanup(&buf, ctxt, "AttValue length too long");
 4266|   177k|    } else {
 4267|   154k|        if (chunkSize > 0)
  ------------------
  |  Branch (4267:13): [True: 130k, False: 23.3k]
  ------------------
 4268|   130k|            xmlSBufAddString(&buf, CUR_PTR - chunkSize, chunkSize);
  ------------------
  |  | 2264|   130k|#define CUR_PTR ctxt->input->cur
  ------------------
 4269|       |
 4270|   154k|        if ((normalize) && (inSpace) && (buf.size > 0)) {
  ------------------
  |  Branch (4270:13): [True: 1.57k, False: 152k]
  |  Branch (4270:28): [True: 295, False: 1.28k]
  |  Branch (4270:41): [True: 295, False: 0]
  ------------------
 4271|    295|            attvalFlags |= XML_ATTVAL_NORM_CHANGE;
  ------------------
  |  |   99|    295|#define XML_ATTVAL_NORM_CHANGE  (1 << 1)
  ------------------
 4272|    295|            buf.size--;
 4273|    295|        }
 4274|       |
 4275|   154k|        ret = xmlSBufFinish(&buf, attlen, ctxt, "AttValue length too long");
 4276|   154k|        attvalFlags |= XML_ATTVAL_ALLOC;
  ------------------
  |  |   98|   154k|#define XML_ATTVAL_ALLOC        (1 << 0)
  ------------------
 4277|       |
 4278|   154k|        if (ret != NULL) {
  ------------------
  |  Branch (4278:13): [True: 154k, False: 31]
  ------------------
 4279|   154k|            if (attlen != NULL)
  ------------------
  |  Branch (4279:17): [True: 24.5k, False: 129k]
  ------------------
 4280|  24.5k|                *attlen = buf.size;
 4281|   154k|        }
 4282|   154k|    }
 4283|       |
 4284|   331k|    if (outFlags != NULL)
  ------------------
  |  Branch (4284:9): [True: 201k, False: 129k]
  ------------------
 4285|   201k|        *outFlags = attvalFlags;
 4286|       |
 4287|   331k|    NEXTL(1);
  ------------------
  |  | 2325|   331k|#define NEXTL(l) do {							\
  |  | 2326|   331k|    if (*(ctxt->input->cur) == '\n') {					\
  |  |  ------------------
  |  |  |  Branch (2326:9): [True: 0, False: 331k]
  |  |  ------------------
  |  | 2327|      0|	ctxt->input->line++; ctxt->input->col = 1;			\
  |  | 2328|   331k|    } else ctxt->input->col++;						\
  |  | 2329|   331k|    ctxt->input->cur += l;				\
  |  | 2330|   331k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2330:12): [Folded, False: 331k]
  |  |  ------------------
  ------------------
 4288|       |
 4289|   331k|    return(ret);
 4290|       |
 4291|  48.9k|error:
 4292|  48.9k|    xmlSBufCleanup(&buf, ctxt, "AttValue length too long");
 4293|       |    return(NULL);
 4294|   380k|}
parser.c:xmlCheckEntityInAttValue:
 3729|  5.69k|xmlCheckEntityInAttValue(xmlParserCtxtPtr ctxt, xmlEntityPtr pent, int depth) {
 3730|  5.69k|    int maxDepth = (ctxt->options & XML_PARSE_HUGE) ? 40 : 20;
  ------------------
  |  Branch (3730:20): [True: 4.72k, False: 972]
  ------------------
 3731|  5.69k|    const xmlChar *str;
 3732|  5.69k|    unsigned long expandedSize = pent->length;
 3733|  5.69k|    int c, flags;
 3734|       |
 3735|  5.69k|    depth += 1;
 3736|  5.69k|    if (depth > maxDepth) {
  ------------------
  |  Branch (3736:9): [True: 1, False: 5.69k]
  ------------------
 3737|      1|	xmlFatalErrMsg(ctxt, XML_ERR_RESOURCE_LIMIT,
 3738|      1|                       "Maximum entity nesting depth exceeded");
 3739|      1|	return;
 3740|      1|    }
 3741|       |
 3742|  5.69k|    if (pent->flags & XML_ENT_EXPANDING) {
  ------------------
  |  |   22|  5.69k|#define XML_ENT_EXPANDING   (1u << 3)
  ------------------
  |  Branch (3742:9): [True: 18, False: 5.67k]
  ------------------
 3743|     18|        xmlFatalErr(ctxt, XML_ERR_ENTITY_LOOP, NULL);
 3744|     18|        return;
 3745|     18|    }
 3746|       |
 3747|       |    /*
 3748|       |     * If we're parsing a default attribute value in DTD content,
 3749|       |     * the entity might reference other entities which weren't
 3750|       |     * defined yet, so the check isn't reliable.
 3751|       |     */
 3752|  5.67k|    if (ctxt->inSubset == 0)
  ------------------
  |  Branch (3752:9): [True: 5.46k, False: 211]
  ------------------
 3753|  5.46k|        flags = XML_ENT_CHECKED | XML_ENT_VALIDATED;
  ------------------
  |  |   20|  5.46k|#define XML_ENT_CHECKED     (1u << 1)
  ------------------
                      flags = XML_ENT_CHECKED | XML_ENT_VALIDATED;
  ------------------
  |  |   21|  5.46k|#define XML_ENT_VALIDATED   (1u << 2)
  ------------------
 3754|    211|    else
 3755|    211|        flags = XML_ENT_VALIDATED;
  ------------------
  |  |   21|    211|#define XML_ENT_VALIDATED   (1u << 2)
  ------------------
 3756|       |
 3757|  5.67k|    str = pent->content;
 3758|  5.67k|    if (str == NULL)
  ------------------
  |  Branch (3758:9): [True: 4, False: 5.67k]
  ------------------
 3759|      4|        goto done;
 3760|       |
 3761|       |    /*
 3762|       |     * Note that entity values are already validated. We only check
 3763|       |     * for illegal less-than signs and compute the expanded size
 3764|       |     * of the entity. No special handling for multi-byte characters
 3765|       |     * is needed.
 3766|       |     */
 3767|  26.9M|    while (!PARSER_STOPPED(ctxt)) {
  ------------------
  |  |   44|  26.9M|#define PARSER_STOPPED(ctxt) ((ctxt)->disableSAX > 1)
  ------------------
  |  Branch (3767:12): [True: 26.9M, False: 127]
  ------------------
 3768|  26.9M|        c = *str;
 3769|       |
 3770|  26.9M|	if (c != '&') {
  ------------------
  |  Branch (3770:6): [True: 26.9M, False: 18.3k]
  ------------------
 3771|  26.9M|            if (c == 0)
  ------------------
  |  Branch (3771:17): [True: 5.53k, False: 26.9M]
  ------------------
 3772|  5.53k|                break;
 3773|       |
 3774|  26.9M|            if (c == '<')
  ------------------
  |  Branch (3774:17): [True: 2.17k, False: 26.8M]
  ------------------
 3775|  2.17k|                xmlFatalErrMsgStr(ctxt, XML_ERR_LT_IN_ATTRIBUTE,
 3776|  2.17k|                        "'<' in entity '%s' is not allowed in attributes "
 3777|  2.17k|                        "values\n", pent->name);
 3778|       |
 3779|  26.9M|            str += 1;
 3780|  26.9M|        } else if (str[1] == '#') {
  ------------------
  |  Branch (3780:20): [True: 3.61k, False: 14.6k]
  ------------------
 3781|  3.61k|            int val;
 3782|       |
 3783|  3.61k|	    val = xmlParseStringCharRef(ctxt, &str);
 3784|  3.61k|	    if (val == 0) {
  ------------------
  |  Branch (3784:10): [True: 4, False: 3.61k]
  ------------------
 3785|      4|                pent->content[0] = 0;
 3786|      4|                break;
 3787|      4|            }
 3788|  14.6k|	} else {
 3789|  14.6k|            xmlChar *name;
 3790|  14.6k|            xmlEntityPtr ent;
 3791|       |
 3792|  14.6k|	    name = xmlParseStringEntityRef(ctxt, &str);
 3793|  14.6k|	    if (name == NULL) {
  ------------------
  |  Branch (3793:10): [True: 14, False: 14.6k]
  ------------------
 3794|     14|                pent->content[0] = 0;
 3795|     14|                break;
 3796|     14|            }
 3797|       |
 3798|  14.6k|            ent = xmlLookupGeneralEntity(ctxt, name, /* inAttr */ 1);
 3799|  14.6k|            xmlFree(name);
 3800|       |
 3801|  14.6k|            if ((ent != NULL) &&
  ------------------
  |  Branch (3801:17): [True: 9.83k, False: 4.83k]
  ------------------
 3802|  9.83k|                (ent->etype != XML_INTERNAL_PREDEFINED_ENTITY)) {
  ------------------
  |  Branch (3802:17): [True: 9.07k, False: 767]
  ------------------
 3803|  9.07k|                if ((ent->flags & flags) != flags) {
  ------------------
  |  Branch (3803:21): [True: 4.62k, False: 4.44k]
  ------------------
 3804|  4.62k|                    pent->flags |= XML_ENT_EXPANDING;
  ------------------
  |  |   22|  4.62k|#define XML_ENT_EXPANDING   (1u << 3)
  ------------------
 3805|  4.62k|                    xmlCheckEntityInAttValue(ctxt, ent, depth);
 3806|  4.62k|                    pent->flags &= ~XML_ENT_EXPANDING;
  ------------------
  |  |   22|  4.62k|#define XML_ENT_EXPANDING   (1u << 3)
  ------------------
 3807|  4.62k|                }
 3808|       |
 3809|  9.07k|                xmlSaturatedAdd(&expandedSize, ent->expandedSize);
 3810|  9.07k|                xmlSaturatedAdd(&expandedSize, XML_ENT_FIXED_COST);
  ------------------
  |  |  169|  9.07k|#define XML_ENT_FIXED_COST 20
  ------------------
 3811|  9.07k|            }
 3812|  14.6k|        }
 3813|  26.9M|    }
 3814|       |
 3815|  5.67k|done:
 3816|  5.67k|    if (ctxt->inSubset == 0)
  ------------------
  |  Branch (3816:9): [True: 5.46k, False: 211]
  ------------------
 3817|  5.46k|        pent->expandedSize = expandedSize;
 3818|       |
 3819|  5.67k|    pent->flags |= flags;
 3820|  5.67k|}
parser.c:xmlCurrentCharRecover:
 2337|  67.3M|xmlCurrentCharRecover(xmlParserCtxtPtr ctxt, int *len) {
 2338|  67.3M|    int c = xmlCurrentChar(ctxt, len);
 2339|       |
 2340|  67.3M|    if (c == XML_INVALID_CHAR)
  ------------------
  |  |    9|  67.3M|#define XML_INVALID_CHAR 0x200000
  ------------------
  |  Branch (2340:9): [True: 17.4M, False: 49.9M]
  ------------------
 2341|  17.4M|        c = 0xFFFD; /* replacement character */
 2342|       |
 2343|  67.3M|    return(c);
 2344|  67.3M|}
parser.c:xmlParseCharDataInternal:
 4570|  7.74M|xmlParseCharDataInternal(xmlParserCtxtPtr ctxt, int partial) {
 4571|  7.74M|    const xmlChar *in;
 4572|  7.74M|    int line = ctxt->input->line;
 4573|  7.74M|    int col = ctxt->input->col;
 4574|  7.74M|    int ccol;
 4575|  7.74M|    int terminate = 0;
 4576|       |
 4577|  7.74M|    GROW;
  ------------------
  |  | 2308|  7.74M|    if ((!PARSER_PROGRESSIVE(ctxt)) && \
  |  |  ------------------
  |  |  |  |   47|  7.74M|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|  7.74M|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2308:9): [True: 5.24M, False: 2.49M]
  |  |  ------------------
  |  | 2309|  7.74M|        (ctxt->input->end - ctxt->input->cur < INPUT_CHUNK)) \
  |  |  ------------------
  |  |  |  |   63|  5.24M|#define INPUT_CHUNK	250
  |  |  ------------------
  |  |  |  Branch (2309:9): [True: 44.6k, False: 5.20M]
  |  |  ------------------
  |  | 2310|  7.74M|	xmlParserGrow(ctxt);
  ------------------
 4578|       |    /*
 4579|       |     * Accelerated common case where input don't need to be
 4580|       |     * modified before passing it to the handler.
 4581|       |     */
 4582|  7.74M|    in = ctxt->input->cur;
 4583|  7.74M|    do {
 4584|  7.84M|get_more_space:
 4585|  8.03M|        while (*in == 0x20) { in++; ctxt->input->col++; }
  ------------------
  |  Branch (4585:16): [True: 183k, False: 7.84M]
  ------------------
 4586|  7.84M|        if (*in == 0xA) {
  ------------------
  |  Branch (4586:13): [True: 98.0k, False: 7.74M]
  ------------------
 4587|  4.22M|            do {
 4588|  4.22M|                ctxt->input->line++; ctxt->input->col = 1;
 4589|  4.22M|                in++;
 4590|  4.22M|            } while (*in == 0xA);
  ------------------
  |  Branch (4590:22): [True: 4.12M, False: 98.0k]
  ------------------
 4591|  98.0k|            goto get_more_space;
 4592|  98.0k|        }
 4593|  7.74M|        if (*in == '<') {
  ------------------
  |  Branch (4593:13): [True: 71.4k, False: 7.67M]
  ------------------
 4594|   142k|            while (in > ctxt->input->cur) {
  ------------------
  |  Branch (4594:20): [True: 71.4k, False: 71.4k]
  ------------------
 4595|  71.4k|                const xmlChar *tmp = ctxt->input->cur;
 4596|  71.4k|                size_t nbchar = in - tmp;
 4597|       |
 4598|  71.4k|                if (nbchar > XML_MAX_ITEMS)
  ------------------
  |  |   13|  71.4k|#define XML_MAX_ITEMS 1000000000 /* 1 billion */
  ------------------
  |  Branch (4598:21): [True: 0, False: 71.4k]
  ------------------
 4599|      0|                    nbchar = XML_MAX_ITEMS;
  ------------------
  |  |   13|      0|#define XML_MAX_ITEMS 1000000000 /* 1 billion */
  ------------------
 4600|  71.4k|                ctxt->input->cur += nbchar;
 4601|       |
 4602|  71.4k|                xmlCharacters(ctxt, tmp, nbchar, 1);
 4603|  71.4k|            }
 4604|  71.4k|            return;
 4605|  71.4k|        }
 4606|       |
 4607|  8.11M|get_more:
 4608|  8.11M|        ccol = ctxt->input->col;
 4609|  18.1M|        while (test_char_data[*in]) {
  ------------------
  |  Branch (4609:16): [True: 10.0M, False: 8.11M]
  ------------------
 4610|  10.0M|            in++;
 4611|  10.0M|            ccol++;
 4612|  10.0M|        }
 4613|  8.11M|        ctxt->input->col = ccol;
 4614|  8.11M|        if (*in == 0xA) {
  ------------------
  |  Branch (4614:13): [True: 49.1k, False: 8.06M]
  ------------------
 4615|  2.95M|            do {
 4616|  2.95M|                ctxt->input->line++; ctxt->input->col = 1;
 4617|  2.95M|                in++;
 4618|  2.95M|            } while (*in == 0xA);
  ------------------
  |  Branch (4618:22): [True: 2.90M, False: 49.1k]
  ------------------
 4619|  49.1k|            goto get_more;
 4620|  49.1k|        }
 4621|  8.06M|        if (*in == ']') {
  ------------------
  |  Branch (4621:13): [True: 384k, False: 7.67M]
  ------------------
 4622|   384k|            size_t avail = ctxt->input->end - in;
 4623|       |
 4624|   384k|            if (partial && avail < 2) {
  ------------------
  |  Branch (4624:17): [True: 351k, False: 32.9k]
  |  Branch (4624:28): [True: 69, False: 351k]
  ------------------
 4625|     69|                terminate = 1;
 4626|     69|                goto invoke_callback;
 4627|     69|            }
 4628|   384k|            if (in[1] == ']') {
  ------------------
  |  Branch (4628:17): [True: 330k, False: 53.9k]
  ------------------
 4629|   330k|                if (partial && avail < 3) {
  ------------------
  |  Branch (4629:21): [True: 317k, False: 12.8k]
  |  Branch (4629:32): [True: 351, False: 317k]
  ------------------
 4630|    351|                    terminate = 1;
 4631|    351|                    goto invoke_callback;
 4632|    351|                }
 4633|   330k|                if (in[2] == '>')
  ------------------
  |  Branch (4633:21): [True: 2.10k, False: 328k]
  ------------------
 4634|  2.10k|                    xmlFatalErr(ctxt, XML_ERR_MISPLACED_CDATA_END, NULL);
 4635|   330k|            }
 4636|       |
 4637|   384k|            in++;
 4638|   384k|            ctxt->input->col++;
 4639|   384k|            goto get_more;
 4640|   384k|        }
 4641|       |
 4642|  7.67M|invoke_callback:
 4643|  8.28M|        while (in > ctxt->input->cur) {
  ------------------
  |  Branch (4643:16): [True: 608k, False: 7.67M]
  ------------------
 4644|   608k|            const xmlChar *tmp = ctxt->input->cur;
 4645|   608k|            size_t nbchar = in - tmp;
 4646|       |
 4647|   608k|            if (nbchar > XML_MAX_ITEMS)
  ------------------
  |  |   13|   608k|#define XML_MAX_ITEMS 1000000000 /* 1 billion */
  ------------------
  |  Branch (4647:17): [True: 0, False: 608k]
  ------------------
 4648|      0|                nbchar = XML_MAX_ITEMS;
  ------------------
  |  |   13|      0|#define XML_MAX_ITEMS 1000000000 /* 1 billion */
  ------------------
 4649|   608k|            ctxt->input->cur += nbchar;
 4650|       |
 4651|   608k|            xmlCharacters(ctxt, tmp, nbchar, 0);
 4652|       |
 4653|   608k|            line = ctxt->input->line;
 4654|   608k|            col = ctxt->input->col;
 4655|   608k|        }
 4656|  7.67M|        ctxt->input->cur = in;
 4657|  7.67M|        if (*in == 0xD) {
  ------------------
  |  Branch (4657:13): [True: 11.8k, False: 7.66M]
  ------------------
 4658|  11.8k|            in++;
 4659|  11.8k|            if (*in == 0xA) {
  ------------------
  |  Branch (4659:17): [True: 5.61k, False: 6.18k]
  ------------------
 4660|  5.61k|                ctxt->input->cur = in;
 4661|  5.61k|                in++;
 4662|  5.61k|                ctxt->input->line++; ctxt->input->col = 1;
 4663|  5.61k|                continue; /* while */
 4664|  5.61k|            }
 4665|  6.18k|            in--;
 4666|  6.18k|        }
 4667|  7.67M|        if (*in == '<') {
  ------------------
  |  Branch (4667:13): [True: 494k, False: 7.17M]
  ------------------
 4668|   494k|            return;
 4669|   494k|        }
 4670|  7.17M|        if (*in == '&') {
  ------------------
  |  Branch (4670:13): [True: 39.8k, False: 7.13M]
  ------------------
 4671|  39.8k|            return;
 4672|  39.8k|        }
 4673|  7.13M|        if (terminate) {
  ------------------
  |  Branch (4673:13): [True: 420, False: 7.13M]
  ------------------
 4674|    420|            return;
 4675|    420|        }
 4676|  7.13M|        SHRINK;
  ------------------
  |  | 2304|  7.13M|    if (!PARSER_PROGRESSIVE(ctxt)) \
  |  |  ------------------
  |  |  |  |   47|  7.13M|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|  7.13M|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2304:9): [True: 4.79M, False: 2.34M]
  |  |  ------------------
  |  | 2305|  7.13M|	xmlParserShrink(ctxt);
  ------------------
 4677|  7.13M|        GROW;
  ------------------
  |  | 2308|  7.13M|    if ((!PARSER_PROGRESSIVE(ctxt)) && \
  |  |  ------------------
  |  |  |  |   47|  7.13M|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|  7.13M|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2308:9): [True: 4.79M, False: 2.34M]
  |  |  ------------------
  |  | 2309|  7.13M|        (ctxt->input->end - ctxt->input->cur < INPUT_CHUNK)) \
  |  |  ------------------
  |  |  |  |   63|  4.79M|#define INPUT_CHUNK	250
  |  |  ------------------
  |  |  |  Branch (2309:9): [True: 18.0k, False: 4.77M]
  |  |  ------------------
  |  | 2310|  7.13M|	xmlParserGrow(ctxt);
  ------------------
 4678|  7.13M|        in = ctxt->input->cur;
 4679|  7.14M|    } while (((*in >= 0x20) && (*in <= 0x7F)) ||
  ------------------
  |  Branch (4679:15): [True: 81.2k, False: 7.06M]
  |  Branch (4679:32): [True: 1.65k, False: 79.5k]
  ------------------
 4680|  7.14M|             (*in == 0x09) || (*in == 0x0a));
  ------------------
  |  Branch (4680:14): [True: 2.07k, False: 7.13M]
  |  Branch (4680:31): [True: 1.58k, False: 7.13M]
  ------------------
 4681|  7.13M|    ctxt->input->line = line;
 4682|  7.13M|    ctxt->input->col = col;
 4683|  7.13M|    xmlParseCharDataComplex(ctxt, partial);
 4684|  7.13M|}
parser.c:xmlCharacters:
 4524|   881k|              int isBlank) {
 4525|   881k|    int checkBlanks;
 4526|       |
 4527|   881k|    if ((ctxt->sax == NULL) || (ctxt->disableSAX))
  ------------------
  |  Branch (4527:9): [True: 0, False: 881k]
  |  Branch (4527:32): [True: 123k, False: 758k]
  ------------------
 4528|   123k|        return;
 4529|       |
 4530|   758k|    checkBlanks = (!ctxt->keepBlanks) ||
  ------------------
  |  Branch (4530:19): [True: 414k, False: 343k]
  ------------------
 4531|   343k|                  (ctxt->sax->ignorableWhitespace != ctxt->sax->characters);
  ------------------
  |  Branch (4531:19): [True: 0, False: 343k]
  ------------------
 4532|       |
 4533|       |    /*
 4534|       |     * Calling areBlanks with only parts of a text node
 4535|       |     * is fundamentally broken, making the NOBLANKS option
 4536|       |     * essentially unusable.
 4537|       |     */
 4538|   758k|    if ((checkBlanks) &&
  ------------------
  |  Branch (4538:9): [True: 414k, False: 343k]
  ------------------
 4539|   414k|        (areBlanks(ctxt, buf, size, isBlank))) {
  ------------------
  |  Branch (4539:9): [True: 11.5k, False: 402k]
  ------------------
 4540|  11.5k|        if ((ctxt->sax->ignorableWhitespace != NULL) &&
  ------------------
  |  Branch (4540:13): [True: 11.5k, False: 0]
  ------------------
 4541|  11.5k|            (ctxt->keepBlanks))
  ------------------
  |  Branch (4541:13): [True: 0, False: 11.5k]
  ------------------
 4542|      0|            ctxt->sax->ignorableWhitespace(ctxt->userData, buf, size);
 4543|   746k|    } else {
 4544|   746k|        if (ctxt->sax->characters != NULL)
  ------------------
  |  Branch (4544:13): [True: 746k, False: 0]
  ------------------
 4545|   746k|            ctxt->sax->characters(ctxt->userData, buf, size);
 4546|       |
 4547|       |        /*
 4548|       |         * The old code used to update this value for "complex" data
 4549|       |         * even if checkBlanks was false. This was probably a bug.
 4550|       |         */
 4551|   746k|        if ((checkBlanks) && (*ctxt->space == -1))
  ------------------
  |  Branch (4551:13): [True: 402k, False: 343k]
  |  Branch (4551:30): [True: 74.8k, False: 327k]
  ------------------
 4552|  74.8k|            *ctxt->space = -2;
 4553|   746k|    }
 4554|   758k|}
parser.c:areBlanks:
 2852|   414k|                     int blank_chars) {
 2853|   414k|    int i;
 2854|   414k|    xmlNodePtr lastChild;
 2855|       |
 2856|       |    /*
 2857|       |     * Check for xml:space value.
 2858|       |     */
 2859|   414k|    if ((ctxt->space == NULL) || (*(ctxt->space) == 1) ||
  ------------------
  |  Branch (2859:9): [True: 0, False: 414k]
  |  Branch (2859:34): [True: 200, False: 414k]
  ------------------
 2860|   414k|        (*(ctxt->space) == -2))
  ------------------
  |  Branch (2860:9): [True: 326k, False: 87.3k]
  ------------------
 2861|   326k|	return(0);
 2862|       |
 2863|       |    /*
 2864|       |     * Check that the string is made of blanks
 2865|       |     */
 2866|  87.3k|    if (blank_chars == 0) {
  ------------------
  |  Branch (2866:9): [True: 78.0k, False: 9.31k]
  ------------------
 2867|   188k|	for (i = 0;i < len;i++)
  ------------------
  |  Branch (2867:13): [True: 182k, False: 5.69k]
  ------------------
 2868|   182k|	    if (!(IS_BLANK_CH(str[i]))) return(0);
  ------------------
  |  |  137|   182k|#define IS_BLANK_CH(c)  xmlIsBlank_ch(c)
  |  |  ------------------
  |  |  |  |   90|   182k|#define xmlIsBlank_ch(c)	(((c) == 0x20) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (90:27): [True: 17.1k, False: 165k]
  |  |  |  |  ------------------
  |  |  |  |   91|   182k|				 ((0x9 <= (c)) && ((c) <= 0xa)) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (91:7): [True: 165k, False: 0]
  |  |  |  |  |  Branch (91:23): [True: 93.2k, False: 72.3k]
  |  |  |  |  ------------------
  |  |  |  |   92|   182k|				 ((c) == 0xd))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (92:6): [True: 0, False: 72.3k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2869|  78.0k|    }
 2870|       |
 2871|       |    /*
 2872|       |     * Look if the element is mixed content in the DTD if available
 2873|       |     */
 2874|  15.0k|    if (ctxt->node == NULL) return(0);
  ------------------
  |  Branch (2874:9): [True: 0, False: 15.0k]
  ------------------
 2875|  15.0k|    if (ctxt->myDoc != NULL) {
  ------------------
  |  Branch (2875:9): [True: 15.0k, False: 0]
  ------------------
 2876|  15.0k|        xmlElementPtr elemDecl = NULL;
 2877|  15.0k|        xmlDocPtr doc = ctxt->myDoc;
 2878|  15.0k|        const xmlChar *prefix = NULL;
 2879|       |
 2880|  15.0k|        if (ctxt->node->ns)
  ------------------
  |  Branch (2880:13): [True: 2.21k, False: 12.7k]
  ------------------
 2881|  2.21k|            prefix = ctxt->node->ns->prefix;
 2882|  15.0k|        if (doc->intSubset != NULL)
  ------------------
  |  Branch (2882:13): [True: 9.14k, False: 5.86k]
  ------------------
 2883|  9.14k|            elemDecl = xmlHashLookup2(doc->intSubset->elements, ctxt->node->name,
 2884|  9.14k|                                      prefix);
 2885|  15.0k|        if ((elemDecl == NULL) && (doc->extSubset != NULL))
  ------------------
  |  Branch (2885:13): [True: 12.3k, False: 2.68k]
  |  Branch (2885:35): [True: 741, False: 11.5k]
  ------------------
 2886|    741|            elemDecl = xmlHashLookup2(doc->extSubset->elements, ctxt->node->name,
 2887|    741|                                      prefix);
 2888|  15.0k|        if (elemDecl != NULL) {
  ------------------
  |  Branch (2888:13): [True: 2.73k, False: 12.2k]
  ------------------
 2889|  2.73k|            if (elemDecl->etype == XML_ELEMENT_TYPE_ELEMENT)
  ------------------
  |  Branch (2889:17): [True: 1.50k, False: 1.23k]
  ------------------
 2890|  1.50k|                return(1);
 2891|  1.23k|            if ((elemDecl->etype == XML_ELEMENT_TYPE_ANY) ||
  ------------------
  |  Branch (2891:17): [True: 282, False: 949]
  ------------------
 2892|    949|                (elemDecl->etype == XML_ELEMENT_TYPE_MIXED))
  ------------------
  |  Branch (2892:17): [True: 205, False: 744]
  ------------------
 2893|    487|                return(0);
 2894|  1.23k|        }
 2895|  15.0k|    }
 2896|       |
 2897|       |    /*
 2898|       |     * Otherwise, heuristic :-\
 2899|       |     *
 2900|       |     * When push parsing, we could be at the end of a chunk.
 2901|       |     * This makes the look-ahead and consequently the NOBLANKS
 2902|       |     * option unreliable.
 2903|       |     */
 2904|  13.0k|    if ((RAW != '<') && (RAW != 0xD)) return(0);
  ------------------
  |  | 2261|  13.0k|#define RAW (*ctxt->input->cur)
  ------------------
                  if ((RAW != '<') && (RAW != 0xD)) return(0);
  ------------------
  |  | 2261|  3.80k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (2904:9): [True: 3.80k, False: 9.21k]
  |  Branch (2904:25): [True: 1.47k, False: 2.32k]
  ------------------
 2905|  11.5k|    if ((ctxt->node->children == NULL) &&
  ------------------
  |  Branch (2905:9): [True: 8.58k, False: 2.95k]
  ------------------
 2906|  8.58k|	(RAW == '<') && (NXT(1) == '/')) return(0);
  ------------------
  |  | 2261|  8.58k|#define RAW (*ctxt->input->cur)
  ------------------
              	(RAW == '<') && (NXT(1) == '/')) return(0);
  ------------------
  |  | 2263|  6.73k|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
  |  Branch (2906:2): [True: 6.73k, False: 1.85k]
  |  Branch (2906:18): [True: 470, False: 6.26k]
  ------------------
 2907|       |
 2908|  11.0k|    lastChild = xmlGetLastChild(ctxt->node);
 2909|  11.0k|    if (lastChild == NULL) {
  ------------------
  |  Branch (2909:9): [True: 8.11k, False: 2.95k]
  ------------------
 2910|  8.11k|        if ((ctxt->node->type != XML_ELEMENT_NODE) &&
  ------------------
  |  Branch (2910:13): [True: 0, False: 8.11k]
  ------------------
 2911|      0|            (ctxt->node->content != NULL)) return(0);
  ------------------
  |  Branch (2911:13): [True: 0, False: 0]
  ------------------
 2912|  8.11k|    } else if (xmlNodeIsText(lastChild))
  ------------------
  |  Branch (2912:16): [True: 476, False: 2.47k]
  ------------------
 2913|    476|        return(0);
 2914|  2.47k|    else if ((ctxt->node->children != NULL) &&
  ------------------
  |  Branch (2914:14): [True: 2.47k, False: 0]
  ------------------
 2915|  2.47k|             (xmlNodeIsText(ctxt->node->children)))
  ------------------
  |  Branch (2915:14): [True: 499, False: 1.97k]
  ------------------
 2916|    499|        return(0);
 2917|  10.0k|    return(1);
 2918|  11.0k|}
parser.c:xmlParseCharDataComplex:
 4697|  7.13M|xmlParseCharDataComplex(xmlParserCtxtPtr ctxt, int partial) {
 4698|  7.13M|    xmlChar buf[XML_PARSER_BIG_BUFFER_SIZE + 5];
 4699|  7.13M|    int nbchar = 0;
 4700|  7.13M|    int cur, l;
 4701|       |
 4702|  7.13M|    cur = xmlCurrentCharRecover(ctxt, &l);
 4703|  22.7M|    while ((cur != '<') && /* checked */
  ------------------
  |  Branch (4703:12): [True: 22.7M, False: 48.0k]
  ------------------
 4704|  22.7M|           (cur != '&') &&
  ------------------
  |  Branch (4704:12): [True: 22.6M, False: 6.09k]
  ------------------
 4705|  22.6M|	   (IS_CHAR(cur))) {
  ------------------
  |  |  115|  22.6M|#define IS_CHAR(c)   xmlIsCharQ(c)
  |  |  ------------------
  |  |  |  |  117|  22.6M|#define xmlIsCharQ(c)		(((c) < 0x100) ? \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (117:25): [True: 11.3M, False: 11.3M]
  |  |  |  |  ------------------
  |  |  |  |  118|  22.6M|				 xmlIsChar_ch((c)) :\
  |  |  |  |  ------------------
  |  |  |  |  |  |  108|  11.3M|#define xmlIsChar_ch(c)		(((0x9 <= (c)) && ((c) <= 0xa)) || \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (108:28): [True: 4.37M, False: 7.01M]
  |  |  |  |  |  |  |  Branch (108:44): [True: 2.19M, False: 2.18M]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  109|  11.3M|				 ((c) == 0xd) || \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (109:6): [True: 0, False: 9.19M]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  110|  11.3M|				  (0x20 <= (c)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (110:7): [True: 2.11M, False: 7.08M]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  119|  22.6M|				(((0x100 <= (c)) && ((c) <= 0xd7ff)) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (119:7): [True: 11.3M, False: 0]
  |  |  |  |  |  Branch (119:25): [True: 5.31M, False: 5.99M]
  |  |  |  |  ------------------
  |  |  |  |  120|  11.3M|				 ((0xe000 <= (c)) && ((c) <= 0xfffd)) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (120:7): [True: 5.99M, False: 0]
  |  |  |  |  |  Branch (120:26): [True: 5.99M, False: 5.30k]
  |  |  |  |  ------------------
  |  |  |  |  121|  11.3M|				 ((0x10000 <= (c)) && ((c) <= 0x10ffff))))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (121:7): [True: 3.10k, False: 2.19k]
  |  |  |  |  |  Branch (121:27): [True: 3.10k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (4705:5): [True: 15.6M, False: 7.08M]
  ------------------
 4706|  15.6M|        if (cur == ']') {
  ------------------
  |  Branch (4706:13): [True: 232k, False: 15.3M]
  ------------------
 4707|   232k|            size_t avail = ctxt->input->end - ctxt->input->cur;
 4708|       |
 4709|   232k|            if (partial && avail < 2)
  ------------------
  |  Branch (4709:17): [True: 226k, False: 6.17k]
  |  Branch (4709:28): [True: 74, False: 226k]
  ------------------
 4710|     74|                break;
 4711|   232k|            if (NXT(1) == ']') {
  ------------------
  |  | 2263|   232k|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
  |  Branch (4711:17): [True: 217k, False: 15.3k]
  ------------------
 4712|   217k|                if (partial && avail < 3)
  ------------------
  |  Branch (4712:21): [True: 215k, False: 1.43k]
  |  Branch (4712:32): [True: 694, False: 215k]
  ------------------
 4713|    694|                    break;
 4714|   216k|                if (NXT(2) == '>')
  ------------------
  |  | 2263|   216k|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
  |  Branch (4714:21): [True: 835, False: 215k]
  ------------------
 4715|    835|                    xmlFatalErr(ctxt, XML_ERR_MISPLACED_CDATA_END, NULL);
 4716|   216k|            }
 4717|   232k|        }
 4718|       |
 4719|  15.6M|	COPY_BUF(buf, nbchar, cur);
  ------------------
  |  | 2333|  15.6M|    if (v < 0x80) b[i++] = v;						\
  |  |  ------------------
  |  |  |  Branch (2333:9): [True: 4.12M, False: 11.4M]
  |  |  ------------------
  |  | 2334|  15.6M|    else i += xmlCopyCharMultiByte(&b[i],v)
  ------------------
 4720|       |	/* move current position before possible calling of ctxt->sax->characters */
 4721|  15.6M|	NEXTL(l);
  ------------------
  |  | 2325|  15.6M|#define NEXTL(l) do {							\
  |  | 2326|  15.6M|    if (*(ctxt->input->cur) == '\n') {					\
  |  |  ------------------
  |  |  |  Branch (2326:9): [True: 2.15M, False: 13.4M]
  |  |  ------------------
  |  | 2327|  2.15M|	ctxt->input->line++; ctxt->input->col = 1;			\
  |  | 2328|  13.4M|    } else ctxt->input->col++;						\
  |  | 2329|  15.6M|    ctxt->input->cur += l;				\
  |  | 2330|  15.6M|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2330:12): [Folded, False: 15.6M]
  |  |  ------------------
  ------------------
 4722|  15.6M|	if (nbchar >= XML_PARSER_BIG_BUFFER_SIZE) {
  ------------------
  |  |  171|  15.6M|#define XML_PARSER_BIG_BUFFER_SIZE 300
  ------------------
  |  Branch (4722:6): [True: 118k, False: 15.4M]
  ------------------
 4723|   118k|	    buf[nbchar] = 0;
 4724|       |
 4725|   118k|            xmlCharacters(ctxt, buf, nbchar, 0);
 4726|   118k|	    nbchar = 0;
 4727|   118k|            SHRINK;
  ------------------
  |  | 2304|   118k|    if (!PARSER_PROGRESSIVE(ctxt)) \
  |  |  ------------------
  |  |  |  |   47|   118k|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|   118k|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2304:9): [True: 108k, False: 9.83k]
  |  |  ------------------
  |  | 2305|   118k|	xmlParserShrink(ctxt);
  ------------------
 4728|   118k|	}
 4729|  15.6M|	cur = xmlCurrentCharRecover(ctxt, &l);
 4730|  15.6M|    }
 4731|  7.13M|    if (nbchar != 0) {
  ------------------
  |  Branch (4731:9): [True: 83.5k, False: 7.05M]
  ------------------
 4732|  83.5k|        buf[nbchar] = 0;
 4733|       |
 4734|  83.5k|        xmlCharacters(ctxt, buf, nbchar, 0);
 4735|  83.5k|    }
 4736|       |    /*
 4737|       |     * cur == 0 can mean
 4738|       |     *
 4739|       |     * - End of buffer.
 4740|       |     * - An actual 0 character.
 4741|       |     * - An incomplete UTF-8 sequence. This is allowed if partial is set.
 4742|       |     */
 4743|  7.13M|    if (ctxt->input->cur < ctxt->input->end) {
  ------------------
  |  Branch (4743:9): [True: 7.13M, False: 5.00k]
  ------------------
 4744|  7.13M|        if ((cur == 0) && (CUR != 0)) {
  ------------------
  |  | 2262|  6.83M|#define CUR (*ctxt->input->cur)
  ------------------
  |  Branch (4744:13): [True: 6.83M, False: 297k]
  |  Branch (4744:27): [True: 612, False: 6.83M]
  ------------------
 4745|    612|            if (partial == 0) {
  ------------------
  |  Branch (4745:17): [True: 409, False: 203]
  ------------------
 4746|    409|                xmlFatalErrMsgInt(ctxt, XML_ERR_INVALID_CHAR,
 4747|    409|                        "Incomplete UTF-8 sequence starting with %02X\n", CUR);
  ------------------
  |  | 2262|    409|#define CUR (*ctxt->input->cur)
  ------------------
 4748|    409|                NEXTL(1);
  ------------------
  |  | 2325|    409|#define NEXTL(l) do {							\
  |  | 2326|    409|    if (*(ctxt->input->cur) == '\n') {					\
  |  |  ------------------
  |  |  |  Branch (2326:9): [True: 0, False: 409]
  |  |  ------------------
  |  | 2327|      0|	ctxt->input->line++; ctxt->input->col = 1;			\
  |  | 2328|    409|    } else ctxt->input->col++;						\
  |  | 2329|    409|    ctxt->input->cur += l;				\
  |  | 2330|    409|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2330:12): [Folded, False: 409]
  |  |  ------------------
  ------------------
 4749|    409|            }
 4750|  7.13M|        } else if ((cur != '<') && (cur != '&') && (cur != ']')) {
  ------------------
  |  Branch (4750:20): [True: 7.08M, False: 48.0k]
  |  Branch (4750:36): [True: 7.07M, False: 6.09k]
  |  Branch (4750:52): [True: 7.07M, False: 768]
  ------------------
 4751|       |            /* Generate the error and skip the offending character */
 4752|  7.07M|            xmlFatalErrMsgInt(ctxt, XML_ERR_INVALID_CHAR,
 4753|  7.07M|                              "PCDATA invalid Char value %d\n", cur);
 4754|  7.07M|            NEXTL(l);
  ------------------
  |  | 2325|  7.07M|#define NEXTL(l) do {							\
  |  | 2326|  7.07M|    if (*(ctxt->input->cur) == '\n') {					\
  |  |  ------------------
  |  |  |  Branch (2326:9): [True: 0, False: 7.07M]
  |  |  ------------------
  |  | 2327|      0|	ctxt->input->line++; ctxt->input->col = 1;			\
  |  | 2328|  7.07M|    } else ctxt->input->col++;						\
  |  | 2329|  7.07M|    ctxt->input->cur += l;				\
  |  | 2330|  7.07M|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2330:12): [Folded, False: 7.07M]
  |  |  ------------------
  ------------------
 4755|  7.07M|        }
 4756|  7.13M|    }
 4757|  7.13M|}
parser.c:xmlFatalErrMsgStr:
  348|   601k|{
  349|   601k|    xmlCtxtErr(ctxt, NULL, XML_FROM_PARSER, error, XML_ERR_FATAL,
  350|   601k|               val, NULL, NULL, 0, msg, val);
  351|   601k|}
parser.c:xmlParseCommentComplex:
 4856|   141k|                       size_t len, size_t size) {
 4857|   141k|    int q, ql;
 4858|   141k|    int r, rl;
 4859|   141k|    int cur, l;
 4860|   141k|    int maxLength = (ctxt->options & XML_PARSE_HUGE) ?
  ------------------
  |  Branch (4860:21): [True: 31.3k, False: 110k]
  ------------------
 4861|  31.3k|                    XML_MAX_HUGE_LENGTH :
  ------------------
  |  |   55|  31.3k|#define XML_MAX_HUGE_LENGTH 1000000000
  ------------------
 4862|   141k|                    XML_MAX_TEXT_LENGTH;
  ------------------
  |  |   50|   110k|#define XML_MAX_TEXT_LENGTH 10000000
  ------------------
 4863|       |
 4864|   141k|    if (buf == NULL) {
  ------------------
  |  Branch (4864:9): [True: 19.0k, False: 122k]
  ------------------
 4865|  19.0k|        len = 0;
 4866|  19.0k|	size = XML_PARSER_BUFFER_SIZE;
  ------------------
  |  |  172|  19.0k|#define XML_PARSER_BUFFER_SIZE 100
  ------------------
 4867|  19.0k|	buf = xmlMalloc(size);
 4868|  19.0k|	if (buf == NULL) {
  ------------------
  |  Branch (4868:6): [True: 4, False: 19.0k]
  ------------------
 4869|      4|	    xmlErrMemory(ctxt);
 4870|      4|	    return;
 4871|      4|	}
 4872|  19.0k|    }
 4873|   141k|    q = xmlCurrentCharRecover(ctxt, &ql);
 4874|   141k|    if (q == 0)
  ------------------
  |  Branch (4874:9): [True: 2.34k, False: 139k]
  ------------------
 4875|  2.34k|        goto not_terminated;
 4876|   139k|    if (!IS_CHAR(q)) {
  ------------------
  |  |  115|   139k|#define IS_CHAR(c)   xmlIsCharQ(c)
  |  |  ------------------
  |  |  |  |  117|   139k|#define xmlIsCharQ(c)		(((c) < 0x100) ? \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (117:25): [True: 64.6k, False: 74.8k]
  |  |  |  |  ------------------
  |  |  |  |  118|   139k|				 xmlIsChar_ch((c)) :\
  |  |  |  |  ------------------
  |  |  |  |  |  |  108|  64.6k|#define xmlIsChar_ch(c)		(((0x9 <= (c)) && ((c) <= 0xa)) || \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (108:28): [True: 64.1k, False: 558]
  |  |  |  |  |  |  |  Branch (108:44): [True: 61.4k, False: 2.64k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  109|  64.6k|				 ((c) == 0xd) || \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (109:6): [True: 0, False: 3.20k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  110|  64.6k|				  (0x20 <= (c)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (110:7): [True: 2.46k, False: 737]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  119|   139k|				(((0x100 <= (c)) && ((c) <= 0xd7ff)) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (119:7): [True: 74.8k, False: 0]
  |  |  |  |  |  Branch (119:25): [True: 9.88k, False: 64.9k]
  |  |  |  |  ------------------
  |  |  |  |  120|  74.8k|				 ((0xe000 <= (c)) && ((c) <= 0xfffd)) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (120:7): [True: 64.9k, False: 0]
  |  |  |  |  |  Branch (120:26): [True: 64.4k, False: 482]
  |  |  |  |  ------------------
  |  |  |  |  121|  74.8k|				 ((0x10000 <= (c)) && ((c) <= 0x10ffff))))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (121:7): [True: 279, False: 203]
  |  |  |  |  |  Branch (121:27): [True: 279, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (4876:9): [True: 940, False: 138k]
  ------------------
 4877|    940|        xmlFatalErrMsgInt(ctxt, XML_ERR_INVALID_CHAR,
 4878|    940|                          "xmlParseComment: invalid xmlChar value %d\n",
 4879|    940|	                  q);
 4880|    940|	xmlFree (buf);
 4881|    940|	return;
 4882|    940|    }
 4883|   138k|    NEXTL(ql);
  ------------------
  |  | 2325|   138k|#define NEXTL(l) do {							\
  |  | 2326|   138k|    if (*(ctxt->input->cur) == '\n') {					\
  |  |  ------------------
  |  |  |  Branch (2326:9): [True: 298, False: 138k]
  |  |  ------------------
  |  | 2327|    298|	ctxt->input->line++; ctxt->input->col = 1;			\
  |  | 2328|   138k|    } else ctxt->input->col++;						\
  |  | 2329|   138k|    ctxt->input->cur += l;				\
  |  | 2330|   138k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2330:12): [Folded, False: 138k]
  |  |  ------------------
  ------------------
 4884|   138k|    r = xmlCurrentCharRecover(ctxt, &rl);
 4885|   138k|    if (r == 0)
  ------------------
  |  Branch (4885:9): [True: 471, False: 138k]
  ------------------
 4886|    471|        goto not_terminated;
 4887|   138k|    if (!IS_CHAR(r)) {
  ------------------
  |  |  115|   138k|#define IS_CHAR(c)   xmlIsCharQ(c)
  |  |  ------------------
  |  |  |  |  117|   138k|#define xmlIsCharQ(c)		(((c) < 0x100) ? \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (117:25): [True: 103k, False: 34.1k]
  |  |  |  |  ------------------
  |  |  |  |  118|   138k|				 xmlIsChar_ch((c)) :\
  |  |  |  |  ------------------
  |  |  |  |  |  |  108|   103k|#define xmlIsChar_ch(c)		(((0x9 <= (c)) && ((c) <= 0xa)) || \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (108:28): [True: 103k, False: 326]
  |  |  |  |  |  |  |  Branch (108:44): [True: 85.2k, False: 18.3k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  109|   103k|				 ((c) == 0xd) || \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (109:6): [True: 0, False: 18.6k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  110|   103k|				  (0x20 <= (c)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (110:7): [True: 18.2k, False: 346]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  119|   138k|				(((0x100 <= (c)) && ((c) <= 0xd7ff)) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (119:7): [True: 34.1k, False: 0]
  |  |  |  |  |  Branch (119:25): [True: 3.13k, False: 31.0k]
  |  |  |  |  ------------------
  |  |  |  |  120|  34.1k|				 ((0xe000 <= (c)) && ((c) <= 0xfffd)) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (120:7): [True: 31.0k, False: 0]
  |  |  |  |  |  Branch (120:26): [True: 28.8k, False: 2.22k]
  |  |  |  |  ------------------
  |  |  |  |  121|  34.1k|				 ((0x10000 <= (c)) && ((c) <= 0x10ffff))))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (121:7): [True: 1.96k, False: 265]
  |  |  |  |  |  Branch (121:27): [True: 1.96k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (4887:9): [True: 611, False: 137k]
  ------------------
 4888|    611|        xmlFatalErrMsgInt(ctxt, XML_ERR_INVALID_CHAR,
 4889|    611|                          "xmlParseComment: invalid xmlChar value %d\n",
 4890|    611|	                  r);
 4891|    611|	xmlFree (buf);
 4892|    611|	return;
 4893|    611|    }
 4894|   137k|    NEXTL(rl);
  ------------------
  |  | 2325|   137k|#define NEXTL(l) do {							\
  |  | 2326|   137k|    if (*(ctxt->input->cur) == '\n') {					\
  |  |  ------------------
  |  |  |  Branch (2326:9): [True: 27.8k, False: 109k]
  |  |  ------------------
  |  | 2327|  27.8k|	ctxt->input->line++; ctxt->input->col = 1;			\
  |  | 2328|   109k|    } else ctxt->input->col++;						\
  |  | 2329|   137k|    ctxt->input->cur += l;				\
  |  | 2330|   137k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2330:12): [Folded, False: 137k]
  |  |  ------------------
  ------------------
 4895|   137k|    cur = xmlCurrentCharRecover(ctxt, &l);
 4896|   137k|    if (cur == 0)
  ------------------
  |  Branch (4896:9): [True: 451, False: 137k]
  ------------------
 4897|    451|        goto not_terminated;
 4898|  27.8M|    while (IS_CHAR(cur) && /* checked */
  ------------------
  |  |  115|  27.8M|#define IS_CHAR(c)   xmlIsCharQ(c)
  |  |  ------------------
  |  |  |  |  117|  55.6M|#define xmlIsCharQ(c)		(((c) < 0x100) ? \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (117:24): [True: 27.8M, False: 4.92k]
  |  |  |  |  |  Branch (117:25): [True: 19.4M, False: 8.32M]
  |  |  |  |  ------------------
  |  |  |  |  118|  55.6M|				 xmlIsChar_ch((c)) :\
  |  |  |  |  ------------------
  |  |  |  |  |  |  108|  19.4M|#define xmlIsChar_ch(c)		(((0x9 <= (c)) && ((c) <= 0xa)) || \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (108:28): [True: 19.4M, False: 4.48k]
  |  |  |  |  |  |  |  Branch (108:44): [True: 9.78M, False: 9.70M]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  109|  19.4M|				 ((c) == 0xd) || \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (109:6): [True: 0, False: 9.70M]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  110|  19.4M|				  (0x20 <= (c)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (110:7): [True: 9.70M, False: 4.59k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  119|  55.6M|				(((0x100 <= (c)) && ((c) <= 0xd7ff)) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (119:7): [True: 8.32M, False: 0]
  |  |  |  |  |  Branch (119:25): [True: 25.9k, False: 8.29M]
  |  |  |  |  ------------------
  |  |  |  |  120|  8.32M|				 ((0xe000 <= (c)) && ((c) <= 0xfffd)) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (120:7): [True: 8.29M, False: 0]
  |  |  |  |  |  Branch (120:26): [True: 8.29M, False: 2.93k]
  |  |  |  |  ------------------
  |  |  |  |  121|  8.32M|				 ((0x10000 <= (c)) && ((c) <= 0x10ffff))))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (121:7): [True: 2.61k, False: 329]
  |  |  |  |  |  Branch (121:27): [True: 2.61k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 4899|  27.8M|           ((cur != '>') ||
  ------------------
  |  Branch (4899:13): [True: 27.3M, False: 429k]
  ------------------
 4900|  27.6M|	    (r != '-') || (q != '-'))) {
  ------------------
  |  Branch (4900:6): [True: 249k, False: 180k]
  |  Branch (4900:20): [True: 47.9k, False: 132k]
  ------------------
 4901|  27.6M|	if ((r == '-') && (q == '-')) {
  ------------------
  |  Branch (4901:6): [True: 904k, False: 26.7M]
  |  Branch (4901:20): [True: 484k, False: 419k]
  ------------------
 4902|   484k|	    xmlFatalErr(ctxt, XML_ERR_HYPHEN_IN_COMMENT, NULL);
 4903|   484k|	}
 4904|  27.6M|	if (len + 5 >= size) {
  ------------------
  |  Branch (4904:6): [True: 76.7k, False: 27.6M]
  ------------------
 4905|  76.7k|	    xmlChar *tmp;
 4906|  76.7k|            int newSize;
 4907|       |
 4908|  76.7k|	    newSize = xmlGrowCapacity(size, 1, 1, maxLength);
 4909|  76.7k|            if (newSize < 0) {
  ------------------
  |  Branch (4909:17): [True: 0, False: 76.7k]
  ------------------
 4910|      0|                xmlFatalErrMsgStr(ctxt, XML_ERR_COMMENT_NOT_FINISHED,
 4911|      0|                             "Comment too big found", NULL);
 4912|      0|                xmlFree (buf);
 4913|      0|                return;
 4914|      0|            }
 4915|  76.7k|	    tmp = xmlRealloc(buf, newSize);
 4916|  76.7k|	    if (tmp == NULL) {
  ------------------
  |  Branch (4916:10): [True: 5, False: 76.7k]
  ------------------
 4917|      5|		xmlErrMemory(ctxt);
 4918|      5|		xmlFree(buf);
 4919|      5|		return;
 4920|      5|	    }
 4921|  76.7k|	    buf = tmp;
 4922|  76.7k|            size = newSize;
 4923|  76.7k|	}
 4924|  27.6M|	COPY_BUF(buf, len, q);
  ------------------
  |  | 2333|  27.6M|    if (v < 0x80) b[i++] = v;						\
  |  |  ------------------
  |  |  |  Branch (2333:9): [True: 18.7M, False: 8.89M]
  |  |  ------------------
  |  | 2334|  27.6M|    else i += xmlCopyCharMultiByte(&b[i],v)
  ------------------
 4925|       |
 4926|  27.6M|	q = r;
 4927|  27.6M|	ql = rl;
 4928|  27.6M|	r = cur;
 4929|  27.6M|	rl = l;
 4930|       |
 4931|  27.6M|	NEXTL(l);
  ------------------
  |  | 2325|  27.6M|#define NEXTL(l) do {							\
  |  | 2326|  27.6M|    if (*(ctxt->input->cur) == '\n') {					\
  |  |  ------------------
  |  |  |  Branch (2326:9): [True: 9.15M, False: 18.5M]
  |  |  ------------------
  |  | 2327|  9.15M|	ctxt->input->line++; ctxt->input->col = 1;			\
  |  | 2328|  18.5M|    } else ctxt->input->col++;						\
  |  | 2329|  27.6M|    ctxt->input->cur += l;				\
  |  | 2330|  27.6M|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2330:12): [Folded, False: 27.6M]
  |  |  ------------------
  ------------------
 4932|  27.6M|	cur = xmlCurrentCharRecover(ctxt, &l);
 4933|       |
 4934|  27.6M|    }
 4935|   137k|    buf[len] = 0;
 4936|   137k|    if (cur == 0) {
  ------------------
  |  Branch (4936:9): [True: 3.93k, False: 133k]
  ------------------
 4937|  3.93k|	xmlFatalErrMsgStr(ctxt, XML_ERR_COMMENT_NOT_FINISHED,
 4938|  3.93k|	                     "Comment not terminated \n<!--%.50s\n", buf);
 4939|   133k|    } else if (!IS_CHAR(cur)) {
  ------------------
  |  |  115|   133k|#define IS_CHAR(c)   xmlIsCharQ(c)
  |  |  ------------------
  |  |  |  |  117|   133k|#define xmlIsCharQ(c)		(((c) < 0x100) ? \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (117:25): [True: 132k, False: 329]
  |  |  |  |  ------------------
  |  |  |  |  118|   133k|				 xmlIsChar_ch((c)) :\
  |  |  |  |  ------------------
  |  |  |  |  |  |  108|   132k|#define xmlIsChar_ch(c)		(((0x9 <= (c)) && ((c) <= 0xa)) || \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (108:28): [True: 132k, False: 556]
  |  |  |  |  |  |  |  Branch (108:44): [True: 0, False: 132k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  109|   132k|				 ((c) == 0xd) || \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (109:6): [True: 0, False: 132k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  110|   132k|				  (0x20 <= (c)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (110:7): [True: 132k, False: 660]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  119|   133k|				(((0x100 <= (c)) && ((c) <= 0xd7ff)) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (119:7): [True: 329, False: 0]
  |  |  |  |  |  Branch (119:25): [True: 0, False: 329]
  |  |  |  |  ------------------
  |  |  |  |  120|    329|				 ((0xe000 <= (c)) && ((c) <= 0xfffd)) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (120:7): [True: 329, False: 0]
  |  |  |  |  |  Branch (120:26): [True: 0, False: 329]
  |  |  |  |  ------------------
  |  |  |  |  121|    329|				 ((0x10000 <= (c)) && ((c) <= 0x10ffff))))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (121:7): [True: 0, False: 329]
  |  |  |  |  |  Branch (121:27): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (4939:16): [True: 989, False: 132k]
  ------------------
 4940|    989|        xmlFatalErrMsgInt(ctxt, XML_ERR_INVALID_CHAR,
 4941|    989|                          "xmlParseComment: invalid xmlChar value %d\n",
 4942|    989|	                  cur);
 4943|   132k|    } else {
 4944|   132k|        NEXT;
  ------------------
  |  | 2316|   132k|#define NEXT xmlNextChar(ctxt)
  ------------------
 4945|   132k|	if ((ctxt->sax != NULL) && (ctxt->sax->comment != NULL) &&
  ------------------
  |  Branch (4945:6): [True: 132k, False: 0]
  |  Branch (4945:29): [True: 132k, False: 0]
  ------------------
 4946|   132k|	    (!ctxt->disableSAX))
  ------------------
  |  Branch (4946:6): [True: 125k, False: 6.28k]
  ------------------
 4947|   125k|	    ctxt->sax->comment(ctxt->userData, buf);
 4948|   132k|    }
 4949|   137k|    xmlFree(buf);
 4950|   137k|    return;
 4951|  3.26k|not_terminated:
 4952|  3.26k|    xmlFatalErrMsgStr(ctxt, XML_ERR_COMMENT_NOT_FINISHED,
 4953|       |			 "Comment not terminated\n", NULL);
 4954|  3.26k|    xmlFree(buf);
 4955|  3.26k|}
parser.c:xmlNsErr:
  384|   187k|{
  385|   187k|    ctxt->nsWellFormed = 0;
  386|       |
  387|       |    xmlCtxtErr(ctxt, NULL, XML_FROM_NAMESPACE, error, XML_ERR_ERROR,
  388|   187k|               info1, info2, info3, 0, msg, info1, info2, info3);
  389|   187k|}
parser.c:xmlSkipBlankCharsPE:
 2437|  1.40M|xmlSkipBlankCharsPE(xmlParserCtxtPtr ctxt) {
 2438|  1.40M|    int res = 0;
 2439|  1.40M|    int inParam;
 2440|  1.40M|    int expandParam;
 2441|       |
 2442|  1.40M|    inParam = PARSER_IN_PE(ctxt);
  ------------------
  |  |   50|  1.40M|    (((ctxt)->input->entity != NULL) && \
  |  |  ------------------
  |  |  |  Branch (50:6): [True: 1.17M, False: 224k]
  |  |  ------------------
  |  |   51|  1.40M|     (((ctxt)->input->entity->etype == XML_INTERNAL_PARAMETER_ENTITY) || \
  |  |  ------------------
  |  |  |  Branch (51:7): [True: 201k, False: 977k]
  |  |  ------------------
  |  |   52|  1.17M|      ((ctxt)->input->entity->etype == XML_EXTERNAL_PARAMETER_ENTITY)))
  |  |  ------------------
  |  |  |  Branch (52:7): [True: 977k, False: 0]
  |  |  ------------------
  ------------------
 2443|  1.40M|    expandParam = PARSER_EXTERNAL(ctxt);
  ------------------
  |  |   55|  1.40M|    (((ctxt)->inSubset == 2) || \
  |  |  ------------------
  |  |  |  Branch (55:6): [True: 220k, False: 1.18M]
  |  |  ------------------
  |  |   56|  1.40M|     (((ctxt)->input->entity != NULL) && \
  |  |  ------------------
  |  |  |  Branch (56:7): [True: 1.00M, False: 174k]
  |  |  ------------------
  |  |   57|  1.18M|      ((ctxt)->input->entity->etype == XML_EXTERNAL_PARAMETER_ENTITY)))
  |  |  ------------------
  |  |  |  Branch (57:7): [True: 973k, False: 34.1k]
  |  |  ------------------
  ------------------
 2444|       |
 2445|  1.40M|    if (!inParam && !expandParam)
  ------------------
  |  Branch (2445:9): [True: 224k, False: 1.17M]
  |  Branch (2445:21): [True: 174k, False: 49.7k]
  ------------------
 2446|   174k|        return(xmlSkipBlankChars(ctxt));
 2447|       |
 2448|       |    /*
 2449|       |     * It's Okay to use CUR/NEXT here since all the blanks are on
 2450|       |     * the ASCII range.
 2451|       |     */
 2452|  2.45M|    while (PARSER_STOPPED(ctxt) == 0) {
  ------------------
  |  |   44|  2.45M|#define PARSER_STOPPED(ctxt) ((ctxt)->disableSAX > 1)
  ------------------
  |  Branch (2452:12): [True: 2.45M, False: 371]
  ------------------
 2453|  2.45M|        if (IS_BLANK_CH(CUR)) { /* CHECKED tstblanks.xml */
  ------------------
  |  |  137|  2.45M|#define IS_BLANK_CH(c)  xmlIsBlank_ch(c)
  |  |  ------------------
  |  |  |  |   90|  2.45M|#define xmlIsBlank_ch(c)	(((c) == 0x20) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (90:27): [True: 917k, False: 1.53M]
  |  |  |  |  ------------------
  |  |  |  |   91|  2.45M|				 ((0x9 <= (c)) && ((c) <= 0xa)) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (91:7): [True: 1.46M, False: 78.5k]
  |  |  |  |  |  Branch (91:23): [True: 219k, False: 1.24M]
  |  |  |  |  ------------------
  |  |  |  |   92|  2.45M|				 ((c) == 0xd))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (92:6): [True: 48.8k, False: 1.27M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2454|  1.18M|            NEXT;
  ------------------
  |  | 2316|  1.18M|#define NEXT xmlNextChar(ctxt)
  ------------------
 2455|  1.27M|        } else if (CUR == '%') {
  ------------------
  |  | 2262|  1.27M|#define CUR (*ctxt->input->cur)
  ------------------
  |  Branch (2455:20): [True: 109k, False: 1.16M]
  ------------------
 2456|   109k|            if ((expandParam == 0) ||
  ------------------
  |  Branch (2456:17): [True: 24, False: 109k]
  ------------------
 2457|   109k|                (IS_BLANK_CH(NXT(1))) || (NXT(1) == 0))
  ------------------
  |  |  137|   109k|#define IS_BLANK_CH(c)  xmlIsBlank_ch(c)
  |  |  ------------------
  |  |  |  |   90|   109k|#define xmlIsBlank_ch(c)	(((c) == 0x20) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (90:27): [True: 77.3k, False: 31.7k]
  |  |  |  |  ------------------
  |  |  |  |   91|   109k|				 ((0x9 <= (c)) && ((c) <= 0xa)) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (91:7): [True: 30.3k, False: 1.48k]
  |  |  |  |  |  Branch (91:23): [True: 443, False: 29.8k]
  |  |  |  |  ------------------
  |  |  |  |   92|   109k|				 ((c) == 0xd))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (92:6): [True: 41, False: 31.3k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                              (IS_BLANK_CH(NXT(1))) || (NXT(1) == 0))
  ------------------
  |  | 2263|  31.3k|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
  |  Branch (2457:42): [True: 1.48k, False: 29.8k]
  ------------------
 2458|  79.3k|                break;
 2459|       |
 2460|       |            /*
 2461|       |             * Expand parameter entity. We continue to consume
 2462|       |             * whitespace at the start of the entity and possible
 2463|       |             * even consume the whole entity and pop it. We might
 2464|       |             * even pop multiple PEs in this loop.
 2465|       |             */
 2466|  29.8k|            xmlParsePERefInternal(ctxt, 0);
 2467|       |
 2468|  29.8k|            inParam = PARSER_IN_PE(ctxt);
  ------------------
  |  |   50|  29.8k|    (((ctxt)->input->entity != NULL) && \
  |  |  ------------------
  |  |  |  Branch (50:6): [True: 29.0k, False: 803]
  |  |  ------------------
  |  |   51|  29.8k|     (((ctxt)->input->entity->etype == XML_INTERNAL_PARAMETER_ENTITY) || \
  |  |  ------------------
  |  |  |  Branch (51:7): [True: 6.53k, False: 22.4k]
  |  |  ------------------
  |  |   52|  29.0k|      ((ctxt)->input->entity->etype == XML_EXTERNAL_PARAMETER_ENTITY)))
  |  |  ------------------
  |  |  |  Branch (52:7): [True: 22.4k, False: 0]
  |  |  ------------------
  ------------------
 2469|  29.8k|            expandParam = PARSER_EXTERNAL(ctxt);
  ------------------
  |  |   55|  29.8k|    (((ctxt)->inSubset == 2) || \
  |  |  ------------------
  |  |  |  Branch (55:6): [True: 5.73k, False: 24.0k]
  |  |  ------------------
  |  |   56|  29.8k|     (((ctxt)->input->entity != NULL) && \
  |  |  ------------------
  |  |  |  Branch (56:7): [True: 24.0k, False: 0]
  |  |  ------------------
  |  |   57|  24.0k|      ((ctxt)->input->entity->etype == XML_EXTERNAL_PARAMETER_ENTITY)))
  |  |  ------------------
  |  |  |  Branch (57:7): [True: 20.8k, False: 3.21k]
  |  |  ------------------
  ------------------
 2470|  1.16M|        } else if (CUR == 0) {
  ------------------
  |  | 2262|  1.16M|#define CUR (*ctxt->input->cur)
  ------------------
  |  Branch (2470:20): [True: 78.5k, False: 1.08M]
  ------------------
 2471|  78.5k|            if (inParam == 0)
  ------------------
  |  Branch (2471:17): [True: 187, False: 78.3k]
  ------------------
 2472|    187|                break;
 2473|       |
 2474|       |            /*
 2475|       |             * Don't pop parameter entities that start a markup
 2476|       |             * declaration to detect Well-formedness constraint:
 2477|       |             * PE Between Declarations.
 2478|       |             */
 2479|  78.3k|            if (ctxt->input->flags & XML_INPUT_MARKUP_DECL)
  ------------------
  |  |   42|  78.3k|#define XML_INPUT_MARKUP_DECL       (1u << 7)
  ------------------
  |  Branch (2479:17): [True: 64.9k, False: 13.4k]
  ------------------
 2480|  64.9k|                break;
 2481|       |
 2482|  13.4k|            xmlPopPE(ctxt);
 2483|       |
 2484|  13.4k|            inParam = PARSER_IN_PE(ctxt);
  ------------------
  |  |   50|  13.4k|    (((ctxt)->input->entity != NULL) && \
  |  |  ------------------
  |  |  |  Branch (50:6): [True: 10.0k, False: 3.37k]
  |  |  ------------------
  |  |   51|  13.4k|     (((ctxt)->input->entity->etype == XML_INTERNAL_PARAMETER_ENTITY) || \
  |  |  ------------------
  |  |  |  Branch (51:7): [True: 3, False: 10.0k]
  |  |  ------------------
  |  |   52|  10.0k|      ((ctxt)->input->entity->etype == XML_EXTERNAL_PARAMETER_ENTITY)))
  |  |  ------------------
  |  |  |  Branch (52:7): [True: 10.0k, False: 0]
  |  |  ------------------
  ------------------
 2485|  13.4k|            expandParam = PARSER_EXTERNAL(ctxt);
  ------------------
  |  |   55|  13.4k|    (((ctxt)->inSubset == 2) || \
  |  |  ------------------
  |  |  |  Branch (55:6): [True: 3.96k, False: 9.45k]
  |  |  ------------------
  |  |   56|  13.4k|     (((ctxt)->input->entity != NULL) && \
  |  |  ------------------
  |  |  |  Branch (56:7): [True: 9.45k, False: 6]
  |  |  ------------------
  |  |   57|  9.45k|      ((ctxt)->input->entity->etype == XML_EXTERNAL_PARAMETER_ENTITY)))
  |  |  ------------------
  |  |  |  Branch (57:7): [True: 9.45k, False: 0]
  |  |  ------------------
  ------------------
 2486|  1.08M|        } else {
 2487|  1.08M|            break;
 2488|  1.08M|        }
 2489|       |
 2490|       |        /*
 2491|       |         * Also increase the counter when entering or exiting a PERef.
 2492|       |         * The spec says: "When a parameter-entity reference is recognized
 2493|       |         * in the DTD and included, its replacement text MUST be enlarged
 2494|       |         * by the attachment of one leading and one following space (#x20)
 2495|       |         * character."
 2496|       |         */
 2497|  1.22M|        if (res < INT_MAX)
  ------------------
  |  Branch (2497:13): [True: 1.22M, False: 0]
  ------------------
 2498|  1.22M|            res++;
 2499|  1.22M|    }
 2500|       |
 2501|  1.22M|    return(res);
 2502|  1.40M|}
parser.c:xmlValidityError:
  294|   259k|{
  295|   259k|    ctxt->valid = 0;
  296|       |
  297|   259k|    xmlCtxtErr(ctxt, NULL, XML_FROM_DTD, error, XML_ERR_ERROR,
  298|       |               str1, str2, NULL, 0, msg, str1, str2);
  299|   259k|}
parser.c:xmlAddDefAttrs:
 1057|  23.3k|               const xmlChar *value) {
 1058|  23.3k|    xmlDefAttrsPtr defaults;
 1059|  23.3k|    xmlDefAttr *attr;
 1060|  23.3k|    int len, expandedSize;
 1061|  23.3k|    xmlHashedString name;
 1062|  23.3k|    xmlHashedString prefix;
 1063|  23.3k|    xmlHashedString hvalue;
 1064|  23.3k|    const xmlChar *localname;
 1065|       |
 1066|       |    /*
 1067|       |     * Allows to detect attribute redefinitions
 1068|       |     */
 1069|  23.3k|    if (ctxt->attsSpecial != NULL) {
  ------------------
  |  Branch (1069:9): [True: 20.3k, False: 3.01k]
  ------------------
 1070|  20.3k|        if (xmlHashLookup2(ctxt->attsSpecial, fullname, fullattr) != NULL)
  ------------------
  |  Branch (1070:13): [True: 11.9k, False: 8.36k]
  ------------------
 1071|  11.9k|	    return;
 1072|  20.3k|    }
 1073|       |
 1074|  11.3k|    if (ctxt->attsDefault == NULL) {
  ------------------
  |  Branch (1074:9): [True: 3.13k, False: 8.24k]
  ------------------
 1075|  3.13k|        ctxt->attsDefault = xmlHashCreateDict(10, ctxt->dict);
 1076|  3.13k|	if (ctxt->attsDefault == NULL)
  ------------------
  |  Branch (1076:6): [True: 3, False: 3.12k]
  ------------------
 1077|      3|	    goto mem_error;
 1078|  3.13k|    }
 1079|       |
 1080|       |    /*
 1081|       |     * split the element name into prefix:localname , the string found
 1082|       |     * are within the DTD and then not associated to namespace names.
 1083|       |     */
 1084|  11.3k|    localname = xmlSplitQName3(fullname, &len);
 1085|  11.3k|    if (localname == NULL) {
  ------------------
  |  Branch (1085:9): [True: 10.7k, False: 661]
  ------------------
 1086|  10.7k|        name = xmlDictLookupHashed(ctxt->dict, fullname, -1);
 1087|  10.7k|	prefix.name = NULL;
 1088|  10.7k|    } else {
 1089|    661|        name = xmlDictLookupHashed(ctxt->dict, localname, -1);
 1090|    661|	prefix = xmlDictLookupHashed(ctxt->dict, fullname, len);
 1091|    661|        if (prefix.name == NULL)
  ------------------
  |  Branch (1091:13): [True: 1, False: 660]
  ------------------
 1092|      1|            goto mem_error;
 1093|    661|    }
 1094|  11.3k|    if (name.name == NULL)
  ------------------
  |  Branch (1094:9): [True: 2, False: 11.3k]
  ------------------
 1095|      2|        goto mem_error;
 1096|       |
 1097|       |    /*
 1098|       |     * make sure there is some storage
 1099|       |     */
 1100|  11.3k|    defaults = xmlHashLookup2(ctxt->attsDefault, name.name, prefix.name);
 1101|  11.3k|    if ((defaults == NULL) ||
  ------------------
  |  Branch (1101:9): [True: 3.75k, False: 7.61k]
  ------------------
 1102|  7.61k|        (defaults->nbAttrs >= defaults->maxAttrs)) {
  ------------------
  |  Branch (1102:9): [True: 754, False: 6.85k]
  ------------------
 1103|  4.51k|        xmlDefAttrsPtr temp;
 1104|  4.51k|        int newSize;
 1105|       |
 1106|  4.51k|        if (defaults == NULL) {
  ------------------
  |  Branch (1106:13): [True: 3.75k, False: 754]
  ------------------
 1107|  3.75k|            newSize = 4;
 1108|  3.75k|        } else {
 1109|    754|            if ((defaults->maxAttrs >= XML_MAX_ATTRS) ||
  ------------------
  |  |   93|    754|#define XML_MAX_ATTRS 100000000 /* 100 million */
  ------------------
  |  Branch (1109:17): [True: 0, False: 754]
  ------------------
 1110|    754|                ((size_t) defaults->maxAttrs >
  ------------------
  |  Branch (1110:17): [True: 0, False: 754]
  ------------------
 1111|    754|                     SIZE_MAX / 2 / sizeof(temp[0]) - sizeof(*defaults)))
 1112|      0|                goto mem_error;
 1113|       |
 1114|    754|            if (defaults->maxAttrs > XML_MAX_ATTRS / 2)
  ------------------
  |  |   93|    754|#define XML_MAX_ATTRS 100000000 /* 100 million */
  ------------------
  |  Branch (1114:17): [True: 0, False: 754]
  ------------------
 1115|      0|                newSize = XML_MAX_ATTRS;
  ------------------
  |  |   93|      0|#define XML_MAX_ATTRS 100000000 /* 100 million */
  ------------------
 1116|    754|            else
 1117|    754|                newSize = defaults->maxAttrs * 2;
 1118|    754|        }
 1119|  4.51k|        temp = xmlRealloc(defaults,
 1120|  4.51k|                          sizeof(*defaults) + newSize * sizeof(xmlDefAttr));
 1121|  4.51k|	if (temp == NULL)
  ------------------
  |  Branch (1121:6): [True: 4, False: 4.50k]
  ------------------
 1122|      4|	    goto mem_error;
 1123|  4.50k|        if (defaults == NULL)
  ------------------
  |  Branch (1123:13): [True: 3.75k, False: 754]
  ------------------
 1124|  3.75k|            temp->nbAttrs = 0;
 1125|  4.50k|	temp->maxAttrs = newSize;
 1126|  4.50k|        defaults = temp;
 1127|  4.50k|	if (xmlHashUpdateEntry2(ctxt->attsDefault, name.name, prefix.name,
  ------------------
  |  Branch (1127:6): [True: 1, False: 4.50k]
  ------------------
 1128|  4.50k|	                        defaults, NULL) < 0) {
 1129|      1|	    xmlFree(defaults);
 1130|      1|	    goto mem_error;
 1131|      1|	}
 1132|  4.50k|    }
 1133|       |
 1134|       |    /*
 1135|       |     * Split the attribute name into prefix:localname , the string found
 1136|       |     * are within the DTD and hen not associated to namespace names.
 1137|       |     */
 1138|  11.3k|    localname = xmlSplitQName3(fullattr, &len);
 1139|  11.3k|    if (localname == NULL) {
  ------------------
  |  Branch (1139:9): [True: 7.96k, False: 3.39k]
  ------------------
 1140|  7.96k|        name = xmlDictLookupHashed(ctxt->dict, fullattr, -1);
 1141|  7.96k|	prefix.name = NULL;
 1142|  7.96k|    } else {
 1143|  3.39k|        name = xmlDictLookupHashed(ctxt->dict, localname, -1);
 1144|  3.39k|	prefix = xmlDictLookupHashed(ctxt->dict, fullattr, len);
 1145|  3.39k|        if (prefix.name == NULL)
  ------------------
  |  Branch (1145:13): [True: 1, False: 3.39k]
  ------------------
 1146|      1|            goto mem_error;
 1147|  3.39k|    }
 1148|  11.3k|    if (name.name == NULL)
  ------------------
  |  Branch (1148:9): [True: 2, False: 11.3k]
  ------------------
 1149|      2|        goto mem_error;
 1150|       |
 1151|       |    /* intern the string and precompute the end */
 1152|  11.3k|    len = strlen((const char *) value);
 1153|  11.3k|    hvalue = xmlDictLookupHashed(ctxt->dict, value, len);
 1154|  11.3k|    if (hvalue.name == NULL)
  ------------------
  |  Branch (1154:9): [True: 1, False: 11.3k]
  ------------------
 1155|      1|        goto mem_error;
 1156|       |
 1157|  11.3k|    expandedSize = strlen((const char *) name.name);
 1158|  11.3k|    if (prefix.name != NULL)
  ------------------
  |  Branch (1158:9): [True: 3.39k, False: 7.96k]
  ------------------
 1159|  3.39k|        expandedSize += strlen((const char *) prefix.name);
 1160|  11.3k|    expandedSize += len;
 1161|       |
 1162|  11.3k|    attr = &defaults->attrs[defaults->nbAttrs++];
 1163|  11.3k|    attr->name = name;
 1164|  11.3k|    attr->prefix = prefix;
 1165|  11.3k|    attr->value = hvalue;
 1166|  11.3k|    attr->valueEnd = hvalue.name + len;
 1167|  11.3k|    attr->external = PARSER_EXTERNAL(ctxt);
  ------------------
  |  |   55|  11.3k|    (((ctxt)->inSubset == 2) || \
  |  |  ------------------
  |  |  |  Branch (55:6): [True: 677, False: 10.6k]
  |  |  ------------------
  |  |   56|  11.3k|     (((ctxt)->input->entity != NULL) && \
  |  |  ------------------
  |  |  |  Branch (56:7): [True: 671, False: 10.0k]
  |  |  ------------------
  |  |   57|  10.6k|      ((ctxt)->input->entity->etype == XML_EXTERNAL_PARAMETER_ENTITY)))
  |  |  ------------------
  |  |  |  Branch (57:7): [True: 613, False: 58]
  |  |  ------------------
  ------------------
 1168|  11.3k|    attr->expandedSize = expandedSize;
 1169|       |
 1170|  11.3k|    return;
 1171|       |
 1172|     15|mem_error:
 1173|     15|    xmlErrMemory(ctxt);
 1174|     15|}
parser.c:xmlAddSpecialAttr:
 1189|  60.7k|{
 1190|  60.7k|    if (ctxt->attsSpecial == NULL) {
  ------------------
  |  Branch (1190:9): [True: 3.81k, False: 56.9k]
  ------------------
 1191|  3.81k|        ctxt->attsSpecial = xmlHashCreateDict(10, ctxt->dict);
 1192|  3.81k|	if (ctxt->attsSpecial == NULL)
  ------------------
  |  Branch (1192:6): [True: 2, False: 3.81k]
  ------------------
 1193|      2|	    goto mem_error;
 1194|  3.81k|    }
 1195|       |
 1196|  60.7k|    if (PARSER_EXTERNAL(ctxt))
  ------------------
  |  |   55|  60.7k|    (((ctxt)->inSubset == 2) || \
  |  |  ------------------
  |  |  |  Branch (55:6): [True: 26.7k, False: 33.9k]
  |  |  ------------------
  |  |   56|  60.7k|     (((ctxt)->input->entity != NULL) && \
  |  |  ------------------
  |  |  |  Branch (56:7): [True: 22.3k, False: 11.6k]
  |  |  ------------------
  |  |   57|  33.9k|      ((ctxt)->input->entity->etype == XML_EXTERNAL_PARAMETER_ENTITY)))
  |  |  ------------------
  |  |  |  Branch (57:7): [True: 18.6k, False: 3.65k]
  |  |  ------------------
  ------------------
 1197|  45.4k|        type |= XML_SPECIAL_EXTERNAL;
  ------------------
  |  |   95|  45.4k|#define XML_SPECIAL_EXTERNAL    (1 << 20)
  ------------------
 1198|       |
 1199|  60.7k|    if (xmlHashAdd2(ctxt->attsSpecial, fullname, fullattr,
  ------------------
  |  Branch (1199:9): [True: 1, False: 60.7k]
  ------------------
 1200|  60.7k|                    XML_INT_TO_PTR(type)) < 0)
  ------------------
  |  |   59|  60.7k|#define XML_INT_TO_PTR(i) ((void *) (XML_INTPTR_T) (i))
  ------------------
 1201|      1|        goto mem_error;
 1202|  60.7k|    return;
 1203|       |
 1204|  60.7k|mem_error:
 1205|      3|    xmlErrMemory(ctxt);
 1206|      3|}
parser.c:xmlSkipBlankCharsPEBalanced:
 6124|   823k|xmlSkipBlankCharsPEBalanced(xmlParserCtxt *ctxt, int openInputNr) {
 6125|   823k|    SKIP_BLANKS;
  ------------------
  |  | 2312|   823k|#define SKIP_BLANKS xmlSkipBlankChars(ctxt)
  ------------------
 6126|   823k|    GROW;
  ------------------
  |  | 2308|   823k|    if ((!PARSER_PROGRESSIVE(ctxt)) && \
  |  |  ------------------
  |  |  |  |   47|   823k|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|   823k|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2308:9): [True: 96.4k, False: 726k]
  |  |  ------------------
  |  | 2309|   823k|        (ctxt->input->end - ctxt->input->cur < INPUT_CHUNK)) \
  |  |  ------------------
  |  |  |  |   63|  96.4k|#define INPUT_CHUNK	250
  |  |  ------------------
  |  |  |  Branch (2309:9): [True: 64.2k, False: 32.1k]
  |  |  ------------------
  |  | 2310|   823k|	xmlParserGrow(ctxt);
  ------------------
 6127|       |
 6128|   823k|    (void) openInputNr;
 6129|       |
 6130|   823k|    if (!PARSER_EXTERNAL(ctxt) && !PARSER_IN_PE(ctxt))
  ------------------
  |  |   55|  1.64M|    (((ctxt)->inSubset == 2) || \
  |  |  ------------------
  |  |  |  Branch (55:6): [True: 33.5k, False: 789k]
  |  |  ------------------
  |  |   56|  1.64M|     (((ctxt)->input->entity != NULL) && \
  |  |  ------------------
  |  |  |  Branch (56:7): [True: 61.5k, False: 728k]
  |  |  ------------------
  |  |   57|   789k|      ((ctxt)->input->entity->etype == XML_EXTERNAL_PARAMETER_ENTITY)))
  |  |  ------------------
  |  |  |  Branch (57:7): [True: 36.7k, False: 24.8k]
  |  |  ------------------
  ------------------
                  if (!PARSER_EXTERNAL(ctxt) && !PARSER_IN_PE(ctxt))
  ------------------
  |  |   50|   753k|    (((ctxt)->input->entity != NULL) && \
  |  |  ------------------
  |  |  |  Branch (50:6): [True: 24.8k, False: 728k]
  |  |  ------------------
  |  |   51|   753k|     (((ctxt)->input->entity->etype == XML_INTERNAL_PARAMETER_ENTITY) || \
  |  |  ------------------
  |  |  |  Branch (51:7): [True: 24.8k, False: 0]
  |  |  ------------------
  |  |   52|  24.8k|      ((ctxt)->input->entity->etype == XML_EXTERNAL_PARAMETER_ENTITY)))
  |  |  ------------------
  |  |  |  Branch (52:7): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 6131|   728k|        return;
 6132|       |
 6133|   104k|    while (!PARSER_STOPPED(ctxt)) {
  ------------------
  |  |   44|   104k|#define PARSER_STOPPED(ctxt) ((ctxt)->disableSAX > 1)
  ------------------
  |  Branch (6133:12): [True: 104k, False: 255]
  ------------------
 6134|   104k|        if (ctxt->input->cur >= ctxt->input->end) {
  ------------------
  |  Branch (6134:13): [True: 3.88k, False: 100k]
  ------------------
 6135|  3.88k|#ifdef LIBXML_VALID_ENABLED
 6136|  3.88k|            if ((ctxt->validate) && (ctxt->inputNr <= openInputNr)) {
  ------------------
  |  Branch (6136:17): [True: 2.59k, False: 1.29k]
  |  Branch (6136:37): [True: 1.17k, False: 1.41k]
  ------------------
 6137|  1.17k|                xmlValidityError(ctxt, XML_ERR_ENTITY_BOUNDARY,
 6138|  1.17k|                                 "Element content declaration doesn't start "
 6139|  1.17k|                                 "and stop in the same entity\n",
 6140|  1.17k|                                 NULL, NULL);
 6141|  1.17k|            }
 6142|  3.88k|#endif
 6143|  3.88k|            if (PARSER_IN_PE(ctxt))
  ------------------
  |  |   50|  3.88k|    (((ctxt)->input->entity != NULL) && \
  |  |  ------------------
  |  |  |  Branch (50:6): [True: 3.83k, False: 56]
  |  |  ------------------
  |  |   51|  3.88k|     (((ctxt)->input->entity->etype == XML_INTERNAL_PARAMETER_ENTITY) || \
  |  |  ------------------
  |  |  |  Branch (51:7): [True: 1.47k, False: 2.35k]
  |  |  ------------------
  |  |   52|  3.83k|      ((ctxt)->input->entity->etype == XML_EXTERNAL_PARAMETER_ENTITY)))
  |  |  ------------------
  |  |  |  Branch (52:7): [True: 2.35k, False: 0]
  |  |  ------------------
  ------------------
 6144|  3.83k|                xmlPopPE(ctxt);
 6145|     56|            else
 6146|     56|                break;
 6147|   100k|        } else if (RAW == '%') {
  ------------------
  |  | 2261|   100k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (6147:20): [True: 5.71k, False: 94.8k]
  ------------------
 6148|  5.71k|            xmlParsePERefInternal(ctxt, 0);
 6149|  94.8k|        } else {
 6150|  94.8k|            break;
 6151|  94.8k|        }
 6152|       |
 6153|  9.55k|        SKIP_BLANKS;
  ------------------
  |  | 2312|  9.55k|#define SKIP_BLANKS xmlSkipBlankChars(ctxt)
  ------------------
 6154|  9.55k|        GROW;
  ------------------
  |  | 2308|  9.55k|    if ((!PARSER_PROGRESSIVE(ctxt)) && \
  |  |  ------------------
  |  |  |  |   47|  9.55k|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|  9.55k|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2308:9): [True: 8.68k, False: 864]
  |  |  ------------------
  |  | 2309|  9.55k|        (ctxt->input->end - ctxt->input->cur < INPUT_CHUNK)) \
  |  |  ------------------
  |  |  |  |   63|  8.68k|#define INPUT_CHUNK	250
  |  |  ------------------
  |  |  |  Branch (2309:9): [True: 6.87k, False: 1.80k]
  |  |  ------------------
  |  | 2310|  9.55k|	xmlParserGrow(ctxt);
  ------------------
 6155|  9.55k|    }
 6156|  95.1k|}
parser.c:xmlParseElementChildrenContentDeclPriv:
 6308|   101k|                                       int depth) {
 6309|   101k|    int maxDepth = (ctxt->options & XML_PARSE_HUGE) ? 2048 : 256;
  ------------------
  |  Branch (6309:20): [True: 83.9k, False: 17.0k]
  ------------------
 6310|   101k|    xmlElementContentPtr ret = NULL, cur = NULL, last = NULL, op = NULL;
 6311|   101k|    const xmlChar *elem;
 6312|   101k|    xmlChar type = 0;
 6313|       |
 6314|   101k|    if (depth > maxDepth) {
  ------------------
  |  Branch (6314:9): [True: 2, False: 101k]
  ------------------
 6315|      2|        xmlFatalErrMsgInt(ctxt, XML_ERR_RESOURCE_LIMIT,
 6316|      2|                "xmlParseElementChildrenContentDecl : depth %d too deep, "
 6317|      2|                "use XML_PARSE_HUGE\n", depth);
 6318|      2|	return(NULL);
 6319|      2|    }
 6320|   101k|    xmlSkipBlankCharsPEBalanced(ctxt, openInputNr);
 6321|   101k|    if (RAW == '(') {
  ------------------
  |  | 2261|   101k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (6321:9): [True: 27.2k, False: 73.8k]
  ------------------
 6322|  27.2k|        int newInputNr = ctxt->inputNr;
 6323|       |
 6324|       |        /* Recurse on first child */
 6325|  27.2k|	NEXT;
  ------------------
  |  | 2316|  27.2k|#define NEXT xmlNextChar(ctxt)
  ------------------
 6326|  27.2k|        cur = ret = xmlParseElementChildrenContentDeclPriv(ctxt, newInputNr,
 6327|  27.2k|                                                           depth + 1);
 6328|  27.2k|        if (cur == NULL)
  ------------------
  |  Branch (6328:13): [True: 25.4k, False: 1.81k]
  ------------------
 6329|  25.4k|            return(NULL);
 6330|  73.8k|    } else {
 6331|  73.8k|	elem = xmlParseName(ctxt);
 6332|  73.8k|	if (elem == NULL) {
  ------------------
  |  Branch (6332:6): [True: 429, False: 73.3k]
  ------------------
 6333|    429|	    xmlFatalErr(ctxt, XML_ERR_ELEMCONTENT_NOT_STARTED, NULL);
 6334|    429|	    return(NULL);
 6335|    429|	}
 6336|  73.3k|        cur = ret = xmlNewDocElementContent(ctxt->myDoc, elem, XML_ELEMENT_CONTENT_ELEMENT);
 6337|  73.3k|	if (cur == NULL) {
  ------------------
  |  Branch (6337:6): [True: 4, False: 73.3k]
  ------------------
 6338|      4|	    xmlErrMemory(ctxt);
 6339|      4|	    return(NULL);
 6340|      4|	}
 6341|  73.3k|	GROW;
  ------------------
  |  | 2308|  73.3k|    if ((!PARSER_PROGRESSIVE(ctxt)) && \
  |  |  ------------------
  |  |  |  |   47|  73.3k|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|  73.3k|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2308:9): [True: 7.96k, False: 65.4k]
  |  |  ------------------
  |  | 2309|  73.3k|        (ctxt->input->end - ctxt->input->cur < INPUT_CHUNK)) \
  |  |  ------------------
  |  |  |  |   63|  7.96k|#define INPUT_CHUNK	250
  |  |  ------------------
  |  |  |  Branch (2309:9): [True: 4.28k, False: 3.68k]
  |  |  ------------------
  |  | 2310|  73.3k|	xmlParserGrow(ctxt);
  ------------------
 6342|  73.3k|	if (RAW == '?') {
  ------------------
  |  | 2261|  73.3k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (6342:6): [True: 1.94k, False: 71.4k]
  ------------------
 6343|  1.94k|	    cur->ocur = XML_ELEMENT_CONTENT_OPT;
 6344|  1.94k|	    NEXT;
  ------------------
  |  | 2316|  1.94k|#define NEXT xmlNextChar(ctxt)
  ------------------
 6345|  71.4k|	} else if (RAW == '*') {
  ------------------
  |  | 2261|  71.4k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (6345:13): [True: 2.06k, False: 69.3k]
  ------------------
 6346|  2.06k|	    cur->ocur = XML_ELEMENT_CONTENT_MULT;
 6347|  2.06k|	    NEXT;
  ------------------
  |  | 2316|  2.06k|#define NEXT xmlNextChar(ctxt)
  ------------------
 6348|  69.3k|	} else if (RAW == '+') {
  ------------------
  |  | 2261|  69.3k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (6348:13): [True: 779, False: 68.5k]
  ------------------
 6349|    779|	    cur->ocur = XML_ELEMENT_CONTENT_PLUS;
 6350|    779|	    NEXT;
  ------------------
  |  | 2316|    779|#define NEXT xmlNextChar(ctxt)
  ------------------
 6351|  68.5k|	} else {
 6352|  68.5k|	    cur->ocur = XML_ELEMENT_CONTENT_ONCE;
 6353|  68.5k|	}
 6354|  73.3k|	GROW;
  ------------------
  |  | 2308|  73.3k|    if ((!PARSER_PROGRESSIVE(ctxt)) && \
  |  |  ------------------
  |  |  |  |   47|  73.3k|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|  73.3k|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2308:9): [True: 7.96k, False: 65.4k]
  |  |  ------------------
  |  | 2309|  73.3k|        (ctxt->input->end - ctxt->input->cur < INPUT_CHUNK)) \
  |  |  ------------------
  |  |  |  |   63|  7.96k|#define INPUT_CHUNK	250
  |  |  ------------------
  |  |  |  Branch (2309:9): [True: 4.28k, False: 3.68k]
  |  |  ------------------
  |  | 2310|  73.3k|	xmlParserGrow(ctxt);
  ------------------
 6355|  73.3k|    }
 6356|   364k|    while (!PARSER_STOPPED(ctxt)) {
  ------------------
  |  |   44|   364k|#define PARSER_STOPPED(ctxt) ((ctxt)->disableSAX > 1)
  ------------------
  |  Branch (6356:12): [True: 362k, False: 1.51k]
  ------------------
 6357|   362k|        xmlSkipBlankCharsPEBalanced(ctxt, openInputNr);
 6358|   362k|        if (RAW == ')')
  ------------------
  |  | 2261|   362k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (6358:13): [True: 70.5k, False: 292k]
  ------------------
 6359|  70.5k|            break;
 6360|       |        /*
 6361|       |	 * Each loop we parse one separator and one element.
 6362|       |	 */
 6363|   292k|        if (RAW == ',') {
  ------------------
  |  | 2261|   292k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (6363:13): [True: 187k, False: 104k]
  ------------------
 6364|   187k|	    if (type == 0) type = CUR;
  ------------------
  |  | 2262|  13.5k|#define CUR (*ctxt->input->cur)
  ------------------
  |  Branch (6364:10): [True: 13.5k, False: 173k]
  ------------------
 6365|       |
 6366|       |	    /*
 6367|       |	     * Detect "Name | Name , Name" error
 6368|       |	     */
 6369|   173k|	    else if (type != CUR) {
  ------------------
  |  | 2262|   173k|#define CUR (*ctxt->input->cur)
  ------------------
  |  Branch (6369:15): [True: 1, False: 173k]
  ------------------
 6370|      1|		xmlFatalErrMsgInt(ctxt, XML_ERR_SEPARATOR_REQUIRED,
 6371|      1|		    "xmlParseElementChildrenContentDecl : '%c' expected\n",
 6372|      1|		                  type);
 6373|      1|		if ((last != NULL) && (last != ret))
  ------------------
  |  Branch (6373:7): [True: 1, False: 0]
  |  Branch (6373:25): [True: 1, False: 0]
  ------------------
 6374|      1|		    xmlFreeDocElementContent(ctxt->myDoc, last);
 6375|      1|		if (ret != NULL)
  ------------------
  |  Branch (6375:7): [True: 1, False: 0]
  ------------------
 6376|      1|		    xmlFreeDocElementContent(ctxt->myDoc, ret);
 6377|      1|		return(NULL);
 6378|      1|	    }
 6379|   187k|	    NEXT;
  ------------------
  |  | 2316|   187k|#define NEXT xmlNextChar(ctxt)
  ------------------
 6380|       |
 6381|   187k|	    op = xmlNewDocElementContent(ctxt->myDoc, NULL, XML_ELEMENT_CONTENT_SEQ);
 6382|   187k|	    if (op == NULL) {
  ------------------
  |  Branch (6382:10): [True: 3, False: 187k]
  ------------------
 6383|      3|                xmlErrMemory(ctxt);
 6384|      3|		if ((last != NULL) && (last != ret))
  ------------------
  |  Branch (6384:7): [True: 1, False: 2]
  |  Branch (6384:25): [True: 1, False: 0]
  ------------------
 6385|      1|		    xmlFreeDocElementContent(ctxt->myDoc, last);
 6386|      3|	        xmlFreeDocElementContent(ctxt->myDoc, ret);
 6387|      3|		return(NULL);
 6388|      3|	    }
 6389|   187k|	    if (last == NULL) {
  ------------------
  |  Branch (6389:10): [True: 13.5k, False: 173k]
  ------------------
 6390|  13.5k|		op->c1 = ret;
 6391|  13.5k|		if (ret != NULL)
  ------------------
  |  Branch (6391:7): [True: 13.5k, False: 0]
  ------------------
 6392|  13.5k|		    ret->parent = op;
 6393|  13.5k|		ret = cur = op;
 6394|   173k|	    } else {
 6395|   173k|	        cur->c2 = op;
 6396|   173k|		if (op != NULL)
  ------------------
  |  Branch (6396:7): [True: 173k, False: 0]
  ------------------
 6397|   173k|		    op->parent = cur;
 6398|   173k|		op->c1 = last;
 6399|   173k|		if (last != NULL)
  ------------------
  |  Branch (6399:7): [True: 173k, False: 0]
  ------------------
 6400|   173k|		    last->parent = op;
 6401|   173k|		cur =op;
 6402|   173k|		last = NULL;
 6403|   173k|	    }
 6404|   187k|	} else if (RAW == '|') {
  ------------------
  |  | 2261|   104k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (6404:13): [True: 102k, False: 2.36k]
  ------------------
 6405|   102k|	    if (type == 0) type = CUR;
  ------------------
  |  | 2262|  43.8k|#define CUR (*ctxt->input->cur)
  ------------------
  |  Branch (6405:10): [True: 43.8k, False: 58.4k]
  ------------------
 6406|       |
 6407|       |	    /*
 6408|       |	     * Detect "Name , Name | Name" error
 6409|       |	     */
 6410|  58.4k|	    else if (type != CUR) {
  ------------------
  |  | 2262|  58.4k|#define CUR (*ctxt->input->cur)
  ------------------
  |  Branch (6410:15): [True: 2, False: 58.4k]
  ------------------
 6411|      2|		xmlFatalErrMsgInt(ctxt, XML_ERR_SEPARATOR_REQUIRED,
 6412|      2|		    "xmlParseElementChildrenContentDecl : '%c' expected\n",
 6413|      2|				  type);
 6414|      2|		if ((last != NULL) && (last != ret))
  ------------------
  |  Branch (6414:7): [True: 2, False: 0]
  |  Branch (6414:25): [True: 2, False: 0]
  ------------------
 6415|      2|		    xmlFreeDocElementContent(ctxt->myDoc, last);
 6416|      2|		if (ret != NULL)
  ------------------
  |  Branch (6416:7): [True: 2, False: 0]
  ------------------
 6417|      2|		    xmlFreeDocElementContent(ctxt->myDoc, ret);
 6418|      2|		return(NULL);
 6419|      2|	    }
 6420|   102k|	    NEXT;
  ------------------
  |  | 2316|   102k|#define NEXT xmlNextChar(ctxt)
  ------------------
 6421|       |
 6422|   102k|	    op = xmlNewDocElementContent(ctxt->myDoc, NULL, XML_ELEMENT_CONTENT_OR);
 6423|   102k|	    if (op == NULL) {
  ------------------
  |  Branch (6423:10): [True: 2, False: 102k]
  ------------------
 6424|      2|                xmlErrMemory(ctxt);
 6425|      2|		if ((last != NULL) && (last != ret))
  ------------------
  |  Branch (6425:7): [True: 1, False: 1]
  |  Branch (6425:25): [True: 1, False: 0]
  ------------------
 6426|      1|		    xmlFreeDocElementContent(ctxt->myDoc, last);
 6427|      2|		if (ret != NULL)
  ------------------
  |  Branch (6427:7): [True: 2, False: 0]
  ------------------
 6428|      2|		    xmlFreeDocElementContent(ctxt->myDoc, ret);
 6429|      2|		return(NULL);
 6430|      2|	    }
 6431|   102k|	    if (last == NULL) {
  ------------------
  |  Branch (6431:10): [True: 43.8k, False: 58.4k]
  ------------------
 6432|  43.8k|		op->c1 = ret;
 6433|  43.8k|		if (ret != NULL)
  ------------------
  |  Branch (6433:7): [True: 43.8k, False: 0]
  ------------------
 6434|  43.8k|		    ret->parent = op;
 6435|  43.8k|		ret = cur = op;
 6436|  58.4k|	    } else {
 6437|  58.4k|	        cur->c2 = op;
 6438|  58.4k|		if (op != NULL)
  ------------------
  |  Branch (6438:7): [True: 58.4k, False: 0]
  ------------------
 6439|  58.4k|		    op->parent = cur;
 6440|  58.4k|		op->c1 = last;
 6441|  58.4k|		if (last != NULL)
  ------------------
  |  Branch (6441:7): [True: 58.4k, False: 0]
  ------------------
 6442|  58.4k|		    last->parent = op;
 6443|  58.4k|		cur =op;
 6444|  58.4k|		last = NULL;
 6445|  58.4k|	    }
 6446|   102k|	} else {
 6447|  2.36k|	    xmlFatalErr(ctxt, XML_ERR_ELEMCONTENT_NOT_FINISHED, NULL);
 6448|  2.36k|	    if ((last != NULL) && (last != ret))
  ------------------
  |  Branch (6448:10): [True: 1.07k, False: 1.29k]
  |  Branch (6448:28): [True: 1.07k, False: 0]
  ------------------
 6449|  1.07k|	        xmlFreeDocElementContent(ctxt->myDoc, last);
 6450|  2.36k|	    if (ret != NULL)
  ------------------
  |  Branch (6450:10): [True: 2.36k, False: 0]
  ------------------
 6451|  2.36k|		xmlFreeDocElementContent(ctxt->myDoc, ret);
 6452|  2.36k|	    return(NULL);
 6453|  2.36k|	}
 6454|   289k|        xmlSkipBlankCharsPEBalanced(ctxt, openInputNr);
 6455|   289k|        if (RAW == '(') {
  ------------------
  |  | 2261|   289k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (6455:13): [True: 62.9k, False: 226k]
  ------------------
 6456|  62.9k|            int newInputNr = ctxt->inputNr;
 6457|       |
 6458|       |	    /* Recurse on second child */
 6459|  62.9k|	    NEXT;
  ------------------
  |  | 2316|  62.9k|#define NEXT xmlNextChar(ctxt)
  ------------------
 6460|  62.9k|	    last = xmlParseElementChildrenContentDeclPriv(ctxt, newInputNr,
 6461|  62.9k|                                                          depth + 1);
 6462|  62.9k|            if (last == NULL) {
  ------------------
  |  Branch (6462:17): [True: 383, False: 62.5k]
  ------------------
 6463|    383|		if (ret != NULL)
  ------------------
  |  Branch (6463:7): [True: 383, False: 0]
  ------------------
 6464|    383|		    xmlFreeDocElementContent(ctxt->myDoc, ret);
 6465|    383|		return(NULL);
 6466|    383|            }
 6467|   226k|	} else {
 6468|   226k|	    elem = xmlParseName(ctxt);
 6469|   226k|	    if (elem == NULL) {
  ------------------
  |  Branch (6469:10): [True: 337, False: 226k]
  ------------------
 6470|    337|		xmlFatalErr(ctxt, XML_ERR_ELEMCONTENT_NOT_STARTED, NULL);
 6471|    337|		if (ret != NULL)
  ------------------
  |  Branch (6471:7): [True: 337, False: 0]
  ------------------
 6472|    337|		    xmlFreeDocElementContent(ctxt->myDoc, ret);
 6473|    337|		return(NULL);
 6474|    337|	    }
 6475|   226k|	    last = xmlNewDocElementContent(ctxt->myDoc, elem, XML_ELEMENT_CONTENT_ELEMENT);
 6476|   226k|	    if (last == NULL) {
  ------------------
  |  Branch (6476:10): [True: 5, False: 226k]
  ------------------
 6477|      5|                xmlErrMemory(ctxt);
 6478|      5|		if (ret != NULL)
  ------------------
  |  Branch (6478:7): [True: 5, False: 0]
  ------------------
 6479|      5|		    xmlFreeDocElementContent(ctxt->myDoc, ret);
 6480|      5|		return(NULL);
 6481|      5|	    }
 6482|   226k|	    if (RAW == '?') {
  ------------------
  |  | 2261|   226k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (6482:10): [True: 23.2k, False: 203k]
  ------------------
 6483|  23.2k|		last->ocur = XML_ELEMENT_CONTENT_OPT;
 6484|  23.2k|		NEXT;
  ------------------
  |  | 2316|  23.2k|#define NEXT xmlNextChar(ctxt)
  ------------------
 6485|   203k|	    } else if (RAW == '*') {
  ------------------
  |  | 2261|   203k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (6485:17): [True: 16.0k, False: 187k]
  ------------------
 6486|  16.0k|		last->ocur = XML_ELEMENT_CONTENT_MULT;
 6487|  16.0k|		NEXT;
  ------------------
  |  | 2316|  16.0k|#define NEXT xmlNextChar(ctxt)
  ------------------
 6488|   187k|	    } else if (RAW == '+') {
  ------------------
  |  | 2261|   187k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (6488:17): [True: 25.0k, False: 162k]
  ------------------
 6489|  25.0k|		last->ocur = XML_ELEMENT_CONTENT_PLUS;
 6490|  25.0k|		NEXT;
  ------------------
  |  | 2316|  25.0k|#define NEXT xmlNextChar(ctxt)
  ------------------
 6491|   162k|	    } else {
 6492|   162k|		last->ocur = XML_ELEMENT_CONTENT_ONCE;
 6493|   162k|	    }
 6494|   226k|	}
 6495|   289k|    }
 6496|  72.0k|    if ((cur != NULL) && (last != NULL)) {
  ------------------
  |  Branch (6496:9): [True: 72.0k, False: 0]
  |  Branch (6496:26): [True: 55.5k, False: 16.5k]
  ------------------
 6497|  55.5k|        cur->c2 = last;
 6498|  55.5k|	if (last != NULL)
  ------------------
  |  Branch (6498:6): [True: 55.5k, False: 0]
  ------------------
 6499|  55.5k|	    last->parent = cur;
 6500|  55.5k|    }
 6501|  72.0k|#ifdef LIBXML_VALID_ENABLED
 6502|  72.0k|    if ((ctxt->validate) && (ctxt->inputNr > openInputNr)) {
  ------------------
  |  Branch (6502:9): [True: 67.6k, False: 4.41k]
  |  Branch (6502:29): [True: 100, False: 67.5k]
  ------------------
 6503|    100|        xmlValidityError(ctxt, XML_ERR_ENTITY_BOUNDARY,
 6504|    100|                         "Element content declaration doesn't start "
 6505|    100|                         "and stop in the same entity\n",
 6506|    100|                         NULL, NULL);
 6507|    100|    }
 6508|  72.0k|#endif
 6509|  72.0k|    NEXT;
  ------------------
  |  | 2316|  72.0k|#define NEXT xmlNextChar(ctxt)
  ------------------
 6510|  72.0k|    if (RAW == '?') {
  ------------------
  |  | 2261|  72.0k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (6510:9): [True: 11.6k, False: 60.4k]
  ------------------
 6511|  11.6k|	if (ret != NULL) {
  ------------------
  |  Branch (6511:6): [True: 11.6k, False: 0]
  ------------------
 6512|  11.6k|	    if ((ret->ocur == XML_ELEMENT_CONTENT_PLUS) ||
  ------------------
  |  Branch (6512:10): [True: 59, False: 11.5k]
  ------------------
 6513|  11.5k|	        (ret->ocur == XML_ELEMENT_CONTENT_MULT))
  ------------------
  |  Branch (6513:10): [True: 76, False: 11.5k]
  ------------------
 6514|    135|	        ret->ocur = XML_ELEMENT_CONTENT_MULT;
 6515|  11.5k|	    else
 6516|  11.5k|	        ret->ocur = XML_ELEMENT_CONTENT_OPT;
 6517|  11.6k|	}
 6518|  11.6k|	NEXT;
  ------------------
  |  | 2316|  11.6k|#define NEXT xmlNextChar(ctxt)
  ------------------
 6519|  60.4k|    } else if (RAW == '*') {
  ------------------
  |  | 2261|  60.4k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (6519:16): [True: 27.0k, False: 33.4k]
  ------------------
 6520|  27.0k|	if (ret != NULL) {
  ------------------
  |  Branch (6520:6): [True: 27.0k, False: 0]
  ------------------
 6521|  27.0k|	    ret->ocur = XML_ELEMENT_CONTENT_MULT;
 6522|  27.0k|	    cur = ret;
 6523|       |	    /*
 6524|       |	     * Some normalization:
 6525|       |	     * (a | b* | c?)* == (a | b | c)*
 6526|       |	     */
 6527|  86.2k|	    while ((cur != NULL) && (cur->type == XML_ELEMENT_CONTENT_OR)) {
  ------------------
  |  Branch (6527:13): [True: 86.2k, False: 0]
  |  Branch (6527:30): [True: 59.1k, False: 27.0k]
  ------------------
 6528|  59.1k|		if ((cur->c1 != NULL) &&
  ------------------
  |  Branch (6528:7): [True: 59.1k, False: 0]
  ------------------
 6529|  59.1k|	            ((cur->c1->ocur == XML_ELEMENT_CONTENT_OPT) ||
  ------------------
  |  Branch (6529:15): [True: 377, False: 58.8k]
  ------------------
 6530|  58.8k|		     (cur->c1->ocur == XML_ELEMENT_CONTENT_MULT)))
  ------------------
  |  Branch (6530:8): [True: 517, False: 58.2k]
  ------------------
 6531|    894|		    cur->c1->ocur = XML_ELEMENT_CONTENT_ONCE;
 6532|  59.1k|		if ((cur->c2 != NULL) &&
  ------------------
  |  Branch (6532:7): [True: 59.1k, False: 0]
  ------------------
 6533|  59.1k|	            ((cur->c2->ocur == XML_ELEMENT_CONTENT_OPT) ||
  ------------------
  |  Branch (6533:15): [True: 131, False: 59.0k]
  ------------------
 6534|  59.0k|		     (cur->c2->ocur == XML_ELEMENT_CONTENT_MULT)))
  ------------------
  |  Branch (6534:8): [True: 95, False: 58.9k]
  ------------------
 6535|    226|		    cur->c2->ocur = XML_ELEMENT_CONTENT_ONCE;
 6536|  59.1k|		cur = cur->c2;
 6537|  59.1k|	    }
 6538|  27.0k|	}
 6539|  27.0k|	NEXT;
  ------------------
  |  | 2316|  27.0k|#define NEXT xmlNextChar(ctxt)
  ------------------
 6540|  33.4k|    } else if (RAW == '+') {
  ------------------
  |  | 2261|  33.4k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (6540:16): [True: 9.91k, False: 23.4k]
  ------------------
 6541|  9.91k|	if (ret != NULL) {
  ------------------
  |  Branch (6541:6): [True: 9.91k, False: 0]
  ------------------
 6542|  9.91k|	    int found = 0;
 6543|       |
 6544|  9.91k|	    if ((ret->ocur == XML_ELEMENT_CONTENT_OPT) ||
  ------------------
  |  Branch (6544:10): [True: 117, False: 9.79k]
  ------------------
 6545|  9.79k|	        (ret->ocur == XML_ELEMENT_CONTENT_MULT))
  ------------------
  |  Branch (6545:10): [True: 77, False: 9.72k]
  ------------------
 6546|    194|	        ret->ocur = XML_ELEMENT_CONTENT_MULT;
 6547|  9.72k|	    else
 6548|  9.72k|	        ret->ocur = XML_ELEMENT_CONTENT_PLUS;
 6549|       |	    /*
 6550|       |	     * Some normalization:
 6551|       |	     * (a | b*)+ == (a | b)*
 6552|       |	     * (a | b?)+ == (a | b)*
 6553|       |	     */
 6554|  19.2k|	    while ((cur != NULL) && (cur->type == XML_ELEMENT_CONTENT_OR)) {
  ------------------
  |  Branch (6554:13): [True: 19.2k, False: 0]
  |  Branch (6554:30): [True: 9.31k, False: 9.91k]
  ------------------
 6555|  9.31k|		if ((cur->c1 != NULL) &&
  ------------------
  |  Branch (6555:7): [True: 9.31k, False: 0]
  ------------------
 6556|  9.31k|	            ((cur->c1->ocur == XML_ELEMENT_CONTENT_OPT) ||
  ------------------
  |  Branch (6556:15): [True: 680, False: 8.63k]
  ------------------
 6557|  8.63k|		     (cur->c1->ocur == XML_ELEMENT_CONTENT_MULT))) {
  ------------------
  |  Branch (6557:8): [True: 361, False: 8.27k]
  ------------------
 6558|  1.04k|		    cur->c1->ocur = XML_ELEMENT_CONTENT_ONCE;
 6559|  1.04k|		    found = 1;
 6560|  1.04k|		}
 6561|  9.31k|		if ((cur->c2 != NULL) &&
  ------------------
  |  Branch (6561:7): [True: 9.31k, False: 0]
  ------------------
 6562|  9.31k|	            ((cur->c2->ocur == XML_ELEMENT_CONTENT_OPT) ||
  ------------------
  |  Branch (6562:15): [True: 80, False: 9.23k]
  ------------------
 6563|  9.23k|		     (cur->c2->ocur == XML_ELEMENT_CONTENT_MULT))) {
  ------------------
  |  Branch (6563:8): [True: 19, False: 9.21k]
  ------------------
 6564|     99|		    cur->c2->ocur = XML_ELEMENT_CONTENT_ONCE;
 6565|     99|		    found = 1;
 6566|     99|		}
 6567|  9.31k|		cur = cur->c2;
 6568|  9.31k|	    }
 6569|  9.91k|	    if (found)
  ------------------
  |  Branch (6569:10): [True: 757, False: 9.15k]
  ------------------
 6570|    757|		ret->ocur = XML_ELEMENT_CONTENT_MULT;
 6571|  9.91k|	}
 6572|  9.91k|	NEXT;
  ------------------
  |  | 2316|  9.91k|#define NEXT xmlNextChar(ctxt)
  ------------------
 6573|  9.91k|    }
 6574|  72.0k|    return(ret);
 6575|  75.1k|}
parser.c:xmlCtxtInitializeLate:
  897|  54.9k|xmlCtxtInitializeLate(xmlParserCtxtPtr ctxt) {
  898|  54.9k|    xmlSAXHandlerPtr sax;
  899|       |
  900|       |    /* Avoid unused variable warning if features are disabled. */
  901|  54.9k|    (void) sax;
  902|       |
  903|       |    /*
  904|       |     * Changing the SAX struct directly is still widespread practice
  905|       |     * in internal and external code.
  906|       |     */
  907|  54.9k|    if (ctxt == NULL) return;
  ------------------
  |  Branch (907:9): [True: 0, False: 54.9k]
  ------------------
  908|  54.9k|    sax = ctxt->sax;
  909|  54.9k|#ifdef LIBXML_SAX1_ENABLED
  910|       |    /*
  911|       |     * Only enable SAX2 if there SAX2 element handlers, except when there
  912|       |     * are no element handlers at all.
  913|       |     */
  914|  54.9k|    if (((ctxt->options & XML_PARSE_SAX1) == 0) &&
  ------------------
  |  Branch (914:9): [True: 32.2k, False: 22.6k]
  ------------------
  915|  32.2k|        (sax) &&
  ------------------
  |  Branch (915:9): [True: 32.2k, False: 0]
  ------------------
  916|  32.2k|        (sax->initialized == XML_SAX2_MAGIC) &&
  ------------------
  |  |  953|  32.2k|#define XML_SAX2_MAGIC 0xDEEDBEAF
  ------------------
  |  Branch (916:9): [True: 32.2k, False: 0]
  ------------------
  917|  32.2k|        ((sax->startElementNs != NULL) ||
  ------------------
  |  Branch (917:10): [True: 32.2k, False: 0]
  ------------------
  918|      0|         (sax->endElementNs != NULL) ||
  ------------------
  |  Branch (918:10): [True: 0, False: 0]
  ------------------
  919|      0|         ((sax->startElement == NULL) && (sax->endElement == NULL))))
  ------------------
  |  Branch (919:11): [True: 0, False: 0]
  |  Branch (919:42): [True: 0, False: 0]
  ------------------
  920|  32.2k|        ctxt->sax2 = 1;
  921|       |#else
  922|       |    ctxt->sax2 = 1;
  923|       |#endif /* LIBXML_SAX1_ENABLED */
  924|       |
  925|       |    /*
  926|       |     * Some users replace the dictionary directly in the context struct.
  927|       |     * We really need an API function to do that cleanly.
  928|       |     */
  929|  54.9k|    ctxt->str_xml = xmlDictLookup(ctxt->dict, BAD_CAST "xml", 3);
  ------------------
  |  |   34|  54.9k|#define BAD_CAST (xmlChar *)
  ------------------
  930|  54.9k|    ctxt->str_xmlns = xmlDictLookup(ctxt->dict, BAD_CAST "xmlns", 5);
  ------------------
  |  |   34|  54.9k|#define BAD_CAST (xmlChar *)
  ------------------
  931|  54.9k|    ctxt->str_xml_ns = xmlDictLookup(ctxt->dict, XML_XML_NAMESPACE, 36);
  ------------------
  |  |  146|  54.9k|    (const xmlChar *) "http://www.w3.org/XML/1998/namespace"
  ------------------
  932|  54.9k|    if ((ctxt->str_xml==NULL) || (ctxt->str_xmlns==NULL) ||
  ------------------
  |  Branch (932:9): [True: 12, False: 54.9k]
  |  Branch (932:34): [True: 0, False: 54.9k]
  ------------------
  933|  54.9k|		(ctxt->str_xml_ns == NULL)) {
  ------------------
  |  Branch (933:3): [True: 0, False: 54.9k]
  ------------------
  934|     12|        xmlErrMemory(ctxt);
  935|     12|    }
  936|       |
  937|  54.9k|    xmlDictSetLimit(ctxt->dict,
  938|  54.9k|                    (ctxt->options & XML_PARSE_HUGE) ?
  ------------------
  |  Branch (938:21): [True: 27.1k, False: 27.7k]
  ------------------
  939|  27.1k|                        0 :
  940|  54.9k|                        XML_MAX_DICTIONARY_LIMIT);
  ------------------
  |  |   73|  82.6k|#define XML_MAX_DICTIONARY_LIMIT 100000000
  ------------------
  941|       |
  942|  54.9k|#ifdef LIBXML_VALID_ENABLED
  943|  54.9k|    if (ctxt->validate)
  ------------------
  |  Branch (943:9): [True: 26.6k, False: 28.3k]
  ------------------
  944|  26.6k|        ctxt->vctxt.flags |= XML_VCTXT_VALIDATE;
  ------------------
  |  |   24|  26.6k|#define XML_VCTXT_VALIDATE (1u << 2)
  ------------------
  945|  28.3k|    else
  946|  28.3k|        ctxt->vctxt.flags &= ~XML_VCTXT_VALIDATE;
  ------------------
  |  |   24|  28.3k|#define XML_VCTXT_VALIDATE (1u << 2)
  ------------------
  947|  54.9k|#endif /* LIBXML_VALID_ENABLED */
  948|  54.9k|}
parser.c:xmlPopPE:
 2384|   136k|xmlPopPE(xmlParserCtxtPtr ctxt) {
 2385|   136k|    unsigned long consumed;
 2386|   136k|    xmlEntityPtr ent;
 2387|       |
 2388|   136k|    ent = ctxt->input->entity;
 2389|       |
 2390|   136k|    ent->flags &= ~XML_ENT_EXPANDING;
  ------------------
  |  |   22|   136k|#define XML_ENT_EXPANDING   (1u << 3)
  ------------------
 2391|       |
 2392|   136k|    if ((ent->flags & XML_ENT_CHECKED) == 0) {
  ------------------
  |  |   20|   136k|#define XML_ENT_CHECKED     (1u << 1)
  ------------------
  |  Branch (2392:9): [True: 5.22k, False: 130k]
  ------------------
 2393|  5.22k|        int result;
 2394|       |
 2395|       |        /*
 2396|       |         * Read the rest of the stream in case of errors. We want
 2397|       |         * to account for the whole entity size.
 2398|       |         */
 2399|  5.43k|        do {
 2400|  5.43k|            ctxt->input->cur = ctxt->input->end;
 2401|  5.43k|            xmlParserShrink(ctxt);
 2402|  5.43k|            result = xmlParserGrow(ctxt);
 2403|  5.43k|        } while (result > 0);
  ------------------
  |  Branch (2403:18): [True: 214, False: 5.22k]
  ------------------
 2404|       |
 2405|  5.22k|        consumed = ctxt->input->consumed;
 2406|  5.22k|        xmlSaturatedAddSizeT(&consumed,
 2407|  5.22k|                             ctxt->input->end - ctxt->input->base);
 2408|       |
 2409|  5.22k|        xmlSaturatedAdd(&ent->expandedSize, consumed);
 2410|       |
 2411|       |        /*
 2412|       |         * Add to sizeentities when parsing an external entity
 2413|       |         * for the first time.
 2414|       |         */
 2415|  5.22k|        if (ent->etype == XML_EXTERNAL_PARAMETER_ENTITY) {
  ------------------
  |  Branch (2415:13): [True: 3.88k, False: 1.33k]
  ------------------
 2416|  3.88k|            xmlSaturatedAdd(&ctxt->sizeentities, consumed);
 2417|  3.88k|        }
 2418|       |
 2419|  5.22k|        ent->flags |= XML_ENT_CHECKED;
  ------------------
  |  |   20|  5.22k|#define XML_ENT_CHECKED     (1u << 1)
  ------------------
 2420|  5.22k|    }
 2421|       |
 2422|   136k|    xmlFreeInputStream(xmlCtxtPopInput(ctxt));
 2423|       |
 2424|   136k|    xmlParserEntityCheck(ctxt, ent->expandedSize);
 2425|       |
 2426|   136k|    GROW;
  ------------------
  |  | 2308|   136k|    if ((!PARSER_PROGRESSIVE(ctxt)) && \
  |  |  ------------------
  |  |  |  |   47|   136k|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|   136k|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2308:9): [True: 120k, False: 15.2k]
  |  |  ------------------
  |  | 2309|   136k|        (ctxt->input->end - ctxt->input->cur < INPUT_CHUNK)) \
  |  |  ------------------
  |  |  |  |   63|   120k|#define INPUT_CHUNK	250
  |  |  ------------------
  |  |  |  Branch (2309:9): [True: 84.9k, False: 35.9k]
  |  |  ------------------
  |  | 2310|   136k|	xmlParserGrow(ctxt);
  ------------------
 2427|   136k|}
parser.c:xmlParseConditionalSections:
 6783|  6.34k|xmlParseConditionalSections(xmlParserCtxtPtr ctxt) {
 6784|  6.34k|    size_t depth = 0;
 6785|  6.34k|    int isFreshPE = 0;
 6786|  6.34k|    int oldInputNr = ctxt->inputNr;
 6787|  6.34k|    int declInputNr = ctxt->inputNr;
 6788|       |
 6789|  13.4k|    while (!PARSER_STOPPED(ctxt)) {
  ------------------
  |  |   44|  13.4k|#define PARSER_STOPPED(ctxt) ((ctxt)->disableSAX > 1)
  ------------------
  |  Branch (6789:12): [True: 13.4k, False: 6]
  ------------------
 6790|  13.4k|        if (ctxt->input->cur >= ctxt->input->end) {
  ------------------
  |  Branch (6790:13): [True: 791, False: 12.6k]
  ------------------
 6791|    791|            if (ctxt->inputNr <= oldInputNr) {
  ------------------
  |  Branch (6791:17): [True: 504, False: 287]
  ------------------
 6792|    504|                xmlFatalErr(ctxt, XML_ERR_EXT_SUBSET_NOT_FINISHED, NULL);
 6793|    504|                return;
 6794|    504|            }
 6795|       |
 6796|    287|            xmlPopPE(ctxt);
 6797|    287|            declInputNr = ctxt->inputNr;
 6798|  12.6k|        } else if ((RAW == '<') && (NXT(1) == '!') && (NXT(2) == '[')) {
  ------------------
  |  | 2261|  12.6k|#define RAW (*ctxt->input->cur)
  ------------------
                      } else if ((RAW == '<') && (NXT(1) == '!') && (NXT(2) == '[')) {
  ------------------
  |  | 2263|  9.31k|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
                      } else if ((RAW == '<') && (NXT(1) == '!') && (NXT(2) == '[')) {
  ------------------
  |  | 2263|  9.08k|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
  |  Branch (6798:20): [True: 9.31k, False: 3.35k]
  |  Branch (6798:36): [True: 9.08k, False: 224]
  |  Branch (6798:55): [True: 7.15k, False: 1.93k]
  ------------------
 6799|  7.15k|            SKIP(3);
  ------------------
  |  | 2285|  7.15k|#define SKIP(val) do {							\
  |  | 2286|  7.15k|    ctxt->input->cur += (val),ctxt->input->col+=(val);			\
  |  | 2287|  7.15k|    if (*ctxt->input->cur == 0)						\
  |  |  ------------------
  |  |  |  Branch (2287:9): [True: 556, False: 6.60k]
  |  |  ------------------
  |  | 2288|  7.15k|        xmlParserGrow(ctxt);						\
  |  | 2289|  7.15k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2289:12): [Folded, False: 7.15k]
  |  |  ------------------
  ------------------
 6800|  7.15k|            SKIP_BLANKS_PE;
  ------------------
  |  | 2314|  7.15k|#define SKIP_BLANKS_PE xmlSkipBlankCharsPE(ctxt)
  ------------------
 6801|       |
 6802|  7.15k|            isFreshPE = 0;
 6803|       |
 6804|  7.15k|            if (CMP7(CUR_PTR, 'I', 'N', 'C', 'L', 'U', 'D', 'E')) {
  ------------------
  |  | 2275|  7.15k|  ( CMP6( s, c1, c2, c3, c4, c5, c6 ) && ((unsigned char *) s)[ 6 ] == c7 )
  |  |  ------------------
  |  |  |  | 2273|  14.3k|  ( CMP5( s, c1, c2, c3, c4, c5 ) && ((unsigned char *) s)[ 5 ] == c6 )
  |  |  |  |  ------------------
  |  |  |  |  |  | 2271|  14.3k|  ( CMP4( s, c1, c2, c3, c4 ) && ((unsigned char *) s)[ 4 ] == c5 )
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  | 2268|  14.3k|  ( ((unsigned char *) s)[ 0 ] == c1 && ((unsigned char *) s)[ 1 ] == c2 && \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (2268:5): [True: 5.92k, False: 1.23k]
  |  |  |  |  |  |  |  |  |  Branch (2268:41): [True: 3.63k, False: 2.28k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  | 2269|  7.15k|    ((unsigned char *) s)[ 2 ] == c3 && ((unsigned char *) s)[ 3 ] == c4 )
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (2269:5): [True: 3.63k, False: 7]
  |  |  |  |  |  |  |  |  |  Branch (2269:41): [True: 3.62k, False: 3]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (2271:34): [True: 3.62k, False: 3]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2273:38): [True: 3.62k, False: 4]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2275:42): [True: 3.61k, False: 4]
  |  |  ------------------
  ------------------
 6805|  3.61k|                SKIP(7);
  ------------------
  |  | 2285|  3.61k|#define SKIP(val) do {							\
  |  | 2286|  3.61k|    ctxt->input->cur += (val),ctxt->input->col+=(val);			\
  |  | 2287|  3.61k|    if (*ctxt->input->cur == 0)						\
  |  |  ------------------
  |  |  |  Branch (2287:9): [True: 210, False: 3.40k]
  |  |  ------------------
  |  | 2288|  3.61k|        xmlParserGrow(ctxt);						\
  |  | 2289|  3.61k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2289:12): [Folded, False: 3.61k]
  |  |  ------------------
  ------------------
 6806|  3.61k|                SKIP_BLANKS_PE;
  ------------------
  |  | 2314|  3.61k|#define SKIP_BLANKS_PE xmlSkipBlankCharsPE(ctxt)
  ------------------
 6807|  3.61k|                if (RAW != '[') {
  ------------------
  |  | 2261|  3.61k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (6807:21): [True: 354, False: 3.26k]
  ------------------
 6808|    354|                    xmlFatalErr(ctxt, XML_ERR_CONDSEC_INVALID, NULL);
 6809|    354|                    return;
 6810|    354|                }
 6811|  3.26k|#ifdef LIBXML_VALID_ENABLED
 6812|  3.26k|                if ((ctxt->validate) && (ctxt->inputNr > declInputNr)) {
  ------------------
  |  Branch (6812:21): [True: 1.94k, False: 1.32k]
  |  Branch (6812:41): [True: 39, False: 1.90k]
  ------------------
 6813|     39|		    xmlValidityError(ctxt, XML_ERR_ENTITY_BOUNDARY,
 6814|     39|                                     "All markup of the conditional section is"
 6815|     39|                                     " not in the same entity\n",
 6816|     39|                                     NULL, NULL);
 6817|     39|                }
 6818|  3.26k|#endif
 6819|  3.26k|                NEXT;
  ------------------
  |  | 2316|  3.26k|#define NEXT xmlNextChar(ctxt)
  ------------------
 6820|       |
 6821|  3.26k|                depth++;
 6822|  3.54k|            } else if (CMP6(CUR_PTR, 'I', 'G', 'N', 'O', 'R', 'E')) {
  ------------------
  |  | 2273|  3.54k|  ( CMP5( s, c1, c2, c3, c4, c5 ) && ((unsigned char *) s)[ 5 ] == c6 )
  |  |  ------------------
  |  |  |  | 2271|  7.08k|  ( CMP4( s, c1, c2, c3, c4 ) && ((unsigned char *) s)[ 4 ] == c5 )
  |  |  |  |  ------------------
  |  |  |  |  |  | 2268|  7.08k|  ( ((unsigned char *) s)[ 0 ] == c1 && ((unsigned char *) s)[ 1 ] == c2 && \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (2268:5): [True: 2.31k, False: 1.23k]
  |  |  |  |  |  |  |  Branch (2268:41): [True: 2.28k, False: 23]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 2269|  3.54k|    ((unsigned char *) s)[ 2 ] == c3 && ((unsigned char *) s)[ 3 ] == c4 )
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (2269:5): [True: 2.28k, False: 2]
  |  |  |  |  |  |  |  Branch (2269:41): [True: 2.28k, False: 2]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2271:34): [True: 2.28k, False: 1]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2273:38): [True: 2.28k, False: 1]
  |  |  ------------------
  ------------------
 6823|  2.28k|                size_t ignoreDepth = 0;
 6824|       |
 6825|  2.28k|                SKIP(6);
  ------------------
  |  | 2285|  2.28k|#define SKIP(val) do {							\
  |  | 2286|  2.28k|    ctxt->input->cur += (val),ctxt->input->col+=(val);			\
  |  | 2287|  2.28k|    if (*ctxt->input->cur == 0)						\
  |  |  ------------------
  |  |  |  Branch (2287:9): [True: 206, False: 2.07k]
  |  |  ------------------
  |  | 2288|  2.28k|        xmlParserGrow(ctxt);						\
  |  | 2289|  2.28k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2289:12): [Folded, False: 2.28k]
  |  |  ------------------
  ------------------
 6826|  2.28k|                SKIP_BLANKS_PE;
  ------------------
  |  | 2314|  2.28k|#define SKIP_BLANKS_PE xmlSkipBlankCharsPE(ctxt)
  ------------------
 6827|  2.28k|                if (RAW != '[') {
  ------------------
  |  | 2261|  2.28k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (6827:21): [True: 354, False: 1.92k]
  ------------------
 6828|    354|                    xmlFatalErr(ctxt, XML_ERR_CONDSEC_INVALID, NULL);
 6829|    354|                    return;
 6830|    354|                }
 6831|  1.92k|#ifdef LIBXML_VALID_ENABLED
 6832|  1.92k|                if ((ctxt->validate) && (ctxt->inputNr > declInputNr)) {
  ------------------
  |  Branch (6832:21): [True: 1.07k, False: 857]
  |  Branch (6832:41): [True: 7, False: 1.06k]
  ------------------
 6833|      7|		    xmlValidityError(ctxt, XML_ERR_ENTITY_BOUNDARY,
 6834|      7|                                     "All markup of the conditional section is"
 6835|      7|                                     " not in the same entity\n",
 6836|      7|                                     NULL, NULL);
 6837|      7|                }
 6838|  1.92k|#endif
 6839|  1.92k|                NEXT;
  ------------------
  |  | 2316|  1.92k|#define NEXT xmlNextChar(ctxt)
  ------------------
 6840|       |
 6841|  31.6k|                while (PARSER_STOPPED(ctxt) == 0) {
  ------------------
  |  |   44|  31.6k|#define PARSER_STOPPED(ctxt) ((ctxt)->disableSAX > 1)
  ------------------
  |  Branch (6841:24): [True: 31.6k, False: 4]
  ------------------
 6842|  31.6k|                    if (RAW == 0) {
  ------------------
  |  | 2261|  31.6k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (6842:25): [True: 1.00k, False: 30.6k]
  ------------------
 6843|  1.00k|                        xmlFatalErr(ctxt, XML_ERR_CONDSEC_NOT_FINISHED, NULL);
 6844|  1.00k|                        return;
 6845|  1.00k|                    }
 6846|  30.6k|                    if ((RAW == '<') && (NXT(1) == '!') && (NXT(2) == '[')) {
  ------------------
  |  | 2261|  30.6k|#define RAW (*ctxt->input->cur)
  ------------------
                                  if ((RAW == '<') && (NXT(1) == '!') && (NXT(2) == '[')) {
  ------------------
  |  | 2263|  1.75k|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
                                  if ((RAW == '<') && (NXT(1) == '!') && (NXT(2) == '[')) {
  ------------------
  |  | 2263|  1.03k|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
  |  Branch (6846:25): [True: 1.75k, False: 28.9k]
  |  Branch (6846:41): [True: 1.03k, False: 723]
  |  Branch (6846:60): [True: 563, False: 469]
  ------------------
 6847|    563|                        SKIP(3);
  ------------------
  |  | 2285|    563|#define SKIP(val) do {							\
  |  | 2286|    563|    ctxt->input->cur += (val),ctxt->input->col+=(val);			\
  |  | 2287|    563|    if (*ctxt->input->cur == 0)						\
  |  |  ------------------
  |  |  |  Branch (2287:9): [True: 82, False: 481]
  |  |  ------------------
  |  | 2288|    563|        xmlParserGrow(ctxt);						\
  |  | 2289|    563|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2289:12): [Folded, False: 563]
  |  |  ------------------
  ------------------
 6848|    563|                        ignoreDepth++;
 6849|       |                        /* Check for integer overflow */
 6850|    563|                        if (ignoreDepth == 0) {
  ------------------
  |  Branch (6850:29): [True: 0, False: 563]
  ------------------
 6851|      0|                            xmlErrMemory(ctxt);
 6852|      0|                            return;
 6853|      0|                        }
 6854|  30.0k|                    } else if ((RAW == ']') && (NXT(1) == ']') &&
  ------------------
  |  | 2261|  30.0k|#define RAW (*ctxt->input->cur)
  ------------------
                                  } else if ((RAW == ']') && (NXT(1) == ']') &&
  ------------------
  |  | 2263|  2.95k|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
  |  Branch (6854:32): [True: 2.95k, False: 27.1k]
  |  Branch (6854:48): [True: 1.64k, False: 1.30k]
  ------------------
 6855|  1.64k|                               (NXT(2) == '>')) {
  ------------------
  |  | 2263|  1.64k|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
  |  Branch (6855:32): [True: 1.18k, False: 460]
  ------------------
 6856|  1.18k|                        SKIP(3);
  ------------------
  |  | 2285|  1.18k|#define SKIP(val) do {							\
  |  | 2286|  1.18k|    ctxt->input->cur += (val),ctxt->input->col+=(val);			\
  |  | 2287|  1.18k|    if (*ctxt->input->cur == 0)						\
  |  |  ------------------
  |  |  |  Branch (2287:9): [True: 323, False: 861]
  |  |  ------------------
  |  | 2288|  1.18k|        xmlParserGrow(ctxt);						\
  |  | 2289|  1.18k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2289:12): [Folded, False: 1.18k]
  |  |  ------------------
  ------------------
 6857|  1.18k|                        if (ignoreDepth == 0)
  ------------------
  |  Branch (6857:29): [True: 918, False: 266]
  ------------------
 6858|    918|                            break;
 6859|    266|                        ignoreDepth--;
 6860|  28.9k|                    } else {
 6861|  28.9k|                        NEXT;
  ------------------
  |  | 2316|  28.9k|#define NEXT xmlNextChar(ctxt)
  ------------------
 6862|  28.9k|                    }
 6863|  30.6k|                }
 6864|       |
 6865|    922|#ifdef LIBXML_VALID_ENABLED
 6866|    922|                if ((ctxt->validate) && (ctxt->inputNr > declInputNr)) {
  ------------------
  |  Branch (6866:21): [True: 391, False: 531]
  |  Branch (6866:41): [True: 6, False: 385]
  ------------------
 6867|      6|		    xmlValidityError(ctxt, XML_ERR_ENTITY_BOUNDARY,
 6868|      6|                                     "All markup of the conditional section is"
 6869|      6|                                     " not in the same entity\n",
 6870|      6|                                     NULL, NULL);
 6871|      6|                }
 6872|    922|#endif
 6873|  1.26k|            } else {
 6874|  1.26k|                xmlFatalErr(ctxt, XML_ERR_CONDSEC_INVALID_KEYWORD, NULL);
 6875|  1.26k|                return;
 6876|  1.26k|            }
 6877|  7.15k|        } else if ((depth > 0) &&
  ------------------
  |  Branch (6877:20): [True: 5.51k, False: 0]
  ------------------
 6878|  5.51k|                   (RAW == ']') && (NXT(1) == ']') && (NXT(2) == '>')) {
  ------------------
  |  | 2261|  5.51k|#define RAW (*ctxt->input->cur)
  ------------------
                                 (RAW == ']') && (NXT(1) == ']') && (NXT(2) == '>')) {
  ------------------
  |  | 2263|  2.33k|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
                                 (RAW == ']') && (NXT(1) == ']') && (NXT(2) == '>')) {
  ------------------
  |  | 2263|  2.32k|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
  |  Branch (6878:20): [True: 2.33k, False: 3.17k]
  |  Branch (6878:36): [True: 2.32k, False: 7]
  |  Branch (6878:55): [True: 2.32k, False: 6]
  ------------------
 6879|  2.32k|            if (isFreshPE) {
  ------------------
  |  Branch (6879:17): [True: 1, False: 2.32k]
  ------------------
 6880|      1|                xmlFatalErrMsg(ctxt, XML_ERR_CONDSEC_INVALID,
 6881|      1|                               "Parameter entity must match "
 6882|      1|                               "extSubsetDecl\n");
 6883|      1|                return;
 6884|      1|            }
 6885|       |
 6886|  2.32k|            depth--;
 6887|  2.32k|#ifdef LIBXML_VALID_ENABLED
 6888|  2.32k|            if ((ctxt->validate) && (ctxt->inputNr > declInputNr)) {
  ------------------
  |  Branch (6888:17): [True: 1.46k, False: 853]
  |  Branch (6888:37): [True: 26, False: 1.44k]
  ------------------
 6889|     26|		xmlValidityError(ctxt, XML_ERR_ENTITY_BOUNDARY,
 6890|     26|                                 "All markup of the conditional section is not"
 6891|     26|                                 " in the same entity\n",
 6892|     26|                                 NULL, NULL);
 6893|     26|            }
 6894|  2.32k|#endif
 6895|  2.32k|            SKIP(3);
  ------------------
  |  | 2285|  2.32k|#define SKIP(val) do {							\
  |  | 2286|  2.32k|    ctxt->input->cur += (val),ctxt->input->col+=(val);			\
  |  | 2287|  2.32k|    if (*ctxt->input->cur == 0)						\
  |  |  ------------------
  |  |  |  Branch (2287:9): [True: 1.24k, False: 1.07k]
  |  |  ------------------
  |  | 2288|  2.32k|        xmlParserGrow(ctxt);						\
  |  | 2289|  2.32k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2289:12): [Folded, False: 2.32k]
  |  |  ------------------
  ------------------
 6896|  3.19k|        } else if ((RAW == '<') && ((NXT(1) == '!') || (NXT(1) == '?'))) {
  ------------------
  |  | 2261|  3.19k|#define RAW (*ctxt->input->cur)
  ------------------
                      } else if ((RAW == '<') && ((NXT(1) == '!') || (NXT(1) == '?'))) {
  ------------------
  |  | 2263|  2.15k|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
                      } else if ((RAW == '<') && ((NXT(1) == '!') || (NXT(1) == '?'))) {
  ------------------
  |  | 2263|    224|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
  |  Branch (6896:20): [True: 2.15k, False: 1.03k]
  |  Branch (6896:37): [True: 1.93k, False: 224]
  |  Branch (6896:56): [True: 218, False: 6]
  ------------------
 6897|  2.14k|            isFreshPE = 0;
 6898|  2.14k|            xmlParseMarkupDecl(ctxt);
 6899|  2.14k|        } else if (RAW == '%') {
  ------------------
  |  | 2261|  1.04k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (6899:20): [True: 991, False: 52]
  ------------------
 6900|    991|            xmlParsePERefInternal(ctxt, 1);
 6901|    991|            if (ctxt->inputNr > declInputNr) {
  ------------------
  |  Branch (6901:17): [True: 285, False: 706]
  ------------------
 6902|    285|                isFreshPE = 1;
 6903|    285|                declInputNr = ctxt->inputNr;
 6904|    285|            }
 6905|    991|        } else {
 6906|     52|            xmlFatalErr(ctxt, XML_ERR_EXT_SUBSET_NOT_FINISHED, NULL);
 6907|     52|            return;
 6908|     52|        }
 6909|       |
 6910|  9.93k|        if (depth == 0)
  ------------------
  |  Branch (6910:13): [True: 2.80k, False: 7.12k]
  ------------------
 6911|  2.80k|            break;
 6912|       |
 6913|  7.12k|        SKIP_BLANKS;
  ------------------
  |  | 2312|  7.12k|#define SKIP_BLANKS xmlSkipBlankChars(ctxt)
  ------------------
 6914|  7.12k|        SHRINK;
  ------------------
  |  | 2304|  7.12k|    if (!PARSER_PROGRESSIVE(ctxt)) \
  |  |  ------------------
  |  |  |  |   47|  7.12k|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|  7.12k|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2304:9): [True: 7.08k, False: 38]
  |  |  ------------------
  |  | 2305|  7.12k|	xmlParserShrink(ctxt);
  ------------------
 6915|  7.12k|        GROW;
  ------------------
  |  | 2308|  7.12k|    if ((!PARSER_PROGRESSIVE(ctxt)) && \
  |  |  ------------------
  |  |  |  |   47|  7.12k|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|  7.12k|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2308:9): [True: 7.08k, False: 38]
  |  |  ------------------
  |  | 2309|  7.12k|        (ctxt->input->end - ctxt->input->cur < INPUT_CHUNK)) \
  |  |  ------------------
  |  |  |  |   63|  7.08k|#define INPUT_CHUNK	250
  |  |  ------------------
  |  |  |  Branch (2309:9): [True: 5.73k, False: 1.35k]
  |  |  ------------------
  |  | 2310|  7.12k|	xmlParserGrow(ctxt);
  ------------------
 6916|  7.12k|    }
 6917|  6.34k|}
parser.c:xmlParserEntityCheck:
  435|  2.49M|{
  436|  2.49M|    unsigned long consumed;
  437|  2.49M|    unsigned long *expandedSize;
  438|  2.49M|    xmlParserInputPtr input = ctxt->input;
  439|  2.49M|    xmlEntityPtr entity = input->entity;
  440|       |
  441|  2.49M|    if ((entity) && (entity->flags & XML_ENT_CHECKED))
  ------------------
  |  |   20|   461k|#define XML_ENT_CHECKED     (1u << 1)
  ------------------
  |  Branch (441:9): [True: 461k, False: 2.03M]
  |  Branch (441:21): [True: 368k, False: 93.6k]
  ------------------
  442|   368k|        return(0);
  443|       |
  444|       |    /*
  445|       |     * Compute total consumed bytes so far, including input streams of
  446|       |     * external entities.
  447|       |     */
  448|  2.12M|    consumed = input->consumed;
  449|  2.12M|    xmlSaturatedAddSizeT(&consumed, input->cur - input->base);
  450|  2.12M|    xmlSaturatedAdd(&consumed, ctxt->sizeentities);
  451|       |
  452|  2.12M|    if (entity)
  ------------------
  |  Branch (452:9): [True: 93.6k, False: 2.03M]
  ------------------
  453|  93.6k|        expandedSize = &entity->expandedSize;
  454|  2.03M|    else
  455|  2.03M|        expandedSize = &ctxt->sizeentcopy;
  456|       |
  457|       |    /*
  458|       |     * Add extra cost and some fixed cost.
  459|       |     */
  460|  2.12M|    xmlSaturatedAdd(expandedSize, extra);
  461|  2.12M|    xmlSaturatedAdd(expandedSize, XML_ENT_FIXED_COST);
  ------------------
  |  |  169|  2.12M|#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.12M|    if ((ctxt->maxAmpl > 0) &&
  ------------------
  |  Branch (468:9): [True: 2.12M, False: 0]
  ------------------
  469|  2.12M|        (*expandedSize > XML_PARSER_ALLOWED_EXPANSION) &&
  ------------------
  |  |  162|  2.12M|#define XML_PARSER_ALLOWED_EXPANSION 1000000
  ------------------
  |  Branch (469:9): [True: 702k, False: 1.42M]
  ------------------
  470|   702k|        ((*expandedSize >= ULONG_MAX) ||
  ------------------
  |  Branch (470:10): [True: 0, False: 702k]
  ------------------
  471|   702k|         (*expandedSize / ctxt->maxAmpl > consumed))) {
  ------------------
  |  Branch (471:10): [True: 345, False: 702k]
  ------------------
  472|    345|        xmlFatalErrMsg(ctxt, XML_ERR_RESOURCE_LIMIT,
  473|    345|                       "Maximum entity amplification factor exceeded, see "
  474|    345|                       "xmlCtxtSetMaxAmplification.\n");
  475|    345|        return(1);
  476|    345|    }
  477|       |
  478|  2.12M|    return(0);
  479|  2.12M|}
parser.c:xmlLookupGeneralEntity:
 7432|  3.12M|xmlLookupGeneralEntity(xmlParserCtxtPtr ctxt, const xmlChar *name, int inAttr) {
 7433|  3.12M|    xmlEntityPtr ent = NULL;
 7434|       |
 7435|       |    /*
 7436|       |     * Predefined entities override any extra definition
 7437|       |     */
 7438|  3.12M|    if ((ctxt->options & XML_PARSE_OLDSAX) == 0) {
  ------------------
  |  Branch (7438:9): [True: 1.59M, False: 1.53M]
  ------------------
 7439|  1.59M|        ent = xmlGetPredefinedEntity(name);
 7440|  1.59M|        if (ent != NULL)
  ------------------
  |  Branch (7440:13): [True: 649k, False: 946k]
  ------------------
 7441|   649k|            return(ent);
 7442|  1.59M|    }
 7443|       |
 7444|       |    /*
 7445|       |     * Ask first SAX for entity resolution, otherwise try the
 7446|       |     * entities which may have stored in the parser context.
 7447|       |     */
 7448|  2.47M|    if (ctxt->sax != NULL) {
  ------------------
  |  Branch (7448:9): [True: 2.47M, False: 0]
  ------------------
 7449|  2.47M|	if (ctxt->sax->getEntity != NULL)
  ------------------
  |  Branch (7449:6): [True: 2.47M, False: 0]
  ------------------
 7450|  2.47M|	    ent = ctxt->sax->getEntity(ctxt->userData, name);
 7451|  2.47M|	if ((ctxt->wellFormed == 1 ) && (ent == NULL) &&
  ------------------
  |  Branch (7451:6): [True: 37.0k, False: 2.44M]
  |  Branch (7451:34): [True: 3.30k, False: 33.7k]
  ------------------
 7452|  3.30k|	    (ctxt->options & XML_PARSE_OLDSAX))
  ------------------
  |  Branch (7452:6): [True: 1.35k, False: 1.95k]
  ------------------
 7453|  1.35k|	    ent = xmlGetPredefinedEntity(name);
 7454|  2.47M|	if ((ctxt->wellFormed == 1 ) && (ent == NULL) &&
  ------------------
  |  Branch (7454:6): [True: 37.0k, False: 2.44M]
  |  Branch (7454:34): [True: 3.30k, False: 33.7k]
  ------------------
 7455|  3.30k|	    (ctxt->userData==ctxt)) {
  ------------------
  |  Branch (7455:6): [True: 3.30k, False: 0]
  ------------------
 7456|  3.30k|	    ent = xmlSAX2GetEntity(ctxt, name);
 7457|  3.30k|	}
 7458|  2.47M|    }
 7459|       |
 7460|  2.47M|    if (ent == NULL) {
  ------------------
  |  Branch (7460:9): [True: 328k, False: 2.14M]
  ------------------
 7461|   328k|        xmlHandleUndeclaredEntity(ctxt, name);
 7462|   328k|    }
 7463|       |
 7464|       |    /*
 7465|       |     * [ WFC: Parsed Entity ]
 7466|       |     * An entity reference must not contain the name of an
 7467|       |     * unparsed entity
 7468|       |     */
 7469|  2.14M|    else if (ent->etype == XML_EXTERNAL_GENERAL_UNPARSED_ENTITY) {
  ------------------
  |  Branch (7469:14): [True: 197, False: 2.14M]
  ------------------
 7470|    197|	xmlFatalErrMsgStr(ctxt, XML_ERR_UNPARSED_ENTITY,
 7471|    197|		 "Entity reference to unparsed entity %s\n", name);
 7472|    197|        ent = NULL;
 7473|    197|    }
 7474|       |
 7475|       |    /*
 7476|       |     * [ WFC: No External Entity References ]
 7477|       |     * Attribute values cannot contain direct or indirect
 7478|       |     * entity references to external entities.
 7479|       |     */
 7480|  2.14M|    else if (ent->etype == XML_EXTERNAL_GENERAL_PARSED_ENTITY) {
  ------------------
  |  Branch (7480:14): [True: 17.2k, False: 2.13M]
  ------------------
 7481|  17.2k|        if (inAttr) {
  ------------------
  |  Branch (7481:13): [True: 1.18k, False: 16.0k]
  ------------------
 7482|  1.18k|            xmlFatalErrMsgStr(ctxt, XML_ERR_ENTITY_IS_EXTERNAL,
 7483|  1.18k|                 "Attribute references external entity '%s'\n", name);
 7484|  1.18k|            ent = NULL;
 7485|  1.18k|        }
 7486|  17.2k|    }
 7487|       |
 7488|  2.47M|    return(ent);
 7489|  3.12M|}
parser.c:xmlParseEntityRefInternal:
 7500|   986k|xmlParseEntityRefInternal(xmlParserCtxtPtr ctxt) {
 7501|   986k|    const xmlChar *name;
 7502|       |
 7503|   986k|    GROW;
  ------------------
  |  | 2308|   986k|    if ((!PARSER_PROGRESSIVE(ctxt)) && \
  |  |  ------------------
  |  |  |  |   47|   986k|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|   986k|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2308:9): [True: 477k, False: 509k]
  |  |  ------------------
  |  | 2309|   986k|        (ctxt->input->end - ctxt->input->cur < INPUT_CHUNK)) \
  |  |  ------------------
  |  |  |  |   63|   477k|#define INPUT_CHUNK	250
  |  |  ------------------
  |  |  |  Branch (2309:9): [True: 264k, False: 212k]
  |  |  ------------------
  |  | 2310|   986k|	xmlParserGrow(ctxt);
  ------------------
 7504|       |
 7505|   986k|    if (RAW != '&')
  ------------------
  |  | 2261|   986k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (7505:9): [True: 0, False: 986k]
  ------------------
 7506|      0|        return(NULL);
 7507|   986k|    NEXT;
  ------------------
  |  | 2316|   986k|#define NEXT xmlNextChar(ctxt)
  ------------------
 7508|   986k|    name = xmlParseName(ctxt);
 7509|   986k|    if (name == NULL) {
  ------------------
  |  Branch (7509:9): [True: 62.5k, False: 924k]
  ------------------
 7510|  62.5k|	xmlFatalErrMsg(ctxt, XML_ERR_NAME_REQUIRED,
 7511|  62.5k|		       "xmlParseEntityRef: no name\n");
 7512|  62.5k|        return(NULL);
 7513|  62.5k|    }
 7514|   924k|    if (RAW != ';') {
  ------------------
  |  | 2261|   924k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (7514:9): [True: 110k, False: 814k]
  ------------------
 7515|   110k|	xmlFatalErr(ctxt, XML_ERR_ENTITYREF_SEMICOL_MISSING, NULL);
 7516|   110k|	return(NULL);
 7517|   110k|    }
 7518|   814k|    NEXT;
  ------------------
  |  | 2316|   814k|#define NEXT xmlNextChar(ctxt)
  ------------------
 7519|       |
 7520|   814k|    return(name);
 7521|   924k|}
parser.c:xmlParsePERefInternal:
 7636|   228k|xmlParsePERefInternal(xmlParserCtxt *ctxt, int markupDecl) {
 7637|   228k|    const xmlChar *name;
 7638|   228k|    xmlEntityPtr entity = NULL;
 7639|   228k|    xmlParserInputPtr input;
 7640|       |
 7641|   228k|    if (RAW != '%')
  ------------------
  |  | 2261|   228k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (7641:9): [True: 0, False: 228k]
  ------------------
 7642|      0|        return;
 7643|   228k|    NEXT;
  ------------------
  |  | 2316|   228k|#define NEXT xmlNextChar(ctxt)
  ------------------
 7644|   228k|    name = xmlParseName(ctxt);
 7645|   228k|    if (name == NULL) {
  ------------------
  |  Branch (7645:9): [True: 14.3k, False: 213k]
  ------------------
 7646|  14.3k|	xmlFatalErrMsg(ctxt, XML_ERR_PEREF_NO_NAME, "PEReference: no name\n");
 7647|  14.3k|	return;
 7648|  14.3k|    }
 7649|   213k|    if (RAW != ';') {
  ------------------
  |  | 2261|   213k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (7649:9): [True: 17.0k, False: 196k]
  ------------------
 7650|  17.0k|	xmlFatalErr(ctxt, XML_ERR_PEREF_SEMICOL_MISSING, NULL);
 7651|  17.0k|        return;
 7652|  17.0k|    }
 7653|       |
 7654|   196k|    NEXT;
  ------------------
  |  | 2316|   196k|#define NEXT xmlNextChar(ctxt)
  ------------------
 7655|       |
 7656|       |    /* Must be set before xmlHandleUndeclaredEntity */
 7657|   196k|    ctxt->hasPErefs = 1;
 7658|       |
 7659|       |    /*
 7660|       |     * Request the entity from SAX
 7661|       |     */
 7662|   196k|    if ((ctxt->sax != NULL) &&
  ------------------
  |  Branch (7662:9): [True: 196k, False: 0]
  ------------------
 7663|   196k|	(ctxt->sax->getParameterEntity != NULL))
  ------------------
  |  Branch (7663:2): [True: 196k, False: 0]
  ------------------
 7664|   196k|	entity = ctxt->sax->getParameterEntity(ctxt->userData, name);
 7665|       |
 7666|   196k|    if (entity == NULL) {
  ------------------
  |  Branch (7666:9): [True: 57.2k, False: 139k]
  ------------------
 7667|  57.2k|        xmlHandleUndeclaredEntity(ctxt, name);
 7668|   139k|    } else {
 7669|       |	/*
 7670|       |	 * Internal checking in case the entity quest barfed
 7671|       |	 */
 7672|   139k|	if ((entity->etype != XML_INTERNAL_PARAMETER_ENTITY) &&
  ------------------
  |  Branch (7672:6): [True: 129k, False: 10.1k]
  ------------------
 7673|   129k|	    (entity->etype != XML_EXTERNAL_PARAMETER_ENTITY)) {
  ------------------
  |  Branch (7673:6): [True: 0, False: 129k]
  ------------------
 7674|      0|	    xmlWarningMsg(ctxt, XML_WAR_UNDECLARED_ENTITY,
 7675|      0|		  "Internal: %%%s; is not a parameter entity\n",
 7676|      0|			  name, NULL);
 7677|   139k|	} else {
 7678|   139k|	    if ((entity->etype == XML_EXTERNAL_PARAMETER_ENTITY) &&
  ------------------
  |  Branch (7678:10): [True: 129k, False: 10.1k]
  ------------------
 7679|   129k|                ((ctxt->options & XML_PARSE_NO_XXE) ||
  ------------------
  |  Branch (7679:18): [True: 201, False: 128k]
  ------------------
 7680|   128k|		 (((ctxt->loadsubset & ~XML_SKIP_IDS) == 0) &&
  ------------------
  |  |  210|   128k|#define XML_SKIP_IDS		8
  ------------------
  |  Branch (7680:5): [True: 31.6k, False: 97.2k]
  ------------------
 7681|  31.6k|		  (ctxt->replaceEntities == 0) &&
  ------------------
  |  Branch (7681:5): [True: 9.34k, False: 22.3k]
  ------------------
 7682|  9.34k|		  (ctxt->validate == 0))))
  ------------------
  |  Branch (7682:5): [True: 194, False: 9.14k]
  ------------------
 7683|    395|		return;
 7684|       |
 7685|   138k|            if (entity->flags & XML_ENT_EXPANDING) {
  ------------------
  |  |   22|   138k|#define XML_ENT_EXPANDING   (1u << 3)
  ------------------
  |  Branch (7685:17): [True: 10, False: 138k]
  ------------------
 7686|     10|                xmlFatalErr(ctxt, XML_ERR_ENTITY_LOOP, NULL);
 7687|     10|                return;
 7688|     10|            }
 7689|       |
 7690|   138k|	    input = xmlNewEntityInputStream(ctxt, entity);
 7691|   138k|	    if (xmlCtxtPushInput(ctxt, input) < 0) {
  ------------------
  |  Branch (7691:10): [True: 2.10k, False: 136k]
  ------------------
 7692|  2.10k|                xmlFreeInputStream(input);
 7693|  2.10k|		return;
 7694|  2.10k|            }
 7695|       |
 7696|   136k|            entity->flags |= XML_ENT_EXPANDING;
  ------------------
  |  |   22|   136k|#define XML_ENT_EXPANDING   (1u << 3)
  ------------------
 7697|       |
 7698|   136k|            if (markupDecl)
  ------------------
  |  Branch (7698:17): [True: 119k, False: 17.2k]
  ------------------
 7699|   119k|                input->flags |= XML_INPUT_MARKUP_DECL;
  ------------------
  |  |   42|   119k|#define XML_INPUT_MARKUP_DECL       (1u << 7)
  ------------------
 7700|       |
 7701|   136k|            GROW;
  ------------------
  |  | 2308|   136k|    if ((!PARSER_PROGRESSIVE(ctxt)) && \
  |  |  ------------------
  |  |  |  |   47|   136k|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|   136k|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2308:9): [True: 136k, False: 0]
  |  |  ------------------
  |  | 2309|   136k|        (ctxt->input->end - ctxt->input->cur < INPUT_CHUNK)) \
  |  |  ------------------
  |  |  |  |   63|   136k|#define INPUT_CHUNK	250
  |  |  ------------------
  |  |  |  Branch (2309:9): [True: 89.0k, False: 47.7k]
  |  |  ------------------
  |  | 2310|   136k|	xmlParserGrow(ctxt);
  ------------------
 7702|       |
 7703|   136k|	    if (entity->etype == XML_EXTERNAL_PARAMETER_ENTITY) {
  ------------------
  |  Branch (7703:10): [True: 126k, False: 10.1k]
  ------------------
 7704|   126k|                xmlDetectEncoding(ctxt);
 7705|       |
 7706|   126k|                if ((CMP5(CUR_PTR, '<', '?', 'x', 'm', 'l')) &&
  ------------------
  |  | 2271|   126k|  ( CMP4( s, c1, c2, c3, c4 ) && ((unsigned char *) s)[ 4 ] == c5 )
  |  |  ------------------
  |  |  |  | 2268|   253k|  ( ((unsigned char *) s)[ 0 ] == c1 && ((unsigned char *) s)[ 1 ] == c2 && \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2268:5): [True: 100k, False: 26.1k]
  |  |  |  |  |  Branch (2268:41): [True: 62.0k, False: 38.3k]
  |  |  |  |  ------------------
  |  |  |  | 2269|   126k|    ((unsigned char *) s)[ 2 ] == c3 && ((unsigned char *) s)[ 3 ] == c4 )
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2269:5): [True: 57.6k, False: 4.45k]
  |  |  |  |  |  Branch (2269:41): [True: 56.6k, False: 991]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2271:34): [True: 55.2k, False: 1.42k]
  |  |  ------------------
  ------------------
 7707|  55.2k|                    (IS_BLANK_CH(NXT(5)))) {
  ------------------
  |  |  137|  55.2k|#define IS_BLANK_CH(c)  xmlIsBlank_ch(c)
  |  |  ------------------
  |  |  |  |   90|  55.2k|#define xmlIsBlank_ch(c)	(((c) == 0x20) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (90:27): [True: 52.7k, False: 2.43k]
  |  |  |  |  ------------------
  |  |  |  |   91|  55.2k|				 ((0x9 <= (c)) && ((c) <= 0xa)) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (91:7): [True: 2.22k, False: 208]
  |  |  |  |  |  Branch (91:23): [True: 408, False: 1.82k]
  |  |  |  |  ------------------
  |  |  |  |   92|  55.2k|				 ((c) == 0xd))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (92:6): [True: 422, False: 1.60k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 7708|  53.6k|                    xmlParseTextDecl(ctxt);
 7709|  53.6k|                }
 7710|   126k|            }
 7711|   136k|	}
 7712|   139k|    }
 7713|   196k|}
parser.c:xmlErrAttributeDup:
  238|  68.7k|{
  239|  68.7k|    if (prefix == NULL)
  ------------------
  |  Branch (239:9): [True: 19.1k, False: 49.5k]
  ------------------
  240|  19.1k|        xmlCtxtErr(ctxt, NULL, XML_FROM_PARSER, XML_ERR_ATTRIBUTE_REDEFINED,
  241|  19.1k|                   XML_ERR_FATAL, localname, NULL, NULL, 0,
  242|  19.1k|                   "Attribute %s redefined\n", localname);
  243|  49.5k|    else
  244|  49.5k|        xmlCtxtErr(ctxt, NULL, XML_FROM_PARSER, XML_ERR_ATTRIBUTE_REDEFINED,
  245|       |                   XML_ERR_FATAL, prefix, localname, NULL, 0,
  246|  49.5k|                   "Attribute %s:%s redefined\n", prefix, localname);
  247|  68.7k|}
parser.c:xmlParseEndTag1:
 8344|  81.2k|xmlParseEndTag1(xmlParserCtxtPtr ctxt, int line) {
 8345|  81.2k|    const xmlChar *name;
 8346|       |
 8347|  81.2k|    GROW;
  ------------------
  |  | 2308|  81.2k|    if ((!PARSER_PROGRESSIVE(ctxt)) && \
  |  |  ------------------
  |  |  |  |   47|  81.2k|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|  81.2k|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2308:9): [True: 64.0k, False: 17.1k]
  |  |  ------------------
  |  | 2309|  81.2k|        (ctxt->input->end - ctxt->input->cur < INPUT_CHUNK)) \
  |  |  ------------------
  |  |  |  |   63|  64.0k|#define INPUT_CHUNK	250
  |  |  ------------------
  |  |  |  Branch (2309:9): [True: 11.1k, False: 52.9k]
  |  |  ------------------
  |  | 2310|  81.2k|	xmlParserGrow(ctxt);
  ------------------
 8348|  81.2k|    if ((RAW != '<') || (NXT(1) != '/')) {
  ------------------
  |  | 2261|  81.2k|#define RAW (*ctxt->input->cur)
  ------------------
                  if ((RAW != '<') || (NXT(1) != '/')) {
  ------------------
  |  | 2263|  81.2k|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
  |  Branch (8348:9): [True: 33, False: 81.2k]
  |  Branch (8348:25): [True: 21, False: 81.1k]
  ------------------
 8349|     54|	xmlFatalErrMsg(ctxt, XML_ERR_LTSLASH_REQUIRED,
 8350|     54|		       "xmlParseEndTag: '</' not found\n");
 8351|     54|	return;
 8352|     54|    }
 8353|  81.1k|    SKIP(2);
  ------------------
  |  | 2285|  81.1k|#define SKIP(val) do {							\
  |  | 2286|  81.1k|    ctxt->input->cur += (val),ctxt->input->col+=(val);			\
  |  | 2287|  81.1k|    if (*ctxt->input->cur == 0)						\
  |  |  ------------------
  |  |  |  Branch (2287:9): [True: 477, False: 80.7k]
  |  |  ------------------
  |  | 2288|  81.1k|        xmlParserGrow(ctxt);						\
  |  | 2289|  81.1k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2289:12): [Folded, False: 81.1k]
  |  |  ------------------
  ------------------
 8354|       |
 8355|  81.1k|    name = xmlParseNameAndCompare(ctxt,ctxt->name);
 8356|       |
 8357|       |    /*
 8358|       |     * We should definitely be at the ending "S? '>'" part
 8359|       |     */
 8360|  81.1k|    GROW;
  ------------------
  |  | 2308|  81.1k|    if ((!PARSER_PROGRESSIVE(ctxt)) && \
  |  |  ------------------
  |  |  |  |   47|  81.1k|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|  81.1k|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2308:9): [True: 64.0k, False: 17.1k]
  |  |  ------------------
  |  | 2309|  81.1k|        (ctxt->input->end - ctxt->input->cur < INPUT_CHUNK)) \
  |  |  ------------------
  |  |  |  |   63|  64.0k|#define INPUT_CHUNK	250
  |  |  ------------------
  |  |  |  Branch (2309:9): [True: 11.1k, False: 52.8k]
  |  |  ------------------
  |  | 2310|  81.1k|	xmlParserGrow(ctxt);
  ------------------
 8361|  81.1k|    SKIP_BLANKS;
  ------------------
  |  | 2312|  81.1k|#define SKIP_BLANKS xmlSkipBlankChars(ctxt)
  ------------------
 8362|  81.1k|    if ((!IS_BYTE_CHAR(RAW)) || (RAW != '>')) {
  ------------------
  |  |  103|  81.1k|#define IS_BYTE_CHAR(c)	 xmlIsChar_ch(c)
  |  |  ------------------
  |  |  |  |  108|  81.1k|#define xmlIsChar_ch(c)		(((0x9 <= (c)) && ((c) <= 0xa)) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (108:28): [True: 77.2k, False: 3.96k]
  |  |  |  |  |  Branch (108:44): [True: 0, False: 77.2k]
  |  |  |  |  ------------------
  |  |  |  |  109|  81.1k|				 ((c) == 0xd) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (109:6): [True: 0, False: 81.1k]
  |  |  |  |  ------------------
  |  |  |  |  110|  81.1k|				  (0x20 <= (c)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (110:7): [True: 77.0k, False: 4.15k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                  if ((!IS_BYTE_CHAR(RAW)) || (RAW != '>')) {
  ------------------
  |  | 2261|  77.0k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (8362:33): [True: 6.96k, False: 70.0k]
  ------------------
 8363|  11.1k|	xmlFatalErr(ctxt, XML_ERR_GT_REQUIRED, NULL);
 8364|  11.1k|    } else
 8365|  70.0k|	NEXT1;
  ------------------
  |  | 2318|  70.0k|#define NEXT1 {								\
  |  | 2319|  70.0k|	ctxt->input->col++;						\
  |  | 2320|  70.0k|	ctxt->input->cur++;						\
  |  | 2321|  70.0k|	if (*ctxt->input->cur == 0)					\
  |  |  ------------------
  |  |  |  Branch (2321:6): [True: 1.44k, False: 68.6k]
  |  |  ------------------
  |  | 2322|  70.0k|	    xmlParserGrow(ctxt);						\
  |  | 2323|  70.0k|    }
  ------------------
 8366|       |
 8367|       |    /*
 8368|       |     * [ WFC: Element Type Match ]
 8369|       |     * The Name in an element's end-tag must match the element type in the
 8370|       |     * start-tag.
 8371|       |     *
 8372|       |     */
 8373|  81.1k|    if (name != (xmlChar*)1) {
  ------------------
  |  Branch (8373:9): [True: 7.61k, False: 73.5k]
  ------------------
 8374|  7.61k|        if (name == NULL) name = BAD_CAST "unparsable";
  ------------------
  |  |   34|  2.93k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (8374:13): [True: 2.93k, False: 4.67k]
  ------------------
 8375|  7.61k|        xmlFatalErrMsgStrIntStr(ctxt, XML_ERR_TAG_NAME_MISMATCH,
 8376|  7.61k|		     "Opening and ending tag mismatch: %s line %d and %s\n",
 8377|  7.61k|		                ctxt->name, line, name);
 8378|  7.61k|    }
 8379|       |
 8380|       |    /*
 8381|       |     * SAX: End of Tag
 8382|       |     */
 8383|  81.1k|    if ((ctxt->sax != NULL) && (ctxt->sax->endElement != NULL) &&
  ------------------
  |  Branch (8383:9): [True: 81.1k, False: 0]
  |  Branch (8383:32): [True: 81.1k, False: 0]
  ------------------
 8384|  81.1k|	(!ctxt->disableSAX))
  ------------------
  |  Branch (8384:2): [True: 72.4k, False: 8.70k]
  ------------------
 8385|  72.4k|        ctxt->sax->endElement(ctxt->userData, ctxt->name);
 8386|       |
 8387|  81.1k|    namePop(ctxt);
 8388|  81.1k|    spacePop(ctxt);
 8389|  81.1k|}
parser.c:xmlParseNameAndCompare:
 3340|   167k|xmlParseNameAndCompare(xmlParserCtxtPtr ctxt, xmlChar const *other) {
 3341|   167k|    register const xmlChar *cmp = other;
 3342|   167k|    register const xmlChar *in;
 3343|   167k|    const xmlChar *ret;
 3344|       |
 3345|   167k|    GROW;
  ------------------
  |  | 2308|   167k|    if ((!PARSER_PROGRESSIVE(ctxt)) && \
  |  |  ------------------
  |  |  |  |   47|   167k|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|   167k|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2308:9): [True: 132k, False: 35.3k]
  |  |  ------------------
  |  | 2309|   167k|        (ctxt->input->end - ctxt->input->cur < INPUT_CHUNK)) \
  |  |  ------------------
  |  |  |  |   63|   132k|#define INPUT_CHUNK	250
  |  |  ------------------
  |  |  |  Branch (2309:9): [True: 22.4k, False: 110k]
  |  |  ------------------
  |  | 2310|   167k|	xmlParserGrow(ctxt);
  ------------------
 3346|       |
 3347|   167k|    in = ctxt->input->cur;
 3348|   393k|    while (*in != 0 && *in == *cmp) {
  ------------------
  |  Branch (3348:12): [True: 388k, False: 4.57k]
  |  Branch (3348:24): [True: 225k, False: 163k]
  ------------------
 3349|   225k|	++in;
 3350|   225k|	++cmp;
 3351|   225k|    }
 3352|   167k|    if (*cmp == 0 && (*in == '>' || IS_BLANK_CH (*in))) {
  ------------------
  |  |  137|  12.8k|#define IS_BLANK_CH(c)  xmlIsBlank_ch(c)
  |  |  ------------------
  |  |  |  |   90|  12.8k|#define xmlIsBlank_ch(c)	(((c) == 0x20) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (90:27): [True: 732, False: 12.0k]
  |  |  |  |  ------------------
  |  |  |  |   91|  12.8k|				 ((0x9 <= (c)) && ((c) <= 0xa)) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (91:7): [True: 8.72k, False: 3.35k]
  |  |  |  |  |  Branch (91:23): [True: 1.95k, False: 6.76k]
  |  |  |  |  ------------------
  |  |  |  |   92|  12.8k|				 ((c) == 0xd))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (92:6): [True: 854, False: 9.26k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (3352:9): [True: 151k, False: 16.3k]
  |  Branch (3352:23): [True: 138k, False: 12.8k]
  ------------------
 3353|       |	/* success */
 3354|   142k|	ctxt->input->col += in - ctxt->input->cur;
 3355|   142k|	ctxt->input->cur = in;
 3356|   142k|	return (const xmlChar*) 1;
 3357|   142k|    }
 3358|       |    /* failure (or end of input buffer), check with full function */
 3359|  25.6k|    ret = xmlParseName (ctxt);
 3360|       |    /* strings coming from the dictionary direct compare possible */
 3361|  25.6k|    if (ret == other) {
  ------------------
  |  Branch (3361:9): [True: 8.05k, False: 17.5k]
  ------------------
 3362|  8.05k|	return (const xmlChar*) 1;
 3363|  8.05k|    }
 3364|  17.5k|    return ret;
 3365|  25.6k|}
parser.c:namePop:
 2175|   760k|{
 2176|   760k|    const xmlChar *ret;
 2177|       |
 2178|   760k|    if ((ctxt == NULL) || (ctxt->nameNr <= 0))
  ------------------
  |  Branch (2178:9): [True: 0, False: 760k]
  |  Branch (2178:27): [True: 3, False: 760k]
  ------------------
 2179|      3|        return (NULL);
 2180|   760k|    ctxt->nameNr--;
 2181|   760k|    if (ctxt->nameNr > 0)
  ------------------
  |  Branch (2181:9): [True: 750k, False: 10.0k]
  ------------------
 2182|   750k|        ctxt->name = ctxt->nameTab[ctxt->nameNr - 1];
 2183|  10.0k|    else
 2184|  10.0k|        ctxt->name = NULL;
 2185|   760k|    ret = ctxt->nameTab[ctxt->nameNr];
 2186|       |    ctxt->nameTab[ctxt->nameNr] = NULL;
 2187|   760k|    return (ret);
 2188|   760k|}
parser.c:spacePop:
 2216|   951k|static int spacePop(xmlParserCtxtPtr ctxt) {
 2217|   951k|    int ret;
 2218|   951k|    if (ctxt->spaceNr <= 0) return(0);
  ------------------
  |  Branch (2218:9): [True: 0, False: 951k]
  ------------------
 2219|   951k|    ctxt->spaceNr--;
 2220|   951k|    if (ctxt->spaceNr > 0)
  ------------------
  |  Branch (2220:9): [True: 951k, False: 22]
  ------------------
 2221|   951k|	ctxt->space = &ctxt->spaceTab[ctxt->spaceNr - 1];
 2222|     22|    else
 2223|     22|        ctxt->space = &ctxt->spaceTab[0];
 2224|   951k|    ret = ctxt->spaceTab[ctxt->spaceNr];
 2225|   951k|    ctxt->spaceTab[ctxt->spaceNr] = -1;
 2226|   951k|    return(ret);
 2227|   951k|}
parser.c:xmlParseContentInternal:
 9577|  12.3k|xmlParseContentInternal(xmlParserCtxtPtr ctxt) {
 9578|  12.3k|    int oldNameNr = ctxt->nameNr;
 9579|  12.3k|    int oldSpaceNr = ctxt->spaceNr;
 9580|  12.3k|    int oldNodeNr = ctxt->nodeNr;
 9581|       |
 9582|  12.3k|    GROW;
  ------------------
  |  | 2308|  12.3k|    if ((!PARSER_PROGRESSIVE(ctxt)) && \
  |  |  ------------------
  |  |  |  |   47|  12.3k|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|  12.3k|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2308:9): [True: 12.3k, False: 0]
  |  |  ------------------
  |  | 2309|  12.3k|        (ctxt->input->end - ctxt->input->cur < INPUT_CHUNK)) \
  |  |  ------------------
  |  |  |  |   63|  12.3k|#define INPUT_CHUNK	250
  |  |  ------------------
  |  |  |  Branch (2309:9): [True: 9.99k, False: 2.35k]
  |  |  ------------------
  |  | 2310|  12.3k|	xmlParserGrow(ctxt);
  ------------------
 9583|  6.45M|    while ((ctxt->input->cur < ctxt->input->end) &&
  ------------------
  |  Branch (9583:12): [True: 6.45M, False: 6.95k]
  ------------------
 9584|  6.45M|	   (PARSER_STOPPED(ctxt) == 0)) {
  ------------------
  |  |   44|  6.45M|#define PARSER_STOPPED(ctxt) ((ctxt)->disableSAX > 1)
  ------------------
  |  Branch (9584:5): [True: 6.45M, False: 466]
  ------------------
 9585|  6.45M|	const xmlChar *cur = ctxt->input->cur;
 9586|       |
 9587|       |	/*
 9588|       |	 * First case : a Processing Instruction.
 9589|       |	 */
 9590|  6.45M|	if ((*cur == '<') && (cur[1] == '?')) {
  ------------------
  |  Branch (9590:6): [True: 1.10M, False: 5.34M]
  |  Branch (9590:23): [True: 109k, False: 996k]
  ------------------
 9591|   109k|	    xmlParsePI(ctxt);
 9592|   109k|	}
 9593|       |
 9594|       |	/*
 9595|       |	 * Second case : a CDSection
 9596|       |	 */
 9597|       |	/* 2.6.0 test was *cur not RAW */
 9598|  6.34M|	else if (CMP9(CUR_PTR, '<', '!', '[', 'C', 'D', 'A', 'T', 'A', '[')) {
  ------------------
  |  | 2279|  6.34M|  ( CMP8( s, c1, c2, c3, c4, c5, c6, c7, c8 ) && \
  |  |  ------------------
  |  |  |  | 2277|  12.6M|  ( CMP7( s, c1, c2, c3, c4, c5, c6, c7 ) && ((unsigned char *) s)[ 7 ] == c8 )
  |  |  |  |  ------------------
  |  |  |  |  |  | 2275|  12.6M|  ( CMP6( s, c1, c2, c3, c4, c5, c6 ) && ((unsigned char *) s)[ 6 ] == c7 )
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  | 2273|  12.6M|  ( CMP5( s, c1, c2, c3, c4, c5 ) && ((unsigned char *) s)[ 5 ] == c6 )
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  | 2271|  12.6M|  ( CMP4( s, c1, c2, c3, c4 ) && ((unsigned char *) s)[ 4 ] == c5 )
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  | 2268|  12.6M|  ( ((unsigned char *) s)[ 0 ] == c1 && ((unsigned char *) s)[ 1 ] == c2 && \
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  Branch (2268:5): [True: 996k, False: 5.34M]
  |  |  |  |  |  |  |  |  |  |  |  |  |  Branch (2268:41): [True: 106k, False: 890k]
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  | 2269|  6.34M|    ((unsigned char *) s)[ 2 ] == c3 && ((unsigned char *) s)[ 3 ] == c4 )
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  Branch (2269:5): [True: 72.1k, False: 33.8k]
  |  |  |  |  |  |  |  |  |  |  |  |  |  Branch (2269:41): [True: 70.9k, False: 1.19k]
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (2271:34): [True: 70.4k, False: 524]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (2273:38): [True: 70.0k, False: 337]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (2275:42): [True: 69.7k, False: 325]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2277:46): [True: 69.5k, False: 243]
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 2280|  6.34M|    ((unsigned char *) s)[ 8 ] == c9 )
  |  |  ------------------
  |  |  |  Branch (2280:5): [True: 69.2k, False: 253]
  |  |  ------------------
  ------------------
 9599|  69.2k|	    xmlParseCDSect(ctxt);
 9600|  69.2k|	}
 9601|       |
 9602|       |	/*
 9603|       |	 * Third case :  a comment
 9604|       |	 */
 9605|  6.27M|	else if ((*cur == '<') && (NXT(1) == '!') &&
  ------------------
  |  | 2263|   926k|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
  |  Branch (9605:11): [True: 926k, False: 5.34M]
  |  Branch (9605:28): [True: 36.7k, False: 890k]
  ------------------
 9606|  36.7k|		 (NXT(2) == '-') && (NXT(3) == '-')) {
  ------------------
  |  | 2263|  36.7k|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
              		 (NXT(2) == '-') && (NXT(3) == '-')) {
  ------------------
  |  | 2263|  20.0k|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
  |  Branch (9606:4): [True: 20.0k, False: 16.6k]
  |  Branch (9606:23): [True: 19.7k, False: 296]
  ------------------
 9607|  19.7k|	    xmlParseComment(ctxt);
 9608|  19.7k|	}
 9609|       |
 9610|       |	/*
 9611|       |	 * Fourth case :  a sub-element.
 9612|       |	 */
 9613|  6.25M|	else if (*cur == '<') {
  ------------------
  |  Branch (9613:11): [True: 907k, False: 5.34M]
  ------------------
 9614|   907k|            if (NXT(1) == '/') {
  ------------------
  |  | 2263|   907k|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
  |  Branch (9614:17): [True: 148k, False: 758k]
  ------------------
 9615|   148k|                if (ctxt->nameNr <= oldNameNr)
  ------------------
  |  Branch (9615:21): [True: 4.92k, False: 144k]
  ------------------
 9616|  4.92k|                    break;
 9617|   144k|	        xmlParseElementEnd(ctxt);
 9618|   758k|            } else {
 9619|   758k|	        xmlParseElementStart(ctxt);
 9620|   758k|            }
 9621|   907k|	}
 9622|       |
 9623|       |	/*
 9624|       |	 * Fifth case : a reference. If if has not been resolved,
 9625|       |	 *    parsing returns it's Name, create the node
 9626|       |	 */
 9627|       |
 9628|  5.34M|	else if (*cur == '&') {
  ------------------
  |  Branch (9628:11): [True: 97.9k, False: 5.24M]
  ------------------
 9629|  97.9k|	    xmlParseReference(ctxt);
 9630|  97.9k|	}
 9631|       |
 9632|       |	/*
 9633|       |	 * Last case, text. Note that References are handled directly.
 9634|       |	 */
 9635|  5.24M|	else {
 9636|  5.24M|	    xmlParseCharDataInternal(ctxt, 0);
 9637|  5.24M|	}
 9638|       |
 9639|  6.44M|	SHRINK;
  ------------------
  |  | 2304|  6.44M|    if (!PARSER_PROGRESSIVE(ctxt)) \
  |  |  ------------------
  |  |  |  |   47|  6.44M|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|  6.44M|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2304:9): [True: 6.44M, False: 0]
  |  |  ------------------
  |  | 2305|  6.44M|	xmlParserShrink(ctxt);
  ------------------
 9640|  6.44M|	GROW;
  ------------------
  |  | 2308|  6.44M|    if ((!PARSER_PROGRESSIVE(ctxt)) && \
  |  |  ------------------
  |  |  |  |   47|  6.44M|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|  6.44M|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2308:9): [True: 6.44M, False: 0]
  |  |  ------------------
  |  | 2309|  6.44M|        (ctxt->input->end - ctxt->input->cur < INPUT_CHUNK)) \
  |  |  ------------------
  |  |  |  |   63|  6.44M|#define INPUT_CHUNK	250
  |  |  ------------------
  |  |  |  Branch (2309:9): [True: 150k, False: 6.29M]
  |  |  ------------------
  |  | 2310|  6.44M|	xmlParserGrow(ctxt);
  ------------------
 9641|  6.44M|    }
 9642|       |
 9643|  12.3k|    if ((ctxt->nameNr > oldNameNr) &&
  ------------------
  |  Branch (9643:9): [True: 1.86k, False: 10.4k]
  ------------------
 9644|  1.86k|        (ctxt->input->cur >= ctxt->input->end) &&
  ------------------
  |  Branch (9644:9): [True: 1.64k, False: 215]
  ------------------
 9645|  1.64k|        (ctxt->wellFormed)) {
  ------------------
  |  Branch (9645:9): [True: 42, False: 1.60k]
  ------------------
 9646|     42|        const xmlChar *name = ctxt->nameTab[ctxt->nameNr - 1];
 9647|     42|        int line = ctxt->pushTab[ctxt->nameNr - 1].line;
 9648|     42|        xmlFatalErrMsgStrIntStr(ctxt, XML_ERR_TAG_NOT_FINISHED,
 9649|     42|                "Premature end of data in tag %s line %d\n",
 9650|     42|                name, line, NULL);
 9651|     42|    }
 9652|       |
 9653|       |    /*
 9654|       |     * Clean up in error case
 9655|       |     */
 9656|       |
 9657|  85.0k|    while (ctxt->nodeNr > oldNodeNr)
  ------------------
  |  Branch (9657:12): [True: 72.6k, False: 12.3k]
  ------------------
 9658|  72.6k|        nodePop(ctxt);
 9659|       |
 9660|   120k|    while (ctxt->nameNr > oldNameNr) {
  ------------------
  |  Branch (9660:12): [True: 108k, False: 12.3k]
  ------------------
 9661|   108k|        xmlStartTag *tag = &ctxt->pushTab[ctxt->nameNr - 1];
 9662|       |
 9663|   108k|        if (tag->nsNr != 0)
  ------------------
  |  Branch (9663:13): [True: 16.3k, False: 92.0k]
  ------------------
 9664|  16.3k|            xmlParserNsPop(ctxt, tag->nsNr);
 9665|       |
 9666|   108k|        namePop(ctxt);
 9667|   108k|    }
 9668|       |
 9669|   120k|    while (ctxt->spaceNr > oldSpaceNr)
  ------------------
  |  Branch (9669:12): [True: 108k, False: 12.3k]
  ------------------
 9670|   108k|        spacePop(ctxt);
 9671|  12.3k|}
parser.c:xmlFatalErrMsgStrIntStr:
  332|   126k|{
  333|   126k|    xmlCtxtErr(ctxt, NULL, XML_FROM_PARSER, error, XML_ERR_FATAL,
  334|       |               str1, str2, NULL, val, msg, str1, val, str2);
  335|   126k|}
parser.c:xmlParseElementStart:
 9736|   767k|xmlParseElementStart(xmlParserCtxtPtr ctxt) {
 9737|   767k|    int maxDepth = (ctxt->options & XML_PARSE_HUGE) ? 2048 : 256;
  ------------------
  |  Branch (9737:20): [True: 507k, False: 260k]
  ------------------
 9738|   767k|    const xmlChar *name;
 9739|   767k|    const xmlChar *prefix = NULL;
 9740|   767k|    const xmlChar *URI = NULL;
 9741|   767k|    xmlParserNodeInfo node_info;
 9742|   767k|    int line;
 9743|   767k|    xmlNodePtr cur;
 9744|   767k|    int nbNs = 0;
 9745|       |
 9746|   767k|    if (ctxt->nameNr > maxDepth) {
  ------------------
  |  Branch (9746:9): [True: 13, False: 767k]
  ------------------
 9747|     13|        xmlFatalErrMsgInt(ctxt, XML_ERR_RESOURCE_LIMIT,
 9748|     13|                "Excessive depth in document: %d use XML_PARSE_HUGE option\n",
 9749|     13|                ctxt->nameNr);
 9750|     13|	return(-1);
 9751|     13|    }
 9752|       |
 9753|       |    /* Capture start position */
 9754|   767k|    if (ctxt->record_info) {
  ------------------
  |  Branch (9754:9): [True: 0, False: 767k]
  ------------------
 9755|      0|        node_info.begin_pos = ctxt->input->consumed +
 9756|      0|                          (CUR_PTR - ctxt->input->base);
  ------------------
  |  | 2264|      0|#define CUR_PTR ctxt->input->cur
  ------------------
 9757|      0|	node_info.begin_line = ctxt->input->line;
 9758|      0|    }
 9759|       |
 9760|   767k|    if (ctxt->spaceNr == 0)
  ------------------
  |  Branch (9760:9): [True: 0, False: 767k]
  ------------------
 9761|      0|	spacePush(ctxt, -1);
 9762|   767k|    else if (*ctxt->space == -2)
  ------------------
  |  Branch (9762:14): [True: 219k, False: 547k]
  ------------------
 9763|   219k|	spacePush(ctxt, -1);
 9764|   547k|    else
 9765|   547k|	spacePush(ctxt, *ctxt->space);
 9766|       |
 9767|   767k|    line = ctxt->input->line;
 9768|   767k|#ifdef LIBXML_SAX1_ENABLED
 9769|   767k|    if (ctxt->sax2)
  ------------------
  |  Branch (9769:9): [True: 555k, False: 212k]
  ------------------
 9770|   555k|#endif /* LIBXML_SAX1_ENABLED */
 9771|   555k|        name = xmlParseStartTag2(ctxt, &prefix, &URI, &nbNs);
 9772|   212k|#ifdef LIBXML_SAX1_ENABLED
 9773|   212k|    else
 9774|   212k|	name = xmlParseStartTag(ctxt);
 9775|   767k|#endif /* LIBXML_SAX1_ENABLED */
 9776|   767k|    if (name == NULL) {
  ------------------
  |  Branch (9776:9): [True: 30.5k, False: 737k]
  ------------------
 9777|  30.5k|	spacePop(ctxt);
 9778|  30.5k|        return(-1);
 9779|  30.5k|    }
 9780|   737k|    nameNsPush(ctxt, name, prefix, URI, line, nbNs);
 9781|   737k|    cur = ctxt->node;
 9782|       |
 9783|   737k|#ifdef LIBXML_VALID_ENABLED
 9784|       |    /*
 9785|       |     * [ VC: Root Element Type ]
 9786|       |     * The Name in the document type declaration must match the element
 9787|       |     * type of the root element.
 9788|       |     */
 9789|   737k|    if (ctxt->validate && ctxt->wellFormed && ctxt->myDoc &&
  ------------------
  |  Branch (9789:9): [True: 141k, False: 596k]
  |  Branch (9789:27): [True: 9.74k, False: 131k]
  |  Branch (9789:47): [True: 9.74k, False: 0]
  ------------------
 9790|  9.74k|        ctxt->node && (ctxt->node == ctxt->myDoc->children))
  ------------------
  |  Branch (9790:9): [True: 9.74k, False: 0]
  |  Branch (9790:23): [True: 0, False: 9.74k]
  ------------------
 9791|      0|        ctxt->valid &= xmlValidateRoot(&ctxt->vctxt, ctxt->myDoc);
 9792|   737k|#endif /* LIBXML_VALID_ENABLED */
 9793|       |
 9794|       |    /*
 9795|       |     * Check for an Empty Element.
 9796|       |     */
 9797|   737k|    if ((RAW == '/') && (NXT(1) == '>')) {
  ------------------
  |  | 2261|   737k|#define RAW (*ctxt->input->cur)
  ------------------
                  if ((RAW == '/') && (NXT(1) == '>')) {
  ------------------
  |  | 2263|   395k|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
  |  Branch (9797:9): [True: 395k, False: 341k]
  |  Branch (9797:25): [True: 389k, False: 6.68k]
  ------------------
 9798|   389k|        SKIP(2);
  ------------------
  |  | 2285|   389k|#define SKIP(val) do {							\
  |  | 2286|   389k|    ctxt->input->cur += (val),ctxt->input->col+=(val);			\
  |  | 2287|   389k|    if (*ctxt->input->cur == 0)						\
  |  |  ------------------
  |  |  |  Branch (2287:9): [True: 844, False: 388k]
  |  |  ------------------
  |  | 2288|   389k|        xmlParserGrow(ctxt);						\
  |  | 2289|   389k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2289:12): [Folded, False: 389k]
  |  |  ------------------
  ------------------
 9799|   389k|	if (ctxt->sax2) {
  ------------------
  |  Branch (9799:6): [True: 309k, False: 79.6k]
  ------------------
 9800|   309k|	    if ((ctxt->sax != NULL) && (ctxt->sax->endElementNs != NULL) &&
  ------------------
  |  Branch (9800:10): [True: 309k, False: 0]
  |  Branch (9800:33): [True: 309k, False: 0]
  ------------------
 9801|   309k|		(!ctxt->disableSAX))
  ------------------
  |  Branch (9801:3): [True: 277k, False: 32.2k]
  ------------------
 9802|   277k|		ctxt->sax->endElementNs(ctxt->userData, name, prefix, URI);
 9803|   309k|#ifdef LIBXML_SAX1_ENABLED
 9804|   309k|	} else {
 9805|  79.6k|	    if ((ctxt->sax != NULL) && (ctxt->sax->endElement != NULL) &&
  ------------------
  |  Branch (9805:10): [True: 79.6k, False: 0]
  |  Branch (9805:33): [True: 79.6k, False: 0]
  ------------------
 9806|  79.6k|		(!ctxt->disableSAX))
  ------------------
  |  Branch (9806:3): [True: 76.6k, False: 3.02k]
  ------------------
 9807|  76.6k|		ctxt->sax->endElement(ctxt->userData, name);
 9808|  79.6k|#endif /* LIBXML_SAX1_ENABLED */
 9809|  79.6k|	}
 9810|   389k|	namePop(ctxt);
 9811|   389k|	spacePop(ctxt);
 9812|   389k|	if (nbNs > 0)
  ------------------
  |  Branch (9812:6): [True: 47.4k, False: 341k]
  ------------------
 9813|  47.4k|	    xmlParserNsPop(ctxt, nbNs);
 9814|   389k|	if (cur != NULL && ctxt->record_info) {
  ------------------
  |  Branch (9814:6): [True: 381k, False: 7.65k]
  |  Branch (9814:21): [True: 0, False: 381k]
  ------------------
 9815|      0|            node_info.node = cur;
 9816|      0|            node_info.end_pos = ctxt->input->consumed +
 9817|      0|                                (CUR_PTR - ctxt->input->base);
  ------------------
  |  | 2264|      0|#define CUR_PTR ctxt->input->cur
  ------------------
 9818|      0|            node_info.end_line = ctxt->input->line;
 9819|      0|            xmlParserAddNodeInfo(ctxt, &node_info);
 9820|      0|	}
 9821|   389k|	return(1);
 9822|   389k|    }
 9823|   348k|    if (RAW == '>') {
  ------------------
  |  | 2261|   348k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (9823:9): [True: 258k, False: 90.0k]
  ------------------
 9824|   258k|        NEXT1;
  ------------------
  |  | 2318|   258k|#define NEXT1 {								\
  |  | 2319|   258k|	ctxt->input->col++;						\
  |  | 2320|   258k|	ctxt->input->cur++;						\
  |  | 2321|   258k|	if (*ctxt->input->cur == 0)					\
  |  |  ------------------
  |  |  |  Branch (2321:6): [True: 2.50k, False: 255k]
  |  |  ------------------
  |  | 2322|   258k|	    xmlParserGrow(ctxt);						\
  |  | 2323|   258k|    }
  ------------------
 9825|   258k|        if (cur != NULL && ctxt->record_info) {
  ------------------
  |  Branch (9825:13): [True: 214k, False: 43.2k]
  |  Branch (9825:28): [True: 0, False: 214k]
  ------------------
 9826|      0|            node_info.node = cur;
 9827|      0|            node_info.end_pos = 0;
 9828|      0|            node_info.end_line = 0;
 9829|      0|            xmlParserAddNodeInfo(ctxt, &node_info);
 9830|      0|        }
 9831|   258k|    } else {
 9832|  90.0k|        xmlFatalErrMsgStrIntStr(ctxt, XML_ERR_GT_REQUIRED,
 9833|  90.0k|		     "Couldn't find end of Start Tag %s line %d\n",
 9834|  90.0k|		                name, line, NULL);
 9835|       |
 9836|       |	/*
 9837|       |	 * end of parsing of this node.
 9838|       |	 */
 9839|  90.0k|	nodePop(ctxt);
 9840|  90.0k|	namePop(ctxt);
 9841|  90.0k|	spacePop(ctxt);
 9842|  90.0k|	if (nbNs > 0)
  ------------------
  |  Branch (9842:6): [True: 14.9k, False: 75.0k]
  ------------------
 9843|  14.9k|	    xmlParserNsPop(ctxt, nbNs);
 9844|  90.0k|	return(-1);
 9845|  90.0k|    }
 9846|       |
 9847|   258k|    return(0);
 9848|   348k|}
parser.c:spacePush:
 2190|  1.10M|static int spacePush(xmlParserCtxtPtr ctxt, int val) {
 2191|  1.10M|    if (ctxt->spaceNr >= ctxt->spaceMax) {
  ------------------
  |  Branch (2191:9): [True: 94.2k, False: 1.00M]
  ------------------
 2192|  94.2k|        int *tmp;
 2193|  94.2k|        int newSize;
 2194|       |
 2195|  94.2k|        newSize = xmlGrowCapacity(ctxt->spaceMax, sizeof(tmp[0]),
 2196|  94.2k|                                  10, XML_MAX_ITEMS);
  ------------------
  |  |   13|  94.2k|#define XML_MAX_ITEMS 1000000000 /* 1 billion */
  ------------------
 2197|  94.2k|        if (newSize < 0) {
  ------------------
  |  Branch (2197:13): [True: 0, False: 94.2k]
  ------------------
 2198|      0|	    xmlErrMemory(ctxt);
 2199|      0|	    return(-1);
 2200|      0|        }
 2201|       |
 2202|  94.2k|        tmp = xmlRealloc(ctxt->spaceTab, newSize * sizeof(tmp[0]));
 2203|  94.2k|        if (tmp == NULL) {
  ------------------
  |  Branch (2203:13): [True: 49, False: 94.1k]
  ------------------
 2204|     49|	    xmlErrMemory(ctxt);
 2205|     49|	    return(-1);
 2206|     49|	}
 2207|  94.1k|	ctxt->spaceTab = tmp;
 2208|       |
 2209|  94.1k|        ctxt->spaceMax = newSize;
 2210|  94.1k|    }
 2211|  1.10M|    ctxt->spaceTab[ctxt->spaceNr] = val;
 2212|  1.10M|    ctxt->space = &ctxt->spaceTab[ctxt->spaceNr];
 2213|  1.10M|    return(ctxt->spaceNr++);
 2214|  1.10M|}
parser.c:xmlParseStartTag2:
 8788|   755k|                  const xmlChar **URI, int *nbNsPtr) {
 8789|   755k|    xmlHashedString hlocalname;
 8790|   755k|    xmlHashedString hprefix;
 8791|   755k|    xmlHashedString hattname;
 8792|   755k|    xmlHashedString haprefix;
 8793|   755k|    const xmlChar *localname;
 8794|   755k|    const xmlChar *prefix;
 8795|   755k|    const xmlChar *attname;
 8796|   755k|    const xmlChar *aprefix;
 8797|   755k|    const xmlChar *uri;
 8798|   755k|    xmlChar *attvalue = NULL;
 8799|   755k|    const xmlChar **atts = ctxt->atts;
 8800|   755k|    unsigned attrHashSize = 0;
 8801|   755k|    int maxatts = ctxt->maxatts;
 8802|   755k|    int nratts, nbatts, nbdef;
 8803|   755k|    int i, j, nbNs, nbTotalDef, attval, nsIndex, maxAtts;
 8804|   755k|    int alloc = 0;
 8805|   755k|    int numNsErr = 0;
 8806|   755k|    int numDupErr = 0;
 8807|       |
 8808|   755k|    if (RAW != '<') return(NULL);
  ------------------
  |  | 2261|   755k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (8808:9): [True: 0, False: 755k]
  ------------------
 8809|   755k|    NEXT1;
  ------------------
  |  | 2318|   755k|#define NEXT1 {								\
  |  | 2319|   755k|	ctxt->input->col++;						\
  |  | 2320|   755k|	ctxt->input->cur++;						\
  |  | 2321|   755k|	if (*ctxt->input->cur == 0)					\
  |  |  ------------------
  |  |  |  Branch (2321:6): [True: 1.02k, False: 754k]
  |  |  ------------------
  |  | 2322|   755k|	    xmlParserGrow(ctxt);						\
  |  | 2323|   755k|    }
  ------------------
 8810|       |
 8811|   755k|    nbatts = 0;
 8812|   755k|    nratts = 0;
 8813|   755k|    nbdef = 0;
 8814|   755k|    nbNs = 0;
 8815|   755k|    nbTotalDef = 0;
 8816|   755k|    attval = 0;
 8817|       |
 8818|   755k|    if (xmlParserNsStartElement(ctxt->nsdb) < 0) {
  ------------------
  |  Branch (8818:9): [True: 0, False: 755k]
  ------------------
 8819|      0|        xmlErrMemory(ctxt);
 8820|      0|        return(NULL);
 8821|      0|    }
 8822|       |
 8823|   755k|    hlocalname = xmlParseQNameHashed(ctxt, &hprefix);
 8824|   755k|    if (hlocalname.name == NULL) {
  ------------------
  |  Branch (8824:9): [True: 18.1k, False: 737k]
  ------------------
 8825|  18.1k|	xmlFatalErrMsg(ctxt, XML_ERR_NAME_REQUIRED,
 8826|  18.1k|		       "StartTag: invalid element name\n");
 8827|  18.1k|        return(NULL);
 8828|  18.1k|    }
 8829|   737k|    localname = hlocalname.name;
 8830|   737k|    prefix = hprefix.name;
 8831|       |
 8832|       |    /*
 8833|       |     * Now parse the attributes, it ends up with the ending
 8834|       |     *
 8835|       |     * (S Attribute)* S?
 8836|       |     */
 8837|   737k|    SKIP_BLANKS;
  ------------------
  |  | 2312|   737k|#define SKIP_BLANKS xmlSkipBlankChars(ctxt)
  ------------------
 8838|   737k|    GROW;
  ------------------
  |  | 2308|   737k|    if ((!PARSER_PROGRESSIVE(ctxt)) && \
  |  |  ------------------
  |  |  |  |   47|   737k|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|   737k|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2308:9): [True: 538k, False: 198k]
  |  |  ------------------
  |  | 2309|   737k|        (ctxt->input->end - ctxt->input->cur < INPUT_CHUNK)) \
  |  |  ------------------
  |  |  |  |   63|   538k|#define INPUT_CHUNK	250
  |  |  ------------------
  |  |  |  Branch (2309:9): [True: 38.4k, False: 500k]
  |  |  ------------------
  |  | 2310|   737k|	xmlParserGrow(ctxt);
  ------------------
 8839|       |
 8840|       |    /*
 8841|       |     * The ctxt->atts array will be ultimately passed to the SAX callback
 8842|       |     * containing five xmlChar pointers for each attribute:
 8843|       |     *
 8844|       |     * [0] attribute name
 8845|       |     * [1] attribute prefix
 8846|       |     * [2] namespace URI
 8847|       |     * [3] attribute value
 8848|       |     * [4] end of attribute value
 8849|       |     *
 8850|       |     * To save memory, we reuse this array temporarily and store integers
 8851|       |     * in these pointer variables.
 8852|       |     *
 8853|       |     * [0] attribute name
 8854|       |     * [1] attribute prefix
 8855|       |     * [2] hash value of attribute prefix, and later namespace index
 8856|       |     * [3] for non-allocated values: ptrdiff_t offset into input buffer
 8857|       |     * [4] for non-allocated values: ptrdiff_t offset into input buffer
 8858|       |     *
 8859|       |     * The ctxt->attallocs array contains an additional unsigned int for
 8860|       |     * each attribute, containing the hash value of the attribute name
 8861|       |     * and the alloc flag in bit 31.
 8862|       |     */
 8863|       |
 8864|   841k|    while (((RAW != '>') &&
  ------------------
  |  | 2261|   841k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (8864:13): [True: 592k, False: 248k]
  ------------------
 8865|   592k|	   ((RAW != '/') || (NXT(1) != '>')) &&
  ------------------
  |  | 2261|   592k|#define RAW (*ctxt->input->cur)
  ------------------
              	   ((RAW != '/') || (NXT(1) != '>')) &&
  ------------------
  |  | 2263|   308k|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
  |  Branch (8865:6): [True: 284k, False: 308k]
  |  Branch (8865:22): [True: 4.95k, False: 303k]
  ------------------
 8866|   289k|	   (IS_BYTE_CHAR(RAW))) && (PARSER_STOPPED(ctxt) == 0)) {
  ------------------
  |  |  103|   289k|#define IS_BYTE_CHAR(c)	 xmlIsChar_ch(c)
  |  |  ------------------
  |  |  |  |  108|   289k|#define xmlIsChar_ch(c)		(((0x9 <= (c)) && ((c) <= 0xa)) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (108:28): [True: 285k, False: 4.15k]
  |  |  |  |  |  Branch (108:44): [True: 0, False: 285k]
  |  |  |  |  ------------------
  |  |  |  |  109|   289k|				 ((c) == 0xd) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (109:6): [True: 0, False: 289k]
  |  |  |  |  ------------------
  |  |  |  |  110|   289k|				  (0x20 <= (c)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (110:7): [True: 284k, False: 4.93k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
              	   (IS_BYTE_CHAR(RAW))) && (PARSER_STOPPED(ctxt) == 0)) {
  ------------------
  |  |   44|   284k|#define PARSER_STOPPED(ctxt) ((ctxt)->disableSAX > 1)
  ------------------
  |  Branch (8866:29): [True: 284k, False: 36]
  ------------------
 8867|   284k|	int len = -1;
 8868|       |
 8869|   284k|	hattname = xmlParseAttribute2(ctxt, prefix, localname,
 8870|   284k|                                          &haprefix, &attvalue, &len,
 8871|   284k|                                          &alloc);
 8872|   284k|        if (hattname.name == NULL)
  ------------------
  |  Branch (8872:13): [True: 66.1k, False: 218k]
  ------------------
 8873|  66.1k|	    break;
 8874|   218k|        if (attvalue == NULL)
  ------------------
  |  Branch (8874:13): [True: 16.2k, False: 201k]
  ------------------
 8875|  16.2k|            goto next_attr;
 8876|   201k|        attname = hattname.name;
 8877|   201k|        aprefix = haprefix.name;
 8878|   201k|	if (len < 0) len = xmlStrlen(attvalue);
  ------------------
  |  Branch (8878:6): [True: 0, False: 201k]
  ------------------
 8879|       |
 8880|   201k|        if ((attname == ctxt->str_xmlns) && (aprefix == NULL)) {
  ------------------
  |  Branch (8880:13): [True: 15.7k, False: 186k]
  |  Branch (8880:45): [True: 15.3k, False: 425]
  ------------------
 8881|  15.3k|            xmlHashedString huri;
 8882|  15.3k|            xmlURIPtr parsedUri;
 8883|       |
 8884|  15.3k|            huri = xmlDictLookupHashed(ctxt->dict, attvalue, len);
 8885|  15.3k|            uri = huri.name;
 8886|  15.3k|            if (uri == NULL) {
  ------------------
  |  Branch (8886:17): [True: 1, False: 15.3k]
  ------------------
 8887|      1|                xmlErrMemory(ctxt);
 8888|      1|                goto next_attr;
 8889|      1|            }
 8890|  15.3k|            if (*uri != 0) {
  ------------------
  |  Branch (8890:17): [True: 6.98k, False: 8.36k]
  ------------------
 8891|  6.98k|                if (xmlParseURISafe((const char *) uri, &parsedUri) < 0) {
  ------------------
  |  Branch (8891:21): [True: 20, False: 6.96k]
  ------------------
 8892|     20|                    xmlErrMemory(ctxt);
 8893|     20|                    goto next_attr;
 8894|     20|                }
 8895|  6.96k|                if (parsedUri == NULL) {
  ------------------
  |  Branch (8895:21): [True: 2.17k, False: 4.78k]
  ------------------
 8896|  2.17k|                    xmlNsErr(ctxt, XML_WAR_NS_URI,
 8897|  2.17k|                             "xmlns: '%s' is not a valid URI\n",
 8898|  2.17k|                                       uri, NULL, NULL);
 8899|  4.78k|                } else {
 8900|  4.78k|                    if (parsedUri->scheme == NULL) {
  ------------------
  |  Branch (8900:25): [True: 2.56k, False: 2.22k]
  ------------------
 8901|  2.56k|                        xmlNsWarn(ctxt, XML_WAR_NS_URI_RELATIVE,
 8902|  2.56k|                                  "xmlns: URI %s is not absolute\n",
 8903|  2.56k|                                  uri, NULL, NULL);
 8904|  2.56k|                    }
 8905|  4.78k|                    xmlFreeURI(parsedUri);
 8906|  4.78k|                }
 8907|  6.96k|                if (uri == ctxt->str_xml_ns) {
  ------------------
  |  Branch (8907:21): [True: 622, False: 6.34k]
  ------------------
 8908|    622|                    if (attname != ctxt->str_xml) {
  ------------------
  |  Branch (8908:25): [True: 622, False: 0]
  ------------------
 8909|    622|                        xmlNsErr(ctxt, XML_NS_ERR_XML_NAMESPACE,
 8910|    622|                     "xml namespace URI cannot be the default namespace\n",
 8911|    622|                                 NULL, NULL, NULL);
 8912|    622|                    }
 8913|    622|                    goto next_attr;
 8914|    622|                }
 8915|  6.34k|                if ((len == 29) &&
  ------------------
  |  Branch (8915:21): [True: 912, False: 5.43k]
  ------------------
 8916|    912|                    (xmlStrEqual(uri,
  ------------------
  |  Branch (8916:21): [True: 389, False: 523]
  ------------------
 8917|    912|                             BAD_CAST "http://www.w3.org/2000/xmlns/"))) {
  ------------------
  |  |   34|    912|#define BAD_CAST (xmlChar *)
  ------------------
 8918|    389|                    xmlNsErr(ctxt, XML_NS_ERR_XML_NAMESPACE,
 8919|    389|                         "reuse of the xmlns namespace name is forbidden\n",
 8920|    389|                             NULL, NULL, NULL);
 8921|    389|                    goto next_attr;
 8922|    389|                }
 8923|  6.34k|            }
 8924|       |
 8925|  14.3k|            if (xmlParserNsPush(ctxt, NULL, &huri, NULL, 0) > 0)
  ------------------
  |  Branch (8925:17): [True: 8.60k, False: 5.72k]
  ------------------
 8926|  8.60k|                nbNs++;
 8927|   186k|        } else if (aprefix == ctxt->str_xmlns) {
  ------------------
  |  Branch (8927:20): [True: 65.9k, False: 120k]
  ------------------
 8928|  65.9k|            xmlHashedString huri;
 8929|  65.9k|            xmlURIPtr parsedUri;
 8930|       |
 8931|  65.9k|            huri = xmlDictLookupHashed(ctxt->dict, attvalue, len);
 8932|  65.9k|            uri = huri.name;
 8933|  65.9k|            if (uri == NULL) {
  ------------------
  |  Branch (8933:17): [True: 1, False: 65.9k]
  ------------------
 8934|      1|                xmlErrMemory(ctxt);
 8935|      1|                goto next_attr;
 8936|      1|            }
 8937|       |
 8938|  65.9k|            if (attname == ctxt->str_xml) {
  ------------------
  |  Branch (8938:17): [True: 477, False: 65.4k]
  ------------------
 8939|    477|                if (uri != ctxt->str_xml_ns) {
  ------------------
  |  Branch (8939:21): [True: 207, False: 270]
  ------------------
 8940|    207|                    xmlNsErr(ctxt, XML_NS_ERR_XML_NAMESPACE,
 8941|    207|                             "xml namespace prefix mapped to wrong URI\n",
 8942|    207|                             NULL, NULL, NULL);
 8943|    207|                }
 8944|       |                /*
 8945|       |                 * Do not keep a namespace definition node
 8946|       |                 */
 8947|    477|                goto next_attr;
 8948|    477|            }
 8949|  65.4k|            if (uri == ctxt->str_xml_ns) {
  ------------------
  |  Branch (8949:17): [True: 208, False: 65.2k]
  ------------------
 8950|    208|                if (attname != ctxt->str_xml) {
  ------------------
  |  Branch (8950:21): [True: 208, False: 0]
  ------------------
 8951|    208|                    xmlNsErr(ctxt, XML_NS_ERR_XML_NAMESPACE,
 8952|    208|                             "xml namespace URI mapped to wrong prefix\n",
 8953|    208|                             NULL, NULL, NULL);
 8954|    208|                }
 8955|    208|                goto next_attr;
 8956|    208|            }
 8957|  65.2k|            if (attname == ctxt->str_xmlns) {
  ------------------
  |  Branch (8957:17): [True: 324, False: 64.9k]
  ------------------
 8958|    324|                xmlNsErr(ctxt, XML_NS_ERR_XML_NAMESPACE,
 8959|    324|                         "redefinition of the xmlns prefix is forbidden\n",
 8960|    324|                         NULL, NULL, NULL);
 8961|    324|                goto next_attr;
 8962|    324|            }
 8963|  64.9k|            if ((len == 29) &&
  ------------------
  |  Branch (8963:17): [True: 494, False: 64.4k]
  ------------------
 8964|    494|                (xmlStrEqual(uri,
  ------------------
  |  Branch (8964:17): [True: 194, False: 300]
  ------------------
 8965|    494|                             BAD_CAST "http://www.w3.org/2000/xmlns/"))) {
  ------------------
  |  |   34|    494|#define BAD_CAST (xmlChar *)
  ------------------
 8966|    194|                xmlNsErr(ctxt, XML_NS_ERR_XML_NAMESPACE,
 8967|    194|                         "reuse of the xmlns namespace name is forbidden\n",
 8968|    194|                         NULL, NULL, NULL);
 8969|    194|                goto next_attr;
 8970|    194|            }
 8971|  64.7k|            if ((uri == NULL) || (uri[0] == 0)) {
  ------------------
  |  Branch (8971:17): [True: 0, False: 64.7k]
  |  Branch (8971:34): [True: 214, False: 64.5k]
  ------------------
 8972|    214|                xmlNsErr(ctxt, XML_NS_ERR_XML_NAMESPACE,
 8973|    214|                         "xmlns:%s: Empty XML namespace is not allowed\n",
 8974|    214|                              attname, NULL, NULL);
 8975|    214|                goto next_attr;
 8976|  64.5k|            } else {
 8977|  64.5k|                if (xmlParseURISafe((const char *) uri, &parsedUri) < 0) {
  ------------------
  |  Branch (8977:21): [True: 3, False: 64.5k]
  ------------------
 8978|      3|                    xmlErrMemory(ctxt);
 8979|      3|                    goto next_attr;
 8980|      3|                }
 8981|  64.5k|                if (parsedUri == NULL) {
  ------------------
  |  Branch (8981:21): [True: 4.72k, False: 59.8k]
  ------------------
 8982|  4.72k|                    xmlNsErr(ctxt, XML_WAR_NS_URI,
 8983|  4.72k|                         "xmlns:%s: '%s' is not a valid URI\n",
 8984|  4.72k|                                       attname, uri, NULL);
 8985|  59.8k|                } else {
 8986|  59.8k|                    if ((ctxt->pedantic) && (parsedUri->scheme == NULL)) {
  ------------------
  |  Branch (8986:25): [True: 3.42k, False: 56.3k]
  |  Branch (8986:45): [True: 1.45k, False: 1.96k]
  ------------------
 8987|  1.45k|                        xmlNsWarn(ctxt, XML_WAR_NS_URI_RELATIVE,
 8988|  1.45k|                                  "xmlns:%s: URI %s is not absolute\n",
 8989|  1.45k|                                  attname, uri, NULL);
 8990|  1.45k|                    }
 8991|  59.8k|                    xmlFreeURI(parsedUri);
 8992|  59.8k|                }
 8993|  64.5k|            }
 8994|       |
 8995|  64.5k|            if (xmlParserNsPush(ctxt, &hattname, &huri, NULL, 0) > 0)
  ------------------
  |  Branch (8995:17): [True: 62.9k, False: 1.57k]
  ------------------
 8996|  62.9k|                nbNs++;
 8997|   120k|        } else {
 8998|       |            /*
 8999|       |             * Populate attributes array, see above for repurposing
 9000|       |             * of xmlChar pointers.
 9001|       |             */
 9002|   120k|            if ((atts == NULL) || (nbatts + 5 > maxatts)) {
  ------------------
  |  Branch (9002:17): [True: 13.4k, False: 107k]
  |  Branch (9002:35): [True: 11.0k, False: 95.9k]
  ------------------
 9003|  24.5k|                int res = xmlCtxtGrowAttrs(ctxt);
 9004|       |
 9005|  24.5k|                maxatts = ctxt->maxatts;
 9006|  24.5k|                atts = ctxt->atts;
 9007|       |
 9008|  24.5k|                if (res < 0)
  ------------------
  |  Branch (9008:21): [True: 11, False: 24.5k]
  ------------------
 9009|     11|                    goto next_attr;
 9010|  24.5k|            }
 9011|   120k|            ctxt->attallocs[nratts++] = (hattname.hashValue & 0x7FFFFFFF) |
 9012|   120k|                                        ((unsigned) alloc << 31);
 9013|   120k|            atts[nbatts++] = attname;
 9014|   120k|            atts[nbatts++] = aprefix;
 9015|   120k|            atts[nbatts++] = XML_INT_TO_PTR(haprefix.hashValue);
  ------------------
  |  |   59|   120k|#define XML_INT_TO_PTR(i) ((void *) (XML_INTPTR_T) (i))
  ------------------
 9016|   120k|            if (alloc) {
  ------------------
  |  Branch (9016:17): [True: 19.5k, False: 100k]
  ------------------
 9017|  19.5k|                atts[nbatts++] = attvalue;
 9018|  19.5k|                attvalue += len;
 9019|  19.5k|                atts[nbatts++] = attvalue;
 9020|   100k|            } else {
 9021|       |                /*
 9022|       |                 * attvalue points into the input buffer which can be
 9023|       |                 * reallocated. Store differences to input->base instead.
 9024|       |                 * The pointers will be reconstructed later.
 9025|       |                 */
 9026|   100k|                atts[nbatts++] = XML_INT_TO_PTR(attvalue - BASE_PTR);
  ------------------
  |  |   59|   100k|#define XML_INT_TO_PTR(i) ((void *) (XML_INTPTR_T) (i))
  ------------------
 9027|   100k|                attvalue += len;
 9028|   100k|                atts[nbatts++] = XML_INT_TO_PTR(attvalue - BASE_PTR);
  ------------------
  |  |   59|   100k|#define XML_INT_TO_PTR(i) ((void *) (XML_INTPTR_T) (i))
  ------------------
 9029|   100k|            }
 9030|       |            /*
 9031|       |             * tag if some deallocation is needed
 9032|       |             */
 9033|   120k|            if (alloc != 0) attval = 1;
  ------------------
  |  Branch (9033:17): [True: 19.5k, False: 100k]
  ------------------
 9034|   120k|            attvalue = NULL; /* moved into atts */
 9035|   120k|        }
 9036|       |
 9037|   218k|next_attr:
 9038|   218k|        if ((attvalue != NULL) && (alloc != 0)) {
  ------------------
  |  Branch (9038:13): [True: 81.3k, False: 136k]
  |  Branch (9038:35): [True: 5.09k, False: 76.2k]
  ------------------
 9039|  5.09k|            xmlFree(attvalue);
 9040|  5.09k|            attvalue = NULL;
 9041|  5.09k|        }
 9042|       |
 9043|   218k|	GROW
  ------------------
  |  | 2308|   218k|    if ((!PARSER_PROGRESSIVE(ctxt)) && \
  |  |  ------------------
  |  |  |  |   47|   218k|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|   218k|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2308:9): [True: 99.6k, False: 118k]
  |  |  ------------------
  |  | 2309|   218k|        (ctxt->input->end - ctxt->input->cur < INPUT_CHUNK)) \
  |  |  ------------------
  |  |  |  |   63|  99.6k|#define INPUT_CHUNK	250
  |  |  ------------------
  |  |  |  Branch (2309:9): [True: 14.2k, False: 85.3k]
  |  |  ------------------
  |  | 2310|   218k|	xmlParserGrow(ctxt);
  ------------------
 9044|   218k|	if ((RAW == '>') || (((RAW == '/') && (NXT(1) == '>'))))
  ------------------
  |  | 2261|   218k|#define RAW (*ctxt->input->cur)
  ------------------
              	if ((RAW == '>') || (((RAW == '/') && (NXT(1) == '>'))))
  ------------------
  |  | 2261|   182k|#define RAW (*ctxt->input->cur)
  ------------------
              	if ((RAW == '>') || (((RAW == '/') && (NXT(1) == '>'))))
  ------------------
  |  | 2263|  57.3k|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
  |  Branch (9044:6): [True: 35.6k, False: 182k]
  |  Branch (9044:24): [True: 57.3k, False: 125k]
  |  Branch (9044:40): [True: 56.6k, False: 624]
  ------------------
 9045|  92.3k|	    break;
 9046|   125k|	if (SKIP_BLANKS == 0) {
  ------------------
  |  | 2312|   125k|#define SKIP_BLANKS xmlSkipBlankChars(ctxt)
  ------------------
  |  Branch (9046:6): [True: 21.7k, False: 103k]
  ------------------
 9047|  21.7k|	    xmlFatalErrMsg(ctxt, XML_ERR_SPACE_REQUIRED,
 9048|  21.7k|			   "attributes construct error\n");
 9049|  21.7k|	    break;
 9050|  21.7k|	}
 9051|   103k|        GROW;
  ------------------
  |  | 2308|   103k|    if ((!PARSER_PROGRESSIVE(ctxt)) && \
  |  |  ------------------
  |  |  |  |   47|   103k|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|   103k|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2308:9): [True: 23.9k, False: 80.0k]
  |  |  ------------------
  |  | 2309|   103k|        (ctxt->input->end - ctxt->input->cur < INPUT_CHUNK)) \
  |  |  ------------------
  |  |  |  |   63|  23.9k|#define INPUT_CHUNK	250
  |  |  ------------------
  |  |  |  Branch (2309:9): [True: 6.95k, False: 16.9k]
  |  |  ------------------
  |  | 2310|   103k|	xmlParserGrow(ctxt);
  ------------------
 9052|   103k|    }
 9053|       |
 9054|       |    /*
 9055|       |     * Namespaces from default attributes
 9056|       |     */
 9057|   737k|    if (ctxt->attsDefault != NULL) {
  ------------------
  |  Branch (9057:9): [True: 175k, False: 561k]
  ------------------
 9058|   175k|        xmlDefAttrsPtr defaults;
 9059|       |
 9060|   175k|	defaults = xmlHashLookup2(ctxt->attsDefault, localname, prefix);
 9061|   175k|	if (defaults != NULL) {
  ------------------
  |  Branch (9061:6): [True: 144k, False: 30.9k]
  ------------------
 9062|   751k|	    for (i = 0; i < defaults->nbAttrs; i++) {
  ------------------
  |  Branch (9062:18): [True: 607k, False: 144k]
  ------------------
 9063|   607k|                xmlDefAttr *attr = &defaults->attrs[i];
 9064|       |
 9065|   607k|	        attname = attr->name.name;
 9066|   607k|		aprefix = attr->prefix.name;
 9067|       |
 9068|   607k|		if ((attname == ctxt->str_xmlns) && (aprefix == NULL)) {
  ------------------
  |  Branch (9068:7): [True: 38.2k, False: 568k]
  |  Branch (9068:39): [True: 36.9k, False: 1.35k]
  ------------------
 9069|  36.9k|                    xmlParserEntityCheck(ctxt, attr->expandedSize);
 9070|       |
 9071|  36.9k|                    if (xmlParserNsPush(ctxt, NULL, &attr->value, NULL, 1) > 0)
  ------------------
  |  Branch (9071:25): [True: 33.7k, False: 3.22k]
  ------------------
 9072|  33.7k|                        nbNs++;
 9073|   570k|		} else if (aprefix == ctxt->str_xmlns) {
  ------------------
  |  Branch (9073:14): [True: 243k, False: 326k]
  ------------------
 9074|   243k|                    xmlParserEntityCheck(ctxt, attr->expandedSize);
 9075|       |
 9076|   243k|                    if (xmlParserNsPush(ctxt, &attr->name, &attr->value,
  ------------------
  |  Branch (9076:25): [True: 215k, False: 28.4k]
  ------------------
 9077|   243k|                                      NULL, 1) > 0)
 9078|   215k|                        nbNs++;
 9079|   326k|		} else {
 9080|   326k|                    if (nratts + nbTotalDef >= XML_MAX_ATTRS) {
  ------------------
  |  |   93|   326k|#define XML_MAX_ATTRS 100000000 /* 100 million */
  ------------------
  |  Branch (9080:25): [True: 0, False: 326k]
  ------------------
 9081|      0|                        xmlFatalErr(ctxt, XML_ERR_RESOURCE_LIMIT,
 9082|      0|                                    "Maximum number of attributes exceeded");
 9083|      0|                        break;
 9084|      0|                    }
 9085|   326k|                    nbTotalDef += 1;
 9086|   326k|                }
 9087|   607k|	    }
 9088|   144k|	}
 9089|   175k|    }
 9090|       |
 9091|       |    /*
 9092|       |     * Resolve attribute namespaces
 9093|       |     */
 9094|   857k|    for (i = 0; i < nbatts; i += 5) {
  ------------------
  |  Branch (9094:17): [True: 120k, False: 737k]
  ------------------
 9095|   120k|        attname = atts[i];
 9096|   120k|        aprefix = atts[i+1];
 9097|       |
 9098|       |        /*
 9099|       |	* The default namespace does not apply to attribute names.
 9100|       |	*/
 9101|   120k|	if (aprefix == NULL) {
  ------------------
  |  Branch (9101:6): [True: 47.4k, False: 72.9k]
  ------------------
 9102|  47.4k|            nsIndex = NS_INDEX_EMPTY;
  ------------------
  |  |   80|  47.4k|#define NS_INDEX_EMPTY  INT_MAX
  ------------------
 9103|  72.9k|        } else if (aprefix == ctxt->str_xml) {
  ------------------
  |  Branch (9103:20): [True: 54.4k, False: 18.5k]
  ------------------
 9104|  54.4k|            nsIndex = NS_INDEX_XML;
  ------------------
  |  |   81|  54.4k|#define NS_INDEX_XML    (INT_MAX - 1)
  ------------------
 9105|  54.4k|        } else {
 9106|  18.5k|            haprefix.name = aprefix;
 9107|  18.5k|            haprefix.hashValue = (size_t) atts[i+2];
 9108|  18.5k|            nsIndex = xmlParserNsLookup(ctxt, &haprefix, NULL);
 9109|       |
 9110|  18.5k|	    if ((nsIndex == INT_MAX) || (nsIndex < ctxt->nsdb->minNsIndex)) {
  ------------------
  |  Branch (9110:10): [True: 12.3k, False: 6.11k]
  |  Branch (9110:34): [True: 196, False: 5.91k]
  ------------------
 9111|  12.5k|                xmlNsErr(ctxt, XML_NS_ERR_UNDEFINED_NAMESPACE,
 9112|  12.5k|		    "Namespace prefix %s for %s on %s is not defined\n",
 9113|  12.5k|		    aprefix, attname, localname);
 9114|  12.5k|                nsIndex = NS_INDEX_EMPTY;
  ------------------
  |  |   80|  12.5k|#define NS_INDEX_EMPTY  INT_MAX
  ------------------
 9115|  12.5k|            }
 9116|  18.5k|        }
 9117|       |
 9118|   120k|        atts[i+2] = XML_INT_TO_PTR(nsIndex);
  ------------------
  |  |   59|   120k|#define XML_INT_TO_PTR(i) ((void *) (XML_INTPTR_T) (i))
  ------------------
 9119|   120k|    }
 9120|       |
 9121|       |    /*
 9122|       |     * Maximum number of attributes including default attributes.
 9123|       |     */
 9124|   737k|    maxAtts = nratts + nbTotalDef;
 9125|       |
 9126|       |    /*
 9127|       |     * Verify that attribute names are unique.
 9128|       |     */
 9129|   737k|    if (maxAtts > 1) {
  ------------------
  |  Branch (9129:9): [True: 55.4k, False: 681k]
  ------------------
 9130|  55.4k|        attrHashSize = 4;
 9131|   138k|        while (attrHashSize / 2 < (unsigned) maxAtts)
  ------------------
  |  Branch (9131:16): [True: 83.1k, False: 55.4k]
  ------------------
 9132|  83.1k|            attrHashSize *= 2;
 9133|       |
 9134|  55.4k|        if (attrHashSize > ctxt->attrHashMax) {
  ------------------
  |  Branch (9134:13): [True: 8.07k, False: 47.3k]
  ------------------
 9135|  8.07k|            xmlAttrHashBucket *tmp;
 9136|       |
 9137|  8.07k|            tmp = xmlRealloc(ctxt->attrHash, attrHashSize * sizeof(tmp[0]));
 9138|  8.07k|            if (tmp == NULL) {
  ------------------
  |  Branch (9138:17): [True: 4, False: 8.06k]
  ------------------
 9139|      4|                xmlErrMemory(ctxt);
 9140|      4|                goto done;
 9141|      4|            }
 9142|       |
 9143|  8.06k|            ctxt->attrHash = tmp;
 9144|  8.06k|            ctxt->attrHashMax = attrHashSize;
 9145|  8.06k|        }
 9146|       |
 9147|  55.4k|        memset(ctxt->attrHash, -1, attrHashSize * sizeof(ctxt->attrHash[0]));
 9148|       |
 9149|   151k|        for (i = 0, j = 0; j < nratts; i += 5, j++) {
  ------------------
  |  Branch (9149:28): [True: 96.5k, False: 55.4k]
  ------------------
 9150|  96.5k|            const xmlChar *nsuri;
 9151|  96.5k|            unsigned hashValue, nameHashValue, uriHashValue;
 9152|  96.5k|            int res;
 9153|       |
 9154|  96.5k|            attname = atts[i];
 9155|  96.5k|            aprefix = atts[i+1];
 9156|  96.5k|            nsIndex = XML_PTR_TO_INT(atts[i+2]);
  ------------------
  |  |   58|  96.5k|#define XML_PTR_TO_INT(p) ((XML_INTPTR_T) (p))
  ------------------
 9157|       |            /* Hash values always have bit 31 set, see dict.c */
 9158|  96.5k|            nameHashValue = ctxt->attallocs[j] | 0x80000000;
 9159|       |
 9160|  96.5k|            if (nsIndex == NS_INDEX_EMPTY) {
  ------------------
  |  |   80|  96.5k|#define NS_INDEX_EMPTY  INT_MAX
  ------------------
  |  Branch (9160:17): [True: 43.2k, False: 53.3k]
  ------------------
 9161|       |                /*
 9162|       |                 * Prefix with empty namespace means an undeclared
 9163|       |                 * prefix which was already reported above.
 9164|       |                 */
 9165|  43.2k|                if (aprefix != NULL)
  ------------------
  |  Branch (9165:21): [True: 9.88k, False: 33.3k]
  ------------------
 9166|  9.88k|                    continue;
 9167|  33.3k|                nsuri = NULL;
 9168|  33.3k|                uriHashValue = URI_HASH_EMPTY;
  ------------------
  |  |   82|  33.3k|#define URI_HASH_EMPTY  0xD943A04E
  ------------------
 9169|  53.3k|            } else if (nsIndex == NS_INDEX_XML) {
  ------------------
  |  |   81|  53.3k|#define NS_INDEX_XML    (INT_MAX - 1)
  ------------------
  |  Branch (9169:24): [True: 47.6k, False: 5.69k]
  ------------------
 9170|  47.6k|                nsuri = ctxt->str_xml_ns;
 9171|  47.6k|                uriHashValue = URI_HASH_XML;
  ------------------
  |  |   83|  47.6k|#define URI_HASH_XML    0xF0451F02
  ------------------
 9172|  47.6k|            } else {
 9173|  5.69k|                nsuri = ctxt->nsTab[nsIndex * 2 + 1];
 9174|  5.69k|                uriHashValue = ctxt->nsdb->extra[nsIndex].uriHashValue;
 9175|  5.69k|            }
 9176|       |
 9177|  86.6k|            hashValue = xmlDictCombineHash(nameHashValue, uriHashValue);
 9178|  86.6k|            res = xmlAttrHashInsert(ctxt, attrHashSize, attname, nsuri,
 9179|  86.6k|                                    hashValue, i);
 9180|  86.6k|            if (res < 0)
  ------------------
  |  Branch (9180:17): [True: 0, False: 86.6k]
  ------------------
 9181|      0|                continue;
 9182|       |
 9183|       |            /*
 9184|       |             * [ WFC: Unique Att Spec ]
 9185|       |             * No attribute name may appear more than once in the same
 9186|       |             * start-tag or empty-element tag.
 9187|       |             * As extended by the Namespace in XML REC.
 9188|       |             */
 9189|  86.6k|            if (res < INT_MAX) {
  ------------------
  |  Branch (9189:17): [True: 57.9k, False: 28.6k]
  ------------------
 9190|  57.9k|                if (aprefix == atts[res+1]) {
  ------------------
  |  Branch (9190:21): [True: 55.5k, False: 2.43k]
  ------------------
 9191|  55.5k|                    xmlErrAttributeDup(ctxt, aprefix, attname);
 9192|  55.5k|                    numDupErr += 1;
 9193|  55.5k|                } else {
 9194|  2.43k|                    xmlNsErr(ctxt, XML_NS_ERR_ATTRIBUTE_REDEFINED,
 9195|  2.43k|                             "Namespaced Attribute %s in '%s' redefined\n",
 9196|  2.43k|                             attname, nsuri, NULL);
 9197|  2.43k|                    numNsErr += 1;
 9198|  2.43k|                }
 9199|  57.9k|            }
 9200|  86.6k|        }
 9201|  55.4k|    }
 9202|       |
 9203|       |    /*
 9204|       |     * Default attributes
 9205|       |     */
 9206|   737k|    if (ctxt->attsDefault != NULL) {
  ------------------
  |  Branch (9206:9): [True: 175k, False: 561k]
  ------------------
 9207|   175k|        xmlDefAttrsPtr defaults;
 9208|       |
 9209|   175k|	defaults = xmlHashLookup2(ctxt->attsDefault, localname, prefix);
 9210|   175k|	if (defaults != NULL) {
  ------------------
  |  Branch (9210:6): [True: 144k, False: 30.9k]
  ------------------
 9211|   751k|	    for (i = 0; i < defaults->nbAttrs; i++) {
  ------------------
  |  Branch (9211:18): [True: 607k, False: 144k]
  ------------------
 9212|   607k|                xmlDefAttr *attr = &defaults->attrs[i];
 9213|   607k|                const xmlChar *nsuri = NULL;
 9214|   607k|                unsigned hashValue, uriHashValue = 0;
 9215|   607k|                int res;
 9216|       |
 9217|   607k|	        attname = attr->name.name;
 9218|   607k|		aprefix = attr->prefix.name;
 9219|       |
 9220|   607k|		if ((attname == ctxt->str_xmlns) && (aprefix == NULL))
  ------------------
  |  Branch (9220:7): [True: 38.2k, False: 568k]
  |  Branch (9220:39): [True: 36.9k, False: 1.35k]
  ------------------
 9221|  36.9k|                    continue;
 9222|   570k|		if (aprefix == ctxt->str_xmlns)
  ------------------
  |  Branch (9222:7): [True: 243k, False: 326k]
  ------------------
 9223|   243k|                    continue;
 9224|       |
 9225|   326k|                if (aprefix == NULL) {
  ------------------
  |  Branch (9225:21): [True: 154k, False: 172k]
  ------------------
 9226|   154k|                    nsIndex = NS_INDEX_EMPTY;
  ------------------
  |  |   80|   154k|#define NS_INDEX_EMPTY  INT_MAX
  ------------------
 9227|   154k|                    nsuri = NULL;
 9228|   154k|                    uriHashValue = URI_HASH_EMPTY;
  ------------------
  |  |   82|   154k|#define URI_HASH_EMPTY  0xD943A04E
  ------------------
 9229|   172k|                } else if (aprefix == ctxt->str_xml) {
  ------------------
  |  Branch (9229:28): [True: 46.2k, False: 125k]
  ------------------
 9230|  46.2k|                    nsIndex = NS_INDEX_XML;
  ------------------
  |  |   81|  46.2k|#define NS_INDEX_XML    (INT_MAX - 1)
  ------------------
 9231|  46.2k|                    nsuri = ctxt->str_xml_ns;
 9232|  46.2k|                    uriHashValue = URI_HASH_XML;
  ------------------
  |  |   83|  46.2k|#define URI_HASH_XML    0xF0451F02
  ------------------
 9233|   125k|                } else {
 9234|   125k|                    nsIndex = xmlParserNsLookup(ctxt, &attr->prefix, NULL);
 9235|   125k|                    if ((nsIndex == INT_MAX) ||
  ------------------
  |  Branch (9235:25): [True: 105k, False: 20.2k]
  ------------------
 9236|   105k|                        (nsIndex < ctxt->nsdb->minNsIndex)) {
  ------------------
  |  Branch (9236:25): [True: 205, False: 20.0k]
  ------------------
 9237|   105k|                        xmlNsErr(ctxt, XML_NS_ERR_UNDEFINED_NAMESPACE,
 9238|   105k|                                 "Namespace prefix %s for %s on %s is not "
 9239|   105k|                                 "defined\n",
 9240|   105k|                                 aprefix, attname, localname);
 9241|   105k|                        nsIndex = NS_INDEX_EMPTY;
  ------------------
  |  |   80|   105k|#define NS_INDEX_EMPTY  INT_MAX
  ------------------
 9242|   105k|                        nsuri = NULL;
 9243|   105k|                        uriHashValue = URI_HASH_EMPTY;
  ------------------
  |  |   82|   105k|#define URI_HASH_EMPTY  0xD943A04E
  ------------------
 9244|   105k|                    } else {
 9245|  20.0k|                        nsuri = ctxt->nsTab[nsIndex * 2 + 1];
 9246|  20.0k|                        uriHashValue = ctxt->nsdb->extra[nsIndex].uriHashValue;
 9247|  20.0k|                    }
 9248|   125k|                }
 9249|       |
 9250|       |                /*
 9251|       |                 * Check whether the attribute exists
 9252|       |                 */
 9253|   326k|                if (maxAtts > 1) {
  ------------------
  |  Branch (9253:21): [True: 281k, False: 44.7k]
  ------------------
 9254|   281k|                    hashValue = xmlDictCombineHash(attr->name.hashValue,
 9255|   281k|                                                   uriHashValue);
 9256|   281k|                    res = xmlAttrHashInsert(ctxt, attrHashSize, attname, nsuri,
 9257|   281k|                                            hashValue, nbatts);
 9258|   281k|                    if (res < 0)
  ------------------
  |  Branch (9258:25): [True: 0, False: 281k]
  ------------------
 9259|      0|                        continue;
 9260|   281k|                    if (res < INT_MAX) {
  ------------------
  |  Branch (9260:25): [True: 11.1k, False: 270k]
  ------------------
 9261|  11.1k|                        if (aprefix == atts[res+1])
  ------------------
  |  Branch (9261:29): [True: 1.16k, False: 10.0k]
  ------------------
 9262|  1.16k|                            continue;
 9263|  10.0k|                        xmlNsErr(ctxt, XML_NS_ERR_ATTRIBUTE_REDEFINED,
 9264|  10.0k|                                 "Namespaced Attribute %s in '%s' redefined\n",
 9265|  10.0k|                                 attname, nsuri, NULL);
 9266|  10.0k|                    }
 9267|   281k|                }
 9268|       |
 9269|   325k|                xmlParserEntityCheck(ctxt, attr->expandedSize);
 9270|       |
 9271|   325k|                if ((atts == NULL) || (nbatts + 5 > maxatts)) {
  ------------------
  |  Branch (9271:21): [True: 1.41k, False: 324k]
  |  Branch (9271:39): [True: 1.09k, False: 322k]
  ------------------
 9272|  2.50k|                    res = xmlCtxtGrowAttrs(ctxt);
 9273|       |
 9274|  2.50k|                    maxatts = ctxt->maxatts;
 9275|  2.50k|                    atts = ctxt->atts;
 9276|       |
 9277|  2.50k|                    if (res < 0) {
  ------------------
  |  Branch (9277:25): [True: 2, False: 2.50k]
  ------------------
 9278|      2|                        localname = NULL;
 9279|      2|                        goto done;
 9280|      2|                    }
 9281|  2.50k|                }
 9282|       |
 9283|   325k|                atts[nbatts++] = attname;
 9284|   325k|                atts[nbatts++] = aprefix;
 9285|   325k|                atts[nbatts++] = XML_INT_TO_PTR(nsIndex);
  ------------------
  |  |   59|   325k|#define XML_INT_TO_PTR(i) ((void *) (XML_INTPTR_T) (i))
  ------------------
 9286|   325k|                atts[nbatts++] = attr->value.name;
 9287|   325k|                atts[nbatts++] = attr->valueEnd;
 9288|       |
 9289|   325k|#ifdef LIBXML_VALID_ENABLED
 9290|       |                /*
 9291|       |                 * This should be moved to valid.c, but we don't keep track
 9292|       |                 * whether an attribute was defaulted.
 9293|       |                 */
 9294|   325k|                if ((ctxt->validate) &&
  ------------------
  |  Branch (9294:21): [True: 198k, False: 127k]
  ------------------
 9295|   198k|                    (ctxt->standalone == 1) &&
  ------------------
  |  Branch (9295:21): [True: 644, False: 197k]
  ------------------
 9296|    644|                    (attr->external != 0)) {
  ------------------
  |  Branch (9296:21): [True: 440, False: 204]
  ------------------
 9297|    440|                    xmlValidityError(ctxt, XML_DTD_STANDALONE_DEFAULTED,
 9298|    440|                            "standalone: attribute %s on %s defaulted "
 9299|    440|                            "from external subset\n",
 9300|    440|                            attname, localname);
 9301|    440|                }
 9302|   325k|#endif
 9303|   325k|                nbdef++;
 9304|   325k|	    }
 9305|   144k|	}
 9306|   175k|    }
 9307|       |
 9308|       |    /*
 9309|       |     * Using a single hash table for nsUri/localName pairs cannot
 9310|       |     * detect duplicate QNames reliably. The following example will
 9311|       |     * only result in two namespace errors.
 9312|       |     *
 9313|       |     * <doc xmlns:a="a" xmlns:b="a">
 9314|       |     *   <elem a:a="" b:a="" b:a=""/>
 9315|       |     * </doc>
 9316|       |     *
 9317|       |     * If we saw more than one namespace error but no duplicate QNames
 9318|       |     * were found, we have to scan for duplicate QNames.
 9319|       |     */
 9320|   737k|    if ((numDupErr == 0) && (numNsErr > 1)) {
  ------------------
  |  Branch (9320:9): [True: 736k, False: 1.06k]
  |  Branch (9320:29): [True: 698, False: 735k]
  ------------------
 9321|    698|        memset(ctxt->attrHash, -1,
 9322|    698|               attrHashSize * sizeof(ctxt->attrHash[0]));
 9323|       |
 9324|  5.06k|        for (i = 0, j = 0; j < nratts; i += 5, j++) {
  ------------------
  |  Branch (9324:28): [True: 4.37k, False: 698]
  ------------------
 9325|  4.37k|            unsigned hashValue, nameHashValue, prefixHashValue;
 9326|  4.37k|            int res;
 9327|       |
 9328|  4.37k|            aprefix = atts[i+1];
 9329|  4.37k|            if (aprefix == NULL)
  ------------------
  |  Branch (9329:17): [True: 426, False: 3.94k]
  ------------------
 9330|    426|                continue;
 9331|       |
 9332|  3.94k|            attname = atts[i];
 9333|       |            /* Hash values always have bit 31 set, see dict.c */
 9334|  3.94k|            nameHashValue = ctxt->attallocs[j] | 0x80000000;
 9335|  3.94k|            prefixHashValue = xmlDictComputeHash(ctxt->dict, aprefix);
 9336|       |
 9337|  3.94k|            hashValue = xmlDictCombineHash(nameHashValue, prefixHashValue);
 9338|  3.94k|            res = xmlAttrHashInsertQName(ctxt, attrHashSize, attname,
 9339|  3.94k|                                         aprefix, hashValue, i);
 9340|  3.94k|            if (res < INT_MAX)
  ------------------
  |  Branch (9340:17): [True: 1.73k, False: 2.21k]
  ------------------
 9341|  1.73k|                xmlErrAttributeDup(ctxt, aprefix, attname);
 9342|  3.94k|        }
 9343|    698|    }
 9344|       |
 9345|       |    /*
 9346|       |     * Reconstruct attribute pointers
 9347|       |     */
 9348|  1.18M|    for (i = 0, j = 0; i < nbatts; i += 5, j++) {
  ------------------
  |  Branch (9348:24): [True: 445k, False: 737k]
  ------------------
 9349|       |        /* namespace URI */
 9350|   445k|        nsIndex = XML_PTR_TO_INT(atts[i+2]);
  ------------------
  |  |   58|   445k|#define XML_PTR_TO_INT(p) ((XML_INTPTR_T) (p))
  ------------------
 9351|   445k|        if (nsIndex == INT_MAX)
  ------------------
  |  Branch (9351:13): [True: 319k, False: 126k]
  ------------------
 9352|   319k|            atts[i+2] = NULL;
 9353|   126k|        else if (nsIndex == INT_MAX - 1)
  ------------------
  |  Branch (9353:18): [True: 100k, False: 25.9k]
  ------------------
 9354|   100k|            atts[i+2] = ctxt->str_xml_ns;
 9355|  25.9k|        else
 9356|  25.9k|            atts[i+2] = ctxt->nsTab[nsIndex * 2 + 1];
 9357|       |
 9358|   445k|        if ((j < nratts) && (ctxt->attallocs[j] & 0x80000000) == 0) {
  ------------------
  |  Branch (9358:13): [True: 120k, False: 325k]
  |  Branch (9358:29): [True: 100k, False: 19.5k]
  ------------------
 9359|   100k|            atts[i+3] = BASE_PTR + XML_PTR_TO_INT(atts[i+3]);  /* value */
  ------------------
  |  | 2265|   100k|#define BASE_PTR ctxt->input->base
  ------------------
                          atts[i+3] = BASE_PTR + XML_PTR_TO_INT(atts[i+3]);  /* value */
  ------------------
  |  |   58|   100k|#define XML_PTR_TO_INT(p) ((XML_INTPTR_T) (p))
  ------------------
 9360|   100k|            atts[i+4] = BASE_PTR + XML_PTR_TO_INT(atts[i+4]);  /* valuend */
  ------------------
  |  | 2265|   100k|#define BASE_PTR ctxt->input->base
  ------------------
                          atts[i+4] = BASE_PTR + XML_PTR_TO_INT(atts[i+4]);  /* valuend */
  ------------------
  |  |   58|   100k|#define XML_PTR_TO_INT(p) ((XML_INTPTR_T) (p))
  ------------------
 9361|   100k|        }
 9362|   445k|    }
 9363|       |
 9364|   737k|    uri = xmlParserNsLookupUri(ctxt, &hprefix);
 9365|   737k|    if ((prefix != NULL) && (uri == NULL)) {
  ------------------
  |  Branch (9365:9): [True: 94.8k, False: 642k]
  |  Branch (9365:29): [True: 29.4k, False: 65.3k]
  ------------------
 9366|  29.4k|	xmlNsErr(ctxt, XML_NS_ERR_UNDEFINED_NAMESPACE,
 9367|  29.4k|	         "Namespace prefix %s on %s is not defined\n",
 9368|  29.4k|		 prefix, localname, NULL);
 9369|  29.4k|    }
 9370|   737k|    *pref = prefix;
 9371|   737k|    *URI = uri;
 9372|       |
 9373|       |    /*
 9374|       |     * SAX callback
 9375|       |     */
 9376|   737k|    if ((ctxt->sax != NULL) && (ctxt->sax->startElementNs != NULL) &&
  ------------------
  |  Branch (9376:9): [True: 737k, False: 0]
  |  Branch (9376:32): [True: 737k, False: 0]
  ------------------
 9377|   737k|	(!ctxt->disableSAX)) {
  ------------------
  |  Branch (9377:2): [True: 622k, False: 114k]
  ------------------
 9378|   622k|	if (nbNs > 0)
  ------------------
  |  Branch (9378:6): [True: 110k, False: 512k]
  ------------------
 9379|   110k|	    ctxt->sax->startElementNs(ctxt->userData, localname, prefix, uri,
 9380|   110k|                          nbNs, ctxt->nsTab + 2 * (ctxt->nsNr - nbNs),
 9381|   110k|			  nbatts / 5, nbdef, atts);
 9382|   512k|	else
 9383|   512k|	    ctxt->sax->startElementNs(ctxt->userData, localname, prefix, uri,
 9384|   512k|                          0, NULL, nbatts / 5, nbdef, atts);
 9385|   622k|    }
 9386|       |
 9387|   737k|done:
 9388|       |    /*
 9389|       |     * Free allocated attribute values
 9390|       |     */
 9391|   737k|    if (attval != 0) {
  ------------------
  |  Branch (9391:9): [True: 10.5k, False: 726k]
  ------------------
 9392|  81.9k|	for (i = 0, j = 0; j < nratts; i += 5, j++)
  ------------------
  |  Branch (9392:21): [True: 71.4k, False: 10.5k]
  ------------------
 9393|  71.4k|	    if (ctxt->attallocs[j] & 0x80000000)
  ------------------
  |  Branch (9393:10): [True: 19.5k, False: 51.9k]
  ------------------
 9394|  19.5k|	        xmlFree((xmlChar *) atts[i+3]);
 9395|  10.5k|    }
 9396|       |
 9397|   737k|    *nbNsPtr = nbNs;
 9398|   737k|    return(localname);
 9399|   737k|}
parser.c:xmlParserNsStartElement:
 1504|   755k|xmlParserNsStartElement(xmlParserNsData *nsdb) {
 1505|   755k|    if (nsdb->elementId == UINT_MAX)
  ------------------
  |  Branch (1505:9): [True: 0, False: 755k]
  ------------------
 1506|      0|        return(-1);
 1507|   755k|    nsdb->elementId++;
 1508|       |
 1509|   755k|    return(0);
 1510|   755k|}
parser.c:xmlParseQNameHashed:
 8429|  1.05M|xmlParseQNameHashed(xmlParserCtxtPtr ctxt, xmlHashedString *prefix) {
 8430|  1.05M|    xmlHashedString l, p;
 8431|  1.05M|    int start, isNCName = 0;
 8432|       |
 8433|  1.05M|    l.name = NULL;
 8434|  1.05M|    p.name = NULL;
 8435|       |
 8436|  1.05M|    GROW;
  ------------------
  |  | 2308|  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 (2308:9): [True: 719k, False: 334k]
  |  |  ------------------
  |  | 2309|  1.05M|        (ctxt->input->end - ctxt->input->cur < INPUT_CHUNK)) \
  |  |  ------------------
  |  |  |  |   63|   719k|#define INPUT_CHUNK	250
  |  |  ------------------
  |  |  |  Branch (2309:9): [True: 59.1k, False: 660k]
  |  |  ------------------
  |  | 2310|  1.05M|	xmlParserGrow(ctxt);
  ------------------
 8437|  1.05M|    start = CUR_PTR - BASE_PTR;
  ------------------
  |  | 2264|  1.05M|#define CUR_PTR ctxt->input->cur
  ------------------
                  start = CUR_PTR - BASE_PTR;
  ------------------
  |  | 2265|  1.05M|#define BASE_PTR ctxt->input->base
  ------------------
 8438|       |
 8439|  1.05M|    l = xmlParseNCName(ctxt);
 8440|  1.05M|    if (l.name != NULL) {
  ------------------
  |  Branch (8440:9): [True: 964k, False: 89.9k]
  ------------------
 8441|   964k|        isNCName = 1;
 8442|   964k|        if (CUR == ':') {
  ------------------
  |  | 2262|   964k|#define CUR (*ctxt->input->cur)
  ------------------
  |  Branch (8442:13): [True: 247k, False: 717k]
  ------------------
 8443|   247k|            NEXT;
  ------------------
  |  | 2316|   247k|#define NEXT xmlNextChar(ctxt)
  ------------------
 8444|   247k|            p = l;
 8445|   247k|            l = xmlParseNCName(ctxt);
 8446|   247k|        }
 8447|   964k|    }
 8448|  1.05M|    if ((l.name == NULL) || (CUR == ':')) {
  ------------------
  |  | 2262|   956k|#define CUR (*ctxt->input->cur)
  ------------------
  |  Branch (8448:9): [True: 97.8k, False: 956k]
  |  Branch (8448:29): [True: 2.13k, False: 954k]
  ------------------
 8449|  99.9k|        xmlChar *tmp;
 8450|       |
 8451|  99.9k|        l.name = NULL;
 8452|  99.9k|        p.name = NULL;
 8453|  99.9k|        if ((isNCName == 0) && (CUR != ':'))
  ------------------
  |  | 2262|  89.9k|#define CUR (*ctxt->input->cur)
  ------------------
  |  Branch (8453:13): [True: 89.9k, False: 10.0k]
  |  Branch (8453:32): [True: 85.2k, False: 4.72k]
  ------------------
 8454|  85.2k|            return(l);
 8455|  14.7k|        tmp = xmlParseNmtoken(ctxt);
 8456|  14.7k|        if (tmp != NULL)
  ------------------
  |  Branch (8456:13): [True: 8.01k, False: 6.75k]
  ------------------
 8457|  8.01k|            xmlFree(tmp);
 8458|  14.7k|        l = xmlDictLookupHashed(ctxt->dict, BASE_PTR + start,
  ------------------
  |  | 2265|  14.7k|#define BASE_PTR ctxt->input->base
  ------------------
 8459|  14.7k|                                CUR_PTR - (BASE_PTR + start));
  ------------------
  |  | 2264|  14.7k|#define CUR_PTR ctxt->input->cur
  ------------------
                                              CUR_PTR - (BASE_PTR + start));
  ------------------
  |  | 2265|  14.7k|#define BASE_PTR ctxt->input->base
  ------------------
 8460|  14.7k|        if (l.name == NULL) {
  ------------------
  |  Branch (8460:13): [True: 1, False: 14.7k]
  ------------------
 8461|      1|            xmlErrMemory(ctxt);
 8462|      1|            return(l);
 8463|      1|        }
 8464|  14.7k|        xmlNsErr(ctxt, XML_NS_ERR_QNAME,
 8465|  14.7k|                 "Failed to parse QName '%s'\n", l.name, NULL, NULL);
 8466|  14.7k|    }
 8467|       |
 8468|   969k|    *prefix = p;
 8469|   969k|    return(l);
 8470|  1.05M|}
parser.c:xmlParseNCName:
 3283|  1.30M|xmlParseNCName(xmlParserCtxtPtr ctxt) {
 3284|  1.30M|    const xmlChar *in, *e;
 3285|  1.30M|    xmlHashedString ret;
 3286|  1.30M|    size_t count = 0;
 3287|  1.30M|    size_t maxLength = (ctxt->options & XML_PARSE_HUGE) ?
  ------------------
  |  Branch (3287:24): [True: 779k, False: 522k]
  ------------------
 3288|   779k|                       XML_MAX_TEXT_LENGTH :
  ------------------
  |  |   50|   779k|#define XML_MAX_TEXT_LENGTH 10000000
  ------------------
 3289|  1.30M|                       XML_MAX_NAME_LENGTH;
  ------------------
  |  |   65|  1.82M|#define XML_MAX_NAME_LENGTH 50000
  ------------------
 3290|       |
 3291|  1.30M|    ret.name = NULL;
 3292|       |
 3293|       |    /*
 3294|       |     * Accelerator for simple ASCII names
 3295|       |     */
 3296|  1.30M|    in = ctxt->input->cur;
 3297|  1.30M|    e = ctxt->input->end;
 3298|  1.30M|    if ((((*in >= 0x61) && (*in <= 0x7A)) ||
  ------------------
  |  Branch (3298:11): [True: 1.19M, False: 106k]
  |  Branch (3298:28): [True: 1.18M, False: 14.0k]
  ------------------
 3299|   120k|	 ((*in >= 0x41) && (*in <= 0x5A)) ||
  ------------------
  |  Branch (3299:4): [True: 32.9k, False: 87.4k]
  |  Branch (3299:21): [True: 17.0k, False: 15.8k]
  ------------------
 3300|  1.19M|	 (*in == '_')) && (in < e)) {
  ------------------
  |  Branch (3300:3): [True: 1.03k, False: 102k]
  |  Branch (3300:20): [True: 1.19M, False: 0]
  ------------------
 3301|  1.19M|	in++;
 3302|  4.86M|	while ((((*in >= 0x61) && (*in <= 0x7A)) ||
  ------------------
  |  Branch (3302:11): [True: 1.72M, False: 3.14M]
  |  Branch (3302:28): [True: 1.71M, False: 9.22k]
  ------------------
 3303|  3.15M|	        ((*in >= 0x41) && (*in <= 0x5A)) ||
  ------------------
  |  Branch (3303:11): [True: 321k, False: 2.82M]
  |  Branch (3303:28): [True: 308k, False: 13.1k]
  ------------------
 3304|  2.84M|	        ((*in >= 0x30) && (*in <= 0x39)) ||
  ------------------
  |  Branch (3304:11): [True: 2.38M, False: 459k]
  |  Branch (3304:28): [True: 1.63M, False: 752k]
  ------------------
 3305|  1.21M|	        (*in == '_') || (*in == '-') ||
  ------------------
  |  Branch (3305:10): [True: 3.36k, False: 1.20M]
  |  Branch (3305:26): [True: 6.61k, False: 1.20M]
  ------------------
 3306|  3.66M|	        (*in == '.')) && (in < e))
  ------------------
  |  Branch (3306:10): [True: 2.00k, False: 1.19M]
  |  Branch (3306:27): [True: 3.66M, False: 0]
  ------------------
 3307|  3.66M|	    in++;
 3308|  1.19M|	if (in >= e)
  ------------------
  |  Branch (3308:6): [True: 687, False: 1.19M]
  ------------------
 3309|    687|	    goto complex;
 3310|  1.19M|	if ((*in > 0) && (*in < 0x80)) {
  ------------------
  |  Branch (3310:6): [True: 1.19M, False: 2.91k]
  |  Branch (3310:19): [True: 1.18M, False: 7.98k]
  ------------------
 3311|  1.18M|	    count = in - ctxt->input->cur;
 3312|  1.18M|            if (count > maxLength) {
  ------------------
  |  Branch (3312:17): [True: 17, False: 1.18M]
  ------------------
 3313|     17|                xmlFatalErr(ctxt, XML_ERR_NAME_TOO_LONG, "NCName");
 3314|     17|                return(ret);
 3315|     17|            }
 3316|  1.18M|	    ret = xmlDictLookupHashed(ctxt->dict, ctxt->input->cur, count);
 3317|  1.18M|	    ctxt->input->cur = in;
 3318|  1.18M|	    ctxt->input->col += count;
 3319|  1.18M|	    if (ret.name == NULL) {
  ------------------
  |  Branch (3319:10): [True: 4, False: 1.18M]
  ------------------
 3320|      4|	        xmlErrMemory(ctxt);
 3321|      4|	    }
 3322|  1.18M|	    return(ret);
 3323|  1.18M|	}
 3324|  1.19M|    }
 3325|   113k|complex:
 3326|   113k|    return(xmlParseNCNameComplex(ctxt));
 3327|  1.30M|}
parser.c:xmlParseNCNameComplex:
 3230|   113k|xmlParseNCNameComplex(xmlParserCtxtPtr ctxt) {
 3231|   113k|    xmlHashedString ret;
 3232|   113k|    int len = 0, l;
 3233|   113k|    int c;
 3234|   113k|    int maxLength = (ctxt->options & XML_PARSE_HUGE) ?
  ------------------
  |  Branch (3234:21): [True: 81.1k, False: 32.6k]
  ------------------
 3235|  81.1k|                    XML_MAX_TEXT_LENGTH :
  ------------------
  |  |   50|  81.1k|#define XML_MAX_TEXT_LENGTH 10000000
  ------------------
 3236|   113k|                    XML_MAX_NAME_LENGTH;
  ------------------
  |  |   65|  32.6k|#define XML_MAX_NAME_LENGTH 50000
  ------------------
 3237|   113k|    int old10 = (ctxt->options & XML_PARSE_OLD10) ? 1 : 0;
  ------------------
  |  Branch (3237:17): [True: 44.0k, False: 69.8k]
  ------------------
 3238|   113k|    size_t startPosition = 0;
 3239|       |
 3240|   113k|    ret.name = NULL;
 3241|   113k|    ret.hashValue = 0;
 3242|       |
 3243|       |    /*
 3244|       |     * Handler for more complex cases
 3245|       |     */
 3246|   113k|    startPosition = CUR_PTR - BASE_PTR;
  ------------------
  |  | 2264|   113k|#define CUR_PTR ctxt->input->cur
  ------------------
                  startPosition = CUR_PTR - BASE_PTR;
  ------------------
  |  | 2265|   113k|#define BASE_PTR ctxt->input->base
  ------------------
 3247|   113k|    c = xmlCurrentChar(ctxt, &l);
 3248|   113k|    if ((c == ' ') || (c == '>') || (c == '/') || /* accelerators */
  ------------------
  |  Branch (3248:9): [True: 2.03k, False: 111k]
  |  Branch (3248:23): [True: 2.29k, False: 109k]
  |  Branch (3248:37): [True: 5.29k, False: 104k]
  ------------------
 3249|   104k|	(!xmlIsNameStartChar(c, old10) || (c == ':'))) {
  ------------------
  |  Branch (3249:3): [True: 82.6k, False: 21.6k]
  |  Branch (3249:36): [True: 5.53k, False: 16.0k]
  ------------------
 3250|  97.7k|	return(ret);
 3251|  97.7k|    }
 3252|       |
 3253|  7.97M|    while ((c != ' ') && (c != '>') && (c != '/') && /* test bigname.xml */
  ------------------
  |  Branch (3253:12): [True: 7.97M, False: 729]
  |  Branch (3253:26): [True: 7.97M, False: 1.39k]
  |  Branch (3253:40): [True: 7.97M, False: 234]
  ------------------
 3254|  7.97M|	   (xmlIsNameChar(c, old10) && (c != ':'))) {
  ------------------
  |  Branch (3254:6): [True: 7.96M, False: 12.3k]
  |  Branch (3254:33): [True: 7.96M, False: 1.41k]
  ------------------
 3255|  7.96M|        if (len <= INT_MAX - l)
  ------------------
  |  Branch (3255:13): [True: 7.96M, False: 0]
  ------------------
 3256|  7.96M|	    len += l;
 3257|  7.96M|	NEXTL(l);
  ------------------
  |  | 2325|  7.96M|#define NEXTL(l) do {							\
  |  | 2326|  7.96M|    if (*(ctxt->input->cur) == '\n') {					\
  |  |  ------------------
  |  |  |  Branch (2326:9): [True: 0, False: 7.96M]
  |  |  ------------------
  |  | 2327|      0|	ctxt->input->line++; ctxt->input->col = 1;			\
  |  | 2328|  7.96M|    } else ctxt->input->col++;						\
  |  | 2329|  7.96M|    ctxt->input->cur += l;				\
  |  | 2330|  7.96M|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2330:12): [Folded, False: 7.96M]
  |  |  ------------------
  ------------------
 3258|  7.96M|	c = xmlCurrentChar(ctxt, &l);
 3259|  7.96M|    }
 3260|  16.0k|    if (len > maxLength) {
  ------------------
  |  Branch (3260:9): [True: 48, False: 16.0k]
  ------------------
 3261|     48|        xmlFatalErr(ctxt, XML_ERR_NAME_TOO_LONG, "NCName");
 3262|     48|        return(ret);
 3263|     48|    }
 3264|  16.0k|    ret = xmlDictLookupHashed(ctxt->dict, (BASE_PTR + startPosition), len);
  ------------------
  |  | 2265|  16.0k|#define BASE_PTR ctxt->input->base
  ------------------
 3265|  16.0k|    if (ret.name == NULL)
  ------------------
  |  Branch (3265:9): [True: 2, False: 16.0k]
  ------------------
 3266|      2|        xmlErrMemory(ctxt);
 3267|  16.0k|    return(ret);
 3268|  16.0k|}
parser.c:xmlParseAttribute2:
 8567|   284k|{
 8568|   284k|    xmlHashedString hname;
 8569|   284k|    const xmlChar *prefix, *name;
 8570|   284k|    xmlChar *val = NULL, *internal_val = NULL;
 8571|   284k|    int special = 0;
 8572|   284k|    int isNamespace;
 8573|   284k|    int flags;
 8574|       |
 8575|   284k|    *value = NULL;
 8576|   284k|    GROW;
  ------------------
  |  | 2308|   284k|    if ((!PARSER_PROGRESSIVE(ctxt)) && \
  |  |  ------------------
  |  |  |  |   47|   284k|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|   284k|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2308:9): [True: 150k, False: 133k]
  |  |  ------------------
  |  | 2309|   284k|        (ctxt->input->end - ctxt->input->cur < INPUT_CHUNK)) \
  |  |  ------------------
  |  |  |  |   63|   150k|#define INPUT_CHUNK	250
  |  |  ------------------
  |  |  |  Branch (2309:9): [True: 17.6k, False: 133k]
  |  |  ------------------
  |  | 2310|   284k|	xmlParserGrow(ctxt);
  ------------------
 8577|   284k|    hname = xmlParseQNameHashed(ctxt, hprefix);
 8578|   284k|    if (hname.name == NULL) {
  ------------------
  |  Branch (8578:9): [True: 66.1k, False: 218k]
  ------------------
 8579|  66.1k|        xmlFatalErrMsg(ctxt, XML_ERR_NAME_REQUIRED,
 8580|  66.1k|                       "error parsing attribute name\n");
 8581|  66.1k|        return(hname);
 8582|  66.1k|    }
 8583|   218k|    name = hname.name;
 8584|   218k|    prefix = hprefix->name;
 8585|       |
 8586|       |    /*
 8587|       |     * get the type if needed
 8588|       |     */
 8589|   218k|    if (ctxt->attsSpecial != NULL) {
  ------------------
  |  Branch (8589:9): [True: 26.9k, False: 191k]
  ------------------
 8590|  26.9k|        special = XML_PTR_TO_INT(xmlHashQLookup2(ctxt->attsSpecial, pref, elem,
  ------------------
  |  |   58|  26.9k|#define XML_PTR_TO_INT(p) ((XML_INTPTR_T) (p))
  ------------------
 8591|  26.9k|                                              prefix, name));
 8592|  26.9k|    }
 8593|       |
 8594|       |    /*
 8595|       |     * read the value
 8596|       |     */
 8597|   218k|    SKIP_BLANKS;
  ------------------
  |  | 2312|   218k|#define SKIP_BLANKS xmlSkipBlankChars(ctxt)
  ------------------
 8598|   218k|    if (RAW != '=') {
  ------------------
  |  | 2261|   218k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (8598:9): [True: 12.6k, False: 205k]
  ------------------
 8599|  12.6k|        xmlFatalErrMsgStr(ctxt, XML_ERR_ATTRIBUTE_WITHOUT_VALUE,
 8600|  12.6k|                          "Specification mandates value for attribute %s\n",
 8601|  12.6k|                          name);
 8602|  12.6k|        goto error;
 8603|  12.6k|    }
 8604|       |
 8605|       |
 8606|   205k|    NEXT;
  ------------------
  |  | 2316|   205k|#define NEXT xmlNextChar(ctxt)
  ------------------
 8607|   205k|    SKIP_BLANKS;
  ------------------
  |  | 2312|   205k|#define SKIP_BLANKS xmlSkipBlankChars(ctxt)
  ------------------
 8608|   205k|    flags = 0;
 8609|   205k|    isNamespace = (((prefix == NULL) && (name == ctxt->str_xmlns)) ||
  ------------------
  |  Branch (8609:21): [True: 65.5k, False: 139k]
  |  Branch (8609:41): [True: 15.6k, False: 49.8k]
  ------------------
 8610|   189k|                   (prefix == ctxt->str_xmlns));
  ------------------
  |  Branch (8610:20): [True: 66.2k, False: 123k]
  ------------------
 8611|   205k|    val = xmlParseAttValueInternal(ctxt, len, &flags, special,
 8612|   205k|                                   isNamespace);
 8613|   205k|    if (val == NULL)
  ------------------
  |  Branch (8613:9): [True: 3.60k, False: 201k]
  ------------------
 8614|  3.60k|        goto error;
 8615|       |
 8616|   201k|    *alloc = (flags & XML_ATTVAL_ALLOC) != 0;
  ------------------
  |  |   98|   201k|#define XML_ATTVAL_ALLOC        (1 << 0)
  ------------------
 8617|       |
 8618|   201k|#ifdef LIBXML_VALID_ENABLED
 8619|   201k|    if ((ctxt->validate) &&
  ------------------
  |  Branch (8619:9): [True: 30.8k, False: 170k]
  ------------------
 8620|  30.8k|        (ctxt->standalone == 1) &&
  ------------------
  |  Branch (8620:9): [True: 411, False: 30.4k]
  ------------------
 8621|    411|        (special & XML_SPECIAL_EXTERNAL) &&
  ------------------
  |  |   95|    411|#define XML_SPECIAL_EXTERNAL    (1 << 20)
  ------------------
  |  Branch (8621:9): [True: 140, False: 271]
  ------------------
 8622|    140|        (flags & XML_ATTVAL_NORM_CHANGE)) {
  ------------------
  |  |   99|    140|#define XML_ATTVAL_NORM_CHANGE  (1 << 1)
  ------------------
  |  Branch (8622:9): [True: 74, False: 66]
  ------------------
 8623|     74|        xmlValidityError(ctxt, XML_DTD_NOT_STANDALONE,
 8624|     74|                         "standalone: normalization of attribute %s on %s "
 8625|     74|                         "by external subset declaration\n",
 8626|     74|                         name, elem);
 8627|     74|    }
 8628|   201k|#endif
 8629|       |
 8630|   201k|    if (prefix == ctxt->str_xml) {
  ------------------
  |  Branch (8630:9): [True: 54.4k, False: 147k]
  ------------------
 8631|       |        /*
 8632|       |         * Check that xml:lang conforms to the specification
 8633|       |         * No more registered as an error, just generate a warning now
 8634|       |         * since this was deprecated in XML second edition
 8635|       |         */
 8636|  54.4k|        if ((ctxt->pedantic) && (xmlStrEqual(name, BAD_CAST "lang"))) {
  ------------------
  |  |   34|  13.7k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (8636:13): [True: 13.7k, False: 40.7k]
  |  Branch (8636:33): [True: 10.7k, False: 3.00k]
  ------------------
 8637|  10.7k|            internal_val = xmlStrndup(val, *len);
 8638|  10.7k|            if (internal_val == NULL)
  ------------------
  |  Branch (8638:17): [True: 2, False: 10.7k]
  ------------------
 8639|      2|                goto mem_error;
 8640|  10.7k|            if (!xmlCheckLanguageID(internal_val)) {
  ------------------
  |  Branch (8640:17): [True: 9.58k, False: 1.18k]
  ------------------
 8641|  9.58k|                xmlWarningMsg(ctxt, XML_WAR_LANG_VALUE,
 8642|  9.58k|                              "Malformed value for xml:lang : %s\n",
 8643|  9.58k|                              internal_val, NULL);
 8644|  9.58k|            }
 8645|  10.7k|        }
 8646|       |
 8647|       |        /*
 8648|       |         * Check that xml:space conforms to the specification
 8649|       |         */
 8650|  54.4k|        if (xmlStrEqual(name, BAD_CAST "space")) {
  ------------------
  |  |   34|  54.4k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (8650:13): [True: 5.40k, False: 49.0k]
  ------------------
 8651|  5.40k|            internal_val = xmlStrndup(val, *len);
 8652|  5.40k|            if (internal_val == NULL)
  ------------------
  |  Branch (8652:17): [True: 1, False: 5.40k]
  ------------------
 8653|      1|                goto mem_error;
 8654|  5.40k|            if (xmlStrEqual(internal_val, BAD_CAST "default"))
  ------------------
  |  |   34|  5.40k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (8654:17): [True: 329, False: 5.07k]
  ------------------
 8655|    329|                *(ctxt->space) = 0;
 8656|  5.07k|            else if (xmlStrEqual(internal_val, BAD_CAST "preserve"))
  ------------------
  |  |   34|  5.07k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (8656:22): [True: 4.85k, False: 222]
  ------------------
 8657|  4.85k|                *(ctxt->space) = 1;
 8658|    222|            else {
 8659|    222|                xmlWarningMsg(ctxt, XML_WAR_SPACE_VALUE,
 8660|    222|                              "Invalid value \"%s\" for xml:space : \"default\" or \"preserve\" expected\n",
 8661|    222|                              internal_val, NULL);
 8662|    222|            }
 8663|  5.40k|        }
 8664|  54.4k|        if (internal_val) {
  ------------------
  |  Branch (8664:13): [True: 16.1k, False: 38.3k]
  ------------------
 8665|  16.1k|            xmlFree(internal_val);
 8666|  16.1k|        }
 8667|  54.4k|    }
 8668|       |
 8669|   201k|    *value = val;
 8670|   201k|    return (hname);
 8671|       |
 8672|      3|mem_error:
 8673|      3|    xmlErrMemory(ctxt);
 8674|  16.2k|error:
 8675|  16.2k|    if ((val != NULL) && (*alloc != 0))
  ------------------
  |  Branch (8675:9): [True: 3, False: 16.2k]
  |  Branch (8675:26): [True: 1, False: 2]
  ------------------
 8676|      1|        xmlFree(val);
 8677|  16.2k|    return(hname);
 8678|      3|}
parser.c:xmlNsWarn:
  406|  4.02k|{
  407|       |    xmlCtxtErr(ctxt, NULL, XML_FROM_NAMESPACE, error, XML_ERR_WARNING,
  408|  4.02k|               info1, info2, info3, 0, msg, info1, info2, info3);
  409|  4.02k|}
parser.c:xmlCtxtGrowAttrs:
 1886|  27.0k|xmlCtxtGrowAttrs(xmlParserCtxtPtr ctxt) {
 1887|  27.0k|    const xmlChar **atts;
 1888|  27.0k|    unsigned *attallocs;
 1889|  27.0k|    int newSize;
 1890|       |
 1891|  27.0k|    newSize = xmlGrowCapacity(ctxt->maxatts / 5,
 1892|  27.0k|                              sizeof(atts[0]) * 5 + sizeof(attallocs[0]),
 1893|  27.0k|                              10, XML_MAX_ATTRS);
  ------------------
  |  |   93|  27.0k|#define XML_MAX_ATTRS 100000000 /* 100 million */
  ------------------
 1894|  27.0k|    if (newSize < 0) {
  ------------------
  |  Branch (1894:9): [True: 0, False: 27.0k]
  ------------------
 1895|      0|        xmlFatalErr(ctxt, XML_ERR_RESOURCE_LIMIT,
 1896|      0|                    "Maximum number of attributes exceeded");
 1897|      0|        return(-1);
 1898|      0|    }
 1899|       |
 1900|  27.0k|    atts = xmlRealloc(ctxt->atts, newSize * sizeof(atts[0]) * 5);
 1901|  27.0k|    if (atts == NULL)
  ------------------
  |  Branch (1901:9): [True: 7, False: 27.0k]
  ------------------
 1902|      7|        goto mem_error;
 1903|  27.0k|    ctxt->atts = atts;
 1904|       |
 1905|  27.0k|    attallocs = xmlRealloc(ctxt->attallocs,
 1906|  27.0k|                           newSize * sizeof(attallocs[0]));
 1907|  27.0k|    if (attallocs == NULL)
  ------------------
  |  Branch (1907:9): [True: 6, False: 27.0k]
  ------------------
 1908|      6|        goto mem_error;
 1909|  27.0k|    ctxt->attallocs = attallocs;
 1910|       |
 1911|  27.0k|    ctxt->maxatts = newSize * 5;
 1912|       |
 1913|  27.0k|    return(0);
 1914|       |
 1915|     13|mem_error:
 1916|     13|    xmlErrMemory(ctxt);
 1917|     13|    return(-1);
 1918|  27.0k|}
parser.c:xmlAttrHashInsert:
 8694|   368k|                  const xmlChar *uri, unsigned hashValue, int aindex) {
 8695|   368k|    xmlAttrHashBucket *table = ctxt->attrHash;
 8696|   368k|    xmlAttrHashBucket *bucket;
 8697|   368k|    unsigned hindex;
 8698|       |
 8699|   368k|    hindex = hashValue & (size - 1);
 8700|   368k|    bucket = &table[hindex];
 8701|       |
 8702|   398k|    while (bucket->index >= 0) {
  ------------------
  |  Branch (8702:12): [True: 99.2k, False: 299k]
  ------------------
 8703|  99.2k|        const xmlChar **atts = &ctxt->atts[bucket->index];
 8704|       |
 8705|  99.2k|        if (name == atts[0]) {
  ------------------
  |  Branch (8705:13): [True: 71.0k, False: 28.2k]
  ------------------
 8706|  71.0k|            int nsIndex = XML_PTR_TO_INT(atts[2]);
  ------------------
  |  |   58|  71.0k|#define XML_PTR_TO_INT(p) ((XML_INTPTR_T) (p))
  ------------------
 8707|       |
 8708|  71.0k|            if ((nsIndex == NS_INDEX_EMPTY) ? (uri == NULL) :
  ------------------
  |  |   80|  71.0k|#define NS_INDEX_EMPTY  INT_MAX
  ------------------
  |  Branch (8708:17): [True: 20.3k, False: 50.6k]
  |  Branch (8708:17): [True: 69.1k, False: 1.90k]
  ------------------
 8709|  71.0k|                (nsIndex == NS_INDEX_XML) ? (uri == ctxt->str_xml_ns) :
  ------------------
  |  |   81|  50.6k|#define NS_INDEX_XML    (INT_MAX - 1)
  ------------------
  |  Branch (8709:17): [True: 46.1k, False: 4.54k]
  ------------------
 8710|  50.6k|                (uri == ctxt->nsTab[nsIndex * 2 + 1]))
 8711|  69.1k|                return(bucket->index);
 8712|  71.0k|        }
 8713|       |
 8714|  30.1k|        hindex++;
 8715|  30.1k|        bucket++;
 8716|  30.1k|        if (hindex >= size) {
  ------------------
  |  Branch (8716:13): [True: 2.43k, False: 27.6k]
  ------------------
 8717|  2.43k|            hindex = 0;
 8718|  2.43k|            bucket = table;
 8719|  2.43k|        }
 8720|  30.1k|    }
 8721|       |
 8722|   299k|    bucket->index = aindex;
 8723|       |
 8724|       |    return(INT_MAX);
 8725|   368k|}
parser.c:xmlAttrHashInsertQName:
 8730|  3.94k|                       unsigned hashValue, int aindex) {
 8731|  3.94k|    xmlAttrHashBucket *table = ctxt->attrHash;
 8732|  3.94k|    xmlAttrHashBucket *bucket;
 8733|  3.94k|    unsigned hindex;
 8734|       |
 8735|  3.94k|    hindex = hashValue & (size - 1);
 8736|  3.94k|    bucket = &table[hindex];
 8737|       |
 8738|  5.11k|    while (bucket->index >= 0) {
  ------------------
  |  Branch (8738:12): [True: 2.90k, False: 2.21k]
  ------------------
 8739|  2.90k|        const xmlChar **atts = &ctxt->atts[bucket->index];
 8740|       |
 8741|  2.90k|        if ((name == atts[0]) && (prefix == atts[1]))
  ------------------
  |  Branch (8741:13): [True: 2.27k, False: 630]
  |  Branch (8741:34): [True: 1.73k, False: 540]
  ------------------
 8742|  1.73k|            return(bucket->index);
 8743|       |
 8744|  1.17k|        hindex++;
 8745|  1.17k|        bucket++;
 8746|  1.17k|        if (hindex >= size) {
  ------------------
  |  Branch (8746:13): [True: 195, False: 975]
  ------------------
 8747|    195|            hindex = 0;
 8748|    195|            bucket = table;
 8749|    195|        }
 8750|  1.17k|    }
 8751|       |
 8752|  2.21k|    bucket->index = aindex;
 8753|       |
 8754|       |    return(INT_MAX);
 8755|  3.94k|}
parser.c:xmlParserNsLookupUri:
 1573|   737k|xmlParserNsLookupUri(xmlParserCtxtPtr ctxt, const xmlHashedString *prefix) {
 1574|   737k|    const xmlChar *ret;
 1575|   737k|    int nsIndex;
 1576|       |
 1577|   737k|    if (prefix->name == ctxt->str_xml)
  ------------------
  |  Branch (1577:9): [True: 441, False: 736k]
  ------------------
 1578|    441|        return(ctxt->str_xml_ns);
 1579|       |
 1580|       |    /*
 1581|       |     * minNsIndex is used when building an entity tree. We must
 1582|       |     * ignore namespaces declared outside the entity.
 1583|       |     */
 1584|   736k|    nsIndex = xmlParserNsLookup(ctxt, prefix, NULL);
 1585|   736k|    if ((nsIndex == INT_MAX) || (nsIndex < ctxt->nsdb->minNsIndex))
  ------------------
  |  Branch (1585:9): [True: 602k, False: 134k]
  |  Branch (1585:33): [True: 544, False: 133k]
  ------------------
 1586|   602k|        return(NULL);
 1587|       |
 1588|   133k|    ret = ctxt->nsTab[nsIndex * 2 + 1];
 1589|   133k|    if (ret[0] == 0)
  ------------------
  |  Branch (1589:9): [True: 16.8k, False: 116k]
  ------------------
 1590|  16.8k|        ret = NULL;
 1591|   133k|    return(ret);
 1592|   736k|}
parser.c:nameNsPush:
 2098|   933k|{
 2099|   933k|    xmlStartTag *tag;
 2100|       |
 2101|   933k|    if (ctxt->nameNr >= ctxt->nameMax) {
  ------------------
  |  Branch (2101:9): [True: 48.6k, False: 884k]
  ------------------
 2102|  48.6k|        const xmlChar **tmp;
 2103|  48.6k|        xmlStartTag *tmp2;
 2104|  48.6k|        int newSize;
 2105|       |
 2106|  48.6k|        newSize = xmlGrowCapacity(ctxt->nameMax,
 2107|  48.6k|                                  sizeof(tmp[0]) + sizeof(tmp2[0]),
 2108|  48.6k|                                  10, XML_MAX_ITEMS);
  ------------------
  |  |   13|  48.6k|#define XML_MAX_ITEMS 1000000000 /* 1 billion */
  ------------------
 2109|  48.6k|        if (newSize < 0)
  ------------------
  |  Branch (2109:13): [True: 0, False: 48.6k]
  ------------------
 2110|      0|            goto mem_error;
 2111|       |
 2112|  48.6k|        tmp = xmlRealloc(ctxt->nameTab, newSize * sizeof(tmp[0]));
 2113|  48.6k|        if (tmp == NULL)
  ------------------
  |  Branch (2113:13): [True: 15, False: 48.6k]
  ------------------
 2114|     15|	    goto mem_error;
 2115|  48.6k|	ctxt->nameTab = tmp;
 2116|       |
 2117|  48.6k|        tmp2 = xmlRealloc(ctxt->pushTab, newSize * sizeof(tmp2[0]));
 2118|  48.6k|        if (tmp2 == NULL)
  ------------------
  |  Branch (2118:13): [True: 21, False: 48.6k]
  ------------------
 2119|     21|	    goto mem_error;
 2120|  48.6k|	ctxt->pushTab = tmp2;
 2121|       |
 2122|  48.6k|        ctxt->nameMax = newSize;
 2123|   884k|    } else if (ctxt->pushTab == NULL) {
  ------------------
  |  Branch (2123:16): [True: 32.6k, False: 852k]
  ------------------
 2124|  32.6k|        ctxt->pushTab = xmlMalloc(ctxt->nameMax * sizeof(ctxt->pushTab[0]));
 2125|  32.6k|        if (ctxt->pushTab == NULL)
  ------------------
  |  Branch (2125:13): [True: 12, False: 32.6k]
  ------------------
 2126|     12|            goto mem_error;
 2127|  32.6k|    }
 2128|   933k|    ctxt->nameTab[ctxt->nameNr] = value;
 2129|   933k|    ctxt->name = value;
 2130|   933k|    tag = &ctxt->pushTab[ctxt->nameNr];
 2131|   933k|    tag->prefix = prefix;
 2132|   933k|    tag->URI = URI;
 2133|   933k|    tag->line = line;
 2134|   933k|    tag->nsNr = nsNr;
 2135|   933k|    return (ctxt->nameNr++);
 2136|     48|mem_error:
 2137|     48|    xmlErrMemory(ctxt);
 2138|     48|    return (-1);
 2139|   933k|}
parser.c:xmlParseElementEnd:
 9856|   149k|xmlParseElementEnd(xmlParserCtxtPtr ctxt) {
 9857|   149k|    xmlNodePtr cur = ctxt->node;
 9858|       |
 9859|   149k|    if (ctxt->nameNr <= 0) {
  ------------------
  |  Branch (9859:9): [True: 5, False: 149k]
  ------------------
 9860|      5|        if ((RAW == '<') && (NXT(1) == '/'))
  ------------------
  |  | 2261|      5|#define RAW (*ctxt->input->cur)
  ------------------
                      if ((RAW == '<') && (NXT(1) == '/'))
  ------------------
  |  | 2263|      3|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
  |  Branch (9860:13): [True: 3, False: 2]
  |  Branch (9860:29): [True: 2, False: 1]
  ------------------
 9861|      2|            SKIP(2);
  ------------------
  |  | 2285|      2|#define SKIP(val) do {							\
  |  | 2286|      2|    ctxt->input->cur += (val),ctxt->input->col+=(val);			\
  |  | 2287|      2|    if (*ctxt->input->cur == 0)						\
  |  |  ------------------
  |  |  |  Branch (2287:9): [True: 1, False: 1]
  |  |  ------------------
  |  | 2288|      2|        xmlParserGrow(ctxt);						\
  |  | 2289|      2|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2289:12): [Folded, False: 2]
  |  |  ------------------
  ------------------
 9862|      5|        return;
 9863|      5|    }
 9864|       |
 9865|       |    /*
 9866|       |     * parse the end of tag: '</' should be here.
 9867|       |     */
 9868|   149k|    if (ctxt->sax2) {
  ------------------
  |  Branch (9868:9): [True: 84.9k, False: 64.0k]
  ------------------
 9869|  84.9k|	xmlParseEndTag2(ctxt, &ctxt->pushTab[ctxt->nameNr - 1]);
 9870|  84.9k|	namePop(ctxt);
 9871|  84.9k|    }
 9872|  64.0k|#ifdef LIBXML_SAX1_ENABLED
 9873|  64.0k|    else
 9874|  64.0k|	xmlParseEndTag1(ctxt, 0);
 9875|   149k|#endif /* LIBXML_SAX1_ENABLED */
 9876|       |
 9877|       |    /*
 9878|       |     * Capture end position
 9879|       |     */
 9880|   149k|    if (cur != NULL && ctxt->record_info) {
  ------------------
  |  Branch (9880:9): [True: 135k, False: 13.7k]
  |  Branch (9880:24): [True: 0, False: 135k]
  ------------------
 9881|      0|        xmlParserNodeInfoPtr node_info;
 9882|       |
 9883|      0|        node_info = (xmlParserNodeInfoPtr) xmlParserFindNodeInfo(ctxt, cur);
 9884|      0|        if (node_info != NULL) {
  ------------------
  |  Branch (9884:13): [True: 0, False: 0]
  ------------------
 9885|      0|            node_info->end_pos = ctxt->input->consumed +
 9886|      0|                                 (CUR_PTR - ctxt->input->base);
  ------------------
  |  | 2264|      0|#define CUR_PTR ctxt->input->cur
  ------------------
 9887|      0|            node_info->end_line = ctxt->input->line;
 9888|      0|        }
 9889|      0|    }
 9890|   149k|}
parser.c:xmlParseEndTag2:
 9414|   106k|xmlParseEndTag2(xmlParserCtxtPtr ctxt, const xmlStartTag *tag) {
 9415|   106k|    const xmlChar *name;
 9416|       |
 9417|   106k|    GROW;
  ------------------
  |  | 2308|   106k|    if ((!PARSER_PROGRESSIVE(ctxt)) && \
  |  |  ------------------
  |  |  |  |   47|   106k|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|   106k|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2308:9): [True: 84.9k, False: 21.5k]
  |  |  ------------------
  |  | 2309|   106k|        (ctxt->input->end - ctxt->input->cur < INPUT_CHUNK)) \
  |  |  ------------------
  |  |  |  |   63|  84.9k|#define INPUT_CHUNK	250
  |  |  ------------------
  |  |  |  Branch (2309:9): [True: 13.7k, False: 71.1k]
  |  |  ------------------
  |  | 2310|   106k|	xmlParserGrow(ctxt);
  ------------------
 9418|   106k|    if ((RAW != '<') || (NXT(1) != '/')) {
  ------------------
  |  | 2261|   106k|#define RAW (*ctxt->input->cur)
  ------------------
                  if ((RAW != '<') || (NXT(1) != '/')) {
  ------------------
  |  | 2263|   106k|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
  |  Branch (9418:9): [True: 40, False: 106k]
  |  Branch (9418:25): [True: 31, False: 106k]
  ------------------
 9419|     71|	xmlFatalErr(ctxt, XML_ERR_LTSLASH_REQUIRED, NULL);
 9420|     71|	return;
 9421|     71|    }
 9422|   106k|    SKIP(2);
  ------------------
  |  | 2285|   106k|#define SKIP(val) do {							\
  |  | 2286|   106k|    ctxt->input->cur += (val),ctxt->input->col+=(val);			\
  |  | 2287|   106k|    if (*ctxt->input->cur == 0)						\
  |  |  ------------------
  |  |  |  Branch (2287:9): [True: 1.60k, False: 104k]
  |  |  ------------------
  |  | 2288|   106k|        xmlParserGrow(ctxt);						\
  |  | 2289|   106k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2289:12): [Folded, False: 106k]
  |  |  ------------------
  ------------------
 9423|       |
 9424|   106k|    if (tag->prefix == NULL)
  ------------------
  |  Branch (9424:9): [True: 86.7k, False: 19.6k]
  ------------------
 9425|  86.7k|        name = xmlParseNameAndCompare(ctxt, ctxt->name);
 9426|  19.6k|    else
 9427|  19.6k|        name = xmlParseQNameAndCompare(ctxt, ctxt->name, tag->prefix);
 9428|       |
 9429|       |    /*
 9430|       |     * We should definitely be at the ending "S? '>'" part
 9431|       |     */
 9432|   106k|    GROW;
  ------------------
  |  | 2308|   106k|    if ((!PARSER_PROGRESSIVE(ctxt)) && \
  |  |  ------------------
  |  |  |  |   47|   106k|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|   106k|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2308:9): [True: 84.8k, False: 21.5k]
  |  |  ------------------
  |  | 2309|   106k|        (ctxt->input->end - ctxt->input->cur < INPUT_CHUNK)) \
  |  |  ------------------
  |  |  |  |   63|  84.8k|#define INPUT_CHUNK	250
  |  |  ------------------
  |  |  |  Branch (2309:9): [True: 13.8k, False: 71.0k]
  |  |  ------------------
  |  | 2310|   106k|	xmlParserGrow(ctxt);
  ------------------
 9433|   106k|    SKIP_BLANKS;
  ------------------
  |  | 2312|   106k|#define SKIP_BLANKS xmlSkipBlankChars(ctxt)
  ------------------
 9434|   106k|    if ((!IS_BYTE_CHAR(RAW)) || (RAW != '>')) {
  ------------------
  |  |  103|   106k|#define IS_BYTE_CHAR(c)	 xmlIsChar_ch(c)
  |  |  ------------------
  |  |  |  |  108|   106k|#define xmlIsChar_ch(c)		(((0x9 <= (c)) && ((c) <= 0xa)) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (108:28): [True: 101k, False: 5.34k]
  |  |  |  |  |  Branch (108:44): [True: 0, False: 101k]
  |  |  |  |  ------------------
  |  |  |  |  109|   106k|				 ((c) == 0xd) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (109:6): [True: 0, False: 106k]
  |  |  |  |  ------------------
  |  |  |  |  110|   106k|				  (0x20 <= (c)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (110:7): [True: 100k, False: 5.61k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                  if ((!IS_BYTE_CHAR(RAW)) || (RAW != '>')) {
  ------------------
  |  | 2261|   100k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (9434:33): [True: 22.2k, False: 78.5k]
  ------------------
 9435|  27.8k|	xmlFatalErr(ctxt, XML_ERR_GT_REQUIRED, NULL);
 9436|  27.8k|    } else
 9437|  78.5k|	NEXT1;
  ------------------
  |  | 2318|  78.5k|#define NEXT1 {								\
  |  | 2319|  78.5k|	ctxt->input->col++;						\
  |  | 2320|  78.5k|	ctxt->input->cur++;						\
  |  | 2321|  78.5k|	if (*ctxt->input->cur == 0)					\
  |  |  ------------------
  |  |  |  Branch (2321:6): [True: 1.43k, False: 77.1k]
  |  |  ------------------
  |  | 2322|  78.5k|	    xmlParserGrow(ctxt);						\
  |  | 2323|  78.5k|    }
  ------------------
 9438|       |
 9439|       |    /*
 9440|       |     * [ WFC: Element Type Match ]
 9441|       |     * The Name in an element's end-tag must match the element type in the
 9442|       |     * start-tag.
 9443|       |     *
 9444|       |     */
 9445|   106k|    if (name != (xmlChar*)1) {
  ------------------
  |  Branch (9445:9): [True: 24.4k, False: 81.9k]
  ------------------
 9446|  24.4k|        if (name == NULL) name = BAD_CAST "unparsable";
  ------------------
  |  |   34|  4.60k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (9446:13): [True: 4.60k, False: 19.8k]
  ------------------
 9447|  24.4k|        xmlFatalErrMsgStrIntStr(ctxt, XML_ERR_TAG_NAME_MISMATCH,
 9448|  24.4k|		     "Opening and ending tag mismatch: %s line %d and %s\n",
 9449|  24.4k|		                ctxt->name, tag->line, name);
 9450|  24.4k|    }
 9451|       |
 9452|       |    /*
 9453|       |     * SAX: End of Tag
 9454|       |     */
 9455|   106k|    if ((ctxt->sax != NULL) && (ctxt->sax->endElementNs != NULL) &&
  ------------------
  |  Branch (9455:9): [True: 106k, False: 0]
  |  Branch (9455:32): [True: 106k, False: 0]
  ------------------
 9456|   106k|	(!ctxt->disableSAX))
  ------------------
  |  Branch (9456:2): [True: 95.7k, False: 10.6k]
  ------------------
 9457|  95.7k|	ctxt->sax->endElementNs(ctxt->userData, ctxt->name, tag->prefix,
 9458|  95.7k|                                tag->URI);
 9459|       |
 9460|   106k|    spacePop(ctxt);
 9461|   106k|    if (tag->nsNr != 0)
  ------------------
  |  Branch (9461:9): [True: 5.39k, False: 101k]
  ------------------
 9462|  5.39k|	xmlParserNsPop(ctxt, tag->nsNr);
 9463|   106k|}
parser.c:xmlParseQNameAndCompare:
 8508|  19.6k|                        xmlChar const *prefix) {
 8509|  19.6k|    const xmlChar *cmp;
 8510|  19.6k|    const xmlChar *in;
 8511|  19.6k|    const xmlChar *ret;
 8512|  19.6k|    const xmlChar *prefix2;
 8513|       |
 8514|  19.6k|    if (prefix == NULL) return(xmlParseNameAndCompare(ctxt, name));
  ------------------
  |  Branch (8514:9): [True: 0, False: 19.6k]
  ------------------
 8515|       |
 8516|  19.6k|    GROW;
  ------------------
  |  | 2308|  19.6k|    if ((!PARSER_PROGRESSIVE(ctxt)) && \
  |  |  ------------------
  |  |  |  |   47|  19.6k|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|  19.6k|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2308:9): [True: 16.2k, False: 3.38k]
  |  |  ------------------
  |  | 2309|  19.6k|        (ctxt->input->end - ctxt->input->cur < INPUT_CHUNK)) \
  |  |  ------------------
  |  |  |  |   63|  16.2k|#define INPUT_CHUNK	250
  |  |  ------------------
  |  |  |  Branch (2309:9): [True: 2.45k, False: 13.7k]
  |  |  ------------------
  |  | 2310|  19.6k|	xmlParserGrow(ctxt);
  ------------------
 8517|  19.6k|    in = ctxt->input->cur;
 8518|       |
 8519|  19.6k|    cmp = prefix;
 8520|  39.3k|    while (*in != 0 && *in == *cmp) {
  ------------------
  |  Branch (8520:12): [True: 38.1k, False: 1.14k]
  |  Branch (8520:24): [True: 19.6k, False: 18.4k]
  ------------------
 8521|  19.6k|	++in;
 8522|  19.6k|	++cmp;
 8523|  19.6k|    }
 8524|  19.6k|    if ((*cmp == 0) && (*in == ':')) {
  ------------------
  |  Branch (8524:9): [True: 17.7k, False: 1.88k]
  |  Branch (8524:24): [True: 6.08k, False: 11.6k]
  ------------------
 8525|  6.08k|        in++;
 8526|  6.08k|	cmp = name;
 8527|  20.2k|	while (*in != 0 && *in == *cmp) {
  ------------------
  |  Branch (8527:9): [True: 19.2k, False: 1.01k]
  |  Branch (8527:21): [True: 14.1k, False: 5.07k]
  ------------------
 8528|  14.1k|	    ++in;
 8529|  14.1k|	    ++cmp;
 8530|  14.1k|	}
 8531|  6.08k|	if (*cmp == 0 && (*in == '>' || IS_BLANK_CH (*in))) {
  ------------------
  |  |  137|  1.47k|#define IS_BLANK_CH(c)  xmlIsBlank_ch(c)
  |  |  ------------------
  |  |  |  |   90|  1.47k|#define xmlIsBlank_ch(c)	(((c) == 0x20) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (90:27): [True: 201, False: 1.27k]
  |  |  |  |  ------------------
  |  |  |  |   91|  1.47k|				 ((0x9 <= (c)) && ((c) <= 0xa)) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (91:7): [True: 868, False: 405]
  |  |  |  |  |  Branch (91:23): [True: 222, False: 646]
  |  |  |  |  ------------------
  |  |  |  |   92|  1.47k|				 ((c) == 0xd))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (92:6): [True: 410, False: 641]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (8531:6): [True: 5.16k, False: 919]
  |  Branch (8531:20): [True: 3.69k, False: 1.47k]
  ------------------
 8532|       |	    /* success */
 8533|  4.52k|            ctxt->input->col += in - ctxt->input->cur;
 8534|  4.52k|	    ctxt->input->cur = in;
 8535|  4.52k|	    return((const xmlChar*) 1);
 8536|  4.52k|	}
 8537|  6.08k|    }
 8538|       |    /*
 8539|       |     * all strings coms from the dictionary, equality can be done directly
 8540|       |     */
 8541|  15.1k|    ret = xmlParseQName (ctxt, &prefix2);
 8542|  15.1k|    if (ret == NULL)
  ------------------
  |  Branch (8542:9): [True: 896, False: 14.2k]
  ------------------
 8543|    896|        return(NULL);
 8544|  14.2k|    if ((ret == name) && (prefix == prefix2))
  ------------------
  |  Branch (8544:9): [True: 12.4k, False: 1.80k]
  |  Branch (8544:26): [True: 586, False: 11.8k]
  ------------------
 8545|    586|	return((const xmlChar*) 1);
 8546|  13.6k|    return ret;
 8547|  14.2k|}
parser.c:xmlParseQName:
 8485|  15.1k|xmlParseQName(xmlParserCtxtPtr ctxt, const xmlChar **prefix) {
 8486|  15.1k|    xmlHashedString n, p;
 8487|       |
 8488|  15.1k|    n = xmlParseQNameHashed(ctxt, &p);
 8489|  15.1k|    if (n.name == NULL)
  ------------------
  |  Branch (8489:9): [True: 896, False: 14.2k]
  ------------------
 8490|    896|        return(NULL);
 8491|  14.2k|    *prefix = p.name;
 8492|  14.2k|    return(n.name);
 8493|  15.1k|}
parser.c:xmlParseInternalSubset:
 8031|  16.2k|xmlParseInternalSubset(xmlParserCtxtPtr ctxt) {
 8032|       |    /*
 8033|       |     * Is there any DTD definition ?
 8034|       |     */
 8035|  16.2k|    if (RAW == '[') {
  ------------------
  |  | 2261|  16.2k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (8035:9): [True: 16.2k, False: 0]
  ------------------
 8036|  16.2k|        int oldInputNr = ctxt->inputNr;
 8037|       |
 8038|  16.2k|        NEXT;
  ------------------
  |  | 2316|  16.2k|#define NEXT xmlNextChar(ctxt)
  ------------------
 8039|       |	/*
 8040|       |	 * Parse the succession of Markup declarations and
 8041|       |	 * PEReferences.
 8042|       |	 * Subsequence (markupdecl | PEReference | S)*
 8043|       |	 */
 8044|  16.2k|	SKIP_BLANKS;
  ------------------
  |  | 2312|  16.2k|#define SKIP_BLANKS xmlSkipBlankChars(ctxt)
  ------------------
 8045|   792k|        while (1) {
  ------------------
  |  Branch (8045:16): [True: 792k, Folded]
  ------------------
 8046|   792k|            if (PARSER_STOPPED(ctxt)) {
  ------------------
  |  |   44|   792k|#define PARSER_STOPPED(ctxt) ((ctxt)->disableSAX > 1)
  |  |  ------------------
  |  |  |  Branch (44:30): [True: 672, False: 791k]
  |  |  ------------------
  ------------------
 8047|    672|                return;
 8048|   791k|            } else if (ctxt->input->cur >= ctxt->input->end) {
  ------------------
  |  Branch (8048:24): [True: 118k, False: 672k]
  ------------------
 8049|   118k|                if (ctxt->inputNr <= oldInputNr) {
  ------------------
  |  Branch (8049:21): [True: 2.04k, False: 116k]
  ------------------
 8050|  2.04k|                xmlFatalErr(ctxt, XML_ERR_INT_SUBSET_NOT_FINISHED, NULL);
 8051|  2.04k|                    return;
 8052|  2.04k|                }
 8053|   116k|                xmlPopPE(ctxt);
 8054|   672k|            } else if ((RAW == ']') && (ctxt->inputNr <= oldInputNr)) {
  ------------------
  |  | 2261|   672k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (8054:24): [True: 10.1k, False: 662k]
  |  Branch (8054:40): [True: 10.1k, False: 4]
  ------------------
 8055|  10.1k|                NEXT;
  ------------------
  |  | 2316|  10.1k|#define NEXT xmlNextChar(ctxt)
  ------------------
 8056|  10.1k|                SKIP_BLANKS;
  ------------------
  |  | 2312|  10.1k|#define SKIP_BLANKS xmlSkipBlankChars(ctxt)
  ------------------
 8057|  10.1k|                break;
 8058|   662k|            } else if ((PARSER_EXTERNAL(ctxt)) &&
  ------------------
  |  |   55|   662k|    (((ctxt)->inSubset == 2) || \
  |  |  ------------------
  |  |  |  Branch (55:6): [True: 0, False: 662k]
  |  |  ------------------
  |  |   56|   662k|     (((ctxt)->input->entity != NULL) && \
  |  |  ------------------
  |  |  |  Branch (56:7): [True: 599k, False: 63.3k]
  |  |  ------------------
  |  |   57|   662k|      ((ctxt)->input->entity->etype == XML_EXTERNAL_PARAMETER_ENTITY)))
  |  |  ------------------
  |  |  |  Branch (57:7): [True: 596k, False: 3.17k]
  |  |  ------------------
  ------------------
 8059|   596k|                       (RAW == '<') && (NXT(1) == '!') && (NXT(2) == '[')) {
  ------------------
  |  | 2261|   596k|#define RAW (*ctxt->input->cur)
  ------------------
                                     (RAW == '<') && (NXT(1) == '!') && (NXT(2) == '[')) {
  ------------------
  |  | 2263|   431k|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
                                     (RAW == '<') && (NXT(1) == '!') && (NXT(2) == '[')) {
  ------------------
  |  | 2263|   421k|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
  |  Branch (8059:24): [True: 431k, False: 164k]
  |  Branch (8059:40): [True: 421k, False: 9.87k]
  |  Branch (8059:59): [True: 4.89k, False: 416k]
  ------------------
 8060|       |                /*
 8061|       |                 * Conditional sections are allowed in external entities
 8062|       |                 * included by PE References in the internal subset.
 8063|       |                 */
 8064|  4.89k|                xmlParseConditionalSections(ctxt);
 8065|   657k|            } else if ((RAW == '<') && ((NXT(1) == '!') || (NXT(1) == '?'))) {
  ------------------
  |  | 2261|   657k|#define RAW (*ctxt->input->cur)
  ------------------
                          } else if ((RAW == '<') && ((NXT(1) == '!') || (NXT(1) == '?'))) {
  ------------------
  |  | 2263|   467k|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
                          } else if ((RAW == '<') && ((NXT(1) == '!') || (NXT(1) == '?'))) {
  ------------------
  |  | 2263|  11.3k|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
  |  Branch (8065:24): [True: 467k, False: 190k]
  |  Branch (8065:41): [True: 455k, False: 11.3k]
  |  Branch (8065:60): [True: 10.2k, False: 1.05k]
  ------------------
 8066|   466k|                xmlParseMarkupDecl(ctxt);
 8067|   466k|            } else if (RAW == '%') {
  ------------------
  |  | 2261|   191k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (8067:24): [True: 188k, False: 3.34k]
  ------------------
 8068|   188k|                xmlParsePERefInternal(ctxt, 1);
 8069|   188k|            } else {
 8070|  3.34k|                xmlFatalErr(ctxt, XML_ERR_INT_SUBSET_NOT_FINISHED, NULL);
 8071|       |
 8072|  3.91k|                while (ctxt->inputNr > oldInputNr)
  ------------------
  |  Branch (8072:24): [True: 570, False: 3.34k]
  ------------------
 8073|    570|                    xmlPopPE(ctxt);
 8074|  3.34k|                return;
 8075|  3.34k|            }
 8076|   776k|            SKIP_BLANKS;
  ------------------
  |  | 2312|   776k|#define SKIP_BLANKS xmlSkipBlankChars(ctxt)
  ------------------
 8077|   776k|            SHRINK;
  ------------------
  |  | 2304|   776k|    if (!PARSER_PROGRESSIVE(ctxt)) \
  |  |  ------------------
  |  |  |  |   47|   776k|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|   776k|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2304:9): [True: 718k, False: 57.3k]
  |  |  ------------------
  |  | 2305|   776k|	xmlParserShrink(ctxt);
  ------------------
 8078|   776k|            GROW;
  ------------------
  |  | 2308|   776k|    if ((!PARSER_PROGRESSIVE(ctxt)) && \
  |  |  ------------------
  |  |  |  |   47|   776k|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|   776k|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2308:9): [True: 718k, False: 57.3k]
  |  |  ------------------
  |  | 2309|   776k|        (ctxt->input->end - ctxt->input->cur < INPUT_CHUNK)) \
  |  |  ------------------
  |  |  |  |   63|   718k|#define INPUT_CHUNK	250
  |  |  ------------------
  |  |  |  Branch (2309:9): [True: 477k, False: 241k]
  |  |  ------------------
  |  | 2310|   776k|	xmlParserGrow(ctxt);
  ------------------
 8079|   776k|        }
 8080|  16.2k|    }
 8081|       |
 8082|       |    /*
 8083|       |     * We should be at the end of the DOCTYPE declaration.
 8084|       |     */
 8085|  10.1k|    if (RAW != '>') {
  ------------------
  |  | 2261|  10.1k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (8085:9): [True: 140, False: 10.0k]
  ------------------
 8086|    140|        xmlFatalErr(ctxt, XML_ERR_DOCTYPE_NOT_FINISHED, NULL);
 8087|    140|        return;
 8088|    140|    }
 8089|  10.0k|    NEXT;
  ------------------
  |  | 2316|  10.0k|#define NEXT xmlNextChar(ctxt)
  ------------------
 8090|  10.0k|}
parser.c:xmlCleanSpecialAttr:
 1231|  21.7k|{
 1232|  21.7k|    if (ctxt->attsSpecial == NULL)
  ------------------
  |  Branch (1232:9): [True: 17.9k, False: 3.81k]
  ------------------
 1233|  17.9k|        return;
 1234|       |
 1235|  3.81k|    xmlHashScanFull(ctxt->attsSpecial, xmlCleanSpecialAttrCallback, ctxt);
 1236|       |
 1237|  3.81k|    if (xmlHashSize(ctxt->attsSpecial) == 0) {
  ------------------
  |  Branch (1237:9): [True: 177, False: 3.63k]
  ------------------
 1238|    177|        xmlHashFree(ctxt->attsSpecial, NULL);
 1239|       |        ctxt->attsSpecial = NULL;
 1240|    177|    }
 1241|  3.81k|}
parser.c:xmlCleanSpecialAttrCallback:
 1214|  25.2k|                            const xmlChar *unused ATTRIBUTE_UNUSED) {
 1215|  25.2k|    xmlParserCtxtPtr ctxt = (xmlParserCtxtPtr) data;
 1216|       |
 1217|  25.2k|    if (XML_PTR_TO_INT(payload) == XML_ATTRIBUTE_CDATA) {
  ------------------
  |  |   58|  25.2k|#define XML_PTR_TO_INT(p) ((XML_INTPTR_T) (p))
  ------------------
  |  Branch (1217:9): [True: 1.71k, False: 23.4k]
  ------------------
 1218|       |        xmlHashRemoveEntry2(ctxt->attsSpecial, fullname, fullattr, NULL);
 1219|  1.71k|    }
 1220|  25.2k|}
parser.c:xmlFinishDocument:
10388|  28.4k|xmlFinishDocument(xmlParserCtxtPtr ctxt) {
10389|  28.4k|    xmlDocPtr doc;
10390|       |
10391|       |    /*
10392|       |     * SAX: end of the document processing.
10393|       |     */
10394|  28.4k|    if ((ctxt->sax) && (ctxt->sax->endDocument != NULL))
  ------------------
  |  Branch (10394:9): [True: 28.4k, False: 0]
  |  Branch (10394:24): [True: 28.4k, False: 0]
  ------------------
10395|  28.4k|        ctxt->sax->endDocument(ctxt->userData);
10396|       |
10397|       |    /*
10398|       |     * Remove locally kept entity definitions if the tree was not built
10399|       |     */
10400|  28.4k|    doc = ctxt->myDoc;
10401|  28.4k|    if ((doc != NULL) &&
  ------------------
  |  Branch (10401:9): [True: 28.3k, False: 83]
  ------------------
10402|  28.3k|        (xmlStrEqual(doc->version, SAX_COMPAT_MODE))) {
  ------------------
  |  |  173|  28.3k|#define SAX_COMPAT_MODE BAD_CAST "SAX compatibility mode document"
  |  |  ------------------
  |  |  |  |   34|  28.3k|#define BAD_CAST (xmlChar *)
  |  |  ------------------
  ------------------
  |  Branch (10402:9): [True: 19, False: 28.3k]
  ------------------
10403|     19|        xmlFreeDoc(doc);
10404|       |        ctxt->myDoc = NULL;
10405|     19|    }
10406|  28.4k|}
parser.c:xmlParseTryOrFinish:
10867|   422k|xmlParseTryOrFinish(xmlParserCtxtPtr ctxt, int terminate) {
10868|   422k|    int ret = 0;
10869|   422k|    size_t avail;
10870|   422k|    xmlChar cur, next;
10871|       |
10872|   422k|    if (ctxt->input == NULL)
  ------------------
  |  Branch (10872:9): [True: 0, False: 422k]
  ------------------
10873|      0|        return(0);
10874|       |
10875|   422k|    if ((ctxt->input != NULL) &&
  ------------------
  |  Branch (10875:9): [True: 422k, False: 0]
  ------------------
10876|   422k|        (ctxt->input->cur - ctxt->input->base > 4096)) {
  ------------------
  |  Branch (10876:9): [True: 2.38k, False: 420k]
  ------------------
10877|  2.38k|        xmlParserShrink(ctxt);
10878|  2.38k|    }
10879|       |
10880|  3.97M|    while (ctxt->disableSAX == 0) {
  ------------------
  |  Branch (10880:12): [True: 3.96M, False: 11.8k]
  ------------------
10881|  3.96M|        avail = ctxt->input->end - ctxt->input->cur;
10882|  3.96M|        if (avail < 1)
  ------------------
  |  Branch (10882:13): [True: 25.3k, False: 3.94M]
  ------------------
10883|  25.3k|	    goto done;
10884|  3.94M|        switch (ctxt->instate) {
10885|  6.28k|            case XML_PARSER_EOF:
  ------------------
  |  Branch (10885:13): [True: 6.28k, False: 3.93M]
  ------------------
10886|       |	        /*
10887|       |		 * Document parsing is done !
10888|       |		 */
10889|  6.28k|	        goto done;
10890|  42.9k|            case XML_PARSER_START:
  ------------------
  |  Branch (10890:13): [True: 42.9k, False: 3.89M]
  ------------------
10891|       |                /*
10892|       |                 * Very first chars read from the document flow.
10893|       |                 */
10894|  42.9k|                if ((!terminate) && (avail < 4))
  ------------------
  |  Branch (10894:21): [True: 41.6k, False: 1.32k]
  |  Branch (10894:37): [True: 506, False: 41.1k]
  ------------------
10895|    506|                    goto done;
10896|       |
10897|       |                /*
10898|       |                 * We need more bytes to detect EBCDIC code pages.
10899|       |                 * See xmlDetectEBCDIC.
10900|       |                 */
10901|  42.4k|                if ((CMP4(CUR_PTR, 0x4C, 0x6F, 0xA7, 0x94)) &&
  ------------------
  |  | 2268|  42.4k|  ( ((unsigned char *) s)[ 0 ] == c1 && ((unsigned char *) s)[ 1 ] == c2 && \
  |  |  ------------------
  |  |  |  Branch (2268:5): [True: 776, False: 41.7k]
  |  |  |  Branch (2268:41): [True: 760, False: 16]
  |  |  ------------------
  |  | 2269|  42.4k|    ((unsigned char *) s)[ 2 ] == c3 && ((unsigned char *) s)[ 3 ] == c4 )
  |  |  ------------------
  |  |  |  Branch (2269:5): [True: 749, False: 11]
  |  |  |  Branch (2269:41): [True: 738, False: 11]
  |  |  ------------------
  ------------------
10902|    738|                    (!terminate) && (avail < 200))
  ------------------
  |  Branch (10902:21): [True: 382, False: 356]
  |  Branch (10902:37): [True: 349, False: 33]
  ------------------
10903|    349|                    goto done;
10904|       |
10905|  42.1k|                xmlDetectEncoding(ctxt);
10906|  42.1k|                ctxt->instate = XML_PARSER_XML_DECL;
10907|  42.1k|		break;
10908|       |
10909|  55.8k|            case XML_PARSER_XML_DECL:
  ------------------
  |  Branch (10909:13): [True: 55.8k, False: 3.88M]
  ------------------
10910|  55.8k|		if ((!terminate) && (avail < 2))
  ------------------
  |  Branch (10910:7): [True: 53.4k, False: 2.39k]
  |  Branch (10910:23): [True: 8, False: 53.4k]
  ------------------
10911|      8|		    goto done;
10912|  55.8k|		cur = ctxt->input->cur[0];
10913|  55.8k|		next = ctxt->input->cur[1];
10914|  55.8k|	        if ((cur == '<') && (next == '?')) {
  ------------------
  |  Branch (10914:14): [True: 54.7k, False: 1.02k]
  |  Branch (10914:30): [True: 22.7k, False: 32.0k]
  ------------------
10915|       |		    /* PI or XML decl */
10916|  22.7k|		    if ((!terminate) &&
  ------------------
  |  Branch (10916:11): [True: 21.3k, False: 1.45k]
  ------------------
10917|  21.3k|                        (!xmlParseLookupString(ctxt, 2, "?>", 2)))
  ------------------
  |  Branch (10917:25): [True: 13.7k, False: 7.57k]
  ------------------
10918|  13.7k|			goto done;
10919|  9.03k|		    if ((ctxt->input->cur[2] == 'x') &&
  ------------------
  |  Branch (10919:11): [True: 7.04k, False: 1.99k]
  ------------------
10920|  7.04k|			(ctxt->input->cur[3] == 'm') &&
  ------------------
  |  Branch (10920:4): [True: 6.14k, False: 893]
  ------------------
10921|  6.14k|			(ctxt->input->cur[4] == 'l') &&
  ------------------
  |  Branch (10921:4): [True: 3.10k, False: 3.04k]
  ------------------
10922|  3.10k|			(IS_BLANK_CH(ctxt->input->cur[5]))) {
  ------------------
  |  |  137|  3.10k|#define IS_BLANK_CH(c)  xmlIsBlank_ch(c)
  |  |  ------------------
  |  |  |  |   90|  3.10k|#define xmlIsBlank_ch(c)	(((c) == 0x20) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (90:27): [True: 2.92k, False: 175]
  |  |  |  |  ------------------
  |  |  |  |   91|  3.10k|				 ((0x9 <= (c)) && ((c) <= 0xa)) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (91:7): [True: 171, False: 4]
  |  |  |  |  |  Branch (91:23): [True: 35, False: 136]
  |  |  |  |  ------------------
  |  |  |  |   92|  3.10k|				 ((c) == 0xd))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (92:6): [True: 9, False: 131]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
10923|  2.96k|			ret += 5;
10924|  2.96k|			xmlParseXMLDecl(ctxt);
10925|  6.06k|		    } else {
10926|  6.06k|			ctxt->version = xmlCharStrdup(XML_DEFAULT_VERSION);
  ------------------
  |  |   42|  6.06k|#define XML_DEFAULT_VERSION	"1.0"
  ------------------
10927|  6.06k|                        if (ctxt->version == NULL) {
  ------------------
  |  Branch (10927:29): [True: 4, False: 6.06k]
  ------------------
10928|      4|                            xmlErrMemory(ctxt);
10929|      4|                            break;
10930|      4|                        }
10931|  6.06k|		    }
10932|  33.0k|		} else {
10933|  33.0k|		    ctxt->version = xmlCharStrdup(XML_DEFAULT_VERSION);
  ------------------
  |  |   42|  33.0k|#define XML_DEFAULT_VERSION	"1.0"
  ------------------
10934|  33.0k|		    if (ctxt->version == NULL) {
  ------------------
  |  Branch (10934:11): [True: 3, False: 33.0k]
  ------------------
10935|      3|		        xmlErrMemory(ctxt);
10936|      3|			break;
10937|      3|		    }
10938|  33.0k|		}
10939|  42.0k|                if ((ctxt->sax) && (ctxt->sax->setDocumentLocator)) {
  ------------------
  |  Branch (10939:21): [True: 42.0k, False: 0]
  |  Branch (10939:36): [True: 42.0k, False: 0]
  ------------------
10940|  42.0k|                    ctxt->sax->setDocumentLocator(ctxt->userData,
10941|  42.0k|                            (xmlSAXLocator *) &xmlDefaultSAXLocator);
10942|  42.0k|                }
10943|  42.0k|                if ((ctxt->sax) && (ctxt->sax->startDocument) &&
  ------------------
  |  Branch (10943:21): [True: 42.0k, False: 0]
  |  Branch (10943:36): [True: 42.0k, False: 0]
  ------------------
10944|  42.0k|                    (!ctxt->disableSAX))
  ------------------
  |  Branch (10944:21): [True: 41.7k, False: 367]
  ------------------
10945|  41.7k|                    ctxt->sax->startDocument(ctxt->userData);
10946|  42.0k|                ctxt->instate = XML_PARSER_MISC;
10947|  42.0k|		break;
10948|   568k|            case XML_PARSER_START_TAG: {
  ------------------
  |  Branch (10948:13): [True: 568k, False: 3.37M]
  ------------------
10949|   568k|	        const xmlChar *name;
10950|   568k|		const xmlChar *prefix = NULL;
10951|   568k|		const xmlChar *URI = NULL;
10952|   568k|                int line = ctxt->input->line;
10953|   568k|		int nbNs = 0;
10954|       |
10955|   568k|		if ((!terminate) && (avail < 2))
  ------------------
  |  Branch (10955:7): [True: 497k, False: 71.7k]
  |  Branch (10955:23): [True: 185, False: 496k]
  ------------------
10956|    185|		    goto done;
10957|   568k|		cur = ctxt->input->cur[0];
10958|   568k|	        if (cur != '<') {
  ------------------
  |  Branch (10958:14): [True: 2.11k, False: 566k]
  ------------------
10959|  2.11k|		    xmlFatalErrMsg(ctxt, XML_ERR_DOCUMENT_EMPTY,
10960|  2.11k|                                   "Start tag expected, '<' not found");
10961|  2.11k|                    ctxt->instate = XML_PARSER_EOF;
10962|  2.11k|                    xmlFinishDocument(ctxt);
10963|  2.11k|		    goto done;
10964|  2.11k|		}
10965|   566k|		if ((!terminate) && (!xmlParseLookupGt(ctxt)))
  ------------------
  |  Branch (10965:7): [True: 496k, False: 70.1k]
  |  Branch (10965:23): [True: 238k, False: 257k]
  ------------------
10966|   238k|                    goto done;
10967|   328k|		if (ctxt->spaceNr == 0)
  ------------------
  |  Branch (10967:7): [True: 0, False: 328k]
  ------------------
10968|      0|		    spacePush(ctxt, -1);
10969|   328k|		else if (*ctxt->space == -2)
  ------------------
  |  Branch (10969:12): [True: 55.7k, False: 272k]
  ------------------
10970|  55.7k|		    spacePush(ctxt, -1);
10971|   272k|		else
10972|   272k|		    spacePush(ctxt, *ctxt->space);
10973|   328k|#ifdef LIBXML_SAX1_ENABLED
10974|   328k|		if (ctxt->sax2)
  ------------------
  |  Branch (10974:7): [True: 199k, False: 128k]
  ------------------
10975|   199k|#endif /* LIBXML_SAX1_ENABLED */
10976|   199k|		    name = xmlParseStartTag2(ctxt, &prefix, &URI, &nbNs);
10977|   128k|#ifdef LIBXML_SAX1_ENABLED
10978|   128k|		else
10979|   128k|		    name = xmlParseStartTag(ctxt);
10980|   328k|#endif /* LIBXML_SAX1_ENABLED */
10981|   328k|		if (name == NULL) {
  ------------------
  |  Branch (10981:7): [True: 2.06k, False: 326k]
  ------------------
10982|  2.06k|		    spacePop(ctxt);
10983|  2.06k|                    ctxt->instate = XML_PARSER_EOF;
10984|  2.06k|                    xmlFinishDocument(ctxt);
10985|  2.06k|		    goto done;
10986|  2.06k|		}
10987|   326k|#ifdef LIBXML_VALID_ENABLED
10988|       |		/*
10989|       |		 * [ VC: Root Element Type ]
10990|       |		 * The Name in the document type declaration must match
10991|       |		 * the element type of the root element.
10992|       |		 */
10993|   326k|		if (ctxt->validate && ctxt->wellFormed && ctxt->myDoc &&
  ------------------
  |  Branch (10993:7): [True: 135k, False: 190k]
  |  Branch (10993:25): [True: 99.2k, False: 36.4k]
  |  Branch (10993:45): [True: 99.2k, False: 0]
  ------------------
10994|  99.2k|		    ctxt->node && (ctxt->node == ctxt->myDoc->children))
  ------------------
  |  Branch (10994:7): [True: 99.2k, False: 0]
  |  Branch (10994:21): [True: 0, False: 99.2k]
  ------------------
10995|      0|		    ctxt->valid &= xmlValidateRoot(&ctxt->vctxt, ctxt->myDoc);
10996|   326k|#endif /* LIBXML_VALID_ENABLED */
10997|       |
10998|       |		/*
10999|       |		 * Check for an Empty Element.
11000|       |		 */
11001|   326k|		if ((RAW == '/') && (NXT(1) == '>')) {
  ------------------
  |  | 2261|   326k|#define RAW (*ctxt->input->cur)
  ------------------
              		if ((RAW == '/') && (NXT(1) == '>')) {
  ------------------
  |  | 2263|  95.7k|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
  |  Branch (11001:7): [True: 95.7k, False: 230k]
  |  Branch (11001:23): [True: 93.2k, False: 2.50k]
  ------------------
11002|  93.2k|		    SKIP(2);
  ------------------
  |  | 2285|  93.2k|#define SKIP(val) do {							\
  |  | 2286|  93.2k|    ctxt->input->cur += (val),ctxt->input->col+=(val);			\
  |  | 2287|  93.2k|    if (*ctxt->input->cur == 0)						\
  |  |  ------------------
  |  |  |  Branch (2287:9): [True: 1.10k, False: 92.1k]
  |  |  ------------------
  |  | 2288|  93.2k|        xmlParserGrow(ctxt);						\
  |  | 2289|  93.2k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2289:12): [Folded, False: 93.2k]
  |  |  ------------------
  ------------------
11003|       |
11004|  93.2k|		    if (ctxt->sax2) {
  ------------------
  |  Branch (11004:11): [True: 50.8k, False: 42.3k]
  ------------------
11005|  50.8k|			if ((ctxt->sax != NULL) &&
  ------------------
  |  Branch (11005:8): [True: 50.8k, False: 0]
  ------------------
11006|  50.8k|			    (ctxt->sax->endElementNs != NULL) &&
  ------------------
  |  Branch (11006:8): [True: 50.8k, False: 0]
  ------------------
11007|  50.8k|			    (!ctxt->disableSAX))
  ------------------
  |  Branch (11007:8): [True: 50.8k, False: 59]
  ------------------
11008|  50.8k|			    ctxt->sax->endElementNs(ctxt->userData, name,
11009|  50.8k|			                            prefix, URI);
11010|  50.8k|			if (nbNs > 0)
  ------------------
  |  Branch (11010:8): [True: 6.05k, False: 44.8k]
  ------------------
11011|  6.05k|			    xmlParserNsPop(ctxt, nbNs);
11012|  50.8k|#ifdef LIBXML_SAX1_ENABLED
11013|  50.8k|		    } else {
11014|  42.3k|			if ((ctxt->sax != NULL) &&
  ------------------
  |  Branch (11014:8): [True: 42.3k, False: 0]
  ------------------
11015|  42.3k|			    (ctxt->sax->endElement != NULL) &&
  ------------------
  |  Branch (11015:8): [True: 42.3k, False: 0]
  ------------------
11016|  42.3k|			    (!ctxt->disableSAX))
  ------------------
  |  Branch (11016:8): [True: 42.3k, False: 17]
  ------------------
11017|  42.3k|			    ctxt->sax->endElement(ctxt->userData, name);
11018|  42.3k|#endif /* LIBXML_SAX1_ENABLED */
11019|  42.3k|		    }
11020|  93.2k|		    spacePop(ctxt);
11021|   232k|		} else if (RAW == '>') {
  ------------------
  |  | 2261|   232k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (11021:14): [True: 189k, False: 43.4k]
  ------------------
11022|   189k|		    NEXT;
  ------------------
  |  | 2316|   189k|#define NEXT xmlNextChar(ctxt)
  ------------------
11023|   189k|                    nameNsPush(ctxt, name, prefix, URI, line, nbNs);
11024|   189k|		} else {
11025|  43.4k|		    xmlFatalErrMsgStr(ctxt, XML_ERR_GT_REQUIRED,
11026|  43.4k|					 "Couldn't find end of Start Tag %s\n",
11027|  43.4k|					 name);
11028|  43.4k|		    nodePop(ctxt);
11029|  43.4k|		    spacePop(ctxt);
11030|  43.4k|                    if (nbNs > 0)
  ------------------
  |  Branch (11030:25): [True: 6.66k, False: 36.8k]
  ------------------
11031|  6.66k|                        xmlParserNsPop(ctxt, nbNs);
11032|  43.4k|		}
11033|       |
11034|   326k|                if (ctxt->nameNr == 0)
  ------------------
  |  Branch (11034:21): [True: 9.98k, False: 316k]
  ------------------
11035|  9.98k|                    ctxt->instate = XML_PARSER_EPILOG;
11036|   316k|                else
11037|   316k|                    ctxt->instate = XML_PARSER_CONTENT;
11038|   326k|                break;
11039|   328k|	    }
11040|  2.98M|            case XML_PARSER_CONTENT: {
  ------------------
  |  Branch (11040:13): [True: 2.98M, False: 957k]
  ------------------
11041|  2.98M|		cur = ctxt->input->cur[0];
11042|       |
11043|  2.98M|		if (cur == '<') {
  ------------------
  |  Branch (11043:7): [True: 437k, False: 2.54M]
  ------------------
11044|   437k|                    if ((!terminate) && (avail < 2))
  ------------------
  |  Branch (11044:25): [True: 363k, False: 74.0k]
  |  Branch (11044:41): [True: 1.40k, False: 362k]
  ------------------
11045|  1.40k|                        goto done;
11046|   436k|		    next = ctxt->input->cur[1];
11047|       |
11048|   436k|                    if (next == '/') {
  ------------------
  |  Branch (11048:25): [True: 39.8k, False: 396k]
  ------------------
11049|  39.8k|                        ctxt->instate = XML_PARSER_END_TAG;
11050|  39.8k|                        break;
11051|   396k|                    } else if (next == '?') {
  ------------------
  |  Branch (11051:32): [True: 25.0k, False: 371k]
  ------------------
11052|  25.0k|                        if ((!terminate) &&
  ------------------
  |  Branch (11052:29): [True: 21.6k, False: 3.36k]
  ------------------
11053|  21.6k|                            (!xmlParseLookupString(ctxt, 2, "?>", 2)))
  ------------------
  |  Branch (11053:29): [True: 6.94k, False: 14.6k]
  ------------------
11054|  6.94k|                            goto done;
11055|  18.0k|                        xmlParsePI(ctxt);
11056|  18.0k|                        ctxt->instate = XML_PARSER_CONTENT;
11057|  18.0k|                        break;
11058|   371k|                    } else if (next == '!') {
  ------------------
  |  Branch (11058:32): [True: 75.2k, False: 296k]
  ------------------
11059|  75.2k|                        if ((!terminate) && (avail < 3))
  ------------------
  |  Branch (11059:29): [True: 69.6k, False: 5.55k]
  |  Branch (11059:45): [True: 169, False: 69.5k]
  ------------------
11060|    169|                            goto done;
11061|  75.0k|                        next = ctxt->input->cur[2];
11062|       |
11063|  75.0k|                        if (next == '-') {
  ------------------
  |  Branch (11063:29): [True: 43.2k, False: 31.8k]
  ------------------
11064|  43.2k|                            if ((!terminate) && (avail < 4))
  ------------------
  |  Branch (11064:33): [True: 41.0k, False: 2.16k]
  |  Branch (11064:49): [True: 102, False: 40.9k]
  ------------------
11065|    102|                                goto done;
11066|  43.1k|                            if (ctxt->input->cur[3] == '-') {
  ------------------
  |  Branch (11066:33): [True: 43.1k, False: 15]
  ------------------
11067|  43.1k|                                if ((!terminate) &&
  ------------------
  |  Branch (11067:37): [True: 40.9k, False: 2.16k]
  ------------------
11068|  40.9k|                                    (!xmlParseLookupString(ctxt, 4, "-->", 3)))
  ------------------
  |  Branch (11068:37): [True: 4.19k, False: 36.7k]
  ------------------
11069|  4.19k|                                    goto done;
11070|  38.9k|                                xmlParseComment(ctxt);
11071|  38.9k|                                ctxt->instate = XML_PARSER_CONTENT;
11072|  38.9k|                                break;
11073|  43.1k|                            }
11074|  43.1k|                        } else if (next == '[') {
  ------------------
  |  Branch (11074:36): [True: 31.5k, False: 275]
  ------------------
11075|  31.5k|                            if ((!terminate) && (avail < 9))
  ------------------
  |  Branch (11075:33): [True: 28.2k, False: 3.27k]
  |  Branch (11075:49): [True: 292, False: 27.9k]
  ------------------
11076|    292|                                goto done;
11077|  31.2k|                            if ((ctxt->input->cur[2] == '[') &&
  ------------------
  |  Branch (11077:33): [True: 31.2k, False: 0]
  ------------------
11078|  31.2k|                                (ctxt->input->cur[3] == 'C') &&
  ------------------
  |  Branch (11078:33): [True: 31.2k, False: 28]
  ------------------
11079|  31.2k|                                (ctxt->input->cur[4] == 'D') &&
  ------------------
  |  Branch (11079:33): [True: 31.2k, False: 7]
  ------------------
11080|  31.2k|                                (ctxt->input->cur[5] == 'A') &&
  ------------------
  |  Branch (11080:33): [True: 31.2k, False: 4]
  ------------------
11081|  31.2k|                                (ctxt->input->cur[6] == 'T') &&
  ------------------
  |  Branch (11081:33): [True: 31.1k, False: 13]
  ------------------
11082|  31.1k|                                (ctxt->input->cur[7] == 'A') &&
  ------------------
  |  Branch (11082:33): [True: 31.1k, False: 11]
  ------------------
11083|  31.1k|                                (ctxt->input->cur[8] == '[')) {
  ------------------
  |  Branch (11083:33): [True: 31.1k, False: 8]
  ------------------
11084|  31.1k|                                if ((!terminate) &&
  ------------------
  |  Branch (11084:37): [True: 27.9k, False: 3.23k]
  ------------------
11085|  27.9k|                                    (!xmlParseLookupString(ctxt, 9, "]]>", 3)))
  ------------------
  |  Branch (11085:37): [True: 5.87k, False: 22.0k]
  ------------------
11086|  5.87k|                                    goto done;
11087|  25.3k|                                ctxt->instate = XML_PARSER_CDATA_SECTION;
11088|  25.3k|                                xmlParseCDSect(ctxt);
11089|  25.3k|                                ctxt->instate = XML_PARSER_CONTENT;
11090|  25.3k|                                break;
11091|  31.1k|                            }
11092|  31.2k|                        }
11093|  75.0k|                    }
11094|  2.54M|		} else if (cur == '&') {
  ------------------
  |  Branch (11094:14): [True: 40.7k, False: 2.50M]
  ------------------
11095|  40.7k|		    if ((!terminate) && (!xmlParseLookupChar(ctxt, ';')))
  ------------------
  |  Branch (11095:11): [True: 30.9k, False: 9.79k]
  |  Branch (11095:27): [True: 15.9k, False: 15.0k]
  ------------------
11096|  15.9k|			goto done;
11097|  24.8k|		    xmlParseReference(ctxt);
11098|  24.8k|                    break;
11099|  2.50M|		} else {
11100|       |		    /* TODO Avoid the extra copy, handle directly !!! */
11101|       |		    /*
11102|       |		     * Goal of the following test is:
11103|       |		     *  - minimize calls to the SAX 'character' callback
11104|       |		     *    when they are mergeable
11105|       |		     *  - handle an problem for isBlank when we only parse
11106|       |		     *    a sequence of blank chars and the next one is
11107|       |		     *    not available to check against '<' presence.
11108|       |		     *  - tries to homogenize the differences in SAX
11109|       |		     *    callbacks between the push and pull versions
11110|       |		     *    of the parser.
11111|       |		     */
11112|  2.50M|		    if (avail < XML_PARSER_BIG_BUFFER_SIZE) {
  ------------------
  |  |  171|  2.50M|#define XML_PARSER_BIG_BUFFER_SIZE 300
  ------------------
  |  Branch (11112:11): [True: 124k, False: 2.37M]
  ------------------
11113|   124k|			if ((!terminate) && (!xmlParseLookupCharData(ctxt)))
  ------------------
  |  Branch (11113:8): [True: 102k, False: 22.5k]
  |  Branch (11113:24): [True: 7.33k, False: 94.9k]
  ------------------
11114|  7.33k|			    goto done;
11115|   124k|                    }
11116|  2.49M|                    ctxt->checkIndex = 0;
11117|  2.49M|		    xmlParseCharDataInternal(ctxt, !terminate);
11118|  2.49M|                    break;
11119|  2.50M|		}
11120|       |
11121|   296k|                ctxt->instate = XML_PARSER_START_TAG;
11122|   296k|		break;
11123|  2.98M|	    }
11124|  42.2k|            case XML_PARSER_END_TAG:
  ------------------
  |  Branch (11124:13): [True: 42.2k, False: 3.89M]
  ------------------
11125|  42.2k|		if ((!terminate) && (!xmlParseLookupChar(ctxt, '>')))
  ------------------
  |  Branch (11125:7): [True: 36.8k, False: 5.41k]
  |  Branch (11125:23): [True: 3.54k, False: 33.3k]
  ------------------
11126|  3.54k|		    goto done;
11127|  38.7k|		if (ctxt->sax2) {
  ------------------
  |  Branch (11127:7): [True: 21.5k, False: 17.1k]
  ------------------
11128|  21.5k|	            xmlParseEndTag2(ctxt, &ctxt->pushTab[ctxt->nameNr - 1]);
11129|  21.5k|		    nameNsPop(ctxt);
11130|  21.5k|		}
11131|  17.1k|#ifdef LIBXML_SAX1_ENABLED
11132|  17.1k|		  else
11133|  17.1k|		    xmlParseEndTag1(ctxt, 0);
11134|  38.7k|#endif /* LIBXML_SAX1_ENABLED */
11135|  38.7k|		if (ctxt->nameNr == 0) {
  ------------------
  |  Branch (11135:7): [True: 2.90k, False: 35.8k]
  ------------------
11136|  2.90k|		    ctxt->instate = XML_PARSER_EPILOG;
11137|  35.8k|		} else {
11138|  35.8k|		    ctxt->instate = XML_PARSER_CONTENT;
11139|  35.8k|		}
11140|  38.7k|		break;
11141|   106k|            case XML_PARSER_MISC:
  ------------------
  |  Branch (11141:13): [True: 106k, False: 3.83M]
  ------------------
11142|   186k|            case XML_PARSER_PROLOG:
  ------------------
  |  Branch (11142:13): [True: 79.4k, False: 3.86M]
  ------------------
11143|   192k|            case XML_PARSER_EPILOG:
  ------------------
  |  Branch (11143:13): [True: 6.44k, False: 3.93M]
  ------------------
11144|   192k|		SKIP_BLANKS;
  ------------------
  |  | 2312|   192k|#define SKIP_BLANKS xmlSkipBlankChars(ctxt)
  ------------------
11145|   192k|                avail = ctxt->input->end - ctxt->input->cur;
11146|   192k|		if (avail < 1)
  ------------------
  |  Branch (11146:7): [True: 3.73k, False: 188k]
  ------------------
11147|  3.73k|		    goto done;
11148|   188k|		if (ctxt->input->cur[0] == '<') {
  ------------------
  |  Branch (11148:7): [True: 184k, False: 4.32k]
  ------------------
11149|   184k|                    if ((!terminate) && (avail < 2))
  ------------------
  |  Branch (11149:25): [True: 178k, False: 6.03k]
  |  Branch (11149:41): [True: 225, False: 178k]
  ------------------
11150|    225|                        goto done;
11151|   184k|                    next = ctxt->input->cur[1];
11152|   184k|                    if (next == '?') {
  ------------------
  |  Branch (11152:25): [True: 38.1k, False: 146k]
  ------------------
11153|  38.1k|                        if ((!terminate) &&
  ------------------
  |  Branch (11153:29): [True: 36.9k, False: 1.20k]
  ------------------
11154|  36.9k|                            (!xmlParseLookupString(ctxt, 2, "?>", 2)))
  ------------------
  |  Branch (11154:29): [True: 5.96k, False: 30.9k]
  ------------------
11155|  5.96k|                            goto done;
11156|  32.1k|                        xmlParsePI(ctxt);
11157|  32.1k|                        break;
11158|   146k|                    } else if (next == '!') {
  ------------------
  |  Branch (11158:32): [True: 112k, False: 33.8k]
  ------------------
11159|   112k|                        if ((!terminate) && (avail < 3))
  ------------------
  |  Branch (11159:29): [True: 109k, False: 2.88k]
  |  Branch (11159:45): [True: 167, False: 109k]
  ------------------
11160|    167|                            goto done;
11161|       |
11162|   111k|                        if (ctxt->input->cur[2] == '-') {
  ------------------
  |  Branch (11162:29): [True: 72.2k, False: 39.7k]
  ------------------
11163|  72.2k|                            if ((!terminate) && (avail < 4))
  ------------------
  |  Branch (11163:33): [True: 71.5k, False: 694]
  |  Branch (11163:49): [True: 150, False: 71.3k]
  ------------------
11164|    150|                                goto done;
11165|  72.0k|                            if (ctxt->input->cur[3] == '-') {
  ------------------
  |  Branch (11165:33): [True: 72.0k, False: 15]
  ------------------
11166|  72.0k|                                if ((!terminate) &&
  ------------------
  |  Branch (11166:37): [True: 71.3k, False: 684]
  ------------------
11167|  71.3k|                                    (!xmlParseLookupString(ctxt, 4, "-->", 3)))
  ------------------
  |  Branch (11167:37): [True: 11.2k, False: 60.1k]
  ------------------
11168|  11.2k|                                    goto done;
11169|  60.8k|                                xmlParseComment(ctxt);
11170|  60.8k|                                break;
11171|  72.0k|                            }
11172|  72.0k|                        } else if (ctxt->instate == XML_PARSER_MISC) {
  ------------------
  |  Branch (11172:36): [True: 39.6k, False: 72]
  ------------------
11173|  39.6k|                            if ((!terminate) && (avail < 9))
  ------------------
  |  Branch (11173:33): [True: 37.5k, False: 2.14k]
  |  Branch (11173:49): [True: 19, False: 37.4k]
  ------------------
11174|     19|                                goto done;
11175|  39.6k|                            if ((ctxt->input->cur[2] == 'D') &&
  ------------------
  |  Branch (11175:33): [True: 39.6k, False: 12]
  ------------------
11176|  39.6k|                                (ctxt->input->cur[3] == 'O') &&
  ------------------
  |  Branch (11176:33): [True: 39.6k, False: 5]
  ------------------
11177|  39.6k|                                (ctxt->input->cur[4] == 'C') &&
  ------------------
  |  Branch (11177:33): [True: 39.6k, False: 8]
  ------------------
11178|  39.6k|                                (ctxt->input->cur[5] == 'T') &&
  ------------------
  |  Branch (11178:33): [True: 39.6k, False: 3]
  ------------------
11179|  39.6k|                                (ctxt->input->cur[6] == 'Y') &&
  ------------------
  |  Branch (11179:33): [True: 39.6k, False: 11]
  ------------------
11180|  39.6k|                                (ctxt->input->cur[7] == 'P') &&
  ------------------
  |  Branch (11180:33): [True: 39.6k, False: 1]
  ------------------
11181|  39.6k|                                (ctxt->input->cur[8] == 'E')) {
  ------------------
  |  Branch (11181:33): [True: 39.5k, False: 4]
  ------------------
11182|  39.5k|                                if ((!terminate) && (!xmlParseLookupGt(ctxt)))
  ------------------
  |  Branch (11182:37): [True: 37.4k, False: 2.11k]
  |  Branch (11182:53): [True: 20.6k, False: 16.8k]
  ------------------
11183|  20.6k|                                    goto done;
11184|  18.9k|                                ctxt->inSubset = 1;
11185|  18.9k|                                xmlParseDocTypeDecl(ctxt);
11186|  18.9k|                                if (RAW == '[') {
  ------------------
  |  | 2261|  18.9k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (11186:37): [True: 15.1k, False: 3.87k]
  ------------------
11187|  15.1k|                                    ctxt->instate = XML_PARSER_DTD;
11188|  15.1k|                                } else {
11189|  3.87k|                                    if (RAW == '>')
  ------------------
  |  | 2261|  3.87k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (11189:41): [True: 3.63k, False: 236]
  ------------------
11190|  3.63k|                                        NEXT;
  ------------------
  |  | 2316|  3.63k|#define NEXT xmlNextChar(ctxt)
  ------------------
11191|       |                                    /*
11192|       |                                     * Create and update the external subset.
11193|       |                                     */
11194|  3.87k|                                    ctxt->inSubset = 2;
11195|  3.87k|                                    if ((ctxt->sax != NULL) &&
  ------------------
  |  Branch (11195:41): [True: 3.87k, False: 0]
  ------------------
11196|  3.87k|                                        (!ctxt->disableSAX) &&
  ------------------
  |  Branch (11196:41): [True: 3.75k, False: 119]
  ------------------
11197|  3.75k|                                        (ctxt->sax->externalSubset != NULL))
  ------------------
  |  Branch (11197:41): [True: 3.75k, False: 0]
  ------------------
11198|  3.75k|                                        ctxt->sax->externalSubset(
11199|  3.75k|                                                ctxt->userData,
11200|  3.75k|                                                ctxt->intSubName,
11201|  3.75k|                                                ctxt->extSubSystem,
11202|  3.75k|                                                ctxt->extSubURI);
11203|  3.87k|                                    ctxt->inSubset = 0;
11204|  3.87k|                                    xmlCleanSpecialAttr(ctxt);
11205|  3.87k|                                    ctxt->instate = XML_PARSER_PROLOG;
11206|  3.87k|                                }
11207|  18.9k|                                break;
11208|  39.5k|                            }
11209|  39.6k|                        }
11210|   111k|                    }
11211|   184k|                }
11212|       |
11213|  38.3k|                if (ctxt->instate == XML_PARSER_EPILOG) {
  ------------------
  |  Branch (11213:21): [True: 2.49k, False: 35.8k]
  ------------------
11214|  2.49k|                    if (ctxt->errNo == XML_ERR_OK)
  ------------------
  |  Branch (11214:25): [True: 29, False: 2.46k]
  ------------------
11215|     29|                        xmlFatalErr(ctxt, XML_ERR_DOCUMENT_END, NULL);
11216|  2.49k|		    ctxt->instate = XML_PARSER_EOF;
11217|  2.49k|                    xmlFinishDocument(ctxt);
11218|  35.8k|                } else {
11219|  35.8k|		    ctxt->instate = XML_PARSER_START_TAG;
11220|  35.8k|		}
11221|  38.3k|		break;
11222|  49.1k|            case XML_PARSER_DTD: {
  ------------------
  |  Branch (11222:13): [True: 49.1k, False: 3.89M]
  ------------------
11223|  49.1k|                if ((!terminate) && (!xmlParseLookupInternalSubset(ctxt)))
  ------------------
  |  Branch (11223:21): [True: 43.4k, False: 5.71k]
  |  Branch (11223:37): [True: 34.1k, False: 9.27k]
  ------------------
11224|  34.1k|                    goto done;
11225|  14.9k|		xmlParseInternalSubset(ctxt);
11226|  14.9k|		ctxt->inSubset = 2;
11227|  14.9k|		if ((ctxt->sax != NULL) && (!ctxt->disableSAX) &&
  ------------------
  |  Branch (11227:7): [True: 14.9k, False: 0]
  |  Branch (11227:30): [True: 12.6k, False: 2.33k]
  ------------------
11228|  12.6k|		    (ctxt->sax->externalSubset != NULL))
  ------------------
  |  Branch (11228:7): [True: 12.6k, False: 0]
  ------------------
11229|  12.6k|		    ctxt->sax->externalSubset(ctxt->userData, ctxt->intSubName,
11230|  12.6k|			    ctxt->extSubSystem, ctxt->extSubURI);
11231|  14.9k|		ctxt->inSubset = 0;
11232|  14.9k|		xmlCleanSpecialAttr(ctxt);
11233|  14.9k|		ctxt->instate = XML_PARSER_PROLOG;
11234|  14.9k|                break;
11235|  49.1k|	    }
11236|      0|            default:
  ------------------
  |  Branch (11236:13): [True: 0, False: 3.94M]
  ------------------
11237|      0|                xmlFatalErrMsg(ctxt, XML_ERR_INTERNAL_ERROR,
11238|      0|			"PP: internal error\n");
11239|      0|		ctxt->instate = XML_PARSER_EOF;
11240|      0|		break;
11241|  3.94M|	}
11242|  3.94M|    }
11243|   422k|done:
11244|   422k|    return(ret);
11245|   422k|}
parser.c:xmlParseLookupString:
10647|   220k|                     const char *str, size_t strLen) {
10648|   220k|    const xmlChar *cur, *term;
10649|       |
10650|   220k|    if (ctxt->checkIndex == 0) {
  ------------------
  |  Branch (10650:9): [True: 174k, False: 45.5k]
  ------------------
10651|   174k|        cur = ctxt->input->cur + startDelta;
10652|   174k|    } else {
10653|  45.5k|        cur = ctxt->input->cur + ctxt->checkIndex;
10654|  45.5k|    }
10655|       |
10656|   220k|    term = BAD_CAST strstr((const char *) cur, str);
  ------------------
  |  |   34|   220k|#define BAD_CAST (xmlChar *)
  ------------------
10657|   220k|    if (term == NULL) {
  ------------------
  |  Branch (10657:9): [True: 47.9k, False: 172k]
  ------------------
10658|  47.9k|        const xmlChar *end = ctxt->input->end;
10659|  47.9k|        size_t index;
10660|       |
10661|       |        /* Rescan (strLen - 1) characters. */
10662|  47.9k|        if ((size_t) (end - cur) < strLen)
  ------------------
  |  Branch (10662:13): [True: 1.00k, False: 46.9k]
  ------------------
10663|  1.00k|            end = cur;
10664|  46.9k|        else
10665|  46.9k|            end -= strLen - 1;
10666|  47.9k|        index = end - ctxt->input->cur;
10667|  47.9k|        if (index > LONG_MAX) {
  ------------------
  |  Branch (10667:13): [True: 0, False: 47.9k]
  ------------------
10668|      0|            ctxt->checkIndex = 0;
10669|      0|            return(ctxt->input->end - strLen);
10670|      0|        }
10671|  47.9k|        ctxt->checkIndex = index;
10672|   172k|    } else {
10673|   172k|        ctxt->checkIndex = 0;
10674|   172k|    }
10675|       |
10676|   220k|    return(term);
10677|   220k|}
parser.c:xmlParseLookupGt:
10714|   533k|xmlParseLookupGt(xmlParserCtxtPtr ctxt) {
10715|   533k|    const xmlChar *cur;
10716|   533k|    const xmlChar *end = ctxt->input->end;
10717|   533k|    int state = ctxt->endCheckState;
10718|   533k|    size_t index;
10719|       |
10720|   533k|    if (ctxt->checkIndex == 0)
  ------------------
  |  Branch (10720:9): [True: 285k, False: 248k]
  ------------------
10721|   285k|        cur = ctxt->input->cur + 1;
10722|   248k|    else
10723|   248k|        cur = ctxt->input->cur + ctxt->checkIndex;
10724|       |
10725|   137M|    while (cur < end) {
  ------------------
  |  Branch (10725:12): [True: 137M, False: 259k]
  ------------------
10726|   137M|        if (state) {
  ------------------
  |  Branch (10726:13): [True: 124M, False: 12.6M]
  ------------------
10727|   124M|            if (*cur == state)
  ------------------
  |  Branch (10727:17): [True: 176k, False: 124M]
  ------------------
10728|   176k|                state = 0;
10729|   124M|        } else if (*cur == '\'' || *cur == '"') {
  ------------------
  |  Branch (10729:20): [True: 72.7k, False: 12.5M]
  |  Branch (10729:36): [True: 106k, False: 12.4M]
  ------------------
10730|   179k|            state = *cur;
10731|  12.4M|        } else if (*cur == '>') {
  ------------------
  |  Branch (10731:20): [True: 274k, False: 12.2M]
  ------------------
10732|   274k|            ctxt->checkIndex = 0;
10733|   274k|            ctxt->endCheckState = 0;
10734|   274k|            return(1);
10735|   274k|        }
10736|   136M|        cur++;
10737|   136M|    }
10738|       |
10739|   259k|    index = cur - ctxt->input->cur;
10740|   259k|    if (index > LONG_MAX) {
  ------------------
  |  Branch (10740:9): [True: 0, False: 259k]
  ------------------
10741|      0|        ctxt->checkIndex = 0;
10742|      0|        ctxt->endCheckState = 0;
10743|      0|        return(1);
10744|      0|    }
10745|   259k|    ctxt->checkIndex = index;
10746|   259k|    ctxt->endCheckState = state;
10747|   259k|    return(0);
10748|   259k|}
parser.c:xmlParseLookupChar:
10613|  67.8k|xmlParseLookupChar(xmlParserCtxtPtr ctxt, int c) {
10614|  67.8k|    const xmlChar *cur;
10615|       |
10616|  67.8k|    if (ctxt->checkIndex == 0) {
  ------------------
  |  Branch (10616:9): [True: 52.2k, False: 15.6k]
  ------------------
10617|  52.2k|        cur = ctxt->input->cur + 1;
10618|  52.2k|    } else {
10619|  15.6k|        cur = ctxt->input->cur + ctxt->checkIndex;
10620|  15.6k|    }
10621|       |
10622|  67.8k|    if (memchr(cur, c, ctxt->input->end - cur) == NULL) {
  ------------------
  |  Branch (10622:9): [True: 19.4k, False: 48.3k]
  ------------------
10623|  19.4k|        size_t index = ctxt->input->end - ctxt->input->cur;
10624|       |
10625|  19.4k|        if (index > LONG_MAX) {
  ------------------
  |  Branch (10625:13): [True: 0, False: 19.4k]
  ------------------
10626|      0|            ctxt->checkIndex = 0;
10627|      0|            return(1);
10628|      0|        }
10629|  19.4k|        ctxt->checkIndex = index;
10630|  19.4k|        return(0);
10631|  48.3k|    } else {
10632|  48.3k|        ctxt->checkIndex = 0;
10633|  48.3k|        return(1);
10634|  48.3k|    }
10635|  67.8k|}
parser.c:xmlParseLookupCharData:
10685|   102k|xmlParseLookupCharData(xmlParserCtxtPtr ctxt) {
10686|   102k|    const xmlChar *cur = ctxt->input->cur + ctxt->checkIndex;
10687|   102k|    const xmlChar *end = ctxt->input->end;
10688|   102k|    size_t index;
10689|       |
10690|  1.17M|    while (cur < end) {
  ------------------
  |  Branch (10690:12): [True: 1.16M, False: 7.33k]
  ------------------
10691|  1.16M|        if ((*cur == '<') || (*cur == '&')) {
  ------------------
  |  Branch (10691:13): [True: 87.8k, False: 1.07M]
  |  Branch (10691:30): [True: 7.10k, False: 1.06M]
  ------------------
10692|  94.9k|            ctxt->checkIndex = 0;
10693|  94.9k|            return(1);
10694|  94.9k|        }
10695|  1.06M|        cur++;
10696|  1.06M|    }
10697|       |
10698|  7.33k|    index = cur - ctxt->input->cur;
10699|  7.33k|    if (index > LONG_MAX) {
  ------------------
  |  Branch (10699:9): [True: 0, False: 7.33k]
  ------------------
10700|      0|        ctxt->checkIndex = 0;
10701|      0|        return(1);
10702|      0|    }
10703|  7.33k|    ctxt->checkIndex = index;
10704|  7.33k|    return(0);
10705|  7.33k|}
parser.c:nameNsPop:
 2149|  21.5k|{
 2150|  21.5k|    const xmlChar *ret;
 2151|       |
 2152|  21.5k|    if (ctxt->nameNr <= 0)
  ------------------
  |  Branch (2152:9): [True: 0, False: 21.5k]
  ------------------
 2153|      0|        return (NULL);
 2154|  21.5k|    ctxt->nameNr--;
 2155|  21.5k|    if (ctxt->nameNr > 0)
  ------------------
  |  Branch (2155:9): [True: 19.9k, False: 1.65k]
  ------------------
 2156|  19.9k|        ctxt->name = ctxt->nameTab[ctxt->nameNr - 1];
 2157|  1.65k|    else
 2158|  1.65k|        ctxt->name = NULL;
 2159|  21.5k|    ret = ctxt->nameTab[ctxt->nameNr];
 2160|       |    ctxt->nameTab[ctxt->nameNr] = NULL;
 2161|  21.5k|    return (ret);
 2162|  21.5k|}
parser.c:xmlParseLookupInternalSubset:
10757|  43.4k|xmlParseLookupInternalSubset(xmlParserCtxtPtr ctxt) {
10758|       |    /*
10759|       |     * Sorry, but progressive parsing of the internal subset is not
10760|       |     * supported. We first check that the full content of the internal
10761|       |     * subset is available and parsing is launched only at that point.
10762|       |     * Internal subset ends with "']' S? '>'" in an unescaped section and
10763|       |     * not in a ']]>' sequence which are conditional sections.
10764|       |     */
10765|  43.4k|    const xmlChar *cur, *start;
10766|  43.4k|    const xmlChar *end = ctxt->input->end;
10767|  43.4k|    int state = ctxt->endCheckState;
10768|  43.4k|    size_t index;
10769|       |
10770|  43.4k|    if (ctxt->checkIndex == 0) {
  ------------------
  |  Branch (10770:9): [True: 13.2k, False: 30.2k]
  ------------------
10771|  13.2k|        cur = ctxt->input->cur + 1;
10772|  30.2k|    } else {
10773|  30.2k|        cur = ctxt->input->cur + ctxt->checkIndex;
10774|  30.2k|    }
10775|  43.4k|    start = cur;
10776|       |
10777|  26.9M|    while (cur < end) {
  ------------------
  |  Branch (10777:12): [True: 26.9M, False: 34.1k]
  ------------------
10778|  26.9M|        if (state == '-') {
  ------------------
  |  Branch (10778:13): [True: 672k, False: 26.2M]
  ------------------
10779|   672k|            if ((*cur == '-') &&
  ------------------
  |  Branch (10779:17): [True: 24.7k, False: 647k]
  ------------------
10780|  24.7k|                (cur[1] == '-') &&
  ------------------
  |  Branch (10780:17): [True: 20.3k, False: 4.37k]
  ------------------
10781|  20.3k|                (cur[2] == '>')) {
  ------------------
  |  Branch (10781:17): [True: 13.9k, False: 6.45k]
  ------------------
10782|  13.9k|                state = 0;
10783|  13.9k|                cur += 3;
10784|  13.9k|                start = cur;
10785|  13.9k|                continue;
10786|  13.9k|            }
10787|   672k|        }
10788|  26.2M|        else if (state == ']') {
  ------------------
  |  Branch (10788:18): [True: 11.0k, False: 26.2M]
  ------------------
10789|  11.0k|            if (*cur == '>') {
  ------------------
  |  Branch (10789:17): [True: 9.02k, False: 2.03k]
  ------------------
10790|  9.02k|                ctxt->checkIndex = 0;
10791|  9.02k|                ctxt->endCheckState = 0;
10792|  9.02k|                return(1);
10793|  9.02k|            }
10794|  2.03k|            if (IS_BLANK_CH(*cur)) {
  ------------------
  |  |  137|  2.03k|#define IS_BLANK_CH(c)  xmlIsBlank_ch(c)
  |  |  ------------------
  |  |  |  |   90|  2.03k|#define xmlIsBlank_ch(c)	(((c) == 0x20) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (90:27): [True: 244, False: 1.78k]
  |  |  |  |  ------------------
  |  |  |  |   91|  2.03k|				 ((0x9 <= (c)) && ((c) <= 0xa)) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (91:7): [True: 1.58k, False: 202]
  |  |  |  |  |  Branch (91:23): [True: 470, False: 1.11k]
  |  |  |  |  ------------------
  |  |  |  |   92|  2.03k|				 ((c) == 0xd))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (92:6): [True: 458, False: 859]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
10795|  1.17k|                state = ' ';
10796|  1.17k|            } else if (*cur != ']') {
  ------------------
  |  Branch (10796:24): [True: 557, False: 302]
  ------------------
10797|    557|                state = 0;
10798|    557|                start = cur;
10799|    557|                continue;
10800|    557|            }
10801|  2.03k|        }
10802|  26.2M|        else if (state == ' ') {
  ------------------
  |  Branch (10802:18): [True: 1.91k, False: 26.2M]
  ------------------
10803|  1.91k|            if (*cur == '>') {
  ------------------
  |  Branch (10803:17): [True: 250, False: 1.66k]
  ------------------
10804|    250|                ctxt->checkIndex = 0;
10805|    250|                ctxt->endCheckState = 0;
10806|    250|                return(1);
10807|    250|            }
10808|  1.66k|            if (!IS_BLANK_CH(*cur)) {
  ------------------
  |  |  137|  1.66k|#define IS_BLANK_CH(c)  xmlIsBlank_ch(c)
  |  |  ------------------
  |  |  |  |   90|  1.66k|#define xmlIsBlank_ch(c)	(((c) == 0x20) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (90:27): [True: 206, False: 1.45k]
  |  |  |  |  ------------------
  |  |  |  |   91|  1.66k|				 ((0x9 <= (c)) && ((c) <= 0xa)) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (91:7): [True: 1.21k, False: 241]
  |  |  |  |  |  Branch (91:23): [True: 293, False: 923]
  |  |  |  |  ------------------
  |  |  |  |   92|  1.66k|				 ((c) == 0xd))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (92:6): [True: 245, False: 919]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
10809|    919|                state = 0;
10810|    919|                start = cur;
10811|    919|                continue;
10812|    919|            }
10813|  1.66k|        }
10814|  26.2M|        else if (state != 0) {
  ------------------
  |  Branch (10814:18): [True: 20.7M, False: 5.52M]
  ------------------
10815|  20.7M|            if (*cur == state) {
  ------------------
  |  Branch (10815:17): [True: 39.0k, False: 20.7M]
  ------------------
10816|  39.0k|                state = 0;
10817|  39.0k|                start = cur + 1;
10818|  39.0k|            }
10819|  20.7M|        }
10820|  5.52M|        else if (*cur == '<') {
  ------------------
  |  Branch (10820:18): [True: 63.2k, False: 5.46M]
  ------------------
10821|  63.2k|            if ((cur[1] == '!') &&
  ------------------
  |  Branch (10821:17): [True: 47.2k, False: 16.0k]
  ------------------
10822|  47.2k|                (cur[2] == '-') &&
  ------------------
  |  Branch (10822:17): [True: 14.2k, False: 32.9k]
  ------------------
10823|  14.2k|                (cur[3] == '-')) {
  ------------------
  |  Branch (10823:17): [True: 13.9k, False: 279]
  ------------------
10824|  13.9k|                state = '-';
10825|  13.9k|                cur += 4;
10826|       |                /* Don't treat <!--> as comment */
10827|  13.9k|                start = cur;
10828|  13.9k|                continue;
10829|  13.9k|            }
10830|  63.2k|        }
10831|  5.46M|        else if ((*cur == '"') || (*cur == '\'') || (*cur == ']')) {
  ------------------
  |  Branch (10831:18): [True: 25.0k, False: 5.43M]
  |  Branch (10831:35): [True: 14.5k, False: 5.42M]
  |  Branch (10831:53): [True: 10.7k, False: 5.41M]
  ------------------
10832|  50.3k|            state = *cur;
10833|  50.3k|        }
10834|       |
10835|  26.9M|        cur++;
10836|  26.9M|    }
10837|       |
10838|       |    /*
10839|       |     * Rescan the three last characters to detect "<!--" and "-->"
10840|       |     * split across chunks.
10841|       |     */
10842|  34.1k|    if ((state == 0) || (state == '-')) {
  ------------------
  |  Branch (10842:9): [True: 6.72k, False: 27.4k]
  |  Branch (10842:25): [True: 1.41k, False: 26.0k]
  ------------------
10843|  8.14k|        if (cur - start < 3)
  ------------------
  |  Branch (10843:13): [True: 587, False: 7.55k]
  ------------------
10844|    587|            cur = start;
10845|  7.55k|        else
10846|  7.55k|            cur -= 3;
10847|  8.14k|    }
10848|  34.1k|    index = cur - ctxt->input->cur;
10849|  34.1k|    if (index > LONG_MAX) {
  ------------------
  |  Branch (10849:9): [True: 0, False: 34.1k]
  ------------------
10850|      0|        ctxt->checkIndex = 0;
10851|      0|        ctxt->endCheckState = 0;
10852|      0|        return(1);
10853|      0|    }
10854|  34.1k|    ctxt->checkIndex = index;
10855|  34.1k|    ctxt->endCheckState = state;
10856|  34.1k|    return(0);
10857|  34.1k|}
parser.c:xmlCtxtParseEntity:
11796|  8.96k|xmlCtxtParseEntity(xmlParserCtxtPtr ctxt, xmlEntityPtr ent) {
11797|  8.96k|    xmlParserInputPtr input;
11798|  8.96k|    xmlNodePtr list;
11799|  8.96k|    unsigned long consumed;
11800|  8.96k|    int isExternal;
11801|  8.96k|    int buildTree;
11802|  8.96k|    int oldMinNsIndex;
11803|  8.96k|    int oldNodelen, oldNodemem;
11804|       |
11805|  8.96k|    isExternal = (ent->etype == XML_EXTERNAL_GENERAL_PARSED_ENTITY);
11806|  8.96k|    buildTree = (ctxt->node != NULL);
11807|       |
11808|       |    /*
11809|       |     * Recursion check
11810|       |     */
11811|  8.96k|    if (ent->flags & XML_ENT_EXPANDING) {
  ------------------
  |  |   22|  8.96k|#define XML_ENT_EXPANDING   (1u << 3)
  ------------------
  |  Branch (11811:9): [True: 7, False: 8.95k]
  ------------------
11812|      7|        xmlFatalErr(ctxt, XML_ERR_ENTITY_LOOP, NULL);
11813|      7|        goto error;
11814|      7|    }
11815|       |
11816|       |    /*
11817|       |     * Load entity
11818|       |     */
11819|  8.95k|    input = xmlNewEntityInputStream(ctxt, ent);
11820|  8.95k|    if (input == NULL)
  ------------------
  |  Branch (11820:9): [True: 2.29k, False: 6.65k]
  ------------------
11821|  2.29k|        goto error;
11822|       |
11823|       |    /*
11824|       |     * When building a tree, we need to limit the scope of namespace
11825|       |     * declarations, so that entities don't reference xmlNs structs
11826|       |     * from the parent of a reference.
11827|       |     */
11828|  6.65k|    oldMinNsIndex = ctxt->nsdb->minNsIndex;
11829|  6.65k|    if (buildTree)
  ------------------
  |  Branch (11829:9): [True: 6.65k, False: 0]
  ------------------
11830|  6.65k|        ctxt->nsdb->minNsIndex = ctxt->nsNr;
11831|       |
11832|  6.65k|    oldNodelen = ctxt->nodelen;
11833|  6.65k|    oldNodemem = ctxt->nodemem;
11834|  6.65k|    ctxt->nodelen = 0;
11835|  6.65k|    ctxt->nodemem = 0;
11836|       |
11837|       |    /*
11838|       |     * Parse content
11839|       |     *
11840|       |     * This initiates a recursive call chain:
11841|       |     *
11842|       |     * - xmlCtxtParseContentInternal
11843|       |     * - xmlParseContentInternal
11844|       |     * - xmlParseReference
11845|       |     * - xmlCtxtParseEntity
11846|       |     *
11847|       |     * The nesting depth is limited by the maximum number of inputs,
11848|       |     * see xmlCtxtPushInput.
11849|       |     *
11850|       |     * It's possible to make this non-recursive (minNsIndex must be
11851|       |     * stored in the input struct) at the expense of code readability.
11852|       |     */
11853|       |
11854|  6.65k|    ent->flags |= XML_ENT_EXPANDING;
  ------------------
  |  |   22|  6.65k|#define XML_ENT_EXPANDING   (1u << 3)
  ------------------
11855|       |
11856|  6.65k|    list = xmlCtxtParseContentInternal(ctxt, input, isExternal, buildTree);
11857|       |
11858|  6.65k|    ent->flags &= ~XML_ENT_EXPANDING;
  ------------------
  |  |   22|  6.65k|#define XML_ENT_EXPANDING   (1u << 3)
  ------------------
11859|       |
11860|  6.65k|    ctxt->nsdb->minNsIndex = oldMinNsIndex;
11861|  6.65k|    ctxt->nodelen = oldNodelen;
11862|  6.65k|    ctxt->nodemem = oldNodemem;
11863|       |
11864|       |    /*
11865|       |     * Entity size accounting
11866|       |     */
11867|  6.65k|    consumed = input->consumed;
11868|  6.65k|    xmlSaturatedAddSizeT(&consumed, input->end - input->base);
11869|       |
11870|  6.65k|    if ((ent->flags & XML_ENT_CHECKED) == 0)
  ------------------
  |  |   20|  6.65k|#define XML_ENT_CHECKED     (1u << 1)
  ------------------
  |  Branch (11870:9): [True: 4.00k, False: 2.65k]
  ------------------
11871|  4.00k|        xmlSaturatedAdd(&ent->expandedSize, consumed);
11872|       |
11873|  6.65k|    if ((ent->flags & XML_ENT_PARSED) == 0) {
  ------------------
  |  |   19|  6.65k|#define XML_ENT_PARSED      (1u << 0)
  ------------------
  |  Branch (11873:9): [True: 4.00k, False: 2.65k]
  ------------------
11874|  4.00k|        if (isExternal)
  ------------------
  |  Branch (11874:13): [True: 1.86k, False: 2.13k]
  ------------------
11875|  1.86k|            xmlSaturatedAdd(&ctxt->sizeentities, consumed);
11876|       |
11877|  4.00k|        ent->children = list;
11878|       |
11879|  57.7k|        while (list != NULL) {
  ------------------
  |  Branch (11879:16): [True: 53.7k, False: 4.00k]
  ------------------
11880|  53.7k|            list->parent = (xmlNodePtr) ent;
11881|       |
11882|       |            /*
11883|       |             * Downstream code like the nginx xslt module can set
11884|       |             * ctxt->myDoc->extSubset to a separate DTD, so the entity
11885|       |             * might have a different or a NULL document.
11886|       |             */
11887|  53.7k|            if (list->doc != ent->doc)
  ------------------
  |  Branch (11887:17): [True: 0, False: 53.7k]
  ------------------
11888|      0|                xmlSetTreeDoc(list, ent->doc);
11889|       |
11890|  53.7k|            if (list->next == NULL)
  ------------------
  |  Branch (11890:17): [True: 2.89k, False: 50.8k]
  ------------------
11891|  2.89k|                ent->last = list;
11892|  53.7k|            list = list->next;
11893|  53.7k|        }
11894|  4.00k|    } else {
11895|  2.65k|        xmlFreeNodeList(list);
11896|  2.65k|    }
11897|       |
11898|  6.65k|    xmlFreeInputStream(input);
11899|       |
11900|  8.96k|error:
11901|  8.96k|    ent->flags |= XML_ENT_PARSED | XML_ENT_CHECKED;
  ------------------
  |  |   19|  8.96k|#define XML_ENT_PARSED      (1u << 0)
  ------------------
                  ent->flags |= XML_ENT_PARSED | XML_ENT_CHECKED;
  ------------------
  |  |   20|  8.96k|#define XML_ENT_CHECKED     (1u << 1)
  ------------------
11902|  8.96k|}
parser.c:xmlCtxtParseContentInternal:
11706|  6.65k|                            int hasTextDecl, int buildTree) {
11707|  6.65k|    xmlNodePtr root = NULL;
11708|  6.65k|    xmlNodePtr list = NULL;
11709|  6.65k|    xmlChar *rootName = BAD_CAST "#root";
  ------------------
  |  |   34|  6.65k|#define BAD_CAST (xmlChar *)
  ------------------
11710|  6.65k|    int result;
11711|       |
11712|  6.65k|    if (buildTree) {
  ------------------
  |  Branch (11712:9): [True: 6.65k, False: 0]
  ------------------
11713|  6.65k|        root = xmlNewDocNode(ctxt->myDoc, NULL, rootName, NULL);
11714|  6.65k|        if (root == NULL) {
  ------------------
  |  Branch (11714:13): [True: 1, False: 6.65k]
  ------------------
11715|      1|            xmlErrMemory(ctxt);
11716|      1|            goto error;
11717|      1|        }
11718|  6.65k|    }
11719|       |
11720|  6.65k|    if (xmlCtxtPushInput(ctxt, input) < 0)
  ------------------
  |  Branch (11720:9): [True: 3, False: 6.65k]
  ------------------
11721|      3|        goto error;
11722|       |
11723|  6.65k|    nameNsPush(ctxt, rootName, NULL, NULL, 0, 0);
11724|  6.65k|    spacePush(ctxt, -1);
11725|       |
11726|  6.65k|    if (buildTree)
  ------------------
  |  Branch (11726:9): [True: 6.65k, False: 0]
  ------------------
11727|  6.65k|        nodePush(ctxt, root);
11728|       |
11729|  6.65k|    if (hasTextDecl) {
  ------------------
  |  Branch (11729:9): [True: 2.40k, False: 4.25k]
  ------------------
11730|  2.40k|        xmlDetectEncoding(ctxt);
11731|       |
11732|       |        /*
11733|       |         * Parse a possible text declaration first
11734|       |         */
11735|  2.40k|        if ((CMP5(CUR_PTR, '<', '?', 'x', 'm', 'l')) &&
  ------------------
  |  | 2271|  2.40k|  ( CMP4( s, c1, c2, c3, c4 ) && ((unsigned char *) s)[ 4 ] == c5 )
  |  |  ------------------
  |  |  |  | 2268|  4.80k|  ( ((unsigned char *) s)[ 0 ] == c1 && ((unsigned char *) s)[ 1 ] == c2 && \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2268:5): [True: 1.43k, False: 969]
  |  |  |  |  |  Branch (2268:41): [True: 428, False: 1.00k]
  |  |  |  |  ------------------
  |  |  |  | 2269|  2.40k|    ((unsigned char *) s)[ 2 ] == c3 && ((unsigned char *) s)[ 3 ] == c4 )
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2269:5): [True: 382, False: 46]
  |  |  |  |  |  Branch (2269:41): [True: 379, False: 3]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2271:34): [True: 374, False: 5]
  |  |  ------------------
  ------------------
11736|    374|            (IS_BLANK_CH(NXT(5)))) {
  ------------------
  |  |  137|    374|#define IS_BLANK_CH(c)  xmlIsBlank_ch(c)
  |  |  ------------------
  |  |  |  |   90|    374|#define xmlIsBlank_ch(c)	(((c) == 0x20) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (90:27): [True: 257, False: 117]
  |  |  |  |  ------------------
  |  |  |  |   91|    374|				 ((0x9 <= (c)) && ((c) <= 0xa)) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (91:7): [True: 116, False: 1]
  |  |  |  |  |  Branch (91:23): [True: 97, False: 19]
  |  |  |  |  ------------------
  |  |  |  |   92|    374|				 ((c) == 0xd))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (92:6): [True: 18, False: 2]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
11737|    372|            xmlParseTextDecl(ctxt);
11738|       |            /*
11739|       |             * An XML-1.0 document can't reference an entity not XML-1.0
11740|       |             */
11741|    372|            if ((xmlStrEqual(ctxt->version, BAD_CAST "1.0")) &&
  ------------------
  |  |   34|    372|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (11741:17): [True: 364, False: 8]
  ------------------
11742|    364|                (!xmlStrEqual(ctxt->input->version, BAD_CAST "1.0"))) {
  ------------------
  |  |   34|    364|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (11742:17): [True: 98, False: 266]
  ------------------
11743|     98|                xmlFatalErrMsg(ctxt, XML_ERR_VERSION_MISMATCH,
11744|     98|                               "Version mismatch between document and "
11745|     98|                               "entity\n");
11746|     98|            }
11747|    372|        }
11748|  2.40k|    }
11749|       |
11750|  6.65k|    xmlParseContentInternal(ctxt);
11751|       |
11752|  6.65k|    if (ctxt->input->cur < ctxt->input->end)
  ------------------
  |  Branch (11752:9): [True: 380, False: 6.27k]
  ------------------
11753|    380|	xmlFatalErr(ctxt, XML_ERR_NOT_WELL_BALANCED, NULL);
11754|       |
11755|  6.65k|    if ((ctxt->wellFormed) ||
  ------------------
  |  Branch (11755:9): [True: 4.69k, False: 1.95k]
  ------------------
11756|  5.72k|        ((ctxt->recovery) && (!xmlCtxtIsCatastrophicError(ctxt)))) {
  ------------------
  |  Branch (11756:10): [True: 1.22k, False: 735]
  |  Branch (11756:30): [True: 1.02k, False: 192]
  ------------------
11757|  5.72k|        if (root != NULL) {
  ------------------
  |  Branch (11757:13): [True: 5.72k, False: 0]
  ------------------
11758|  5.72k|            xmlNodePtr cur;
11759|       |
11760|       |            /*
11761|       |             * Unlink newly created node list.
11762|       |             */
11763|  5.72k|            list = root->children;
11764|  5.72k|            root->children = NULL;
11765|  5.72k|            root->last = NULL;
11766|  65.0k|            for (cur = list; cur != NULL; cur = cur->next)
  ------------------
  |  Branch (11766:30): [True: 59.2k, False: 5.72k]
  ------------------
11767|  59.2k|                cur->parent = NULL;
11768|  5.72k|        }
11769|  5.72k|    }
11770|       |
11771|       |    /*
11772|       |     * Read the rest of the stream in case of errors. We want
11773|       |     * to account for the whole entity size.
11774|       |     */
11775|  6.99k|    do {
11776|  6.99k|        ctxt->input->cur = ctxt->input->end;
11777|  6.99k|        xmlParserShrink(ctxt);
11778|  6.99k|        result = xmlParserGrow(ctxt);
11779|  6.99k|    } while (result > 0);
  ------------------
  |  Branch (11779:14): [True: 339, False: 6.65k]
  ------------------
11780|       |
11781|  6.65k|    if (buildTree)
  ------------------
  |  Branch (11781:9): [True: 6.65k, False: 0]
  ------------------
11782|  6.65k|        nodePop(ctxt);
11783|       |
11784|  6.65k|    namePop(ctxt);
11785|  6.65k|    spacePop(ctxt);
11786|       |
11787|  6.65k|    xmlCtxtPopInput(ctxt);
11788|       |
11789|  6.65k|error:
11790|  6.65k|    xmlFreeNode(root);
11791|       |
11792|  6.65k|    return(list);
11793|  6.65k|}
parser.c:xmlParserNsPush:
 1703|   359k|                const xmlHashedString *uri, void *saxData, int defAttr) {
 1704|   359k|    xmlParserNsBucket *bucket = NULL;
 1705|   359k|    xmlParserNsExtra *extra;
 1706|   359k|    const xmlChar **ns;
 1707|   359k|    unsigned hashValue, nsIndex, oldIndex;
 1708|       |
 1709|   359k|    if ((prefix != NULL) && (prefix->name == ctxt->str_xml))
  ------------------
  |  Branch (1709:9): [True: 308k, False: 51.2k]
  |  Branch (1709:29): [True: 195, False: 307k]
  ------------------
 1710|    195|        return(0);
 1711|       |
 1712|   359k|    if ((ctxt->nsNr >= ctxt->nsMax) && (xmlParserNsGrow(ctxt) < 0)) {
  ------------------
  |  Branch (1712:9): [True: 18.3k, False: 340k]
  |  Branch (1712:40): [True: 23, False: 18.3k]
  ------------------
 1713|     23|        xmlErrMemory(ctxt);
 1714|     23|        return(-1);
 1715|     23|    }
 1716|       |
 1717|       |    /*
 1718|       |     * Default namespace and 'xml' namespace
 1719|       |     */
 1720|   359k|    if ((prefix == NULL) || (prefix->name == NULL)) {
  ------------------
  |  Branch (1720:9): [True: 51.2k, False: 307k]
  |  Branch (1720:29): [True: 0, False: 307k]
  ------------------
 1721|  51.2k|        oldIndex = ctxt->nsdb->defaultNsIndex;
 1722|       |
 1723|  51.2k|        if (oldIndex != INT_MAX) {
  ------------------
  |  Branch (1723:13): [True: 48.2k, False: 2.99k]
  ------------------
 1724|  48.2k|            extra = &ctxt->nsdb->extra[oldIndex];
 1725|       |
 1726|  48.2k|            if (extra->elementId == ctxt->nsdb->elementId) {
  ------------------
  |  Branch (1726:17): [True: 923, False: 47.3k]
  ------------------
 1727|    923|                if (defAttr == 0)
  ------------------
  |  Branch (1727:21): [True: 398, False: 525]
  ------------------
 1728|    398|                    xmlErrAttributeDup(ctxt, NULL, BAD_CAST "xmlns");
  ------------------
  |  |   34|    398|#define BAD_CAST (xmlChar *)
  ------------------
 1729|    923|                return(0);
 1730|    923|            }
 1731|       |
 1732|  47.3k|            if ((ctxt->options & XML_PARSE_NSCLEAN) &&
  ------------------
  |  Branch (1732:17): [True: 9.40k, False: 37.9k]
  ------------------
 1733|  9.40k|                (uri->name == ctxt->nsTab[oldIndex * 2 + 1]))
  ------------------
  |  Branch (1733:17): [True: 7.99k, False: 1.40k]
  ------------------
 1734|  7.99k|                return(0);
 1735|  47.3k|        }
 1736|       |
 1737|  42.3k|        ctxt->nsdb->defaultNsIndex = ctxt->nsNr;
 1738|  42.3k|        goto populate_entry;
 1739|  51.2k|    }
 1740|       |
 1741|       |    /*
 1742|       |     * Hash table lookup
 1743|       |     */
 1744|   307k|    oldIndex = xmlParserNsLookup(ctxt, prefix, &bucket);
 1745|   307k|    if (oldIndex != INT_MAX) {
  ------------------
  |  Branch (1745:9): [True: 231k, False: 76.6k]
  ------------------
 1746|   231k|        extra = &ctxt->nsdb->extra[oldIndex];
 1747|       |
 1748|       |        /*
 1749|       |         * Check for duplicate definitions on the same element.
 1750|       |         */
 1751|   231k|        if (extra->elementId == ctxt->nsdb->elementId) {
  ------------------
  |  Branch (1751:13): [True: 1.30k, False: 230k]
  ------------------
 1752|  1.30k|            if (defAttr == 0)
  ------------------
  |  Branch (1752:17): [True: 1.10k, False: 197]
  ------------------
 1753|  1.10k|                xmlErrAttributeDup(ctxt, BAD_CAST "xmlns", prefix->name);
  ------------------
  |  |   34|  1.10k|#define BAD_CAST (xmlChar *)
  ------------------
 1754|  1.30k|            return(0);
 1755|  1.30k|        }
 1756|       |
 1757|   230k|        if ((ctxt->options & XML_PARSE_NSCLEAN) &&
  ------------------
  |  Branch (1757:13): [True: 29.4k, False: 200k]
  ------------------
 1758|  29.4k|            (uri->name == ctxt->nsTab[bucket->index * 2 + 1]))
  ------------------
  |  Branch (1758:13): [True: 28.5k, False: 961]
  ------------------
 1759|  28.5k|            return(0);
 1760|       |
 1761|   201k|        bucket->index = ctxt->nsNr;
 1762|   201k|        goto populate_entry;
 1763|   230k|    }
 1764|       |
 1765|       |    /*
 1766|       |     * Insert new bucket
 1767|       |     */
 1768|       |
 1769|  76.6k|    hashValue = prefix->hashValue;
 1770|       |
 1771|       |    /*
 1772|       |     * Grow hash table, 50% fill factor
 1773|       |     */
 1774|  76.6k|    if (ctxt->nsdb->hashElems + 1 > ctxt->nsdb->hashSize / 2) {
  ------------------
  |  Branch (1774:9): [True: 10.3k, False: 66.3k]
  ------------------
 1775|  10.3k|        xmlParserNsBucket *newHash;
 1776|  10.3k|        unsigned newSize, i, index;
 1777|       |
 1778|  10.3k|        if (ctxt->nsdb->hashSize > UINT_MAX / 2) {
  ------------------
  |  Branch (1778:13): [True: 0, False: 10.3k]
  ------------------
 1779|      0|            xmlErrMemory(ctxt);
 1780|      0|            return(-1);
 1781|      0|        }
 1782|  10.3k|        newSize = ctxt->nsdb->hashSize ? ctxt->nsdb->hashSize * 2 : 16;
  ------------------
  |  Branch (1782:19): [True: 726, False: 9.58k]
  ------------------
 1783|  10.3k|        newHash = xmlMalloc(newSize * sizeof(newHash[0]));
 1784|  10.3k|        if (newHash == NULL) {
  ------------------
  |  Branch (1784:13): [True: 6, False: 10.3k]
  ------------------
 1785|      6|            xmlErrMemory(ctxt);
 1786|      6|            return(-1);
 1787|      6|        }
 1788|  10.3k|        memset(newHash, 0, newSize * sizeof(newHash[0]));
 1789|       |
 1790|   187k|        for (i = 0; i < ctxt->nsdb->hashSize; i++) {
  ------------------
  |  Branch (1790:21): [True: 177k, False: 10.3k]
  ------------------
 1791|   177k|            unsigned hv = ctxt->nsdb->hash[i].hashValue;
 1792|   177k|            unsigned newIndex;
 1793|       |
 1794|   177k|            if ((hv == 0) || (ctxt->nsdb->hash[i].index == INT_MAX))
  ------------------
  |  Branch (1794:17): [True: 174k, False: 3.16k]
  |  Branch (1794:30): [True: 1.21k, False: 1.95k]
  ------------------
 1795|   175k|                continue;
 1796|  1.95k|            newIndex = hv & (newSize - 1);
 1797|       |
 1798|  3.17k|            while (newHash[newIndex].hashValue != 0) {
  ------------------
  |  Branch (1798:20): [True: 1.22k, False: 1.95k]
  ------------------
 1799|  1.22k|                newIndex++;
 1800|  1.22k|                if (newIndex == newSize)
  ------------------
  |  Branch (1800:21): [True: 213, False: 1.01k]
  ------------------
 1801|    213|                    newIndex = 0;
 1802|  1.22k|            }
 1803|       |
 1804|  1.95k|            newHash[newIndex] = ctxt->nsdb->hash[i];
 1805|  1.95k|        }
 1806|       |
 1807|  10.3k|        xmlFree(ctxt->nsdb->hash);
 1808|  10.3k|        ctxt->nsdb->hash = newHash;
 1809|  10.3k|        ctxt->nsdb->hashSize = newSize;
 1810|       |
 1811|       |        /*
 1812|       |         * Relookup
 1813|       |         */
 1814|  10.3k|        index = hashValue & (newSize - 1);
 1815|       |
 1816|  10.6k|        while (newHash[index].hashValue != 0) {
  ------------------
  |  Branch (1816:16): [True: 389, False: 10.3k]
  ------------------
 1817|    389|            index++;
 1818|    389|            if (index == newSize)
  ------------------
  |  Branch (1818:17): [True: 53, False: 336]
  ------------------
 1819|     53|                index = 0;
 1820|    389|        }
 1821|       |
 1822|  10.3k|        bucket = &newHash[index];
 1823|  10.3k|    }
 1824|       |
 1825|  76.6k|    bucket->hashValue = hashValue;
 1826|  76.6k|    bucket->index = ctxt->nsNr;
 1827|  76.6k|    ctxt->nsdb->hashElems++;
 1828|  76.6k|    oldIndex = INT_MAX;
 1829|       |
 1830|   320k|populate_entry:
 1831|   320k|    nsIndex = ctxt->nsNr;
 1832|       |
 1833|   320k|    ns = &ctxt->nsTab[nsIndex * 2];
 1834|   320k|    ns[0] = prefix ? prefix->name : NULL;
  ------------------
  |  Branch (1834:13): [True: 278k, False: 42.3k]
  ------------------
 1835|   320k|    ns[1] = uri->name;
 1836|       |
 1837|   320k|    extra = &ctxt->nsdb->extra[nsIndex];
 1838|   320k|    extra->saxData = saxData;
 1839|   320k|    extra->prefixHashValue = prefix ? prefix->hashValue : 0;
  ------------------
  |  Branch (1839:30): [True: 278k, False: 42.3k]
  ------------------
 1840|   320k|    extra->uriHashValue = uri->hashValue;
 1841|   320k|    extra->elementId = ctxt->nsdb->elementId;
 1842|   320k|    extra->oldIndex = oldIndex;
 1843|       |
 1844|   320k|    ctxt->nsNr++;
 1845|       |
 1846|   320k|    return(1);
 1847|  76.6k|}
parser.c:xmlParserNsGrow:
 1661|  18.3k|xmlParserNsGrow(xmlParserCtxtPtr ctxt) {
 1662|  18.3k|    const xmlChar **table;
 1663|  18.3k|    xmlParserNsExtra *extra;
 1664|  18.3k|    int newSize;
 1665|       |
 1666|  18.3k|    newSize = xmlGrowCapacity(ctxt->nsMax,
 1667|  18.3k|                              sizeof(table[0]) + sizeof(extra[0]),
 1668|  18.3k|                              16, XML_MAX_ITEMS);
  ------------------
  |  |   13|  18.3k|#define XML_MAX_ITEMS 1000000000 /* 1 billion */
  ------------------
 1669|  18.3k|    if (newSize < 0)
  ------------------
  |  Branch (1669:9): [True: 0, False: 18.3k]
  ------------------
 1670|      0|        goto error;
 1671|       |
 1672|  18.3k|    table = xmlRealloc(ctxt->nsTab, 2 * newSize * sizeof(table[0]));
 1673|  18.3k|    if (table == NULL)
  ------------------
  |  Branch (1673:9): [True: 7, False: 18.3k]
  ------------------
 1674|      7|        goto error;
 1675|  18.3k|    ctxt->nsTab = table;
 1676|       |
 1677|  18.3k|    extra = xmlRealloc(ctxt->nsdb->extra, newSize * sizeof(extra[0]));
 1678|  18.3k|    if (extra == NULL)
  ------------------
  |  Branch (1678:9): [True: 16, False: 18.3k]
  ------------------
 1679|     16|        goto error;
 1680|  18.3k|    ctxt->nsdb->extra = extra;
 1681|       |
 1682|  18.3k|    ctxt->nsMax = newSize;
 1683|  18.3k|    return(0);
 1684|       |
 1685|     23|error:
 1686|     23|    xmlErrMemory(ctxt);
 1687|     23|    return(-1);
 1688|  18.3k|}
parser.c:xmlParserNsPop:
 1858|  96.8k|{
 1859|  96.8k|    int i;
 1860|       |
 1861|       |    /* assert(nr <= ctxt->nsNr); */
 1862|       |
 1863|   313k|    for (i = ctxt->nsNr - 1; i >= ctxt->nsNr - nr; i--) {
  ------------------
  |  Branch (1863:30): [True: 216k, False: 96.8k]
  ------------------
 1864|   216k|        const xmlChar *prefix = ctxt->nsTab[i * 2];
 1865|   216k|        xmlParserNsExtra *extra = &ctxt->nsdb->extra[i];
 1866|       |
 1867|   216k|        if (prefix == NULL) {
  ------------------
  |  Branch (1867:13): [True: 18.4k, False: 198k]
  ------------------
 1868|  18.4k|            ctxt->nsdb->defaultNsIndex = extra->oldIndex;
 1869|   198k|        } else {
 1870|   198k|            xmlHashedString hprefix;
 1871|   198k|            xmlParserNsBucket *bucket = NULL;
 1872|       |
 1873|   198k|            hprefix.name = prefix;
 1874|   198k|            hprefix.hashValue = extra->prefixHashValue;
 1875|   198k|            xmlParserNsLookup(ctxt, &hprefix, &bucket);
 1876|       |            /* assert(bucket && bucket->hashValue); */
 1877|   198k|            bucket->index = extra->oldIndex;
 1878|   198k|        }
 1879|   216k|    }
 1880|       |
 1881|  96.8k|    ctxt->nsNr -= nr;
 1882|  96.8k|    return(nr);
 1883|  96.8k|}
parser.c:xmlCtxtSetOptionsInternal:
13169|  53.7k|{
13170|  53.7k|    int allMask;
13171|       |
13172|  53.7k|    if (ctxt == NULL)
  ------------------
  |  Branch (13172:9): [True: 0, False: 53.7k]
  ------------------
13173|      0|        return(-1);
13174|       |
13175|       |    /*
13176|       |     * XInclude options aren't handled by the parser.
13177|       |     *
13178|       |     * XML_PARSE_XINCLUDE
13179|       |     * XML_PARSE_NOXINCNODE
13180|       |     * XML_PARSE_NOBASEFIX
13181|       |     */
13182|  53.7k|    allMask = XML_PARSE_RECOVER |
13183|  53.7k|              XML_PARSE_NOENT |
13184|  53.7k|              XML_PARSE_DTDLOAD |
13185|  53.7k|              XML_PARSE_DTDATTR |
13186|  53.7k|              XML_PARSE_DTDVALID |
13187|  53.7k|              XML_PARSE_NOERROR |
13188|  53.7k|              XML_PARSE_NOWARNING |
13189|  53.7k|              XML_PARSE_PEDANTIC |
13190|  53.7k|              XML_PARSE_NOBLANKS |
13191|  53.7k|#ifdef LIBXML_SAX1_ENABLED
13192|  53.7k|              XML_PARSE_SAX1 |
13193|  53.7k|#endif
13194|  53.7k|              XML_PARSE_NONET |
13195|  53.7k|              XML_PARSE_NODICT |
13196|  53.7k|              XML_PARSE_NSCLEAN |
13197|  53.7k|              XML_PARSE_NOCDATA |
13198|  53.7k|              XML_PARSE_COMPACT |
13199|  53.7k|              XML_PARSE_OLD10 |
13200|  53.7k|              XML_PARSE_HUGE |
13201|  53.7k|              XML_PARSE_OLDSAX |
13202|  53.7k|              XML_PARSE_IGNORE_ENC |
13203|  53.7k|              XML_PARSE_BIG_LINES |
13204|  53.7k|              XML_PARSE_NO_XXE |
13205|  53.7k|              XML_PARSE_UNZIP |
13206|  53.7k|              XML_PARSE_NO_SYS_CATALOG |
13207|  53.7k|              XML_PARSE_CATALOG_PI;
13208|       |
13209|  53.7k|    ctxt->options = (ctxt->options & keepMask) | (options & allMask);
13210|       |
13211|       |    /*
13212|       |     * For some options, struct members are historically the source
13213|       |     * of truth. The values are initalized from global variables and
13214|       |     * old code could also modify them directly. Several older API
13215|       |     * functions that don't take an options argument rely on these
13216|       |     * deprecated mechanisms.
13217|       |     *
13218|       |     * Once public access to struct members and the globals are
13219|       |     * disabled, we can use the options bitmask as source of
13220|       |     * truth, making all these struct members obsolete.
13221|       |     *
13222|       |     * The XML_DETECT_IDS flags is misnamed. It simply enables
13223|       |     * loading of the external subset.
13224|       |     */
13225|  53.7k|    ctxt->recovery = (options & XML_PARSE_RECOVER) ? 1 : 0;
  ------------------
  |  Branch (13225:22): [True: 27.2k, False: 26.4k]
  ------------------
13226|  53.7k|    ctxt->replaceEntities = (options & XML_PARSE_NOENT) ? 1 : 0;
  ------------------
  |  Branch (13226:29): [True: 27.1k, False: 26.6k]
  ------------------
13227|  53.7k|    ctxt->loadsubset = (options & XML_PARSE_DTDLOAD) ? XML_DETECT_IDS : 0;
  ------------------
  |  |  208|  29.6k|#define XML_DETECT_IDS		2
  ------------------
  |  Branch (13227:24): [True: 29.6k, False: 24.0k]
  ------------------
13228|  53.7k|    ctxt->loadsubset |= (options & XML_PARSE_DTDATTR) ? XML_COMPLETE_ATTRS : 0;
  ------------------
  |  |  209|  26.3k|#define XML_COMPLETE_ATTRS	4
  ------------------
  |  Branch (13228:25): [True: 26.3k, False: 27.4k]
  ------------------
13229|  53.7k|    ctxt->loadsubset |= (options & XML_PARSE_SKIP_IDS) ? XML_SKIP_IDS : 0;
  ------------------
  |  |  210|  25.8k|#define XML_SKIP_IDS		8
  ------------------
  |  Branch (13229:25): [True: 25.8k, False: 27.9k]
  ------------------
13230|  53.7k|    ctxt->validate = (options & XML_PARSE_DTDVALID) ? 1 : 0;
  ------------------
  |  Branch (13230:22): [True: 25.7k, False: 28.0k]
  ------------------
13231|  53.7k|    ctxt->pedantic = (options & XML_PARSE_PEDANTIC) ? 1 : 0;
  ------------------
  |  Branch (13231:22): [True: 12.3k, False: 41.4k]
  ------------------
13232|  53.7k|    ctxt->keepBlanks = (options & XML_PARSE_NOBLANKS) ? 0 : 1;
  ------------------
  |  Branch (13232:24): [True: 24.8k, False: 28.8k]
  ------------------
13233|  53.7k|    ctxt->dictNames = (options & XML_PARSE_NODICT) ? 0 : 1;
  ------------------
  |  Branch (13233:23): [True: 22.3k, False: 31.4k]
  ------------------
13234|       |
13235|  53.7k|    return(options & ~allMask);
13236|  53.7k|}

xmlCtxtSetErrorHandler:
  122|  53.7k|{
  123|  53.7k|    if (ctxt == NULL)
  ------------------
  |  Branch (123:9): [True: 0, False: 53.7k]
  ------------------
  124|      0|        return;
  125|  53.7k|    ctxt->errorHandler = handler;
  126|  53.7k|    ctxt->errorCtxt = data;
  127|  53.7k|}
xmlCtxtErrMemory:
  179|  14.8k|{
  180|  14.8k|    xmlStructuredErrorFunc schannel = NULL;
  181|  14.8k|    xmlGenericErrorFunc channel = NULL;
  182|  14.8k|    void *data;
  183|       |
  184|  14.8k|    if (ctxt == NULL) {
  ------------------
  |  Branch (184:9): [True: 0, False: 14.8k]
  ------------------
  185|      0|        xmlRaiseMemoryError(NULL, NULL, NULL, XML_FROM_PARSER, NULL);
  186|      0|        return;
  187|      0|    }
  188|       |
  189|  14.8k|    ctxt->errNo = XML_ERR_NO_MEMORY;
  190|  14.8k|    ctxt->instate = XML_PARSER_EOF; /* TODO: Remove after refactoring */
  191|  14.8k|    ctxt->wellFormed = 0;
  192|  14.8k|    ctxt->disableSAX = 2;
  193|       |
  194|  14.8k|    if (ctxt->errorHandler) {
  ------------------
  |  Branch (194:9): [True: 14.8k, False: 0]
  ------------------
  195|  14.8k|        schannel = ctxt->errorHandler;
  196|  14.8k|        data = ctxt->errorCtxt;
  197|  14.8k|    } else if ((ctxt->sax->initialized == XML_SAX2_MAGIC) &&
  ------------------
  |  |  953|      0|#define XML_SAX2_MAGIC 0xDEEDBEAF
  ------------------
  |  Branch (197:16): [True: 0, False: 0]
  ------------------
  198|      0|        (ctxt->sax->serror != NULL)) {
  ------------------
  |  Branch (198:9): [True: 0, False: 0]
  ------------------
  199|      0|        schannel = ctxt->sax->serror;
  200|      0|        data = ctxt->userData;
  201|      0|    } else {
  202|      0|        channel = ctxt->sax->error;
  203|      0|        data = ctxt->userData;
  204|      0|    }
  205|       |
  206|  14.8k|    xmlRaiseMemoryError(schannel, channel, data, XML_FROM_PARSER,
  207|  14.8k|                        &ctxt->lastError);
  208|  14.8k|}
xmlCtxtErrIO:
  221|   277k|{
  222|   277k|    const char *errstr, *msg, *str1, *str2;
  223|   277k|    xmlErrorLevel level;
  224|       |
  225|   277k|    if (ctxt == NULL)
  ------------------
  |  Branch (225:9): [True: 0, False: 277k]
  ------------------
  226|      0|        return;
  227|       |
  228|   277k|    if (((code == XML_IO_ENOENT) ||
  ------------------
  |  Branch (228:10): [True: 6.49k, False: 270k]
  ------------------
  229|   270k|         (code == XML_IO_UNKNOWN))) {
  ------------------
  |  Branch (229:10): [True: 0, False: 270k]
  ------------------
  230|       |        /*
  231|       |         * Only report a warning if a file could not be found. This should
  232|       |         * only be done for external entities, but the external entity loader
  233|       |         * of xsltproc can try multiple paths and assumes that ENOENT doesn't
  234|       |         * raise an error and aborts parsing.
  235|       |         */
  236|  6.49k|        if (ctxt->validate == 0)
  ------------------
  |  Branch (236:13): [True: 2.31k, False: 4.18k]
  ------------------
  237|  2.31k|            level = XML_ERR_WARNING;
  238|  4.18k|        else
  239|  4.18k|            level = XML_ERR_ERROR;
  240|   270k|    } else if (code == XML_IO_NETWORK_ATTEMPT) {
  ------------------
  |  Branch (240:16): [True: 0, False: 270k]
  ------------------
  241|      0|        level = XML_ERR_ERROR;
  242|   270k|    } else {
  243|   270k|        level = XML_ERR_FATAL;
  244|   270k|    }
  245|       |
  246|   277k|    errstr = xmlErrString(code);
  247|       |
  248|   277k|    if (uri == NULL) {
  ------------------
  |  Branch (248:9): [True: 270k, False: 6.55k]
  ------------------
  249|   270k|        msg = "%s\n";
  250|   270k|        str1 = errstr;
  251|   270k|        str2 = NULL;
  252|   270k|    } else {
  253|  6.55k|        msg = "failed to load \"%s\": %s\n";
  254|  6.55k|        str1 = uri;
  255|  6.55k|        str2 = errstr;
  256|  6.55k|    }
  257|       |
  258|   277k|    xmlCtxtErr(ctxt, NULL, XML_FROM_IO, code, level,
  259|   277k|               (const xmlChar *) uri, NULL, NULL, 0,
  260|   277k|               msg, str1, str2);
  261|   277k|}
xmlCtxtIsCatastrophicError:
  268|  43.5M|xmlCtxtIsCatastrophicError(xmlParserCtxt *ctxt) {
  269|  43.5M|    if (ctxt == NULL)
  ------------------
  |  Branch (269:9): [True: 0, False: 43.5M]
  ------------------
  270|      0|        return(1);
  271|       |
  272|  43.5M|    return(xmlIsCatastrophicError(ctxt->lastError.level,
  273|  43.5M|                                  ctxt->lastError.code));
  274|  43.5M|}
xmlCtxtVErr:
  296|  43.9M|{
  297|  43.9M|    xmlStructuredErrorFunc schannel = NULL;
  298|  43.9M|    xmlGenericErrorFunc channel = NULL;
  299|  43.9M|    void *data = NULL;
  300|  43.9M|    const char *file = NULL;
  301|  43.9M|    int line = 0;
  302|  43.9M|    int col = 0;
  303|  43.9M|    int res;
  304|       |
  305|  43.9M|    if (code == XML_ERR_NO_MEMORY) {
  ------------------
  |  Branch (305:9): [True: 3.71k, False: 43.9M]
  ------------------
  306|  3.71k|        xmlCtxtErrMemory(ctxt);
  307|  3.71k|        return;
  308|  3.71k|    }
  309|       |
  310|  43.9M|    if (ctxt == NULL) {
  ------------------
  |  Branch (310:9): [True: 0, False: 43.9M]
  ------------------
  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|  43.9M|    if (PARSER_STOPPED(ctxt))
  ------------------
  |  |   44|  43.9M|#define PARSER_STOPPED(ctxt) ((ctxt)->disableSAX > 1)
  |  |  ------------------
  |  |  |  Branch (44:30): [True: 433k, False: 43.5M]
  |  |  ------------------
  ------------------
  322|   433k|	return;
  323|       |
  324|       |    /* Don't overwrite catastrophic errors */
  325|  43.5M|    if (xmlCtxtIsCatastrophicError(ctxt))
  ------------------
  |  Branch (325:9): [True: 0, False: 43.5M]
  ------------------
  326|      0|        return;
  327|       |
  328|  43.5M|    if (level == XML_ERR_WARNING) {
  ------------------
  |  Branch (328:9): [True: 112k, False: 43.4M]
  ------------------
  329|   112k|        if (ctxt->nbWarnings >= XML_MAX_ERRORS)
  ------------------
  |  |   54|   112k|#define XML_MAX_ERRORS 100
  ------------------
  |  Branch (329:13): [True: 62.1k, False: 50.0k]
  ------------------
  330|  62.1k|            return;
  331|  50.0k|        ctxt->nbWarnings += 1;
  332|  43.4M|    } else {
  333|       |        /*
  334|       |         * By long-standing design, the parser isn't completely
  335|       |         * stopped on well-formedness errors. Only SAX callbacks
  336|       |         * are disabled.
  337|       |         *
  338|       |         * In some situations, we really want to abort as fast
  339|       |         * as possible.
  340|       |         */
  341|  43.4M|        if (xmlIsCatastrophicError(level, code) ||
  ------------------
  |  Branch (341:13): [True: 11, False: 43.4M]
  ------------------
  342|  43.4M|            code == XML_ERR_RESOURCE_LIMIT ||
  ------------------
  |  Branch (342:13): [True: 348, False: 43.4M]
  ------------------
  343|  43.4M|            code == XML_ERR_ENTITY_LOOP) {
  ------------------
  |  Branch (343:13): [True: 102, False: 43.4M]
  ------------------
  344|    461|            ctxt->disableSAX = 2; /* really stop parser */
  345|  43.4M|        } else {
  346|       |            /* Report at least one fatal error. */
  347|  43.4M|            if (ctxt->nbErrors >= XML_MAX_ERRORS &&
  ------------------
  |  |   54|  86.8M|#define XML_MAX_ERRORS 100
  ------------------
  |  Branch (347:17): [True: 42.7M, False: 634k]
  ------------------
  348|  42.7M|                (level < XML_ERR_FATAL || ctxt->wellFormed == 0))
  ------------------
  |  Branch (348:18): [True: 651k, False: 42.1M]
  |  Branch (348:43): [True: 42.1M, False: 222]
  ------------------
  349|  42.7M|                return;
  350|       |
  351|   634k|            if (level == XML_ERR_FATAL && ctxt->recovery == 0)
  ------------------
  |  Branch (351:17): [True: 476k, False: 158k]
  |  Branch (351:43): [True: 113k, False: 363k]
  ------------------
  352|   113k|                ctxt->disableSAX = 1;
  353|   634k|        }
  354|       |
  355|   635k|        if (level == XML_ERR_FATAL)
  ------------------
  |  Branch (355:13): [True: 476k, False: 158k]
  ------------------
  356|   476k|            ctxt->wellFormed = 0;
  357|   635k|        ctxt->errNo = code;
  358|   635k|        ctxt->nbErrors += 1;
  359|   635k|    }
  360|       |
  361|   685k|    if (((ctxt->options & XML_PARSE_NOERROR) == 0) &&
  ------------------
  |  Branch (361:9): [True: 263k, False: 421k]
  ------------------
  362|   263k|        ((level != XML_ERR_WARNING) ||
  ------------------
  |  Branch (362:10): [True: 241k, False: 21.7k]
  ------------------
  363|   252k|         ((ctxt->options & XML_PARSE_NOWARNING) == 0))) {
  ------------------
  |  Branch (363:10): [True: 10.4k, False: 11.3k]
  ------------------
  364|   252k|        if (ctxt->errorHandler) {
  ------------------
  |  Branch (364:13): [True: 252k, False: 0]
  ------------------
  365|   252k|            schannel = ctxt->errorHandler;
  366|   252k|            data = ctxt->errorCtxt;
  367|   252k|        } 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|   252k|    }
  385|       |
  386|   685k|    if (ctxt->input != NULL) {
  ------------------
  |  Branch (386:9): [True: 682k, False: 2.88k]
  ------------------
  387|   682k|        xmlParserInputPtr input = ctxt->input;
  388|       |
  389|   682k|        if ((input->filename == NULL) &&
  ------------------
  |  Branch (389:13): [True: 393k, False: 288k]
  ------------------
  390|   393k|            (ctxt->inputNr > 1)) {
  ------------------
  |  Branch (390:13): [True: 25.2k, False: 368k]
  ------------------
  391|  25.2k|            input = ctxt->inputTab[ctxt->inputNr - 2];
  392|  25.2k|        }
  393|   682k|        file = input->filename;
  394|   682k|        line = input->line;
  395|   682k|        col = input->col;
  396|   682k|    }
  397|       |
  398|   685k|    res = xmlVRaiseError(schannel, channel, data, ctxt, node, domain, code,
  399|   685k|                         level, file, line, (const char *) str1,
  400|   685k|                         (const char *) str2, (const char *) str3, int1, col,
  401|   685k|                         msg, ap);
  402|       |
  403|   685k|    if (res < 0) {
  ------------------
  |  Branch (403:9): [True: 2.66k, False: 682k]
  ------------------
  404|  2.66k|        xmlCtxtErrMemory(ctxt);
  405|  2.66k|        return;
  406|  2.66k|    }
  407|   685k|}
xmlCtxtErr:
  429|  43.6M|{
  430|  43.6M|    va_list ap;
  431|       |
  432|  43.6M|    va_start(ap, msg);
  433|  43.6M|    xmlCtxtVErr(ctxt, node, domain, code, level,
  434|  43.6M|                str1, str2, str3, int1, msg, ap);
  435|       |    va_end(ap);
  436|  43.6M|}
xmlFatalErr:
  481|  8.45M|{
  482|  8.45M|    const char *errmsg;
  483|  8.45M|    xmlErrorDomain domain = XML_FROM_PARSER;
  484|  8.45M|    xmlErrorLevel level = XML_ERR_FATAL;
  485|       |
  486|  8.45M|    errmsg = xmlErrString(code);
  487|       |
  488|  8.45M|    if ((ctxt != NULL) && (ctxt->html)) {
  ------------------
  |  Branch (488:9): [True: 8.45M, False: 0]
  |  Branch (488:27): [True: 0, False: 8.45M]
  ------------------
  489|      0|        domain = XML_FROM_HTML;
  490|       |
  491|       |        /* Continue if encoding is unsupported */
  492|      0|        if (code == XML_ERR_UNSUPPORTED_ENCODING)
  ------------------
  |  Branch (492:13): [True: 0, False: 0]
  ------------------
  493|      0|            level = XML_ERR_ERROR;
  494|      0|    }
  495|       |
  496|  8.45M|    if (info == NULL) {
  ------------------
  |  Branch (496:9): [True: 1.58M, False: 6.87M]
  ------------------
  497|  1.58M|        xmlCtxtErr(ctxt, NULL, domain, code, level,
  498|  1.58M|                   NULL, NULL, NULL, 0, "%s\n", errmsg);
  499|  6.87M|    } else {
  500|  6.87M|        xmlCtxtErr(ctxt, NULL, domain, code, level,
  501|  6.87M|                   (const xmlChar *) info, NULL, NULL, 0,
  502|  6.87M|                   "%s: %s\n", errmsg, info);
  503|  6.87M|    }
  504|  8.45M|}
xmlParserGrow:
  616|  9.35M|xmlParserGrow(xmlParserCtxt *ctxt) {
  617|  9.35M|    xmlParserInputPtr in = ctxt->input;
  618|  9.35M|    xmlParserInputBufferPtr buf = in->buf;
  619|  9.35M|    size_t curEnd = in->end - in->cur;
  620|  9.35M|    size_t curBase = in->cur - in->base;
  621|  9.35M|    size_t maxLength = (ctxt->options & XML_PARSE_HUGE) ?
  ------------------
  |  Branch (621:24): [True: 3.15M, False: 6.19M]
  ------------------
  622|  3.15M|                       XML_MAX_HUGE_LENGTH :
  ------------------
  |  |   55|  3.15M|#define XML_MAX_HUGE_LENGTH 1000000000
  ------------------
  623|  9.35M|                       XML_MAX_LOOKUP_LIMIT;
  ------------------
  |  |   81|  15.5M|#define XML_MAX_LOOKUP_LIMIT 10000000
  ------------------
  624|  9.35M|    int ret;
  625|       |
  626|  9.35M|    if (buf == NULL)
  ------------------
  |  Branch (626:9): [True: 0, False: 9.35M]
  ------------------
  627|      0|        return(0);
  628|       |    /* Don't grow push parser buffer. */
  629|  9.35M|    if (PARSER_PROGRESSIVE(ctxt))
  ------------------
  |  |   47|  9.35M|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  ------------------
  |  |  |  |   41|  9.35M|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  ------------------
  |  |  |  Branch (47:5): [True: 2.19M, False: 7.16M]
  |  |  ------------------
  ------------------
  630|  2.19M|        return(0);
  631|       |    /* Don't grow memory buffers. */
  632|  7.16M|    if ((buf->encoder == NULL) && (buf->readcallback == NULL))
  ------------------
  |  Branch (632:9): [True: 6.74M, False: 416k]
  |  Branch (632:35): [True: 6.74M, False: 0]
  ------------------
  633|  6.74M|        return(0);
  634|   416k|    if (buf->error != 0)
  ------------------
  |  Branch (634:9): [True: 77.6k, False: 338k]
  ------------------
  635|  77.6k|        return(-1);
  636|       |
  637|   338k|    if (curBase > maxLength) {
  ------------------
  |  Branch (637:9): [True: 0, False: 338k]
  ------------------
  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|   338k|    if (curEnd >= INPUT_CHUNK)
  ------------------
  |  |   63|   338k|#define INPUT_CHUNK	250
  ------------------
  |  Branch (643:9): [True: 342, False: 338k]
  ------------------
  644|    342|        return(0);
  645|       |
  646|   338k|    ret = xmlParserInputBufferGrow(buf, INPUT_CHUNK);
  ------------------
  |  |   63|   338k|#define INPUT_CHUNK	250
  ------------------
  647|   338k|    xmlBufUpdateInput(buf->buffer, in, curBase);
  648|       |
  649|   338k|    if (ret < 0) {
  ------------------
  |  Branch (649:9): [True: 395, False: 337k]
  ------------------
  650|    395|        xmlCtxtErrIO(ctxt, buf->error, NULL);
  651|    395|    }
  652|       |
  653|   338k|    return(ret);
  654|   338k|}
xmlParserCheckEOF:
  664|  26.9k|xmlParserCheckEOF(xmlParserCtxt *ctxt, xmlParserErrors code) {
  665|  26.9k|    xmlParserInputPtr in = ctxt->input;
  666|  26.9k|    xmlParserInputBufferPtr buf;
  667|       |
  668|  26.9k|    if (ctxt->errNo != XML_ERR_OK)
  ------------------
  |  Branch (668:9): [True: 22.1k, False: 4.79k]
  ------------------
  669|  22.1k|        return;
  670|       |
  671|  4.79k|    if (in->cur < in->end) {
  ------------------
  |  Branch (671:9): [True: 6, False: 4.79k]
  ------------------
  672|      6|        xmlFatalErr(ctxt, code, NULL);
  673|      6|        return;
  674|      6|    }
  675|       |
  676|  4.79k|    buf = in->buf;
  677|  4.79k|    if ((buf != NULL) && (buf->encoder != NULL)) {
  ------------------
  |  Branch (677:9): [True: 4.79k, False: 0]
  |  Branch (677:26): [True: 14, False: 4.77k]
  ------------------
  678|     14|        size_t curBase = in->cur - in->base;
  679|     14|        size_t sizeOut = 64;
  680|     14|        xmlCharEncError ret;
  681|       |
  682|       |        /*
  683|       |         * Check for truncated multi-byte sequence
  684|       |         */
  685|     14|        ret = xmlCharEncInput(buf, &sizeOut, /* flush */ 1);
  686|     14|        xmlBufUpdateInput(buf->buffer, in, curBase);
  687|     14|        if (ret != XML_ENC_ERR_SUCCESS) {
  ------------------
  |  Branch (687:13): [True: 1, False: 13]
  ------------------
  688|      1|            xmlCtxtErrIO(ctxt, buf->error, NULL);
  689|      1|            return;
  690|      1|        }
  691|       |
  692|       |        /* Shouldn't happen */
  693|     13|        if (in->cur < in->end)
  ------------------
  |  Branch (693:13): [True: 0, False: 13]
  ------------------
  694|      0|            xmlFatalErr(ctxt, XML_ERR_INTERNAL_ERROR, "expected EOF");
  695|     13|    }
  696|  4.79k|}
xmlParserShrink:
  749|  13.1M|xmlParserShrink(xmlParserCtxt *ctxt) {
  750|  13.1M|    xmlParserInputPtr in = ctxt->input;
  751|  13.1M|    xmlParserInputBufferPtr buf = in->buf;
  752|  13.1M|    size_t used, res;
  753|       |
  754|  13.1M|    if (buf == NULL)
  ------------------
  |  Branch (754:9): [True: 0, False: 13.1M]
  ------------------
  755|      0|        return;
  756|       |
  757|  13.1M|    used = in->cur - in->base;
  758|       |
  759|  13.1M|    if (used > LINE_LEN) {
  ------------------
  |  |  595|  13.1M|#define LINE_LEN        80
  ------------------
  |  Branch (759:9): [True: 7.98M, False: 5.20M]
  ------------------
  760|  7.98M|        res = xmlBufShrink(buf->buffer, used - LINE_LEN);
  ------------------
  |  |  595|  7.98M|#define LINE_LEN        80
  ------------------
  761|       |
  762|  7.98M|        if (res > 0) {
  ------------------
  |  Branch (762:13): [True: 7.98M, False: 277]
  ------------------
  763|  7.98M|            used -= res;
  764|  7.98M|            xmlSaturatedAddSizeT(&in->consumed, res);
  765|  7.98M|        }
  766|       |
  767|  7.98M|        xmlBufUpdateInput(buf->buffer, in, used);
  768|  7.98M|    }
  769|  13.1M|}
xmlNextChar:
  818|   528M|{
  819|   528M|    const unsigned char *cur;
  820|   528M|    size_t avail;
  821|   528M|    int c;
  822|       |
  823|   528M|    if ((ctxt == NULL) || (ctxt->input == NULL))
  ------------------
  |  Branch (823:9): [True: 0, False: 528M]
  |  Branch (823:27): [True: 0, False: 528M]
  ------------------
  824|      0|        return;
  825|       |
  826|   528M|    avail = ctxt->input->end - ctxt->input->cur;
  827|       |
  828|   528M|    if (avail < INPUT_CHUNK) {
  ------------------
  |  |   63|   528M|#define INPUT_CHUNK	250
  ------------------
  |  Branch (828:9): [True: 2.55M, False: 526M]
  ------------------
  829|  2.55M|        xmlParserGrow(ctxt);
  830|  2.55M|        if (ctxt->input->cur >= ctxt->input->end)
  ------------------
  |  Branch (830:13): [True: 698, False: 2.55M]
  ------------------
  831|    698|            return;
  832|  2.55M|        avail = ctxt->input->end - ctxt->input->cur;
  833|  2.55M|    }
  834|       |
  835|   528M|    cur = ctxt->input->cur;
  836|   528M|    c = *cur;
  837|       |
  838|   528M|    if (c < 0x80) {
  ------------------
  |  Branch (838:9): [True: 499M, False: 29.5M]
  ------------------
  839|   499M|        if (c == '\n') {
  ------------------
  |  Branch (839:13): [True: 430k, False: 498M]
  ------------------
  840|   430k|            ctxt->input->cur++;
  841|   430k|            ctxt->input->line++;
  842|   430k|            ctxt->input->col = 1;
  843|   498M|        } else if (c == '\r') {
  ------------------
  |  Branch (843:20): [True: 51.0k, False: 498M]
  ------------------
  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|  51.0k|            ctxt->input->cur += ((cur[1] == '\n') ? 2 : 1);
  ------------------
  |  Branch (850:34): [True: 48.0k, False: 2.99k]
  ------------------
  851|  51.0k|            ctxt->input->line++;
  852|  51.0k|            ctxt->input->col = 1;
  853|  51.0k|            return;
  854|   498M|        } else {
  855|   498M|            ctxt->input->cur++;
  856|   498M|            ctxt->input->col++;
  857|   498M|        }
  858|   499M|    } else {
  859|  29.5M|        ctxt->input->col++;
  860|       |
  861|  29.5M|        if ((avail < 2) || (cur[1] & 0xc0) != 0x80)
  ------------------
  |  Branch (861:13): [True: 2.43k, False: 29.5M]
  |  Branch (861:28): [True: 26.9M, False: 2.55M]
  ------------------
  862|  26.9M|            goto encoding_error;
  863|       |
  864|  2.55M|        if (c < 0xe0) {
  ------------------
  |  Branch (864:13): [True: 2.35M, False: 197k]
  ------------------
  865|       |            /* 2-byte code */
  866|  2.35M|            if (c < 0xc2)
  ------------------
  |  Branch (866:17): [True: 1.19M, False: 1.16M]
  ------------------
  867|  1.19M|                goto encoding_error;
  868|  1.16M|            ctxt->input->cur += 2;
  869|  1.16M|        } else {
  870|   197k|            unsigned int val = (c << 8) | cur[1];
  871|       |
  872|   197k|            if ((avail < 3) || (cur[2] & 0xc0) != 0x80)
  ------------------
  |  Branch (872:17): [True: 539, False: 197k]
  |  Branch (872:32): [True: 7.32k, False: 190k]
  ------------------
  873|  7.86k|                goto encoding_error;
  874|       |
  875|   190k|            if (c < 0xf0) {
  ------------------
  |  Branch (875:17): [True: 171k, False: 18.4k]
  ------------------
  876|       |                /* 3-byte code */
  877|   171k|                if ((val < 0xe0a0) || ((val >= 0xeda0) && (val < 0xee00)))
  ------------------
  |  Branch (877:21): [True: 212, False: 171k]
  |  Branch (877:40): [True: 17.1k, False: 154k]
  |  Branch (877:59): [True: 5.38k, False: 11.7k]
  ------------------
  878|  5.59k|                    goto encoding_error;
  879|   166k|                ctxt->input->cur += 3;
  880|   166k|            } else {
  881|  18.4k|                if ((avail < 4) || ((cur[3] & 0xc0) != 0x80))
  ------------------
  |  Branch (881:21): [True: 205, False: 18.2k]
  |  Branch (881:36): [True: 514, False: 17.7k]
  ------------------
  882|    719|                    goto encoding_error;
  883|       |
  884|       |                /* 4-byte code */
  885|  17.7k|                if ((val < 0xf090) || (val >= 0xf490))
  ------------------
  |  Branch (885:21): [True: 340, False: 17.3k]
  |  Branch (885:39): [True: 1.03k, False: 16.3k]
  ------------------
  886|  1.37k|                    goto encoding_error;
  887|  16.3k|                ctxt->input->cur += 4;
  888|  16.3k|            }
  889|   190k|        }
  890|  2.55M|    }
  891|       |
  892|   500M|    return;
  893|       |
  894|   500M|encoding_error:
  895|       |    /* Only report the first error */
  896|  28.2M|    if ((ctxt->input->flags & XML_INPUT_ENCODING_ERROR) == 0) {
  ------------------
  |  |   40|  28.2M|#define XML_INPUT_ENCODING_ERROR    (1u << 5)
  ------------------
  |  Branch (896:9): [True: 226k, False: 27.9M]
  ------------------
  897|   226k|        xmlCtxtErrIO(ctxt, XML_ERR_INVALID_ENCODING, NULL);
  898|   226k|        ctxt->input->flags |= XML_INPUT_ENCODING_ERROR;
  ------------------
  |  |   40|   226k|#define XML_INPUT_ENCODING_ERROR    (1u << 5)
  ------------------
  899|   226k|    }
  900|  28.2M|    ctxt->input->cur++;
  901|  28.2M|}
xmlCurrentChar:
  924|  85.5M|xmlCurrentChar(xmlParserCtxt *ctxt, int *len) {
  925|  85.5M|    const unsigned char *cur;
  926|  85.5M|    size_t avail;
  927|  85.5M|    int c;
  928|       |
  929|  85.5M|    if ((ctxt == NULL) || (len == NULL) || (ctxt->input == NULL)) return(0);
  ------------------
  |  Branch (929:9): [True: 0, False: 85.5M]
  |  Branch (929:27): [True: 0, False: 85.5M]
  |  Branch (929:44): [True: 0, False: 85.5M]
  ------------------
  930|       |
  931|  85.5M|    avail = ctxt->input->end - ctxt->input->cur;
  932|       |
  933|  85.5M|    if (avail < INPUT_CHUNK) {
  ------------------
  |  |   63|  85.5M|#define INPUT_CHUNK	250
  ------------------
  |  Branch (933:9): [True: 2.64M, False: 82.9M]
  ------------------
  934|  2.64M|        xmlParserGrow(ctxt);
  935|  2.64M|        avail = ctxt->input->end - ctxt->input->cur;
  936|  2.64M|    }
  937|       |
  938|  85.5M|    cur = ctxt->input->cur;
  939|  85.5M|    c = *cur;
  940|       |
  941|  85.5M|    if (c < 0x80) {
  ------------------
  |  Branch (941:9): [True: 37.2M, False: 48.3M]
  ------------------
  942|       |	/* 1-byte code */
  943|  37.2M|        if (c < 0x20) {
  ------------------
  |  Branch (943:13): [True: 19.4M, False: 17.7M]
  ------------------
  944|       |            /*
  945|       |             *   2.11 End-of-Line Handling
  946|       |             *   the literal two-character sequence "#xD#xA" or a standalone
  947|       |             *   literal #xD, an XML processor must pass to the application
  948|       |             *   the single character #xA.
  949|       |             */
  950|  19.4M|            if (c == '\r') {
  ------------------
  |  Branch (950:17): [True: 691k, False: 18.7M]
  ------------------
  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|   691k|                if (cur[1] == '\n')
  ------------------
  |  Branch (956:21): [True: 18.5k, False: 672k]
  ------------------
  957|  18.5k|                    ctxt->input->cur++;
  958|   691k|                *len = 1;
  959|   691k|                c = '\n';
  960|  18.7M|            } else if (c == 0) {
  ------------------
  |  Branch (960:24): [True: 6.90M, False: 11.8M]
  ------------------
  961|  6.90M|                if (ctxt->input->cur >= ctxt->input->end) {
  ------------------
  |  Branch (961:21): [True: 38.6k, False: 6.86M]
  ------------------
  962|  38.6k|                    *len = 0;
  963|  6.86M|                } else {
  964|  6.86M|                    *len = 1;
  965|       |                    /*
  966|       |                     * TODO: Null bytes should be handled by callers,
  967|       |                     * but this can be tricky.
  968|       |                     */
  969|  6.86M|                    xmlFatalErr(ctxt, XML_ERR_INVALID_CHAR,
  970|  6.86M|                            "Char 0x0 out of allowed range\n");
  971|  6.86M|                }
  972|  11.8M|            } else {
  973|  11.8M|                *len = 1;
  974|  11.8M|            }
  975|  19.4M|        } else {
  976|  17.7M|            *len = 1;
  977|  17.7M|        }
  978|       |
  979|  37.2M|        return(c);
  980|  48.3M|    } else {
  981|  48.3M|        int val;
  982|       |
  983|  48.3M|        if (avail < 2)
  ------------------
  |  Branch (983:13): [True: 1.42k, False: 48.3M]
  ------------------
  984|  1.42k|            goto incomplete_sequence;
  985|  48.3M|        if ((cur[1] & 0xc0) != 0x80)
  ------------------
  |  Branch (985:13): [True: 16.5M, False: 31.8M]
  ------------------
  986|  16.5M|            goto encoding_error;
  987|       |
  988|  31.8M|        if (c < 0xe0) {
  ------------------
  |  Branch (988:13): [True: 3.76M, False: 28.0M]
  ------------------
  989|       |            /* 2-byte code */
  990|  3.76M|            if (c < 0xc2)
  ------------------
  |  Branch (990:17): [True: 945k, False: 2.81M]
  ------------------
  991|   945k|                goto encoding_error;
  992|  2.81M|            val = (c & 0x1f) << 6;
  993|  2.81M|            val |= cur[1] & 0x3f;
  994|  2.81M|            *len = 2;
  995|  28.0M|        } else {
  996|  28.0M|            if (avail < 3)
  ------------------
  |  Branch (996:17): [True: 251, False: 28.0M]
  ------------------
  997|    251|                goto incomplete_sequence;
  998|  28.0M|            if ((cur[2] & 0xc0) != 0x80)
  ------------------
  |  Branch (998:17): [True: 5.57k, False: 28.0M]
  ------------------
  999|  5.57k|                goto encoding_error;
 1000|       |
 1001|  28.0M|            if (c < 0xf0) {
  ------------------
  |  Branch (1001:17): [True: 28.0M, False: 24.2k]
  ------------------
 1002|       |                /* 3-byte code */
 1003|  28.0M|                val = (c & 0xf) << 12;
 1004|  28.0M|                val |= (cur[1] & 0x3f) << 6;
 1005|  28.0M|                val |= cur[2] & 0x3f;
 1006|  28.0M|                if ((val < 0x800) || ((val >= 0xd800) && (val < 0xe000)))
  ------------------
  |  Branch (1006:21): [True: 423, False: 28.0M]
  |  Branch (1006:39): [True: 9.19M, False: 18.8M]
  |  Branch (1006:58): [True: 220, False: 9.19M]
  ------------------
 1007|    643|                    goto encoding_error;
 1008|  28.0M|                *len = 3;
 1009|  28.0M|            } else {
 1010|  24.2k|                if (avail < 4)
  ------------------
  |  Branch (1010:21): [True: 246, False: 24.0k]
  ------------------
 1011|    246|                    goto incomplete_sequence;
 1012|  24.0k|                if ((cur[3] & 0xc0) != 0x80)
  ------------------
  |  Branch (1012:21): [True: 2.41k, False: 21.6k]
  ------------------
 1013|  2.41k|                    goto encoding_error;
 1014|       |
 1015|       |                /* 4-byte code */
 1016|  21.6k|                val = (c & 0x0f) << 18;
 1017|  21.6k|                val |= (cur[1] & 0x3f) << 12;
 1018|  21.6k|                val |= (cur[2] & 0x3f) << 6;
 1019|  21.6k|                val |= cur[3] & 0x3f;
 1020|  21.6k|                if ((val < 0x10000) || (val >= 0x110000))
  ------------------
  |  Branch (1020:21): [True: 274, False: 21.3k]
  |  Branch (1020:40): [True: 5.23k, False: 16.1k]
  ------------------
 1021|  5.50k|                    goto encoding_error;
 1022|  16.1k|                *len = 4;
 1023|  16.1k|            }
 1024|  28.0M|        }
 1025|       |
 1026|  30.8M|        return(val);
 1027|  31.8M|    }
 1028|       |
 1029|  17.4M|encoding_error:
 1030|       |    /* Only report the first error */
 1031|  17.4M|    if ((ctxt->input->flags & XML_INPUT_ENCODING_ERROR) == 0) {
  ------------------
  |  |   40|  17.4M|#define XML_INPUT_ENCODING_ERROR    (1u << 5)
  ------------------
  |  Branch (1031:9): [True: 15.0k, False: 17.4M]
  ------------------
 1032|  15.0k|        xmlCtxtErrIO(ctxt, XML_ERR_INVALID_ENCODING, NULL);
 1033|  15.0k|        ctxt->input->flags |= XML_INPUT_ENCODING_ERROR;
  ------------------
  |  |   40|  15.0k|#define XML_INPUT_ENCODING_ERROR    (1u << 5)
  ------------------
 1034|  15.0k|    }
 1035|  17.4M|    *len = 1;
 1036|  17.4M|    return(XML_INVALID_CHAR);
  ------------------
  |  |    9|  17.4M|#define XML_INVALID_CHAR 0x200000
  ------------------
 1037|       |
 1038|  1.92k|incomplete_sequence:
 1039|       |    /*
 1040|       |     * An encoding problem may arise from a truncated input buffer
 1041|       |     * splitting a character in the middle. In that case do not raise
 1042|       |     * an error but return 0. This should only happen when push parsing
 1043|       |     * char data.
 1044|       |     */
 1045|  1.92k|    *len = 0;
 1046|  1.92k|    return(0);
 1047|  85.5M|}
xmlCopyCharMultiByte:
 1086|  38.0M|xmlCopyCharMultiByte(xmlChar *out, int val) {
 1087|  38.0M|    if ((out == NULL) || (val < 0)) return(0);
  ------------------
  |  Branch (1087:9): [True: 0, False: 38.0M]
  |  Branch (1087:26): [True: 0, False: 38.0M]
  ------------------
 1088|       |    /*
 1089|       |     * We are supposed to handle UTF8, check it's valid
 1090|       |     * From rfc2044: encoding of the Unicode values on UTF-8:
 1091|       |     *
 1092|       |     * UCS-4 range (hex.)           UTF-8 octet sequence (binary)
 1093|       |     * 0000 0000-0000 007F   0xxxxxxx
 1094|       |     * 0000 0080-0000 07FF   110xxxxx 10xxxxxx
 1095|       |     * 0000 0800-0000 FFFF   1110xxxx 10xxxxxx 10xxxxxx
 1096|       |     */
 1097|  38.0M|    if  (val >= 0x80) {
  ------------------
  |  Branch (1097:10): [True: 38.0M, False: 5.90k]
  ------------------
 1098|  38.0M|	xmlChar *savedout = out;
 1099|  38.0M|	int bits;
 1100|  38.0M|	if (val <   0x800) { *out++= (val >>  6) | 0xC0;  bits=  0; }
  ------------------
  |  Branch (1100:6): [True: 2.51M, False: 35.5M]
  ------------------
 1101|  35.5M|	else if (val < 0x10000) { *out++= (val >> 12) | 0xE0;  bits=  6;}
  ------------------
  |  Branch (1101:11): [True: 35.5M, False: 12.8k]
  ------------------
 1102|  12.8k|	else if (val < 0x110000)  { *out++= (val >> 18) | 0xF0;  bits=  12; }
  ------------------
  |  Branch (1102:11): [True: 12.8k, 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|   111M|	for ( ; bits >= 0; bits-= 6)
  ------------------
  |  Branch (1109:10): [True: 73.6M, False: 38.0M]
  ------------------
 1110|  73.6M|	    *out++= ((val >> bits) & 0x3F) | 0x80 ;
 1111|  38.0M|	return (out - savedout);
 1112|  38.0M|    }
 1113|  5.90k|    *out = val;
 1114|  5.90k|    return 1;
 1115|  38.0M|}
xmlSwitchEncoding:
 1263|  6.50k|{
 1264|  6.50k|    xmlCharEncodingHandlerPtr handler = NULL;
 1265|  6.50k|    int ret;
 1266|  6.50k|    xmlParserErrors code;
 1267|       |
 1268|  6.50k|    if ((ctxt == NULL) || (ctxt->input == NULL))
  ------------------
  |  Branch (1268:9): [True: 0, False: 6.50k]
  |  Branch (1268:27): [True: 0, False: 6.50k]
  ------------------
 1269|      0|        return(-1);
 1270|       |
 1271|  6.50k|    code = xmlLookupCharEncodingHandler(enc, &handler);
 1272|  6.50k|    if (code != 0) {
  ------------------
  |  Branch (1272:9): [True: 3, False: 6.50k]
  ------------------
 1273|      3|        xmlFatalErr(ctxt, code, NULL);
 1274|      3|        return(-1);
 1275|      3|    }
 1276|       |
 1277|  6.50k|    ret = xmlSwitchToEncoding(ctxt, handler);
 1278|       |
 1279|  6.50k|    if ((ret >= 0) && (enc == XML_CHAR_ENCODING_NONE)) {
  ------------------
  |  Branch (1279:9): [True: 4.80k, False: 1.70k]
  |  Branch (1279:23): [True: 0, False: 4.80k]
  ------------------
 1280|      0|        ctxt->input->flags &= ~XML_INPUT_HAS_ENCODING;
  ------------------
  |  |   33|      0|#define XML_INPUT_HAS_ENCODING      (1u << 0)
  ------------------
 1281|      0|    }
 1282|       |
 1283|  6.50k|    return(ret);
 1284|  6.50k|}
xmlInputSetEncodingHandler:
 1353|  15.4k|                           xmlCharEncodingHandler *handler) {
 1354|  15.4k|    xmlParserInputBufferPtr in;
 1355|  15.4k|    xmlBufPtr buf;
 1356|  15.4k|    xmlParserErrors code = XML_ERR_OK;
 1357|       |
 1358|  15.4k|    if ((input == NULL) || (input->buf == NULL)) {
  ------------------
  |  Branch (1358:9): [True: 0, False: 15.4k]
  |  Branch (1358:28): [True: 0, False: 15.4k]
  ------------------
 1359|      0|        xmlCharEncCloseFunc(handler);
 1360|      0|	return(XML_ERR_ARGUMENT);
 1361|      0|    }
 1362|  15.4k|    in = input->buf;
 1363|       |
 1364|  15.4k|    input->flags |= XML_INPUT_HAS_ENCODING;
  ------------------
  |  |   33|  15.4k|#define XML_INPUT_HAS_ENCODING      (1u << 0)
  ------------------
 1365|       |
 1366|       |    /*
 1367|       |     * UTF-8 requires no encoding handler.
 1368|       |     */
 1369|  15.4k|    if ((handler != NULL) &&
  ------------------
  |  Branch (1369:9): [True: 14.9k, False: 478]
  ------------------
 1370|  14.9k|        (xmlStrcasecmp(BAD_CAST handler->name, BAD_CAST "UTF-8") == 0)) {
  ------------------
  |  |   34|  14.9k|#define BAD_CAST (xmlChar *)
  ------------------
                      (xmlStrcasecmp(BAD_CAST handler->name, BAD_CAST "UTF-8") == 0)) {
  ------------------
  |  |   34|  14.9k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (1370:9): [True: 0, False: 14.9k]
  ------------------
 1371|      0|        xmlCharEncCloseFunc(handler);
 1372|      0|        handler = NULL;
 1373|      0|    }
 1374|       |
 1375|  15.4k|    if (in->encoder == handler)
  ------------------
  |  Branch (1375:9): [True: 478, False: 14.9k]
  ------------------
 1376|    478|        return(XML_ERR_OK);
 1377|       |
 1378|  14.9k|    if (in->encoder != NULL) {
  ------------------
  |  Branch (1378:9): [True: 0, False: 14.9k]
  ------------------
 1379|       |        /*
 1380|       |         * Switching encodings during parsing is a really bad idea,
 1381|       |         * but Chromium can switch between ISO-8859-1 and UTF-16 before
 1382|       |         * separate calls to xmlParseChunk.
 1383|       |         *
 1384|       |         * TODO: We should check whether the "raw" input buffer is empty and
 1385|       |         * convert the old content using the old encoder.
 1386|       |         */
 1387|       |
 1388|      0|        xmlCharEncCloseFunc(in->encoder);
 1389|      0|        in->encoder = handler;
 1390|      0|        return(XML_ERR_OK);
 1391|      0|    }
 1392|       |
 1393|  14.9k|    buf = xmlBufCreate(XML_IO_BUFFER_SIZE);
  ------------------
  |  |   20|  14.9k|#define XML_IO_BUFFER_SIZE 6000
  ------------------
 1394|  14.9k|    if (buf == NULL) {
  ------------------
  |  Branch (1394:9): [True: 20, False: 14.9k]
  ------------------
 1395|     20|        xmlCharEncCloseFunc(handler);
 1396|     20|        return(XML_ERR_NO_MEMORY);
 1397|     20|    }
 1398|       |
 1399|  14.9k|    in->encoder = handler;
 1400|  14.9k|    in->raw = in->buffer;
 1401|  14.9k|    in->buffer = buf;
 1402|       |
 1403|       |    /*
 1404|       |     * Is there already some content down the pipe to convert ?
 1405|       |     */
 1406|  14.9k|    if (input->end > input->base) {
  ------------------
  |  Branch (1406:9): [True: 14.9k, False: 0]
  ------------------
 1407|  14.9k|        size_t processed;
 1408|  14.9k|        size_t nbchars;
 1409|  14.9k|        xmlCharEncError res;
 1410|       |
 1411|       |        /*
 1412|       |         * Shrink the current input buffer.
 1413|       |         * Move it as the raw buffer and create a new input buffer
 1414|       |         */
 1415|  14.9k|        processed = input->cur - input->base;
 1416|  14.9k|        xmlBufShrink(in->raw, processed);
 1417|  14.9k|        input->consumed += processed;
 1418|  14.9k|        in->rawconsumed = processed;
 1419|       |
 1420|       |        /*
 1421|       |         * If we're push-parsing, we must convert the whole buffer.
 1422|       |         *
 1423|       |         * If we're pull-parsing, we could be parsing from a huge
 1424|       |         * memory buffer which we don't want to convert completely.
 1425|       |         */
 1426|  14.9k|        if (input->flags & XML_INPUT_PROGRESSIVE)
  ------------------
  |  |   41|  14.9k|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  ------------------
  |  Branch (1426:13): [True: 1.27k, False: 13.6k]
  ------------------
 1427|  1.27k|            nbchars = SIZE_MAX;
 1428|  13.6k|        else
 1429|  13.6k|            nbchars = 4000 /* MINLEN */;
 1430|  14.9k|        res = xmlCharEncInput(in, &nbchars, /* flush */ 0);
 1431|  14.9k|        if (res != XML_ENC_ERR_SUCCESS)
  ------------------
  |  Branch (1431:13): [True: 2.57k, False: 12.3k]
  ------------------
 1432|  2.57k|            code = in->error;
 1433|  14.9k|    }
 1434|       |
 1435|  14.9k|    xmlBufResetInput(in->buffer, input);
 1436|       |
 1437|  14.9k|    return(code);
 1438|  14.9k|}
xmlSwitchToEncoding:
 1475|  11.0k|{
 1476|  11.0k|    xmlParserErrors code;
 1477|       |
 1478|  11.0k|    if (ctxt == NULL)
  ------------------
  |  Branch (1478:9): [True: 0, False: 11.0k]
  ------------------
 1479|      0|        return(-1);
 1480|       |
 1481|  11.0k|    code = xmlInputSetEncodingHandler(ctxt->input, handler);
 1482|  11.0k|    if (code != XML_ERR_OK) {
  ------------------
  |  Branch (1482:9): [True: 1.81k, False: 9.25k]
  ------------------
 1483|  1.81k|        xmlCtxtErrIO(ctxt, code, NULL);
 1484|  1.81k|        return(-1);
 1485|  1.81k|    }
 1486|       |
 1487|  9.25k|    return(0);
 1488|  11.0k|}
xmlDetectEncoding:
 1498|   374k|xmlDetectEncoding(xmlParserCtxt *ctxt) {
 1499|   374k|    const xmlChar *in;
 1500|   374k|    xmlCharEncoding enc;
 1501|   374k|    int bomSize;
 1502|   374k|    int autoFlag = 0;
 1503|       |
 1504|   374k|    if (xmlParserGrow(ctxt) < 0)
  ------------------
  |  Branch (1504:9): [True: 0, False: 374k]
  ------------------
 1505|      0|        return;
 1506|   374k|    in = ctxt->input->cur;
 1507|   374k|    if (ctxt->input->end - in < 4)
  ------------------
  |  Branch (1507:9): [True: 1.70k, False: 372k]
  ------------------
 1508|  1.70k|        return;
 1509|       |
 1510|   372k|    if (ctxt->input->flags & XML_INPUT_HAS_ENCODING) {
  ------------------
  |  |   33|   372k|#define XML_INPUT_HAS_ENCODING      (1u << 0)
  ------------------
  |  Branch (1510:9): [True: 0, False: 372k]
  ------------------
 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|   372k|    enc = XML_CHAR_ENCODING_NONE;
 1523|   372k|    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|   372k|    switch (in[0]) {
  ------------------
  |  Branch (1531:13): [True: 344k, False: 27.7k]
  ------------------
 1532|  2.04k|        case 0x00:
  ------------------
  |  Branch (1532:9): [True: 2.04k, False: 370k]
  ------------------
 1533|  2.04k|            if ((!ctxt->html) &&
  ------------------
  |  Branch (1533:17): [True: 2.04k, False: 0]
  ------------------
 1534|  2.04k|                (in[1] == 0x00) && (in[2] == 0x00) && (in[3] == 0x3C)) {
  ------------------
  |  Branch (1534:17): [True: 671, False: 1.36k]
  |  Branch (1534:36): [True: 462, False: 209]
  |  Branch (1534:55): [True: 243, False: 219]
  ------------------
 1535|    243|                enc = XML_CHAR_ENCODING_UCS4BE;
 1536|    243|                autoFlag = XML_INPUT_AUTO_OTHER;
  ------------------
  |  |   38|    243|#define XML_INPUT_AUTO_OTHER        (4u << 1)
  ------------------
 1537|  1.79k|            } else if ((in[1] == 0x3C) && (in[2] == 0x00) && (in[3] == 0x3F)) {
  ------------------
  |  Branch (1537:24): [True: 1.30k, False: 491]
  |  Branch (1537:43): [True: 1.05k, False: 248]
  |  Branch (1537:62): [True: 979, False: 79]
  ------------------
 1538|       |                /*
 1539|       |                 * TODO: The HTML5 spec requires to check that the
 1540|       |                 * next codepoint is an 'x'.
 1541|       |                 */
 1542|    979|                enc = XML_CHAR_ENCODING_UTF16BE;
 1543|    979|                autoFlag = XML_INPUT_AUTO_UTF16BE;
  ------------------
  |  |   37|    979|#define XML_INPUT_AUTO_UTF16BE      (3u << 1)
  ------------------
 1544|    979|            }
 1545|  2.04k|            break;
 1546|       |
 1547|   334k|        case 0x3C:
  ------------------
  |  Branch (1547:9): [True: 334k, False: 37.6k]
  ------------------
 1548|   334k|            if (in[1] == 0x00) {
  ------------------
  |  Branch (1548:17): [True: 4.22k, False: 330k]
  ------------------
 1549|  4.22k|                if ((!ctxt->html) &&
  ------------------
  |  Branch (1549:21): [True: 4.22k, False: 0]
  ------------------
 1550|  4.22k|                    (in[2] == 0x00) && (in[3] == 0x00)) {
  ------------------
  |  Branch (1550:21): [True: 1.25k, False: 2.96k]
  |  Branch (1550:40): [True: 1.00k, False: 249]
  ------------------
 1551|  1.00k|                    enc = XML_CHAR_ENCODING_UCS4LE;
 1552|  1.00k|                    autoFlag = XML_INPUT_AUTO_OTHER;
  ------------------
  |  |   38|  1.00k|#define XML_INPUT_AUTO_OTHER        (4u << 1)
  ------------------
 1553|  3.21k|                } else if ((in[2] == 0x3F) && (in[3] == 0x00)) {
  ------------------
  |  Branch (1553:28): [True: 2.80k, False: 409]
  |  Branch (1553:47): [True: 2.56k, False: 239]
  ------------------
 1554|       |                    /*
 1555|       |                     * TODO: The HTML5 spec requires to check that the
 1556|       |                     * next codepoint is an 'x'.
 1557|       |                     */
 1558|  2.56k|                    enc = XML_CHAR_ENCODING_UTF16LE;
 1559|  2.56k|                    autoFlag = XML_INPUT_AUTO_UTF16LE;
  ------------------
  |  |   36|  2.56k|#define XML_INPUT_AUTO_UTF16LE      (2u << 1)
  ------------------
 1560|  2.56k|                }
 1561|  4.22k|            }
 1562|   334k|            break;
 1563|       |
 1564|  5.44k|        case 0x4C:
  ------------------
  |  Branch (1564:9): [True: 5.44k, False: 367k]
  ------------------
 1565|  5.44k|	    if ((!ctxt->html) &&
  ------------------
  |  Branch (1565:10): [True: 5.44k, False: 0]
  ------------------
 1566|  5.44k|                (in[1] == 0x6F) && (in[2] == 0xA7) && (in[3] == 0x94)) {
  ------------------
  |  Branch (1566:17): [True: 5.22k, False: 227]
  |  Branch (1566:36): [True: 4.91k, False: 303]
  |  Branch (1566:55): [True: 4.67k, False: 248]
  ------------------
 1567|  4.67k|	        enc = XML_CHAR_ENCODING_EBCDIC;
 1568|  4.67k|                autoFlag = XML_INPUT_AUTO_OTHER;
  ------------------
  |  |   38|  4.67k|#define XML_INPUT_AUTO_OTHER        (4u << 1)
  ------------------
 1569|  4.67k|            }
 1570|  5.44k|            break;
 1571|       |
 1572|    337|        case 0xEF:
  ------------------
  |  Branch (1572:9): [True: 337, False: 372k]
  ------------------
 1573|    337|            if ((in[1] == 0xBB) && (in[2] == 0xBF)) {
  ------------------
  |  Branch (1573:17): [True: 85, False: 252]
  |  Branch (1573:36): [True: 7, False: 78]
  ------------------
 1574|      7|                enc = XML_CHAR_ENCODING_UTF8;
 1575|      7|                autoFlag = XML_INPUT_AUTO_UTF8;
  ------------------
  |  |   35|      7|#define XML_INPUT_AUTO_UTF8         (1u << 1)
  ------------------
 1576|      7|                bomSize = 3;
 1577|      7|            }
 1578|    337|            break;
 1579|       |
 1580|  1.63k|        case 0xFE:
  ------------------
  |  Branch (1580:9): [True: 1.63k, False: 370k]
  ------------------
 1581|  1.63k|            if (in[1] == 0xFF) {
  ------------------
  |  Branch (1581:17): [True: 1.41k, False: 227]
  ------------------
 1582|  1.41k|                enc = XML_CHAR_ENCODING_UTF16BE;
 1583|  1.41k|                autoFlag = XML_INPUT_AUTO_UTF16BE;
  ------------------
  |  |   37|  1.41k|#define XML_INPUT_AUTO_UTF16BE      (3u << 1)
  ------------------
 1584|  1.41k|                bomSize = 2;
 1585|  1.41k|            }
 1586|  1.63k|            break;
 1587|       |
 1588|    507|        case 0xFF:
  ------------------
  |  Branch (1588:9): [True: 507, False: 372k]
  ------------------
 1589|    507|            if (in[1] == 0xFE) {
  ------------------
  |  Branch (1589:17): [True: 296, False: 211]
  ------------------
 1590|    296|                enc = XML_CHAR_ENCODING_UTF16LE;
 1591|    296|                autoFlag = XML_INPUT_AUTO_UTF16LE;
  ------------------
  |  |   36|    296|#define XML_INPUT_AUTO_UTF16LE      (2u << 1)
  ------------------
 1592|    296|                bomSize = 2;
 1593|    296|            }
 1594|    507|            break;
 1595|   372k|    }
 1596|       |
 1597|   372k|    if (bomSize > 0) {
  ------------------
  |  Branch (1597:9): [True: 1.71k, False: 370k]
  ------------------
 1598|  1.71k|        ctxt->input->cur += bomSize;
 1599|  1.71k|    }
 1600|       |
 1601|   372k|    if (enc != XML_CHAR_ENCODING_NONE) {
  ------------------
  |  Branch (1601:9): [True: 11.1k, False: 361k]
  ------------------
 1602|  11.1k|        ctxt->input->flags |= autoFlag;
 1603|       |
 1604|  11.1k|        if (enc == XML_CHAR_ENCODING_EBCDIC) {
  ------------------
  |  Branch (1604:13): [True: 4.67k, False: 6.50k]
  ------------------
 1605|  4.67k|            xmlCharEncodingHandlerPtr handler;
 1606|  4.67k|            xmlParserErrors res;
 1607|       |
 1608|  4.67k|            res = xmlDetectEBCDIC(ctxt, &handler);
 1609|  4.67k|            if (res != XML_ERR_OK) {
  ------------------
  |  Branch (1609:17): [True: 110, False: 4.56k]
  ------------------
 1610|    110|                xmlFatalErr(ctxt, res, "detecting EBCDIC\n");
 1611|  4.56k|            } else {
 1612|  4.56k|                xmlSwitchToEncoding(ctxt, handler);
 1613|  4.56k|            }
 1614|  6.50k|        } else {
 1615|  6.50k|            xmlSwitchEncoding(ctxt, enc);
 1616|  6.50k|        }
 1617|  11.1k|    }
 1618|   372k|}
xmlSetDeclaredEncoding:
 1632|  6.37k|xmlSetDeclaredEncoding(xmlParserCtxt *ctxt, xmlChar *encoding) {
 1633|  6.37k|    if (((ctxt->input->flags & XML_INPUT_HAS_ENCODING) == 0) &&
  ------------------
  |  |   33|  6.37k|#define XML_INPUT_HAS_ENCODING      (1u << 0)
  ------------------
  |  Branch (1633:9): [True: 6.36k, False: 5]
  ------------------
 1634|  6.36k|        ((ctxt->options & XML_PARSE_IGNORE_ENC) == 0)) {
  ------------------
  |  Branch (1634:9): [True: 5.20k, False: 1.16k]
  ------------------
 1635|  5.20k|        xmlCharEncodingHandlerPtr handler;
 1636|  5.20k|        xmlParserErrors res;
 1637|  5.20k|        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.20k|        if (ctxt->html)
  ------------------
  |  Branch (1644:13): [True: 0, False: 5.20k]
  ------------------
 1645|      0|            flags |= XML_ENC_HTML;
 1646|  5.20k|        res = xmlCreateCharEncodingHandler((const char *) encoding,
 1647|  5.20k|                flags, ctxt->convImpl, ctxt->convCtxt, &handler);
 1648|  5.20k|        if (res != XML_ERR_OK) {
  ------------------
  |  Branch (1648:13): [True: 854, False: 4.35k]
  ------------------
 1649|    854|            xmlFatalErr(ctxt, res, (const char *) encoding);
 1650|    854|            xmlFree(encoding);
 1651|    854|            return;
 1652|    854|        }
 1653|       |
 1654|  4.35k|        res  = xmlInputSetEncodingHandler(ctxt->input, handler);
 1655|  4.35k|        if (res != XML_ERR_OK) {
  ------------------
  |  Branch (1655:13): [True: 782, False: 3.56k]
  ------------------
 1656|    782|            xmlCtxtErrIO(ctxt, res, NULL);
 1657|    782|            xmlFree(encoding);
 1658|    782|            return;
 1659|    782|        }
 1660|       |
 1661|  3.56k|        ctxt->input->flags |= XML_INPUT_USES_ENC_DECL;
  ------------------
  |  |   39|  3.56k|#define XML_INPUT_USES_ENC_DECL     (1u << 4)
  ------------------
 1662|  3.56k|    } else if (ctxt->input->flags & XML_INPUT_AUTO_ENCODING) {
  ------------------
  |  |   34|  1.16k|#define XML_INPUT_AUTO_ENCODING     (7u << 1)
  ------------------
  |  Branch (1662:16): [True: 5, False: 1.16k]
  ------------------
 1663|      5|        static const char *allowedUTF8[] = {
 1664|      5|            "UTF-8", "UTF8", NULL
 1665|      5|        };
 1666|      5|        static const char *allowedUTF16LE[] = {
 1667|      5|            "UTF-16", "UTF-16LE", "UTF16", NULL
 1668|      5|        };
 1669|      5|        static const char *allowedUTF16BE[] = {
 1670|      5|            "UTF-16", "UTF-16BE", "UTF16", NULL
 1671|      5|        };
 1672|      5|        const char **allowed = NULL;
 1673|      5|        const char *autoEnc = NULL;
 1674|       |
 1675|      5|        switch (ctxt->input->flags & XML_INPUT_AUTO_ENCODING) {
  ------------------
  |  |   34|      5|#define XML_INPUT_AUTO_ENCODING     (7u << 1)
  ------------------
  |  Branch (1675:17): [True: 4, False: 1]
  ------------------
 1676|      4|            case XML_INPUT_AUTO_UTF8:
  ------------------
  |  |   35|      4|#define XML_INPUT_AUTO_UTF8         (1u << 1)
  ------------------
  |  Branch (1676:13): [True: 4, False: 1]
  ------------------
 1677|      4|                allowed = allowedUTF8;
 1678|      4|                autoEnc = "UTF-8";
 1679|      4|                break;
 1680|      0|            case XML_INPUT_AUTO_UTF16LE:
  ------------------
  |  |   36|      0|#define XML_INPUT_AUTO_UTF16LE      (2u << 1)
  ------------------
  |  Branch (1680:13): [True: 0, False: 5]
  ------------------
 1681|      0|                allowed = allowedUTF16LE;
 1682|      0|                autoEnc = "UTF-16LE";
 1683|      0|                break;
 1684|      0|            case XML_INPUT_AUTO_UTF16BE:
  ------------------
  |  |   37|      0|#define XML_INPUT_AUTO_UTF16BE      (3u << 1)
  ------------------
  |  Branch (1684:13): [True: 0, False: 5]
  ------------------
 1685|      0|                allowed = allowedUTF16BE;
 1686|      0|                autoEnc = "UTF-16BE";
 1687|      0|                break;
 1688|      5|        }
 1689|       |
 1690|      5|        if (allowed != NULL) {
  ------------------
  |  Branch (1690:13): [True: 4, False: 1]
  ------------------
 1691|      4|            const char **p;
 1692|      4|            int match = 0;
 1693|       |
 1694|     10|            for (p = allowed; *p != NULL; p++) {
  ------------------
  |  Branch (1694:31): [True: 7, False: 3]
  ------------------
 1695|      7|                if (xmlStrcasecmp(encoding, BAD_CAST *p) == 0) {
  ------------------
  |  |   34|      7|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (1695:21): [True: 1, False: 6]
  ------------------
 1696|      1|                    match = 1;
 1697|      1|                    break;
 1698|      1|                }
 1699|      7|            }
 1700|       |
 1701|      4|            if (match == 0) {
  ------------------
  |  Branch (1701:17): [True: 3, False: 1]
  ------------------
 1702|      3|                xmlWarningMsg(ctxt, XML_WAR_ENCODING_MISMATCH,
 1703|      3|                              "Encoding '%s' doesn't match "
 1704|      3|                              "auto-detected '%s'\n",
 1705|      3|                              encoding, BAD_CAST autoEnc);
  ------------------
  |  |   34|      3|#define BAD_CAST (xmlChar *)
  ------------------
 1706|      3|                xmlFree(encoding);
 1707|      3|                encoding = xmlStrdup(BAD_CAST autoEnc);
  ------------------
  |  |   34|      3|#define BAD_CAST (xmlChar *)
  ------------------
 1708|      3|                if (encoding == NULL)
  ------------------
  |  Branch (1708:21): [True: 1, False: 2]
  ------------------
 1709|      1|                    xmlCtxtErrMemory(ctxt);
 1710|      3|            }
 1711|      4|        }
 1712|      5|    }
 1713|       |
 1714|  4.73k|    if (ctxt->encoding != NULL)
  ------------------
  |  Branch (1714:9): [True: 1.42k, False: 3.30k]
  ------------------
 1715|  1.42k|        xmlFree(ctxt->encoding);
 1716|  4.73k|    ctxt->encoding = encoding;
 1717|  4.73k|}
xmlGetActualEncoding:
 1740|  31.7k|xmlGetActualEncoding(xmlParserCtxt *ctxt) {
 1741|  31.7k|    const xmlChar *encoding = NULL;
 1742|       |
 1743|  31.7k|    if ((ctxt->input->flags & XML_INPUT_USES_ENC_DECL) ||
  ------------------
  |  |   39|  31.7k|#define XML_INPUT_USES_ENC_DECL     (1u << 4)
  ------------------
  |  Branch (1743:9): [True: 726, False: 31.0k]
  ------------------
 1744|  31.0k|        (ctxt->input->flags & XML_INPUT_AUTO_ENCODING)) {
  ------------------
  |  |   34|  31.0k|#define XML_INPUT_AUTO_ENCODING     (7u << 1)
  ------------------
  |  Branch (1744:9): [True: 490, False: 30.5k]
  ------------------
 1745|       |        /* Preserve encoding exactly */
 1746|  1.21k|        encoding = ctxt->encoding;
 1747|  30.5k|    } else if ((ctxt->input->buf) && (ctxt->input->buf->encoder)) {
  ------------------
  |  Branch (1747:16): [True: 30.5k, False: 0]
  |  Branch (1747:38): [True: 201, False: 30.3k]
  ------------------
 1748|    201|        encoding = BAD_CAST ctxt->input->buf->encoder->name;
  ------------------
  |  |   34|    201|#define BAD_CAST (xmlChar *)
  ------------------
 1749|  30.3k|    } else if (ctxt->input->flags & XML_INPUT_HAS_ENCODING) {
  ------------------
  |  |   33|  30.3k|#define XML_INPUT_HAS_ENCODING      (1u << 0)
  ------------------
  |  Branch (1749:16): [True: 203, False: 30.1k]
  ------------------
 1750|    203|        encoding = BAD_CAST "UTF-8";
  ------------------
  |  |   34|    203|#define BAD_CAST (xmlChar *)
  ------------------
 1751|    203|    }
 1752|       |
 1753|  31.7k|    return(encoding);
 1754|  31.7k|}
xmlFreeInputStream:
 1768|   391k|xmlFreeInputStream(xmlParserInput *input) {
 1769|   391k|    if (input == NULL) return;
  ------------------
  |  Branch (1769:9): [True: 2.23k, False: 389k]
  ------------------
 1770|       |
 1771|   389k|    if (input->filename != NULL) xmlFree((char *) input->filename);
  ------------------
  |  Branch (1771:9): [True: 332k, False: 57.2k]
  ------------------
 1772|   389k|    if (input->version != NULL) xmlFree((char *) input->version);
  ------------------
  |  Branch (1772:9): [True: 238k, False: 151k]
  ------------------
 1773|   389k|    if ((input->free != NULL) && (input->base != NULL))
  ------------------
  |  Branch (1773:9): [True: 0, False: 389k]
  |  Branch (1773:34): [True: 0, False: 0]
  ------------------
 1774|      0|        input->free((xmlChar *) input->base);
 1775|   389k|    if (input->buf != NULL)
  ------------------
  |  Branch (1775:9): [True: 389k, False: 0]
  ------------------
 1776|   389k|        xmlFreeParserInputBuffer(input->buf);
 1777|   389k|    xmlFree(input);
 1778|   389k|}
xmlNewInputFromMemory:
 1892|   332k|                      xmlParserInputFlags flags) {
 1893|   332k|    xmlParserInputBufferPtr buf;
 1894|       |
 1895|   332k|    if (mem == NULL)
  ------------------
  |  Branch (1895:9): [True: 0, False: 332k]
  ------------------
 1896|      0|	return(NULL);
 1897|       |
 1898|   332k|    buf = xmlNewInputBufferMemory(mem, size, flags, XML_CHAR_ENCODING_NONE);
 1899|   332k|    if (buf == NULL)
  ------------------
  |  Branch (1899:9): [True: 25, False: 332k]
  ------------------
 1900|     25|        return(NULL);
 1901|       |
 1902|   332k|    return(xmlNewInputInternal(buf, url));
 1903|   332k|}
xmlNewInputFromString:
 1954|  14.4k|                      xmlParserInputFlags flags) {
 1955|  14.4k|    xmlParserInputBufferPtr buf;
 1956|       |
 1957|  14.4k|    if (str == NULL)
  ------------------
  |  Branch (1957:9): [True: 0, False: 14.4k]
  ------------------
 1958|      0|	return(NULL);
 1959|       |
 1960|  14.4k|    buf = xmlNewInputBufferString(str, flags);
 1961|  14.4k|    if (buf == NULL)
  ------------------
  |  Branch (1961:9): [True: 4, False: 14.4k]
  ------------------
 1962|      4|        return(NULL);
 1963|       |
 1964|  14.4k|    return(xmlNewInputInternal(buf, url));
 1965|  14.4k|}
xmlCtxtNewInputFromString:
 1978|  14.4k|                          xmlParserInputFlags flags) {
 1979|  14.4k|    xmlParserInputPtr input;
 1980|       |
 1981|  14.4k|    if ((ctxt == NULL) || (str == NULL))
  ------------------
  |  Branch (1981:9): [True: 0, False: 14.4k]
  |  Branch (1981:27): [True: 0, False: 14.4k]
  ------------------
 1982|      0|	return(NULL);
 1983|       |
 1984|  14.4k|    input = xmlNewInputFromString(url, str, flags);
 1985|  14.4k|    if (input == NULL) {
  ------------------
  |  Branch (1985:9): [True: 8, False: 14.4k]
  ------------------
 1986|      8|        xmlCtxtErrMemory(ctxt);
 1987|      8|        return(NULL);
 1988|      8|    }
 1989|       |
 1990|  14.4k|    if (encoding != NULL)
  ------------------
  |  Branch (1990:9): [True: 0, False: 14.4k]
  ------------------
 1991|      0|        xmlSwitchInputEncodingName(ctxt, input, encoding);
 1992|       |
 1993|  14.4k|    return(input);
 1994|  14.4k|}
xmlNewPushInput:
 2155|  42.8k|xmlNewPushInput(const char *url, const char *chunk, int size) {
 2156|  42.8k|    xmlParserInputBufferPtr buf;
 2157|  42.8k|    xmlParserInputPtr input;
 2158|       |
 2159|  42.8k|    buf = xmlAllocParserInputBuffer(XML_CHAR_ENCODING_NONE);
 2160|  42.8k|    if (buf == NULL)
  ------------------
  |  Branch (2160:9): [True: 9, False: 42.8k]
  ------------------
 2161|      9|        return(NULL);
 2162|       |
 2163|  42.8k|    input = xmlNewInputInternal(buf, url);
 2164|  42.8k|    if (input == NULL)
  ------------------
  |  Branch (2164:9): [True: 6, False: 42.8k]
  ------------------
 2165|      6|	return(NULL);
 2166|       |
 2167|  42.8k|    input->flags |= XML_INPUT_PROGRESSIVE;
  ------------------
  |  |   41|  42.8k|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  ------------------
 2168|       |
 2169|  42.8k|    if ((size > 0) && (chunk != NULL)) {
  ------------------
  |  Branch (2169:9): [True: 41.6k, False: 1.17k]
  |  Branch (2169:23): [True: 41.6k, False: 0]
  ------------------
 2170|  41.6k|        int res;
 2171|       |
 2172|  41.6k|	res = xmlParserInputBufferPush(input->buf, size, chunk);
 2173|  41.6k|        xmlBufResetInput(input->buf->buffer, input);
 2174|  41.6k|        if (res < 0) {
  ------------------
  |  Branch (2174:13): [True: 0, False: 41.6k]
  ------------------
 2175|      0|            xmlFreeInputStream(input);
 2176|      0|            return(NULL);
 2177|      0|        }
 2178|  41.6k|    }
 2179|       |
 2180|  42.8k|    return(input);
 2181|  42.8k|}
xmlNewEntityInputStream:
 2224|   147k|xmlNewEntityInputStream(xmlParserCtxt *ctxt, xmlEntity *ent) {
 2225|   147k|    xmlParserInputPtr input;
 2226|       |
 2227|   147k|    if ((ctxt == NULL) || (ent == NULL))
  ------------------
  |  Branch (2227:9): [True: 0, False: 147k]
  |  Branch (2227:27): [True: 0, False: 147k]
  ------------------
 2228|      0|	return(NULL);
 2229|       |
 2230|   147k|    if (ent->content != NULL) {
  ------------------
  |  Branch (2230:9): [True: 14.4k, False: 133k]
  ------------------
 2231|  14.4k|        input = xmlCtxtNewInputFromString(ctxt, NULL,
 2232|  14.4k|                (const char *) ent->content, NULL, XML_INPUT_BUF_STATIC);
 2233|   133k|    } else if (ent->URI != NULL) {
  ------------------
  |  Branch (2233:16): [True: 132k, False: 567]
  ------------------
 2234|   132k|        xmlResourceType rtype;
 2235|       |
 2236|   132k|        if (ent->etype == XML_EXTERNAL_PARAMETER_ENTITY)
  ------------------
  |  Branch (2236:13): [True: 128k, False: 4.55k]
  ------------------
 2237|   128k|            rtype = XML_RESOURCE_PARAMETER_ENTITY;
 2238|  4.55k|        else
 2239|  4.55k|            rtype = XML_RESOURCE_GENERAL_ENTITY;
 2240|       |
 2241|   132k|        input = xmlLoadResource(ctxt, (char *) ent->URI,
 2242|   132k|                                (char *) ent->ExternalID, rtype);
 2243|   132k|    } else {
 2244|    567|        return(NULL);
 2245|    567|    }
 2246|       |
 2247|   147k|    if (input == NULL)
  ------------------
  |  Branch (2247:9): [True: 3.83k, False: 143k]
  ------------------
 2248|  3.83k|        return(NULL);
 2249|       |
 2250|   143k|    input->entity = ent;
 2251|       |
 2252|   143k|    return(input);
 2253|   147k|}
xmlCtxtSetResourceLoader:
 2645|  53.7k|                         void *vctxt) {
 2646|  53.7k|    if (ctxt == NULL)
  ------------------
  |  Branch (2646:9): [True: 0, False: 53.7k]
  ------------------
 2647|      0|        return;
 2648|       |
 2649|  53.7k|    ctxt->resourceLoader = loader;
 2650|  53.7k|    ctxt->resourceCtxt = vctxt;
 2651|  53.7k|}
xmlLoadResource:
 2662|   339k|                xmlResourceType type) {
 2663|   339k|    char *canonicFilename;
 2664|   339k|    xmlParserInputPtr ret;
 2665|       |
 2666|   339k|    if (url == NULL)
  ------------------
  |  Branch (2666:9): [True: 266, False: 338k]
  ------------------
 2667|    266|        return(NULL);
 2668|       |
 2669|   338k|    if ((ctxt != NULL) && (ctxt->resourceLoader != NULL)) {
  ------------------
  |  Branch (2669:9): [True: 338k, False: 0]
  |  Branch (2669:27): [True: 338k, False: 0]
  ------------------
 2670|   338k|        char *resource = NULL;
 2671|   338k|        void *userData;
 2672|   338k|        xmlParserInputFlags flags = 0;
 2673|   338k|        int code;
 2674|       |
 2675|   338k|#ifdef LIBXML_CATALOG_ENABLED
 2676|   338k|        resource = xmlCtxtResolveFromCatalog(ctxt, url, publicId);
 2677|   338k|        if (resource != NULL)
  ------------------
  |  Branch (2677:13): [True: 0, False: 338k]
  ------------------
 2678|      0|            url = resource;
 2679|   338k|#endif
 2680|       |
 2681|   338k|        if (ctxt->options & XML_PARSE_UNZIP)
  ------------------
  |  Branch (2681:13): [True: 232k, False: 105k]
  ------------------
 2682|   232k|            flags |= XML_INPUT_UNZIP;
 2683|   338k|        if ((ctxt->options & XML_PARSE_NONET) == 0)
  ------------------
  |  Branch (2683:13): [True: 212k, False: 126k]
  ------------------
 2684|   212k|            flags |= XML_INPUT_NETWORK;
 2685|       |
 2686|   338k|        userData = ctxt->resourceCtxt;
 2687|   338k|        if (userData == NULL)
  ------------------
  |  Branch (2687:13): [True: 338k, False: 0]
  ------------------
 2688|   338k|            userData = ctxt;
 2689|       |
 2690|   338k|        code = ctxt->resourceLoader(userData, url, publicId, type,
 2691|   338k|                                    flags, &ret);
 2692|   338k|        if (code != XML_ERR_OK) {
  ------------------
  |  Branch (2692:13): [True: 6.55k, False: 332k]
  ------------------
 2693|  6.55k|            xmlCtxtErrIO(ctxt, code, url);
 2694|  6.55k|            ret = NULL;
 2695|  6.55k|        }
 2696|   338k|        if (resource != NULL)
  ------------------
  |  Branch (2696:13): [True: 0, False: 338k]
  ------------------
 2697|      0|            xmlFree(resource);
 2698|   338k|        return(ret);
 2699|   338k|    }
 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|  53.8k|{
 2948|  53.8k|    xmlParserInputPtr input;
 2949|       |
 2950|  53.8k|    if (ctxt == NULL) return;
  ------------------
  |  Branch (2950:9): [True: 45, False: 53.8k]
  ------------------
 2951|       |
 2952|   107k|    while ((input = xmlCtxtPopInput(ctxt)) != NULL) { /* Non consuming */
  ------------------
  |  Branch (2952:12): [True: 53.2k, False: 53.8k]
  ------------------
 2953|  53.2k|        xmlFreeInputStream(input);
 2954|  53.2k|    }
 2955|  53.8k|    if (ctxt->spaceTab != NULL) xmlFree(ctxt->spaceTab);
  ------------------
  |  Branch (2955:9): [True: 53.7k, False: 30]
  ------------------
 2956|  53.8k|    if (ctxt->nameTab != NULL) xmlFree((xmlChar * *)ctxt->nameTab);
  ------------------
  |  Branch (2956:9): [True: 53.7k, False: 26]
  ------------------
 2957|  53.8k|    if (ctxt->nodeTab != NULL) xmlFree(ctxt->nodeTab);
  ------------------
  |  Branch (2957:9): [True: 53.7k, False: 21]
  ------------------
 2958|  53.8k|    if (ctxt->nodeInfoTab != NULL) xmlFree(ctxt->nodeInfoTab);
  ------------------
  |  Branch (2958:9): [True: 0, False: 53.8k]
  ------------------
 2959|  53.8k|    if (ctxt->inputTab != NULL) xmlFree(ctxt->inputTab);
  ------------------
  |  Branch (2959:9): [True: 53.8k, False: 15]
  ------------------
 2960|  53.8k|    if (ctxt->version != NULL) xmlFree(ctxt->version);
  ------------------
  |  Branch (2960:9): [True: 51.0k, False: 2.80k]
  ------------------
 2961|  53.8k|    if (ctxt->encoding != NULL) xmlFree(ctxt->encoding);
  ------------------
  |  Branch (2961:9): [True: 1.04k, False: 52.7k]
  ------------------
 2962|  53.8k|    if (ctxt->extSubURI != NULL) xmlFree(ctxt->extSubURI);
  ------------------
  |  Branch (2962:9): [True: 3.90k, False: 49.9k]
  ------------------
 2963|  53.8k|    if (ctxt->extSubSystem != NULL) xmlFree(ctxt->extSubSystem);
  ------------------
  |  Branch (2963:9): [True: 822, False: 52.9k]
  ------------------
 2964|  53.8k|#ifdef LIBXML_SAX1_ENABLED
 2965|  53.8k|    if ((ctxt->sax != NULL) &&
  ------------------
  |  Branch (2965:9): [True: 53.8k, False: 9]
  ------------------
 2966|  53.8k|        (ctxt->sax != (xmlSAXHandlerPtr) &xmlDefaultSAXHandler))
  ------------------
  |  Branch (2966:9): [True: 53.8k, False: 0]
  ------------------
 2967|       |#else
 2968|       |    if (ctxt->sax != NULL)
 2969|       |#endif /* LIBXML_SAX1_ENABLED */
 2970|  53.8k|        xmlFree(ctxt->sax);
 2971|  53.8k|    if (ctxt->directory != NULL) xmlFree(ctxt->directory);
  ------------------
  |  Branch (2971:9): [True: 11.8k, False: 41.9k]
  ------------------
 2972|  53.8k|    if (ctxt->vctxt.nodeTab != NULL) xmlFree(ctxt->vctxt.nodeTab);
  ------------------
  |  Branch (2972:9): [True: 0, False: 53.8k]
  ------------------
 2973|  53.8k|    if (ctxt->atts != NULL) xmlFree((xmlChar * *)ctxt->atts);
  ------------------
  |  Branch (2973:9): [True: 27.4k, False: 26.3k]
  ------------------
 2974|  53.8k|    if (ctxt->dict != NULL) xmlDictFree(ctxt->dict);
  ------------------
  |  Branch (2974:9): [True: 53.8k, False: 4]
  ------------------
 2975|  53.8k|    if (ctxt->nsTab != NULL) xmlFree(ctxt->nsTab);
  ------------------
  |  Branch (2975:9): [True: 11.0k, False: 42.8k]
  ------------------
 2976|  53.8k|    if (ctxt->nsdb != NULL) xmlParserNsFree(ctxt->nsdb);
  ------------------
  |  Branch (2976:9): [True: 53.7k, False: 35]
  ------------------
 2977|  53.8k|    if (ctxt->attrHash != NULL) xmlFree(ctxt->attrHash);
  ------------------
  |  Branch (2977:9): [True: 7.91k, False: 45.9k]
  ------------------
 2978|  53.8k|    if (ctxt->pushTab != NULL) xmlFree(ctxt->pushTab);
  ------------------
  |  Branch (2978:9): [True: 32.6k, False: 21.1k]
  ------------------
 2979|  53.8k|    if (ctxt->attallocs != NULL) xmlFree(ctxt->attallocs);
  ------------------
  |  Branch (2979:9): [True: 14.8k, False: 38.9k]
  ------------------
 2980|  53.8k|    if (ctxt->attsDefault != NULL)
  ------------------
  |  Branch (2980:9): [True: 3.12k, False: 50.6k]
  ------------------
 2981|  3.12k|        xmlHashFree(ctxt->attsDefault, xmlHashDefaultDeallocator);
 2982|  53.8k|    if (ctxt->attsSpecial != NULL)
  ------------------
  |  Branch (2982:9): [True: 3.63k, False: 50.1k]
  ------------------
 2983|  3.63k|        xmlHashFree(ctxt->attsSpecial, NULL);
 2984|  53.8k|    if (ctxt->freeElems != NULL) {
  ------------------
  |  Branch (2984:9): [True: 28.7k, False: 25.0k]
  ------------------
 2985|  28.7k|        xmlNodePtr cur, next;
 2986|       |
 2987|  28.7k|	cur = ctxt->freeElems;
 2988|  57.5k|	while (cur != NULL) {
  ------------------
  |  Branch (2988:9): [True: 28.7k, False: 28.7k]
  ------------------
 2989|  28.7k|	    next = cur->next;
 2990|  28.7k|	    xmlFree(cur);
 2991|  28.7k|	    cur = next;
 2992|  28.7k|	}
 2993|  28.7k|    }
 2994|  53.8k|    if (ctxt->freeAttrs != NULL) {
  ------------------
  |  Branch (2994:9): [True: 16.3k, False: 37.5k]
  ------------------
 2995|  16.3k|        xmlAttrPtr cur, next;
 2996|       |
 2997|  16.3k|	cur = ctxt->freeAttrs;
 2998|  32.6k|	while (cur != NULL) {
  ------------------
  |  Branch (2998:9): [True: 16.3k, False: 16.3k]
  ------------------
 2999|  16.3k|	    next = cur->next;
 3000|  16.3k|	    xmlFree(cur);
 3001|  16.3k|	    cur = next;
 3002|  16.3k|	}
 3003|  16.3k|    }
 3004|       |    /*
 3005|       |     * cleanup the error strings
 3006|       |     */
 3007|  53.8k|    if (ctxt->lastError.message != NULL)
  ------------------
  |  Branch (3007:9): [True: 37.6k, False: 16.1k]
  ------------------
 3008|  37.6k|        xmlFree(ctxt->lastError.message);
 3009|  53.8k|    if (ctxt->lastError.file != NULL)
  ------------------
  |  Branch (3009:9): [True: 10.1k, False: 43.6k]
  ------------------
 3010|  10.1k|        xmlFree(ctxt->lastError.file);
 3011|  53.8k|    if (ctxt->lastError.str1 != NULL)
  ------------------
  |  Branch (3011:9): [True: 21.0k, False: 32.8k]
  ------------------
 3012|  21.0k|        xmlFree(ctxt->lastError.str1);
 3013|  53.8k|    if (ctxt->lastError.str2 != NULL)
  ------------------
  |  Branch (3013:9): [True: 6.39k, False: 47.4k]
  ------------------
 3014|  6.39k|        xmlFree(ctxt->lastError.str2);
 3015|  53.8k|    if (ctxt->lastError.str3 != NULL)
  ------------------
  |  Branch (3015:9): [True: 612, False: 53.2k]
  ------------------
 3016|    612|        xmlFree(ctxt->lastError.str3);
 3017|       |
 3018|  53.8k|#ifdef LIBXML_CATALOG_ENABLED
 3019|  53.8k|    if (ctxt->catalogs != NULL)
  ------------------
  |  Branch (3019:9): [True: 0, False: 53.8k]
  ------------------
 3020|      0|	xmlCatalogFreeLocal(ctxt->catalogs);
 3021|  53.8k|#endif
 3022|  53.8k|    xmlFree(ctxt);
 3023|  53.8k|}
xmlNewParserCtxt:
 3033|  10.9k|{
 3034|  10.9k|    return(xmlNewSAXParserCtxt(NULL, NULL));
 3035|  10.9k|}
xmlNewSAXParserCtxt:
 3054|  53.8k|{
 3055|  53.8k|    xmlParserCtxtPtr ctxt;
 3056|       |
 3057|  53.8k|    xmlInitParser();
 3058|       |
 3059|  53.8k|    ctxt = (xmlParserCtxtPtr) xmlMalloc(sizeof(xmlParserCtxt));
 3060|  53.8k|    if (ctxt == NULL)
  ------------------
  |  Branch (3060:9): [True: 8, False: 53.8k]
  ------------------
 3061|      8|	return(NULL);
 3062|  53.8k|    memset(ctxt, 0, sizeof(xmlParserCtxt));
 3063|  53.8k|    if (xmlInitSAXParserCtxt(ctxt, sax, userData) < 0) {
  ------------------
  |  Branch (3063:9): [True: 35, False: 53.7k]
  ------------------
 3064|     35|        xmlFreeParserCtxt(ctxt);
 3065|     35|	return(NULL);
 3066|     35|    }
 3067|  53.7k|    return(ctxt);
 3068|  53.8k|}
xmlInitNodeInfoSeq:
 3540|  53.7k|{
 3541|  53.7k|    if (seq == NULL)
  ------------------
  |  Branch (3541:9): [True: 0, False: 53.7k]
  ------------------
 3542|      0|        return;
 3543|  53.7k|    seq->length = 0;
 3544|  53.7k|    seq->maximum = 0;
 3545|       |    seq->buffer = NULL;
 3546|  53.7k|}
parserInternals.c:xmlDetectEBCDIC:
 1168|  4.67k|xmlDetectEBCDIC(xmlParserCtxtPtr ctxt, xmlCharEncodingHandlerPtr *hout) {
 1169|  4.67k|    xmlChar out[200];
 1170|  4.67k|    xmlParserInputPtr input = ctxt->input;
 1171|  4.67k|    xmlCharEncodingHandlerPtr handler;
 1172|  4.67k|    int inlen, outlen, i;
 1173|  4.67k|    xmlParserErrors code;
 1174|  4.67k|    xmlCharEncError res;
 1175|       |
 1176|  4.67k|    *hout = NULL;
 1177|       |
 1178|       |    /*
 1179|       |     * To detect the EBCDIC code page, we convert the first 200 bytes
 1180|       |     * to IBM037 (EBCDIC-US) and try to find the encoding declaration.
 1181|       |     */
 1182|  4.67k|    code = xmlCreateCharEncodingHandler("IBM037", XML_ENC_INPUT,
 1183|  4.67k|            ctxt->convImpl, ctxt->convCtxt, &handler);
 1184|  4.67k|    if (code != XML_ERR_OK)
  ------------------
  |  Branch (1184:9): [True: 8, False: 4.66k]
  ------------------
 1185|      8|        return(code);
 1186|  4.66k|    outlen = sizeof(out) - 1;
 1187|  4.66k|    inlen = input->end - input->cur;
 1188|  4.66k|    res = xmlEncInputChunk(handler, out, &outlen, input->cur, &inlen,
 1189|  4.66k|                           /* flush */ 0);
 1190|       |    /*
 1191|       |     * Return the EBCDIC handler if decoding failed. The error will
 1192|       |     * be reported later.
 1193|       |     */
 1194|  4.66k|    if (res < 0)
  ------------------
  |  Branch (1194:9): [True: 824, False: 3.83k]
  ------------------
 1195|    824|        goto done;
 1196|  3.83k|    out[outlen] = 0;
 1197|       |
 1198|   104k|    for (i = 0; i < outlen; i++) {
  ------------------
  |  Branch (1198:17): [True: 102k, False: 2.01k]
  ------------------
 1199|   102k|        if (out[i] == '>')
  ------------------
  |  Branch (1199:13): [True: 319, False: 101k]
  ------------------
 1200|    319|            break;
 1201|   101k|        if ((out[i] == 'e') &&
  ------------------
  |  Branch (1201:13): [True: 4.72k, False: 97.0k]
  ------------------
 1202|  4.72k|            (xmlStrncmp(out + i, BAD_CAST "encoding", 8) == 0)) {
  ------------------
  |  |   34|  4.72k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (1202:13): [True: 1.50k, False: 3.21k]
  ------------------
 1203|  1.50k|            int start, cur, quote;
 1204|       |
 1205|  1.50k|            i += 8;
 1206|  1.50k|            while (IS_BLANK_CH(out[i]))
 1207|    812|                i += 1;
 1208|  1.50k|            if (out[i++] != '=')
  ------------------
  |  Branch (1208:17): [True: 241, False: 1.26k]
  ------------------
 1209|    241|                break;
 1210|  1.26k|            while (IS_BLANK_CH(out[i]))
 1211|    940|                i += 1;
 1212|  1.26k|            quote = out[i++];
 1213|  1.26k|            if ((quote != '\'') && (quote != '"'))
  ------------------
  |  Branch (1213:17): [True: 1.01k, False: 253]
  |  Branch (1213:36): [True: 546, False: 469]
  ------------------
 1214|    546|                break;
 1215|    722|            start = i;
 1216|    722|            cur = out[i];
 1217|  4.59k|            while (((cur >= 'a') && (cur <= 'z')) ||
  ------------------
  |  Branch (1217:21): [True: 1.08k, False: 3.51k]
  |  Branch (1217:37): [True: 807, False: 276]
  ------------------
 1218|  3.79k|                   ((cur >= 'A') && (cur <= 'Z')) ||
  ------------------
  |  Branch (1218:21): [True: 2.32k, False: 1.46k]
  |  Branch (1218:37): [True: 1.15k, False: 1.17k]
  ------------------
 1219|  2.63k|                   ((cur >= '0') && (cur <= '9')) ||
  ------------------
  |  Branch (1219:21): [True: 1.55k, False: 1.08k]
  |  Branch (1219:37): [True: 381, False: 1.17k]
  ------------------
 1220|  2.25k|                   (cur == '.') || (cur == '_') ||
  ------------------
  |  Branch (1220:20): [True: 253, False: 2.00k]
  |  Branch (1220:36): [True: 897, False: 1.10k]
  ------------------
 1221|  1.10k|                   (cur == '-'))
  ------------------
  |  Branch (1221:20): [True: 386, False: 722]
  ------------------
 1222|  3.87k|                cur = out[++i];
 1223|    722|            if (cur != quote)
  ------------------
  |  Branch (1223:17): [True: 515, False: 207]
  ------------------
 1224|    515|                break;
 1225|    207|            out[i] = 0;
 1226|    207|            xmlCharEncCloseFunc(handler);
 1227|    207|            code = xmlCreateCharEncodingHandler((char *) out + start,
 1228|    207|                    XML_ENC_INPUT, ctxt->convImpl, ctxt->convCtxt,
 1229|    207|                    &handler);
 1230|    207|            if (code != XML_ERR_OK)
  ------------------
  |  Branch (1230:17): [True: 95, False: 112]
  ------------------
 1231|     95|                return(code);
 1232|    112|            *hout = handler;
 1233|    112|            return(XML_ERR_OK);
 1234|    207|        }
 1235|   101k|    }
 1236|       |
 1237|  4.45k|done:
 1238|       |    /*
 1239|       |     * Encoding handlers are stateful, so we have to recreate them.
 1240|       |     */
 1241|  4.45k|    xmlCharEncCloseFunc(handler);
 1242|  4.45k|    code = xmlCreateCharEncodingHandler("IBM037", XML_ENC_INPUT,
 1243|  4.45k|            ctxt->convImpl, ctxt->convCtxt, &handler);
 1244|  4.45k|    if (code != XML_ERR_OK)
  ------------------
  |  Branch (1244:9): [True: 7, False: 4.44k]
  ------------------
 1245|      7|        return(code);
 1246|  4.44k|    *hout = handler;
 1247|  4.44k|    return(XML_ERR_OK);
 1248|  4.45k|}
parserInternals.c:xmlNewInputInternal:
 1842|   389k|xmlNewInputInternal(xmlParserInputBufferPtr buf, const char *filename) {
 1843|   389k|    xmlParserInputPtr input;
 1844|       |
 1845|   389k|    input = (xmlParserInputPtr) xmlMalloc(sizeof(xmlParserInput));
 1846|   389k|    if (input == NULL) {
  ------------------
  |  Branch (1846:9): [True: 23, False: 389k]
  ------------------
 1847|     23|	xmlFreeParserInputBuffer(buf);
 1848|     23|	return(NULL);
 1849|     23|    }
 1850|   389k|    memset(input, 0, sizeof(xmlParserInput));
 1851|   389k|    input->line = 1;
 1852|   389k|    input->col = 1;
 1853|       |
 1854|   389k|    input->buf = buf;
 1855|   389k|    xmlBufResetInput(input->buf->buffer, input);
 1856|       |
 1857|   389k|    if (filename != NULL) {
  ------------------
  |  Branch (1857:9): [True: 332k, False: 57.2k]
  ------------------
 1858|   332k|        input->filename = xmlMemStrdup(filename);
 1859|   332k|        if (input->filename == NULL) {
  ------------------
  |  Branch (1859:13): [True: 8, False: 332k]
  ------------------
 1860|      8|            xmlFreeInputStream(input);
 1861|      8|            return(NULL);
 1862|      8|        }
 1863|   332k|    }
 1864|       |
 1865|   389k|    return(input);
 1866|   389k|}
parserInternals.c:xmlCtxtResolveFromCatalog:
 2363|   338k|                          const char *publicId) {
 2364|   338k|    char *resource;
 2365|   338k|    void *localCatalogs = NULL;
 2366|   338k|    int allowGlobal = 1;
 2367|   338k|    xmlParserErrors code;
 2368|       |
 2369|   338k|    if (ctxt != NULL) {
  ------------------
  |  Branch (2369:9): [True: 338k, False: 0]
  ------------------
 2370|       |        /*
 2371|       |         * Loading of HTML documents shouldn't use XML catalogs.
 2372|       |         */
 2373|   338k|        if (ctxt->html)
  ------------------
  |  Branch (2373:13): [True: 0, False: 338k]
  ------------------
 2374|      0|            return(NULL);
 2375|       |
 2376|   338k|        localCatalogs = ctxt->catalogs;
 2377|       |
 2378|   338k|        if (ctxt->options & XML_PARSE_NO_SYS_CATALOG)
  ------------------
  |  Branch (2378:13): [True: 47.1k, False: 291k]
  ------------------
 2379|  47.1k|            allowGlobal = 0;
 2380|   338k|    }
 2381|       |
 2382|   338k|    switch (xmlCatalogGetDefaults()) {
  ------------------
  |  Branch (2382:13): [True: 338k, False: 0]
  ------------------
 2383|   338k|        case XML_CATA_ALLOW_NONE:
  ------------------
  |  Branch (2383:9): [True: 338k, False: 0]
  ------------------
 2384|   338k|            return(NULL);
 2385|      0|        case XML_CATA_ALLOW_DOCUMENT:
  ------------------
  |  Branch (2385:9): [True: 0, False: 338k]
  ------------------
 2386|      0|            allowGlobal = 0;
 2387|      0|            break;
 2388|      0|        case XML_CATA_ALLOW_GLOBAL:
  ------------------
  |  Branch (2388:9): [True: 0, False: 338k]
  ------------------
 2389|      0|            localCatalogs = NULL;
 2390|      0|            break;
 2391|      0|        case XML_CATA_ALLOW_ALL:
  ------------------
  |  Branch (2391:9): [True: 0, False: 338k]
  ------------------
 2392|      0|            break;
 2393|   338k|    }
 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|   338k|}
parserInternals.c:xmlInitSAXParserCtxt:
 2766|  53.8k|{
 2767|  53.8k|    xmlParserInputPtr input;
 2768|  53.8k|#ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
 2769|  53.8k|    size_t initialNodeTabSize = 1;
 2770|       |#else
 2771|       |    size_t initialNodeTabSize = 10;
 2772|       |#endif
 2773|       |
 2774|  53.8k|    if (ctxt == NULL)
  ------------------
  |  Branch (2774:9): [True: 0, False: 53.8k]
  ------------------
 2775|      0|        return(-1);
 2776|       |
 2777|  53.8k|    if (ctxt->dict == NULL)
  ------------------
  |  Branch (2777:9): [True: 53.8k, False: 0]
  ------------------
 2778|  53.8k|	ctxt->dict = xmlDictCreate();
 2779|  53.8k|    if (ctxt->dict == NULL)
  ------------------
  |  Branch (2779:9): [True: 4, False: 53.8k]
  ------------------
 2780|      4|	return(-1);
 2781|       |
 2782|  53.8k|    if (ctxt->sax == NULL)
  ------------------
  |  Branch (2782:9): [True: 53.8k, False: 0]
  ------------------
 2783|  53.8k|	ctxt->sax = (xmlSAXHandler *) xmlMalloc(sizeof(xmlSAXHandler));
 2784|  53.8k|    if (ctxt->sax == NULL)
  ------------------
  |  Branch (2784:9): [True: 5, False: 53.8k]
  ------------------
 2785|      5|	return(-1);
 2786|  53.8k|    if (sax == NULL) {
  ------------------
  |  Branch (2786:9): [True: 10.9k, False: 42.8k]
  ------------------
 2787|  10.9k|	memset(ctxt->sax, 0, sizeof(xmlSAXHandler));
 2788|  10.9k|        xmlSAXVersion(ctxt->sax, 2);
 2789|  10.9k|        ctxt->userData = ctxt;
 2790|  42.8k|    } else {
 2791|  42.8k|	if (sax->initialized == XML_SAX2_MAGIC) {
  ------------------
  |  |  953|  42.8k|#define XML_SAX2_MAGIC 0xDEEDBEAF
  ------------------
  |  Branch (2791:6): [True: 42.8k, False: 0]
  ------------------
 2792|  42.8k|	    memcpy(ctxt->sax, sax, sizeof(xmlSAXHandler));
 2793|  42.8k|        } else {
 2794|      0|	    memset(ctxt->sax, 0, sizeof(xmlSAXHandler));
 2795|      0|	    memcpy(ctxt->sax, sax, sizeof(xmlSAXHandlerV1));
 2796|      0|        }
 2797|  42.8k|        ctxt->userData = userData ? userData : ctxt;
  ------------------
  |  Branch (2797:26): [True: 0, False: 42.8k]
  ------------------
 2798|  42.8k|    }
 2799|       |
 2800|  53.8k|    ctxt->maxatts = 0;
 2801|  53.8k|    ctxt->atts = NULL;
 2802|       |    /* Allocate the Input stack */
 2803|  53.8k|    if (ctxt->inputTab == NULL) {
  ------------------
  |  Branch (2803:9): [True: 53.8k, False: 0]
  ------------------
 2804|  53.8k|#ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
 2805|  53.8k|        size_t initialSize = 1;
 2806|       |#else
 2807|       |        size_t initialSize = 5;
 2808|       |#endif
 2809|       |
 2810|  53.8k|	ctxt->inputTab = xmlMalloc(initialSize * sizeof(xmlParserInputPtr));
 2811|  53.8k|	ctxt->inputMax = initialSize;
 2812|  53.8k|    }
 2813|  53.8k|    if (ctxt->inputTab == NULL)
  ------------------
  |  Branch (2813:9): [True: 6, False: 53.8k]
  ------------------
 2814|      6|	return(-1);
 2815|  53.8k|    while ((input = xmlCtxtPopInput(ctxt)) != NULL) { /* Non consuming */
  ------------------
  |  Branch (2815:12): [True: 0, False: 53.8k]
  ------------------
 2816|      0|        xmlFreeInputStream(input);
 2817|      0|    }
 2818|  53.8k|    ctxt->inputNr = 0;
 2819|  53.8k|    ctxt->input = NULL;
 2820|       |
 2821|  53.8k|    ctxt->version = NULL;
 2822|  53.8k|    ctxt->encoding = NULL;
 2823|  53.8k|    ctxt->standalone = -1;
 2824|  53.8k|    ctxt->hasExternalSubset = 0;
 2825|  53.8k|    ctxt->hasPErefs = 0;
 2826|  53.8k|    ctxt->html = 0;
 2827|  53.8k|    ctxt->instate = XML_PARSER_START;
 2828|       |
 2829|       |    /* Allocate the Node stack */
 2830|  53.8k|    if (ctxt->nodeTab == NULL) {
  ------------------
  |  Branch (2830:9): [True: 53.8k, False: 0]
  ------------------
 2831|  53.8k|	ctxt->nodeTab = xmlMalloc(initialNodeTabSize * sizeof(xmlNodePtr));
 2832|  53.8k|	ctxt->nodeMax = initialNodeTabSize;
 2833|  53.8k|    }
 2834|  53.8k|    if (ctxt->nodeTab == NULL)
  ------------------
  |  Branch (2834:9): [True: 6, False: 53.7k]
  ------------------
 2835|      6|	return(-1);
 2836|  53.7k|    ctxt->nodeNr = 0;
 2837|  53.7k|    ctxt->node = NULL;
 2838|       |
 2839|       |    /* Allocate the Name stack */
 2840|  53.7k|    if (ctxt->nameTab == NULL) {
  ------------------
  |  Branch (2840:9): [True: 53.7k, False: 0]
  ------------------
 2841|  53.7k|	ctxt->nameTab = xmlMalloc(initialNodeTabSize * sizeof(xmlChar *));
 2842|  53.7k|	ctxt->nameMax = initialNodeTabSize;
 2843|  53.7k|    }
 2844|  53.7k|    if (ctxt->nameTab == NULL)
  ------------------
  |  Branch (2844:9): [True: 5, False: 53.7k]
  ------------------
 2845|      5|	return(-1);
 2846|  53.7k|    ctxt->nameNr = 0;
 2847|  53.7k|    ctxt->name = NULL;
 2848|       |
 2849|       |    /* Allocate the space stack */
 2850|  53.7k|    if (ctxt->spaceTab == NULL) {
  ------------------
  |  Branch (2850:9): [True: 53.7k, False: 0]
  ------------------
 2851|  53.7k|	ctxt->spaceTab = xmlMalloc(initialNodeTabSize * sizeof(int));
 2852|  53.7k|	ctxt->spaceMax = initialNodeTabSize;
 2853|  53.7k|    }
 2854|  53.7k|    if (ctxt->spaceTab == NULL)
  ------------------
  |  Branch (2854:9): [True: 4, False: 53.7k]
  ------------------
 2855|      4|	return(-1);
 2856|  53.7k|    ctxt->spaceNr = 1;
 2857|  53.7k|    ctxt->spaceTab[0] = -1;
 2858|  53.7k|    ctxt->space = &ctxt->spaceTab[0];
 2859|  53.7k|    ctxt->myDoc = NULL;
 2860|  53.7k|    ctxt->wellFormed = 1;
 2861|  53.7k|    ctxt->nsWellFormed = 1;
 2862|  53.7k|    ctxt->valid = 1;
 2863|       |
 2864|  53.7k|    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|  53.7k|    ctxt->loadsubset = xmlLoadExtDtdDefaultValue;
  ------------------
  |  | 1331|  53.7k|  #define xmlLoadExtDtdDefaultValue (*__xmlLoadExtDtdDefaultValue())
  ------------------
 2873|  53.7k|    if (ctxt->loadsubset) {
  ------------------
  |  Branch (2873:9): [True: 0, False: 53.7k]
  ------------------
 2874|      0|        ctxt->options |= XML_PARSE_DTDLOAD;
 2875|      0|    }
 2876|  53.7k|    ctxt->validate = xmlDoValidityCheckingDefaultValue;
  ------------------
  |  | 1302|  53.7k|    (*__xmlDoValidityCheckingDefaultValue())
  ------------------
 2877|  53.7k|    if (ctxt->validate) {
  ------------------
  |  Branch (2877:9): [True: 0, False: 53.7k]
  ------------------
 2878|      0|        ctxt->options |= XML_PARSE_DTDVALID;
 2879|      0|    }
 2880|  53.7k|    ctxt->pedantic = xmlPedanticParserDefaultValue;
  ------------------
  |  | 1339|  53.7k|    (*__xmlPedanticParserDefaultValue())
  ------------------
 2881|  53.7k|    if (ctxt->pedantic) {
  ------------------
  |  Branch (2881:9): [True: 0, False: 53.7k]
  ------------------
 2882|      0|        ctxt->options |= XML_PARSE_PEDANTIC;
 2883|      0|    }
 2884|  53.7k|    ctxt->keepBlanks = xmlKeepBlanksDefaultValue;
  ------------------
  |  | 1316|  53.7k|  #define xmlKeepBlanksDefaultValue (*__xmlKeepBlanksDefaultValue())
  ------------------
 2885|  53.7k|    if (ctxt->keepBlanks == 0) {
  ------------------
  |  Branch (2885:9): [True: 0, False: 53.7k]
  ------------------
 2886|      0|	ctxt->sax->ignorableWhitespace = xmlSAX2IgnorableWhitespace;
 2887|      0|	ctxt->options |= XML_PARSE_NOBLANKS;
 2888|      0|    }
 2889|  53.7k|    ctxt->replaceEntities = xmlSubstituteEntitiesDefaultValue;
  ------------------
  |  | 1347|  53.7k|    (*__xmlSubstituteEntitiesDefaultValue())
  ------------------
 2890|  53.7k|    if (ctxt->replaceEntities) {
  ------------------
  |  Branch (2890:9): [True: 0, False: 53.7k]
  ------------------
 2891|      0|        ctxt->options |= XML_PARSE_NOENT;
 2892|      0|    }
 2893|  53.7k|    if (xmlGetWarningsDefaultValue == 0)
  ------------------
  |  | 1309|  53.7k|    (*__xmlGetWarningsDefaultValue())
  ------------------
  |  Branch (2893:9): [True: 0, False: 53.7k]
  ------------------
 2894|      0|        ctxt->options |= XML_PARSE_NOWARNING;
 2895|       |
 2896|  53.7k|    ctxt->vctxt.flags = XML_VCTXT_USE_PCTXT;
  ------------------
  |  |   20|  53.7k|#define XML_VCTXT_USE_PCTXT (1u << 1)
  ------------------
 2897|  53.7k|    ctxt->vctxt.userData = ctxt;
 2898|  53.7k|    ctxt->vctxt.error = xmlParserValidityError;
 2899|  53.7k|    ctxt->vctxt.warning = xmlParserValidityWarning;
 2900|       |
 2901|  53.7k|    ctxt->record_info = 0;
 2902|  53.7k|    ctxt->checkIndex = 0;
 2903|  53.7k|    ctxt->inSubset = 0;
 2904|  53.7k|    ctxt->errNo = XML_ERR_OK;
 2905|  53.7k|    ctxt->depth = 0;
 2906|  53.7k|    ctxt->catalogs = NULL;
 2907|  53.7k|    ctxt->sizeentities = 0;
 2908|  53.7k|    ctxt->sizeentcopy = 0;
 2909|  53.7k|    ctxt->input_id = 1;
 2910|  53.7k|    ctxt->maxAmpl = XML_MAX_AMPLIFICATION_DEFAULT;
  ------------------
  |  |   60|  53.7k|#define XML_MAX_AMPLIFICATION_DEFAULT 5
  ------------------
 2911|  53.7k|    xmlInitNodeInfoSeq(&ctxt->node_seq);
 2912|       |
 2913|  53.7k|    if (ctxt->nsdb == NULL) {
  ------------------
  |  Branch (2913:9): [True: 53.7k, False: 0]
  ------------------
 2914|  53.7k|        ctxt->nsdb = xmlParserNsCreate();
 2915|  53.7k|        if (ctxt->nsdb == NULL)
  ------------------
  |  Branch (2915:13): [True: 5, False: 53.7k]
  ------------------
 2916|      5|            return(-1);
 2917|  53.7k|    }
 2918|       |
 2919|  53.7k|    return(0);
 2920|  53.7k|}

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

xmlInitMutex:
   57|     12|{
   58|     12|#ifdef HAVE_POSIX_THREADS
   59|     12|    pthread_mutex_init(&mutex->lock, NULL);
   60|       |#elif defined HAVE_WIN32_THREADS
   61|       |    InitializeCriticalSection(&mutex->cs);
   62|       |#else
   63|       |    (void) mutex;
   64|       |#endif
   65|     12|}
xmlMutexLock:
  124|   167k|{
  125|   167k|    if (tok == NULL)
  ------------------
  |  Branch (125:9): [True: 0, False: 167k]
  ------------------
  126|      0|        return;
  127|   167k|#ifdef HAVE_POSIX_THREADS
  128|       |    /*
  129|       |     * This assumes that __libc_single_threaded won't change while the
  130|       |     * lock is held.
  131|       |     */
  132|   167k|    pthread_mutex_lock(&tok->lock);
  133|       |#elif defined HAVE_WIN32_THREADS
  134|       |    EnterCriticalSection(&tok->cs);
  135|       |#endif
  136|       |
  137|   167k|}
xmlMutexUnlock:
  146|   167k|{
  147|   167k|    if (tok == NULL)
  ------------------
  |  Branch (147:9): [True: 0, False: 167k]
  ------------------
  148|      0|        return;
  149|   167k|#ifdef HAVE_POSIX_THREADS
  150|   167k|    pthread_mutex_unlock(&tok->lock);
  151|       |#elif defined HAVE_WIN32_THREADS
  152|       |    LeaveCriticalSection(&tok->cs);
  153|       |#endif
  154|   167k|}
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.75M|xmlInitParser(void) {
  405|  2.75M|#ifdef HAVE_POSIX_THREADS
  406|  2.75M|    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.75M|}
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|  30.0k|void BINARY_INSERTION_SORT(SORT_TYPE *dst, const size_t size) {
  250|       |  /* don't bother sorting an array of size <= 1 */
  251|  30.0k|  if (size <= 1) {
  ------------------
  |  Branch (251:7): [True: 0, False: 30.0k]
  ------------------
  252|      0|    return;
  253|      0|  }
  254|       |
  255|  30.0k|  BINARY_INSERTION_SORT_START(dst, 1, size);
  ------------------
  |  |  149|  30.0k|#define BINARY_INSERTION_SORT_START    SORT_MAKE_STR(binary_insertion_sort_start)
  |  |  ------------------
  |  |  |  |  146|  30.0k|#define SORT_MAKE_STR(x) SORT_MAKE_STR1(SORT_NAME,x)
  |  |  |  |  ------------------
  |  |  |  |  |  |  145|  30.0k|#define SORT_MAKE_STR1(x, y) SORT_CONCAT(x,y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  144|  30.0k|#define SORT_CONCAT(x, y) x ## _ ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  256|  30.0k|}
libxml_domnode_tim_sort:
  533|  39.8k|void TIM_SORT(SORT_TYPE *dst, const size_t size) {
  534|  39.8k|  size_t minrun;
  535|  39.8k|  TEMP_STORAGE_T _store, *store;
  536|  39.8k|  TIM_SORT_RUN_T run_stack[TIM_SORT_STACK_SIZE];
  537|  39.8k|  size_t stack_curr = 0;
  538|  39.8k|  size_t curr = 0;
  539|       |
  540|       |  /* don't bother sorting an array of size 1 */
  541|  39.8k|  if (size <= 1) {
  ------------------
  |  Branch (541:7): [True: 0, False: 39.8k]
  ------------------
  542|      0|    return;
  543|      0|  }
  544|       |
  545|  39.8k|  if (size < 64) {
  ------------------
  |  Branch (545:7): [True: 30.0k, False: 9.81k]
  ------------------
  546|  30.0k|    BINARY_INSERTION_SORT(dst, size);
  ------------------
  |  |  150|  30.0k|#define BINARY_INSERTION_SORT          SORT_MAKE_STR(binary_insertion_sort)
  |  |  ------------------
  |  |  |  |  146|  30.0k|#define SORT_MAKE_STR(x) SORT_MAKE_STR1(SORT_NAME,x)
  |  |  |  |  ------------------
  |  |  |  |  |  |  145|  30.0k|#define SORT_MAKE_STR1(x, y) SORT_CONCAT(x,y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  144|  30.0k|#define SORT_CONCAT(x, y) x ## _ ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  547|  30.0k|    return;
  548|  30.0k|  }
  549|       |
  550|       |  /* compute the minimum run length */
  551|  9.81k|  minrun = compute_minrun(size);
  552|       |  /* temporary storage for merges */
  553|  9.81k|  store = &_store;
  554|  9.81k|  store->alloc = 0;
  555|  9.81k|  store->storage = NULL;
  556|       |
  557|  9.81k|  if (!PUSH_NEXT(dst, size, store, minrun, run_stack, &stack_curr, &curr)) {
  ------------------
  |  Branch (557:7): [True: 0, False: 9.81k]
  ------------------
  558|      0|    return;
  559|      0|  }
  560|       |
  561|  9.81k|  if (!PUSH_NEXT(dst, size, store, minrun, run_stack, &stack_curr, &curr)) {
  ------------------
  |  Branch (561:7): [True: 7.01k, False: 2.79k]
  ------------------
  562|  7.01k|    return;
  563|  7.01k|  }
  564|       |
  565|  2.79k|  if (!PUSH_NEXT(dst, size, store, minrun, run_stack, &stack_curr, &curr)) {
  ------------------
  |  Branch (565:7): [True: 2.23k, False: 564]
  ------------------
  566|  2.23k|    return;
  567|  2.23k|  }
  568|       |
  569|  6.15k|  while (1) {
  ------------------
  |  Branch (569:10): [True: 6.15k, Folded]
  ------------------
  570|  6.15k|    if (!CHECK_INVARIANT(run_stack, stack_curr)) {
  ------------------
  |  |  153|  6.15k|#define CHECK_INVARIANT                SORT_MAKE_STR(check_invariant)
  |  |  ------------------
  |  |  |  |  146|  6.15k|#define SORT_MAKE_STR(x) SORT_MAKE_STR1(SORT_NAME,x)
  |  |  |  |  ------------------
  |  |  |  |  |  |  145|  6.15k|#define SORT_MAKE_STR1(x, y) SORT_CONCAT(x,y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  144|  6.15k|#define SORT_CONCAT(x, y) x ## _ ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (570:9): [True: 2.30k, False: 3.84k]
  ------------------
  571|  2.30k|      stack_curr = TIM_SORT_COLLAPSE(dst, run_stack, stack_curr, store, size);
  ------------------
  |  |  157|  2.30k|#define TIM_SORT_COLLAPSE              SORT_MAKE_STR(tim_sort_collapse)
  |  |  ------------------
  |  |  |  |  146|  2.30k|#define SORT_MAKE_STR(x) SORT_MAKE_STR1(SORT_NAME,x)
  |  |  |  |  ------------------
  |  |  |  |  |  |  145|  2.30k|#define SORT_MAKE_STR1(x, y) SORT_CONCAT(x,y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  144|  2.30k|#define SORT_CONCAT(x, y) x ## _ ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  572|  2.30k|      continue;
  573|  2.30k|    }
  574|       |
  575|  3.84k|    if (!PUSH_NEXT(dst, size, store, minrun, run_stack, &stack_curr, &curr)) {
  ------------------
  |  Branch (575:9): [True: 564, False: 3.28k]
  ------------------
  576|    564|      return;
  577|    564|    }
  578|  3.84k|  }
  579|    564|}
xpath.c:libxml_domnode_binary_insertion_sort_start:
  219|  36.7k|static void BINARY_INSERTION_SORT_START(SORT_TYPE *dst, const size_t start, const size_t size) {
  220|  36.7k|  size_t i;
  221|       |
  222|   429k|  for (i = start; i < size; i++) {
  ------------------
  |  Branch (222:19): [True: 392k, False: 36.7k]
  ------------------
  223|   392k|    size_t j;
  224|   392k|    SORT_TYPE x;
  ------------------
  |  |  593|   392k|#define SORT_TYPE xmlNodePtr
  ------------------
  225|   392k|    size_t location;
  226|       |
  227|       |    /* If this entry is already correct, just move along */
  228|   392k|    if (SORT_CMP(dst[i - 1], dst[i]) <= 0) {
  ------------------
  |  |  617|   392k|#define SORT_CMP(x, y)  (wrap_cmp(x, y))
  ------------------
  |  Branch (228:9): [True: 242k, False: 150k]
  ------------------
  229|   242k|      continue;
  230|   242k|    }
  231|       |
  232|       |    /* Else we need to find the right place, shift everything over, and squeeze in */
  233|   150k|    x = dst[i];
  234|   150k|    location = BINARY_INSERTION_FIND(dst, x, i);
  ------------------
  |  |  148|   150k|#define BINARY_INSERTION_FIND          SORT_MAKE_STR(binary_insertion_find)
  |  |  ------------------
  |  |  |  |  146|   150k|#define SORT_MAKE_STR(x) SORT_MAKE_STR1(SORT_NAME,x)
  |  |  |  |  ------------------
  |  |  |  |  |  |  145|   150k|#define SORT_MAKE_STR1(x, y) SORT_CONCAT(x,y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  144|   150k|#define SORT_CONCAT(x, y) x ## _ ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  235|       |
  236|   924k|    for (j = i - 1; j >= location; j--) {
  ------------------
  |  Branch (236:21): [True: 778k, False: 146k]
  ------------------
  237|   778k|      dst[j + 1] = dst[j];
  238|       |
  239|   778k|      if (j == 0) { /* check edge case because j is unsigned */
  ------------------
  |  Branch (239:11): [True: 4.78k, False: 774k]
  ------------------
  240|  4.78k|        break;
  241|  4.78k|      }
  242|   778k|    }
  243|       |
  244|   150k|    dst[location] = x;
  245|   150k|  }
  246|  36.7k|}
xpath.c:libxml_domnode_binary_insertion_find:
  180|   150k|    const size_t size) {
  181|   150k|  size_t l, c, r;
  182|   150k|  SORT_TYPE cx;
  ------------------
  |  |  593|   150k|#define SORT_TYPE xmlNodePtr
  ------------------
  183|   150k|  l = 0;
  184|   150k|  r = size - 1;
  185|   150k|  c = r >> 1;
  186|       |
  187|       |  /* check for out of bounds at the beginning. */
  188|   150k|  if (SORT_CMP(x, dst[0]) < 0) {
  ------------------
  |  |  617|   150k|#define SORT_CMP(x, y)  (wrap_cmp(x, y))
  ------------------
  |  Branch (188:7): [True: 4.78k, False: 146k]
  ------------------
  189|  4.78k|    return 0;
  190|   146k|  } else if (SORT_CMP(x, dst[r]) > 0) {
  ------------------
  |  |  617|   146k|#define SORT_CMP(x, y)  (wrap_cmp(x, y))
  ------------------
  |  Branch (190:14): [True: 0, False: 146k]
  ------------------
  191|      0|    return r;
  192|      0|  }
  193|       |
  194|   146k|  cx = dst[c];
  195|       |
  196|   619k|  while (1) {
  ------------------
  |  Branch (196:10): [True: 619k, Folded]
  ------------------
  197|   619k|    const int val = SORT_CMP(x, cx);
  ------------------
  |  |  617|   619k|#define SORT_CMP(x, y)  (wrap_cmp(x, y))
  ------------------
  198|       |
  199|   619k|    if (val < 0) {
  ------------------
  |  Branch (199:9): [True: 141k, False: 477k]
  ------------------
  200|   141k|      if (c - l <= 1) {
  ------------------
  |  Branch (200:11): [True: 54.6k, False: 87.2k]
  ------------------
  201|  54.6k|        return c;
  202|  54.6k|      }
  203|       |
  204|  87.2k|      r = c;
  205|   477k|    } else { /* allow = for stability. The binary search favors the right. */
  206|   477k|      if (r - c <= 1) {
  ------------------
  |  Branch (206:11): [True: 91.4k, False: 386k]
  ------------------
  207|  91.4k|        return c + 1;
  208|  91.4k|      }
  209|       |
  210|   386k|      l = c;
  211|   386k|    }
  212|       |
  213|   473k|    c = l + ((r - l) >> 1);
  214|   473k|    cx = dst[c];
  215|   473k|  }
  216|   146k|}
xpath.c:compute_minrun:
  129|  9.81k|static __inline int compute_minrun(const uint64_t size) {
  130|  9.81k|  const int top_bit = 64 - CLZ(size);
  ------------------
  |  |   78|  9.81k|#define CLZ __builtin_clzll
  ------------------
  131|  9.81k|  const int shift = MAX(top_bit, 6) - 6;
  ------------------
  |  |   67|  9.81k|#define MAX(x,y) (((x) > (y) ? (x) : (y)))
  |  |  ------------------
  |  |  |  Branch (67:20): [True: 9.81k, False: 0]
  |  |  ------------------
  ------------------
  132|  9.81k|  const int minrun = size >> shift;
  133|  9.81k|  const uint64_t mask = (1ULL << shift) - 1;
  134|       |
  135|  9.81k|  if (mask & size) {
  ------------------
  |  Branch (135:7): [True: 5.54k, False: 4.26k]
  ------------------
  136|  5.54k|    return minrun + 1;
  137|  5.54k|  }
  138|       |
  139|  4.26k|  return minrun;
  140|  9.81k|}
xpath.c:PUSH_NEXT:
  496|  26.2k|                              size_t *curr) {
  497|  26.2k|  size_t len = COUNT_RUN(dst, *curr, size);
  ------------------
  |  |  152|  26.2k|#define COUNT_RUN                      SORT_MAKE_STR(count_run)
  |  |  ------------------
  |  |  |  |  146|  26.2k|#define SORT_MAKE_STR(x) SORT_MAKE_STR1(SORT_NAME,x)
  |  |  |  |  ------------------
  |  |  |  |  |  |  145|  26.2k|#define SORT_MAKE_STR1(x, y) SORT_CONCAT(x,y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  144|  26.2k|#define SORT_CONCAT(x, y) x ## _ ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  498|  26.2k|  size_t run = minrun;
  499|       |
  500|  26.2k|  if (run > size - *curr) {
  ------------------
  |  Branch (500:7): [True: 9.42k, False: 16.8k]
  ------------------
  501|  9.42k|    run = size - *curr;
  502|  9.42k|  }
  503|       |
  504|  26.2k|  if (run > len) {
  ------------------
  |  Branch (504:7): [True: 6.74k, False: 19.5k]
  ------------------
  505|  6.74k|    BINARY_INSERTION_SORT_START(&dst[*curr], len, run);
  ------------------
  |  |  149|  6.74k|#define BINARY_INSERTION_SORT_START    SORT_MAKE_STR(binary_insertion_sort_start)
  |  |  ------------------
  |  |  |  |  146|  6.74k|#define SORT_MAKE_STR(x) SORT_MAKE_STR1(SORT_NAME,x)
  |  |  |  |  ------------------
  |  |  |  |  |  |  145|  6.74k|#define SORT_MAKE_STR1(x, y) SORT_CONCAT(x,y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  144|  6.74k|#define SORT_CONCAT(x, y) x ## _ ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  506|  6.74k|    len = run;
  507|  6.74k|  }
  508|       |
  509|  26.2k|  run_stack[*stack_curr].start = *curr;
  510|  26.2k|  run_stack[*stack_curr].length = len;
  511|  26.2k|  (*stack_curr)++;
  512|  26.2k|  *curr += len;
  513|       |
  514|  26.2k|  if (*curr == size) {
  ------------------
  |  Branch (514:7): [True: 9.81k, False: 16.4k]
  ------------------
  515|       |    /* finish up */
  516|  22.2k|    while (*stack_curr > 1) {
  ------------------
  |  Branch (516:12): [True: 12.4k, False: 9.81k]
  ------------------
  517|  12.4k|      TIM_SORT_MERGE(dst, run_stack, *stack_curr, store);
  ------------------
  |  |  156|  12.4k|#define TIM_SORT_MERGE                 SORT_MAKE_STR(tim_sort_merge)
  |  |  ------------------
  |  |  |  |  146|  12.4k|#define SORT_MAKE_STR(x) SORT_MAKE_STR1(SORT_NAME,x)
  |  |  |  |  ------------------
  |  |  |  |  |  |  145|  12.4k|#define SORT_MAKE_STR1(x, y) SORT_CONCAT(x,y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  144|  12.4k|#define SORT_CONCAT(x, y) x ## _ ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  518|  12.4k|      run_stack[*stack_curr - 2].length += run_stack[*stack_curr - 1].length;
  519|  12.4k|      (*stack_curr)--;
  520|  12.4k|    }
  521|       |
  522|  9.81k|    if (store->storage != NULL) {
  ------------------
  |  Branch (522:9): [True: 9.81k, False: 0]
  ------------------
  523|  9.81k|      free(store->storage);
  524|  9.81k|      store->storage = NULL;
  525|  9.81k|    }
  526|       |
  527|  9.81k|    return 0;
  528|  9.81k|  }
  529|       |
  530|  16.4k|  return 1;
  531|  26.2k|}
xpath.c:libxml_domnode_count_run:
  272|  26.2k|static size_t COUNT_RUN(SORT_TYPE *dst, const size_t start, const size_t size) {
  273|  26.2k|  size_t curr;
  274|       |
  275|  26.2k|  if (size - start == 1) {
  ------------------
  |  Branch (275:7): [True: 8.11k, False: 18.1k]
  ------------------
  276|  8.11k|    return 1;
  277|  8.11k|  }
  278|       |
  279|  18.1k|  if (start >= size - 2) {
  ------------------
  |  Branch (279:7): [True: 343, False: 17.8k]
  ------------------
  280|    343|    if (SORT_CMP(dst[size - 2], dst[size - 1]) > 0) {
  ------------------
  |  |  617|    343|#define SORT_CMP(x, y)  (wrap_cmp(x, y))
  ------------------
  |  Branch (280:9): [True: 93, False: 250]
  ------------------
  281|     93|      SORT_SWAP(dst[size - 2], dst[size - 1]);
  ------------------
  |  |   59|     93|#define SORT_SWAP(x,y) {SORT_TYPE __SORT_SWAP_t = (x); (x) = (y); (y) = __SORT_SWAP_t;}
  |  |  ------------------
  |  |  |  |  593|     93|#define SORT_TYPE xmlNodePtr
  |  |  ------------------
  ------------------
  282|     93|    }
  283|       |
  284|    343|    return 2;
  285|    343|  }
  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.3k, False: 1.45k]
  ------------------
  290|       |    /* increasing run */
  291|  1.58M|    while (1) {
  ------------------
  |  Branch (291:12): [True: 1.58M, Folded]
  ------------------
  292|  1.58M|      if (curr == size - 1) {
  ------------------
  |  Branch (292:11): [True: 9.13k, False: 1.57M]
  ------------------
  293|  9.13k|        break;
  294|  9.13k|      }
  295|       |
  296|  1.57M|      if (SORT_CMP(dst[curr - 1], dst[curr]) > 0) {
  ------------------
  |  |  617|  1.57M|#define SORT_CMP(x, y)  (wrap_cmp(x, y))
  ------------------
  |  Branch (296:11): [True: 7.22k, False: 1.57M]
  ------------------
  297|  7.22k|        break;
  298|  7.22k|      }
  299|       |
  300|  1.57M|      curr++;
  301|  1.57M|    }
  302|       |
  303|  16.3k|    return curr - start;
  304|  16.3k|  } else {
  305|       |    /* decreasing run */
  306|  3.97k|    while (1) {
  ------------------
  |  Branch (306:12): [True: 3.97k, Folded]
  ------------------
  307|  3.97k|      if (curr == size - 1) {
  ------------------
  |  Branch (307:11): [True: 207, False: 3.76k]
  ------------------
  308|    207|        break;
  309|    207|      }
  310|       |
  311|  3.76k|      if (SORT_CMP(dst[curr - 1], dst[curr]) <= 0) {
  ------------------
  |  |  617|  3.76k|#define SORT_CMP(x, y)  (wrap_cmp(x, y))
  ------------------
  |  Branch (311:11): [True: 1.25k, False: 2.51k]
  ------------------
  312|  1.25k|        break;
  313|  1.25k|      }
  314|       |
  315|  2.51k|      curr++;
  316|  2.51k|    }
  317|       |
  318|       |    /* reverse in-place */
  319|  1.45k|    REVERSE_ELEMENTS(dst, start, curr - 1);
  ------------------
  |  |  151|  1.45k|#define REVERSE_ELEMENTS               SORT_MAKE_STR(reverse_elements)
  |  |  ------------------
  |  |  |  |  146|  1.45k|#define SORT_MAKE_STR(x) SORT_MAKE_STR1(SORT_NAME,x)
  |  |  |  |  ------------------
  |  |  |  |  |  |  145|  1.45k|#define SORT_MAKE_STR1(x, y) SORT_CONCAT(x,y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  144|  1.45k|#define SORT_CONCAT(x, y) x ## _ ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  320|  1.45k|    return curr - start;
  321|  1.45k|  }
  322|  17.8k|}
xpath.c:libxml_domnode_reverse_elements:
  260|  1.45k|static __inline void REVERSE_ELEMENTS(SORT_TYPE *dst, size_t start, size_t end) {
  261|  3.96k|  while (1) {
  ------------------
  |  Branch (261:10): [True: 3.96k, Folded]
  ------------------
  262|  3.96k|    if (start >= end) {
  ------------------
  |  Branch (262:9): [True: 1.45k, False: 2.50k]
  ------------------
  263|  1.45k|      return;
  264|  1.45k|    }
  265|       |
  266|  2.50k|    SORT_SWAP(dst[start], dst[end]);
  ------------------
  |  |   59|  2.50k|#define SORT_SWAP(x,y) {SORT_TYPE __SORT_SWAP_t = (x); (x) = (y); (y) = __SORT_SWAP_t;}
  |  |  ------------------
  |  |  |  |  593|  2.50k|#define SORT_TYPE xmlNodePtr
  |  |  ------------------
  ------------------
  267|  2.50k|    start++;
  268|  2.50k|    end--;
  269|  2.50k|  }
  270|  1.45k|}
xpath.c:libxml_domnode_tim_sort_merge:
  374|  16.4k|                           TEMP_STORAGE_T *store) {
  375|  16.4k|  const size_t A = stack[stack_curr - 2].length;
  376|  16.4k|  const size_t B = stack[stack_curr - 1].length;
  377|  16.4k|  const size_t curr = stack[stack_curr - 2].start;
  378|  16.4k|  SORT_TYPE *storage;
  ------------------
  |  |  593|  16.4k|#define SORT_TYPE xmlNodePtr
  ------------------
  379|  16.4k|  size_t i, j, k;
  380|  16.4k|  TIM_SORT_RESIZE(store, MIN(A, B));
  ------------------
  |  |  155|  16.4k|#define TIM_SORT_RESIZE                SORT_MAKE_STR(tim_sort_resize)
  |  |  ------------------
  |  |  |  |  146|  16.4k|#define SORT_MAKE_STR(x) SORT_MAKE_STR1(SORT_NAME,x)
  |  |  |  |  ------------------
  |  |  |  |  |  |  145|  16.4k|#define SORT_MAKE_STR1(x, y) SORT_CONCAT(x,y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  144|  16.4k|#define SORT_CONCAT(x, y) x ## _ ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                TIM_SORT_RESIZE(store, MIN(A, B));
  ------------------
  |  |   71|  16.4k|#define MIN(x,y) (((x) < (y) ? (x) : (y)))
  |  |  ------------------
  |  |  |  Branch (71:20): [True: 4.28k, False: 12.1k]
  |  |  ------------------
  ------------------
  381|  16.4k|  storage = store->storage;
  382|       |
  383|       |  /* left merge */
  384|  16.4k|  if (A < B) {
  ------------------
  |  Branch (384:7): [True: 4.28k, False: 12.1k]
  ------------------
  385|  4.28k|    memcpy(storage, &dst[curr], A * sizeof(SORT_TYPE));
  386|  4.28k|    i = 0;
  387|  4.28k|    j = curr + A;
  388|       |
  389|   596k|    for (k = curr; k < curr + A + B; k++) {
  ------------------
  |  Branch (389:20): [True: 595k, False: 470]
  ------------------
  390|   595k|      if ((i < A) && (j < curr + A + B)) {
  ------------------
  |  Branch (390:11): [True: 591k, False: 3.81k]
  |  Branch (390:22): [True: 580k, False: 11.0k]
  ------------------
  391|   580k|        if (SORT_CMP(storage[i], dst[j]) <= 0) {
  ------------------
  |  |  617|   580k|#define SORT_CMP(x, y)  (wrap_cmp(x, y))
  ------------------
  |  Branch (391:13): [True: 279k, False: 301k]
  ------------------
  392|   279k|          dst[k] = storage[i++];
  393|   301k|        } else {
  394|   301k|          dst[k] = dst[j++];
  395|   301k|        }
  396|   580k|      } else if (i < A) {
  ------------------
  |  Branch (396:18): [True: 11.0k, False: 3.81k]
  ------------------
  397|  11.0k|        dst[k] = storage[i++];
  398|  11.0k|      } else {
  399|  3.81k|        break;
  400|  3.81k|      }
  401|   595k|    }
  402|  12.1k|  } else {
  403|       |    /* right merge */
  404|  12.1k|    memcpy(storage, &dst[curr + A], B * sizeof(SORT_TYPE));
  405|  12.1k|    i = B;
  406|  12.1k|    j = curr + A;
  407|  12.1k|    k = curr + A + B;
  408|       |
  409|   608k|    while (k > curr) {
  ------------------
  |  Branch (409:12): [True: 607k, False: 746]
  ------------------
  410|   607k|      k--;
  411|   607k|      if ((i > 0) && (j > curr)) {
  ------------------
  |  Branch (411:11): [True: 596k, False: 11.4k]
  |  Branch (411:22): [True: 584k, False: 12.2k]
  ------------------
  412|   584k|        if (SORT_CMP(dst[j - 1], storage[i - 1]) > 0) {
  ------------------
  |  |  617|   584k|#define SORT_CMP(x, y)  (wrap_cmp(x, y))
  ------------------
  |  Branch (412:13): [True: 195k, False: 388k]
  ------------------
  413|   195k|          dst[k] = dst[--j];
  414|   388k|        } else {
  415|   388k|          dst[k] = storage[--i];
  416|   388k|        }
  417|   584k|      } else if (i > 0) {
  ------------------
  |  Branch (417:18): [True: 12.2k, False: 11.4k]
  ------------------
  418|  12.2k|        dst[k] = storage[--i];
  419|  12.2k|      } else {
  420|  11.4k|        break;
  421|  11.4k|      }
  422|   607k|    }
  423|  12.1k|  }
  424|  16.4k|}
xpath.c:libxml_domnode_tim_sort_resize:
  358|  16.4k|static void TIM_SORT_RESIZE(TEMP_STORAGE_T *store, const size_t new_size) {
  359|  16.4k|  if (store->alloc < new_size) {
  ------------------
  |  Branch (359:7): [True: 12.7k, False: 3.69k]
  ------------------
  360|  12.7k|    SORT_TYPE *tempstore = (SORT_TYPE *)realloc(store->storage, new_size * sizeof(SORT_TYPE));
  ------------------
  |  |  593|  12.7k|#define SORT_TYPE xmlNodePtr
  ------------------
  361|       |
  362|  12.7k|    if (tempstore == NULL) {
  ------------------
  |  Branch (362:9): [True: 0, False: 12.7k]
  ------------------
  363|      0|      fprintf(stderr, "Error allocating temporary storage for tim sort: need %lu bytes",
  364|      0|              (unsigned long)(sizeof(SORT_TYPE) * new_size));
  365|      0|      exit(1);
  366|      0|    }
  367|       |
  368|  12.7k|    store->storage = tempstore;
  369|  12.7k|    store->alloc = new_size;
  370|  12.7k|  }
  371|  16.4k|}
xpath.c:libxml_domnode_check_invariant:
  324|  6.15k|static int CHECK_INVARIANT(TIM_SORT_RUN_T *stack, const int stack_curr) {
  325|  6.15k|  size_t A, B, C;
  326|       |
  327|  6.15k|  if (stack_curr < 2) {
  ------------------
  |  Branch (327:7): [True: 348, False: 5.80k]
  ------------------
  328|    348|    return 1;
  329|    348|  }
  330|       |
  331|  5.80k|  if (stack_curr == 2) {
  ------------------
  |  Branch (331:7): [True: 884, False: 4.92k]
  ------------------
  332|    884|    const size_t A1 = stack[stack_curr - 2].length;
  333|    884|    const size_t B1 = stack[stack_curr - 1].length;
  334|       |
  335|    884|    if (A1 <= B1) {
  ------------------
  |  Branch (335:9): [True: 20, False: 864]
  ------------------
  336|     20|      return 0;
  337|     20|    }
  338|       |
  339|    864|    return 1;
  340|    884|  }
  341|       |
  342|  4.92k|  A = stack[stack_curr - 3].length;
  343|  4.92k|  B = stack[stack_curr - 2].length;
  344|  4.92k|  C = stack[stack_curr - 1].length;
  345|       |
  346|  4.92k|  if ((A <= B + C) || (B <= C)) {
  ------------------
  |  Branch (346:7): [True: 1.60k, False: 3.32k]
  |  Branch (346:23): [True: 683, False: 2.63k]
  ------------------
  347|  2.28k|    return 0;
  348|  2.28k|  }
  349|       |
  350|  2.63k|  return 1;
  351|  4.92k|}
xpath.c:libxml_domnode_tim_sort_collapse:
  427|  2.30k|                             TEMP_STORAGE_T *store, const size_t size) {
  428|  5.95k|  while (1) {
  ------------------
  |  Branch (428:10): [True: 5.95k, Folded]
  ------------------
  429|  5.95k|    size_t A, B, C, D;
  430|  5.95k|    int ABC, BCD, CD;
  431|       |
  432|       |    /* if the stack only has one thing on it, we are done with the collapse */
  433|  5.95k|    if (stack_curr <= 1) {
  ------------------
  |  Branch (433:9): [True: 0, False: 5.95k]
  ------------------
  434|      0|      break;
  435|      0|    }
  436|       |
  437|       |    /* if this is the last merge, just do it */
  438|  5.95k|    if ((stack_curr == 2) && (stack[0].length + stack[1].length == size)) {
  ------------------
  |  Branch (438:9): [True: 1.13k, False: 4.82k]
  |  Branch (438:30): [True: 0, False: 1.13k]
  ------------------
  439|      0|      TIM_SORT_MERGE(dst, stack, stack_curr, store);
  ------------------
  |  |  156|      0|#define TIM_SORT_MERGE                 SORT_MAKE_STR(tim_sort_merge)
  |  |  ------------------
  |  |  |  |  146|      0|#define SORT_MAKE_STR(x) SORT_MAKE_STR1(SORT_NAME,x)
  |  |  |  |  ------------------
  |  |  |  |  |  |  145|      0|#define SORT_MAKE_STR1(x, y) SORT_CONCAT(x,y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  144|      0|#define SORT_CONCAT(x, y) x ## _ ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  440|      0|      stack[0].length += stack[1].length;
  441|      0|      stack_curr--;
  442|      0|      break;
  443|      0|    }
  444|       |    /* check if the invariant is off for a stack of 2 elements */
  445|  5.95k|    else if ((stack_curr == 2) && (stack[0].length <= stack[1].length)) {
  ------------------
  |  Branch (445:14): [True: 1.13k, False: 4.82k]
  |  Branch (445:35): [True: 348, False: 785]
  ------------------
  446|    348|      TIM_SORT_MERGE(dst, stack, stack_curr, store);
  ------------------
  |  |  156|    348|#define TIM_SORT_MERGE                 SORT_MAKE_STR(tim_sort_merge)
  |  |  ------------------
  |  |  |  |  146|    348|#define SORT_MAKE_STR(x) SORT_MAKE_STR1(SORT_NAME,x)
  |  |  |  |  ------------------
  |  |  |  |  |  |  145|    348|#define SORT_MAKE_STR1(x, y) SORT_CONCAT(x,y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  144|    348|#define SORT_CONCAT(x, y) x ## _ ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  447|    348|      stack[0].length += stack[1].length;
  448|    348|      stack_curr--;
  449|    348|      break;
  450|  5.60k|    } else if (stack_curr == 2) {
  ------------------
  |  Branch (450:16): [True: 785, False: 4.82k]
  ------------------
  451|    785|      break;
  452|    785|    }
  453|       |
  454|  4.82k|    B = stack[stack_curr - 3].length;
  455|  4.82k|    C = stack[stack_curr - 2].length;
  456|  4.82k|    D = stack[stack_curr - 1].length;
  457|       |
  458|  4.82k|    if (stack_curr >= 4) {
  ------------------
  |  Branch (458:9): [True: 3.12k, False: 1.69k]
  ------------------
  459|  3.12k|      A = stack[stack_curr - 4].length;
  460|  3.12k|      ABC = (A <= B + C);
  461|  3.12k|    } else {
  462|  1.69k|      ABC = 0;
  463|  1.69k|    }
  464|       |
  465|  4.82k|    BCD = (B <= C + D) || ABC;
  ------------------
  |  Branch (465:11): [True: 2.28k, False: 2.53k]
  |  Branch (465:27): [True: 29, False: 2.50k]
  ------------------
  466|  4.82k|    CD = (C <= D);
  467|       |
  468|       |    /* Both invariants are good */
  469|  4.82k|    if (!BCD && !CD) {
  ------------------
  |  Branch (469:9): [True: 2.50k, False: 2.31k]
  |  Branch (469:17): [True: 1.17k, False: 1.33k]
  ------------------
  470|  1.17k|      break;
  471|  1.17k|    }
  472|       |
  473|       |    /* left merge */
  474|  3.65k|    if (BCD && !CD) {
  ------------------
  |  Branch (474:9): [True: 2.31k, False: 1.33k]
  |  Branch (474:16): [True: 934, False: 1.37k]
  ------------------
  475|    934|      TIM_SORT_MERGE(dst, stack, stack_curr - 1, store);
  ------------------
  |  |  156|    934|#define TIM_SORT_MERGE                 SORT_MAKE_STR(tim_sort_merge)
  |  |  ------------------
  |  |  |  |  146|    934|#define SORT_MAKE_STR(x) SORT_MAKE_STR1(SORT_NAME,x)
  |  |  |  |  ------------------
  |  |  |  |  |  |  145|    934|#define SORT_MAKE_STR1(x, y) SORT_CONCAT(x,y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  144|    934|#define SORT_CONCAT(x, y) x ## _ ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  476|    934|      stack[stack_curr - 3].length += stack[stack_curr - 2].length;
  477|    934|      stack[stack_curr - 2] = stack[stack_curr - 1];
  478|    934|      stack_curr--;
  479|  2.71k|    } else {
  480|       |      /* right merge */
  481|  2.71k|      TIM_SORT_MERGE(dst, stack, stack_curr, store);
  ------------------
  |  |  156|  2.71k|#define TIM_SORT_MERGE                 SORT_MAKE_STR(tim_sort_merge)
  |  |  ------------------
  |  |  |  |  146|  2.71k|#define SORT_MAKE_STR(x) SORT_MAKE_STR1(SORT_NAME,x)
  |  |  |  |  ------------------
  |  |  |  |  |  |  145|  2.71k|#define SORT_MAKE_STR1(x, y) SORT_CONCAT(x,y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  144|  2.71k|#define SORT_CONCAT(x, y) x ## _ ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  482|  2.71k|      stack[stack_curr - 2].length += stack[stack_curr - 1].length;
  483|  2.71k|      stack_curr--;
  484|  2.71k|    }
  485|  3.65k|  }
  486|       |
  487|  2.30k|  return stack_curr;
  488|  2.30k|}

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

xmlParseURISafe:
  962|   906k|xmlParseURISafe(const char *str, xmlURI **uriOut) {
  963|   906k|    xmlURIPtr uri;
  964|   906k|    int ret;
  965|       |
  966|   906k|    if (uriOut == NULL)
  ------------------
  |  Branch (966:9): [True: 0, False: 906k]
  ------------------
  967|      0|        return(1);
  968|   906k|    *uriOut = NULL;
  969|   906k|    if (str == NULL)
  ------------------
  |  Branch (969:9): [True: 0, False: 906k]
  ------------------
  970|      0|	return(1);
  971|       |
  972|   906k|    uri = xmlCreateURI();
  973|   906k|    if (uri == NULL)
  ------------------
  |  Branch (973:9): [True: 153, False: 906k]
  ------------------
  974|    153|        return(-1);
  975|       |
  976|   906k|    ret = xmlParse3986URIReference(uri, str);
  977|   906k|    if (ret) {
  ------------------
  |  Branch (977:9): [True: 25.7k, False: 880k]
  ------------------
  978|  25.7k|        xmlFreeURI(uri);
  979|  25.7k|        return(ret);
  980|  25.7k|    }
  981|       |
  982|   880k|    *uriOut = uri;
  983|   880k|    return(0);
  984|   906k|}
xmlParseURIReference:
 1012|  1.03k|xmlParseURIReference(xmlURI *uri, const char *str) {
 1013|  1.03k|    return(xmlParse3986URIReference(uri, str));
 1014|  1.03k|}
xmlCreateURI:
 1058|  1.03M|xmlCreateURI(void) {
 1059|  1.03M|    xmlURIPtr ret;
 1060|       |
 1061|  1.03M|    ret = (xmlURIPtr) xmlMalloc(sizeof(xmlURI));
 1062|  1.03M|    if (ret == NULL)
  ------------------
  |  Branch (1062:9): [True: 198, False: 1.03M]
  ------------------
 1063|    198|	return(NULL);
 1064|  1.03M|    memset(ret, 0, sizeof(xmlURI));
 1065|  1.03M|    ret->port = PORT_EMPTY;
  ------------------
  |  |   36|  1.03M|#define PORT_EMPTY           0
  ------------------
 1066|  1.03M|    return(ret);
 1067|  1.03M|}
xmlSaveUri:
 1095|   150k|xmlSaveUri(xmlURI *uri) {
 1096|   150k|    xmlChar *ret = NULL;
 1097|   150k|    xmlChar *temp;
 1098|   150k|    const char *p;
 1099|   150k|    int len;
 1100|   150k|    int max;
 1101|       |
 1102|   150k|    if (uri == NULL) return(NULL);
  ------------------
  |  Branch (1102:9): [True: 0, False: 150k]
  ------------------
 1103|       |
 1104|       |
 1105|   150k|    max = 80;
 1106|   150k|    ret = xmlMalloc(max + 1);
 1107|   150k|    if (ret == NULL)
  ------------------
  |  Branch (1107:9): [True: 103, False: 150k]
  ------------------
 1108|    103|	return(NULL);
 1109|   150k|    len = 0;
 1110|       |
 1111|   150k|    if (uri->scheme != NULL) {
  ------------------
  |  Branch (1111:9): [True: 13.5k, False: 136k]
  ------------------
 1112|  13.5k|	p = uri->scheme;
 1113|  96.4k|	while (*p != 0) {
  ------------------
  |  Branch (1113:9): [True: 82.8k, False: 13.5k]
  ------------------
 1114|  82.8k|	    if (len >= max) {
  ------------------
  |  Branch (1114:10): [True: 196, False: 82.6k]
  ------------------
 1115|    196|                temp = xmlSaveUriRealloc(ret, &max);
 1116|    196|                if (temp == NULL) goto mem_error;
  ------------------
  |  Branch (1116:21): [True: 1, False: 195]
  ------------------
 1117|    195|		ret = temp;
 1118|    195|	    }
 1119|  82.8k|	    ret[len++] = *p++;
 1120|  82.8k|	}
 1121|  13.5k|	if (len >= max) {
  ------------------
  |  Branch (1121:6): [True: 202, False: 13.3k]
  ------------------
 1122|    202|            temp = xmlSaveUriRealloc(ret, &max);
 1123|    202|            if (temp == NULL) goto mem_error;
  ------------------
  |  Branch (1123:17): [True: 3, False: 199]
  ------------------
 1124|    199|            ret = temp;
 1125|    199|	}
 1126|  13.5k|	ret[len++] = ':';
 1127|  13.5k|    }
 1128|   150k|    if (uri->opaque != NULL) {
  ------------------
  |  Branch (1128:9): [True: 0, False: 150k]
  ------------------
 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|   150k|    } else {
 1147|   150k|	if ((uri->server != NULL) || (uri->port != PORT_EMPTY)) {
  ------------------
  |  |   36|   140k|#define PORT_EMPTY           0
  ------------------
  |  Branch (1147:6): [True: 9.76k, False: 140k]
  |  Branch (1147:31): [True: 3.43k, False: 137k]
  ------------------
 1148|  13.1k|	    if (len + 3 >= max) {
  ------------------
  |  Branch (1148:10): [True: 199, False: 12.9k]
  ------------------
 1149|    199|                temp = xmlSaveUriRealloc(ret, &max);
 1150|    199|                if (temp == NULL) goto mem_error;
  ------------------
  |  Branch (1150:21): [True: 3, False: 196]
  ------------------
 1151|    196|                ret = temp;
 1152|    196|	    }
 1153|  13.1k|	    ret[len++] = '/';
 1154|  13.1k|	    ret[len++] = '/';
 1155|  13.1k|	    if (uri->user != NULL) {
  ------------------
  |  Branch (1155:10): [True: 4.15k, False: 9.03k]
  ------------------
 1156|  4.15k|		p = uri->user;
 1157|  40.1M|		while (*p != 0) {
  ------------------
  |  Branch (1157:10): [True: 40.1M, False: 4.14k]
  ------------------
 1158|  40.1M|		    if (len + 3 >= max) {
  ------------------
  |  Branch (1158:11): [True: 2.85k, False: 40.1M]
  ------------------
 1159|  2.85k|                        temp = xmlSaveUriRealloc(ret, &max);
 1160|  2.85k|                        if (temp == NULL) goto mem_error;
  ------------------
  |  Branch (1160:29): [True: 12, False: 2.84k]
  ------------------
 1161|  2.84k|                        ret = temp;
 1162|  2.84k|		    }
 1163|  40.1M|		    if ((IS_UNRESERVED(*(p))) ||
  ------------------
  |  |  103|  40.1M|#define IS_UNRESERVED(x) (IS_ALPHANUM(x) || IS_MARK(x))
  |  |  ------------------
  |  |  |  |   73|  80.3M|#define IS_ALPHANUM(x) (IS_ALPHA(x) || IS_DIGIT(x))
  |  |  |  |  ------------------
  |  |  |  |  |  |   45|  80.3M|#define IS_ALPHA(x) (IS_LOWALPHA(x) || IS_UPALPHA(x))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   53|  80.3M|#define IS_LOWALPHA(x) (((x) >= 'a') && ((x) <= 'z'))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (53:25): [True: 25.0k, False: 40.1M]
  |  |  |  |  |  |  |  |  |  Branch (53:41): [True: 21.5k, False: 3.50k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define IS_ALPHA(x) (IS_LOWALPHA(x) || IS_UPALPHA(x))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   60|  40.1M|#define IS_UPALPHA(x) (((x) >= 'A') && ((x) <= 'Z'))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (60:24): [True: 38.0M, False: 2.06M]
  |  |  |  |  |  |  |  |  |  Branch (60:40): [True: 38.0M, False: 4.41k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define IS_ALPHANUM(x) (IS_ALPHA(x) || IS_DIGIT(x))
  |  |  |  |  ------------------
  |  |  |  |  |  |   68|  2.06M|#define IS_DIGIT(x) (((x) >= '0') && ((x) <= '9'))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (68:22): [True: 45.7k, False: 2.02M]
  |  |  |  |  |  |  |  Branch (68:38): [True: 21.2k, False: 24.4k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define IS_UNRESERVED(x) (IS_ALPHANUM(x) || IS_MARK(x))
  |  |  ------------------
  |  |  |  |   79|  2.04M|#define IS_MARK(x) (((x) == '-') || ((x) == '_') || ((x) == '.') ||     \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (79:21): [True: 1.72k, False: 2.04M]
  |  |  |  |  |  Branch (79:37): [True: 787, False: 2.04M]
  |  |  |  |  |  Branch (79:53): [True: 2.58k, False: 2.04M]
  |  |  |  |  ------------------
  |  |  |  |   80|  2.04M|    ((x) == '!') || ((x) == '~') || ((x) == '*') || ((x) == '\'') ||    \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (80:5): [True: 1.49k, False: 2.03M]
  |  |  |  |  |  Branch (80:21): [True: 1.09k, False: 2.03M]
  |  |  |  |  |  Branch (80:37): [True: 3.38k, False: 2.03M]
  |  |  |  |  |  Branch (80:53): [True: 1.29k, False: 2.03M]
  |  |  |  |  ------------------
  |  |  |  |   81|  2.04M|    ((x) == '(') || ((x) == ')'))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (81:5): [True: 1.42k, False: 2.03M]
  |  |  |  |  |  Branch (81:21): [True: 1.40k, False: 2.03M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1164|  2.03M|			((*(p) == ';')) || ((*(p) == ':')) ||
  ------------------
  |  Branch (1164:4): [True: 3.41k, False: 2.02M]
  |  Branch (1164:23): [True: 4.29k, False: 2.02M]
  ------------------
 1165|  2.02M|			((*(p) == '&')) || ((*(p) == '=')) ||
  ------------------
  |  Branch (1165:4): [True: 382, False: 2.02M]
  |  Branch (1165:23): [True: 2.03k, False: 2.02M]
  ------------------
 1166|  2.02M|			((*(p) == '+')) || ((*(p) == '$')) ||
  ------------------
  |  Branch (1166:4): [True: 1.10k, False: 2.01M]
  |  Branch (1166:23): [True: 1.18k, False: 2.01M]
  ------------------
 1167|  2.01M|			((*(p) == ',')))
  ------------------
  |  Branch (1167:4): [True: 540, False: 2.01M]
  ------------------
 1168|  38.1M|			ret[len++] = *p++;
 1169|  2.01M|		    else {
 1170|  2.01M|			int val = *(unsigned char *)p++;
 1171|  2.01M|			int hi = val / 0x10, lo = val % 0x10;
 1172|  2.01M|			ret[len++] = '%';
 1173|  2.01M|			ret[len++] = hi + (hi > 9? 'A'-10 : '0');
  ------------------
  |  Branch (1173:23): [True: 4.08k, False: 2.01M]
  ------------------
 1174|  2.01M|			ret[len++] = lo + (lo > 9? 'A'-10 : '0');
  ------------------
  |  Branch (1174:23): [True: 28.2k, False: 1.98M]
  ------------------
 1175|  2.01M|		    }
 1176|  40.1M|		}
 1177|  4.14k|		if (len + 3 >= max) {
  ------------------
  |  Branch (1177:7): [True: 200, False: 3.94k]
  ------------------
 1178|    200|                    temp = xmlSaveUriRealloc(ret, &max);
 1179|    200|                    if (temp == NULL) goto mem_error;
  ------------------
  |  Branch (1179:25): [True: 3, False: 197]
  ------------------
 1180|    197|                    ret = temp;
 1181|    197|		}
 1182|  4.14k|		ret[len++] = '@';
 1183|  4.14k|	    }
 1184|  13.1k|	    if (uri->server != NULL) {
  ------------------
  |  Branch (1184:10): [True: 9.74k, False: 3.42k]
  ------------------
 1185|  9.74k|		p = uri->server;
 1186|  6.44M|		while (*p != 0) {
  ------------------
  |  Branch (1186:10): [True: 6.43M, False: 9.73k]
  ------------------
 1187|  6.43M|		    if (len >= max) {
  ------------------
  |  Branch (1187:11): [True: 337, False: 6.43M]
  ------------------
 1188|    337|			temp = xmlSaveUriRealloc(ret, &max);
 1189|    337|			if (temp == NULL) goto mem_error;
  ------------------
  |  Branch (1189:8): [True: 8, False: 329]
  ------------------
 1190|    329|			ret = temp;
 1191|    329|		    }
 1192|       |                    /* TODO: escaping? */
 1193|  6.43M|		    ret[len++] = (xmlChar) *p++;
 1194|  6.43M|		}
 1195|  9.74k|	    }
 1196|  13.1k|            if (uri->port > 0) {
  ------------------
  |  Branch (1196:17): [True: 1.49k, False: 11.6k]
  ------------------
 1197|  1.49k|                if (len + 10 >= max) {
  ------------------
  |  Branch (1197:21): [True: 196, False: 1.29k]
  ------------------
 1198|    196|                    temp = xmlSaveUriRealloc(ret, &max);
 1199|    196|                    if (temp == NULL) goto mem_error;
  ------------------
  |  Branch (1199:25): [True: 1, False: 195]
  ------------------
 1200|    195|                    ret = temp;
 1201|    195|                }
 1202|  1.49k|                len += snprintf((char *) &ret[len], max - len, ":%d", uri->port);
 1203|  1.49k|            }
 1204|   137k|	} else if (uri->authority != NULL) {
  ------------------
  |  Branch (1204:13): [True: 0, False: 137k]
  ------------------
 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|   137k|	} else if (uri->scheme != NULL) {
  ------------------
  |  Branch (1232:13): [True: 754, False: 136k]
  ------------------
 1233|    754|	    if (len + 3 >= max) {
  ------------------
  |  Branch (1233:10): [True: 206, False: 548]
  ------------------
 1234|    206|                temp = xmlSaveUriRealloc(ret, &max);
 1235|    206|                if (temp == NULL) goto mem_error;
  ------------------
  |  Branch (1235:21): [True: 1, False: 205]
  ------------------
 1236|    205|                ret = temp;
 1237|    205|	    }
 1238|    754|	}
 1239|   150k|	if (uri->path != NULL) {
  ------------------
  |  Branch (1239:6): [True: 143k, False: 7.16k]
  ------------------
 1240|   143k|	    p = uri->path;
 1241|       |	    /*
 1242|       |	     * the colon in file:///d: should not be escaped or
 1243|       |	     * Windows accesses fail later.
 1244|       |	     */
 1245|   143k|	    if ((uri->scheme != NULL) &&
  ------------------
  |  Branch (1245:10): [True: 8.93k, False: 134k]
  ------------------
 1246|  8.93k|		(p[0] == '/') &&
  ------------------
  |  Branch (1246:3): [True: 8.13k, False: 804]
  ------------------
 1247|  8.13k|		(((p[1] >= 'a') && (p[1] <= 'z')) ||
  ------------------
  |  Branch (1247:5): [True: 2.03k, False: 6.09k]
  |  Branch (1247:22): [True: 1.73k, False: 297]
  ------------------
 1248|  6.39k|		 ((p[1] >= 'A') && (p[1] <= 'Z'))) &&
  ------------------
  |  Branch (1248:5): [True: 798, False: 5.59k]
  |  Branch (1248:22): [True: 497, False: 301]
  ------------------
 1249|  2.23k|		(p[2] == ':') &&
  ------------------
  |  Branch (1249:3): [True: 669, False: 1.56k]
  ------------------
 1250|    669|	        (xmlStrEqual(BAD_CAST uri->scheme, BAD_CAST "file"))) {
  ------------------
  |  |   34|    669|#define BAD_CAST (xmlChar *)
  ------------------
              	        (xmlStrEqual(BAD_CAST uri->scheme, BAD_CAST "file"))) {
  ------------------
  |  |   34|    669|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (1250:10): [True: 401, False: 268]
  ------------------
 1251|    401|		if (len + 3 >= max) {
  ------------------
  |  Branch (1251:7): [True: 205, False: 196]
  ------------------
 1252|    205|                    temp = xmlSaveUriRealloc(ret, &max);
 1253|    205|                    if (temp == NULL) goto mem_error;
  ------------------
  |  Branch (1253:25): [True: 1, False: 204]
  ------------------
 1254|    204|                    ret = temp;
 1255|    204|		}
 1256|    400|		ret[len++] = *p++;
 1257|    400|		ret[len++] = *p++;
 1258|    400|		ret[len++] = *p++;
 1259|    400|	    }
 1260|  5.81M|	    while (*p != 0) {
  ------------------
  |  Branch (1260:13): [True: 5.67M, False: 143k]
  ------------------
 1261|  5.67M|		if (len + 3 >= max) {
  ------------------
  |  Branch (1261:7): [True: 7.91k, False: 5.66M]
  ------------------
 1262|  7.91k|                    temp = xmlSaveUriRealloc(ret, &max);
 1263|  7.91k|                    if (temp == NULL) goto mem_error;
  ------------------
  |  Branch (1263:25): [True: 8, False: 7.90k]
  ------------------
 1264|  7.90k|                    ret = temp;
 1265|  7.90k|		}
 1266|  5.67M|		if ((IS_UNRESERVED(*(p))) || ((*(p) == '/')) ||
  ------------------
  |  |  103|  5.67M|#define IS_UNRESERVED(x) (IS_ALPHANUM(x) || IS_MARK(x))
  |  |  ------------------
  |  |  |  |   73|  11.3M|#define IS_ALPHANUM(x) (IS_ALPHA(x) || IS_DIGIT(x))
  |  |  |  |  ------------------
  |  |  |  |  |  |   45|  11.3M|#define IS_ALPHA(x) (IS_LOWALPHA(x) || IS_UPALPHA(x))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   53|  11.3M|#define IS_LOWALPHA(x) (((x) >= 'a') && ((x) <= 'z'))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (53:25): [True: 818k, False: 4.85M]
  |  |  |  |  |  |  |  |  |  Branch (53:41): [True: 815k, False: 3.45k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define IS_ALPHA(x) (IS_LOWALPHA(x) || IS_UPALPHA(x))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   60|  4.85M|#define IS_UPALPHA(x) (((x) >= 'A') && ((x) <= 'Z'))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (60:24): [True: 3.50M, False: 1.35M]
  |  |  |  |  |  |  |  |  |  Branch (60:40): [True: 3.49M, False: 4.19k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define IS_ALPHANUM(x) (IS_ALPHA(x) || IS_DIGIT(x))
  |  |  |  |  ------------------
  |  |  |  |  |  |   68|  1.36M|#define IS_DIGIT(x) (((x) >= '0') && ((x) <= '9'))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (68:22): [True: 155k, False: 1.20M]
  |  |  |  |  |  |  |  Branch (68:38): [True: 137k, False: 18.1k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define IS_UNRESERVED(x) (IS_ALPHANUM(x) || IS_MARK(x))
  |  |  ------------------
  |  |  |  |   79|  1.22M|#define IS_MARK(x) (((x) == '-') || ((x) == '_') || ((x) == '.') ||     \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (79:21): [True: 10.1k, False: 1.21M]
  |  |  |  |  |  Branch (79:37): [True: 440, False: 1.21M]
  |  |  |  |  |  Branch (79:53): [True: 153k, False: 1.05M]
  |  |  |  |  ------------------
  |  |  |  |   80|  1.22M|    ((x) == '!') || ((x) == '~') || ((x) == '*') || ((x) == '\'') ||    \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (80:5): [True: 4.92k, False: 1.05M]
  |  |  |  |  |  Branch (80:21): [True: 1.47k, False: 1.05M]
  |  |  |  |  |  Branch (80:37): [True: 922k, False: 130k]
  |  |  |  |  |  Branch (80:53): [True: 2.84k, False: 128k]
  |  |  |  |  ------------------
  |  |  |  |   81|  1.22M|    ((x) == '(') || ((x) == ')'))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (81:5): [True: 1.92k, False: 126k]
  |  |  |  |  |  Branch (81:21): [True: 2.45k, False: 123k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (1266:32): [True: 94.1k, False: 29.4k]
  ------------------
 1267|  29.4k|                    ((*(p) == ';')) || ((*(p) == '@')) || ((*(p) == '&')) ||
  ------------------
  |  Branch (1267:21): [True: 2.00k, False: 27.4k]
  |  Branch (1267:40): [True: 3.89k, False: 23.5k]
  |  Branch (1267:59): [True: 395, False: 23.1k]
  ------------------
 1268|  23.1k|	            ((*(p) == '=')) || ((*(p) == '+')) || ((*(p) == '$')) ||
  ------------------
  |  Branch (1268:14): [True: 1.22k, False: 21.9k]
  |  Branch (1268:33): [True: 2.16k, False: 19.7k]
  |  Branch (1268:52): [True: 1.28k, False: 18.4k]
  ------------------
 1269|  18.4k|	            ((*(p) == ',')))
  ------------------
  |  Branch (1269:14): [True: 2.12k, False: 16.3k]
  ------------------
 1270|  5.65M|		    ret[len++] = *p++;
 1271|  16.3k|		else {
 1272|  16.3k|		    int val = *(unsigned char *)p++;
 1273|  16.3k|		    int hi = val / 0x10, lo = val % 0x10;
 1274|  16.3k|		    ret[len++] = '%';
 1275|  16.3k|		    ret[len++] = hi + (hi > 9? 'A'-10 : '0');
  ------------------
  |  Branch (1275:26): [True: 1.14k, False: 15.2k]
  ------------------
 1276|  16.3k|		    ret[len++] = lo + (lo > 9? 'A'-10 : '0');
  ------------------
  |  Branch (1276:26): [True: 10.0k, False: 6.30k]
  ------------------
 1277|  16.3k|		}
 1278|  5.67M|	    }
 1279|   143k|	}
 1280|   150k|	if (uri->query_raw != NULL) {
  ------------------
  |  Branch (1280:6): [True: 6.66k, False: 143k]
  ------------------
 1281|  6.66k|	    if (len + 1 >= max) {
  ------------------
  |  Branch (1281:10): [True: 196, False: 6.46k]
  ------------------
 1282|    196|                temp = xmlSaveUriRealloc(ret, &max);
 1283|    196|                if (temp == NULL) goto mem_error;
  ------------------
  |  Branch (1283:21): [True: 1, False: 195]
  ------------------
 1284|    195|                ret = temp;
 1285|    195|	    }
 1286|  6.66k|	    ret[len++] = '?';
 1287|  6.66k|	    p = uri->query_raw;
 1288|  13.6M|	    while (*p != 0) {
  ------------------
  |  Branch (1288:13): [True: 13.5M, False: 6.65k]
  ------------------
 1289|  13.5M|		if (len + 1 >= max) {
  ------------------
  |  Branch (1289:7): [True: 6.63k, False: 13.5M]
  ------------------
 1290|  6.63k|                    temp = xmlSaveUriRealloc(ret, &max);
 1291|  6.63k|                    if (temp == NULL) goto mem_error;
  ------------------
  |  Branch (1291:25): [True: 11, False: 6.61k]
  ------------------
 1292|  6.61k|                    ret = temp;
 1293|  6.61k|		}
 1294|  13.5M|		ret[len++] = *p++;
 1295|  13.5M|	    }
 1296|   143k|	} else if (uri->query != NULL) {
  ------------------
  |  Branch (1296:13): [True: 0, False: 143k]
  ------------------
 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|   150k|    }
 1322|   150k|    if (uri->fragment != NULL) {
  ------------------
  |  Branch (1322:9): [True: 7.81k, False: 142k]
  ------------------
 1323|  7.81k|	if (len + 3 >= max) {
  ------------------
  |  Branch (1323:6): [True: 376, False: 7.44k]
  ------------------
 1324|    376|            temp = xmlSaveUriRealloc(ret, &max);
 1325|    376|            if (temp == NULL) goto mem_error;
  ------------------
  |  Branch (1325:17): [True: 3, False: 373]
  ------------------
 1326|    373|            ret = temp;
 1327|    373|	}
 1328|  7.81k|	ret[len++] = '#';
 1329|  7.81k|	p = uri->fragment;
 1330|  37.8k|	while (*p != 0) {
  ------------------
  |  Branch (1330:9): [True: 30.0k, False: 7.81k]
  ------------------
 1331|  30.0k|	    if (len + 3 >= max) {
  ------------------
  |  Branch (1331:10): [True: 272, False: 29.7k]
  ------------------
 1332|    272|                temp = xmlSaveUriRealloc(ret, &max);
 1333|    272|                if (temp == NULL) goto mem_error;
  ------------------
  |  Branch (1333:21): [True: 2, False: 270]
  ------------------
 1334|    270|                ret = temp;
 1335|    270|	    }
 1336|  30.0k|	    if ((IS_UNRESERVED(*(p))) || (IS_RESERVED(*(p))))
  ------------------
  |  |  103|  30.0k|#define IS_UNRESERVED(x) (IS_ALPHANUM(x) || IS_MARK(x))
  |  |  ------------------
  |  |  |  |   73|  60.1k|#define IS_ALPHANUM(x) (IS_ALPHA(x) || IS_DIGIT(x))
  |  |  |  |  ------------------
  |  |  |  |  |  |   45|  60.1k|#define IS_ALPHA(x) (IS_LOWALPHA(x) || IS_UPALPHA(x))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   53|  60.1k|#define IS_LOWALPHA(x) (((x) >= 'a') && ((x) <= 'z'))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (53:25): [True: 5.95k, False: 24.1k]
  |  |  |  |  |  |  |  |  |  Branch (53:41): [True: 5.63k, False: 319]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define IS_ALPHA(x) (IS_LOWALPHA(x) || IS_UPALPHA(x))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   60|  24.4k|#define IS_UPALPHA(x) (((x) >= 'A') && ((x) <= 'Z'))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (60:24): [True: 3.52k, False: 20.8k]
  |  |  |  |  |  |  |  |  |  Branch (60:40): [True: 2.23k, False: 1.29k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define IS_ALPHANUM(x) (IS_ALPHA(x) || IS_DIGIT(x))
  |  |  |  |  ------------------
  |  |  |  |  |  |   68|  22.1k|#define IS_DIGIT(x) (((x) >= '0') && ((x) <= '9'))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (68:22): [True: 6.74k, False: 15.4k]
  |  |  |  |  |  |  |  Branch (68:38): [True: 2.56k, False: 4.17k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define IS_UNRESERVED(x) (IS_ALPHANUM(x) || IS_MARK(x))
  |  |  ------------------
  |  |  |  |   79|  19.6k|#define IS_MARK(x) (((x) == '-') || ((x) == '_') || ((x) == '.') ||     \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (79:21): [True: 450, False: 19.1k]
  |  |  |  |  |  Branch (79:37): [True: 265, False: 18.9k]
  |  |  |  |  |  Branch (79:53): [True: 2.14k, False: 16.7k]
  |  |  |  |  ------------------
  |  |  |  |   80|  19.6k|    ((x) == '!') || ((x) == '~') || ((x) == '*') || ((x) == '\'') ||    \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (80:5): [True: 485, False: 16.2k]
  |  |  |  |  |  Branch (80:21): [True: 308, False: 15.9k]
  |  |  |  |  |  Branch (80:37): [True: 690, False: 15.2k]
  |  |  |  |  |  Branch (80:53): [True: 526, False: 14.7k]
  |  |  |  |  ------------------
  |  |  |  |   81|  19.6k|    ((x) == '(') || ((x) == ')'))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (81:5): [True: 333, False: 14.4k]
  |  |  |  |  |  Branch (81:21): [True: 402, False: 14.0k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
              	    if ((IS_UNRESERVED(*(p))) || (IS_RESERVED(*(p))))
  ------------------
  |  |   95|  14.0k|#define IS_RESERVED(x) (((x) == ';') || ((x) == '/') || ((x) == '?') || \
  |  |  ------------------
  |  |  |  Branch (95:25): [True: 1.31k, False: 12.7k]
  |  |  |  Branch (95:41): [True: 748, False: 11.9k]
  |  |  |  Branch (95:57): [True: 478, False: 11.4k]
  |  |  ------------------
  |  |   96|  14.0k|        ((x) == ':') || ((x) == '@') || ((x) == '&') || ((x) == '=') || \
  |  |  ------------------
  |  |  |  Branch (96:9): [True: 472, False: 11.0k]
  |  |  |  Branch (96:25): [True: 305, False: 10.7k]
  |  |  |  Branch (96:41): [True: 194, False: 10.5k]
  |  |  |  Branch (96:57): [True: 308, False: 10.1k]
  |  |  ------------------
  |  |   97|  14.0k|        ((x) == '+') || ((x) == '$') || ((x) == ',') || ((x) == '[') || \
  |  |  ------------------
  |  |  |  Branch (97:9): [True: 474, False: 9.72k]
  |  |  |  Branch (97:25): [True: 524, False: 9.20k]
  |  |  |  Branch (97:41): [True: 7.80k, False: 1.39k]
  |  |  |  Branch (97:57): [True: 421, False: 976]
  |  |  ------------------
  |  |   98|  14.0k|        ((x) == ']'))
  |  |  ------------------
  |  |  |  Branch (98:9): [True: 290, False: 686]
  |  |  ------------------
  ------------------
 1337|  29.3k|		ret[len++] = *p++;
 1338|    686|	    else {
 1339|    686|		int val = *(unsigned char *)p++;
 1340|    686|		int hi = val / 0x10, lo = val % 0x10;
 1341|    686|		ret[len++] = '%';
 1342|    686|		ret[len++] = hi + (hi > 9? 'A'-10 : '0');
  ------------------
  |  Branch (1342:22): [True: 460, False: 226]
  ------------------
 1343|    686|		ret[len++] = lo + (lo > 9? 'A'-10 : '0');
  ------------------
  |  Branch (1343:22): [True: 417, False: 269]
  ------------------
 1344|    686|	    }
 1345|  30.0k|	}
 1346|  7.81k|    }
 1347|   150k|    if (len >= max) {
  ------------------
  |  Branch (1347:9): [True: 197, False: 150k]
  ------------------
 1348|    197|        temp = xmlSaveUriRealloc(ret, &max);
 1349|    197|        if (temp == NULL) goto mem_error;
  ------------------
  |  Branch (1349:13): [True: 3, False: 194]
  ------------------
 1350|    194|        ret = temp;
 1351|    194|    }
 1352|   150k|    ret[len] = 0;
 1353|   150k|    return(ret);
 1354|       |
 1355|     61|mem_error:
 1356|     61|    xmlFree(ret);
 1357|       |    return(NULL);
 1358|   150k|}
xmlFreeURI:
 1412|  1.14M|xmlFreeURI(xmlURI *uri) {
 1413|  1.14M|    if (uri == NULL) return;
  ------------------
  |  Branch (1413:9): [True: 109k, False: 1.03M]
  ------------------
 1414|       |
 1415|  1.03M|    if (uri->scheme != NULL) xmlFree(uri->scheme);
  ------------------
  |  Branch (1415:9): [True: 43.7k, False: 987k]
  ------------------
 1416|  1.03M|    if (uri->server != NULL) xmlFree(uri->server);
  ------------------
  |  Branch (1416:9): [True: 31.5k, False: 999k]
  ------------------
 1417|  1.03M|    if (uri->user != NULL) xmlFree(uri->user);
  ------------------
  |  Branch (1417:9): [True: 7.68k, False: 1.02M]
  ------------------
 1418|  1.03M|    if (uri->path != NULL) xmlFree(uri->path);
  ------------------
  |  Branch (1418:9): [True: 278k, False: 752k]
  ------------------
 1419|  1.03M|    if (uri->fragment != NULL) xmlFree(uri->fragment);
  ------------------
  |  Branch (1419:9): [True: 720k, False: 310k]
  ------------------
 1420|  1.03M|    if (uri->opaque != NULL) xmlFree(uri->opaque);
  ------------------
  |  Branch (1420:9): [True: 0, False: 1.03M]
  ------------------
 1421|  1.03M|    if (uri->authority != NULL) xmlFree(uri->authority);
  ------------------
  |  Branch (1421:9): [True: 0, False: 1.03M]
  ------------------
 1422|  1.03M|    if (uri->query != NULL) xmlFree(uri->query);
  ------------------
  |  Branch (1422:9): [True: 11.3k, False: 1.01M]
  ------------------
 1423|  1.03M|    if (uri->query_raw != NULL) xmlFree(uri->query_raw);
  ------------------
  |  Branch (1423:9): [True: 15.7k, False: 1.01M]
  ------------------
 1424|  1.03M|    xmlFree(uri);
 1425|  1.03M|}
xmlNormalizeURIPath:
 1555|  8.88k|xmlNormalizeURIPath(char *path) {
 1556|  8.88k|    return(xmlNormalizePath(path, 0));
 1557|  8.88k|}
xmlURIUnescapeString:
 1580|  1.66M|xmlURIUnescapeString(const char *str, int len, char *target) {
 1581|  1.66M|    char *ret, *out;
 1582|  1.66M|    const char *in;
 1583|       |
 1584|  1.66M|    if (str == NULL)
  ------------------
  |  Branch (1584:9): [True: 0, False: 1.66M]
  ------------------
 1585|      0|	return(NULL);
 1586|  1.66M|    if (len <= 0) len = strlen(str);
  ------------------
  |  Branch (1586:9): [True: 733k, False: 932k]
  ------------------
 1587|  1.66M|    if (len < 0) return(NULL);
  ------------------
  |  Branch (1587:9): [True: 0, False: 1.66M]
  ------------------
 1588|       |
 1589|  1.66M|    if (target == NULL) {
  ------------------
  |  Branch (1589:9): [True: 1.66M, False: 0]
  ------------------
 1590|  1.66M|	ret = xmlMalloc(len + 1);
 1591|  1.66M|	if (ret == NULL)
  ------------------
  |  Branch (1591:6): [True: 335, False: 1.66M]
  ------------------
 1592|    335|	    return(NULL);
 1593|  1.66M|    } else
 1594|      0|	ret = target;
 1595|  1.66M|    in = str;
 1596|  1.66M|    out = ret;
 1597|   149M|    while(len > 0) {
  ------------------
  |  Branch (1597:11): [True: 147M, False: 1.66M]
  ------------------
 1598|   147M|	if ((len > 2) && (*in == '%') && (is_hex(in[1])) && (is_hex(in[2]))) {
  ------------------
  |  Branch (1598:6): [True: 145M, False: 1.79M]
  |  Branch (1598:19): [True: 2.02M, False: 143M]
  |  Branch (1598:35): [True: 2.01M, False: 1.61k]
  |  Branch (1598:54): [True: 2.01M, False: 1.32k]
  ------------------
 1599|  2.01M|            int c = 0;
 1600|  2.01M|	    in++;
 1601|  2.01M|	    if ((*in >= '0') && (*in <= '9'))
  ------------------
  |  Branch (1601:10): [True: 2.01M, False: 0]
  |  Branch (1601:26): [True: 1.99M, False: 18.2k]
  ------------------
 1602|  1.99M|	        c = (*in - '0');
 1603|  18.2k|	    else if ((*in >= 'a') && (*in <= 'f'))
  ------------------
  |  Branch (1603:15): [True: 7.47k, False: 10.7k]
  |  Branch (1603:31): [True: 7.47k, False: 0]
  ------------------
 1604|  7.47k|	        c = (*in - 'a') + 10;
 1605|  10.7k|	    else if ((*in >= 'A') && (*in <= 'F'))
  ------------------
  |  Branch (1605:15): [True: 10.7k, False: 0]
  |  Branch (1605:31): [True: 10.7k, False: 0]
  ------------------
 1606|  10.7k|	        c = (*in - 'A') + 10;
 1607|  2.01M|	    in++;
 1608|  2.01M|	    if ((*in >= '0') && (*in <= '9'))
  ------------------
  |  Branch (1608:10): [True: 2.01M, False: 0]
  |  Branch (1608:26): [True: 1.98M, False: 28.2k]
  ------------------
 1609|  1.98M|	        c = c * 16 + (*in - '0');
 1610|  28.2k|	    else if ((*in >= 'a') && (*in <= 'f'))
  ------------------
  |  Branch (1610:15): [True: 7.55k, False: 20.7k]
  |  Branch (1610:31): [True: 7.55k, False: 0]
  ------------------
 1611|  7.55k|	        c = c * 16 + (*in - 'a') + 10;
 1612|  20.7k|	    else if ((*in >= 'A') && (*in <= 'F'))
  ------------------
  |  Branch (1612:15): [True: 20.7k, False: 0]
  |  Branch (1612:31): [True: 20.7k, False: 0]
  ------------------
 1613|  20.7k|	        c = c * 16 + (*in - 'A') + 10;
 1614|  2.01M|	    in++;
 1615|  2.01M|	    len -= 3;
 1616|       |            /* Explicit sign change */
 1617|  2.01M|	    *out++ = (char) c;
 1618|   145M|	} else {
 1619|   145M|	    *out++ = *in++;
 1620|   145M|	    len--;
 1621|   145M|	}
 1622|   147M|    }
 1623|  1.66M|    *out = 0;
 1624|  1.66M|    return(ret);
 1625|  1.66M|}
xmlURIEscapeStr:
 1637|  2.25k|xmlURIEscapeStr(const xmlChar *str, const xmlChar *list) {
 1638|  2.25k|    xmlChar *ret, ch;
 1639|  2.25k|    const xmlChar *in;
 1640|  2.25k|    int len, out;
 1641|       |
 1642|  2.25k|    if (str == NULL)
  ------------------
  |  Branch (1642:9): [True: 0, False: 2.25k]
  ------------------
 1643|      0|	return(NULL);
 1644|  2.25k|    if (str[0] == 0)
  ------------------
  |  Branch (1644:9): [True: 0, False: 2.25k]
  ------------------
 1645|      0|	return(xmlStrdup(str));
 1646|  2.25k|    len = xmlStrlen(str);
 1647|  2.25k|    if (len == 0)
  ------------------
  |  Branch (1647:9): [True: 0, False: 2.25k]
  ------------------
 1648|      0|        return(NULL);
 1649|       |
 1650|  2.25k|    len += 20;
 1651|  2.25k|    ret = xmlMalloc(len);
 1652|  2.25k|    if (ret == NULL)
  ------------------
  |  Branch (1652:9): [True: 4, False: 2.24k]
  ------------------
 1653|      4|	return(NULL);
 1654|  2.24k|    in = (const xmlChar *) str;
 1655|  2.24k|    out = 0;
 1656|  2.53M|    while(*in != 0) {
  ------------------
  |  Branch (1656:11): [True: 2.53M, False: 2.24k]
  ------------------
 1657|  2.53M|	if (len - out <= 3) {
  ------------------
  |  Branch (1657:6): [True: 559, False: 2.53M]
  ------------------
 1658|    559|            xmlChar *temp;
 1659|    559|            int newSize;
 1660|       |
 1661|    559|            newSize = xmlGrowCapacity(len, 1, 1, XML_MAX_ITEMS);
  ------------------
  |  |   13|    559|#define XML_MAX_ITEMS 1000000000 /* 1 billion */
  ------------------
 1662|    559|            if (newSize < 0) {
  ------------------
  |  Branch (1662:17): [True: 0, False: 559]
  ------------------
 1663|      0|		xmlFree(ret);
 1664|      0|                return(NULL);
 1665|      0|            }
 1666|    559|            temp = xmlRealloc(ret, newSize);
 1667|    559|	    if (temp == NULL) {
  ------------------
  |  Branch (1667:10): [True: 2, False: 557]
  ------------------
 1668|      2|		xmlFree(ret);
 1669|      2|		return(NULL);
 1670|      2|	    }
 1671|    557|	    ret = temp;
 1672|    557|            len = newSize;
 1673|    557|	}
 1674|       |
 1675|  2.53M|	ch = *in;
 1676|       |
 1677|  2.53M|	if ((ch != '@') && (!IS_UNRESERVED(ch)) && (!xmlStrchr(list, ch))) {
  ------------------
  |  |  103|  2.53M|#define IS_UNRESERVED(x) (IS_ALPHANUM(x) || IS_MARK(x))
  |  |  ------------------
  |  |  |  |   73|  5.07M|#define IS_ALPHANUM(x) (IS_ALPHA(x) || IS_DIGIT(x))
  |  |  |  |  ------------------
  |  |  |  |  |  |   45|  5.07M|#define IS_ALPHA(x) (IS_LOWALPHA(x) || IS_UPALPHA(x))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   53|  5.07M|#define IS_LOWALPHA(x) (((x) >= 'a') && ((x) <= 'z'))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (53:25): [True: 179k, False: 2.35M]
  |  |  |  |  |  |  |  |  |  Branch (53:41): [True: 144k, False: 35.2k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define IS_ALPHA(x) (IS_LOWALPHA(x) || IS_UPALPHA(x))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   60|  2.39M|#define IS_UPALPHA(x) (((x) >= 'A') && ((x) <= 'Z'))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (60:24): [True: 133k, False: 2.25M]
  |  |  |  |  |  |  |  |  |  Branch (60:40): [True: 95.7k, False: 37.6k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define IS_ALPHANUM(x) (IS_ALPHA(x) || IS_DIGIT(x))
  |  |  |  |  ------------------
  |  |  |  |  |  |   68|  2.29M|#define IS_DIGIT(x) (((x) >= '0') && ((x) <= '9'))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (68:22): [True: 61.5k, False: 2.23M]
  |  |  |  |  |  |  |  Branch (68:38): [True: 15.4k, False: 46.0k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define IS_UNRESERVED(x) (IS_ALPHANUM(x) || IS_MARK(x))
  |  |  ------------------
  |  |  |  |   79|  2.27M|#define IS_MARK(x) (((x) == '-') || ((x) == '_') || ((x) == '.') ||     \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (79:21): [True: 17.9k, False: 2.26M]
  |  |  |  |  |  Branch (79:37): [True: 519, False: 2.26M]
  |  |  |  |  |  Branch (79:53): [True: 89.9k, False: 2.17M]
  |  |  |  |  ------------------
  |  |  |  |   80|  2.27M|    ((x) == '!') || ((x) == '~') || ((x) == '*') || ((x) == '\'') ||    \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (80:5): [True: 1.68k, False: 2.16M]
  |  |  |  |  |  Branch (80:21): [True: 974, False: 2.16M]
  |  |  |  |  |  Branch (80:37): [True: 694k, False: 1.47M]
  |  |  |  |  |  Branch (80:53): [True: 3.66k, False: 1.47M]
  |  |  |  |  ------------------
  |  |  |  |   81|  2.27M|    ((x) == '(') || ((x) == ')'))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (81:5): [True: 15.9k, False: 1.45M]
  |  |  |  |  |  Branch (81:21): [True: 16.2k, False: 1.43M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (1677:6): [True: 2.53M, False: 853]
  |  Branch (1677:45): [True: 1.36M, False: 78.0k]
  ------------------
 1678|  1.36M|	    unsigned char val;
 1679|  1.36M|	    ret[out++] = '%';
 1680|  1.36M|	    val = ch >> 4;
 1681|  1.36M|	    if (val <= 9)
  ------------------
  |  Branch (1681:10): [True: 1.35M, False: 4.84k]
  ------------------
 1682|  1.35M|		ret[out++] = '0' + val;
 1683|  4.84k|	    else
 1684|  4.84k|		ret[out++] = 'A' + val - 0xA;
 1685|  1.36M|	    val = ch & 0xF;
 1686|  1.36M|	    if (val <= 9)
  ------------------
  |  Branch (1686:10): [True: 1.32M, False: 33.1k]
  ------------------
 1687|  1.32M|		ret[out++] = '0' + val;
 1688|  33.1k|	    else
 1689|  33.1k|		ret[out++] = 'A' + val - 0xA;
 1690|  1.36M|	    in++;
 1691|  1.36M|	} else {
 1692|  1.17M|	    ret[out++] = *in++;
 1693|  1.17M|	}
 1694|       |
 1695|  2.53M|    }
 1696|  2.24k|    ret[out] = 0;
 1697|  2.24k|    return(ret);
 1698|  2.24k|}
xmlBuildURISafe:
 1972|   782k|xmlBuildURISafe(const xmlChar *URI, const xmlChar *base, xmlChar **valPtr) {
 1973|   782k|    xmlChar *val = NULL;
 1974|   782k|    int ret, len, indx, cur, out;
 1975|   782k|    xmlURIPtr ref = NULL;
 1976|   782k|    xmlURIPtr bas = NULL;
 1977|   782k|    xmlURIPtr res = NULL;
 1978|       |
 1979|   782k|    if (valPtr == NULL)
  ------------------
  |  Branch (1979:9): [True: 0, False: 782k]
  ------------------
 1980|      0|        return(1);
 1981|   782k|    *valPtr = NULL;
 1982|       |
 1983|   782k|    if (URI == NULL)
  ------------------
  |  Branch (1983:9): [True: 0, False: 782k]
  ------------------
 1984|      0|        return(1);
 1985|       |
 1986|   782k|    if (base == NULL) {
  ------------------
  |  Branch (1986:9): [True: 21.1k, False: 761k]
  ------------------
 1987|  21.1k|        val = xmlStrdup(URI);
 1988|  21.1k|        if (val == NULL)
  ------------------
  |  Branch (1988:13): [True: 3, False: 21.1k]
  ------------------
 1989|      3|            return(-1);
 1990|  21.1k|        *valPtr = val;
 1991|  21.1k|        return(0);
 1992|  21.1k|    }
 1993|       |
 1994|       |    /*
 1995|       |     * 1) The URI reference is parsed into the potential four components and
 1996|       |     *    fragment identifier, as described in Section 4.3.
 1997|       |     *
 1998|       |     *    NOTE that a completely empty URI is treated by modern browsers
 1999|       |     *    as a reference to "." rather than as a synonym for the current
 2000|       |     *    URI.  Should we do that here?
 2001|       |     */
 2002|   761k|    if (URI[0] != 0)
  ------------------
  |  Branch (2002:9): [True: 757k, False: 3.96k]
  ------------------
 2003|   757k|        ret = xmlParseURISafe((const char *) URI, &ref);
 2004|  3.96k|    else
 2005|  3.96k|        ret = 0;
 2006|   761k|    if (ret != 0)
  ------------------
  |  Branch (2006:9): [True: 8.21k, False: 753k]
  ------------------
 2007|  8.21k|	goto done;
 2008|   753k|    if ((ref != NULL) && (ref->scheme != NULL)) {
  ------------------
  |  Branch (2008:9): [True: 749k, False: 3.96k]
  |  Branch (2008:26): [True: 5.30k, False: 743k]
  ------------------
 2009|       |	/*
 2010|       |	 * The URI is absolute don't modify.
 2011|       |	 */
 2012|  5.30k|	val = xmlStrdup(URI);
 2013|  5.30k|        if (val == NULL)
  ------------------
  |  Branch (2013:13): [True: 28, False: 5.27k]
  ------------------
 2014|     28|            ret = -1;
 2015|  5.30k|	goto done;
 2016|  5.30k|    }
 2017|       |
 2018|       |    /*
 2019|       |     * If base has no scheme or authority, it is assumed to be a
 2020|       |     * filesystem path.
 2021|       |     */
 2022|   747k|    if (xmlStrstr(base, BAD_CAST "://") == NULL) {
  ------------------
  |  |   34|   747k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (2022:9): [True: 722k, False: 25.1k]
  ------------------
 2023|   722k|        xmlFreeURI(ref);
 2024|   722k|        return(xmlResolvePath(URI, base, valPtr));
 2025|   722k|    }
 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|  25.1k|    ret = xmlParseURISafe((const char *) base, &bas);
 2045|  25.1k|    if (ret < 0)
  ------------------
  |  Branch (2045:9): [True: 143, False: 24.9k]
  ------------------
 2046|    143|        goto done;
 2047|  24.9k|    if (ret != 0) {
  ------------------
  |  Branch (2047:9): [True: 6.64k, False: 18.3k]
  ------------------
 2048|  6.64k|	if (ref) {
  ------------------
  |  Branch (2048:6): [True: 6.00k, False: 644]
  ------------------
 2049|  6.00k|            ret = 0;
 2050|  6.00k|	    val = xmlSaveUri(ref);
 2051|  6.00k|            if (val == NULL)
  ------------------
  |  Branch (2051:17): [True: 13, False: 5.99k]
  ------------------
 2052|     13|                ret = -1;
 2053|  6.00k|        }
 2054|  6.64k|	goto done;
 2055|  6.64k|    }
 2056|  18.3k|    if (ref == NULL) {
  ------------------
  |  Branch (2056:9): [True: 2.52k, False: 15.7k]
  ------------------
 2057|       |	/*
 2058|       |	 * the base fragment must be ignored
 2059|       |	 */
 2060|  2.52k|	if (bas->fragment != NULL) {
  ------------------
  |  Branch (2060:6): [True: 249, False: 2.27k]
  ------------------
 2061|    249|	    xmlFree(bas->fragment);
 2062|    249|	    bas->fragment = NULL;
 2063|    249|	}
 2064|  2.52k|	val = xmlSaveUri(bas);
 2065|  2.52k|        if (val == NULL)
  ------------------
  |  Branch (2065:13): [True: 30, False: 2.49k]
  ------------------
 2066|     30|            ret = -1;
 2067|  2.52k|	goto done;
 2068|  2.52k|    }
 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|  15.7k|    ret = -1;
 2083|  15.7k|    res = xmlCreateURI();
 2084|  15.7k|    if (res == NULL)
  ------------------
  |  Branch (2084:9): [True: 32, False: 15.7k]
  ------------------
 2085|     32|	goto done;
 2086|  15.7k|    if ((ref->scheme == NULL) && (ref->path == NULL) &&
  ------------------
  |  Branch (2086:9): [True: 15.7k, False: 0]
  |  Branch (2086:34): [True: 5.51k, False: 10.2k]
  ------------------
 2087|  5.51k|	((ref->authority == NULL) && (ref->server == NULL) &&
  ------------------
  |  Branch (2087:3): [True: 5.51k, False: 0]
  |  Branch (2087:31): [True: 4.65k, False: 855]
  ------------------
 2088|  4.65k|         (ref->port == PORT_EMPTY))) {
  ------------------
  |  |   36|  4.65k|#define PORT_EMPTY           0
  ------------------
  |  Branch (2088:10): [True: 4.41k, False: 247]
  ------------------
 2089|  4.41k|	if (bas->scheme != NULL) {
  ------------------
  |  Branch (2089:6): [True: 3.67k, False: 738]
  ------------------
 2090|  3.67k|	    res->scheme = xmlMemStrdup(bas->scheme);
 2091|  3.67k|            if (res->scheme == NULL)
  ------------------
  |  Branch (2091:17): [True: 8, False: 3.66k]
  ------------------
 2092|      8|                goto done;
 2093|  3.67k|        }
 2094|  4.40k|	if (bas->authority != NULL) {
  ------------------
  |  Branch (2094:6): [True: 0, False: 4.40k]
  ------------------
 2095|      0|	    res->authority = xmlMemStrdup(bas->authority);
 2096|      0|            if (res->authority == NULL)
  ------------------
  |  Branch (2096:17): [True: 0, False: 0]
  ------------------
 2097|      0|                goto done;
 2098|  4.40k|        } else {
 2099|  4.40k|	    if (bas->server != NULL) {
  ------------------
  |  Branch (2099:10): [True: 2.40k, False: 2.00k]
  ------------------
 2100|  2.40k|		res->server = xmlMemStrdup(bas->server);
 2101|  2.40k|                if (res->server == NULL)
  ------------------
  |  Branch (2101:21): [True: 7, False: 2.39k]
  ------------------
 2102|      7|                    goto done;
 2103|  2.40k|            }
 2104|  4.39k|	    if (bas->user != NULL) {
  ------------------
  |  Branch (2104:10): [True: 2.00k, False: 2.38k]
  ------------------
 2105|  2.00k|		res->user = xmlMemStrdup(bas->user);
 2106|  2.00k|                if (res->user == NULL)
  ------------------
  |  Branch (2106:21): [True: 7, False: 2.00k]
  ------------------
 2107|      7|                    goto done;
 2108|  2.00k|            }
 2109|  4.39k|	    res->port = bas->port;
 2110|  4.39k|	}
 2111|  4.39k|	if (bas->path != NULL) {
  ------------------
  |  Branch (2111:6): [True: 2.36k, False: 2.02k]
  ------------------
 2112|  2.36k|	    res->path = xmlMemStrdup(bas->path);
 2113|  2.36k|            if (res->path == NULL)
  ------------------
  |  Branch (2113:17): [True: 9, False: 2.35k]
  ------------------
 2114|      9|                goto done;
 2115|  2.36k|        }
 2116|  4.38k|	if (ref->query_raw != NULL) {
  ------------------
  |  Branch (2116:6): [True: 886, False: 3.49k]
  ------------------
 2117|    886|	    res->query_raw = xmlMemStrdup (ref->query_raw);
 2118|    886|            if (res->query_raw == NULL)
  ------------------
  |  Branch (2118:17): [True: 4, False: 882]
  ------------------
 2119|      4|                goto done;
 2120|  3.49k|        } else if (ref->query != NULL) {
  ------------------
  |  Branch (2120:20): [True: 0, False: 3.49k]
  ------------------
 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.49k|        } else if (bas->query_raw != NULL) {
  ------------------
  |  Branch (2124:20): [True: 1.66k, False: 1.82k]
  ------------------
 2125|  1.66k|	    res->query_raw = xmlMemStrdup(bas->query_raw);
 2126|  1.66k|            if (res->query_raw == NULL)
  ------------------
  |  Branch (2126:17): [True: 6, False: 1.66k]
  ------------------
 2127|      6|                goto done;
 2128|  1.82k|        } else if (bas->query != NULL) {
  ------------------
  |  Branch (2128:20): [True: 0, False: 1.82k]
  ------------------
 2129|      0|	    res->query = xmlMemStrdup(bas->query);
 2130|      0|            if (res->query == NULL)
  ------------------
  |  Branch (2130:17): [True: 0, False: 0]
  ------------------
 2131|      0|                goto done;
 2132|      0|        }
 2133|  4.37k|	if (ref->fragment != NULL) {
  ------------------
  |  Branch (2133:6): [True: 3.47k, False: 893]
  ------------------
 2134|  3.47k|	    res->fragment = xmlMemStrdup(ref->fragment);
 2135|  3.47k|            if (res->fragment == NULL)
  ------------------
  |  Branch (2135:17): [True: 6, False: 3.47k]
  ------------------
 2136|      6|                goto done;
 2137|  3.47k|        }
 2138|  4.36k|	goto step_7;
 2139|  4.37k|    }
 2140|       |
 2141|       |    /*
 2142|       |     * 3) If the scheme component is defined, indicating that the reference
 2143|       |     *    starts with a scheme name, then the reference is interpreted as an
 2144|       |     *    absolute URI and we are done.  Otherwise, the reference URI's
 2145|       |     *    scheme is inherited from the base URI's scheme component.
 2146|       |     */
 2147|  11.3k|    if (ref->scheme != NULL) {
  ------------------
  |  Branch (2147:9): [True: 0, False: 11.3k]
  ------------------
 2148|      0|	val = xmlSaveUri(ref);
 2149|      0|        if (val != NULL)
  ------------------
  |  Branch (2149:13): [True: 0, False: 0]
  ------------------
 2150|      0|            ret = 0;
 2151|      0|	goto done;
 2152|      0|    }
 2153|  11.3k|    if (bas->scheme != NULL) {
  ------------------
  |  Branch (2153:9): [True: 7.74k, False: 3.59k]
  ------------------
 2154|  7.74k|	res->scheme = xmlMemStrdup(bas->scheme);
 2155|  7.74k|        if (res->scheme == NULL)
  ------------------
  |  Branch (2155:13): [True: 16, False: 7.72k]
  ------------------
 2156|     16|            goto done;
 2157|  7.74k|    }
 2158|       |
 2159|  11.3k|    if (ref->query_raw != NULL) {
  ------------------
  |  Branch (2159:9): [True: 1.79k, False: 9.52k]
  ------------------
 2160|  1.79k|	res->query_raw = xmlMemStrdup(ref->query_raw);
 2161|  1.79k|        if (res->query_raw == NULL)
  ------------------
  |  Branch (2161:13): [True: 3, False: 1.79k]
  ------------------
 2162|      3|            goto done;
 2163|  9.52k|    } else if (ref->query != NULL) {
  ------------------
  |  Branch (2163:16): [True: 0, False: 9.52k]
  ------------------
 2164|      0|	res->query = xmlMemStrdup(ref->query);
 2165|      0|        if (res->query == NULL)
  ------------------
  |  Branch (2165:13): [True: 0, False: 0]
  ------------------
 2166|      0|            goto done;
 2167|      0|    }
 2168|  11.3k|    if (ref->fragment != NULL) {
  ------------------
  |  Branch (2168:9): [True: 1.82k, False: 9.49k]
  ------------------
 2169|  1.82k|	res->fragment = xmlMemStrdup(ref->fragment);
 2170|  1.82k|        if (res->fragment == NULL)
  ------------------
  |  Branch (2170:13): [True: 1, False: 1.82k]
  ------------------
 2171|      1|            goto done;
 2172|  1.82k|    }
 2173|       |
 2174|       |    /*
 2175|       |     * 4) If the authority component is defined, then the reference is a
 2176|       |     *    network-path and we skip to step 7.  Otherwise, the reference
 2177|       |     *    URI's authority is inherited from the base URI's authority
 2178|       |     *    component, which will also be undefined if the URI scheme does not
 2179|       |     *    use an authority component.
 2180|       |     */
 2181|  11.3k|    if ((ref->authority != NULL) || (ref->server != NULL) ||
  ------------------
  |  Branch (2181:9): [True: 0, False: 11.3k]
  |  Branch (2181:37): [True: 1.05k, False: 10.2k]
  ------------------
 2182|  10.2k|         (ref->port != PORT_EMPTY)) {
  ------------------
  |  |   36|  10.2k|#define PORT_EMPTY           0
  ------------------
  |  Branch (2182:10): [True: 262, False: 10.0k]
  ------------------
 2183|  1.31k|	if (ref->authority != NULL) {
  ------------------
  |  Branch (2183:6): [True: 0, False: 1.31k]
  ------------------
 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.31k|        } else {
 2188|  1.31k|            if (ref->server != NULL) {
  ------------------
  |  Branch (2188:17): [True: 1.05k, False: 262]
  ------------------
 2189|  1.05k|                res->server = xmlMemStrdup(ref->server);
 2190|  1.05k|                if (res->server == NULL)
  ------------------
  |  Branch (2190:21): [True: 3, False: 1.05k]
  ------------------
 2191|      3|                    goto done;
 2192|  1.05k|            }
 2193|  1.31k|	    if (ref->user != NULL) {
  ------------------
  |  Branch (2193:10): [True: 227, False: 1.08k]
  ------------------
 2194|    227|		res->user = xmlMemStrdup(ref->user);
 2195|    227|                if (res->user == NULL)
  ------------------
  |  Branch (2195:21): [True: 1, False: 226]
  ------------------
 2196|      1|                    goto done;
 2197|    227|            }
 2198|  1.31k|            res->port = ref->port;
 2199|  1.31k|	}
 2200|  1.31k|	if (ref->path != NULL) {
  ------------------
  |  Branch (2200:6): [True: 215, False: 1.09k]
  ------------------
 2201|    215|	    res->path = xmlMemStrdup(ref->path);
 2202|    215|            if (res->path == NULL)
  ------------------
  |  Branch (2202:17): [True: 2, False: 213]
  ------------------
 2203|      2|                goto done;
 2204|    215|        }
 2205|  1.31k|	goto step_7;
 2206|  1.31k|    }
 2207|  10.0k|    if (bas->authority != NULL) {
  ------------------
  |  Branch (2207:9): [True: 0, False: 10.0k]
  ------------------
 2208|      0|	res->authority = xmlMemStrdup(bas->authority);
 2209|      0|        if (res->authority == NULL)
  ------------------
  |  Branch (2209:13): [True: 0, False: 0]
  ------------------
 2210|      0|            goto done;
 2211|  10.0k|    } else if ((bas->server != NULL) || (bas->port != PORT_EMPTY)) {
  ------------------
  |  |   36|  5.57k|#define PORT_EMPTY           0
  ------------------
  |  Branch (2211:16): [True: 4.43k, False: 5.57k]
  |  Branch (2211:41): [True: 1.60k, False: 3.96k]
  ------------------
 2212|  6.04k|	if (bas->server != NULL) {
  ------------------
  |  Branch (2212:6): [True: 4.43k, False: 1.60k]
  ------------------
 2213|  4.43k|	    res->server = xmlMemStrdup(bas->server);
 2214|  4.43k|            if (res->server == NULL)
  ------------------
  |  Branch (2214:17): [True: 9, False: 4.42k]
  ------------------
 2215|      9|                goto done;
 2216|  4.43k|        }
 2217|  6.03k|	if (bas->user != NULL) {
  ------------------
  |  Branch (2217:6): [True: 867, False: 5.16k]
  ------------------
 2218|    867|	    res->user = xmlMemStrdup(bas->user);
 2219|    867|            if (res->user == NULL)
  ------------------
  |  Branch (2219:17): [True: 2, False: 865]
  ------------------
 2220|      2|                goto done;
 2221|    867|        }
 2222|  6.03k|	res->port = bas->port;
 2223|  6.03k|    }
 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.99k|    if ((ref->path != NULL) && (ref->path[0] == '/')) {
  ------------------
  |  Branch (2229:9): [True: 9.99k, False: 0]
  |  Branch (2229:32): [True: 1.08k, False: 8.91k]
  ------------------
 2230|  1.08k|	res->path = xmlMemStrdup(ref->path);
 2231|  1.08k|        if (res->path == NULL)
  ------------------
  |  Branch (2231:13): [True: 4, False: 1.07k]
  ------------------
 2232|      4|            goto done;
 2233|  1.07k|	goto step_7;
 2234|  1.08k|    }
 2235|       |
 2236|       |
 2237|       |    /*
 2238|       |     * 6) If this step is reached, then we are resolving a relative-path
 2239|       |     *    reference.  The relative path needs to be merged with the base
 2240|       |     *    URI's path.  Although there are many ways to do this, we will
 2241|       |     *    describe a simple method using a separate string buffer.
 2242|       |     *
 2243|       |     * Allocate a buffer large enough for the result string.
 2244|       |     */
 2245|  8.91k|    len = 2; /* extra / and 0 */
 2246|  8.91k|    if (ref->path != NULL)
  ------------------
  |  Branch (2246:9): [True: 8.91k, False: 0]
  ------------------
 2247|  8.91k|	len += strlen(ref->path);
 2248|  8.91k|    if (bas->path != NULL)
  ------------------
  |  Branch (2248:9): [True: 4.05k, False: 4.85k]
  ------------------
 2249|  4.05k|	len += strlen(bas->path);
 2250|  8.91k|    res->path = xmlMalloc(len);
 2251|  8.91k|    if (res->path == NULL)
  ------------------
  |  Branch (2251:9): [True: 24, False: 8.88k]
  ------------------
 2252|     24|	goto done;
 2253|  8.88k|    res->path[0] = 0;
 2254|       |
 2255|       |    /*
 2256|       |     * a) All but the last segment of the base URI's path component is
 2257|       |     *    copied to the buffer.  In other words, any characters after the
 2258|       |     *    last (right-most) slash character, if any, are excluded.
 2259|       |     */
 2260|  8.88k|    cur = 0;
 2261|  8.88k|    out = 0;
 2262|  8.88k|    if (bas->path != NULL) {
  ------------------
  |  Branch (2262:9): [True: 4.05k, False: 4.83k]
  ------------------
 2263|  21.1k|	while (bas->path[cur] != 0) {
  ------------------
  |  Branch (2263:9): [True: 20.3k, False: 832]
  ------------------
 2264|   458k|	    while ((bas->path[cur] != 0) && (bas->path[cur] != '/'))
  ------------------
  |  Branch (2264:13): [True: 455k, False: 3.22k]
  |  Branch (2264:38): [True: 438k, False: 17.1k]
  ------------------
 2265|   438k|		cur++;
 2266|  20.3k|	    if (bas->path[cur] == 0)
  ------------------
  |  Branch (2266:10): [True: 3.22k, False: 17.1k]
  ------------------
 2267|  3.22k|		break;
 2268|       |
 2269|  17.1k|	    cur++;
 2270|   440k|	    while (out < cur) {
  ------------------
  |  Branch (2270:13): [True: 423k, False: 17.1k]
  ------------------
 2271|   423k|		res->path[out] = bas->path[out];
 2272|   423k|		out++;
 2273|   423k|	    }
 2274|  17.1k|	}
 2275|  4.05k|    }
 2276|  8.88k|    res->path[out] = 0;
 2277|       |
 2278|       |    /*
 2279|       |     * b) The reference's path component is appended to the buffer
 2280|       |     *    string.
 2281|       |     */
 2282|  8.88k|    if (ref->path != NULL && ref->path[0] != 0) {
  ------------------
  |  Branch (2282:9): [True: 8.88k, False: 0]
  |  Branch (2282:30): [True: 8.69k, False: 195]
  ------------------
 2283|  8.69k|	indx = 0;
 2284|       |	/*
 2285|       |	 * Ensure the path includes a '/'
 2286|       |	 */
 2287|  8.69k|	if ((out == 0) && ((bas->server != NULL) || bas->port != PORT_EMPTY))
  ------------------
  |  |   36|  2.54k|#define PORT_EMPTY           0
  ------------------
  |  Branch (2287:6): [True: 5.58k, False: 3.11k]
  |  Branch (2287:21): [True: 3.03k, False: 2.54k]
  |  Branch (2287:46): [True: 1.02k, False: 1.51k]
  ------------------
 2288|  4.06k|	    res->path[out++] = '/';
 2289|   424k|	while (ref->path[indx] != 0) {
  ------------------
  |  Branch (2289:9): [True: 415k, False: 8.69k]
  ------------------
 2290|   415k|	    res->path[out++] = ref->path[indx++];
 2291|   415k|	}
 2292|  8.69k|    }
 2293|  8.88k|    res->path[out] = 0;
 2294|       |
 2295|       |    /*
 2296|       |     * Steps c) to h) are really path normalization steps
 2297|       |     */
 2298|  8.88k|    xmlNormalizeURIPath(res->path);
 2299|       |
 2300|  15.6k|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|  15.6k|    val = xmlSaveUri(res);
 2308|  15.6k|    if (val != NULL)
  ------------------
  |  Branch (2308:9): [True: 15.5k, False: 87]
  ------------------
 2309|  15.5k|        ret = 0;
 2310|       |
 2311|  38.6k|done:
 2312|  38.6k|    if (ref != NULL)
  ------------------
  |  Branch (2312:9): [True: 27.1k, False: 11.4k]
  ------------------
 2313|  27.1k|	xmlFreeURI(ref);
 2314|  38.6k|    if (bas != NULL)
  ------------------
  |  Branch (2314:9): [True: 18.3k, False: 20.3k]
  ------------------
 2315|  18.3k|	xmlFreeURI(bas);
 2316|  38.6k|    if (res != NULL)
  ------------------
  |  Branch (2316:9): [True: 15.7k, False: 22.8k]
  ------------------
 2317|  15.7k|	xmlFreeURI(res);
 2318|  38.6k|    *valPtr = val;
 2319|  38.6k|    return(ret);
 2320|  15.6k|}
xmlBuildRelativeURISafe:
 2493|   107k|{
 2494|   107k|    xmlChar *val = NULL;
 2495|   107k|    int ret = 0;
 2496|   107k|    size_t ix = 0;
 2497|   107k|    size_t nbslash = 0;
 2498|   107k|    size_t len = 0;
 2499|   107k|    xmlURIPtr ref = NULL;
 2500|   107k|    xmlURIPtr bas = NULL;
 2501|   107k|    const xmlChar *bptr, *uptr, *rptr;
 2502|   107k|    xmlChar *vptr;
 2503|   107k|    int remove_path = 0;
 2504|   107k|    int refDrive, baseDrive;
 2505|       |
 2506|   107k|    if (valPtr == NULL)
  ------------------
  |  Branch (2506:9): [True: 0, False: 107k]
  ------------------
 2507|      0|        return(1);
 2508|   107k|    *valPtr = NULL;
 2509|   107k|    if ((URI == NULL) || (*URI == 0))
  ------------------
  |  Branch (2509:9): [True: 0, False: 107k]
  |  Branch (2509:26): [True: 632, False: 106k]
  ------------------
 2510|    632|	return(1);
 2511|       |
 2512|   106k|    ret = xmlParseUriOrPath((char *) URI, &ref, &refDrive);
 2513|   106k|    if (ret < 0)
  ------------------
  |  Branch (2513:9): [True: 36, False: 106k]
  ------------------
 2514|     36|        goto done;
 2515|   106k|    if (ret != 0) {
  ------------------
  |  Branch (2515:9): [True: 411, False: 105k]
  ------------------
 2516|       |        /* Return URI if URI is invalid */
 2517|    411|        ret = 0;
 2518|    411|        val = xmlStrdup(URI);
 2519|    411|        if (val == NULL)
  ------------------
  |  Branch (2519:13): [True: 1, False: 410]
  ------------------
 2520|      1|            ret = -1;
 2521|    411|        goto done;
 2522|    411|    }
 2523|       |
 2524|       |    /* Return URI if base is empty */
 2525|   105k|    if ((base == NULL) || (*base == 0))
  ------------------
  |  Branch (2525:9): [True: 0, False: 105k]
  |  Branch (2525:27): [True: 103k, False: 2.39k]
  ------------------
 2526|   103k|        goto done;
 2527|       |
 2528|  2.39k|    ret = xmlParseUriOrPath((char *) base, &bas, &baseDrive);
 2529|  2.39k|    if (ret < 0)
  ------------------
  |  Branch (2529:9): [True: 9, False: 2.38k]
  ------------------
 2530|      9|        goto done;
 2531|  2.38k|    if (ret != 0) {
  ------------------
  |  Branch (2531:9): [True: 238, False: 2.14k]
  ------------------
 2532|       |        /* Return URI if base is invalid */
 2533|    238|        ret = 0;
 2534|    238|        goto done;
 2535|    238|    }
 2536|       |
 2537|       |    /*
 2538|       |     * If the scheme / server on the URI differs from the base,
 2539|       |     * just return the URI
 2540|       |     */
 2541|  2.14k|    if ((xmlStrcmp ((xmlChar *)bas->scheme, (xmlChar *)ref->scheme)) ||
  ------------------
  |  Branch (2541:9): [True: 205, False: 1.94k]
  ------------------
 2542|  1.94k|	(xmlStrcmp ((xmlChar *)bas->server, (xmlChar *)ref->server)) ||
  ------------------
  |  Branch (2542:2): [True: 68, False: 1.87k]
  ------------------
 2543|  1.87k|        (bas->port != ref->port) ||
  ------------------
  |  Branch (2543:9): [True: 0, False: 1.87k]
  ------------------
 2544|  1.87k|        (baseDrive != refDrive)) {
  ------------------
  |  Branch (2544:9): [True: 0, False: 1.87k]
  ------------------
 2545|    273|	goto done;
 2546|    273|    }
 2547|  1.87k|    if (xmlStrEqual((xmlChar *)bas->path, (xmlChar *)ref->path)) {
  ------------------
  |  Branch (2547:9): [True: 116, False: 1.75k]
  ------------------
 2548|    116|	val = xmlStrdup(BAD_CAST "");
  ------------------
  |  |   34|    116|#define BAD_CAST (xmlChar *)
  ------------------
 2549|    116|        if (val == NULL)
  ------------------
  |  Branch (2549:13): [True: 2, False: 114]
  ------------------
 2550|      2|            ret = -1;
 2551|    116|	goto done;
 2552|    116|    }
 2553|  1.75k|    if (bas->path == NULL) {
  ------------------
  |  Branch (2553:9): [True: 9, False: 1.75k]
  ------------------
 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.75k|    if (ref->path == NULL) {
  ------------------
  |  Branch (2561:9): [True: 66, False: 1.68k]
  ------------------
 2562|     66|        ref->path = (char *) "/";
 2563|     66|	remove_path = 1;
 2564|     66|    }
 2565|       |
 2566|  1.75k|    bptr = (xmlChar *) bas->path;
 2567|  1.75k|    rptr = (xmlChar *) ref->path;
 2568|       |
 2569|       |    /*
 2570|       |     * Return URI if URI and base aren't both absolute or relative.
 2571|       |     */
 2572|  1.75k|    if ((bptr[0] == '/') != (rptr[0] == '/'))
  ------------------
  |  Branch (2572:9): [True: 322, False: 1.42k]
  ------------------
 2573|    322|        goto done;
 2574|       |
 2575|       |    /*
 2576|       |     * At this point we can compare the two paths
 2577|       |     */
 2578|  1.42k|    {
 2579|  1.42k|        size_t pos = 0;
 2580|       |
 2581|       |        /*
 2582|       |         * Next we compare the two strings and find where they first differ
 2583|       |         */
 2584|  4.01k|	while ((bptr[pos] == rptr[pos]) && (bptr[pos] != 0))
  ------------------
  |  Branch (2584:9): [True: 2.58k, False: 1.42k]
  |  Branch (2584:37): [True: 2.58k, False: 0]
  ------------------
 2585|  2.58k|	    pos++;
 2586|       |
 2587|  1.42k|	if (bptr[pos] == rptr[pos]) {
  ------------------
  |  Branch (2587:6): [True: 0, False: 1.42k]
  ------------------
 2588|      0|	    val = xmlStrdup(BAD_CAST "");
  ------------------
  |  |   34|      0|#define BAD_CAST (xmlChar *)
  ------------------
 2589|      0|            if (val == NULL)
  ------------------
  |  Branch (2589:17): [True: 0, False: 0]
  ------------------
 2590|      0|                ret = -1;
 2591|      0|	    goto done;		/* (I can't imagine why anyone would do this) */
 2592|      0|	}
 2593|       |
 2594|       |	/*
 2595|       |	 * In URI, "back up" to the last '/' encountered.  This will be the
 2596|       |	 * beginning of the "unique" suffix of URI
 2597|       |	 */
 2598|  1.42k|	ix = pos;
 2599|  2.51k|	for (; ix > 0; ix--) {
  ------------------
  |  Branch (2599:9): [True: 1.24k, False: 1.27k]
  ------------------
 2600|  1.24k|	    if (rptr[ix - 1] == '/')
  ------------------
  |  Branch (2600:10): [True: 155, False: 1.09k]
  ------------------
 2601|    155|		break;
 2602|  1.24k|	}
 2603|  1.42k|	uptr = (xmlChar *)&rptr[ix];
 2604|       |
 2605|       |	/*
 2606|       |	 * In base, count the number of '/' from the differing point
 2607|       |	 */
 2608|   175k|	for (; bptr[ix] != 0; ix++) {
  ------------------
  |  Branch (2608:9): [True: 173k, False: 1.42k]
  ------------------
 2609|   173k|	    if (bptr[ix] == '/')
  ------------------
  |  Branch (2609:10): [True: 39.3k, False: 134k]
  ------------------
 2610|  39.3k|		nbslash++;
 2611|   173k|	}
 2612|       |
 2613|       |	/*
 2614|       |	 * e.g: URI="foo/" base="foo/bar" -> "./"
 2615|       |	 */
 2616|  1.42k|	if (nbslash == 0 && !uptr[0]) {
  ------------------
  |  Branch (2616:6): [True: 384, False: 1.04k]
  |  Branch (2616:22): [True: 20, False: 364]
  ------------------
 2617|     20|	    val = xmlStrdup(BAD_CAST "./");
  ------------------
  |  |   34|     20|#define BAD_CAST (xmlChar *)
  ------------------
 2618|     20|            if (val == NULL)
  ------------------
  |  Branch (2618:17): [True: 1, False: 19]
  ------------------
 2619|      1|                ret = -1;
 2620|     20|	    goto done;
 2621|     20|	}
 2622|       |
 2623|  1.40k|	len = (size_t) xmlStrlen (uptr) + 1;
 2624|  1.40k|    }
 2625|       |
 2626|  1.40k|    if (nbslash == 0) {
  ------------------
  |  Branch (2626:9): [True: 364, False: 1.04k]
  ------------------
 2627|    364|	if (uptr != NULL) {
  ------------------
  |  Branch (2627:6): [True: 364, False: 0]
  ------------------
 2628|       |	    /* exception characters from xmlSaveUri */
 2629|    364|	    val = xmlURIEscapeStr(uptr, BAD_CAST "/;&=+$,");
  ------------------
  |  |   34|    364|#define BAD_CAST (xmlChar *)
  ------------------
 2630|    364|            if (val == NULL)
  ------------------
  |  Branch (2630:17): [True: 2, False: 362]
  ------------------
 2631|      2|                ret = -1;
 2632|    364|        }
 2633|    364|	goto done;
 2634|    364|    }
 2635|       |
 2636|       |    /*
 2637|       |     * Allocate just enough space for the returned string -
 2638|       |     * length of the remainder of the URI, plus enough space
 2639|       |     * for the "../" groups, plus one for the terminator
 2640|       |     */
 2641|  1.04k|    if (len + 3 * nbslash > SIZE_MAX) {
  ------------------
  |  Branch (2641:9): [True: 0, False: 1.04k]
  ------------------
 2642|      0|        ret = -1;
 2643|      0|        goto done;
 2644|      0|    }
 2645|  1.04k|    val = (xmlChar *) xmlMalloc (len + 3 * nbslash);
 2646|  1.04k|    if (val == NULL) {
  ------------------
  |  Branch (2646:9): [True: 1, False: 1.04k]
  ------------------
 2647|      1|        ret = -1;
 2648|      1|	goto done;
 2649|      1|    }
 2650|  1.04k|    vptr = val;
 2651|       |    /*
 2652|       |     * Put in as many "../" as needed
 2653|       |     */
 2654|  40.4k|    for (; nbslash>0; nbslash--) {
  ------------------
  |  Branch (2654:12): [True: 39.3k, False: 1.04k]
  ------------------
 2655|  39.3k|	*vptr++ = '.';
 2656|  39.3k|	*vptr++ = '.';
 2657|  39.3k|	*vptr++ = '/';
 2658|  39.3k|    }
 2659|       |    /*
 2660|       |     * Finish up with the end of the URI
 2661|       |     */
 2662|  1.04k|    if (uptr != NULL) {
  ------------------
  |  Branch (2662:9): [True: 1.04k, False: 0]
  ------------------
 2663|  1.04k|        if ((vptr > val) && (len > 0) &&
  ------------------
  |  Branch (2663:13): [True: 1.04k, False: 0]
  |  Branch (2663:29): [True: 1.04k, False: 0]
  ------------------
 2664|  1.04k|	    (uptr[0] == '/') && (vptr[-1] == '/')) {
  ------------------
  |  Branch (2664:6): [True: 0, False: 1.04k]
  |  Branch (2664:26): [True: 0, False: 0]
  ------------------
 2665|      0|	    memcpy (vptr, uptr + 1, len - 1);
 2666|      0|	    vptr[len - 2] = 0;
 2667|  1.04k|	} else {
 2668|  1.04k|	    memcpy (vptr, uptr, len);
 2669|  1.04k|	    vptr[len - 1] = 0;
 2670|  1.04k|	}
 2671|  1.04k|    } else {
 2672|      0|	vptr[len - 1] = 0;
 2673|      0|    }
 2674|       |
 2675|  1.05k|escape:
 2676|       |    /* escape the freshly-built path */
 2677|  1.05k|    vptr = val;
 2678|       |    /* exception characters from xmlSaveUri */
 2679|  1.05k|    val = xmlURIEscapeStr(vptr, BAD_CAST "/;&=+$,");
  ------------------
  |  |   34|  1.05k|#define BAD_CAST (xmlChar *)
  ------------------
 2680|  1.05k|    if (val == NULL)
  ------------------
  |  Branch (2680:9): [True: 2, False: 1.04k]
  ------------------
 2681|      2|        ret = -1;
 2682|  1.04k|    else
 2683|  1.04k|        ret = 0;
 2684|  1.05k|    xmlFree(vptr);
 2685|       |
 2686|   106k|done:
 2687|   106k|    if ((ret == 0) && (val == NULL)) {
  ------------------
  |  Branch (2687:9): [True: 106k, False: 55]
  |  Branch (2687:23): [True: 104k, False: 1.95k]
  ------------------
 2688|   104k|        val = xmlSaveUri(ref);
 2689|   104k|        if (val == NULL)
  ------------------
  |  Branch (2689:13): [True: 16, False: 104k]
  ------------------
 2690|     16|            ret = -1;
 2691|   104k|    }
 2692|       |
 2693|       |    /*
 2694|       |     * Free the working variables
 2695|       |     */
 2696|   106k|    if (remove_path != 0)
  ------------------
  |  Branch (2696:9): [True: 66, False: 106k]
  ------------------
 2697|     66|        ref->path = NULL;
 2698|   106k|    if (ref != NULL)
  ------------------
  |  Branch (2698:9): [True: 105k, False: 447]
  ------------------
 2699|   105k|	xmlFreeURI (ref);
 2700|   106k|    if (bas != NULL)
  ------------------
  |  Branch (2700:9): [True: 2.14k, False: 104k]
  ------------------
 2701|  2.14k|	xmlFreeURI (bas);
 2702|   106k|    if (ret != 0) {
  ------------------
  |  Branch (2702:9): [True: 71, False: 106k]
  ------------------
 2703|     71|        xmlFree(val);
 2704|     71|        val = NULL;
 2705|     71|    }
 2706|       |
 2707|   106k|    *valPtr = val;
 2708|   106k|    return(ret);
 2709|  1.05k|}
xmlCanonicPath:
 2747|  12.5k|{
 2748|  12.5k|    xmlChar *ret;
 2749|       |
 2750|  12.5k|    if (path == NULL)
  ------------------
  |  Branch (2750:9): [True: 0, False: 12.5k]
  ------------------
 2751|      0|	return(NULL);
 2752|       |
 2753|       |    /* Check if this is an "absolute uri" */
 2754|  12.5k|    if (xmlStrstr(path, BAD_CAST "://") != NULL) {
  ------------------
  |  |   34|  12.5k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (2754:9): [True: 837, False: 11.6k]
  ------------------
 2755|       |	/*
 2756|       |         * Escape all characters except reserved, unreserved and the
 2757|       |         * percent sign.
 2758|       |         *
 2759|       |         * xmlURIEscapeStr already keeps unreserved characters, so we
 2760|       |         * pass gen-delims, sub-delims and "%" to ignore.
 2761|       |         */
 2762|    837|        ret = xmlURIEscapeStr(path, BAD_CAST ":/?#[]@!$&()*+,;='%");
  ------------------
  |  |   34|    837|#define BAD_CAST (xmlChar *)
  ------------------
 2763|  11.6k|    } else {
 2764|  11.6k|        ret = xmlStrdup((const xmlChar *) path);
 2765|  11.6k|    }
 2766|       |
 2767|  12.5k|    return(ret);
 2768|  12.5k|}
xmlPathToURI:
 2781|  12.5k|{
 2782|  12.5k|    return(xmlCanonicPath(path));
 2783|  12.5k|}
uri.c:xmlParse3986URIReference:
  924|   907k|xmlParse3986URIReference(xmlURIPtr uri, const char *str) {
  925|   907k|    int ret;
  926|       |
  927|   907k|    if (str == NULL)
  ------------------
  |  Branch (927:9): [True: 0, False: 907k]
  ------------------
  928|      0|	return(-1);
  929|   907k|    xmlCleanURI(uri);
  930|       |
  931|       |    /*
  932|       |     * Try first to parse absolute refs, then fallback to relative if
  933|       |     * it fails.
  934|       |     */
  935|   907k|    ret = xmlParse3986URI(uri, str);
  936|   907k|    if (ret < 0)
  ------------------
  |  Branch (936:9): [True: 119, False: 907k]
  ------------------
  937|    119|        return(ret);
  938|   907k|    if (ret != 0) {
  ------------------
  |  Branch (938:9): [True: 875k, False: 32.3k]
  ------------------
  939|   875k|	xmlCleanURI(uri);
  940|   875k|        ret = xmlParse3986RelativeRef(uri, str);
  941|   875k|	if (ret != 0) {
  ------------------
  |  Branch (941:6): [True: 26.2k, False: 848k]
  ------------------
  942|  26.2k|	    xmlCleanURI(uri);
  943|  26.2k|	    return(ret);
  944|  26.2k|	}
  945|   875k|    }
  946|   881k|    return(0);
  947|   907k|}
uri.c:xmlCleanURI:
 1383|  1.83M|xmlCleanURI(xmlURIPtr uri) {
 1384|  1.83M|    if (uri == NULL) return;
  ------------------
  |  Branch (1384:9): [True: 0, False: 1.83M]
  ------------------
 1385|       |
 1386|  1.83M|    if (uri->scheme != NULL) xmlFree(uri->scheme);
  ------------------
  |  Branch (1386:9): [True: 98.6k, False: 1.74M]
  ------------------
 1387|  1.83M|    uri->scheme = NULL;
 1388|  1.83M|    if (uri->server != NULL) xmlFree(uri->server);
  ------------------
  |  Branch (1388:9): [True: 3.42k, False: 1.83M]
  ------------------
 1389|  1.83M|    uri->server = NULL;
 1390|  1.83M|    if (uri->user != NULL) xmlFree(uri->user);
  ------------------
  |  Branch (1390:9): [True: 377, False: 1.83M]
  ------------------
 1391|  1.83M|    uri->user = NULL;
 1392|  1.83M|    if (uri->path != NULL) xmlFree(uri->path);
  ------------------
  |  Branch (1392:9): [True: 20.0k, False: 1.81M]
  ------------------
 1393|  1.83M|    uri->path = NULL;
 1394|  1.83M|    if (uri->fragment != NULL) xmlFree(uri->fragment);
  ------------------
  |  Branch (1394:9): [True: 1.73k, False: 1.83M]
  ------------------
 1395|  1.83M|    uri->fragment = NULL;
 1396|  1.83M|    if (uri->opaque != NULL) xmlFree(uri->opaque);
  ------------------
  |  Branch (1396:9): [True: 0, False: 1.83M]
  ------------------
 1397|  1.83M|    uri->opaque = NULL;
 1398|  1.83M|    if (uri->authority != NULL) xmlFree(uri->authority);
  ------------------
  |  Branch (1398:9): [True: 0, False: 1.83M]
  ------------------
 1399|  1.83M|    uri->authority = NULL;
 1400|  1.83M|    if (uri->query != NULL) xmlFree(uri->query);
  ------------------
  |  Branch (1400:9): [True: 2.73k, False: 1.83M]
  ------------------
 1401|  1.83M|    uri->query = NULL;
 1402|  1.83M|    if (uri->query_raw != NULL) xmlFree(uri->query_raw);
  ------------------
  |  Branch (1402:9): [True: 2.70k, False: 1.83M]
  ------------------
 1403|       |    uri->query_raw = NULL;
 1404|  1.83M|}
uri.c:xmlParse3986URI:
  885|   907k|xmlParse3986URI(xmlURIPtr uri, const char *str) {
  886|   907k|    int ret;
  887|       |
  888|   907k|    ret = xmlParse3986Scheme(uri, &str);
  889|   907k|    if (ret != 0) return(ret);
  ------------------
  |  Branch (889:9): [True: 776k, False: 131k]
  ------------------
  890|   131k|    if (*str != ':') {
  ------------------
  |  Branch (890:9): [True: 91.5k, False: 39.5k]
  ------------------
  891|  91.5k|	return(1);
  892|  91.5k|    }
  893|  39.5k|    str++;
  894|  39.5k|    ret = xmlParse3986HierPart(uri, &str);
  895|  39.5k|    if (ret != 0) return(ret);
  ------------------
  |  Branch (895:9): [True: 1.31k, False: 38.1k]
  ------------------
  896|  38.1k|    if (*str == '?') {
  ------------------
  |  Branch (896:9): [True: 2.92k, False: 35.2k]
  ------------------
  897|  2.92k|	str++;
  898|  2.92k|	ret = xmlParse3986Query(uri, &str);
  899|  2.92k|	if (ret != 0) return(ret);
  ------------------
  |  Branch (899:6): [True: 15, False: 2.91k]
  ------------------
  900|  2.92k|    }
  901|  38.1k|    if (*str == '#') {
  ------------------
  |  Branch (901:9): [True: 1.66k, False: 36.5k]
  ------------------
  902|  1.66k|	str++;
  903|  1.66k|	ret = xmlParse3986Fragment(uri, &str);
  904|  1.66k|	if (ret != 0) return(ret);
  ------------------
  |  Branch (904:6): [True: 4, False: 1.65k]
  ------------------
  905|  1.66k|    }
  906|  38.1k|    if (*str != 0) {
  ------------------
  |  Branch (906:9): [True: 5.85k, False: 32.3k]
  ------------------
  907|  5.85k|	xmlCleanURI(uri);
  908|  5.85k|	return(1);
  909|  5.85k|    }
  910|  32.3k|    return(0);
  911|  38.1k|}
uri.c:xmlParse3986Scheme:
  224|   907k|xmlParse3986Scheme(xmlURIPtr uri, const char **str) {
  225|   907k|    const char *cur;
  226|       |
  227|   907k|    cur = *str;
  228|   907k|    if (!ISA_ALPHA(cur))
  ------------------
  |  |  128|   907k|#define ISA_ALPHA(p) (((*(p) >= 'a') && (*(p) <= 'z')) ||		\
  |  |  ------------------
  |  |  |  Branch (128:24): [True: 128k, False: 779k]
  |  |  |  Branch (128:41): [True: 126k, False: 2.22k]
  |  |  ------------------
  |  |  129|   907k|                      ((*(p) >= 'A') && (*(p) <= 'Z')))
  |  |  ------------------
  |  |  |  Branch (129:24): [True: 7.85k, False: 773k]
  |  |  |  Branch (129:41): [True: 5.11k, False: 2.74k]
  |  |  ------------------
  ------------------
  229|   776k|	return(1);
  230|   131k|    cur++;
  231|       |
  232|       |#if defined(LIBXML_WINPATH_ENABLED)
  233|       |    /*
  234|       |     * Don't treat Windows drive letters as scheme.
  235|       |     */
  236|       |    if (*cur == ':')
  237|       |        return(1);
  238|       |#endif
  239|       |
  240|   292k|    while (ISA_ALPHA(cur) || ISA_DIGIT(cur) ||
  ------------------
  |  |  128|   585k|#define ISA_ALPHA(p) (((*(p) >= 'a') && (*(p) <= 'z')) ||		\
  |  |  ------------------
  |  |  |  Branch (128:24): [True: 93.8k, False: 198k]
  |  |  |  Branch (128:41): [True: 93.4k, False: 471]
  |  |  ------------------
  |  |  129|   585k|                      ((*(p) >= 'A') && (*(p) <= 'Z')))
  |  |  ------------------
  |  |  |  Branch (129:24): [True: 48.3k, False: 150k]
  |  |  |  Branch (129:41): [True: 47.6k, False: 713]
  |  |  ------------------
  ------------------
                  while (ISA_ALPHA(cur) || ISA_DIGIT(cur) ||
  ------------------
  |  |  127|   444k|#define ISA_DIGIT(p) ((*(p) >= '0') && (*(p) <= '9'))
  |  |  ------------------
  |  |  |  Branch (127:23): [True: 50.7k, False: 100k]
  |  |  |  Branch (127:40): [True: 7.28k, False: 43.4k]
  |  |  ------------------
  ------------------
  241|   161k|           (*cur == '+') || (*cur == '-') || (*cur == '.')) cur++;
  ------------------
  |  Branch (241:12): [True: 7.21k, False: 137k]
  |  Branch (241:29): [True: 3.90k, False: 133k]
  |  Branch (241:46): [True: 2.11k, False: 131k]
  ------------------
  242|   131k|    if (uri != NULL) {
  ------------------
  |  Branch (242:9): [True: 131k, False: 0]
  ------------------
  243|   131k|	if (uri->scheme != NULL) xmlFree(uri->scheme);
  ------------------
  |  Branch (243:6): [True: 0, False: 131k]
  ------------------
  244|   131k|	uri->scheme = STRNDUP(*str, cur - *str);
  ------------------
  |  |  119|   131k|#define STRNDUP(s, n) (char *) xmlStrndup((const xmlChar *)(s), (n))
  ------------------
  245|   131k|        if (uri->scheme == NULL)
  ------------------
  |  Branch (245:13): [True: 34, False: 131k]
  ------------------
  246|     34|            return(-1);
  247|   131k|    }
  248|   131k|    *str = cur;
  249|   131k|    return(0);
  250|   131k|}
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: 30.6k, False: 8.90k]
  |  Branch (788:26): [True: 29.7k, False: 824]
  ------------------
  789|  29.7k|        cur += 2;
  790|  29.7k|	ret = xmlParse3986Authority(uri, &cur);
  791|  29.7k|	if (ret != 0) return(ret);
  ------------------
  |  Branch (791:6): [True: 1.29k, False: 28.4k]
  ------------------
  792|       |        /*
  793|       |         * An empty server is marked with a special URI value.
  794|       |         */
  795|  28.4k|	if ((uri->server == NULL) && (uri->port == PORT_EMPTY))
  ------------------
  |  |   36|  4.53k|#define PORT_EMPTY           0
  ------------------
  |  Branch (795:6): [True: 4.53k, False: 23.9k]
  |  Branch (795:31): [True: 4.29k, False: 234]
  ------------------
  796|  4.29k|	    uri->port = PORT_EMPTY_SERVER;
  ------------------
  |  |   37|  4.29k|#define PORT_EMPTY_SERVER   -1
  ------------------
  797|  28.4k|	ret = xmlParse3986PathAbEmpty(uri, &cur);
  798|  28.4k|	if (ret != 0) return(ret);
  ------------------
  |  Branch (798:6): [True: 8, False: 28.4k]
  ------------------
  799|  28.4k|	*str = cur;
  800|  28.4k|	return(0);
  801|  28.4k|    } else if (*cur == '/') {
  ------------------
  |  Branch (801:16): [True: 824, False: 8.90k]
  ------------------
  802|    824|        ret = xmlParse3986PathAbsolute(uri, &cur);
  803|    824|	if (ret != 0) return(ret);
  ------------------
  |  Branch (803:6): [True: 2, False: 822]
  ------------------
  804|  8.90k|    } else if (ISA_PCHAR(uri, cur)) {
  ------------------
  |  |  174|  8.90k|     (ISA_UNRESERVED(u, p) || ISA_PCT_ENCODED(p) || ISA_SUB_DELIM(p) ||	\
  |  |  ------------------
  |  |  |  |  189|  17.8k|#define ISA_UNRESERVED(u, p) (xmlIsUnreserved(u, p))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (189:30): [True: 2.42k, False: 6.47k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                    (ISA_UNRESERVED(u, p) || ISA_PCT_ENCODED(p) || ISA_SUB_DELIM(p) ||	\
  |  |  ------------------
  |  |  |  |  168|  15.3k|     ((*(p) == '%') && (ISA_HEXDIG(p + 1)) && (ISA_HEXDIG(p + 2)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  131|  1.87k|       (ISA_DIGIT(p) || ((*(p) >= 'a') && (*(p) <= 'f')) ||		\
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  127|  3.75k|#define ISA_DIGIT(p) ((*(p) >= '0') && (*(p) <= '9'))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (127:23): [True: 1.63k, False: 245]
  |  |  |  |  |  |  |  |  |  Branch (127:40): [True: 386, False: 1.24k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (131:26): [True: 880, False: 613]
  |  |  |  |  |  |  |  Branch (131:43): [True: 686, False: 194]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  132|  1.87k|        ((*(p) >= 'A') && (*(p) <= 'F')))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (132:10): [True: 522, False: 285]
  |  |  |  |  |  |  |  Branch (132:27): [True: 328, False: 194]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |                    ((*(p) == '%') && (ISA_HEXDIG(p + 1)) && (ISA_HEXDIG(p + 2)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  131|  1.40k|       (ISA_DIGIT(p) || ((*(p) >= 'a') && (*(p) <= 'f')) ||		\
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  127|  2.80k|#define ISA_DIGIT(p) ((*(p) >= '0') && (*(p) <= '9'))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (127:23): [True: 1.15k, False: 246]
  |  |  |  |  |  |  |  |  |  Branch (127:40): [True: 227, False: 927]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (131:26): [True: 423, False: 750]
  |  |  |  |  |  |  |  Branch (131:43): [True: 204, False: 219]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  132|  1.40k|        ((*(p) >= 'A') && (*(p) <= 'F')))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (132:10): [True: 723, False: 246]
  |  |  |  |  |  |  |  Branch (132:27): [True: 504, False: 219]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (168:7): [True: 1.87k, False: 4.60k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                    (ISA_UNRESERVED(u, p) || ISA_PCT_ENCODED(p) || ISA_SUB_DELIM(p) ||	\
  |  |  ------------------
  |  |  |  |  139|  14.4k|      (((*(p) == '!')) || ((*(p) == '$')) || ((*(p) == '&')) ||		\
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (139:8): [True: 199, False: 5.34k]
  |  |  |  |  |  Branch (139:27): [True: 271, False: 5.07k]
  |  |  |  |  |  Branch (139:46): [True: 203, False: 4.87k]
  |  |  |  |  ------------------
  |  |  |  |  140|  5.54k|       ((*(p) == '(')) || ((*(p) == ')')) || ((*(p) == '*')) ||		\
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (140:8): [True: 218, False: 4.65k]
  |  |  |  |  |  Branch (140:27): [True: 204, False: 4.44k]
  |  |  |  |  |  Branch (140:46): [True: 200, False: 4.24k]
  |  |  |  |  ------------------
  |  |  |  |  141|  5.54k|       ((*(p) == '+')) || ((*(p) == ',')) || ((*(p) == ';')) ||		\
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (141:8): [True: 604, False: 3.64k]
  |  |  |  |  |  Branch (141:27): [True: 210, False: 3.43k]
  |  |  |  |  |  Branch (141:46): [True: 405, False: 3.03k]
  |  |  |  |  ------------------
  |  |  |  |  142|  5.54k|       ((*(p) == '=')) || ((*(p) == '\'')))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (142:8): [True: 195, False: 2.83k]
  |  |  |  |  |  Branch (142:27): [True: 227, False: 2.60k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  175|  8.90k|      ((*(p) == ':')) || ((*(p) == '@')))
  |  |  ------------------
  |  |  |  Branch (175:7): [True: 556, False: 2.05k]
  |  |  |  Branch (175:26): [True: 219, False: 1.83k]
  |  |  ------------------
  ------------------
  805|  7.07k|        ret = xmlParse3986PathRootless(uri, &cur);
  806|  7.07k|	if (ret != 0) return(ret);
  ------------------
  |  Branch (806:6): [True: 16, False: 7.05k]
  ------------------
  807|  7.07k|    } else {
  808|       |	/* path-empty is effectively empty */
  809|  1.83k|	if (uri != NULL) {
  ------------------
  |  Branch (809:6): [True: 1.83k, False: 0]
  ------------------
  810|  1.83k|	    if (uri->path != NULL) xmlFree(uri->path);
  ------------------
  |  Branch (810:10): [True: 0, False: 1.83k]
  ------------------
  811|  1.83k|	    uri->path = NULL;
  812|  1.83k|	}
  813|  1.83k|    }
  814|  9.71k|    *str = cur;
  815|  9.71k|    return (0);
  816|  39.5k|}
uri.c:xmlParse3986Authority:
  529|  33.2k|{
  530|  33.2k|    const char *cur;
  531|  33.2k|    int ret;
  532|       |
  533|  33.2k|    cur = *str;
  534|       |    /*
  535|       |     * try to parse an userinfo and check for the trailing @
  536|       |     */
  537|  33.2k|    ret = xmlParse3986Userinfo(uri, &cur);
  538|  33.2k|    if (ret < 0)
  ------------------
  |  Branch (538:9): [True: 16, False: 33.2k]
  ------------------
  539|     16|        return(ret);
  540|  33.2k|    if ((ret != 0) || (*cur != '@'))
  ------------------
  |  Branch (540:9): [True: 28.2k, False: 4.96k]
  |  Branch (540:23): [True: 0, False: 4.96k]
  ------------------
  541|  28.2k|        cur = *str;
  542|  4.96k|    else
  543|  4.96k|        cur++;
  544|  33.2k|    ret = xmlParse3986Host(uri, &cur);
  545|  33.2k|    if (ret != 0) return(ret);
  ------------------
  |  Branch (545:9): [True: 310, False: 32.9k]
  ------------------
  546|  32.9k|    if (*cur == ':') {
  ------------------
  |  Branch (546:9): [True: 3.53k, False: 29.4k]
  ------------------
  547|  3.53k|        cur++;
  548|  3.53k|        ret = xmlParse3986Port(uri, &cur);
  549|  3.53k|	if (ret != 0) return(ret);
  ------------------
  |  Branch (549:6): [True: 1.34k, False: 2.19k]
  ------------------
  550|  3.53k|    }
  551|  31.6k|    *str = cur;
  552|  31.6k|    return(0);
  553|  32.9k|}
uri.c:xmlParse3986Userinfo:
  379|  33.2k|{
  380|  33.2k|    const char *cur;
  381|       |
  382|  33.2k|    cur = *str;
  383|  2.24M|    while (ISA_UNRESERVED(uri, cur) || ISA_PCT_ENCODED(cur) ||
  ------------------
  |  |  189|  4.49M|#define ISA_UNRESERVED(u, p) (xmlIsUnreserved(u, p))
  |  |  ------------------
  |  |  |  Branch (189:30): [True: 206k, False: 2.04M]
  |  |  ------------------
  ------------------
                  while (ISA_UNRESERVED(uri, cur) || ISA_PCT_ENCODED(cur) ||
  ------------------
  |  |  168|  4.29M|     ((*(p) == '%') && (ISA_HEXDIG(p + 1)) && (ISA_HEXDIG(p + 2)))
  |  |  ------------------
  |  |  |  |  131|  1.98M|       (ISA_DIGIT(p) || ((*(p) >= 'a') && (*(p) <= 'f')) ||		\
  |  |  |  |  ------------------
  |  |  |  |  |  |  127|  3.97M|#define ISA_DIGIT(p) ((*(p) >= '0') && (*(p) <= '9'))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (127:23): [True: 1.98M, False: 226]
  |  |  |  |  |  |  |  Branch (127:40): [True: 1.98M, False: 6.17k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (131:26): [True: 1.62k, False: 4.77k]
  |  |  |  |  |  Branch (131:43): [True: 1.43k, False: 196]
  |  |  |  |  ------------------
  |  |  |  |  132|  1.98M|        ((*(p) >= 'A') && (*(p) <= 'F')))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (132:10): [True: 4.74k, False: 230]
  |  |  |  |  |  Branch (132:27): [True: 4.50k, False: 234]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                    ((*(p) == '%') && (ISA_HEXDIG(p + 1)) && (ISA_HEXDIG(p + 2)))
  |  |  ------------------
  |  |  |  |  131|  1.98M|       (ISA_DIGIT(p) || ((*(p) >= 'a') && (*(p) <= 'f')) ||		\
  |  |  |  |  ------------------
  |  |  |  |  |  |  127|  3.97M|#define ISA_DIGIT(p) ((*(p) >= '0') && (*(p) <= '9'))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (127:23): [True: 1.98M, False: 390]
  |  |  |  |  |  |  |  Branch (127:40): [True: 1.98M, False: 5.59k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (131:26): [True: 896, False: 5.08k]
  |  |  |  |  |  Branch (131:43): [True: 643, False: 253]
  |  |  |  |  ------------------
  |  |  |  |  132|  1.98M|        ((*(p) >= 'A') && (*(p) <= 'F')))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (132:10): [True: 4.77k, False: 563]
  |  |  |  |  |  Branch (132:27): [True: 4.51k, False: 263]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (168:7): [True: 1.98M, False: 52.6k]
  |  |  ------------------
  ------------------
  384|  53.9k|           ISA_SUB_DELIM(cur) || (*cur == ':'))
  ------------------
  |  |  139|  2.30M|      (((*(p) == '!')) || ((*(p) == '$')) || ((*(p) == '&')) ||		\
  |  |  ------------------
  |  |  |  Branch (139:8): [True: 1.16k, False: 52.7k]
  |  |  |  Branch (139:27): [True: 781, False: 51.9k]
  |  |  |  Branch (139:46): [True: 368, False: 51.6k]
  |  |  ------------------
  |  |  140|  53.9k|       ((*(p) == '(')) || ((*(p) == ')')) || ((*(p) == '*')) ||		\
  |  |  ------------------
  |  |  |  Branch (140:8): [True: 1.60k, False: 50.0k]
  |  |  |  Branch (140:27): [True: 2.01k, False: 47.9k]
  |  |  |  Branch (140:46): [True: 1.56k, False: 46.4k]
  |  |  ------------------
  |  |  141|  53.9k|       ((*(p) == '+')) || ((*(p) == ',')) || ((*(p) == ';')) ||		\
  |  |  ------------------
  |  |  |  Branch (141:8): [True: 878, False: 45.5k]
  |  |  |  Branch (141:27): [True: 2.87k, False: 42.6k]
  |  |  |  Branch (141:46): [True: 750, False: 41.9k]
  |  |  ------------------
  |  |  142|  53.9k|       ((*(p) == '=')) || ((*(p) == '\'')))
  |  |  ------------------
  |  |  |  Branch (142:8): [True: 883, False: 41.0k]
  |  |  |  Branch (142:27): [True: 2.86k, False: 38.1k]
  |  |  ------------------
  ------------------
  |  Branch (384:34): [True: 4.90k, False: 33.2k]
  ------------------
  385|  2.21M|	NEXT(cur);
  ------------------
  |  |  108|  2.21M|#define NEXT(p) ((*p == '%')? p += 3 : p++)
  |  |  ------------------
  |  |  |  Branch (108:18): [True: 1.98M, False: 227k]
  |  |  ------------------
  ------------------
  386|  33.2k|    if (*cur == '@') {
  ------------------
  |  Branch (386:9): [True: 4.98k, False: 28.2k]
  ------------------
  387|  4.98k|	if (uri != NULL) {
  ------------------
  |  Branch (387:6): [True: 4.98k, False: 0]
  ------------------
  388|  4.98k|	    if (uri->user != NULL) xmlFree(uri->user);
  ------------------
  |  Branch (388:10): [True: 0, False: 4.98k]
  ------------------
  389|  4.98k|	    if (uri->cleanup & XML_URI_NO_UNESCAPE)
  ------------------
  |  |  192|  4.98k|#define XML_URI_NO_UNESCAPE     2
  ------------------
  |  Branch (389:10): [True: 0, False: 4.98k]
  ------------------
  390|      0|		uri->user = STRNDUP(*str, cur - *str);
  ------------------
  |  |  119|      0|#define STRNDUP(s, n) (char *) xmlStrndup((const xmlChar *)(s), (n))
  ------------------
  391|  4.98k|	    else
  392|  4.98k|		uri->user = xmlURIUnescapeString(*str, cur - *str, NULL);
  393|  4.98k|            if (uri->user == NULL)
  ------------------
  |  Branch (393:17): [True: 16, False: 4.96k]
  ------------------
  394|     16|                return(-1);
  395|  4.98k|	}
  396|  4.96k|	*str = cur;
  397|  4.96k|	return(0);
  398|  4.98k|    }
  399|  28.2k|    return(1);
  400|  33.2k|}
uri.c:xmlParse3986Host:
  452|  33.2k|{
  453|  33.2k|    const char *cur = *str;
  454|  33.2k|    const char *host;
  455|       |
  456|  33.2k|    host = cur;
  457|       |    /*
  458|       |     * IPv6 and future addressing scheme are enclosed between brackets
  459|       |     */
  460|  33.2k|    if (*cur == '[') {
  ------------------
  |  Branch (460:9): [True: 464, False: 32.7k]
  ------------------
  461|    464|        cur++;
  462|  3.77k|	while ((*cur != ']') && (*cur != 0))
  ------------------
  |  Branch (462:9): [True: 3.57k, False: 195]
  |  Branch (462:26): [True: 3.30k, False: 269]
  ------------------
  463|  3.30k|	    cur++;
  464|    464|	if (*cur != ']')
  ------------------
  |  Branch (464:6): [True: 269, False: 195]
  ------------------
  465|    269|	    return(1);
  466|    195|	cur++;
  467|    195|	goto found;
  468|    464|    }
  469|       |    /*
  470|       |     * try to parse an IPv4
  471|       |     */
  472|  32.7k|    if (ISA_DIGIT(cur)) {
  ------------------
  |  |  127|  32.7k|#define ISA_DIGIT(p) ((*(p) >= '0') && (*(p) <= '9'))
  |  |  ------------------
  |  |  |  Branch (127:23): [True: 23.9k, False: 8.88k]
  |  |  |  Branch (127:40): [True: 7.29k, False: 16.6k]
  |  |  ------------------
  ------------------
  473|  7.29k|        if (xmlParse3986DecOctet(&cur) != 0)
  ------------------
  |  Branch (473:13): [True: 1.18k, False: 6.10k]
  ------------------
  474|  1.18k|	    goto not_ipv4;
  475|  6.10k|	if (*cur != '.')
  ------------------
  |  Branch (475:6): [True: 3.22k, False: 2.87k]
  ------------------
  476|  3.22k|	    goto not_ipv4;
  477|  2.87k|	cur++;
  478|  2.87k|        if (xmlParse3986DecOctet(&cur) != 0)
  ------------------
  |  Branch (478:13): [True: 1.17k, False: 1.70k]
  ------------------
  479|  1.17k|	    goto not_ipv4;
  480|  1.70k|	if (*cur != '.')
  ------------------
  |  Branch (480:6): [True: 1.50k, False: 204]
  ------------------
  481|  1.50k|	    goto not_ipv4;
  482|    204|        if (xmlParse3986DecOctet(&cur) != 0)
  ------------------
  |  Branch (482:13): [True: 204, False: 0]
  ------------------
  483|    204|	    goto not_ipv4;
  484|      0|	if (*cur != '.')
  ------------------
  |  Branch (484:6): [True: 0, False: 0]
  ------------------
  485|      0|	    goto not_ipv4;
  486|      0|        if (xmlParse3986DecOctet(&cur) != 0)
  ------------------
  |  Branch (486:13): [True: 0, False: 0]
  ------------------
  487|      0|	    goto not_ipv4;
  488|      0|	goto found;
  489|  7.29k|not_ipv4:
  490|  7.29k|        cur = *str;
  491|  7.29k|    }
  492|       |    /*
  493|       |     * then this should be a hostname which can be empty
  494|       |     */
  495|  8.45M|    while (ISA_UNRESERVED(uri, cur) ||
  ------------------
  |  |  189|  16.9M|#define ISA_UNRESERVED(u, p) (xmlIsUnreserved(u, p))
  |  |  ------------------
  |  |  |  Branch (189:30): [True: 8.40M, False: 52.9k]
  |  |  ------------------
  ------------------
  496|  52.9k|           ISA_PCT_ENCODED(cur) || ISA_SUB_DELIM(cur))
  ------------------
  |  |  168|  8.50M|     ((*(p) == '%') && (ISA_HEXDIG(p + 1)) && (ISA_HEXDIG(p + 2)))
  |  |  ------------------
  |  |  |  |  131|  3.86k|       (ISA_DIGIT(p) || ((*(p) >= 'a') && (*(p) <= 'f')) ||		\
  |  |  |  |  ------------------
  |  |  |  |  |  |  127|  7.73k|#define ISA_DIGIT(p) ((*(p) >= '0') && (*(p) <= '9'))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (127:23): [True: 3.65k, False: 215]
  |  |  |  |  |  |  |  Branch (127:40): [True: 1.08k, False: 2.56k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (131:26): [True: 1.84k, False: 941]
  |  |  |  |  |  Branch (131:43): [True: 1.64k, False: 196]
  |  |  |  |  ------------------
  |  |  |  |  132|  3.86k|        ((*(p) >= 'A') && (*(p) <= 'F')))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (132:10): [True: 870, False: 267]
  |  |  |  |  |  Branch (132:27): [True: 634, False: 236]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                    ((*(p) == '%') && (ISA_HEXDIG(p + 1)) && (ISA_HEXDIG(p + 2)))
  |  |  ------------------
  |  |  |  |  131|  3.36k|       (ISA_DIGIT(p) || ((*(p) >= 'a') && (*(p) <= 'f')) ||		\
  |  |  |  |  ------------------
  |  |  |  |  |  |  127|  6.72k|#define ISA_DIGIT(p) ((*(p) >= '0') && (*(p) <= '9'))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (127:23): [True: 2.94k, False: 418]
  |  |  |  |  |  |  |  Branch (127:40): [True: 640, False: 2.30k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (131:26): [True: 1.20k, False: 1.51k]
  |  |  |  |  |  Branch (131:43): [True: 955, False: 253]
  |  |  |  |  ------------------
  |  |  |  |  132|  3.36k|        ((*(p) >= 'A') && (*(p) <= 'F')))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (132:10): [True: 1.17k, False: 591]
  |  |  |  |  |  Branch (132:27): [True: 913, False: 263]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (168:7): [True: 3.86k, False: 49.1k]
  |  |  ------------------
  ------------------
                         ISA_PCT_ENCODED(cur) || ISA_SUB_DELIM(cur))
  ------------------
  |  |  139|  50.4k|      (((*(p) == '!')) || ((*(p) == '$')) || ((*(p) == '&')) ||		\
  |  |  ------------------
  |  |  |  Branch (139:8): [True: 1.23k, False: 49.2k]
  |  |  |  Branch (139:27): [True: 992, False: 48.2k]
  |  |  |  Branch (139:46): [True: 629, False: 47.6k]
  |  |  ------------------
  |  |  140|  50.4k|       ((*(p) == '(')) || ((*(p) == ')')) || ((*(p) == '*')) ||		\
  |  |  ------------------
  |  |  |  Branch (140:8): [True: 1.26k, False: 46.3k]
  |  |  |  Branch (140:27): [True: 1.37k, False: 44.9k]
  |  |  |  Branch (140:46): [True: 1.03k, False: 43.9k]
  |  |  ------------------
  |  |  141|  50.4k|       ((*(p) == '+')) || ((*(p) == ',')) || ((*(p) == ';')) ||		\
  |  |  ------------------
  |  |  |  Branch (141:8): [True: 1.26k, False: 42.6k]
  |  |  |  Branch (141:27): [True: 2.77k, False: 39.9k]
  |  |  |  Branch (141:46): [True: 3.47k, False: 36.4k]
  |  |  ------------------
  |  |  142|  50.4k|       ((*(p) == '=')) || ((*(p) == '\'')))
  |  |  ------------------
  |  |  |  Branch (142:8): [True: 1.67k, False: 34.7k]
  |  |  |  Branch (142:27): [True: 1.95k, False: 32.7k]
  |  |  ------------------
  ------------------
  497|  8.42M|        NEXT(cur);
  ------------------
  |  |  108|  8.45M|#define NEXT(p) ((*p == '%')? p += 3 : p++)
  |  |  ------------------
  |  |  |  Branch (108:18): [True: 2.50k, False: 8.42M]
  |  |  ------------------
  ------------------
  498|  32.9k|found:
  499|  32.9k|    if (uri != NULL) {
  ------------------
  |  Branch (499:9): [True: 32.9k, False: 0]
  ------------------
  500|  32.9k|	if (uri->authority != NULL) xmlFree(uri->authority);
  ------------------
  |  Branch (500:6): [True: 0, False: 32.9k]
  ------------------
  501|  32.9k|	uri->authority = NULL;
  502|  32.9k|	if (uri->server != NULL) xmlFree(uri->server);
  ------------------
  |  Branch (502:6): [True: 0, False: 32.9k]
  ------------------
  503|  32.9k|	if (cur != host) {
  ------------------
  |  Branch (503:6): [True: 27.1k, False: 5.84k]
  ------------------
  504|  27.1k|	    if (uri->cleanup & XML_URI_NO_UNESCAPE)
  ------------------
  |  |  192|  27.1k|#define XML_URI_NO_UNESCAPE     2
  ------------------
  |  Branch (504:10): [True: 0, False: 27.1k]
  ------------------
  505|      0|		uri->server = STRNDUP(host, cur - host);
  ------------------
  |  |  119|      0|#define STRNDUP(s, n) (char *) xmlStrndup((const xmlChar *)(s), (n))
  ------------------
  506|  27.1k|	    else
  507|  27.1k|		uri->server = xmlURIUnescapeString(host, cur - host, NULL);
  508|  27.1k|            if (uri->server == NULL)
  ------------------
  |  Branch (508:17): [True: 41, False: 27.1k]
  ------------------
  509|     41|                return(-1);
  510|  27.1k|	} else
  511|  5.84k|	    uri->server = NULL;
  512|  32.9k|    }
  513|  32.9k|    *str = cur;
  514|  32.9k|    return(0);
  515|  32.9k|}
uri.c:xmlParse3986DecOctet:
  415|  10.3k|xmlParse3986DecOctet(const char **str) {
  416|  10.3k|    const char *cur = *str;
  417|       |
  418|  10.3k|    if (!(ISA_DIGIT(cur)))
  ------------------
  |  |  127|  10.3k|#define ISA_DIGIT(p) ((*(p) >= '0') && (*(p) <= '9'))
  |  |  ------------------
  |  |  |  Branch (127:23): [True: 9.74k, False: 625]
  |  |  |  Branch (127:40): [True: 9.40k, False: 346]
  |  |  ------------------
  ------------------
  419|    971|        return(1);
  420|  9.40k|    if (!ISA_DIGIT(cur+1))
  ------------------
  |  |  127|  9.40k|#define ISA_DIGIT(p) ((*(p) >= '0') && (*(p) <= '9'))
  |  |  ------------------
  |  |  |  Branch (127:23): [True: 5.70k, False: 3.69k]
  |  |  |  Branch (127:40): [True: 4.48k, False: 1.22k]
  |  |  ------------------
  ------------------
  421|  4.91k|	cur++;
  422|  4.48k|    else if ((*cur != '0') && (ISA_DIGIT(cur + 1)) && (!ISA_DIGIT(cur+2)))
  ------------------
  |  |  127|  3.93k|#define ISA_DIGIT(p) ((*(p) >= '0') && (*(p) <= '9'))
  |  |  ------------------
  |  |  |  Branch (127:23): [True: 3.93k, False: 0]
  |  |  |  Branch (127:40): [True: 3.93k, False: 0]
  |  |  ------------------
  ------------------
                  else if ((*cur != '0') && (ISA_DIGIT(cur + 1)) && (!ISA_DIGIT(cur+2)))
  ------------------
  |  |  127|  3.93k|#define ISA_DIGIT(p) ((*(p) >= '0') && (*(p) <= '9'))
  |  |  ------------------
  |  |  |  Branch (127:23): [True: 3.02k, False: 910]
  |  |  |  Branch (127:40): [True: 2.62k, False: 404]
  |  |  ------------------
  ------------------
  |  Branch (422:14): [True: 3.93k, False: 547]
  ------------------
  423|  1.31k|	cur += 2;
  424|  3.17k|    else if ((*cur == '1') && (ISA_DIGIT(cur + 1)) && (ISA_DIGIT(cur + 2)))
  ------------------
  |  |  127|    507|#define ISA_DIGIT(p) ((*(p) >= '0') && (*(p) <= '9'))
  |  |  ------------------
  |  |  |  Branch (127:23): [True: 507, False: 0]
  |  |  |  Branch (127:40): [True: 507, False: 0]
  |  |  ------------------
  ------------------
                  else if ((*cur == '1') && (ISA_DIGIT(cur + 1)) && (ISA_DIGIT(cur + 2)))
  ------------------
  |  |  127|    507|#define ISA_DIGIT(p) ((*(p) >= '0') && (*(p) <= '9'))
  |  |  ------------------
  |  |  |  Branch (127:23): [True: 507, False: 0]
  |  |  |  Branch (127:40): [True: 507, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (424:14): [True: 507, False: 2.66k]
  ------------------
  425|    507|	cur += 3;
  426|  2.66k|    else if ((*cur == '2') && (*(cur + 1) >= '0') &&
  ------------------
  |  Branch (426:14): [True: 1.48k, False: 1.18k]
  |  Branch (426:31): [True: 1.48k, False: 0]
  ------------------
  427|  1.48k|	     (*(cur + 1) <= '4') && (ISA_DIGIT(cur + 2)))
  ------------------
  |  |  127|    524|#define ISA_DIGIT(p) ((*(p) >= '0') && (*(p) <= '9'))
  |  |  ------------------
  |  |  |  Branch (127:23): [True: 524, False: 0]
  |  |  |  Branch (127:40): [True: 524, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (427:7): [True: 524, False: 960]
  ------------------
  428|    524|	cur += 3;
  429|  2.14k|    else if ((*cur == '2') && (*(cur + 1) == '5') &&
  ------------------
  |  Branch (429:14): [True: 960, False: 1.18k]
  |  Branch (429:31): [True: 549, False: 411]
  ------------------
  430|    549|	     (*(cur + 2) >= '0') && (*(cur + 1) <= '5'))
  ------------------
  |  Branch (430:7): [True: 549, False: 0]
  |  Branch (430:30): [True: 549, False: 0]
  ------------------
  431|    549|	cur += 3;
  432|  1.59k|    else
  433|  1.59k|        return(1);
  434|  7.81k|    *str = cur;
  435|  7.81k|    return(0);
  436|  9.40k|}
uri.c:xmlParse3986Port:
  342|  3.53k|{
  343|  3.53k|    const char *cur = *str;
  344|  3.53k|    int port = 0;
  345|       |
  346|  3.53k|    if (ISA_DIGIT(cur)) {
  ------------------
  |  |  127|  3.53k|#define ISA_DIGIT(p) ((*(p) >= '0') && (*(p) <= '9'))
  |  |  ------------------
  |  |  |  Branch (127:23): [True: 3.04k, False: 494]
  |  |  |  Branch (127:40): [True: 2.59k, False: 446]
  |  |  ------------------
  ------------------
  347|  10.7k|	while (ISA_DIGIT(cur)) {
  ------------------
  |  |  127|  10.7k|#define ISA_DIGIT(p) ((*(p) >= '0') && (*(p) <= '9'))
  |  |  ------------------
  |  |  |  Branch (127:23): [True: 8.88k, False: 1.90k]
  |  |  |  Branch (127:40): [True: 8.59k, False: 294]
  |  |  ------------------
  ------------------
  348|  8.59k|            int digit = *cur - '0';
  349|       |
  350|  8.59k|            if (port > INT_MAX / 10)
  ------------------
  |  Branch (350:17): [True: 206, False: 8.38k]
  ------------------
  351|    206|                return(1);
  352|  8.38k|            port *= 10;
  353|  8.38k|            if (port > INT_MAX - digit)
  ------------------
  |  Branch (353:17): [True: 195, False: 8.19k]
  ------------------
  354|    195|                return(1);
  355|  8.19k|	    port += digit;
  356|       |
  357|  8.19k|	    cur++;
  358|  8.19k|	}
  359|  2.19k|	if (uri != NULL)
  ------------------
  |  Branch (359:6): [True: 2.19k, False: 0]
  ------------------
  360|  2.19k|	    uri->port = port;
  361|  2.19k|	*str = cur;
  362|  2.19k|	return(0);
  363|  2.59k|    }
  364|    940|    return(1);
  365|  3.53k|}
uri.c:xmlParse3986PathAbEmpty:
  609|  31.6k|{
  610|  31.6k|    const char *cur;
  611|  31.6k|    int ret;
  612|       |
  613|  31.6k|    cur = *str;
  614|       |
  615|  91.6k|    while (*cur == '/') {
  ------------------
  |  Branch (615:12): [True: 60.0k, False: 31.6k]
  ------------------
  616|  60.0k|        cur++;
  617|  60.0k|	ret = xmlParse3986Segment(uri, &cur, 0, 1);
  618|  60.0k|	if (ret != 0) return(ret);
  ------------------
  |  Branch (618:6): [True: 0, False: 60.0k]
  ------------------
  619|  60.0k|    }
  620|  31.6k|    if (uri != NULL) {
  ------------------
  |  Branch (620:9): [True: 31.6k, False: 0]
  ------------------
  621|  31.6k|	if (uri->path != NULL) xmlFree(uri->path);
  ------------------
  |  Branch (621:6): [True: 0, False: 31.6k]
  ------------------
  622|  31.6k|        if (*str != cur) {
  ------------------
  |  Branch (622:13): [True: 17.1k, False: 14.4k]
  ------------------
  623|  17.1k|            if (uri->cleanup & XML_URI_NO_UNESCAPE)
  ------------------
  |  |  192|  17.1k|#define XML_URI_NO_UNESCAPE     2
  ------------------
  |  Branch (623:17): [True: 0, False: 17.1k]
  ------------------
  624|      0|                uri->path = STRNDUP(*str, cur - *str);
  ------------------
  |  |  119|      0|#define STRNDUP(s, n) (char *) xmlStrndup((const xmlChar *)(s), (n))
  ------------------
  625|  17.1k|            else
  626|  17.1k|                uri->path = xmlURIUnescapeString(*str, cur - *str, NULL);
  627|  17.1k|            if (uri->path == NULL)
  ------------------
  |  Branch (627:17): [True: 10, False: 17.1k]
  ------------------
  628|     10|                return (-1);
  629|  17.1k|        } else {
  630|  14.4k|            uri->path = NULL;
  631|  14.4k|        }
  632|  31.6k|    }
  633|  31.6k|    *str = cur;
  634|  31.6k|    return (0);
  635|  31.6k|}
uri.c:xmlParse3986Segment:
  572|   316k|{
  573|   316k|    const char *cur;
  574|       |
  575|   316k|    cur = *str;
  576|   316k|    if (!ISA_PCHAR(uri, cur) || (*cur == forbid)) {
  ------------------
  |  |  174|   632k|     (ISA_UNRESERVED(u, p) || ISA_PCT_ENCODED(p) || ISA_SUB_DELIM(p) ||	\
  |  |  ------------------
  |  |  |  |  189|   632k|#define ISA_UNRESERVED(u, p) (xmlIsUnreserved(u, p))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (189:30): [True: 213k, False: 102k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                    (ISA_UNRESERVED(u, p) || ISA_PCT_ENCODED(p) || ISA_SUB_DELIM(p) ||	\
  |  |  ------------------
  |  |  |  |  168|   419k|     ((*(p) == '%') && (ISA_HEXDIG(p + 1)) && (ISA_HEXDIG(p + 2)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  131|  4.69k|       (ISA_DIGIT(p) || ((*(p) >= 'a') && (*(p) <= 'f')) ||		\
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  127|  9.39k|#define ISA_DIGIT(p) ((*(p) >= '0') && (*(p) <= '9'))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (127:23): [True: 4.45k, False: 239]
  |  |  |  |  |  |  |  |  |  Branch (127:40): [True: 1.34k, False: 3.11k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (131:26): [True: 1.52k, False: 1.83k]
  |  |  |  |  |  |  |  Branch (131:43): [True: 1.32k, False: 198]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  132|  4.69k|        ((*(p) >= 'A') && (*(p) <= 'F')))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (132:10): [True: 1.79k, False: 243]
  |  |  |  |  |  |  |  Branch (132:27): [True: 1.54k, False: 248]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |                    ((*(p) == '%') && (ISA_HEXDIG(p + 1)) && (ISA_HEXDIG(p + 2)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  131|  4.20k|       (ISA_DIGIT(p) || ((*(p) >= 'a') && (*(p) <= 'f')) ||		\
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  127|  8.41k|#define ISA_DIGIT(p) ((*(p) >= '0') && (*(p) <= '9'))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (127:23): [True: 3.98k, False: 224]
  |  |  |  |  |  |  |  |  |  Branch (127:40): [True: 1.02k, False: 2.96k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (131:26): [True: 1.04k, False: 2.14k]
  |  |  |  |  |  |  |  Branch (131:43): [True: 848, False: 195]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  132|  4.20k|        ((*(p) >= 'A') && (*(p) <= 'F')))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (132:10): [True: 2.11k, False: 224]
  |  |  |  |  |  |  |  Branch (132:27): [True: 1.78k, False: 328]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (168:7): [True: 4.69k, False: 97.9k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                    (ISA_UNRESERVED(u, p) || ISA_PCT_ENCODED(p) || ISA_SUB_DELIM(p) ||	\
  |  |  ------------------
  |  |  |  |  139|   415k|      (((*(p) == '!')) || ((*(p) == '$')) || ((*(p) == '&')) ||		\
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (139:8): [True: 3.21k, False: 95.7k]
  |  |  |  |  |  Branch (139:27): [True: 2.35k, False: 93.4k]
  |  |  |  |  |  Branch (139:46): [True: 760, False: 92.6k]
  |  |  |  |  ------------------
  |  |  |  |  140|  99.0k|       ((*(p) == '(')) || ((*(p) == ')')) || ((*(p) == '*')) ||		\
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (140:8): [True: 1.00k, False: 91.6k]
  |  |  |  |  |  Branch (140:27): [True: 1.13k, False: 90.5k]
  |  |  |  |  |  Branch (140:46): [True: 50.1k, False: 40.3k]
  |  |  |  |  ------------------
  |  |  |  |  141|  99.0k|       ((*(p) == '+')) || ((*(p) == ',')) || ((*(p) == ';')) ||		\
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (141:8): [True: 2.82k, False: 37.5k]
  |  |  |  |  |  Branch (141:27): [True: 1.54k, False: 35.9k]
  |  |  |  |  |  Branch (141:46): [True: 2.36k, False: 33.6k]
  |  |  |  |  ------------------
  |  |  |  |  142|  99.0k|       ((*(p) == '=')) || ((*(p) == '\'')))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (142:8): [True: 967, False: 32.6k]
  |  |  |  |  |  Branch (142:27): [True: 1.55k, False: 31.1k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  175|   316k|      ((*(p) == ':')) || ((*(p) == '@')))
  |  |  ------------------
  |  |  |  Branch (175:7): [True: 3.75k, False: 27.3k]
  |  |  |  Branch (175:26): [True: 3.55k, False: 23.7k]
  |  |  ------------------
  ------------------
  |  Branch (576:33): [True: 1.33k, False: 291k]
  ------------------
  577|  25.1k|        if (empty)
  ------------------
  |  Branch (577:13): [True: 21.1k, False: 3.98k]
  ------------------
  578|  21.1k|	    return(0);
  579|  3.98k|	return(1);
  580|  25.1k|    }
  581|   291k|    NEXT(cur);
  ------------------
  |  |  108|   291k|#define NEXT(p) ((*p == '%')? p += 3 : p++)
  |  |  ------------------
  |  |  |  Branch (108:18): [True: 3.65k, False: 287k]
  |  |  ------------------
  ------------------
  582|       |
  583|       |#if defined(LIBXML_WINPATH_ENABLED)
  584|       |    /*
  585|       |     * Allow Windows drive letters.
  586|       |     */
  587|       |    if ((forbid == ':') && (*cur == forbid))
  588|       |        NEXT(cur);
  589|       |#endif
  590|       |
  591|  6.97M|    while (ISA_PCHAR(uri, cur) && (*cur != forbid))
  ------------------
  |  |  174|  13.9M|     (ISA_UNRESERVED(u, p) || ISA_PCT_ENCODED(p) || ISA_SUB_DELIM(p) ||	\
  |  |  ------------------
  |  |  |  |  189|  13.9M|#define ISA_UNRESERVED(u, p) (xmlIsUnreserved(u, p))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (189:30): [True: 5.14M, False: 1.83M]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                    (ISA_UNRESERVED(u, p) || ISA_PCT_ENCODED(p) || ISA_SUB_DELIM(p) ||	\
  |  |  ------------------
  |  |  |  |  168|  8.81M|     ((*(p) == '%') && (ISA_HEXDIG(p + 1)) && (ISA_HEXDIG(p + 2)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  131|  6.70k|       (ISA_DIGIT(p) || ((*(p) >= 'a') && (*(p) <= 'f')) ||		\
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  127|  13.4k|#define ISA_DIGIT(p) ((*(p) >= '0') && (*(p) <= '9'))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (127:23): [True: 6.31k, False: 392]
  |  |  |  |  |  |  |  |  |  Branch (127:40): [True: 3.65k, False: 2.66k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (131:26): [True: 1.43k, False: 1.62k]
  |  |  |  |  |  |  |  Branch (131:43): [True: 1.23k, False: 199]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  132|  6.70k|        ((*(p) >= 'A') && (*(p) <= 'F')))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (132:10): [True: 1.41k, False: 404]
  |  |  |  |  |  |  |  Branch (132:27): [True: 1.05k, False: 358]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |                    ((*(p) == '%') && (ISA_HEXDIG(p + 1)) && (ISA_HEXDIG(p + 2)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  131|  5.94k|       (ISA_DIGIT(p) || ((*(p) >= 'a') && (*(p) <= 'f')) ||		\
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  127|  11.8k|#define ISA_DIGIT(p) ((*(p) >= '0') && (*(p) <= '9'))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (127:23): [True: 5.66k, False: 283]
  |  |  |  |  |  |  |  |  |  Branch (127:40): [True: 2.18k, False: 3.48k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (131:26): [True: 1.25k, False: 2.51k]
  |  |  |  |  |  |  |  Branch (131:43): [True: 1.01k, False: 237]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  132|  5.94k|        ((*(p) >= 'A') && (*(p) <= 'F')))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (132:10): [True: 2.36k, False: 388]
  |  |  |  |  |  |  |  Branch (132:27): [True: 1.98k, False: 375]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (168:7): [True: 6.70k, False: 1.82M]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                    (ISA_UNRESERVED(u, p) || ISA_PCT_ENCODED(p) || ISA_SUB_DELIM(p) ||	\
  |  |  ------------------
  |  |  |  |  139|  8.80M|      (((*(p) == '!')) || ((*(p) == '$')) || ((*(p) == '&')) ||		\
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (139:8): [True: 4.97k, False: 1.82M]
  |  |  |  |  |  Branch (139:27): [True: 1.07k, False: 1.82M]
  |  |  |  |  |  Branch (139:46): [True: 487, False: 1.82M]
  |  |  |  |  ------------------
  |  |  |  |  140|  1.82M|       ((*(p) == '(')) || ((*(p) == ')')) || ((*(p) == '*')) ||		\
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (140:8): [True: 34.8k, False: 1.78M]
  |  |  |  |  |  Branch (140:27): [True: 1.80k, False: 1.78M]
  |  |  |  |  |  Branch (140:46): [True: 1.47M, False: 315k]
  |  |  |  |  ------------------
  |  |  |  |  141|  1.82M|       ((*(p) == '+')) || ((*(p) == ',')) || ((*(p) == ';')) ||		\
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (141:8): [True: 2.36k, False: 313k]
  |  |  |  |  |  Branch (141:27): [True: 2.61k, False: 310k]
  |  |  |  |  |  Branch (141:46): [True: 2.63k, False: 308k]
  |  |  |  |  ------------------
  |  |  |  |  142|  1.82M|       ((*(p) == '=')) || ((*(p) == '\'')))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (142:8): [True: 2.25k, False: 305k]
  |  |  |  |  |  Branch (142:27): [True: 5.61k, False: 300k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  175|  6.97M|      ((*(p) == ':')) || ((*(p) == '@')))
  |  |  ------------------
  |  |  |  Branch (175:7): [True: 14.6k, False: 285k]
  |  |  |  Branch (175:26): [True: 2.72k, False: 282k]
  |  |  ------------------
  ------------------
  |  Branch (591:35): [True: 6.68M, False: 8.24k]
  ------------------
  592|  6.68M|        NEXT(cur);
  ------------------
  |  |  108|  6.97M|#define NEXT(p) ((*p == '%')? p += 3 : p++)
  |  |  ------------------
  |  |  |  Branch (108:18): [True: 5.18k, False: 6.68M]
  |  |  ------------------
  ------------------
  593|   291k|    *str = cur;
  594|   291k|    return (0);
  595|   316k|}
uri.c:xmlParse3986PathAbsolute:
  649|  8.37k|{
  650|  8.37k|    const char *cur;
  651|  8.37k|    int ret;
  652|       |
  653|  8.37k|    cur = *str;
  654|       |
  655|  8.37k|    if (*cur != '/')
  ------------------
  |  Branch (655:9): [True: 0, False: 8.37k]
  ------------------
  656|      0|        return(1);
  657|  8.37k|    cur++;
  658|  8.37k|    ret = xmlParse3986Segment(uri, &cur, 0, 0);
  659|  8.37k|    if (ret == 0) {
  ------------------
  |  Branch (659:9): [True: 5.73k, False: 2.64k]
  ------------------
  660|  15.9k|	while (*cur == '/') {
  ------------------
  |  Branch (660:9): [True: 10.1k, False: 5.73k]
  ------------------
  661|  10.1k|	    cur++;
  662|  10.1k|	    ret = xmlParse3986Segment(uri, &cur, 0, 1);
  663|  10.1k|	    if (ret != 0) return(ret);
  ------------------
  |  Branch (663:10): [True: 0, False: 10.1k]
  ------------------
  664|  10.1k|	}
  665|  5.73k|    }
  666|  8.37k|    if (uri != NULL) {
  ------------------
  |  Branch (666:9): [True: 8.37k, False: 0]
  ------------------
  667|  8.37k|	if (uri->path != NULL) xmlFree(uri->path);
  ------------------
  |  Branch (667:6): [True: 0, False: 8.37k]
  ------------------
  668|  8.37k|        if (cur != *str) {
  ------------------
  |  Branch (668:13): [True: 8.37k, False: 0]
  ------------------
  669|  8.37k|            if (uri->cleanup & XML_URI_NO_UNESCAPE)
  ------------------
  |  |  192|  8.37k|#define XML_URI_NO_UNESCAPE     2
  ------------------
  |  Branch (669:17): [True: 0, False: 8.37k]
  ------------------
  670|      0|                uri->path = STRNDUP(*str, cur - *str);
  ------------------
  |  |  119|      0|#define STRNDUP(s, n) (char *) xmlStrndup((const xmlChar *)(s), (n))
  ------------------
  671|  8.37k|            else
  672|  8.37k|                uri->path = xmlURIUnescapeString(*str, cur - *str, NULL);
  673|  8.37k|            if (uri->path == NULL)
  ------------------
  |  Branch (673:17): [True: 16, False: 8.36k]
  ------------------
  674|     16|                return (-1);
  675|  8.37k|        } else {
  676|      0|            uri->path = NULL;
  677|      0|        }
  678|  8.37k|    }
  679|  8.36k|    *str = cur;
  680|  8.36k|    return (0);
  681|  8.37k|}
uri.c:xmlIsUnreserved:
  196|  59.2M|xmlIsUnreserved(xmlURIPtr uri, const char *cur) {
  197|  59.2M|    if (uri == NULL)
  ------------------
  |  Branch (197:9): [True: 0, False: 59.2M]
  ------------------
  198|      0|        return(0);
  199|       |
  200|  59.2M|    if (ISA_STRICTLY_UNRESERVED(cur))
  ------------------
  |  |  161|  59.2M|      ((ISA_ALPHA(p)) || (ISA_DIGIT(p)) || ((*(p) == '-')) ||		\
  |  |  ------------------
  |  |  |  |  128|  59.2M|#define ISA_ALPHA(p) (((*(p) >= 'a') && (*(p) <= 'z')) ||		\
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (128:24): [True: 5.75M, False: 53.5M]
  |  |  |  |  |  Branch (128:41): [True: 5.73M, False: 21.4k]
  |  |  |  |  ------------------
  |  |  |  |  129|  59.2M|                      ((*(p) >= 'A') && (*(p) <= 'Z')))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (129:24): [True: 41.7M, False: 11.8M]
  |  |  |  |  |  Branch (129:41): [True: 41.6M, False: 29.7k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                     ((ISA_ALPHA(p)) || (ISA_DIGIT(p)) || ((*(p) == '-')) ||		\
  |  |  ------------------
  |  |  |  |  127|  11.8M|#define ISA_DIGIT(p) ((*(p) >= '0') && (*(p) <= '9'))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (127:23): [True: 1.89M, False: 9.97M]
  |  |  |  |  |  Branch (127:40): [True: 909k, False: 990k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (161:44): [True: 47.5k, False: 10.9M]
  |  |  ------------------
  |  |  162|  59.2M|       ((*(p) == '.')) || ((*(p) == '_')) || ((*(p) == '~')))
  |  |  ------------------
  |  |  |  Branch (162:8): [True: 162k, False: 10.7M]
  |  |  |  Branch (162:27): [True: 2.41k, False: 10.7M]
  |  |  |  Branch (162:46): [True: 20.8k, False: 10.7M]
  |  |  ------------------
  ------------------
  201|  48.5M|        return(1);
  202|       |
  203|  10.7M|    if (uri->cleanup & XML_URI_ALLOW_UNWISE) {
  ------------------
  |  |  191|  10.7M|#define XML_URI_ALLOW_UNWISE    1
  ------------------
  |  Branch (203:9): [True: 0, False: 10.7M]
  ------------------
  204|      0|        if (IS_UNWISE(cur))
  ------------------
  |  |   87|      0|      (((*(p) == '{')) || ((*(p) == '}')) || ((*(p) == '|')) ||         \
  |  |  ------------------
  |  |  |  Branch (87:8): [True: 0, False: 0]
  |  |  |  Branch (87:27): [True: 0, False: 0]
  |  |  |  Branch (87:46): [True: 0, False: 0]
  |  |  ------------------
  |  |   88|      0|       ((*(p) == '\\')) || ((*(p) == '^')) || ((*(p) == '[')) ||        \
  |  |  ------------------
  |  |  |  Branch (88:8): [True: 0, False: 0]
  |  |  |  Branch (88:28): [True: 0, False: 0]
  |  |  |  Branch (88:47): [True: 0, False: 0]
  |  |  ------------------
  |  |   89|      0|       ((*(p) == ']')) || ((*(p) == '`')))
  |  |  ------------------
  |  |  |  Branch (89:8): [True: 0, False: 0]
  |  |  |  Branch (89:27): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  205|      0|            return(1);
  206|  10.7M|    } else if (uri->cleanup & XML_URI_ALLOW_UCSCHAR) {
  ------------------
  |  |  193|  10.7M|#define XML_URI_ALLOW_UCSCHAR   4
  ------------------
  |  Branch (206:16): [True: 0, False: 10.7M]
  ------------------
  207|      0|        if (ISA_UCSCHAR(cur))
  ------------------
  |  |  185|      0|    ((*(p) <= 0x20) || (*(p) >= 0x7F) || (*(p) == '<') || (*(p) == '>') || \
  |  |  ------------------
  |  |  |  Branch (185:6): [True: 0, False: 0]
  |  |  |  Branch (185:24): [True: 0, False: 0]
  |  |  |  Branch (185:42): [True: 0, False: 0]
  |  |  |  Branch (185:59): [True: 0, False: 0]
  |  |  ------------------
  |  |  186|      0|     (*(p) == '"')  || (*(p) == '{')  || (*(p) == '}') || (*(p) == '|') || \
  |  |  ------------------
  |  |  |  Branch (186:6): [True: 0, False: 0]
  |  |  |  Branch (186:24): [True: 0, False: 0]
  |  |  |  Branch (186:42): [True: 0, False: 0]
  |  |  |  Branch (186:59): [True: 0, False: 0]
  |  |  ------------------
  |  |  187|      0|     (*(p) == '\\') || (*(p) == '^')  || (*(p) == '`'))
  |  |  ------------------
  |  |  |  Branch (187:6): [True: 0, False: 0]
  |  |  |  Branch (187:24): [True: 0, False: 0]
  |  |  |  Branch (187:42): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  208|      0|            return(1);
  209|      0|    }
  210|       |
  211|  10.7M|    return(0);
  212|  10.7M|}
uri.c:xmlParse3986PathRootless:
  695|  7.07k|{
  696|  7.07k|    const char *cur;
  697|  7.07k|    int ret;
  698|       |
  699|  7.07k|    cur = *str;
  700|       |
  701|  7.07k|    ret = xmlParse3986Segment(uri, &cur, 0, 0);
  702|  7.07k|    if (ret != 0) return(ret);
  ------------------
  |  Branch (702:9): [True: 0, False: 7.07k]
  ------------------
  703|  10.8k|    while (*cur == '/') {
  ------------------
  |  Branch (703:12): [True: 3.79k, False: 7.07k]
  ------------------
  704|  3.79k|        cur++;
  705|  3.79k|	ret = xmlParse3986Segment(uri, &cur, 0, 1);
  706|  3.79k|	if (ret != 0) return(ret);
  ------------------
  |  Branch (706:6): [True: 0, False: 3.79k]
  ------------------
  707|  3.79k|    }
  708|  7.07k|    if (uri != NULL) {
  ------------------
  |  Branch (708:9): [True: 7.07k, False: 0]
  ------------------
  709|  7.07k|	if (uri->path != NULL) xmlFree(uri->path);
  ------------------
  |  Branch (709:6): [True: 0, False: 7.07k]
  ------------------
  710|  7.07k|        if (cur != *str) {
  ------------------
  |  Branch (710:13): [True: 7.07k, False: 0]
  ------------------
  711|  7.07k|            if (uri->cleanup & XML_URI_NO_UNESCAPE)
  ------------------
  |  |  192|  7.07k|#define XML_URI_NO_UNESCAPE     2
  ------------------
  |  Branch (711:17): [True: 0, False: 7.07k]
  ------------------
  712|      0|                uri->path = STRNDUP(*str, cur - *str);
  ------------------
  |  |  119|      0|#define STRNDUP(s, n) (char *) xmlStrndup((const xmlChar *)(s), (n))
  ------------------
  713|  7.07k|            else
  714|  7.07k|                uri->path = xmlURIUnescapeString(*str, cur - *str, NULL);
  715|  7.07k|            if (uri->path == NULL)
  ------------------
  |  Branch (715:17): [True: 16, False: 7.05k]
  ------------------
  716|     16|                return (-1);
  717|  7.07k|        } else {
  718|      0|            uri->path = NULL;
  719|      0|        }
  720|  7.07k|    }
  721|  7.05k|    *str = cur;
  722|  7.05k|    return (0);
  723|  7.07k|}
uri.c:xmlParse3986Query:
  300|  14.1k|{
  301|  14.1k|    const char *cur;
  302|       |
  303|  14.1k|    cur = *str;
  304|       |
  305|  31.7M|    while ((ISA_PCHAR(uri, cur)) || (*cur == '/') || (*cur == '?'))
  ------------------
  |  |  174|  31.7M|     (ISA_UNRESERVED(u, p) || ISA_PCT_ENCODED(p) || ISA_SUB_DELIM(p) ||	\
  |  |  ------------------
  |  |  |  |  189|  63.5M|#define ISA_UNRESERVED(u, p) (xmlIsUnreserved(u, p))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (189:30): [True: 29.4M, False: 2.35M]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                    (ISA_UNRESERVED(u, p) || ISA_PCT_ENCODED(p) || ISA_SUB_DELIM(p) ||	\
  |  |  ------------------
  |  |  |  |  168|  34.1M|     ((*(p) == '%') && (ISA_HEXDIG(p + 1)) && (ISA_HEXDIG(p + 2)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  131|  12.7k|       (ISA_DIGIT(p) || ((*(p) >= 'a') && (*(p) <= 'f')) ||		\
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  127|  25.5k|#define ISA_DIGIT(p) ((*(p) >= '0') && (*(p) <= '9'))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (127:23): [True: 12.5k, False: 238]
  |  |  |  |  |  |  |  |  |  Branch (127:40): [True: 9.35k, False: 3.17k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (131:26): [True: 1.82k, False: 1.58k]
  |  |  |  |  |  |  |  Branch (131:43): [True: 1.60k, False: 223]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  132|  12.7k|        ((*(p) >= 'A') && (*(p) <= 'F')))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (132:10): [True: 1.39k, False: 417]
  |  |  |  |  |  |  |  Branch (132:27): [True: 1.16k, False: 223]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |                    ((*(p) == '%') && (ISA_HEXDIG(p + 1)) && (ISA_HEXDIG(p + 2)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  131|  12.1k|       (ISA_DIGIT(p) || ((*(p) >= 'a') && (*(p) <= 'f')) ||		\
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  127|  24.2k|#define ISA_DIGIT(p) ((*(p) >= '0') && (*(p) <= '9'))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (127:23): [True: 11.8k, False: 305]
  |  |  |  |  |  |  |  |  |  Branch (127:40): [True: 2.21k, False: 9.60k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (131:26): [True: 1.32k, False: 8.58k]
  |  |  |  |  |  |  |  Branch (131:43): [True: 1.06k, False: 262]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  132|  12.1k|        ((*(p) >= 'A') && (*(p) <= 'F')))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (132:10): [True: 8.50k, False: 339]
  |  |  |  |  |  |  |  Branch (132:27): [True: 8.04k, False: 459]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (168:7): [True: 12.7k, False: 2.34M]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                    (ISA_UNRESERVED(u, p) || ISA_PCT_ENCODED(p) || ISA_SUB_DELIM(p) ||	\
  |  |  ------------------
  |  |  |  |  139|  34.1M|      (((*(p) == '!')) || ((*(p) == '$')) || ((*(p) == '&')) ||		\
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (139:8): [True: 10.4k, False: 2.33M]
  |  |  |  |  |  Branch (139:27): [True: 749, False: 2.33M]
  |  |  |  |  |  Branch (139:46): [True: 267, False: 2.33M]
  |  |  |  |  ------------------
  |  |  |  |  140|  2.34M|       ((*(p) == '(')) || ((*(p) == ')')) || ((*(p) == '*')) ||		\
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (140:8): [True: 4.50k, False: 2.32M]
  |  |  |  |  |  Branch (140:27): [True: 5.17k, False: 2.32M]
  |  |  |  |  |  Branch (140:46): [True: 2.00M, False: 316k]
  |  |  |  |  ------------------
  |  |  |  |  141|  2.34M|       ((*(p) == '+')) || ((*(p) == ',')) || ((*(p) == ';')) ||		\
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (141:8): [True: 766, False: 315k]
  |  |  |  |  |  Branch (141:27): [True: 606, False: 314k]
  |  |  |  |  |  Branch (141:46): [True: 1.02k, False: 313k]
  |  |  |  |  ------------------
  |  |  |  |  142|  2.34M|       ((*(p) == '=')) || ((*(p) == '\'')))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (142:8): [True: 1.00k, False: 312k]
  |  |  |  |  |  Branch (142:27): [True: 4.96k, False: 307k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  175|  31.7M|      ((*(p) == ':')) || ((*(p) == '@')))
  |  |  ------------------
  |  |  |  Branch (175:7): [True: 9.55k, False: 298k]
  |  |  |  Branch (175:26): [True: 22.8k, False: 275k]
  |  |  ------------------
  ------------------
  |  Branch (305:37): [True: 125k, False: 149k]
  |  Branch (305:54): [True: 135k, False: 14.1k]
  ------------------
  306|  31.7M|        NEXT(cur);
  ------------------
  |  |  108|  31.7M|#define NEXT(p) ((*p == '%')? p += 3 : p++)
  |  |  ------------------
  |  |  |  Branch (108:18): [True: 11.3k, False: 31.7M]
  |  |  ------------------
  ------------------
  307|  14.1k|    if (uri != NULL) {
  ------------------
  |  Branch (307:9): [True: 14.1k, False: 0]
  ------------------
  308|  14.1k|        if (uri->query != NULL)
  ------------------
  |  Branch (308:13): [True: 0, False: 14.1k]
  ------------------
  309|      0|            xmlFree(uri->query);
  310|  14.1k|	if (uri->cleanup & XML_URI_NO_UNESCAPE)
  ------------------
  |  |  192|  14.1k|#define XML_URI_NO_UNESCAPE     2
  ------------------
  |  Branch (310:6): [True: 0, False: 14.1k]
  ------------------
  311|      0|	    uri->query = STRNDUP(*str, cur - *str);
  ------------------
  |  |  119|      0|#define STRNDUP(s, n) (char *) xmlStrndup((const xmlChar *)(s), (n))
  ------------------
  312|  14.1k|	else
  313|  14.1k|	    uri->query = xmlURIUnescapeString(*str, cur - *str, NULL);
  314|  14.1k|        if (uri->query == NULL)
  ------------------
  |  Branch (314:13): [True: 16, False: 14.1k]
  ------------------
  315|     16|            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|  14.1k|	if (uri->query_raw != NULL)
  ------------------
  |  Branch (320:6): [True: 0, False: 14.1k]
  ------------------
  321|      0|	    xmlFree (uri->query_raw);
  322|  14.1k|	uri->query_raw = STRNDUP (*str, cur - *str);
  ------------------
  |  |  119|  14.1k|#define STRNDUP(s, n) (char *) xmlStrndup((const xmlChar *)(s), (n))
  ------------------
  323|  14.1k|        if (uri->query_raw == NULL)
  ------------------
  |  Branch (323:13): [True: 40, False: 14.0k]
  ------------------
  324|     40|            return (-1);
  325|  14.1k|    }
  326|  14.0k|    *str = cur;
  327|  14.0k|    return (0);
  328|  14.1k|}
uri.c:xmlParse3986Fragment:
  267|   719k|{
  268|   719k|    const char *cur;
  269|       |
  270|   719k|    cur = *str;
  271|       |
  272|  8.65M|    while ((ISA_PCHAR(uri, cur)) || (*cur == '/') || (*cur == '?') ||
  ------------------
  |  |  174|  8.65M|     (ISA_UNRESERVED(u, p) || ISA_PCT_ENCODED(p) || ISA_SUB_DELIM(p) ||	\
  |  |  ------------------
  |  |  |  |  189|  17.3M|#define ISA_UNRESERVED(u, p) (xmlIsUnreserved(u, p))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (189:30): [True: 5.05M, False: 3.60M]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                    (ISA_UNRESERVED(u, p) || ISA_PCT_ENCODED(p) || ISA_SUB_DELIM(p) ||	\
  |  |  ------------------
  |  |  |  |  168|  12.2M|     ((*(p) == '%') && (ISA_HEXDIG(p + 1)) && (ISA_HEXDIG(p + 2)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  131|  5.19k|       (ISA_DIGIT(p) || ((*(p) >= 'a') && (*(p) <= 'f')) ||		\
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  127|  10.3k|#define ISA_DIGIT(p) ((*(p) >= '0') && (*(p) <= '9'))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (127:23): [True: 4.97k, False: 228]
  |  |  |  |  |  |  |  |  |  Branch (127:40): [True: 1.19k, False: 3.77k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (131:26): [True: 2.00k, False: 2.00k]
  |  |  |  |  |  |  |  Branch (131:43): [True: 1.79k, False: 215]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  132|  5.19k|        ((*(p) >= 'A') && (*(p) <= 'F')))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (132:10): [True: 1.94k, False: 274]
  |  |  |  |  |  |  |  Branch (132:27): [True: 1.71k, False: 226]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |                    ((*(p) == '%') && (ISA_HEXDIG(p + 1)) && (ISA_HEXDIG(p + 2)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  131|  4.69k|       (ISA_DIGIT(p) || ((*(p) >= 'a') && (*(p) <= 'f')) ||		\
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  127|  9.39k|#define ISA_DIGIT(p) ((*(p) >= '0') && (*(p) <= '9'))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (127:23): [True: 4.45k, False: 240]
  |  |  |  |  |  |  |  |  |  Branch (127:40): [True: 518, False: 3.94k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (131:26): [True: 1.69k, False: 2.48k]
  |  |  |  |  |  |  |  Branch (131:43): [True: 1.38k, False: 302]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  132|  4.69k|        ((*(p) >= 'A') && (*(p) <= 'F')))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (132:10): [True: 2.53k, False: 252]
  |  |  |  |  |  |  |  Branch (132:27): [True: 2.07k, False: 467]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (168:7): [True: 5.19k, False: 3.59M]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                    (ISA_UNRESERVED(u, p) || ISA_PCT_ENCODED(p) || ISA_SUB_DELIM(p) ||	\
  |  |  ------------------
  |  |  |  |  139|  12.2M|      (((*(p) == '!')) || ((*(p) == '$')) || ((*(p) == '&')) ||		\
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (139:8): [True: 722k, False: 2.87M]
  |  |  |  |  |  Branch (139:27): [True: 988, False: 2.87M]
  |  |  |  |  |  Branch (139:46): [True: 490, False: 2.87M]
  |  |  |  |  ------------------
  |  |  |  |  140|  3.59M|       ((*(p) == '(')) || ((*(p) == ')')) || ((*(p) == '*')) ||		\
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (140:8): [True: 8.92k, False: 2.86M]
  |  |  |  |  |  Branch (140:27): [True: 7.93k, False: 2.85M]
  |  |  |  |  |  Branch (140:46): [True: 6.57k, False: 2.85M]
  |  |  |  |  ------------------
  |  |  |  |  141|  3.59M|       ((*(p) == '+')) || ((*(p) == ',')) || ((*(p) == ';')) ||		\
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (141:8): [True: 1.01k, False: 2.84M]
  |  |  |  |  |  Branch (141:27): [True: 699k, False: 2.15M]
  |  |  |  |  |  Branch (141:46): [True: 6.60k, False: 2.14M]
  |  |  |  |  ------------------
  |  |  |  |  142|  3.59M|       ((*(p) == '=')) || ((*(p) == '\'')))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (142:8): [True: 1.98k, False: 2.14M]
  |  |  |  |  |  Branch (142:27): [True: 1.23k, False: 2.14M]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  175|  8.65M|      ((*(p) == ':')) || ((*(p) == '@')))
  |  |  ------------------
  |  |  |  Branch (175:7): [True: 698k, False: 1.44M]
  |  |  |  Branch (175:26): [True: 2.84k, False: 1.43M]
  |  |  ------------------
  ------------------
  |  Branch (272:37): [True: 710k, False: 727k]
  |  Branch (272:54): [True: 4.07k, False: 723k]
  ------------------
  273|   723k|           (*cur == '[') || (*cur == ']'))
  ------------------
  |  Branch (273:12): [True: 2.11k, False: 721k]
  |  Branch (273:29): [True: 1.93k, False: 719k]
  ------------------
  274|  7.93M|        NEXT(cur);
  ------------------
  |  |  108|  7.93M|#define NEXT(p) ((*p == '%')? p += 3 : p++)
  |  |  ------------------
  |  |  |  Branch (108:18): [True: 3.97k, False: 7.93M]
  |  |  ------------------
  ------------------
  275|   719k|    if (uri != NULL) {
  ------------------
  |  Branch (275:9): [True: 719k, False: 0]
  ------------------
  276|   719k|        if (uri->fragment != NULL)
  ------------------
  |  Branch (276:13): [True: 0, False: 719k]
  ------------------
  277|      0|            xmlFree(uri->fragment);
  278|   719k|	if (uri->cleanup & XML_URI_NO_UNESCAPE)
  ------------------
  |  |  192|   719k|#define XML_URI_NO_UNESCAPE     2
  ------------------
  |  Branch (278:6): [True: 0, False: 719k]
  ------------------
  279|      0|	    uri->fragment = STRNDUP(*str, cur - *str);
  ------------------
  |  |  119|      0|#define STRNDUP(s, n) (char *) xmlStrndup((const xmlChar *)(s), (n))
  ------------------
  280|   719k|	else
  281|   719k|	    uri->fragment = xmlURIUnescapeString(*str, cur - *str, NULL);
  282|   719k|        if (uri->fragment == NULL)
  ------------------
  |  Branch (282:13): [True: 38, False: 719k]
  ------------------
  283|     38|            return (-1);
  284|   719k|    }
  285|   719k|    *str = cur;
  286|   719k|    return (0);
  287|   719k|}
uri.c:xmlParse3986RelativeRef:
  833|   875k|xmlParse3986RelativeRef(xmlURIPtr uri, const char *str) {
  834|   875k|    int ret;
  835|       |
  836|   875k|    if ((*str == '/') && (*(str + 1) == '/')) {
  ------------------
  |  Branch (836:9): [True: 11.0k, False: 864k]
  |  Branch (836:26): [True: 3.49k, False: 7.55k]
  ------------------
  837|  3.49k|        str += 2;
  838|  3.49k|	ret = xmlParse3986Authority(uri, &str);
  839|  3.49k|	if (ret != 0) return(ret);
  ------------------
  |  Branch (839:6): [True: 377, False: 3.12k]
  ------------------
  840|  3.12k|	ret = xmlParse3986PathAbEmpty(uri, &str);
  841|  3.12k|	if (ret != 0) return(ret);
  ------------------
  |  Branch (841:6): [True: 2, False: 3.11k]
  ------------------
  842|   871k|    } else if (*str == '/') {
  ------------------
  |  Branch (842:16): [True: 7.55k, False: 864k]
  ------------------
  843|  7.55k|	ret = xmlParse3986PathAbsolute(uri, &str);
  844|  7.55k|	if (ret != 0) return(ret);
  ------------------
  |  Branch (844:6): [True: 14, False: 7.54k]
  ------------------
  845|   864k|    } else if (ISA_PCHAR(uri, str)) {
  ------------------
  |  |  174|   864k|     (ISA_UNRESERVED(u, p) || ISA_PCT_ENCODED(p) || ISA_SUB_DELIM(p) ||	\
  |  |  ------------------
  |  |  |  |  189|  1.72M|#define ISA_UNRESERVED(u, p) (xmlIsUnreserved(u, p))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (189:30): [True: 127k, False: 736k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                    (ISA_UNRESERVED(u, p) || ISA_PCT_ENCODED(p) || ISA_SUB_DELIM(p) ||	\
  |  |  ------------------
  |  |  |  |  168|  1.60M|     ((*(p) == '%') && (ISA_HEXDIG(p + 1)) && (ISA_HEXDIG(p + 2)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  131|  3.59k|       (ISA_DIGIT(p) || ((*(p) >= 'a') && (*(p) <= 'f')) ||		\
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  127|  7.19k|#define ISA_DIGIT(p) ((*(p) >= '0') && (*(p) <= '9'))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (127:23): [True: 3.32k, False: 267]
  |  |  |  |  |  |  |  |  |  Branch (127:40): [True: 938, False: 2.39k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (131:26): [True: 1.16k, False: 1.49k]
  |  |  |  |  |  |  |  Branch (131:43): [True: 947, False: 214]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  132|  3.59k|        ((*(p) >= 'A') && (*(p) <= 'F')))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (132:10): [True: 1.39k, False: 314]
  |  |  |  |  |  |  |  Branch (132:27): [True: 1.04k, False: 347]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |                    ((*(p) == '%') && (ISA_HEXDIG(p + 1)) && (ISA_HEXDIG(p + 2)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  131|  2.93k|       (ISA_DIGIT(p) || ((*(p) >= 'a') && (*(p) <= 'f')) ||		\
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  127|  5.86k|#define ISA_DIGIT(p) ((*(p) >= '0') && (*(p) <= '9'))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (127:23): [True: 2.66k, False: 273]
  |  |  |  |  |  |  |  |  |  Branch (127:40): [True: 743, False: 1.91k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (131:26): [True: 708, False: 1.48k]
  |  |  |  |  |  |  |  Branch (131:43): [True: 510, False: 198]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  132|  2.93k|        ((*(p) >= 'A') && (*(p) <= 'F')))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (132:10): [True: 1.20k, False: 472]
  |  |  |  |  |  |  |  Branch (132:27): [True: 875, False: 334]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (168:7): [True: 3.59k, False: 732k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                    (ISA_UNRESERVED(u, p) || ISA_PCT_ENCODED(p) || ISA_SUB_DELIM(p) ||	\
  |  |  ------------------
  |  |  |  |  139|  1.59M|      (((*(p) == '!')) || ((*(p) == '$')) || ((*(p) == '&')) ||		\
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (139:8): [True: 2.55k, False: 731k]
  |  |  |  |  |  Branch (139:27): [True: 1.68k, False: 730k]
  |  |  |  |  |  Branch (139:46): [True: 498, False: 729k]
  |  |  |  |  ------------------
  |  |  |  |  140|   734k|       ((*(p) == '(')) || ((*(p) == ')')) || ((*(p) == '*')) ||		\
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (140:8): [True: 653, False: 728k]
  |  |  |  |  |  Branch (140:27): [True: 486, False: 728k]
  |  |  |  |  |  Branch (140:46): [True: 4.46k, False: 724k]
  |  |  |  |  ------------------
  |  |  |  |  141|   734k|       ((*(p) == '+')) || ((*(p) == ',')) || ((*(p) == ';')) ||		\
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (141:8): [True: 1.49k, False: 722k]
  |  |  |  |  |  Branch (141:27): [True: 653, False: 721k]
  |  |  |  |  |  Branch (141:46): [True: 1.33k, False: 720k]
  |  |  |  |  ------------------
  |  |  |  |  142|   734k|       ((*(p) == '=')) || ((*(p) == '\'')))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (142:8): [True: 700, False: 719k]
  |  |  |  |  |  Branch (142:27): [True: 751, False: 719k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  175|   864k|      ((*(p) == ':')) || ((*(p) == '@')))
  |  |  ------------------
  |  |  |  Branch (175:7): [True: 1.33k, False: 717k]
  |  |  |  Branch (175:26): [True: 804, False: 716k]
  |  |  ------------------
  ------------------
  846|   147k|        ret = xmlParse3986PathNoScheme(uri, &str);
  847|   147k|	if (ret != 0) return(ret);
  ------------------
  |  Branch (847:6): [True: 1.47k, False: 145k]
  ------------------
  848|   716k|    } else {
  849|       |	/* path-empty is effectively empty */
  850|   716k|	if (uri != NULL) {
  ------------------
  |  Branch (850:6): [True: 716k, False: 0]
  ------------------
  851|   716k|	    if (uri->path != NULL) xmlFree(uri->path);
  ------------------
  |  Branch (851:10): [True: 0, False: 716k]
  ------------------
  852|   716k|	    uri->path = NULL;
  853|   716k|	}
  854|   716k|    }
  855|       |
  856|   873k|    if (*str == '?') {
  ------------------
  |  Branch (856:9): [True: 11.2k, False: 862k]
  ------------------
  857|  11.2k|	str++;
  858|  11.2k|	ret = xmlParse3986Query(uri, &str);
  859|  11.2k|	if (ret != 0) return(ret);
  ------------------
  |  Branch (859:6): [True: 41, False: 11.1k]
  ------------------
  860|  11.2k|    }
  861|   873k|    if (*str == '#') {
  ------------------
  |  Branch (861:9): [True: 717k, False: 155k]
  ------------------
  862|   717k|	str++;
  863|   717k|	ret = xmlParse3986Fragment(uri, &str);
  864|   717k|	if (ret != 0) return(ret);
  ------------------
  |  Branch (864:6): [True: 34, False: 717k]
  ------------------
  865|   717k|    }
  866|   873k|    if (*str != 0) {
  ------------------
  |  Branch (866:9): [True: 24.3k, False: 848k]
  ------------------
  867|  24.3k|	xmlCleanURI(uri);
  868|  24.3k|	return(1);
  869|  24.3k|    }
  870|   848k|    return(0);
  871|   873k|}
uri.c:xmlParse3986PathNoScheme:
  737|   147k|{
  738|   147k|    const char *cur;
  739|   147k|    int ret;
  740|       |
  741|   147k|    cur = *str;
  742|       |
  743|   147k|    ret = xmlParse3986Segment(uri, &cur, ':', 0);
  744|   147k|    if (ret != 0) return(ret);
  ------------------
  |  Branch (744:9): [True: 1.33k, False: 145k]
  ------------------
  745|   225k|    while (*cur == '/') {
  ------------------
  |  Branch (745:12): [True: 79.6k, False: 145k]
  ------------------
  746|  79.6k|        cur++;
  747|  79.6k|	ret = xmlParse3986Segment(uri, &cur, 0, 1);
  748|  79.6k|	if (ret != 0) return(ret);
  ------------------
  |  Branch (748:6): [True: 0, False: 79.6k]
  ------------------
  749|  79.6k|    }
  750|   145k|    if (uri != NULL) {
  ------------------
  |  Branch (750:9): [True: 145k, False: 0]
  ------------------
  751|   145k|	if (uri->path != NULL) xmlFree(uri->path);
  ------------------
  |  Branch (751:6): [True: 0, False: 145k]
  ------------------
  752|   145k|        if (cur != *str) {
  ------------------
  |  Branch (752:13): [True: 145k, False: 0]
  ------------------
  753|   145k|            if (uri->cleanup & XML_URI_NO_UNESCAPE)
  ------------------
  |  |  192|   145k|#define XML_URI_NO_UNESCAPE     2
  ------------------
  |  Branch (753:17): [True: 0, False: 145k]
  ------------------
  754|      0|                uri->path = STRNDUP(*str, cur - *str);
  ------------------
  |  |  119|      0|#define STRNDUP(s, n) (char *) xmlStrndup((const xmlChar *)(s), (n))
  ------------------
  755|   145k|            else
  756|   145k|                uri->path = xmlURIUnescapeString(*str, cur - *str, NULL);
  757|   145k|            if (uri->path == NULL)
  ------------------
  |  Branch (757:17): [True: 140, False: 145k]
  ------------------
  758|    140|                return (-1);
  759|   145k|        } else {
  760|      0|            uri->path = NULL;
  761|      0|        }
  762|   145k|    }
  763|   145k|    *str = cur;
  764|   145k|    return (0);
  765|   145k|}
uri.c:xmlSaveUriRealloc:
 1074|  20.1k|xmlSaveUriRealloc(xmlChar *ret, int *max) {
 1075|  20.1k|    xmlChar *temp;
 1076|  20.1k|    int newSize;
 1077|       |
 1078|  20.1k|    newSize = xmlGrowCapacity(*max, 1, 80, MAX_URI_LENGTH);
  ------------------
  |  |   34|  20.1k|#define MAX_URI_LENGTH 1024 * 1024
  ------------------
 1079|  20.1k|    if (newSize < 0)
  ------------------
  |  Branch (1079:9): [True: 27, False: 20.1k]
  ------------------
 1080|     27|        return(NULL);
 1081|  20.1k|    temp = xmlRealloc(ret, newSize + 1);
 1082|  20.1k|    if (temp == NULL)
  ------------------
  |  Branch (1082:9): [True: 34, False: 20.1k]
  ------------------
 1083|     34|        return(NULL);
 1084|  20.1k|    *max = newSize;
 1085|  20.1k|    return(temp);
 1086|  20.1k|}
uri.c:xmlNormalizePath:
 1456|   129k|xmlNormalizePath(char *path, int isFile) {
 1457|   129k|    char *cur, *out;
 1458|   129k|    int numSeg = 0;
 1459|       |
 1460|   129k|    if (path == NULL)
  ------------------
  |  Branch (1460:9): [True: 1.70k, False: 128k]
  ------------------
 1461|  1.70k|	return(-1);
 1462|       |
 1463|   128k|    cur = path;
 1464|   128k|    out = path;
 1465|       |
 1466|   128k|    if (*cur == 0)
  ------------------
  |  Branch (1466:9): [True: 195, False: 128k]
  ------------------
 1467|    195|        return(0);
 1468|       |
 1469|   128k|    if (xmlIsPathSeparator(*cur, isFile)) {
  ------------------
  |  Branch (1469:9): [True: 7.44k, False: 120k]
  ------------------
 1470|  7.44k|        cur++;
 1471|  7.44k|        *out++ = '/';
 1472|  7.44k|    }
 1473|       |
 1474|   467k|    while (*cur != 0) {
  ------------------
  |  Branch (1474:12): [True: 341k, False: 126k]
  ------------------
 1475|       |        /*
 1476|       |         * At this point, out is either empty or ends with a separator.
 1477|       |         * Collapse multiple separators first.
 1478|       |         */
 1479|   364k|        while (xmlIsPathSeparator(*cur, isFile)) {
  ------------------
  |  Branch (1479:16): [True: 23.0k, False: 341k]
  ------------------
 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|  23.0k|            cur++;
 1486|  23.0k|        }
 1487|       |
 1488|   341k|        if (*cur == '.') {
  ------------------
  |  Branch (1488:13): [True: 155k, False: 186k]
  ------------------
 1489|   155k|            if (cur[1] == 0) {
  ------------------
  |  Branch (1489:17): [True: 928, False: 154k]
  ------------------
 1490|       |                /* Ignore "." at end of path */
 1491|    928|                break;
 1492|   154k|            } else if (xmlIsPathSeparator(cur[1], isFile)) {
  ------------------
  |  Branch (1492:24): [True: 106k, False: 47.4k]
  ------------------
 1493|       |                /* Skip "./" */
 1494|   106k|                cur += 2;
 1495|   106k|                continue;
 1496|   106k|            } else if ((cur[1] == '.') &&
  ------------------
  |  Branch (1496:24): [True: 45.8k, False: 1.58k]
  ------------------
 1497|  45.8k|                       ((cur[2] == 0) || xmlIsPathSeparator(cur[2], isFile))) {
  ------------------
  |  Branch (1497:25): [True: 658, False: 45.2k]
  |  Branch (1497:42): [True: 44.7k, False: 437]
  ------------------
 1498|  45.4k|                if (numSeg > 0) {
  ------------------
  |  Branch (1498:21): [True: 5.30k, False: 40.1k]
  ------------------
 1499|       |                    /* Handle ".." by removing last segment */
 1500|  26.0k|                    do {
 1501|  26.0k|                        out--;
 1502|  26.0k|                    } while ((out > path) &&
  ------------------
  |  Branch (1502:30): [True: 25.4k, False: 576]
  ------------------
 1503|  25.4k|                             !xmlIsPathSeparator(out[-1], isFile));
  ------------------
  |  Branch (1503:30): [True: 20.7k, False: 4.72k]
  ------------------
 1504|  5.30k|                    numSeg--;
 1505|       |
 1506|  5.30k|                    if (cur[2] == 0)
  ------------------
  |  Branch (1506:25): [True: 257, False: 5.04k]
  ------------------
 1507|    257|                        break;
 1508|  5.04k|                    cur += 3;
 1509|  5.04k|                    continue;
 1510|  40.1k|                } else if (out[0] == '/') {
  ------------------
  |  Branch (1510:28): [True: 428, False: 39.7k]
  ------------------
 1511|       |                    /* Ignore extraneous ".." in absolute paths */
 1512|    428|                    if (cur[2] == 0)
  ------------------
  |  Branch (1512:25): [True: 196, False: 232]
  ------------------
 1513|    196|                        break;
 1514|    232|                    cur += 3;
 1515|    232|                    continue;
 1516|  39.7k|                } else {
 1517|       |                    /* Keep "../" at start of relative path */
 1518|  39.7k|                    numSeg--;
 1519|  39.7k|                }
 1520|  45.4k|            }
 1521|   155k|        }
 1522|       |
 1523|       |        /* Copy segment */
 1524|  2.25M|        while ((*cur != 0) && !xmlIsPathSeparator(*cur, isFile)) {
  ------------------
  |  Branch (1524:16): [True: 2.12M, False: 125k]
  |  Branch (1524:31): [True: 2.02M, False: 102k]
  ------------------
 1525|  2.02M|            *out++ = *cur++;
 1526|  2.02M|        }
 1527|       |
 1528|       |        /* Copy separator */
 1529|   227k|        if (*cur != 0) {
  ------------------
  |  Branch (1529:13): [True: 102k, False: 125k]
  ------------------
 1530|   102k|            cur++;
 1531|   102k|            *out++ = '/';
 1532|   102k|        }
 1533|       |
 1534|   227k|        numSeg++;
 1535|   227k|    }
 1536|       |
 1537|       |    /* Keep "." if output is empty and it's a file */
 1538|   128k|    if ((isFile) && (out <= path))
  ------------------
  |  Branch (1538:9): [True: 119k, False: 8.85k]
  |  Branch (1538:21): [True: 758, False: 118k]
  ------------------
 1539|    758|        *out++ = '.';
 1540|   128k|    *out = 0;
 1541|       |
 1542|   128k|    return(0);
 1543|   128k|}
uri.c:xmlIsPathSeparator:
 1434|  3.88M|xmlIsPathSeparator(int c, int isFile) {
 1435|  3.88M|    (void) isFile;
 1436|       |
 1437|  3.88M|    if (c == '/')
  ------------------
  |  Branch (1437:9): [True: 303k, False: 3.57M]
  ------------------
 1438|   303k|        return(1);
 1439|       |
 1440|       |#if defined(LIBXML_WINPATH_ENABLED)
 1441|       |    if (isFile && (c == '\\'))
 1442|       |        return(1);
 1443|       |#endif
 1444|       |
 1445|  3.57M|    return(0);
 1446|  3.88M|}
uri.c:is_hex:
 1559|  4.04M|static int is_hex(char c) {
 1560|  4.04M|    if (((c >= '0') && (c <= '9')) ||
  ------------------
  |  Branch (1560:10): [True: 4.03M, False: 985]
  |  Branch (1560:24): [True: 3.98M, False: 49.6k]
  ------------------
 1561|  50.6k|        ((c >= 'a') && (c <= 'f')) ||
  ------------------
  |  Branch (1561:10): [True: 17.0k, False: 33.6k]
  |  Branch (1561:24): [True: 16.1k, False: 890]
  ------------------
 1562|  34.5k|        ((c >= 'A') && (c <= 'F')))
  ------------------
  |  Branch (1562:10): [True: 32.6k, False: 1.82k]
  |  Branch (1562:24): [True: 31.5k, False: 1.11k]
  ------------------
 1563|  4.03M|	return(1);
 1564|  2.93k|    return(0);
 1565|  4.04M|}
uri.c:xmlResolvePath:
 1863|   722k|xmlResolvePath(const xmlChar *escRef, const xmlChar *base, xmlChar **out) {
 1864|   722k|    const xmlChar *fragment;
 1865|   722k|    xmlChar *tmp = NULL;
 1866|   722k|    xmlChar *ref = NULL;
 1867|   722k|    xmlChar *result = NULL;
 1868|   722k|    int ret = -1;
 1869|   722k|    int i;
 1870|       |
 1871|   722k|    if (out == NULL)
  ------------------
  |  Branch (1871:9): [True: 0, False: 722k]
  ------------------
 1872|      0|        return(1);
 1873|   722k|    *out = NULL;
 1874|       |
 1875|   722k|    if ((escRef == NULL) || (escRef[0] == 0)) {
  ------------------
  |  Branch (1875:9): [True: 0, False: 722k]
  |  Branch (1875:29): [True: 745, False: 721k]
  ------------------
 1876|    745|        if ((base == NULL) || (base[0] == 0))
  ------------------
  |  Branch (1876:13): [True: 0, False: 745]
  |  Branch (1876:31): [True: 363, False: 382]
  ------------------
 1877|    363|            return(1);
 1878|    382|        ref = xmlStrdup(base);
 1879|    382|        if (ref == NULL)
  ------------------
  |  Branch (1879:13): [True: 3, False: 379]
  ------------------
 1880|      3|            goto err_memory;
 1881|    379|        *out = ref;
 1882|    379|        return(0);
 1883|    382|    }
 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|   721k|    fragment = xmlStrchr(escRef, '#');
 1891|   721k|    if (fragment != NULL) {
  ------------------
  |  Branch (1891:9): [True: 705k, False: 16.1k]
  ------------------
 1892|   705k|        tmp = xmlStrndup(escRef, fragment - escRef);
 1893|   705k|        if (tmp == NULL)
  ------------------
  |  Branch (1893:13): [True: 12, False: 705k]
  ------------------
 1894|     12|            goto err_memory;
 1895|   705k|        escRef = tmp;
 1896|   705k|    }
 1897|       |
 1898|   721k|    ref = (xmlChar *) xmlURIUnescapeString((char *) escRef, -1, NULL);
 1899|   721k|    if (ref == NULL)
  ------------------
  |  Branch (1899:9): [True: 42, False: 721k]
  ------------------
 1900|     42|        goto err_memory;
 1901|       |
 1902|   721k|    if ((base == NULL) || (base[0] == 0))
  ------------------
  |  Branch (1902:9): [True: 0, False: 721k]
  |  Branch (1902:27): [True: 706k, False: 15.4k]
  ------------------
 1903|   706k|        goto done;
 1904|       |
 1905|  15.4k|    if (xmlIsAbsolutePath(ref))
  ------------------
  |  Branch (1905:9): [True: 2.43k, False: 12.9k]
  ------------------
 1906|  2.43k|        goto done;
 1907|       |
 1908|       |    /*
 1909|       |     * Remove last segment from base
 1910|       |     */
 1911|  12.9k|    i = xmlStrlen(base);
 1912|   911k|    while ((i > 0) && !xmlIsPathSeparator(base[i-1], 1))
  ------------------
  |  Branch (1912:12): [True: 910k, False: 1.48k]
  |  Branch (1912:23): [True: 898k, False: 11.4k]
  ------------------
 1913|   898k|        i--;
 1914|       |
 1915|       |    /*
 1916|       |     * Concatenate base and ref
 1917|       |     */
 1918|  12.9k|    if (i > 0) {
  ------------------
  |  Branch (1918:9): [True: 11.4k, False: 1.48k]
  ------------------
 1919|  11.4k|        int refLen = xmlStrlen(ref);
 1920|       |
 1921|  11.4k|        result = xmlMalloc(i + refLen + 1);
 1922|  11.4k|        if (result == NULL)
  ------------------
  |  Branch (1922:13): [True: 22, False: 11.4k]
  ------------------
 1923|     22|            goto err_memory;
 1924|       |
 1925|  11.4k|        memcpy(result, base, i);
 1926|  11.4k|        memcpy(result + i, ref, refLen + 1);
 1927|  11.4k|    }
 1928|       |
 1929|       |    /*
 1930|       |     * Normalize
 1931|       |     */
 1932|  12.9k|    xmlNormalizePath((char *) result, 1);
 1933|       |
 1934|   721k|done:
 1935|   721k|    if (result == NULL) {
  ------------------
  |  Branch (1935:9): [True: 710k, False: 11.4k]
  ------------------
 1936|   710k|        result = ref;
 1937|   710k|        ref = NULL;
 1938|   710k|    }
 1939|       |
 1940|   721k|    if (fragment != NULL) {
  ------------------
  |  Branch (1940:9): [True: 705k, False: 16.1k]
  ------------------
 1941|   705k|        result = xmlStrcat(result, fragment);
 1942|   705k|        if (result == NULL)
  ------------------
  |  Branch (1942:13): [True: 13, False: 705k]
  ------------------
 1943|     13|            goto err_memory;
 1944|   705k|    }
 1945|       |
 1946|   721k|    *out = result;
 1947|   721k|    ret = 0;
 1948|       |
 1949|   721k|err_memory:
 1950|   721k|    xmlFree(tmp);
 1951|   721k|    xmlFree(ref);
 1952|   721k|    return(ret);
 1953|   721k|}
uri.c:xmlIsAbsolutePath:
 1837|   123k|xmlIsAbsolutePath(const xmlChar *path) {
 1838|   123k|    int c = path[0];
 1839|       |
 1840|   123k|    if (xmlIsPathSeparator(c, 1))
  ------------------
  |  Branch (1840:9): [True: 3.32k, False: 119k]
  ------------------
 1841|  3.32k|        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|   119k|    return(0);
 1851|   123k|}
uri.c:xmlParseUriOrPath:
 2344|   108k|xmlParseUriOrPath(const char *str, xmlURIPtr *out, int *drive) {
 2345|   108k|    xmlURIPtr uri;
 2346|   108k|    char *buf = NULL;
 2347|   108k|    int ret;
 2348|       |
 2349|   108k|    *out = NULL;
 2350|   108k|    *drive = 0;
 2351|       |
 2352|   108k|    uri = xmlCreateURI();
 2353|   108k|    if (uri == NULL) {
  ------------------
  |  Branch (2353:9): [True: 13, False: 108k]
  ------------------
 2354|     13|        ret = -1;
 2355|     13|	goto done;
 2356|     13|    }
 2357|       |
 2358|   108k|    if (xmlStrstr(BAD_CAST str, BAD_CAST "://") == NULL) {
  ------------------
  |  |   34|   108k|#define BAD_CAST (xmlChar *)
  ------------------
                  if (xmlStrstr(BAD_CAST str, BAD_CAST "://") == NULL) {
  ------------------
  |  |   34|   108k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (2358:9): [True: 107k, False: 1.03k]
  ------------------
 2359|   107k|        const char *path;
 2360|   107k|        size_t pathSize;
 2361|   107k|        int prependSlash = 0;
 2362|       |
 2363|   107k|        buf = xmlMemStrdup(str);
 2364|   107k|        if (buf == NULL) {
  ------------------
  |  Branch (2364:13): [True: 15, False: 107k]
  ------------------
 2365|     15|            ret = -1;
 2366|     15|            goto done;
 2367|     15|        }
 2368|   107k|        xmlNormalizePath(buf, /* isFile */ 1);
 2369|       |
 2370|   107k|        path = buf;
 2371|       |
 2372|   107k|        if (xmlIsAbsolutePath(BAD_CAST buf)) {
  ------------------
  |  |   34|   107k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (2372:13): [True: 893, False: 106k]
  ------------------
 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|    893|        }
 2426|       |
 2427|   107k|        pathSize = strlen(path);
 2428|   107k|        uri->path = xmlMalloc(pathSize + prependSlash + 1);
 2429|   107k|        if (uri->path == NULL) {
  ------------------
  |  Branch (2429:13): [True: 11, False: 107k]
  ------------------
 2430|     11|            ret = -1;
 2431|     11|            goto done;
 2432|     11|        }
 2433|   107k|        if (prependSlash) {
  ------------------
  |  Branch (2433:13): [True: 0, False: 107k]
  ------------------
 2434|      0|            uri->path[0] = '/';
 2435|      0|            memcpy(uri->path + 1, path, pathSize + 1);
 2436|   107k|        } else {
 2437|   107k|            memcpy(uri->path, path, pathSize + 1);
 2438|   107k|        }
 2439|   107k|    } else {
 2440|  1.03k|	ret = xmlParseURIReference(uri, str);
 2441|  1.03k|	if (ret != 0)
  ------------------
  |  Branch (2441:6): [True: 655, False: 381]
  ------------------
 2442|    655|	    goto done;
 2443|       |
 2444|    381|        xmlNormalizePath(uri->path, /* isFile */ 0);
 2445|    381|    }
 2446|       |
 2447|       |#if defined(LIBXML_WINPATH_ENABLED)
 2448|       |    if ((uri->path[0] == '/') &&
 2449|       |        (((uri->path[1] >= 'A') && (uri->path[1] <= 'Z')) ||
 2450|       |         ((uri->path[1] >= 'a') && (uri->path[1] <= 'z'))) &&
 2451|       |        (uri->path[2] == ':'))
 2452|       |        *drive = uri->path[1];
 2453|       |#endif
 2454|       |
 2455|   108k|    *out = uri;
 2456|   108k|    uri = NULL;
 2457|   108k|    ret = 0;
 2458|       |
 2459|   108k|done:
 2460|   108k|    xmlFreeURI(uri);
 2461|   108k|    xmlFree(buf);
 2462|       |
 2463|   108k|    return(ret);
 2464|   108k|}

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

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

xmlSerializeText:
  306|   767k|                 unsigned flags) {
  307|   767k|    const xmlChar *cur;
  308|   767k|    const signed char *tab;
  309|       |
  310|   767k|    if (string == NULL)
  ------------------
  |  Branch (310:9): [True: 0, False: 767k]
  ------------------
  311|      0|        return;
  312|       |
  313|   767k|#ifdef LIBXML_HTML_ENABLED
  314|   767k|    if (flags & XML_ESCAPE_HTML) {
  ------------------
  |  |   24|   767k|#define XML_ESCAPE_HTML             (1u << 2)
  ------------------
  |  Branch (314:9): [True: 0, False: 767k]
  ------------------
  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|   767k|    else
  321|   767k|#endif
  322|   767k|    {
  323|   767k|        if (flags & XML_ESCAPE_QUOT)
  ------------------
  |  |   25|   767k|#define XML_ESCAPE_QUOT             (1u << 3)
  ------------------
  |  Branch (323:13): [True: 0, False: 767k]
  ------------------
  324|      0|            tab = xmlEscapeTabQuot;
  325|   767k|        else if (flags & XML_ESCAPE_ATTR)
  ------------------
  |  |   22|   767k|#define XML_ESCAPE_ATTR             (1u << 0)
  ------------------
  |  Branch (325:18): [True: 460k, False: 307k]
  ------------------
  326|   460k|            tab = xmlEscapeTabAttr;
  327|   307k|        else
  328|   307k|            tab = xmlEscapeTab;
  329|   767k|    }
  330|       |
  331|   767k|    cur = string;
  332|       |
  333|   822k|    while (1) {
  ------------------
  |  Branch (333:12): [True: 822k, Folded]
  ------------------
  334|   822k|        const xmlChar *base;
  335|   822k|        int c;
  336|   822k|        int offset;
  337|       |
  338|   822k|        base = cur;
  339|   822k|        offset = -1;
  340|       |
  341|  38.3M|        while (1) {
  ------------------
  |  Branch (341:16): [True: 38.3M, Folded]
  ------------------
  342|  38.3M|            if ((size_t) (cur - string) >= maxSize)
  ------------------
  |  Branch (342:17): [True: 0, False: 38.3M]
  ------------------
  343|      0|                break;
  344|       |
  345|  38.3M|            c = (unsigned char) *cur;
  346|       |
  347|  38.3M|            if (c < 0x80) {
  ------------------
  |  Branch (347:17): [True: 33.6M, False: 4.69M]
  ------------------
  348|  33.6M|                offset = tab[c];
  349|  33.6M|                if (offset >= 0)
  ------------------
  |  Branch (349:21): [True: 822k, False: 32.8M]
  ------------------
  350|   822k|                    break;
  351|  33.6M|            } else if (flags & XML_ESCAPE_NON_ASCII) {
  ------------------
  |  |   23|  4.69M|#define XML_ESCAPE_NON_ASCII        (1u << 1)
  ------------------
  |  Branch (351:24): [True: 0, False: 4.69M]
  ------------------
  352|      0|                break;
  353|      0|            }
  354|       |
  355|  37.5M|            cur += 1;
  356|  37.5M|        }
  357|       |
  358|   822k|        if (cur > base)
  ------------------
  |  Branch (358:13): [True: 795k, False: 27.4k]
  ------------------
  359|   795k|            xmlOutputBufferWrite(buf, cur - base, (char *) base);
  360|       |
  361|   822k|        if ((size_t) (cur - string) >= maxSize)
  ------------------
  |  Branch (361:13): [True: 0, False: 822k]
  ------------------
  362|      0|            break;
  363|       |
  364|   822k|        if (offset >= 0) {
  ------------------
  |  Branch (364:13): [True: 822k, False: 0]
  ------------------
  365|   822k|            if (c == 0)
  ------------------
  |  Branch (365:17): [True: 767k, False: 55.0k]
  ------------------
  366|   767k|                break;
  367|       |
  368|  55.0k|            xmlOutputBufferWrite(buf, xmlEscapeContent[offset],
  369|  55.0k|                                 &xmlEscapeContent[offset+1]);
  370|  55.0k|            cur += 1;
  371|  55.0k|        } 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|   822k|    }
  390|   767k|}
xmlAllocParserInputBuffer:
 1332|  42.8k|xmlAllocParserInputBuffer(xmlCharEncoding enc) {
 1333|  42.8k|    xmlParserInputBufferPtr ret;
 1334|       |
 1335|  42.8k|    ret = (xmlParserInputBufferPtr) xmlMalloc(sizeof(xmlParserInputBuffer));
 1336|  42.8k|    if (ret == NULL) {
  ------------------
  |  Branch (1336:9): [True: 4, False: 42.8k]
  ------------------
 1337|      4|	return(NULL);
 1338|      4|    }
 1339|  42.8k|    memset(ret, 0, sizeof(xmlParserInputBuffer));
 1340|  42.8k|    ret->buffer = xmlBufCreate(XML_IO_BUFFER_SIZE);
  ------------------
  |  |   20|  42.8k|#define XML_IO_BUFFER_SIZE 6000
  ------------------
 1341|  42.8k|    if (ret->buffer == NULL) {
  ------------------
  |  Branch (1341:9): [True: 5, False: 42.8k]
  ------------------
 1342|      5|        xmlFree(ret);
 1343|      5|	return(NULL);
 1344|      5|    }
 1345|  42.8k|    if (enc != XML_CHAR_ENCODING_NONE) {
  ------------------
  |  Branch (1345:9): [True: 0, False: 42.8k]
  ------------------
 1346|      0|        if (xmlLookupCharEncodingHandler(enc, &ret->encoder) != XML_ERR_OK) {
  ------------------
  |  Branch (1346:13): [True: 0, False: 0]
  ------------------
 1347|       |            /* We can't handle errors properly here. */
 1348|      0|            xmlFreeParserInputBuffer(ret);
 1349|      0|            return(NULL);
 1350|      0|        }
 1351|      0|    }
 1352|  42.8k|    if (ret->encoder != NULL)
  ------------------
  |  Branch (1352:9): [True: 0, False: 42.8k]
  ------------------
 1353|      0|        ret->raw = xmlBufCreate(XML_IO_BUFFER_SIZE);
  ------------------
  |  |   20|      0|#define XML_IO_BUFFER_SIZE 6000
  ------------------
 1354|  42.8k|    else
 1355|  42.8k|        ret->raw = NULL;
 1356|  42.8k|    ret->readcallback = NULL;
 1357|  42.8k|    ret->closecallback = NULL;
 1358|  42.8k|    ret->context = NULL;
 1359|  42.8k|    ret->compressed = -1;
 1360|  42.8k|    ret->rawconsumed = 0;
 1361|       |
 1362|  42.8k|    return(ret);
 1363|  42.8k|}
xmlAllocOutputBuffer:
 1375|  38.4k|xmlAllocOutputBuffer(xmlCharEncodingHandler *encoder) {
 1376|  38.4k|    xmlOutputBufferPtr ret;
 1377|       |
 1378|  38.4k|    ret = (xmlOutputBufferPtr) xmlMalloc(sizeof(xmlOutputBuffer));
 1379|  38.4k|    if (ret == NULL) {
  ------------------
  |  Branch (1379:9): [True: 40, False: 38.4k]
  ------------------
 1380|     40|	return(NULL);
 1381|     40|    }
 1382|  38.4k|    memset(ret, 0, sizeof(xmlOutputBuffer));
 1383|  38.4k|    ret->buffer = xmlBufCreate(MINLEN);
  ------------------
  |  |   52|  38.4k|#define MINLEN 4000
  ------------------
 1384|  38.4k|    if (ret->buffer == NULL) {
  ------------------
  |  Branch (1384:9): [True: 80, False: 38.3k]
  ------------------
 1385|     80|        xmlFree(ret);
 1386|     80|	return(NULL);
 1387|     80|    }
 1388|       |
 1389|  38.3k|    ret->encoder = encoder;
 1390|  38.3k|    if (encoder != NULL) {
  ------------------
  |  Branch (1390:9): [True: 0, False: 38.3k]
  ------------------
 1391|      0|        ret->conv = xmlBufCreate(MINLEN);
  ------------------
  |  |   52|      0|#define MINLEN 4000
  ------------------
 1392|      0|	if (ret->conv == NULL) {
  ------------------
  |  Branch (1392:6): [True: 0, False: 0]
  ------------------
 1393|      0|            xmlBufFree(ret->buffer);
 1394|      0|            xmlFree(ret);
 1395|      0|	    return(NULL);
 1396|      0|	}
 1397|       |
 1398|       |	/*
 1399|       |	 * This call is designed to initiate the encoder state
 1400|       |	 */
 1401|      0|	xmlCharEncOutput(ret, 1);
 1402|      0|    } else
 1403|  38.3k|        ret->conv = NULL;
 1404|  38.3k|    ret->writecallback = NULL;
 1405|  38.3k|    ret->closecallback = NULL;
 1406|  38.3k|    ret->context = NULL;
 1407|  38.3k|    ret->written = 0;
 1408|       |
 1409|  38.3k|    return(ret);
 1410|  38.3k|}
xmlFreeParserInputBuffer:
 1419|   434k|xmlFreeParserInputBuffer(xmlParserInputBuffer *in) {
 1420|   434k|    if (in == NULL) return;
  ------------------
  |  Branch (1420:9): [True: 2.22k, False: 432k]
  ------------------
 1421|       |
 1422|   432k|    if (in->raw) {
  ------------------
  |  Branch (1422:9): [True: 14.9k, False: 417k]
  ------------------
 1423|  14.9k|        xmlBufFree(in->raw);
 1424|  14.9k|	in->raw = NULL;
 1425|  14.9k|    }
 1426|   432k|    if (in->encoder != NULL) {
  ------------------
  |  Branch (1426:9): [True: 14.9k, False: 417k]
  ------------------
 1427|  14.9k|        xmlCharEncCloseFunc(in->encoder);
 1428|  14.9k|    }
 1429|   432k|    if (in->closecallback != NULL) {
  ------------------
  |  Branch (1429:9): [True: 0, False: 432k]
  ------------------
 1430|      0|	in->closecallback(in->context);
 1431|      0|    }
 1432|   432k|    if (in->buffer != NULL) {
  ------------------
  |  Branch (1432:9): [True: 432k, False: 0]
  ------------------
 1433|   432k|        xmlBufFree(in->buffer);
 1434|   432k|	in->buffer = NULL;
 1435|   432k|    }
 1436|       |
 1437|   432k|    xmlFree(in);
 1438|   432k|}
xmlOutputBufferClose:
 1451|  38.3k|{
 1452|  38.3k|    int ret;
 1453|       |
 1454|  38.3k|    if (out == NULL)
  ------------------
  |  Branch (1454:9): [True: 0, False: 38.3k]
  ------------------
 1455|      0|        return (-1);
 1456|       |
 1457|  38.3k|    if (out->writecallback != NULL)
  ------------------
  |  Branch (1457:9): [True: 0, False: 38.3k]
  ------------------
 1458|      0|        xmlOutputBufferFlush(out);
 1459|       |
 1460|  38.3k|    if (out->closecallback != NULL) {
  ------------------
  |  Branch (1460:9): [True: 0, False: 38.3k]
  ------------------
 1461|      0|        int code = out->closecallback(out->context);
 1462|       |
 1463|      0|        if ((code != XML_ERR_OK) &&
  ------------------
  |  Branch (1463:13): [True: 0, False: 0]
  ------------------
 1464|      0|            (!xmlIsCatastrophicError(XML_ERR_FATAL, out->error))) {
  ------------------
  |  Branch (1464:13): [True: 0, False: 0]
  ------------------
 1465|      0|            if (code < 0)
  ------------------
  |  Branch (1465:17): [True: 0, False: 0]
  ------------------
 1466|      0|                out->error = XML_IO_UNKNOWN;
 1467|      0|            else
 1468|      0|                out->error = code;
 1469|      0|        }
 1470|      0|    }
 1471|       |
 1472|  38.3k|    if (out->error != XML_ERR_OK)
  ------------------
  |  Branch (1472:9): [True: 25, False: 38.3k]
  ------------------
 1473|     25|        ret = -out->error;
 1474|  38.3k|    else
 1475|  38.3k|        ret = out->written;
 1476|       |
 1477|  38.3k|    if (out->conv) {
  ------------------
  |  Branch (1477:9): [True: 0, False: 38.3k]
  ------------------
 1478|      0|        xmlBufFree(out->conv);
 1479|      0|        out->conv = NULL;
 1480|      0|    }
 1481|  38.3k|    if (out->encoder != NULL) {
  ------------------
  |  Branch (1481:9): [True: 0, False: 38.3k]
  ------------------
 1482|      0|        xmlCharEncCloseFunc(out->encoder);
 1483|      0|    }
 1484|  38.3k|    if (out->buffer != NULL) {
  ------------------
  |  Branch (1484:9): [True: 38.3k, False: 0]
  ------------------
 1485|  38.3k|        xmlBufFree(out->buffer);
 1486|  38.3k|        out->buffer = NULL;
 1487|  38.3k|    }
 1488|       |
 1489|  38.3k|    xmlFree(out);
 1490|       |
 1491|  38.3k|    return(ret);
 1492|  38.3k|}
xmlNewInputBufferMemory:
 1940|   375k|                        xmlParserInputFlags flags, xmlCharEncoding enc) {
 1941|   375k|    xmlParserInputBufferPtr ret;
 1942|       |
 1943|   375k|    if ((flags & XML_INPUT_BUF_STATIC) &&
  ------------------
  |  Branch (1943:9): [True: 332k, False: 42.9k]
  ------------------
 1944|   332k|        ((flags & XML_INPUT_BUF_ZERO_TERMINATED) == 0)) {
  ------------------
  |  Branch (1944:9): [True: 0, False: 332k]
  ------------------
 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|   375k|    } else {
 1968|   375k|        ret = xmlMalloc(sizeof(*ret));
 1969|   375k|        if (ret == NULL)
  ------------------
  |  Branch (1969:13): [True: 18, False: 375k]
  ------------------
 1970|     18|            return(NULL);
 1971|   375k|        memset(ret, 0, sizeof(xmlParserInputBuffer));
 1972|   375k|        ret->compressed = -1;
 1973|       |
 1974|   375k|        ret->buffer = xmlBufCreateMem((const xmlChar *) mem, size,
 1975|   375k|                                      (flags & XML_INPUT_BUF_STATIC ? 1 : 0));
  ------------------
  |  Branch (1975:40): [True: 332k, False: 42.8k]
  ------------------
 1976|   375k|        if (ret->buffer == NULL) {
  ------------------
  |  Branch (1976:13): [True: 18, False: 375k]
  ------------------
 1977|     18|            xmlFree(ret);
 1978|     18|            return(NULL);
 1979|     18|        }
 1980|   375k|    }
 1981|       |
 1982|   375k|    return(ret);
 1983|   375k|}
xmlParserInputBufferCreateMem:
 2005|  42.9k|xmlParserInputBufferCreateMem(const char *mem, int size, xmlCharEncoding enc) {
 2006|  42.9k|    if ((mem == NULL) || (size < 0))
  ------------------
  |  Branch (2006:9): [True: 0, False: 42.9k]
  |  Branch (2006:26): [True: 0, False: 42.9k]
  ------------------
 2007|      0|        return(NULL);
 2008|       |
 2009|  42.9k|    return(xmlNewInputBufferMemory(mem, size, 0, enc));
 2010|  42.9k|}
xmlNewInputBufferString:
 2049|  14.4k|xmlNewInputBufferString(const char *str, xmlParserInputFlags flags) {
 2050|  14.4k|    xmlParserInputBufferPtr ret;
 2051|       |
 2052|  14.4k|    ret = xmlMalloc(sizeof(*ret));
 2053|  14.4k|    if (ret == NULL)
  ------------------
  |  Branch (2053:9): [True: 2, False: 14.4k]
  ------------------
 2054|      2|	return(NULL);
 2055|  14.4k|    memset(ret, 0, sizeof(xmlParserInputBuffer));
 2056|  14.4k|    ret->compressed = -1;
 2057|       |
 2058|  14.4k|    ret->buffer = xmlBufCreateMem((const xmlChar *) str, strlen(str),
 2059|  14.4k|                                  (flags & XML_INPUT_BUF_STATIC ? 1 : 0));
  ------------------
  |  Branch (2059:36): [True: 14.4k, False: 0]
  ------------------
 2060|  14.4k|    if (ret->buffer == NULL) {
  ------------------
  |  Branch (2060:9): [True: 2, False: 14.4k]
  ------------------
 2061|      2|        xmlFree(ret);
 2062|      2|	return(NULL);
 2063|      2|    }
 2064|       |
 2065|  14.4k|    return(ret);
 2066|  14.4k|}
xmlParserInputBufferPush:
 2231|   466k|	                 int len, const char *buf) {
 2232|   466k|    size_t nbchars = 0;
 2233|   466k|    int ret;
 2234|       |
 2235|   466k|    if (len < 0) return(0);
  ------------------
  |  Branch (2235:9): [True: 0, False: 466k]
  ------------------
 2236|   466k|    if ((in == NULL) || (in->error)) return(-1);
  ------------------
  |  Branch (2236:9): [True: 0, False: 466k]
  |  Branch (2236:25): [True: 229, False: 466k]
  ------------------
 2237|   466k|    if (in->encoder != NULL) {
  ------------------
  |  Branch (2237:9): [True: 27.1k, False: 439k]
  ------------------
 2238|       |        /*
 2239|       |	 * Store the data in the incoming raw buffer
 2240|       |	 */
 2241|  27.1k|        if (in->raw == NULL) {
  ------------------
  |  Branch (2241:13): [True: 0, False: 27.1k]
  ------------------
 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|  27.1k|	ret = xmlBufAdd(in->raw, (const xmlChar *) buf, len);
 2249|  27.1k|	if (ret != 0) {
  ------------------
  |  Branch (2249:6): [True: 0, False: 27.1k]
  ------------------
 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|  27.1k|        nbchars = SIZE_MAX;
 2258|  27.1k|	if (xmlCharEncInput(in, &nbchars, /* flush */ 0) !=
  ------------------
  |  Branch (2258:6): [True: 12, False: 27.1k]
  ------------------
 2259|  27.1k|            XML_ENC_ERR_SUCCESS)
 2260|     12|            return(-1);
 2261|  27.1k|        if (nbchars > INT_MAX)
  ------------------
  |  Branch (2261:13): [True: 0, False: 27.1k]
  ------------------
 2262|      0|            nbchars = INT_MAX;
 2263|   439k|    } else {
 2264|   439k|	nbchars = len;
 2265|   439k|        ret = xmlBufAdd(in->buffer, (xmlChar *) buf, nbchars);
 2266|   439k|	if (ret != 0) {
  ------------------
  |  Branch (2266:6): [True: 1, False: 439k]
  ------------------
 2267|      1|            in->error = XML_ERR_NO_MEMORY;
 2268|      1|	    return(-1);
 2269|      1|        }
 2270|   439k|    }
 2271|   466k|    return(nbchars);
 2272|   466k|}
xmlParserInputBufferGrow:
 2298|   629k|xmlParserInputBufferGrow(xmlParserInputBuffer *in, int len) {
 2299|   629k|    int res = 0;
 2300|       |
 2301|   629k|    if ((in == NULL) || (in->error))
  ------------------
  |  Branch (2301:9): [True: 0, False: 629k]
  |  Branch (2301:25): [True: 715, False: 628k]
  ------------------
 2302|    715|        return(-1);
 2303|       |
 2304|   628k|    if (len < MINLEN)
  ------------------
  |  |   52|   628k|#define MINLEN 4000
  ------------------
  |  Branch (2304:9): [True: 339k, False: 289k]
  ------------------
 2305|   339k|        len = MINLEN;
  ------------------
  |  |   52|   339k|#define MINLEN 4000
  ------------------
 2306|       |
 2307|       |    /*
 2308|       |     * Call the read method for this I/O type.
 2309|       |     */
 2310|   628k|    if (in->readcallback != NULL) {
  ------------------
  |  Branch (2310:9): [True: 0, False: 628k]
  ------------------
 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|   628k|    if (in->encoder != NULL) {
  ------------------
  |  Branch (2355:9): [True: 365k, False: 263k]
  ------------------
 2356|   365k|        size_t sizeOut;
 2357|       |
 2358|       |        /*
 2359|       |         * Don't convert whole buffer when reading from memory.
 2360|       |         */
 2361|   365k|        if (in->readcallback == NULL)
  ------------------
  |  Branch (2361:13): [True: 365k, False: 0]
  ------------------
 2362|   365k|            sizeOut = len;
 2363|      0|        else
 2364|      0|            sizeOut = SIZE_MAX;
 2365|       |
 2366|   365k|	if (xmlCharEncInput(in, &sizeOut, /* flush */ 0) !=
  ------------------
  |  Branch (2366:6): [True: 639, False: 364k]
  ------------------
 2367|   365k|            XML_ENC_ERR_SUCCESS)
 2368|    639|	    return(-1);
 2369|   364k|        res = sizeOut;
 2370|   364k|    }
 2371|   628k|    return(res);
 2372|   628k|}
xmlParserInputBufferRead:
 2385|  76.9k|xmlParserInputBufferRead(xmlParserInputBuffer *in, int len) {
 2386|  76.9k|    return(xmlParserInputBufferGrow(in, len));
 2387|  76.9k|}
xmlOutputBufferWrite:
 2403|  7.92M|xmlOutputBufferWrite(xmlOutputBuffer *out, int len, const char *data) {
 2404|  7.92M|    xmlBufPtr buf = NULL;
 2405|  7.92M|    size_t written = 0;
 2406|  7.92M|    int ret;
 2407|       |
 2408|  7.92M|    if ((out == NULL) || (out->error))
  ------------------
  |  Branch (2408:9): [True: 0, False: 7.92M]
  |  Branch (2408:26): [True: 4.49k, False: 7.91M]
  ------------------
 2409|  4.49k|        return(-1);
 2410|  7.91M|    if (len < 0)
  ------------------
  |  Branch (2410:9): [True: 0, False: 7.91M]
  ------------------
 2411|      0|        return(0);
 2412|       |
 2413|  7.91M|    ret = xmlBufAdd(out->buffer, (const xmlChar *) data, len);
 2414|  7.91M|    if (ret != 0) {
  ------------------
  |  Branch (2414:9): [True: 25, False: 7.91M]
  ------------------
 2415|     25|        out->error = XML_ERR_NO_MEMORY;
 2416|     25|        return(-1);
 2417|     25|    }
 2418|       |
 2419|       |    /*
 2420|       |     * first handle encoding stuff.
 2421|       |     */
 2422|  7.91M|    if (out->encoder != NULL) {
  ------------------
  |  Branch (2422:9): [True: 0, False: 7.91M]
  ------------------
 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|  7.91M|    } else {
 2450|  7.91M|        if (out->writecallback)
  ------------------
  |  Branch (2450:13): [True: 0, False: 7.91M]
  ------------------
 2451|      0|            buf = out->buffer;
 2452|  7.91M|        else
 2453|  7.91M|            written = len;
 2454|  7.91M|    }
 2455|       |
 2456|  7.91M|    if ((buf != NULL) && (out->writecallback)) {
  ------------------
  |  Branch (2456:9): [True: 0, False: 7.91M]
  |  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|  7.91M|    return(written <= INT_MAX ? written : INT_MAX);
  ------------------
  |  Branch (2491:12): [True: 7.91M, False: 0]
  ------------------
 2492|  7.91M|}
xmlOutputBufferWriteString:
 2580|  2.13M|xmlOutputBufferWriteString(xmlOutputBuffer *out, const char *str) {
 2581|  2.13M|    int len;
 2582|       |
 2583|  2.13M|    if ((out == NULL) || (out->error)) return(-1);
  ------------------
  |  Branch (2583:9): [True: 0, False: 2.13M]
  |  Branch (2583:26): [True: 905, False: 2.13M]
  ------------------
 2584|  2.13M|    if (str == NULL)
  ------------------
  |  Branch (2584:9): [True: 0, False: 2.13M]
  ------------------
 2585|      0|        return(-1);
 2586|  2.13M|    len = strlen(str);
 2587|       |
 2588|  2.13M|    if (len > 0)
  ------------------
  |  Branch (2588:9): [True: 2.13M, False: 2.69k]
  ------------------
 2589|  2.13M|	return(xmlOutputBufferWrite(out, len, str));
 2590|  2.69k|    return(len);
 2591|  2.13M|}
xmlOutputBufferWriteQuotedString:
 2609|  9.33k|                                 const xmlChar *string) {
 2610|  9.33k|    const xmlChar *cur, *base;
 2611|       |
 2612|  9.33k|    if ((buf == NULL) || (buf->error))
  ------------------
  |  Branch (2612:9): [True: 0, False: 9.33k]
  |  Branch (2612:26): [True: 0, False: 9.33k]
  ------------------
 2613|      0|        return;
 2614|       |
 2615|  9.33k|    if (xmlStrchr(string, '\"')) {
  ------------------
  |  Branch (2615:9): [True: 201, False: 9.13k]
  ------------------
 2616|    201|        if (xmlStrchr(string, '\'')) {
  ------------------
  |  Branch (2616:13): [True: 0, False: 201]
  ------------------
 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|    201|        else{
 2637|    201|	    xmlOutputBufferWrite(buf, 1, "'");
 2638|    201|            xmlOutputBufferWriteString(buf, (const char *) string);
 2639|    201|	    xmlOutputBufferWrite(buf, 1, "'");
 2640|    201|        }
 2641|  9.13k|    } else {
 2642|  9.13k|        xmlOutputBufferWrite(buf, 1, "\"");
 2643|  9.13k|        xmlOutputBufferWriteString(buf, (const char *) string);
 2644|  9.13k|        xmlOutputBufferWrite(buf, 1, "\"");
 2645|  9.13k|    }
 2646|  9.33k|}
xmlParserGetDirectory:
 2720|   203k|xmlParserGetDirectory(const char *filename) {
 2721|   203k|    char *ret = NULL;
 2722|   203k|    char dir[1024];
 2723|   203k|    char *cur;
 2724|       |
 2725|   203k|    if (filename == NULL) return(NULL);
  ------------------
  |  Branch (2725:9): [True: 0, False: 203k]
  ------------------
 2726|       |
 2727|       |#if defined(LIBXML_WINPATH_ENABLED)
 2728|       |#   define IS_XMLPGD_SEP(ch) ((ch=='/')||(ch=='\\'))
 2729|       |#else
 2730|   203k|#   define IS_XMLPGD_SEP(ch) (ch=='/')
 2731|   203k|#endif
 2732|       |
 2733|   203k|    strncpy(dir, filename, 1023);
 2734|   203k|    dir[1023] = 0;
 2735|   203k|    cur = &dir[strlen(dir)];
 2736|  1.45M|    while (cur > dir) {
  ------------------
  |  Branch (2736:12): [True: 1.25M, False: 192k]
  ------------------
 2737|  1.25M|         if (IS_XMLPGD_SEP(*cur)) break;
  ------------------
  |  | 2730|  1.25M|#   define IS_XMLPGD_SEP(ch) (ch=='/')
  |  |  ------------------
  |  |  |  Branch (2730:30): [True: 10.6k, False: 1.24M]
  |  |  ------------------
  ------------------
 2738|  1.24M|	 cur --;
 2739|  1.24M|    }
 2740|   203k|    if (IS_XMLPGD_SEP(*cur)) {
  ------------------
  |  | 2730|   203k|#   define IS_XMLPGD_SEP(ch) (ch=='/')
  |  |  ------------------
  |  |  |  Branch (2730:30): [True: 10.8k, False: 192k]
  |  |  ------------------
  ------------------
 2741|  10.8k|        if (cur == dir) dir[1] = 0;
  ------------------
  |  Branch (2741:13): [True: 180, False: 10.6k]
  ------------------
 2742|  10.6k|	else *cur = 0;
 2743|  10.8k|	ret = xmlMemStrdup(dir);
 2744|   192k|    } else {
 2745|   192k|        ret = xmlMemStrdup(".");
 2746|   192k|    }
 2747|   203k|    return(ret);
 2748|   203k|#undef IS_XMLPGD_SEP
 2749|   203k|}
xmlInitIOCallbacks:
 2790|      2|{
 2791|      2|    xmlInputCallbackNr = 1;
 2792|      2|    xmlInputCallbackTable[0].matchcallback = xmlIODefaultMatch;
 2793|       |
 2794|      2|#ifdef LIBXML_OUTPUT_ENABLED
 2795|      2|    xmlOutputCallbackNr = 1;
 2796|      2|    xmlOutputCallbackTable[0].matchcallback = xmlIODefaultMatch;
 2797|      2|#endif
 2798|      2|}

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

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

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

xmlSaveSetIndentString:
  126|  42.6k|xmlSaveSetIndentString(xmlSaveCtxt *ctxt, const char *indent) {
  127|  42.6k|    size_t len;
  128|  42.6k|    int i;
  129|       |
  130|  42.6k|    if ((ctxt == NULL) || (indent == NULL))
  ------------------
  |  Branch (130:9): [True: 0, False: 42.6k]
  |  Branch (130:27): [True: 0, False: 42.6k]
  ------------------
  131|      0|        return(-1);
  132|       |
  133|  42.6k|    len = strlen(indent);
  134|  42.6k|    if ((len <= 0) || (len > MAX_INDENT))
  ------------------
  |  |   20|  42.6k|#define MAX_INDENT 60
  ------------------
  |  Branch (134:9): [True: 0, False: 42.6k]
  |  Branch (134:23): [True: 0, False: 42.6k]
  ------------------
  135|      0|        return(-1);
  136|       |
  137|  42.6k|    ctxt->indent_size = len;
  138|  42.6k|    ctxt->indent_nr = MAX_INDENT / ctxt->indent_size;
  ------------------
  |  |   20|  42.6k|#define MAX_INDENT 60
  ------------------
  139|  1.32M|    for (i = 0; i < ctxt->indent_nr; i++)
  ------------------
  |  Branch (139:17): [True: 1.27M, False: 42.6k]
  ------------------
  140|  1.27M|        memcpy(&ctxt->indent[i * ctxt->indent_size], indent, len);
  141|       |
  142|  42.6k|    return(0);
  143|  42.6k|}
xmlNodeDumpOutput:
 2334|  42.6k|{
 2335|  42.6k|    xmlSaveCtxt ctxt;
 2336|  42.6k|    int options;
 2337|  42.6k|#ifdef LIBXML_HTML_ENABLED
 2338|  42.6k|    xmlDtdPtr dtd;
 2339|  42.6k|    int is_xhtml = 0;
 2340|  42.6k|#endif
 2341|       |
 2342|  42.6k|    (void) doc;
 2343|       |
 2344|  42.6k|    xmlInitParser();
 2345|       |
 2346|  42.6k|    if ((buf == NULL) || (cur == NULL)) return;
  ------------------
  |  Branch (2346:9): [True: 0, False: 42.6k]
  |  Branch (2346:26): [True: 0, False: 42.6k]
  ------------------
 2347|       |
 2348|  42.6k|    if (level < 0)
  ------------------
  |  Branch (2348:9): [True: 0, False: 42.6k]
  ------------------
 2349|      0|        level = 0;
 2350|  42.6k|    else if (level > 100)
  ------------------
  |  Branch (2350:14): [True: 0, False: 42.6k]
  ------------------
 2351|      0|        level = 100;
 2352|       |
 2353|  42.6k|    if (encoding == NULL)
  ------------------
  |  Branch (2353:9): [True: 42.6k, False: 0]
  ------------------
 2354|  42.6k|        encoding = "UTF-8";
 2355|       |
 2356|  42.6k|    memset(&ctxt, 0, sizeof(ctxt));
 2357|  42.6k|    ctxt.buf = buf;
 2358|  42.6k|    ctxt.level = level;
 2359|  42.6k|    ctxt.encoding = (const xmlChar *) encoding;
 2360|       |
 2361|  42.6k|    options = XML_SAVE_AS_XML;
 2362|  42.6k|    if (format)
  ------------------
  |  Branch (2362:9): [True: 0, False: 42.6k]
  ------------------
 2363|      0|        options |= XML_SAVE_FORMAT;
 2364|  42.6k|    xmlSaveCtxtInit(&ctxt, options);
 2365|       |
 2366|  42.6k|#ifdef LIBXML_HTML_ENABLED
 2367|  42.6k|    dtd = xmlGetIntSubset(doc);
 2368|  42.6k|    if (dtd != NULL) {
  ------------------
  |  Branch (2368:9): [True: 27.3k, False: 15.3k]
  ------------------
 2369|  27.3k|	is_xhtml = xmlIsXHTML(dtd->SystemID, dtd->ExternalID);
 2370|  27.3k|	if (is_xhtml < 0)
  ------------------
  |  Branch (2370:6): [True: 8.55k, False: 18.7k]
  ------------------
 2371|  8.55k|	    is_xhtml = 0;
 2372|  27.3k|    }
 2373|       |
 2374|  42.6k|    if (is_xhtml)
  ------------------
  |  Branch (2374:9): [True: 17.2k, False: 25.3k]
  ------------------
 2375|  17.2k|        xhtmlNodeDumpOutput(&ctxt, cur);
 2376|  25.3k|    else
 2377|  25.3k|#endif
 2378|  25.3k|        xmlNodeDumpOutputInternal(&ctxt, cur);
 2379|  42.6k|}
xmlsave.c:xmlNsDumpOutput:
  762|   299k|xmlNsDumpOutput(xmlOutputBufferPtr buf, xmlNsPtr cur, xmlSaveCtxtPtr ctxt) {
  763|   299k|    unsigned escapeFlags = XML_ESCAPE_ATTR;
  ------------------
  |  |   22|   299k|#define XML_ESCAPE_ATTR             (1u << 0)
  ------------------
  764|       |
  765|   299k|    if ((cur == NULL) || (buf == NULL)) return;
  ------------------
  |  Branch (765:9): [True: 0, False: 299k]
  |  Branch (765:26): [True: 0, False: 299k]
  ------------------
  766|       |
  767|   299k|    if ((ctxt == NULL) || (ctxt->encoding == NULL))
  ------------------
  |  Branch (767:9): [True: 0, False: 299k]
  |  Branch (767:27): [True: 0, False: 299k]
  ------------------
  768|      0|        escapeFlags |= XML_ESCAPE_NON_ASCII;
  ------------------
  |  |   23|      0|#define XML_ESCAPE_NON_ASCII        (1u << 1)
  ------------------
  769|       |
  770|   299k|    if ((cur->type == XML_LOCAL_NAMESPACE) && (cur->href != NULL)) {
  ------------------
  |  |  500|   299k|#define XML_LOCAL_NAMESPACE XML_NAMESPACE_DECL
  ------------------
  |  Branch (770:9): [True: 299k, False: 0]
  |  Branch (770:47): [True: 296k, False: 2.33k]
  ------------------
  771|   296k|	if (xmlStrEqual(cur->prefix, BAD_CAST "xml"))
  ------------------
  |  |   34|   296k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (771:6): [True: 213, False: 296k]
  ------------------
  772|    213|	    return;
  773|       |
  774|   296k|	if (ctxt != NULL && ctxt->format == 2)
  ------------------
  |  Branch (774:6): [True: 296k, False: 0]
  |  Branch (774:22): [True: 0, False: 296k]
  ------------------
  775|      0|	    xmlOutputBufferWriteWSNonSig(ctxt, 2);
  776|   296k|	else
  777|   296k|	    xmlOutputBufferWrite(buf, 1, " ");
  778|       |
  779|       |        /* Within the context of an element attributes */
  780|   296k|	if (cur->prefix != NULL) {
  ------------------
  |  Branch (780:6): [True: 290k, False: 6.31k]
  ------------------
  781|   290k|	    xmlOutputBufferWrite(buf, 6, "xmlns:");
  782|   290k|	    xmlOutputBufferWriteString(buf, (const char *)cur->prefix);
  783|   290k|	} else
  784|  6.31k|	    xmlOutputBufferWrite(buf, 5, "xmlns");
  785|   296k|        xmlOutputBufferWrite(buf, 2, "=\"");
  786|       |        xmlSerializeText(buf, cur->href, SIZE_MAX, escapeFlags);
  787|   296k|        xmlOutputBufferWrite(buf, 1, "\"");
  788|   296k|    }
  789|   299k|}
xmlsave.c:xmlSaveDocInternal:
 1226|  1.11k|                   const xmlChar *encoding) {
 1227|  1.11k|#ifdef LIBXML_HTML_ENABLED
 1228|  1.11k|    xmlDtdPtr dtd;
 1229|  1.11k|    int is_xhtml = 0;
 1230|  1.11k|#endif
 1231|  1.11k|    xmlOutputBufferPtr buf = ctxt->buf;
 1232|  1.11k|    int switched_encoding = 0;
 1233|       |
 1234|  1.11k|    xmlInitParser();
 1235|       |
 1236|  1.11k|    if ((cur->type != XML_HTML_DOCUMENT_NODE) &&
  ------------------
  |  Branch (1236:9): [True: 1.11k, False: 0]
  ------------------
 1237|  1.11k|        (cur->type != XML_DOCUMENT_NODE))
  ------------------
  |  Branch (1237:9): [True: 0, False: 1.11k]
  ------------------
 1238|      0|	 return(-1);
 1239|       |
 1240|  1.11k|    if (encoding == NULL)
  ------------------
  |  Branch (1240:9): [True: 0, False: 1.11k]
  ------------------
 1241|      0|	encoding = cur->encoding;
 1242|       |
 1243|  1.11k|    if (((cur->type == XML_HTML_DOCUMENT_NODE) &&
  ------------------
  |  Branch (1243:10): [True: 0, False: 1.11k]
  ------------------
 1244|      0|         ((ctxt->options & XML_SAVE_AS_XML) == 0) &&
  ------------------
  |  Branch (1244:10): [True: 0, False: 0]
  ------------------
 1245|      0|         ((ctxt->options & XML_SAVE_XHTML) == 0)) ||
  ------------------
  |  Branch (1245:10): [True: 0, False: 0]
  ------------------
 1246|  1.11k|        (ctxt->options & XML_SAVE_AS_HTML)) {
  ------------------
  |  Branch (1246:9): [True: 0, False: 1.11k]
  ------------------
 1247|      0|#ifdef LIBXML_HTML_ENABLED
 1248|      0|        int format = 0;
 1249|       |
 1250|      0|	if (ctxt->encoding == NULL) {
  ------------------
  |  Branch (1250:6): [True: 0, False: 0]
  ------------------
 1251|      0|            if (encoding == NULL)
  ------------------
  |  Branch (1251:17): [True: 0, False: 0]
  ------------------
 1252|      0|                encoding = BAD_CAST "HTML";
  ------------------
  |  |   34|      0|#define BAD_CAST (xmlChar *)
  ------------------
 1253|       |
 1254|      0|	    if (xmlSaveSwitchEncoding(ctxt, (const char*) encoding) < 0) {
  ------------------
  |  Branch (1254:10): [True: 0, False: 0]
  ------------------
 1255|      0|		return(-1);
 1256|      0|	    }
 1257|      0|            switched_encoding = 1;
 1258|      0|	}
 1259|       |
 1260|      0|        if (ctxt->options & XML_SAVE_FORMAT)
  ------------------
  |  Branch (1260:13): [True: 0, False: 0]
  ------------------
 1261|      0|            format = 1;
 1262|      0|        htmlNodeDumpInternal(buf, (htmlNodePtr) cur, (char *) ctxt->encoding,
 1263|      0|                             format);
 1264|       |#else
 1265|       |        return(-1);
 1266|       |#endif
 1267|  1.11k|    } else if ((cur->type == XML_DOCUMENT_NODE) ||
  ------------------
  |  Branch (1267:16): [True: 1.11k, False: 0]
  ------------------
 1268|      0|               (ctxt->options & XML_SAVE_AS_XML) ||
  ------------------
  |  Branch (1268:16): [True: 0, False: 0]
  ------------------
 1269|  1.11k|               (ctxt->options & XML_SAVE_XHTML)) {
  ------------------
  |  Branch (1269:16): [True: 0, False: 0]
  ------------------
 1270|  1.11k|	if ((encoding != NULL) && (ctxt->encoding == NULL)) {
  ------------------
  |  Branch (1270:6): [True: 1.11k, False: 0]
  |  Branch (1270:28): [True: 0, False: 1.11k]
  ------------------
 1271|      0|            if (xmlSaveSwitchEncoding(ctxt, (const char *) encoding) < 0)
  ------------------
  |  Branch (1271:17): [True: 0, False: 0]
  ------------------
 1272|      0|                return(-1);
 1273|      0|            switched_encoding = 1;
 1274|      0|	}
 1275|       |
 1276|       |	/*
 1277|       |	 * Save the XML declaration
 1278|       |	 */
 1279|  1.11k|	if ((ctxt->options & XML_SAVE_NO_DECL) == 0) {
  ------------------
  |  Branch (1279:6): [True: 1.11k, False: 0]
  ------------------
 1280|  1.11k|	    xmlOutputBufferWrite(buf, 15, "<?xml version=\"");
 1281|  1.11k|	    if (cur->version != NULL)
  ------------------
  |  Branch (1281:10): [True: 1.11k, False: 0]
  ------------------
 1282|  1.11k|		xmlOutputBufferWriteString(buf, (char *) cur->version);
 1283|      0|	    else
 1284|      0|		xmlOutputBufferWrite(buf, 3, "1.0");
 1285|  1.11k|	    xmlOutputBufferWrite(buf, 1, "\"");
 1286|  1.11k|	    if (encoding != NULL) {
  ------------------
  |  Branch (1286:10): [True: 1.11k, False: 0]
  ------------------
 1287|  1.11k|		xmlOutputBufferWrite(buf, 11, " encoding=\"");
 1288|  1.11k|		xmlOutputBufferWriteString(buf, (char *) encoding);
 1289|  1.11k|	        xmlOutputBufferWrite(buf, 1, "\"");
 1290|  1.11k|	    }
 1291|  1.11k|	    switch (cur->standalone) {
  ------------------
  |  Branch (1291:14): [True: 133, False: 981]
  ------------------
 1292|     67|		case 0:
  ------------------
  |  Branch (1292:3): [True: 67, False: 1.04k]
  ------------------
 1293|     67|		    xmlOutputBufferWrite(buf, 16, " standalone=\"no\"");
 1294|     67|		    break;
 1295|     66|		case 1:
  ------------------
  |  Branch (1295:3): [True: 66, False: 1.04k]
  ------------------
 1296|     66|		    xmlOutputBufferWrite(buf, 17, " standalone=\"yes\"");
 1297|     66|		    break;
 1298|  1.11k|	    }
 1299|  1.11k|	    xmlOutputBufferWrite(buf, 3, "?>\n");
 1300|  1.11k|	}
 1301|       |
 1302|  1.11k|#ifdef LIBXML_HTML_ENABLED
 1303|  1.11k|        if (ctxt->options & XML_SAVE_XHTML)
  ------------------
  |  Branch (1303:13): [True: 200, False: 914]
  ------------------
 1304|    200|            is_xhtml = 1;
 1305|  1.11k|	if ((ctxt->options & XML_SAVE_NO_XHTML) == 0) {
  ------------------
  |  Branch (1305:6): [True: 1.11k, False: 0]
  ------------------
 1306|  1.11k|	    dtd = xmlGetIntSubset(cur);
 1307|  1.11k|	    if (dtd != NULL) {
  ------------------
  |  Branch (1307:10): [True: 1.03k, False: 81]
  ------------------
 1308|  1.03k|		is_xhtml = xmlIsXHTML(dtd->SystemID, dtd->ExternalID);
 1309|  1.03k|		if (is_xhtml < 0) is_xhtml = 0;
  ------------------
  |  Branch (1309:7): [True: 727, False: 306]
  ------------------
 1310|  1.03k|	    }
 1311|  1.11k|	}
 1312|  1.11k|#endif
 1313|  1.11k|	if (cur->children != NULL) {
  ------------------
  |  Branch (1313:6): [True: 1.11k, False: 0]
  ------------------
 1314|  1.11k|	    xmlNodePtr child = cur->children;
 1315|       |
 1316|  3.30k|	    while (child != NULL) {
  ------------------
  |  Branch (1316:13): [True: 2.18k, False: 1.11k]
  ------------------
 1317|  2.18k|		ctxt->level = 0;
 1318|  2.18k|#ifdef LIBXML_HTML_ENABLED
 1319|  2.18k|		if (is_xhtml)
  ------------------
  |  Branch (1319:7): [True: 438, False: 1.75k]
  ------------------
 1320|    438|		    xhtmlNodeDumpOutput(ctxt, child);
 1321|  1.75k|		else
 1322|  1.75k|#endif
 1323|  1.75k|		    xmlNodeDumpOutputInternal(ctxt, child);
 1324|  2.18k|                if ((child->type != XML_XINCLUDE_START) &&
  ------------------
  |  Branch (1324:21): [True: 2.18k, False: 0]
  ------------------
 1325|  2.18k|                    (child->type != XML_XINCLUDE_END))
  ------------------
  |  Branch (1325:21): [True: 2.18k, False: 0]
  ------------------
 1326|  2.18k|                    xmlOutputBufferWrite(buf, 1, "\n");
 1327|  2.18k|		child = child->next;
 1328|  2.18k|	    }
 1329|  1.11k|	}
 1330|  1.11k|    }
 1331|       |
 1332|       |    /*
 1333|       |     * Restore the state of the saving context at the end of the document
 1334|       |     */
 1335|  1.11k|    if (switched_encoding) {
  ------------------
  |  Branch (1335:9): [True: 0, False: 1.11k]
  ------------------
 1336|      0|	xmlSaveClearEncoding(ctxt);
 1337|      0|    }
 1338|       |
 1339|  1.11k|    return(0);
 1340|  1.11k|}
xmlsave.c:xhtmlNodeDumpOutput:
 1489|  17.7k|xhtmlNodeDumpOutput(xmlSaveCtxtPtr ctxt, xmlNodePtr cur) {
 1490|  17.7k|    int format = ctxt->format, addmeta, oldoptions;
 1491|  17.7k|    xmlNodePtr tmp, root, unformattedNode = NULL, parent;
 1492|  17.7k|    xmlChar *start, *end;
 1493|  17.7k|    xmlOutputBufferPtr buf = ctxt->buf;
 1494|       |
 1495|  17.7k|    if (cur == NULL) return;
  ------------------
  |  Branch (1495:9): [True: 0, False: 17.7k]
  ------------------
 1496|       |
 1497|  17.7k|    oldoptions = ctxt->options;
 1498|  17.7k|    ctxt->options |= XML_SAVE_XHTML;
 1499|       |
 1500|  17.7k|    root = cur;
 1501|  17.7k|    parent = cur->parent;
 1502|  40.2k|    while (1) {
  ------------------
  |  Branch (1502:12): [True: 40.2k, Folded]
  ------------------
 1503|  40.2k|        switch (cur->type) {
 1504|    200|        case XML_DOCUMENT_NODE:
  ------------------
  |  Branch (1504:9): [True: 200, False: 40.0k]
  ------------------
 1505|    200|        case XML_HTML_DOCUMENT_NODE:
  ------------------
  |  Branch (1505:9): [True: 0, False: 40.2k]
  ------------------
 1506|    200|            xmlSaveDocInternal(ctxt, (xmlDocPtr) cur, ctxt->encoding);
 1507|    200|	    break;
 1508|       |
 1509|      0|        case XML_NAMESPACE_DECL:
  ------------------
  |  Branch (1509:9): [True: 0, False: 40.2k]
  ------------------
 1510|      0|	    xmlNsDumpOutput(buf, (xmlNsPtr) cur, ctxt);
 1511|      0|	    break;
 1512|       |
 1513|    200|        case XML_DTD_NODE:
  ------------------
  |  Branch (1513:9): [True: 200, False: 40.0k]
  ------------------
 1514|    200|            xmlDtdDumpOutput(ctxt, (xmlDtdPtr) cur);
 1515|    200|	    break;
 1516|       |
 1517|      0|        case XML_DOCUMENT_FRAG_NODE:
  ------------------
  |  Branch (1517:9): [True: 0, False: 40.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: 40.2k]
  ------------------
 1527|      0|            xmlBufDumpElementDecl(buf, (xmlElementPtr) cur);
 1528|      0|	    break;
 1529|       |
 1530|      0|        case XML_ATTRIBUTE_DECL:
  ------------------
  |  Branch (1530:9): [True: 0, False: 40.2k]
  ------------------
 1531|      0|            xmlSaveWriteAttributeDecl(ctxt, (xmlAttributePtr) cur);
 1532|      0|	    break;
 1533|       |
 1534|      0|        case XML_ENTITY_DECL:
  ------------------
  |  Branch (1534:9): [True: 0, False: 40.2k]
  ------------------
 1535|      0|            xmlBufDumpEntityDecl(buf, (xmlEntityPtr) cur);
 1536|      0|	    break;
 1537|       |
 1538|  27.6k|        case XML_ELEMENT_NODE:
  ------------------
  |  Branch (1538:9): [True: 27.6k, False: 12.5k]
  ------------------
 1539|  27.6k|            addmeta = 0;
 1540|       |
 1541|  27.6k|	    if ((cur != root) && (ctxt->format == 1))
  ------------------
  |  Branch (1541:10): [True: 15.8k, False: 11.7k]
  |  Branch (1541:27): [True: 0, False: 15.8k]
  ------------------
 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|  27.6k|            if ((cur->parent != parent) && (cur->children != NULL)) {
  ------------------
  |  Branch (1549:17): [True: 0, False: 27.6k]
  |  Branch (1549:44): [True: 0, False: 0]
  ------------------
 1550|      0|                xhtmlNodeDumpOutput(ctxt, cur);
 1551|      0|                break;
 1552|      0|            }
 1553|       |
 1554|  27.6k|            xmlOutputBufferWrite(buf, 1, "<");
 1555|  27.6k|            if ((cur->ns != NULL) && (cur->ns->prefix != NULL)) {
  ------------------
  |  Branch (1555:17): [True: 2.12k, False: 25.5k]
  |  Branch (1555:38): [True: 587, False: 1.53k]
  ------------------
 1556|    587|                xmlOutputBufferWriteString(buf, (const char *)cur->ns->prefix);
 1557|    587|                xmlOutputBufferWrite(buf, 1, ":");
 1558|    587|            }
 1559|       |
 1560|  27.6k|            xmlOutputBufferWriteString(buf, (const char *)cur->name);
 1561|  27.6k|            if (cur->nsDef)
  ------------------
  |  Branch (1561:17): [True: 2.72k, False: 24.9k]
  ------------------
 1562|  2.72k|                xmlNsListDumpOutputCtxt(ctxt, cur->nsDef);
 1563|  27.6k|            if ((xmlStrEqual(cur->name, BAD_CAST "html") &&
  ------------------
  |  |   34|  27.6k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (1563:18): [True: 1.02k, False: 26.6k]
  ------------------
 1564|  1.02k|                (cur->ns == NULL) && (cur->nsDef == NULL))) {
  ------------------
  |  Branch (1564:17): [True: 643, False: 377]
  |  Branch (1564:38): [True: 336, False: 307]
  ------------------
 1565|       |                /*
 1566|       |                 * 3.1.1. Strictly Conforming Documents A.3.1.1 3/
 1567|       |                 */
 1568|    336|                xmlOutputBufferWriteString(buf,
 1569|    336|                        " xmlns=\"http://www.w3.org/1999/xhtml\"");
 1570|    336|            }
 1571|  27.6k|            if (cur->properties != NULL)
  ------------------
  |  Branch (1571:17): [True: 7.54k, False: 20.0k]
  ------------------
 1572|  7.54k|                xhtmlAttrListDumpOutput(ctxt, cur->properties);
 1573|       |
 1574|  27.6k|            if ((parent != NULL) &&
  ------------------
  |  Branch (1574:17): [True: 16.0k, False: 11.5k]
  ------------------
 1575|  16.0k|                (parent->parent == (xmlNodePtr) cur->doc) &&
  ------------------
  |  Branch (1575:17): [True: 68, False: 16.0k]
  ------------------
 1576|     68|                xmlStrEqual(cur->name, BAD_CAST"head") &&
  ------------------
  |  |   34|     68|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (1576:17): [True: 0, False: 68]
  ------------------
 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|  27.6k|            if (cur->children == NULL) {
  ------------------
  |  Branch (1604:17): [True: 12.6k, False: 14.9k]
  ------------------
 1605|  12.6k|                if (((cur->ns == NULL) || (cur->ns->prefix == NULL)) &&
  ------------------
  |  Branch (1605:22): [True: 11.5k, False: 1.14k]
  |  Branch (1605:43): [True: 882, False: 267]
  ------------------
 1606|  12.4k|                    ((xhtmlIsEmpty(cur) == 1) && (addmeta == 0))) {
  ------------------
  |  Branch (1606:22): [True: 3.51k, False: 8.89k]
  |  Branch (1606:50): [True: 3.51k, False: 0]
  ------------------
 1607|       |                    /*
 1608|       |                     * C.2. Empty Elements
 1609|       |                     */
 1610|  3.51k|                    xmlOutputBufferWrite(buf, 3, " />");
 1611|  9.16k|                } else {
 1612|  9.16k|                    if (addmeta == 1) {
  ------------------
  |  Branch (1612:25): [True: 0, False: 9.16k]
  ------------------
 1613|      0|                        xmlOutputBufferWrite(buf, 1, ">");
 1614|      0|                        if (ctxt->format == 1) {
  ------------------
  |  Branch (1614:29): [True: 0, False: 0]
  ------------------
 1615|      0|                            xmlOutputBufferWrite(buf, 1, "\n");
 1616|      0|                            xmlSaveWriteIndent(ctxt, 1);
 1617|      0|                        }
 1618|      0|                        xmlOutputBufferWriteString(buf,
 1619|      0|                                "<meta http-equiv=\"Content-Type\" "
 1620|      0|                                "content=\"text/html; charset=");
 1621|      0|                        if (ctxt->encoding) {
  ------------------
  |  Branch (1621:29): [True: 0, False: 0]
  ------------------
 1622|      0|                            xmlOutputBufferWriteString(buf,
 1623|      0|                                    (const char *)ctxt->encoding);
 1624|      0|                        } else {
 1625|      0|                            xmlOutputBufferWrite(buf, 5, "UTF-8");
 1626|      0|                        }
 1627|      0|                        xmlOutputBufferWrite(buf, 4, "\" />");
 1628|      0|                        if (ctxt->format == 1)
  ------------------
  |  Branch (1628:29): [True: 0, False: 0]
  ------------------
 1629|      0|                            xmlOutputBufferWrite(buf, 1, "\n");
 1630|  9.16k|                    } else {
 1631|  9.16k|                        xmlOutputBufferWrite(buf, 1, ">");
 1632|  9.16k|                    }
 1633|       |                    /*
 1634|       |                     * C.3. Element Minimization and Empty Element Content
 1635|       |                     */
 1636|  9.16k|                    xmlOutputBufferWrite(buf, 2, "</");
 1637|  9.16k|                    if ((cur->ns != NULL) && (cur->ns->prefix != NULL)) {
  ------------------
  |  Branch (1637:25): [True: 1.14k, False: 8.01k]
  |  Branch (1637:46): [True: 267, False: 882]
  ------------------
 1638|    267|                        xmlOutputBufferWriteString(buf,
 1639|    267|                                (const char *)cur->ns->prefix);
 1640|    267|                        xmlOutputBufferWrite(buf, 1, ":");
 1641|    267|                    }
 1642|  9.16k|                    xmlOutputBufferWriteString(buf, (const char *)cur->name);
 1643|  9.16k|                    xmlOutputBufferWrite(buf, 1, ">");
 1644|  9.16k|                }
 1645|  14.9k|            } else {
 1646|  14.9k|                xmlOutputBufferWrite(buf, 1, ">");
 1647|  14.9k|                if (addmeta == 1) {
  ------------------
  |  Branch (1647:21): [True: 0, False: 14.9k]
  ------------------
 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|  14.9k|                if (ctxt->format == 1) {
  ------------------
  |  Branch (1664:21): [True: 0, False: 14.9k]
  ------------------
 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|  14.9k|                if (ctxt->format == 1) xmlOutputBufferWrite(buf, 1, "\n");
  ------------------
  |  Branch (1677:21): [True: 0, False: 14.9k]
  ------------------
 1678|  14.9k|                if (ctxt->level >= 0) ctxt->level++;
  ------------------
  |  Branch (1678:21): [True: 14.9k, False: 0]
  ------------------
 1679|  14.9k|                parent = cur;
 1680|  14.9k|                cur = cur->children;
 1681|  14.9k|                continue;
 1682|  14.9k|            }
 1683|       |
 1684|  12.6k|            break;
 1685|       |
 1686|  12.6k|        case XML_TEXT_NODE:
  ------------------
  |  Branch (1686:9): [True: 9.85k, False: 30.3k]
  ------------------
 1687|  9.85k|	    if (cur->content == NULL)
  ------------------
  |  Branch (1687:10): [True: 0, False: 9.85k]
  ------------------
 1688|      0|                break;
 1689|  9.85k|	    if ((cur->name == xmlStringText) ||
  ------------------
  |  Branch (1689:10): [True: 9.85k, False: 0]
  ------------------
 1690|  9.85k|		(cur->name != xmlStringTextNoenc)) {
  ------------------
  |  Branch (1690:3): [True: 0, False: 0]
  ------------------
 1691|  9.85k|                if (ctxt->escape)
  ------------------
  |  Branch (1691:21): [True: 0, False: 9.85k]
  ------------------
 1692|      0|                    xmlOutputBufferWriteEscape(buf, cur->content,
 1693|      0|                                               ctxt->escape);
 1694|  9.85k|                else
 1695|  9.85k|                    xmlSaveWriteText(ctxt, cur->content, /* flags */ 0);
 1696|  9.85k|	    } else {
 1697|       |		/*
 1698|       |		 * Disable escaping, needed for XSLT
 1699|       |		 */
 1700|      0|		xmlOutputBufferWriteString(buf, (const char *) cur->content);
 1701|      0|	    }
 1702|  9.85k|	    break;
 1703|       |
 1704|    744|        case XML_PI_NODE:
  ------------------
  |  Branch (1704:9): [True: 744, False: 39.4k]
  ------------------
 1705|    744|            if (cur->content != NULL) {
  ------------------
  |  Branch (1705:17): [True: 253, False: 491]
  ------------------
 1706|    253|                xmlOutputBufferWrite(buf, 2, "<?");
 1707|    253|                xmlOutputBufferWriteString(buf, (const char *)cur->name);
 1708|    253|                if (cur->content != NULL) {
  ------------------
  |  Branch (1708:21): [True: 253, False: 0]
  ------------------
 1709|    253|                    xmlOutputBufferWrite(buf, 1, " ");
 1710|    253|                    xmlOutputBufferWriteString(buf,
 1711|    253|                            (const char *)cur->content);
 1712|    253|                }
 1713|    253|                xmlOutputBufferWrite(buf, 2, "?>");
 1714|    491|            } else {
 1715|    491|                xmlOutputBufferWrite(buf, 2, "<?");
 1716|    491|                xmlOutputBufferWriteString(buf, (const char *)cur->name);
 1717|    491|                xmlOutputBufferWrite(buf, 2, "?>");
 1718|    491|            }
 1719|    744|            break;
 1720|       |
 1721|    328|        case XML_COMMENT_NODE:
  ------------------
  |  Branch (1721:9): [True: 328, False: 39.8k]
  ------------------
 1722|    328|            if (cur->content != NULL) {
  ------------------
  |  Branch (1722:17): [True: 328, False: 0]
  ------------------
 1723|    328|                xmlOutputBufferWrite(buf, 4, "<!--");
 1724|    328|                xmlOutputBufferWriteString(buf, (const char *)cur->content);
 1725|    328|                xmlOutputBufferWrite(buf, 3, "-->");
 1726|    328|            }
 1727|    328|            break;
 1728|       |
 1729|    552|        case XML_ENTITY_REF_NODE:
  ------------------
  |  Branch (1729:9): [True: 552, False: 39.6k]
  ------------------
 1730|    552|            xmlOutputBufferWrite(buf, 1, "&");
 1731|    552|            xmlOutputBufferWriteString(buf, (const char *)cur->name);
 1732|    552|            xmlOutputBufferWrite(buf, 1, ";");
 1733|    552|            break;
 1734|       |
 1735|    454|        case XML_CDATA_SECTION_NODE:
  ------------------
  |  Branch (1735:9): [True: 454, False: 39.7k]
  ------------------
 1736|    454|            if (cur->content == NULL || *cur->content == '\0') {
  ------------------
  |  Branch (1736:17): [True: 0, False: 454]
  |  Branch (1736:41): [True: 201, False: 253]
  ------------------
 1737|    201|                xmlOutputBufferWrite(buf, 12, "<![CDATA[]]>");
 1738|    253|            } else {
 1739|    253|                start = end = cur->content;
 1740|  3.84k|                while (*end != '\0') {
  ------------------
  |  Branch (1740:24): [True: 3.59k, False: 253]
  ------------------
 1741|  3.59k|                    if (*end == ']' && *(end + 1) == ']' &&
  ------------------
  |  Branch (1741:25): [True: 607, False: 2.98k]
  |  Branch (1741:40): [True: 316, False: 291]
  ------------------
 1742|    316|                        *(end + 2) == '>') {
  ------------------
  |  Branch (1742:25): [True: 0, False: 316]
  ------------------
 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|  3.59k|                    end++;
 1751|  3.59k|                }
 1752|    253|                if (start != end) {
  ------------------
  |  Branch (1752:21): [True: 253, False: 0]
  ------------------
 1753|    253|                    xmlOutputBufferWrite(buf, 9, "<![CDATA[");
 1754|    253|                    xmlOutputBufferWriteString(buf, (const char *)start);
 1755|    253|                    xmlOutputBufferWrite(buf, 3, "]]>");
 1756|    253|                }
 1757|    253|            }
 1758|    454|            break;
 1759|       |
 1760|      0|        case XML_ATTRIBUTE_NODE:
  ------------------
  |  Branch (1760:9): [True: 0, False: 40.2k]
  ------------------
 1761|      0|            xmlAttrDumpOutput(ctxt, (xmlAttrPtr) cur);
 1762|      0|	    break;
 1763|       |
 1764|    225|        default:
  ------------------
  |  Branch (1764:9): [True: 225, False: 39.9k]
  ------------------
 1765|    225|            break;
 1766|  40.2k|        }
 1767|       |
 1768|  40.2k|        while (1) {
  ------------------
  |  Branch (1768:16): [True: 40.2k, Folded]
  ------------------
 1769|  40.2k|            if (cur == root)
  ------------------
  |  Branch (1769:17): [True: 17.7k, False: 22.4k]
  ------------------
 1770|  17.7k|                return;
 1771|  22.4k|            if (ctxt->format == 1)
  ------------------
  |  Branch (1771:17): [True: 0, False: 22.4k]
  ------------------
 1772|      0|                xmlOutputBufferWrite(buf, 1, "\n");
 1773|  22.4k|            if (cur->next != NULL) {
  ------------------
  |  Branch (1773:17): [True: 7.50k, False: 14.9k]
  ------------------
 1774|  7.50k|                cur = cur->next;
 1775|  7.50k|                break;
 1776|  7.50k|            }
 1777|       |
 1778|  14.9k|            cur = parent;
 1779|       |            /* cur->parent was validated when descending. */
 1780|  14.9k|            parent = cur->parent;
 1781|       |
 1782|  14.9k|            if (cur->type == XML_ELEMENT_NODE) {
  ------------------
  |  Branch (1782:17): [True: 14.9k, False: 0]
  ------------------
 1783|  14.9k|                if (ctxt->level > 0) ctxt->level--;
  ------------------
  |  Branch (1783:21): [True: 14.9k, False: 0]
  ------------------
 1784|  14.9k|                if (ctxt->format == 1)
  ------------------
  |  Branch (1784:21): [True: 0, False: 14.9k]
  ------------------
 1785|      0|                    xmlSaveWriteIndent(ctxt, 0);
 1786|       |
 1787|  14.9k|                xmlOutputBufferWrite(buf, 2, "</");
 1788|  14.9k|                if ((cur->ns != NULL) && (cur->ns->prefix != NULL)) {
  ------------------
  |  Branch (1788:21): [True: 974, False: 13.9k]
  |  Branch (1788:42): [True: 320, False: 654]
  ------------------
 1789|    320|                    xmlOutputBufferWriteString(buf,
 1790|    320|                            (const char *)cur->ns->prefix);
 1791|    320|                    xmlOutputBufferWrite(buf, 1, ":");
 1792|    320|                }
 1793|       |
 1794|  14.9k|                xmlOutputBufferWriteString(buf, (const char *)cur->name);
 1795|  14.9k|                xmlOutputBufferWrite(buf, 1, ">");
 1796|       |
 1797|  14.9k|                if (cur == unformattedNode) {
  ------------------
  |  Branch (1797:21): [True: 0, False: 14.9k]
  ------------------
 1798|      0|                    ctxt->format = format;
 1799|      0|                    unformattedNode = NULL;
 1800|      0|                }
 1801|  14.9k|            }
 1802|  14.9k|        }
 1803|  25.2k|    }
 1804|       |
 1805|      0|    ctxt->options = oldoptions;
 1806|      0|}
xmlsave.c:xmlDtdDumpOutput:
  827|  11.1k|xmlDtdDumpOutput(xmlSaveCtxtPtr ctxt, xmlDtdPtr dtd) {
  828|  11.1k|    xmlOutputBufferPtr buf;
  829|  11.1k|    xmlNodePtr cur;
  830|  11.1k|    int format, level;
  831|       |
  832|  11.1k|    if (dtd == NULL) return;
  ------------------
  |  Branch (832:9): [True: 0, False: 11.1k]
  ------------------
  833|  11.1k|    if ((ctxt == NULL) || (ctxt->buf == NULL))
  ------------------
  |  Branch (833:9): [True: 0, False: 11.1k]
  |  Branch (833:27): [True: 0, False: 11.1k]
  ------------------
  834|      0|        return;
  835|  11.1k|    buf = ctxt->buf;
  836|  11.1k|    xmlOutputBufferWrite(buf, 10, "<!DOCTYPE ");
  837|  11.1k|    xmlOutputBufferWriteString(buf, (const char *)dtd->name);
  838|  11.1k|    if (dtd->ExternalID != NULL) {
  ------------------
  |  Branch (838:9): [True: 559, False: 10.5k]
  ------------------
  839|    559|	xmlOutputBufferWrite(buf, 8, " PUBLIC ");
  840|    559|	xmlOutputBufferWriteQuotedString(buf, dtd->ExternalID);
  841|    559|	xmlOutputBufferWrite(buf, 1, " ");
  842|    559|	xmlOutputBufferWriteQuotedString(buf, dtd->SystemID);
  843|  10.5k|    }  else if (dtd->SystemID != NULL) {
  ------------------
  |  Branch (843:17): [True: 520, False: 10.0k]
  ------------------
  844|    520|	xmlOutputBufferWrite(buf, 8, " SYSTEM ");
  845|    520|	xmlOutputBufferWriteQuotedString(buf, dtd->SystemID);
  846|    520|    }
  847|  11.1k|    if ((dtd->entities == NULL) && (dtd->elements == NULL) &&
  ------------------
  |  Branch (847:9): [True: 8.93k, False: 2.16k]
  |  Branch (847:36): [True: 3.05k, False: 5.88k]
  ------------------
  848|  3.05k|        (dtd->attributes == NULL) && (dtd->notations == NULL) &&
  ------------------
  |  Branch (848:9): [True: 3.05k, False: 0]
  |  Branch (848:38): [True: 1.56k, False: 1.48k]
  ------------------
  849|  1.56k|	(dtd->pentities == NULL)) {
  ------------------
  |  Branch (849:2): [True: 1.28k, False: 281]
  ------------------
  850|  1.28k|	xmlOutputBufferWrite(buf, 1, ">");
  851|  1.28k|	return;
  852|  1.28k|    }
  853|  9.81k|    xmlOutputBufferWrite(buf, 3, " [\n");
  854|       |    /*
  855|       |     * Dump the notations first they are not in the DTD children list
  856|       |     * Do this only on a standalone DTD or on the internal subset though.
  857|       |     */
  858|  9.81k|    if ((dtd->notations != NULL) && ((dtd->doc == NULL) ||
  ------------------
  |  Branch (858:9): [True: 1.69k, False: 8.11k]
  |  Branch (858:38): [True: 1.62k, False: 75]
  ------------------
  859|  1.69k|        (dtd->doc->intSubset == dtd))) {
  ------------------
  |  Branch (859:9): [True: 75, False: 0]
  ------------------
  860|  1.69k|        xmlBufDumpNotationTable(buf, (xmlNotationTablePtr) dtd->notations);
  861|  1.69k|    }
  862|  9.81k|    format = ctxt->format;
  863|  9.81k|    level = ctxt->level;
  864|  9.81k|    ctxt->format = 0;
  865|  9.81k|    ctxt->level = -1;
  866|  29.2k|    for (cur = dtd->children; cur != NULL; cur = cur->next) {
  ------------------
  |  Branch (866:31): [True: 19.4k, False: 9.81k]
  ------------------
  867|  19.4k|        xmlNodeDumpOutputInternal(ctxt, cur);
  868|  19.4k|    }
  869|  9.81k|    ctxt->format = format;
  870|  9.81k|    ctxt->level = level;
  871|  9.81k|    xmlOutputBufferWrite(buf, 2, "]>");
  872|  9.81k|}
xmlsave.c:xmlBufDumpElementDecl:
  417|  5.77k|xmlBufDumpElementDecl(xmlOutputBufferPtr buf, xmlElementPtr elem) {
  418|  5.77k|    xmlOutputBufferWrite(buf, 10, "<!ELEMENT ");
  419|  5.77k|    if (elem->prefix != NULL) {
  ------------------
  |  Branch (419:9): [True: 1.25k, False: 4.51k]
  ------------------
  420|  1.25k|        xmlOutputBufferWriteString(buf, (const char *) elem->prefix);
  421|  1.25k|        xmlOutputBufferWrite(buf, 1, ":");
  422|  1.25k|    }
  423|  5.77k|    xmlOutputBufferWriteString(buf, (const char *) elem->name);
  424|  5.77k|    xmlOutputBufferWrite(buf, 1, " ");
  425|       |
  426|  5.77k|    switch (elem->etype) {
  427|  1.98k|	case XML_ELEMENT_TYPE_EMPTY:
  ------------------
  |  Branch (427:2): [True: 1.98k, False: 3.79k]
  ------------------
  428|  1.98k|	    xmlOutputBufferWrite(buf, 5, "EMPTY");
  429|  1.98k|	    break;
  430|    179|	case XML_ELEMENT_TYPE_ANY:
  ------------------
  |  Branch (430:2): [True: 179, False: 5.59k]
  ------------------
  431|    179|	    xmlOutputBufferWrite(buf, 3, "ANY");
  432|    179|	    break;
  433|    355|	case XML_ELEMENT_TYPE_MIXED:
  ------------------
  |  Branch (433:2): [True: 355, False: 5.42k]
  ------------------
  434|  3.61k|	case XML_ELEMENT_TYPE_ELEMENT:
  ------------------
  |  Branch (434:2): [True: 3.25k, False: 2.52k]
  ------------------
  435|  3.61k|	    xmlBufDumpElementContent(buf, elem->content);
  436|  3.61k|	    break;
  437|      0|        default:
  ------------------
  |  Branch (437:9): [True: 0, False: 5.77k]
  ------------------
  438|       |            /* assert(0); */
  439|      0|            break;
  440|  5.77k|    }
  441|       |
  442|  5.77k|    xmlOutputBufferWrite(buf, 2, ">\n");
  443|  5.77k|}
xmlsave.c:xmlBufDumpElementContent:
  345|  3.61k|                         xmlElementContentPtr content) {
  346|  3.61k|    xmlElementContentPtr cur;
  347|       |
  348|  3.61k|    if (content == NULL) return;
  ------------------
  |  Branch (348:9): [True: 0, False: 3.61k]
  ------------------
  349|       |
  350|  3.61k|    xmlOutputBufferWrite(buf, 1, "(");
  351|  3.61k|    cur = content;
  352|       |
  353|   221k|    do {
  354|   221k|        if (cur == NULL) return;
  ------------------
  |  Branch (354:13): [True: 0, False: 221k]
  ------------------
  355|       |
  356|   221k|        switch (cur->type) {
  ------------------
  |  Branch (356:17): [True: 221k, False: 0]
  ------------------
  357|    355|            case XML_ELEMENT_CONTENT_PCDATA:
  ------------------
  |  Branch (357:13): [True: 355, False: 220k]
  ------------------
  358|    355|                xmlOutputBufferWrite(buf, 7, "#PCDATA");
  359|    355|                break;
  360|   112k|            case XML_ELEMENT_CONTENT_ELEMENT:
  ------------------
  |  Branch (360:13): [True: 112k, False: 109k]
  ------------------
  361|   112k|                if (cur->prefix != NULL) {
  ------------------
  |  Branch (361:21): [True: 2.44k, False: 109k]
  ------------------
  362|  2.44k|                    xmlOutputBufferWriteString(buf,
  363|  2.44k|                            (const char *) cur->prefix);
  364|  2.44k|                    xmlOutputBufferWrite(buf, 1, ":");
  365|  2.44k|                }
  366|   112k|                xmlOutputBufferWriteString(buf, (const char *) cur->name);
  367|   112k|                break;
  368|  61.2k|            case XML_ELEMENT_CONTENT_SEQ:
  ------------------
  |  Branch (368:13): [True: 61.2k, False: 160k]
  ------------------
  369|   108k|            case XML_ELEMENT_CONTENT_OR:
  ------------------
  |  Branch (369:13): [True: 47.6k, False: 173k]
  ------------------
  370|   108k|                if ((cur != content) &&
  ------------------
  |  Branch (370:21): [True: 107k, False: 1.11k]
  ------------------
  371|   107k|                    (cur->parent != NULL) &&
  ------------------
  |  Branch (371:21): [True: 107k, False: 0]
  ------------------
  372|   107k|                    ((cur->type != cur->parent->type) ||
  ------------------
  |  Branch (372:22): [True: 29.9k, False: 77.7k]
  ------------------
  373|  77.7k|                     (cur->ocur != XML_ELEMENT_CONTENT_ONCE)))
  ------------------
  |  Branch (373:22): [True: 8.37k, False: 69.3k]
  ------------------
  374|  38.3k|                    xmlOutputBufferWrite(buf, 1, "(");
  375|   108k|                cur = cur->c1;
  376|   108k|                continue;
  377|   221k|        }
  378|       |
  379|   221k|        while (cur != content) {
  ------------------
  |  Branch (379:16): [True: 217k, False: 3.61k]
  ------------------
  380|   217k|            xmlElementContentPtr parent = cur->parent;
  381|       |
  382|   217k|            if (parent == NULL) return;
  ------------------
  |  Branch (382:17): [True: 0, False: 217k]
  ------------------
  383|       |
  384|   217k|            if (((cur->type == XML_ELEMENT_CONTENT_OR) ||
  ------------------
  |  Branch (384:18): [True: 46.9k, False: 170k]
  ------------------
  385|   170k|                 (cur->type == XML_ELEMENT_CONTENT_SEQ)) &&
  ------------------
  |  Branch (385:18): [True: 60.7k, False: 109k]
  ------------------
  386|   107k|                ((cur->type != parent->type) ||
  ------------------
  |  Branch (386:18): [True: 29.9k, False: 77.7k]
  ------------------
  387|  77.7k|                 (cur->ocur != XML_ELEMENT_CONTENT_ONCE)))
  ------------------
  |  Branch (387:18): [True: 8.37k, False: 69.3k]
  ------------------
  388|  38.3k|                xmlOutputBufferWrite(buf, 1, ")");
  389|   217k|            xmlBufDumpElementOccur(buf, cur);
  390|       |
  391|   217k|            if (cur == parent->c1) {
  ------------------
  |  Branch (391:17): [True: 108k, False: 108k]
  ------------------
  392|   108k|                if (parent->type == XML_ELEMENT_CONTENT_SEQ)
  ------------------
  |  Branch (392:21): [True: 61.2k, False: 47.6k]
  ------------------
  393|  61.2k|                    xmlOutputBufferWrite(buf, 3, " , ");
  394|  47.6k|                else if (parent->type == XML_ELEMENT_CONTENT_OR)
  ------------------
  |  Branch (394:26): [True: 47.6k, False: 0]
  ------------------
  395|  47.6k|                    xmlOutputBufferWrite(buf, 3, " | ");
  396|       |
  397|   108k|                cur = parent->c2;
  398|   108k|                break;
  399|   108k|            }
  400|       |
  401|   108k|            cur = parent;
  402|   108k|        }
  403|   221k|    } while (cur != content);
  ------------------
  |  Branch (403:14): [True: 217k, False: 3.61k]
  ------------------
  404|       |
  405|  3.61k|    xmlOutputBufferWrite(buf, 1, ")");
  406|  3.61k|    xmlBufDumpElementOccur(buf, content);
  407|  3.61k|}
xmlsave.c:xmlBufDumpElementOccur:
  321|   221k|xmlBufDumpElementOccur(xmlOutputBufferPtr buf, xmlElementContentPtr cur) {
  322|   221k|    switch (cur->ocur) {
  ------------------
  |  Branch (322:13): [True: 221k, False: 0]
  ------------------
  323|   161k|        case XML_ELEMENT_CONTENT_ONCE:
  ------------------
  |  Branch (323:9): [True: 161k, False: 60.2k]
  ------------------
  324|   161k|            break;
  325|  27.3k|        case XML_ELEMENT_CONTENT_OPT:
  ------------------
  |  Branch (325:9): [True: 27.3k, False: 193k]
  ------------------
  326|  27.3k|            xmlOutputBufferWrite(buf, 1, "?");
  327|  27.3k|            break;
  328|  25.4k|        case XML_ELEMENT_CONTENT_MULT:
  ------------------
  |  Branch (328:9): [True: 25.4k, False: 195k]
  ------------------
  329|  25.4k|            xmlOutputBufferWrite(buf, 1, "*");
  330|  25.4k|            break;
  331|  7.41k|        case XML_ELEMENT_CONTENT_PLUS:
  ------------------
  |  Branch (331:9): [True: 7.41k, False: 213k]
  ------------------
  332|  7.41k|            xmlOutputBufferWrite(buf, 1, "+");
  333|  7.41k|            break;
  334|   221k|    }
  335|   221k|}
xmlsave.c:xmlSaveWriteAttributeDecl:
  471|  8.91k|xmlSaveWriteAttributeDecl(xmlSaveCtxtPtr ctxt, xmlAttributePtr attr) {
  472|  8.91k|    xmlOutputBufferPtr buf = ctxt->buf;
  473|       |
  474|  8.91k|    xmlOutputBufferWrite(buf, 10, "<!ATTLIST ");
  475|  8.91k|    xmlOutputBufferWriteString(buf, (const char *) attr->elem);
  476|  8.91k|    xmlOutputBufferWrite(buf, 1, " ");
  477|  8.91k|    if (attr->prefix != NULL) {
  ------------------
  |  Branch (477:9): [True: 2.91k, False: 6.00k]
  ------------------
  478|  2.91k|	xmlOutputBufferWriteString(buf, (const char *) attr->prefix);
  479|  2.91k|	xmlOutputBufferWrite(buf, 1, ":");
  480|  2.91k|    }
  481|  8.91k|    xmlOutputBufferWriteString(buf, (const char *) attr->name);
  482|       |
  483|  8.91k|    switch (attr->atype) {
  484|    598|	case XML_ATTRIBUTE_CDATA:
  ------------------
  |  Branch (484:2): [True: 598, False: 8.32k]
  ------------------
  485|    598|	    xmlOutputBufferWrite(buf, 6, " CDATA");
  486|    598|	    break;
  487|  1.17k|	case XML_ATTRIBUTE_ID:
  ------------------
  |  Branch (487:2): [True: 1.17k, False: 7.74k]
  ------------------
  488|  1.17k|	    xmlOutputBufferWrite(buf, 3, " ID");
  489|  1.17k|	    break;
  490|    427|	case XML_ATTRIBUTE_IDREF:
  ------------------
  |  Branch (490:2): [True: 427, False: 8.49k]
  ------------------
  491|    427|	    xmlOutputBufferWrite(buf, 6, " IDREF");
  492|    427|	    break;
  493|    227|	case XML_ATTRIBUTE_IDREFS:
  ------------------
  |  Branch (493:2): [True: 227, False: 8.69k]
  ------------------
  494|    227|	    xmlOutputBufferWrite(buf, 7, " IDREFS");
  495|    227|	    break;
  496|    506|	case XML_ATTRIBUTE_ENTITY:
  ------------------
  |  Branch (496:2): [True: 506, False: 8.41k]
  ------------------
  497|    506|	    xmlOutputBufferWrite(buf, 7, " ENTITY");
  498|    506|	    break;
  499|    447|	case XML_ATTRIBUTE_ENTITIES:
  ------------------
  |  Branch (499:2): [True: 447, False: 8.47k]
  ------------------
  500|    447|	    xmlOutputBufferWrite(buf, 9, " ENTITIES");
  501|    447|	    break;
  502|    235|	case XML_ATTRIBUTE_NMTOKEN:
  ------------------
  |  Branch (502:2): [True: 235, False: 8.68k]
  ------------------
  503|    235|	    xmlOutputBufferWrite(buf, 8, " NMTOKEN");
  504|    235|	    break;
  505|    240|	case XML_ATTRIBUTE_NMTOKENS:
  ------------------
  |  Branch (505:2): [True: 240, False: 8.67k]
  ------------------
  506|    240|	    xmlOutputBufferWrite(buf, 9, " NMTOKENS");
  507|    240|	    break;
  508|  4.74k|	case XML_ATTRIBUTE_ENUMERATION:
  ------------------
  |  Branch (508:2): [True: 4.74k, False: 4.17k]
  ------------------
  509|  4.74k|	    xmlOutputBufferWrite(buf, 2, " (");
  510|  4.74k|	    xmlBufDumpEnumeration(buf, attr->tree);
  511|  4.74k|	    break;
  512|    321|	case XML_ATTRIBUTE_NOTATION:
  ------------------
  |  Branch (512:2): [True: 321, False: 8.59k]
  ------------------
  513|    321|	    xmlOutputBufferWrite(buf, 11, " NOTATION (");
  514|    321|	    xmlBufDumpEnumeration(buf, attr->tree);
  515|    321|	    break;
  516|      0|	default:
  ------------------
  |  Branch (516:2): [True: 0, False: 8.91k]
  ------------------
  517|       |            /* assert(0); */
  518|      0|            break;
  519|  8.91k|    }
  520|       |
  521|  8.91k|    switch (attr->def) {
  522|  7.12k|	case XML_ATTRIBUTE_NONE:
  ------------------
  |  Branch (522:2): [True: 7.12k, False: 1.79k]
  ------------------
  523|  7.12k|	    break;
  524|    505|	case XML_ATTRIBUTE_REQUIRED:
  ------------------
  |  Branch (524:2): [True: 505, False: 8.41k]
  ------------------
  525|    505|	    xmlOutputBufferWrite(buf, 10, " #REQUIRED");
  526|    505|	    break;
  527|    582|	case XML_ATTRIBUTE_IMPLIED:
  ------------------
  |  Branch (527:2): [True: 582, False: 8.33k]
  ------------------
  528|    582|	    xmlOutputBufferWrite(buf, 9, " #IMPLIED");
  529|    582|	    break;
  530|    705|	case XML_ATTRIBUTE_FIXED:
  ------------------
  |  Branch (530:2): [True: 705, False: 8.21k]
  ------------------
  531|    705|	    xmlOutputBufferWrite(buf, 7, " #FIXED");
  532|    705|	    break;
  533|      0|	default:
  ------------------
  |  Branch (533:2): [True: 0, False: 8.91k]
  ------------------
  534|       |            /* assert(0); */
  535|      0|            break;
  536|  8.91k|    }
  537|       |
  538|  8.91k|    if (attr->defaultValue != NULL) {
  ------------------
  |  Branch (538:9): [True: 4.43k, False: 4.48k]
  ------------------
  539|  4.43k|        xmlOutputBufferWrite(buf, 2, " \"");
  540|  4.43k|        xmlSaveWriteText(ctxt, attr->defaultValue, XML_ESCAPE_ATTR);
  ------------------
  |  |   22|  4.43k|#define XML_ESCAPE_ATTR             (1u << 0)
  ------------------
  541|  4.43k|        xmlOutputBufferWrite(buf, 1, "\"");
  542|  4.43k|    }
  543|       |
  544|  8.91k|    xmlOutputBufferWrite(buf, 2, ">\n");
  545|  8.91k|}
xmlsave.c:xmlBufDumpEnumeration:
  452|  5.06k|xmlBufDumpEnumeration(xmlOutputBufferPtr buf, xmlEnumerationPtr cur) {
  453|  11.7k|    while (cur != NULL) {
  ------------------
  |  Branch (453:12): [True: 6.68k, False: 5.06k]
  ------------------
  454|  6.68k|        xmlOutputBufferWriteString(buf, (const char *) cur->name);
  455|  6.68k|        if (cur->next != NULL)
  ------------------
  |  Branch (455:13): [True: 1.61k, False: 5.06k]
  ------------------
  456|  1.61k|            xmlOutputBufferWrite(buf, 3, " | ");
  457|       |
  458|  6.68k|        cur = cur->next;
  459|  6.68k|    }
  460|       |
  461|  5.06k|    xmlOutputBufferWrite(buf, 1, ")");
  462|  5.06k|}
xmlsave.c:xmlBufDumpEntityDecl:
  592|  4.67k|xmlBufDumpEntityDecl(xmlOutputBufferPtr buf, xmlEntityPtr ent) {
  593|  4.67k|    if ((ent->etype == XML_INTERNAL_PARAMETER_ENTITY) ||
  ------------------
  |  Branch (593:9): [True: 471, False: 4.20k]
  ------------------
  594|  4.20k|        (ent->etype == XML_EXTERNAL_PARAMETER_ENTITY))
  ------------------
  |  Branch (594:9): [True: 465, False: 3.74k]
  ------------------
  595|    936|        xmlOutputBufferWrite(buf, 11, "<!ENTITY % ");
  596|  3.74k|    else
  597|  3.74k|        xmlOutputBufferWrite(buf, 9, "<!ENTITY ");
  598|  4.67k|    xmlOutputBufferWriteString(buf, (const char *) ent->name);
  599|  4.67k|    xmlOutputBufferWrite(buf, 1, " ");
  600|       |
  601|  4.67k|    if ((ent->etype == XML_EXTERNAL_GENERAL_PARSED_ENTITY) ||
  ------------------
  |  Branch (601:9): [True: 1.05k, False: 3.62k]
  ------------------
  602|  3.62k|        (ent->etype == XML_EXTERNAL_GENERAL_UNPARSED_ENTITY) ||
  ------------------
  |  Branch (602:9): [True: 794, False: 2.83k]
  ------------------
  603|  2.83k|        (ent->etype == XML_EXTERNAL_PARAMETER_ENTITY)) {
  ------------------
  |  Branch (603:9): [True: 465, False: 2.36k]
  ------------------
  604|  2.31k|        if (ent->ExternalID != NULL) {
  ------------------
  |  Branch (604:13): [True: 874, False: 1.43k]
  ------------------
  605|    874|             xmlOutputBufferWrite(buf, 7, "PUBLIC ");
  606|    874|             xmlOutputBufferWriteQuotedString(buf, ent->ExternalID);
  607|    874|             xmlOutputBufferWrite(buf, 1, " ");
  608|  1.43k|        } else {
  609|  1.43k|             xmlOutputBufferWrite(buf, 7, "SYSTEM ");
  610|  1.43k|        }
  611|  2.31k|        xmlOutputBufferWriteQuotedString(buf, ent->SystemID);
  612|  2.31k|    }
  613|       |
  614|  4.67k|    if (ent->etype == XML_EXTERNAL_GENERAL_UNPARSED_ENTITY) {
  ------------------
  |  Branch (614:9): [True: 794, False: 3.88k]
  ------------------
  615|    794|        if (ent->content != NULL) { /* Should be true ! */
  ------------------
  |  Branch (615:13): [True: 587, False: 207]
  ------------------
  616|    587|            xmlOutputBufferWrite(buf, 7, " NDATA ");
  617|    587|            if (ent->orig != NULL)
  ------------------
  |  Branch (617:17): [True: 66, False: 521]
  ------------------
  618|     66|                xmlOutputBufferWriteString(buf, (const char *) ent->orig);
  619|    521|            else
  620|    521|                xmlOutputBufferWriteString(buf, (const char *) ent->content);
  621|    587|        }
  622|    794|    }
  623|       |
  624|  4.67k|    if ((ent->etype == XML_INTERNAL_GENERAL_ENTITY) ||
  ------------------
  |  Branch (624:9): [True: 1.89k, False: 2.78k]
  ------------------
  625|  2.78k|        (ent->etype == XML_INTERNAL_PARAMETER_ENTITY)) {
  ------------------
  |  Branch (625:9): [True: 471, False: 2.31k]
  ------------------
  626|       |        /*
  627|       |         * We could save the original quote character and avoid
  628|       |         * calling xmlOutputBufferWriteQuotedString here.
  629|       |         */
  630|  2.36k|        if (ent->orig != NULL)
  ------------------
  |  Branch (630:13): [True: 2.32k, False: 37]
  ------------------
  631|  2.32k|            xmlOutputBufferWriteQuotedString(buf, ent->orig);
  632|     37|        else
  633|     37|            xmlBufDumpEntityContent(buf, ent->content);
  634|  2.36k|    }
  635|       |
  636|  4.67k|    xmlOutputBufferWrite(buf, 2, ">\n");
  637|  4.67k|}
xmlsave.c:xmlBufDumpEntityContent:
  555|     37|xmlBufDumpEntityContent(xmlOutputBufferPtr buf, const xmlChar *content) {
  556|     37|    const char * base, *cur;
  557|       |
  558|     37|    if (content == NULL)
  ------------------
  |  Branch (558:9): [True: 0, False: 37]
  ------------------
  559|      0|        return;
  560|       |
  561|     37|    xmlOutputBufferWrite(buf, 1, "\"");
  562|     37|    base = cur = (const char *) content;
  563|    487|    while (*cur != 0) {
  ------------------
  |  Branch (563:12): [True: 450, False: 37]
  ------------------
  564|    450|        if (*cur == '"') {
  ------------------
  |  Branch (564:13): [True: 0, False: 450]
  ------------------
  565|      0|            if (base != cur)
  ------------------
  |  Branch (565:17): [True: 0, False: 0]
  ------------------
  566|      0|                xmlOutputBufferWrite(buf, cur - base, base);
  567|      0|            xmlOutputBufferWrite(buf, 6, "&quot;");
  568|      0|            cur++;
  569|      0|            base = cur;
  570|    450|        } else if (*cur == '%') {
  ------------------
  |  Branch (570:20): [True: 0, False: 450]
  ------------------
  571|      0|            if (base != cur)
  ------------------
  |  Branch (571:17): [True: 0, False: 0]
  ------------------
  572|      0|                xmlOutputBufferWrite(buf, cur - base, base);
  573|      0|            xmlOutputBufferWrite(buf, 6, "&#x25;");
  574|      0|            cur++;
  575|      0|            base = cur;
  576|    450|        } else {
  577|    450|            cur++;
  578|    450|        }
  579|    450|    }
  580|     37|    if (base != cur)
  ------------------
  |  Branch (580:9): [True: 37, False: 0]
  ------------------
  581|     37|        xmlOutputBufferWrite(buf, cur - base, base);
  582|     37|    xmlOutputBufferWrite(buf, 1, "\"");
  583|     37|}
xmlsave.c:xmlNsListDumpOutputCtxt:
  799|   284k|xmlNsListDumpOutputCtxt(xmlSaveCtxtPtr ctxt, xmlNsPtr cur) {
  800|   583k|    while (cur != NULL) {
  ------------------
  |  Branch (800:12): [True: 299k, False: 284k]
  ------------------
  801|   299k|        xmlNsDumpOutput(ctxt->buf, cur, ctxt);
  802|   299k|	cur = cur->next;
  803|   299k|    }
  804|   284k|}
xmlsave.c:xhtmlAttrListDumpOutput:
 1421|  7.54k|xhtmlAttrListDumpOutput(xmlSaveCtxtPtr ctxt, xmlAttrPtr cur) {
 1422|  7.54k|    xmlAttrPtr xml_lang = NULL;
 1423|  7.54k|    xmlAttrPtr lang = NULL;
 1424|  7.54k|    xmlAttrPtr name = NULL;
 1425|  7.54k|    xmlAttrPtr id = NULL;
 1426|  7.54k|    xmlNodePtr parent;
 1427|  7.54k|    xmlOutputBufferPtr buf;
 1428|       |
 1429|  7.54k|    if (cur == NULL) return;
  ------------------
  |  Branch (1429:9): [True: 0, False: 7.54k]
  ------------------
 1430|  7.54k|    buf = ctxt->buf;
 1431|  7.54k|    parent = cur->parent;
 1432|  24.2k|    while (cur != NULL) {
  ------------------
  |  Branch (1432:12): [True: 16.6k, False: 7.54k]
  ------------------
 1433|  16.6k|	if ((cur->ns == NULL) && (xmlStrEqual(cur->name, BAD_CAST "id")))
  ------------------
  |  |   34|  15.6k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (1433:6): [True: 15.6k, False: 1.04k]
  |  Branch (1433:27): [True: 548, False: 15.0k]
  ------------------
 1434|    548|	    id = cur;
 1435|  16.1k|	else
 1436|  16.1k|	if ((cur->ns == NULL) && (xmlStrEqual(cur->name, BAD_CAST "name")))
  ------------------
  |  |   34|  15.0k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (1436:6): [True: 15.0k, False: 1.04k]
  |  Branch (1436:27): [True: 1.97k, False: 13.1k]
  ------------------
 1437|  1.97k|	    name = cur;
 1438|  14.1k|	else
 1439|  14.1k|	if ((cur->ns == NULL) && (xmlStrEqual(cur->name, BAD_CAST "lang")))
  ------------------
  |  |   34|  13.1k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (1439:6): [True: 13.1k, False: 1.04k]
  |  Branch (1439:27): [True: 511, False: 12.6k]
  ------------------
 1440|    511|	    lang = cur;
 1441|  13.6k|	else
 1442|  13.6k|	if ((cur->ns != NULL) && (xmlStrEqual(cur->name, BAD_CAST "lang")) &&
  ------------------
  |  |   34|  1.04k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (1442:6): [True: 1.04k, False: 12.6k]
  |  Branch (1442:27): [True: 808, False: 235]
  ------------------
 1443|    808|	    (xmlStrEqual(cur->ns->prefix, BAD_CAST "xml")))
  ------------------
  |  |   34|    808|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (1443:6): [True: 611, False: 197]
  ------------------
 1444|    611|	    xml_lang = cur;
 1445|  16.6k|        xmlAttrDumpOutput(ctxt, cur);
 1446|  16.6k|	cur = cur->next;
 1447|  16.6k|    }
 1448|       |    /*
 1449|       |     * C.8
 1450|       |     */
 1451|  7.54k|    if ((name != NULL) && (id == NULL)) {
  ------------------
  |  Branch (1451:9): [True: 1.97k, False: 5.57k]
  |  Branch (1451:27): [True: 1.76k, False: 204]
  ------------------
 1452|  1.76k|	if ((parent != NULL) && (parent->name != NULL) &&
  ------------------
  |  Branch (1452:6): [True: 1.76k, False: 0]
  |  Branch (1452:26): [True: 1.76k, False: 0]
  ------------------
 1453|  1.76k|	    ((xmlStrEqual(parent->name, BAD_CAST "a")) ||
  ------------------
  |  |   34|  1.76k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (1453:7): [True: 201, False: 1.56k]
  ------------------
 1454|  1.56k|	     (xmlStrEqual(parent->name, BAD_CAST "p")) ||
  ------------------
  |  |   34|  1.56k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (1454:7): [True: 72, False: 1.49k]
  ------------------
 1455|  1.49k|	     (xmlStrEqual(parent->name, BAD_CAST "div")) ||
  ------------------
  |  |   34|  1.49k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (1455:7): [True: 217, False: 1.27k]
  ------------------
 1456|  1.27k|	     (xmlStrEqual(parent->name, BAD_CAST "img")) ||
  ------------------
  |  |   34|  1.27k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (1456:7): [True: 224, False: 1.05k]
  ------------------
 1457|  1.05k|	     (xmlStrEqual(parent->name, BAD_CAST "map")) ||
  ------------------
  |  |   34|  1.05k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (1457:7): [True: 198, False: 857]
  ------------------
 1458|    857|	     (xmlStrEqual(parent->name, BAD_CAST "applet")) ||
  ------------------
  |  |   34|    857|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (1458:7): [True: 198, False: 659]
  ------------------
 1459|    659|	     (xmlStrEqual(parent->name, BAD_CAST "form")) ||
  ------------------
  |  |   34|    659|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (1459:7): [True: 205, False: 454]
  ------------------
 1460|    454|	     (xmlStrEqual(parent->name, BAD_CAST "frame")) ||
  ------------------
  |  |   34|    454|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (1460:7): [True: 46, False: 408]
  ------------------
 1461|  1.56k|	     (xmlStrEqual(parent->name, BAD_CAST "iframe")))) {
  ------------------
  |  |   34|    408|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (1461:7): [True: 208, False: 200]
  ------------------
 1462|  1.56k|	    xmlOutputBufferWrite(buf, 5, " id=\"");
 1463|  1.56k|            xmlSaveWriteAttrContent(ctxt, name);
 1464|  1.56k|	    xmlOutputBufferWrite(buf, 1, "\"");
 1465|  1.56k|	}
 1466|  1.76k|    }
 1467|       |    /*
 1468|       |     * C.7.
 1469|       |     */
 1470|  7.54k|    if ((lang != NULL) && (xml_lang == NULL)) {
  ------------------
  |  Branch (1470:9): [True: 509, False: 7.03k]
  |  Branch (1470:27): [True: 300, False: 209]
  ------------------
 1471|    300|	xmlOutputBufferWrite(buf, 11, " xml:lang=\"");
 1472|    300|        xmlSaveWriteAttrContent(ctxt, lang);
 1473|    300|	xmlOutputBufferWrite(buf, 1, "\"");
 1474|    300|    } else
 1475|  7.24k|    if ((xml_lang != NULL) && (lang == NULL)) {
  ------------------
  |  Branch (1475:9): [True: 431, False: 6.81k]
  |  Branch (1475:31): [True: 222, False: 209]
  ------------------
 1476|    222|	xmlOutputBufferWrite(buf, 7, " lang=\"");
 1477|    222|        xmlSaveWriteAttrContent(ctxt, xml_lang);
 1478|    222|	xmlOutputBufferWrite(buf, 1, "\"");
 1479|    222|    }
 1480|  7.54k|}
xmlsave.c:xmlSaveWriteAttrContent:
  241|   181k|{
  242|   181k|    xmlNodePtr children;
  243|   181k|    xmlOutputBufferPtr buf = ctxt->buf;
  244|       |
  245|   181k|    children = attr->children;
  246|   340k|    while (children != NULL) {
  ------------------
  |  Branch (246:12): [True: 159k, False: 181k]
  ------------------
  247|   159k|        switch (children->type) {
  248|   159k|            case XML_TEXT_NODE:
  ------------------
  |  Branch (248:13): [True: 159k, False: 384]
  ------------------
  249|   159k|	        xmlSaveWriteText(ctxt, children->content, XML_ESCAPE_ATTR);
  ------------------
  |  |   22|   159k|#define XML_ESCAPE_ATTR             (1u << 0)
  ------------------
  250|   159k|		break;
  251|    384|            case XML_ENTITY_REF_NODE:
  ------------------
  |  Branch (251:13): [True: 384, False: 159k]
  ------------------
  252|    384|                xmlOutputBufferWrite(buf, 1, "&");
  253|    384|                xmlOutputBufferWriteString(buf, (const char *) children->name);
  254|    384|                xmlOutputBufferWrite(buf, 1, ";");
  255|    384|                break;
  256|      0|            default:
  ------------------
  |  Branch (256:13): [True: 0, False: 159k]
  ------------------
  257|       |                /* should not happen unless we have a badly built tree */
  258|      0|                break;
  259|   159k|        }
  260|   159k|        children = children->next;
  261|   159k|    }
  262|   181k|}
xmlsave.c:xhtmlIsEmpty:
 1356|  12.4k|xhtmlIsEmpty(xmlNodePtr node) {
 1357|  12.4k|    if (node == NULL)
  ------------------
  |  Branch (1357:9): [True: 0, False: 12.4k]
  ------------------
 1358|      0|	return(-1);
 1359|  12.4k|    if (node->type != XML_ELEMENT_NODE)
  ------------------
  |  Branch (1359:9): [True: 0, False: 12.4k]
  ------------------
 1360|      0|	return(0);
 1361|  12.4k|    if ((node->ns != NULL) && (!xmlStrEqual(node->ns->href, XHTML_NS_NAME)))
  ------------------
  |  |   33|    882|#define XHTML_NS_NAME BAD_CAST "http://www.w3.org/1999/xhtml"
  |  |  ------------------
  |  |  |  |   34|    882|#define BAD_CAST (xmlChar *)
  |  |  ------------------
  ------------------
  |  Branch (1361:9): [True: 882, False: 11.5k]
  |  Branch (1361:31): [True: 671, False: 211]
  ------------------
 1362|    671|	return(0);
 1363|  11.7k|    if (node->children != NULL)
  ------------------
  |  Branch (1363:9): [True: 0, False: 11.7k]
  ------------------
 1364|      0|	return(0);
 1365|  11.7k|    switch (node->name ? node->name[0] : 0) {
  ------------------
  |  Branch (1365:13): [True: 11.7k, False: 0]
  |  Branch (1365:13): [True: 9.30k, False: 2.43k]
  ------------------
 1366|  1.81k|	case 'a':
  ------------------
  |  Branch (1366:2): [True: 1.81k, False: 9.92k]
  ------------------
 1367|  1.81k|	    if (xmlStrEqual(node->name, BAD_CAST "area"))
  ------------------
  |  |   34|  1.81k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (1367:10): [True: 209, False: 1.60k]
  ------------------
 1368|    209|		return(1);
 1369|  1.60k|	    return(0);
 1370|    903|	case 'b':
  ------------------
  |  Branch (1370:2): [True: 903, False: 10.8k]
  ------------------
 1371|    903|	    if (xmlStrEqual(node->name, BAD_CAST "br"))
  ------------------
  |  |   34|    903|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (1371:10): [True: 69, False: 834]
  ------------------
 1372|     69|		return(1);
 1373|    834|	    if (xmlStrEqual(node->name, BAD_CAST "base"))
  ------------------
  |  |   34|    834|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (1373:10): [True: 293, False: 541]
  ------------------
 1374|    293|		return(1);
 1375|    541|	    if (xmlStrEqual(node->name, BAD_CAST "basefont"))
  ------------------
  |  |   34|    541|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (1375:10): [True: 209, False: 332]
  ------------------
 1376|    209|		return(1);
 1377|    332|	    return(0);
 1378|    659|	case 'c':
  ------------------
  |  Branch (1378:2): [True: 659, False: 11.0k]
  ------------------
 1379|    659|	    if (xmlStrEqual(node->name, BAD_CAST "col"))
  ------------------
  |  |   34|    659|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (1379:10): [True: 220, False: 439]
  ------------------
 1380|    220|		return(1);
 1381|    439|	    return(0);
 1382|    729|	case 'f':
  ------------------
  |  Branch (1382:2): [True: 729, False: 11.0k]
  ------------------
 1383|    729|	    if (xmlStrEqual(node->name, BAD_CAST "frame"))
  ------------------
  |  |   34|    729|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (1383:10): [True: 209, False: 520]
  ------------------
 1384|    209|		return(1);
 1385|    520|	    return(0);
 1386|    818|	case 'h':
  ------------------
  |  Branch (1386:2): [True: 818, False: 10.9k]
  ------------------
 1387|    818|	    if (xmlStrEqual(node->name, BAD_CAST "hr"))
  ------------------
  |  |   34|    818|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (1387:10): [True: 205, False: 613]
  ------------------
 1388|    205|		return(1);
 1389|    613|	    return(0);
 1390|  1.82k|	case 'i':
  ------------------
  |  Branch (1390:2): [True: 1.82k, False: 9.91k]
  ------------------
 1391|  1.82k|	    if (xmlStrEqual(node->name, BAD_CAST "img"))
  ------------------
  |  |   34|  1.82k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (1391:10): [True: 1.08k, False: 741]
  ------------------
 1392|  1.08k|		return(1);
 1393|    741|	    if (xmlStrEqual(node->name, BAD_CAST "input"))
  ------------------
  |  |   34|    741|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (1393:10): [True: 220, False: 521]
  ------------------
 1394|    220|		return(1);
 1395|    521|	    if (xmlStrEqual(node->name, BAD_CAST "isindex"))
  ------------------
  |  |   34|    521|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (1395:10): [True: 224, False: 297]
  ------------------
 1396|    224|		return(1);
 1397|    297|	    return(0);
 1398|    319|	case 'l':
  ------------------
  |  Branch (1398:2): [True: 319, False: 11.4k]
  ------------------
 1399|    319|	    if (xmlStrEqual(node->name, BAD_CAST "link"))
  ------------------
  |  |   34|    319|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (1399:10): [True: 79, False: 240]
  ------------------
 1400|     79|		return(1);
 1401|    240|	    return(0);
 1402|  1.25k|	case 'm':
  ------------------
  |  Branch (1402:2): [True: 1.25k, False: 10.4k]
  ------------------
 1403|  1.25k|	    if (xmlStrEqual(node->name, BAD_CAST "meta"))
  ------------------
  |  |   34|  1.25k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (1403:10): [True: 285, False: 969]
  ------------------
 1404|    285|		return(1);
 1405|    969|	    return(0);
 1406|    985|	case 'p':
  ------------------
  |  Branch (1406:2): [True: 985, False: 10.7k]
  ------------------
 1407|    985|	    if (xmlStrEqual(node->name, BAD_CAST "param"))
  ------------------
  |  |   34|    985|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (1407:10): [True: 208, False: 777]
  ------------------
 1408|    208|		return(1);
 1409|    777|	    return(0);
 1410|  11.7k|    }
 1411|  2.43k|    return(0);
 1412|  11.7k|}
xmlsave.c:xmlSaveWriteText:
  226|   471k|xmlSaveWriteText(xmlSaveCtxt *ctxt, const xmlChar *text, unsigned flags) {
  227|   471k|    if (ctxt->encoding == NULL)
  ------------------
  |  Branch (227:9): [True: 0, False: 471k]
  ------------------
  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|   471k|}
xmlsave.c:xmlAttrDumpOutput:
  881|   179k|xmlAttrDumpOutput(xmlSaveCtxtPtr ctxt, xmlAttrPtr cur) {
  882|   179k|    xmlOutputBufferPtr buf;
  883|       |
  884|   179k|    if (cur == NULL) return;
  ------------------
  |  Branch (884:9): [True: 0, False: 179k]
  ------------------
  885|   179k|    buf = ctxt->buf;
  886|   179k|    if (buf == NULL) return;
  ------------------
  |  Branch (886:9): [True: 0, False: 179k]
  ------------------
  887|   179k|    if (ctxt->format == 2)
  ------------------
  |  Branch (887:9): [True: 0, False: 179k]
  ------------------
  888|      0|        xmlOutputBufferWriteWSNonSig(ctxt, 2);
  889|   179k|    else
  890|   179k|        xmlOutputBufferWrite(buf, 1, " ");
  891|   179k|    if ((cur->ns != NULL) && (cur->ns->prefix != NULL)) {
  ------------------
  |  Branch (891:9): [True: 19.0k, False: 160k]
  |  Branch (891:30): [True: 18.6k, False: 382]
  ------------------
  892|  18.6k|        xmlOutputBufferWriteString(buf, (const char *)cur->ns->prefix);
  893|  18.6k|	xmlOutputBufferWrite(buf, 1, ":");
  894|  18.6k|    }
  895|   179k|    xmlOutputBufferWriteString(buf, (const char *)cur->name);
  896|   179k|    xmlOutputBufferWrite(buf, 2, "=\"");
  897|   179k|#ifdef LIBXML_HTML_ENABLED
  898|   179k|    if ((ctxt->options & XML_SAVE_XHTML) &&
  ------------------
  |  Branch (898:9): [True: 16.6k, False: 162k]
  ------------------
  899|  16.6k|        (cur->ns == NULL) &&
  ------------------
  |  Branch (899:9): [True: 15.6k, False: 1.04k]
  ------------------
  900|  15.6k|        ((cur->children == NULL) ||
  ------------------
  |  Branch (900:10): [True: 7.93k, False: 7.70k]
  ------------------
  901|  7.70k|         (cur->children->content == NULL) ||
  ------------------
  |  Branch (901:10): [True: 0, False: 7.70k]
  ------------------
  902|  7.70k|         (cur->children->content[0] == 0)) &&
  ------------------
  |  Branch (902:10): [True: 5.37k, False: 2.32k]
  ------------------
  903|  13.3k|        (htmlIsBooleanAttr(cur->name))) {
  ------------------
  |  Branch (903:9): [True: 232, False: 13.0k]
  ------------------
  904|    232|        xmlOutputBufferWriteString(buf, (const char *) cur->name);
  905|    232|    } else
  906|   178k|#endif
  907|   178k|    {
  908|   178k|        xmlSaveWriteAttrContent(ctxt, cur);
  909|   178k|    }
  910|   179k|    xmlOutputBufferWrite(buf, 1, "\"");
  911|   179k|}
xmlsave.c:xmlNodeDumpOutputInternal:
  961|  46.5k|xmlNodeDumpOutputInternal(xmlSaveCtxtPtr ctxt, xmlNodePtr cur) {
  962|  46.5k|    int format = ctxt->format;
  963|  46.5k|    xmlNodePtr tmp, root, unformattedNode = NULL, parent;
  964|  46.5k|    xmlAttrPtr attr;
  965|  46.5k|    xmlChar *start, *end;
  966|  46.5k|    xmlOutputBufferPtr buf;
  967|       |
  968|  46.5k|    if (cur == NULL) return;
  ------------------
  |  Branch (968:9): [True: 0, False: 46.5k]
  ------------------
  969|  46.5k|    buf = ctxt->buf;
  970|       |
  971|  46.5k|    root = cur;
  972|  46.5k|    parent = cur->parent;
  973|  1.30M|    while (1) {
  ------------------
  |  Branch (973:12): [True: 1.30M, Folded]
  ------------------
  974|  1.30M|        switch (cur->type) {
  975|    914|        case XML_DOCUMENT_NODE:
  ------------------
  |  Branch (975:9): [True: 914, False: 1.30M]
  ------------------
  976|    914|        case XML_HTML_DOCUMENT_NODE:
  ------------------
  |  Branch (976:9): [True: 0, False: 1.30M]
  ------------------
  977|    914|	    xmlSaveDocInternal(ctxt, (xmlDocPtr) cur, ctxt->encoding);
  978|    914|	    break;
  979|       |
  980|  10.9k|        case XML_DTD_NODE:
  ------------------
  |  Branch (980:9): [True: 10.9k, False: 1.29M]
  ------------------
  981|  10.9k|            xmlDtdDumpOutput(ctxt, (xmlDtdPtr) cur);
  982|  10.9k|            break;
  983|       |
  984|      0|        case XML_DOCUMENT_FRAG_NODE:
  ------------------
  |  Branch (984:9): [True: 0, False: 1.30M]
  ------------------
  985|       |            /* Always validate cur->parent when descending. */
  986|      0|            if ((cur->parent == parent) && (cur->children != NULL)) {
  ------------------
  |  Branch (986:17): [True: 0, False: 0]
  |  Branch (986:44): [True: 0, False: 0]
  ------------------
  987|      0|                parent = cur;
  988|      0|                cur = cur->children;
  989|      0|                continue;
  990|      0|            }
  991|      0|	    break;
  992|       |
  993|  5.77k|        case XML_ELEMENT_DECL:
  ------------------
  |  Branch (993:9): [True: 5.77k, False: 1.30M]
  ------------------
  994|  5.77k|            xmlBufDumpElementDecl(buf, (xmlElementPtr) cur);
  995|  5.77k|            break;
  996|       |
  997|  8.91k|        case XML_ATTRIBUTE_DECL:
  ------------------
  |  Branch (997:9): [True: 8.91k, False: 1.29M]
  ------------------
  998|  8.91k|            xmlSaveWriteAttributeDecl(ctxt, (xmlAttributePtr) cur);
  999|  8.91k|            break;
 1000|       |
 1001|  4.67k|        case XML_ENTITY_DECL:
  ------------------
  |  Branch (1001:9): [True: 4.67k, False: 1.30M]
  ------------------
 1002|  4.67k|            xmlBufDumpEntityDecl(buf, (xmlEntityPtr) cur);
 1003|  4.67k|            break;
 1004|       |
 1005|   689k|        case XML_ELEMENT_NODE:
  ------------------
  |  Branch (1005:9): [True: 689k, False: 618k]
  ------------------
 1006|   689k|	    if ((cur != root) && (ctxt->format == 1))
  ------------------
  |  Branch (1006:10): [True: 684k, False: 4.98k]
  |  Branch (1006:27): [True: 0, False: 684k]
  ------------------
 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|   689k|            if ((cur->parent != parent) && (cur->children != NULL)) {
  ------------------
  |  Branch (1014:17): [True: 0, False: 689k]
  |  Branch (1014:44): [True: 0, False: 0]
  ------------------
 1015|      0|                xmlNodeDumpOutputInternal(ctxt, cur);
 1016|      0|                break;
 1017|      0|            }
 1018|       |
 1019|   689k|            xmlOutputBufferWrite(buf, 1, "<");
 1020|   689k|            if ((cur->ns != NULL) && (cur->ns->prefix != NULL)) {
  ------------------
  |  Branch (1020:17): [True: 149k, False: 539k]
  |  Branch (1020:38): [True: 142k, False: 6.88k]
  ------------------
 1021|   142k|                xmlOutputBufferWriteString(buf, (const char *)cur->ns->prefix);
 1022|   142k|                xmlOutputBufferWrite(buf, 1, ":");
 1023|   142k|            }
 1024|   689k|            xmlOutputBufferWriteString(buf, (const char *)cur->name);
 1025|   689k|            if (cur->nsDef)
  ------------------
  |  Branch (1025:17): [True: 281k, False: 408k]
  ------------------
 1026|   281k|                xmlNsListDumpOutputCtxt(ctxt, cur->nsDef);
 1027|   852k|            for (attr = cur->properties; attr != NULL; attr = attr->next)
  ------------------
  |  Branch (1027:42): [True: 162k, False: 689k]
  ------------------
 1028|   162k|                xmlAttrDumpOutput(ctxt, attr);
 1029|       |
 1030|   689k|            if (cur->children == NULL) {
  ------------------
  |  Branch (1030:17): [True: 133k, False: 556k]
  ------------------
 1031|   133k|                if ((ctxt->options & XML_SAVE_NO_EMPTY) == 0) {
  ------------------
  |  Branch (1031:21): [True: 133k, False: 0]
  ------------------
 1032|   133k|                    if (ctxt->format == 2)
  ------------------
  |  Branch (1032:25): [True: 0, False: 133k]
  ------------------
 1033|      0|                        xmlOutputBufferWriteWSNonSig(ctxt, 0);
 1034|   133k|                    xmlOutputBufferWrite(buf, 2, "/>");
 1035|   133k|                } 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|   556k|            } else {
 1050|   556k|                if (ctxt->format == 1) {
  ------------------
  |  Branch (1050:21): [True: 0, False: 556k]
  ------------------
 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|   556k|                if (ctxt->format == 2)
  ------------------
  |  Branch (1063:21): [True: 0, False: 556k]
  ------------------
 1064|      0|                    xmlOutputBufferWriteWSNonSig(ctxt, 1);
 1065|   556k|                xmlOutputBufferWrite(buf, 1, ">");
 1066|   556k|                if (ctxt->format == 1) xmlOutputBufferWrite(buf, 1, "\n");
  ------------------
  |  Branch (1066:21): [True: 0, False: 556k]
  ------------------
 1067|   556k|                if (ctxt->level >= 0) ctxt->level++;
  ------------------
  |  Branch (1067:21): [True: 556k, False: 0]
  ------------------
 1068|   556k|                parent = cur;
 1069|   556k|                cur = cur->children;
 1070|   556k|                continue;
 1071|   556k|            }
 1072|       |
 1073|   133k|            break;
 1074|       |
 1075|   297k|        case XML_TEXT_NODE:
  ------------------
  |  Branch (1075:9): [True: 297k, False: 1.01M]
  ------------------
 1076|   297k|	    if (cur->content == NULL)
  ------------------
  |  Branch (1076:10): [True: 251, False: 297k]
  ------------------
 1077|    251|                break;
 1078|   297k|	    if (cur->name != xmlStringTextNoenc) {
  ------------------
  |  Branch (1078:10): [True: 297k, False: 0]
  ------------------
 1079|   297k|                if (ctxt->escape)
  ------------------
  |  Branch (1079:21): [True: 0, False: 297k]
  ------------------
 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|   297k|                else
 1087|   297k|                    xmlSaveWriteText(ctxt, cur->content, /* flags */ 0);
 1088|   297k|	    } else {
 1089|       |		/*
 1090|       |		 * Disable escaping, needed for XSLT
 1091|       |		 */
 1092|      0|		xmlOutputBufferWriteString(buf, (const char *) cur->content);
 1093|      0|	    }
 1094|   297k|	    break;
 1095|       |
 1096|    759|        case XML_PI_NODE:
  ------------------
  |  Branch (1096:9): [True: 759, False: 1.30M]
  ------------------
 1097|    759|	    if ((cur != root) && (ctxt->format == 1))
  ------------------
  |  Branch (1097:10): [True: 301, False: 458]
  |  Branch (1097:27): [True: 0, False: 301]
  ------------------
 1098|      0|                xmlSaveWriteIndent(ctxt, 0);
 1099|       |
 1100|    759|            if (cur->content != NULL) {
  ------------------
  |  Branch (1100:17): [True: 214, False: 545]
  ------------------
 1101|    214|                xmlOutputBufferWrite(buf, 2, "<?");
 1102|    214|                xmlOutputBufferWriteString(buf, (const char *)cur->name);
 1103|    214|                if (cur->content != NULL) {
  ------------------
  |  Branch (1103:21): [True: 214, False: 0]
  ------------------
 1104|    214|                    if (ctxt->format == 2)
  ------------------
  |  Branch (1104:25): [True: 0, False: 214]
  ------------------
 1105|      0|                        xmlOutputBufferWriteWSNonSig(ctxt, 0);
 1106|    214|                    else
 1107|    214|                        xmlOutputBufferWrite(buf, 1, " ");
 1108|    214|                    xmlOutputBufferWriteString(buf,
 1109|    214|                            (const char *)cur->content);
 1110|    214|                }
 1111|    214|                xmlOutputBufferWrite(buf, 2, "?>");
 1112|    545|            } else {
 1113|    545|                xmlOutputBufferWrite(buf, 2, "<?");
 1114|    545|                xmlOutputBufferWriteString(buf, (const char *)cur->name);
 1115|    545|                if (ctxt->format == 2)
  ------------------
  |  Branch (1115:21): [True: 0, False: 545]
  ------------------
 1116|      0|                    xmlOutputBufferWriteWSNonSig(ctxt, 0);
 1117|    545|                xmlOutputBufferWrite(buf, 2, "?>");
 1118|    545|            }
 1119|    759|            break;
 1120|       |
 1121|  7.12k|        case XML_COMMENT_NODE:
  ------------------
  |  Branch (1121:9): [True: 7.12k, False: 1.30M]
  ------------------
 1122|  7.12k|	    if ((cur != root) && (ctxt->format == 1))
  ------------------
  |  Branch (1122:10): [True: 4.35k, False: 2.76k]
  |  Branch (1122:27): [True: 0, False: 4.35k]
  ------------------
 1123|      0|                xmlSaveWriteIndent(ctxt, 0);
 1124|       |
 1125|  7.12k|            if (cur->content != NULL) {
  ------------------
  |  Branch (1125:17): [True: 7.12k, False: 0]
  ------------------
 1126|  7.12k|                xmlOutputBufferWrite(buf, 4, "<!--");
 1127|  7.12k|                xmlOutputBufferWriteString(buf, (const char *)cur->content);
 1128|  7.12k|                xmlOutputBufferWrite(buf, 3, "-->");
 1129|  7.12k|            }
 1130|  7.12k|            break;
 1131|       |
 1132|    615|        case XML_ENTITY_REF_NODE:
  ------------------
  |  Branch (1132:9): [True: 615, False: 1.30M]
  ------------------
 1133|    615|            xmlOutputBufferWrite(buf, 1, "&");
 1134|    615|            xmlOutputBufferWriteString(buf, (const char *)cur->name);
 1135|    615|            xmlOutputBufferWrite(buf, 1, ";");
 1136|    615|            break;
 1137|       |
 1138|  1.11k|        case XML_CDATA_SECTION_NODE:
  ------------------
  |  Branch (1138:9): [True: 1.11k, False: 1.30M]
  ------------------
 1139|  1.11k|            if (cur->content == NULL || *cur->content == '\0') {
  ------------------
  |  Branch (1139:17): [True: 0, False: 1.11k]
  |  Branch (1139:41): [True: 229, False: 888]
  ------------------
 1140|    229|                xmlOutputBufferWrite(buf, 12, "<![CDATA[]]>");
 1141|    888|            } else {
 1142|    888|                start = end = cur->content;
 1143|  15.9k|                while (*end != '\0') {
  ------------------
  |  Branch (1143:24): [True: 15.0k, False: 888]
  ------------------
 1144|  15.0k|                    if ((*end == ']') && (*(end + 1) == ']') &&
  ------------------
  |  Branch (1144:25): [True: 619, False: 14.4k]
  |  Branch (1144:42): [True: 307, False: 312]
  ------------------
 1145|    307|                        (*(end + 2) == '>')) {
  ------------------
  |  Branch (1145:25): [True: 0, False: 307]
  ------------------
 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|  15.0k|                    end++;
 1154|  15.0k|                }
 1155|    888|                if (start != end) {
  ------------------
  |  Branch (1155:21): [True: 888, False: 0]
  ------------------
 1156|    888|                    xmlOutputBufferWrite(buf, 9, "<![CDATA[");
 1157|    888|                    xmlOutputBufferWriteString(buf, (const char *)start);
 1158|    888|                    xmlOutputBufferWrite(buf, 3, "]]>");
 1159|    888|                }
 1160|    888|            }
 1161|  1.11k|            break;
 1162|       |
 1163|      0|        case XML_ATTRIBUTE_NODE:
  ------------------
  |  Branch (1163:9): [True: 0, False: 1.30M]
  ------------------
 1164|      0|            xmlAttrDumpOutput(ctxt, (xmlAttrPtr) cur);
 1165|      0|            break;
 1166|       |
 1167|      0|        case XML_NAMESPACE_DECL:
  ------------------
  |  Branch (1167:9): [True: 0, False: 1.30M]
  ------------------
 1168|      0|            xmlNsDumpOutput(buf, (xmlNsPtr) cur, ctxt);
 1169|      0|            break;
 1170|       |
 1171|   280k|        default:
  ------------------
  |  Branch (1171:9): [True: 280k, False: 1.02M]
  ------------------
 1172|   280k|            break;
 1173|  1.30M|        }
 1174|       |
 1175|  1.30M|        while (1) {
  ------------------
  |  Branch (1175:16): [True: 1.30M, Folded]
  ------------------
 1176|  1.30M|            if (cur == root)
  ------------------
  |  Branch (1176:17): [True: 46.5k, False: 1.26M]
  ------------------
 1177|  46.5k|                return;
 1178|  1.26M|            if ((ctxt->format == 1) &&
  ------------------
  |  Branch (1178:17): [True: 0, False: 1.26M]
  ------------------
 1179|      0|                (cur->type != XML_XINCLUDE_START) &&
  ------------------
  |  Branch (1179:17): [True: 0, False: 0]
  ------------------
 1180|      0|                (cur->type != XML_XINCLUDE_END))
  ------------------
  |  Branch (1180:17): [True: 0, False: 0]
  ------------------
 1181|      0|                xmlOutputBufferWrite(buf, 1, "\n");
 1182|  1.26M|            if (cur->next != NULL) {
  ------------------
  |  Branch (1182:17): [True: 705k, False: 556k]
  ------------------
 1183|   705k|                cur = cur->next;
 1184|   705k|                break;
 1185|   705k|            }
 1186|       |
 1187|   556k|            cur = parent;
 1188|       |            /* cur->parent was validated when descending. */
 1189|   556k|            parent = cur->parent;
 1190|       |
 1191|   556k|            if (cur->type == XML_ELEMENT_NODE) {
  ------------------
  |  Branch (1191:17): [True: 556k, False: 0]
  ------------------
 1192|   556k|                if (ctxt->level > 0) ctxt->level--;
  ------------------
  |  Branch (1192:21): [True: 556k, False: 0]
  ------------------
 1193|   556k|                if (ctxt->format == 1)
  ------------------
  |  Branch (1193:21): [True: 0, False: 556k]
  ------------------
 1194|      0|                    xmlSaveWriteIndent(ctxt, 0);
 1195|       |
 1196|   556k|                xmlOutputBufferWrite(buf, 2, "</");
 1197|   556k|                if ((cur->ns != NULL) && (cur->ns->prefix != NULL)) {
  ------------------
  |  Branch (1197:21): [True: 20.2k, False: 536k]
  |  Branch (1197:42): [True: 14.0k, False: 6.23k]
  ------------------
 1198|  14.0k|                    xmlOutputBufferWriteString(buf,
 1199|  14.0k|                            (const char *)cur->ns->prefix);
 1200|  14.0k|                    xmlOutputBufferWrite(buf, 1, ":");
 1201|  14.0k|                }
 1202|       |
 1203|   556k|                xmlOutputBufferWriteString(buf, (const char *)cur->name);
 1204|   556k|                if (ctxt->format == 2)
  ------------------
  |  Branch (1204:21): [True: 0, False: 556k]
  ------------------
 1205|      0|                    xmlOutputBufferWriteWSNonSig(ctxt, 0);
 1206|   556k|                xmlOutputBufferWrite(buf, 1, ">");
 1207|       |
 1208|   556k|                if (cur == unformattedNode) {
  ------------------
  |  Branch (1208:21): [True: 0, False: 556k]
  ------------------
 1209|      0|                    ctxt->format = format;
 1210|       |                    unformattedNode = NULL;
 1211|      0|                }
 1212|   556k|            }
 1213|   556k|        }
 1214|   752k|    }
 1215|  46.5k|}
xmlsave.c:xmlBufDumpNotationDecl:
  271|  1.69k|xmlBufDumpNotationDecl(xmlOutputBufferPtr buf, xmlNotationPtr nota) {
  272|  1.69k|    xmlOutputBufferWrite(buf, 11, "<!NOTATION ");
  273|  1.69k|    xmlOutputBufferWriteString(buf, (const char *) nota->name);
  274|       |
  275|  1.69k|    if (nota->PublicID != NULL) {
  ------------------
  |  Branch (275:9): [True: 862, False: 837]
  ------------------
  276|    862|	xmlOutputBufferWrite(buf, 8, " PUBLIC ");
  277|    862|	xmlOutputBufferWriteQuotedString(buf, nota->PublicID);
  278|    862|	if (nota->SystemID != NULL) {
  ------------------
  |  Branch (278:6): [True: 484, False: 378]
  ------------------
  279|    484|	    xmlOutputBufferWrite(buf, 1, " ");
  280|    484|	    xmlOutputBufferWriteQuotedString(buf, nota->SystemID);
  281|    484|	}
  282|    862|    } else {
  283|    837|	xmlOutputBufferWrite(buf, 8, " SYSTEM ");
  284|    837|	xmlOutputBufferWriteQuotedString(buf, nota->SystemID);
  285|    837|    }
  286|       |
  287|  1.69k|    xmlOutputBufferWrite(buf, 3, " >\n");
  288|  1.69k|}
xmlsave.c:xmlBufDumpNotationTable:
  310|  1.69k|xmlBufDumpNotationTable(xmlOutputBufferPtr buf, xmlNotationTablePtr table) {
  311|  1.69k|    xmlHashScan(table, xmlBufDumpNotationDeclScan, buf);
  312|  1.69k|}
xmlsave.c:xmlBufDumpNotationDeclScan:
  299|  1.69k|                           const xmlChar *name ATTRIBUTE_UNUSED) {
  300|  1.69k|    xmlBufDumpNotationDecl((xmlOutputBufferPtr) buf, (xmlNotationPtr) nota);
  301|  1.69k|}
xmlsave.c:xmlSaveCtxtInit:
  153|  42.6k|{
  154|  42.6k|    if (ctxt == NULL) return;
  ------------------
  |  Branch (154:9): [True: 0, False: 42.6k]
  ------------------
  155|       |
  156|  42.6k|    xmlSaveSetIndentString(ctxt, xmlTreeIndentString);
  ------------------
  |  | 1364|  42.6k|    #define xmlTreeIndentString (*__xmlTreeIndentString())
  ------------------
  157|       |
  158|  42.6k|    if (options & XML_SAVE_FORMAT)
  ------------------
  |  Branch (158:9): [True: 0, False: 42.6k]
  ------------------
  159|      0|        ctxt->format = 1;
  160|  42.6k|    else if (options & XML_SAVE_WSNONSIG)
  ------------------
  |  Branch (160:14): [True: 0, False: 42.6k]
  ------------------
  161|      0|        ctxt->format = 2;
  162|       |
  163|  42.6k|    if (((options & XML_SAVE_EMPTY) == 0) &&
  ------------------
  |  Branch (163:9): [True: 42.6k, False: 0]
  ------------------
  164|  42.6k|        (xmlSaveNoEmptyTags))
  ------------------
  |  | 1372|  42.6k|    #define xmlSaveNoEmptyTags (*__xmlSaveNoEmptyTags())
  ------------------
  |  Branch (164:9): [True: 0, False: 42.6k]
  ------------------
  165|      0|	options |= XML_SAVE_NO_EMPTY;
  166|       |
  167|  42.6k|    ctxt->options = options;
  168|  42.6k|}

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

xmlStrndup:
   50|  25.7M|xmlStrndup(const xmlChar *cur, int len) {
   51|  25.7M|    xmlChar *ret;
   52|       |
   53|  25.7M|    if ((cur == NULL) || (len < 0)) return(NULL);
  ------------------
  |  Branch (53:9): [True: 0, False: 25.7M]
  |  Branch (53:26): [True: 0, False: 25.7M]
  ------------------
   54|  25.7M|    ret = xmlMalloc((size_t) len + 1);
   55|  25.7M|    if (ret == NULL) {
  ------------------
  |  Branch (55:9): [True: 3.16k, False: 25.7M]
  ------------------
   56|  3.16k|        return(NULL);
   57|  3.16k|    }
   58|  25.7M|    memcpy(ret, cur, len);
   59|  25.7M|    ret[len] = 0;
   60|  25.7M|    return(ret);
   61|  25.7M|}
xmlStrdup:
   72|  20.6M|xmlStrdup(const xmlChar *cur) {
   73|  20.6M|    const xmlChar *p = cur;
   74|       |
   75|  20.6M|    if (cur == NULL) return(NULL);
  ------------------
  |  Branch (75:9): [True: 53, False: 20.6M]
  ------------------
   76|   862M|    while (*p != 0) p++; /* non input consuming */
  ------------------
  |  Branch (76:12): [True: 841M, False: 20.6M]
  ------------------
   77|  20.6M|    return(xmlStrndup(cur, p - cur));
   78|  20.6M|}
xmlCharStrndup:
   89|   972k|xmlCharStrndup(const char *cur, int len) {
   90|   972k|    int i;
   91|   972k|    xmlChar *ret;
   92|       |
   93|   972k|    if ((cur == NULL) || (len < 0)) return(NULL);
  ------------------
  |  Branch (93:9): [True: 0, False: 972k]
  |  Branch (93:26): [True: 0, False: 972k]
  ------------------
   94|   972k|    ret = xmlMalloc((size_t) len + 1);
   95|   972k|    if (ret == NULL) {
  ------------------
  |  Branch (95:9): [True: 143, False: 972k]
  ------------------
   96|    143|        return(NULL);
   97|    143|    }
   98|  90.2M|    for (i = 0;i < len;i++) {
  ------------------
  |  Branch (98:16): [True: 89.2M, False: 972k]
  ------------------
   99|       |        /* Explicit sign change */
  100|  89.2M|        ret[i] = (xmlChar) cur[i];
  101|  89.2M|        if (ret[i] == 0) return(ret);
  ------------------
  |  Branch (101:13): [True: 0, False: 89.2M]
  ------------------
  102|  89.2M|    }
  103|   972k|    ret[len] = 0;
  104|   972k|    return(ret);
  105|   972k|}
xmlCharStrdup:
  115|   972k|xmlCharStrdup(const char *cur) {
  116|   972k|    const char *p = cur;
  117|       |
  118|   972k|    if (cur == NULL) return(NULL);
  ------------------
  |  Branch (118:9): [True: 0, False: 972k]
  ------------------
  119|  90.6M|    while (*p != '\0') p++; /* non input consuming */
  ------------------
  |  Branch (119:12): [True: 89.6M, False: 972k]
  ------------------
  120|   972k|    return(xmlCharStrndup(cur, p - cur));
  121|   972k|}
xmlStrcmp:
  132|  4.09k|xmlStrcmp(const xmlChar *str1, const xmlChar *str2) {
  133|  4.09k|    if (str1 == str2) return(0);
  ------------------
  |  Branch (133:9): [True: 3.81k, False: 273]
  ------------------
  134|    273|    if (str1 == NULL) return(-1);
  ------------------
  |  Branch (134:9): [True: 273, False: 0]
  ------------------
  135|      0|    if (str2 == NULL) return(1);
  ------------------
  |  Branch (135:9): [True: 0, False: 0]
  ------------------
  136|      0|#ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
  137|      0|    return(strcmp((const char *)str1, (const char *)str2));
  138|       |#else
  139|       |    do {
  140|       |        int tmp = *str1++ - *str2;
  141|       |        if (tmp != 0) return(tmp);
  142|       |    } while (*str2++ != 0);
  143|       |    return 0;
  144|       |#endif
  145|      0|}
xmlStrEqual:
  157|  32.0M|xmlStrEqual(const xmlChar *str1, const xmlChar *str2) {
  158|  32.0M|    if (str1 == str2) return(1);
  ------------------
  |  Branch (158:9): [True: 888k, False: 31.1M]
  ------------------
  159|  31.1M|    if (str1 == NULL) return(0);
  ------------------
  |  Branch (159:9): [True: 429k, False: 30.7M]
  ------------------
  160|  30.7M|    if (str2 == NULL) return(0);
  ------------------
  |  Branch (160:9): [True: 4.37M, False: 26.3M]
  ------------------
  161|  26.3M|#ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
  162|  26.3M|    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|  30.7M|}
xmlStrQEqual:
  181|  42.0k|xmlStrQEqual(const xmlChar *pref, const xmlChar *name, const xmlChar *str) {
  182|  42.0k|    if (pref == NULL) return(xmlStrEqual(name, str));
  ------------------
  |  Branch (182:9): [True: 15.3k, False: 26.6k]
  ------------------
  183|  26.6k|    if (name == NULL) return(0);
  ------------------
  |  Branch (183:9): [True: 0, False: 26.6k]
  ------------------
  184|  26.6k|    if (str == NULL) return(0);
  ------------------
  |  Branch (184:9): [True: 0, False: 26.6k]
  ------------------
  185|       |
  186|   116k|    do {
  187|   116k|        if (*pref++ != *str) return(0);
  ------------------
  |  Branch (187:13): [True: 0, False: 116k]
  ------------------
  188|   116k|    } while ((*str++) && (*pref));
  ------------------
  |  Branch (188:14): [True: 116k, False: 0]
  |  Branch (188:26): [True: 89.5k, False: 26.6k]
  ------------------
  189|  26.6k|    if (*str++ != ':') return(0);
  ------------------
  |  Branch (189:9): [True: 0, False: 26.6k]
  ------------------
  190|   323k|    do {
  191|   323k|        if (*name++ != *str) return(0);
  ------------------
  |  Branch (191:13): [True: 0, False: 323k]
  ------------------
  192|   323k|    } while (*str++);
  ------------------
  |  Branch (192:14): [True: 296k, False: 26.6k]
  ------------------
  193|  26.6k|    return(1);
  194|  26.6k|}
xmlStrncmp:
  206|  17.6M|xmlStrncmp(const xmlChar *str1, const xmlChar *str2, int len) {
  207|  17.6M|    if (len <= 0) return(0);
  ------------------
  |  Branch (207:9): [True: 38, False: 17.6M]
  ------------------
  208|  17.6M|    if (str1 == str2) return(0);
  ------------------
  |  Branch (208:9): [True: 0, False: 17.6M]
  ------------------
  209|  17.6M|    if (str1 == NULL) return(-1);
  ------------------
  |  Branch (209:9): [True: 1, False: 17.6M]
  ------------------
  210|  17.6M|    if (str2 == NULL) return(1);
  ------------------
  |  Branch (210:9): [True: 0, False: 17.6M]
  ------------------
  211|  17.6M|#ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
  212|  17.6M|    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|  17.6M|}
xmlStrcasecmp:
  266|   108k|xmlStrcasecmp(const xmlChar *str1, const xmlChar *str2) {
  267|   108k|    register int tmp;
  268|       |
  269|   108k|    if (str1 == str2) return(0);
  ------------------
  |  Branch (269:9): [True: 0, False: 108k]
  ------------------
  270|   108k|    if (str1 == NULL) return(-1);
  ------------------
  |  Branch (270:9): [True: 0, False: 108k]
  ------------------
  271|   108k|    if (str2 == NULL) return(1);
  ------------------
  |  Branch (271:9): [True: 0, False: 108k]
  ------------------
  272|   260k|    do {
  273|   260k|        tmp = casemap[*str1++] - casemap[*str2];
  274|   260k|        if (tmp != 0) return(tmp);
  ------------------
  |  Branch (274:13): [True: 103k, False: 156k]
  ------------------
  275|   260k|    } while (*str2++ != 0);
  ------------------
  |  Branch (275:14): [True: 152k, False: 4.58k]
  ------------------
  276|  4.58k|    return 0;
  277|   108k|}
xmlStrchr:
  312|  75.2M|xmlStrchr(const xmlChar *str, xmlChar val) {
  313|  75.2M|    if (str == NULL) return(NULL);
  ------------------
  |  Branch (313:9): [True: 0, False: 75.2M]
  ------------------
  314|   319M|    while (*str != 0) { /* non input consuming */
  ------------------
  |  Branch (314:12): [True: 245M, False: 74.4M]
  ------------------
  315|   245M|        if (*str == val) return((xmlChar *) str);
  ------------------
  |  Branch (315:13): [True: 790k, False: 244M]
  ------------------
  316|   244M|        str++;
  317|   244M|    }
  318|  74.4M|    return(NULL);
  319|  75.2M|}
xmlStrstr:
  330|   936k|xmlStrstr(const xmlChar *str, const xmlChar *val) {
  331|   936k|    int n;
  332|       |
  333|   936k|    if (str == NULL) return(NULL);
  ------------------
  |  Branch (333:9): [True: 0, False: 936k]
  ------------------
  334|   936k|    if (val == NULL) return(NULL);
  ------------------
  |  Branch (334:9): [True: 0, False: 936k]
  ------------------
  335|   936k|    n = xmlStrlen(val);
  336|       |
  337|   936k|    if (n == 0) return(str);
  ------------------
  |  Branch (337:9): [True: 272, False: 936k]
  ------------------
  338|  4.61M|    while (*str != 0) { /* non input consuming */
  ------------------
  |  Branch (338:12): [True: 3.70M, False: 909k]
  ------------------
  339|  3.70M|        if (*str == *val) {
  ------------------
  |  Branch (339:13): [True: 38.4k, False: 3.66M]
  ------------------
  340|  38.4k|            if (!xmlStrncmp(str, val, n)) return((const xmlChar *) str);
  ------------------
  |  Branch (340:17): [True: 27.6k, False: 10.7k]
  ------------------
  341|  38.4k|        }
  342|  3.67M|        str++;
  343|  3.67M|    }
  344|   909k|    return(NULL);
  345|   936k|}
xmlStrlen:
  405|  2.76M|xmlStrlen(const xmlChar *str) {
  406|  2.76M|    size_t len = str ? strlen((const char *)str) : 0;
  ------------------
  |  Branch (406:18): [True: 2.75M, False: 2.37k]
  ------------------
  407|  2.76M|    return(len > INT_MAX ? 0 : len);
  ------------------
  |  Branch (407:12): [True: 0, False: 2.76M]
  ------------------
  408|  2.76M|}
xmlStrncat:
  423|   707k|xmlStrncat(xmlChar *cur, const xmlChar *add, int len) {
  424|   707k|    int size;
  425|   707k|    xmlChar *ret;
  426|       |
  427|   707k|    if ((add == NULL) || (len == 0))
  ------------------
  |  Branch (427:9): [True: 0, False: 707k]
  |  Branch (427:26): [True: 660, False: 706k]
  ------------------
  428|    660|        return(cur);
  429|       |
  430|   706k|    if (len < 0) {
  ------------------
  |  Branch (430:9): [True: 0, False: 706k]
  ------------------
  431|      0|        if (cur != NULL)
  ------------------
  |  Branch (431:13): [True: 0, False: 0]
  ------------------
  432|      0|            xmlFree(cur);
  433|      0|        return(NULL);
  434|      0|    }
  435|       |
  436|   706k|    if (cur == NULL)
  ------------------
  |  Branch (436:9): [True: 0, False: 706k]
  ------------------
  437|      0|        return(xmlStrndup(add, len));
  438|       |
  439|   706k|    size = xmlStrlen(cur);
  440|   706k|    if ((size < 0) || (size > INT_MAX - len)) {
  ------------------
  |  Branch (440:9): [True: 0, False: 706k]
  |  Branch (440:23): [True: 0, False: 706k]
  ------------------
  441|      0|        xmlFree(cur);
  442|      0|        return(NULL);
  443|      0|    }
  444|   706k|    ret = (xmlChar *) xmlRealloc(cur, (size_t) size + len + 1);
  445|   706k|    if (ret == NULL) {
  ------------------
  |  Branch (445:9): [True: 16, False: 706k]
  ------------------
  446|     16|        xmlFree(cur);
  447|     16|        return(NULL);
  448|     16|    }
  449|   706k|    memcpy(&ret[size], add, len);
  450|   706k|    ret[size + len] = 0;
  451|   706k|    return(ret);
  452|   706k|}
xmlStrncatNew:
  465|     47|xmlStrncatNew(const xmlChar *str1, const xmlChar *str2, int len) {
  466|     47|    int size;
  467|     47|    xmlChar *ret;
  468|       |
  469|     47|    if (len < 0) {
  ------------------
  |  Branch (469:9): [True: 0, False: 47]
  ------------------
  470|      0|        len = xmlStrlen(str2);
  471|      0|        if (len < 0)
  ------------------
  |  Branch (471:13): [True: 0, False: 0]
  ------------------
  472|      0|            return(NULL);
  473|      0|    }
  474|     47|    if (str1 == NULL)
  ------------------
  |  Branch (474:9): [True: 47, False: 0]
  ------------------
  475|     47|        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|   707k|xmlStrcat(xmlChar *cur, const xmlChar *add) {
  503|   707k|    const xmlChar *p = add;
  504|       |
  505|   707k|    if (add == NULL) return(cur);
  ------------------
  |  Branch (505:9): [True: 3, False: 707k]
  ------------------
  506|   707k|    if (cur == NULL)
  ------------------
  |  Branch (506:9): [True: 2, False: 707k]
  ------------------
  507|      2|        return(xmlStrdup(add));
  508|       |
  509|  9.18M|    while (*p != 0) p++; /* non input consuming */
  ------------------
  |  Branch (509:12): [True: 8.47M, False: 707k]
  ------------------
  510|   707k|    return(xmlStrncat(cur, add, p - add));
  511|   707k|}
xmlStrVASPrintf:
  573|  1.39M|xmlStrVASPrintf(xmlChar **out, int maxSize, const char *msg, va_list ap) {
  574|  1.39M|    char empty[1];
  575|  1.39M|    va_list copy;
  576|  1.39M|    xmlChar *buf;
  577|  1.39M|    int res, size;
  578|  1.39M|    int truncated = 0;
  579|       |
  580|  1.39M|    if (out == NULL)
  ------------------
  |  Branch (580:9): [True: 0, False: 1.39M]
  ------------------
  581|      0|        return(1);
  582|  1.39M|    *out = NULL;
  583|  1.39M|    if (msg == NULL)
  ------------------
  |  Branch (583:9): [True: 0, False: 1.39M]
  ------------------
  584|      0|        return(1);
  585|  1.39M|    if (maxSize < 32)
  ------------------
  |  Branch (585:9): [True: 0, False: 1.39M]
  ------------------
  586|      0|        maxSize = 32;
  587|       |
  588|  1.39M|    va_copy(copy, ap);
  589|  1.39M|    res = vsnprintf(empty, 1, msg, copy);
  590|  1.39M|    va_end(copy);
  591|       |
  592|  1.39M|    if (res > 0) {
  ------------------
  |  Branch (592:9): [True: 1.39M, False: 0]
  ------------------
  593|       |        /* snprintf seems to work according to C99. */
  594|       |
  595|  1.39M|        if (res < maxSize) {
  ------------------
  |  Branch (595:13): [True: 1.39M, False: 371]
  ------------------
  596|  1.39M|            size = res + 1;
  597|  1.39M|        } else {
  598|    371|            size = maxSize;
  599|    371|            truncated = 1;
  600|    371|        }
  601|  1.39M|        buf = xmlMalloc(size);
  602|  1.39M|        if (buf == NULL)
  ------------------
  |  Branch (602:13): [True: 1.57k, False: 1.39M]
  ------------------
  603|  1.57k|            return(-1);
  604|  1.39M|        if (vsnprintf((char *) buf, size, msg, ap) < 0) {
  ------------------
  |  Branch (604:13): [True: 0, False: 1.39M]
  ------------------
  605|      0|            xmlFree(buf);
  606|      0|            return(1);
  607|      0|        }
  608|  1.39M|    } 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.39M|    if (truncated != 0) {
  ------------------
  |  Branch (658:9): [True: 371, False: 1.39M]
  ------------------
  659|    371|        int i = size - 1;
  660|       |
  661|    639|        while (i > 0) {
  ------------------
  |  Branch (661:16): [True: 639, False: 0]
  ------------------
  662|       |            /* Break after ASCII */
  663|    639|            if (buf[i-1] < 0x80)
  ------------------
  |  Branch (663:17): [True: 158, False: 481]
  ------------------
  664|    158|                break;
  665|    481|            i -= 1;
  666|       |            /* Break before non-ASCII */
  667|    481|            if (buf[i] >= 0xc0)
  ------------------
  |  Branch (667:17): [True: 213, False: 268]
  ------------------
  668|    213|                break;
  669|    481|        }
  670|       |
  671|    371|        buf[i] = 0;
  672|    371|    }
  673|       |
  674|  1.39M|    *out = (xmlChar *) buf;
  675|  1.39M|    return(truncated);
  676|  1.39M|}
xmlUTF8Strlen:
  770|  19.2k|xmlUTF8Strlen(const xmlChar *utf) {
  771|  19.2k|    size_t ret = 0;
  772|       |
  773|  19.2k|    if (utf == NULL)
  ------------------
  |  Branch (773:9): [True: 19, False: 19.2k]
  ------------------
  774|     19|        return(-1);
  775|       |
  776|  1.94M|    while (*utf != 0) {
  ------------------
  |  Branch (776:12): [True: 1.92M, False: 19.2k]
  ------------------
  777|  1.92M|        if (utf[0] & 0x80) {
  ------------------
  |  Branch (777:13): [True: 6.08k, False: 1.92M]
  ------------------
  778|  6.08k|            if ((utf[1] & 0xc0) != 0x80)
  ------------------
  |  Branch (778:17): [True: 0, False: 6.08k]
  ------------------
  779|      0|                return(-1);
  780|  6.08k|            if ((utf[0] & 0xe0) == 0xe0) {
  ------------------
  |  Branch (780:17): [True: 1.77k, False: 4.31k]
  ------------------
  781|  1.77k|                if ((utf[2] & 0xc0) != 0x80)
  ------------------
  |  Branch (781:21): [True: 0, False: 1.77k]
  ------------------
  782|      0|                    return(-1);
  783|  1.77k|                if ((utf[0] & 0xf0) == 0xf0) {
  ------------------
  |  Branch (783:21): [True: 1.45k, False: 318]
  ------------------
  784|  1.45k|                    if ((utf[0] & 0xf8) != 0xf0 || (utf[3] & 0xc0) != 0x80)
  ------------------
  |  Branch (784:25): [True: 0, False: 1.45k]
  |  Branch (784:52): [True: 0, False: 1.45k]
  ------------------
  785|      0|                        return(-1);
  786|  1.45k|                    utf += 4;
  787|  1.45k|                } else {
  788|    318|                    utf += 3;
  789|    318|                }
  790|  4.31k|            } else {
  791|  4.31k|                utf += 2;
  792|  4.31k|            }
  793|  1.92M|        } else {
  794|  1.92M|            utf++;
  795|  1.92M|        }
  796|  1.92M|        ret++;
  797|  1.92M|    }
  798|  19.2k|    return(ret > INT_MAX ? 0 : ret);
  ------------------
  |  Branch (798:12): [True: 0, False: 19.2k]
  ------------------
  799|  19.2k|}
xmlGetUTF8Char:
  812|  39.6M|xmlGetUTF8Char(const unsigned char *utf, int *len) {
  813|  39.6M|    unsigned int c;
  814|       |
  815|  39.6M|    if (utf == NULL)
  ------------------
  |  Branch (815:9): [True: 0, False: 39.6M]
  ------------------
  816|      0|        goto error;
  817|  39.6M|    if (len == NULL)
  ------------------
  |  Branch (817:9): [True: 0, False: 39.6M]
  ------------------
  818|      0|        goto error;
  819|       |
  820|  39.6M|    c = utf[0];
  821|  39.6M|    if (c < 0x80) {
  ------------------
  |  Branch (821:9): [True: 18.5M, False: 21.0M]
  ------------------
  822|  18.5M|        if (*len < 1)
  ------------------
  |  Branch (822:13): [True: 0, False: 18.5M]
  ------------------
  823|      0|            goto error;
  824|       |        /* 1-byte code */
  825|  18.5M|        *len = 1;
  826|  21.0M|    } else {
  827|  21.0M|        if ((*len < 2) || ((utf[1] & 0xc0) != 0x80))
  ------------------
  |  Branch (827:13): [True: 250, False: 21.0M]
  |  Branch (827:27): [True: 130k, False: 20.9M]
  ------------------
  828|   130k|            goto error;
  829|  20.9M|        if (c < 0xe0) {
  ------------------
  |  Branch (829:13): [True: 191k, False: 20.7M]
  ------------------
  830|   191k|            if (c < 0xc2)
  ------------------
  |  Branch (830:17): [True: 5.97k, False: 186k]
  ------------------
  831|  5.97k|                goto error;
  832|       |            /* 2-byte code */
  833|   186k|            *len = 2;
  834|   186k|            c = (c & 0x1f) << 6;
  835|   186k|            c |= utf[1] & 0x3f;
  836|  20.7M|        } else {
  837|  20.7M|            if ((*len < 3) || ((utf[2] & 0xc0) != 0x80))
  ------------------
  |  Branch (837:17): [True: 83, False: 20.7M]
  |  Branch (837:31): [True: 403, False: 20.7M]
  ------------------
  838|    486|                goto error;
  839|  20.7M|            if (c < 0xf0) {
  ------------------
  |  Branch (839:17): [True: 20.7M, False: 4.90k]
  ------------------
  840|       |                /* 3-byte code */
  841|  20.7M|                *len = 3;
  842|  20.7M|                c = (c & 0xf) << 12;
  843|  20.7M|                c |= (utf[1] & 0x3f) << 6;
  844|  20.7M|                c |= utf[2] & 0x3f;
  845|  20.7M|                if ((c < 0x800) || ((c >= 0xd800) && (c < 0xe000)))
  ------------------
  |  Branch (845:21): [True: 333, False: 20.7M]
  |  Branch (845:37): [True: 3.17M, False: 17.5M]
  |  Branch (845:54): [True: 214, False: 3.17M]
  ------------------
  846|    547|                    goto error;
  847|  20.7M|            } else {
  848|  4.90k|                if ((*len < 4) || ((utf[3] & 0xc0) != 0x80))
  ------------------
  |  Branch (848:21): [True: 108, False: 4.79k]
  |  Branch (848:35): [True: 416, False: 4.38k]
  ------------------
  849|    524|                    goto error;
  850|       |                /*
  851|       |                 * The lead byte of a 4-byte sequence is 11110xxx and its
  852|       |                 * payload is the last 3 bits. Lead bytes from 0xF8 aren't
  853|       |                 * valid in UTF-8 (RFC 3629) because they would start a
  854|       |                 * sequence of five or more bytes, but masking with 0x7
  855|       |                 * reads them as 0xF0 to 0xF7, so F8 90 80 80 would decode
  856|       |                 * as U+10000. Reject them before decoding. Lead bytes 0xF5
  857|       |                 * to 0xF7 give values from 0x140000, which the range check
  858|       |                 * below rejects.
  859|       |                 */
  860|  4.38k|                if (c >= 0xf8)
  ------------------
  |  Branch (860:21): [True: 624, False: 3.75k]
  ------------------
  861|    624|                    goto error;
  862|  3.75k|                *len = 4;
  863|       |                /* 4-byte code */
  864|  3.75k|                c = (c & 0x7) << 18;
  865|  3.75k|                c |= (utf[1] & 0x3f) << 12;
  866|  3.75k|                c |= (utf[2] & 0x3f) << 6;
  867|  3.75k|                c |= utf[3] & 0x3f;
  868|  3.75k|                if ((c < 0x10000) || (c >= 0x110000))
  ------------------
  |  Branch (868:21): [True: 3, False: 3.75k]
  |  Branch (868:38): [True: 8, False: 3.74k]
  ------------------
  869|     11|                    goto error;
  870|  3.75k|            }
  871|  20.7M|        }
  872|  20.9M|    }
  873|  39.4M|    return(c);
  874|       |
  875|   139k|error:
  876|   139k|    if (len != NULL)
  ------------------
  |  Branch (876:9): [True: 139k, False: 0]
  ------------------
  877|   139k|	*len = 0;
  878|   139k|    return(-1);
  879|  39.6M|}
xmlUTF8Strsize:
  945|   104k|xmlUTF8Strsize(const xmlChar *utf, int len) {
  946|   104k|    const xmlChar *ptr=utf;
  947|   104k|    int ch;
  948|   104k|    size_t ret;
  949|       |
  950|   104k|    if (utf == NULL)
  ------------------
  |  Branch (950:9): [True: 0, False: 104k]
  ------------------
  951|      0|        return(0);
  952|       |
  953|   104k|    if (len <= 0)
  ------------------
  |  Branch (953:9): [True: 0, False: 104k]
  ------------------
  954|      0|        return(0);
  955|       |
  956|   236k|    while ( len-- > 0) {
  ------------------
  |  Branch (956:13): [True: 139k, False: 96.9k]
  ------------------
  957|   139k|        if ( !*ptr )
  ------------------
  |  Branch (957:14): [True: 7.56k, False: 132k]
  ------------------
  958|  7.56k|            break;
  959|   132k|        ch = *ptr++;
  960|   132k|        if ((ch & 0x80))
  ------------------
  |  Branch (960:13): [True: 385, False: 131k]
  ------------------
  961|  1.08k|            while ((ch<<=1) & 0x80 ) {
  ------------------
  |  Branch (961:20): [True: 699, False: 385]
  ------------------
  962|    699|		if (*ptr == 0) break;
  ------------------
  |  Branch (962:7): [True: 0, False: 699]
  ------------------
  963|    699|                ptr++;
  964|    699|	    }
  965|   132k|    }
  966|   104k|    ret = ptr - utf;
  967|   104k|    return (ret > INT_MAX ? 0 : ret);
  ------------------
  |  Branch (967:13): [True: 0, False: 104k]
  ------------------
  968|   104k|}
xmlUTF8Strndup:
  979|  12.9k|xmlUTF8Strndup(const xmlChar *utf, int len) {
  980|  12.9k|    xmlChar *ret;
  981|  12.9k|    int i;
  982|       |
  983|  12.9k|    if ((utf == NULL) || (len < 0)) return(NULL);
  ------------------
  |  Branch (983:9): [True: 0, False: 12.9k]
  |  Branch (983:26): [True: 0, False: 12.9k]
  ------------------
  984|  12.9k|    i = xmlUTF8Strsize(utf, len);
  985|  12.9k|    ret = xmlMalloc((size_t) i + 1);
  986|  12.9k|    if (ret == NULL) {
  ------------------
  |  Branch (986:9): [True: 4, False: 12.9k]
  ------------------
  987|      4|        return(NULL);
  988|      4|    }
  989|  12.9k|    memcpy(ret, utf, i);
  990|  12.9k|    ret[i] = 0;
  991|  12.9k|    return(ret);
  992|  12.9k|}
xmlUTF8Strpos:
 1003|  11.4k|xmlUTF8Strpos(const xmlChar *utf, int pos) {
 1004|  11.4k|    int ch;
 1005|       |
 1006|  11.4k|    if (utf == NULL) return(NULL);
  ------------------
  |  Branch (1006:9): [True: 0, False: 11.4k]
  ------------------
 1007|  11.4k|    if (pos < 0)
  ------------------
  |  Branch (1007:9): [True: 0, False: 11.4k]
  ------------------
 1008|      0|        return(NULL);
 1009|  6.51M|    while (pos--) {
  ------------------
  |  Branch (1009:12): [True: 6.50M, False: 11.4k]
  ------------------
 1010|  6.50M|        ch = *utf++;
 1011|  6.50M|        if (ch == 0)
  ------------------
  |  Branch (1011:13): [True: 0, False: 6.50M]
  ------------------
 1012|      0|            return(NULL);
 1013|  6.50M|        if ( ch & 0x80 ) {
  ------------------
  |  Branch (1013:14): [True: 8.93k, False: 6.49M]
  ------------------
 1014|       |            /* if not simple ascii, verify proper format */
 1015|  8.93k|            if ( (ch & 0xc0) != 0xc0 )
  ------------------
  |  Branch (1015:18): [True: 0, False: 8.93k]
  ------------------
 1016|      0|                return(NULL);
 1017|       |            /* then skip over remaining bytes for this char */
 1018|  28.3k|            while ( (ch <<= 1) & 0x80 )
  ------------------
  |  Branch (1018:21): [True: 19.4k, False: 8.93k]
  ------------------
 1019|  19.4k|                if ( (*utf++ & 0xc0) != 0x80 )
  ------------------
  |  Branch (1019:22): [True: 0, False: 19.4k]
  ------------------
 1020|      0|                    return(NULL);
 1021|  8.93k|        }
 1022|  6.50M|    }
 1023|  11.4k|    return((xmlChar *)utf);
 1024|  11.4k|}
xmlUTF8Strloc:
 1035|  54.9k|xmlUTF8Strloc(const xmlChar *utf, const xmlChar *utfchar) {
 1036|  54.9k|    size_t i;
 1037|  54.9k|    int size;
 1038|  54.9k|    int ch;
 1039|       |
 1040|  54.9k|    if (utf==NULL || utfchar==NULL) return -1;
  ------------------
  |  Branch (1040:9): [True: 0, False: 54.9k]
  |  Branch (1040:22): [True: 0, False: 54.9k]
  ------------------
 1041|  54.9k|    size = xmlUTF8Strsize(utfchar, 1);
 1042|  15.2M|        for(i=0; (ch=*utf) != 0; i++) {
  ------------------
  |  Branch (1042:18): [True: 15.2M, False: 25.1k]
  ------------------
 1043|  15.2M|            if (xmlStrncmp(utf, utfchar, size)==0)
  ------------------
  |  Branch (1043:17): [True: 29.8k, False: 15.2M]
  ------------------
 1044|  29.8k|                return(i > INT_MAX ? 0 : i);
  ------------------
  |  Branch (1044:24): [True: 0, False: 29.8k]
  ------------------
 1045|  15.2M|            utf++;
 1046|  15.2M|            if ( ch & 0x80 ) {
  ------------------
  |  Branch (1046:18): [True: 29.0k, False: 15.1M]
  ------------------
 1047|       |                /* if not simple ascii, verify proper format */
 1048|  29.0k|                if ( (ch & 0xc0) != 0xc0 )
  ------------------
  |  Branch (1048:22): [True: 0, False: 29.0k]
  ------------------
 1049|      0|                    return(-1);
 1050|       |                /* then skip over remaining bytes for this char */
 1051|  96.4k|                while ( (ch <<= 1) & 0x80 )
  ------------------
  |  Branch (1051:25): [True: 67.4k, False: 29.0k]
  ------------------
 1052|  67.4k|                    if ( (*utf++ & 0xc0) != 0x80 )
  ------------------
  |  Branch (1052:26): [True: 0, False: 67.4k]
  ------------------
 1053|      0|                        return(-1);
 1054|  29.0k|            }
 1055|  15.2M|        }
 1056|       |
 1057|  25.1k|    return(-1);
 1058|  54.9k|}
xmlUTF8Strsub:
 1072|  12.9k|xmlUTF8Strsub(const xmlChar *utf, int start, int len) {
 1073|  12.9k|    int i;
 1074|  12.9k|    int ch;
 1075|       |
 1076|  12.9k|    if (utf == NULL) return(NULL);
  ------------------
  |  Branch (1076:9): [True: 0, False: 12.9k]
  ------------------
 1077|  12.9k|    if (start < 0) return(NULL);
  ------------------
  |  Branch (1077:9): [True: 0, False: 12.9k]
  ------------------
 1078|  12.9k|    if (len < 0) return(NULL);
  ------------------
  |  Branch (1078:9): [True: 0, False: 12.9k]
  ------------------
 1079|       |
 1080|       |    /*
 1081|       |     * Skip over any leading chars
 1082|       |     */
 1083|  21.5k|    for (i = 0; i < start; i++) {
  ------------------
  |  Branch (1083:17): [True: 8.54k, False: 12.9k]
  ------------------
 1084|  8.54k|        ch = *utf++;
 1085|  8.54k|        if (ch == 0)
  ------------------
  |  Branch (1085:13): [True: 0, False: 8.54k]
  ------------------
 1086|      0|            return(NULL);
 1087|       |        /* skip over remaining bytes for this char */
 1088|  8.54k|        if (ch & 0x80) {
  ------------------
  |  Branch (1088:13): [True: 0, False: 8.54k]
  ------------------
 1089|      0|            ch <<= 1;
 1090|      0|            while (ch & 0x80) {
  ------------------
  |  Branch (1090:20): [True: 0, False: 0]
  ------------------
 1091|      0|                if (*utf++ == 0)
  ------------------
  |  Branch (1091:21): [True: 0, False: 0]
  ------------------
 1092|      0|                    return(NULL);
 1093|      0|                ch <<= 1;
 1094|      0|            }
 1095|      0|        }
 1096|  8.54k|    }
 1097|       |
 1098|  12.9k|    return(xmlUTF8Strndup(utf, len));
 1099|  12.9k|}

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|   522k|xmlXPathIsNaN(double val) {
  251|   522k|#ifdef isnan
  252|   522k|    return isnan(val);
  253|       |#else
  254|       |    return !(val == val);
  255|       |#endif
  256|   522k|}
xmlXPathIsInf:
  265|   398k|xmlXPathIsInf(double val) {
  266|   398k|#ifdef isinf
  267|   398k|    return isinf(val) ? (val > 0 ? 1 : -1) : 0;
  ------------------
  |  Branch (267:12): [True: 20.6k, False: 378k]
  |  Branch (267:26): [True: 13.9k, False: 6.70k]
  ------------------
  268|       |#else
  269|       |    if (val >= xmlXPathPINF)
  270|       |        return 1;
  271|       |    if (val <= -xmlXPathPINF)
  272|       |        return -1;
  273|       |    return 0;
  274|       |#endif
  275|   398k|}
xmlXPathErrMemory:
  677|  3.68k|{
  678|  3.68k|    if (ctxt == NULL)
  ------------------
  |  Branch (678:9): [True: 0, False: 3.68k]
  ------------------
  679|      0|        return;
  680|  3.68k|    xmlRaiseMemoryError(ctxt->error, NULL, ctxt->userData, XML_FROM_XPATH,
  681|  3.68k|                        &ctxt->lastError);
  682|  3.68k|}
xmlXPathPErrMemory:
  691|  3.47k|{
  692|  3.47k|    if (ctxt == NULL)
  ------------------
  |  Branch (692:9): [True: 0, False: 3.47k]
  ------------------
  693|      0|        return;
  694|  3.47k|    ctxt->error = XPATH_MEMORY_ERROR;
  695|  3.47k|    xmlXPathErrMemory(ctxt->context);
  696|  3.47k|}
xmlXPathErr:
  777|  8.50k|xmlXPathErr(xmlXPathParserContext *ctxt, int code) {
  778|  8.50k|    xmlXPathErrFmt(ctxt, code, "%s\n", xmlXPathErrorMessages[code]);
  779|  8.50k|}
xmlXPathFreeCompExpr:
  971|  12.7k|{
  972|  12.7k|    xmlXPathStepOpPtr op;
  973|  12.7k|    int i;
  974|       |
  975|  12.7k|    if (comp == NULL)
  ------------------
  |  Branch (975:9): [True: 0, False: 12.7k]
  ------------------
  976|      0|        return;
  977|  12.7k|    if (comp->dict == NULL) {
  ------------------
  |  Branch (977:9): [True: 12.7k, False: 0]
  ------------------
  978|  3.62M|	for (i = 0; i < comp->nbStep; i++) {
  ------------------
  |  Branch (978:14): [True: 3.61M, False: 12.7k]
  ------------------
  979|  3.61M|	    op = &comp->steps[i];
  980|  3.61M|	    if (op->value4 != NULL) {
  ------------------
  |  Branch (980:10): [True: 72.0k, False: 3.54M]
  ------------------
  981|  72.0k|		if (op->op == XPATH_OP_VALUE)
  ------------------
  |  Branch (981:7): [True: 56.9k, False: 15.0k]
  ------------------
  982|  56.9k|		    xmlXPathFreeObject(op->value4);
  983|  15.0k|		else
  984|  15.0k|		    xmlFree(op->value4);
  985|  72.0k|	    }
  986|  3.61M|	    if (op->value5 != NULL)
  ------------------
  |  Branch (986:10): [True: 75.6k, False: 3.54M]
  ------------------
  987|  75.6k|		xmlFree(op->value5);
  988|  3.61M|	}
  989|  12.7k|    } else {
  990|      0|	for (i = 0; i < comp->nbStep; i++) {
  ------------------
  |  Branch (990:14): [True: 0, False: 0]
  ------------------
  991|      0|	    op = &comp->steps[i];
  992|      0|	    if (op->value4 != NULL) {
  ------------------
  |  Branch (992:10): [True: 0, False: 0]
  ------------------
  993|      0|		if (op->op == XPATH_OP_VALUE)
  ------------------
  |  Branch (993:7): [True: 0, False: 0]
  ------------------
  994|      0|		    xmlXPathFreeObject(op->value4);
  995|      0|	    }
  996|      0|	}
  997|      0|        xmlDictFree(comp->dict);
  998|      0|    }
  999|  12.7k|    if (comp->steps != NULL) {
  ------------------
  |  Branch (999:9): [True: 12.7k, False: 0]
  ------------------
 1000|  12.7k|        xmlFree(comp->steps);
 1001|  12.7k|    }
 1002|       |#ifdef XPATH_STREAMING
 1003|       |    if (comp->stream != NULL) {
 1004|       |        xmlFreePatternList(comp->stream);
 1005|       |    }
 1006|       |#endif
 1007|  12.7k|    if (comp->expr != NULL) {
  ------------------
  |  Branch (1007:9): [True: 0, False: 12.7k]
  ------------------
 1008|      0|        xmlFree(comp->expr);
 1009|      0|    }
 1010|       |
 1011|  12.7k|    xmlFree(comp);
 1012|  12.7k|}
xmlXPathValuePop:
 1979|  3.85M|{
 1980|  3.85M|    xmlXPathObjectPtr ret;
 1981|       |
 1982|  3.85M|    if ((ctxt == NULL) || (ctxt->valueNr <= 0))
  ------------------
  |  Branch (1982:9): [True: 0, False: 3.85M]
  |  Branch (1982:27): [True: 16.1k, False: 3.83M]
  ------------------
 1983|  16.1k|        return (NULL);
 1984|       |
 1985|  3.83M|    ctxt->valueNr--;
 1986|  3.83M|    if (ctxt->valueNr > 0)
  ------------------
  |  Branch (1986:9): [True: 3.14M, False: 688k]
  ------------------
 1987|  3.14M|        ctxt->value = ctxt->valueTab[ctxt->valueNr - 1];
 1988|   688k|    else
 1989|   688k|        ctxt->value = NULL;
 1990|  3.83M|    ret = ctxt->valueTab[ctxt->valueNr];
 1991|       |    ctxt->valueTab[ctxt->valueNr] = NULL;
 1992|  3.83M|    return (ret);
 1993|  3.85M|}
xmlXPathValuePush:
 2007|  3.84M|{
 2008|  3.84M|    if (ctxt == NULL) return(-1);
  ------------------
  |  Branch (2008:9): [True: 0, False: 3.84M]
  ------------------
 2009|  3.84M|    if (value == NULL) {
  ------------------
  |  Branch (2009:9): [True: 1.09k, False: 3.84M]
  ------------------
 2010|       |        /*
 2011|       |         * A NULL value typically indicates that a memory allocation failed.
 2012|       |         */
 2013|  1.09k|        xmlXPathPErrMemory(ctxt);
 2014|  1.09k|        return(-1);
 2015|  1.09k|    }
 2016|  3.84M|    if (ctxt->valueNr >= ctxt->valueMax) {
  ------------------
  |  Branch (2016:9): [True: 339, False: 3.84M]
  ------------------
 2017|    339|        xmlXPathObjectPtr *tmp;
 2018|    339|        int newSize;
 2019|       |
 2020|    339|        newSize = xmlGrowCapacity(ctxt->valueMax, sizeof(tmp[0]),
 2021|    339|                                  10, XPATH_MAX_STACK_DEPTH);
  ------------------
  |  |   96|    339|#define XPATH_MAX_STACK_DEPTH 1000000
  ------------------
 2022|    339|        if (newSize < 0) {
  ------------------
  |  Branch (2022:13): [True: 0, False: 339]
  ------------------
 2023|      0|            xmlXPathPErrMemory(ctxt);
 2024|      0|            xmlXPathFreeObject(value);
 2025|      0|            return (-1);
 2026|      0|        }
 2027|    339|        tmp = xmlRealloc(ctxt->valueTab, newSize * sizeof(tmp[0]));
 2028|    339|        if (tmp == NULL) {
  ------------------
  |  Branch (2028:13): [True: 1, False: 338]
  ------------------
 2029|      1|            xmlXPathPErrMemory(ctxt);
 2030|      1|            xmlXPathFreeObject(value);
 2031|      1|            return (-1);
 2032|      1|        }
 2033|    338|	ctxt->valueTab = tmp;
 2034|    338|        ctxt->valueMax = newSize;
 2035|    338|    }
 2036|  3.84M|    ctxt->valueTab[ctxt->valueNr] = value;
 2037|  3.84M|    ctxt->value = value;
 2038|  3.84M|    return (ctxt->valueNr++);
 2039|  3.84M|}
xmlXPathNodeSetSort:
 2552|  39.8k|xmlXPathNodeSetSort(xmlNodeSet *set) {
 2553|       |#ifndef WITH_TIM_SORT
 2554|       |    int i, j, incr, len;
 2555|       |    xmlNodePtr tmp;
 2556|       |#endif
 2557|       |
 2558|  39.8k|    if (set == NULL)
  ------------------
  |  Branch (2558:9): [True: 0, False: 39.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|  39.8k|    libxml_domnode_tim_sort(set->nodeTab, set->nodeNr);
 2590|  39.8k|#endif /* WITH_TIM_SORT */
 2591|  39.8k|}
xmlXPathNodeSetFreeNs:
 2647|   172k|xmlXPathNodeSetFreeNs(xmlNs *ns) {
 2648|   172k|    if ((ns == NULL) || (ns->type != XML_NAMESPACE_DECL))
  ------------------
  |  Branch (2648:9): [True: 0, False: 172k]
  |  Branch (2648:25): [True: 0, False: 172k]
  ------------------
 2649|      0|	return;
 2650|       |
 2651|   172k|    if ((ns->next != NULL) && (ns->next->type != XML_NAMESPACE_DECL)) {
  ------------------
  |  Branch (2651:9): [True: 172k, False: 0]
  |  Branch (2651:31): [True: 172k, False: 0]
  ------------------
 2652|   172k|	if (ns->href != NULL)
  ------------------
  |  Branch (2652:6): [True: 121k, False: 50.4k]
  ------------------
 2653|   121k|	    xmlFree((xmlChar *)ns->href);
 2654|   172k|	if (ns->prefix != NULL)
  ------------------
  |  Branch (2654:6): [True: 127k, False: 44.6k]
  ------------------
 2655|   127k|	    xmlFree((xmlChar *)ns->prefix);
 2656|   172k|	xmlFree(ns);
 2657|   172k|    }
 2658|   172k|}
xmlXPathNodeSetCreate:
 2667|  2.18M|xmlXPathNodeSetCreate(xmlNode *val) {
 2668|  2.18M|    xmlNodeSetPtr ret;
 2669|       |
 2670|  2.18M|    ret = (xmlNodeSetPtr) xmlMalloc(sizeof(xmlNodeSet));
 2671|  2.18M|    if (ret == NULL)
  ------------------
  |  Branch (2671:9): [True: 301, False: 2.18M]
  ------------------
 2672|    301|	return(NULL);
 2673|  2.18M|    memset(ret, 0 , sizeof(xmlNodeSet));
 2674|  2.18M|    if (val != NULL) {
  ------------------
  |  Branch (2674:9): [True: 1.11M, False: 1.06M]
  ------------------
 2675|  1.11M|        ret->nodeTab = (xmlNodePtr *) xmlMalloc(XML_NODESET_DEFAULT *
  ------------------
  |  | 2593|  1.11M|#define XML_NODESET_DEFAULT	10
  ------------------
 2676|  1.11M|					     sizeof(xmlNodePtr));
 2677|  1.11M|	if (ret->nodeTab == NULL) {
  ------------------
  |  Branch (2677:6): [True: 176, False: 1.11M]
  ------------------
 2678|    176|	    xmlFree(ret);
 2679|    176|	    return(NULL);
 2680|    176|	}
 2681|  1.11M|	memset(ret->nodeTab, 0 ,
 2682|  1.11M|	       XML_NODESET_DEFAULT * sizeof(xmlNodePtr));
  ------------------
  |  | 2593|  1.11M|#define XML_NODESET_DEFAULT	10
  ------------------
 2683|  1.11M|        ret->nodeMax = XML_NODESET_DEFAULT;
  ------------------
  |  | 2593|  1.11M|#define XML_NODESET_DEFAULT	10
  ------------------
 2684|  1.11M|	if (val->type == XML_NAMESPACE_DECL) {
  ------------------
  |  Branch (2684:6): [True: 2.75k, False: 1.11M]
  ------------------
 2685|  2.75k|	    xmlNsPtr ns = (xmlNsPtr) val;
 2686|  2.75k|            xmlNodePtr nsNode = xmlXPathNodeSetDupNs((xmlNodePtr) ns->next, ns);
 2687|       |
 2688|  2.75k|            if (nsNode == NULL) {
  ------------------
  |  Branch (2688:17): [True: 4, False: 2.75k]
  ------------------
 2689|      4|                xmlXPathFreeNodeSet(ret);
 2690|      4|                return(NULL);
 2691|      4|            }
 2692|  2.75k|	    ret->nodeTab[ret->nodeNr++] = nsNode;
 2693|  2.75k|	} else
 2694|  1.11M|	    ret->nodeTab[ret->nodeNr++] = val;
 2695|  1.11M|    }
 2696|  2.18M|    return(ret);
 2697|  2.18M|}
xmlXPathNodeSetAddNs:
 2761|   158k|xmlXPathNodeSetAddNs(xmlNodeSet *cur, xmlNode *node, xmlNs *ns) {
 2762|   158k|    int i;
 2763|   158k|    xmlNodePtr nsNode;
 2764|       |
 2765|   158k|    if ((cur == NULL) || (ns == NULL) || (node == NULL) ||
  ------------------
  |  Branch (2765:9): [True: 0, False: 158k]
  |  Branch (2765:26): [True: 0, False: 158k]
  |  Branch (2765:42): [True: 0, False: 158k]
  ------------------
 2766|   158k|        (ns->type != XML_NAMESPACE_DECL) ||
  ------------------
  |  Branch (2766:9): [True: 0, False: 158k]
  ------------------
 2767|   158k|	(node->type != XML_ELEMENT_NODE))
  ------------------
  |  Branch (2767:2): [True: 0, False: 158k]
  ------------------
 2768|      0|	return(-1);
 2769|       |
 2770|       |    /* @@ with_ns to check whether namespace nodes should be looked at @@ */
 2771|       |    /*
 2772|       |     * prevent duplicates
 2773|       |     */
 2774|   283k|    for (i = 0;i < cur->nodeNr;i++) {
  ------------------
  |  Branch (2774:16): [True: 124k, False: 158k]
  ------------------
 2775|   124k|        if ((cur->nodeTab[i] != NULL) &&
  ------------------
  |  Branch (2775:13): [True: 124k, False: 0]
  ------------------
 2776|   124k|	    (cur->nodeTab[i]->type == XML_NAMESPACE_DECL) &&
  ------------------
  |  Branch (2776:6): [True: 124k, False: 0]
  ------------------
 2777|   124k|	    (((xmlNsPtr)cur->nodeTab[i])->next == (xmlNsPtr) node) &&
  ------------------
  |  Branch (2777:6): [True: 124k, False: 0]
  ------------------
 2778|   124k|	    (xmlStrEqual(ns->prefix, ((xmlNsPtr)cur->nodeTab[i])->prefix)))
  ------------------
  |  Branch (2778:6): [True: 0, False: 124k]
  ------------------
 2779|      0|	    return(0);
 2780|   124k|    }
 2781|       |
 2782|       |    /*
 2783|       |     * grow the nodeTab if needed
 2784|       |     */
 2785|   158k|    if (cur->nodeNr >= cur->nodeMax) {
  ------------------
  |  Branch (2785:9): [True: 9.53k, False: 149k]
  ------------------
 2786|  9.53k|        if (xmlXPathNodeSetGrow(cur) < 0)
  ------------------
  |  Branch (2786:13): [True: 11, False: 9.52k]
  ------------------
 2787|     11|            return(-1);
 2788|  9.53k|    }
 2789|   158k|    nsNode = xmlXPathNodeSetDupNs(node, ns);
 2790|   158k|    if(nsNode == NULL)
  ------------------
  |  Branch (2790:8): [True: 18, False: 158k]
  ------------------
 2791|     18|        return(-1);
 2792|   158k|    cur->nodeTab[cur->nodeNr++] = nsNode;
 2793|   158k|    return(0);
 2794|   158k|}
xmlXPathNodeSetAdd:
 2804|  1.80k|xmlXPathNodeSetAdd(xmlNodeSet *cur, xmlNode *val) {
 2805|  1.80k|    int i;
 2806|       |
 2807|  1.80k|    if ((cur == NULL) || (val == NULL)) return(-1);
  ------------------
  |  Branch (2807:9): [True: 0, False: 1.80k]
  |  Branch (2807:26): [True: 0, False: 1.80k]
  ------------------
 2808|       |
 2809|       |    /* @@ with_ns to check whether namespace nodes should be looked at @@ */
 2810|       |    /*
 2811|       |     * prevent duplicates
 2812|       |     */
 2813|  1.80k|    for (i = 0;i < cur->nodeNr;i++)
  ------------------
  |  Branch (2813:16): [True: 1.17k, False: 626]
  ------------------
 2814|  1.17k|        if (cur->nodeTab[i] == val) return(0);
  ------------------
  |  Branch (2814:13): [True: 1.17k, False: 0]
  ------------------
 2815|       |
 2816|       |    /*
 2817|       |     * grow the nodeTab if needed
 2818|       |     */
 2819|    626|    if (cur->nodeNr >= cur->nodeMax) {
  ------------------
  |  Branch (2819:9): [True: 626, False: 0]
  ------------------
 2820|    626|        if (xmlXPathNodeSetGrow(cur) < 0)
  ------------------
  |  Branch (2820:13): [True: 2, False: 624]
  ------------------
 2821|      2|            return(-1);
 2822|    626|    }
 2823|       |
 2824|    624|    if (val->type == XML_NAMESPACE_DECL) {
  ------------------
  |  Branch (2824:9): [True: 0, False: 624]
  ------------------
 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|    624|	cur->nodeTab[cur->nodeNr++] = val;
 2833|    624|    return(0);
 2834|    624|}
xmlXPathNodeSetAddUnique:
 2845|  5.05M|xmlXPathNodeSetAddUnique(xmlNodeSet *cur, xmlNode *val) {
 2846|  5.05M|    if ((cur == NULL) || (val == NULL)) return(-1);
  ------------------
  |  Branch (2846:9): [True: 0, False: 5.05M]
  |  Branch (2846:26): [True: 0, False: 5.05M]
  ------------------
 2847|       |
 2848|       |    /* @@ with_ns to check whether namespace nodes should be looked at @@ */
 2849|       |    /*
 2850|       |     * grow the nodeTab if needed
 2851|       |     */
 2852|  5.05M|    if (cur->nodeNr >= cur->nodeMax) {
  ------------------
  |  Branch (2852:9): [True: 1.26M, False: 3.79M]
  ------------------
 2853|  1.26M|        if (xmlXPathNodeSetGrow(cur) < 0)
  ------------------
  |  Branch (2853:13): [True: 163, False: 1.26M]
  ------------------
 2854|    163|            return(-1);
 2855|  1.26M|    }
 2856|       |
 2857|  5.05M|    if (val->type == XML_NAMESPACE_DECL) {
  ------------------
  |  Branch (2857:9): [True: 3.94k, False: 5.05M]
  ------------------
 2858|  3.94k|	xmlNsPtr ns = (xmlNsPtr) val;
 2859|  3.94k|        xmlNodePtr nsNode = xmlXPathNodeSetDupNs((xmlNodePtr) ns->next, ns);
 2860|       |
 2861|  3.94k|        if (nsNode == NULL)
  ------------------
  |  Branch (2861:13): [True: 8, False: 3.93k]
  ------------------
 2862|      8|            return(-1);
 2863|  3.93k|	cur->nodeTab[cur->nodeNr++] = nsNode;
 2864|  3.93k|    } else
 2865|  5.05M|	cur->nodeTab[cur->nodeNr++] = val;
 2866|  5.05M|    return(0);
 2867|  5.05M|}
xmlXPathNodeSetMerge:
 2880|  57.6k|xmlXPathNodeSetMerge(xmlNodeSet *val1, xmlNodeSet *val2) {
 2881|  57.6k|    int i, j, initNr, skip;
 2882|  57.6k|    xmlNodePtr n1, n2;
 2883|       |
 2884|  57.6k|    if (val1 == NULL) {
  ------------------
  |  Branch (2884:9): [True: 5, False: 57.6k]
  ------------------
 2885|      5|	val1 = xmlXPathNodeSetCreate(NULL);
 2886|      5|        if (val1 == NULL)
  ------------------
  |  Branch (2886:13): [True: 0, False: 5]
  ------------------
 2887|      0|            return (NULL);
 2888|      5|    }
 2889|  57.6k|    if (val2 == NULL)
  ------------------
  |  Branch (2889:9): [True: 22, False: 57.6k]
  ------------------
 2890|     22|        return(val1);
 2891|       |
 2892|       |    /* @@ with_ns to check whether namespace nodes should be looked at @@ */
 2893|  57.6k|    initNr = val1->nodeNr;
 2894|       |
 2895|   792k|    for (i = 0;i < val2->nodeNr;i++) {
  ------------------
  |  Branch (2895:16): [True: 735k, False: 57.5k]
  ------------------
 2896|   735k|	n2 = val2->nodeTab[i];
 2897|       |	/*
 2898|       |	 * check against duplicates
 2899|       |	 */
 2900|   735k|	skip = 0;
 2901|  14.4M|	for (j = 0; j < initNr; j++) {
  ------------------
  |  Branch (2901:14): [True: 13.7M, False: 627k]
  ------------------
 2902|  13.7M|	    n1 = val1->nodeTab[j];
 2903|  13.7M|	    if (n1 == n2) {
  ------------------
  |  Branch (2903:10): [True: 107k, False: 13.6M]
  ------------------
 2904|   107k|		skip = 1;
 2905|   107k|		break;
 2906|  13.6M|	    } else if ((n1->type == XML_NAMESPACE_DECL) &&
  ------------------
  |  Branch (2906:17): [True: 367, False: 13.6M]
  ------------------
 2907|    367|		       (n2->type == XML_NAMESPACE_DECL)) {
  ------------------
  |  Branch (2907:10): [True: 51, False: 316]
  ------------------
 2908|     51|		if ((((xmlNsPtr) n1)->next == ((xmlNsPtr) n2)->next) &&
  ------------------
  |  Branch (2908:7): [True: 51, False: 0]
  ------------------
 2909|     51|		    (xmlStrEqual(((xmlNsPtr) n1)->prefix,
  ------------------
  |  Branch (2909:7): [True: 29, False: 22]
  ------------------
 2910|     51|			((xmlNsPtr) n2)->prefix)))
 2911|     29|		{
 2912|     29|		    skip = 1;
 2913|     29|		    break;
 2914|     29|		}
 2915|     51|	    }
 2916|  13.7M|	}
 2917|   735k|	if (skip)
  ------------------
  |  Branch (2917:6): [True: 107k, False: 627k]
  ------------------
 2918|   107k|	    continue;
 2919|       |
 2920|       |	/*
 2921|       |	 * grow the nodeTab if needed
 2922|       |	 */
 2923|   627k|        if (val1->nodeNr >= val1->nodeMax) {
  ------------------
  |  Branch (2923:13): [True: 59.7k, False: 567k]
  ------------------
 2924|  59.7k|            if (xmlXPathNodeSetGrow(val1) < 0)
  ------------------
  |  Branch (2924:17): [True: 28, False: 59.7k]
  ------------------
 2925|     28|                goto error;
 2926|  59.7k|        }
 2927|   627k|	if (n2->type == XML_NAMESPACE_DECL) {
  ------------------
  |  Branch (2927:6): [True: 6.64k, False: 620k]
  ------------------
 2928|  6.64k|	    xmlNsPtr ns = (xmlNsPtr) n2;
 2929|  6.64k|            xmlNodePtr nsNode = xmlXPathNodeSetDupNs((xmlNodePtr) ns->next, ns);
 2930|       |
 2931|  6.64k|            if (nsNode == NULL)
  ------------------
  |  Branch (2931:17): [True: 27, False: 6.61k]
  ------------------
 2932|     27|                goto error;
 2933|  6.61k|	    val1->nodeTab[val1->nodeNr++] = nsNode;
 2934|  6.61k|	} else
 2935|   620k|	    val1->nodeTab[val1->nodeNr++] = n2;
 2936|   627k|    }
 2937|       |
 2938|  57.5k|    return(val1);
 2939|       |
 2940|     55|error:
 2941|     55|    xmlXPathFreeNodeSet(val1);
 2942|       |    return(NULL);
 2943|  57.6k|}
xmlXPathFreeNodeSet:
 3101|  2.18M|xmlXPathFreeNodeSet(xmlNodeSet *obj) {
 3102|  2.18M|    if (obj == NULL) return;
  ------------------
  |  Branch (3102:9): [True: 22, False: 2.18M]
  ------------------
 3103|  2.18M|    if (obj->nodeTab != NULL) {
  ------------------
  |  Branch (3103:9): [True: 1.57M, False: 607k]
  ------------------
 3104|  1.57M|	int i;
 3105|       |
 3106|       |	/* @@ with_ns to check whether namespace nodes should be looked at @@ */
 3107|  7.97M|	for (i = 0;i < obj->nodeNr;i++)
  ------------------
  |  Branch (3107:13): [True: 6.40M, False: 1.57M]
  ------------------
 3108|  6.40M|	    if ((obj->nodeTab[i] != NULL) &&
  ------------------
  |  Branch (3108:10): [True: 6.40M, False: 0]
  ------------------
 3109|  6.40M|		(obj->nodeTab[i]->type == XML_NAMESPACE_DECL))
  ------------------
  |  Branch (3109:3): [True: 169k, False: 6.23M]
  ------------------
 3110|   169k|		xmlXPathNodeSetFreeNs((xmlNsPtr) obj->nodeTab[i]);
 3111|  1.57M|	xmlFree(obj->nodeTab);
 3112|  1.57M|    }
 3113|  2.18M|    xmlFree(obj);
 3114|  2.18M|}
xmlXPathNewNodeSet:
 3191|  1.12M|xmlXPathNewNodeSet(xmlNode *val) {
 3192|  1.12M|    xmlXPathObjectPtr ret;
 3193|       |
 3194|  1.12M|    ret = (xmlXPathObjectPtr) xmlMalloc(sizeof(xmlXPathObject));
 3195|  1.12M|    if (ret == NULL)
  ------------------
  |  Branch (3195:9): [True: 158, False: 1.12M]
  ------------------
 3196|    158|	return(NULL);
 3197|  1.12M|    memset(ret, 0 , sizeof(xmlXPathObject));
 3198|  1.12M|    ret->type = XPATH_NODESET;
 3199|  1.12M|    ret->boolval = 0;
 3200|  1.12M|    ret->nodesetval = xmlXPathNodeSetCreate(val);
 3201|  1.12M|    if (ret->nodesetval == NULL) {
  ------------------
  |  Branch (3201:9): [True: 341, False: 1.12M]
  ------------------
 3202|    341|        xmlFree(ret);
 3203|    341|        return(NULL);
 3204|    341|    }
 3205|       |    /* @@ with_ns to check whether namespace nodes should be looked at @@ */
 3206|  1.12M|    return(ret);
 3207|  1.12M|}
xmlXPathWrapNodeSet:
 3267|  1.03M|xmlXPathWrapNodeSet(xmlNodeSet *val) {
 3268|  1.03M|    xmlXPathObjectPtr ret;
 3269|       |
 3270|  1.03M|    ret = (xmlXPathObjectPtr) xmlMalloc(sizeof(xmlXPathObject));
 3271|  1.03M|    if (ret == NULL) {
  ------------------
  |  Branch (3271:9): [True: 184, False: 1.03M]
  ------------------
 3272|    184|        xmlXPathFreeNodeSet(val);
 3273|    184|	return(NULL);
 3274|    184|    }
 3275|  1.03M|    memset(ret, 0 , sizeof(xmlXPathObject));
 3276|  1.03M|    ret->type = XPATH_NODESET;
 3277|  1.03M|    ret->nodesetval = val;
 3278|  1.03M|    return(ret);
 3279|  1.03M|}
xmlXPathFunctionLookup:
 3743|  7.32k|xmlXPathFunctionLookup(xmlXPathContext *ctxt, const xmlChar *name) {
 3744|       |    return(xmlXPathFunctionLookupNS(ctxt, name, NULL));
 3745|  7.32k|}
xmlXPathFunctionLookupNS:
 3758|  7.33k|			 const xmlChar *ns_uri) {
 3759|  7.33k|    xmlXPathFunction ret;
 3760|  7.33k|    void *payload;
 3761|       |
 3762|  7.33k|    if (ctxt == NULL)
  ------------------
  |  Branch (3762:9): [True: 0, False: 7.33k]
  ------------------
 3763|      0|	return(NULL);
 3764|  7.33k|    if (name == NULL)
  ------------------
  |  Branch (3764:9): [True: 0, False: 7.33k]
  ------------------
 3765|      0|	return(NULL);
 3766|       |
 3767|  7.33k|    if (ns_uri == NULL) {
  ------------------
  |  Branch (3767:9): [True: 7.32k, False: 9]
  ------------------
 3768|  7.32k|        int bucketIndex = xmlXPathSFComputeHash(name) % SF_HASH_SIZE;
  ------------------
  |  |  168|  7.32k|#define SF_HASH_SIZE 64
  ------------------
 3769|       |
 3770|  10.0k|        while (xmlXPathSFHash[bucketIndex] != UCHAR_MAX) {
  ------------------
  |  Branch (3770:16): [True: 9.54k, False: 519]
  ------------------
 3771|  9.54k|            int funcIndex = xmlXPathSFHash[bucketIndex];
 3772|       |
 3773|  9.54k|            if (strcmp(xmlXPathStandardFunctions[funcIndex].name,
  ------------------
  |  Branch (3773:17): [True: 6.80k, False: 2.74k]
  ------------------
 3774|  9.54k|                       (char *) name) == 0)
 3775|  6.80k|                return(xmlXPathStandardFunctions[funcIndex].func);
 3776|       |
 3777|  2.74k|            bucketIndex += 1;
 3778|  2.74k|            if (bucketIndex >= SF_HASH_SIZE)
  ------------------
  |  |  168|  2.74k|#define SF_HASH_SIZE 64
  ------------------
  |  Branch (3778:17): [True: 0, False: 2.74k]
  ------------------
 3779|      0|                bucketIndex = 0;
 3780|  2.74k|        }
 3781|  7.32k|    }
 3782|       |
 3783|    528|    if (ctxt->funcLookupFunc != NULL) {
  ------------------
  |  Branch (3783:9): [True: 0, False: 528]
  ------------------
 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|    528|    if (ctxt->funcHash == NULL)
  ------------------
  |  Branch (3792:9): [True: 528, False: 0]
  ------------------
 3793|    528|	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|    528|}
xmlXPathRegisteredFuncsCleanup:
 3807|  7.68k|xmlXPathRegisteredFuncsCleanup(xmlXPathContext *ctxt) {
 3808|  7.68k|    if (ctxt == NULL)
  ------------------
  |  Branch (3808:9): [True: 0, False: 7.68k]
  ------------------
 3809|      0|	return;
 3810|       |
 3811|  7.68k|    xmlHashFree(ctxt->funcHash, NULL);
 3812|       |    ctxt->funcHash = NULL;
 3813|  7.68k|}
xmlXPathVariableLookup:
 3891|     72|xmlXPathVariableLookup(xmlXPathContext *ctxt, const xmlChar *name) {
 3892|     72|    if (ctxt == NULL)
  ------------------
  |  Branch (3892:9): [True: 0, False: 72]
  ------------------
 3893|      0|	return(NULL);
 3894|       |
 3895|     72|    if (ctxt->varLookupFunc != NULL) {
  ------------------
  |  Branch (3895:9): [True: 0, False: 72]
  ------------------
 3896|      0|	xmlXPathObjectPtr ret;
 3897|       |
 3898|      0|	ret = ((xmlXPathVariableLookupFunc)ctxt->varLookupFunc)
 3899|      0|	        (ctxt->varLookupData, name, NULL);
 3900|      0|	return(ret);
 3901|      0|    }
 3902|     72|    return(xmlXPathVariableLookupNS(ctxt, name, NULL));
 3903|     72|}
xmlXPathVariableLookupNS:
 3916|     86|			 const xmlChar *ns_uri) {
 3917|     86|    if (ctxt == NULL)
  ------------------
  |  Branch (3917:9): [True: 0, False: 86]
  ------------------
 3918|      0|	return(NULL);
 3919|       |
 3920|     86|    if (ctxt->varLookupFunc != NULL) {
  ------------------
  |  Branch (3920:9): [True: 0, False: 86]
  ------------------
 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|     86|    if (ctxt->varHash == NULL)
  ------------------
  |  Branch (3928:9): [True: 86, False: 0]
  ------------------
 3929|     86|	return(NULL);
 3930|      0|    if (name == NULL)
  ------------------
  |  Branch (3930:9): [True: 0, False: 0]
  ------------------
 3931|      0|	return(NULL);
 3932|       |
 3933|      0|    return(xmlXPathObjectCopy(xmlHashLookup2(ctxt->varHash, name, ns_uri)));
 3934|      0|}
xmlXPathRegisteredVariablesCleanup:
 3942|  7.68k|xmlXPathRegisteredVariablesCleanup(xmlXPathContext *ctxt) {
 3943|  7.68k|    if (ctxt == NULL)
  ------------------
  |  Branch (3943:9): [True: 0, False: 7.68k]
  ------------------
 3944|      0|	return;
 3945|       |
 3946|  7.68k|    xmlHashFree(ctxt->varHash, xmlXPathFreeObjectEntry);
 3947|       |    ctxt->varHash = NULL;
 3948|  7.68k|}
xmlXPathRegisterNs:
 3961|    618|			   const xmlChar *ns_uri) {
 3962|    618|    xmlChar *copy;
 3963|       |
 3964|    618|    if (ctxt == NULL)
  ------------------
  |  Branch (3964:9): [True: 0, False: 618]
  ------------------
 3965|      0|	return(-1);
 3966|    618|    if (prefix == NULL)
  ------------------
  |  Branch (3966:9): [True: 0, False: 618]
  ------------------
 3967|      0|	return(-1);
 3968|    618|    if (prefix[0] == 0)
  ------------------
  |  Branch (3968:9): [True: 0, False: 618]
  ------------------
 3969|      0|	return(-1);
 3970|       |
 3971|    618|    if (ctxt->nsHash == NULL)
  ------------------
  |  Branch (3971:9): [True: 45, False: 573]
  ------------------
 3972|     45|	ctxt->nsHash = xmlHashCreate(10);
 3973|    618|    if (ctxt->nsHash == NULL) {
  ------------------
  |  Branch (3973:9): [True: 2, False: 616]
  ------------------
 3974|      2|        xmlXPathErrMemory(ctxt);
 3975|      2|	return(-1);
 3976|      2|    }
 3977|    616|    if (ns_uri == NULL)
  ------------------
  |  Branch (3977:9): [True: 0, False: 616]
  ------------------
 3978|      0|        return(xmlHashRemoveEntry(ctxt->nsHash, prefix,
 3979|      0|	                          xmlHashDefaultDeallocator));
 3980|       |
 3981|    616|    copy = xmlStrdup(ns_uri);
 3982|    616|    if (copy == NULL) {
  ------------------
  |  Branch (3982:9): [True: 1, False: 615]
  ------------------
 3983|      1|        xmlXPathErrMemory(ctxt);
 3984|      1|        return(-1);
 3985|      1|    }
 3986|    615|    if (xmlHashUpdateEntry(ctxt->nsHash, prefix, copy,
  ------------------
  |  Branch (3986:9): [True: 2, False: 613]
  ------------------
 3987|    615|                           xmlHashDefaultDeallocator) < 0) {
 3988|      2|        xmlXPathErrMemory(ctxt);
 3989|      2|        xmlFree(copy);
 3990|      2|        return(-1);
 3991|      2|    }
 3992|       |
 3993|    613|    return(0);
 3994|    615|}
xmlXPathNsLookup:
 4005|  10.2k|xmlXPathNsLookup(xmlXPathContext *ctxt, const xmlChar *prefix) {
 4006|  10.2k|    if (ctxt == NULL)
  ------------------
  |  Branch (4006:9): [True: 0, False: 10.2k]
  ------------------
 4007|      0|	return(NULL);
 4008|  10.2k|    if (prefix == NULL)
  ------------------
  |  Branch (4008:9): [True: 0, False: 10.2k]
  ------------------
 4009|      0|	return(NULL);
 4010|       |
 4011|  10.2k|    if (xmlStrEqual(prefix, (const xmlChar *) "xml"))
  ------------------
  |  Branch (4011:9): [True: 10.0k, False: 241]
  ------------------
 4012|  10.0k|	return(XML_XML_NAMESPACE);
  ------------------
  |  |  146|  10.0k|    (const xmlChar *) "http://www.w3.org/XML/1998/namespace"
  ------------------
 4013|       |
 4014|    241|    if (ctxt->namespaces != NULL) {
  ------------------
  |  Branch (4014:9): [True: 0, False: 241]
  ------------------
 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|    241|    return((const xmlChar *) xmlHashLookup(ctxt->nsHash, prefix));
 4025|    241|}
xmlXPathRegisteredNsCleanup:
 4033|  7.68k|xmlXPathRegisteredNsCleanup(xmlXPathContext *ctxt) {
 4034|  7.68k|    if (ctxt == NULL)
  ------------------
  |  Branch (4034:9): [True: 0, False: 7.68k]
  ------------------
 4035|      0|	return;
 4036|       |
 4037|  7.68k|    xmlHashFree(ctxt->nsHash, xmlHashDefaultDeallocator);
 4038|       |    ctxt->nsHash = NULL;
 4039|  7.68k|}
xmlXPathNewFloat:
 4056|   433k|xmlXPathNewFloat(double val) {
 4057|   433k|    xmlXPathObjectPtr ret;
 4058|       |
 4059|   433k|    ret = (xmlXPathObjectPtr) xmlMalloc(sizeof(xmlXPathObject));
 4060|   433k|    if (ret == NULL)
  ------------------
  |  Branch (4060:9): [True: 148, False: 433k]
  ------------------
 4061|    148|	return(NULL);
 4062|   433k|    memset(ret, 0 , sizeof(xmlXPathObject));
 4063|   433k|    ret->type = XPATH_NUMBER;
 4064|   433k|    ret->floatval = val;
 4065|   433k|    return(ret);
 4066|   433k|}
xmlXPathNewBoolean:
 4075|   519k|xmlXPathNewBoolean(int val) {
 4076|   519k|    xmlXPathObjectPtr ret;
 4077|       |
 4078|   519k|    ret = (xmlXPathObjectPtr) xmlMalloc(sizeof(xmlXPathObject));
 4079|   519k|    if (ret == NULL)
  ------------------
  |  Branch (4079:9): [True: 103, False: 519k]
  ------------------
 4080|    103|	return(NULL);
 4081|   519k|    memset(ret, 0 , sizeof(xmlXPathObject));
 4082|   519k|    ret->type = XPATH_BOOLEAN;
 4083|   519k|    ret->boolval = (val != 0);
 4084|   519k|    return(ret);
 4085|   519k|}
xmlXPathNewString:
 4094|   122k|xmlXPathNewString(const xmlChar *val) {
 4095|   122k|    xmlXPathObjectPtr ret;
 4096|       |
 4097|   122k|    ret = (xmlXPathObjectPtr) xmlMalloc(sizeof(xmlXPathObject));
 4098|   122k|    if (ret == NULL)
  ------------------
  |  Branch (4098:9): [True: 24, False: 122k]
  ------------------
 4099|     24|	return(NULL);
 4100|   122k|    memset(ret, 0 , sizeof(xmlXPathObject));
 4101|   122k|    ret->type = XPATH_STRING;
 4102|   122k|    if (val == NULL)
  ------------------
  |  Branch (4102:9): [True: 4, False: 122k]
  ------------------
 4103|      4|        val = BAD_CAST "";
  ------------------
  |  |   34|      4|#define BAD_CAST (xmlChar *)
  ------------------
 4104|   122k|    ret->stringval = xmlStrdup(val);
 4105|   122k|    if (ret->stringval == NULL) {
  ------------------
  |  Branch (4105:9): [True: 29, False: 122k]
  ------------------
 4106|     29|        xmlFree(ret);
 4107|     29|        return(NULL);
 4108|     29|    }
 4109|   122k|    return(ret);
 4110|   122k|}
xmlXPathWrapString:
 4121|  59.5k|xmlXPathWrapString (xmlChar *val) {
 4122|  59.5k|    xmlXPathObjectPtr ret;
 4123|       |
 4124|  59.5k|    ret = (xmlXPathObjectPtr) xmlMalloc(sizeof(xmlXPathObject));
 4125|  59.5k|    if (ret == NULL) {
  ------------------
  |  Branch (4125:9): [True: 51, False: 59.5k]
  ------------------
 4126|     51|        xmlFree(val);
 4127|     51|	return(NULL);
 4128|     51|    }
 4129|  59.5k|    memset(ret, 0 , sizeof(xmlXPathObject));
 4130|  59.5k|    ret->type = XPATH_STRING;
 4131|  59.5k|    ret->stringval = val;
 4132|  59.5k|    return(ret);
 4133|  59.5k|}
xmlXPathObjectCopy:
 4183|   339k|xmlXPathObjectCopy(xmlXPathObject *val) {
 4184|   339k|    xmlXPathObjectPtr ret;
 4185|       |
 4186|   339k|    if (val == NULL)
  ------------------
  |  Branch (4186:9): [True: 0, False: 339k]
  ------------------
 4187|      0|	return(NULL);
 4188|       |
 4189|   339k|    ret = (xmlXPathObjectPtr) xmlMalloc(sizeof(xmlXPathObject));
 4190|   339k|    if (ret == NULL)
  ------------------
  |  Branch (4190:9): [True: 96, False: 339k]
  ------------------
 4191|     96|	return(NULL);
 4192|   339k|    memcpy(ret, val , sizeof(xmlXPathObject));
 4193|   339k|    switch (val->type) {
 4194|      0|	case XPATH_BOOLEAN:
  ------------------
  |  Branch (4194:2): [True: 0, False: 339k]
  ------------------
 4195|   325k|	case XPATH_NUMBER:
  ------------------
  |  Branch (4195:2): [True: 325k, False: 14.4k]
  ------------------
 4196|   325k|	    break;
 4197|  14.4k|	case XPATH_STRING:
  ------------------
  |  Branch (4197:2): [True: 14.4k, False: 325k]
  ------------------
 4198|  14.4k|	    ret->stringval = xmlStrdup(val->stringval);
 4199|  14.4k|            if (ret->stringval == NULL) {
  ------------------
  |  Branch (4199:17): [True: 15, False: 14.4k]
  ------------------
 4200|     15|                xmlFree(ret);
 4201|     15|                return(NULL);
 4202|     15|            }
 4203|  14.4k|	    break;
 4204|  14.4k|	case XPATH_XSLT_TREE:
  ------------------
  |  Branch (4204:2): [True: 0, False: 339k]
  ------------------
 4205|      0|	case XPATH_NODESET:
  ------------------
  |  Branch (4205:2): [True: 0, False: 339k]
  ------------------
 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: 339k]
  ------------------
 4215|      0|	    ret->user = val->user;
 4216|      0|	    break;
 4217|      0|        default:
  ------------------
  |  Branch (4217:9): [True: 0, False: 339k]
  ------------------
 4218|      0|            xmlFree(ret);
 4219|      0|            ret = NULL;
 4220|      0|	    break;
 4221|   339k|    }
 4222|   339k|    return(ret);
 4223|   339k|}
xmlXPathFreeObject:
 4231|  3.62M|xmlXPathFreeObject(xmlXPathObject *obj) {
 4232|  3.62M|    if (obj == NULL) return;
  ------------------
  |  Branch (4232:9): [True: 0, False: 3.62M]
  ------------------
 4233|  3.62M|    if ((obj->type == XPATH_NODESET) || (obj->type == XPATH_XSLT_TREE)) {
  ------------------
  |  Branch (4233:9): [True: 2.15M, False: 1.47M]
  |  Branch (4233:41): [True: 0, False: 1.47M]
  ------------------
 4234|  2.15M|        if (obj->nodesetval != NULL)
  ------------------
  |  Branch (4234:13): [True: 2.15M, False: 63]
  ------------------
 4235|  2.15M|            xmlXPathFreeNodeSet(obj->nodesetval);
 4236|  2.15M|    } else if (obj->type == XPATH_STRING) {
  ------------------
  |  Branch (4236:16): [True: 196k, False: 1.27M]
  ------------------
 4237|   196k|	if (obj->stringval != NULL)
  ------------------
  |  Branch (4237:6): [True: 196k, False: 41]
  ------------------
 4238|   196k|	    xmlFree(obj->stringval);
 4239|   196k|    }
 4240|  3.62M|    xmlFree(obj);
 4241|  3.62M|}
xmlXPathCastBooleanToString:
 4354|  12.4k|xmlXPathCastBooleanToString (int val) {
 4355|  12.4k|    xmlChar *ret;
 4356|  12.4k|    if (val)
  ------------------
  |  Branch (4356:9): [True: 6.80k, False: 5.62k]
  ------------------
 4357|  6.80k|	ret = xmlStrdup((const xmlChar *) "true");
 4358|  5.62k|    else
 4359|  5.62k|	ret = xmlStrdup((const xmlChar *) "false");
 4360|  12.4k|    return(ret);
 4361|  12.4k|}
xmlXPathCastNumberToString:
 4370|  18.0k|xmlXPathCastNumberToString (double val) {
 4371|  18.0k|    xmlChar *ret;
 4372|  18.0k|    switch (xmlXPathIsInf(val)) {
 4373|    508|    case 1:
  ------------------
  |  Branch (4373:5): [True: 508, False: 17.5k]
  ------------------
 4374|    508|	ret = xmlStrdup((const xmlChar *) "Infinity");
 4375|    508|	break;
 4376|    273|    case -1:
  ------------------
  |  Branch (4376:5): [True: 273, False: 17.7k]
  ------------------
 4377|    273|	ret = xmlStrdup((const xmlChar *) "-Infinity");
 4378|    273|	break;
 4379|  17.2k|    default:
  ------------------
  |  Branch (4379:5): [True: 17.2k, False: 781]
  ------------------
 4380|  17.2k|	if (xmlXPathIsNaN(val)) {
  ------------------
  |  Branch (4380:6): [True: 1.68k, False: 15.5k]
  ------------------
 4381|  1.68k|	    ret = xmlStrdup((const xmlChar *) "NaN");
 4382|  15.5k|	} else if (val == 0) {
  ------------------
  |  Branch (4382:13): [True: 572, False: 14.9k]
  ------------------
 4383|       |            /* Omit sign for negative zero. */
 4384|    572|	    ret = xmlStrdup((const xmlChar *) "0");
 4385|  14.9k|	} else {
 4386|       |	    /* could be improved */
 4387|  14.9k|	    char buf[100];
 4388|  14.9k|	    xmlXPathFormatNumber(val, buf, 99);
 4389|  14.9k|	    buf[99] = 0;
 4390|  14.9k|	    ret = xmlStrdup((const xmlChar *) buf);
 4391|  14.9k|	}
 4392|  18.0k|    }
 4393|  18.0k|    return(ret);
 4394|  18.0k|}
xmlXPathCastNodeToString:
 4403|   423k|xmlXPathCastNodeToString (xmlNode *node) {
 4404|   423k|    return(xmlNodeGetContent(node));
 4405|   423k|}
xmlXPathCastNodeSetToString:
 4414|   506k|xmlXPathCastNodeSetToString (xmlNodeSet *ns) {
 4415|   506k|    if ((ns == NULL) || (ns->nodeNr == 0) || (ns->nodeTab == NULL))
  ------------------
  |  Branch (4415:9): [True: 0, False: 506k]
  |  Branch (4415:25): [True: 266k, False: 240k]
  |  Branch (4415:46): [True: 0, False: 240k]
  ------------------
 4416|   266k|	return(xmlStrdup((const xmlChar *) ""));
 4417|       |
 4418|   240k|    if (ns->nodeNr > 1)
  ------------------
  |  Branch (4418:9): [True: 29.1k, False: 211k]
  ------------------
 4419|  29.1k|	xmlXPathNodeSetSort(ns);
 4420|   240k|    return(xmlXPathCastNodeToString(ns->nodeTab[0]));
 4421|   506k|}
xmlXPathCastToString:
 4431|  55.9k|xmlXPathCastToString(xmlXPathObject *val) {
 4432|  55.9k|    xmlChar *ret = NULL;
 4433|       |
 4434|  55.9k|    if (val == NULL)
  ------------------
  |  Branch (4434:9): [True: 0, False: 55.9k]
  ------------------
 4435|      0|	return(xmlStrdup((const xmlChar *) ""));
 4436|  55.9k|    switch (val->type) {
  ------------------
  |  Branch (4436:13): [True: 55.9k, False: 0]
  ------------------
 4437|      0|	case XPATH_UNDEFINED:
  ------------------
  |  Branch (4437:2): [True: 0, False: 55.9k]
  ------------------
 4438|      0|	    ret = xmlStrdup((const xmlChar *) "");
 4439|      0|	    break;
 4440|  24.9k|        case XPATH_NODESET:
  ------------------
  |  Branch (4440:9): [True: 24.9k, False: 30.9k]
  ------------------
 4441|  24.9k|        case XPATH_XSLT_TREE:
  ------------------
  |  Branch (4441:9): [True: 0, False: 55.9k]
  ------------------
 4442|  24.9k|	    ret = xmlXPathCastNodeSetToString(val->nodesetval);
 4443|  24.9k|	    break;
 4444|    518|	case XPATH_STRING:
  ------------------
  |  Branch (4444:2): [True: 518, False: 55.4k]
  ------------------
 4445|    518|	    return(xmlStrdup(val->stringval));
 4446|  12.4k|        case XPATH_BOOLEAN:
  ------------------
  |  Branch (4446:9): [True: 12.4k, False: 43.4k]
  ------------------
 4447|  12.4k|	    ret = xmlXPathCastBooleanToString(val->boolval);
 4448|  12.4k|	    break;
 4449|  18.0k|	case XPATH_NUMBER: {
  ------------------
  |  Branch (4449:2): [True: 18.0k, False: 37.9k]
  ------------------
 4450|  18.0k|	    ret = xmlXPathCastNumberToString(val->floatval);
 4451|  18.0k|	    break;
 4452|  24.9k|	}
 4453|      0|	case XPATH_USERS:
  ------------------
  |  Branch (4453:2): [True: 0, False: 55.9k]
  ------------------
 4454|       |	    /* TODO */
 4455|      0|	    ret = xmlStrdup((const xmlChar *) "");
 4456|      0|	    break;
 4457|  55.9k|    }
 4458|  55.4k|    return(ret);
 4459|  55.9k|}
xmlXPathCastBooleanToNumber:
 4507|  46.4k|xmlXPathCastBooleanToNumber(int val) {
 4508|  46.4k|    if (val)
  ------------------
  |  Branch (4508:9): [True: 3.39k, False: 43.0k]
  ------------------
 4509|  3.39k|	return(1.0);
 4510|  43.0k|    return(0.0);
 4511|  46.4k|}
xmlXPathCastStringToNumber:
 4520|   690k|xmlXPathCastStringToNumber(const xmlChar * val) {
 4521|   690k|    return(xmlXPathStringEvalNumber(val));
 4522|   690k|}
xmlXPathCastNumberToBoolean:
 4617|  67.1k|xmlXPathCastNumberToBoolean (double val) {
 4618|  67.1k|     if (xmlXPathIsNaN(val) || (val == 0.0))
  ------------------
  |  Branch (4618:10): [True: 53.0k, False: 14.0k]
  |  Branch (4618:32): [True: 5.16k, False: 8.87k]
  ------------------
 4619|  58.2k|	 return(0);
 4620|  8.87k|     return(1);
 4621|  67.1k|}
xmlXPathCastStringToBoolean:
 4630|    269|xmlXPathCastStringToBoolean (const xmlChar *val) {
 4631|    269|    if ((val == NULL) || (xmlStrlen(val) == 0))
  ------------------
  |  Branch (4631:9): [True: 0, False: 269]
  |  Branch (4631:26): [True: 34, False: 235]
  ------------------
 4632|     34|	return(0);
 4633|    235|    return(1);
 4634|    269|}
xmlXPathCastNodeSetToBoolean:
 4643|  10.2k|xmlXPathCastNodeSetToBoolean (xmlNodeSet *ns) {
 4644|  10.2k|    if ((ns == NULL) || (ns->nodeNr == 0))
  ------------------
  |  Branch (4644:9): [True: 0, False: 10.2k]
  |  Branch (4644:25): [True: 9.13k, False: 1.13k]
  ------------------
 4645|  9.13k|	return(0);
 4646|  1.13k|    return(1);
 4647|  10.2k|}
xmlXPathCastToBoolean:
 4656|  13.8k|xmlXPathCastToBoolean (xmlXPathObject *val) {
 4657|  13.8k|    int ret = 0;
 4658|       |
 4659|  13.8k|    if (val == NULL)
  ------------------
  |  Branch (4659:9): [True: 0, False: 13.8k]
  ------------------
 4660|      0|	return(0);
 4661|  13.8k|    switch (val->type) {
  ------------------
  |  Branch (4661:13): [True: 13.8k, False: 0]
  ------------------
 4662|      0|    case XPATH_UNDEFINED:
  ------------------
  |  Branch (4662:5): [True: 0, False: 13.8k]
  ------------------
 4663|      0|	ret = 0;
 4664|      0|	break;
 4665|  10.2k|    case XPATH_NODESET:
  ------------------
  |  Branch (4665:5): [True: 10.2k, False: 3.59k]
  ------------------
 4666|  10.2k|    case XPATH_XSLT_TREE:
  ------------------
  |  Branch (4666:5): [True: 0, False: 13.8k]
  ------------------
 4667|  10.2k|	ret = xmlXPathCastNodeSetToBoolean(val->nodesetval);
 4668|  10.2k|	break;
 4669|    269|    case XPATH_STRING:
  ------------------
  |  Branch (4669:5): [True: 269, False: 13.5k]
  ------------------
 4670|    269|	ret = xmlXPathCastStringToBoolean(val->stringval);
 4671|    269|	break;
 4672|  3.32k|    case XPATH_NUMBER:
  ------------------
  |  Branch (4672:5): [True: 3.32k, False: 10.5k]
  ------------------
 4673|  3.32k|	ret = xmlXPathCastNumberToBoolean(val->floatval);
 4674|  3.32k|	break;
 4675|      0|    case XPATH_BOOLEAN:
  ------------------
  |  Branch (4675:5): [True: 0, False: 13.8k]
  ------------------
 4676|      0|	ret = val->boolval;
 4677|      0|	break;
 4678|      0|    case XPATH_USERS:
  ------------------
  |  Branch (4678:5): [True: 0, False: 13.8k]
  ------------------
 4679|       |	/* TODO */
 4680|      0|	ret = 0;
 4681|      0|	break;
 4682|  13.8k|    }
 4683|  13.8k|    return(ret);
 4684|  13.8k|}
xmlXPathNewContext:
 4720|  7.70k|xmlXPathNewContext(xmlDoc *doc) {
 4721|  7.70k|    xmlXPathContextPtr ret;
 4722|       |
 4723|  7.70k|    ret = (xmlXPathContextPtr) xmlMalloc(sizeof(xmlXPathContext));
 4724|  7.70k|    if (ret == NULL)
  ------------------
  |  Branch (4724:9): [True: 18, False: 7.68k]
  ------------------
 4725|     18|	return(NULL);
 4726|  7.68k|    memset(ret, 0 , sizeof(xmlXPathContext));
 4727|  7.68k|    ret->doc = doc;
 4728|  7.68k|    ret->node = NULL;
 4729|       |
 4730|  7.68k|    ret->varHash = NULL;
 4731|       |
 4732|  7.68k|    ret->nb_types = 0;
 4733|  7.68k|    ret->max_types = 0;
 4734|  7.68k|    ret->types = NULL;
 4735|       |
 4736|  7.68k|    ret->nb_axis = 0;
 4737|  7.68k|    ret->max_axis = 0;
 4738|  7.68k|    ret->axis = NULL;
 4739|       |
 4740|  7.68k|    ret->nsHash = NULL;
 4741|  7.68k|    ret->user = NULL;
 4742|       |
 4743|  7.68k|    ret->contextSize = -1;
 4744|  7.68k|    ret->proximityPosition = -1;
 4745|       |
 4746|       |#ifdef XP_DEFAULT_CACHE_ON
 4747|       |    if (xmlXPathContextSetCache(ret, 1, -1, 0) == -1) {
 4748|       |	xmlXPathFreeContext(ret);
 4749|       |	return(NULL);
 4750|       |    }
 4751|       |#endif
 4752|       |
 4753|  7.68k|    return(ret);
 4754|  7.70k|}
xmlXPathFreeContext:
 4762|  7.68k|xmlXPathFreeContext(xmlXPathContext *ctxt) {
 4763|  7.68k|    if (ctxt == NULL) return;
  ------------------
  |  Branch (4763:9): [True: 0, False: 7.68k]
  ------------------
 4764|       |
 4765|  7.68k|    if (ctxt->cache != NULL)
  ------------------
  |  Branch (4765:9): [True: 0, False: 7.68k]
  ------------------
 4766|      0|	xmlXPathFreeCache((xmlXPathContextCachePtr) ctxt->cache);
 4767|  7.68k|    xmlXPathRegisteredNsCleanup(ctxt);
 4768|  7.68k|    xmlXPathRegisteredFuncsCleanup(ctxt);
 4769|  7.68k|    xmlXPathRegisteredVariablesCleanup(ctxt);
 4770|  7.68k|    xmlResetError(&ctxt->lastError);
 4771|  7.68k|    xmlFree(ctxt);
 4772|  7.68k|}
xmlXPathSetErrorHandler:
 4785|  7.68k|                        xmlStructuredErrorFunc handler, void *data) {
 4786|  7.68k|    if (ctxt == NULL)
  ------------------
  |  Branch (4786:9): [True: 0, False: 7.68k]
  ------------------
 4787|      0|        return;
 4788|       |
 4789|  7.68k|    ctxt->error = handler;
 4790|  7.68k|    ctxt->userData = data;
 4791|  7.68k|}
xmlXPathNewParserContext:
 4807|  12.8k|xmlXPathNewParserContext(const xmlChar *str, xmlXPathContext *ctxt) {
 4808|  12.8k|    xmlXPathParserContextPtr ret;
 4809|       |
 4810|  12.8k|    ret = (xmlXPathParserContextPtr) xmlMalloc(sizeof(xmlXPathParserContext));
 4811|  12.8k|    if (ret == NULL) {
  ------------------
  |  Branch (4811:9): [True: 39, False: 12.7k]
  ------------------
 4812|     39|        xmlXPathErrMemory(ctxt);
 4813|     39|	return(NULL);
 4814|     39|    }
 4815|  12.7k|    memset(ret, 0 , sizeof(xmlXPathParserContext));
 4816|  12.7k|    ret->cur = ret->base = str;
 4817|  12.7k|    ret->context = ctxt;
 4818|       |
 4819|  12.7k|    ret->comp = xmlXPathNewCompExpr();
 4820|  12.7k|    if (ret->comp == NULL) {
  ------------------
  |  Branch (4820:9): [True: 65, False: 12.7k]
  ------------------
 4821|     65|        xmlXPathErrMemory(ctxt);
 4822|     65|	xmlFree(ret->valueTab);
 4823|     65|	xmlFree(ret);
 4824|     65|	return(NULL);
 4825|     65|    }
 4826|  12.7k|    if ((ctxt != NULL) && (ctxt->dict != NULL)) {
  ------------------
  |  Branch (4826:9): [True: 12.7k, False: 0]
  |  Branch (4826:27): [True: 0, False: 12.7k]
  ------------------
 4827|      0|        ret->comp->dict = ctxt->dict;
 4828|      0|	xmlDictReference(ret->comp->dict);
 4829|      0|    }
 4830|       |
 4831|  12.7k|    return(ret);
 4832|  12.7k|}
xmlXPathFreeParserContext:
 4879|  12.7k|xmlXPathFreeParserContext(xmlXPathParserContext *ctxt) {
 4880|  12.7k|    int i;
 4881|       |
 4882|  12.7k|    if (ctxt == NULL)
  ------------------
  |  Branch (4882:9): [True: 0, False: 12.7k]
  ------------------
 4883|      0|        return;
 4884|       |
 4885|  12.7k|    if (ctxt->valueTab != NULL) {
  ------------------
  |  Branch (4885:9): [True: 12.6k, False: 37]
  ------------------
 4886|  21.0k|        for (i = 0; i < ctxt->valueNr; i++) {
  ------------------
  |  Branch (4886:21): [True: 8.41k, False: 12.6k]
  ------------------
 4887|  8.41k|            if (ctxt->context)
  ------------------
  |  Branch (4887:17): [True: 8.41k, False: 0]
  ------------------
 4888|  8.41k|                xmlXPathReleaseObject(ctxt->context, ctxt->valueTab[i]);
 4889|      0|            else
 4890|      0|                xmlXPathFreeObject(ctxt->valueTab[i]);
 4891|  8.41k|        }
 4892|  12.6k|        xmlFree(ctxt->valueTab);
 4893|  12.6k|    }
 4894|  12.7k|    if (ctxt->comp != NULL) {
  ------------------
  |  Branch (4894:9): [True: 12.7k, False: 0]
  ------------------
 4895|       |#ifdef XPATH_STREAMING
 4896|       |	if (ctxt->comp->stream != NULL) {
 4897|       |	    xmlFreePatternList(ctxt->comp->stream);
 4898|       |	    ctxt->comp->stream = NULL;
 4899|       |	}
 4900|       |#endif
 4901|  12.7k|	xmlXPathFreeCompExpr(ctxt->comp);
 4902|  12.7k|    }
 4903|  12.7k|    xmlFree(ctxt);
 4904|  12.7k|}
xmlXPathEqualValues:
 5702|   326k|xmlXPathEqualValues(xmlXPathParserContext *ctxt) {
 5703|   326k|    xmlXPathObjectPtr arg1, arg2, argtmp;
 5704|   326k|    int ret = 0;
 5705|       |
 5706|   326k|    if ((ctxt == NULL) || (ctxt->context == NULL)) return(0);
  ------------------
  |  Branch (5706:9): [True: 0, False: 326k]
  |  Branch (5706:27): [True: 0, False: 326k]
  ------------------
 5707|   326k|    arg2 = xmlXPathValuePop(ctxt);
 5708|   326k|    arg1 = xmlXPathValuePop(ctxt);
 5709|   326k|    if ((arg1 == NULL) || (arg2 == NULL)) {
  ------------------
  |  Branch (5709:9): [True: 0, False: 326k]
  |  Branch (5709:27): [True: 0, False: 326k]
  ------------------
 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|   326k|    if (arg1 == arg2) {
  ------------------
  |  Branch (5717:9): [True: 0, False: 326k]
  ------------------
 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|   326k|    if ((arg2->type == XPATH_NODESET) || (arg2->type == XPATH_XSLT_TREE) ||
  ------------------
  |  Branch (5725:9): [True: 112k, False: 213k]
  |  Branch (5725:42): [True: 0, False: 213k]
  ------------------
 5726|   213k|      (arg1->type == XPATH_NODESET) || (arg1->type == XPATH_XSLT_TREE)) {
  ------------------
  |  Branch (5726:7): [True: 21.1k, False: 192k]
  |  Branch (5726:40): [True: 0, False: 192k]
  ------------------
 5727|       |	/*
 5728|       |	 *Hack it to assure arg1 is the nodeset
 5729|       |	 */
 5730|   133k|	if ((arg1->type != XPATH_NODESET) && (arg1->type != XPATH_XSLT_TREE)) {
  ------------------
  |  Branch (5730:6): [True: 97.6k, False: 36.2k]
  |  Branch (5730:39): [True: 97.6k, False: 0]
  ------------------
 5731|  97.6k|		argtmp = arg2;
 5732|  97.6k|		arg2 = arg1;
 5733|  97.6k|		arg1 = argtmp;
 5734|  97.6k|	}
 5735|   133k|	switch (arg2->type) {
  ------------------
  |  Branch (5735:10): [True: 133k, False: 0]
  ------------------
 5736|      0|	    case XPATH_UNDEFINED:
  ------------------
  |  Branch (5736:6): [True: 0, False: 133k]
  ------------------
 5737|      0|		break;
 5738|  15.0k|	    case XPATH_NODESET:
  ------------------
  |  Branch (5738:6): [True: 15.0k, False: 118k]
  ------------------
 5739|  15.0k|	    case XPATH_XSLT_TREE:
  ------------------
  |  Branch (5739:6): [True: 0, False: 133k]
  ------------------
 5740|  15.0k|		ret = xmlXPathEqualNodeSets(ctxt, arg1, arg2, 0);
 5741|  15.0k|		break;
 5742|  77.3k|	    case XPATH_BOOLEAN:
  ------------------
  |  Branch (5742:6): [True: 77.3k, False: 56.5k]
  ------------------
 5743|  77.3k|		if ((arg1->nodesetval == NULL) ||
  ------------------
  |  Branch (5743:7): [True: 0, False: 77.3k]
  ------------------
 5744|  77.3k|		  (arg1->nodesetval->nodeNr == 0)) ret = 0;
  ------------------
  |  Branch (5744:5): [True: 55.8k, False: 21.4k]
  ------------------
 5745|  21.4k|		else
 5746|  21.4k|		    ret = 1;
 5747|  77.3k|		ret = (ret == arg2->boolval);
 5748|  77.3k|		break;
 5749|  38.4k|	    case XPATH_NUMBER:
  ------------------
  |  Branch (5749:6): [True: 38.4k, False: 95.3k]
  ------------------
 5750|  38.4k|		ret = xmlXPathEqualNodeSetFloat(ctxt, arg1, arg2->floatval, 0);
 5751|  38.4k|		break;
 5752|  2.94k|	    case XPATH_STRING:
  ------------------
  |  Branch (5752:6): [True: 2.94k, False: 130k]
  ------------------
 5753|  2.94k|		ret = xmlXPathEqualNodeSetString(ctxt, arg1,
 5754|  2.94k|                                                 arg2->stringval, 0);
 5755|  2.94k|		break;
 5756|      0|	    case XPATH_USERS:
  ------------------
  |  Branch (5756:6): [True: 0, False: 133k]
  ------------------
 5757|       |		/* TODO */
 5758|      0|		break;
 5759|   133k|	}
 5760|   133k|	xmlXPathReleaseObject(ctxt->context, arg1);
 5761|   133k|	xmlXPathReleaseObject(ctxt->context, arg2);
 5762|   133k|	return(ret);
 5763|   133k|    }
 5764|       |
 5765|   192k|    return (xmlXPathEqualValuesCommon(ctxt, arg1, arg2));
 5766|   326k|}
xmlXPathNotEqualValues:
 5775|  7.19k|xmlXPathNotEqualValues(xmlXPathParserContext *ctxt) {
 5776|  7.19k|    xmlXPathObjectPtr arg1, arg2, argtmp;
 5777|  7.19k|    int ret = 0;
 5778|       |
 5779|  7.19k|    if ((ctxt == NULL) || (ctxt->context == NULL)) return(0);
  ------------------
  |  Branch (5779:9): [True: 0, False: 7.19k]
  |  Branch (5779:27): [True: 0, False: 7.19k]
  ------------------
 5780|  7.19k|    arg2 = xmlXPathValuePop(ctxt);
 5781|  7.19k|    arg1 = xmlXPathValuePop(ctxt);
 5782|  7.19k|    if ((arg1 == NULL) || (arg2 == NULL)) {
  ------------------
  |  Branch (5782:9): [True: 0, False: 7.19k]
  |  Branch (5782:27): [True: 0, False: 7.19k]
  ------------------
 5783|      0|	if (arg1 != NULL)
  ------------------
  |  Branch (5783:6): [True: 0, False: 0]
  ------------------
 5784|      0|	    xmlXPathReleaseObject(ctxt->context, arg1);
 5785|      0|	else
 5786|      0|	    xmlXPathReleaseObject(ctxt->context, arg2);
 5787|      0|	XP_ERROR0(XPATH_INVALID_OPERAND);
  ------------------
  |  |  252|      0|    { xmlXPathErr(ctxt, X); return(0); }
  ------------------
 5788|      0|    }
 5789|       |
 5790|  7.19k|    if (arg1 == arg2) {
  ------------------
  |  Branch (5790:9): [True: 0, False: 7.19k]
  ------------------
 5791|      0|	xmlXPathReleaseObject(ctxt->context, arg1);
 5792|      0|        return(0);
 5793|      0|    }
 5794|       |
 5795|       |    /*
 5796|       |     *If either argument is a nodeset, it's a 'special case'
 5797|       |     */
 5798|  7.19k|    if ((arg2->type == XPATH_NODESET) || (arg2->type == XPATH_XSLT_TREE) ||
  ------------------
  |  Branch (5798:9): [True: 4.48k, False: 2.71k]
  |  Branch (5798:42): [True: 0, False: 2.71k]
  ------------------
 5799|  5.58k|      (arg1->type == XPATH_NODESET) || (arg1->type == XPATH_XSLT_TREE)) {
  ------------------
  |  Branch (5799:7): [True: 1.10k, False: 1.60k]
  |  Branch (5799:40): [True: 0, False: 1.60k]
  ------------------
 5800|       |	/*
 5801|       |	 *Hack it to assure arg1 is the nodeset
 5802|       |	 */
 5803|  5.58k|	if ((arg1->type != XPATH_NODESET) && (arg1->type != XPATH_XSLT_TREE)) {
  ------------------
  |  Branch (5803:6): [True: 3.47k, False: 2.11k]
  |  Branch (5803:39): [True: 3.47k, False: 0]
  ------------------
 5804|  3.47k|		argtmp = arg2;
 5805|  3.47k|		arg2 = arg1;
 5806|  3.47k|		arg1 = argtmp;
 5807|  3.47k|	}
 5808|  5.58k|	switch (arg2->type) {
  ------------------
  |  Branch (5808:10): [True: 5.58k, False: 0]
  ------------------
 5809|      0|	    case XPATH_UNDEFINED:
  ------------------
  |  Branch (5809:6): [True: 0, False: 5.58k]
  ------------------
 5810|      0|		break;
 5811|  1.00k|	    case XPATH_NODESET:
  ------------------
  |  Branch (5811:6): [True: 1.00k, False: 4.57k]
  ------------------
 5812|  1.00k|	    case XPATH_XSLT_TREE:
  ------------------
  |  Branch (5812:6): [True: 0, False: 5.58k]
  ------------------
 5813|  1.00k|		ret = xmlXPathEqualNodeSets(ctxt, arg1, arg2, 1);
 5814|  1.00k|		break;
 5815|  1.59k|	    case XPATH_BOOLEAN:
  ------------------
  |  Branch (5815:6): [True: 1.59k, False: 3.99k]
  ------------------
 5816|  1.59k|		if ((arg1->nodesetval == NULL) ||
  ------------------
  |  Branch (5816:7): [True: 0, False: 1.59k]
  ------------------
 5817|  1.59k|		  (arg1->nodesetval->nodeNr == 0)) ret = 0;
  ------------------
  |  Branch (5817:5): [True: 1.09k, False: 499]
  ------------------
 5818|    499|		else
 5819|    499|		    ret = 1;
 5820|  1.59k|		ret = (ret != arg2->boolval);
 5821|  1.59k|		break;
 5822|  2.18k|	    case XPATH_NUMBER:
  ------------------
  |  Branch (5822:6): [True: 2.18k, False: 3.40k]
  ------------------
 5823|  2.18k|		ret = xmlXPathEqualNodeSetFloat(ctxt, arg1, arg2->floatval, 1);
 5824|  2.18k|		break;
 5825|    803|	    case XPATH_STRING:
  ------------------
  |  Branch (5825:6): [True: 803, False: 4.78k]
  ------------------
 5826|    803|		ret = xmlXPathEqualNodeSetString(ctxt, arg1,
 5827|    803|                                                 arg2->stringval, 1);
 5828|    803|		break;
 5829|      0|	    case XPATH_USERS:
  ------------------
  |  Branch (5829:6): [True: 0, False: 5.58k]
  ------------------
 5830|       |		/* TODO */
 5831|      0|		break;
 5832|  5.58k|	}
 5833|  5.58k|	xmlXPathReleaseObject(ctxt->context, arg1);
 5834|  5.58k|	xmlXPathReleaseObject(ctxt->context, arg2);
 5835|  5.58k|	return(ret);
 5836|  5.58k|    }
 5837|       |
 5838|  1.60k|    return (!xmlXPathEqualValuesCommon(ctxt, arg1, arg2));
 5839|  7.19k|}
xmlXPathCompareValues:
 5864|   200k|xmlXPathCompareValues(xmlXPathParserContext *ctxt, int inf, int strict) {
 5865|   200k|    int ret = 0, arg1i = 0, arg2i = 0;
 5866|   200k|    xmlXPathObjectPtr arg1, arg2;
 5867|       |
 5868|   200k|    if ((ctxt == NULL) || (ctxt->context == NULL)) return(0);
  ------------------
  |  Branch (5868:9): [True: 0, False: 200k]
  |  Branch (5868:27): [True: 0, False: 200k]
  ------------------
 5869|   200k|    arg2 = xmlXPathValuePop(ctxt);
 5870|   200k|    arg1 = xmlXPathValuePop(ctxt);
 5871|   200k|    if ((arg1 == NULL) || (arg2 == NULL)) {
  ------------------
  |  Branch (5871:9): [True: 12, False: 200k]
  |  Branch (5871:27): [True: 0, False: 200k]
  ------------------
 5872|     12|	if (arg1 != NULL)
  ------------------
  |  Branch (5872:6): [True: 0, False: 12]
  ------------------
 5873|      0|	    xmlXPathReleaseObject(ctxt->context, arg1);
 5874|     12|	else
 5875|     12|	    xmlXPathReleaseObject(ctxt->context, arg2);
 5876|     12|	XP_ERROR0(XPATH_INVALID_OPERAND);
  ------------------
  |  |  252|     12|    { xmlXPathErr(ctxt, X); return(0); }
  ------------------
 5877|      0|    }
 5878|       |
 5879|   200k|    if ((arg2->type == XPATH_NODESET) || (arg2->type == XPATH_XSLT_TREE) ||
  ------------------
  |  Branch (5879:9): [True: 109k, False: 90.5k]
  |  Branch (5879:42): [True: 0, False: 90.5k]
  ------------------
 5880|   131k|      (arg1->type == XPATH_NODESET) || (arg1->type == XPATH_XSLT_TREE)) {
  ------------------
  |  Branch (5880:7): [True: 21.5k, False: 69.0k]
  |  Branch (5880:40): [True: 0, False: 69.0k]
  ------------------
 5881|       |	/*
 5882|       |	 * If either argument is a XPATH_NODESET or XPATH_XSLT_TREE the two arguments
 5883|       |	 * are not freed from within this routine; they will be freed from the
 5884|       |	 * called routine, e.g. xmlXPathCompareNodeSets or xmlXPathCompareNodeSetValue
 5885|       |	 */
 5886|   131k|	if (((arg2->type == XPATH_NODESET) || (arg2->type == XPATH_XSLT_TREE)) &&
  ------------------
  |  Branch (5886:7): [True: 109k, False: 21.5k]
  |  Branch (5886:40): [True: 0, False: 21.5k]
  ------------------
 5887|   109k|	  ((arg1->type == XPATH_NODESET) || (arg1->type == XPATH_XSLT_TREE))){
  ------------------
  |  Branch (5887:5): [True: 60.4k, False: 49.2k]
  |  Branch (5887:38): [True: 0, False: 49.2k]
  ------------------
 5888|  60.4k|	    ret = xmlXPathCompareNodeSets(ctxt, inf, strict, arg1, arg2);
 5889|  70.7k|	} else {
 5890|  70.7k|	    if ((arg1->type == XPATH_NODESET) || (arg1->type == XPATH_XSLT_TREE)) {
  ------------------
  |  Branch (5890:10): [True: 21.5k, False: 49.2k]
  |  Branch (5890:43): [True: 0, False: 49.2k]
  ------------------
 5891|  21.5k|		ret = xmlXPathCompareNodeSetValue(ctxt, inf, strict,
 5892|  21.5k|			                          arg1, arg2);
 5893|  49.2k|	    } else {
 5894|  49.2k|		ret = xmlXPathCompareNodeSetValue(ctxt, !inf, strict,
 5895|  49.2k|			                          arg2, arg1);
 5896|  49.2k|	    }
 5897|  70.7k|	}
 5898|   131k|	return(ret);
 5899|   131k|    }
 5900|       |
 5901|  69.0k|    if (arg1->type != XPATH_NUMBER) {
  ------------------
  |  Branch (5901:9): [True: 19.5k, False: 49.5k]
  ------------------
 5902|  19.5k|	xmlXPathValuePush(ctxt, arg1);
 5903|  19.5k|	xmlXPathNumberFunction(ctxt, 1);
 5904|  19.5k|	arg1 = xmlXPathValuePop(ctxt);
 5905|  19.5k|    }
 5906|  69.0k|    if (arg2->type != XPATH_NUMBER) {
  ------------------
  |  Branch (5906:9): [True: 14.0k, False: 54.9k]
  ------------------
 5907|  14.0k|	xmlXPathValuePush(ctxt, arg2);
 5908|  14.0k|	xmlXPathNumberFunction(ctxt, 1);
 5909|  14.0k|	arg2 = xmlXPathValuePop(ctxt);
 5910|  14.0k|    }
 5911|  69.0k|    if (ctxt->error)
  ------------------
  |  Branch (5911:9): [True: 278, False: 68.7k]
  ------------------
 5912|    278|        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|  68.7k|    if (xmlXPathIsNaN(arg1->floatval) || xmlXPathIsNaN(arg2->floatval)) {
  ------------------
  |  Branch (5918:9): [True: 32.6k, False: 36.1k]
  |  Branch (5918:42): [True: 3.35k, False: 32.7k]
  ------------------
 5919|  35.9k|	ret=0;
 5920|  35.9k|    } else {
 5921|  32.7k|	arg1i=xmlXPathIsInf(arg1->floatval);
 5922|  32.7k|	arg2i=xmlXPathIsInf(arg2->floatval);
 5923|  32.7k|	if (inf && strict) {
  ------------------
  |  Branch (5923:6): [True: 21.8k, False: 10.9k]
  |  Branch (5923:13): [True: 20.1k, False: 1.71k]
  ------------------
 5924|  20.1k|	    if ((arg1i == -1 && arg2i != -1) ||
  ------------------
  |  Branch (5924:11): [True: 649, False: 19.4k]
  |  Branch (5924:26): [True: 259, False: 390]
  ------------------
 5925|  19.8k|		(arg2i == 1 && arg1i != 1)) {
  ------------------
  |  Branch (5925:4): [True: 663, False: 19.2k]
  |  Branch (5925:18): [True: 415, False: 248]
  ------------------
 5926|    674|		ret = 1;
 5927|  19.4k|	    } else if (arg1i == 0 && arg2i == 0) {
  ------------------
  |  Branch (5927:17): [True: 18.4k, False: 958]
  |  Branch (5927:31): [True: 17.5k, False: 982]
  ------------------
 5928|  17.5k|		ret = (arg1->floatval < arg2->floatval);
 5929|  17.5k|	    } else {
 5930|  1.94k|		ret = 0;
 5931|  1.94k|	    }
 5932|  20.1k|	}
 5933|  12.6k|	else if (inf && !strict) {
  ------------------
  |  Branch (5933:11): [True: 1.71k, False: 10.9k]
  |  Branch (5933:18): [True: 1.71k, False: 0]
  ------------------
 5934|  1.71k|	    if (arg1i == -1 || arg2i == 1) {
  ------------------
  |  Branch (5934:10): [True: 208, False: 1.50k]
  |  Branch (5934:25): [True: 302, False: 1.20k]
  ------------------
 5935|    510|		ret = 1;
 5936|  1.20k|	    } else if (arg1i == 0 && arg2i == 0) {
  ------------------
  |  Branch (5936:17): [True: 941, False: 262]
  |  Branch (5936:31): [True: 674, False: 267]
  ------------------
 5937|    674|		ret = (arg1->floatval <= arg2->floatval);
 5938|    674|	    } else {
 5939|    529|		ret = 0;
 5940|    529|	    }
 5941|  1.71k|	}
 5942|  10.9k|	else if (!inf && strict) {
  ------------------
  |  Branch (5942:11): [True: 10.9k, False: 0]
  |  Branch (5942:19): [True: 5.60k, False: 5.33k]
  ------------------
 5943|  5.60k|	    if ((arg1i == 1 && arg2i != 1) ||
  ------------------
  |  Branch (5943:11): [True: 822, False: 4.78k]
  |  Branch (5943:25): [True: 471, False: 351]
  ------------------
 5944|  5.13k|		(arg2i == -1 && arg1i != -1)) {
  ------------------
  |  Branch (5944:4): [True: 480, False: 4.65k]
  |  Branch (5944:19): [True: 227, False: 253]
  ------------------
 5945|    698|		ret = 1;
 5946|  4.91k|	    } else if (arg1i == 0 && arg2i == 0) {
  ------------------
  |  Branch (5946:17): [True: 4.09k, False: 817]
  |  Branch (5946:31): [True: 3.76k, False: 332]
  ------------------
 5947|  3.76k|		ret = (arg1->floatval > arg2->floatval);
 5948|  3.76k|	    } else {
 5949|  1.14k|		ret = 0;
 5950|  1.14k|	    }
 5951|  5.60k|	}
 5952|  5.33k|	else if (!inf && !strict) {
  ------------------
  |  Branch (5952:11): [True: 5.33k, False: 0]
  |  Branch (5952:19): [True: 5.33k, False: 0]
  ------------------
 5953|  5.33k|	    if (arg1i == 1 || arg2i == -1) {
  ------------------
  |  Branch (5953:10): [True: 2.96k, False: 2.36k]
  |  Branch (5953:24): [True: 218, False: 2.14k]
  ------------------
 5954|  3.18k|		ret = 1;
 5955|  3.18k|	    } else if (arg1i == 0 && arg2i == 0) {
  ------------------
  |  Branch (5955:17): [True: 1.55k, False: 592]
  |  Branch (5955:31): [True: 1.28k, False: 267]
  ------------------
 5956|  1.28k|		ret = (arg1->floatval >= arg2->floatval);
 5957|  1.28k|	    } else {
 5958|    859|		ret = 0;
 5959|    859|	    }
 5960|  5.33k|	}
 5961|  32.7k|    }
 5962|  69.0k|error:
 5963|  69.0k|    xmlXPathReleaseObject(ctxt->context, arg1);
 5964|  69.0k|    xmlXPathReleaseObject(ctxt->context, arg2);
 5965|  69.0k|    return(ret);
 5966|  68.7k|}
xmlXPathValueFlipSign:
 5976|   124k|xmlXPathValueFlipSign(xmlXPathParserContext *ctxt) {
 5977|   124k|    if ((ctxt == NULL) || (ctxt->context == NULL)) return;
  ------------------
  |  Branch (5977:9): [True: 0, False: 124k]
  |  Branch (5977:27): [True: 0, False: 124k]
  ------------------
 5978|   124k|    CAST_TO_NUMBER;
  ------------------
  |  |  297|   124k|    if ((ctxt->value != NULL) && (ctxt->value->type != XPATH_NUMBER))	\
  |  |  ------------------
  |  |  |  Branch (297:9): [True: 124k, False: 0]
  |  |  |  Branch (297:34): [True: 70.5k, False: 54.3k]
  |  |  ------------------
  |  |  298|   124k|        xmlXPathNumberFunction(ctxt, 1);
  ------------------
 5979|   124k|    CHECK_TYPE(XPATH_NUMBER);
  ------------------
  |  |  261|   124k|    if ((ctxt->value == NULL) || (ctxt->value->type != typeval))	\
  |  |  ------------------
  |  |  |  Branch (261:9): [True: 3, False: 124k]
  |  |  |  Branch (261:34): [True: 11, False: 124k]
  |  |  ------------------
  |  |  262|   124k|        XP_ERROR(XPATH_INVALID_TYPE)
  |  |  ------------------
  |  |  |  |  244|     14|    { xmlXPathErr(ctxt, X); return; }
  |  |  ------------------
  ------------------
 5980|   124k|    ctxt->value->floatval = -ctxt->value->floatval;
 5981|   124k|}
xmlXPathAddValues:
 5991|  81.1k|xmlXPathAddValues(xmlXPathParserContext *ctxt) {
 5992|  81.1k|    xmlXPathObjectPtr arg;
 5993|  81.1k|    double val;
 5994|       |
 5995|  81.1k|    arg = xmlXPathValuePop(ctxt);
 5996|  81.1k|    if (arg == NULL)
  ------------------
  |  Branch (5996:9): [True: 0, False: 81.1k]
  ------------------
 5997|  81.1k|	XP_ERROR(XPATH_INVALID_OPERAND);
  ------------------
  |  |  244|      0|    { xmlXPathErr(ctxt, X); return; }
  ------------------
 5998|  81.1k|    val = xmlXPathCastToNumberInternal(ctxt, arg);
 5999|  81.1k|    xmlXPathReleaseObject(ctxt->context, arg);
 6000|  81.1k|    CAST_TO_NUMBER;
  ------------------
  |  |  297|  81.1k|    if ((ctxt->value != NULL) && (ctxt->value->type != XPATH_NUMBER))	\
  |  |  ------------------
  |  |  |  Branch (297:9): [True: 81.1k, False: 0]
  |  |  |  Branch (297:34): [True: 67.2k, False: 13.9k]
  |  |  ------------------
  |  |  298|  81.1k|        xmlXPathNumberFunction(ctxt, 1);
  ------------------
 6001|  81.1k|    CHECK_TYPE(XPATH_NUMBER);
  ------------------
  |  |  261|  81.1k|    if ((ctxt->value == NULL) || (ctxt->value->type != typeval))	\
  |  |  ------------------
  |  |  |  Branch (261:9): [True: 3, False: 81.1k]
  |  |  |  Branch (261:34): [True: 5, False: 81.1k]
  |  |  ------------------
  |  |  262|  81.1k|        XP_ERROR(XPATH_INVALID_TYPE)
  |  |  ------------------
  |  |  |  |  244|      8|    { xmlXPathErr(ctxt, X); return; }
  |  |  ------------------
  ------------------
 6002|  81.1k|    ctxt->value->floatval += val;
 6003|  81.1k|}
xmlXPathSubValues:
 6013|  77.8k|xmlXPathSubValues(xmlXPathParserContext *ctxt) {
 6014|  77.8k|    xmlXPathObjectPtr arg;
 6015|  77.8k|    double val;
 6016|       |
 6017|  77.8k|    arg = xmlXPathValuePop(ctxt);
 6018|  77.8k|    if (arg == NULL)
  ------------------
  |  Branch (6018:9): [True: 0, False: 77.8k]
  ------------------
 6019|  77.8k|	XP_ERROR(XPATH_INVALID_OPERAND);
  ------------------
  |  |  244|      0|    { xmlXPathErr(ctxt, X); return; }
  ------------------
 6020|  77.8k|    val = xmlXPathCastToNumberInternal(ctxt, arg);
 6021|  77.8k|    xmlXPathReleaseObject(ctxt->context, arg);
 6022|  77.8k|    CAST_TO_NUMBER;
  ------------------
  |  |  297|  77.8k|    if ((ctxt->value != NULL) && (ctxt->value->type != XPATH_NUMBER))	\
  |  |  ------------------
  |  |  |  Branch (297:9): [True: 77.8k, False: 0]
  |  |  |  Branch (297:34): [True: 14.7k, False: 63.1k]
  |  |  ------------------
  |  |  298|  77.8k|        xmlXPathNumberFunction(ctxt, 1);
  ------------------
 6023|  77.8k|    CHECK_TYPE(XPATH_NUMBER);
  ------------------
  |  |  261|  77.8k|    if ((ctxt->value == NULL) || (ctxt->value->type != typeval))	\
  |  |  ------------------
  |  |  |  Branch (261:9): [True: 3, False: 77.8k]
  |  |  |  Branch (261:34): [True: 2, False: 77.8k]
  |  |  ------------------
  |  |  262|  77.8k|        XP_ERROR(XPATH_INVALID_TYPE)
  |  |  ------------------
  |  |  |  |  244|      5|    { xmlXPathErr(ctxt, X); return; }
  |  |  ------------------
  ------------------
 6024|  77.8k|    ctxt->value->floatval -= val;
 6025|  77.8k|}
xmlXPathMultValues:
 6035|   202k|xmlXPathMultValues(xmlXPathParserContext *ctxt) {
 6036|   202k|    xmlXPathObjectPtr arg;
 6037|   202k|    double val;
 6038|       |
 6039|   202k|    arg = xmlXPathValuePop(ctxt);
 6040|   202k|    if (arg == NULL)
  ------------------
  |  Branch (6040:9): [True: 0, False: 202k]
  ------------------
 6041|   202k|	XP_ERROR(XPATH_INVALID_OPERAND);
  ------------------
  |  |  244|      0|    { xmlXPathErr(ctxt, X); return; }
  ------------------
 6042|   202k|    val = xmlXPathCastToNumberInternal(ctxt, arg);
 6043|   202k|    xmlXPathReleaseObject(ctxt->context, arg);
 6044|   202k|    CAST_TO_NUMBER;
  ------------------
  |  |  297|   202k|    if ((ctxt->value != NULL) && (ctxt->value->type != XPATH_NUMBER))	\
  |  |  ------------------
  |  |  |  Branch (297:9): [True: 202k, False: 0]
  |  |  |  Branch (297:34): [True: 63.0k, False: 139k]
  |  |  ------------------
  |  |  298|   202k|        xmlXPathNumberFunction(ctxt, 1);
  ------------------
 6045|   202k|    CHECK_TYPE(XPATH_NUMBER);
  ------------------
  |  |  261|   202k|    if ((ctxt->value == NULL) || (ctxt->value->type != typeval))	\
  |  |  ------------------
  |  |  |  Branch (261:9): [True: 8, False: 202k]
  |  |  |  Branch (261:34): [True: 1, False: 202k]
  |  |  ------------------
  |  |  262|   202k|        XP_ERROR(XPATH_INVALID_TYPE)
  |  |  ------------------
  |  |  |  |  244|      9|    { xmlXPathErr(ctxt, X); return; }
  |  |  ------------------
  ------------------
 6046|   202k|    ctxt->value->floatval *= val;
 6047|   202k|}
xmlXPathDivValues:
 6058|  1.25k|xmlXPathDivValues(xmlXPathParserContext *ctxt) {
 6059|  1.25k|    xmlXPathObjectPtr arg;
 6060|  1.25k|    double val;
 6061|       |
 6062|  1.25k|    arg = xmlXPathValuePop(ctxt);
 6063|  1.25k|    if (arg == NULL)
  ------------------
  |  Branch (6063:9): [True: 0, False: 1.25k]
  ------------------
 6064|  1.25k|	XP_ERROR(XPATH_INVALID_OPERAND);
  ------------------
  |  |  244|      0|    { xmlXPathErr(ctxt, X); return; }
  ------------------
 6065|  1.25k|    val = xmlXPathCastToNumberInternal(ctxt, arg);
 6066|  1.25k|    xmlXPathReleaseObject(ctxt->context, arg);
 6067|  1.25k|    CAST_TO_NUMBER;
  ------------------
  |  |  297|  1.25k|    if ((ctxt->value != NULL) && (ctxt->value->type != XPATH_NUMBER))	\
  |  |  ------------------
  |  |  |  Branch (297:9): [True: 1.25k, False: 0]
  |  |  |  Branch (297:34): [True: 505, False: 746]
  |  |  ------------------
  |  |  298|  1.25k|        xmlXPathNumberFunction(ctxt, 1);
  ------------------
 6068|  1.25k|    CHECK_TYPE(XPATH_NUMBER);
  ------------------
  |  |  261|  1.25k|    if ((ctxt->value == NULL) || (ctxt->value->type != typeval))	\
  |  |  ------------------
  |  |  |  Branch (261:9): [True: 1, False: 1.25k]
  |  |  |  Branch (261:34): [True: 1, False: 1.24k]
  |  |  ------------------
  |  |  262|  1.25k|        XP_ERROR(XPATH_INVALID_TYPE)
  |  |  ------------------
  |  |  |  |  244|      2|    { xmlXPathErr(ctxt, X); return; }
  |  |  ------------------
  ------------------
 6069|  1.24k|    ctxt->value->floatval /= val;
 6070|  1.24k|}
xmlXPathModValues:
 6080|    857|xmlXPathModValues(xmlXPathParserContext *ctxt) {
 6081|    857|    xmlXPathObjectPtr arg;
 6082|    857|    double arg1, arg2;
 6083|       |
 6084|    857|    arg = xmlXPathValuePop(ctxt);
 6085|    857|    if (arg == NULL)
  ------------------
  |  Branch (6085:9): [True: 0, False: 857]
  ------------------
 6086|    857|	XP_ERROR(XPATH_INVALID_OPERAND);
  ------------------
  |  |  244|      0|    { xmlXPathErr(ctxt, X); return; }
  ------------------
 6087|    857|    arg2 = xmlXPathCastToNumberInternal(ctxt, arg);
 6088|    857|    xmlXPathReleaseObject(ctxt->context, arg);
 6089|    857|    CAST_TO_NUMBER;
  ------------------
  |  |  297|    857|    if ((ctxt->value != NULL) && (ctxt->value->type != XPATH_NUMBER))	\
  |  |  ------------------
  |  |  |  Branch (297:9): [True: 857, False: 0]
  |  |  |  Branch (297:34): [True: 401, False: 456]
  |  |  ------------------
  |  |  298|    857|        xmlXPathNumberFunction(ctxt, 1);
  ------------------
 6090|    857|    CHECK_TYPE(XPATH_NUMBER);
  ------------------
  |  |  261|    857|    if ((ctxt->value == NULL) || (ctxt->value->type != typeval))	\
  |  |  ------------------
  |  |  |  Branch (261:9): [True: 1, False: 856]
  |  |  |  Branch (261:34): [True: 1, False: 855]
  |  |  ------------------
  |  |  262|    857|        XP_ERROR(XPATH_INVALID_TYPE)
  |  |  ------------------
  |  |  |  |  244|      2|    { xmlXPathErr(ctxt, X); return; }
  |  |  ------------------
  ------------------
 6091|    855|    arg1 = ctxt->value->floatval;
 6092|    855|    if (arg2 == 0)
  ------------------
  |  Branch (6092:9): [True: 304, False: 551]
  ------------------
 6093|    304|	ctxt->value->floatval = xmlXPathNAN;
 6094|    551|    else {
 6095|    551|	ctxt->value->floatval = fmod(arg1, arg2);
 6096|    551|    }
 6097|    855|}
xmlXPathNextSelf:
 6138|    804|xmlXPathNextSelf(xmlXPathParserContext *ctxt, xmlNode *cur) {
 6139|    804|    if ((ctxt == NULL) || (ctxt->context == NULL)) return(NULL);
  ------------------
  |  Branch (6139:9): [True: 0, False: 804]
  |  Branch (6139:27): [True: 0, False: 804]
  ------------------
 6140|    804|    if (cur == NULL)
  ------------------
  |  Branch (6140:9): [True: 402, False: 402]
  ------------------
 6141|    402|        return(ctxt->context->node);
 6142|    402|    return(NULL);
 6143|    804|}
xmlXPathNextChild:
 6154|   200k|xmlXPathNextChild(xmlXPathParserContext *ctxt, xmlNode *cur) {
 6155|   200k|    if ((ctxt == NULL) || (ctxt->context == NULL)) return(NULL);
  ------------------
  |  Branch (6155:9): [True: 0, False: 200k]
  |  Branch (6155:27): [True: 0, False: 200k]
  ------------------
 6156|   200k|    if (cur == NULL) {
  ------------------
  |  Branch (6156:9): [True: 81.9k, False: 118k]
  ------------------
 6157|  81.9k|	if (ctxt->context->node == NULL) return(NULL);
  ------------------
  |  Branch (6157:6): [True: 0, False: 81.9k]
  ------------------
 6158|  81.9k|	switch (ctxt->context->node->type) {
  ------------------
  |  Branch (6158:10): [True: 81.9k, False: 0]
  ------------------
 6159|  20.1k|            case XML_ELEMENT_NODE:
  ------------------
  |  Branch (6159:13): [True: 20.1k, False: 61.8k]
  ------------------
 6160|  58.6k|            case XML_TEXT_NODE:
  ------------------
  |  Branch (6160:13): [True: 38.5k, False: 43.4k]
  ------------------
 6161|  70.7k|            case XML_CDATA_SECTION_NODE:
  ------------------
  |  Branch (6161:13): [True: 12.0k, False: 69.9k]
  ------------------
 6162|  70.7k|            case XML_ENTITY_REF_NODE:
  ------------------
  |  Branch (6162:13): [True: 0, False: 81.9k]
  ------------------
 6163|  70.7k|            case XML_ENTITY_NODE:
  ------------------
  |  Branch (6163:13): [True: 0, False: 81.9k]
  ------------------
 6164|  71.6k|            case XML_PI_NODE:
  ------------------
  |  Branch (6164:13): [True: 965, False: 81.0k]
  ------------------
 6165|  81.3k|            case XML_COMMENT_NODE:
  ------------------
  |  Branch (6165:13): [True: 9.64k, False: 72.3k]
  ------------------
 6166|  81.3k|            case XML_NOTATION_NODE:
  ------------------
  |  Branch (6166:13): [True: 0, False: 81.9k]
  ------------------
 6167|  81.3k|            case XML_DTD_NODE:
  ------------------
  |  Branch (6167:13): [True: 0, False: 81.9k]
  ------------------
 6168|  81.3k|		return(ctxt->context->node->children);
 6169|    440|            case XML_DOCUMENT_NODE:
  ------------------
  |  Branch (6169:13): [True: 440, False: 81.5k]
  ------------------
 6170|    440|            case XML_DOCUMENT_TYPE_NODE:
  ------------------
  |  Branch (6170:13): [True: 0, False: 81.9k]
  ------------------
 6171|    440|            case XML_DOCUMENT_FRAG_NODE:
  ------------------
  |  Branch (6171:13): [True: 0, False: 81.9k]
  ------------------
 6172|    440|            case XML_HTML_DOCUMENT_NODE:
  ------------------
  |  Branch (6172:13): [True: 0, False: 81.9k]
  ------------------
 6173|    440|		return(((xmlDocPtr) ctxt->context->node)->children);
 6174|      0|	    case XML_ELEMENT_DECL:
  ------------------
  |  Branch (6174:6): [True: 0, False: 81.9k]
  ------------------
 6175|      0|	    case XML_ATTRIBUTE_DECL:
  ------------------
  |  Branch (6175:6): [True: 0, False: 81.9k]
  ------------------
 6176|      0|	    case XML_ENTITY_DECL:
  ------------------
  |  Branch (6176:6): [True: 0, False: 81.9k]
  ------------------
 6177|    203|            case XML_ATTRIBUTE_NODE:
  ------------------
  |  Branch (6177:13): [True: 203, False: 81.7k]
  ------------------
 6178|    203|	    case XML_NAMESPACE_DECL:
  ------------------
  |  Branch (6178:6): [True: 0, False: 81.9k]
  ------------------
 6179|    203|	    case XML_XINCLUDE_START:
  ------------------
  |  Branch (6179:6): [True: 0, False: 81.9k]
  ------------------
 6180|    203|	    case XML_XINCLUDE_END:
  ------------------
  |  Branch (6180:6): [True: 0, False: 81.9k]
  ------------------
 6181|    203|		return(NULL);
 6182|  81.9k|	}
 6183|      0|	return(NULL);
 6184|  81.9k|    }
 6185|   118k|    if ((cur->type == XML_DOCUMENT_NODE) ||
  ------------------
  |  Branch (6185:9): [True: 0, False: 118k]
  ------------------
 6186|   118k|        (cur->type == XML_HTML_DOCUMENT_NODE))
  ------------------
  |  Branch (6186:9): [True: 0, False: 118k]
  ------------------
 6187|      0|	return(NULL);
 6188|   118k|    return(cur->next);
 6189|   118k|}
xmlXPathNextDescendant:
 6271|  4.70M|xmlXPathNextDescendant(xmlXPathParserContext *ctxt, xmlNode *cur) {
 6272|  4.70M|    if ((ctxt == NULL) || (ctxt->context == NULL)) return(NULL);
  ------------------
  |  Branch (6272:9): [True: 0, False: 4.70M]
  |  Branch (6272:27): [True: 0, False: 4.70M]
  ------------------
 6273|  4.70M|    if (cur == NULL) {
  ------------------
  |  Branch (6273:9): [True: 106k, False: 4.60M]
  ------------------
 6274|   106k|	if (ctxt->context->node == NULL)
  ------------------
  |  Branch (6274:6): [True: 0, False: 106k]
  ------------------
 6275|      0|	    return(NULL);
 6276|   106k|	if ((ctxt->context->node->type == XML_ATTRIBUTE_NODE) ||
  ------------------
  |  Branch (6276:6): [True: 375, False: 106k]
  ------------------
 6277|   106k|	    (ctxt->context->node->type == XML_NAMESPACE_DECL))
  ------------------
  |  Branch (6277:6): [True: 3.99k, False: 102k]
  ------------------
 6278|  4.36k|	    return(NULL);
 6279|       |
 6280|   102k|        if (ctxt->context->node == (xmlNodePtr) ctxt->context->doc)
  ------------------
  |  Branch (6280:13): [True: 36.3k, False: 65.8k]
  ------------------
 6281|  36.3k|	    return(ctxt->context->doc->children);
 6282|  65.8k|        return(ctxt->context->node->children);
 6283|   102k|    }
 6284|       |
 6285|  4.60M|    if (cur->type == XML_NAMESPACE_DECL)
  ------------------
  |  Branch (6285:9): [True: 0, False: 4.60M]
  ------------------
 6286|      0|        return(NULL);
 6287|  4.60M|    if (cur->children != NULL) {
  ------------------
  |  Branch (6287:9): [True: 1.14M, False: 3.45M]
  ------------------
 6288|       |	/*
 6289|       |	 * Do not descend on entities declarations
 6290|       |	 */
 6291|  1.14M|	if (cur->children->type != XML_ENTITY_DECL) {
  ------------------
  |  Branch (6291:6): [True: 1.14M, False: 3.95k]
  ------------------
 6292|  1.14M|	    cur = cur->children;
 6293|       |	    /*
 6294|       |	     * Skip DTDs
 6295|       |	     */
 6296|  1.14M|	    if (cur->type != XML_DTD_NODE)
  ------------------
  |  Branch (6296:10): [True: 1.14M, False: 1.39k]
  ------------------
 6297|  1.14M|		return(cur);
 6298|  1.14M|	}
 6299|  1.14M|    }
 6300|       |
 6301|  3.45M|    if (cur == ctxt->context->node) return(NULL);
  ------------------
  |  Branch (6301:9): [True: 2.01k, False: 3.45M]
  ------------------
 6302|       |
 6303|  3.45M|    while (cur->next != NULL) {
  ------------------
  |  Branch (6303:12): [True: 2.89M, False: 566k]
  ------------------
 6304|  2.89M|	cur = cur->next;
 6305|  2.89M|	if ((cur->type != XML_ENTITY_DECL) &&
  ------------------
  |  Branch (6305:6): [True: 2.89M, False: 794]
  ------------------
 6306|  2.89M|	    (cur->type != XML_DTD_NODE))
  ------------------
  |  Branch (6306:6): [True: 2.88M, False: 1.55k]
  ------------------
 6307|  2.88M|	    return(cur);
 6308|  2.89M|    }
 6309|       |
 6310|  1.18M|    do {
 6311|  1.18M|        cur = cur->parent;
 6312|  1.18M|	if (cur == NULL) break;
  ------------------
  |  Branch (6312:6): [True: 0, False: 1.18M]
  ------------------
 6313|  1.18M|	if (cur == ctxt->context->node) return(NULL);
  ------------------
  |  Branch (6313:6): [True: 159k, False: 1.02M]
  ------------------
 6314|  1.02M|	if (cur->next != NULL) {
  ------------------
  |  Branch (6314:6): [True: 407k, False: 618k]
  ------------------
 6315|   407k|	    cur = cur->next;
 6316|   407k|	    return(cur);
 6317|   407k|	}
 6318|  1.02M|    } while (cur != NULL);
  ------------------
  |  Branch (6318:14): [True: 618k, False: 0]
  ------------------
 6319|      0|    return(cur);
 6320|   566k|}
xmlXPathNextDescendantOrSelf:
 6334|  3.54M|xmlXPathNextDescendantOrSelf(xmlXPathParserContext *ctxt, xmlNode *cur) {
 6335|  3.54M|    if ((ctxt == NULL) || (ctxt->context == NULL)) return(NULL);
  ------------------
  |  Branch (6335:9): [True: 0, False: 3.54M]
  |  Branch (6335:27): [True: 0, False: 3.54M]
  ------------------
 6336|  3.54M|    if (cur == NULL)
  ------------------
  |  Branch (6336:9): [True: 133k, False: 3.41M]
  ------------------
 6337|   133k|        return(ctxt->context->node);
 6338|       |
 6339|  3.41M|    if (ctxt->context->node == NULL)
  ------------------
  |  Branch (6339:9): [True: 0, False: 3.41M]
  ------------------
 6340|      0|        return(NULL);
 6341|  3.41M|    if ((ctxt->context->node->type == XML_ATTRIBUTE_NODE) ||
  ------------------
  |  Branch (6341:9): [True: 718, False: 3.41M]
  ------------------
 6342|  3.41M|        (ctxt->context->node->type == XML_NAMESPACE_DECL))
  ------------------
  |  Branch (6342:9): [True: 3.93k, False: 3.40M]
  ------------------
 6343|  4.65k|        return(NULL);
 6344|       |
 6345|  3.40M|    return(xmlXPathNextDescendant(ctxt, cur));
 6346|  3.41M|}
xmlXPathNextParent:
 6357|   293k|xmlXPathNextParent(xmlXPathParserContext *ctxt, xmlNode *cur) {
 6358|   293k|    if ((ctxt == NULL) || (ctxt->context == NULL)) return(NULL);
  ------------------
  |  Branch (6358:9): [True: 0, False: 293k]
  |  Branch (6358:27): [True: 0, False: 293k]
  ------------------
 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|   293k|    if (cur == NULL) {
  ------------------
  |  Branch (6364:9): [True: 151k, False: 141k]
  ------------------
 6365|   151k|	if (ctxt->context->node == NULL) return(NULL);
  ------------------
  |  Branch (6365:6): [True: 0, False: 151k]
  ------------------
 6366|   151k|	switch (ctxt->context->node->type) {
  ------------------
  |  Branch (6366:10): [True: 151k, False: 0]
  ------------------
 6367|   102k|            case XML_ELEMENT_NODE:
  ------------------
  |  Branch (6367:13): [True: 102k, False: 48.5k]
  ------------------
 6368|   140k|            case XML_TEXT_NODE:
  ------------------
  |  Branch (6368:13): [True: 38.0k, False: 113k]
  ------------------
 6369|   141k|            case XML_CDATA_SECTION_NODE:
  ------------------
  |  Branch (6369:13): [True: 629, False: 150k]
  ------------------
 6370|   141k|            case XML_ENTITY_REF_NODE:
  ------------------
  |  Branch (6370:13): [True: 0, False: 151k]
  ------------------
 6371|   141k|            case XML_ENTITY_NODE:
  ------------------
  |  Branch (6371:13): [True: 0, False: 151k]
  ------------------
 6372|   141k|            case XML_PI_NODE:
  ------------------
  |  Branch (6372:13): [True: 446, False: 150k]
  ------------------
 6373|   143k|            case XML_COMMENT_NODE:
  ------------------
  |  Branch (6373:13): [True: 1.18k, False: 150k]
  ------------------
 6374|   143k|            case XML_NOTATION_NODE:
  ------------------
  |  Branch (6374:13): [True: 0, False: 151k]
  ------------------
 6375|   143k|            case XML_DTD_NODE:
  ------------------
  |  Branch (6375:13): [True: 0, False: 151k]
  ------------------
 6376|   143k|	    case XML_ELEMENT_DECL:
  ------------------
  |  Branch (6376:6): [True: 0, False: 151k]
  ------------------
 6377|   143k|	    case XML_ATTRIBUTE_DECL:
  ------------------
  |  Branch (6377:6): [True: 0, False: 151k]
  ------------------
 6378|   143k|	    case XML_XINCLUDE_START:
  ------------------
  |  Branch (6378:6): [True: 0, False: 151k]
  ------------------
 6379|   143k|	    case XML_XINCLUDE_END:
  ------------------
  |  Branch (6379:6): [True: 0, False: 151k]
  ------------------
 6380|   143k|	    case XML_ENTITY_DECL:
  ------------------
  |  Branch (6380:6): [True: 0, False: 151k]
  ------------------
 6381|   143k|		if (ctxt->context->node->parent == NULL)
  ------------------
  |  Branch (6381:7): [True: 0, False: 143k]
  ------------------
 6382|      0|		    return((xmlNodePtr) ctxt->context->doc);
 6383|   143k|		if ((ctxt->context->node->parent->type == XML_ELEMENT_NODE) &&
  ------------------
  |  Branch (6383:7): [True: 137k, False: 5.95k]
  ------------------
 6384|   137k|		    ((ctxt->context->node->parent->name[0] == ' ') ||
  ------------------
  |  Branch (6384:8): [True: 0, False: 137k]
  ------------------
 6385|   137k|		     (xmlStrEqual(ctxt->context->node->parent->name,
  ------------------
  |  Branch (6385:8): [True: 0, False: 137k]
  ------------------
 6386|   137k|				 BAD_CAST "fake node libxslt"))))
  ------------------
  |  |   34|   137k|#define BAD_CAST (xmlChar *)
  ------------------
 6387|      0|		    return(NULL);
 6388|   143k|		return(ctxt->context->node->parent);
 6389|    315|            case XML_ATTRIBUTE_NODE: {
  ------------------
  |  Branch (6389:13): [True: 315, False: 151k]
  ------------------
 6390|    315|		xmlAttrPtr att = (xmlAttrPtr) ctxt->context->node;
 6391|       |
 6392|    315|		return(att->parent);
 6393|   143k|	    }
 6394|  7.59k|            case XML_DOCUMENT_NODE:
  ------------------
  |  Branch (6394:13): [True: 7.59k, False: 143k]
  ------------------
 6395|  7.59k|            case XML_DOCUMENT_TYPE_NODE:
  ------------------
  |  Branch (6395:13): [True: 0, False: 151k]
  ------------------
 6396|  7.59k|            case XML_DOCUMENT_FRAG_NODE:
  ------------------
  |  Branch (6396:13): [True: 0, False: 151k]
  ------------------
 6397|  7.59k|            case XML_HTML_DOCUMENT_NODE:
  ------------------
  |  Branch (6397:13): [True: 0, False: 151k]
  ------------------
 6398|  7.59k|                return(NULL);
 6399|    268|	    case XML_NAMESPACE_DECL: {
  ------------------
  |  Branch (6399:6): [True: 268, False: 151k]
  ------------------
 6400|    268|		xmlNsPtr ns = (xmlNsPtr) ctxt->context->node;
 6401|       |
 6402|    268|		if ((ns->next != NULL) &&
  ------------------
  |  Branch (6402:7): [True: 268, False: 0]
  ------------------
 6403|    268|		    (ns->next->type != XML_NAMESPACE_DECL))
  ------------------
  |  Branch (6403:7): [True: 268, False: 0]
  ------------------
 6404|    268|		    return((xmlNodePtr) ns->next);
 6405|      0|                return(NULL);
 6406|    268|	    }
 6407|   151k|	}
 6408|   151k|    }
 6409|   141k|    return(NULL);
 6410|   293k|}
xmlXPathNextAncestor:
 6425|   161k|xmlXPathNextAncestor(xmlXPathParserContext *ctxt, xmlNode *cur) {
 6426|   161k|    if ((ctxt == NULL) || (ctxt->context == NULL)) return(NULL);
  ------------------
  |  Branch (6426:9): [True: 0, False: 161k]
  |  Branch (6426:27): [True: 0, False: 161k]
  ------------------
 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|   161k|    if (cur == NULL) {
  ------------------
  |  Branch (6432:9): [True: 26.0k, False: 135k]
  ------------------
 6433|  26.0k|	if (ctxt->context->node == NULL) return(NULL);
  ------------------
  |  Branch (6433:6): [True: 0, False: 26.0k]
  ------------------
 6434|  26.0k|	switch (ctxt->context->node->type) {
  ------------------
  |  Branch (6434:10): [True: 26.0k, False: 0]
  ------------------
 6435|  23.6k|            case XML_ELEMENT_NODE:
  ------------------
  |  Branch (6435:13): [True: 23.6k, False: 2.44k]
  ------------------
 6436|  24.8k|            case XML_TEXT_NODE:
  ------------------
  |  Branch (6436:13): [True: 1.24k, False: 24.8k]
  ------------------
 6437|  24.9k|            case XML_CDATA_SECTION_NODE:
  ------------------
  |  Branch (6437:13): [True: 130, False: 25.9k]
  ------------------
 6438|  24.9k|            case XML_ENTITY_REF_NODE:
  ------------------
  |  Branch (6438:13): [True: 0, False: 26.0k]
  ------------------
 6439|  24.9k|            case XML_ENTITY_NODE:
  ------------------
  |  Branch (6439:13): [True: 0, False: 26.0k]
  ------------------
 6440|  25.3k|            case XML_PI_NODE:
  ------------------
  |  Branch (6440:13): [True: 332, False: 25.7k]
  ------------------
 6441|  25.4k|            case XML_COMMENT_NODE:
  ------------------
  |  Branch (6441:13): [True: 80, False: 25.9k]
  ------------------
 6442|  25.4k|	    case XML_DTD_NODE:
  ------------------
  |  Branch (6442:6): [True: 0, False: 26.0k]
  ------------------
 6443|  25.4k|	    case XML_ELEMENT_DECL:
  ------------------
  |  Branch (6443:6): [True: 0, False: 26.0k]
  ------------------
 6444|  25.4k|	    case XML_ATTRIBUTE_DECL:
  ------------------
  |  Branch (6444:6): [True: 0, False: 26.0k]
  ------------------
 6445|  25.4k|	    case XML_ENTITY_DECL:
  ------------------
  |  Branch (6445:6): [True: 0, False: 26.0k]
  ------------------
 6446|  25.4k|            case XML_NOTATION_NODE:
  ------------------
  |  Branch (6446:13): [True: 0, False: 26.0k]
  ------------------
 6447|  25.4k|	    case XML_XINCLUDE_START:
  ------------------
  |  Branch (6447:6): [True: 0, False: 26.0k]
  ------------------
 6448|  25.4k|	    case XML_XINCLUDE_END:
  ------------------
  |  Branch (6448:6): [True: 0, False: 26.0k]
  ------------------
 6449|  25.4k|		if (ctxt->context->node->parent == NULL)
  ------------------
  |  Branch (6449:7): [True: 0, False: 25.4k]
  ------------------
 6450|      0|		    return((xmlNodePtr) ctxt->context->doc);
 6451|  25.4k|		if ((ctxt->context->node->parent->type == XML_ELEMENT_NODE) &&
  ------------------
  |  Branch (6451:7): [True: 24.4k, False: 923]
  ------------------
 6452|  24.4k|		    ((ctxt->context->node->parent->name[0] == ' ') ||
  ------------------
  |  Branch (6452:8): [True: 0, False: 24.4k]
  ------------------
 6453|  24.4k|		     (xmlStrEqual(ctxt->context->node->parent->name,
  ------------------
  |  Branch (6453:8): [True: 0, False: 24.4k]
  ------------------
 6454|  24.4k|				 BAD_CAST "fake node libxslt"))))
  ------------------
  |  |   34|  24.4k|#define BAD_CAST (xmlChar *)
  ------------------
 6455|      0|		    return(NULL);
 6456|  25.4k|		return(ctxt->context->node->parent);
 6457|     58|            case XML_ATTRIBUTE_NODE: {
  ------------------
  |  Branch (6457:13): [True: 58, False: 26.0k]
  ------------------
 6458|     58|		xmlAttrPtr tmp = (xmlAttrPtr) ctxt->context->node;
 6459|       |
 6460|     58|		return(tmp->parent);
 6461|  25.4k|	    }
 6462|    598|            case XML_DOCUMENT_NODE:
  ------------------
  |  Branch (6462:13): [True: 598, False: 25.4k]
  ------------------
 6463|    598|            case XML_DOCUMENT_TYPE_NODE:
  ------------------
  |  Branch (6463:13): [True: 0, False: 26.0k]
  ------------------
 6464|    598|            case XML_DOCUMENT_FRAG_NODE:
  ------------------
  |  Branch (6464:13): [True: 0, False: 26.0k]
  ------------------
 6465|    598|            case XML_HTML_DOCUMENT_NODE:
  ------------------
  |  Branch (6465:13): [True: 0, False: 26.0k]
  ------------------
 6466|    598|                return(NULL);
 6467|      0|	    case XML_NAMESPACE_DECL: {
  ------------------
  |  Branch (6467:6): [True: 0, False: 26.0k]
  ------------------
 6468|      0|		xmlNsPtr ns = (xmlNsPtr) ctxt->context->node;
 6469|       |
 6470|      0|		if ((ns->next != NULL) &&
  ------------------
  |  Branch (6470:7): [True: 0, False: 0]
  ------------------
 6471|      0|		    (ns->next->type != XML_NAMESPACE_DECL))
  ------------------
  |  Branch (6471:7): [True: 0, False: 0]
  ------------------
 6472|      0|		    return((xmlNodePtr) ns->next);
 6473|       |		/* Bad, how did that namespace end up here ? */
 6474|      0|                return(NULL);
 6475|      0|	    }
 6476|  26.0k|	}
 6477|      0|	return(NULL);
 6478|  26.0k|    }
 6479|   135k|    if (cur == ctxt->context->doc->children)
  ------------------
  |  Branch (6479:9): [True: 3.81k, False: 131k]
  ------------------
 6480|  3.81k|	return((xmlNodePtr) ctxt->context->doc);
 6481|   131k|    if (cur == (xmlNodePtr) ctxt->context->doc)
  ------------------
  |  Branch (6481:9): [True: 29.0k, False: 102k]
  ------------------
 6482|  29.0k|	return(NULL);
 6483|   102k|    switch (cur->type) {
  ------------------
  |  Branch (6483:13): [True: 102k, False: 0]
  ------------------
 6484|   100k|	case XML_ELEMENT_NODE:
  ------------------
  |  Branch (6484:2): [True: 100k, False: 2.23k]
  ------------------
 6485|   101k|	case XML_TEXT_NODE:
  ------------------
  |  Branch (6485:2): [True: 1.43k, False: 100k]
  ------------------
 6486|   101k|	case XML_CDATA_SECTION_NODE:
  ------------------
  |  Branch (6486:2): [True: 194, False: 102k]
  ------------------
 6487|   101k|	case XML_ENTITY_REF_NODE:
  ------------------
  |  Branch (6487:2): [True: 0, False: 102k]
  ------------------
 6488|   101k|	case XML_ENTITY_NODE:
  ------------------
  |  Branch (6488:2): [True: 0, False: 102k]
  ------------------
 6489|   102k|	case XML_PI_NODE:
  ------------------
  |  Branch (6489:2): [True: 369, False: 101k]
  ------------------
 6490|   102k|	case XML_COMMENT_NODE:
  ------------------
  |  Branch (6490:2): [True: 40, False: 102k]
  ------------------
 6491|   102k|	case XML_NOTATION_NODE:
  ------------------
  |  Branch (6491:2): [True: 0, False: 102k]
  ------------------
 6492|   102k|	case XML_DTD_NODE:
  ------------------
  |  Branch (6492:2): [True: 0, False: 102k]
  ------------------
 6493|   102k|        case XML_ELEMENT_DECL:
  ------------------
  |  Branch (6493:9): [True: 0, False: 102k]
  ------------------
 6494|   102k|        case XML_ATTRIBUTE_DECL:
  ------------------
  |  Branch (6494:9): [True: 0, False: 102k]
  ------------------
 6495|   102k|        case XML_ENTITY_DECL:
  ------------------
  |  Branch (6495:9): [True: 0, False: 102k]
  ------------------
 6496|   102k|	case XML_XINCLUDE_START:
  ------------------
  |  Branch (6496:2): [True: 0, False: 102k]
  ------------------
 6497|   102k|	case XML_XINCLUDE_END:
  ------------------
  |  Branch (6497:2): [True: 0, False: 102k]
  ------------------
 6498|   102k|	    if (cur->parent == NULL)
  ------------------
  |  Branch (6498:10): [True: 0, False: 102k]
  ------------------
 6499|      0|		return(NULL);
 6500|   102k|	    if ((cur->parent->type == XML_ELEMENT_NODE) &&
  ------------------
  |  Branch (6500:10): [True: 77.8k, False: 24.2k]
  ------------------
 6501|  77.8k|		((cur->parent->name[0] == ' ') ||
  ------------------
  |  Branch (6501:4): [True: 0, False: 77.8k]
  ------------------
 6502|  77.8k|		 (xmlStrEqual(cur->parent->name,
  ------------------
  |  Branch (6502:4): [True: 0, False: 77.8k]
  ------------------
 6503|  77.8k|			      BAD_CAST "fake node libxslt"))))
  ------------------
  |  |   34|  77.8k|#define BAD_CAST (xmlChar *)
  ------------------
 6504|      0|		return(NULL);
 6505|   102k|	    return(cur->parent);
 6506|    199|	case XML_ATTRIBUTE_NODE: {
  ------------------
  |  Branch (6506:2): [True: 199, False: 102k]
  ------------------
 6507|    199|	    xmlAttrPtr att = (xmlAttrPtr) cur;
 6508|       |
 6509|    199|	    return(att->parent);
 6510|   102k|	}
 6511|      0|	case XML_NAMESPACE_DECL: {
  ------------------
  |  Branch (6511:2): [True: 0, False: 102k]
  ------------------
 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: 102k]
  ------------------
 6521|      0|	case XML_DOCUMENT_TYPE_NODE:
  ------------------
  |  Branch (6521:2): [True: 0, False: 102k]
  ------------------
 6522|      0|	case XML_DOCUMENT_FRAG_NODE:
  ------------------
  |  Branch (6522:2): [True: 0, False: 102k]
  ------------------
 6523|      0|	case XML_HTML_DOCUMENT_NODE:
  ------------------
  |  Branch (6523:2): [True: 0, False: 102k]
  ------------------
 6524|      0|	    return(NULL);
 6525|   102k|    }
 6526|      0|    return(NULL);
 6527|   102k|}
xmlXPathNextAncestorOrSelf:
 6541|  36.0k|xmlXPathNextAncestorOrSelf(xmlXPathParserContext *ctxt, xmlNode *cur) {
 6542|  36.0k|    if ((ctxt == NULL) || (ctxt->context == NULL)) return(NULL);
  ------------------
  |  Branch (6542:9): [True: 0, False: 36.0k]
  |  Branch (6542:27): [True: 0, False: 36.0k]
  ------------------
 6543|  36.0k|    if (cur == NULL)
  ------------------
  |  Branch (6543:9): [True: 3.60k, False: 32.4k]
  ------------------
 6544|  3.60k|        return(ctxt->context->node);
 6545|  32.4k|    return(xmlXPathNextAncestor(ctxt, cur));
 6546|  36.0k|}
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|  10.1k|xmlXPathNextFollowing(xmlXPathParserContext *ctxt, xmlNode *cur) {
 6623|  10.1k|    if ((ctxt == NULL) || (ctxt->context == NULL)) return(NULL);
  ------------------
  |  Branch (6623:9): [True: 0, False: 10.1k]
  |  Branch (6623:27): [True: 0, False: 10.1k]
  ------------------
 6624|  10.1k|    if ((cur != NULL) && (cur->type  != XML_ATTRIBUTE_NODE) &&
  ------------------
  |  Branch (6624:9): [True: 8.60k, False: 1.55k]
  |  Branch (6624:26): [True: 8.60k, False: 0]
  ------------------
 6625|  8.60k|        (cur->type != XML_NAMESPACE_DECL) && (cur->children != NULL))
  ------------------
  |  Branch (6625:9): [True: 8.60k, False: 0]
  |  Branch (6625:46): [True: 570, False: 8.03k]
  ------------------
 6626|    570|        return(cur->children);
 6627|       |
 6628|  9.58k|    if (cur == NULL) {
  ------------------
  |  Branch (6628:9): [True: 1.55k, False: 8.03k]
  ------------------
 6629|  1.55k|        cur = ctxt->context->node;
 6630|  1.55k|        if (cur->type == XML_ATTRIBUTE_NODE) {
  ------------------
  |  Branch (6630:13): [True: 80, False: 1.47k]
  ------------------
 6631|     80|            cur = cur->parent;
 6632|  1.47k|        } else if (cur->type == XML_NAMESPACE_DECL) {
  ------------------
  |  Branch (6632:20): [True: 0, False: 1.47k]
  ------------------
 6633|      0|            xmlNsPtr ns = (xmlNsPtr) cur;
 6634|       |
 6635|      0|            if ((ns->next == NULL) ||
  ------------------
  |  Branch (6635:17): [True: 0, False: 0]
  ------------------
 6636|      0|                (ns->next->type == XML_NAMESPACE_DECL))
  ------------------
  |  Branch (6636:17): [True: 0, False: 0]
  ------------------
 6637|      0|                return (NULL);
 6638|      0|            cur = (xmlNodePtr) ns->next;
 6639|      0|        }
 6640|  1.55k|    }
 6641|       |
 6642|       |    /* ERROR */
 6643|  9.58k|    if (cur == NULL)
  ------------------
  |  Branch (6643:9): [True: 0, False: 9.58k]
  ------------------
 6644|      0|        return(NULL);
 6645|       |
 6646|  9.58k|    if (cur->type == XML_DOCUMENT_NODE)
  ------------------
  |  Branch (6646:9): [True: 177, False: 9.41k]
  ------------------
 6647|    177|        return(NULL);
 6648|       |
 6649|  9.41k|    if (cur->next != NULL)
  ------------------
  |  Branch (6649:9): [True: 7.45k, False: 1.95k]
  ------------------
 6650|  7.45k|        return(cur->next);
 6651|       |
 6652|  3.33k|    do {
 6653|  3.33k|        cur = cur->parent;
 6654|  3.33k|        if (cur == NULL)
  ------------------
  |  Branch (6654:13): [True: 0, False: 3.33k]
  ------------------
 6655|      0|            break;
 6656|  3.33k|        if (cur == (xmlNodePtr) ctxt->context->doc)
  ------------------
  |  Branch (6656:13): [True: 1.37k, False: 1.95k]
  ------------------
 6657|  1.37k|            return(NULL);
 6658|  1.95k|        if (cur->next != NULL && cur->type != XML_DOCUMENT_NODE)
  ------------------
  |  Branch (6658:13): [True: 581, False: 1.37k]
  |  Branch (6658:34): [True: 581, False: 0]
  ------------------
 6659|    581|            return(cur->next);
 6660|  1.95k|    } while (cur != NULL);
  ------------------
  |  Branch (6660:14): [True: 1.37k, False: 0]
  ------------------
 6661|       |
 6662|      0|    return(cur);
 6663|  1.95k|}
xmlXPathNextNamespace:
 6814|   223k|xmlXPathNextNamespace(xmlXPathParserContext *ctxt, xmlNode *cur) {
 6815|   223k|    if ((ctxt == NULL) || (ctxt->context == NULL)) return(NULL);
  ------------------
  |  Branch (6815:9): [True: 0, False: 223k]
  |  Branch (6815:27): [True: 0, False: 223k]
  ------------------
 6816|   223k|    if (ctxt->context->node->type != XML_ELEMENT_NODE) return(NULL);
  ------------------
  |  Branch (6816:9): [True: 8.11k, False: 215k]
  ------------------
 6817|   215k|    if (cur == NULL) {
  ------------------
  |  Branch (6817:9): [True: 72.3k, False: 143k]
  ------------------
 6818|  72.3k|        if (ctxt->context->tmpNsList != NULL)
  ------------------
  |  Branch (6818:13): [True: 18.9k, False: 53.4k]
  ------------------
 6819|  18.9k|	    xmlFree(ctxt->context->tmpNsList);
 6820|  72.3k|	ctxt->context->tmpNsNr = 0;
 6821|  72.3k|        if (xmlGetNsListSafe(ctxt->context->doc, ctxt->context->node,
  ------------------
  |  Branch (6821:13): [True: 6, False: 72.3k]
  ------------------
 6822|  72.3k|                             &ctxt->context->tmpNsList) < 0) {
 6823|      6|            xmlXPathPErrMemory(ctxt);
 6824|      6|            return(NULL);
 6825|      6|        }
 6826|  72.3k|        if (ctxt->context->tmpNsList != NULL) {
  ------------------
  |  Branch (6826:13): [True: 71.5k, False: 842]
  ------------------
 6827|   181k|            while (ctxt->context->tmpNsList[ctxt->context->tmpNsNr] != NULL) {
  ------------------
  |  Branch (6827:20): [True: 109k, False: 71.5k]
  ------------------
 6828|   109k|                ctxt->context->tmpNsNr++;
 6829|   109k|            }
 6830|  71.5k|        }
 6831|  72.3k|	return((xmlNodePtr) xmlXPathXMLNamespace);
 6832|  72.3k|    }
 6833|   143k|    if (ctxt->context->tmpNsNr > 0) {
  ------------------
  |  Branch (6833:9): [True: 90.5k, False: 52.8k]
  ------------------
 6834|  90.5k|	return (xmlNodePtr)ctxt->context->tmpNsList[--ctxt->context->tmpNsNr];
 6835|  90.5k|    } else {
 6836|  52.8k|	if (ctxt->context->tmpNsList != NULL)
  ------------------
  |  Branch (6836:6): [True: 52.2k, False: 640]
  ------------------
 6837|  52.2k|	    xmlFree(ctxt->context->tmpNsList);
 6838|  52.8k|	ctxt->context->tmpNsList = NULL;
 6839|       |	return(NULL);
 6840|  52.8k|    }
 6841|   143k|}
xmlXPathNextAttribute:
 6852|   234k|xmlXPathNextAttribute(xmlXPathParserContext *ctxt, xmlNode *cur) {
 6853|   234k|    if ((ctxt == NULL) || (ctxt->context == NULL)) return(NULL);
  ------------------
  |  Branch (6853:9): [True: 0, False: 234k]
  |  Branch (6853:27): [True: 0, False: 234k]
  ------------------
 6854|   234k|    if (ctxt->context->node == NULL)
  ------------------
  |  Branch (6854:9): [True: 0, False: 234k]
  ------------------
 6855|      0|	return(NULL);
 6856|   234k|    if (ctxt->context->node->type != XML_ELEMENT_NODE)
  ------------------
  |  Branch (6856:9): [True: 42.5k, False: 192k]
  ------------------
 6857|  42.5k|	return(NULL);
 6858|   192k|    if (cur == NULL) {
  ------------------
  |  Branch (6858:9): [True: 182k, False: 9.67k]
  ------------------
 6859|   182k|        if (ctxt->context->node == (xmlNodePtr) ctxt->context->doc)
  ------------------
  |  Branch (6859:13): [True: 0, False: 182k]
  ------------------
 6860|      0|	    return(NULL);
 6861|   182k|        return((xmlNodePtr)ctxt->context->node->properties);
 6862|   182k|    }
 6863|  9.67k|    return((xmlNodePtr)cur->next);
 6864|   192k|}
xmlXPathRoot:
 6887|   324k|xmlXPathRoot(xmlXPathParserContext *ctxt) {
 6888|   324k|    if ((ctxt == NULL) || (ctxt->context == NULL))
  ------------------
  |  Branch (6888:9): [True: 0, False: 324k]
  |  Branch (6888:27): [True: 0, False: 324k]
  ------------------
 6889|      0|	return;
 6890|   324k|    xmlXPathValuePush(ctxt, xmlXPathCacheNewNodeSet(ctxt,
 6891|   324k|                                            (xmlNodePtr) ctxt->context->doc));
 6892|   324k|}
xmlXPathLastFunction:
 6911|    896|xmlXPathLastFunction(xmlXPathParserContext *ctxt, int nargs) {
 6912|  2.68k|    CHECK_ARITY(0);
  ------------------
  |  |  280|    896|    if (ctxt == NULL) return;						\
  |  |  ------------------
  |  |  |  Branch (280:9): [True: 0, False: 896]
  |  |  ------------------
  |  |  281|    896|    if (nargs != (x))							\
  |  |  ------------------
  |  |  |  Branch (281:9): [True: 3, False: 893]
  |  |  ------------------
  |  |  282|    896|        XP_ERROR(XPATH_INVALID_ARITY);					\
  |  |  ------------------
  |  |  |  |  244|      3|    { xmlXPathErr(ctxt, X); return; }
  |  |  ------------------
  |  |  283|    893|    if (ctxt->valueNr < (x))						\
  |  |  ------------------
  |  |  |  Branch (283:9): [True: 0, False: 893]
  |  |  ------------------
  |  |  284|    893|        XP_ERROR(XPATH_STACK_ERROR);
  |  |  ------------------
  |  |  |  |  244|      0|    { xmlXPathErr(ctxt, X); return; }
  |  |  ------------------
  ------------------
 6913|  2.68k|    if (ctxt->context->contextSize >= 0) {
  ------------------
  |  Branch (6913:9): [True: 893, False: 0]
  ------------------
 6914|    893|	xmlXPathValuePush(ctxt,
 6915|    893|	    xmlXPathCacheNewFloat(ctxt, (double) ctxt->context->contextSize));
 6916|    893|    } else {
 6917|      0|	XP_ERROR(XPATH_INVALID_CTXT_SIZE);
  ------------------
  |  |  244|      0|    { xmlXPathErr(ctxt, X); return; }
  ------------------
 6918|      0|    }
 6919|  2.68k|}
xmlXPathPositionFunction:
 6932|  12.0k|xmlXPathPositionFunction(xmlXPathParserContext *ctxt, int nargs) {
 6933|  36.0k|    CHECK_ARITY(0);
  ------------------
  |  |  280|  12.0k|    if (ctxt == NULL) return;						\
  |  |  ------------------
  |  |  |  Branch (280:9): [True: 0, False: 12.0k]
  |  |  ------------------
  |  |  281|  12.0k|    if (nargs != (x))							\
  |  |  ------------------
  |  |  |  Branch (281:9): [True: 1, False: 12.0k]
  |  |  ------------------
  |  |  282|  12.0k|        XP_ERROR(XPATH_INVALID_ARITY);					\
  |  |  ------------------
  |  |  |  |  244|      1|    { xmlXPathErr(ctxt, X); return; }
  |  |  ------------------
  |  |  283|  12.0k|    if (ctxt->valueNr < (x))						\
  |  |  ------------------
  |  |  |  Branch (283:9): [True: 0, False: 12.0k]
  |  |  ------------------
  |  |  284|  12.0k|        XP_ERROR(XPATH_STACK_ERROR);
  |  |  ------------------
  |  |  |  |  244|      0|    { xmlXPathErr(ctxt, X); return; }
  |  |  ------------------
  ------------------
 6934|  36.0k|    if (ctxt->context->proximityPosition >= 0) {
  ------------------
  |  Branch (6934:9): [True: 12.0k, False: 0]
  ------------------
 6935|  12.0k|	xmlXPathValuePush(ctxt, xmlXPathCacheNewFloat(ctxt,
 6936|  12.0k|            (double) ctxt->context->proximityPosition));
 6937|  12.0k|    } else {
 6938|      0|	XP_ERROR(XPATH_INVALID_CTXT_POSITION);
  ------------------
  |  |  244|      0|    { xmlXPathErr(ctxt, X); return; }
  ------------------
 6939|      0|    }
 6940|  36.0k|}
xmlXPathCountFunction:
 6950|     51|xmlXPathCountFunction(xmlXPathParserContext *ctxt, int nargs) {
 6951|     51|    xmlXPathObjectPtr cur;
 6952|       |
 6953|    147|    CHECK_ARITY(1);
  ------------------
  |  |  280|     51|    if (ctxt == NULL) return;						\
  |  |  ------------------
  |  |  |  Branch (280:9): [True: 0, False: 51]
  |  |  ------------------
  |  |  281|     51|    if (nargs != (x))							\
  |  |  ------------------
  |  |  |  Branch (281:9): [True: 3, False: 48]
  |  |  ------------------
  |  |  282|     51|        XP_ERROR(XPATH_INVALID_ARITY);					\
  |  |  ------------------
  |  |  |  |  244|      3|    { xmlXPathErr(ctxt, X); return; }
  |  |  ------------------
  |  |  283|     48|    if (ctxt->valueNr < (x))						\
  |  |  ------------------
  |  |  |  Branch (283:9): [True: 0, False: 48]
  |  |  ------------------
  |  |  284|     48|        XP_ERROR(XPATH_STACK_ERROR);
  |  |  ------------------
  |  |  |  |  244|      0|    { xmlXPathErr(ctxt, X); return; }
  |  |  ------------------
  ------------------
 6954|    147|    if ((ctxt->value == NULL) ||
  ------------------
  |  Branch (6954:9): [True: 0, False: 48]
  ------------------
 6955|     48|	((ctxt->value->type != XPATH_NODESET) &&
  ------------------
  |  Branch (6955:3): [True: 3, False: 45]
  ------------------
 6956|      3|	 (ctxt->value->type != XPATH_XSLT_TREE)))
  ------------------
  |  Branch (6956:3): [True: 3, False: 0]
  ------------------
 6957|     45|	XP_ERROR(XPATH_INVALID_TYPE);
  ------------------
  |  |  244|      3|    { xmlXPathErr(ctxt, X); return; }
  ------------------
 6958|     45|    cur = xmlXPathValuePop(ctxt);
 6959|       |
 6960|     45|    if ((cur == NULL) || (cur->nodesetval == NULL))
  ------------------
  |  Branch (6960:9): [True: 0, False: 45]
  |  Branch (6960:26): [True: 0, False: 45]
  ------------------
 6961|      0|	xmlXPathValuePush(ctxt, xmlXPathCacheNewFloat(ctxt, 0.0));
 6962|     45|    else
 6963|     45|	xmlXPathValuePush(ctxt, xmlXPathCacheNewFloat(ctxt,
 6964|     45|	    (double) cur->nodesetval->nodeNr));
 6965|     45|    xmlXPathReleaseObject(ctxt->context, cur);
 6966|     45|}
xmlXPathIdFunction:
 7047|  5.93k|xmlXPathIdFunction(xmlXPathParserContext *ctxt, int nargs) {
 7048|  5.93k|    xmlChar *tokens;
 7049|  5.93k|    xmlNodeSetPtr ret;
 7050|  5.93k|    xmlXPathObjectPtr obj;
 7051|       |
 7052|  17.7k|    CHECK_ARITY(1);
  ------------------
  |  |  280|  5.93k|    if (ctxt == NULL) return;						\
  |  |  ------------------
  |  |  |  Branch (280:9): [True: 0, False: 5.93k]
  |  |  ------------------
  |  |  281|  5.93k|    if (nargs != (x))							\
  |  |  ------------------
  |  |  |  Branch (281:9): [True: 3, False: 5.93k]
  |  |  ------------------
  |  |  282|  5.93k|        XP_ERROR(XPATH_INVALID_ARITY);					\
  |  |  ------------------
  |  |  |  |  244|      3|    { xmlXPathErr(ctxt, X); return; }
  |  |  ------------------
  |  |  283|  5.93k|    if (ctxt->valueNr < (x))						\
  |  |  ------------------
  |  |  |  Branch (283:9): [True: 12, False: 5.92k]
  |  |  ------------------
  |  |  284|  5.93k|        XP_ERROR(XPATH_STACK_ERROR);
  |  |  ------------------
  |  |  |  |  244|     12|    { xmlXPathErr(ctxt, X); return; }
  |  |  ------------------
  ------------------
 7053|  17.7k|    obj = xmlXPathValuePop(ctxt);
 7054|  17.7k|    if (obj == NULL) XP_ERROR(XPATH_INVALID_OPERAND);
  ------------------
  |  |  244|      0|    { xmlXPathErr(ctxt, X); return; }
  ------------------
  |  Branch (7054:9): [True: 0, False: 5.92k]
  ------------------
 7055|  5.92k|    if ((obj->type == XPATH_NODESET) || (obj->type == XPATH_XSLT_TREE)) {
  ------------------
  |  Branch (7055:9): [True: 1.31k, False: 4.61k]
  |  Branch (7055:41): [True: 0, False: 4.61k]
  ------------------
 7056|  1.31k|	xmlNodeSetPtr ns;
 7057|  1.31k|	int i;
 7058|       |
 7059|  1.31k|	ret = xmlXPathNodeSetCreate(NULL);
 7060|  1.31k|        if (ret == NULL)
  ------------------
  |  Branch (7060:13): [True: 6, False: 1.30k]
  ------------------
 7061|      6|            xmlXPathPErrMemory(ctxt);
 7062|       |
 7063|  1.31k|	if (obj->nodesetval != NULL) {
  ------------------
  |  Branch (7063:6): [True: 1.31k, False: 0]
  ------------------
 7064|  4.77k|	    for (i = 0; i < obj->nodesetval->nodeNr; i++) {
  ------------------
  |  Branch (7064:18): [True: 3.46k, False: 1.31k]
  ------------------
 7065|  3.46k|		tokens =
 7066|  3.46k|		    xmlXPathCastNodeToString(obj->nodesetval->nodeTab[i]);
 7067|  3.46k|                if (tokens == NULL)
  ------------------
  |  Branch (7067:21): [True: 7, False: 3.45k]
  ------------------
 7068|      7|                    xmlXPathPErrMemory(ctxt);
 7069|  3.46k|		ns = xmlXPathGetElementsByIds(ctxt->context->doc, tokens);
 7070|  3.46k|                if (ns == NULL)
  ------------------
  |  Branch (7070:21): [True: 22, False: 3.44k]
  ------------------
 7071|     22|                    xmlXPathPErrMemory(ctxt);
 7072|  3.46k|		ret = xmlXPathNodeSetMerge(ret, ns);
 7073|  3.46k|                if (ret == NULL)
  ------------------
  |  Branch (7073:21): [True: 1, False: 3.46k]
  ------------------
 7074|      1|                    xmlXPathPErrMemory(ctxt);
 7075|  3.46k|		xmlXPathFreeNodeSet(ns);
 7076|  3.46k|		if (tokens != NULL)
  ------------------
  |  Branch (7076:7): [True: 3.45k, False: 7]
  ------------------
 7077|  3.45k|		    xmlFree(tokens);
 7078|  3.46k|	    }
 7079|  1.31k|	}
 7080|  1.31k|	xmlXPathReleaseObject(ctxt->context, obj);
 7081|  1.31k|	xmlXPathValuePush(ctxt, xmlXPathCacheWrapNodeSet(ctxt, ret));
 7082|  1.31k|	return;
 7083|  1.31k|    }
 7084|  4.61k|    tokens = xmlXPathCastToString(obj);
 7085|  4.61k|    if (tokens == NULL)
  ------------------
  |  Branch (7085:9): [True: 1, False: 4.61k]
  ------------------
 7086|      1|        xmlXPathPErrMemory(ctxt);
 7087|  4.61k|    xmlXPathReleaseObject(ctxt->context, obj);
 7088|  4.61k|    ret = xmlXPathGetElementsByIds(ctxt->context->doc, tokens);
 7089|  4.61k|    if (ret == NULL)
  ------------------
  |  Branch (7089:9): [True: 6, False: 4.60k]
  ------------------
 7090|      6|        xmlXPathPErrMemory(ctxt);
 7091|  4.61k|    xmlFree(tokens);
 7092|  4.61k|    xmlXPathValuePush(ctxt, xmlXPathCacheWrapNodeSet(ctxt, ret));
 7093|  4.61k|}
xmlXPathLocalNameFunction:
 7108|  2.19k|xmlXPathLocalNameFunction(xmlXPathParserContext *ctxt, int nargs) {
 7109|  2.19k|    xmlXPathObjectPtr cur;
 7110|       |
 7111|  2.19k|    if (ctxt == NULL) return;
  ------------------
  |  Branch (7111:9): [True: 0, False: 2.19k]
  ------------------
 7112|       |
 7113|  2.19k|    if (nargs == 0) {
  ------------------
  |  Branch (7113:9): [True: 0, False: 2.19k]
  ------------------
 7114|      0|	xmlXPathValuePush(ctxt, xmlXPathCacheNewNodeSet(ctxt, ctxt->context->node));
 7115|      0|	nargs = 1;
 7116|      0|    }
 7117|       |
 7118|  6.57k|    CHECK_ARITY(1);
  ------------------
  |  |  280|  2.19k|    if (ctxt == NULL) return;						\
  |  |  ------------------
  |  |  |  Branch (280:9): [True: 0, False: 2.19k]
  |  |  ------------------
  |  |  281|  2.19k|    if (nargs != (x))							\
  |  |  ------------------
  |  |  |  Branch (281:9): [True: 0, False: 2.19k]
  |  |  ------------------
  |  |  282|  2.19k|        XP_ERROR(XPATH_INVALID_ARITY);					\
  |  |  ------------------
  |  |  |  |  244|      0|    { xmlXPathErr(ctxt, X); return; }
  |  |  ------------------
  |  |  283|  2.19k|    if (ctxt->valueNr < (x))						\
  |  |  ------------------
  |  |  |  Branch (283:9): [True: 1, False: 2.19k]
  |  |  ------------------
  |  |  284|  2.19k|        XP_ERROR(XPATH_STACK_ERROR);
  |  |  ------------------
  |  |  |  |  244|      1|    { xmlXPathErr(ctxt, X); return; }
  |  |  ------------------
  ------------------
 7119|  6.57k|    if ((ctxt->value == NULL) ||
  ------------------
  |  Branch (7119:9): [True: 0, False: 2.19k]
  ------------------
 7120|  2.19k|	((ctxt->value->type != XPATH_NODESET) &&
  ------------------
  |  Branch (7120:3): [True: 1, False: 2.18k]
  ------------------
 7121|      1|	 (ctxt->value->type != XPATH_XSLT_TREE)))
  ------------------
  |  Branch (7121:3): [True: 1, False: 0]
  ------------------
 7122|  2.18k|	XP_ERROR(XPATH_INVALID_TYPE);
  ------------------
  |  |  244|      1|    { xmlXPathErr(ctxt, X); return; }
  ------------------
 7123|  2.18k|    cur = xmlXPathValuePop(ctxt);
 7124|       |
 7125|  2.18k|    if ((cur->nodesetval == NULL) || (cur->nodesetval->nodeNr == 0)) {
  ------------------
  |  Branch (7125:9): [True: 0, False: 2.18k]
  |  Branch (7125:38): [True: 2, False: 2.18k]
  ------------------
 7126|      2|	xmlXPathValuePush(ctxt, xmlXPathCacheNewCString(ctxt, ""));
 7127|  2.18k|    } else {
 7128|  2.18k|	int i = 0; /* Should be first in document order !!!!! */
 7129|  2.18k|	switch (cur->nodesetval->nodeTab[i]->type) {
 7130|      1|	case XML_ELEMENT_NODE:
  ------------------
  |  Branch (7130:2): [True: 1, False: 2.18k]
  ------------------
 7131|      2|	case XML_ATTRIBUTE_NODE:
  ------------------
  |  Branch (7131:2): [True: 1, False: 2.18k]
  ------------------
 7132|      2|	case XML_PI_NODE:
  ------------------
  |  Branch (7132:2): [True: 0, False: 2.18k]
  ------------------
 7133|      2|	    if (cur->nodesetval->nodeTab[i]->name[0] == ' ')
  ------------------
  |  Branch (7133:10): [True: 0, False: 2]
  ------------------
 7134|      0|		xmlXPathValuePush(ctxt, xmlXPathCacheNewCString(ctxt, ""));
 7135|      2|	    else
 7136|      2|		xmlXPathValuePush(ctxt, xmlXPathCacheNewString(ctxt,
 7137|      2|			cur->nodesetval->nodeTab[i]->name));
 7138|      2|	    break;
 7139|      0|	case XML_NAMESPACE_DECL:
  ------------------
  |  Branch (7139:2): [True: 0, False: 2.18k]
  ------------------
 7140|      0|	    xmlXPathValuePush(ctxt, xmlXPathCacheNewString(ctxt,
 7141|      0|			((xmlNsPtr)cur->nodesetval->nodeTab[i])->prefix));
 7142|      0|	    break;
 7143|  2.18k|	default:
  ------------------
  |  Branch (7143:2): [True: 2.18k, False: 2]
  ------------------
 7144|  2.18k|	    xmlXPathValuePush(ctxt, xmlXPathCacheNewCString(ctxt, ""));
 7145|  2.18k|	}
 7146|  2.18k|    }
 7147|  2.18k|    xmlXPathReleaseObject(ctxt->context, cur);
 7148|  2.18k|}
xmlXPathStringFunction:
 7312|  51.4k|xmlXPathStringFunction(xmlXPathParserContext *ctxt, int nargs) {
 7313|  51.4k|    xmlXPathObjectPtr cur;
 7314|  51.4k|    xmlChar *stringval;
 7315|       |
 7316|  51.4k|    if (ctxt == NULL) return;
  ------------------
  |  Branch (7316:9): [True: 0, False: 51.4k]
  ------------------
 7317|  51.4k|    if (nargs == 0) {
  ------------------
  |  Branch (7317:9): [True: 119, False: 51.3k]
  ------------------
 7318|    119|        stringval = xmlXPathCastNodeToString(ctxt->context->node);
 7319|    119|        if (stringval == NULL)
  ------------------
  |  Branch (7319:13): [True: 1, False: 118]
  ------------------
 7320|      1|            xmlXPathPErrMemory(ctxt);
 7321|    119|        xmlXPathValuePush(ctxt, xmlXPathCacheWrapString(ctxt, stringval));
 7322|    119|	return;
 7323|    119|    }
 7324|       |
 7325|   205k|    CHECK_ARITY(1);
  ------------------
  |  |  280|  51.3k|    if (ctxt == NULL) return;						\
  |  |  ------------------
  |  |  |  Branch (280:9): [True: 0, False: 51.3k]
  |  |  ------------------
  |  |  281|  51.3k|    if (nargs != (x))							\
  |  |  ------------------
  |  |  |  Branch (281:9): [True: 3, False: 51.3k]
  |  |  ------------------
  |  |  282|  51.3k|        XP_ERROR(XPATH_INVALID_ARITY);					\
  |  |  ------------------
  |  |  |  |  244|      3|    { xmlXPathErr(ctxt, X); return; }
  |  |  ------------------
  |  |  283|  51.3k|    if (ctxt->valueNr < (x))						\
  |  |  ------------------
  |  |  |  Branch (283:9): [True: 0, False: 51.3k]
  |  |  ------------------
  |  |  284|  51.3k|        XP_ERROR(XPATH_STACK_ERROR);
  |  |  ------------------
  |  |  |  |  244|      0|    { xmlXPathErr(ctxt, X); return; }
  |  |  ------------------
  ------------------
 7326|   205k|    cur = xmlXPathValuePop(ctxt);
 7327|   205k|    if (cur == NULL) XP_ERROR(XPATH_INVALID_OPERAND);
  ------------------
  |  |  244|      0|    { xmlXPathErr(ctxt, X); return; }
  ------------------
  |  Branch (7327:9): [True: 0, False: 51.3k]
  ------------------
 7328|  51.3k|    if (cur->type != XPATH_STRING) {
  ------------------
  |  Branch (7328:9): [True: 51.3k, False: 15]
  ------------------
 7329|  51.3k|        stringval = xmlXPathCastToString(cur);
 7330|  51.3k|        if (stringval == NULL)
  ------------------
  |  Branch (7330:13): [True: 36, False: 51.2k]
  ------------------
 7331|     36|            xmlXPathPErrMemory(ctxt);
 7332|  51.3k|        xmlXPathReleaseObject(ctxt->context, cur);
 7333|  51.3k|        cur = xmlXPathCacheWrapString(ctxt, stringval);
 7334|  51.3k|    }
 7335|  51.3k|    xmlXPathValuePush(ctxt, cur);
 7336|  51.3k|}
xmlXPathStringLengthFunction:
 7350|    164|xmlXPathStringLengthFunction(xmlXPathParserContext *ctxt, int nargs) {
 7351|    164|    xmlXPathObjectPtr cur;
 7352|       |
 7353|    164|    if (nargs == 0) {
  ------------------
  |  Branch (7353:9): [True: 12, False: 152]
  ------------------
 7354|     12|        if ((ctxt == NULL) || (ctxt->context == NULL))
  ------------------
  |  Branch (7354:13): [True: 0, False: 12]
  |  Branch (7354:31): [True: 0, False: 12]
  ------------------
 7355|      0|	    return;
 7356|     12|	if (ctxt->context->node == NULL) {
  ------------------
  |  Branch (7356:6): [True: 0, False: 12]
  ------------------
 7357|      0|	    xmlXPathValuePush(ctxt, xmlXPathCacheNewFloat(ctxt, 0));
 7358|     12|	} else {
 7359|     12|	    xmlChar *content;
 7360|       |
 7361|     12|	    content = xmlXPathCastNodeToString(ctxt->context->node);
 7362|     12|            if (content == NULL)
  ------------------
  |  Branch (7362:17): [True: 1, False: 11]
  ------------------
 7363|      1|                xmlXPathPErrMemory(ctxt);
 7364|     12|	    xmlXPathValuePush(ctxt, xmlXPathCacheNewFloat(ctxt,
 7365|     12|		xmlUTF8Strlen(content)));
 7366|     12|	    xmlFree(content);
 7367|     12|	}
 7368|     12|	return;
 7369|     12|    }
 7370|    602|    CHECK_ARITY(1);
  ------------------
  |  |  280|    152|    if (ctxt == NULL) return;						\
  |  |  ------------------
  |  |  |  Branch (280:9): [True: 0, False: 152]
  |  |  ------------------
  |  |  281|    152|    if (nargs != (x))							\
  |  |  ------------------
  |  |  |  Branch (281:9): [True: 3, False: 149]
  |  |  ------------------
  |  |  282|    152|        XP_ERROR(XPATH_INVALID_ARITY);					\
  |  |  ------------------
  |  |  |  |  244|      3|    { xmlXPathErr(ctxt, X); return; }
  |  |  ------------------
  |  |  283|    149|    if (ctxt->valueNr < (x))						\
  |  |  ------------------
  |  |  |  Branch (283:9): [True: 0, False: 149]
  |  |  ------------------
  |  |  284|    149|        XP_ERROR(XPATH_STACK_ERROR);
  |  |  ------------------
  |  |  |  |  244|      0|    { xmlXPathErr(ctxt, X); return; }
  |  |  ------------------
  ------------------
 7371|    602|    CAST_TO_STRING;
  ------------------
  |  |  290|    149|    if ((ctxt->value != NULL) && (ctxt->value->type != XPATH_STRING))	\
  |  |  ------------------
  |  |  |  Branch (290:9): [True: 149, False: 0]
  |  |  |  Branch (290:34): [True: 139, False: 10]
  |  |  ------------------
  |  |  291|    149|        xmlXPathStringFunction(ctxt, 1);
  ------------------
 7372|    602|    CHECK_TYPE(XPATH_STRING);
  ------------------
  |  |  261|    149|    if ((ctxt->value == NULL) || (ctxt->value->type != typeval))	\
  |  |  ------------------
  |  |  |  Branch (261:9): [True: 1, False: 148]
  |  |  |  Branch (261:34): [True: 1, False: 147]
  |  |  ------------------
  |  |  262|    149|        XP_ERROR(XPATH_INVALID_TYPE)
  |  |  ------------------
  |  |  |  |  244|      2|    { xmlXPathErr(ctxt, X); return; }
  |  |  ------------------
  ------------------
 7373|    147|    cur = xmlXPathValuePop(ctxt);
 7374|    147|    xmlXPathValuePush(ctxt, xmlXPathCacheNewFloat(ctxt,
 7375|    147|	xmlUTF8Strlen(cur->stringval)));
 7376|    147|    xmlXPathReleaseObject(ctxt->context, cur);
 7377|    147|}
xmlXPathConcatFunction:
 7388|    614|xmlXPathConcatFunction(xmlXPathParserContext *ctxt, int nargs) {
 7389|    614|    xmlXPathObjectPtr cur, newobj;
 7390|    614|    xmlChar *tmp;
 7391|       |
 7392|    614|    if (ctxt == NULL) return;
  ------------------
  |  Branch (7392:9): [True: 0, False: 614]
  ------------------
 7393|    614|    if (nargs < 2) {
  ------------------
  |  Branch (7393:9): [True: 7, False: 607]
  ------------------
 7394|      7|	CHECK_ARITY(2);
  ------------------
  |  |  280|      7|    if (ctxt == NULL) return;						\
  |  |  ------------------
  |  |  |  Branch (280:9): [True: 0, False: 7]
  |  |  ------------------
  |  |  281|      7|    if (nargs != (x))							\
  |  |  ------------------
  |  |  |  Branch (281:9): [True: 7, False: 0]
  |  |  ------------------
  |  |  282|      7|        XP_ERROR(XPATH_INVALID_ARITY);					\
  |  |  ------------------
  |  |  |  |  244|      7|    { xmlXPathErr(ctxt, X); return; }
  |  |  ------------------
  |  |  283|      0|    if (ctxt->valueNr < (x))						\
  |  |  ------------------
  |  |  |  Branch (283:9): [True: 0, False: 0]
  |  |  ------------------
  |  |  284|      0|        XP_ERROR(XPATH_STACK_ERROR);
  |  |  ------------------
  |  |  |  |  244|      0|    { xmlXPathErr(ctxt, X); return; }
  |  |  ------------------
  ------------------
 7395|      7|    }
 7396|       |
 7397|    607|    CAST_TO_STRING;
  ------------------
  |  |  290|    607|    if ((ctxt->value != NULL) && (ctxt->value->type != XPATH_STRING))	\
  |  |  ------------------
  |  |  |  Branch (290:9): [True: 607, False: 0]
  |  |  |  Branch (290:34): [True: 490, False: 117]
  |  |  ------------------
  |  |  291|    607|        xmlXPathStringFunction(ctxt, 1);
  ------------------
 7398|    607|    cur = xmlXPathValuePop(ctxt);
 7399|    607|    if ((cur == NULL) || (cur->type != XPATH_STRING)) {
  ------------------
  |  Branch (7399:9): [True: 0, False: 607]
  |  Branch (7399:26): [True: 2, False: 605]
  ------------------
 7400|      2|	xmlXPathReleaseObject(ctxt->context, cur);
 7401|      2|	return;
 7402|      2|    }
 7403|    605|    nargs--;
 7404|       |
 7405|  2.46k|    while (nargs > 0) {
  ------------------
  |  Branch (7405:12): [True: 1.86k, False: 602]
  ------------------
 7406|  1.86k|	CAST_TO_STRING;
  ------------------
  |  |  290|  1.86k|    if ((ctxt->value != NULL) && (ctxt->value->type != XPATH_STRING))	\
  |  |  ------------------
  |  |  |  Branch (290:9): [True: 1.86k, False: 0]
  |  |  |  Branch (290:34): [True: 1.81k, False: 50]
  |  |  ------------------
  |  |  291|  1.86k|        xmlXPathStringFunction(ctxt, 1);
  ------------------
 7407|  1.86k|	newobj = xmlXPathValuePop(ctxt);
 7408|  1.86k|	if ((newobj == NULL) || (newobj->type != XPATH_STRING)) {
  ------------------
  |  Branch (7408:6): [True: 1, False: 1.86k]
  |  Branch (7408:26): [True: 2, False: 1.86k]
  ------------------
 7409|      3|	    xmlXPathReleaseObject(ctxt->context, newobj);
 7410|      3|	    xmlXPathReleaseObject(ctxt->context, cur);
 7411|      3|	    XP_ERROR(XPATH_INVALID_TYPE);
  ------------------
  |  |  244|      3|    { xmlXPathErr(ctxt, X); return; }
  ------------------
 7412|      0|	}
 7413|  1.86k|	tmp = xmlStrcat(newobj->stringval, cur->stringval);
 7414|  1.86k|        if (tmp == NULL)
  ------------------
  |  Branch (7414:13): [True: 3, False: 1.86k]
  ------------------
 7415|      3|            xmlXPathPErrMemory(ctxt);
 7416|  1.86k|	newobj->stringval = cur->stringval;
 7417|  1.86k|	cur->stringval = tmp;
 7418|  1.86k|	xmlXPathReleaseObject(ctxt->context, newobj);
 7419|  1.86k|	nargs--;
 7420|  1.86k|    }
 7421|    602|    xmlXPathValuePush(ctxt, cur);
 7422|    602|}
xmlXPathStartsWithFunction:
 7467|    169|xmlXPathStartsWithFunction(xmlXPathParserContext *ctxt, int nargs) {
 7468|    169|    xmlXPathObjectPtr hay, needle;
 7469|    169|    int n;
 7470|       |
 7471|    505|    CHECK_ARITY(2);
  ------------------
  |  |  280|    169|    if (ctxt == NULL) return;						\
  |  |  ------------------
  |  |  |  Branch (280:9): [True: 0, False: 169]
  |  |  ------------------
  |  |  281|    169|    if (nargs != (x))							\
  |  |  ------------------
  |  |  |  Branch (281:9): [True: 1, False: 168]
  |  |  ------------------
  |  |  282|    169|        XP_ERROR(XPATH_INVALID_ARITY);					\
  |  |  ------------------
  |  |  |  |  244|      1|    { xmlXPathErr(ctxt, X); return; }
  |  |  ------------------
  |  |  283|    168|    if (ctxt->valueNr < (x))						\
  |  |  ------------------
  |  |  |  Branch (283:9): [True: 0, False: 168]
  |  |  ------------------
  |  |  284|    168|        XP_ERROR(XPATH_STACK_ERROR);
  |  |  ------------------
  |  |  |  |  244|      0|    { xmlXPathErr(ctxt, X); return; }
  |  |  ------------------
  ------------------
 7472|    505|    CAST_TO_STRING;
  ------------------
  |  |  290|    168|    if ((ctxt->value != NULL) && (ctxt->value->type != XPATH_STRING))	\
  |  |  ------------------
  |  |  |  Branch (290:9): [True: 168, False: 0]
  |  |  |  Branch (290:34): [True: 62, False: 106]
  |  |  ------------------
  |  |  291|    168|        xmlXPathStringFunction(ctxt, 1);
  ------------------
 7473|    505|    CHECK_TYPE(XPATH_STRING);
  ------------------
  |  |  261|    168|    if ((ctxt->value == NULL) || (ctxt->value->type != typeval))	\
  |  |  ------------------
  |  |  |  Branch (261:9): [True: 0, False: 168]
  |  |  |  Branch (261:34): [True: 1, False: 167]
  |  |  ------------------
  |  |  262|    168|        XP_ERROR(XPATH_INVALID_TYPE)
  |  |  ------------------
  |  |  |  |  244|      1|    { xmlXPathErr(ctxt, X); return; }
  |  |  ------------------
  ------------------
 7474|    167|    needle = xmlXPathValuePop(ctxt);
 7475|    167|    CAST_TO_STRING;
  ------------------
  |  |  290|    167|    if ((ctxt->value != NULL) && (ctxt->value->type != XPATH_STRING))	\
  |  |  ------------------
  |  |  |  Branch (290:9): [True: 167, False: 0]
  |  |  |  Branch (290:34): [True: 167, False: 0]
  |  |  ------------------
  |  |  291|    167|        xmlXPathStringFunction(ctxt, 1);
  ------------------
 7476|    167|    hay = xmlXPathValuePop(ctxt);
 7477|       |
 7478|    167|    if ((hay == NULL) || (hay->type != XPATH_STRING)) {
  ------------------
  |  Branch (7478:9): [True: 1, False: 166]
  |  Branch (7478:26): [True: 1, False: 165]
  ------------------
 7479|      2|	xmlXPathReleaseObject(ctxt->context, hay);
 7480|      2|	xmlXPathReleaseObject(ctxt->context, needle);
 7481|      2|	XP_ERROR(XPATH_INVALID_TYPE);
  ------------------
  |  |  244|      2|    { xmlXPathErr(ctxt, X); return; }
  ------------------
 7482|      0|    }
 7483|    165|    n = xmlStrlen(needle->stringval);
 7484|    165|    if (xmlStrncmp(hay->stringval, needle->stringval, n))
  ------------------
  |  Branch (7484:9): [True: 126, False: 39]
  ------------------
 7485|    126|        xmlXPathValuePush(ctxt, xmlXPathCacheNewBoolean(ctxt, 0));
 7486|     39|    else
 7487|     39|        xmlXPathValuePush(ctxt, xmlXPathCacheNewBoolean(ctxt, 1));
 7488|    165|    xmlXPathReleaseObject(ctxt->context, hay);
 7489|    165|    xmlXPathReleaseObject(ctxt->context, needle);
 7490|    165|}
xmlXPathSubstringFunction:
 7520|  16.4k|xmlXPathSubstringFunction(xmlXPathParserContext *ctxt, int nargs) {
 7521|  16.4k|    xmlXPathObjectPtr str, start, len;
 7522|  16.4k|    double le=0, in;
 7523|  16.4k|    int i = 1, j = INT_MAX;
 7524|       |
 7525|  16.4k|    if (nargs < 2) {
  ------------------
  |  Branch (7525:9): [True: 6, False: 16.4k]
  ------------------
 7526|      6|	CHECK_ARITY(2);
  ------------------
  |  |  280|      6|    if (ctxt == NULL) return;						\
  |  |  ------------------
  |  |  |  Branch (280:9): [True: 0, False: 6]
  |  |  ------------------
  |  |  281|      6|    if (nargs != (x))							\
  |  |  ------------------
  |  |  |  Branch (281:9): [True: 6, False: 0]
  |  |  ------------------
  |  |  282|      6|        XP_ERROR(XPATH_INVALID_ARITY);					\
  |  |  ------------------
  |  |  |  |  244|      6|    { xmlXPathErr(ctxt, X); return; }
  |  |  ------------------
  |  |  283|      0|    if (ctxt->valueNr < (x))						\
  |  |  ------------------
  |  |  |  Branch (283:9): [True: 0, False: 0]
  |  |  ------------------
  |  |  284|      0|        XP_ERROR(XPATH_STACK_ERROR);
  |  |  ------------------
  |  |  |  |  244|      0|    { xmlXPathErr(ctxt, X); return; }
  |  |  ------------------
  ------------------
 7527|      6|    }
 7528|  16.4k|    if (nargs > 3) {
  ------------------
  |  Branch (7528:9): [True: 3, False: 16.4k]
  ------------------
 7529|      3|	CHECK_ARITY(3);
  ------------------
  |  |  280|      3|    if (ctxt == NULL) return;						\
  |  |  ------------------
  |  |  |  Branch (280:9): [True: 0, False: 3]
  |  |  ------------------
  |  |  281|      3|    if (nargs != (x))							\
  |  |  ------------------
  |  |  |  Branch (281:9): [True: 3, False: 0]
  |  |  ------------------
  |  |  282|      3|        XP_ERROR(XPATH_INVALID_ARITY);					\
  |  |  ------------------
  |  |  |  |  244|      3|    { xmlXPathErr(ctxt, X); return; }
  |  |  ------------------
  |  |  283|      0|    if (ctxt->valueNr < (x))						\
  |  |  ------------------
  |  |  |  Branch (283:9): [True: 0, False: 0]
  |  |  ------------------
  |  |  284|      0|        XP_ERROR(XPATH_STACK_ERROR);
  |  |  ------------------
  |  |  |  |  244|      0|    { xmlXPathErr(ctxt, X); return; }
  |  |  ------------------
  ------------------
 7530|      3|    }
 7531|       |    /*
 7532|       |     * take care of possible last (position) argument
 7533|       |    */
 7534|  16.4k|    if (nargs == 3) {
  ------------------
  |  Branch (7534:9): [True: 7.36k, False: 9.07k]
  ------------------
 7535|  7.36k|	CAST_TO_NUMBER;
  ------------------
  |  |  297|  7.36k|    if ((ctxt->value != NULL) && (ctxt->value->type != XPATH_NUMBER))	\
  |  |  ------------------
  |  |  |  Branch (297:9): [True: 7.36k, False: 0]
  |  |  |  Branch (297:34): [True: 1.30k, False: 6.06k]
  |  |  ------------------
  |  |  298|  7.36k|        xmlXPathNumberFunction(ctxt, 1);
  ------------------
 7536|  7.36k|	CHECK_TYPE(XPATH_NUMBER);
  ------------------
  |  |  261|  7.36k|    if ((ctxt->value == NULL) || (ctxt->value->type != typeval))	\
  |  |  ------------------
  |  |  |  Branch (261:9): [True: 0, False: 7.36k]
  |  |  |  Branch (261:34): [True: 2, False: 7.36k]
  |  |  ------------------
  |  |  262|  7.36k|        XP_ERROR(XPATH_INVALID_TYPE)
  |  |  ------------------
  |  |  |  |  244|      2|    { xmlXPathErr(ctxt, X); return; }
  |  |  ------------------
  ------------------
 7537|  7.36k|	len = xmlXPathValuePop(ctxt);
 7538|  7.36k|	le = len->floatval;
 7539|  7.36k|	xmlXPathReleaseObject(ctxt->context, len);
 7540|  7.36k|    }
 7541|       |
 7542|  16.4k|    CAST_TO_NUMBER;
  ------------------
  |  |  297|  16.4k|    if ((ctxt->value != NULL) && (ctxt->value->type != XPATH_NUMBER))	\
  |  |  ------------------
  |  |  |  Branch (297:9): [True: 16.4k, False: 0]
  |  |  |  Branch (297:34): [True: 6.18k, False: 10.2k]
  |  |  ------------------
  |  |  298|  16.4k|        xmlXPathNumberFunction(ctxt, 1);
  ------------------
 7543|  16.4k|    CHECK_TYPE(XPATH_NUMBER);
  ------------------
  |  |  261|  16.4k|    if ((ctxt->value == NULL) || (ctxt->value->type != typeval))	\
  |  |  ------------------
  |  |  |  Branch (261:9): [True: 0, False: 16.4k]
  |  |  |  Branch (261:34): [True: 1, False: 16.4k]
  |  |  ------------------
  |  |  262|  16.4k|        XP_ERROR(XPATH_INVALID_TYPE)
  |  |  ------------------
  |  |  |  |  244|      1|    { xmlXPathErr(ctxt, X); return; }
  |  |  ------------------
  ------------------
 7544|  16.4k|    start = xmlXPathValuePop(ctxt);
 7545|  16.4k|    in = start->floatval;
 7546|  16.4k|    xmlXPathReleaseObject(ctxt->context, start);
 7547|  16.4k|    CAST_TO_STRING;
  ------------------
  |  |  290|  16.4k|    if ((ctxt->value != NULL) && (ctxt->value->type != XPATH_STRING))	\
  |  |  ------------------
  |  |  |  Branch (290:9): [True: 16.4k, False: 3]
  |  |  |  Branch (290:34): [True: 16.4k, False: 1]
  |  |  ------------------
  |  |  291|  16.4k|        xmlXPathStringFunction(ctxt, 1);
  ------------------
 7548|  16.4k|    CHECK_TYPE(XPATH_STRING);
  ------------------
  |  |  261|  16.4k|    if ((ctxt->value == NULL) || (ctxt->value->type != typeval))	\
  |  |  ------------------
  |  |  |  Branch (261:9): [True: 6, False: 16.4k]
  |  |  |  Branch (261:34): [True: 1, False: 16.4k]
  |  |  ------------------
  |  |  262|  16.4k|        XP_ERROR(XPATH_INVALID_TYPE)
  |  |  ------------------
  |  |  |  |  244|      7|    { xmlXPathErr(ctxt, X); return; }
  |  |  ------------------
  ------------------
 7549|  16.4k|    str = xmlXPathValuePop(ctxt);
 7550|       |
 7551|  16.4k|    if (!(in < INT_MAX)) { /* Logical NOT to handle NaNs */
  ------------------
  |  Branch (7551:9): [True: 1.41k, False: 15.0k]
  ------------------
 7552|  1.41k|        i = INT_MAX;
 7553|  15.0k|    } else if (in >= 1.0) {
  ------------------
  |  Branch (7553:16): [True: 9.15k, False: 5.86k]
  ------------------
 7554|  9.15k|        i = (int)in;
 7555|  9.15k|        if (in - floor(in) >= 0.5)
  ------------------
  |  Branch (7555:13): [True: 384, False: 8.77k]
  ------------------
 7556|    384|            i += 1;
 7557|  9.15k|    }
 7558|       |
 7559|  16.4k|    if (nargs == 3) {
  ------------------
  |  Branch (7559:9): [True: 7.36k, False: 9.07k]
  ------------------
 7560|  7.36k|        double rin, rle, end;
 7561|       |
 7562|  7.36k|        rin = floor(in);
 7563|  7.36k|        if (in - rin >= 0.5)
  ------------------
  |  Branch (7563:13): [True: 274, False: 7.09k]
  ------------------
 7564|    274|            rin += 1.0;
 7565|       |
 7566|  7.36k|        rle = floor(le);
 7567|  7.36k|        if (le - rle >= 0.5)
  ------------------
  |  Branch (7567:13): [True: 318, False: 7.04k]
  ------------------
 7568|    318|            rle += 1.0;
 7569|       |
 7570|  7.36k|        end = rin + rle;
 7571|  7.36k|        if (!(end >= 1.0)) { /* Logical NOT to handle NaNs */
  ------------------
  |  Branch (7571:13): [True: 1.55k, False: 5.80k]
  ------------------
 7572|  1.55k|            j = 1;
 7573|  5.80k|        } else if (end < INT_MAX) {
  ------------------
  |  Branch (7573:20): [True: 5.56k, False: 242]
  ------------------
 7574|  5.56k|            j = (int)end;
 7575|  5.56k|        }
 7576|  7.36k|    }
 7577|       |
 7578|  16.4k|    i -= 1;
 7579|  16.4k|    j -= 1;
 7580|       |
 7581|  16.4k|    if ((i < j) && (i < xmlUTF8Strlen(str->stringval))) {
  ------------------
  |  Branch (7581:9): [True: 13.7k, False: 2.71k]
  |  Branch (7581:20): [True: 12.9k, False: 738]
  ------------------
 7582|  12.9k|        xmlChar *ret = xmlUTF8Strsub(str->stringval, i, j - i);
 7583|  12.9k|        if (ret == NULL)
  ------------------
  |  Branch (7583:13): [True: 4, False: 12.9k]
  ------------------
 7584|      4|            xmlXPathPErrMemory(ctxt);
 7585|  12.9k|	xmlXPathValuePush(ctxt, xmlXPathCacheNewString(ctxt, ret));
 7586|  12.9k|	xmlFree(ret);
 7587|  12.9k|    } else {
 7588|  3.45k|	xmlXPathValuePush(ctxt, xmlXPathCacheNewCString(ctxt, ""));
 7589|  3.45k|    }
 7590|       |
 7591|  16.4k|    xmlXPathReleaseObject(ctxt->context, str);
 7592|  16.4k|}
xmlXPathSubstringBeforeFunction:
 7607|    523|xmlXPathSubstringBeforeFunction(xmlXPathParserContext *ctxt, int nargs) {
 7608|    523|    xmlXPathObjectPtr str = NULL;
 7609|    523|    xmlXPathObjectPtr find = NULL;
 7610|    523|    const xmlChar *point;
 7611|    523|    xmlChar *result;
 7612|       |
 7613|  1.56k|    CHECK_ARITY(2);
  ------------------
  |  |  280|    523|    if (ctxt == NULL) return;						\
  |  |  ------------------
  |  |  |  Branch (280:9): [True: 0, False: 523]
  |  |  ------------------
  |  |  281|    523|    if (nargs != (x))							\
  |  |  ------------------
  |  |  |  Branch (281:9): [True: 1, False: 522]
  |  |  ------------------
  |  |  282|    523|        XP_ERROR(XPATH_INVALID_ARITY);					\
  |  |  ------------------
  |  |  |  |  244|      1|    { xmlXPathErr(ctxt, X); return; }
  |  |  ------------------
  |  |  283|    522|    if (ctxt->valueNr < (x))						\
  |  |  ------------------
  |  |  |  Branch (283:9): [True: 0, False: 522]
  |  |  ------------------
  |  |  284|    522|        XP_ERROR(XPATH_STACK_ERROR);
  |  |  ------------------
  |  |  |  |  244|      0|    { xmlXPathErr(ctxt, X); return; }
  |  |  ------------------
  ------------------
 7614|  1.56k|    CAST_TO_STRING;
  ------------------
  |  |  290|    522|    if ((ctxt->value != NULL) && (ctxt->value->type != XPATH_STRING))	\
  |  |  ------------------
  |  |  |  Branch (290:9): [True: 522, False: 0]
  |  |  |  Branch (290:34): [True: 522, False: 0]
  |  |  ------------------
  |  |  291|    522|        xmlXPathStringFunction(ctxt, 1);
  ------------------
 7615|  1.56k|    find = xmlXPathValuePop(ctxt);
 7616|  1.56k|    CAST_TO_STRING;
  ------------------
  |  |  290|    522|    if ((ctxt->value != NULL) && (ctxt->value->type != XPATH_STRING))	\
  |  |  ------------------
  |  |  |  Branch (290:9): [True: 521, False: 1]
  |  |  |  Branch (290:34): [True: 521, False: 0]
  |  |  ------------------
  |  |  291|    522|        xmlXPathStringFunction(ctxt, 1);
  ------------------
 7617|  1.56k|    str = xmlXPathValuePop(ctxt);
 7618|  1.56k|    if (ctxt->error != 0)
  ------------------
  |  Branch (7618:9): [True: 5, False: 517]
  ------------------
 7619|      5|        goto error;
 7620|       |
 7621|    517|    point = xmlStrstr(str->stringval, find->stringval);
 7622|    517|    if (point == NULL) {
  ------------------
  |  Branch (7622:9): [True: 245, False: 272]
  ------------------
 7623|    245|        result = xmlStrdup(BAD_CAST "");
  ------------------
  |  |   34|    245|#define BAD_CAST (xmlChar *)
  ------------------
 7624|    272|    } else {
 7625|    272|        result = xmlStrndup(str->stringval, point - str->stringval);
 7626|    272|    }
 7627|    517|    if (result == NULL) {
  ------------------
  |  Branch (7627:9): [True: 1, False: 516]
  ------------------
 7628|      1|        xmlXPathPErrMemory(ctxt);
 7629|      1|        goto error;
 7630|      1|    }
 7631|    516|    xmlXPathValuePush(ctxt, xmlXPathCacheWrapString(ctxt, result));
 7632|       |
 7633|    522|error:
 7634|    522|    xmlXPathReleaseObject(ctxt->context, str);
 7635|    522|    xmlXPathReleaseObject(ctxt->context, find);
 7636|    522|}
xmlXPathNormalizeFunction:
 7697|  2.72k|xmlXPathNormalizeFunction(xmlXPathParserContext *ctxt, int nargs) {
 7698|  2.72k|    xmlChar *source, *target;
 7699|  2.72k|    int blank;
 7700|       |
 7701|  2.72k|    if (ctxt == NULL) return;
  ------------------
  |  Branch (7701:9): [True: 0, False: 2.72k]
  ------------------
 7702|  2.72k|    if (nargs == 0) {
  ------------------
  |  Branch (7702:9): [True: 1.98k, False: 747]
  ------------------
 7703|       |        /* Use current context node */
 7704|  1.98k|        source = xmlXPathCastNodeToString(ctxt->context->node);
 7705|  1.98k|        if (source == NULL)
  ------------------
  |  Branch (7705:13): [True: 2, False: 1.98k]
  ------------------
 7706|      2|            xmlXPathPErrMemory(ctxt);
 7707|  1.98k|        xmlXPathValuePush(ctxt, xmlXPathCacheWrapString(ctxt, source));
 7708|  1.98k|        nargs = 1;
 7709|  1.98k|    }
 7710|       |
 7711|  8.18k|    CHECK_ARITY(1);
  ------------------
  |  |  280|  2.72k|    if (ctxt == NULL) return;						\
  |  |  ------------------
  |  |  |  Branch (280:9): [True: 0, False: 2.72k]
  |  |  ------------------
  |  |  281|  2.72k|    if (nargs != (x))							\
  |  |  ------------------
  |  |  |  Branch (281:9): [True: 1, False: 2.72k]
  |  |  ------------------
  |  |  282|  2.72k|        XP_ERROR(XPATH_INVALID_ARITY);					\
  |  |  ------------------
  |  |  |  |  244|      1|    { xmlXPathErr(ctxt, X); return; }
  |  |  ------------------
  |  |  283|  2.72k|    if (ctxt->valueNr < (x))						\
  |  |  ------------------
  |  |  |  Branch (283:9): [True: 0, False: 2.72k]
  |  |  ------------------
  |  |  284|  2.72k|        XP_ERROR(XPATH_STACK_ERROR);
  |  |  ------------------
  |  |  |  |  244|      0|    { xmlXPathErr(ctxt, X); return; }
  |  |  ------------------
  ------------------
 7712|  8.18k|    CAST_TO_STRING;
  ------------------
  |  |  290|  2.72k|    if ((ctxt->value != NULL) && (ctxt->value->type != XPATH_STRING))	\
  |  |  ------------------
  |  |  |  Branch (290:9): [True: 2.72k, False: 0]
  |  |  |  Branch (290:34): [True: 747, False: 1.98k]
  |  |  ------------------
  |  |  291|  2.72k|        xmlXPathStringFunction(ctxt, 1);
  ------------------
 7713|  8.18k|    CHECK_TYPE(XPATH_STRING);
  ------------------
  |  |  261|  2.72k|    if ((ctxt->value == NULL) || (ctxt->value->type != typeval))	\
  |  |  ------------------
  |  |  |  Branch (261:9): [True: 1, False: 2.72k]
  |  |  |  Branch (261:34): [True: 3, False: 2.72k]
  |  |  ------------------
  |  |  262|  2.72k|        XP_ERROR(XPATH_INVALID_TYPE)
  |  |  ------------------
  |  |  |  |  244|      4|    { xmlXPathErr(ctxt, X); return; }
  |  |  ------------------
  ------------------
 7714|  2.72k|    source = ctxt->value->stringval;
 7715|  2.72k|    if (source == NULL)
  ------------------
  |  Branch (7715:9): [True: 3, False: 2.72k]
  ------------------
 7716|      3|        return;
 7717|  2.72k|    target = source;
 7718|       |
 7719|       |    /* Skip leading whitespaces */
 7720|  2.72k|    while (IS_BLANK_CH(*source))
 7721|    841|        source++;
 7722|       |
 7723|       |    /* Collapse intermediate whitespaces, and skip trailing whitespaces */
 7724|  2.72k|    blank = 0;
 7725|  19.1k|    while (*source) {
  ------------------
  |  Branch (7725:12): [True: 16.4k, False: 2.72k]
  ------------------
 7726|  16.4k|        if (IS_BLANK_CH(*source)) {
  ------------------
  |  |  137|  16.4k|#define IS_BLANK_CH(c)  xmlIsBlank_ch(c)
  |  |  ------------------
  |  |  |  |   90|  16.4k|#define xmlIsBlank_ch(c)	(((c) == 0x20) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (90:27): [True: 801, False: 15.6k]
  |  |  |  |  ------------------
  |  |  |  |   91|  16.4k|				 ((0x9 <= (c)) && ((c) <= 0xa)) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (91:7): [True: 15.6k, False: 0]
  |  |  |  |  |  Branch (91:23): [True: 553, False: 15.0k]
  |  |  |  |  ------------------
  |  |  |  |   92|  16.4k|				 ((c) == 0xd))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (92:6): [True: 18, False: 15.0k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 7727|  1.37k|	    blank = 1;
 7728|  15.0k|        } else {
 7729|  15.0k|            if (blank) {
  ------------------
  |  Branch (7729:17): [True: 839, False: 14.2k]
  ------------------
 7730|    839|                *target++ = 0x20;
 7731|    839|                blank = 0;
 7732|    839|            }
 7733|  15.0k|            *target++ = *source;
 7734|  15.0k|        }
 7735|  16.4k|        source++;
 7736|  16.4k|    }
 7737|  2.72k|    *target = 0;
 7738|  2.72k|}
xmlXPathTranslateFunction:
 7762|  5.45k|xmlXPathTranslateFunction(xmlXPathParserContext *ctxt, int nargs) {
 7763|  5.45k|    xmlXPathObjectPtr str = NULL;
 7764|  5.45k|    xmlXPathObjectPtr from = NULL;
 7765|  5.45k|    xmlXPathObjectPtr to = NULL;
 7766|  5.45k|    xmlBufPtr target;
 7767|  5.45k|    int offset, max;
 7768|  5.45k|    int ch;
 7769|  5.45k|    const xmlChar *point;
 7770|  5.45k|    xmlChar *cptr, *content;
 7771|       |
 7772|  16.3k|    CHECK_ARITY(3);
  ------------------
  |  |  280|  5.45k|    if (ctxt == NULL) return;						\
  |  |  ------------------
  |  |  |  Branch (280:9): [True: 0, False: 5.45k]
  |  |  ------------------
  |  |  281|  5.45k|    if (nargs != (x))							\
  |  |  ------------------
  |  |  |  Branch (281:9): [True: 8, False: 5.44k]
  |  |  ------------------
  |  |  282|  5.45k|        XP_ERROR(XPATH_INVALID_ARITY);					\
  |  |  ------------------
  |  |  |  |  244|      8|    { xmlXPathErr(ctxt, X); return; }
  |  |  ------------------
  |  |  283|  5.44k|    if (ctxt->valueNr < (x))						\
  |  |  ------------------
  |  |  |  Branch (283:9): [True: 0, False: 5.44k]
  |  |  ------------------
  |  |  284|  5.44k|        XP_ERROR(XPATH_STACK_ERROR);
  |  |  ------------------
  |  |  |  |  244|      0|    { xmlXPathErr(ctxt, X); return; }
  |  |  ------------------
  ------------------
 7773|       |
 7774|  16.3k|    CAST_TO_STRING;
  ------------------
  |  |  290|  5.44k|    if ((ctxt->value != NULL) && (ctxt->value->type != XPATH_STRING))	\
  |  |  ------------------
  |  |  |  Branch (290:9): [True: 5.44k, False: 0]
  |  |  |  Branch (290:34): [True: 5.19k, False: 250]
  |  |  ------------------
  |  |  291|  5.44k|        xmlXPathStringFunction(ctxt, 1);
  ------------------
 7775|  16.3k|    to = xmlXPathValuePop(ctxt);
 7776|  16.3k|    CAST_TO_STRING;
  ------------------
  |  |  290|  5.44k|    if ((ctxt->value != NULL) && (ctxt->value->type != XPATH_STRING))	\
  |  |  ------------------
  |  |  |  Branch (290:9): [True: 5.44k, False: 0]
  |  |  |  Branch (290:34): [True: 4.74k, False: 701]
  |  |  ------------------
  |  |  291|  5.44k|        xmlXPathStringFunction(ctxt, 1);
  ------------------
 7777|  16.3k|    from = xmlXPathValuePop(ctxt);
 7778|  16.3k|    CAST_TO_STRING;
  ------------------
  |  |  290|  5.44k|    if ((ctxt->value != NULL) && (ctxt->value->type != XPATH_STRING))	\
  |  |  ------------------
  |  |  |  Branch (290:9): [True: 5.44k, False: 6]
  |  |  |  Branch (290:34): [True: 5.44k, False: 1]
  |  |  ------------------
  |  |  291|  5.44k|        xmlXPathStringFunction(ctxt, 1);
  ------------------
 7779|  16.3k|    str = xmlXPathValuePop(ctxt);
 7780|  16.3k|    if (ctxt->error != 0)
  ------------------
  |  Branch (7780:9): [True: 27, False: 5.42k]
  ------------------
 7781|     27|        goto error;
 7782|       |
 7783|       |    /*
 7784|       |     * Account for quadratic runtime
 7785|       |     */
 7786|  5.42k|    if (ctxt->context->opLimit != 0) {
  ------------------
  |  Branch (7786:9): [True: 5.42k, False: 0]
  ------------------
 7787|  5.42k|        unsigned long f1 = xmlStrlen(from->stringval);
 7788|  5.42k|        unsigned long f2 = xmlStrlen(str->stringval);
 7789|       |
 7790|  5.42k|        if ((f1 > 0) && (f2 > 0)) {
  ------------------
  |  Branch (7790:13): [True: 4.72k, False: 696]
  |  Branch (7790:25): [True: 4.38k, False: 344]
  ------------------
 7791|  4.38k|            unsigned long p;
 7792|       |
 7793|  4.38k|            f1 = f1 / 10 + 1;
 7794|  4.38k|            f2 = f2 / 10 + 1;
 7795|  4.38k|            p = f1 > ULONG_MAX / f2 ? ULONG_MAX : f1 * f2;
  ------------------
  |  Branch (7795:17): [True: 0, False: 4.38k]
  ------------------
 7796|  4.38k|            if (xmlXPathCheckOpLimit(ctxt, p) < 0)
  ------------------
  |  Branch (7796:17): [True: 8, False: 4.37k]
  ------------------
 7797|      8|                goto error;
 7798|  4.38k|        }
 7799|  5.42k|    }
 7800|       |
 7801|  5.41k|    target = xmlBufCreate(50);
 7802|  5.41k|    if (target == NULL) {
  ------------------
  |  Branch (7802:9): [True: 5, False: 5.40k]
  ------------------
 7803|      5|        xmlXPathPErrMemory(ctxt);
 7804|      5|        goto error;
 7805|      5|    }
 7806|       |
 7807|  5.40k|    max = xmlUTF8Strlen(to->stringval);
 7808|  60.4k|    for (cptr = str->stringval; (ch=*cptr); ) {
  ------------------
  |  Branch (7808:33): [True: 54.9k, False: 5.40k]
  ------------------
 7809|  54.9k|        offset = xmlUTF8Strloc(from->stringval, cptr);
 7810|  54.9k|        if (offset >= 0) {
  ------------------
  |  Branch (7810:13): [True: 29.8k, False: 25.1k]
  ------------------
 7811|  29.8k|            if (offset < max) {
  ------------------
  |  Branch (7811:17): [True: 11.4k, False: 18.4k]
  ------------------
 7812|  11.4k|                point = xmlUTF8Strpos(to->stringval, offset);
 7813|  11.4k|                if (point)
  ------------------
  |  Branch (7813:21): [True: 11.4k, False: 0]
  ------------------
 7814|  11.4k|                    xmlBufAdd(target, point, xmlUTF8Strsize(point, 1));
 7815|  11.4k|            }
 7816|  29.8k|        } else
 7817|  25.1k|            xmlBufAdd(target, cptr, xmlUTF8Strsize(cptr, 1));
 7818|       |
 7819|       |        /* Step to next character in input */
 7820|  54.9k|        cptr++;
 7821|  54.9k|        if ( ch & 0x80 ) {
  ------------------
  |  Branch (7821:14): [True: 0, False: 54.9k]
  ------------------
 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|  54.9k|    }
 7837|       |
 7838|  5.40k|    content = xmlBufDetach(target);
 7839|  5.40k|    if (content == NULL)
  ------------------
  |  Branch (7839:9): [True: 0, False: 5.40k]
  ------------------
 7840|      0|        xmlXPathPErrMemory(ctxt);
 7841|  5.40k|    else
 7842|  5.40k|        xmlXPathValuePush(ctxt, xmlXPathCacheWrapString(ctxt, content));
 7843|  5.40k|    xmlBufFree(target);
 7844|  5.44k|error:
 7845|  5.44k|    xmlXPathReleaseObject(ctxt->context, str);
 7846|  5.44k|    xmlXPathReleaseObject(ctxt->context, from);
 7847|  5.44k|    xmlXPathReleaseObject(ctxt->context, to);
 7848|  5.44k|}
xmlXPathBooleanFunction:
 7863|  19.1k|xmlXPathBooleanFunction(xmlXPathParserContext *ctxt, int nargs) {
 7864|  19.1k|    xmlXPathObjectPtr cur;
 7865|       |
 7866|  57.4k|    CHECK_ARITY(1);
  ------------------
  |  |  280|  19.1k|    if (ctxt == NULL) return;						\
  |  |  ------------------
  |  |  |  Branch (280:9): [True: 0, False: 19.1k]
  |  |  ------------------
  |  |  281|  19.1k|    if (nargs != (x))							\
  |  |  ------------------
  |  |  |  Branch (281:9): [True: 0, False: 19.1k]
  |  |  ------------------
  |  |  282|  19.1k|        XP_ERROR(XPATH_INVALID_ARITY);					\
  |  |  ------------------
  |  |  |  |  244|      0|    { xmlXPathErr(ctxt, X); return; }
  |  |  ------------------
  |  |  283|  19.1k|    if (ctxt->valueNr < (x))						\
  |  |  ------------------
  |  |  |  Branch (283:9): [True: 0, False: 19.1k]
  |  |  ------------------
  |  |  284|  19.1k|        XP_ERROR(XPATH_STACK_ERROR);
  |  |  ------------------
  |  |  |  |  244|      0|    { xmlXPathErr(ctxt, X); return; }
  |  |  ------------------
  ------------------
 7867|  57.4k|    cur = xmlXPathValuePop(ctxt);
 7868|  57.4k|    if (cur == NULL) XP_ERROR(XPATH_INVALID_OPERAND);
  ------------------
  |  |  244|      0|    { xmlXPathErr(ctxt, X); return; }
  ------------------
  |  Branch (7868:9): [True: 0, False: 19.1k]
  ------------------
 7869|  19.1k|    if (cur->type != XPATH_BOOLEAN) {
  ------------------
  |  Branch (7869:9): [True: 13.8k, False: 5.29k]
  ------------------
 7870|  13.8k|        int boolval = xmlXPathCastToBoolean(cur);
 7871|       |
 7872|  13.8k|        xmlXPathReleaseObject(ctxt->context, cur);
 7873|  13.8k|        cur = xmlXPathCacheNewBoolean(ctxt, boolval);
 7874|  13.8k|    }
 7875|  19.1k|    xmlXPathValuePush(ctxt, cur);
 7876|  19.1k|}
xmlXPathNotFunction:
 7888|      7|xmlXPathNotFunction(xmlXPathParserContext *ctxt, int nargs) {
 7889|     19|    CHECK_ARITY(1);
  ------------------
  |  |  280|      7|    if (ctxt == NULL) return;						\
  |  |  ------------------
  |  |  |  Branch (280:9): [True: 0, False: 7]
  |  |  ------------------
  |  |  281|      7|    if (nargs != (x))							\
  |  |  ------------------
  |  |  |  Branch (281:9): [True: 1, False: 6]
  |  |  ------------------
  |  |  282|      7|        XP_ERROR(XPATH_INVALID_ARITY);					\
  |  |  ------------------
  |  |  |  |  244|      1|    { xmlXPathErr(ctxt, X); return; }
  |  |  ------------------
  |  |  283|      6|    if (ctxt->valueNr < (x))						\
  |  |  ------------------
  |  |  |  Branch (283:9): [True: 0, False: 6]
  |  |  ------------------
  |  |  284|      6|        XP_ERROR(XPATH_STACK_ERROR);
  |  |  ------------------
  |  |  |  |  244|      0|    { xmlXPathErr(ctxt, X); return; }
  |  |  ------------------
  ------------------
 7890|     19|    CAST_TO_BOOLEAN;
  ------------------
  |  |  304|      6|    if ((ctxt->value != NULL) && (ctxt->value->type != XPATH_BOOLEAN))	\
  |  |  ------------------
  |  |  |  Branch (304:9): [True: 6, False: 0]
  |  |  |  Branch (304:34): [True: 3, False: 3]
  |  |  ------------------
  |  |  305|      6|        xmlXPathBooleanFunction(ctxt, 1);
  ------------------
 7891|     19|    CHECK_TYPE(XPATH_BOOLEAN);
  ------------------
  |  |  261|      6|    if ((ctxt->value == NULL) || (ctxt->value->type != typeval))	\
  |  |  ------------------
  |  |  |  Branch (261:9): [True: 1, False: 5]
  |  |  |  Branch (261:34): [True: 1, False: 4]
  |  |  ------------------
  |  |  262|      6|        XP_ERROR(XPATH_INVALID_TYPE)
  |  |  ------------------
  |  |  |  |  244|      2|    { xmlXPathErr(ctxt, X); return; }
  |  |  ------------------
  ------------------
 7892|      4|    ctxt->value->boolval = ! ctxt->value->boolval;
 7893|      4|}
xmlXPathTrueFunction:
 7903|     16|xmlXPathTrueFunction(xmlXPathParserContext *ctxt, int nargs) {
 7904|     42|    CHECK_ARITY(0);
  ------------------
  |  |  280|     16|    if (ctxt == NULL) return;						\
  |  |  ------------------
  |  |  |  Branch (280:9): [True: 0, False: 16]
  |  |  ------------------
  |  |  281|     16|    if (nargs != (x))							\
  |  |  ------------------
  |  |  |  Branch (281:9): [True: 3, False: 13]
  |  |  ------------------
  |  |  282|     16|        XP_ERROR(XPATH_INVALID_ARITY);					\
  |  |  ------------------
  |  |  |  |  244|      3|    { xmlXPathErr(ctxt, X); return; }
  |  |  ------------------
  |  |  283|     13|    if (ctxt->valueNr < (x))						\
  |  |  ------------------
  |  |  |  Branch (283:9): [True: 0, False: 13]
  |  |  ------------------
  |  |  284|     13|        XP_ERROR(XPATH_STACK_ERROR);
  |  |  ------------------
  |  |  |  |  244|      0|    { xmlXPathErr(ctxt, X); return; }
  |  |  ------------------
  ------------------
 7905|     42|    xmlXPathValuePush(ctxt, xmlXPathCacheNewBoolean(ctxt, 1));
 7906|     42|}
xmlXPathFalseFunction:
 7916|     25|xmlXPathFalseFunction(xmlXPathParserContext *ctxt, int nargs) {
 7917|     69|    CHECK_ARITY(0);
  ------------------
  |  |  280|     25|    if (ctxt == NULL) return;						\
  |  |  ------------------
  |  |  |  Branch (280:9): [True: 0, False: 25]
  |  |  ------------------
  |  |  281|     25|    if (nargs != (x))							\
  |  |  ------------------
  |  |  |  Branch (281:9): [True: 3, False: 22]
  |  |  ------------------
  |  |  282|     25|        XP_ERROR(XPATH_INVALID_ARITY);					\
  |  |  ------------------
  |  |  |  |  244|      3|    { xmlXPathErr(ctxt, X); return; }
  |  |  ------------------
  |  |  283|     22|    if (ctxt->valueNr < (x))						\
  |  |  ------------------
  |  |  |  Branch (283:9): [True: 0, False: 22]
  |  |  ------------------
  |  |  284|     22|        XP_ERROR(XPATH_STACK_ERROR);
  |  |  ------------------
  |  |  |  |  244|      0|    { xmlXPathErr(ctxt, X); return; }
  |  |  ------------------
  ------------------
 7918|     69|    xmlXPathValuePush(ctxt, xmlXPathCacheNewBoolean(ctxt, 0));
 7919|     69|}
xmlXPathLangFunction:
 7942|  15.0k|xmlXPathLangFunction(xmlXPathParserContext *ctxt, int nargs) {
 7943|  15.0k|    xmlXPathObjectPtr val;
 7944|  15.0k|    xmlNodePtr cur;
 7945|  15.0k|    xmlChar *theLang = NULL;
 7946|  15.0k|    const xmlChar *lang;
 7947|  15.0k|    int ret = 0;
 7948|  15.0k|    int i;
 7949|       |
 7950|  45.1k|    CHECK_ARITY(1);
  ------------------
  |  |  280|  15.0k|    if (ctxt == NULL) return;						\
  |  |  ------------------
  |  |  |  Branch (280:9): [True: 0, False: 15.0k]
  |  |  ------------------
  |  |  281|  15.0k|    if (nargs != (x))							\
  |  |  ------------------
  |  |  |  Branch (281:9): [True: 3, False: 15.0k]
  |  |  ------------------
  |  |  282|  15.0k|        XP_ERROR(XPATH_INVALID_ARITY);					\
  |  |  ------------------
  |  |  |  |  244|      3|    { xmlXPathErr(ctxt, X); return; }
  |  |  ------------------
  |  |  283|  15.0k|    if (ctxt->valueNr < (x))						\
  |  |  ------------------
  |  |  |  Branch (283:9): [True: 0, False: 15.0k]
  |  |  ------------------
  |  |  284|  15.0k|        XP_ERROR(XPATH_STACK_ERROR);
  |  |  ------------------
  |  |  |  |  244|      0|    { xmlXPathErr(ctxt, X); return; }
  |  |  ------------------
  ------------------
 7951|  45.1k|    CAST_TO_STRING;
  ------------------
  |  |  290|  15.0k|    if ((ctxt->value != NULL) && (ctxt->value->type != XPATH_STRING))	\
  |  |  ------------------
  |  |  |  Branch (290:9): [True: 15.0k, False: 0]
  |  |  |  Branch (290:34): [True: 15.0k, False: 14]
  |  |  ------------------
  |  |  291|  15.0k|        xmlXPathStringFunction(ctxt, 1);
  ------------------
 7952|  45.1k|    CHECK_TYPE(XPATH_STRING);
  ------------------
  |  |  261|  15.0k|    if ((ctxt->value == NULL) || (ctxt->value->type != typeval))	\
  |  |  ------------------
  |  |  |  Branch (261:9): [True: 1, False: 15.0k]
  |  |  |  Branch (261:34): [True: 1, False: 15.0k]
  |  |  ------------------
  |  |  262|  15.0k|        XP_ERROR(XPATH_INVALID_TYPE)
  |  |  ------------------
  |  |  |  |  244|      2|    { xmlXPathErr(ctxt, X); return; }
  |  |  ------------------
  ------------------
 7953|  15.0k|    val = xmlXPathValuePop(ctxt);
 7954|  15.0k|    lang = val->stringval;
 7955|  15.0k|    cur = ctxt->context->node;
 7956|   360k|    while (cur != NULL) {
  ------------------
  |  Branch (7956:12): [True: 345k, False: 15.0k]
  ------------------
 7957|   345k|        if (xmlNodeGetAttrValue(cur, BAD_CAST "lang", XML_XML_NAMESPACE,
  ------------------
  |  |   34|   345k|#define BAD_CAST (xmlChar *)
  ------------------
                      if (xmlNodeGetAttrValue(cur, BAD_CAST "lang", XML_XML_NAMESPACE,
  ------------------
  |  |  146|   345k|    (const xmlChar *) "http://www.w3.org/XML/1998/namespace"
  ------------------
  |  Branch (7957:13): [True: 0, False: 345k]
  ------------------
 7958|   345k|                                &theLang) < 0)
 7959|      0|            xmlXPathPErrMemory(ctxt);
 7960|   345k|        if (theLang != NULL)
  ------------------
  |  Branch (7960:13): [True: 0, False: 345k]
  ------------------
 7961|      0|            break;
 7962|   345k|        cur = cur->parent;
 7963|   345k|    }
 7964|  15.0k|    if ((theLang != NULL) && (lang != NULL)) {
  ------------------
  |  Branch (7964:9): [True: 0, False: 15.0k]
  |  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|  15.0k|not_equal:
 7972|  15.0k|    if (theLang != NULL)
  ------------------
  |  Branch (7972:9): [True: 0, False: 15.0k]
  ------------------
 7973|      0|	xmlFree((void *)theLang);
 7974|       |
 7975|  15.0k|    xmlXPathReleaseObject(ctxt->context, val);
 7976|  15.0k|    xmlXPathValuePush(ctxt, xmlXPathCacheNewBoolean(ctxt, ret));
 7977|  15.0k|}
xmlXPathNumberFunction:
 7987|   364k|xmlXPathNumberFunction(xmlXPathParserContext *ctxt, int nargs) {
 7988|   364k|    xmlXPathObjectPtr cur;
 7989|   364k|    double res;
 7990|       |
 7991|   364k|    if (ctxt == NULL) return;
  ------------------
  |  Branch (7991:9): [True: 0, False: 364k]
  ------------------
 7992|   364k|    if (nargs == 0) {
  ------------------
  |  Branch (7992:9): [True: 0, False: 364k]
  ------------------
 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.45M|    CHECK_ARITY(1);
  ------------------
  |  |  280|   364k|    if (ctxt == NULL) return;						\
  |  |  ------------------
  |  |  |  Branch (280:9): [True: 0, False: 364k]
  |  |  ------------------
  |  |  281|   364k|    if (nargs != (x))							\
  |  |  ------------------
  |  |  |  Branch (281:9): [True: 0, False: 364k]
  |  |  ------------------
  |  |  282|   364k|        XP_ERROR(XPATH_INVALID_ARITY);					\
  |  |  ------------------
  |  |  |  |  244|      0|    { xmlXPathErr(ctxt, X); return; }
  |  |  ------------------
  |  |  283|   364k|    if (ctxt->valueNr < (x))						\
  |  |  ------------------
  |  |  |  Branch (283:9): [True: 7, False: 364k]
  |  |  ------------------
  |  |  284|   364k|        XP_ERROR(XPATH_STACK_ERROR);
  |  |  ------------------
  |  |  |  |  244|      7|    { xmlXPathErr(ctxt, X); return; }
  |  |  ------------------
  ------------------
 8008|  1.45M|    cur = xmlXPathValuePop(ctxt);
 8009|  1.45M|    if (cur->type != XPATH_NUMBER) {
  ------------------
  |  Branch (8009:9): [True: 364k, False: 1]
  ------------------
 8010|   364k|        double floatval;
 8011|       |
 8012|   364k|        floatval = xmlXPathCastToNumberInternal(ctxt, cur);
 8013|   364k|        xmlXPathReleaseObject(ctxt->context, cur);
 8014|   364k|        cur = xmlXPathCacheNewFloat(ctxt, floatval);
 8015|   364k|    }
 8016|  1.45M|    xmlXPathValuePush(ctxt, cur);
 8017|  1.45M|}
xmlXPathSumFunction:
 8029|     38|xmlXPathSumFunction(xmlXPathParserContext *ctxt, int nargs) {
 8030|     38|    xmlXPathObjectPtr cur;
 8031|     38|    int i;
 8032|     38|    double res = 0.0;
 8033|       |
 8034|    108|    CHECK_ARITY(1);
  ------------------
  |  |  280|     38|    if (ctxt == NULL) return;						\
  |  |  ------------------
  |  |  |  Branch (280:9): [True: 0, False: 38]
  |  |  ------------------
  |  |  281|     38|    if (nargs != (x))							\
  |  |  ------------------
  |  |  |  Branch (281:9): [True: 3, False: 35]
  |  |  ------------------
  |  |  282|     38|        XP_ERROR(XPATH_INVALID_ARITY);					\
  |  |  ------------------
  |  |  |  |  244|      3|    { xmlXPathErr(ctxt, X); return; }
  |  |  ------------------
  |  |  283|     35|    if (ctxt->valueNr < (x))						\
  |  |  ------------------
  |  |  |  Branch (283:9): [True: 0, False: 35]
  |  |  ------------------
  |  |  284|     35|        XP_ERROR(XPATH_STACK_ERROR);
  |  |  ------------------
  |  |  |  |  244|      0|    { xmlXPathErr(ctxt, X); return; }
  |  |  ------------------
  ------------------
 8035|    108|    if ((ctxt->value == NULL) ||
  ------------------
  |  Branch (8035:9): [True: 0, False: 35]
  ------------------
 8036|     35|	((ctxt->value->type != XPATH_NODESET) &&
  ------------------
  |  Branch (8036:3): [True: 3, False: 32]
  ------------------
 8037|      3|	 (ctxt->value->type != XPATH_XSLT_TREE)))
  ------------------
  |  Branch (8037:3): [True: 3, False: 0]
  ------------------
 8038|     32|	XP_ERROR(XPATH_INVALID_TYPE);
  ------------------
  |  |  244|      3|    { xmlXPathErr(ctxt, X); return; }
  ------------------
 8039|     32|    cur = xmlXPathValuePop(ctxt);
 8040|       |
 8041|     32|    if ((cur->nodesetval != NULL) && (cur->nodesetval->nodeNr != 0)) {
  ------------------
  |  Branch (8041:9): [True: 32, False: 0]
  |  Branch (8041:38): [True: 10, False: 22]
  ------------------
 8042|     40|	for (i = 0; i < cur->nodesetval->nodeNr; i++) {
  ------------------
  |  Branch (8042:14): [True: 30, False: 10]
  ------------------
 8043|     30|	    res += xmlXPathNodeToNumberInternal(ctxt,
 8044|     30|                                                cur->nodesetval->nodeTab[i]);
 8045|     30|	}
 8046|     10|    }
 8047|     32|    xmlXPathValuePush(ctxt, xmlXPathCacheNewFloat(ctxt, res));
 8048|     32|    xmlXPathReleaseObject(ctxt->context, cur);
 8049|     32|}
xmlXPathFloorFunction:
 8061|    281|xmlXPathFloorFunction(xmlXPathParserContext *ctxt, int nargs) {
 8062|    831|    CHECK_ARITY(1);
  ------------------
  |  |  280|    281|    if (ctxt == NULL) return;						\
  |  |  ------------------
  |  |  |  Branch (280:9): [True: 0, False: 281]
  |  |  ------------------
  |  |  281|    281|    if (nargs != (x))							\
  |  |  ------------------
  |  |  |  Branch (281:9): [True: 6, False: 275]
  |  |  ------------------
  |  |  282|    281|        XP_ERROR(XPATH_INVALID_ARITY);					\
  |  |  ------------------
  |  |  |  |  244|      6|    { xmlXPathErr(ctxt, X); return; }
  |  |  ------------------
  |  |  283|    275|    if (ctxt->valueNr < (x))						\
  |  |  ------------------
  |  |  |  Branch (283:9): [True: 0, False: 275]
  |  |  ------------------
  |  |  284|    275|        XP_ERROR(XPATH_STACK_ERROR);
  |  |  ------------------
  |  |  |  |  244|      0|    { xmlXPathErr(ctxt, X); return; }
  |  |  ------------------
  ------------------
 8063|    831|    CAST_TO_NUMBER;
  ------------------
  |  |  297|    275|    if ((ctxt->value != NULL) && (ctxt->value->type != XPATH_NUMBER))	\
  |  |  ------------------
  |  |  |  Branch (297:9): [True: 275, False: 0]
  |  |  |  Branch (297:34): [True: 161, False: 114]
  |  |  ------------------
  |  |  298|    275|        xmlXPathNumberFunction(ctxt, 1);
  ------------------
 8064|    831|    CHECK_TYPE(XPATH_NUMBER);
  ------------------
  |  |  261|    275|    if ((ctxt->value == NULL) || (ctxt->value->type != typeval))	\
  |  |  ------------------
  |  |  |  Branch (261:9): [True: 0, False: 275]
  |  |  |  Branch (261:34): [True: 2, False: 273]
  |  |  ------------------
  |  |  262|    275|        XP_ERROR(XPATH_INVALID_TYPE)
  |  |  ------------------
  |  |  |  |  244|      2|    { xmlXPathErr(ctxt, X); return; }
  |  |  ------------------
  ------------------
 8065|       |
 8066|    273|    ctxt->value->floatval = floor(ctxt->value->floatval);
 8067|    273|}
xmlXPathParseNCName:
 8147|   100k|xmlXPathParseNCName(xmlXPathParserContext *ctxt) {
 8148|   100k|    const xmlChar *end;
 8149|   100k|    xmlChar *ret;
 8150|       |
 8151|   100k|    if ((ctxt == NULL) || (ctxt->cur == NULL)) return(NULL);
  ------------------
  |  Branch (8151:9): [True: 0, False: 100k]
  |  Branch (8151:27): [True: 0, False: 100k]
  ------------------
 8152|       |
 8153|   100k|    end = xmlScanName(ctxt->cur, XML_MAX_NAME_LENGTH, XML_SCAN_NC);
  ------------------
  |  |   65|   100k|#define XML_MAX_NAME_LENGTH 50000
  ------------------
                  end = xmlScanName(ctxt->cur, XML_MAX_NAME_LENGTH, XML_SCAN_NC);
  ------------------
  |  |   69|   100k|#define XML_SCAN_NC         1
  ------------------
 8154|   100k|    if (end == NULL) {
  ------------------
  |  Branch (8154:9): [True: 3, False: 100k]
  ------------------
 8155|      3|        XP_ERRORNULL(XPATH_EXPR_ERROR);
  ------------------
  |  |  633|      3|    { xmlXPathErr(ctxt, X); return(NULL); }
  ------------------
 8156|      0|    }
 8157|   100k|    if (end == ctxt->cur)
  ------------------
  |  Branch (8157:9): [True: 5.26k, False: 95.2k]
  ------------------
 8158|  5.26k|        return(NULL);
 8159|       |
 8160|  95.2k|    ret = xmlStrndup(ctxt->cur, end - ctxt->cur);
 8161|  95.2k|    if (ret == NULL)
  ------------------
  |  Branch (8161:9): [True: 77, False: 95.1k]
  ------------------
 8162|     77|        xmlXPathPErrMemory(ctxt);
 8163|  95.2k|    ctxt->cur = end;
 8164|  95.2k|    return(ret);
 8165|   100k|}
xmlXPathParseName:
 8199|  22.5k|xmlXPathParseName(xmlXPathParserContext *ctxt) {
 8200|  22.5k|    const xmlChar *end;
 8201|  22.5k|    xmlChar *ret;
 8202|       |
 8203|  22.5k|    if ((ctxt == NULL) || (ctxt->cur == NULL)) return(NULL);
  ------------------
  |  Branch (8203:9): [True: 0, False: 22.5k]
  |  Branch (8203:27): [True: 0, False: 22.5k]
  ------------------
 8204|       |
 8205|  22.5k|    end = xmlScanName(ctxt->cur, XML_MAX_NAME_LENGTH, 0);
  ------------------
  |  |   65|  22.5k|#define XML_MAX_NAME_LENGTH 50000
  ------------------
 8206|  22.5k|    if (end == NULL) {
  ------------------
  |  Branch (8206:9): [True: 3, False: 22.5k]
  ------------------
 8207|      3|        XP_ERRORNULL(XPATH_EXPR_ERROR);
  ------------------
  |  |  633|      3|    { xmlXPathErr(ctxt, X); return(NULL); }
  ------------------
 8208|      0|    }
 8209|  22.5k|    if (end == ctxt->cur)
  ------------------
  |  Branch (8209:9): [True: 3.44k, False: 19.0k]
  ------------------
 8210|  3.44k|        return(NULL);
 8211|       |
 8212|  19.0k|    ret = xmlStrndup(ctxt->cur, end - ctxt->cur);
 8213|  19.0k|    if (ret == NULL)
  ------------------
  |  Branch (8213:9): [True: 53, False: 19.0k]
  ------------------
 8214|     53|        xmlXPathPErrMemory(ctxt);
 8215|  19.0k|    ctxt->cur = end;
 8216|  19.0k|    return(ret);
 8217|  22.5k|}
xmlXPathStringEvalNumber:
 8236|   690k|xmlXPathStringEvalNumber(const xmlChar *str) {
 8237|   690k|    const xmlChar *cur = str;
 8238|   690k|    double ret;
 8239|   690k|    int ok = 0;
 8240|   690k|    int isneg = 0;
 8241|   690k|    int exponent = 0;
 8242|   690k|    int is_exponent_negative = 0;
 8243|   690k|#ifdef __GNUC__
 8244|   690k|    unsigned long tmp = 0;
 8245|   690k|    double temp;
 8246|   690k|#endif
 8247|   690k|    if (cur == NULL) return(0);
  ------------------
  |  Branch (8247:9): [True: 0, False: 690k]
  ------------------
 8248|   690k|    while (IS_BLANK_CH(*cur)) cur++;
 8249|   690k|    if (*cur == '-') {
  ------------------
  |  Branch (8249:9): [True: 68.9k, False: 621k]
  ------------------
 8250|  68.9k|	isneg = 1;
 8251|  68.9k|	cur++;
 8252|  68.9k|    }
 8253|   690k|    if ((*cur != '.') && ((*cur < '0') || (*cur > '9'))) {
  ------------------
  |  Branch (8253:9): [True: 614k, False: 75.7k]
  |  Branch (8253:27): [True: 527k, False: 87.2k]
  |  Branch (8253:43): [True: 66.3k, False: 20.8k]
  ------------------
 8254|   593k|        return(xmlXPathNAN);
 8255|   593k|    }
 8256|       |
 8257|  96.6k|#ifdef __GNUC__
 8258|       |    /*
 8259|       |     * tmp/temp is a workaround against a gcc compiler bug
 8260|       |     * http://veillard.com/gcc.bug
 8261|       |     */
 8262|  96.6k|    ret = 0;
 8263|   158k|    while ((*cur >= '0') && (*cur <= '9')) {
  ------------------
  |  Branch (8263:12): [True: 64.2k, False: 94.6k]
  |  Branch (8263:29): [True: 62.2k, False: 1.99k]
  ------------------
 8264|  62.2k|	ret = ret * 10;
 8265|  62.2k|	tmp = (*cur - '0');
 8266|  62.2k|	ok = 1;
 8267|  62.2k|	cur++;
 8268|  62.2k|	temp = (double) tmp;
 8269|  62.2k|	ret = ret + temp;
 8270|  62.2k|    }
 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|  96.6k|    if (*cur == '.') {
  ------------------
  |  Branch (8280:9): [True: 80.7k, False: 15.8k]
  ------------------
 8281|  80.7k|	int v, frac = 0, max;
 8282|  80.7k|	double fraction = 0;
 8283|       |
 8284|  80.7k|        cur++;
 8285|  80.7k|	if (((*cur < '0') || (*cur > '9')) && (!ok)) {
  ------------------
  |  Branch (8285:7): [True: 18.1k, False: 62.6k]
  |  Branch (8285:23): [True: 22.8k, False: 39.8k]
  |  Branch (8285:40): [True: 39.0k, False: 1.88k]
  ------------------
 8286|  39.0k|	    return(xmlXPathNAN);
 8287|  39.0k|	}
 8288|  69.8k|        while (*cur == '0') {
  ------------------
  |  Branch (8288:16): [True: 28.1k, False: 41.7k]
  ------------------
 8289|  28.1k|	    frac = frac + 1;
 8290|  28.1k|	    cur++;
 8291|  28.1k|        }
 8292|  41.7k|        max = frac + MAX_FRAC;
  ------------------
  |  | 8219|  41.7k|#define MAX_FRAC 20
  ------------------
 8293|  89.5k|	while (((*cur >= '0') && (*cur <= '9')) && (frac < max)) {
  ------------------
  |  Branch (8293:10): [True: 65.0k, False: 24.4k]
  |  Branch (8293:27): [True: 47.8k, False: 17.1k]
  |  Branch (8293:45): [True: 47.8k, False: 31]
  ------------------
 8294|  47.8k|	    v = (*cur - '0');
 8295|  47.8k|	    fraction = fraction * 10 + v;
 8296|  47.8k|	    frac = frac + 1;
 8297|  47.8k|	    cur++;
 8298|  47.8k|	}
 8299|  41.7k|	fraction /= pow(10.0, frac);
 8300|  41.7k|	ret = ret + fraction;
 8301|  41.9k|	while ((*cur >= '0') && (*cur <= '9'))
  ------------------
  |  Branch (8301:9): [True: 17.4k, False: 24.5k]
  |  Branch (8301:26): [True: 233, False: 17.1k]
  ------------------
 8302|    233|	    cur++;
 8303|  41.7k|    }
 8304|  57.5k|    if ((*cur == 'e') || (*cur == 'E')) {
  ------------------
  |  Branch (8304:9): [True: 3.39k, False: 54.1k]
  |  Branch (8304:26): [True: 7.38k, False: 46.7k]
  ------------------
 8305|  10.7k|      cur++;
 8306|  10.7k|      if (*cur == '-') {
  ------------------
  |  Branch (8306:11): [True: 2.56k, False: 8.20k]
  ------------------
 8307|  2.56k|	is_exponent_negative = 1;
 8308|  2.56k|	cur++;
 8309|  8.20k|      } else if (*cur == '+') {
  ------------------
  |  Branch (8309:18): [True: 4.01k, False: 4.19k]
  ------------------
 8310|  4.01k|        cur++;
 8311|  4.01k|      }
 8312|  53.6k|      while ((*cur >= '0') && (*cur <= '9')) {
  ------------------
  |  Branch (8312:14): [True: 43.5k, False: 10.0k]
  |  Branch (8312:31): [True: 42.8k, False: 678]
  ------------------
 8313|  42.8k|        if (exponent < 1000000)
  ------------------
  |  Branch (8313:13): [True: 38.5k, False: 4.28k]
  ------------------
 8314|  38.5k|	  exponent = exponent * 10 + (*cur - '0');
 8315|  42.8k|	cur++;
 8316|  42.8k|      }
 8317|  10.7k|    }
 8318|  57.5k|    while (IS_BLANK_CH(*cur)) cur++;
 8319|  57.5k|    if (*cur != 0) return(xmlXPathNAN);
  ------------------
  |  Branch (8319:9): [True: 29.3k, False: 28.1k]
  ------------------
 8320|  28.1k|    if (isneg) ret = -ret;
  ------------------
  |  Branch (8320:9): [True: 11.4k, False: 16.6k]
  ------------------
 8321|  28.1k|    if (is_exponent_negative) exponent = -exponent;
  ------------------
  |  Branch (8321:9): [True: 2.39k, False: 25.7k]
  ------------------
 8322|  28.1k|    ret *= pow(10.0, (double)exponent);
 8323|  28.1k|    return(ret);
 8324|  57.5k|}
xmlXPathIsNodeType:
 8548|  11.8k|xmlXPathIsNodeType(const xmlChar *name) {
 8549|  11.8k|    if (name == NULL)
  ------------------
  |  Branch (8549:9): [True: 0, False: 11.8k]
  ------------------
 8550|      0|	return(0);
 8551|       |
 8552|  11.8k|    if (xmlStrEqual(name, BAD_CAST "node"))
  ------------------
  |  |   34|  11.8k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (8552:9): [True: 38, False: 11.7k]
  ------------------
 8553|     38|	return(1);
 8554|  11.7k|    if (xmlStrEqual(name, BAD_CAST "text"))
  ------------------
  |  |   34|  11.7k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (8554:9): [True: 44, False: 11.7k]
  ------------------
 8555|     44|	return(1);
 8556|  11.7k|    if (xmlStrEqual(name, BAD_CAST "comment"))
  ------------------
  |  |   34|  11.7k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (8556:9): [True: 42, False: 11.6k]
  ------------------
 8557|     42|	return(1);
 8558|  11.6k|    if (xmlStrEqual(name, BAD_CAST "processing-instruction"))
  ------------------
  |  |   34|  11.6k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (8558:9): [True: 170, False: 11.5k]
  ------------------
 8559|    170|	return(1);
 8560|  11.5k|    return(0);
 8561|  11.6k|}
xmlXPathEvaluatePredicateResult:
11626|   207k|                                xmlXPathObject *res) {
11627|   207k|    if ((ctxt == NULL) || (res == NULL)) return(0);
  ------------------
  |  Branch (11627:9): [True: 0, False: 207k]
  |  Branch (11627:27): [True: 0, False: 207k]
  ------------------
11628|   207k|    switch (res->type) {
11629|      0|        case XPATH_BOOLEAN:
  ------------------
  |  Branch (11629:9): [True: 0, False: 207k]
  ------------------
11630|      0|	    return(res->boolval);
11631|  90.6k|        case XPATH_NUMBER:
  ------------------
  |  Branch (11631:9): [True: 90.6k, False: 117k]
  ------------------
11632|       |#if defined(__BORLANDC__) || (defined(_MSC_VER) && (_MSC_VER == 1200))
11633|       |	    return((res->floatval == ctxt->context->proximityPosition) &&
11634|       |	           (!xmlXPathIsNaN(res->floatval))); /* MSC pbm Mark Vakoc !*/
11635|       |#else
11636|  90.6k|	    return(res->floatval == ctxt->context->proximityPosition);
11637|      0|#endif
11638|   112k|        case XPATH_NODESET:
  ------------------
  |  Branch (11638:9): [True: 112k, False: 95.1k]
  ------------------
11639|   112k|        case XPATH_XSLT_TREE:
  ------------------
  |  Branch (11639:9): [True: 0, False: 207k]
  ------------------
11640|   112k|	    if (res->nodesetval == NULL)
  ------------------
  |  Branch (11640:10): [True: 0, False: 112k]
  ------------------
11641|      0|		return(0);
11642|   112k|	    return(res->nodesetval->nodeNr != 0);
11643|  4.43k|        case XPATH_STRING:
  ------------------
  |  Branch (11643:9): [True: 4.43k, False: 203k]
  ------------------
11644|  4.43k|	    return((res->stringval != NULL) && (res->stringval[0] != 0));
  ------------------
  |  Branch (11644:13): [True: 4.43k, False: 0]
  |  Branch (11644:41): [True: 3.59k, False: 838]
  ------------------
11645|      0|        default:
  ------------------
  |  Branch (11645:9): [True: 0, False: 207k]
  ------------------
11646|      0|	    break;
11647|   207k|    }
11648|      0|    return(0);
11649|   207k|}
xmlXPathEvalExpr:
12002|  15.6k|xmlXPathEvalExpr(xmlXPathParserContext *ctxt) {
12003|       |#ifdef XPATH_STREAMING
12004|       |    xmlXPathCompExprPtr comp;
12005|       |#endif
12006|  15.6k|    int oldDepth = 0;
12007|       |
12008|  15.6k|    if ((ctxt == NULL) || (ctxt->context == NULL))
  ------------------
  |  Branch (12008:9): [True: 0, False: 15.6k]
  |  Branch (12008:27): [True: 0, False: 15.6k]
  ------------------
12009|      0|        return;
12010|  15.6k|    if (ctxt->context->lastError.code != 0)
  ------------------
  |  Branch (12010:9): [True: 198, False: 15.4k]
  ------------------
12011|    198|        return;
12012|       |
12013|       |#ifdef XPATH_STREAMING
12014|       |    comp = xmlXPathTryStreamCompile(ctxt->context, ctxt->base);
12015|       |    if ((comp == NULL) &&
12016|       |        (ctxt->context->lastError.code == XML_ERR_NO_MEMORY)) {
12017|       |        xmlXPathPErrMemory(ctxt);
12018|       |        return;
12019|       |    }
12020|       |    if (comp != NULL) {
12021|       |        if (ctxt->comp != NULL)
12022|       |	    xmlXPathFreeCompExpr(ctxt->comp);
12023|       |        ctxt->comp = comp;
12024|       |    } else
12025|       |#endif
12026|  15.4k|    {
12027|  15.4k|        if (ctxt->context != NULL)
  ------------------
  |  Branch (12027:13): [True: 15.4k, False: 0]
  ------------------
12028|  15.4k|            oldDepth = ctxt->context->depth;
12029|  15.4k|	xmlXPathCompileExpr(ctxt, 1);
12030|  15.4k|        if (ctxt->context != NULL)
  ------------------
  |  Branch (12030:13): [True: 15.4k, False: 0]
  ------------------
12031|  15.4k|            ctxt->context->depth = oldDepth;
12032|  15.4k|        CHECK_ERROR;
  ------------------
  |  |  230|  15.4k|    if (ctxt->error != XPATH_EXPRESSION_OK) return
  |  |  ------------------
  |  |  |  Branch (230:9): [True: 2.09k, False: 13.3k]
  |  |  ------------------
  ------------------
12033|       |
12034|       |        /* Check for trailing characters. */
12035|  13.3k|        if (*ctxt->cur != 0)
  ------------------
  |  Branch (12035:13): [True: 401, False: 12.9k]
  ------------------
12036|  12.9k|            XP_ERROR(XPATH_EXPR_ERROR);
  ------------------
  |  |  244|    401|    { xmlXPathErr(ctxt, X); return; }
  ------------------
12037|       |
12038|  12.9k|	if ((ctxt->comp->nbStep > 1) && (ctxt->comp->last >= 0)) {
  ------------------
  |  Branch (12038:6): [True: 12.9k, False: 36]
  |  Branch (12038:34): [True: 12.9k, False: 0]
  ------------------
12039|  12.9k|            if (ctxt->context != NULL)
  ------------------
  |  Branch (12039:17): [True: 12.9k, False: 0]
  ------------------
12040|  12.9k|                oldDepth = ctxt->context->depth;
12041|  12.9k|	    xmlXPathOptimizeExpression(ctxt,
12042|  12.9k|		&ctxt->comp->steps[ctxt->comp->last]);
12043|  12.9k|            if (ctxt->context != NULL)
  ------------------
  |  Branch (12043:17): [True: 12.9k, False: 0]
  ------------------
12044|  12.9k|                ctxt->context->depth = oldDepth;
12045|  12.9k|        }
12046|  12.9k|    }
12047|       |
12048|      0|    xmlXPathRunEval(ctxt, 0);
12049|  12.9k|}
xpath.c:xmlXPathNameFunction:
 7223|  8.79k|{
 7224|  8.79k|    xmlXPathObjectPtr cur;
 7225|       |
 7226|  8.79k|    if (nargs == 0) {
  ------------------
  |  Branch (7226:9): [True: 2.89k, False: 5.89k]
  ------------------
 7227|  2.89k|	xmlXPathValuePush(ctxt, xmlXPathCacheNewNodeSet(ctxt, ctxt->context->node));
 7228|  2.89k|        nargs = 1;
 7229|  2.89k|    }
 7230|       |
 7231|  26.3k|    CHECK_ARITY(1);
  ------------------
  |  |  280|  8.79k|    if (ctxt == NULL) return;						\
  |  |  ------------------
  |  |  |  Branch (280:9): [True: 0, False: 8.79k]
  |  |  ------------------
  |  |  281|  8.79k|    if (nargs != (x))							\
  |  |  ------------------
  |  |  |  Branch (281:9): [True: 3, False: 8.79k]
  |  |  ------------------
  |  |  282|  8.79k|        XP_ERROR(XPATH_INVALID_ARITY);					\
  |  |  ------------------
  |  |  |  |  244|      3|    { xmlXPathErr(ctxt, X); return; }
  |  |  ------------------
  |  |  283|  8.79k|    if (ctxt->valueNr < (x))						\
  |  |  ------------------
  |  |  |  Branch (283:9): [True: 4, False: 8.79k]
  |  |  ------------------
  |  |  284|  8.79k|        XP_ERROR(XPATH_STACK_ERROR);
  |  |  ------------------
  |  |  |  |  244|      4|    { xmlXPathErr(ctxt, X); return; }
  |  |  ------------------
  ------------------
 7232|  26.3k|    if ((ctxt->value == NULL) ||
  ------------------
  |  Branch (7232:9): [True: 0, False: 8.79k]
  ------------------
 7233|  8.79k|        ((ctxt->value->type != XPATH_NODESET) &&
  ------------------
  |  Branch (7233:10): [True: 5, False: 8.78k]
  ------------------
 7234|      5|         (ctxt->value->type != XPATH_XSLT_TREE)))
  ------------------
  |  Branch (7234:10): [True: 5, False: 0]
  ------------------
 7235|  8.78k|        XP_ERROR(XPATH_INVALID_TYPE);
  ------------------
  |  |  244|      5|    { xmlXPathErr(ctxt, X); return; }
  ------------------
 7236|  8.78k|    cur = xmlXPathValuePop(ctxt);
 7237|       |
 7238|  8.78k|    if ((cur->nodesetval == NULL) || (cur->nodesetval->nodeNr == 0)) {
  ------------------
  |  Branch (7238:9): [True: 0, False: 8.78k]
  |  Branch (7238:38): [True: 2.43k, False: 6.34k]
  ------------------
 7239|  2.43k|        xmlXPathValuePush(ctxt, xmlXPathCacheNewCString(ctxt, ""));
 7240|  6.34k|    } else {
 7241|  6.34k|        int i = 0;              /* Should be first in document order !!!!! */
 7242|       |
 7243|  6.34k|        switch (cur->nodesetval->nodeTab[i]->type) {
 7244|  4.15k|            case XML_ELEMENT_NODE:
  ------------------
  |  Branch (7244:13): [True: 4.15k, False: 2.19k]
  ------------------
 7245|  4.15k|            case XML_ATTRIBUTE_NODE:
  ------------------
  |  Branch (7245:13): [True: 0, False: 6.34k]
  ------------------
 7246|  4.15k|		if (cur->nodesetval->nodeTab[i]->name[0] == ' ')
  ------------------
  |  Branch (7246:7): [True: 0, False: 4.15k]
  ------------------
 7247|      0|		    xmlXPathValuePush(ctxt,
 7248|      0|			xmlXPathCacheNewCString(ctxt, ""));
 7249|  4.15k|		else if ((cur->nodesetval->nodeTab[i]->ns == NULL) ||
  ------------------
  |  Branch (7249:12): [True: 3.58k, False: 569]
  ------------------
 7250|  3.94k|                         (cur->nodesetval->nodeTab[i]->ns->prefix == NULL)) {
  ------------------
  |  Branch (7250:26): [True: 358, False: 211]
  ------------------
 7251|  3.94k|		    xmlXPathValuePush(ctxt, xmlXPathCacheNewString(ctxt,
 7252|  3.94k|			    cur->nodesetval->nodeTab[i]->name));
 7253|  3.94k|		} else {
 7254|    211|		    xmlChar *fullname;
 7255|       |
 7256|    211|		    fullname = xmlBuildQName(cur->nodesetval->nodeTab[i]->name,
 7257|    211|				     cur->nodesetval->nodeTab[i]->ns->prefix,
 7258|    211|				     NULL, 0);
 7259|    211|		    if (fullname == cur->nodesetval->nodeTab[i]->name)
  ------------------
  |  Branch (7259:11): [True: 0, False: 211]
  ------------------
 7260|      0|			fullname = xmlStrdup(cur->nodesetval->nodeTab[i]->name);
 7261|    211|		    if (fullname == NULL)
  ------------------
  |  Branch (7261:11): [True: 1, False: 210]
  ------------------
 7262|      1|                        xmlXPathPErrMemory(ctxt);
 7263|    211|		    xmlXPathValuePush(ctxt, xmlXPathCacheWrapString(ctxt, fullname));
 7264|    211|                }
 7265|  4.15k|                break;
 7266|  2.19k|            default:
  ------------------
  |  Branch (7266:13): [True: 2.19k, False: 4.15k]
  ------------------
 7267|  2.19k|		xmlXPathValuePush(ctxt, xmlXPathCacheNewNodeSet(ctxt,
 7268|  2.19k|		    cur->nodesetval->nodeTab[i]));
 7269|  2.19k|                xmlXPathLocalNameFunction(ctxt, 1);
 7270|  6.34k|        }
 7271|  6.34k|    }
 7272|  8.78k|    xmlXPathReleaseObject(ctxt->context, cur);
 7273|  8.78k|}
xpath.c:xmlXPathSFComputeHash:
  186|  7.37k|xmlXPathSFComputeHash(const xmlChar *name) {
  187|  7.37k|    unsigned hashValue = 5381;
  188|  7.37k|    const xmlChar *ptr;
  189|       |
  190|  46.9k|    for (ptr = name; *ptr; ptr++)
  ------------------
  |  Branch (190:22): [True: 39.5k, False: 7.37k]
  ------------------
  191|  39.5k|        hashValue = hashValue * 33 + *ptr;
  192|       |
  193|  7.37k|    return(hashValue);
  194|  7.37k|}
xpath.c:wrap_cmp:
  606|  4.07M|    {
  607|  4.07M|        int res = xmlXPathCmpNodesExt(x, y);
  608|  4.07M|        return res == -2 ? res : -res;
  ------------------
  |  Branch (608:16): [True: 0, False: 4.07M]
  ------------------
  609|  4.07M|    }
xpath.c:xmlXPathCmpNodesExt:
  309|  4.07M|xmlXPathCmpNodesExt(xmlNodePtr node1, xmlNodePtr node2) {
  310|  4.07M|    int depth1, depth2;
  311|  4.07M|    int misc = 0, precedence1 = 0, precedence2 = 0;
  312|  4.07M|    xmlNodePtr miscNode1 = NULL, miscNode2 = NULL;
  313|  4.07M|    xmlNodePtr cur, root;
  314|  4.07M|    XML_INTPTR_T l1, l2;
  ------------------
  |  |   52|  4.07M|  #define XML_INTPTR_T intptr_t
  ------------------
  315|       |
  316|  4.07M|    if ((node1 == NULL) || (node2 == NULL))
  ------------------
  |  Branch (316:9): [True: 0, False: 4.07M]
  |  Branch (316:28): [True: 0, False: 4.07M]
  ------------------
  317|      0|	return(-2);
  318|       |
  319|  4.07M|    if (node1 == node2)
  ------------------
  |  Branch (319:9): [True: 0, False: 4.07M]
  ------------------
  320|      0|	return(0);
  321|       |
  322|       |    /*
  323|       |     * a couple of optimizations which will avoid computations in most cases
  324|       |     */
  325|  4.07M|    switch (node1->type) {
  326|  2.98M|	case XML_ELEMENT_NODE:
  ------------------
  |  Branch (326:2): [True: 2.98M, False: 1.09M]
  ------------------
  327|  2.98M|	    if (node2->type == XML_ELEMENT_NODE) {
  ------------------
  |  Branch (327:10): [True: 2.31M, False: 672k]
  ------------------
  328|  2.31M|		if ((0 > XML_NODE_SORT_VALUE(node1)) &&
  ------------------
  |  |  295|  2.31M|#define XML_NODE_SORT_VALUE(n) XML_PTR_TO_INT((n)->content)
  |  |  ------------------
  |  |  |  |   58|  2.31M|#define XML_PTR_TO_INT(p) ((XML_INTPTR_T) (p))
  |  |  ------------------
  ------------------
  |  Branch (328:7): [True: 0, False: 2.31M]
  ------------------
  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.31M|		    goto turtle_comparison;
  340|  2.31M|	    }
  341|   672k|	    break;
  342|   672k|	case XML_ATTRIBUTE_NODE:
  ------------------
  |  Branch (342:2): [True: 6.73k, False: 4.07M]
  ------------------
  343|  6.73k|	    precedence1 = 1; /* element is owner */
  344|  6.73k|	    miscNode1 = node1;
  345|  6.73k|	    node1 = node1->parent;
  346|  6.73k|	    misc = 1;
  347|  6.73k|	    break;
  348|   765k|	case XML_TEXT_NODE:
  ------------------
  |  Branch (348:2): [True: 765k, False: 3.31M]
  ------------------
  349|   821k|	case XML_CDATA_SECTION_NODE:
  ------------------
  |  Branch (349:2): [True: 56.3k, False: 4.02M]
  ------------------
  350|   830k|	case XML_COMMENT_NODE:
  ------------------
  |  Branch (350:2): [True: 8.51k, False: 4.06M]
  ------------------
  351|   920k|	case XML_PI_NODE: {
  ------------------
  |  Branch (351:2): [True: 90.6k, False: 3.98M]
  ------------------
  352|   920k|	    miscNode1 = node1;
  353|       |	    /*
  354|       |	    * Find nearest element node.
  355|       |	    */
  356|   920k|	    if (node1->prev != NULL) {
  ------------------
  |  Branch (356:10): [True: 480k, False: 440k]
  ------------------
  357|  6.07M|		do {
  358|  6.07M|		    node1 = node1->prev;
  359|  6.07M|		    if (node1->type == XML_ELEMENT_NODE) {
  ------------------
  |  Branch (359:11): [True: 470k, False: 5.60M]
  ------------------
  360|   470k|			precedence1 = 3; /* element in prev-sibl axis */
  361|   470k|			break;
  362|   470k|		    }
  363|  5.60M|		    if (node1->prev == NULL) {
  ------------------
  |  Branch (363:11): [True: 9.60k, False: 5.59M]
  ------------------
  364|  9.60k|			precedence1 = 2; /* element is parent */
  365|       |			/*
  366|       |			* URGENT TODO: Are there any cases, where the
  367|       |			* parent of such a node is not an element node?
  368|       |			*/
  369|  9.60k|			node1 = node1->parent;
  370|  9.60k|			break;
  371|  9.60k|		    }
  372|  5.60M|		} while (1);
  ------------------
  |  Branch (372:12): [True: 5.59M, Folded]
  ------------------
  373|   480k|	    } else {
  374|   440k|		precedence1 = 2; /* element is parent */
  375|   440k|		node1 = node1->parent;
  376|   440k|	    }
  377|   920k|	    if ((node1 == NULL) || (node1->type != XML_ELEMENT_NODE) ||
  ------------------
  |  Branch (377:10): [True: 0, False: 920k]
  |  Branch (377:29): [True: 1.03k, False: 919k]
  ------------------
  378|   920k|		(0 <= XML_NODE_SORT_VALUE(node1))) {
  ------------------
  |  |  295|   919k|#define XML_NODE_SORT_VALUE(n) XML_PTR_TO_INT((n)->content)
  |  |  ------------------
  |  |  |  |   58|   919k|#define XML_PTR_TO_INT(p) ((XML_INTPTR_T) (p))
  |  |  ------------------
  ------------------
  |  Branch (378:3): [True: 919k, False: 0]
  ------------------
  379|       |		/*
  380|       |		* Fallback for whatever case.
  381|       |		*/
  382|   920k|		node1 = miscNode1;
  383|   920k|		precedence1 = 0;
  384|   920k|	    } else
  385|      0|		misc = 1;
  386|   920k|	}
  387|   920k|	    break;
  388|   140k|	case XML_NAMESPACE_DECL:
  ------------------
  |  Branch (388:2): [True: 140k, False: 3.93M]
  ------------------
  389|       |	    /*
  390|       |	    * TODO: why do we return 1 for namespace nodes?
  391|       |	    */
  392|   140k|	    return(1);
  393|  23.6k|	default:
  ------------------
  |  Branch (393:2): [True: 23.6k, False: 4.05M]
  ------------------
  394|  23.6k|	    break;
  395|  4.07M|    }
  396|  1.62M|    switch (node2->type) {
  397|   507k|	case XML_ELEMENT_NODE:
  ------------------
  |  Branch (397:2): [True: 507k, False: 1.11M]
  ------------------
  398|   507k|	    break;
  399|  19.6k|	case XML_ATTRIBUTE_NODE:
  ------------------
  |  Branch (399:2): [True: 19.6k, False: 1.60M]
  ------------------
  400|  19.6k|	    precedence2 = 1; /* element is owner */
  401|  19.6k|	    miscNode2 = node2;
  402|  19.6k|	    node2 = node2->parent;
  403|  19.6k|	    misc = 1;
  404|  19.6k|	    break;
  405|   838k|	case XML_TEXT_NODE:
  ------------------
  |  Branch (405:2): [True: 838k, False: 785k]
  ------------------
  406|   896k|	case XML_CDATA_SECTION_NODE:
  ------------------
  |  Branch (406:2): [True: 57.6k, False: 1.56M]
  ------------------
  407|   905k|	case XML_COMMENT_NODE:
  ------------------
  |  Branch (407:2): [True: 8.91k, False: 1.61M]
  ------------------
  408|   994k|	case XML_PI_NODE: {
  ------------------
  |  Branch (408:2): [True: 89.5k, False: 1.53M]
  ------------------
  409|   994k|	    miscNode2 = node2;
  410|   994k|	    if (node2->prev != NULL) {
  ------------------
  |  Branch (410:10): [True: 497k, False: 497k]
  ------------------
  411|  6.09M|		do {
  412|  6.09M|		    node2 = node2->prev;
  413|  6.09M|		    if (node2->type == XML_ELEMENT_NODE) {
  ------------------
  |  Branch (413:11): [True: 487k, False: 5.60M]
  ------------------
  414|   487k|			precedence2 = 3; /* element in prev-sibl axis */
  415|   487k|			break;
  416|   487k|		    }
  417|  5.60M|		    if (node2->prev == NULL) {
  ------------------
  |  Branch (417:11): [True: 9.55k, False: 5.59M]
  ------------------
  418|  9.55k|			precedence2 = 2; /* element is parent */
  419|  9.55k|			node2 = node2->parent;
  420|  9.55k|			break;
  421|  9.55k|		    }
  422|  5.60M|		} while (1);
  ------------------
  |  Branch (422:12): [True: 5.59M, Folded]
  ------------------
  423|   497k|	    } else {
  424|   497k|		precedence2 = 2; /* element is parent */
  425|   497k|		node2 = node2->parent;
  426|   497k|	    }
  427|   994k|	    if ((node2 == NULL) || (node2->type != XML_ELEMENT_NODE) ||
  ------------------
  |  Branch (427:10): [True: 0, False: 994k]
  |  Branch (427:29): [True: 837, False: 993k]
  ------------------
  428|   993k|		(0 <= XML_NODE_SORT_VALUE(node2)))
  ------------------
  |  |  295|   993k|#define XML_NODE_SORT_VALUE(n) XML_PTR_TO_INT((n)->content)
  |  |  ------------------
  |  |  |  |   58|   993k|#define XML_PTR_TO_INT(p) ((XML_INTPTR_T) (p))
  |  |  ------------------
  ------------------
  |  Branch (428:3): [True: 993k, False: 0]
  ------------------
  429|   994k|	    {
  430|   994k|		node2 = miscNode2;
  431|   994k|		precedence2 = 0;
  432|   994k|	    } else
  433|      0|		misc = 1;
  434|   994k|	}
  435|   994k|	    break;
  436|    239|	case XML_NAMESPACE_DECL:
  ------------------
  |  Branch (436:2): [True: 239, False: 1.62M]
  ------------------
  437|    239|	    return(1);
  438|   101k|	default:
  ------------------
  |  Branch (438:2): [True: 101k, False: 1.52M]
  ------------------
  439|   101k|	    break;
  440|  1.62M|    }
  441|  1.62M|    if (misc) {
  ------------------
  |  Branch (441:9): [True: 24.1k, False: 1.59M]
  ------------------
  442|  24.1k|	if (node1 == node2) {
  ------------------
  |  Branch (442:6): [True: 2.32k, False: 21.7k]
  ------------------
  443|  2.32k|	    if (precedence1 == precedence2) {
  ------------------
  |  Branch (443:10): [True: 998, False: 1.32k]
  ------------------
  444|       |		/*
  445|       |		* The ugly case; but normally there aren't many
  446|       |		* adjacent non-element nodes around.
  447|       |		*/
  448|    998|		cur = miscNode2->prev;
  449|  1.28k|		while (cur != NULL) {
  ------------------
  |  Branch (449:10): [True: 746, False: 539]
  ------------------
  450|    746|		    if (cur == miscNode1)
  ------------------
  |  Branch (450:11): [True: 459, False: 287]
  ------------------
  451|    459|			return(1);
  452|    287|		    if (cur->type == XML_ELEMENT_NODE)
  ------------------
  |  Branch (452:11): [True: 0, False: 287]
  ------------------
  453|      0|			return(-1);
  454|    287|		    cur = cur->prev;
  455|    287|		}
  456|    539|		return (-1);
  457|  1.32k|	    } 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.32k|		if (precedence1 < precedence2)
  ------------------
  |  Branch (463:7): [True: 759, False: 568]
  ------------------
  464|    759|		    return(1);
  465|    568|		else
  466|    568|		    return(-1);
  467|  1.32k|	    }
  468|  2.32k|	}
  469|       |	/*
  470|       |	* Special case: One of the helper-elements is contained by the other.
  471|       |	* <foo>
  472|       |	*   <node2>
  473|       |	*     <node1>Text-1(precedence1 == 2)</node1>
  474|       |	*   </node2>
  475|       |	*   Text-6(precedence2 == 3)
  476|       |	* </foo>
  477|       |	*/
  478|  21.7k|	if ((precedence2 == 3) && (precedence1 > 1)) {
  ------------------
  |  Branch (478:6): [True: 0, False: 21.7k]
  |  Branch (478:28): [True: 0, False: 0]
  ------------------
  479|      0|	    cur = node1->parent;
  480|      0|	    while (cur) {
  ------------------
  |  Branch (480:13): [True: 0, False: 0]
  ------------------
  481|      0|		if (cur == node2)
  ------------------
  |  Branch (481:7): [True: 0, False: 0]
  ------------------
  482|      0|		    return(1);
  483|      0|		cur = cur->parent;
  484|      0|	    }
  485|      0|	}
  486|  21.7k|	if ((precedence1 == 3) && (precedence2 > 1)) {
  ------------------
  |  Branch (486:6): [True: 0, False: 21.7k]
  |  Branch (486:28): [True: 0, False: 0]
  ------------------
  487|      0|	    cur = node2->parent;
  488|      0|	    while (cur) {
  ------------------
  |  Branch (488:13): [True: 0, False: 0]
  ------------------
  489|      0|		if (cur == node1)
  ------------------
  |  Branch (489:7): [True: 0, False: 0]
  ------------------
  490|      0|		    return(-1);
  491|      0|		cur = cur->parent;
  492|      0|	    }
  493|      0|	}
  494|  21.7k|    }
  495|       |
  496|       |    /*
  497|       |     * Speedup using document order if available.
  498|       |     */
  499|  1.62M|    if ((node1->type == XML_ELEMENT_NODE) &&
  ------------------
  |  Branch (499:9): [True: 677k, False: 944k]
  ------------------
  500|   677k|	(node2->type == XML_ELEMENT_NODE) &&
  ------------------
  |  Branch (500:2): [True: 19.0k, False: 658k]
  ------------------
  501|  19.0k|	(0 > XML_NODE_SORT_VALUE(node1)) &&
  ------------------
  |  |  295|  19.0k|#define XML_NODE_SORT_VALUE(n) XML_PTR_TO_INT((n)->content)
  |  |  ------------------
  |  |  |  |   58|  19.0k|#define XML_PTR_TO_INT(p) ((XML_INTPTR_T) (p))
  |  |  ------------------
  ------------------
  |  Branch (501:2): [True: 0, False: 19.0k]
  ------------------
  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.93M|turtle_comparison:
  514|       |
  515|  3.93M|    if (node1 == node2->prev)
  ------------------
  |  Branch (515:9): [True: 1.11M, False: 2.81M]
  ------------------
  516|  1.11M|	return(1);
  517|  2.81M|    if (node1 == node2->next)
  ------------------
  |  Branch (517:9): [True: 75.6k, False: 2.74M]
  ------------------
  518|  75.6k|	return(-1);
  519|       |    /*
  520|       |     * compute depth to root
  521|       |     */
  522|  62.1M|    for (depth2 = 0, cur = node2; cur->parent != NULL; cur = cur->parent) {
  ------------------
  |  Branch (522:35): [True: 60.1M, False: 2.03M]
  ------------------
  523|  60.1M|	if (cur->parent == node1)
  ------------------
  |  Branch (523:6): [True: 708k, False: 59.4M]
  ------------------
  524|   708k|	    return(1);
  525|  59.4M|	depth2++;
  526|  59.4M|    }
  527|  2.03M|    root = cur;
  528|  57.2M|    for (depth1 = 0, cur = node1; cur->parent != NULL; cur = cur->parent) {
  ------------------
  |  Branch (528:35): [True: 55.5M, False: 1.63M]
  ------------------
  529|  55.5M|	if (cur->parent == node2)
  ------------------
  |  Branch (529:6): [True: 398k, False: 55.1M]
  ------------------
  530|   398k|	    return(-1);
  531|  55.1M|	depth1++;
  532|  55.1M|    }
  533|       |    /*
  534|       |     * Distinct document (or distinct entities :-( ) case.
  535|       |     */
  536|  1.63M|    if (root != cur) {
  ------------------
  |  Branch (536:9): [True: 0, False: 1.63M]
  ------------------
  537|      0|	return(-2);
  538|      0|    }
  539|       |    /*
  540|       |     * get the nearest common ancestor.
  541|       |     */
  542|  5.64M|    while (depth1 > depth2) {
  ------------------
  |  Branch (542:12): [True: 4.00M, False: 1.63M]
  ------------------
  543|  4.00M|	depth1--;
  544|  4.00M|	node1 = node1->parent;
  545|  4.00M|    }
  546|  6.79M|    while (depth2 > depth1) {
  ------------------
  |  Branch (546:12): [True: 5.15M, False: 1.63M]
  ------------------
  547|  5.15M|	depth2--;
  548|  5.15M|	node2 = node2->parent;
  549|  5.15M|    }
  550|  2.66M|    while (node1->parent != node2->parent) {
  ------------------
  |  Branch (550:12): [True: 1.03M, False: 1.63M]
  ------------------
  551|  1.03M|	node1 = node1->parent;
  552|  1.03M|	node2 = node2->parent;
  553|       |	/* should not happen but just in case ... */
  554|  1.03M|	if ((node1 == NULL) || (node2 == NULL))
  ------------------
  |  Branch (554:6): [True: 0, False: 1.03M]
  |  Branch (554:25): [True: 0, False: 1.03M]
  ------------------
  555|      0|	    return(-2);
  556|  1.03M|    }
  557|       |    /*
  558|       |     * Find who's first.
  559|       |     */
  560|  1.63M|    if (node1 == node2->prev)
  ------------------
  |  Branch (560:9): [True: 463k, False: 1.17M]
  ------------------
  561|   463k|	return(1);
  562|  1.17M|    if (node1 == node2->next)
  ------------------
  |  Branch (562:9): [True: 444k, False: 726k]
  ------------------
  563|   444k|	return(-1);
  564|       |    /*
  565|       |     * Speedup using document order if available.
  566|       |     */
  567|   726k|    if ((node1->type == XML_ELEMENT_NODE) &&
  ------------------
  |  Branch (567:9): [True: 715k, False: 11.5k]
  ------------------
  568|   715k|	(node2->type == XML_ELEMENT_NODE) &&
  ------------------
  |  Branch (568:2): [True: 701k, False: 13.7k]
  ------------------
  569|   701k|	(0 > XML_NODE_SORT_VALUE(node1)) &&
  ------------------
  |  |  295|   701k|#define XML_NODE_SORT_VALUE(n) XML_PTR_TO_INT((n)->content)
  |  |  ------------------
  |  |  |  |   58|   701k|#define XML_PTR_TO_INT(p) ((XML_INTPTR_T) (p))
  |  |  ------------------
  ------------------
  |  Branch (569:2): [True: 0, False: 701k]
  ------------------
  570|      0|	(0 > XML_NODE_SORT_VALUE(node2)) &&
  ------------------
  |  |  295|      0|#define XML_NODE_SORT_VALUE(n) XML_PTR_TO_INT((n)->content)
  |  |  ------------------
  |  |  |  |   58|      0|#define XML_PTR_TO_INT(p) ((XML_INTPTR_T) (p))
  |  |  ------------------
  ------------------
  |  Branch (570:2): [True: 0, False: 0]
  ------------------
  571|      0|	(node1->doc == node2->doc)) {
  ------------------
  |  Branch (571:2): [True: 0, False: 0]
  ------------------
  572|       |
  573|      0|	l1 = -XML_NODE_SORT_VALUE(node1);
  ------------------
  |  |  295|      0|#define XML_NODE_SORT_VALUE(n) XML_PTR_TO_INT((n)->content)
  |  |  ------------------
  |  |  |  |   58|      0|#define XML_PTR_TO_INT(p) ((XML_INTPTR_T) (p))
  |  |  ------------------
  ------------------
  574|      0|	l2 = -XML_NODE_SORT_VALUE(node2);
  ------------------
  |  |  295|      0|#define XML_NODE_SORT_VALUE(n) XML_PTR_TO_INT((n)->content)
  |  |  ------------------
  |  |  |  |   58|      0|#define XML_PTR_TO_INT(p) ((XML_INTPTR_T) (p))
  |  |  ------------------
  ------------------
  575|      0|	if (l1 < l2)
  ------------------
  |  Branch (575:6): [True: 0, False: 0]
  ------------------
  576|      0|	    return(1);
  577|      0|	if (l1 > l2)
  ------------------
  |  Branch (577:6): [True: 0, False: 0]
  ------------------
  578|      0|	    return(-1);
  579|      0|    }
  580|       |
  581|  6.78M|    for (cur = node1->next;cur != NULL;cur = cur->next)
  ------------------
  |  Branch (581:28): [True: 6.42M, False: 363k]
  ------------------
  582|  6.42M|	if (cur == node2)
  ------------------
  |  Branch (582:6): [True: 363k, False: 6.05M]
  ------------------
  583|   363k|	    return(1);
  584|   363k|    return(-1); /* assume there is no sibling list corruption */
  585|   726k|}
xpath.c:xmlXPathErrFmt:
  707|  9.35k|xmlXPathErrFmt(xmlXPathParserContext *ctxt, int code, const char *fmt, ...) {
  708|  9.35k|    va_list ap;
  709|  9.35k|    xmlStructuredErrorFunc schannel = NULL;
  710|  9.35k|    xmlGenericErrorFunc channel = NULL;
  711|  9.35k|    void *data = NULL;
  712|  9.35k|    xmlNodePtr node = NULL;
  713|  9.35k|    int res;
  714|       |
  715|  9.35k|    if (ctxt == NULL)
  ------------------
  |  Branch (715:9): [True: 0, False: 9.35k]
  ------------------
  716|      0|        return;
  717|  9.35k|    if ((code < 0) || (code > MAXERRNO))
  ------------------
  |  |  668|  9.35k|#define MAXERRNO ((int)(sizeof(xmlXPathErrorMessages) /	\
  |  |  669|  9.35k|		   sizeof(xmlXPathErrorMessages[0])) - 1)
  ------------------
  |  Branch (717:9): [True: 0, False: 9.35k]
  |  Branch (717:23): [True: 0, False: 9.35k]
  ------------------
  718|      0|	code = MAXERRNO;
  ------------------
  |  |  668|      0|#define MAXERRNO ((int)(sizeof(xmlXPathErrorMessages) /	\
  |  |  669|      0|		   sizeof(xmlXPathErrorMessages[0])) - 1)
  ------------------
  719|       |    /* Only report the first error */
  720|  9.35k|    if (ctxt->error != 0)
  ------------------
  |  Branch (720:9): [True: 3.69k, False: 5.65k]
  ------------------
  721|  3.69k|        return;
  722|       |
  723|  5.65k|    ctxt->error = code;
  724|       |
  725|  5.65k|    if (ctxt->context != NULL) {
  ------------------
  |  Branch (725:9): [True: 5.65k, False: 0]
  ------------------
  726|  5.65k|        xmlErrorPtr err = &ctxt->context->lastError;
  727|       |
  728|       |        /* Don't overwrite memory error. */
  729|  5.65k|        if (err->code == XML_ERR_NO_MEMORY)
  ------------------
  |  Branch (729:13): [True: 0, False: 5.65k]
  ------------------
  730|      0|            return;
  731|       |
  732|       |        /* cleanup current last error */
  733|  5.65k|        xmlResetError(err);
  734|       |
  735|  5.65k|        err->domain = XML_FROM_XPATH;
  736|  5.65k|        err->code = code + XML_XPATH_EXPRESSION_OK - XPATH_EXPRESSION_OK;
  737|  5.65k|        err->level = XML_ERR_ERROR;
  738|  5.65k|        if (ctxt->base != NULL) {
  ------------------
  |  Branch (738:13): [True: 5.65k, False: 0]
  ------------------
  739|  5.65k|            err->str1 = (char *) xmlStrdup(ctxt->base);
  740|  5.65k|            if (err->str1 == NULL) {
  ------------------
  |  Branch (740:17): [True: 35, False: 5.62k]
  ------------------
  741|     35|                xmlXPathPErrMemory(ctxt);
  742|     35|                return;
  743|     35|            }
  744|  5.65k|        }
  745|  5.62k|        err->int1 = ctxt->cur - ctxt->base;
  746|  5.62k|        err->node = ctxt->context->debugNode;
  747|       |
  748|  5.62k|        schannel = ctxt->context->error;
  749|  5.62k|        data = ctxt->context->userData;
  750|  5.62k|        node = ctxt->context->debugNode;
  751|  5.62k|    }
  752|       |
  753|  5.62k|    if (schannel == NULL) {
  ------------------
  |  Branch (753:9): [True: 0, False: 5.62k]
  ------------------
  754|      0|        channel = xmlGenericError;
  ------------------
  |  |  976|      0|  #define xmlGenericError (*__xmlGenericError())
  ------------------
  755|      0|        data = xmlGenericErrorContext;
  ------------------
  |  |  983|      0|  #define xmlGenericErrorContext (*__xmlGenericErrorContext())
  ------------------
  756|      0|    }
  757|       |
  758|  5.62k|    va_start(ap, fmt);
  759|  5.62k|    res = xmlVRaiseError(schannel, channel, data, NULL, node, XML_FROM_XPATH,
  760|  5.62k|                         code + XML_XPATH_EXPRESSION_OK - XPATH_EXPRESSION_OK,
  761|  5.62k|                         XML_ERR_ERROR, NULL, 0,
  762|  5.62k|                         (const char *) ctxt->base, NULL, NULL,
  763|  5.62k|                         ctxt->cur - ctxt->base, 0,
  764|  5.62k|                         fmt, ap);
  765|  5.62k|    va_end(ap);
  766|  5.62k|    if (res < 0)
  ------------------
  |  Branch (766:9): [True: 51, False: 5.57k]
  ------------------
  767|     51|        xmlXPathPErrMemory(ctxt);
  768|  5.62k|}
xpath.c:xmlXPathCastToNumberInternal:
 1931|   728k|                             xmlXPathObjectPtr val) {
 1932|   728k|    double ret = 0.0;
 1933|       |
 1934|   728k|    if (val == NULL)
  ------------------
  |  Branch (1934:9): [True: 0, False: 728k]
  ------------------
 1935|      0|	return(xmlXPathNAN);
 1936|   728k|    switch (val->type) {
  ------------------
  |  Branch (1936:13): [True: 728k, False: 0]
  ------------------
 1937|      0|    case XPATH_UNDEFINED:
  ------------------
  |  Branch (1937:5): [True: 0, False: 728k]
  ------------------
 1938|      0|	ret = xmlXPathNAN;
 1939|      0|	break;
 1940|   481k|    case XPATH_NODESET:
  ------------------
  |  Branch (1940:5): [True: 481k, False: 246k]
  ------------------
 1941|   481k|    case XPATH_XSLT_TREE: {
  ------------------
  |  Branch (1941:5): [True: 0, False: 728k]
  ------------------
 1942|   481k|        xmlChar *str;
 1943|       |
 1944|   481k|	str = xmlXPathCastNodeSetToString(val->nodesetval);
 1945|   481k|        if (str == NULL) {
  ------------------
  |  Branch (1945:13): [True: 74, False: 481k]
  ------------------
 1946|     74|            xmlXPathPErrMemory(ctxt);
 1947|     74|            ret = xmlXPathNAN;
 1948|   481k|        } else {
 1949|   481k|	    ret = xmlXPathCastStringToNumber(str);
 1950|   481k|            xmlFree(str);
 1951|   481k|        }
 1952|   481k|	break;
 1953|   481k|    }
 1954|   126k|    case XPATH_STRING:
  ------------------
  |  Branch (1954:5): [True: 126k, False: 601k]
  ------------------
 1955|   126k|	ret = xmlXPathCastStringToNumber(val->stringval);
 1956|   126k|	break;
 1957|  73.4k|    case XPATH_NUMBER:
  ------------------
  |  Branch (1957:5): [True: 73.4k, False: 654k]
  ------------------
 1958|  73.4k|	ret = val->floatval;
 1959|  73.4k|	break;
 1960|  46.4k|    case XPATH_BOOLEAN:
  ------------------
  |  Branch (1960:5): [True: 46.4k, False: 681k]
  ------------------
 1961|  46.4k|	ret = xmlXPathCastBooleanToNumber(val->boolval);
 1962|  46.4k|	break;
 1963|      0|    case XPATH_USERS:
  ------------------
  |  Branch (1963:5): [True: 0, False: 728k]
  ------------------
 1964|       |	/* TODO */
 1965|      0|	ret = xmlXPathNAN;
 1966|      0|	break;
 1967|   728k|    }
 1968|   728k|    return(ret);
 1969|   728k|}
xpath.c:xmlXPathNodeSetDupNs:
 2604|   172k|xmlXPathNodeSetDupNs(xmlNodePtr node, xmlNsPtr ns) {
 2605|   172k|    xmlNsPtr cur;
 2606|       |
 2607|   172k|    if ((ns == NULL) || (ns->type != XML_NAMESPACE_DECL))
  ------------------
  |  Branch (2607:9): [True: 0, False: 172k]
  |  Branch (2607:25): [True: 0, False: 172k]
  ------------------
 2608|      0|	return(NULL);
 2609|   172k|    if ((node == NULL) || (node->type == XML_NAMESPACE_DECL))
  ------------------
  |  Branch (2609:9): [True: 0, False: 172k]
  |  Branch (2609:27): [True: 0, False: 172k]
  ------------------
 2610|      0|	return((xmlNodePtr) ns);
 2611|       |
 2612|       |    /*
 2613|       |     * Allocate a new Namespace and fill the fields.
 2614|       |     */
 2615|   172k|    cur = (xmlNsPtr) xmlMalloc(sizeof(xmlNs));
 2616|   172k|    if (cur == NULL)
  ------------------
  |  Branch (2616:9): [True: 21, False: 172k]
  ------------------
 2617|     21|	return(NULL);
 2618|   172k|    memset(cur, 0, sizeof(xmlNs));
 2619|   172k|    cur->type = XML_NAMESPACE_DECL;
 2620|   172k|    if (ns->href != NULL) {
  ------------------
  |  Branch (2620:9): [True: 121k, False: 50.4k]
  ------------------
 2621|   121k|	cur->href = xmlStrdup(ns->href);
 2622|   121k|        if (cur->href == NULL) {
  ------------------
  |  Branch (2622:13): [True: 17, False: 121k]
  ------------------
 2623|     17|            xmlFree(cur);
 2624|     17|            return(NULL);
 2625|     17|        }
 2626|   121k|    }
 2627|   172k|    if (ns->prefix != NULL) {
  ------------------
  |  Branch (2627:9): [True: 127k, False: 44.6k]
  ------------------
 2628|   127k|	cur->prefix = xmlStrdup(ns->prefix);
 2629|   127k|        if (cur->prefix == NULL) {
  ------------------
  |  Branch (2629:13): [True: 19, False: 127k]
  ------------------
 2630|     19|            xmlFree((xmlChar *) cur->href);
 2631|     19|            xmlFree(cur);
 2632|     19|            return(NULL);
 2633|     19|        }
 2634|   127k|    }
 2635|   172k|    cur->next = (xmlNsPtr) node;
 2636|   172k|    return((xmlNodePtr) cur);
 2637|   172k|}
xpath.c:xmlXPathNodeSetGrow:
 2735|  1.41M|xmlXPathNodeSetGrow(xmlNodeSetPtr cur) {
 2736|  1.41M|    xmlNodePtr *temp;
 2737|  1.41M|    int newSize;
 2738|       |
 2739|  1.41M|    newSize = xmlGrowCapacity(cur->nodeMax, sizeof(temp[0]),
 2740|  1.41M|                              XML_NODESET_DEFAULT, XPATH_MAX_NODESET_LENGTH);
  ------------------
  |  | 2593|  1.41M|#define XML_NODESET_DEFAULT	10
  ------------------
                                            XML_NODESET_DEFAULT, XPATH_MAX_NODESET_LENGTH);
  ------------------
  |  |  105|  1.41M|#define XPATH_MAX_NODESET_LENGTH 10000000
  ------------------
 2741|  1.41M|    if (newSize < 0)
  ------------------
  |  Branch (2741:9): [True: 0, False: 1.41M]
  ------------------
 2742|      0|        return(-1);
 2743|  1.41M|    temp = xmlRealloc(cur->nodeTab, newSize * sizeof(temp[0]));
 2744|  1.41M|    if (temp == NULL)
  ------------------
  |  Branch (2744:9): [True: 304, False: 1.41M]
  ------------------
 2745|    304|        return(-1);
 2746|  1.41M|    cur->nodeMax = newSize;
 2747|  1.41M|    cur->nodeTab = temp;
 2748|       |
 2749|  1.41M|    return(0);
 2750|  1.41M|}
xpath.c:xmlXPathReleaseObject:
 4257|  3.43M|{
 4258|  3.43M|    if (obj == NULL)
  ------------------
  |  Branch (4258:9): [True: 25, False: 3.43M]
  ------------------
 4259|     25|	return;
 4260|  3.43M|    if ((ctxt == NULL) || (ctxt->cache == NULL)) {
  ------------------
  |  Branch (4260:9): [True: 0, False: 3.43M]
  |  Branch (4260:27): [True: 3.43M, False: 0]
  ------------------
 4261|  3.43M|	 xmlXPathFreeObject(obj);
 4262|  3.43M|    } 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.43M|}
xpath.c:xmlXPathFormatNumber:
 2229|  14.9k|{
 2230|  14.9k|    switch (xmlXPathIsInf(number)) {
 2231|      0|    case 1:
  ------------------
  |  Branch (2231:5): [True: 0, False: 14.9k]
  ------------------
 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: 14.9k]
  ------------------
 2236|      0|	if (buffersize > (int)sizeof("-Infinity"))
  ------------------
  |  Branch (2236:6): [True: 0, False: 0]
  ------------------
 2237|      0|	    snprintf(buffer, buffersize, "-Infinity");
 2238|      0|	break;
 2239|  14.9k|    default:
  ------------------
  |  Branch (2239:5): [True: 14.9k, False: 0]
  ------------------
 2240|  14.9k|	if (xmlXPathIsNaN(number)) {
  ------------------
  |  Branch (2240:6): [True: 0, False: 14.9k]
  ------------------
 2241|      0|	    if (buffersize > (int)sizeof("NaN"))
  ------------------
  |  Branch (2241:10): [True: 0, False: 0]
  ------------------
 2242|      0|		snprintf(buffer, buffersize, "NaN");
 2243|  14.9k|	} else if (number == 0) {
  ------------------
  |  Branch (2243:13): [True: 0, False: 14.9k]
  ------------------
 2244|       |            /* Omit sign for negative zero. */
 2245|      0|	    snprintf(buffer, buffersize, "0");
 2246|  14.9k|	} else if ((number > INT_MIN) && (number < INT_MAX) &&
  ------------------
  |  Branch (2246:13): [True: 8.39k, False: 6.58k]
  |  Branch (2246:35): [True: 5.40k, False: 2.99k]
  ------------------
 2247|  5.40k|                   (number == (int) number)) {
  ------------------
  |  Branch (2247:20): [True: 4.20k, False: 1.19k]
  ------------------
 2248|  4.20k|	    char work[30];
 2249|  4.20k|	    char *ptr, *cur;
 2250|  4.20k|	    int value = (int) number;
 2251|       |
 2252|  4.20k|            ptr = &buffer[0];
 2253|  4.20k|	    if (value == 0) {
  ------------------
  |  Branch (2253:10): [True: 0, False: 4.20k]
  ------------------
 2254|      0|		*ptr++ = '0';
 2255|  4.20k|	    } else {
 2256|  4.20k|		snprintf(work, 29, "%d", value);
 2257|  4.20k|		cur = &work[0];
 2258|  18.0k|		while ((*cur) && (ptr - buffer < buffersize)) {
  ------------------
  |  Branch (2258:10): [True: 13.8k, False: 4.20k]
  |  Branch (2258:20): [True: 13.8k, False: 0]
  ------------------
 2259|  13.8k|		    *ptr++ = *cur++;
 2260|  13.8k|		}
 2261|  4.20k|	    }
 2262|  4.20k|	    if (ptr - buffer < buffersize) {
  ------------------
  |  Branch (2262:10): [True: 4.20k, False: 0]
  ------------------
 2263|  4.20k|		*ptr = 0;
 2264|  4.20k|	    } else if (buffersize > 0) {
  ------------------
  |  Branch (2264:17): [True: 0, False: 0]
  ------------------
 2265|      0|		ptr--;
 2266|      0|		*ptr = 0;
 2267|      0|	    }
 2268|  10.7k|	} else {
 2269|       |	    /*
 2270|       |	      For the dimension of work,
 2271|       |	          DBL_DIG is number of significant digits
 2272|       |		  EXPONENT is only needed for "scientific notation"
 2273|       |	          3 is sign, decimal point, and terminating zero
 2274|       |		  LOWER_DOUBLE_EXP is max number of leading zeroes in fraction
 2275|       |	      Note that this dimension is slightly (a few characters)
 2276|       |	      larger than actually necessary.
 2277|       |	    */
 2278|  10.7k|	    char work[DBL_DIG + EXPONENT_DIGITS + 3 + LOWER_DOUBLE_EXP];
 2279|  10.7k|	    int integer_place, fraction_place;
 2280|  10.7k|	    char *ptr;
 2281|  10.7k|	    char *after_fraction;
 2282|  10.7k|	    double absolute_value;
 2283|  10.7k|	    int size;
 2284|       |
 2285|  10.7k|	    absolute_value = fabs(number);
 2286|       |
 2287|       |	    /*
 2288|       |	     * First choose format - scientific or regular floating point.
 2289|       |	     * In either case, result is in work, and after_fraction points
 2290|       |	     * just past the fractional part.
 2291|       |	    */
 2292|  10.7k|	    if ( ((absolute_value > UPPER_DOUBLE) ||
  ------------------
  |  | 2212|  10.7k|#define UPPER_DOUBLE 1E9
  ------------------
  |  Branch (2292:12): [True: 9.58k, False: 1.18k]
  ------------------
 2293|  1.18k|		  (absolute_value < LOWER_DOUBLE)) &&
  ------------------
  |  | 2213|  1.18k|#define LOWER_DOUBLE 1E-5
  ------------------
  |  Branch (2293:5): [True: 270, False: 915]
  ------------------
 2294|  9.85k|		 (absolute_value != 0.0) ) {
  ------------------
  |  Branch (2294:4): [True: 9.85k, False: 0]
  ------------------
 2295|       |		/* Use scientific notation */
 2296|  9.85k|		integer_place = DBL_DIG + EXPONENT_DIGITS + 1;
  ------------------
  |  | 2218|  9.85k|#define EXPONENT_DIGITS (3 + 2)
  ------------------
 2297|  9.85k|		fraction_place = DBL_DIG - 1;
 2298|  9.85k|		size = snprintf(work, sizeof(work),"%*.*e",
 2299|  9.85k|			 integer_place, fraction_place, number);
 2300|  52.0k|		while ((size > 0) && (work[size] != 'e')) size--;
  ------------------
  |  Branch (2300:10): [True: 52.0k, False: 0]
  |  Branch (2300:24): [True: 42.2k, False: 9.85k]
  ------------------
 2301|       |
 2302|  9.85k|	    }
 2303|    915|	    else {
 2304|       |		/* Use regular notation */
 2305|    915|		if (absolute_value > 0.0) {
  ------------------
  |  Branch (2305:7): [True: 915, False: 0]
  ------------------
 2306|    915|		    integer_place = (int)log10(absolute_value);
 2307|    915|		    if (integer_place > 0)
  ------------------
  |  Branch (2307:11): [True: 558, False: 357]
  ------------------
 2308|    558|		        fraction_place = DBL_DIG - integer_place - 1;
 2309|    357|		    else
 2310|    357|		        fraction_place = DBL_DIG - integer_place;
 2311|    915|		} else {
 2312|      0|		    fraction_place = 1;
 2313|      0|		}
 2314|    915|		size = snprintf(work, sizeof(work), "%0.*f",
 2315|    915|				fraction_place, number);
 2316|    915|	    }
 2317|       |
 2318|       |	    /* Remove leading spaces sometimes inserted by snprintf */
 2319|  13.7k|	    while (work[0] == ' ') {
  ------------------
  |  Branch (2319:13): [True: 3.02k, False: 10.7k]
  ------------------
 2320|  63.4k|	        for (ptr = &work[0];(ptr[0] = ptr[1]);ptr++);
  ------------------
  |  Branch (2320:30): [True: 60.4k, False: 3.02k]
  ------------------
 2321|  3.02k|		size--;
 2322|  3.02k|	    }
 2323|       |
 2324|       |	    /* Remove fractional trailing zeroes */
 2325|  10.7k|	    after_fraction = work + size;
 2326|  10.7k|	    ptr = after_fraction;
 2327|  34.3k|	    while (*(--ptr) == '0')
  ------------------
  |  Branch (2327:13): [True: 23.5k, False: 10.7k]
  ------------------
 2328|  23.5k|		;
 2329|  10.7k|	    if (*ptr != '.')
  ------------------
  |  Branch (2329:10): [True: 10.4k, False: 345]
  ------------------
 2330|  10.4k|	        ptr++;
 2331|  53.0k|	    while ((*ptr++ = *after_fraction++) != 0);
  ------------------
  |  Branch (2331:13): [True: 42.2k, False: 10.7k]
  ------------------
 2332|       |
 2333|       |	    /* Finally copy result back to caller */
 2334|  10.7k|	    size = strlen(work) + 1;
 2335|  10.7k|	    if (size > buffersize) {
  ------------------
  |  Branch (2335:10): [True: 0, False: 10.7k]
  ------------------
 2336|      0|		work[buffersize - 1] = 0;
 2337|      0|		size = buffersize;
 2338|      0|	    }
 2339|  10.7k|	    memmove(buffer, work, size);
 2340|  10.7k|	}
 2341|  14.9k|	break;
 2342|  14.9k|    }
 2343|  14.9k|}
xpath.c:xmlXPathNodeToNumberInternal:
 4532|  82.2k|xmlXPathNodeToNumberInternal(xmlXPathParserContextPtr ctxt, xmlNodePtr node) {
 4533|  82.2k|    xmlChar *strval;
 4534|  82.2k|    double ret;
 4535|       |
 4536|  82.2k|    if (node == NULL)
  ------------------
  |  Branch (4536:9): [True: 0, False: 82.2k]
  ------------------
 4537|      0|	return(xmlXPathNAN);
 4538|  82.2k|    strval = xmlXPathCastNodeToString(node);
 4539|  82.2k|    if (strval == NULL) {
  ------------------
  |  Branch (4539:9): [True: 21, False: 82.2k]
  ------------------
 4540|     21|        xmlXPathPErrMemory(ctxt);
 4541|     21|	return(xmlXPathNAN);
 4542|     21|    }
 4543|  82.2k|    ret = xmlXPathCastStringToNumber(strval);
 4544|  82.2k|    xmlFree(strval);
 4545|       |
 4546|  82.2k|    return(ret);
 4547|  82.2k|}
xpath.c:xmlXPathNewCompExpr:
  940|  12.7k|xmlXPathNewCompExpr(void) {
  941|  12.7k|    xmlXPathCompExprPtr cur;
  942|       |
  943|  12.7k|    cur = (xmlXPathCompExprPtr) xmlMalloc(sizeof(xmlXPathCompExpr));
  944|  12.7k|    if (cur == NULL)
  ------------------
  |  Branch (944:9): [True: 26, False: 12.7k]
  ------------------
  945|     26|	return(NULL);
  946|  12.7k|    memset(cur, 0, sizeof(xmlXPathCompExpr));
  947|  12.7k|#ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
  948|  12.7k|    cur->maxStep = 1;
  949|       |#else
  950|       |    cur->maxStep = 10;
  951|       |#endif
  952|  12.7k|    cur->nbStep = 0;
  953|  12.7k|    cur->steps = (xmlXPathStepOp *) xmlMalloc(cur->maxStep *
  954|  12.7k|	                                   sizeof(xmlXPathStepOp));
  955|  12.7k|    if (cur->steps == NULL) {
  ------------------
  |  Branch (955:9): [True: 39, False: 12.7k]
  ------------------
  956|     39|	xmlFree(cur);
  957|     39|	return(NULL);
  958|     39|    }
  959|  12.7k|    memset(cur->steps, 0, cur->maxStep * sizeof(xmlXPathStepOp));
  960|  12.7k|    cur->last = -1;
  961|  12.7k|    return(cur);
  962|  12.7k|}
xpath.c:xmlXPathEqualNodeSets:
 5433|  16.0k|                      xmlXPathObjectPtr arg2, int neq) {
 5434|  16.0k|    int i, j;
 5435|  16.0k|    unsigned int *hashs1;
 5436|  16.0k|    unsigned int *hashs2;
 5437|  16.0k|    xmlChar **values1;
 5438|  16.0k|    xmlChar **values2;
 5439|  16.0k|    int ret = 0;
 5440|  16.0k|    xmlNodeSetPtr ns1;
 5441|  16.0k|    xmlNodeSetPtr ns2;
 5442|       |
 5443|  16.0k|    if ((arg1 == NULL) ||
  ------------------
  |  Branch (5443:9): [True: 0, False: 16.0k]
  ------------------
 5444|  16.0k|	((arg1->type != XPATH_NODESET) && (arg1->type != XPATH_XSLT_TREE)))
  ------------------
  |  Branch (5444:3): [True: 0, False: 16.0k]
  |  Branch (5444:36): [True: 0, False: 0]
  ------------------
 5445|      0|        return(0);
 5446|  16.0k|    if ((arg2 == NULL) ||
  ------------------
  |  Branch (5446:9): [True: 0, False: 16.0k]
  ------------------
 5447|  16.0k|	((arg2->type != XPATH_NODESET) && (arg2->type != XPATH_XSLT_TREE)))
  ------------------
  |  Branch (5447:3): [True: 0, False: 16.0k]
  |  Branch (5447:36): [True: 0, False: 0]
  ------------------
 5448|      0|        return(0);
 5449|       |
 5450|  16.0k|    ns1 = arg1->nodesetval;
 5451|  16.0k|    ns2 = arg2->nodesetval;
 5452|       |
 5453|  16.0k|    if ((ns1 == NULL) || (ns1->nodeNr <= 0))
  ------------------
  |  Branch (5453:9): [True: 0, False: 16.0k]
  |  Branch (5453:26): [True: 6.07k, False: 10.0k]
  ------------------
 5454|  6.07k|	return(0);
 5455|  10.0k|    if ((ns2 == NULL) || (ns2->nodeNr <= 0))
  ------------------
  |  Branch (5455:9): [True: 0, False: 10.0k]
  |  Branch (5455:26): [True: 4.94k, False: 5.06k]
  ------------------
 5456|  4.94k|	return(0);
 5457|       |
 5458|       |    /*
 5459|       |     * for equal, check if there is a node pertaining to both sets
 5460|       |     */
 5461|  5.06k|    if (neq == 0)
  ------------------
  |  Branch (5461:9): [True: 4.50k, False: 556]
  ------------------
 5462|  8.48k|	for (i = 0;i < ns1->nodeNr;i++)
  ------------------
  |  Branch (5462:13): [True: 6.44k, False: 2.04k]
  ------------------
 5463|  40.5k|	    for (j = 0;j < ns2->nodeNr;j++)
  ------------------
  |  Branch (5463:17): [True: 36.5k, False: 3.98k]
  ------------------
 5464|  36.5k|		if (ns1->nodeTab[i] == ns2->nodeTab[j])
  ------------------
  |  Branch (5464:7): [True: 2.46k, False: 34.1k]
  ------------------
 5465|  2.46k|		    return(1);
 5466|       |
 5467|  2.60k|    values1 = (xmlChar **) xmlMalloc(ns1->nodeNr * sizeof(xmlChar *));
 5468|  2.60k|    if (values1 == NULL) {
  ------------------
  |  Branch (5468:9): [True: 2, False: 2.60k]
  ------------------
 5469|      2|        xmlXPathPErrMemory(ctxt);
 5470|      2|	return(0);
 5471|      2|    }
 5472|  2.60k|    hashs1 = (unsigned int *) xmlMalloc(ns1->nodeNr * sizeof(unsigned int));
 5473|  2.60k|    if (hashs1 == NULL) {
  ------------------
  |  Branch (5473:9): [True: 2, False: 2.59k]
  ------------------
 5474|      2|        xmlXPathPErrMemory(ctxt);
 5475|      2|	xmlFree(values1);
 5476|      2|	return(0);
 5477|      2|    }
 5478|  2.59k|    memset(values1, 0, ns1->nodeNr * sizeof(xmlChar *));
 5479|  2.59k|    values2 = (xmlChar **) xmlMalloc(ns2->nodeNr * sizeof(xmlChar *));
 5480|  2.59k|    if (values2 == NULL) {
  ------------------
  |  Branch (5480:9): [True: 3, False: 2.59k]
  ------------------
 5481|      3|        xmlXPathPErrMemory(ctxt);
 5482|      3|	xmlFree(hashs1);
 5483|      3|	xmlFree(values1);
 5484|      3|	return(0);
 5485|      3|    }
 5486|  2.59k|    hashs2 = (unsigned int *) xmlMalloc(ns2->nodeNr * sizeof(unsigned int));
 5487|  2.59k|    if (hashs2 == NULL) {
  ------------------
  |  Branch (5487:9): [True: 3, False: 2.59k]
  ------------------
 5488|      3|        xmlXPathPErrMemory(ctxt);
 5489|      3|	xmlFree(hashs1);
 5490|      3|	xmlFree(values1);
 5491|      3|	xmlFree(values2);
 5492|      3|	return(0);
 5493|      3|    }
 5494|  2.59k|    memset(values2, 0, ns2->nodeNr * sizeof(xmlChar *));
 5495|  5.89k|    for (i = 0;i < ns1->nodeNr;i++) {
  ------------------
  |  Branch (5495:16): [True: 4.13k, False: 1.76k]
  ------------------
 5496|  4.13k|	hashs1[i] = xmlXPathNodeValHash(ns1->nodeTab[i]);
 5497|  21.9k|	for (j = 0;j < ns2->nodeNr;j++) {
  ------------------
  |  Branch (5497:13): [True: 18.6k, False: 3.30k]
  ------------------
 5498|  18.6k|	    if (i == 0)
  ------------------
  |  Branch (5498:10): [True: 16.9k, False: 1.71k]
  ------------------
 5499|  16.9k|		hashs2[j] = xmlXPathNodeValHash(ns2->nodeTab[j]);
 5500|  18.6k|	    if (hashs1[i] != hashs2[j]) {
  ------------------
  |  Branch (5500:10): [True: 17.2k, False: 1.39k]
  ------------------
 5501|  17.2k|		if (neq) {
  ------------------
  |  Branch (5501:7): [True: 326, False: 16.9k]
  ------------------
 5502|    326|		    ret = 1;
 5503|    326|		    break;
 5504|    326|		}
 5505|  17.2k|	    }
 5506|  1.39k|	    else {
 5507|  1.39k|		if (values1[i] == NULL) {
  ------------------
  |  Branch (5507:7): [True: 1.16k, False: 228]
  ------------------
 5508|  1.16k|		    values1[i] = xmlNodeGetContent(ns1->nodeTab[i]);
 5509|  1.16k|                    if (values1[i] == NULL)
  ------------------
  |  Branch (5509:25): [True: 12, False: 1.15k]
  ------------------
 5510|     12|                        xmlXPathPErrMemory(ctxt);
 5511|  1.16k|                }
 5512|  1.39k|		if (values2[j] == NULL) {
  ------------------
  |  Branch (5512:7): [True: 914, False: 480]
  ------------------
 5513|    914|		    values2[j] = xmlNodeGetContent(ns2->nodeTab[j]);
 5514|    914|                    if (values2[j] == NULL)
  ------------------
  |  Branch (5514:25): [True: 10, False: 904]
  ------------------
 5515|     10|                        xmlXPathPErrMemory(ctxt);
 5516|    914|                }
 5517|  1.39k|		ret = xmlStrEqual(values1[i], values2[j]) ^ neq;
 5518|  1.39k|		if (ret)
  ------------------
  |  Branch (5518:7): [True: 506, False: 888]
  ------------------
 5519|    506|		    break;
 5520|  1.39k|	    }
 5521|  18.6k|	}
 5522|  4.13k|	if (ret)
  ------------------
  |  Branch (5522:6): [True: 832, False: 3.30k]
  ------------------
 5523|    832|	    break;
 5524|  4.13k|    }
 5525|  7.66k|    for (i = 0;i < ns1->nodeNr;i++)
  ------------------
  |  Branch (5525:16): [True: 5.06k, False: 2.59k]
  ------------------
 5526|  5.06k|	if (values1[i] != NULL)
  ------------------
  |  Branch (5526:6): [True: 1.15k, False: 3.91k]
  ------------------
 5527|  1.15k|	    xmlFree(values1[i]);
 5528|  19.7k|    for (j = 0;j < ns2->nodeNr;j++)
  ------------------
  |  Branch (5528:16): [True: 17.1k, False: 2.59k]
  ------------------
 5529|  17.1k|	if (values2[j] != NULL)
  ------------------
  |  Branch (5529:6): [True: 904, False: 16.2k]
  ------------------
 5530|    904|	    xmlFree(values2[j]);
 5531|  2.59k|    xmlFree(values1);
 5532|  2.59k|    xmlFree(values2);
 5533|  2.59k|    xmlFree(hashs1);
 5534|  2.59k|    xmlFree(hashs2);
 5535|  2.59k|    return(ret);
 5536|  2.59k|}
xpath.c:xmlXPathNodeValHash:
 4920|  53.7k|xmlXPathNodeValHash(xmlNodePtr node) {
 4921|  53.7k|    int len = 2;
 4922|  53.7k|    const xmlChar * string = NULL;
 4923|  53.7k|    xmlNodePtr tmp = NULL;
 4924|  53.7k|    unsigned int ret = 0;
 4925|       |
 4926|  53.7k|    if (node == NULL)
  ------------------
  |  Branch (4926:9): [True: 0, False: 53.7k]
  ------------------
 4927|      0|	return(0);
 4928|       |
 4929|  53.7k|    if (node->type == XML_DOCUMENT_NODE) {
  ------------------
  |  Branch (4929:9): [True: 2.99k, False: 50.7k]
  ------------------
 4930|  2.99k|	tmp = xmlDocGetRootElement((xmlDocPtr) node);
 4931|  2.99k|	if (tmp == NULL)
  ------------------
  |  Branch (4931:6): [True: 0, False: 2.99k]
  ------------------
 4932|      0|	    node = node->children;
 4933|  2.99k|	else
 4934|  2.99k|	    node = tmp;
 4935|       |
 4936|  2.99k|	if (node == NULL)
  ------------------
  |  Branch (4936:6): [True: 0, False: 2.99k]
  ------------------
 4937|      0|	    return(0);
 4938|  2.99k|    }
 4939|       |
 4940|  53.7k|    switch (node->type) {
 4941|    734|	case XML_COMMENT_NODE:
  ------------------
  |  Branch (4941:2): [True: 734, False: 52.9k]
  ------------------
 4942|  1.24k|	case XML_PI_NODE:
  ------------------
  |  Branch (4942:2): [True: 506, False: 53.2k]
  ------------------
 4943|  1.44k|	case XML_CDATA_SECTION_NODE:
  ------------------
  |  Branch (4943:2): [True: 207, False: 53.5k]
  ------------------
 4944|  6.52k|	case XML_TEXT_NODE:
  ------------------
  |  Branch (4944:2): [True: 5.08k, False: 48.6k]
  ------------------
 4945|  6.52k|	    string = node->content;
 4946|  6.52k|	    if (string == NULL)
  ------------------
  |  Branch (4946:10): [True: 506, False: 6.02k]
  ------------------
 4947|    506|		return(0);
 4948|  6.02k|	    if (string[0] == 0)
  ------------------
  |  Branch (4948:10): [True: 623, False: 5.39k]
  ------------------
 4949|    623|		return(0);
 4950|  5.39k|	    return(string[0] + (string[1] << 8));
 4951|    557|	case XML_NAMESPACE_DECL:
  ------------------
  |  Branch (4951:2): [True: 557, False: 53.1k]
  ------------------
 4952|    557|	    string = ((xmlNsPtr)node)->href;
 4953|    557|	    if (string == NULL)
  ------------------
  |  Branch (4953:10): [True: 267, False: 290]
  ------------------
 4954|    267|		return(0);
 4955|    290|	    if (string[0] == 0)
  ------------------
  |  Branch (4955:10): [True: 0, False: 290]
  ------------------
 4956|      0|		return(0);
 4957|    290|	    return(string[0] + (string[1] << 8));
 4958|    789|	case XML_ATTRIBUTE_NODE:
  ------------------
  |  Branch (4958:2): [True: 789, False: 52.9k]
  ------------------
 4959|    789|	    tmp = ((xmlAttrPtr) node)->children;
 4960|    789|	    break;
 4961|  45.8k|	case XML_ELEMENT_NODE:
  ------------------
  |  Branch (4961:2): [True: 45.8k, False: 7.87k]
  ------------------
 4962|  45.8k|	    tmp = node->children;
 4963|  45.8k|	    break;
 4964|      0|	default:
  ------------------
  |  Branch (4964:2): [True: 0, False: 53.7k]
  ------------------
 4965|      0|	    return(0);
 4966|  53.7k|    }
 4967|  1.83M|    while (tmp != NULL) {
  ------------------
  |  Branch (4967:12): [True: 1.82M, False: 12.9k]
  ------------------
 4968|  1.82M|	switch (tmp->type) {
 4969|  1.13k|	    case XML_CDATA_SECTION_NODE:
  ------------------
  |  Branch (4969:6): [True: 1.13k, False: 1.82M]
  ------------------
 4970|  39.0k|	    case XML_TEXT_NODE:
  ------------------
  |  Branch (4970:6): [True: 37.8k, False: 1.78M]
  ------------------
 4971|  39.0k|		string = tmp->content;
 4972|  39.0k|		break;
 4973|  1.78M|	    default:
  ------------------
  |  Branch (4973:6): [True: 1.78M, False: 39.0k]
  ------------------
 4974|  1.78M|                string = NULL;
 4975|  1.78M|		break;
 4976|  1.82M|	}
 4977|  1.82M|	if ((string != NULL) && (string[0] != 0)) {
  ------------------
  |  Branch (4977:6): [True: 39.0k, False: 1.78M]
  |  Branch (4977:26): [True: 38.7k, False: 275]
  ------------------
 4978|  38.7k|	    if (len == 1) {
  ------------------
  |  Branch (4978:10): [True: 3.51k, False: 35.2k]
  ------------------
 4979|  3.51k|		return(ret + (string[0] << 8));
 4980|  3.51k|	    }
 4981|  35.2k|	    if (string[1] == 0) {
  ------------------
  |  Branch (4981:10): [True: 5.05k, False: 30.1k]
  ------------------
 4982|  5.05k|		len = 1;
 4983|  5.05k|		ret = string[0];
 4984|  30.1k|	    } else {
 4985|  30.1k|		return(string[0] + (string[1] << 8));
 4986|  30.1k|	    }
 4987|  35.2k|	}
 4988|       |	/*
 4989|       |	 * Skip to next node
 4990|       |	 */
 4991|  1.78M|        if ((tmp->children != NULL) &&
  ------------------
  |  Branch (4991:13): [True: 1.76M, False: 19.9k]
  ------------------
 4992|  1.76M|            (tmp->type != XML_DTD_NODE) &&
  ------------------
  |  Branch (4992:13): [True: 1.76M, False: 0]
  ------------------
 4993|  1.76M|            (tmp->type != XML_ENTITY_REF_NODE) &&
  ------------------
  |  Branch (4993:13): [True: 1.76M, False: 0]
  ------------------
 4994|  1.76M|            (tmp->children->type != XML_ENTITY_DECL)) {
  ------------------
  |  Branch (4994:13): [True: 1.76M, False: 0]
  ------------------
 4995|  1.76M|            tmp = tmp->children;
 4996|  1.76M|            continue;
 4997|  1.76M|	}
 4998|  19.9k|	if (tmp == node)
  ------------------
  |  Branch (4998:6): [True: 0, False: 19.9k]
  ------------------
 4999|      0|	    break;
 5000|       |
 5001|  19.9k|	if (tmp->next != NULL) {
  ------------------
  |  Branch (5001:6): [True: 15.2k, False: 4.69k]
  ------------------
 5002|  15.2k|	    tmp = tmp->next;
 5003|  15.2k|	    continue;
 5004|  15.2k|	}
 5005|       |
 5006|  8.02k|	do {
 5007|  8.02k|	    tmp = tmp->parent;
 5008|  8.02k|	    if (tmp == NULL)
  ------------------
  |  Branch (5008:10): [True: 0, False: 8.02k]
  ------------------
 5009|      0|		break;
 5010|  8.02k|	    if (tmp == node) {
  ------------------
  |  Branch (5010:10): [True: 2.12k, False: 5.89k]
  ------------------
 5011|  2.12k|		tmp = NULL;
 5012|  2.12k|		break;
 5013|  2.12k|	    }
 5014|  5.89k|	    if (tmp->next != NULL) {
  ------------------
  |  Branch (5014:10): [True: 2.56k, False: 3.32k]
  ------------------
 5015|  2.56k|		tmp = tmp->next;
 5016|  2.56k|		break;
 5017|  2.56k|	    }
 5018|  5.89k|	} while (tmp != NULL);
  ------------------
  |  Branch (5018:11): [True: 3.32k, False: 0]
  ------------------
 5019|  4.69k|    }
 5020|  12.9k|    return(ret);
 5021|  46.6k|}
xpath.c:xmlXPathEqualNodeSetFloat:
 5370|  40.6k|    xmlXPathObjectPtr arg, double f, int neq) {
 5371|  40.6k|  int i, ret=0;
 5372|  40.6k|  xmlNodeSetPtr ns;
 5373|  40.6k|  xmlChar *str2;
 5374|  40.6k|  xmlXPathObjectPtr val;
 5375|  40.6k|  double v;
 5376|       |
 5377|  40.6k|    if ((arg == NULL) ||
  ------------------
  |  Branch (5377:9): [True: 0, False: 40.6k]
  ------------------
 5378|  40.6k|	((arg->type != XPATH_NODESET) && (arg->type != XPATH_XSLT_TREE)))
  ------------------
  |  Branch (5378:3): [True: 0, False: 40.6k]
  |  Branch (5378:35): [True: 0, False: 0]
  ------------------
 5379|      0|        return(0);
 5380|       |
 5381|  40.6k|    ns = arg->nodesetval;
 5382|  40.6k|    if (ns != NULL) {
  ------------------
  |  Branch (5382:9): [True: 40.6k, False: 0]
  ------------------
 5383|   102k|	for (i=0;i<ns->nodeNr;i++) {
  ------------------
  |  Branch (5383:11): [True: 62.5k, False: 40.2k]
  ------------------
 5384|  62.5k|	    str2 = xmlXPathCastNodeToString(ns->nodeTab[i]);
 5385|  62.5k|	    if (str2 != NULL) {
  ------------------
  |  Branch (5385:10): [True: 62.4k, False: 15]
  ------------------
 5386|  62.4k|		xmlXPathValuePush(ctxt, xmlXPathCacheNewString(ctxt, str2));
 5387|  62.4k|		xmlFree(str2);
 5388|  62.4k|		xmlXPathNumberFunction(ctxt, 1);
 5389|  62.4k|                CHECK_ERROR0;
  ------------------
  |  |  236|  62.4k|    if (ctxt->error != XPATH_EXPRESSION_OK) return(0)
  |  |  ------------------
  |  |  |  Branch (236:9): [True: 18, False: 62.4k]
  |  |  ------------------
  ------------------
 5390|  62.4k|		val = xmlXPathValuePop(ctxt);
 5391|  62.4k|		v = val->floatval;
 5392|  62.4k|		xmlXPathReleaseObject(ctxt->context, val);
 5393|  62.4k|		if (!xmlXPathIsNaN(v)) {
  ------------------
  |  Branch (5393:7): [True: 2.81k, False: 59.6k]
  ------------------
 5394|  2.81k|		    if ((!neq) && (v==f)) {
  ------------------
  |  Branch (5394:11): [True: 2.43k, False: 382]
  |  Branch (5394:21): [True: 75, False: 2.35k]
  ------------------
 5395|     75|			ret = 1;
 5396|     75|			break;
 5397|  2.73k|		    } else if ((neq) && (v!=f)) {
  ------------------
  |  Branch (5397:18): [True: 382, False: 2.35k]
  |  Branch (5397:27): [True: 361, False: 21]
  ------------------
 5398|    361|			ret = 1;
 5399|    361|			break;
 5400|    361|		    }
 5401|  59.6k|		} else {	/* NaN is unequal to any value */
 5402|  59.6k|		    if (neq)
  ------------------
  |  Branch (5402:11): [True: 4.82k, False: 54.8k]
  ------------------
 5403|  4.82k|			ret = 1;
 5404|  59.6k|		}
 5405|  62.4k|	    } else {
 5406|     15|                xmlXPathPErrMemory(ctxt);
 5407|     15|            }
 5408|  62.5k|	}
 5409|  40.6k|    }
 5410|       |
 5411|  40.6k|    return(ret);
 5412|  40.6k|}
xpath.c:xmlXPathEqualNodeSetString:
 5314|  3.74k|{
 5315|  3.74k|    int i;
 5316|  3.74k|    xmlNodeSetPtr ns;
 5317|  3.74k|    xmlChar *str2;
 5318|  3.74k|    unsigned int hash;
 5319|       |
 5320|  3.74k|    if ((str == NULL) || (arg == NULL) ||
  ------------------
  |  Branch (5320:9): [True: 0, False: 3.74k]
  |  Branch (5320:26): [True: 0, False: 3.74k]
  ------------------
 5321|  3.74k|        ((arg->type != XPATH_NODESET) && (arg->type != XPATH_XSLT_TREE)))
  ------------------
  |  Branch (5321:10): [True: 0, False: 3.74k]
  |  Branch (5321:42): [True: 0, False: 0]
  ------------------
 5322|      0|        return (0);
 5323|  3.74k|    ns = arg->nodesetval;
 5324|       |    /*
 5325|       |     * A NULL nodeset compared with a string is always false
 5326|       |     * (since there is no node equal, and no node not equal)
 5327|       |     */
 5328|  3.74k|    if ((ns == NULL) || (ns->nodeNr <= 0) )
  ------------------
  |  Branch (5328:9): [True: 0, False: 3.74k]
  |  Branch (5328:25): [True: 2.31k, False: 1.43k]
  ------------------
 5329|  2.31k|        return (0);
 5330|  1.43k|    hash = xmlXPathStringHash(str);
 5331|  33.2k|    for (i = 0; i < ns->nodeNr; i++) {
  ------------------
  |  Branch (5331:17): [True: 32.6k, False: 608]
  ------------------
 5332|  32.6k|        if (xmlXPathNodeValHash(ns->nodeTab[i]) == hash) {
  ------------------
  |  Branch (5332:13): [True: 1.11k, False: 31.5k]
  ------------------
 5333|  1.11k|            str2 = xmlNodeGetContent(ns->nodeTab[i]);
 5334|  1.11k|            if (str2 == NULL) {
  ------------------
  |  Branch (5334:17): [True: 2, False: 1.10k]
  ------------------
 5335|      2|                xmlXPathPErrMemory(ctxt);
 5336|      2|                return(0);
 5337|      2|            }
 5338|  1.10k|            if (xmlStrEqual(str, str2)) {
  ------------------
  |  Branch (5338:17): [True: 644, False: 465]
  ------------------
 5339|    644|                xmlFree(str2);
 5340|    644|		if (neq)
  ------------------
  |  Branch (5340:7): [True: 338, False: 306]
  ------------------
 5341|    338|		    continue;
 5342|    306|                return (1);
 5343|    644|            } else if (neq) {
  ------------------
  |  Branch (5343:24): [True: 244, False: 221]
  ------------------
 5344|    244|		xmlFree(str2);
 5345|    244|		return (1);
 5346|    244|	    }
 5347|    221|            xmlFree(str2);
 5348|  31.5k|        } else if (neq)
  ------------------
  |  Branch (5348:20): [True: 274, False: 31.2k]
  ------------------
 5349|    274|	    return (1);
 5350|  32.6k|    }
 5351|    608|    return (0);
 5352|  1.43k|}
xpath.c:xmlXPathStringHash:
 5031|  1.43k|xmlXPathStringHash(const xmlChar * string) {
 5032|  1.43k|    if (string == NULL)
  ------------------
  |  Branch (5032:9): [True: 0, False: 1.43k]
  ------------------
 5033|      0|	return(0);
 5034|  1.43k|    if (string[0] == 0)
  ------------------
  |  Branch (5034:9): [True: 415, False: 1.01k]
  ------------------
 5035|    415|	return(0);
 5036|  1.01k|    return(string[0] + (string[1] << 8));
 5037|  1.43k|}
xpath.c:xmlXPathEqualValuesCommon:
 5540|   194k|  xmlXPathObjectPtr arg1, xmlXPathObjectPtr arg2) {
 5541|   194k|    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|   194k|    switch (arg1->type) {
  ------------------
  |  Branch (5546:13): [True: 194k, False: 0]
  ------------------
 5547|      0|        case XPATH_UNDEFINED:
  ------------------
  |  Branch (5547:9): [True: 0, False: 194k]
  ------------------
 5548|      0|	    break;
 5549|  81.4k|        case XPATH_BOOLEAN:
  ------------------
  |  Branch (5549:9): [True: 81.4k, False: 112k]
  ------------------
 5550|  81.4k|	    switch (arg2->type) {
  ------------------
  |  Branch (5550:14): [True: 81.4k, False: 0]
  ------------------
 5551|      0|	        case XPATH_UNDEFINED:
  ------------------
  |  Branch (5551:10): [True: 0, False: 81.4k]
  ------------------
 5552|      0|		    break;
 5553|  37.8k|		case XPATH_BOOLEAN:
  ------------------
  |  Branch (5553:3): [True: 37.8k, False: 43.6k]
  ------------------
 5554|  37.8k|		    ret = (arg1->boolval == arg2->boolval);
 5555|  37.8k|		    break;
 5556|  36.6k|		case XPATH_NUMBER:
  ------------------
  |  Branch (5556:3): [True: 36.6k, False: 44.8k]
  ------------------
 5557|  36.6k|		    ret = (arg1->boolval ==
 5558|  36.6k|			   xmlXPathCastNumberToBoolean(arg2->floatval));
 5559|  36.6k|		    break;
 5560|  7.01k|		case XPATH_STRING:
  ------------------
  |  Branch (5560:3): [True: 7.01k, False: 74.4k]
  ------------------
 5561|  7.01k|		    if ((arg2->stringval == NULL) ||
  ------------------
  |  Branch (5561:11): [True: 0, False: 7.01k]
  ------------------
 5562|  7.01k|			(arg2->stringval[0] == 0)) ret = 0;
  ------------------
  |  Branch (5562:4): [True: 3.10k, False: 3.91k]
  ------------------
 5563|  3.91k|		    else
 5564|  3.91k|			ret = 1;
 5565|  7.01k|		    ret = (arg1->boolval == ret);
 5566|  7.01k|		    break;
 5567|      0|		case XPATH_USERS:
  ------------------
  |  Branch (5567:3): [True: 0, False: 81.4k]
  ------------------
 5568|       |		    /* TODO */
 5569|      0|		    break;
 5570|      0|		case XPATH_NODESET:
  ------------------
  |  Branch (5570:3): [True: 0, False: 81.4k]
  ------------------
 5571|      0|		case XPATH_XSLT_TREE:
  ------------------
  |  Branch (5571:3): [True: 0, False: 81.4k]
  ------------------
 5572|      0|		    break;
 5573|  81.4k|	    }
 5574|  81.4k|	    break;
 5575|   110k|        case XPATH_NUMBER:
  ------------------
  |  Branch (5575:9): [True: 110k, False: 83.2k]
  ------------------
 5576|   110k|	    switch (arg2->type) {
  ------------------
  |  Branch (5576:14): [True: 110k, False: 0]
  ------------------
 5577|      0|	        case XPATH_UNDEFINED:
  ------------------
  |  Branch (5577:10): [True: 0, False: 110k]
  ------------------
 5578|      0|		    break;
 5579|  27.1k|		case XPATH_BOOLEAN:
  ------------------
  |  Branch (5579:3): [True: 27.1k, False: 83.7k]
  ------------------
 5580|  27.1k|		    ret = (arg2->boolval==
 5581|  27.1k|			   xmlXPathCastNumberToBoolean(arg1->floatval));
 5582|  27.1k|		    break;
 5583|    475|		case XPATH_STRING:
  ------------------
  |  Branch (5583:3): [True: 475, False: 110k]
  ------------------
 5584|    475|		    xmlXPathValuePush(ctxt, arg2);
 5585|    475|		    xmlXPathNumberFunction(ctxt, 1);
 5586|    475|		    arg2 = xmlXPathValuePop(ctxt);
 5587|    475|                    if (ctxt->error)
  ------------------
  |  Branch (5587:25): [True: 2, False: 473]
  ------------------
 5588|      2|                        break;
 5589|       |                    /* Falls through. */
 5590|  83.7k|		case XPATH_NUMBER:
  ------------------
  |  Branch (5590:3): [True: 83.2k, False: 27.6k]
  ------------------
 5591|       |		    /* Hand check NaN and Infinity equalities */
 5592|  83.7k|		    if (xmlXPathIsNaN(arg1->floatval) ||
  ------------------
  |  Branch (5592:11): [True: 5.31k, False: 78.4k]
  ------------------
 5593|  78.4k|			    xmlXPathIsNaN(arg2->floatval)) {
  ------------------
  |  Branch (5593:8): [True: 896, False: 77.5k]
  ------------------
 5594|  6.20k|		        ret = 0;
 5595|  77.5k|		    } else if (xmlXPathIsInf(arg1->floatval) == 1) {
  ------------------
  |  Branch (5595:18): [True: 5.37k, False: 72.1k]
  ------------------
 5596|  5.37k|		        if (xmlXPathIsInf(arg2->floatval) == 1)
  ------------------
  |  Branch (5596:15): [True: 78, False: 5.29k]
  ------------------
 5597|     78|			    ret = 1;
 5598|  5.29k|			else
 5599|  5.29k|			    ret = 0;
 5600|  72.1k|		    } else if (xmlXPathIsInf(arg1->floatval) == -1) {
  ------------------
  |  Branch (5600:18): [True: 687, False: 71.4k]
  ------------------
 5601|    687|			if (xmlXPathIsInf(arg2->floatval) == -1)
  ------------------
  |  Branch (5601:8): [True: 217, False: 470]
  ------------------
 5602|    217|			    ret = 1;
 5603|    470|			else
 5604|    470|			    ret = 0;
 5605|  71.4k|		    } else if (xmlXPathIsInf(arg2->floatval) == 1) {
  ------------------
  |  Branch (5605:18): [True: 1.24k, False: 70.2k]
  ------------------
 5606|  1.24k|			if (xmlXPathIsInf(arg1->floatval) == 1)
  ------------------
  |  Branch (5606:8): [True: 0, False: 1.24k]
  ------------------
 5607|      0|			    ret = 1;
 5608|  1.24k|			else
 5609|  1.24k|			    ret = 0;
 5610|  70.2k|		    } else if (xmlXPathIsInf(arg2->floatval) == -1) {
  ------------------
  |  Branch (5610:18): [True: 263, False: 69.9k]
  ------------------
 5611|    263|			if (xmlXPathIsInf(arg1->floatval) == -1)
  ------------------
  |  Branch (5611:8): [True: 0, False: 263]
  ------------------
 5612|      0|			    ret = 1;
 5613|    263|			else
 5614|    263|			    ret = 0;
 5615|  69.9k|		    } else {
 5616|  69.9k|		        ret = (arg1->floatval == arg2->floatval);
 5617|  69.9k|		    }
 5618|  83.7k|		    break;
 5619|      0|		case XPATH_USERS:
  ------------------
  |  Branch (5619:3): [True: 0, False: 110k]
  ------------------
 5620|       |		    /* TODO */
 5621|      0|		    break;
 5622|      0|		case XPATH_NODESET:
  ------------------
  |  Branch (5622:3): [True: 0, False: 110k]
  ------------------
 5623|      0|		case XPATH_XSLT_TREE:
  ------------------
  |  Branch (5623:3): [True: 0, False: 110k]
  ------------------
 5624|      0|		    break;
 5625|   110k|	    }
 5626|   110k|	    break;
 5627|   110k|        case XPATH_STRING:
  ------------------
  |  Branch (5627:9): [True: 1.82k, False: 192k]
  ------------------
 5628|  1.82k|	    switch (arg2->type) {
  ------------------
  |  Branch (5628:14): [True: 1.82k, False: 0]
  ------------------
 5629|      0|	        case XPATH_UNDEFINED:
  ------------------
  |  Branch (5629:10): [True: 0, False: 1.82k]
  ------------------
 5630|      0|		    break;
 5631|    524|		case XPATH_BOOLEAN:
  ------------------
  |  Branch (5631:3): [True: 524, False: 1.29k]
  ------------------
 5632|    524|		    if ((arg1->stringval == NULL) ||
  ------------------
  |  Branch (5632:11): [True: 0, False: 524]
  ------------------
 5633|    524|			(arg1->stringval[0] == 0)) ret = 0;
  ------------------
  |  Branch (5633:4): [True: 310, False: 214]
  ------------------
 5634|    214|		    else
 5635|    214|			ret = 1;
 5636|    524|		    ret = (arg2->boolval == ret);
 5637|    524|		    break;
 5638|    244|		case XPATH_STRING:
  ------------------
  |  Branch (5638:3): [True: 244, False: 1.57k]
  ------------------
 5639|    244|		    ret = xmlStrEqual(arg1->stringval, arg2->stringval);
 5640|    244|		    break;
 5641|  1.05k|		case XPATH_NUMBER:
  ------------------
  |  Branch (5641:3): [True: 1.05k, False: 768]
  ------------------
 5642|  1.05k|		    xmlXPathValuePush(ctxt, arg1);
 5643|  1.05k|		    xmlXPathNumberFunction(ctxt, 1);
 5644|  1.05k|		    arg1 = xmlXPathValuePop(ctxt);
 5645|  1.05k|                    if (ctxt->error)
  ------------------
  |  Branch (5645:25): [True: 3, False: 1.05k]
  ------------------
 5646|      3|                        break;
 5647|       |		    /* Hand check NaN and Infinity equalities */
 5648|  1.05k|		    if (xmlXPathIsNaN(arg1->floatval) ||
  ------------------
  |  Branch (5648:11): [True: 511, False: 539]
  ------------------
 5649|    727|			    xmlXPathIsNaN(arg2->floatval)) {
  ------------------
  |  Branch (5649:8): [True: 216, False: 323]
  ------------------
 5650|    727|		        ret = 0;
 5651|    727|		    } else if (xmlXPathIsInf(arg1->floatval) == 1) {
  ------------------
  |  Branch (5651:18): [True: 1, False: 322]
  ------------------
 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|    322|		    } else if (xmlXPathIsInf(arg1->floatval) == -1) {
  ------------------
  |  Branch (5656:18): [True: 1, False: 321]
  ------------------
 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|    321|		    } else if (xmlXPathIsInf(arg2->floatval) == 1) {
  ------------------
  |  Branch (5661:18): [True: 10, False: 311]
  ------------------
 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|    311|		    } else if (xmlXPathIsInf(arg2->floatval) == -1) {
  ------------------
  |  Branch (5666:18): [True: 3, False: 308]
  ------------------
 5667|      3|			if (xmlXPathIsInf(arg1->floatval) == -1)
  ------------------
  |  Branch (5667:8): [True: 0, False: 3]
  ------------------
 5668|      0|			    ret = 1;
 5669|      3|			else
 5670|      3|			    ret = 0;
 5671|    308|		    } else {
 5672|    308|		        ret = (arg1->floatval == arg2->floatval);
 5673|    308|		    }
 5674|  1.05k|		    break;
 5675|      0|		case XPATH_USERS:
  ------------------
  |  Branch (5675:3): [True: 0, False: 1.82k]
  ------------------
 5676|       |		    /* TODO */
 5677|      0|		    break;
 5678|      0|		case XPATH_NODESET:
  ------------------
  |  Branch (5678:3): [True: 0, False: 1.82k]
  ------------------
 5679|      0|		case XPATH_XSLT_TREE:
  ------------------
  |  Branch (5679:3): [True: 0, False: 1.82k]
  ------------------
 5680|      0|		    break;
 5681|  1.82k|	    }
 5682|  1.82k|	    break;
 5683|  1.82k|        case XPATH_USERS:
  ------------------
  |  Branch (5683:9): [True: 0, False: 194k]
  ------------------
 5684|       |	    /* TODO */
 5685|      0|	    break;
 5686|      0|	case XPATH_NODESET:
  ------------------
  |  Branch (5686:2): [True: 0, False: 194k]
  ------------------
 5687|      0|	case XPATH_XSLT_TREE:
  ------------------
  |  Branch (5687:2): [True: 0, False: 194k]
  ------------------
 5688|      0|	    break;
 5689|   194k|    }
 5690|   194k|    xmlXPathReleaseObject(ctxt->context, arg1);
 5691|   194k|    xmlXPathReleaseObject(ctxt->context, arg2);
 5692|   194k|    return(ret);
 5693|   194k|}
xpath.c:xmlXPathCompareNodeSets:
 5178|  60.4k|	                xmlXPathObjectPtr arg1, xmlXPathObjectPtr arg2) {
 5179|  60.4k|    int i, j, init = 0;
 5180|  60.4k|    double val1;
 5181|  60.4k|    double *values2;
 5182|  60.4k|    int ret = 0;
 5183|  60.4k|    xmlNodeSetPtr ns1;
 5184|  60.4k|    xmlNodeSetPtr ns2;
 5185|       |
 5186|  60.4k|    if ((arg1 == NULL) ||
  ------------------
  |  Branch (5186:9): [True: 0, False: 60.4k]
  ------------------
 5187|  60.4k|	((arg1->type != XPATH_NODESET) && (arg1->type != XPATH_XSLT_TREE))) {
  ------------------
  |  Branch (5187:3): [True: 0, False: 60.4k]
  |  Branch (5187:36): [True: 0, False: 0]
  ------------------
 5188|      0|	xmlXPathFreeObject(arg2);
 5189|      0|        return(0);
 5190|      0|    }
 5191|  60.4k|    if ((arg2 == NULL) ||
  ------------------
  |  Branch (5191:9): [True: 0, False: 60.4k]
  ------------------
 5192|  60.4k|	((arg2->type != XPATH_NODESET) && (arg2->type != XPATH_XSLT_TREE))) {
  ------------------
  |  Branch (5192:3): [True: 0, False: 60.4k]
  |  Branch (5192:36): [True: 0, False: 0]
  ------------------
 5193|      0|	xmlXPathFreeObject(arg1);
 5194|      0|	xmlXPathFreeObject(arg2);
 5195|      0|        return(0);
 5196|      0|    }
 5197|       |
 5198|  60.4k|    ns1 = arg1->nodesetval;
 5199|  60.4k|    ns2 = arg2->nodesetval;
 5200|       |
 5201|  60.4k|    if ((ns1 == NULL) || (ns1->nodeNr <= 0)) {
  ------------------
  |  Branch (5201:9): [True: 0, False: 60.4k]
  |  Branch (5201:26): [True: 38.8k, False: 21.6k]
  ------------------
 5202|  38.8k|	xmlXPathFreeObject(arg1);
 5203|  38.8k|	xmlXPathFreeObject(arg2);
 5204|  38.8k|	return(0);
 5205|  38.8k|    }
 5206|  21.6k|    if ((ns2 == NULL) || (ns2->nodeNr <= 0)) {
  ------------------
  |  Branch (5206:9): [True: 0, False: 21.6k]
  |  Branch (5206:26): [True: 15.6k, False: 5.97k]
  ------------------
 5207|  15.6k|	xmlXPathFreeObject(arg1);
 5208|  15.6k|	xmlXPathFreeObject(arg2);
 5209|  15.6k|	return(0);
 5210|  15.6k|    }
 5211|       |
 5212|  5.97k|    values2 = (double *) xmlMalloc(ns2->nodeNr * sizeof(double));
 5213|  5.97k|    if (values2 == NULL) {
  ------------------
  |  Branch (5213:9): [True: 2, False: 5.97k]
  ------------------
 5214|      2|        xmlXPathPErrMemory(ctxt);
 5215|      2|	xmlXPathFreeObject(arg1);
 5216|      2|	xmlXPathFreeObject(arg2);
 5217|      2|	return(0);
 5218|      2|    }
 5219|  40.6k|    for (i = 0;i < ns1->nodeNr;i++) {
  ------------------
  |  Branch (5219:16): [True: 37.7k, False: 2.90k]
  ------------------
 5220|  37.7k|	val1 = xmlXPathNodeToNumberInternal(ctxt, ns1->nodeTab[i]);
 5221|  37.7k|	if (xmlXPathIsNaN(val1))
  ------------------
  |  Branch (5221:6): [True: 32.2k, False: 5.52k]
  ------------------
 5222|  32.2k|	    continue;
 5223|  57.2k|	for (j = 0;j < ns2->nodeNr;j++) {
  ------------------
  |  Branch (5223:13): [True: 54.7k, False: 2.45k]
  ------------------
 5224|  54.7k|	    if (init == 0) {
  ------------------
  |  Branch (5224:10): [True: 44.4k, False: 10.2k]
  ------------------
 5225|  44.4k|		values2[j] = xmlXPathNodeToNumberInternal(ctxt,
 5226|  44.4k|                                                          ns2->nodeTab[j]);
 5227|  44.4k|	    }
 5228|  54.7k|	    if (xmlXPathIsNaN(values2[j]))
  ------------------
  |  Branch (5228:10): [True: 44.8k, False: 9.96k]
  ------------------
 5229|  44.8k|		continue;
 5230|  9.96k|	    if (inf && strict)
  ------------------
  |  Branch (5230:10): [True: 520, False: 9.44k]
  |  Branch (5230:17): [True: 295, False: 225]
  ------------------
 5231|    295|		ret = (val1 < values2[j]);
 5232|  9.67k|	    else if (inf && !strict)
  ------------------
  |  Branch (5232:15): [True: 225, False: 9.44k]
  |  Branch (5232:22): [True: 225, False: 0]
  ------------------
 5233|    225|		ret = (val1 <= values2[j]);
 5234|  9.44k|	    else if (!inf && strict)
  ------------------
  |  Branch (5234:15): [True: 9.44k, False: 0]
  |  Branch (5234:23): [True: 9.21k, False: 234]
  ------------------
 5235|  9.21k|		ret = (val1 > values2[j]);
 5236|    234|	    else if (!inf && !strict)
  ------------------
  |  Branch (5236:15): [True: 234, False: 0]
  |  Branch (5236:23): [True: 234, False: 0]
  ------------------
 5237|    234|		ret = (val1 >= values2[j]);
 5238|  9.96k|	    if (ret)
  ------------------
  |  Branch (5238:10): [True: 3.06k, False: 6.89k]
  ------------------
 5239|  3.06k|		break;
 5240|  9.96k|	}
 5241|  5.52k|	if (ret)
  ------------------
  |  Branch (5241:6): [True: 3.06k, False: 2.45k]
  ------------------
 5242|  3.06k|	    break;
 5243|  2.45k|	init = 1;
 5244|  2.45k|    }
 5245|  5.97k|    xmlFree(values2);
 5246|  5.97k|    xmlXPathFreeObject(arg1);
 5247|  5.97k|    xmlXPathFreeObject(arg2);
 5248|  5.97k|    return(ret);
 5249|  5.97k|}
xpath.c:xmlXPathCompareNodeSetValue:
 5272|  70.7k|	                    xmlXPathObjectPtr arg, xmlXPathObjectPtr val) {
 5273|  70.7k|    if ((val == NULL) || (arg == NULL) ||
  ------------------
  |  Branch (5273:9): [True: 0, False: 70.7k]
  |  Branch (5273:26): [True: 0, False: 70.7k]
  ------------------
 5274|  70.7k|	((arg->type != XPATH_NODESET) && (arg->type != XPATH_XSLT_TREE)))
  ------------------
  |  Branch (5274:3): [True: 0, False: 70.7k]
  |  Branch (5274:35): [True: 0, False: 0]
  ------------------
 5275|      0|        return(0);
 5276|       |
 5277|  70.7k|    switch(val->type) {
 5278|  59.9k|        case XPATH_NUMBER:
  ------------------
  |  Branch (5278:9): [True: 59.9k, False: 10.8k]
  ------------------
 5279|  59.9k|	    return(xmlXPathCompareNodeSetFloat(ctxt, inf, strict, arg, val));
 5280|      0|        case XPATH_NODESET:
  ------------------
  |  Branch (5280:9): [True: 0, False: 70.7k]
  ------------------
 5281|      0|        case XPATH_XSLT_TREE:
  ------------------
  |  Branch (5281:9): [True: 0, False: 70.7k]
  ------------------
 5282|      0|	    return(xmlXPathCompareNodeSets(ctxt, inf, strict, arg, val));
 5283|    922|        case XPATH_STRING:
  ------------------
  |  Branch (5283:9): [True: 922, False: 69.8k]
  ------------------
 5284|    922|	    return(xmlXPathCompareNodeSetString(ctxt, inf, strict, arg, val));
 5285|  9.90k|        case XPATH_BOOLEAN:
  ------------------
  |  Branch (5285:9): [True: 9.90k, False: 60.8k]
  ------------------
 5286|  9.90k|	    xmlXPathValuePush(ctxt, arg);
 5287|  9.90k|	    xmlXPathBooleanFunction(ctxt, 1);
 5288|  9.90k|	    xmlXPathValuePush(ctxt, val);
 5289|  9.90k|	    return(xmlXPathCompareValues(ctxt, inf, strict));
 5290|      0|	default:
  ------------------
  |  Branch (5290:2): [True: 0, False: 70.7k]
  ------------------
 5291|      0|            xmlXPathReleaseObject(ctxt->context, arg);
 5292|      0|            xmlXPathReleaseObject(ctxt->context, val);
 5293|      0|            XP_ERROR0(XPATH_INVALID_TYPE);
  ------------------
  |  |  252|      0|    { xmlXPathErr(ctxt, X); return(0); }
  ------------------
 5294|  70.7k|    }
 5295|      0|    return(0);
 5296|  70.7k|}
xpath.c:xmlXPathCompareNodeSetFloat:
 5061|  59.9k|	                    xmlXPathObjectPtr arg, xmlXPathObjectPtr f) {
 5062|  59.9k|    int i, ret = 0;
 5063|  59.9k|    xmlNodeSetPtr ns;
 5064|  59.9k|    xmlChar *str2;
 5065|       |
 5066|  59.9k|    if ((f == NULL) || (arg == NULL) ||
  ------------------
  |  Branch (5066:9): [True: 0, False: 59.9k]
  |  Branch (5066:24): [True: 0, False: 59.9k]
  ------------------
 5067|  59.9k|	((arg->type != XPATH_NODESET) && (arg->type != XPATH_XSLT_TREE))) {
  ------------------
  |  Branch (5067:3): [True: 0, False: 59.9k]
  |  Branch (5067:35): [True: 0, False: 0]
  ------------------
 5068|      0|	xmlXPathReleaseObject(ctxt->context, arg);
 5069|      0|	xmlXPathReleaseObject(ctxt->context, f);
 5070|      0|        return(0);
 5071|      0|    }
 5072|  59.9k|    ns = arg->nodesetval;
 5073|  59.9k|    if (ns != NULL) {
  ------------------
  |  Branch (5073:9): [True: 59.9k, False: 0]
  ------------------
 5074|  88.6k|	for (i = 0;i < ns->nodeNr;i++) {
  ------------------
  |  Branch (5074:13): [True: 29.5k, False: 59.0k]
  ------------------
 5075|  29.5k|	     str2 = xmlXPathCastNodeToString(ns->nodeTab[i]);
 5076|  29.5k|	     if (str2 != NULL) {
  ------------------
  |  Branch (5076:11): [True: 29.5k, False: 27]
  ------------------
 5077|  29.5k|		 xmlXPathValuePush(ctxt, xmlXPathCacheNewString(ctxt, str2));
 5078|  29.5k|		 xmlFree(str2);
 5079|  29.5k|		 xmlXPathNumberFunction(ctxt, 1);
 5080|  29.5k|		 xmlXPathValuePush(ctxt, xmlXPathCacheObjectCopy(ctxt, f));
 5081|  29.5k|		 ret = xmlXPathCompareValues(ctxt, inf, strict);
 5082|  29.5k|		 if (ret)
  ------------------
  |  Branch (5082:8): [True: 823, False: 28.7k]
  ------------------
 5083|    823|		     break;
 5084|  29.5k|	     } else {
 5085|     27|                 xmlXPathPErrMemory(ctxt);
 5086|     27|             }
 5087|  29.5k|	}
 5088|  59.9k|    }
 5089|  59.9k|    xmlXPathReleaseObject(ctxt->context, arg);
 5090|  59.9k|    xmlXPathReleaseObject(ctxt->context, f);
 5091|  59.9k|    return(ret);
 5092|  59.9k|}
xpath.c:xmlXPathCacheObjectCopy:
 1881|   339k|{
 1882|   339k|    xmlXPathObjectPtr ret;
 1883|   339k|    xmlXPathContextPtr ctxt = pctxt->context;
 1884|       |
 1885|   339k|    if (val == NULL)
  ------------------
  |  Branch (1885:9): [True: 0, False: 339k]
  ------------------
 1886|      0|	return(NULL);
 1887|       |
 1888|   339k|    if ((ctxt != NULL) && (ctxt->cache != NULL)) {
  ------------------
  |  Branch (1888:9): [True: 339k, False: 0]
  |  Branch (1888:27): [True: 0, False: 339k]
  ------------------
 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|   339k|    ret = xmlXPathObjectCopy(val);
 1911|   339k|    if (ret == NULL)
  ------------------
  |  Branch (1911:9): [True: 111, False: 339k]
  ------------------
 1912|    111|        xmlXPathPErrMemory(pctxt);
 1913|   339k|    return(ret);
 1914|   339k|}
xpath.c:xmlXPathCompareNodeSetString:
 5115|    922|	                    xmlXPathObjectPtr arg, xmlXPathObjectPtr s) {
 5116|    922|    int i, ret = 0;
 5117|    922|    xmlNodeSetPtr ns;
 5118|    922|    xmlChar *str2;
 5119|       |
 5120|    922|    if ((s == NULL) || (arg == NULL) ||
  ------------------
  |  Branch (5120:9): [True: 0, False: 922]
  |  Branch (5120:24): [True: 0, False: 922]
  ------------------
 5121|    922|	((arg->type != XPATH_NODESET) && (arg->type != XPATH_XSLT_TREE))) {
  ------------------
  |  Branch (5121:3): [True: 0, False: 922]
  |  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|    922|    ns = arg->nodesetval;
 5127|    922|    if (ns != NULL) {
  ------------------
  |  Branch (5127:9): [True: 922, False: 0]
  ------------------
 5128|  4.54k|	for (i = 0;i < ns->nodeNr;i++) {
  ------------------
  |  Branch (5128:13): [True: 3.61k, False: 922]
  ------------------
 5129|  3.61k|	     str2 = xmlXPathCastNodeToString(ns->nodeTab[i]);
 5130|  3.61k|	     if (str2 != NULL) {
  ------------------
  |  Branch (5130:11): [True: 3.61k, False: 2]
  ------------------
 5131|  3.61k|		 xmlXPathValuePush(ctxt,
 5132|  3.61k|			   xmlXPathCacheNewString(ctxt, str2));
 5133|  3.61k|		 xmlFree(str2);
 5134|  3.61k|		 xmlXPathValuePush(ctxt, xmlXPathCacheObjectCopy(ctxt, s));
 5135|  3.61k|		 ret = xmlXPathCompareValues(ctxt, inf, strict);
 5136|  3.61k|		 if (ret)
  ------------------
  |  Branch (5136:8): [True: 0, False: 3.61k]
  ------------------
 5137|      0|		     break;
 5138|  3.61k|	     } else {
 5139|      2|                 xmlXPathPErrMemory(ctxt);
 5140|      2|             }
 5141|  3.61k|	}
 5142|    922|    }
 5143|    922|    xmlXPathReleaseObject(ctxt->context, arg);
 5144|    922|    xmlXPathReleaseObject(ctxt->context, s);
 5145|    922|    return(ret);
 5146|    922|}
xpath.c:xmlXPathCacheNewNodeSet:
 1689|  1.11M|{
 1690|  1.11M|    xmlXPathObjectPtr ret;
 1691|  1.11M|    xmlXPathContextPtr ctxt = pctxt->context;
 1692|       |
 1693|  1.11M|    if ((ctxt != NULL) && (ctxt->cache != NULL)) {
  ------------------
  |  Branch (1693:9): [True: 1.11M, False: 0]
  |  Branch (1693:27): [True: 0, False: 1.11M]
  ------------------
 1694|      0|	xmlXPathContextCachePtr cache = (xmlXPathContextCachePtr) ctxt->cache;
 1695|       |
 1696|      0|	if (cache->nodesetObjs != NULL) {
  ------------------
  |  Branch (1696:6): [True: 0, False: 0]
  ------------------
 1697|       |	    /*
 1698|       |	    * Use the nodeset-cache.
 1699|       |	    */
 1700|      0|	    ret = cache->nodesetObjs;
 1701|      0|            cache->nodesetObjs = (void *) ret->stringval;
 1702|      0|            cache->numNodeset -= 1;
 1703|      0|            ret->stringval = NULL;
 1704|      0|	    ret->type = XPATH_NODESET;
 1705|      0|	    ret->boolval = 0;
 1706|      0|	    if (val) {
  ------------------
  |  Branch (1706:10): [True: 0, False: 0]
  ------------------
 1707|      0|		if ((ret->nodesetval->nodeMax == 0) ||
  ------------------
  |  Branch (1707:7): [True: 0, False: 0]
  ------------------
 1708|      0|		    (val->type == XML_NAMESPACE_DECL))
  ------------------
  |  Branch (1708:7): [True: 0, False: 0]
  ------------------
 1709|      0|		{
 1710|      0|		    if (xmlXPathNodeSetAddUnique(ret->nodesetval, val) < 0)
  ------------------
  |  Branch (1710:11): [True: 0, False: 0]
  ------------------
 1711|      0|                        xmlXPathPErrMemory(pctxt);
 1712|      0|		} else {
 1713|      0|		    ret->nodesetval->nodeTab[0] = val;
 1714|      0|		    ret->nodesetval->nodeNr = 1;
 1715|      0|		}
 1716|      0|	    }
 1717|      0|	    return(ret);
 1718|      0|	} else if (cache->miscObjs != NULL) {
  ------------------
  |  Branch (1718:13): [True: 0, False: 0]
  ------------------
 1719|      0|            xmlNodeSetPtr set;
 1720|       |	    /*
 1721|       |	    * Fallback to misc-cache.
 1722|       |	    */
 1723|       |
 1724|      0|	    set = xmlXPathNodeSetCreate(val);
 1725|      0|	    if (set == NULL) {
  ------------------
  |  Branch (1725:10): [True: 0, False: 0]
  ------------------
 1726|      0|                xmlXPathPErrMemory(pctxt);
 1727|      0|		return(NULL);
 1728|      0|	    }
 1729|       |
 1730|      0|	    ret = cache->miscObjs;
 1731|      0|            cache->miscObjs = (void *) ret->stringval;
 1732|      0|            cache->numMisc -= 1;
 1733|      0|            ret->stringval = NULL;
 1734|      0|	    ret->type = XPATH_NODESET;
 1735|      0|	    ret->boolval = 0;
 1736|      0|	    ret->nodesetval = set;
 1737|      0|	    return(ret);
 1738|      0|	}
 1739|      0|    }
 1740|  1.11M|    ret = xmlXPathNewNodeSet(val);
 1741|  1.11M|    if (ret == NULL)
  ------------------
  |  Branch (1741:9): [True: 481, False: 1.11M]
  ------------------
 1742|    481|        xmlXPathPErrMemory(pctxt);
 1743|  1.11M|    return(ret);
 1744|  1.11M|}
xpath.c:xmlXPathCacheNewFloat:
 1847|   433k|{
 1848|   433k|    xmlXPathObjectPtr ret;
 1849|   433k|    xmlXPathContextPtr ctxt = pctxt->context;
 1850|       |
 1851|   433k|    if ((ctxt != NULL) && (ctxt->cache != NULL)) {
  ------------------
  |  Branch (1851:9): [True: 433k, False: 0]
  |  Branch (1851:27): [True: 0, False: 433k]
  ------------------
 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|   433k|    ret = xmlXPathNewFloat(val);
 1866|   433k|    if (ret == NULL)
  ------------------
  |  Branch (1866:9): [True: 148, False: 433k]
  ------------------
 1867|    148|        xmlXPathPErrMemory(pctxt);
 1868|   433k|    return(ret);
 1869|   433k|}
xpath.c:xmlXPathGetElementsByIds:
 6976|  8.07k|xmlXPathGetElementsByIds (xmlDocPtr doc, const xmlChar *ids) {
 6977|  8.07k|    xmlNodeSetPtr ret;
 6978|  8.07k|    const xmlChar *cur = ids;
 6979|  8.07k|    xmlChar *ID;
 6980|  8.07k|    xmlAttrPtr attr;
 6981|  8.07k|    xmlNodePtr elem = NULL;
 6982|       |
 6983|  8.07k|    if (ids == NULL) return(NULL);
  ------------------
  |  Branch (6983:9): [True: 8, False: 8.06k]
  ------------------
 6984|       |
 6985|  8.06k|    ret = xmlXPathNodeSetCreate(NULL);
 6986|  8.06k|    if (ret == NULL)
  ------------------
  |  Branch (6986:9): [True: 5, False: 8.06k]
  ------------------
 6987|      5|        return(ret);
 6988|       |
 6989|  8.06k|    while (IS_BLANK_CH(*cur)) cur++;
 6990|  18.4k|    while (*cur != 0) {
  ------------------
  |  Branch (6990:12): [True: 10.3k, False: 8.04k]
  ------------------
 6991|  69.1k|	while ((!IS_BLANK_CH(*cur)) && (*cur != 0))
  ------------------
  |  |  137|  69.1k|#define IS_BLANK_CH(c)  xmlIsBlank_ch(c)
  |  |  ------------------
  |  |  |  |   90|  69.1k|#define xmlIsBlank_ch(c)	(((c) == 0x20) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (90:27): [True: 3.47k, False: 65.6k]
  |  |  |  |  ------------------
  |  |  |  |   91|  69.1k|				 ((0x9 <= (c)) && ((c) <= 0xa)) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (91:7): [True: 59.6k, False: 6.04k]
  |  |  |  |  |  Branch (91:23): [True: 576, False: 59.0k]
  |  |  |  |  ------------------
  |  |  |  |   92|  69.1k|				 ((c) == 0xd))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (92:6): [True: 279, False: 64.8k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (6991:33): [True: 58.7k, False: 6.04k]
  ------------------
 6992|  58.7k|	    cur++;
 6993|       |
 6994|  10.3k|        ID = xmlStrndup(ids, cur - ids);
 6995|  10.3k|	if (ID == NULL) {
  ------------------
  |  Branch (6995:6): [True: 13, False: 10.3k]
  ------------------
 6996|     13|            xmlXPathFreeNodeSet(ret);
 6997|     13|            return(NULL);
 6998|     13|        }
 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|  10.3k|        attr = xmlGetID(doc, ID);
 7007|  10.3k|        xmlFree(ID);
 7008|  10.3k|        if (attr != NULL) {
  ------------------
  |  Branch (7008:13): [True: 1.80k, False: 8.55k]
  ------------------
 7009|  1.80k|            if (attr->type == XML_ATTRIBUTE_NODE)
  ------------------
  |  Branch (7009:17): [True: 1.80k, False: 0]
  ------------------
 7010|  1.80k|                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.80k|            if (elem != NULL) {
  ------------------
  |  Branch (7015:17): [True: 1.80k, False: 0]
  ------------------
 7016|  1.80k|                if (xmlXPathNodeSetAdd(ret, elem) < 0) {
  ------------------
  |  Branch (7016:21): [True: 2, False: 1.79k]
  ------------------
 7017|      2|                    xmlXPathFreeNodeSet(ret);
 7018|      2|                    return(NULL);
 7019|      2|                }
 7020|  1.80k|            }
 7021|  1.80k|        }
 7022|       |
 7023|  10.3k|	while (IS_BLANK_CH(*cur)) cur++;
 7024|  10.3k|	ids = cur;
 7025|  10.3k|    }
 7026|  8.04k|    return(ret);
 7027|  8.06k|}
xpath.c:xmlXPathCacheWrapNodeSet:
 1620|  1.03M|{
 1621|  1.03M|    xmlXPathObjectPtr ret;
 1622|  1.03M|    xmlXPathContextPtr ctxt = pctxt->context;
 1623|       |
 1624|  1.03M|    if ((ctxt != NULL) && (ctxt->cache != NULL)) {
  ------------------
  |  Branch (1624:9): [True: 1.03M, False: 0]
  |  Branch (1624:27): [True: 0, False: 1.03M]
  ------------------
 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.03M|    ret = xmlXPathWrapNodeSet(val);
 1640|  1.03M|    if (ret == NULL)
  ------------------
  |  Branch (1640:9): [True: 184, False: 1.03M]
  ------------------
 1641|    184|        xmlXPathPErrMemory(pctxt);
 1642|  1.03M|    return(ret);
 1643|  1.03M|}
xpath.c:xmlXPathCacheNewCString:
 1799|  8.08k|{
 1800|  8.08k|    return xmlXPathCacheNewString(pctxt, BAD_CAST val);
  ------------------
  |  |   34|  8.08k|#define BAD_CAST (xmlChar *)
  ------------------
 1801|  8.08k|}
xpath.c:xmlXPathCacheNewString:
 1756|   122k|{
 1757|   122k|    xmlXPathObjectPtr ret;
 1758|   122k|    xmlXPathContextPtr ctxt = pctxt->context;
 1759|       |
 1760|   122k|    if ((ctxt != NULL) && (ctxt->cache != NULL)) {
  ------------------
  |  Branch (1760:9): [True: 122k, False: 0]
  |  Branch (1760:27): [True: 0, False: 122k]
  ------------------
 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|   122k|    ret = xmlXPathNewString(val);
 1784|   122k|    if (ret == NULL)
  ------------------
  |  Branch (1784:9): [True: 41, False: 122k]
  ------------------
 1785|     41|        xmlXPathPErrMemory(pctxt);
 1786|   122k|    return(ret);
 1787|   122k|}
xpath.c:xmlXPathCacheWrapString:
 1655|  59.5k|{
 1656|  59.5k|    xmlXPathObjectPtr ret;
 1657|  59.5k|    xmlXPathContextPtr ctxt = pctxt->context;
 1658|       |
 1659|  59.5k|    if ((ctxt != NULL) && (ctxt->cache != NULL)) {
  ------------------
  |  Branch (1659:9): [True: 59.5k, False: 0]
  |  Branch (1659:27): [True: 0, False: 59.5k]
  ------------------
 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|  59.5k|    ret = xmlXPathWrapString(val);
 1673|  59.5k|    if (ret == NULL)
  ------------------
  |  Branch (1673:9): [True: 51, False: 59.5k]
  ------------------
 1674|     51|        xmlXPathPErrMemory(pctxt);
 1675|  59.5k|    return(ret);
 1676|  59.5k|}
xpath.c:xmlXPathCacheNewBoolean:
 1813|   519k|{
 1814|   519k|    xmlXPathObjectPtr ret;
 1815|   519k|    xmlXPathContextPtr ctxt = pctxt->context;
 1816|       |
 1817|   519k|    if ((ctxt != NULL) && (ctxt->cache != NULL)) {
  ------------------
  |  Branch (1817:9): [True: 519k, False: 0]
  |  Branch (1817:27): [True: 0, False: 519k]
  ------------------
 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|   519k|    ret = xmlXPathNewBoolean(val);
 1832|   519k|    if (ret == NULL)
  ------------------
  |  Branch (1832:9): [True: 103, False: 519k]
  ------------------
 1833|    103|        xmlXPathPErrMemory(pctxt);
 1834|   519k|    return(ret);
 1835|   519k|}
xpath.c:xmlXPathCheckOpLimit:
  803|  13.4M|xmlXPathCheckOpLimit(xmlXPathParserContextPtr ctxt, unsigned long opCount) {
  804|  13.4M|    xmlXPathContextPtr xpctxt = ctxt->context;
  805|       |
  806|  13.4M|    if ((opCount > xpctxt->opLimit) ||
  ------------------
  |  Branch (806:9): [True: 1, False: 13.4M]
  ------------------
  807|  13.4M|        (xpctxt->opCount > xpctxt->opLimit - opCount)) {
  ------------------
  |  Branch (807:9): [True: 97, False: 13.4M]
  ------------------
  808|     98|        xpctxt->opCount = xpctxt->opLimit;
  809|     98|        xmlXPathErr(ctxt, XPATH_OP_LIMIT_EXCEEDED);
  810|     98|        return(-1);
  811|     98|    }
  812|       |
  813|  13.4M|    xpctxt->opCount += opCount;
  814|  13.4M|    return(0);
  815|  13.4M|}
xpath.c:xmlXPathCompileExpr:
 9088|  52.2k|xmlXPathCompileExpr(xmlXPathParserContextPtr ctxt, int sort) {
 9089|  52.2k|    xmlXPathContextPtr xpctxt = ctxt->context;
 9090|       |
 9091|  52.2k|    if (xpctxt != NULL) {
  ------------------
  |  Branch (9091:9): [True: 52.2k, False: 0]
  ------------------
 9092|  52.2k|        if (xpctxt->depth >= XPATH_MAX_RECURSION_DEPTH)
  ------------------
  |  |  112|  52.2k|#define XPATH_MAX_RECURSION_DEPTH 500
  ------------------
  |  Branch (9092:13): [True: 311, False: 51.9k]
  ------------------
 9093|  51.9k|            XP_ERROR(XPATH_RECURSION_LIMIT_EXCEEDED);
  ------------------
  |  |  244|    311|    { xmlXPathErr(ctxt, X); return; }
  ------------------
 9094|       |        /*
 9095|       |         * Parsing a single '(' pushes about 10 functions on the call stack
 9096|       |         * before recursing!
 9097|       |         */
 9098|  51.9k|        xpctxt->depth += 10;
 9099|  51.9k|    }
 9100|       |
 9101|  51.9k|    xmlXPathCompAndExpr(ctxt);
 9102|  51.9k|    CHECK_ERROR;
  ------------------
  |  |  230|  51.9k|    if (ctxt->error != XPATH_EXPRESSION_OK) return
  |  |  ------------------
  |  |  |  Branch (230:9): [True: 5.73k, False: 46.1k]
  |  |  ------------------
  ------------------
 9103|  46.1k|    SKIP_BLANKS;
  ------------------
  |  | 2199|  46.1k|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  | 2202|  51.9k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2202:15): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 9104|  50.7k|    while ((CUR == 'o') && (NXT(1) == 'r')) {
  ------------------
  |  | 2193|  50.7k|#define CUR (*ctxt->cur)
  ------------------
                  while ((CUR == 'o') && (NXT(1) == 'r')) {
  ------------------
  |  | 2195|  4.65k|#define NXT(val) ctxt->cur[(val)]
  ------------------
  |  Branch (9104:12): [True: 4.65k, False: 46.0k]
  |  Branch (9104:28): [True: 4.64k, False: 11]
  ------------------
 9105|  4.64k|	int op1 = ctxt->comp->last;
 9106|  4.64k|        SKIP(2);
  ------------------
  |  | 2194|  4.64k|#define SKIP(val) ctxt->cur += (val)
  ------------------
 9107|  4.64k|	SKIP_BLANKS;
  ------------------
  |  | 2199|  4.64k|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  | 2202|  3.60k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2202:15): [True: 3.60k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 9108|  4.64k|        xmlXPathCompAndExpr(ctxt);
 9109|  4.64k|	CHECK_ERROR;
  ------------------
  |  |  230|  4.64k|    if (ctxt->error != XPATH_EXPRESSION_OK) return
  |  |  ------------------
  |  |  |  Branch (230:9): [True: 139, False: 4.50k]
  |  |  ------------------
  ------------------
 9110|  4.50k|	PUSH_BINARY_EXPR(XPATH_OP_OR, op1, ctxt->comp->last, 0, 0);
  ------------------
  |  | 1094|  4.50k|#define PUSH_BINARY_EXPR(op, ch1, ch2, val, val2)			\
  |  | 1095|  4.50k|xmlXPathCompExprAdd(ctxt, (ch1), (ch2), (op),			\
  |  | 1096|  4.50k|			(val), (val2), 0 ,NULL ,NULL)
  ------------------
 9111|  4.50k|	SKIP_BLANKS;
  ------------------
  |  | 2199|  4.50k|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  | 2202|  4.50k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2202:15): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 9112|  4.50k|    }
 9113|  46.0k|    if ((sort) && (ctxt->comp->steps[ctxt->comp->last].op != XPATH_OP_VALUE)) {
  ------------------
  |  Branch (9113:9): [True: 38.0k, False: 8.01k]
  |  Branch (9113:19): [True: 30.7k, False: 7.32k]
  ------------------
 9114|       |	/* more ops could be optimized too */
 9115|       |	/*
 9116|       |	* This is the main place to eliminate sorting for
 9117|       |	* operations which don't require a sorted node-set.
 9118|       |	* E.g. count().
 9119|       |	*/
 9120|  30.7k|	PUSH_UNARY_EXPR(XPATH_OP_SORT, ctxt->comp->last , 0, 0);
  ------------------
  |  | 1091|  30.7k|#define PUSH_UNARY_EXPR(op, ch, val, val2)				\
  |  | 1092|  30.7k|xmlXPathCompExprAdd(ctxt, (ch), -1, (op), (val), (val2), 0 ,NULL ,NULL)
  ------------------
 9121|  30.7k|    }
 9122|       |
 9123|  46.0k|    if (xpctxt != NULL)
  ------------------
  |  Branch (9123:9): [True: 46.0k, False: 0]
  ------------------
 9124|  46.0k|        xpctxt->depth -= 10;
 9125|  46.0k|}
xpath.c:xmlXPathCompAndExpr:
 9062|  56.5k|xmlXPathCompAndExpr(xmlXPathParserContextPtr ctxt) {
 9063|  56.5k|    xmlXPathCompEqualityExpr(ctxt);
 9064|  56.5k|    CHECK_ERROR;
  ------------------
  |  |  230|  56.5k|    if (ctxt->error != XPATH_EXPRESSION_OK) return
  |  |  ------------------
  |  |  |  Branch (230:9): [True: 5.83k, False: 50.7k]
  |  |  ------------------
  ------------------
 9065|  50.7k|    SKIP_BLANKS;
  ------------------
  |  | 2199|  50.7k|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  | 2202|  56.5k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2202:15): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 9066|  51.2k|    while ((CUR == 'a') && (NXT(1) == 'n') && (NXT(2) == 'd')) {
  ------------------
  |  | 2193|  51.2k|#define CUR (*ctxt->cur)
  ------------------
                  while ((CUR == 'a') && (NXT(1) == 'n') && (NXT(2) == 'd')) {
  ------------------
  |  | 2195|    616|#define NXT(val) ctxt->cur[(val)]
  ------------------
                  while ((CUR == 'a') && (NXT(1) == 'n') && (NXT(2) == 'd')) {
  ------------------
  |  | 2195|    581|#define NXT(val) ctxt->cur[(val)]
  ------------------
  |  Branch (9066:12): [True: 616, False: 50.6k]
  |  Branch (9066:28): [True: 581, False: 35]
  |  Branch (9066:47): [True: 579, False: 2]
  ------------------
 9067|    579|	int op1 = ctxt->comp->last;
 9068|    579|        SKIP(3);
  ------------------
  |  | 2194|    579|#define SKIP(val) ctxt->cur += (val)
  ------------------
 9069|    579|	SKIP_BLANKS;
  ------------------
  |  | 2199|  1.66k|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  | 2202|  1.66k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2202:15): [True: 1.66k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 9070|    579|        xmlXPathCompEqualityExpr(ctxt);
 9071|    579|	CHECK_ERROR;
  ------------------
  |  |  230|    579|    if (ctxt->error != XPATH_EXPRESSION_OK) return
  |  |  ------------------
  |  |  |  Branch (230:9): [True: 40, False: 539]
  |  |  ------------------
  ------------------
 9072|    539|	PUSH_BINARY_EXPR(XPATH_OP_AND, op1, ctxt->comp->last, 0, 0);
  ------------------
  |  | 1094|    539|#define PUSH_BINARY_EXPR(op, ch1, ch2, val, val2)			\
  |  | 1095|    539|xmlXPathCompExprAdd(ctxt, (ch1), (ch2), (op),			\
  |  | 1096|    539|			(val), (val2), 0 ,NULL ,NULL)
  ------------------
 9073|    539|	SKIP_BLANKS;
  ------------------
  |  | 2199|    539|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  | 2202|    539|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2202:15): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 9074|    539|    }
 9075|  50.7k|}
xpath.c:xmlXPathCompEqualityExpr:
 9033|  57.1k|xmlXPathCompEqualityExpr(xmlXPathParserContextPtr ctxt) {
 9034|  57.1k|    xmlXPathCompRelationalExpr(ctxt);
 9035|  57.1k|    CHECK_ERROR;
  ------------------
  |  |  230|  57.1k|    if (ctxt->error != XPATH_EXPRESSION_OK) return
  |  |  ------------------
  |  |  |  Branch (230:9): [True: 5.04k, False: 52.1k]
  |  |  ------------------
  ------------------
 9036|  52.1k|    SKIP_BLANKS;
  ------------------
  |  | 2199|  52.1k|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  | 2202|  57.1k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2202:15): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 9037|  93.2k|    while ((CUR == '=') || ((CUR == '!') && (NXT(1) == '='))) {
  ------------------
  |  | 2193|  93.2k|#define CUR (*ctxt->cur)
  ------------------
                  while ((CUR == '=') || ((CUR == '!') && (NXT(1) == '='))) {
  ------------------
  |  | 2193|  53.4k|#define CUR (*ctxt->cur)
  ------------------
                  while ((CUR == '=') || ((CUR == '!') && (NXT(1) == '='))) {
  ------------------
  |  | 2195|  2.21k|#define NXT(val) ctxt->cur[(val)]
  ------------------
  |  Branch (9037:12): [True: 39.7k, False: 53.4k]
  |  Branch (9037:29): [True: 2.21k, False: 51.2k]
  |  Branch (9037:45): [True: 2.18k, False: 31]
  ------------------
 9038|  41.9k|	int eq;
 9039|  41.9k|	int op1 = ctxt->comp->last;
 9040|       |
 9041|  41.9k|        if (CUR == '=') eq = 1;
  ------------------
  |  | 2193|  41.9k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (9041:13): [True: 39.7k, False: 2.18k]
  ------------------
 9042|  2.18k|	else eq = 0;
 9043|  41.9k|	NEXT;
  ------------------
  |  | 2202|  41.9k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  ------------------
  |  |  |  Branch (2202:15): [True: 41.9k, False: 0]
  |  |  ------------------
  ------------------
 9044|  41.9k|	if (!eq) NEXT;
  ------------------
  |  | 2202|  2.18k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  ------------------
  |  |  |  Branch (2202:15): [True: 2.18k, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (9044:6): [True: 2.18k, False: 39.7k]
  ------------------
 9045|  41.9k|	SKIP_BLANKS;
  ------------------
  |  | 2199|  68.8k|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  | 2202|  68.8k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2202:15): [True: 68.8k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 9046|  41.9k|        xmlXPathCompRelationalExpr(ctxt);
 9047|  41.9k|	CHECK_ERROR;
  ------------------
  |  |  230|  41.9k|    if (ctxt->error != XPATH_EXPRESSION_OK) return
  |  |  ------------------
  |  |  |  Branch (230:9): [True: 820, False: 41.1k]
  |  |  ------------------
  ------------------
 9048|  41.1k|	PUSH_BINARY_EXPR(XPATH_OP_EQUAL, op1, ctxt->comp->last, eq, 0);
  ------------------
  |  | 1094|  41.1k|#define PUSH_BINARY_EXPR(op, ch1, ch2, val, val2)			\
  |  | 1095|  41.1k|xmlXPathCompExprAdd(ctxt, (ch1), (ch2), (op),			\
  |  | 1096|  41.1k|			(val), (val2), 0 ,NULL ,NULL)
  ------------------
 9049|  41.1k|	SKIP_BLANKS;
  ------------------
  |  | 2199|  41.1k|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  | 2202|  41.1k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2202:15): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 9050|  41.1k|    }
 9051|  52.1k|}
xpath.c:xmlXPathCompRelationalExpr:
 8996|  99.1k|xmlXPathCompRelationalExpr(xmlXPathParserContextPtr ctxt) {
 8997|  99.1k|    xmlXPathCompAdditiveExpr(ctxt);
 8998|  99.1k|    CHECK_ERROR;
  ------------------
  |  |  230|  99.1k|    if (ctxt->error != XPATH_EXPRESSION_OK) return
  |  |  ------------------
  |  |  |  Branch (230:9): [True: 5.06k, False: 94.0k]
  |  |  ------------------
  ------------------
 8999|  94.0k|    SKIP_BLANKS;
  ------------------
  |  | 2199|  94.0k|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  | 2202|  99.1k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2202:15): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 9000|   120k|    while ((CUR == '<') || (CUR == '>')) {
  ------------------
  |  | 2193|   120k|#define CUR (*ctxt->cur)
  ------------------
                  while ((CUR == '<') || (CUR == '>')) {
  ------------------
  |  | 2193|   114k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (9000:12): [True: 5.78k, False: 114k]
  |  Branch (9000:28): [True: 21.3k, False: 93.2k]
  ------------------
 9001|  27.0k|	int inf, strict;
 9002|  27.0k|	int op1 = ctxt->comp->last;
 9003|       |
 9004|  27.0k|        if (CUR == '<') inf = 1;
  ------------------
  |  | 2193|  27.0k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (9004:13): [True: 5.78k, False: 21.3k]
  ------------------
 9005|  21.3k|	else inf = 0;
 9006|  27.0k|	if (NXT(1) == '=') strict = 0;
  ------------------
  |  | 2195|  27.0k|#define NXT(val) ctxt->cur[(val)]
  ------------------
  |  Branch (9006:6): [True: 6.50k, False: 20.5k]
  ------------------
 9007|  20.5k|	else strict = 1;
 9008|  27.0k|	NEXT;
  ------------------
  |  | 2202|  27.0k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  ------------------
  |  |  |  Branch (2202:15): [True: 27.0k, False: 0]
  |  |  ------------------
  ------------------
 9009|  27.0k|	if (!strict) NEXT;
  ------------------
  |  | 2202|  6.50k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  ------------------
  |  |  |  Branch (2202:15): [True: 6.50k, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (9009:6): [True: 6.50k, False: 20.5k]
  ------------------
 9010|  27.0k|	SKIP_BLANKS;
  ------------------
  |  | 2199|  27.0k|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  | 2202|  4.41k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2202:15): [True: 4.41k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 9011|  27.0k|        xmlXPathCompAdditiveExpr(ctxt);
 9012|  27.0k|	CHECK_ERROR;
  ------------------
  |  |  230|  27.0k|    if (ctxt->error != XPATH_EXPRESSION_OK) return
  |  |  ------------------
  |  |  |  Branch (230:9): [True: 804, False: 26.2k]
  |  |  ------------------
  ------------------
 9013|  26.2k|	PUSH_BINARY_EXPR(XPATH_OP_CMP, op1, ctxt->comp->last, inf, strict);
  ------------------
  |  | 1094|  26.2k|#define PUSH_BINARY_EXPR(op, ch1, ch2, val, val2)			\
  |  | 1095|  26.2k|xmlXPathCompExprAdd(ctxt, (ch1), (ch2), (op),			\
  |  | 1096|  26.2k|			(val), (val2), 0 ,NULL ,NULL)
  ------------------
 9014|  26.2k|	SKIP_BLANKS;
  ------------------
  |  | 2199|  26.2k|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  | 2202|  26.2k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2202:15): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 9015|  26.2k|    }
 9016|  94.0k|}
xpath.c:xmlXPathCompAdditiveExpr:
 8958|   126k|xmlXPathCompAdditiveExpr(xmlXPathParserContextPtr ctxt) {
 8959|       |
 8960|   126k|    xmlXPathCompMultiplicativeExpr(ctxt);
 8961|   126k|    CHECK_ERROR;
  ------------------
  |  |  230|   126k|    if (ctxt->error != XPATH_EXPRESSION_OK) return
  |  |  ------------------
  |  |  |  Branch (230:9): [True: 5.10k, False: 121k]
  |  |  ------------------
  ------------------
 8962|   121k|    SKIP_BLANKS;
  ------------------
  |  | 2199|   121k|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  | 2202|   126k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2202:15): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 8963|   172k|    while ((CUR == '+') || (CUR == '-')) {
  ------------------
  |  | 2193|   172k|#define CUR (*ctxt->cur)
  ------------------
                  while ((CUR == '+') || (CUR == '-')) {
  ------------------
  |  | 2193|   167k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (8963:12): [True: 5.24k, False: 167k]
  |  Branch (8963:28): [True: 46.8k, False: 120k]
  ------------------
 8964|  52.0k|	int plus;
 8965|  52.0k|	int op1 = ctxt->comp->last;
 8966|       |
 8967|  52.0k|        if (CUR == '+') plus = 1;
  ------------------
  |  | 2193|  52.0k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (8967:13): [True: 5.24k, False: 46.8k]
  ------------------
 8968|  46.8k|	else plus = 0;
 8969|  52.0k|	NEXT;
  ------------------
  |  | 2202|  52.0k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  ------------------
  |  |  |  Branch (2202:15): [True: 52.0k, False: 0]
  |  |  ------------------
  ------------------
 8970|  52.0k|	SKIP_BLANKS;
  ------------------
  |  | 2199|  52.0k|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  | 2202|  6.64k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2202:15): [True: 6.64k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 8971|  52.0k|        xmlXPathCompMultiplicativeExpr(ctxt);
 8972|  52.0k|	CHECK_ERROR;
  ------------------
  |  |  230|  52.0k|    if (ctxt->error != XPATH_EXPRESSION_OK) return
  |  |  ------------------
  |  |  |  Branch (230:9): [True: 760, False: 51.3k]
  |  |  ------------------
  ------------------
 8973|  51.3k|	PUSH_BINARY_EXPR(XPATH_OP_PLUS, op1, ctxt->comp->last, plus, 0);
  ------------------
  |  | 1094|  51.3k|#define PUSH_BINARY_EXPR(op, ch1, ch2, val, val2)			\
  |  | 1095|  51.3k|xmlXPathCompExprAdd(ctxt, (ch1), (ch2), (op),			\
  |  | 1096|  51.3k|			(val), (val2), 0 ,NULL ,NULL)
  ------------------
 8974|  51.3k|	SKIP_BLANKS;
  ------------------
  |  | 2199|  51.3k|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  | 2202|  51.3k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2202:15): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 8975|  51.3k|    }
 8976|   121k|}
xpath.c:xmlXPathCompMultiplicativeExpr:
 8919|   178k|xmlXPathCompMultiplicativeExpr(xmlXPathParserContextPtr ctxt) {
 8920|   178k|    xmlXPathCompUnaryExpr(ctxt);
 8921|   178k|    CHECK_ERROR;
  ------------------
  |  |  230|   178k|    if (ctxt->error != XPATH_EXPRESSION_OK) return
  |  |  ------------------
  |  |  |  Branch (230:9): [True: 5.50k, False: 172k]
  |  |  ------------------
  ------------------
 8922|   172k|    SKIP_BLANKS;
  ------------------
  |  | 2199|   172k|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  | 2202|   178k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2202:15): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 8923|  1.19M|    while ((CUR == '*') ||
  ------------------
  |  | 2193|  1.19M|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (8923:12): [True: 1.01M, False: 173k]
  ------------------
 8924|   173k|           ((CUR == 'd') && (NXT(1) == 'i') && (NXT(2) == 'v')) ||
  ------------------
  |  | 2193|   173k|#define CUR (*ctxt->cur)
  ------------------
                         ((CUR == 'd') && (NXT(1) == 'i') && (NXT(2) == 'v')) ||
  ------------------
  |  | 2195|    662|#define NXT(val) ctxt->cur[(val)]
  ------------------
                         ((CUR == 'd') && (NXT(1) == 'i') && (NXT(2) == 'v')) ||
  ------------------
  |  | 2195|    638|#define NXT(val) ctxt->cur[(val)]
  ------------------
  |  Branch (8924:13): [True: 662, False: 172k]
  |  Branch (8924:29): [True: 638, False: 24]
  |  Branch (8924:48): [True: 628, False: 10]
  ------------------
 8925|  1.01M|           ((CUR == 'm') && (NXT(1) == 'o') && (NXT(2) == 'd'))) {
  ------------------
  |  | 2193|   172k|#define CUR (*ctxt->cur)
  ------------------
                         ((CUR == 'm') && (NXT(1) == 'o') && (NXT(2) == 'd'))) {
  ------------------
  |  | 2195|    585|#define NXT(val) ctxt->cur[(val)]
  ------------------
                         ((CUR == 'm') && (NXT(1) == 'o') && (NXT(2) == 'd'))) {
  ------------------
  |  | 2195|    574|#define NXT(val) ctxt->cur[(val)]
  ------------------
  |  Branch (8925:13): [True: 585, False: 172k]
  |  Branch (8925:29): [True: 574, False: 11]
  |  Branch (8925:48): [True: 568, False: 6]
  ------------------
 8926|  1.01M|	int op = -1;
 8927|  1.01M|	int op1 = ctxt->comp->last;
 8928|       |
 8929|  1.01M|        if (CUR == '*') {
  ------------------
  |  | 2193|  1.01M|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (8929:13): [True: 1.01M, False: 1.19k]
  ------------------
 8930|  1.01M|	    op = 0;
 8931|  1.01M|	    NEXT;
  ------------------
  |  | 2202|  1.01M|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  ------------------
  |  |  |  Branch (2202:15): [True: 1.01M, False: 0]
  |  |  ------------------
  ------------------
 8932|  1.01M|	} else if (CUR == 'd') {
  ------------------
  |  | 2193|  1.19k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (8932:13): [True: 628, False: 568]
  ------------------
 8933|    628|	    op = 1;
 8934|    628|	    SKIP(3);
  ------------------
  |  | 2194|    628|#define SKIP(val) ctxt->cur += (val)
  ------------------
 8935|    628|	} else if (CUR == 'm') {
  ------------------
  |  | 2193|    568|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (8935:13): [True: 568, False: 0]
  ------------------
 8936|    568|	    op = 2;
 8937|    568|	    SKIP(3);
  ------------------
  |  | 2194|    568|#define SKIP(val) ctxt->cur += (val)
  ------------------
 8938|    568|	}
 8939|  1.01M|	SKIP_BLANKS;
  ------------------
  |  | 2199|  1.01M|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  | 2202|  12.8k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2202:15): [True: 12.8k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 8940|  1.01M|        xmlXPathCompUnaryExpr(ctxt);
 8941|  1.01M|	CHECK_ERROR;
  ------------------
  |  |  230|  1.01M|    if (ctxt->error != XPATH_EXPRESSION_OK) return
  |  |  ------------------
  |  |  |  Branch (230:9): [True: 353, False: 1.01M]
  |  |  ------------------
  ------------------
 8942|  1.01M|	PUSH_BINARY_EXPR(XPATH_OP_MULT, op1, ctxt->comp->last, op, 0);
  ------------------
  |  | 1094|  1.01M|#define PUSH_BINARY_EXPR(op, ch1, ch2, val, val2)			\
  |  | 1095|  1.01M|xmlXPathCompExprAdd(ctxt, (ch1), (ch2), (op),			\
  |  | 1096|  1.01M|			(val), (val2), 0 ,NULL ,NULL)
  ------------------
 8943|  1.01M|	SKIP_BLANKS;
  ------------------
  |  | 2199|  1.01M|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  | 2202|  1.01M|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2202:15): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 8944|  1.01M|    }
 8945|   172k|}
xpath.c:xmlXPathCompUnaryExpr:
 8884|  1.19M|xmlXPathCompUnaryExpr(xmlXPathParserContextPtr ctxt) {
 8885|  1.19M|    int minus = 0;
 8886|  1.19M|    int found = 0;
 8887|       |
 8888|  1.19M|    SKIP_BLANKS;
  ------------------
  |  | 2199|  1.19M|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  | 2202|  13.5k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2202:15): [True: 13.5k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 8889|  1.27M|    while (CUR == '-') {
  ------------------
  |  | 2193|  1.27M|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (8889:12): [True: 77.3k, False: 1.19M]
  ------------------
 8890|  77.3k|        minus = 1 - minus;
 8891|  77.3k|	found = 1;
 8892|  77.3k|	NEXT;
  ------------------
  |  | 2202|  77.3k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  ------------------
  |  |  |  Branch (2202:15): [True: 77.3k, False: 0]
  |  |  ------------------
  ------------------
 8893|  77.3k|	SKIP_BLANKS;
  ------------------
  |  | 2199|  77.3k|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  | 2202|  9.14k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2202:15): [True: 9.14k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 8894|  77.3k|    }
 8895|       |
 8896|  1.19M|    xmlXPathCompUnionExpr(ctxt);
 8897|  1.19M|    CHECK_ERROR;
  ------------------
  |  |  230|  1.19M|    if (ctxt->error != XPATH_EXPRESSION_OK) return
  |  |  ------------------
  |  |  |  Branch (230:9): [True: 5.85k, False: 1.19M]
  |  |  ------------------
  ------------------
 8898|  1.19M|    if (found) {
  ------------------
  |  Branch (8898:9): [True: 53.7k, False: 1.13M]
  ------------------
 8899|  53.7k|	if (minus)
  ------------------
  |  Branch (8899:6): [True: 44.7k, False: 8.98k]
  ------------------
 8900|  44.7k|	    PUSH_UNARY_EXPR(XPATH_OP_PLUS, ctxt->comp->last, 2, 0);
  ------------------
  |  | 1091|  44.7k|#define PUSH_UNARY_EXPR(op, ch, val, val2)				\
  |  | 1092|  44.7k|xmlXPathCompExprAdd(ctxt, (ch), -1, (op), (val), (val2), 0 ,NULL ,NULL)
  ------------------
 8901|  8.98k|	else
 8902|       |	    PUSH_UNARY_EXPR(XPATH_OP_PLUS, ctxt->comp->last, 3, 0);
  ------------------
  |  | 1091|  8.98k|#define PUSH_UNARY_EXPR(op, ch, val, val2)				\
  |  | 1092|  8.98k|xmlXPathCompExprAdd(ctxt, (ch), -1, (op), (val), (val2), 0 ,NULL ,NULL)
  ------------------
 8903|  53.7k|    }
 8904|  1.19M|}
xpath.c:xmlXPathCompUnionExpr:
 8856|  1.19M|xmlXPathCompUnionExpr(xmlXPathParserContextPtr ctxt) {
 8857|  1.19M|    xmlXPathCompPathExpr(ctxt);
 8858|  1.19M|    CHECK_ERROR;
  ------------------
  |  |  230|  1.19M|    if (ctxt->error != XPATH_EXPRESSION_OK) return
  |  |  ------------------
  |  |  |  Branch (230:9): [True: 5.66k, False: 1.19M]
  |  |  ------------------
  ------------------
 8859|  1.19M|    SKIP_BLANKS;
  ------------------
  |  | 2199|  1.19M|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  | 2202|  1.19M|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2202:15): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 8860|  1.20M|    while (CUR == '|') {
  ------------------
  |  | 2193|  1.20M|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (8860:12): [True: 8.55k, False: 1.19M]
  ------------------
 8861|  8.55k|	int op1 = ctxt->comp->last;
 8862|  8.55k|	PUSH_LEAVE_EXPR(XPATH_OP_NODE, 0, 0);
  ------------------
  |  | 1088|  8.55k|#define PUSH_LEAVE_EXPR(op, val, val2)					\
  |  | 1089|  8.55k|xmlXPathCompExprAdd(ctxt, -1, -1, (op), (val), (val2), 0 ,NULL ,NULL)
  ------------------
 8863|       |
 8864|  8.55k|	NEXT;
  ------------------
  |  | 2202|  8.55k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  ------------------
  |  |  |  Branch (2202:15): [True: 8.55k, False: 0]
  |  |  ------------------
  ------------------
 8865|  8.55k|	SKIP_BLANKS;
  ------------------
  |  | 2199|  8.55k|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  | 2202|  5.25k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2202:15): [True: 5.25k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 8866|  8.55k|	xmlXPathCompPathExpr(ctxt);
 8867|       |
 8868|  8.55k|	PUSH_BINARY_EXPR(XPATH_OP_UNION, op1, ctxt->comp->last, 0, 0);
  ------------------
  |  | 1094|  8.55k|#define PUSH_BINARY_EXPR(op, ch1, ch2, val, val2)			\
  |  | 1095|  8.55k|xmlXPathCompExprAdd(ctxt, (ch1), (ch2), (op),			\
  |  | 1096|  8.55k|			(val), (val2), 0 ,NULL ,NULL)
  ------------------
 8869|       |
 8870|  8.55k|	SKIP_BLANKS;
  ------------------
  |  | 2199|  8.55k|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  | 2202|      0|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2202:15): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 8871|  8.55k|    }
 8872|  1.19M|}
xpath.c:xmlXPathCompPathExpr:
 8734|  1.20M|xmlXPathCompPathExpr(xmlXPathParserContextPtr ctxt) {
 8735|  1.20M|    int lc = 1;           /* Should we branch to LocationPath ?         */
 8736|  1.20M|    xmlChar *name = NULL; /* we may have to preparse a name to find out */
 8737|       |
 8738|  1.20M|    SKIP_BLANKS;
  ------------------
  |  | 2199|  1.20M|    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.20M|    if ((CUR == '$') || (CUR == '(') ||
  ------------------
  |  | 2193|  1.20M|#define CUR (*ctxt->cur)
  ------------------
                  if ((CUR == '$') || (CUR == '(') ||
  ------------------
  |  | 2193|  1.20M|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (8739:9): [True: 1.43k, False: 1.20M]
  |  Branch (8739:25): [True: 3.85k, False: 1.20M]
  ------------------
 8740|  1.20M|	(IS_ASCII_DIGIT(CUR)) ||
  ------------------
  |  |  230|  1.20M|#define IS_ASCII_DIGIT(c)	((0x30 <= (c)) && ((c) <= 0x39))
  |  |  ------------------
  |  |  |  Branch (230:28): [True: 125k, False: 1.07M]
  |  |  |  Branch (230:45): [True: 52.9k, False: 72.2k]
  |  |  ------------------
  ------------------
 8741|  1.14M|        (CUR == '\'') || (CUR == '"') ||
  ------------------
  |  | 2193|  1.14M|#define CUR (*ctxt->cur)
  ------------------
                      (CUR == '\'') || (CUR == '"') ||
  ------------------
  |  | 2193|  1.14M|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (8741:9): [True: 1.68k, False: 1.14M]
  |  Branch (8741:26): [True: 116, False: 1.14M]
  ------------------
 8742|  1.14M|	(CUR == '.' && IS_ASCII_DIGIT(NXT(1)))) {
  ------------------
  |  | 2193|  1.14M|#define CUR (*ctxt->cur)
  ------------------
              	(CUR == '.' && IS_ASCII_DIGIT(NXT(1)))) {
  ------------------
  |  |  230|  11.1k|#define IS_ASCII_DIGIT(c)	((0x30 <= (c)) && ((c) <= 0x39))
  |  |  ------------------
  |  |  |  Branch (230:28): [True: 6.57k, False: 4.53k]
  |  |  |  Branch (230:45): [True: 2.45k, False: 4.12k]
  |  |  ------------------
  ------------------
  |  Branch (8742:3): [True: 11.1k, False: 1.13M]
  ------------------
 8743|  62.4k|	lc = 0;
 8744|  1.14M|    } else if (CUR == '*') {
  ------------------
  |  | 2193|  1.14M|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (8744:16): [True: 985k, False: 157k]
  ------------------
 8745|       |	/* relative or absolute location path */
 8746|   985k|	lc = 1;
 8747|   985k|    } else if (CUR == '/') {
  ------------------
  |  | 2193|   157k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (8747:16): [True: 76.5k, False: 81.2k]
  ------------------
 8748|       |	/* relative or absolute location path */
 8749|  76.5k|	lc = 1;
 8750|  81.2k|    } else if (CUR == '@') {
  ------------------
  |  | 2193|  81.2k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (8750:16): [True: 1.70k, False: 79.5k]
  ------------------
 8751|       |	/* relative abbreviated attribute location path */
 8752|  1.70k|	lc = 1;
 8753|  79.5k|    } else if (CUR == '.') {
  ------------------
  |  | 2193|  79.5k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (8753:16): [True: 8.66k, False: 70.9k]
  ------------------
 8754|       |	/* relative abbreviated attribute location path */
 8755|  8.66k|	lc = 1;
 8756|  70.9k|    } 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|  70.9k|	SKIP_BLANKS;
  ------------------
  |  | 2199|  70.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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 8769|  70.9k|	name = xmlXPathScanName(ctxt);
 8770|  70.9k|	if ((name != NULL) && (xmlStrstr(name, (xmlChar *) "::") != NULL)) {
  ------------------
  |  Branch (8770:6): [True: 67.5k, False: 3.39k]
  |  Branch (8770:24): [True: 681, False: 66.8k]
  ------------------
 8771|    681|	    lc = 1;
 8772|    681|	    xmlFree(name);
 8773|  70.2k|	} else if (name != NULL) {
  ------------------
  |  Branch (8773:13): [True: 66.8k, False: 3.39k]
  ------------------
 8774|  66.8k|	    int len =xmlStrlen(name);
 8775|       |
 8776|       |
 8777|   516k|	    while (NXT(len) != 0) {
  ------------------
  |  | 2195|   516k|#define NXT(val) ctxt->cur[(val)]
  ------------------
  |  Branch (8777:13): [True: 515k, False: 1.22k]
  ------------------
 8778|   515k|		if (NXT(len) == '/') {
  ------------------
  |  | 2195|   515k|#define NXT(val) ctxt->cur[(val)]
  ------------------
  |  Branch (8778:7): [True: 3.69k, False: 511k]
  ------------------
 8779|       |		    /* element name */
 8780|  3.69k|		    lc = 1;
 8781|  3.69k|		    break;
 8782|   511k|		} else if (IS_BLANK_CH(NXT(len))) {
  ------------------
  |  |  137|   511k|#define IS_BLANK_CH(c)  xmlIsBlank_ch(c)
  |  |  ------------------
  |  |  |  |   90|   511k|#define xmlIsBlank_ch(c)	(((c) == 0x20) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (90:27): [True: 448k, False: 63.3k]
  |  |  |  |  ------------------
  |  |  |  |   91|   511k|				 ((0x9 <= (c)) && ((c) <= 0xa)) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (91:7): [True: 63.3k, False: 3]
  |  |  |  |  |  Branch (91:23): [True: 1.26k, False: 62.0k]
  |  |  |  |  ------------------
  |  |  |  |   92|   511k|				 ((c) == 0xd))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (92:6): [True: 130, False: 61.9k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 8783|       |		    /* ignore blanks */
 8784|   449k|		    ;
 8785|   449k|		} else if (NXT(len) == ':') {
  ------------------
  |  | 2195|  61.9k|#define NXT(val) ctxt->cur[(val)]
  ------------------
  |  Branch (8785:14): [True: 703, False: 61.2k]
  ------------------
 8786|    703|		    lc = 1;
 8787|    703|		    break;
 8788|  61.2k|		} else if ((NXT(len) == '(')) {
  ------------------
  |  | 2195|  61.2k|#define NXT(val) ctxt->cur[(val)]
  ------------------
  |  Branch (8788:14): [True: 11.8k, False: 49.4k]
  ------------------
 8789|       |		    /* Node Type or Function */
 8790|  11.8k|		    if (xmlXPathIsNodeType(name)) {
  ------------------
  |  Branch (8790:11): [True: 294, False: 11.5k]
  ------------------
 8791|    294|			lc = 1;
 8792|  11.5k|		    } else {
 8793|  11.5k|			lc = 0;
 8794|  11.5k|		    }
 8795|  11.8k|                    break;
 8796|  49.4k|		} else if ((NXT(len) == '[')) {
  ------------------
  |  | 2195|  49.4k|#define NXT(val) ctxt->cur[(val)]
  ------------------
  |  Branch (8796:14): [True: 1.01k, False: 48.3k]
  ------------------
 8797|       |		    /* element name */
 8798|  1.01k|		    lc = 1;
 8799|  1.01k|		    break;
 8800|  48.3k|		} else if ((NXT(len) == '<') || (NXT(len) == '>') ||
  ------------------
  |  | 2195|  48.3k|#define NXT(val) ctxt->cur[(val)]
  ------------------
              		} else if ((NXT(len) == '<') || (NXT(len) == '>') ||
  ------------------
  |  | 2195|  46.4k|#define NXT(val) ctxt->cur[(val)]
  ------------------
  |  Branch (8800:14): [True: 1.93k, False: 46.4k]
  |  Branch (8800:35): [True: 6.90k, False: 39.5k]
  ------------------
 8801|  39.5k|			   (NXT(len) == '=')) {
  ------------------
  |  | 2195|  39.5k|#define NXT(val) ctxt->cur[(val)]
  ------------------
  |  Branch (8801:7): [True: 7.28k, False: 32.2k]
  ------------------
 8802|  16.1k|		    lc = 1;
 8803|  16.1k|		    break;
 8804|  32.2k|		} else {
 8805|  32.2k|		    lc = 1;
 8806|  32.2k|		    break;
 8807|  32.2k|		}
 8808|   449k|		len++;
 8809|   449k|	    }
 8810|  66.8k|	    if (NXT(len) == 0) {
  ------------------
  |  | 2195|  66.8k|#define NXT(val) ctxt->cur[(val)]
  ------------------
  |  Branch (8810:10): [True: 1.22k, False: 65.6k]
  ------------------
 8811|       |		/* element name */
 8812|  1.22k|		lc = 1;
 8813|  1.22k|	    }
 8814|  66.8k|	    xmlFree(name);
 8815|  66.8k|	} else {
 8816|       |	    /* make sure all cases are covered explicitly */
 8817|  3.39k|	    XP_ERROR(XPATH_EXPR_ERROR);
  ------------------
  |  |  244|  3.39k|    { xmlXPathErr(ctxt, X); return; }
  ------------------
 8818|      0|	}
 8819|  70.9k|    }
 8820|       |
 8821|  1.20M|    if (lc) {
  ------------------
  |  Branch (8821:9): [True: 1.12M, False: 74.0k]
  ------------------
 8822|  1.12M|	if (CUR == '/') {
  ------------------
  |  | 2193|  1.12M|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (8822:6): [True: 76.5k, False: 1.05M]
  ------------------
 8823|  76.5k|	    PUSH_LEAVE_EXPR(XPATH_OP_ROOT, 0, 0);
  ------------------
  |  | 1088|  76.5k|#define PUSH_LEAVE_EXPR(op, val, val2)					\
  |  | 1089|  76.5k|xmlXPathCompExprAdd(ctxt, -1, -1, (op), (val), (val2), 0 ,NULL ,NULL)
  ------------------
 8824|  1.05M|	} else {
 8825|  1.05M|	    PUSH_LEAVE_EXPR(XPATH_OP_NODE, 0, 0);
  ------------------
  |  | 1088|  1.05M|#define PUSH_LEAVE_EXPR(op, val, val2)					\
  |  | 1089|  1.05M|xmlXPathCompExprAdd(ctxt, -1, -1, (op), (val), (val2), 0 ,NULL ,NULL)
  ------------------
 8826|  1.05M|	}
 8827|  1.12M|	xmlXPathCompLocationPath(ctxt);
 8828|  1.12M|    } else {
 8829|  74.0k|	xmlXPathCompFilterExpr(ctxt);
 8830|  74.0k|	CHECK_ERROR;
  ------------------
  |  |  230|  74.0k|    if (ctxt->error != XPATH_EXPRESSION_OK) return
  |  |  ------------------
  |  |  |  Branch (230:9): [True: 2.11k, False: 71.8k]
  |  |  ------------------
  ------------------
 8831|  71.8k|	if ((CUR == '/') && (NXT(1) == '/')) {
  ------------------
  |  | 2193|  71.8k|#define CUR (*ctxt->cur)
  ------------------
              	if ((CUR == '/') && (NXT(1) == '/')) {
  ------------------
  |  | 2195|  2.32k|#define NXT(val) ctxt->cur[(val)]
  ------------------
  |  Branch (8831:6): [True: 2.32k, False: 69.5k]
  |  Branch (8831:22): [True: 754, False: 1.57k]
  ------------------
 8832|    754|	    SKIP(2);
  ------------------
  |  | 2194|    754|#define SKIP(val) ctxt->cur += (val)
  ------------------
 8833|    754|	    SKIP_BLANKS;
  ------------------
  |  | 2199|  2.39k|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  | 2202|  2.39k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2202:15): [True: 2.39k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 8834|       |
 8835|    754|	    PUSH_LONG_EXPR(XPATH_OP_COLLECT, AXIS_DESCENDANT_OR_SELF,
  ------------------
  |  | 1085|    754|    xmlXPathCompExprAdd(ctxt, ctxt->comp->last, -1,		\
  |  | 1086|    754|	                (op), (val), (val2), (val3), (val4), (val5))
  ------------------
 8836|    754|		    NODE_TEST_TYPE, NODE_TYPE_NODE, NULL, NULL);
 8837|       |
 8838|    754|	    xmlXPathCompRelativeLocationPath(ctxt);
 8839|  71.1k|	} else if (CUR == '/') {
  ------------------
  |  | 2193|  71.1k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (8839:13): [True: 1.57k, False: 69.5k]
  ------------------
 8840|  1.57k|	    xmlXPathCompRelativeLocationPath(ctxt);
 8841|  1.57k|	}
 8842|  71.8k|    }
 8843|  1.20M|    SKIP_BLANKS;
  ------------------
  |  | 2199|  1.20M|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  | 2202|  1.20M|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2202:15): [True: 5.22k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 8844|  1.20M|}
xpath.c:xmlXPathScanName:
 8705|  70.9k|xmlXPathScanName(xmlXPathParserContextPtr ctxt) {
 8706|  70.9k|    const xmlChar *end;
 8707|  70.9k|    xmlChar *ret;
 8708|       |
 8709|  70.9k|    end = xmlScanName(ctxt->cur, XML_MAX_NAME_LENGTH, 0);
  ------------------
  |  |   65|  70.9k|#define XML_MAX_NAME_LENGTH 50000
  ------------------
 8710|  70.9k|    if (end == NULL) {
  ------------------
  |  Branch (8710:9): [True: 3, False: 70.9k]
  ------------------
 8711|      3|        XP_ERRORNULL(XPATH_EXPR_ERROR);
  ------------------
  |  |  633|      3|    { xmlXPathErr(ctxt, X); return(NULL); }
  ------------------
 8712|      0|    }
 8713|  70.9k|    if (end == ctxt->cur)
  ------------------
  |  Branch (8713:9): [True: 3.33k, False: 67.5k]
  ------------------
 8714|  3.33k|        return(NULL);
 8715|       |
 8716|  67.5k|    ret = xmlStrndup(ctxt->cur, end - ctxt->cur);
 8717|  67.5k|    if (ret == NULL)
  ------------------
  |  Branch (8717:9): [True: 59, False: 67.5k]
  ------------------
 8718|     59|        xmlXPathPErrMemory(ctxt);
 8719|  67.5k|    return(ret);
 8720|  70.9k|}
xpath.c:xmlXPathCompLocationPath:
 9524|  1.12M|xmlXPathCompLocationPath(xmlXPathParserContextPtr ctxt) {
 9525|  1.12M|    SKIP_BLANKS;
  ------------------
  |  | 2199|  1.12M|    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.12M|    if (CUR != '/') {
  ------------------
  |  | 2193|  1.12M|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (9526:9): [True: 1.05M, False: 76.5k]
  ------------------
 9527|  1.05M|        xmlXPathCompRelativeLocationPath(ctxt);
 9528|  1.05M|    } else {
 9529|   155k|	while (CUR == '/') {
  ------------------
  |  | 2193|   155k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (9529:9): [True: 79.0k, False: 76.0k]
  ------------------
 9530|  79.0k|	    if ((CUR == '/') && (NXT(1) == '/')) {
  ------------------
  |  | 2193|  79.0k|#define CUR (*ctxt->cur)
  ------------------
              	    if ((CUR == '/') && (NXT(1) == '/')) {
  ------------------
  |  | 2195|  79.0k|#define NXT(val) ctxt->cur[(val)]
  ------------------
  |  Branch (9530:10): [True: 79.0k, False: 0]
  |  Branch (9530:26): [True: 10.6k, False: 68.4k]
  ------------------
 9531|  10.6k|		SKIP(2);
  ------------------
  |  | 2194|  10.6k|#define SKIP(val) ctxt->cur += (val)
  ------------------
 9532|  10.6k|		SKIP_BLANKS;
  ------------------
  |  | 2199|  10.6k|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  | 2202|  8.42k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2202:15): [True: 8.42k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 9533|  10.6k|		PUSH_LONG_EXPR(XPATH_OP_COLLECT, AXIS_DESCENDANT_OR_SELF,
  ------------------
  |  | 1085|  10.6k|    xmlXPathCompExprAdd(ctxt, ctxt->comp->last, -1,		\
  |  | 1086|  10.6k|	                (op), (val), (val2), (val3), (val4), (val5))
  ------------------
 9534|  10.6k|			     NODE_TEST_TYPE, NODE_TYPE_NODE, NULL, NULL);
 9535|  10.6k|		xmlXPathCompRelativeLocationPath(ctxt);
 9536|  68.4k|	    } else if (CUR == '/') {
  ------------------
  |  | 2193|  68.4k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (9536:17): [True: 68.4k, False: 0]
  ------------------
 9537|  68.4k|		NEXT;
  ------------------
  |  | 2202|  68.4k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  ------------------
  |  |  |  Branch (2202:15): [True: 68.4k, False: 0]
  |  |  ------------------
  ------------------
 9538|  68.4k|		SKIP_BLANKS;
  ------------------
  |  | 2199|  68.4k|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  | 2202|  30.9k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2202:15): [True: 30.9k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 9539|  68.4k|		if ((CUR != 0) &&
  ------------------
  |  | 2193|  68.4k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (9539:7): [True: 67.7k, False: 682]
  ------------------
 9540|  67.7k|		    ((IS_ASCII_LETTER(CUR)) || (CUR >= 0x80) ||
  ------------------
  |  |  222|  67.7k|#define IS_ASCII_LETTER(c)	((0x61 <= ((c) | 0x20)) && \
  |  |  ------------------
  |  |  |  Branch (222:29): [True: 8.13k, False: 59.6k]
  |  |  ------------------
  |  |  223|  67.7k|                                 (((c) | 0x20) <= 0x7a))
  |  |  ------------------
  |  |  |  Branch (223:34): [True: 6.27k, False: 1.85k]
  |  |  ------------------
  ------------------
              		    ((IS_ASCII_LETTER(CUR)) || (CUR >= 0x80) ||
  ------------------
  |  | 2193|  61.4k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (9540:34): [True: 238, False: 61.2k]
  ------------------
 9541|  61.2k|                     (CUR == '_') || (CUR == '.') ||
  ------------------
  |  | 2193|  61.2k|#define CUR (*ctxt->cur)
  ------------------
                                   (CUR == '_') || (CUR == '.') ||
  ------------------
  |  | 2193|  60.4k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (9541:22): [True: 750, False: 60.4k]
  |  Branch (9541:38): [True: 3.76k, False: 56.7k]
  ------------------
 9542|  56.7k|		     (CUR == '@') || (CUR == '*')))
  ------------------
  |  | 2193|  56.7k|#define CUR (*ctxt->cur)
  ------------------
              		     (CUR == '@') || (CUR == '*')))
  ------------------
  |  | 2193|  56.5k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (9542:8): [True: 143, False: 56.5k]
  |  Branch (9542:24): [True: 51.0k, False: 5.54k]
  ------------------
 9543|  62.1k|		    xmlXPathCompRelativeLocationPath(ctxt);
 9544|  68.4k|	    }
 9545|  79.0k|	    CHECK_ERROR;
  ------------------
  |  |  230|  79.0k|    if (ctxt->error != XPATH_EXPRESSION_OK) return
  |  |  ------------------
  |  |  |  Branch (230:9): [True: 515, False: 78.5k]
  |  |  ------------------
  ------------------
 9546|  79.0k|	}
 9547|  76.5k|    }
 9548|  1.12M|}
xpath.c:xmlXPathCompFilterExpr:
 8683|  74.0k|xmlXPathCompFilterExpr(xmlXPathParserContextPtr ctxt) {
 8684|  74.0k|    xmlXPathCompPrimaryExpr(ctxt);
 8685|  74.0k|    CHECK_ERROR;
  ------------------
  |  |  230|  74.0k|    if (ctxt->error != XPATH_EXPRESSION_OK) return
  |  |  ------------------
  |  |  |  Branch (230:9): [True: 1.56k, False: 72.4k]
  |  |  ------------------
  ------------------
 8686|  72.4k|    SKIP_BLANKS;
  ------------------
  |  | 2199|  72.4k|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  | 2202|  74.0k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2202:15): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 8687|       |
 8688|  80.4k|    while (CUR == '[') {
  ------------------
  |  | 2193|  80.4k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (8688:12): [True: 7.99k, False: 72.4k]
  ------------------
 8689|  7.99k|	xmlXPathCompPredicate(ctxt, 1);
 8690|  7.99k|	SKIP_BLANKS;
  ------------------
  |  | 2199|  7.99k|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  | 2202|      0|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2202:15): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 8691|  7.99k|    }
 8692|       |
 8693|       |
 8694|  72.4k|}
xpath.c:xmlXPathCompPrimaryExpr:
 8645|  74.0k|xmlXPathCompPrimaryExpr(xmlXPathParserContextPtr ctxt) {
 8646|  74.0k|    SKIP_BLANKS;
  ------------------
  |  | 2199|  74.0k|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  | 2202|      0|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2202:15): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 8647|  74.0k|    if (CUR == '$') xmlXPathCompVariableReference(ctxt);
  ------------------
  |  | 2193|  74.0k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (8647:9): [True: 1.43k, False: 72.5k]
  ------------------
 8648|  72.5k|    else if (CUR == '(') {
  ------------------
  |  | 2193|  72.5k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (8648:14): [True: 3.85k, False: 68.7k]
  ------------------
 8649|  3.85k|	NEXT;
  ------------------
  |  | 2202|  3.85k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  ------------------
  |  |  |  Branch (2202:15): [True: 3.85k, False: 0]
  |  |  ------------------
  ------------------
 8650|  3.85k|	SKIP_BLANKS;
  ------------------
  |  | 2199|  4.85k|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  | 2202|  4.85k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2202:15): [True: 4.85k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 8651|  3.85k|	xmlXPathCompileExpr(ctxt, 1);
 8652|  3.85k|	CHECK_ERROR;
  ------------------
  |  |  230|  3.85k|    if (ctxt->error != XPATH_EXPRESSION_OK) return
  |  |  ------------------
  |  |  |  Branch (230:9): [True: 336, False: 3.51k]
  |  |  ------------------
  ------------------
 8653|  3.51k|	if (CUR != ')') {
  ------------------
  |  | 2193|  3.51k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (8653:6): [True: 42, False: 3.47k]
  ------------------
 8654|     42|	    XP_ERROR(XPATH_EXPR_ERROR);
  ------------------
  |  |  244|     42|    { xmlXPathErr(ctxt, X); return; }
  ------------------
 8655|      0|	}
 8656|  3.47k|	NEXT;
  ------------------
  |  | 2202|  3.47k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  ------------------
  |  |  |  Branch (2202:15): [True: 3.47k, False: 0]
  |  |  ------------------
  ------------------
 8657|  3.47k|	SKIP_BLANKS;
  ------------------
  |  | 2199|  14.1k|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  | 2202|  17.6k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2202:15): [True: 14.1k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 8658|  68.7k|    } else if (IS_ASCII_DIGIT(CUR) || (CUR == '.' && IS_ASCII_DIGIT(NXT(1)))) {
  ------------------
  |  |  230|   137k|#define IS_ASCII_DIGIT(c)	((0x30 <= (c)) && ((c) <= 0x39))
  |  |  ------------------
  |  |  |  Branch (230:28): [True: 64.4k, False: 4.25k]
  |  |  |  Branch (230:45): [True: 52.9k, False: 11.5k]
  |  |  ------------------
  ------------------
                  } else if (IS_ASCII_DIGIT(CUR) || (CUR == '.' && IS_ASCII_DIGIT(NXT(1)))) {
  ------------------
  |  | 2193|  15.7k|#define CUR (*ctxt->cur)
  ------------------
                  } else if (IS_ASCII_DIGIT(CUR) || (CUR == '.' && IS_ASCII_DIGIT(NXT(1)))) {
  ------------------
  |  |  230|  2.45k|#define IS_ASCII_DIGIT(c)	((0x30 <= (c)) && ((c) <= 0x39))
  |  |  ------------------
  |  |  |  Branch (230:28): [True: 2.45k, False: 0]
  |  |  |  Branch (230:45): [True: 2.45k, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (8658:40): [True: 2.45k, False: 13.3k]
  ------------------
 8659|  55.4k|	xmlXPathCompNumber(ctxt);
 8660|  55.4k|    } else if ((CUR == '\'') || (CUR == '"')) {
  ------------------
  |  | 2193|  13.3k|#define CUR (*ctxt->cur)
  ------------------
                  } else if ((CUR == '\'') || (CUR == '"')) {
  ------------------
  |  | 2193|  11.6k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (8660:16): [True: 1.68k, False: 11.6k]
  |  Branch (8660:33): [True: 116, False: 11.5k]
  ------------------
 8661|  1.80k|	xmlXPathCompLiteral(ctxt);
 8662|  11.5k|    } else {
 8663|  11.5k|	xmlXPathCompFunctionCall(ctxt);
 8664|  11.5k|    }
 8665|  73.6k|    SKIP_BLANKS;
  ------------------
  |  | 2199|  73.6k|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  | 2202|   135k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2202:15): [True: 61.2k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 8666|  73.6k|}
xpath.c:xmlXPathCompVariableReference:
 8511|  1.43k|xmlXPathCompVariableReference(xmlXPathParserContextPtr ctxt) {
 8512|  1.43k|    xmlChar *name;
 8513|  1.43k|    xmlChar *prefix;
 8514|       |
 8515|  1.43k|    SKIP_BLANKS;
  ------------------
  |  | 2199|  1.43k|    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.43k|    if (CUR != '$') {
  ------------------
  |  | 2193|  1.43k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (8516:9): [True: 0, False: 1.43k]
  ------------------
 8517|      0|	XP_ERROR(XPATH_VARIABLE_REF_ERROR);
  ------------------
  |  |  244|      0|    { xmlXPathErr(ctxt, X); return; }
  ------------------
 8518|      0|    }
 8519|  1.43k|    NEXT;
  ------------------
  |  | 2202|  1.43k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  ------------------
  |  |  |  Branch (2202:15): [True: 1.43k, False: 0]
  |  |  ------------------
  ------------------
 8520|  1.43k|    name = xmlXPathParseQName(ctxt, &prefix);
 8521|  1.43k|    if (name == NULL) {
  ------------------
  |  Branch (8521:9): [True: 52, False: 1.38k]
  ------------------
 8522|     52|        xmlFree(prefix);
 8523|     52|	XP_ERROR(XPATH_VARIABLE_REF_ERROR);
  ------------------
  |  |  244|     52|    { xmlXPathErr(ctxt, X); return; }
  ------------------
 8524|      0|    }
 8525|  1.38k|    ctxt->comp->last = -1;
 8526|  1.38k|    if (PUSH_LONG_EXPR(XPATH_OP_VARIABLE, 0, 0, 0, name, prefix) == -1) {
  ------------------
  |  | 1085|  1.38k|    xmlXPathCompExprAdd(ctxt, ctxt->comp->last, -1,		\
  |  | 1086|  1.38k|	                (op), (val), (val2), (val3), (val4), (val5))
  ------------------
  |  Branch (8526:9): [True: 1, False: 1.37k]
  ------------------
 8527|      1|        xmlFree(prefix);
 8528|      1|        xmlFree(name);
 8529|      1|    }
 8530|  1.38k|    SKIP_BLANKS;
  ------------------
  |  | 2199|  5.74k|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  | 2202|  7.12k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2202:15): [True: 5.74k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 8531|  1.38k|    if ((ctxt->context != NULL) && (ctxt->context->flags & XML_XPATH_NOVAR)) {
  ------------------
  |  |  241|  1.38k|#define XML_XPATH_NOVAR	  (1<<1)
  ------------------
  |  Branch (8531:9): [True: 1.38k, False: 0]
  |  Branch (8531:36): [True: 0, False: 1.38k]
  ------------------
 8532|      0|	XP_ERROR(XPATH_FORBID_VARIABLE_ERROR);
  ------------------
  |  |  244|      0|    { xmlXPathErr(ctxt, X); return; }
  ------------------
 8533|      0|    }
 8534|  1.38k|}
xpath.c:xmlXPathParseQName:
 8178|  12.9k|xmlXPathParseQName(xmlXPathParserContextPtr ctxt, xmlChar **prefix) {
 8179|  12.9k|    xmlChar *ret = NULL;
 8180|       |
 8181|  12.9k|    *prefix = NULL;
 8182|  12.9k|    ret = xmlXPathParseNCName(ctxt);
 8183|  12.9k|    if (ret && CUR == ':') {
  ------------------
  |  | 2193|  12.8k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (8183:9): [True: 12.8k, False: 70]
  |  Branch (8183:16): [True: 836, False: 12.0k]
  ------------------
 8184|    836|        *prefix = ret;
 8185|    836|	NEXT;
  ------------------
  |  | 2202|    836|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  ------------------
  |  |  |  Branch (2202:15): [True: 836, False: 0]
  |  |  ------------------
  ------------------
 8186|    836|	ret = xmlXPathParseNCName(ctxt);
 8187|    836|    }
 8188|  12.9k|    return(ret);
 8189|  12.9k|}
xpath.c:xmlXPathCompNumber:
 8337|  55.4k|{
 8338|  55.4k|    double ret = 0.0;
 8339|  55.4k|    int ok = 0;
 8340|  55.4k|    int exponent = 0;
 8341|  55.4k|    int is_exponent_negative = 0;
 8342|  55.4k|    xmlXPathObjectPtr num;
 8343|  55.4k|#ifdef __GNUC__
 8344|  55.4k|    unsigned long tmp = 0;
 8345|  55.4k|    double temp;
 8346|  55.4k|#endif
 8347|       |
 8348|  55.4k|    CHECK_ERROR;
  ------------------
  |  |  230|  55.4k|    if (ctxt->error != XPATH_EXPRESSION_OK) return
  |  |  ------------------
  |  |  |  Branch (230:9): [True: 45, False: 55.3k]
  |  |  ------------------
  ------------------
 8349|  55.3k|    if ((CUR != '.') && ((CUR < '0') || (CUR > '9'))) {
  ------------------
  |  | 2193|  55.3k|#define CUR (*ctxt->cur)
  ------------------
                  if ((CUR != '.') && ((CUR < '0') || (CUR > '9'))) {
  ------------------
  |  | 2193|  52.9k|#define CUR (*ctxt->cur)
  ------------------
                  if ((CUR != '.') && ((CUR < '0') || (CUR > '9'))) {
  ------------------
  |  | 2193|  52.9k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (8349:9): [True: 52.9k, False: 2.45k]
  |  Branch (8349:26): [True: 0, False: 52.9k]
  |  Branch (8349:41): [True: 0, False: 52.9k]
  ------------------
 8350|      0|        XP_ERROR(XPATH_NUMBER_ERROR);
  ------------------
  |  |  244|      0|    { xmlXPathErr(ctxt, X); return; }
  ------------------
 8351|      0|    }
 8352|  55.3k|#ifdef __GNUC__
 8353|       |    /*
 8354|       |     * tmp/temp is a workaround against a gcc compiler bug
 8355|       |     * http://veillard.com/gcc.bug
 8356|       |     */
 8357|  55.3k|    ret = 0;
 8358|   194k|    while ((CUR >= '0') && (CUR <= '9')) {
  ------------------
  |  | 2193|   194k|#define CUR (*ctxt->cur)
  ------------------
                  while ((CUR >= '0') && (CUR <= '9')) {
  ------------------
  |  | 2193|   162k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (8358:12): [True: 162k, False: 31.5k]
  |  Branch (8358:28): [True: 138k, False: 23.8k]
  ------------------
 8359|   138k|	ret = ret * 10;
 8360|   138k|	tmp = (CUR - '0');
  ------------------
  |  | 2193|   138k|#define CUR (*ctxt->cur)
  ------------------
 8361|   138k|        ok = 1;
 8362|   138k|        NEXT;
  ------------------
  |  | 2202|   138k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  ------------------
  |  |  |  Branch (2202:15): [True: 138k, False: 0]
  |  |  ------------------
  ------------------
 8363|   138k|	temp = (double) tmp;
 8364|   138k|	ret = ret + temp;
 8365|   138k|    }
 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|  55.3k|    if (CUR == '.') {
  ------------------
  |  | 2193|  55.3k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (8374:9): [True: 9.26k, False: 46.0k]
  ------------------
 8375|  9.26k|	int v, frac = 0, max;
 8376|  9.26k|	double fraction = 0;
 8377|       |
 8378|  9.26k|        NEXT;
  ------------------
  |  | 2202|  9.26k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  ------------------
  |  |  |  Branch (2202:15): [True: 9.26k, False: 0]
  |  |  ------------------
  ------------------
 8379|  9.26k|        if (((CUR < '0') || (CUR > '9')) && (!ok)) {
  ------------------
  |  | 2193|  9.26k|#define CUR (*ctxt->cur)
  ------------------
                      if (((CUR < '0') || (CUR > '9')) && (!ok)) {
  ------------------
  |  | 2193|  8.30k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (8379:14): [True: 957, False: 8.30k]
  |  Branch (8379:29): [True: 1.15k, False: 7.15k]
  |  Branch (8379:45): [True: 0, False: 2.10k]
  ------------------
 8380|      0|            XP_ERROR(XPATH_NUMBER_ERROR);
  ------------------
  |  |  244|      0|    { xmlXPathErr(ctxt, X); return; }
  ------------------
 8381|      0|        }
 8382|  13.6k|        while (CUR == '0') {
  ------------------
  |  | 2193|  13.6k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (8382:16): [True: 4.38k, False: 9.26k]
  ------------------
 8383|  4.38k|            frac = frac + 1;
 8384|  4.38k|            NEXT;
  ------------------
  |  | 2202|  4.38k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  ------------------
  |  |  |  Branch (2202:15): [True: 4.38k, False: 0]
  |  |  ------------------
  ------------------
 8385|  4.38k|        }
 8386|  9.26k|        max = frac + MAX_FRAC;
  ------------------
  |  | 8219|  9.26k|#define MAX_FRAC 20
  ------------------
 8387|  27.9k|        while ((CUR >= '0') && (CUR <= '9') && (frac < max)) {
  ------------------
  |  | 2193|  27.9k|#define CUR (*ctxt->cur)
  ------------------
                      while ((CUR >= '0') && (CUR <= '9') && (frac < max)) {
  ------------------
  |  | 2193|  25.3k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (8387:16): [True: 25.3k, False: 2.64k]
  |  Branch (8387:32): [True: 18.7k, False: 6.56k]
  |  Branch (8387:48): [True: 18.7k, False: 53]
  ------------------
 8388|  18.7k|	    v = (CUR - '0');
  ------------------
  |  | 2193|  18.7k|#define CUR (*ctxt->cur)
  ------------------
 8389|  18.7k|	    fraction = fraction * 10 + v;
 8390|  18.7k|	    frac = frac + 1;
 8391|  18.7k|            NEXT;
  ------------------
  |  | 2202|  18.7k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  ------------------
  |  |  |  Branch (2202:15): [True: 18.7k, False: 0]
  |  |  ------------------
  ------------------
 8392|  18.7k|        }
 8393|  9.26k|        fraction /= pow(10.0, frac);
 8394|  9.26k|        ret = ret + fraction;
 8395|  9.90k|        while ((CUR >= '0') && (CUR <= '9'))
  ------------------
  |  | 2193|  9.90k|#define CUR (*ctxt->cur)
  ------------------
                      while ((CUR >= '0') && (CUR <= '9'))
  ------------------
  |  | 2193|  7.20k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (8395:16): [True: 7.20k, False: 2.69k]
  |  Branch (8395:32): [True: 641, False: 6.56k]
  ------------------
 8396|    641|            NEXT;
  ------------------
  |  | 2202|  9.90k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  ------------------
  |  |  |  Branch (2202:15): [True: 641, False: 0]
  |  |  ------------------
  ------------------
 8397|  9.26k|    }
 8398|  55.3k|    if ((CUR == 'e') || (CUR == 'E')) {
  ------------------
  |  | 2193|  55.3k|#define CUR (*ctxt->cur)
  ------------------
                  if ((CUR == 'e') || (CUR == 'E')) {
  ------------------
  |  | 2193|  54.5k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (8398:9): [True: 781, False: 54.5k]
  |  Branch (8398:25): [True: 8.11k, False: 46.4k]
  ------------------
 8399|  8.89k|        NEXT;
  ------------------
  |  | 2202|  8.89k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  ------------------
  |  |  |  Branch (2202:15): [True: 8.89k, False: 0]
  |  |  ------------------
  ------------------
 8400|  8.89k|        if (CUR == '-') {
  ------------------
  |  | 2193|  8.89k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (8400:13): [True: 585, False: 8.30k]
  ------------------
 8401|    585|            is_exponent_negative = 1;
 8402|    585|            NEXT;
  ------------------
  |  | 2202|    585|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  ------------------
  |  |  |  Branch (2202:15): [True: 585, False: 0]
  |  |  ------------------
  ------------------
 8403|  8.30k|        } else if (CUR == '+') {
  ------------------
  |  | 2193|  8.30k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (8403:20): [True: 756, False: 7.55k]
  ------------------
 8404|    756|	    NEXT;
  ------------------
  |  | 2202|    756|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  ------------------
  |  |  |  Branch (2202:15): [True: 756, False: 0]
  |  |  ------------------
  ------------------
 8405|    756|	}
 8406|  66.8k|        while ((CUR >= '0') && (CUR <= '9')) {
  ------------------
  |  | 2193|  66.8k|#define CUR (*ctxt->cur)
  ------------------
                      while ((CUR >= '0') && (CUR <= '9')) {
  ------------------
  |  | 2193|  63.5k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (8406:16): [True: 63.5k, False: 3.35k]
  |  Branch (8406:32): [True: 57.9k, False: 5.54k]
  ------------------
 8407|  57.9k|            if (exponent < 1000000)
  ------------------
  |  Branch (8407:17): [True: 45.3k, False: 12.6k]
  ------------------
 8408|  45.3k|                exponent = exponent * 10 + (CUR - '0');
  ------------------
  |  | 2193|  45.3k|#define CUR (*ctxt->cur)
  ------------------
 8409|  57.9k|            NEXT;
  ------------------
  |  | 2202|  57.9k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  ------------------
  |  |  |  Branch (2202:15): [True: 57.9k, False: 0]
  |  |  ------------------
  ------------------
 8410|  57.9k|        }
 8411|  8.89k|        if (is_exponent_negative)
  ------------------
  |  Branch (8411:13): [True: 585, False: 8.30k]
  ------------------
 8412|    585|            exponent = -exponent;
 8413|  8.89k|        ret *= pow(10.0, (double) exponent);
 8414|  8.89k|    }
 8415|  55.3k|    num = xmlXPathCacheNewFloat(ctxt, ret);
 8416|  55.3k|    if (num == NULL) {
  ------------------
  |  Branch (8416:9): [True: 52, False: 55.3k]
  ------------------
 8417|     52|	ctxt->error = XPATH_MEMORY_ERROR;
 8418|  55.3k|    } else if (PUSH_LONG_EXPR(XPATH_OP_VALUE, XPATH_NUMBER, 0, 0, num,
  ------------------
  |  | 1085|  55.3k|    xmlXPathCompExprAdd(ctxt, ctxt->comp->last, -1,		\
  |  | 1086|  55.3k|	                (op), (val), (val2), (val3), (val4), (val5))
  ------------------
  |  Branch (8418:16): [True: 13, False: 55.2k]
  ------------------
 8419|  55.3k|                              NULL) == -1) {
 8420|     13|        xmlXPathReleaseObject(ctxt->context, num);
 8421|     13|    }
 8422|  55.3k|}
xpath.c:xmlXPathCompLiteral:
 8478|  1.80k|xmlXPathCompLiteral(xmlXPathParserContextPtr ctxt) {
 8479|  1.80k|    xmlChar *ret = NULL;
 8480|  1.80k|    xmlXPathObjectPtr lit;
 8481|       |
 8482|  1.80k|    ret = xmlXPathParseLiteral(ctxt);
 8483|  1.80k|    if (ret == NULL)
  ------------------
  |  Branch (8483:9): [True: 149, False: 1.65k]
  ------------------
 8484|    149|        return;
 8485|  1.65k|    lit = xmlXPathCacheNewString(ctxt, ret);
 8486|  1.65k|    if (lit == NULL) {
  ------------------
  |  Branch (8486:9): [True: 6, False: 1.64k]
  ------------------
 8487|      6|        ctxt->error = XPATH_MEMORY_ERROR;
 8488|  1.64k|    } else if (PUSH_LONG_EXPR(XPATH_OP_VALUE, XPATH_STRING, 0, 0, lit,
  ------------------
  |  | 1085|  1.64k|    xmlXPathCompExprAdd(ctxt, ctxt->comp->last, -1,		\
  |  | 1086|  1.64k|	                (op), (val), (val2), (val3), (val4), (val5))
  ------------------
  |  Branch (8488:16): [True: 2, False: 1.64k]
  ------------------
 8489|  1.64k|                              NULL) == -1) {
 8490|      2|        xmlXPathReleaseObject(ctxt->context, lit);
 8491|      2|    }
 8492|  1.65k|    xmlFree(ret);
 8493|  1.65k|}
xpath.c:xmlXPathParseLiteral:
 8434|  1.92k|xmlXPathParseLiteral(xmlXPathParserContextPtr ctxt) {
 8435|  1.92k|    const xmlChar *q;
 8436|  1.92k|    xmlChar *ret = NULL;
 8437|  1.92k|    int quote;
 8438|       |
 8439|  1.92k|    if (CUR == '"') {
  ------------------
  |  | 2193|  1.92k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (8439:9): [True: 116, False: 1.81k]
  ------------------
 8440|    116|        quote = '"';
 8441|  1.81k|    } else if (CUR == '\'') {
  ------------------
  |  | 2193|  1.81k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (8441:16): [True: 1.80k, False: 9]
  ------------------
 8442|  1.80k|        quote = '\'';
 8443|  1.80k|    } else {
 8444|      9|	XP_ERRORNULL(XPATH_START_LITERAL_ERROR);
  ------------------
  |  |  633|      9|    { xmlXPathErr(ctxt, X); return(NULL); }
  ------------------
 8445|      0|    }
 8446|       |
 8447|  1.92k|    NEXT;
  ------------------
  |  | 2202|  1.92k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  ------------------
  |  |  |  Branch (2202:15): [True: 1.92k, False: 0]
  |  |  ------------------
  ------------------
 8448|  1.92k|    q = CUR_PTR;
  ------------------
  |  | 2196|  1.92k|#define CUR_PTR ctxt->cur
  ------------------
 8449|  15.3k|    while (CUR != quote) {
  ------------------
  |  | 2193|  15.3k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (8449:12): [True: 13.5k, False: 1.77k]
  ------------------
 8450|  13.5k|        int ch;
 8451|  13.5k|        int len = 4;
 8452|       |
 8453|  13.5k|        if (CUR == 0)
  ------------------
  |  | 2193|  13.5k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (8453:13): [True: 129, False: 13.4k]
  ------------------
 8454|  13.4k|            XP_ERRORNULL(XPATH_UNFINISHED_LITERAL_ERROR);
  ------------------
  |  |  633|    129|    { xmlXPathErr(ctxt, X); return(NULL); }
  ------------------
 8455|  13.4k|        ch = xmlGetUTF8Char(CUR_PTR, &len);
  ------------------
  |  | 2196|  13.4k|#define CUR_PTR ctxt->cur
  ------------------
 8456|  13.4k|        if ((ch < 0) || (IS_CHAR(ch) == 0))
  ------------------
  |  |  115|  13.4k|#define IS_CHAR(c)   xmlIsCharQ(c)
  |  |  ------------------
  |  |  |  |  117|  13.4k|#define xmlIsCharQ(c)		(((c) < 0x100) ? \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (117:25): [True: 12.9k, False: 464]
  |  |  |  |  ------------------
  |  |  |  |  118|  13.4k|				 xmlIsChar_ch((c)) :\
  |  |  |  |  ------------------
  |  |  |  |  |  |  108|  12.9k|#define xmlIsChar_ch(c)		(((0x9 <= (c)) && ((c) <= 0xa)) || \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (108:28): [True: 12.9k, False: 10]
  |  |  |  |  |  |  |  Branch (108:44): [True: 234, False: 12.7k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  109|  12.9k|				 ((c) == 0xd) || \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (109:6): [True: 124, False: 12.6k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  110|  12.9k|				  (0x20 <= (c)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (110:7): [True: 12.6k, False: 10]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  119|  13.4k|				(((0x100 <= (c)) && ((c) <= 0xd7ff)) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (119:7): [True: 464, False: 0]
  |  |  |  |  |  Branch (119:25): [True: 283, False: 181]
  |  |  |  |  ------------------
  |  |  |  |  120|    464|				 ((0xe000 <= (c)) && ((c) <= 0xfffd)) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (120:7): [True: 181, False: 0]
  |  |  |  |  |  Branch (120:26): [True: 90, False: 91]
  |  |  |  |  ------------------
  |  |  |  |  121|    464|				 ((0x10000 <= (c)) && ((c) <= 0x10ffff))))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (121:7): [True: 91, False: 0]
  |  |  |  |  |  Branch (121:27): [True: 91, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (8456:13): [True: 3, False: 13.4k]
  |  Branch (8456:25): [True: 10, False: 13.4k]
  ------------------
 8457|  13.4k|            XP_ERRORNULL(XPATH_INVALID_CHAR_ERROR);
  ------------------
  |  |  633|     13|    { xmlXPathErr(ctxt, X); return(NULL); }
  ------------------
 8458|  13.4k|        CUR_PTR += len;
  ------------------
  |  | 2196|  13.4k|#define CUR_PTR ctxt->cur
  ------------------
 8459|  13.4k|    }
 8460|  1.77k|    ret = xmlStrndup(q, CUR_PTR - q);
  ------------------
  |  | 2196|  1.77k|#define CUR_PTR ctxt->cur
  ------------------
 8461|  1.77k|    if (ret == NULL)
  ------------------
  |  Branch (8461:9): [True: 10, False: 1.76k]
  ------------------
 8462|     10|        xmlXPathPErrMemory(ctxt);
 8463|  1.77k|    NEXT;
  ------------------
  |  | 2202|  1.77k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  ------------------
  |  |  |  Branch (2202:15): [True: 1.77k, False: 0]
  |  |  ------------------
  ------------------
 8464|  1.77k|    return(ret);
 8465|  1.92k|}
xpath.c:xmlXPathCompFunctionCall:
 8573|  11.5k|xmlXPathCompFunctionCall(xmlXPathParserContextPtr ctxt) {
 8574|  11.5k|    xmlChar *name;
 8575|  11.5k|    xmlChar *prefix;
 8576|  11.5k|    int nbargs = 0;
 8577|  11.5k|    int sort = 1;
 8578|       |
 8579|  11.5k|    name = xmlXPathParseQName(ctxt, &prefix);
 8580|  11.5k|    if (name == NULL) {
  ------------------
  |  Branch (8580:9): [True: 18, False: 11.4k]
  ------------------
 8581|     18|	xmlFree(prefix);
 8582|     18|	XP_ERROR(XPATH_EXPR_ERROR);
  ------------------
  |  |  244|     18|    { xmlXPathErr(ctxt, X); return; }
  ------------------
 8583|      0|    }
 8584|  11.4k|    SKIP_BLANKS;
  ------------------
  |  | 2199|   295k|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  | 2202|   306k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2202:15): [True: 295k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 8585|       |
 8586|  11.4k|    if (CUR != '(') {
  ------------------
  |  | 2193|  11.4k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (8586:9): [True: 6, False: 11.4k]
  ------------------
 8587|      6|	xmlFree(name);
 8588|      6|	xmlFree(prefix);
 8589|      6|	XP_ERROR(XPATH_EXPR_ERROR);
  ------------------
  |  |  244|      6|    { xmlXPathErr(ctxt, X); return; }
  ------------------
 8590|      0|    }
 8591|  11.4k|    NEXT;
  ------------------
  |  | 2202|  11.4k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  ------------------
  |  |  |  Branch (2202:15): [True: 11.4k, False: 0]
  |  |  ------------------
  ------------------
 8592|  11.4k|    SKIP_BLANKS;
  ------------------
  |  | 2199|   102k|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  | 2202|   113k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2202:15): [True: 102k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 8593|       |
 8594|       |    /*
 8595|       |    * Optimization for count(): we don't need the node-set to be sorted.
 8596|       |    */
 8597|  11.4k|    if ((prefix == NULL) && (name[0] == 'c') &&
  ------------------
  |  Branch (8597:9): [True: 10.9k, False: 492]
  |  Branch (8597:29): [True: 1.19k, False: 9.79k]
  ------------------
 8598|  1.19k|	xmlStrEqual(name, BAD_CAST "count"))
  ------------------
  |  |   34|  1.19k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (8598:2): [True: 52, False: 1.14k]
  ------------------
 8599|     52|    {
 8600|     52|	sort = 0;
 8601|     52|    }
 8602|  11.4k|    ctxt->comp->last = -1;
 8603|  11.4k|    if (CUR != ')') {
  ------------------
  |  | 2193|  11.4k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (8603:9): [True: 9.33k, False: 2.15k]
  ------------------
 8604|  14.8k|	while (CUR != 0) {
  ------------------
  |  | 2193|  14.8k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (8604:9): [True: 14.8k, False: 3]
  ------------------
 8605|  14.8k|	    int op1 = ctxt->comp->last;
 8606|  14.8k|	    ctxt->comp->last = -1;
 8607|  14.8k|	    xmlXPathCompileExpr(ctxt, sort);
 8608|  14.8k|	    if (ctxt->error != XPATH_EXPRESSION_OK) {
  ------------------
  |  Branch (8608:10): [True: 723, False: 14.1k]
  ------------------
 8609|    723|		xmlFree(name);
 8610|    723|		xmlFree(prefix);
 8611|    723|		return;
 8612|    723|	    }
 8613|  14.1k|	    PUSH_BINARY_EXPR(XPATH_OP_ARG, op1, ctxt->comp->last, 0, 0);
  ------------------
  |  | 1094|  14.1k|#define PUSH_BINARY_EXPR(op, ch1, ch2, val, val2)			\
  |  | 1095|  14.1k|xmlXPathCompExprAdd(ctxt, (ch1), (ch2), (op),			\
  |  | 1096|  14.1k|			(val), (val2), 0 ,NULL ,NULL)
  ------------------
 8614|  14.1k|	    nbargs++;
 8615|  14.1k|	    if (CUR == ')') break;
  ------------------
  |  | 2193|  14.1k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (8615:10): [True: 8.50k, False: 5.60k]
  ------------------
 8616|  5.60k|	    if (CUR != ',') {
  ------------------
  |  | 2193|  5.60k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (8616:10): [True: 104, False: 5.49k]
  ------------------
 8617|    104|		xmlFree(name);
 8618|    104|		xmlFree(prefix);
 8619|    104|		XP_ERROR(XPATH_EXPR_ERROR);
  ------------------
  |  |  244|    104|    { xmlXPathErr(ctxt, X); return; }
  ------------------
 8620|      0|	    }
 8621|  5.49k|	    NEXT;
  ------------------
  |  | 2202|  5.49k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  ------------------
  |  |  |  Branch (2202:15): [True: 5.49k, False: 0]
  |  |  ------------------
  ------------------
 8622|  5.49k|	    SKIP_BLANKS;
  ------------------
  |  | 2199|  5.49k|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  | 2202|  9.09k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2202:15): [True: 3.59k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 8623|  5.49k|	}
 8624|  9.33k|    }
 8625|  10.6k|    if (PUSH_LONG_EXPR(XPATH_OP_FUNCTION, nbargs, 0, 0, name, prefix) == -1) {
  ------------------
  |  | 1085|  10.6k|    xmlXPathCompExprAdd(ctxt, ctxt->comp->last, -1,		\
  |  | 1086|  10.6k|	                (op), (val), (val2), (val3), (val4), (val5))
  ------------------
  |  Branch (8625:9): [True: 2, False: 10.6k]
  ------------------
 8626|      2|        xmlFree(prefix);
 8627|      2|        xmlFree(name);
 8628|      2|    }
 8629|  10.6k|    NEXT;
  ------------------
  |  | 2202|  10.6k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  ------------------
  |  |  |  Branch (2202:15): [True: 10.6k, False: 3]
  |  |  ------------------
  ------------------
 8630|  10.6k|    SKIP_BLANKS;
  ------------------
  |  | 2199|   106k|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  | 2202|   116k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2202:15): [True: 106k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 8631|  10.6k|}
xpath.c:xmlXPathCompPredicate:
 9137|  18.1k|xmlXPathCompPredicate(xmlXPathParserContextPtr ctxt, int filter) {
 9138|  18.1k|    int op1 = ctxt->comp->last;
 9139|       |
 9140|  18.1k|    SKIP_BLANKS;
  ------------------
  |  | 2199|  18.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|  18.1k|    if (CUR != '[') {
  ------------------
  |  | 2193|  18.1k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (9141:9): [True: 0, False: 18.1k]
  ------------------
 9142|      0|	XP_ERROR(XPATH_INVALID_PREDICATE_ERROR);
  ------------------
  |  |  244|      0|    { xmlXPathErr(ctxt, X); return; }
  ------------------
 9143|      0|    }
 9144|  18.1k|    NEXT;
  ------------------
  |  | 2202|  18.1k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  ------------------
  |  |  |  Branch (2202:15): [True: 18.1k, False: 0]
  |  |  ------------------
  ------------------
 9145|  18.1k|    SKIP_BLANKS;
  ------------------
  |  | 2199|  18.1k|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  | 2202|  32.4k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2202:15): [True: 14.3k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 9146|       |
 9147|  18.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|  18.1k|    if (! filter)
  ------------------
  |  Branch (9157:9): [True: 10.1k, False: 7.99k]
  ------------------
 9158|  10.1k|	xmlXPathCompileExpr(ctxt, 0);
 9159|  7.99k|    else
 9160|  7.99k|	xmlXPathCompileExpr(ctxt, 1);
 9161|  18.1k|    CHECK_ERROR;
  ------------------
  |  |  230|  18.1k|    if (ctxt->error != XPATH_EXPRESSION_OK) return
  |  |  ------------------
  |  |  |  Branch (230:9): [True: 3.04k, False: 15.0k]
  |  |  ------------------
  ------------------
 9162|       |
 9163|  15.0k|    if (CUR != ']') {
  ------------------
  |  | 2193|  15.0k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (9163:9): [True: 247, False: 14.8k]
  ------------------
 9164|    247|	XP_ERROR(XPATH_INVALID_PREDICATE_ERROR);
  ------------------
  |  |  244|    247|    { xmlXPathErr(ctxt, X); return; }
  ------------------
 9165|      0|    }
 9166|       |
 9167|  14.8k|    if (filter)
  ------------------
  |  Branch (9167:9): [True: 7.05k, False: 7.78k]
  ------------------
 9168|  7.05k|	PUSH_BINARY_EXPR(XPATH_OP_FILTER, op1, ctxt->comp->last, 0, 0);
  ------------------
  |  | 1094|  7.05k|#define PUSH_BINARY_EXPR(op, ch1, ch2, val, val2)			\
  |  | 1095|  7.05k|xmlXPathCompExprAdd(ctxt, (ch1), (ch2), (op),			\
  |  | 1096|  7.05k|			(val), (val2), 0 ,NULL ,NULL)
  ------------------
 9169|  7.78k|    else
 9170|  7.78k|	PUSH_BINARY_EXPR(XPATH_OP_PREDICATE, op1, ctxt->comp->last, 0, 0);
  ------------------
  |  | 1094|  7.78k|#define PUSH_BINARY_EXPR(op, ch1, ch2, val, val2)			\
  |  | 1095|  7.78k|xmlXPathCompExprAdd(ctxt, (ch1), (ch2), (op),			\
  |  | 1096|  7.78k|			(val), (val2), 0 ,NULL ,NULL)
  ------------------
 9171|       |
 9172|  14.8k|    NEXT;
  ------------------
  |  | 2202|  14.8k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  ------------------
  |  |  |  Branch (2202:15): [True: 14.8k, False: 0]
  |  |  ------------------
  ------------------
 9173|  14.8k|    SKIP_BLANKS;
  ------------------
  |  | 2199|  18.9k|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  | 2202|  33.8k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2202:15): [True: 18.9k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 9174|  14.8k|}
xpath.c:xmlXPathCompRelativeLocationPath:
 9481|  1.12M|(xmlXPathParserContextPtr ctxt) {
 9482|  1.12M|    SKIP_BLANKS;
  ------------------
  |  | 2199|  1.12M|    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.12M|    if ((CUR == '/') && (NXT(1) == '/')) {
  ------------------
  |  | 2193|  1.12M|#define CUR (*ctxt->cur)
  ------------------
                  if ((CUR == '/') && (NXT(1) == '/')) {
  ------------------
  |  | 2195|  7.57k|#define NXT(val) ctxt->cur[(val)]
  ------------------
  |  Branch (9483:9): [True: 7.57k, False: 1.11M]
  |  Branch (9483:25): [True: 3.01k, False: 4.56k]
  ------------------
 9484|  3.01k|	SKIP(2);
  ------------------
  |  | 2194|  3.01k|#define SKIP(val) ctxt->cur += (val)
  ------------------
 9485|  3.01k|	SKIP_BLANKS;
  ------------------
  |  | 2199|  9.62k|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  | 2202|  9.62k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2202:15): [True: 9.62k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 9486|  3.01k|	PUSH_LONG_EXPR(XPATH_OP_COLLECT, AXIS_DESCENDANT_OR_SELF,
  ------------------
  |  | 1085|  3.01k|    xmlXPathCompExprAdd(ctxt, ctxt->comp->last, -1,		\
  |  | 1086|  3.01k|	                (op), (val), (val2), (val3), (val4), (val5))
  ------------------
 9487|  3.01k|		         NODE_TEST_TYPE, NODE_TYPE_NODE, NULL, NULL);
 9488|  1.12M|    } else if (CUR == '/') {
  ------------------
  |  | 2193|  1.12M|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (9488:16): [True: 4.56k, False: 1.11M]
  ------------------
 9489|  4.56k|	    NEXT;
  ------------------
  |  | 2202|  4.56k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  ------------------
  |  |  |  Branch (2202:15): [True: 4.56k, False: 0]
  |  |  ------------------
  ------------------
 9490|  4.56k|	SKIP_BLANKS;
  ------------------
  |  | 2199|  12.5k|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  | 2202|  12.5k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2202:15): [True: 12.5k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 9491|  4.56k|    }
 9492|  1.12M|    xmlXPathCompStep(ctxt);
 9493|  1.12M|    CHECK_ERROR;
  ------------------
  |  |  230|  1.12M|    if (ctxt->error != XPATH_EXPRESSION_OK) return
  |  |  ------------------
  |  |  |  Branch (230:9): [True: 1.38k, False: 1.12M]
  |  |  ------------------
  ------------------
 9494|  1.12M|    SKIP_BLANKS;
  ------------------
  |  | 2199|  1.12M|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  | 2202|  1.12M|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2202:15): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 9495|  1.14M|    while (CUR == '/') {
  ------------------
  |  | 2193|  1.14M|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (9495:12): [True: 17.7k, False: 1.12M]
  ------------------
 9496|  17.7k|	if ((CUR == '/') && (NXT(1) == '/')) {
  ------------------
  |  | 2193|  17.7k|#define CUR (*ctxt->cur)
  ------------------
              	if ((CUR == '/') && (NXT(1) == '/')) {
  ------------------
  |  | 2195|  17.7k|#define NXT(val) ctxt->cur[(val)]
  ------------------
  |  Branch (9496:6): [True: 17.7k, False: 0]
  |  Branch (9496:22): [True: 5.29k, False: 12.4k]
  ------------------
 9497|  5.29k|	    SKIP(2);
  ------------------
  |  | 2194|  5.29k|#define SKIP(val) ctxt->cur += (val)
  ------------------
 9498|  5.29k|	    SKIP_BLANKS;
  ------------------
  |  | 2199|  7.94k|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  | 2202|  7.94k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2202:15): [True: 7.94k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 9499|  5.29k|	    PUSH_LONG_EXPR(XPATH_OP_COLLECT, AXIS_DESCENDANT_OR_SELF,
  ------------------
  |  | 1085|  5.29k|    xmlXPathCompExprAdd(ctxt, ctxt->comp->last, -1,		\
  |  | 1086|  5.29k|	                (op), (val), (val2), (val3), (val4), (val5))
  ------------------
 9500|  5.29k|			     NODE_TEST_TYPE, NODE_TYPE_NODE, NULL, NULL);
 9501|  5.29k|	    xmlXPathCompStep(ctxt);
 9502|  12.4k|	} else if (CUR == '/') {
  ------------------
  |  | 2193|  12.4k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (9502:13): [True: 12.4k, False: 0]
  ------------------
 9503|  12.4k|	    NEXT;
  ------------------
  |  | 2202|  12.4k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  ------------------
  |  |  |  Branch (2202:15): [True: 12.4k, False: 0]
  |  |  ------------------
  ------------------
 9504|  12.4k|	    SKIP_BLANKS;
  ------------------
  |  | 2199|  12.4k|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  | 2202|  7.03k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2202:15): [True: 7.03k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 9505|  12.4k|	    xmlXPathCompStep(ctxt);
 9506|  12.4k|	}
 9507|  17.7k|	SKIP_BLANKS;
  ------------------
  |  | 2199|  17.7k|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  | 2202|  2.25k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2202:15): [True: 2.25k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 9508|  17.7k|    }
 9509|  1.12M|}
xpath.c:xmlXPathCompStep:
 9390|  1.14M|xmlXPathCompStep(xmlXPathParserContextPtr ctxt) {
 9391|  1.14M|    SKIP_BLANKS;
  ------------------
  |  | 2199|  1.14M|    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.14M|    if ((CUR == '.') && (NXT(1) == '.')) {
  ------------------
  |  | 2193|  1.14M|#define CUR (*ctxt->cur)
  ------------------
                  if ((CUR == '.') && (NXT(1) == '.')) {
  ------------------
  |  | 2195|  22.9k|#define NXT(val) ctxt->cur[(val)]
  ------------------
  |  Branch (9392:9): [True: 22.9k, False: 1.12M]
  |  Branch (9392:25): [True: 5.86k, False: 17.0k]
  ------------------
 9393|  5.86k|	SKIP(2);
  ------------------
  |  | 2194|  5.86k|#define SKIP(val) ctxt->cur += (val)
  ------------------
 9394|  5.86k|	SKIP_BLANKS;
  ------------------
  |  | 2199|  5.86k|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  | 2202|  1.12k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2202:15): [True: 1.12k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 9395|  5.86k|	PUSH_LONG_EXPR(XPATH_OP_COLLECT, AXIS_PARENT,
  ------------------
  |  | 1085|  5.86k|    xmlXPathCompExprAdd(ctxt, ctxt->comp->last, -1,		\
  |  | 1086|  5.86k|	                (op), (val), (val2), (val3), (val4), (val5))
  ------------------
 9396|  5.86k|		    NODE_TEST_TYPE, NODE_TYPE_NODE, NULL, NULL);
 9397|  1.13M|    } else if (CUR == '.') {
  ------------------
  |  | 2193|  1.13M|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (9397:16): [True: 17.0k, False: 1.12M]
  ------------------
 9398|  17.0k|	NEXT;
  ------------------
  |  | 2202|  17.0k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  ------------------
  |  |  |  Branch (2202:15): [True: 17.0k, False: 0]
  |  |  ------------------
  ------------------
 9399|  17.0k|	SKIP_BLANKS;
  ------------------
  |  | 2199|  17.0k|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  | 2202|  8.18k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2202:15): [True: 8.18k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 9400|  1.12M|    } else {
 9401|  1.12M|	xmlChar *name = NULL;
 9402|  1.12M|	xmlChar *prefix = NULL;
 9403|  1.12M|	xmlXPathTestVal test = (xmlXPathTestVal) 0;
 9404|  1.12M|	xmlXPathAxisVal axis = (xmlXPathAxisVal) 0;
 9405|  1.12M|	xmlXPathTypeVal type = (xmlXPathTypeVal) 0;
 9406|  1.12M|	int op1;
 9407|       |
 9408|  1.12M|	if (CUR == '*') {
  ------------------
  |  | 2193|  1.12M|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (9408:6): [True: 1.04M, False: 78.0k]
  ------------------
 9409|  1.04M|	    axis = AXIS_CHILD;
 9410|  1.04M|	} else {
 9411|  78.0k|	    if (name == NULL)
  ------------------
  |  Branch (9411:10): [True: 78.0k, False: 0]
  ------------------
 9412|  78.0k|		name = xmlXPathParseNCName(ctxt);
 9413|  78.0k|	    if (name != NULL) {
  ------------------
  |  Branch (9413:10): [True: 73.2k, False: 4.82k]
  ------------------
 9414|  73.2k|		axis = xmlXPathIsAxisName(name);
 9415|  73.2k|		if (axis != 0) {
  ------------------
  |  Branch (9415:7): [True: 4.46k, False: 68.7k]
  ------------------
 9416|  4.46k|		    SKIP_BLANKS;
  ------------------
  |  | 2199|  54.3k|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  | 2202|  54.3k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2202:15): [True: 54.3k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 9417|  4.46k|		    if ((CUR == ':') && (NXT(1) == ':')) {
  ------------------
  |  | 2193|  4.46k|#define CUR (*ctxt->cur)
  ------------------
              		    if ((CUR == ':') && (NXT(1) == ':')) {
  ------------------
  |  | 2195|  2.65k|#define NXT(val) ctxt->cur[(val)]
  ------------------
  |  Branch (9417:11): [True: 2.65k, False: 1.81k]
  |  Branch (9417:27): [True: 2.20k, False: 445]
  ------------------
 9418|  2.20k|			SKIP(2);
  ------------------
  |  | 2194|  2.20k|#define SKIP(val) ctxt->cur += (val)
  ------------------
 9419|  2.20k|			xmlFree(name);
 9420|  2.20k|			name = NULL;
 9421|  2.25k|		    } else {
 9422|       |			/* an element name can conflict with an axis one :-\ */
 9423|  2.25k|			axis = AXIS_CHILD;
 9424|  2.25k|		    }
 9425|  68.7k|		} else {
 9426|  68.7k|		    axis = AXIS_CHILD;
 9427|  68.7k|		}
 9428|  73.2k|	    } else if (CUR == '@') {
  ------------------
  |  | 2193|  4.82k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (9428:17): [True: 4.00k, False: 820]
  ------------------
 9429|  4.00k|		NEXT;
  ------------------
  |  | 2202|  4.00k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  ------------------
  |  |  |  Branch (2202:15): [True: 4.00k, False: 0]
  |  |  ------------------
  ------------------
 9430|  4.00k|		axis = AXIS_ATTRIBUTE;
 9431|  4.00k|	    } else {
 9432|    820|		axis = AXIS_CHILD;
 9433|    820|	    }
 9434|  78.0k|	}
 9435|       |
 9436|  1.12M|        if (ctxt->error != XPATH_EXPRESSION_OK) {
  ------------------
  |  Branch (9436:13): [True: 1.08k, False: 1.12M]
  ------------------
 9437|  1.08k|            xmlFree(name);
 9438|  1.08k|            return;
 9439|  1.08k|        }
 9440|       |
 9441|  1.12M|	name = xmlXPathCompNodeTest(ctxt, &test, &type, &prefix, name);
 9442|  1.12M|	if (test == 0)
  ------------------
  |  Branch (9442:6): [True: 440, False: 1.12M]
  ------------------
 9443|    440|	    return;
 9444|       |
 9445|  1.12M|        if ((prefix != NULL) && (ctxt->context != NULL) &&
  ------------------
  |  Branch (9445:13): [True: 3.05k, False: 1.11M]
  |  Branch (9445:33): [True: 3.05k, False: 0]
  ------------------
 9446|  3.05k|	    (ctxt->context->flags & XML_XPATH_CHECKNS)) {
  ------------------
  |  |  237|  3.05k|#define XML_XPATH_CHECKNS (1<<0)
  ------------------
  |  Branch (9446:6): [True: 0, False: 3.05k]
  ------------------
 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.12M|	op1 = ctxt->comp->last;
 9454|  1.12M|	ctxt->comp->last = -1;
 9455|       |
 9456|  1.12M|	SKIP_BLANKS;
  ------------------
  |  | 2199|  1.12M|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  | 2202|  1.13M|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2202:15): [True: 12.3k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 9457|  1.13M|	while (CUR == '[') {
  ------------------
  |  | 2193|  1.13M|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (9457:9): [True: 10.1k, False: 1.12M]
  ------------------
 9458|  10.1k|	    xmlXPathCompPredicate(ctxt, 0);
 9459|  10.1k|	}
 9460|       |
 9461|  1.12M|        if (PUSH_FULL_EXPR(XPATH_OP_COLLECT, op1, ctxt->comp->last, axis,
  ------------------
  |  | 1082|  1.12M|    xmlXPathCompExprAdd(ctxt, (op1), (op2),			\
  |  | 1083|  1.12M|	                (op), (val), (val2), (val3), (val4), (val5))
  ------------------
  |  Branch (9461:13): [True: 37, False: 1.12M]
  ------------------
 9462|  1.12M|                           test, type, (void *)prefix, (void *)name) == -1) {
 9463|     37|            xmlFree(prefix);
 9464|     37|            xmlFree(name);
 9465|     37|        }
 9466|  1.12M|    }
 9467|  1.14M|}
xpath.c:xmlXPathIsAxisName:
 9321|  73.2k|xmlXPathIsAxisName(const xmlChar *name) {
 9322|  73.2k|    xmlXPathAxisVal ret = (xmlXPathAxisVal) 0;
 9323|  73.2k|    switch (name[0]) {
  ------------------
  |  Branch (9323:13): [True: 27.8k, False: 45.3k]
  ------------------
 9324|  7.62k|	case 'a':
  ------------------
  |  Branch (9324:2): [True: 7.62k, False: 65.6k]
  ------------------
 9325|  7.62k|	    if (xmlStrEqual(name, BAD_CAST "ancestor"))
  ------------------
  |  |   34|  7.62k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (9325:10): [True: 1.54k, False: 6.08k]
  ------------------
 9326|  1.54k|		ret = AXIS_ANCESTOR;
 9327|  7.62k|	    if (xmlStrEqual(name, BAD_CAST "ancestor-or-self"))
  ------------------
  |  |   34|  7.62k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (9327:10): [True: 293, False: 7.33k]
  ------------------
 9328|    293|		ret = AXIS_ANCESTOR_OR_SELF;
 9329|  7.62k|	    if (xmlStrEqual(name, BAD_CAST "attribute"))
  ------------------
  |  |   34|  7.62k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (9329:10): [True: 68, False: 7.55k]
  ------------------
 9330|     68|		ret = AXIS_ATTRIBUTE;
 9331|  7.62k|	    break;
 9332|  1.87k|	case 'c':
  ------------------
  |  Branch (9332:2): [True: 1.87k, False: 71.3k]
  ------------------
 9333|  1.87k|	    if (xmlStrEqual(name, BAD_CAST "child"))
  ------------------
  |  |   34|  1.87k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (9333:10): [True: 19, False: 1.85k]
  ------------------
 9334|     19|		ret = AXIS_CHILD;
 9335|  1.87k|	    break;
 9336|  1.83k|	case 'd':
  ------------------
  |  Branch (9336:2): [True: 1.83k, False: 71.4k]
  ------------------
 9337|  1.83k|	    if (xmlStrEqual(name, BAD_CAST "descendant"))
  ------------------
  |  |   34|  1.83k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (9337:10): [True: 200, False: 1.63k]
  ------------------
 9338|    200|		ret = AXIS_DESCENDANT;
 9339|  1.83k|	    if (xmlStrEqual(name, BAD_CAST "descendant-or-self"))
  ------------------
  |  |   34|  1.83k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (9339:10): [True: 194, False: 1.64k]
  ------------------
 9340|    194|		ret = AXIS_DESCENDANT_OR_SELF;
 9341|  1.83k|	    break;
 9342|  6.16k|	case 'f':
  ------------------
  |  Branch (9342:2): [True: 6.16k, False: 67.0k]
  ------------------
 9343|  6.16k|	    if (xmlStrEqual(name, BAD_CAST "following"))
  ------------------
  |  |   34|  6.16k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (9343:10): [True: 223, False: 5.94k]
  ------------------
 9344|    223|		ret = AXIS_FOLLOWING;
 9345|  6.16k|	    if (xmlStrEqual(name, BAD_CAST "following-sibling"))
  ------------------
  |  |   34|  6.16k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (9345:10): [True: 18, False: 6.15k]
  ------------------
 9346|     18|		ret = AXIS_FOLLOWING_SIBLING;
 9347|  6.16k|	    break;
 9348|  5.82k|	case 'n':
  ------------------
  |  Branch (9348:2): [True: 5.82k, False: 67.4k]
  ------------------
 9349|  5.82k|	    if (xmlStrEqual(name, BAD_CAST "namespace"))
  ------------------
  |  |   34|  5.82k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (9349:10): [True: 532, False: 5.29k]
  ------------------
 9350|    532|		ret = AXIS_NAMESPACE;
 9351|  5.82k|	    break;
 9352|  1.79k|	case 'p':
  ------------------
  |  Branch (9352:2): [True: 1.79k, False: 71.4k]
  ------------------
 9353|  1.79k|	    if (xmlStrEqual(name, BAD_CAST "parent"))
  ------------------
  |  |   34|  1.79k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (9353:10): [True: 264, False: 1.53k]
  ------------------
 9354|    264|		ret = AXIS_PARENT;
 9355|  1.79k|	    if (xmlStrEqual(name, BAD_CAST "preceding"))
  ------------------
  |  |   34|  1.79k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (9355:10): [True: 70, False: 1.72k]
  ------------------
 9356|     70|		ret = AXIS_PRECEDING;
 9357|  1.79k|	    if (xmlStrEqual(name, BAD_CAST "preceding-sibling"))
  ------------------
  |  |   34|  1.79k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (9357:10): [True: 10, False: 1.78k]
  ------------------
 9358|     10|		ret = AXIS_PRECEDING_SIBLING;
 9359|  1.79k|	    break;
 9360|  2.73k|	case 's':
  ------------------
  |  Branch (9360:2): [True: 2.73k, False: 70.5k]
  ------------------
 9361|  2.73k|	    if (xmlStrEqual(name, BAD_CAST "self"))
  ------------------
  |  |   34|  2.73k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (9361:10): [True: 1.03k, False: 1.70k]
  ------------------
 9362|  1.03k|		ret = AXIS_SELF;
 9363|  2.73k|	    break;
 9364|  73.2k|    }
 9365|  73.2k|    return(ret);
 9366|  73.2k|}
xpath.c:xmlXPathCompNodeTest:
 9201|  1.12M|		     xmlChar *name) {
 9202|  1.12M|    int blanks;
 9203|       |
 9204|  1.12M|    if ((test == NULL) || (type == NULL) || (prefix == NULL)) {
  ------------------
  |  Branch (9204:9): [True: 0, False: 1.12M]
  |  Branch (9204:27): [True: 0, False: 1.12M]
  |  Branch (9204:45): [True: 0, False: 1.12M]
  ------------------
 9205|      0|	return(NULL);
 9206|      0|    }
 9207|  1.12M|    *type = (xmlXPathTypeVal) 0;
 9208|  1.12M|    *test = (xmlXPathTestVal) 0;
 9209|  1.12M|    *prefix = NULL;
 9210|  1.12M|    SKIP_BLANKS;
  ------------------
  |  | 2199|  1.12M|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  | 2202|  1.26M|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2202:15): [True: 147k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 9211|       |
 9212|  1.12M|    if ((name == NULL) && (CUR == '*')) {
  ------------------
  |  | 2193|  1.05M|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (9212:9): [True: 1.05M, False: 70.5k]
  |  Branch (9212:27): [True: 1.04M, False: 5.70k]
  ------------------
 9213|       |	/*
 9214|       |	 * All elements
 9215|       |	 */
 9216|  1.04M|	NEXT;
  ------------------
  |  | 2202|  1.04M|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  ------------------
  |  |  |  Branch (2202:15): [True: 1.04M, False: 0]
  |  |  ------------------
  ------------------
 9217|  1.04M|	*test = NODE_TEST_ALL;
 9218|  1.04M|	return(NULL);
 9219|  1.04M|    }
 9220|       |
 9221|  76.2k|    if (name == NULL)
  ------------------
  |  Branch (9221:9): [True: 5.70k, False: 70.5k]
  ------------------
 9222|  5.70k|	name = xmlXPathParseNCName(ctxt);
 9223|  76.2k|    if (name == NULL) {
  ------------------
  |  Branch (9223:9): [True: 368, False: 75.9k]
  ------------------
 9224|    368|	XP_ERRORNULL(XPATH_EXPR_ERROR);
  ------------------
  |  |  633|    368|    { xmlXPathErr(ctxt, X); return(NULL); }
  ------------------
 9225|      0|    }
 9226|       |
 9227|  75.9k|    blanks = IS_BLANK_CH(CUR);
  ------------------
  |  |  137|  75.9k|#define IS_BLANK_CH(c)  xmlIsBlank_ch(c)
  |  |  ------------------
  |  |  |  |   90|  75.9k|#define xmlIsBlank_ch(c)	(((c) == 0x20) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (90:27): [True: 2.35k, False: 73.5k]
  |  |  |  |  ------------------
  |  |  |  |   91|  75.9k|				 ((0x9 <= (c)) && ((c) <= 0xa)) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (91:7): [True: 71.3k, False: 2.26k]
  |  |  |  |  |  Branch (91:23): [True: 12, False: 71.2k]
  |  |  |  |  ------------------
  |  |  |  |   92|  75.9k|				 ((c) == 0xd))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (92:6): [True: 14, False: 73.5k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 9228|  75.9k|    SKIP_BLANKS;
  ------------------
  |  | 2199|  75.9k|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  | 2202|  91.9k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2202:15): [True: 16.0k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 9229|  75.9k|    if (CUR == '(') {
  ------------------
  |  | 2193|  75.9k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (9229:9): [True: 905, False: 75.0k]
  ------------------
 9230|    905|	NEXT;
  ------------------
  |  | 2202|    905|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  ------------------
  |  |  |  Branch (2202:15): [True: 905, False: 0]
  |  |  ------------------
  ------------------
 9231|       |	/*
 9232|       |	 * NodeType or PI search
 9233|       |	 */
 9234|    905|	if (xmlStrEqual(name, BAD_CAST "comment"))
  ------------------
  |  |   34|    905|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (9234:6): [True: 42, False: 863]
  ------------------
 9235|     42|	    *type = NODE_TYPE_COMMENT;
 9236|    863|	else if (xmlStrEqual(name, BAD_CAST "node"))
  ------------------
  |  |   34|    863|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (9236:11): [True: 104, False: 759]
  ------------------
 9237|    104|	    *type = NODE_TYPE_NODE;
 9238|    759|	else if (xmlStrEqual(name, BAD_CAST "processing-instruction"))
  ------------------
  |  |   34|    759|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (9238:11): [True: 170, False: 589]
  ------------------
 9239|    170|	    *type = NODE_TYPE_PI;
 9240|    589|	else if (xmlStrEqual(name, BAD_CAST "text"))
  ------------------
  |  |   34|    589|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (9240:11): [True: 517, False: 72]
  ------------------
 9241|    517|	    *type = NODE_TYPE_TEXT;
 9242|     72|	else {
 9243|     72|	    if (name != NULL)
  ------------------
  |  Branch (9243:10): [True: 72, False: 0]
  ------------------
 9244|     72|		xmlFree(name);
 9245|     72|	    XP_ERRORNULL(XPATH_EXPR_ERROR);
  ------------------
  |  |  633|     72|    { xmlXPathErr(ctxt, X); return(NULL); }
  ------------------
 9246|      0|	}
 9247|       |
 9248|    833|	*test = NODE_TEST_TYPE;
 9249|       |
 9250|    833|	SKIP_BLANKS;
  ------------------
  |  | 2199|  1.53k|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  | 2202|  2.37k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2202:15): [True: 1.53k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 9251|    833|	if (*type == NODE_TYPE_PI) {
  ------------------
  |  Branch (9251:6): [True: 170, False: 663]
  ------------------
 9252|       |	    /*
 9253|       |	     * Specific case: search a PI by name.
 9254|       |	     */
 9255|    170|	    if (name != NULL)
  ------------------
  |  Branch (9255:10): [True: 170, False: 0]
  ------------------
 9256|    170|		xmlFree(name);
 9257|    170|	    name = NULL;
 9258|    170|	    if (CUR != ')') {
  ------------------
  |  | 2193|    170|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (9258:10): [True: 125, False: 45]
  ------------------
 9259|    125|		name = xmlXPathParseLiteral(ctxt);
 9260|    125|		*test = NODE_TEST_PI;
 9261|    125|		SKIP_BLANKS;
  ------------------
  |  | 2199|    552|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  | 2202|    552|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2202:15): [True: 552, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 9262|    125|	    }
 9263|    170|	}
 9264|    833|	if (CUR != ')') {
  ------------------
  |  | 2193|    833|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (9264:6): [True: 77, False: 756]
  ------------------
 9265|     77|	    if (name != NULL)
  ------------------
  |  Branch (9265:10): [True: 65, False: 12]
  ------------------
 9266|     65|		xmlFree(name);
 9267|     77|	    XP_ERRORNULL(XPATH_UNCLOSED_ERROR);
  ------------------
  |  |  633|     77|    { xmlXPathErr(ctxt, X); return(NULL); }
  ------------------
 9268|      0|	}
 9269|    756|	NEXT;
  ------------------
  |  | 2202|    756|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  ------------------
  |  |  |  Branch (2202:15): [True: 756, False: 0]
  |  |  ------------------
  ------------------
 9270|    756|	return(name);
 9271|    833|    }
 9272|  75.0k|    *test = NODE_TEST_NAME;
 9273|  75.0k|    if ((!blanks) && (CUR == ':')) {
  ------------------
  |  | 2193|  72.6k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (9273:9): [True: 72.6k, False: 2.36k]
  |  Branch (9273:22): [True: 3.05k, False: 69.6k]
  ------------------
 9274|  3.05k|	NEXT;
  ------------------
  |  | 2202|  3.05k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  ------------------
  |  |  |  Branch (2202:15): [True: 3.05k, False: 0]
  |  |  ------------------
  ------------------
 9275|       |
 9276|       |	/*
 9277|       |	 * Since currently the parser context don't have a
 9278|       |	 * namespace list associated:
 9279|       |	 * The namespace name for this prefix can be computed
 9280|       |	 * only at evaluation time. The compilation is done
 9281|       |	 * outside of any context.
 9282|       |	 */
 9283|  3.05k|	*prefix = name;
 9284|       |
 9285|  3.05k|	if (CUR == '*') {
  ------------------
  |  | 2193|  3.05k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (9285:6): [True: 753, False: 2.30k]
  ------------------
 9286|       |	    /*
 9287|       |	     * All elements
 9288|       |	     */
 9289|    753|	    NEXT;
  ------------------
  |  | 2202|    753|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  ------------------
  |  |  |  Branch (2202:15): [True: 753, False: 0]
  |  |  ------------------
  ------------------
 9290|    753|	    *test = NODE_TEST_ALL;
 9291|    753|	    return(NULL);
 9292|    753|	}
 9293|       |
 9294|  2.30k|	name = xmlXPathParseNCName(ctxt);
 9295|  2.30k|	if (name == NULL) {
  ------------------
  |  Branch (9295:6): [True: 83, False: 2.21k]
  ------------------
 9296|     83|	    XP_ERRORNULL(XPATH_EXPR_ERROR);
  ------------------
  |  |  633|     83|    { xmlXPathErr(ctxt, X); return(NULL); }
  ------------------
 9297|      0|	}
 9298|  2.30k|    }
 9299|  74.1k|    return(name);
 9300|  75.0k|}
xpath.c:xmlXPathCompExprAdd:
 1031|  3.61M|   int value2, int value3, void *value4, void *value5) {
 1032|  3.61M|    xmlXPathCompExprPtr comp = ctxt->comp;
 1033|  3.61M|    if (comp->nbStep >= comp->maxStep) {
  ------------------
  |  Branch (1033:9): [True: 66.0k, False: 3.55M]
  ------------------
 1034|  66.0k|	xmlXPathStepOp *real;
 1035|  66.0k|        int newSize;
 1036|       |
 1037|  66.0k|        newSize = xmlGrowCapacity(comp->maxStep, sizeof(real[0]),
 1038|  66.0k|                                  10, XPATH_MAX_STEPS);
  ------------------
  |  |   88|  66.0k|#define XPATH_MAX_STEPS 1000000
  ------------------
 1039|  66.0k|        if (newSize < 0) {
  ------------------
  |  Branch (1039:13): [True: 0, False: 66.0k]
  ------------------
 1040|      0|	    xmlXPathPErrMemory(ctxt);
 1041|      0|	    return(-1);
 1042|      0|        }
 1043|  66.0k|	real = xmlRealloc(comp->steps, newSize * sizeof(real[0]));
 1044|  66.0k|	if (real == NULL) {
  ------------------
  |  Branch (1044:6): [True: 130, False: 65.8k]
  ------------------
 1045|    130|	    xmlXPathPErrMemory(ctxt);
 1046|    130|	    return(-1);
 1047|    130|	}
 1048|  65.8k|	comp->steps = real;
 1049|  65.8k|	comp->maxStep = newSize;
 1050|  65.8k|    }
 1051|  3.61M|    comp->last = comp->nbStep;
 1052|  3.61M|    comp->steps[comp->nbStep].ch1 = ch1;
 1053|  3.61M|    comp->steps[comp->nbStep].ch2 = ch2;
 1054|  3.61M|    comp->steps[comp->nbStep].op = op;
 1055|  3.61M|    comp->steps[comp->nbStep].value = value;
 1056|  3.61M|    comp->steps[comp->nbStep].value2 = value2;
 1057|  3.61M|    comp->steps[comp->nbStep].value3 = value3;
 1058|  3.61M|    if ((comp->dict != NULL) &&
  ------------------
  |  Branch (1058:9): [True: 0, False: 3.61M]
  ------------------
 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.61M|    } else {
 1074|  3.61M|	comp->steps[comp->nbStep].value4 = value4;
 1075|  3.61M|	comp->steps[comp->nbStep].value5 = value5;
 1076|  3.61M|    }
 1077|       |    comp->steps[comp->nbStep].cache = NULL;
 1078|  3.61M|    return(comp->nbStep++);
 1079|  3.61M|}
xpath.c:xmlXPathOptimizeExpression:
11740|  1.79M|{
11741|  1.79M|    xmlXPathCompExprPtr comp = pctxt->comp;
11742|  1.79M|    xmlXPathContextPtr ctxt;
11743|       |
11744|       |    /*
11745|       |    * Try to rewrite "descendant-or-self::node()/foo" to an optimized
11746|       |    * internal representation.
11747|       |    */
11748|       |
11749|  1.79M|    if ((op->op == XPATH_OP_COLLECT /* 11 */) &&
  ------------------
  |  Branch (11749:9): [True: 549k, False: 1.24M]
  ------------------
11750|   549k|        (op->ch1 != -1) &&
  ------------------
  |  Branch (11750:9): [True: 549k, False: 0]
  ------------------
11751|   549k|        (op->ch2 == -1 /* no predicate */))
  ------------------
  |  Branch (11751:9): [True: 542k, False: 6.27k]
  ------------------
11752|   542k|    {
11753|   542k|        xmlXPathStepOpPtr prevop = &comp->steps[op->ch1];
11754|       |
11755|   542k|        if ((prevop->op == XPATH_OP_COLLECT /* 11 */) &&
  ------------------
  |  Branch (11755:13): [True: 16.8k, False: 525k]
  ------------------
11756|  16.8k|            ((xmlXPathAxisVal) prevop->value ==
  ------------------
  |  Branch (11756:13): [True: 8.91k, False: 7.91k]
  ------------------
11757|  16.8k|                AXIS_DESCENDANT_OR_SELF) &&
11758|  8.91k|            (prevop->ch2 == -1) &&
  ------------------
  |  Branch (11758:13): [True: 8.91k, False: 0]
  ------------------
11759|  8.91k|            ((xmlXPathTestVal) prevop->value2 == NODE_TEST_TYPE) &&
  ------------------
  |  Branch (11759:13): [True: 8.91k, False: 0]
  ------------------
11760|  8.91k|            ((xmlXPathTypeVal) prevop->value3 == NODE_TYPE_NODE))
  ------------------
  |  Branch (11760:13): [True: 8.91k, False: 0]
  ------------------
11761|  8.91k|        {
11762|       |            /*
11763|       |            * This is a "descendant-or-self::node()" without predicates.
11764|       |            * Try to eliminate it.
11765|       |            */
11766|       |
11767|  8.91k|            switch ((xmlXPathAxisVal) op->value) {
11768|  2.41k|                case AXIS_CHILD:
  ------------------
  |  Branch (11768:17): [True: 2.41k, False: 6.49k]
  ------------------
11769|  2.41k|                case AXIS_DESCENDANT:
  ------------------
  |  Branch (11769:17): [True: 0, False: 8.91k]
  ------------------
11770|       |                    /*
11771|       |                    * Convert "descendant-or-self::node()/child::" or
11772|       |                    * "descendant-or-self::node()/descendant::" to
11773|       |                    * "descendant::"
11774|       |                    */
11775|  2.41k|                    op->ch1   = prevop->ch1;
11776|  2.41k|                    op->value = AXIS_DESCENDANT;
11777|  2.41k|                    break;
11778|      0|                case AXIS_SELF:
  ------------------
  |  Branch (11778:17): [True: 0, False: 8.91k]
  ------------------
11779|  2.09k|                case AXIS_DESCENDANT_OR_SELF:
  ------------------
  |  Branch (11779:17): [True: 2.09k, False: 6.82k]
  ------------------
11780|       |                    /*
11781|       |                    * Convert "descendant-or-self::node()/self::" or
11782|       |                    * "descendant-or-self::node()/descendant-or-self::" to
11783|       |                    * to "descendant-or-self::"
11784|       |                    */
11785|  2.09k|                    op->ch1   = prevop->ch1;
11786|  2.09k|                    op->value = AXIS_DESCENDANT_OR_SELF;
11787|  2.09k|                    break;
11788|  4.40k|                default:
  ------------------
  |  Branch (11788:17): [True: 4.40k, False: 4.50k]
  ------------------
11789|  4.40k|                    break;
11790|  8.91k|            }
11791|  8.91k|	}
11792|   542k|    }
11793|       |
11794|       |    /* OP_VALUE has invalid ch1. */
11795|  1.79M|    if (op->op == XPATH_OP_VALUE)
  ------------------
  |  Branch (11795:9): [True: 46.9k, False: 1.74M]
  ------------------
11796|  46.9k|        return;
11797|       |
11798|       |    /* Recurse */
11799|  1.74M|    ctxt = pctxt->context;
11800|  1.74M|    if (ctxt != NULL) {
  ------------------
  |  Branch (11800:9): [True: 1.74M, False: 0]
  ------------------
11801|  1.74M|        if (ctxt->depth >= XPATH_MAX_RECURSION_DEPTH)
  ------------------
  |  |  112|  1.74M|#define XPATH_MAX_RECURSION_DEPTH 500
  ------------------
  |  Branch (11801:13): [True: 1.29k, False: 1.74M]
  ------------------
11802|  1.29k|            return;
11803|  1.74M|        ctxt->depth += 1;
11804|  1.74M|    }
11805|  1.74M|    if (op->ch1 != -1)
  ------------------
  |  Branch (11805:9): [True: 1.18M, False: 555k]
  ------------------
11806|  1.18M|        xmlXPathOptimizeExpression(pctxt, &comp->steps[op->ch1]);
11807|  1.74M|    if (op->ch2 != -1)
  ------------------
  |  Branch (11807:9): [True: 591k, False: 1.15M]
  ------------------
11808|   591k|	xmlXPathOptimizeExpression(pctxt, &comp->steps[op->ch2]);
11809|  1.74M|    if (ctxt != NULL)
  ------------------
  |  Branch (11809:9): [True: 1.74M, False: 0]
  ------------------
11810|  1.74M|        ctxt->depth -= 1;
11811|  1.74M|}
xpath.c:xmlXPathRunEval:
11496|  12.9k|{
11497|  12.9k|    xmlXPathCompExprPtr comp;
11498|  12.9k|    int oldDepth;
11499|       |
11500|  12.9k|    if ((ctxt == NULL) || (ctxt->comp == NULL))
  ------------------
  |  Branch (11500:9): [True: 0, False: 12.9k]
  |  Branch (11500:27): [True: 0, False: 12.9k]
  ------------------
11501|      0|	return(-1);
11502|       |
11503|  12.9k|    if (ctxt->valueTab == NULL) {
  ------------------
  |  Branch (11503:9): [True: 0, False: 12.9k]
  ------------------
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|  12.9k|    comp = ctxt->comp;
11553|  12.9k|    if (comp->last < 0) {
  ------------------
  |  Branch (11553:9): [True: 0, False: 12.9k]
  ------------------
11554|      0|        xmlXPathErr(ctxt, XPATH_STACK_ERROR);
11555|      0|	return(-1);
11556|      0|    }
11557|  12.9k|    oldDepth = ctxt->context->depth;
11558|  12.9k|    if (toBool)
  ------------------
  |  Branch (11558:9): [True: 0, False: 12.9k]
  ------------------
11559|      0|	return(xmlXPathCompOpEvalToBoolean(ctxt,
11560|      0|	    &comp->steps[comp->last], 0));
11561|  12.9k|    else
11562|  12.9k|	xmlXPathCompOpEval(ctxt, &comp->steps[comp->last]);
11563|  12.9k|    ctxt->context->depth = oldDepth;
11564|       |
11565|  12.9k|    return(0);
11566|  12.9k|}
xpath.c:xmlXPathCompOpEvalToBoolean:
11177|   432k|{
11178|   432k|    xmlXPathObjectPtr resObj = NULL;
11179|       |
11180|   437k|start:
11181|   437k|    if (OP_LIMIT_EXCEEDED(ctxt, 1))
  ------------------
  |  |  818|   437k|    ((ctxt->context->opLimit != 0) && (xmlXPathCheckOpLimit(ctxt, n) < 0))
  |  |  ------------------
  |  |  |  Branch (818:6): [True: 437k, False: 0]
  |  |  |  Branch (818:39): [True: 3, False: 437k]
  |  |  ------------------
  ------------------
11182|      3|        return(0);
11183|       |    /* comp = ctxt->comp; */
11184|   437k|    switch (op->op) {
11185|      0|        case XPATH_OP_END:
  ------------------
  |  Branch (11185:9): [True: 0, False: 437k]
  ------------------
11186|      0|            return (0);
11187|  44.8k|	case XPATH_OP_VALUE:
  ------------------
  |  Branch (11187:2): [True: 44.8k, False: 392k]
  ------------------
11188|  44.8k|	    resObj = (xmlXPathObjectPtr) op->value4;
11189|  44.8k|	    if (isPredicate)
  ------------------
  |  Branch (11189:10): [True: 44.8k, False: 0]
  ------------------
11190|  44.8k|		return(xmlXPathEvaluatePredicateResult(ctxt, resObj));
11191|      0|	    return(xmlXPathCastToBoolean(resObj));
11192|  4.71k|	case XPATH_OP_SORT:
  ------------------
  |  Branch (11192:2): [True: 4.71k, False: 432k]
  ------------------
11193|       |	    /*
11194|       |	    * We don't need sorting for boolean results. Skip this one.
11195|       |	    */
11196|  4.71k|            if (op->ch1 != -1) {
  ------------------
  |  Branch (11196:17): [True: 4.71k, False: 0]
  ------------------
11197|  4.71k|		op = &ctxt->comp->steps[op->ch1];
11198|  4.71k|		goto start;
11199|  4.71k|	    }
11200|      0|	    return(0);
11201|   102k|	case XPATH_OP_COLLECT:
  ------------------
  |  Branch (11201:2): [True: 102k, False: 335k]
  ------------------
11202|   102k|	    if (op->ch1 == -1)
  ------------------
  |  Branch (11202:10): [True: 0, False: 102k]
  ------------------
11203|      0|		return(0);
11204|       |
11205|   102k|            xmlXPathCompOpEval(ctxt, &ctxt->comp->steps[op->ch1]);
11206|   102k|	    if (ctxt->error != XPATH_EXPRESSION_OK)
  ------------------
  |  Branch (11206:10): [True: 107, False: 101k]
  ------------------
11207|    107|		return(-1);
11208|       |
11209|   101k|            xmlXPathNodeCollectAndTest(ctxt, op, NULL, NULL, 1);
11210|   101k|	    if (ctxt->error != XPATH_EXPRESSION_OK)
  ------------------
  |  Branch (11210:10): [True: 205, False: 101k]
  ------------------
11211|    205|		return(-1);
11212|       |
11213|   101k|	    resObj = xmlXPathValuePop(ctxt);
11214|   101k|	    if (resObj == NULL)
  ------------------
  |  Branch (11214:10): [True: 0, False: 101k]
  ------------------
11215|      0|		return(-1);
11216|   101k|	    break;
11217|   285k|	default:
  ------------------
  |  Branch (11217:2): [True: 285k, False: 151k]
  ------------------
11218|       |	    /*
11219|       |	    * Fallback to call xmlXPathCompOpEval().
11220|       |	    */
11221|   285k|	    xmlXPathCompOpEval(ctxt, op);
11222|   285k|	    if (ctxt->error != XPATH_EXPRESSION_OK)
  ------------------
  |  Branch (11222:10): [True: 1.26k, False: 284k]
  ------------------
11223|  1.26k|		return(-1);
11224|       |
11225|   284k|	    resObj = xmlXPathValuePop(ctxt);
11226|   284k|	    if (resObj == NULL)
  ------------------
  |  Branch (11226:10): [True: 0, False: 284k]
  ------------------
11227|      0|		return(-1);
11228|   284k|	    break;
11229|   437k|    }
11230|       |
11231|   386k|    if (resObj) {
  ------------------
  |  Branch (11231:9): [True: 386k, False: 0]
  ------------------
11232|   386k|	int res;
11233|       |
11234|   386k|	if (resObj->type == XPATH_BOOLEAN) {
  ------------------
  |  Branch (11234:6): [True: 223k, False: 162k]
  ------------------
11235|   223k|	    res = resObj->boolval;
11236|   223k|	} else if (isPredicate) {
  ------------------
  |  Branch (11236:13): [True: 162k, 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|   162k|	    res = xmlXPathEvaluatePredicateResult(ctxt, resObj);
11246|   162k|	} else {
11247|      0|	    res = xmlXPathCastToBoolean(resObj);
11248|      0|	}
11249|   386k|	xmlXPathReleaseObject(ctxt->context, resObj);
11250|   386k|	return(res);
11251|   386k|    }
11252|       |
11253|      0|    return(0);
11254|   386k|}
xpath.c:xmlXPathNodeCollectAndTest:
 9793|  1.08M|{
 9794|       |
 9795|  1.08M|#define XP_TEST_HIT \
 9796|  1.08M|    if (hasAxisRange != 0) { \
 9797|  1.08M|	if (++pos == maxPos) { \
 9798|  1.08M|	    if (addNode(seq, cur) < 0) \
 9799|  1.08M|	        xmlXPathPErrMemory(ctxt); \
 9800|  1.08M|	    goto axis_range_end; } \
 9801|  1.08M|    } else { \
 9802|  1.08M|	if (addNode(seq, cur) < 0) \
 9803|  1.08M|	    xmlXPathPErrMemory(ctxt); \
 9804|  1.08M|	if (breakOnFirstHit) goto first_hit; }
 9805|       |
 9806|  1.08M|#define XP_TEST_HIT_NS \
 9807|  1.08M|    if (hasAxisRange != 0) { \
 9808|  1.08M|	if (++pos == maxPos) { \
 9809|  1.08M|	    hasNsNodes = 1; \
 9810|  1.08M|	    if (xmlXPathNodeSetAddNs(seq, xpctxt->node, (xmlNsPtr) cur) < 0) \
 9811|  1.08M|	        xmlXPathPErrMemory(ctxt); \
 9812|  1.08M|	goto axis_range_end; } \
 9813|  1.08M|    } else { \
 9814|  1.08M|	hasNsNodes = 1; \
 9815|  1.08M|	if (xmlXPathNodeSetAddNs(seq, xpctxt->node, (xmlNsPtr) cur) < 0) \
 9816|  1.08M|	    xmlXPathPErrMemory(ctxt); \
 9817|  1.08M|	if (breakOnFirstHit) goto first_hit; }
 9818|       |
 9819|  1.08M|    xmlXPathAxisVal axis = (xmlXPathAxisVal) op->value;
 9820|  1.08M|    xmlXPathTestVal test = (xmlXPathTestVal) op->value2;
 9821|  1.08M|    xmlXPathTypeVal type = (xmlXPathTypeVal) op->value3;
 9822|  1.08M|    const xmlChar *prefix = op->value4;
 9823|  1.08M|    const xmlChar *name = op->value5;
 9824|  1.08M|    const xmlChar *URI = NULL;
 9825|       |
 9826|  1.08M|    int total = 0, hasNsNodes = 0;
 9827|       |    /* The popped object holding the context nodes */
 9828|  1.08M|    xmlXPathObjectPtr obj;
 9829|       |    /* The set of context nodes for the node tests */
 9830|  1.08M|    xmlNodeSetPtr contextSeq;
 9831|  1.08M|    int contextIdx;
 9832|  1.08M|    xmlNodePtr contextNode;
 9833|       |    /* The final resulting node set wrt to all context nodes */
 9834|  1.08M|    xmlNodeSetPtr outSeq;
 9835|       |    /*
 9836|       |    * The temporary resulting node set wrt 1 context node.
 9837|       |    * Used to feed predicate evaluation.
 9838|       |    */
 9839|  1.08M|    xmlNodeSetPtr seq;
 9840|  1.08M|    xmlNodePtr cur;
 9841|       |    /* First predicate operator */
 9842|  1.08M|    xmlXPathStepOpPtr predOp;
 9843|  1.08M|    int maxPos; /* The requested position() (when a "[n]" predicate) */
 9844|  1.08M|    int hasPredicateRange, hasAxisRange, pos;
 9845|  1.08M|    int breakOnFirstHit;
 9846|       |
 9847|  1.08M|    xmlXPathTraversalFunction next = NULL;
 9848|  1.08M|    int (*addNode) (xmlNodeSetPtr, xmlNodePtr);
 9849|  1.08M|    xmlXPathNodeSetMergeFunction mergeAndClear;
 9850|  1.08M|    xmlNodePtr oldContextNode;
 9851|  1.08M|    xmlXPathContextPtr xpctxt = ctxt->context;
 9852|       |
 9853|       |
 9854|  1.08M|    CHECK_TYPE0(XPATH_NODESET);
  ------------------
  |  |  271|  1.08M|    if ((ctxt->value == NULL) || (ctxt->value->type != typeval))	\
  |  |  ------------------
  |  |  |  Branch (271:9): [True: 0, False: 1.08M]
  |  |  |  Branch (271:34): [True: 105, False: 1.08M]
  |  |  ------------------
  |  |  272|  1.08M|        XP_ERROR0(XPATH_INVALID_TYPE)
  |  |  ------------------
  |  |  |  |  252|    105|    { xmlXPathErr(ctxt, X); return(0); }
  |  |  ------------------
  ------------------
 9855|  1.08M|    obj = xmlXPathValuePop(ctxt);
 9856|       |    /*
 9857|       |    * Setup namespaces.
 9858|       |    */
 9859|  1.08M|    if (prefix != NULL) {
  ------------------
  |  Branch (9859:9): [True: 10.2k, False: 1.07M]
  ------------------
 9860|  10.2k|        URI = xmlXPathNsLookup(xpctxt, prefix);
 9861|  10.2k|        if (URI == NULL) {
  ------------------
  |  Branch (9861:13): [True: 184, False: 10.0k]
  ------------------
 9862|    184|	    xmlXPathReleaseObject(xpctxt, obj);
 9863|    184|            xmlXPathErrFmt(ctxt, XPATH_UNDEF_PREFIX_ERROR,
 9864|    184|                           "Undefined namespace prefix: %s\n", prefix);
 9865|    184|            return 0;
 9866|    184|	}
 9867|  10.2k|    }
 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.08M|    mergeAndClear = xmlXPathNodeSetMergeAndClear;
 9882|  1.08M|    switch (axis) {
  ------------------
  |  Branch (9882:13): [True: 1.08M, False: 0]
  ------------------
 9883|    605|        case AXIS_ANCESTOR:
  ------------------
  |  Branch (9883:9): [True: 605, False: 1.08M]
  ------------------
 9884|    605|            first = NULL;
 9885|    605|            next = xmlXPathNextAncestor;
 9886|    605|            break;
 9887|     95|        case AXIS_ANCESTOR_OR_SELF:
  ------------------
  |  Branch (9887:9): [True: 95, False: 1.08M]
  ------------------
 9888|     95|            first = NULL;
 9889|     95|            next = xmlXPathNextAncestorOrSelf;
 9890|     95|            break;
 9891|  17.9k|        case AXIS_ATTRIBUTE:
  ------------------
  |  Branch (9891:9): [True: 17.9k, False: 1.07M]
  ------------------
 9892|  17.9k|            first = NULL;
 9893|  17.9k|	    last = NULL;
 9894|  17.9k|            next = xmlXPathNextAttribute;
 9895|  17.9k|	    mergeAndClear = xmlXPathNodeSetMergeAndClearNoDupls;
 9896|  17.9k|            break;
 9897|   861k|        case AXIS_CHILD:
  ------------------
  |  Branch (9897:9): [True: 861k, False: 226k]
  ------------------
 9898|   861k|	    last = NULL;
 9899|   861k|	    if (((test == NODE_TEST_NAME) || (test == NODE_TEST_ALL)) &&
  ------------------
  |  Branch (9899:11): [True: 617k, False: 244k]
  |  Branch (9899:39): [True: 239k, False: 4.57k]
  ------------------
 9900|   856k|		(type == NODE_TYPE_NODE))
  ------------------
  |  Branch (9900:3): [True: 856k, False: 0]
  ------------------
 9901|   856k|	    {
 9902|       |		/*
 9903|       |		* Optimization if an element node type is 'element'.
 9904|       |		*/
 9905|   856k|		next = xmlXPathNextChildElement;
 9906|   856k|	    } else
 9907|  4.57k|		next = xmlXPathNextChild;
 9908|   861k|	    mergeAndClear = xmlXPathNodeSetMergeAndClearNoDupls;
 9909|   861k|            break;
 9910|  39.3k|        case AXIS_DESCENDANT:
  ------------------
  |  Branch (9910:9): [True: 39.3k, False: 1.04M]
  ------------------
 9911|  39.3k|	    last = NULL;
 9912|  39.3k|            next = xmlXPathNextDescendant;
 9913|  39.3k|            break;
 9914|   142k|        case AXIS_DESCENDANT_OR_SELF:
  ------------------
  |  Branch (9914:9): [True: 142k, False: 945k]
  ------------------
 9915|   142k|	    last = NULL;
 9916|   142k|            next = xmlXPathNextDescendantOrSelf;
 9917|   142k|            break;
 9918|    367|        case AXIS_FOLLOWING:
  ------------------
  |  Branch (9918:9): [True: 367, False: 1.08M]
  ------------------
 9919|    367|	    last = NULL;
 9920|    367|            next = xmlXPathNextFollowing;
 9921|    367|            break;
 9922|      0|        case AXIS_FOLLOWING_SIBLING:
  ------------------
  |  Branch (9922:9): [True: 0, False: 1.08M]
  ------------------
 9923|      0|	    last = NULL;
 9924|      0|            next = xmlXPathNextFollowingSibling;
 9925|      0|            break;
 9926|  2.59k|        case AXIS_NAMESPACE:
  ------------------
  |  Branch (9926:9): [True: 2.59k, False: 1.08M]
  ------------------
 9927|  2.59k|            first = NULL;
 9928|  2.59k|	    last = NULL;
 9929|  2.59k|            next = (xmlXPathTraversalFunction) xmlXPathNextNamespace;
 9930|  2.59k|	    mergeAndClear = xmlXPathNodeSetMergeAndClearNoDupls;
 9931|  2.59k|            break;
 9932|  22.5k|        case AXIS_PARENT:
  ------------------
  |  Branch (9932:9): [True: 22.5k, False: 1.06M]
  ------------------
 9933|  22.5k|            first = NULL;
 9934|  22.5k|            next = xmlXPathNextParent;
 9935|  22.5k|            break;
 9936|     59|        case AXIS_PRECEDING:
  ------------------
  |  Branch (9936:9): [True: 59, False: 1.08M]
  ------------------
 9937|     59|            first = NULL;
 9938|     59|            next = xmlXPathNextPrecedingInternal;
 9939|     59|            break;
 9940|      3|        case AXIS_PRECEDING_SIBLING:
  ------------------
  |  Branch (9940:9): [True: 3, False: 1.08M]
  ------------------
 9941|      3|            first = NULL;
 9942|      3|            next = xmlXPathNextPrecedingSibling;
 9943|      3|            break;
 9944|    402|        case AXIS_SELF:
  ------------------
  |  Branch (9944:9): [True: 402, False: 1.08M]
  ------------------
 9945|    402|            first = NULL;
 9946|    402|	    last = NULL;
 9947|    402|            next = xmlXPathNextSelf;
 9948|    402|	    mergeAndClear = xmlXPathNodeSetMergeAndClearNoDupls;
 9949|    402|            break;
 9950|  1.08M|    }
 9951|       |
 9952|  1.08M|    if (next == NULL) {
  ------------------
  |  Branch (9952:9): [True: 0, False: 1.08M]
  ------------------
 9953|      0|	xmlXPathReleaseObject(xpctxt, obj);
 9954|      0|        return(0);
 9955|      0|    }
 9956|  1.08M|    contextSeq = obj->nodesetval;
 9957|  1.08M|    if ((contextSeq == NULL) || (contextSeq->nodeNr <= 0)) {
  ------------------
  |  Branch (9957:9): [True: 0, False: 1.08M]
  |  Branch (9957:33): [True: 62.7k, False: 1.02M]
  ------------------
 9958|  62.7k|        xmlXPathValuePush(ctxt, obj);
 9959|  62.7k|        return(0);
 9960|  62.7k|    }
 9961|       |    /*
 9962|       |    * Predicate optimization ---------------------------------------------
 9963|       |    * If this step has a last predicate, which contains a position(),
 9964|       |    * then we'll optimize (although not exactly "position()", but only
 9965|       |    * the  short-hand form, i.e., "[n]".
 9966|       |    *
 9967|       |    * Example - expression "/foo[parent::bar][1]":
 9968|       |    *
 9969|       |    * COLLECT 'child' 'name' 'node' foo    -- op (we are here)
 9970|       |    *   ROOT                               -- op->ch1
 9971|       |    *   PREDICATE                          -- op->ch2 (predOp)
 9972|       |    *     PREDICATE                          -- predOp->ch1 = [parent::bar]
 9973|       |    *       SORT
 9974|       |    *         COLLECT  'parent' 'name' 'node' bar
 9975|       |    *           NODE
 9976|       |    *     ELEM Object is a number : 1        -- predOp->ch2 = [1]
 9977|       |    *
 9978|       |    */
 9979|  1.02M|    maxPos = 0;
 9980|  1.02M|    predOp = NULL;
 9981|  1.02M|    hasPredicateRange = 0;
 9982|  1.02M|    hasAxisRange = 0;
 9983|  1.02M|    if (op->ch2 != -1) {
  ------------------
  |  Branch (9983:9): [True: 117k, False: 907k]
  ------------------
 9984|       |	/*
 9985|       |	* There's at least one predicate. 16 == XPATH_OP_PREDICATE
 9986|       |	*/
 9987|   117k|	predOp = &ctxt->comp->steps[op->ch2];
 9988|   117k|	if (xmlXPathIsPositionalPredicate(ctxt, predOp, &maxPos)) {
  ------------------
  |  Branch (9988:6): [True: 57.8k, False: 60.0k]
  ------------------
 9989|  57.8k|	    if (predOp->ch1 != -1) {
  ------------------
  |  Branch (9989:10): [True: 36.4k, False: 21.3k]
  ------------------
 9990|       |		/*
 9991|       |		* Use the next inner predicate operator.
 9992|       |		*/
 9993|  36.4k|		predOp = &ctxt->comp->steps[predOp->ch1];
 9994|  36.4k|		hasPredicateRange = 1;
 9995|  36.4k|	    } else {
 9996|       |		/*
 9997|       |		* There's no other predicate than the [n] predicate.
 9998|       |		*/
 9999|  21.3k|		predOp = NULL;
10000|  21.3k|		hasAxisRange = 1;
10001|  21.3k|	    }
10002|  57.8k|	}
10003|   117k|    }
10004|  1.02M|    breakOnFirstHit = ((toBool) && (predOp == NULL)) ? 1 : 0;
  ------------------
  |  Branch (10004:24): [True: 96.3k, False: 929k]
  |  Branch (10004:36): [True: 72.4k, False: 23.9k]
  ------------------
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.02M|    oldContextNode = xpctxt->node;
10019|  1.02M|    addNode = xmlXPathNodeSetAddUnique;
10020|  1.02M|    outSeq = NULL;
10021|  1.02M|    seq = NULL;
10022|  1.02M|    contextNode = NULL;
10023|  1.02M|    contextIdx = 0;
10024|       |
10025|       |
10026|  3.23M|    while (((contextIdx < contextSeq->nodeNr) || (contextNode != NULL)) &&
  ------------------
  |  Branch (10026:13): [True: 2.26M, False: 963k]
  |  Branch (10026:50): [True: 0, False: 963k]
  ------------------
10027|  2.26M|           (ctxt->error == XPATH_EXPRESSION_OK)) {
  ------------------
  |  Branch (10027:12): [True: 2.26M, False: 95]
  ------------------
10028|  2.26M|	xpctxt->node = contextSeq->nodeTab[contextIdx++];
10029|       |
10030|  2.26M|	if (seq == NULL) {
  ------------------
  |  Branch (10030:6): [True: 1.05M, False: 1.21M]
  ------------------
10031|  1.05M|	    seq = xmlXPathNodeSetCreate(NULL);
10032|  1.05M|	    if (seq == NULL) {
  ------------------
  |  Branch (10032:10): [True: 128, False: 1.05M]
  ------------------
10033|    128|                xmlXPathPErrMemory(ctxt);
10034|    128|		total = 0;
10035|    128|		goto error;
10036|    128|	    }
10037|  1.05M|	}
10038|       |	/*
10039|       |	* Traverse the axis and test the nodes.
10040|       |	*/
10041|  2.26M|	pos = 0;
10042|  2.26M|	cur = NULL;
10043|  2.26M|	hasNsNodes = 0;
10044|  8.85M|        do {
10045|  8.85M|            if (OP_LIMIT_EXCEEDED(ctxt, 1))
  ------------------
  |  |  818|  8.85M|    ((ctxt->context->opLimit != 0) && (xmlXPathCheckOpLimit(ctxt, n) < 0))
  |  |  ------------------
  |  |  |  Branch (818:6): [True: 8.85M, False: 0]
  |  |  |  Branch (818:39): [True: 25, False: 8.85M]
  |  |  ------------------
  ------------------
10046|     25|                goto error;
10047|       |
10048|  8.85M|            cur = next(ctxt, cur);
10049|  8.85M|            if (cur == NULL)
  ------------------
  |  Branch (10049:17): [True: 2.18M, False: 6.67M]
  ------------------
10050|  2.18M|                break;
10051|       |
10052|       |	    /*
10053|       |	    * QUESTION TODO: What does the "first" and "last" stuff do?
10054|       |	    */
10055|  6.67M|            if ((first != NULL) && (*first != NULL)) {
  ------------------
  |  Branch (10055:17): [True: 8.20k, False: 6.66M]
  |  Branch (10055:36): [True: 813, False: 7.39k]
  ------------------
10056|    813|		if (*first == cur)
  ------------------
  |  Branch (10056:7): [True: 278, False: 535]
  ------------------
10057|    278|		    break;
10058|    535|		if (((total % 256) == 0) &&
  ------------------
  |  Branch (10058:7): [True: 398, False: 137]
  ------------------
10059|    398|#ifdef XP_OPTIMIZED_NON_ELEM_COMPARISON
10060|    398|		    (xmlXPathCmpNodesExt(*first, cur) >= 0))
  ------------------
  |  Branch (10060:7): [True: 304, False: 94]
  ------------------
10061|       |#else
10062|       |		    (xmlXPathCmpNodes(*first, cur) >= 0))
10063|       |#endif
10064|    304|		{
10065|    304|		    break;
10066|    304|		}
10067|    535|	    }
10068|  6.67M|	    if ((last != NULL) && (*last != NULL)) {
  ------------------
  |  Branch (10068:10): [True: 5.18k, False: 6.66M]
  |  Branch (10068:28): [True: 4.75k, False: 429]
  ------------------
10069|  4.75k|		if (*last == cur)
  ------------------
  |  Branch (10069:7): [True: 915, False: 3.83k]
  ------------------
10070|    915|		    break;
10071|  3.83k|		if (((total % 256) == 0) &&
  ------------------
  |  Branch (10071:7): [True: 1.31k, False: 2.52k]
  ------------------
10072|  1.31k|#ifdef XP_OPTIMIZED_NON_ELEM_COMPARISON
10073|  1.31k|		    (xmlXPathCmpNodesExt(cur, *last) >= 0))
  ------------------
  |  Branch (10073:7): [True: 1.02k, False: 284]
  ------------------
10074|       |#else
10075|       |		    (xmlXPathCmpNodes(cur, *last) >= 0))
10076|       |#endif
10077|  1.02k|		{
10078|  1.02k|		    break;
10079|  1.02k|		}
10080|  3.83k|	    }
10081|       |
10082|  6.66M|            total++;
10083|       |
10084|  6.66M|	    switch (test) {
  ------------------
  |  Branch (10084:14): [True: 6.66M, False: 0]
  ------------------
10085|      0|                case NODE_TEST_NONE:
  ------------------
  |  Branch (10085:17): [True: 0, False: 6.66M]
  ------------------
10086|      0|		    total = 0;
10087|      0|		    goto error;
10088|  3.68M|                case NODE_TEST_TYPE:
  ------------------
  |  Branch (10088:17): [True: 3.68M, False: 2.98M]
  ------------------
10089|  3.68M|		    if (type == NODE_TYPE_NODE) {
  ------------------
  |  Branch (10089:11): [True: 3.56M, False: 118k]
  ------------------
10090|  3.56M|			switch (cur->type) {
10091|   127k|			    case XML_DOCUMENT_NODE:
  ------------------
  |  Branch (10091:8): [True: 127k, False: 3.43M]
  ------------------
10092|   127k|			    case XML_HTML_DOCUMENT_NODE:
  ------------------
  |  Branch (10092:8): [True: 0, False: 3.56M]
  ------------------
10093|  2.31M|			    case XML_ELEMENT_NODE:
  ------------------
  |  Branch (10093:8): [True: 2.19M, False: 1.37M]
  ------------------
10094|  2.31M|			    case XML_ATTRIBUTE_NODE:
  ------------------
  |  Branch (10094:8): [True: 718, False: 3.56M]
  ------------------
10095|  2.44M|			    case XML_PI_NODE:
  ------------------
  |  Branch (10095:8): [True: 123k, False: 3.44M]
  ------------------
10096|  2.46M|			    case XML_COMMENT_NODE:
  ------------------
  |  Branch (10096:8): [True: 24.9k, False: 3.54M]
  ------------------
10097|  2.56M|			    case XML_CDATA_SECTION_NODE:
  ------------------
  |  Branch (10097:8): [True: 96.3k, False: 3.46M]
  ------------------
10098|  3.55M|			    case XML_TEXT_NODE:
  ------------------
  |  Branch (10098:8): [True: 992k, False: 2.57M]
  ------------------
10099|  3.55M|				XP_TEST_HIT
  ------------------
  |  | 9796|  3.55M|    if (hasAxisRange != 0) { \
  |  |  ------------------
  |  |  |  Branch (9796:9): [True: 567, False: 3.55M]
  |  |  ------------------
  |  | 9797|    567|	if (++pos == maxPos) { \
  |  |  ------------------
  |  |  |  Branch (9797:6): [True: 246, False: 321]
  |  |  ------------------
  |  | 9798|    246|	    if (addNode(seq, cur) < 0) \
  |  |  ------------------
  |  |  |  Branch (9798:10): [True: 1, False: 245]
  |  |  ------------------
  |  | 9799|    246|	        xmlXPathPErrMemory(ctxt); \
  |  | 9800|    246|	    goto axis_range_end; } \
  |  | 9801|  3.55M|    } else { \
  |  | 9802|  3.55M|	if (addNode(seq, cur) < 0) \
  |  |  ------------------
  |  |  |  Branch (9802:6): [True: 87, False: 3.55M]
  |  |  ------------------
  |  | 9803|  3.55M|	    xmlXPathPErrMemory(ctxt); \
  |  | 9804|  3.55M|	if (breakOnFirstHit) goto first_hit; }
  |  |  ------------------
  |  |  |  Branch (9804:6): [True: 10.8k, False: 3.54M]
  |  |  ------------------
  ------------------
10100|  3.54M|				break;
10101|  3.54M|			    case XML_NAMESPACE_DECL: {
  ------------------
  |  Branch (10101:8): [True: 3.94k, False: 3.56M]
  ------------------
10102|  3.94k|				if (axis == AXIS_NAMESPACE) {
  ------------------
  |  Branch (10102:9): [True: 0, False: 3.94k]
  ------------------
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|  3.94k|				} else {
10105|  3.94k|	                            hasNsNodes = 1;
10106|  3.94k|				    XP_TEST_HIT
  ------------------
  |  | 9796|  3.94k|    if (hasAxisRange != 0) { \
  |  |  ------------------
  |  |  |  Branch (9796:9): [True: 0, False: 3.94k]
  |  |  ------------------
  |  | 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|  3.94k|    } else { \
  |  | 9802|  3.94k|	if (addNode(seq, cur) < 0) \
  |  |  ------------------
  |  |  |  Branch (9802:6): [True: 9, False: 3.93k]
  |  |  ------------------
  |  | 9803|  3.94k|	    xmlXPathPErrMemory(ctxt); \
  |  | 9804|  3.94k|	if (breakOnFirstHit) goto first_hit; }
  |  |  ------------------
  |  |  |  Branch (9804:6): [True: 0, False: 3.94k]
  |  |  ------------------
  ------------------
10107|  3.94k|				}
10108|  3.94k|				break;
10109|  3.94k|                            }
10110|  5.68k|			    default:
  ------------------
  |  Branch (10110:8): [True: 5.68k, False: 3.56M]
  ------------------
10111|  5.68k|				break;
10112|  3.56M|			}
10113|  3.56M|		    } else if (cur->type == (xmlElementType) type) {
  ------------------
  |  Branch (10113:18): [True: 58.5k, False: 60.0k]
  ------------------
10114|  58.5k|			if (cur->type == XML_NAMESPACE_DECL)
  ------------------
  |  Branch (10114:8): [True: 0, False: 58.5k]
  ------------------
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|  58.5k|			else
10117|  58.5k|			    XP_TEST_HIT
  ------------------
  |  | 9796|  58.5k|    if (hasAxisRange != 0) { \
  |  |  ------------------
  |  |  |  Branch (9796:9): [True: 1.99k, False: 56.5k]
  |  |  ------------------
  |  | 9797|  1.99k|	if (++pos == maxPos) { \
  |  |  ------------------
  |  |  |  Branch (9797:6): [True: 235, False: 1.76k]
  |  |  ------------------
  |  | 9798|    235|	    if (addNode(seq, cur) < 0) \
  |  |  ------------------
  |  |  |  Branch (9798:10): [True: 1, False: 234]
  |  |  ------------------
  |  | 9799|    235|	        xmlXPathPErrMemory(ctxt); \
  |  | 9800|    235|	    goto axis_range_end; } \
  |  | 9801|  56.5k|    } else { \
  |  | 9802|  56.5k|	if (addNode(seq, cur) < 0) \
  |  |  ------------------
  |  |  |  Branch (9802:6): [True: 3, False: 56.5k]
  |  |  ------------------
  |  | 9803|  56.5k|	    xmlXPathPErrMemory(ctxt); \
  |  | 9804|  56.5k|	if (breakOnFirstHit) goto first_hit; }
  |  |  ------------------
  |  |  |  Branch (9804:6): [True: 195, False: 56.3k]
  |  |  ------------------
  ------------------
10118|  60.0k|		    } else if ((type == NODE_TYPE_TEXT) &&
  ------------------
  |  Branch (10118:18): [True: 60.0k, False: 55]
  ------------------
10119|  60.0k|			 (cur->type == XML_CDATA_SECTION_NODE))
  ------------------
  |  Branch (10119:5): [True: 18.6k, False: 41.4k]
  ------------------
10120|  18.6k|		    {
10121|  18.6k|			XP_TEST_HIT
  ------------------
  |  | 9796|  18.6k|    if (hasAxisRange != 0) { \
  |  |  ------------------
  |  |  |  Branch (9796:9): [True: 498, False: 18.1k]
  |  |  ------------------
  |  | 9797|    498|	if (++pos == maxPos) { \
  |  |  ------------------
  |  |  |  Branch (9797:6): [True: 233, False: 265]
  |  |  ------------------
  |  | 9798|    233|	    if (addNode(seq, cur) < 0) \
  |  |  ------------------
  |  |  |  Branch (9798:10): [True: 3, False: 230]
  |  |  ------------------
  |  | 9799|    233|	        xmlXPathPErrMemory(ctxt); \
  |  | 9800|    233|	    goto axis_range_end; } \
  |  | 9801|  18.1k|    } else { \
  |  | 9802|  18.1k|	if (addNode(seq, cur) < 0) \
  |  |  ------------------
  |  |  |  Branch (9802:6): [True: 1, False: 18.1k]
  |  |  ------------------
  |  | 9803|  18.1k|	    xmlXPathPErrMemory(ctxt); \
  |  | 9804|  18.1k|	if (breakOnFirstHit) goto first_hit; }
  |  |  ------------------
  |  |  |  Branch (9804:6): [True: 200, False: 17.9k]
  |  |  ------------------
  ------------------
10122|  18.6k|		    }
10123|  3.67M|		    break;
10124|  3.67M|                case NODE_TEST_PI:
  ------------------
  |  Branch (10124:17): [True: 438, False: 6.66M]
  ------------------
10125|    438|                    if ((cur->type == XML_PI_NODE) &&
  ------------------
  |  Branch (10125:25): [True: 127, False: 311]
  ------------------
10126|    127|                        ((name == NULL) || xmlStrEqual(name, cur->name)))
  ------------------
  |  Branch (10126:26): [True: 0, False: 127]
  |  Branch (10126:44): [True: 86, False: 41]
  ------------------
10127|     86|		    {
10128|     86|			XP_TEST_HIT
  ------------------
  |  | 9796|     86|    if (hasAxisRange != 0) { \
  |  |  ------------------
  |  |  |  Branch (9796:9): [True: 0, False: 86]
  |  |  ------------------
  |  | 9797|      0|	if (++pos == maxPos) { \
  |  |  ------------------
  |  |  |  Branch (9797:6): [True: 0, False: 0]
  |  |  ------------------
  |  | 9798|      0|	    if (addNode(seq, cur) < 0) \
  |  |  ------------------
  |  |  |  Branch (9798:10): [True: 0, False: 0]
  |  |  ------------------
  |  | 9799|      0|	        xmlXPathPErrMemory(ctxt); \
  |  | 9800|      0|	    goto axis_range_end; } \
  |  | 9801|     86|    } else { \
  |  | 9802|     86|	if (addNode(seq, cur) < 0) \
  |  |  ------------------
  |  |  |  Branch (9802:6): [True: 1, False: 85]
  |  |  ------------------
  |  | 9803|     86|	    xmlXPathPErrMemory(ctxt); \
  |  | 9804|     86|	if (breakOnFirstHit) goto first_hit; }
  |  |  ------------------
  |  |  |  Branch (9804:6): [True: 0, False: 86]
  |  |  ------------------
  ------------------
10129|     86|                    }
10130|    438|                    break;
10131|  1.37M|                case NODE_TEST_ALL:
  ------------------
  |  Branch (10131:17): [True: 1.37M, False: 5.29M]
  ------------------
10132|  1.37M|                    if (axis == AXIS_ATTRIBUTE) {
  ------------------
  |  Branch (10132:25): [True: 10.6k, False: 1.36M]
  ------------------
10133|  10.6k|                        if (cur->type == XML_ATTRIBUTE_NODE)
  ------------------
  |  Branch (10133:29): [True: 10.6k, False: 0]
  ------------------
10134|  10.6k|			{
10135|  10.6k|                            if (prefix == NULL)
  ------------------
  |  Branch (10135:33): [True: 9.77k, False: 914]
  ------------------
10136|  9.77k|			    {
10137|  9.77k|				XP_TEST_HIT
  ------------------
  |  | 9796|  9.77k|    if (hasAxisRange != 0) { \
  |  |  ------------------
  |  |  |  Branch (9796:9): [True: 670, False: 9.10k]
  |  |  ------------------
  |  | 9797|    670|	if (++pos == maxPos) { \
  |  |  ------------------
  |  |  |  Branch (9797:6): [True: 374, False: 296]
  |  |  ------------------
  |  | 9798|    374|	    if (addNode(seq, cur) < 0) \
  |  |  ------------------
  |  |  |  Branch (9798:10): [True: 1, False: 373]
  |  |  ------------------
  |  | 9799|    374|	        xmlXPathPErrMemory(ctxt); \
  |  | 9800|    374|	    goto axis_range_end; } \
  |  | 9801|  9.10k|    } else { \
  |  | 9802|  9.10k|	if (addNode(seq, cur) < 0) \
  |  |  ------------------
  |  |  |  Branch (9802:6): [True: 4, False: 9.09k]
  |  |  ------------------
  |  | 9803|  9.10k|	    xmlXPathPErrMemory(ctxt); \
  |  | 9804|  9.10k|	if (breakOnFirstHit) goto first_hit; }
  |  |  ------------------
  |  |  |  Branch (9804:6): [True: 4.87k, False: 4.22k]
  |  |  ------------------
  ------------------
10138|  9.77k|                            } else if ((cur->ns != NULL) &&
  ------------------
  |  Branch (10138:40): [True: 682, False: 232]
  ------------------
10139|    682|				(xmlStrEqual(URI, cur->ns->href)))
  ------------------
  |  Branch (10139:5): [True: 682, False: 0]
  ------------------
10140|    682|			    {
10141|    682|				XP_TEST_HIT
  ------------------
  |  | 9796|    682|    if (hasAxisRange != 0) { \
  |  |  ------------------
  |  |  |  Branch (9796:9): [True: 421, False: 261]
  |  |  ------------------
  |  | 9797|    421|	if (++pos == maxPos) { \
  |  |  ------------------
  |  |  |  Branch (9797:6): [True: 208, False: 213]
  |  |  ------------------
  |  | 9798|    208|	    if (addNode(seq, cur) < 0) \
  |  |  ------------------
  |  |  |  Branch (9798:10): [True: 1, False: 207]
  |  |  ------------------
  |  | 9799|    208|	        xmlXPathPErrMemory(ctxt); \
  |  | 9800|    208|	    goto axis_range_end; } \
  |  | 9801|    421|    } else { \
  |  | 9802|    261|	if (addNode(seq, cur) < 0) \
  |  |  ------------------
  |  |  |  Branch (9802:6): [True: 1, False: 260]
  |  |  ------------------
  |  | 9803|    261|	    xmlXPathPErrMemory(ctxt); \
  |  | 9804|    261|	if (breakOnFirstHit) goto first_hit; }
  |  |  ------------------
  |  |  |  Branch (9804:6): [True: 39, False: 222]
  |  |  ------------------
  ------------------
10142|    682|                            }
10143|  10.6k|                        }
10144|  1.36M|                    } else if (axis == AXIS_NAMESPACE) {
  ------------------
  |  Branch (10144:32): [True: 158k, False: 1.20M]
  ------------------
10145|   158k|                        if (cur->type == XML_NAMESPACE_DECL)
  ------------------
  |  Branch (10145:29): [True: 158k, False: 0]
  ------------------
10146|   158k|			{
10147|   158k|			    XP_TEST_HIT_NS
  ------------------
  |  | 9807|   158k|    if (hasAxisRange != 0) { \
  |  |  ------------------
  |  |  |  Branch (9807:9): [True: 19.5k, False: 139k]
  |  |  ------------------
  |  | 9808|  19.5k|	if (++pos == maxPos) { \
  |  |  ------------------
  |  |  |  Branch (9808:6): [True: 19.3k, False: 247]
  |  |  ------------------
  |  | 9809|  19.3k|	    hasNsNodes = 1; \
  |  | 9810|  19.3k|	    if (xmlXPathNodeSetAddNs(seq, xpctxt->node, (xmlNsPtr) cur) < 0) \
  |  |  ------------------
  |  |  |  Branch (9810:10): [True: 5, False: 19.3k]
  |  |  ------------------
  |  | 9811|  19.3k|	        xmlXPathPErrMemory(ctxt); \
  |  | 9812|  19.3k|	goto axis_range_end; } \
  |  | 9813|   139k|    } else { \
  |  | 9814|   139k|	hasNsNodes = 1; \
  |  | 9815|   139k|	if (xmlXPathNodeSetAddNs(seq, xpctxt->node, (xmlNsPtr) cur) < 0) \
  |  |  ------------------
  |  |  |  Branch (9815:6): [True: 22, False: 139k]
  |  |  ------------------
  |  | 9816|   139k|	    xmlXPathPErrMemory(ctxt); \
  |  | 9817|   139k|	if (breakOnFirstHit) goto first_hit; }
  |  |  ------------------
  |  |  |  Branch (9817:6): [True: 35, False: 139k]
  |  |  ------------------
  ------------------
10148|   158k|                        }
10149|  1.20M|                    } else {
10150|  1.20M|                        if (cur->type == XML_ELEMENT_NODE) {
  ------------------
  |  Branch (10150:29): [True: 1.05M, False: 154k]
  ------------------
10151|  1.05M|                            if (prefix == NULL)
  ------------------
  |  Branch (10151:33): [True: 1.02M, False: 25.8k]
  ------------------
10152|  1.02M|			    {
10153|  1.02M|				XP_TEST_HIT
  ------------------
  |  | 9796|  1.02M|    if (hasAxisRange != 0) { \
  |  |  ------------------
  |  |  |  Branch (9796:9): [True: 1.26k, False: 1.02M]
  |  |  ------------------
  |  | 9797|  1.26k|	if (++pos == maxPos) { \
  |  |  ------------------
  |  |  |  Branch (9797:6): [True: 659, False: 607]
  |  |  ------------------
  |  | 9798|    659|	    if (addNode(seq, cur) < 0) \
  |  |  ------------------
  |  |  |  Branch (9798:10): [True: 2, False: 657]
  |  |  ------------------
  |  | 9799|    659|	        xmlXPathPErrMemory(ctxt); \
  |  | 9800|    659|	    goto axis_range_end; } \
  |  | 9801|  1.02M|    } else { \
  |  | 9802|  1.02M|	if (addNode(seq, cur) < 0) \
  |  |  ------------------
  |  |  |  Branch (9802:6): [True: 37, False: 1.02M]
  |  |  ------------------
  |  | 9803|  1.02M|	    xmlXPathPErrMemory(ctxt); \
  |  | 9804|  1.02M|	if (breakOnFirstHit) goto first_hit; }
  |  |  ------------------
  |  |  |  Branch (9804:6): [True: 18.6k, False: 1.00M]
  |  |  ------------------
  ------------------
10154|       |
10155|  1.02M|                            } else if ((cur->ns != NULL) &&
  ------------------
  |  Branch (10155:40): [True: 8.05k, False: 17.8k]
  ------------------
10156|  8.05k|				(xmlStrEqual(URI, cur->ns->href)))
  ------------------
  |  Branch (10156:5): [True: 2.74k, False: 5.30k]
  ------------------
10157|  2.74k|			    {
10158|  2.74k|				XP_TEST_HIT
  ------------------
  |  | 9796|  2.74k|    if (hasAxisRange != 0) { \
  |  |  ------------------
  |  |  |  Branch (9796:9): [True: 345, False: 2.39k]
  |  |  ------------------
  |  | 9797|    345|	if (++pos == maxPos) { \
  |  |  ------------------
  |  |  |  Branch (9797:6): [True: 71, False: 274]
  |  |  ------------------
  |  | 9798|     71|	    if (addNode(seq, cur) < 0) \
  |  |  ------------------
  |  |  |  Branch (9798:10): [True: 1, False: 70]
  |  |  ------------------
  |  | 9799|     71|	        xmlXPathPErrMemory(ctxt); \
  |  | 9800|     71|	    goto axis_range_end; } \
  |  | 9801|  2.39k|    } else { \
  |  | 9802|  2.39k|	if (addNode(seq, cur) < 0) \
  |  |  ------------------
  |  |  |  Branch (9802:6): [True: 2, False: 2.39k]
  |  |  ------------------
  |  | 9803|  2.39k|	    xmlXPathPErrMemory(ctxt); \
  |  | 9804|  2.39k|	if (breakOnFirstHit) goto first_hit; }
  |  |  ------------------
  |  |  |  Branch (9804:6): [True: 2.03k, False: 364]
  |  |  ------------------
  ------------------
10159|  2.74k|                            }
10160|  1.05M|                        }
10161|  1.20M|                    }
10162|  1.33M|                    break;
10163|  1.33M|                case NODE_TEST_NS:{
  ------------------
  |  Branch (10163:17): [True: 0, False: 6.66M]
  ------------------
10164|       |                        /* TODO */
10165|      0|                        break;
10166|  1.37M|                    }
10167|  1.60M|                case NODE_TEST_NAME:
  ------------------
  |  Branch (10167:17): [True: 1.60M, False: 5.06M]
  ------------------
10168|  1.60M|                    if (axis == AXIS_ATTRIBUTE) {
  ------------------
  |  Branch (10168:25): [True: 5.31k, False: 1.60M]
  ------------------
10169|  5.31k|                        if (cur->type != XML_ATTRIBUTE_NODE)
  ------------------
  |  Branch (10169:29): [True: 0, False: 5.31k]
  ------------------
10170|      0|			    break;
10171|  1.60M|		    } else if (axis == AXIS_NAMESPACE) {
  ------------------
  |  Branch (10171:18): [True: 4.21k, False: 1.59M]
  ------------------
10172|  4.21k|                        if (cur->type != XML_NAMESPACE_DECL)
  ------------------
  |  Branch (10172:29): [True: 0, False: 4.21k]
  ------------------
10173|      0|			    break;
10174|  1.59M|		    } else {
10175|  1.59M|		        if (cur->type != XML_ELEMENT_NODE)
  ------------------
  |  Branch (10175:15): [True: 179k, False: 1.41M]
  ------------------
10176|   179k|			    break;
10177|  1.59M|		    }
10178|  1.42M|                    switch (cur->type) {
10179|  1.41M|                        case XML_ELEMENT_NODE:
  ------------------
  |  Branch (10179:25): [True: 1.41M, False: 9.53k]
  ------------------
10180|  1.41M|                            if (xmlStrEqual(name, cur->name)) {
  ------------------
  |  Branch (10180:33): [True: 404k, False: 1.01M]
  ------------------
10181|   404k|                                if (prefix == NULL) {
  ------------------
  |  Branch (10181:37): [True: 402k, False: 1.98k]
  ------------------
10182|   402k|                                    if (cur->ns == NULL)
  ------------------
  |  Branch (10182:41): [True: 402k, False: 711]
  ------------------
10183|   402k|				    {
10184|   402k|					XP_TEST_HIT
  ------------------
  |  | 9796|   402k|    if (hasAxisRange != 0) { \
  |  |  ------------------
  |  |  |  Branch (9796:9): [True: 42.9k, False: 359k]
  |  |  ------------------
  |  | 9797|  42.9k|	if (++pos == maxPos) { \
  |  |  ------------------
  |  |  |  Branch (9797:6): [True: 21.0k, False: 21.9k]
  |  |  ------------------
  |  | 9798|  21.0k|	    if (addNode(seq, cur) < 0) \
  |  |  ------------------
  |  |  |  Branch (9798:10): [True: 2, False: 21.0k]
  |  |  ------------------
  |  | 9799|  21.0k|	        xmlXPathPErrMemory(ctxt); \
  |  | 9800|  21.0k|	    goto axis_range_end; } \
  |  | 9801|   359k|    } else { \
  |  | 9802|   359k|	if (addNode(seq, cur) < 0) \
  |  |  ------------------
  |  |  |  Branch (9802:6): [True: 10, False: 359k]
  |  |  ------------------
  |  | 9803|   359k|	    xmlXPathPErrMemory(ctxt); \
  |  | 9804|   359k|	if (breakOnFirstHit) goto first_hit; }
  |  |  ------------------
  |  |  |  Branch (9804:6): [True: 96, False: 359k]
  |  |  ------------------
  ------------------
10185|   402k|                                    }
10186|   402k|                                } else {
10187|  1.98k|                                    if ((cur->ns != NULL) &&
  ------------------
  |  Branch (10187:41): [True: 363, False: 1.62k]
  ------------------
10188|    363|                                        (xmlStrEqual(URI, cur->ns->href)))
  ------------------
  |  Branch (10188:41): [True: 148, False: 215]
  ------------------
10189|    148|				    {
10190|    148|					XP_TEST_HIT
  ------------------
  |  | 9796|    148|    if (hasAxisRange != 0) { \
  |  |  ------------------
  |  |  |  Branch (9796:9): [True: 0, False: 148]
  |  |  ------------------
  |  | 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|    148|    } else { \
  |  | 9802|    148|	if (addNode(seq, cur) < 0) \
  |  |  ------------------
  |  |  |  Branch (9802:6): [True: 1, False: 147]
  |  |  ------------------
  |  | 9803|    148|	    xmlXPathPErrMemory(ctxt); \
  |  | 9804|    148|	if (breakOnFirstHit) goto first_hit; }
  |  |  ------------------
  |  |  |  Branch (9804:6): [True: 71, False: 77]
  |  |  ------------------
  ------------------
10191|    148|                                    }
10192|  1.98k|                                }
10193|   404k|                            }
10194|  1.39M|                            break;
10195|  1.39M|                        case XML_ATTRIBUTE_NODE:{
  ------------------
  |  Branch (10195:25): [True: 5.31k, False: 1.42M]
  ------------------
10196|  5.31k|                                xmlAttrPtr attr = (xmlAttrPtr) cur;
10197|       |
10198|  5.31k|                                if (xmlStrEqual(name, attr->name)) {
  ------------------
  |  Branch (10198:37): [True: 3.80k, False: 1.51k]
  ------------------
10199|  3.80k|                                    if (prefix == NULL) {
  ------------------
  |  Branch (10199:41): [True: 3.54k, False: 254]
  ------------------
10200|  3.54k|                                        if ((attr->ns == NULL) ||
  ------------------
  |  Branch (10200:45): [True: 3.28k, False: 265]
  ------------------
10201|    265|                                            (attr->ns->prefix == NULL))
  ------------------
  |  Branch (10201:45): [True: 0, False: 265]
  ------------------
10202|  3.28k|					{
10203|  3.28k|					    XP_TEST_HIT
  ------------------
  |  | 9796|  3.28k|    if (hasAxisRange != 0) { \
  |  |  ------------------
  |  |  |  Branch (9796:9): [True: 2.30k, False: 975]
  |  |  ------------------
  |  | 9797|  2.30k|	if (++pos == maxPos) { \
  |  |  ------------------
  |  |  |  Branch (9797:6): [True: 746, False: 1.56k]
  |  |  ------------------
  |  | 9798|    746|	    if (addNode(seq, cur) < 0) \
  |  |  ------------------
  |  |  |  Branch (9798:10): [True: 1, False: 745]
  |  |  ------------------
  |  | 9799|    746|	        xmlXPathPErrMemory(ctxt); \
  |  | 9800|    746|	    goto axis_range_end; } \
  |  | 9801|  2.30k|    } else { \
  |  | 9802|    975|	if (addNode(seq, cur) < 0) \
  |  |  ------------------
  |  |  |  Branch (9802:6): [True: 1, False: 974]
  |  |  ------------------
  |  | 9803|    975|	    xmlXPathPErrMemory(ctxt); \
  |  | 9804|    975|	if (breakOnFirstHit) goto first_hit; }
  |  |  ------------------
  |  |  |  Branch (9804:6): [True: 74, False: 901]
  |  |  ------------------
  ------------------
10204|  3.28k|                                        }
10205|  3.54k|                                    } else {
10206|    254|                                        if ((attr->ns != NULL) &&
  ------------------
  |  Branch (10206:45): [True: 2, False: 252]
  ------------------
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|    254|                                    }
10213|  3.80k|                                }
10214|  4.49k|                                break;
10215|  5.31k|                            }
10216|  4.49k|                        case XML_NAMESPACE_DECL:
  ------------------
  |  Branch (10216:25): [True: 4.21k, False: 1.42M]
  ------------------
10217|  4.21k|                            if (cur->type == XML_NAMESPACE_DECL) {
  ------------------
  |  Branch (10217:33): [True: 4.21k, False: 0]
  ------------------
10218|  4.21k|                                xmlNsPtr ns = (xmlNsPtr) cur;
10219|       |
10220|  4.21k|                                if ((ns->prefix != NULL) && (name != NULL)
  ------------------
  |  Branch (10220:37): [True: 3.01k, False: 1.20k]
  |  Branch (10220:61): [True: 3.01k, False: 0]
  ------------------
10221|  3.01k|                                    && (xmlStrEqual(ns->prefix, name)))
  ------------------
  |  Branch (10221:40): [True: 452, False: 2.55k]
  ------------------
10222|    452|				{
10223|    452|				    XP_TEST_HIT_NS
  ------------------
  |  | 9807|    452|    if (hasAxisRange != 0) { \
  |  |  ------------------
  |  |  |  Branch (9807:9): [True: 166, False: 286]
  |  |  ------------------
  |  | 9808|    166|	if (++pos == maxPos) { \
  |  |  ------------------
  |  |  |  Branch (9808:6): [True: 97, False: 69]
  |  |  ------------------
  |  | 9809|     97|	    hasNsNodes = 1; \
  |  | 9810|     97|	    if (xmlXPathNodeSetAddNs(seq, xpctxt->node, (xmlNsPtr) cur) < 0) \
  |  |  ------------------
  |  |  |  Branch (9810:10): [True: 1, False: 96]
  |  |  ------------------
  |  | 9811|     97|	        xmlXPathPErrMemory(ctxt); \
  |  | 9812|     97|	goto axis_range_end; } \
  |  | 9813|    286|    } else { \
  |  | 9814|    286|	hasNsNodes = 1; \
  |  | 9815|    286|	if (xmlXPathNodeSetAddNs(seq, xpctxt->node, (xmlNsPtr) cur) < 0) \
  |  |  ------------------
  |  |  |  Branch (9815:6): [True: 1, False: 285]
  |  |  ------------------
  |  | 9816|    286|	    xmlXPathPErrMemory(ctxt); \
  |  | 9817|    286|	if (breakOnFirstHit) goto first_hit; }
  |  |  ------------------
  |  |  |  Branch (9817:6): [True: 0, False: 286]
  |  |  ------------------
  ------------------
10224|    452|                                }
10225|  4.21k|                            }
10226|  4.11k|                            break;
10227|  4.11k|                        default:
  ------------------
  |  Branch (10227:25): [True: 0, False: 1.42M]
  ------------------
10228|      0|                            break;
10229|  1.42M|                    }
10230|  1.40M|                    break;
10231|  6.66M|	    } /* switch(test) */
10232|  6.66M|        } while ((cur != NULL) && (ctxt->error == XPATH_EXPRESSION_OK));
  ------------------
  |  Branch (10232:18): [True: 6.58M, False: 0]
  |  Branch (10232:35): [True: 6.58M, False: 178]
  ------------------
10233|       |
10234|  2.18M|	goto apply_predicates;
10235|       |
10236|  2.18M|axis_range_end: /* ----------------------------------------------------- */
10237|       |	/*
10238|       |	* We have a "/foo[n]", and position() = n was reached.
10239|       |	* Note that we can have as well "/foo/::parent::foo[1]", so
10240|       |	* a duplicate-aware merge is still needed.
10241|       |	* Merge with the result.
10242|       |	*/
10243|  43.2k|	if (outSeq == NULL) {
  ------------------
  |  Branch (10243:6): [True: 18.7k, False: 24.4k]
  ------------------
10244|  18.7k|	    outSeq = seq;
10245|  18.7k|	    seq = NULL;
10246|  24.4k|	} else {
10247|  24.4k|	    outSeq = mergeAndClear(outSeq, seq);
10248|  24.4k|            if (outSeq == NULL)
  ------------------
  |  Branch (10248:17): [True: 1, False: 24.4k]
  ------------------
10249|      1|                xmlXPathPErrMemory(ctxt);
10250|  24.4k|        }
10251|       |	/*
10252|       |	* Break if only a true/false result was requested.
10253|       |	*/
10254|  43.2k|	if (toBool)
  ------------------
  |  Branch (10254:6): [True: 13.6k, False: 29.5k]
  ------------------
10255|  13.6k|	    break;
10256|  29.5k|	continue;
10257|       |
10258|  37.1k|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|  37.1k|	if (outSeq == NULL) {
  ------------------
  |  Branch (10263:6): [True: 37.1k, False: 0]
  ------------------
10264|  37.1k|	    outSeq = seq;
10265|  37.1k|	    seq = NULL;
10266|  37.1k|	} 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|  37.1k|	break;
10272|       |
10273|  2.18M|apply_predicates: /* --------------------------------------------------- */
10274|  2.18M|        if (ctxt->error != XPATH_EXPRESSION_OK)
  ------------------
  |  Branch (10274:13): [True: 184, False: 2.18M]
  ------------------
10275|    184|	    goto error;
10276|       |
10277|       |        /*
10278|       |	* Apply predicates.
10279|       |	*/
10280|  2.18M|        if ((predOp != NULL) && (seq->nodeNr > 0)) {
  ------------------
  |  Branch (10280:13): [True: 663k, False: 1.52M]
  |  Branch (10280:33): [True: 147k, False: 516k]
  ------------------
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|   147k|	    if (hasPredicateRange != 0)
  ------------------
  |  Branch (10309:10): [True: 10.0k, False: 136k]
  ------------------
10310|  10.0k|		xmlXPathCompOpEvalPredicate(ctxt, predOp, seq, maxPos, maxPos,
10311|  10.0k|					    hasNsNodes);
10312|   136k|	    else
10313|   136k|		xmlXPathCompOpEvalPredicate(ctxt, predOp, seq, 1, seq->nodeNr,
10314|   136k|					    hasNsNodes);
10315|       |
10316|   147k|	    if (ctxt->error != XPATH_EXPRESSION_OK) {
  ------------------
  |  Branch (10316:10): [True: 1.55k, False: 145k]
  ------------------
10317|  1.55k|		total = 0;
10318|  1.55k|		goto error;
10319|  1.55k|	    }
10320|   147k|        }
10321|       |
10322|  2.18M|        if (seq->nodeNr > 0) {
  ------------------
  |  Branch (10322:13): [True: 573k, False: 1.61M]
  ------------------
10323|       |	    /*
10324|       |	    * Add to result set.
10325|       |	    */
10326|   573k|	    if (outSeq == NULL) {
  ------------------
  |  Branch (10326:10): [True: 314k, False: 258k]
  ------------------
10327|   314k|		outSeq = seq;
10328|   314k|		seq = NULL;
10329|   314k|	    } else {
10330|   258k|		outSeq = mergeAndClear(outSeq, seq);
10331|   258k|                if (outSeq == NULL)
  ------------------
  |  Branch (10331:21): [True: 99, False: 258k]
  ------------------
10332|     99|                    xmlXPathPErrMemory(ctxt);
10333|   258k|	    }
10334|       |
10335|   573k|            if (toBool)
  ------------------
  |  Branch (10335:17): [True: 8.76k, False: 564k]
  ------------------
10336|  8.76k|                break;
10337|   573k|	}
10338|  2.18M|    }
10339|       |
10340|  1.02M|error:
10341|  1.02M|    if ((obj->boolval) && (obj->user != NULL)) {
  ------------------
  |  Branch (10341:9): [True: 0, False: 1.02M]
  |  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.02M|    xmlXPathReleaseObject(xpctxt, obj);
10353|       |
10354|       |    /*
10355|       |    * Ensure we return at least an empty set.
10356|       |    */
10357|  1.02M|    if (outSeq == NULL) {
  ------------------
  |  Branch (10357:9): [True: 655k, False: 369k]
  ------------------
10358|   655k|	if ((seq != NULL) && (seq->nodeNr == 0)) {
  ------------------
  |  Branch (10358:6): [True: 655k, False: 120]
  |  Branch (10358:23): [True: 655k, False: 139]
  ------------------
10359|   655k|	    outSeq = seq;
10360|   655k|        } else {
10361|    259|	    outSeq = xmlXPathNodeSetCreate(NULL);
10362|    259|            if (outSeq == NULL)
  ------------------
  |  Branch (10362:17): [True: 1, False: 258]
  ------------------
10363|      1|                xmlXPathPErrMemory(ctxt);
10364|    259|        }
10365|   655k|    }
10366|  1.02M|    if ((seq != NULL) && (seq != outSeq)) {
  ------------------
  |  Branch (10366:9): [True: 683k, False: 341k]
  |  Branch (10366:26): [True: 28.3k, False: 655k]
  ------------------
10367|  28.3k|	 xmlXPathFreeNodeSet(seq);
10368|  28.3k|    }
10369|       |    /*
10370|       |    * Hand over the result. Better to push the set also in
10371|       |    * case of errors.
10372|       |    */
10373|  1.02M|    xmlXPathValuePush(ctxt, xmlXPathCacheWrapNodeSet(ctxt, outSeq));
10374|       |    /*
10375|       |    * Reset the context node.
10376|       |    */
10377|  1.02M|    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.02M|    if (xpctxt->tmpNsList != NULL) {
  ------------------
  |  Branch (10382:9): [True: 323, False: 1.02M]
  ------------------
10383|    323|        xmlFree(xpctxt->tmpNsList);
10384|    323|        xpctxt->tmpNsList = NULL;
10385|    323|    }
10386|       |
10387|  1.02M|    return(total);
10388|  1.02M|}
xpath.c:xmlXPathNodeSetMergeAndClear:
 2958|   161k|{
 2959|   161k|    {
 2960|   161k|	int i, j, initNbSet1;
 2961|   161k|	xmlNodePtr n1, n2;
 2962|       |
 2963|   161k|	initNbSet1 = set1->nodeNr;
 2964|   480k|	for (i = 0;i < set2->nodeNr;i++) {
  ------------------
  |  Branch (2964:13): [True: 318k, False: 161k]
  ------------------
 2965|   318k|	    n2 = set2->nodeTab[i];
 2966|       |	    /*
 2967|       |	    * Skip duplicates.
 2968|       |	    */
 2969|  11.2M|	    for (j = 0; j < initNbSet1; j++) {
  ------------------
  |  Branch (2969:18): [True: 11.1M, False: 87.9k]
  ------------------
 2970|  11.1M|		n1 = set1->nodeTab[j];
 2971|  11.1M|		if (n1 == n2) {
  ------------------
  |  Branch (2971:7): [True: 230k, False: 10.9M]
  ------------------
 2972|   230k|		    goto skip_node;
 2973|  10.9M|		} else if ((n1->type == XML_NAMESPACE_DECL) &&
  ------------------
  |  Branch (2973:14): [True: 109k, False: 10.8M]
  ------------------
 2974|   109k|		    (n2->type == XML_NAMESPACE_DECL))
  ------------------
  |  Branch (2974:7): [True: 109k, False: 0]
  ------------------
 2975|   109k|		{
 2976|   109k|		    if ((((xmlNsPtr) n1)->next == ((xmlNsPtr) n2)->next) &&
  ------------------
  |  Branch (2976:11): [True: 2.77k, False: 106k]
  ------------------
 2977|  2.77k|			(xmlStrEqual(((xmlNsPtr) n1)->prefix,
  ------------------
  |  Branch (2977:4): [True: 0, False: 2.77k]
  ------------------
 2978|  2.77k|			((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|   109k|		}
 2987|  11.1M|	    }
 2988|       |	    /*
 2989|       |	    * grow the nodeTab if needed
 2990|       |	    */
 2991|  87.9k|            if (set1->nodeNr >= set1->nodeMax) {
  ------------------
  |  Branch (2991:17): [True: 16.4k, False: 71.5k]
  ------------------
 2992|  16.4k|                if (xmlXPathNodeSetGrow(set1) < 0)
  ------------------
  |  Branch (2992:21): [True: 46, False: 16.3k]
  ------------------
 2993|     46|                    goto error;
 2994|  16.4k|            }
 2995|  87.8k|	    set1->nodeTab[set1->nodeNr++] = n2;
 2996|   318k|skip_node:
 2997|   318k|            set2->nodeTab[i] = NULL;
 2998|   318k|	}
 2999|   161k|    }
 3000|   161k|    set2->nodeNr = 0;
 3001|   161k|    return(set1);
 3002|       |
 3003|     46|error:
 3004|     46|    xmlXPathFreeNodeSet(set1);
 3005|     46|    xmlXPathNodeSetClear(set2, 1);
 3006|       |    return(NULL);
 3007|   161k|}
xpath.c:xmlXPathNodeSetClear:
 3154|  4.27k|{
 3155|  4.27k|    xmlXPathNodeSetClearFromPos(set, 0, hasNsNodes);
 3156|  4.27k|}
xpath.c:xmlXPathNodeSetClearFromPos:
 3127|  4.94k|{
 3128|  4.94k|    if ((set == NULL) || (pos >= set->nodeNr))
  ------------------
  |  Branch (3128:9): [True: 0, False: 4.94k]
  |  Branch (3128:26): [True: 0, False: 4.94k]
  ------------------
 3129|      0|	return;
 3130|  4.94k|    else if ((hasNsNodes)) {
  ------------------
  |  Branch (3130:14): [True: 773, False: 4.17k]
  ------------------
 3131|    773|	int i;
 3132|    773|	xmlNodePtr node;
 3133|       |
 3134|  4.87k|	for (i = pos; i < set->nodeNr; i++) {
  ------------------
  |  Branch (3134:16): [True: 4.10k, False: 773]
  ------------------
 3135|  4.10k|	    node = set->nodeTab[i];
 3136|  4.10k|	    if ((node != NULL) &&
  ------------------
  |  Branch (3136:10): [True: 3.57k, False: 534]
  ------------------
 3137|  3.57k|		(node->type == XML_NAMESPACE_DECL))
  ------------------
  |  Branch (3137:3): [True: 58, False: 3.51k]
  ------------------
 3138|     58|		xmlXPathNodeSetFreeNs((xmlNsPtr) node);
 3139|  4.10k|	}
 3140|    773|    }
 3141|  4.94k|    set->nodeNr = pos;
 3142|  4.94k|}
xpath.c:xmlXPathNodeSetMergeAndClearNoDupls:
 3021|   121k|{
 3022|   121k|    {
 3023|   121k|	int i;
 3024|   121k|	xmlNodePtr n2;
 3025|       |
 3026|   563k|	for (i = 0;i < set2->nodeNr;i++) {
  ------------------
  |  Branch (3026:13): [True: 441k, False: 121k]
  ------------------
 3027|   441k|	    n2 = set2->nodeTab[i];
 3028|   441k|            if (set1->nodeNr >= set1->nodeMax) {
  ------------------
  |  Branch (3028:17): [True: 65.1k, False: 376k]
  ------------------
 3029|  65.1k|                if (xmlXPathNodeSetGrow(set1) < 0)
  ------------------
  |  Branch (3029:21): [True: 54, False: 65.0k]
  ------------------
 3030|     54|                    goto error;
 3031|  65.1k|            }
 3032|   441k|	    set1->nodeTab[set1->nodeNr++] = n2;
 3033|   441k|            set2->nodeTab[i] = NULL;
 3034|   441k|	}
 3035|   121k|    }
 3036|   121k|    set2->nodeNr = 0;
 3037|   121k|    return(set1);
 3038|       |
 3039|     54|error:
 3040|     54|    xmlXPathFreeNodeSet(set1);
 3041|     54|    xmlXPathNodeSetClear(set2, 1);
 3042|       |    return(NULL);
 3043|   121k|}
xpath.c:xmlXPathNextChildElement:
 6200|  2.80M|xmlXPathNextChildElement(xmlXPathParserContextPtr ctxt, xmlNodePtr cur) {
 6201|  2.80M|    if ((ctxt == NULL) || (ctxt->context == NULL)) return(NULL);
  ------------------
  |  Branch (6201:9): [True: 0, False: 2.80M]
  |  Branch (6201:27): [True: 0, False: 2.80M]
  ------------------
 6202|  2.80M|    if (cur == NULL) {
  ------------------
  |  Branch (6202:9): [True: 1.45M, False: 1.34M]
  ------------------
 6203|  1.45M|	cur = ctxt->context->node;
 6204|  1.45M|	if (cur == NULL) return(NULL);
  ------------------
  |  Branch (6204:6): [True: 0, False: 1.45M]
  ------------------
 6205|       |	/*
 6206|       |	* Get the first element child.
 6207|       |	*/
 6208|  1.45M|	switch (cur->type) {
 6209|  1.07M|            case XML_ELEMENT_NODE:
  ------------------
  |  Branch (6209:13): [True: 1.07M, False: 379k]
  ------------------
 6210|  1.07M|	    case XML_DOCUMENT_FRAG_NODE:
  ------------------
  |  Branch (6210:6): [True: 0, False: 1.45M]
  ------------------
 6211|  1.07M|	    case XML_ENTITY_REF_NODE: /* URGENT TODO: entify-refs as well? */
  ------------------
  |  Branch (6211:6): [True: 0, False: 1.45M]
  ------------------
 6212|  1.07M|            case XML_ENTITY_NODE:
  ------------------
  |  Branch (6212:13): [True: 0, False: 1.45M]
  ------------------
 6213|  1.07M|		cur = cur->children;
 6214|  1.07M|		if (cur != NULL) {
  ------------------
  |  Branch (6214:7): [True: 328k, False: 746k]
  ------------------
 6215|   328k|		    if (cur->type == XML_ELEMENT_NODE)
  ------------------
  |  Branch (6215:11): [True: 138k, False: 190k]
  ------------------
 6216|   138k|			return(cur);
 6217|   199k|		    do {
 6218|   199k|			cur = cur->next;
 6219|   199k|		    } while ((cur != NULL) &&
  ------------------
  |  Branch (6219:16): [True: 133k, False: 66.0k]
  ------------------
 6220|   133k|			(cur->type != XML_ELEMENT_NODE));
  ------------------
  |  Branch (6220:4): [True: 9.48k, False: 124k]
  ------------------
 6221|   190k|		    return(cur);
 6222|   328k|		}
 6223|   746k|		return(NULL);
 6224|   256k|            case XML_DOCUMENT_NODE:
  ------------------
  |  Branch (6224:13): [True: 256k, False: 1.19M]
  ------------------
 6225|   256k|            case XML_HTML_DOCUMENT_NODE:
  ------------------
  |  Branch (6225:13): [True: 0, False: 1.45M]
  ------------------
 6226|   256k|		return(xmlDocGetRootElement((xmlDocPtr) cur));
 6227|   122k|	    default:
  ------------------
  |  Branch (6227:6): [True: 122k, False: 1.33M]
  ------------------
 6228|   122k|		return(NULL);
 6229|  1.45M|	}
 6230|      0|	return(NULL);
 6231|  1.45M|    }
 6232|       |    /*
 6233|       |    * Get the next sibling element node.
 6234|       |    */
 6235|  1.34M|    switch (cur->type) {
 6236|  1.34M|	case XML_ELEMENT_NODE:
  ------------------
  |  Branch (6236:2): [True: 1.34M, False: 0]
  ------------------
 6237|  1.34M|	case XML_TEXT_NODE:
  ------------------
  |  Branch (6237:2): [True: 0, False: 1.34M]
  ------------------
 6238|  1.34M|	case XML_ENTITY_REF_NODE:
  ------------------
  |  Branch (6238:2): [True: 0, False: 1.34M]
  ------------------
 6239|  1.34M|	case XML_ENTITY_NODE:
  ------------------
  |  Branch (6239:2): [True: 0, False: 1.34M]
  ------------------
 6240|  1.34M|	case XML_CDATA_SECTION_NODE:
  ------------------
  |  Branch (6240:2): [True: 0, False: 1.34M]
  ------------------
 6241|  1.34M|	case XML_PI_NODE:
  ------------------
  |  Branch (6241:2): [True: 0, False: 1.34M]
  ------------------
 6242|  1.34M|	case XML_COMMENT_NODE:
  ------------------
  |  Branch (6242:2): [True: 0, False: 1.34M]
  ------------------
 6243|  1.34M|	case XML_XINCLUDE_END:
  ------------------
  |  Branch (6243:2): [True: 0, False: 1.34M]
  ------------------
 6244|  1.34M|	    break;
 6245|       |	/* case XML_DTD_NODE: */ /* URGENT TODO: DTD-node as well? */
 6246|      0|	default:
  ------------------
  |  Branch (6246:2): [True: 0, False: 1.34M]
  ------------------
 6247|      0|	    return(NULL);
 6248|  1.34M|    }
 6249|  1.34M|    if (cur->next != NULL) {
  ------------------
  |  Branch (6249:9): [True: 918k, False: 430k]
  ------------------
 6250|   918k|	if (cur->next->type == XML_ELEMENT_NODE)
  ------------------
  |  Branch (6250:6): [True: 771k, False: 146k]
  ------------------
 6251|   771k|	    return(cur->next);
 6252|   146k|	cur = cur->next;
 6253|   236k|	do {
 6254|   236k|	    cur = cur->next;
 6255|   236k|	} while ((cur != NULL) && (cur->type != XML_ELEMENT_NODE));
  ------------------
  |  Branch (6255:11): [True: 170k, False: 66.1k]
  |  Branch (6255:28): [True: 89.5k, False: 80.7k]
  ------------------
 6256|   146k|	return(cur);
 6257|   918k|    }
 6258|   430k|    return(NULL);
 6259|  1.34M|}
xpath.c:xmlXPathNextPrecedingInternal:
 6756|  80.8k|{
 6757|  80.8k|    if ((ctxt == NULL) || (ctxt->context == NULL)) return(NULL);
  ------------------
  |  Branch (6757:9): [True: 0, False: 80.8k]
  |  Branch (6757:27): [True: 0, False: 80.8k]
  ------------------
 6758|  80.8k|    if (cur == NULL) {
  ------------------
  |  Branch (6758:9): [True: 3.70k, False: 77.1k]
  ------------------
 6759|  3.70k|        cur = ctxt->context->node;
 6760|  3.70k|        if (cur == NULL)
  ------------------
  |  Branch (6760:13): [True: 0, False: 3.70k]
  ------------------
 6761|      0|            return (NULL);
 6762|  3.70k|        if (cur->type == XML_ATTRIBUTE_NODE) {
  ------------------
  |  Branch (6762:13): [True: 0, False: 3.70k]
  ------------------
 6763|      0|            cur = cur->parent;
 6764|  3.70k|        } else if (cur->type == XML_NAMESPACE_DECL) {
  ------------------
  |  Branch (6764:20): [True: 0, False: 3.70k]
  ------------------
 6765|      0|            xmlNsPtr ns = (xmlNsPtr) cur;
 6766|       |
 6767|      0|            if ((ns->next == NULL) ||
  ------------------
  |  Branch (6767:17): [True: 0, False: 0]
  ------------------
 6768|      0|                (ns->next->type == XML_NAMESPACE_DECL))
  ------------------
  |  Branch (6768:17): [True: 0, False: 0]
  ------------------
 6769|      0|                return (NULL);
 6770|      0|            cur = (xmlNodePtr) ns->next;
 6771|      0|        }
 6772|  3.70k|        ctxt->ancestor = cur->parent;
 6773|  3.70k|    }
 6774|       |
 6775|  80.8k|    if (cur->type == XML_NAMESPACE_DECL || cur->type == XML_DOCUMENT_NODE)
  ------------------
  |  Branch (6775:9): [True: 0, False: 80.8k]
  |  Branch (6775:44): [True: 59, False: 80.7k]
  ------------------
 6776|     59|        return(NULL);
 6777|       |
 6778|  80.7k|    if ((cur->prev != NULL) && (cur->prev->type == XML_DTD_NODE))
  ------------------
  |  Branch (6778:9): [True: 33.8k, False: 46.9k]
  |  Branch (6778:32): [True: 2.09k, False: 31.7k]
  ------------------
 6779|  2.09k|	cur = cur->prev;
 6780|       |
 6781|  1.29M|    while (cur->prev == NULL) {
  ------------------
  |  Branch (6781:12): [True: 1.25M, False: 40.3k]
  ------------------
 6782|  1.25M|        cur = cur->parent;
 6783|  1.25M|        if (cur == NULL)
  ------------------
  |  Branch (6783:13): [True: 2.38k, False: 1.25M]
  ------------------
 6784|  2.38k|            return (NULL);
 6785|  1.25M|        if (cur == ctxt->context->doc->children)
  ------------------
  |  Branch (6785:13): [True: 1.27k, False: 1.25M]
  ------------------
 6786|  1.27k|            return (NULL);
 6787|  1.25M|        if (cur != ctxt->ancestor)
  ------------------
  |  Branch (6787:13): [True: 36.7k, False: 1.21M]
  ------------------
 6788|  36.7k|            return (cur);
 6789|  1.21M|        ctxt->ancestor = cur->parent;
 6790|  1.21M|    }
 6791|       |
 6792|  40.3k|    if (cur->type == XML_DOCUMENT_NODE)
  ------------------
  |  Branch (6792:9): [True: 0, False: 40.3k]
  ------------------
 6793|      0|        return(NULL);
 6794|       |
 6795|  40.3k|    cur = cur->prev;
 6796|  77.1k|    while (cur->last != NULL)
  ------------------
  |  Branch (6796:12): [True: 36.7k, False: 40.3k]
  ------------------
 6797|  36.7k|        cur = cur->last;
 6798|  40.3k|    return (cur);
 6799|  40.3k|}
xpath.c:xmlXPathIsPositionalPredicate:
 9736|   117k|{
 9737|       |
 9738|   117k|    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|   117k|    if ((op->op != XPATH_OP_PREDICATE) && (op->op != XPATH_OP_FILTER))
  ------------------
  |  Branch (9753:9): [True: 0, False: 117k]
  |  Branch (9753:43): [True: 0, False: 0]
  ------------------
 9754|      0|	return(0);
 9755|       |
 9756|   117k|    if (op->ch2 != -1) {
  ------------------
  |  Branch (9756:9): [True: 117k, False: 0]
  ------------------
 9757|   117k|	exprOp = &ctxt->comp->steps[op->ch2];
 9758|   117k|    } else
 9759|      0|	return(0);
 9760|       |
 9761|   117k|    if ((exprOp != NULL) &&
  ------------------
  |  Branch (9761:9): [True: 117k, False: 0]
  ------------------
 9762|   117k|	(exprOp->op == XPATH_OP_VALUE) &&
  ------------------
  |  Branch (9762:2): [True: 62.0k, False: 55.8k]
  ------------------
 9763|  62.0k|	(exprOp->value4 != NULL) &&
  ------------------
  |  Branch (9763:2): [True: 62.0k, False: 0]
  ------------------
 9764|  62.0k|	(((xmlXPathObjectPtr) exprOp->value4)->type == XPATH_NUMBER))
  ------------------
  |  Branch (9764:2): [True: 61.8k, False: 243]
  ------------------
 9765|  61.8k|    {
 9766|  61.8k|        double floatval = ((xmlXPathObjectPtr) exprOp->value4)->floatval;
 9767|       |
 9768|       |	/*
 9769|       |	* We have a "[n]" predicate here.
 9770|       |	* TODO: Unfortunately this simplistic test here is not
 9771|       |	* able to detect a position() predicate in compound
 9772|       |	* expressions like "[@attr = 'a" and position() = 1],
 9773|       |	* and even not the usage of position() in
 9774|       |	* "[position() = 1]"; thus - obviously - a position-range,
 9775|       |	* like it "[position() < 5]", is also not detected.
 9776|       |	* Maybe we could rewrite the AST to ease the optimization.
 9777|       |	*/
 9778|       |
 9779|  61.8k|        if ((floatval > INT_MIN) && (floatval < INT_MAX)) {
  ------------------
  |  Branch (9779:13): [True: 61.6k, False: 216]
  |  Branch (9779:37): [True: 58.2k, False: 3.43k]
  ------------------
 9780|  58.2k|	    *maxPos = (int) floatval;
 9781|  58.2k|            if (floatval == (double) *maxPos)
  ------------------
  |  Branch (9781:17): [True: 57.8k, False: 391]
  ------------------
 9782|  57.8k|                return(1);
 9783|  58.2k|        }
 9784|  61.8k|    }
 9785|  60.0k|    return(0);
 9786|   117k|}
xpath.c:xmlXPathCompOpEvalPredicate:
 9710|   148k|{
 9711|   148k|    if (op->ch1 != -1) {
  ------------------
  |  Branch (9711:9): [True: 1.16k, False: 147k]
  ------------------
 9712|  1.16k|	xmlXPathCompExprPtr comp = ctxt->comp;
 9713|       |	/*
 9714|       |	* Process inner predicates first.
 9715|       |	*/
 9716|  1.16k|	if (comp->steps[op->ch1].op != XPATH_OP_PREDICATE) {
  ------------------
  |  Branch (9716:6): [True: 0, False: 1.16k]
  ------------------
 9717|      0|            XP_ERROR(XPATH_INVALID_OPERAND);
  ------------------
  |  |  244|      0|    { xmlXPathErr(ctxt, X); return; }
  ------------------
 9718|      0|	}
 9719|  1.16k|        if (ctxt->context->depth >= XPATH_MAX_RECURSION_DEPTH)
  ------------------
  |  |  112|  1.16k|#define XPATH_MAX_RECURSION_DEPTH 500
  ------------------
  |  Branch (9719:13): [True: 1, False: 1.16k]
  ------------------
 9720|  1.16k|            XP_ERROR(XPATH_RECURSION_LIMIT_EXCEEDED);
  ------------------
  |  |  244|      1|    { xmlXPathErr(ctxt, X); return; }
  ------------------
 9721|  1.16k|        ctxt->context->depth += 1;
 9722|  1.16k|	xmlXPathCompOpEvalPredicate(ctxt, &comp->steps[op->ch1], set,
 9723|  1.16k|                                    1, set->nodeNr, hasNsNodes);
 9724|  1.16k|        ctxt->context->depth -= 1;
 9725|  1.16k|	CHECK_ERROR;
  ------------------
  |  |  230|  1.16k|    if (ctxt->error != XPATH_EXPRESSION_OK) return
  |  |  ------------------
  |  |  |  Branch (230:9): [True: 842, False: 322]
  |  |  ------------------
  ------------------
 9726|  1.16k|    }
 9727|       |
 9728|   147k|    if (op->ch2 != -1)
  ------------------
  |  Branch (9728:9): [True: 147k, False: 0]
  ------------------
 9729|   147k|        xmlXPathNodeSetFilter(ctxt, set, op->ch2, minPos, maxPos, hasNsNodes);
 9730|   147k|}
xpath.c:xmlXPathNodeSetFilter:
 9577|   161k|{
 9578|   161k|    xmlXPathContextPtr xpctxt;
 9579|   161k|    xmlNodePtr oldnode;
 9580|   161k|    xmlDocPtr olddoc;
 9581|   161k|    xmlXPathStepOpPtr filterOp;
 9582|   161k|    int oldcs, oldpp;
 9583|   161k|    int i, j, pos;
 9584|       |
 9585|   161k|    if ((set == NULL) || (set->nodeNr == 0))
  ------------------
  |  Branch (9585:9): [True: 0, False: 161k]
  |  Branch (9585:26): [True: 9.03k, False: 152k]
  ------------------
 9586|  9.03k|        return;
 9587|       |
 9588|       |    /*
 9589|       |    * Check if the node set contains a sufficient number of nodes for
 9590|       |    * the requested range.
 9591|       |    */
 9592|   152k|    if (set->nodeNr < minPos) {
  ------------------
  |  Branch (9592:9): [True: 4.17k, False: 148k]
  ------------------
 9593|  4.17k|        xmlXPathNodeSetClear(set, hasNsNodes);
 9594|  4.17k|        return;
 9595|  4.17k|    }
 9596|       |
 9597|   148k|    xpctxt = ctxt->context;
 9598|   148k|    oldnode = xpctxt->node;
 9599|   148k|    olddoc = xpctxt->doc;
 9600|   148k|    oldcs = xpctxt->contextSize;
 9601|   148k|    oldpp = xpctxt->proximityPosition;
 9602|   148k|    filterOp = &ctxt->comp->steps[filterOpIndex];
 9603|       |
 9604|   148k|    xpctxt->contextSize = set->nodeNr;
 9605|       |
 9606|   520k|    for (i = 0, j = 0, pos = 1; i < set->nodeNr; i++) {
  ------------------
  |  Branch (9606:33): [True: 432k, False: 87.6k]
  ------------------
 9607|   432k|        xmlNodePtr node = set->nodeTab[i];
 9608|   432k|        int res;
 9609|       |
 9610|   432k|        xpctxt->node = node;
 9611|   432k|        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|   432k|        if ((node->type != XML_NAMESPACE_DECL) &&
  ------------------
  |  Branch (9619:13): [True: 430k, False: 2.76k]
  ------------------
 9620|   430k|            (node->doc != NULL))
  ------------------
  |  Branch (9620:13): [True: 430k, False: 0]
  ------------------
 9621|   430k|            xpctxt->doc = node->doc;
 9622|       |
 9623|   432k|        res = xmlXPathCompOpEvalToBoolean(ctxt, filterOp, 1);
 9624|       |
 9625|   432k|        if (ctxt->error != XPATH_EXPRESSION_OK)
  ------------------
  |  Branch (9625:13): [True: 1.58k, False: 431k]
  ------------------
 9626|  1.58k|            break;
 9627|   431k|        if (res < 0) {
  ------------------
  |  Branch (9627:13): [True: 0, False: 431k]
  ------------------
 9628|       |            /* Shouldn't happen */
 9629|      0|            xmlXPathErr(ctxt, XPATH_EXPR_ERROR);
 9630|      0|            break;
 9631|      0|        }
 9632|       |
 9633|   431k|        if ((res != 0) && ((pos >= minPos) && (pos <= maxPos))) {
  ------------------
  |  Branch (9633:13): [True: 160k, False: 270k]
  |  Branch (9633:28): [True: 153k, False: 7.61k]
  |  Branch (9633:47): [True: 150k, False: 3.03k]
  ------------------
 9634|   150k|            if (i != j) {
  ------------------
  |  Branch (9634:17): [True: 5.29k, False: 145k]
  ------------------
 9635|  5.29k|                set->nodeTab[j] = node;
 9636|  5.29k|                set->nodeTab[i] = NULL;
 9637|  5.29k|            }
 9638|       |
 9639|   150k|            j += 1;
 9640|   280k|        } else {
 9641|       |            /* Remove the entry from the initial node set. */
 9642|   280k|            set->nodeTab[i] = NULL;
 9643|   280k|            if (node->type == XML_NAMESPACE_DECL)
  ------------------
  |  Branch (9643:17): [True: 2.64k, False: 278k]
  ------------------
 9644|  2.64k|                xmlXPathNodeSetFreeNs((xmlNsPtr) node);
 9645|   280k|        }
 9646|       |
 9647|   431k|        if (res != 0) {
  ------------------
  |  Branch (9647:13): [True: 160k, False: 270k]
  ------------------
 9648|   160k|            if (pos == maxPos) {
  ------------------
  |  Branch (9648:17): [True: 59.1k, False: 101k]
  ------------------
 9649|  59.1k|                i += 1;
 9650|  59.1k|                break;
 9651|  59.1k|            }
 9652|       |
 9653|   101k|            pos += 1;
 9654|   101k|        }
 9655|   431k|    }
 9656|       |
 9657|       |    /* Free remaining nodes. */
 9658|   148k|    if (hasNsNodes) {
  ------------------
  |  Branch (9658:9): [True: 6.82k, False: 141k]
  ------------------
 9659|  7.94k|        for (; i < set->nodeNr; i++) {
  ------------------
  |  Branch (9659:16): [True: 1.12k, False: 6.82k]
  ------------------
 9660|  1.12k|            xmlNodePtr node = set->nodeTab[i];
 9661|  1.12k|            if ((node != NULL) && (node->type == XML_NAMESPACE_DECL))
  ------------------
  |  Branch (9661:17): [True: 1.12k, False: 0]
  |  Branch (9661:35): [True: 25, False: 1.10k]
  ------------------
 9662|     25|                xmlXPathNodeSetFreeNs((xmlNsPtr) node);
 9663|  1.12k|        }
 9664|  6.82k|    }
 9665|       |
 9666|   148k|    set->nodeNr = j;
 9667|       |
 9668|       |    /* If too many elements were removed, shrink table to preserve memory. */
 9669|   148k|    if ((set->nodeMax > XML_NODESET_DEFAULT) &&
  ------------------
  |  | 2593|   148k|#define XML_NODESET_DEFAULT	10
  ------------------
  |  Branch (9669:9): [True: 9.83k, False: 138k]
  ------------------
 9670|  9.83k|        (set->nodeNr < set->nodeMax / 2)) {
  ------------------
  |  Branch (9670:9): [True: 5.77k, False: 4.05k]
  ------------------
 9671|  5.77k|        xmlNodePtr *tmp;
 9672|  5.77k|        int nodeMax = set->nodeNr;
 9673|       |
 9674|  5.77k|        if (nodeMax < XML_NODESET_DEFAULT)
  ------------------
  |  | 2593|  5.77k|#define XML_NODESET_DEFAULT	10
  ------------------
  |  Branch (9674:13): [True: 5.67k, False: 103]
  ------------------
 9675|  5.67k|            nodeMax = XML_NODESET_DEFAULT;
  ------------------
  |  | 2593|  5.67k|#define XML_NODESET_DEFAULT	10
  ------------------
 9676|  5.77k|        tmp = (xmlNodePtr *) xmlRealloc(set->nodeTab,
 9677|  5.77k|                nodeMax * sizeof(xmlNodePtr));
 9678|  5.77k|        if (tmp == NULL) {
  ------------------
  |  Branch (9678:13): [True: 1, False: 5.77k]
  ------------------
 9679|      1|            xmlXPathPErrMemory(ctxt);
 9680|  5.77k|        } else {
 9681|  5.77k|            set->nodeTab = tmp;
 9682|  5.77k|            set->nodeMax = nodeMax;
 9683|  5.77k|        }
 9684|  5.77k|    }
 9685|       |
 9686|   148k|    xpctxt->node = oldnode;
 9687|   148k|    xpctxt->doc = olddoc;
 9688|   148k|    xpctxt->contextSize = oldcs;
 9689|   148k|    xpctxt->proximityPosition = oldpp;
 9690|   148k|}
xpath.c:xmlXPathCompOpEval:
10750|  3.83M|{
10751|  3.83M|    int total = 0;
10752|  3.83M|    int equal, ret;
10753|  3.83M|    xmlXPathCompExprPtr comp;
10754|  3.83M|    xmlXPathObjectPtr arg1, arg2;
10755|       |
10756|  3.83M|    CHECK_ERROR0;
  ------------------
  |  |  236|  3.83M|    if (ctxt->error != XPATH_EXPRESSION_OK) return(0)
  |  |  ------------------
  |  |  |  Branch (236:9): [True: 4, False: 3.83M]
  |  |  ------------------
  ------------------
10757|  3.83M|    if (OP_LIMIT_EXCEEDED(ctxt, 1))
  ------------------
  |  |  818|  3.83M|    ((ctxt->context->opLimit != 0) && (xmlXPathCheckOpLimit(ctxt, n) < 0))
  |  |  ------------------
  |  |  |  Branch (818:6): [True: 3.83M, False: 0]
  |  |  |  Branch (818:39): [True: 48, False: 3.83M]
  |  |  ------------------
  ------------------
10758|     48|        return(0);
10759|  3.83M|    if (ctxt->context->depth >= XPATH_MAX_RECURSION_DEPTH)
  ------------------
  |  |  112|  3.83M|#define XPATH_MAX_RECURSION_DEPTH 500
  ------------------
  |  Branch (10759:9): [True: 22, False: 3.83M]
  ------------------
10760|  3.83M|        XP_ERROR0(XPATH_RECURSION_LIMIT_EXCEEDED);
  ------------------
  |  |  252|     22|    { xmlXPathErr(ctxt, X); return(0); }
  ------------------
10761|  3.83M|    ctxt->context->depth += 1;
10762|  3.83M|    comp = ctxt->comp;
10763|  3.83M|    switch (op->op) {
10764|      0|        case XPATH_OP_END:
  ------------------
  |  Branch (10764:9): [True: 0, False: 3.83M]
  ------------------
10765|      0|            break;
10766|  1.99k|        case XPATH_OP_AND:
  ------------------
  |  Branch (10766:9): [True: 1.99k, False: 3.83M]
  ------------------
10767|  1.99k|            total += xmlXPathCompOpEval(ctxt, &comp->steps[op->ch1]);
10768|  1.99k|	    CHECK_ERROR0;
  ------------------
  |  |  236|  1.99k|    if (ctxt->error != XPATH_EXPRESSION_OK) return(0)
  |  |  ------------------
  |  |  |  Branch (236:9): [True: 101, False: 1.89k]
  |  |  ------------------
  ------------------
10769|  1.89k|            xmlXPathBooleanFunction(ctxt, 1);
10770|  1.89k|            if ((ctxt->value == NULL) || (ctxt->value->boolval == 0))
  ------------------
  |  Branch (10770:17): [True: 1, False: 1.89k]
  |  Branch (10770:42): [True: 611, False: 1.28k]
  ------------------
10771|    612|                break;
10772|  1.28k|            arg2 = xmlXPathValuePop(ctxt);
10773|  1.28k|            total += xmlXPathCompOpEval(ctxt, &comp->steps[op->ch2]);
10774|  1.28k|	    if (ctxt->error) {
  ------------------
  |  Branch (10774:10): [True: 16, False: 1.26k]
  ------------------
10775|     16|		xmlXPathFreeObject(arg2);
10776|     16|		break;
10777|     16|	    }
10778|  1.26k|            xmlXPathBooleanFunction(ctxt, 1);
10779|  1.26k|            if (ctxt->value != NULL)
  ------------------
  |  Branch (10779:17): [True: 1.26k, False: 2]
  ------------------
10780|  1.26k|                ctxt->value->boolval &= arg2->boolval;
10781|  1.26k|	    xmlXPathReleaseObject(ctxt->context, arg2);
10782|  1.26k|            break;
10783|  4.60k|        case XPATH_OP_OR:
  ------------------
  |  Branch (10783:9): [True: 4.60k, False: 3.83M]
  ------------------
10784|  4.60k|            total += xmlXPathCompOpEval(ctxt, &comp->steps[op->ch1]);
10785|  4.60k|	    CHECK_ERROR0;
  ------------------
  |  |  236|  4.60k|    if (ctxt->error != XPATH_EXPRESSION_OK) return(0)
  |  |  ------------------
  |  |  |  Branch (236:9): [True: 858, False: 3.74k]
  |  |  ------------------
  ------------------
10786|  3.74k|            xmlXPathBooleanFunction(ctxt, 1);
10787|  3.74k|            if ((ctxt->value == NULL) || (ctxt->value->boolval == 1))
  ------------------
  |  Branch (10787:17): [True: 2, False: 3.74k]
  |  Branch (10787:42): [True: 1.29k, False: 2.44k]
  ------------------
10788|  1.29k|                break;
10789|  2.44k|            arg2 = xmlXPathValuePop(ctxt);
10790|  2.44k|            total += xmlXPathCompOpEval(ctxt, &comp->steps[op->ch2]);
10791|  2.44k|	    if (ctxt->error) {
  ------------------
  |  Branch (10791:10): [True: 110, False: 2.33k]
  ------------------
10792|    110|		xmlXPathFreeObject(arg2);
10793|    110|		break;
10794|    110|	    }
10795|  2.33k|            xmlXPathBooleanFunction(ctxt, 1);
10796|  2.33k|            if (ctxt->value != NULL)
  ------------------
  |  Branch (10796:17): [True: 2.33k, False: 5]
  ------------------
10797|  2.33k|                ctxt->value->boolval |= arg2->boolval;
10798|  2.33k|	    xmlXPathReleaseObject(ctxt->context, arg2);
10799|  2.33k|            break;
10800|   340k|        case XPATH_OP_EQUAL:
  ------------------
  |  Branch (10800:9): [True: 340k, False: 3.49M]
  ------------------
10801|   340k|            total += xmlXPathCompOpEval(ctxt, &comp->steps[op->ch1]);
10802|   340k|	    CHECK_ERROR0;
  ------------------
  |  |  236|   340k|    if (ctxt->error != XPATH_EXPRESSION_OK) return(0)
  |  |  ------------------
  |  |  |  Branch (236:9): [True: 5.07k, False: 335k]
  |  |  ------------------
  ------------------
10803|   335k|            total += xmlXPathCompOpEval(ctxt, &comp->steps[op->ch2]);
10804|   335k|	    CHECK_ERROR0;
  ------------------
  |  |  236|   335k|    if (ctxt->error != XPATH_EXPRESSION_OK) return(0)
  |  |  ------------------
  |  |  |  Branch (236:9): [True: 1.41k, False: 333k]
  |  |  ------------------
  ------------------
10805|   333k|	    if (op->value)
  ------------------
  |  Branch (10805:10): [True: 326k, False: 7.19k]
  ------------------
10806|   326k|		equal = xmlXPathEqualValues(ctxt);
10807|  7.19k|	    else
10808|  7.19k|		equal = xmlXPathNotEqualValues(ctxt);
10809|   333k|	    xmlXPathValuePush(ctxt, xmlXPathCacheNewBoolean(ctxt, equal));
10810|   333k|            break;
10811|   159k|        case XPATH_OP_CMP:
  ------------------
  |  Branch (10811:9): [True: 159k, False: 3.68M]
  ------------------
10812|   159k|            total += xmlXPathCompOpEval(ctxt, &comp->steps[op->ch1]);
10813|   159k|	    CHECK_ERROR0;
  ------------------
  |  |  236|   159k|    if (ctxt->error != XPATH_EXPRESSION_OK) return(0)
  |  |  ------------------
  |  |  |  Branch (236:9): [True: 1.21k, False: 157k]
  |  |  ------------------
  ------------------
10814|   157k|            total += xmlXPathCompOpEval(ctxt, &comp->steps[op->ch2]);
10815|   157k|	    CHECK_ERROR0;
  ------------------
  |  |  236|   157k|    if (ctxt->error != XPATH_EXPRESSION_OK) return(0)
  |  |  ------------------
  |  |  |  Branch (236:9): [True: 717, False: 157k]
  |  |  ------------------
  ------------------
10816|   157k|            ret = xmlXPathCompareValues(ctxt, op->value, op->value2);
10817|   157k|	    xmlXPathValuePush(ctxt, xmlXPathCacheNewBoolean(ctxt, ret));
10818|   157k|            break;
10819|   311k|        case XPATH_OP_PLUS:
  ------------------
  |  Branch (10819:9): [True: 311k, False: 3.52M]
  ------------------
10820|   311k|            total += xmlXPathCompOpEval(ctxt, &comp->steps[op->ch1]);
10821|   311k|	    CHECK_ERROR0;
  ------------------
  |  |  236|   311k|    if (ctxt->error != XPATH_EXPRESSION_OK) return(0)
  |  |  ------------------
  |  |  |  Branch (236:9): [True: 4.66k, False: 307k]
  |  |  ------------------
  ------------------
10822|   307k|            if (op->ch2 != -1) {
  ------------------
  |  Branch (10822:17): [True: 160k, False: 147k]
  ------------------
10823|   160k|                total += xmlXPathCompOpEval(ctxt, &comp->steps[op->ch2]);
10824|   160k|	    }
10825|   307k|	    CHECK_ERROR0;
  ------------------
  |  |  236|   307k|    if (ctxt->error != XPATH_EXPRESSION_OK) return(0)
  |  |  ------------------
  |  |  |  Branch (236:9): [True: 994, False: 306k]
  |  |  ------------------
  ------------------
10826|   306k|            if (op->value == 0)
  ------------------
  |  Branch (10826:17): [True: 77.8k, False: 228k]
  ------------------
10827|  77.8k|                xmlXPathSubValues(ctxt);
10828|   228k|            else if (op->value == 1)
  ------------------
  |  Branch (10828:22): [True: 81.1k, False: 147k]
  ------------------
10829|  81.1k|                xmlXPathAddValues(ctxt);
10830|   147k|            else if (op->value == 2)
  ------------------
  |  Branch (10830:22): [True: 124k, False: 22.3k]
  ------------------
10831|   124k|                xmlXPathValueFlipSign(ctxt);
10832|  22.3k|            else if (op->value == 3) {
  ------------------
  |  Branch (10832:22): [True: 22.3k, False: 0]
  ------------------
10833|  22.3k|                CAST_TO_NUMBER;
  ------------------
  |  |  297|  22.3k|    if ((ctxt->value != NULL) && (ctxt->value->type != XPATH_NUMBER))	\
  |  |  ------------------
  |  |  |  Branch (297:9): [True: 22.3k, False: 0]
  |  |  |  Branch (297:34): [True: 13.5k, False: 8.78k]
  |  |  ------------------
  |  |  298|  22.3k|        xmlXPathNumberFunction(ctxt, 1);
  ------------------
10834|  22.3k|                CHECK_TYPE0(XPATH_NUMBER);
  ------------------
  |  |  271|  22.3k|    if ((ctxt->value == NULL) || (ctxt->value->type != typeval))	\
  |  |  ------------------
  |  |  |  Branch (271:9): [True: 1, False: 22.3k]
  |  |  |  Branch (271:34): [True: 2, False: 22.3k]
  |  |  ------------------
  |  |  272|  22.3k|        XP_ERROR0(XPATH_INVALID_TYPE)
  |  |  ------------------
  |  |  |  |  252|      3|    { xmlXPathErr(ctxt, X); return(0); }
  |  |  ------------------
  ------------------
10835|  22.3k|            }
10836|   306k|            break;
10837|   306k|        case XPATH_OP_MULT:
  ------------------
  |  Branch (10837:9): [True: 216k, False: 3.62M]
  ------------------
10838|   216k|            total += xmlXPathCompOpEval(ctxt, &comp->steps[op->ch1]);
10839|   216k|	    CHECK_ERROR0;
  ------------------
  |  |  236|   216k|    if (ctxt->error != XPATH_EXPRESSION_OK) return(0)
  |  |  ------------------
  |  |  |  Branch (236:9): [True: 11.6k, False: 204k]
  |  |  ------------------
  ------------------
10840|   204k|            total += xmlXPathCompOpEval(ctxt, &comp->steps[op->ch2]);
10841|   204k|	    CHECK_ERROR0;
  ------------------
  |  |  236|   204k|    if (ctxt->error != XPATH_EXPRESSION_OK) return(0)
  |  |  ------------------
  |  |  |  Branch (236:9): [True: 370, False: 204k]
  |  |  ------------------
  ------------------
10842|   204k|            if (op->value == 0)
  ------------------
  |  Branch (10842:17): [True: 202k, False: 2.10k]
  ------------------
10843|   202k|                xmlXPathMultValues(ctxt);
10844|  2.10k|            else if (op->value == 1)
  ------------------
  |  Branch (10844:22): [True: 1.25k, False: 857]
  ------------------
10845|  1.25k|                xmlXPathDivValues(ctxt);
10846|    857|            else if (op->value == 2)
  ------------------
  |  Branch (10846:22): [True: 857, False: 0]
  ------------------
10847|    857|                xmlXPathModValues(ctxt);
10848|   204k|            break;
10849|   126k|        case XPATH_OP_UNION:
  ------------------
  |  Branch (10849:9): [True: 126k, False: 3.71M]
  ------------------
10850|   126k|            total += xmlXPathCompOpEval(ctxt, &comp->steps[op->ch1]);
10851|   126k|	    CHECK_ERROR0;
  ------------------
  |  |  236|   126k|    if (ctxt->error != XPATH_EXPRESSION_OK) return(0)
  |  |  ------------------
  |  |  |  Branch (236:9): [True: 507, False: 125k]
  |  |  ------------------
  ------------------
10852|   125k|            total += xmlXPathCompOpEval(ctxt, &comp->steps[op->ch2]);
10853|   125k|	    CHECK_ERROR0;
  ------------------
  |  |  236|   125k|    if (ctxt->error != XPATH_EXPRESSION_OK) return(0)
  |  |  ------------------
  |  |  |  Branch (236:9): [True: 311, False: 125k]
  |  |  ------------------
  ------------------
10854|       |
10855|   125k|            arg2 = xmlXPathValuePop(ctxt);
10856|   125k|            arg1 = xmlXPathValuePop(ctxt);
10857|   125k|            if ((arg1 == NULL) || (arg1->type != XPATH_NODESET) ||
  ------------------
  |  Branch (10857:17): [True: 0, False: 125k]
  |  Branch (10857:35): [True: 41, False: 125k]
  ------------------
10858|   125k|                (arg2 == NULL) || (arg2->type != XPATH_NODESET)) {
  ------------------
  |  Branch (10858:17): [True: 0, False: 125k]
  |  Branch (10858:35): [True: 15, False: 125k]
  ------------------
10859|     56|	        xmlXPathReleaseObject(ctxt->context, arg1);
10860|     56|	        xmlXPathReleaseObject(ctxt->context, arg2);
10861|     56|                XP_ERROR0(XPATH_INVALID_TYPE);
  ------------------
  |  |  252|     56|    { xmlXPathErr(ctxt, X); return(0); }
  ------------------
10862|      0|            }
10863|   125k|            if ((ctxt->context->opLimit != 0) &&
  ------------------
  |  Branch (10863:17): [True: 125k, False: 0]
  ------------------
10864|   125k|                (((arg1->nodesetval != NULL) &&
  ------------------
  |  Branch (10864:19): [True: 125k, False: 0]
  ------------------
10865|   125k|                  (xmlXPathCheckOpLimit(ctxt,
  ------------------
  |  Branch (10865:19): [True: 8, False: 125k]
  ------------------
10866|   125k|                                        arg1->nodesetval->nodeNr) < 0)) ||
10867|   125k|                 ((arg2->nodesetval != NULL) &&
  ------------------
  |  Branch (10867:19): [True: 125k, False: 0]
  ------------------
10868|   125k|                  (xmlXPathCheckOpLimit(ctxt,
  ------------------
  |  Branch (10868:19): [True: 3, False: 125k]
  ------------------
10869|   125k|                                        arg2->nodesetval->nodeNr) < 0)))) {
10870|     11|	        xmlXPathReleaseObject(ctxt->context, arg1);
10871|     11|	        xmlXPathReleaseObject(ctxt->context, arg2);
10872|     11|                break;
10873|     11|            }
10874|       |
10875|   125k|	    if (((arg2->nodesetval != NULL) &&
  ------------------
  |  Branch (10875:11): [True: 125k, False: 0]
  ------------------
10876|   125k|		 (arg2->nodesetval->nodeNr != 0)))
  ------------------
  |  Branch (10876:4): [True: 51.2k, False: 74.3k]
  ------------------
10877|  51.2k|	    {
10878|  51.2k|		arg1->nodesetval = xmlXPathNodeSetMerge(arg1->nodesetval,
10879|  51.2k|							arg2->nodesetval);
10880|  51.2k|                if (arg1->nodesetval == NULL)
  ------------------
  |  Branch (10880:21): [True: 52, False: 51.1k]
  ------------------
10881|     52|                    xmlXPathPErrMemory(ctxt);
10882|  51.2k|	    }
10883|       |
10884|   125k|            xmlXPathValuePush(ctxt, arg1);
10885|   125k|	    xmlXPathReleaseObject(ctxt->context, arg2);
10886|   125k|            break;
10887|   322k|        case XPATH_OP_ROOT:
  ------------------
  |  Branch (10887:9): [True: 322k, False: 3.51M]
  ------------------
10888|   322k|            xmlXPathRoot(ctxt);
10889|   322k|            break;
10890|   788k|        case XPATH_OP_NODE:
  ------------------
  |  Branch (10890:9): [True: 788k, False: 3.05M]
  ------------------
10891|   788k|            if (op->ch1 != -1)
  ------------------
  |  Branch (10891:17): [True: 0, False: 788k]
  ------------------
10892|      0|                total += xmlXPathCompOpEval(ctxt, &comp->steps[op->ch1]);
10893|   788k|	    CHECK_ERROR0;
  ------------------
  |  |  236|   788k|    if (ctxt->error != XPATH_EXPRESSION_OK) return(0)
  |  |  ------------------
  |  |  |  Branch (236:9): [True: 0, False: 788k]
  |  |  ------------------
  ------------------
10894|   788k|            if (op->ch2 != -1)
  ------------------
  |  Branch (10894:17): [True: 0, False: 788k]
  ------------------
10895|      0|                total += xmlXPathCompOpEval(ctxt, &comp->steps[op->ch2]);
10896|   788k|	    CHECK_ERROR0;
  ------------------
  |  |  236|   788k|    if (ctxt->error != XPATH_EXPRESSION_OK) return(0)
  |  |  ------------------
  |  |  |  Branch (236:9): [True: 0, False: 788k]
  |  |  ------------------
  ------------------
10897|   788k|	    xmlXPathValuePush(ctxt, xmlXPathCacheNewNodeSet(ctxt,
10898|   788k|                                                    ctxt->context->node));
10899|   788k|            break;
10900|   968k|        case XPATH_OP_COLLECT:{
  ------------------
  |  Branch (10900:9): [True: 968k, False: 2.87M]
  ------------------
10901|   968k|                if (op->ch1 == -1)
  ------------------
  |  Branch (10901:21): [True: 0, False: 968k]
  ------------------
10902|      0|                    break;
10903|       |
10904|   968k|                total += xmlXPathCompOpEval(ctxt, &comp->steps[op->ch1]);
10905|   968k|		CHECK_ERROR0;
  ------------------
  |  |  236|   968k|    if (ctxt->error != XPATH_EXPRESSION_OK) return(0)
  |  |  ------------------
  |  |  |  Branch (236:9): [True: 1.45k, False: 966k]
  |  |  ------------------
  ------------------
10906|       |
10907|   966k|                total += xmlXPathNodeCollectAndTest(ctxt, op, NULL, NULL, 0);
10908|   966k|                break;
10909|   968k|            }
10910|   306k|        case XPATH_OP_VALUE:
  ------------------
  |  Branch (10910:9): [True: 306k, False: 3.53M]
  ------------------
10911|   306k|            xmlXPathValuePush(ctxt, xmlXPathCacheObjectCopy(ctxt, op->value4));
10912|   306k|            break;
10913|     92|        case XPATH_OP_VARIABLE:{
  ------------------
  |  Branch (10913:9): [True: 92, False: 3.83M]
  ------------------
10914|     92|		xmlXPathObjectPtr val;
10915|       |
10916|     92|                if (op->ch1 != -1)
  ------------------
  |  Branch (10916:21): [True: 0, False: 92]
  ------------------
10917|      0|                    total +=
10918|      0|                        xmlXPathCompOpEval(ctxt, &comp->steps[op->ch1]);
10919|     92|                if (op->value5 == NULL) {
  ------------------
  |  Branch (10919:21): [True: 72, False: 20]
  ------------------
10920|     72|		    val = xmlXPathVariableLookup(ctxt->context, op->value4);
10921|     72|		    if (val == NULL) {
  ------------------
  |  Branch (10921:11): [True: 72, False: 0]
  ------------------
10922|     72|                        xmlXPathErrFmt(ctxt, XPATH_UNDEF_VARIABLE_ERROR,
10923|     72|                                       "Undefined variable: %s\n", op->value4);
10924|     72|                        return 0;
10925|     72|                    }
10926|      0|                    xmlXPathValuePush(ctxt, val);
10927|     20|		} else {
10928|     20|                    const xmlChar *URI;
10929|       |
10930|     20|                    URI = xmlXPathNsLookup(ctxt->context, op->value5);
10931|     20|                    if (URI == NULL) {
  ------------------
  |  Branch (10931:25): [True: 6, False: 14]
  ------------------
10932|      6|                        xmlXPathErrFmt(ctxt, XPATH_UNDEF_PREFIX_ERROR,
10933|      6|                                       "Undefined namespace prefix: %s\n",
10934|      6|                                       op->value5);
10935|      6|                        return 0;
10936|      6|                    }
10937|     14|		    val = xmlXPathVariableLookupNS(ctxt->context,
10938|     14|                                                       op->value4, URI);
10939|     14|		    if (val == NULL) {
  ------------------
  |  Branch (10939:11): [True: 14, False: 0]
  ------------------
10940|     14|                        xmlXPathErrFmt(ctxt, XPATH_UNDEF_VARIABLE_ERROR,
10941|     14|                                       "Undefined variable: %s:%s\n",
10942|     14|                                       op->value5, op->value4);
10943|     14|                        return 0;
10944|     14|                    }
10945|      0|                    xmlXPathValuePush(ctxt, val);
10946|      0|                }
10947|      0|                break;
10948|     92|            }
10949|  70.3k|        case XPATH_OP_FUNCTION:{
  ------------------
  |  Branch (10949:9): [True: 70.3k, False: 3.76M]
  ------------------
10950|  70.3k|                xmlXPathFunction func;
10951|  70.3k|                const xmlChar *oldFunc, *oldFuncURI;
10952|  70.3k|		int i;
10953|  70.3k|                int frame;
10954|       |
10955|  70.3k|                frame = ctxt->valueNr;
10956|  70.3k|                if (op->ch1 != -1) {
  ------------------
  |  Branch (10956:21): [True: 52.3k, False: 18.0k]
  ------------------
10957|  52.3k|                    total +=
10958|  52.3k|                        xmlXPathCompOpEval(ctxt, &comp->steps[op->ch1]);
10959|  52.3k|                    if (ctxt->error != XPATH_EXPRESSION_OK)
  ------------------
  |  Branch (10959:25): [True: 938, False: 51.3k]
  ------------------
10960|    938|                        break;
10961|  52.3k|                }
10962|  69.4k|		if (ctxt->valueNr < frame + op->value)
  ------------------
  |  Branch (10962:7): [True: 0, False: 69.4k]
  ------------------
10963|  69.4k|		    XP_ERROR0(XPATH_INVALID_OPERAND);
  ------------------
  |  |  252|      0|    { xmlXPathErr(ctxt, X); return(0); }
  ------------------
10964|   158k|		for (i = 0; i < op->value; i++) {
  ------------------
  |  Branch (10964:15): [True: 89.2k, False: 69.4k]
  ------------------
10965|  89.2k|		    if (ctxt->valueTab[(ctxt->valueNr - 1) - i] == NULL)
  ------------------
  |  Branch (10965:11): [True: 0, False: 89.2k]
  ------------------
10966|  89.2k|			XP_ERROR0(XPATH_INVALID_OPERAND);
  ------------------
  |  |  252|      0|    { xmlXPathErr(ctxt, X); return(0); }
  ------------------
10967|  89.2k|                }
10968|  69.4k|                if (op->cache != NULL)
  ------------------
  |  Branch (10968:21): [True: 62.0k, False: 7.38k]
  ------------------
10969|  62.0k|                    func = op->cache;
10970|  7.38k|                else {
10971|  7.38k|                    const xmlChar *URI = NULL;
10972|       |
10973|  7.38k|                    if (op->value5 == NULL) {
  ------------------
  |  Branch (10973:25): [True: 7.32k, False: 60]
  ------------------
10974|  7.32k|                        func = xmlXPathFunctionLookup(ctxt->context,
10975|  7.32k|                                                      op->value4);
10976|  7.32k|                        if (func == NULL) {
  ------------------
  |  Branch (10976:29): [True: 519, False: 6.80k]
  ------------------
10977|    519|                            xmlXPathErrFmt(ctxt, XPATH_UNKNOWN_FUNC_ERROR,
10978|    519|                                           "Unregistered function: %s\n",
10979|    519|                                           op->value4);
10980|    519|                            return 0;
10981|    519|                        }
10982|  7.32k|                    } else {
10983|     60|                        URI = xmlXPathNsLookup(ctxt->context, op->value5);
10984|     60|                        if (URI == NULL) {
  ------------------
  |  Branch (10984:29): [True: 51, False: 9]
  ------------------
10985|     51|                            xmlXPathErrFmt(ctxt, XPATH_UNDEF_PREFIX_ERROR,
10986|     51|                                           "Undefined namespace prefix: %s\n",
10987|     51|                                           op->value5);
10988|     51|                            return 0;
10989|     51|                        }
10990|      9|                        func = xmlXPathFunctionLookupNS(ctxt->context,
10991|      9|                                                        op->value4, URI);
10992|      9|                        if (func == NULL) {
  ------------------
  |  Branch (10992:29): [True: 9, False: 0]
  ------------------
10993|      9|                            xmlXPathErrFmt(ctxt, XPATH_UNKNOWN_FUNC_ERROR,
10994|      9|                                           "Unregistered function: %s:%s\n",
10995|      9|                                           op->value5, op->value4);
10996|      9|                            return 0;
10997|      9|                        }
10998|      9|                    }
10999|  6.80k|                    op->cache = func;
11000|  6.80k|                    op->cacheURI = (void *) URI;
11001|  6.80k|                }
11002|  68.8k|                oldFunc = ctxt->context->function;
11003|  68.8k|                oldFuncURI = ctxt->context->functionURI;
11004|  68.8k|                ctxt->context->function = op->value4;
11005|  68.8k|                ctxt->context->functionURI = op->cacheURI;
11006|  68.8k|                func(ctxt, op->value);
11007|  68.8k|                ctxt->context->function = oldFunc;
11008|  68.8k|                ctxt->context->functionURI = oldFuncURI;
11009|  68.8k|                if ((ctxt->error == XPATH_EXPRESSION_OK) &&
  ------------------
  |  Branch (11009:21): [True: 68.5k, False: 282]
  ------------------
11010|  68.5k|                    (ctxt->valueNr != frame + 1))
  ------------------
  |  Branch (11010:21): [True: 0, False: 68.5k]
  ------------------
11011|  68.8k|                    XP_ERROR0(XPATH_STACK_ERROR);
  ------------------
  |  |  252|      0|    { xmlXPathErr(ctxt, X); return(0); }
  ------------------
11012|  68.8k|                break;
11013|  68.8k|            }
11014|  91.6k|        case XPATH_OP_ARG:
  ------------------
  |  Branch (11014:9): [True: 91.6k, False: 3.74M]
  ------------------
11015|  91.6k|            if (op->ch1 != -1) {
  ------------------
  |  Branch (11015:17): [True: 39.2k, False: 52.3k]
  ------------------
11016|  39.2k|                total += xmlXPathCompOpEval(ctxt, &comp->steps[op->ch1]);
11017|  39.2k|	        CHECK_ERROR0;
  ------------------
  |  |  236|  39.2k|    if (ctxt->error != XPATH_EXPRESSION_OK) return(0)
  |  |  ------------------
  |  |  |  Branch (236:9): [True: 930, False: 38.3k]
  |  |  ------------------
  ------------------
11018|  39.2k|            }
11019|  90.6k|            if (op->ch2 != -1) {
  ------------------
  |  Branch (11019:17): [True: 90.6k, False: 0]
  ------------------
11020|  90.6k|                total += xmlXPathCompOpEval(ctxt, &comp->steps[op->ch2]);
11021|  90.6k|	        CHECK_ERROR0;
  ------------------
  |  |  236|  90.6k|    if (ctxt->error != XPATH_EXPRESSION_OK) return(0)
  |  |  ------------------
  |  |  |  Branch (236:9): [True: 938, False: 89.7k]
  |  |  ------------------
  ------------------
11022|  90.6k|	    }
11023|  89.7k|            break;
11024|  89.7k|        case XPATH_OP_PREDICATE:
  ------------------
  |  Branch (11024:9): [True: 0, False: 3.83M]
  ------------------
11025|  25.7k|        case XPATH_OP_FILTER:{
  ------------------
  |  Branch (11025:9): [True: 25.7k, False: 3.81M]
  ------------------
11026|  25.7k|                xmlXPathObjectPtr obj;
11027|  25.7k|                xmlNodeSetPtr set;
11028|       |
11029|       |                /*
11030|       |                 * Optimization for ()[1] selection i.e. the first elem
11031|       |                 */
11032|  25.7k|                if ((op->ch1 != -1) && (op->ch2 != -1) &&
  ------------------
  |  Branch (11032:21): [True: 25.7k, False: 0]
  |  Branch (11032:40): [True: 25.7k, False: 0]
  ------------------
11033|  25.7k|#ifdef XP_OPTIMIZED_FILTER_FIRST
11034|       |		    /*
11035|       |		    * FILTER TODO: Can we assume that the inner processing
11036|       |		    *  will result in an ordered list if we have an
11037|       |		    *  XPATH_OP_FILTER?
11038|       |		    *  What about an additional field or flag on
11039|       |		    *  xmlXPathObject like @sorted ? This way we wouldn't need
11040|       |		    *  to assume anything, so it would be more robust and
11041|       |		    *  easier to optimize.
11042|       |		    */
11043|  25.7k|                    ((comp->steps[op->ch1].op == XPATH_OP_SORT) || /* 18 */
  ------------------
  |  Branch (11043:22): [True: 14.8k, False: 10.8k]
  ------------------
11044|  10.8k|		     (comp->steps[op->ch1].op == XPATH_OP_FILTER)) && /* 17 */
  ------------------
  |  Branch (11044:8): [True: 10.7k, False: 130]
  ------------------
11045|       |#else
11046|       |		    (comp->steps[op->ch1].op == XPATH_OP_SORT) &&
11047|       |#endif
11048|  25.5k|                    (comp->steps[op->ch2].op == XPATH_OP_VALUE)) { /* 12 */
  ------------------
  |  Branch (11048:21): [True: 18.2k, False: 7.34k]
  ------------------
11049|  18.2k|                    xmlXPathObjectPtr val;
11050|       |
11051|  18.2k|                    val = comp->steps[op->ch2].value4;
11052|  18.2k|                    if ((val != NULL) && (val->type == XPATH_NUMBER) &&
  ------------------
  |  Branch (11052:25): [True: 18.2k, False: 0]
  |  Branch (11052:42): [True: 18.2k, False: 10]
  ------------------
11053|  18.2k|                        (val->floatval == 1.0)) {
  ------------------
  |  Branch (11053:25): [True: 12.9k, False: 5.31k]
  ------------------
11054|  12.9k|                        xmlNodePtr first = NULL;
11055|       |
11056|  12.9k|                        total +=
11057|  12.9k|                            xmlXPathCompOpEvalFirst(ctxt,
11058|  12.9k|                                                    &comp->steps[op->ch1],
11059|  12.9k|                                                    &first);
11060|  12.9k|			CHECK_ERROR0;
  ------------------
  |  |  236|  12.9k|    if (ctxt->error != XPATH_EXPRESSION_OK) return(0)
  |  |  ------------------
  |  |  |  Branch (236:9): [True: 975, False: 11.9k]
  |  |  ------------------
  ------------------
11061|       |                        /*
11062|       |                         * The nodeset should be in document order,
11063|       |                         * Keep only the first value
11064|       |                         */
11065|  11.9k|                        if ((ctxt->value != NULL) &&
  ------------------
  |  Branch (11065:29): [True: 11.9k, False: 0]
  ------------------
11066|  11.9k|                            (ctxt->value->type == XPATH_NODESET) &&
  ------------------
  |  Branch (11066:29): [True: 11.7k, False: 147]
  ------------------
11067|  11.7k|                            (ctxt->value->nodesetval != NULL) &&
  ------------------
  |  Branch (11067:29): [True: 11.7k, False: 0]
  ------------------
11068|  11.7k|                            (ctxt->value->nodesetval->nodeNr > 1))
  ------------------
  |  Branch (11068:29): [True: 673, False: 11.1k]
  ------------------
11069|    673|                            xmlXPathNodeSetClearFromPos(ctxt->value->nodesetval,
11070|    673|                                                        1, 1);
11071|  11.9k|                        break;
11072|  12.9k|                    }
11073|  18.2k|                }
11074|       |                /*
11075|       |                 * Optimization for ()[last()] selection i.e. the last elem
11076|       |                 */
11077|  12.7k|                if ((op->ch1 != -1) && (op->ch2 != -1) &&
  ------------------
  |  Branch (11077:21): [True: 12.7k, False: 0]
  |  Branch (11077:40): [True: 12.7k, False: 0]
  ------------------
11078|  12.7k|                    (comp->steps[op->ch1].op == XPATH_OP_SORT) &&
  ------------------
  |  Branch (11078:21): [True: 7.41k, False: 5.37k]
  ------------------
11079|  7.41k|                    (comp->steps[op->ch2].op == XPATH_OP_SORT)) {
  ------------------
  |  Branch (11079:21): [True: 6.93k, False: 478]
  ------------------
11080|  6.93k|                    int f = comp->steps[op->ch2].ch1;
11081|       |
11082|  6.93k|                    if ((f != -1) &&
  ------------------
  |  Branch (11082:25): [True: 6.93k, False: 0]
  ------------------
11083|  6.93k|                        (comp->steps[f].op == XPATH_OP_FUNCTION) &&
  ------------------
  |  Branch (11083:25): [True: 2.54k, False: 4.39k]
  ------------------
11084|  2.54k|                        (comp->steps[f].value5 == NULL) &&
  ------------------
  |  Branch (11084:25): [True: 2.34k, False: 198]
  ------------------
11085|  2.34k|                        (comp->steps[f].value == 0) &&
  ------------------
  |  Branch (11085:25): [True: 2.08k, False: 267]
  ------------------
11086|  2.08k|                        (comp->steps[f].value4 != NULL) &&
  ------------------
  |  Branch (11086:25): [True: 2.08k, False: 0]
  ------------------
11087|  2.08k|                        (xmlStrEqual
  ------------------
  |  Branch (11087:25): [True: 1.97k, False: 105]
  ------------------
11088|  2.08k|                         (comp->steps[f].value4, BAD_CAST "last"))) {
  ------------------
  |  |   34|  2.08k|#define BAD_CAST (xmlChar *)
  ------------------
11089|  1.97k|                        xmlNodePtr last = NULL;
11090|       |
11091|  1.97k|                        total +=
11092|  1.97k|                            xmlXPathCompOpEvalLast(ctxt,
11093|  1.97k|                                                   &comp->steps[op->ch1],
11094|  1.97k|                                                   &last);
11095|  1.97k|			CHECK_ERROR0;
  ------------------
  |  |  236|  1.97k|    if (ctxt->error != XPATH_EXPRESSION_OK) return(0)
  |  |  ------------------
  |  |  |  Branch (236:9): [True: 39, False: 1.93k]
  |  |  ------------------
  ------------------
11096|       |                        /*
11097|       |                         * The nodeset should be in document order,
11098|       |                         * Keep only the last value
11099|       |                         */
11100|  1.93k|                        if ((ctxt->value != NULL) &&
  ------------------
  |  Branch (11100:29): [True: 1.93k, False: 0]
  ------------------
11101|  1.93k|                            (ctxt->value->type == XPATH_NODESET) &&
  ------------------
  |  Branch (11101:29): [True: 1.88k, False: 53]
  ------------------
11102|  1.88k|                            (ctxt->value->nodesetval != NULL) &&
  ------------------
  |  Branch (11102:29): [True: 1.88k, False: 0]
  ------------------
11103|  1.88k|                            (ctxt->value->nodesetval->nodeTab != NULL) &&
  ------------------
  |  Branch (11103:29): [True: 1.61k, False: 271]
  ------------------
11104|  1.61k|                            (ctxt->value->nodesetval->nodeNr > 1))
  ------------------
  |  Branch (11104:29): [True: 571, False: 1.04k]
  ------------------
11105|    571|                            xmlXPathNodeSetKeepLast(ctxt->value->nodesetval);
11106|  1.93k|                        break;
11107|  1.97k|                    }
11108|  6.93k|                }
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|  10.8k|                if (op->ch1 != -1)
  ------------------
  |  Branch (11120:21): [True: 10.8k, False: 0]
  ------------------
11121|  10.8k|                    total +=
11122|  10.8k|                        xmlXPathCompOpEval(ctxt, &comp->steps[op->ch1]);
11123|  10.8k|		CHECK_ERROR0;
  ------------------
  |  |  236|  10.8k|    if (ctxt->error != XPATH_EXPRESSION_OK) return(0)
  |  |  ------------------
  |  |  |  Branch (236:9): [True: 343, False: 10.4k]
  |  |  ------------------
  ------------------
11124|  10.4k|                if (op->ch2 == -1)
  ------------------
  |  Branch (11124:21): [True: 0, False: 10.4k]
  ------------------
11125|      0|                    break;
11126|  10.4k|                if (ctxt->value == NULL)
  ------------------
  |  Branch (11126:21): [True: 0, False: 10.4k]
  ------------------
11127|      0|                    break;
11128|       |
11129|       |                /*
11130|       |                 * In case of errors, xmlXPathNodeSetFilter can pop additional
11131|       |                 * nodes from the stack. We have to temporarily remove the
11132|       |                 * nodeset object from the stack to avoid freeing it
11133|       |                 * prematurely.
11134|       |                 */
11135|  10.4k|                CHECK_TYPE0(XPATH_NODESET);
  ------------------
  |  |  271|  10.4k|    if ((ctxt->value == NULL) || (ctxt->value->type != typeval))	\
  |  |  ------------------
  |  |  |  Branch (271:9): [True: 0, False: 10.4k]
  |  |  |  Branch (271:34): [True: 48, False: 10.4k]
  |  |  ------------------
  |  |  272|  10.4k|        XP_ERROR0(XPATH_INVALID_TYPE)
  |  |  ------------------
  |  |  |  |  252|     48|    { xmlXPathErr(ctxt, X); return(0); }
  |  |  ------------------
  ------------------
11136|  10.4k|                obj = xmlXPathValuePop(ctxt);
11137|  10.4k|                set = obj->nodesetval;
11138|  10.4k|                if (set != NULL)
  ------------------
  |  Branch (11138:21): [True: 10.4k, False: 0]
  ------------------
11139|  10.4k|                    xmlXPathNodeSetFilter(ctxt, set, op->ch2,
11140|  10.4k|                                          1, set->nodeNr, 1);
11141|  10.4k|                xmlXPathValuePush(ctxt, obj);
11142|  10.4k|                break;
11143|  10.4k|            }
11144|   104k|        case XPATH_OP_SORT:
  ------------------
  |  Branch (11144:9): [True: 104k, False: 3.73M]
  ------------------
11145|   104k|            if (op->ch1 != -1)
  ------------------
  |  Branch (11145:17): [True: 104k, False: 0]
  ------------------
11146|   104k|                total += xmlXPathCompOpEval(ctxt, &comp->steps[op->ch1]);
11147|   104k|	    CHECK_ERROR0;
  ------------------
  |  |  236|   104k|    if (ctxt->error != XPATH_EXPRESSION_OK) return(0)
  |  |  ------------------
  |  |  |  Branch (236:9): [True: 4.37k, False: 100k]
  |  |  ------------------
  ------------------
11148|   100k|            if ((ctxt->value != NULL) &&
  ------------------
  |  Branch (11148:17): [True: 100k, False: 0]
  ------------------
11149|   100k|                (ctxt->value->type == XPATH_NODESET) &&
  ------------------
  |  Branch (11149:17): [True: 56.1k, False: 43.9k]
  ------------------
11150|  56.1k|                (ctxt->value->nodesetval != NULL) &&
  ------------------
  |  Branch (11150:17): [True: 56.1k, False: 0]
  ------------------
11151|  56.1k|		(ctxt->value->nodesetval->nodeNr > 1))
  ------------------
  |  Branch (11151:3): [True: 6.27k, False: 49.8k]
  ------------------
11152|  6.27k|	    {
11153|  6.27k|                xmlXPathNodeSetSort(ctxt->value->nodesetval);
11154|  6.27k|	    }
11155|   100k|            break;
11156|      0|        default:
  ------------------
  |  Branch (11156:9): [True: 0, False: 3.83M]
  ------------------
11157|      0|            XP_ERROR0(XPATH_INVALID_OPERAND);
  ------------------
  |  |  252|      0|    { xmlXPathErr(ctxt, X); return(0); }
  ------------------
11158|      0|            break;
11159|  3.83M|    }
11160|       |
11161|  3.80M|    ctxt->context->depth -= 1;
11162|  3.80M|    return (total);
11163|  3.83M|}
xpath.c:xmlXPathCompOpEvalFirst:
10406|  25.2k|{
10407|  25.2k|    int total = 0, cur;
10408|  25.2k|    xmlXPathCompExprPtr comp;
10409|  25.2k|    xmlXPathObjectPtr arg1, arg2;
10410|       |
10411|  25.2k|    CHECK_ERROR0;
  ------------------
  |  |  236|  25.2k|    if (ctxt->error != XPATH_EXPRESSION_OK) return(0)
  |  |  ------------------
  |  |  |  Branch (236:9): [True: 0, False: 25.2k]
  |  |  ------------------
  ------------------
10412|  25.2k|    if (OP_LIMIT_EXCEEDED(ctxt, 1))
  ------------------
  |  |  818|  25.2k|    ((ctxt->context->opLimit != 0) && (xmlXPathCheckOpLimit(ctxt, n) < 0))
  |  |  ------------------
  |  |  |  Branch (818:6): [True: 25.2k, False: 0]
  |  |  |  Branch (818:39): [True: 1, False: 25.2k]
  |  |  ------------------
  ------------------
10413|      1|        return(0);
10414|  25.2k|    if (ctxt->context->depth >= XPATH_MAX_RECURSION_DEPTH)
  ------------------
  |  |  112|  25.2k|#define XPATH_MAX_RECURSION_DEPTH 500
  ------------------
  |  Branch (10414:9): [True: 2, False: 25.2k]
  ------------------
10415|  25.2k|        XP_ERROR0(XPATH_RECURSION_LIMIT_EXCEEDED);
  ------------------
  |  |  252|      2|    { xmlXPathErr(ctxt, X); return(0); }
  ------------------
10416|  25.2k|    ctxt->context->depth += 1;
10417|  25.2k|    comp = ctxt->comp;
10418|  25.2k|    switch (op->op) {
10419|      0|        case XPATH_OP_END:
  ------------------
  |  Branch (10419:9): [True: 0, False: 25.2k]
  ------------------
10420|      0|            break;
10421|  2.55k|        case XPATH_OP_UNION:
  ------------------
  |  Branch (10421:9): [True: 2.55k, False: 22.6k]
  ------------------
10422|  2.55k|            total =
10423|  2.55k|                xmlXPathCompOpEvalFirst(ctxt, &comp->steps[op->ch1],
10424|  2.55k|                                        first);
10425|  2.55k|	    CHECK_ERROR0;
  ------------------
  |  |  236|  2.55k|    if (ctxt->error != XPATH_EXPRESSION_OK) return(0)
  |  |  ------------------
  |  |  |  Branch (236:9): [True: 222, False: 2.33k]
  |  |  ------------------
  ------------------
10426|  2.33k|            if ((ctxt->value != NULL)
  ------------------
  |  Branch (10426:17): [True: 2.33k, False: 0]
  ------------------
10427|  2.33k|                && (ctxt->value->type == XPATH_NODESET)
  ------------------
  |  Branch (10427:20): [True: 2.31k, False: 18]
  ------------------
10428|  2.31k|                && (ctxt->value->nodesetval != NULL)
  ------------------
  |  Branch (10428:20): [True: 2.31k, False: 0]
  ------------------
10429|  2.31k|                && (ctxt->value->nodesetval->nodeNr >= 1)) {
  ------------------
  |  Branch (10429:20): [True: 1.42k, False: 890]
  ------------------
10430|       |                /*
10431|       |                 * limit tree traversing to first node in the result
10432|       |                 */
10433|       |		/*
10434|       |		* OPTIMIZE TODO: This implicitly sorts
10435|       |		*  the result, even if not needed. E.g. if the argument
10436|       |		*  of the count() function, no sorting is needed.
10437|       |		* OPTIMIZE TODO: How do we know if the node-list wasn't
10438|       |		*  already sorted?
10439|       |		*/
10440|  1.42k|		if (ctxt->value->nodesetval->nodeNr > 1)
  ------------------
  |  Branch (10440:7): [True: 268, False: 1.15k]
  ------------------
10441|    268|		    xmlXPathNodeSetSort(ctxt->value->nodesetval);
10442|  1.42k|                *first = ctxt->value->nodesetval->nodeTab[0];
10443|  1.42k|            }
10444|  2.33k|            cur =
10445|  2.33k|                xmlXPathCompOpEvalFirst(ctxt, &comp->steps[op->ch2],
10446|  2.33k|                                        first);
10447|  2.33k|	    CHECK_ERROR0;
  ------------------
  |  |  236|  2.33k|    if (ctxt->error != XPATH_EXPRESSION_OK) return(0)
  |  |  ------------------
  |  |  |  Branch (236:9): [True: 31, False: 2.29k]
  |  |  ------------------
  ------------------
10448|       |
10449|  2.29k|            arg2 = xmlXPathValuePop(ctxt);
10450|  2.29k|            arg1 = xmlXPathValuePop(ctxt);
10451|  2.29k|            if ((arg1 == NULL) || (arg1->type != XPATH_NODESET) ||
  ------------------
  |  Branch (10451:17): [True: 0, False: 2.29k]
  |  Branch (10451:35): [True: 10, False: 2.28k]
  ------------------
10452|  2.28k|                (arg2 == NULL) || (arg2->type != XPATH_NODESET)) {
  ------------------
  |  Branch (10452:17): [True: 0, False: 2.28k]
  |  Branch (10452:35): [True: 3, False: 2.28k]
  ------------------
10453|     13|	        xmlXPathReleaseObject(ctxt->context, arg1);
10454|     13|	        xmlXPathReleaseObject(ctxt->context, arg2);
10455|     13|                XP_ERROR0(XPATH_INVALID_TYPE);
  ------------------
  |  |  252|     13|    { xmlXPathErr(ctxt, X); return(0); }
  ------------------
10456|      0|            }
10457|  2.28k|            if ((ctxt->context->opLimit != 0) &&
  ------------------
  |  Branch (10457:17): [True: 2.28k, False: 0]
  ------------------
10458|  2.28k|                (((arg1->nodesetval != NULL) &&
  ------------------
  |  Branch (10458:19): [True: 2.28k, False: 0]
  ------------------
10459|  2.28k|                  (xmlXPathCheckOpLimit(ctxt,
  ------------------
  |  Branch (10459:19): [True: 0, False: 2.28k]
  ------------------
10460|  2.28k|                                        arg1->nodesetval->nodeNr) < 0)) ||
10461|  2.28k|                 ((arg2->nodesetval != NULL) &&
  ------------------
  |  Branch (10461:19): [True: 2.28k, False: 0]
  ------------------
10462|  2.28k|                  (xmlXPathCheckOpLimit(ctxt,
  ------------------
  |  Branch (10462:19): [True: 0, False: 2.28k]
  ------------------
10463|  2.28k|                                        arg2->nodesetval->nodeNr) < 0)))) {
10464|      0|	        xmlXPathReleaseObject(ctxt->context, arg1);
10465|      0|	        xmlXPathReleaseObject(ctxt->context, arg2);
10466|      0|                break;
10467|      0|            }
10468|       |
10469|  2.28k|            if ((arg2->nodesetval != NULL) &&
  ------------------
  |  Branch (10469:17): [True: 2.28k, False: 0]
  ------------------
10470|  2.28k|                (arg2->nodesetval->nodeNr != 0)) {
  ------------------
  |  Branch (10470:17): [True: 321, False: 1.96k]
  ------------------
10471|    321|                arg1->nodesetval = xmlXPathNodeSetMerge(arg1->nodesetval,
10472|    321|                                                        arg2->nodesetval);
10473|    321|                if (arg1->nodesetval == NULL)
  ------------------
  |  Branch (10473:21): [True: 1, False: 320]
  ------------------
10474|      1|                    xmlXPathPErrMemory(ctxt);
10475|    321|            }
10476|  2.28k|            xmlXPathValuePush(ctxt, arg1);
10477|  2.28k|	    xmlXPathReleaseObject(ctxt->context, arg2);
10478|  2.28k|            total += cur;
10479|  2.28k|            break;
10480|    230|        case XPATH_OP_ROOT:
  ------------------
  |  Branch (10480:9): [True: 230, False: 25.0k]
  ------------------
10481|    230|            xmlXPathRoot(ctxt);
10482|    230|            break;
10483|    260|        case XPATH_OP_NODE:
  ------------------
  |  Branch (10483:9): [True: 260, False: 24.9k]
  ------------------
10484|    260|            if (op->ch1 != -1)
  ------------------
  |  Branch (10484:17): [True: 0, False: 260]
  ------------------
10485|      0|                total += xmlXPathCompOpEval(ctxt, &comp->steps[op->ch1]);
10486|    260|	    CHECK_ERROR0;
  ------------------
  |  |  236|    260|    if (ctxt->error != XPATH_EXPRESSION_OK) return(0)
  |  |  ------------------
  |  |  |  Branch (236:9): [True: 0, False: 260]
  |  |  ------------------
  ------------------
10487|    260|            if (op->ch2 != -1)
  ------------------
  |  Branch (10487:17): [True: 0, False: 260]
  ------------------
10488|      0|                total += xmlXPathCompOpEval(ctxt, &comp->steps[op->ch2]);
10489|    260|	    CHECK_ERROR0;
  ------------------
  |  |  236|    260|    if (ctxt->error != XPATH_EXPRESSION_OK) return(0)
  |  |  ------------------
  |  |  |  Branch (236:9): [True: 0, False: 260]
  |  |  ------------------
  ------------------
10490|    260|	    xmlXPathValuePush(ctxt, xmlXPathCacheNewNodeSet(ctxt,
10491|    260|		ctxt->context->node));
10492|    260|            break;
10493|  9.15k|        case XPATH_OP_COLLECT:{
  ------------------
  |  Branch (10493:9): [True: 9.15k, False: 16.0k]
  ------------------
10494|  9.15k|                if (op->ch1 == -1)
  ------------------
  |  Branch (10494:21): [True: 0, False: 9.15k]
  ------------------
10495|      0|                    break;
10496|       |
10497|  9.15k|                total = xmlXPathCompOpEval(ctxt, &comp->steps[op->ch1]);
10498|  9.15k|		CHECK_ERROR0;
  ------------------
  |  |  236|  9.15k|    if (ctxt->error != XPATH_EXPRESSION_OK) return(0)
  |  |  ------------------
  |  |  |  Branch (236:9): [True: 10, False: 9.14k]
  |  |  ------------------
  ------------------
10499|       |
10500|  9.14k|                total += xmlXPathNodeCollectAndTest(ctxt, op, first, NULL, 0);
10501|  9.14k|                break;
10502|  9.15k|            }
10503|     22|        case XPATH_OP_VALUE:
  ------------------
  |  Branch (10503:9): [True: 22, False: 25.2k]
  ------------------
10504|     22|            xmlXPathValuePush(ctxt, xmlXPathCacheObjectCopy(ctxt, op->value4));
10505|     22|            break;
10506|  7.45k|        case XPATH_OP_SORT:
  ------------------
  |  Branch (10506:9): [True: 7.45k, False: 17.7k]
  ------------------
10507|  7.45k|            if (op->ch1 != -1)
  ------------------
  |  Branch (10507:17): [True: 7.45k, False: 0]
  ------------------
10508|  7.45k|                total +=
10509|  7.45k|                    xmlXPathCompOpEvalFirst(ctxt, &comp->steps[op->ch1],
10510|  7.45k|                                            first);
10511|  7.45k|	    CHECK_ERROR0;
  ------------------
  |  |  236|  7.45k|    if (ctxt->error != XPATH_EXPRESSION_OK) return(0)
  |  |  ------------------
  |  |  |  Branch (236:9): [True: 57, False: 7.39k]
  |  |  ------------------
  ------------------
10512|  7.39k|            if ((ctxt->value != NULL)
  ------------------
  |  Branch (10512:17): [True: 7.39k, False: 0]
  ------------------
10513|  7.39k|                && (ctxt->value->type == XPATH_NODESET)
  ------------------
  |  Branch (10513:20): [True: 7.32k, False: 73]
  ------------------
10514|  7.32k|                && (ctxt->value->nodesetval != NULL)
  ------------------
  |  Branch (10514:20): [True: 7.32k, False: 0]
  ------------------
10515|  7.32k|		&& (ctxt->value->nodesetval->nodeNr > 1))
  ------------------
  |  Branch (10515:6): [True: 675, False: 6.64k]
  ------------------
10516|    675|                xmlXPathNodeSetSort(ctxt->value->nodesetval);
10517|  7.39k|            break;
10518|      0|#ifdef XP_OPTIMIZED_FILTER_FIRST
10519|  5.50k|	case XPATH_OP_FILTER:
  ------------------
  |  Branch (10519:2): [True: 5.50k, False: 19.7k]
  ------------------
10520|  5.50k|                total += xmlXPathCompOpEvalFilterFirst(ctxt, op, first);
10521|  5.50k|            break;
10522|      0|#endif
10523|     75|        default:
  ------------------
  |  Branch (10523:9): [True: 75, False: 25.1k]
  ------------------
10524|     75|            total += xmlXPathCompOpEval(ctxt, op);
10525|     75|            break;
10526|  25.2k|    }
10527|       |
10528|  24.9k|    ctxt->context->depth -= 1;
10529|  24.9k|    return(total);
10530|  25.2k|}
xpath.c:xmlXPathCompOpEvalFilterFirst:
10668|  5.50k|{
10669|  5.50k|    int total = 0;
10670|  5.50k|    xmlXPathCompExprPtr comp;
10671|  5.50k|    xmlXPathObjectPtr obj;
10672|  5.50k|    xmlNodeSetPtr set;
10673|       |
10674|  5.50k|    CHECK_ERROR0;
  ------------------
  |  |  236|  5.50k|    if (ctxt->error != XPATH_EXPRESSION_OK) return(0)
  |  |  ------------------
  |  |  |  Branch (236:9): [True: 0, False: 5.50k]
  |  |  ------------------
  ------------------
10675|  5.50k|    comp = ctxt->comp;
10676|       |    /*
10677|       |    * Optimization for ()[last()] selection i.e. the last elem
10678|       |    */
10679|  5.50k|    if ((op->ch1 != -1) && (op->ch2 != -1) &&
  ------------------
  |  Branch (10679:9): [True: 5.50k, False: 0]
  |  Branch (10679:28): [True: 5.50k, False: 0]
  ------------------
10680|  5.50k|	(comp->steps[op->ch1].op == XPATH_OP_SORT) &&
  ------------------
  |  Branch (10680:2): [True: 4.30k, False: 1.19k]
  ------------------
10681|  4.30k|	(comp->steps[op->ch2].op == XPATH_OP_SORT)) {
  ------------------
  |  Branch (10681:2): [True: 1.40k, False: 2.89k]
  ------------------
10682|  1.40k|	int f = comp->steps[op->ch2].ch1;
10683|       |
10684|  1.40k|	if ((f != -1) &&
  ------------------
  |  Branch (10684:6): [True: 1.40k, False: 0]
  ------------------
10685|  1.40k|	    (comp->steps[f].op == XPATH_OP_FUNCTION) &&
  ------------------
  |  Branch (10685:6): [True: 1.11k, False: 292]
  ------------------
10686|  1.11k|	    (comp->steps[f].value5 == NULL) &&
  ------------------
  |  Branch (10686:6): [True: 1.04k, False: 68]
  ------------------
10687|  1.04k|	    (comp->steps[f].value == 0) &&
  ------------------
  |  Branch (10687:6): [True: 835, False: 214]
  ------------------
10688|    835|	    (comp->steps[f].value4 != NULL) &&
  ------------------
  |  Branch (10688:6): [True: 835, False: 0]
  ------------------
10689|    835|	    (xmlStrEqual
  ------------------
  |  Branch (10689:6): [True: 768, False: 67]
  ------------------
10690|    835|	    (comp->steps[f].value4, BAD_CAST "last"))) {
  ------------------
  |  |   34|    835|#define BAD_CAST (xmlChar *)
  ------------------
10691|    768|	    xmlNodePtr last = NULL;
10692|       |
10693|    768|	    total +=
10694|    768|		xmlXPathCompOpEvalLast(ctxt,
10695|    768|		    &comp->steps[op->ch1],
10696|    768|		    &last);
10697|    768|	    CHECK_ERROR0;
  ------------------
  |  |  236|    768|    if (ctxt->error != XPATH_EXPRESSION_OK) return(0)
  |  |  ------------------
  |  |  |  Branch (236:9): [True: 5, False: 763]
  |  |  ------------------
  ------------------
10698|       |	    /*
10699|       |	    * The nodeset should be in document order,
10700|       |	    * Keep only the last value
10701|       |	    */
10702|    763|	    if ((ctxt->value != NULL) &&
  ------------------
  |  Branch (10702:10): [True: 763, False: 0]
  ------------------
10703|    763|		(ctxt->value->type == XPATH_NODESET) &&
  ------------------
  |  Branch (10703:3): [True: 689, False: 74]
  ------------------
10704|    689|		(ctxt->value->nodesetval != NULL) &&
  ------------------
  |  Branch (10704:3): [True: 689, False: 0]
  ------------------
10705|    689|		(ctxt->value->nodesetval->nodeTab != NULL) &&
  ------------------
  |  Branch (10705:3): [True: 610, False: 79]
  ------------------
10706|    610|		(ctxt->value->nodesetval->nodeNr > 1)) {
  ------------------
  |  Branch (10706:3): [True: 297, False: 313]
  ------------------
10707|    297|                xmlXPathNodeSetKeepLast(ctxt->value->nodesetval);
10708|    297|		*first = *(ctxt->value->nodesetval->nodeTab);
10709|    297|	    }
10710|    763|	    return (total);
10711|    768|	}
10712|  1.40k|    }
10713|       |
10714|  4.73k|    if (op->ch1 != -1)
  ------------------
  |  Branch (10714:9): [True: 4.73k, False: 0]
  ------------------
10715|  4.73k|	total += xmlXPathCompOpEval(ctxt, &comp->steps[op->ch1]);
10716|  4.73k|    CHECK_ERROR0;
  ------------------
  |  |  236|  4.73k|    if (ctxt->error != XPATH_EXPRESSION_OK) return(0)
  |  |  ------------------
  |  |  |  Branch (236:9): [True: 908, False: 3.82k]
  |  |  ------------------
  ------------------
10717|  3.82k|    if (op->ch2 == -1)
  ------------------
  |  Branch (10717:9): [True: 0, False: 3.82k]
  ------------------
10718|      0|	return (total);
10719|  3.82k|    if (ctxt->value == NULL)
  ------------------
  |  Branch (10719:9): [True: 0, False: 3.82k]
  ------------------
10720|      0|	return (total);
10721|       |
10722|       |    /*
10723|       |     * In case of errors, xmlXPathNodeSetFilter can pop additional nodes from
10724|       |     * the stack. We have to temporarily remove the nodeset object from the
10725|       |     * stack to avoid freeing it prematurely.
10726|       |     */
10727|  3.82k|    CHECK_TYPE0(XPATH_NODESET);
  ------------------
  |  |  271|  3.82k|    if ((ctxt->value == NULL) || (ctxt->value->type != typeval))	\
  |  |  ------------------
  |  |  |  Branch (271:9): [True: 0, False: 3.82k]
  |  |  |  Branch (271:34): [True: 20, False: 3.80k]
  |  |  ------------------
  |  |  272|  3.82k|        XP_ERROR0(XPATH_INVALID_TYPE)
  |  |  ------------------
  |  |  |  |  252|     20|    { xmlXPathErr(ctxt, X); return(0); }
  |  |  ------------------
  ------------------
10728|  3.80k|    obj = xmlXPathValuePop(ctxt);
10729|  3.80k|    set = obj->nodesetval;
10730|  3.80k|    if (set != NULL) {
  ------------------
  |  Branch (10730:9): [True: 3.80k, False: 0]
  ------------------
10731|  3.80k|        xmlXPathNodeSetFilter(ctxt, set, op->ch2, 1, 1, 1);
10732|  3.80k|        if (set->nodeNr > 0)
  ------------------
  |  Branch (10732:13): [True: 1.18k, False: 2.61k]
  ------------------
10733|  1.18k|            *first = set->nodeTab[0];
10734|  3.80k|    }
10735|  3.80k|    xmlXPathValuePush(ctxt, obj);
10736|       |
10737|  3.80k|    return (total);
10738|  3.82k|}
xpath.c:xmlXPathCompOpEvalLast:
10544|  26.8k|{
10545|  26.8k|    int total = 0, cur;
10546|  26.8k|    xmlXPathCompExprPtr comp;
10547|  26.8k|    xmlXPathObjectPtr arg1, arg2;
10548|       |
10549|  26.8k|    CHECK_ERROR0;
  ------------------
  |  |  236|  26.8k|    if (ctxt->error != XPATH_EXPRESSION_OK) return(0)
  |  |  ------------------
  |  |  |  Branch (236:9): [True: 0, False: 26.8k]
  |  |  ------------------
  ------------------
10550|  26.8k|    if (OP_LIMIT_EXCEEDED(ctxt, 1))
  ------------------
  |  |  818|  26.8k|    ((ctxt->context->opLimit != 0) && (xmlXPathCheckOpLimit(ctxt, n) < 0))
  |  |  ------------------
  |  |  |  Branch (818:6): [True: 26.8k, False: 0]
  |  |  |  Branch (818:39): [True: 1, False: 26.8k]
  |  |  ------------------
  ------------------
10551|      1|        return(0);
10552|  26.8k|    if (ctxt->context->depth >= XPATH_MAX_RECURSION_DEPTH)
  ------------------
  |  |  112|  26.8k|#define XPATH_MAX_RECURSION_DEPTH 500
  ------------------
  |  Branch (10552:9): [True: 0, False: 26.8k]
  ------------------
10553|  26.8k|        XP_ERROR0(XPATH_RECURSION_LIMIT_EXCEEDED);
  ------------------
  |  |  252|      0|    { xmlXPathErr(ctxt, X); return(0); }
  ------------------
10554|  26.8k|    ctxt->context->depth += 1;
10555|  26.8k|    comp = ctxt->comp;
10556|  26.8k|    switch (op->op) {
10557|      0|        case XPATH_OP_END:
  ------------------
  |  Branch (10557:9): [True: 0, False: 26.8k]
  ------------------
10558|      0|            break;
10559|  10.7k|        case XPATH_OP_UNION:
  ------------------
  |  Branch (10559:9): [True: 10.7k, False: 16.1k]
  ------------------
10560|  10.7k|            total =
10561|  10.7k|                xmlXPathCompOpEvalLast(ctxt, &comp->steps[op->ch1], last);
10562|  10.7k|	    CHECK_ERROR0;
  ------------------
  |  |  236|  10.7k|    if (ctxt->error != XPATH_EXPRESSION_OK) return(0)
  |  |  ------------------
  |  |  |  Branch (236:9): [True: 115, False: 10.6k]
  |  |  ------------------
  ------------------
10563|  10.6k|            if ((ctxt->value != NULL)
  ------------------
  |  Branch (10563:17): [True: 10.6k, False: 0]
  ------------------
10564|  10.6k|                && (ctxt->value->type == XPATH_NODESET)
  ------------------
  |  Branch (10564:20): [True: 10.6k, False: 1]
  ------------------
10565|  10.6k|                && (ctxt->value->nodesetval != NULL)
  ------------------
  |  Branch (10565:20): [True: 10.6k, False: 0]
  ------------------
10566|  10.6k|                && (ctxt->value->nodesetval->nodeNr >= 1)) {
  ------------------
  |  Branch (10566:20): [True: 8.50k, False: 2.13k]
  ------------------
10567|       |                /*
10568|       |                 * limit tree traversing to first node in the result
10569|       |                 */
10570|  8.50k|		if (ctxt->value->nodesetval->nodeNr > 1)
  ------------------
  |  Branch (10570:7): [True: 2.59k, False: 5.91k]
  ------------------
10571|  2.59k|		    xmlXPathNodeSetSort(ctxt->value->nodesetval);
10572|  8.50k|                *last =
10573|  8.50k|                    ctxt->value->nodesetval->nodeTab[ctxt->value->
10574|  8.50k|                                                     nodesetval->nodeNr -
10575|  8.50k|                                                     1];
10576|  8.50k|            }
10577|  10.6k|            cur =
10578|  10.6k|                xmlXPathCompOpEvalLast(ctxt, &comp->steps[op->ch2], last);
10579|  10.6k|	    CHECK_ERROR0;
  ------------------
  |  |  236|  10.6k|    if (ctxt->error != XPATH_EXPRESSION_OK) return(0)
  |  |  ------------------
  |  |  |  Branch (236:9): [True: 28, False: 10.6k]
  |  |  ------------------
  ------------------
10580|  10.6k|            if ((ctxt->value != NULL)
  ------------------
  |  Branch (10580:17): [True: 10.6k, False: 0]
  ------------------
10581|  10.6k|                && (ctxt->value->type == XPATH_NODESET)
  ------------------
  |  Branch (10581:20): [True: 10.6k, False: 2]
  ------------------
10582|  10.6k|                && (ctxt->value->nodesetval != NULL)
  ------------------
  |  Branch (10582:20): [True: 10.6k, False: 0]
  ------------------
10583|  10.6k|                && (ctxt->value->nodesetval->nodeNr >= 1)) { /* TODO: NOP ? */
  ------------------
  |  Branch (10583:20): [True: 2.65k, False: 7.96k]
  ------------------
10584|  2.65k|            }
10585|       |
10586|  10.6k|            arg2 = xmlXPathValuePop(ctxt);
10587|  10.6k|            arg1 = xmlXPathValuePop(ctxt);
10588|  10.6k|            if ((arg1 == NULL) || (arg1->type != XPATH_NODESET) ||
  ------------------
  |  Branch (10588:17): [True: 0, False: 10.6k]
  |  Branch (10588:35): [True: 1, False: 10.6k]
  ------------------
10589|  10.6k|                (arg2 == NULL) || (arg2->type != XPATH_NODESET)) {
  ------------------
  |  Branch (10589:17): [True: 0, False: 10.6k]
  |  Branch (10589:35): [True: 1, False: 10.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|  10.6k|            if ((ctxt->context->opLimit != 0) &&
  ------------------
  |  Branch (10594:17): [True: 10.6k, False: 0]
  ------------------
10595|  10.6k|                (((arg1->nodesetval != NULL) &&
  ------------------
  |  Branch (10595:19): [True: 10.6k, False: 0]
  ------------------
10596|  10.6k|                  (xmlXPathCheckOpLimit(ctxt,
  ------------------
  |  Branch (10596:19): [True: 1, False: 10.6k]
  ------------------
10597|  10.6k|                                        arg1->nodesetval->nodeNr) < 0)) ||
10598|  10.6k|                 ((arg2->nodesetval != NULL) &&
  ------------------
  |  Branch (10598:19): [True: 10.6k, False: 0]
  ------------------
10599|  10.6k|                  (xmlXPathCheckOpLimit(ctxt,
  ------------------
  |  Branch (10599:19): [True: 0, False: 10.6k]
  ------------------
10600|  10.6k|                                        arg2->nodesetval->nodeNr) < 0)))) {
10601|      1|	        xmlXPathReleaseObject(ctxt->context, arg1);
10602|      1|	        xmlXPathReleaseObject(ctxt->context, arg2);
10603|      1|                break;
10604|      1|            }
10605|       |
10606|  10.6k|            if ((arg2->nodesetval != NULL) &&
  ------------------
  |  Branch (10606:17): [True: 10.6k, False: 0]
  ------------------
10607|  10.6k|                (arg2->nodesetval->nodeNr != 0)) {
  ------------------
  |  Branch (10607:17): [True: 2.65k, False: 7.96k]
  ------------------
10608|  2.65k|                arg1->nodesetval = xmlXPathNodeSetMerge(arg1->nodesetval,
10609|  2.65k|                                                        arg2->nodesetval);
10610|  2.65k|                if (arg1->nodesetval == NULL)
  ------------------
  |  Branch (10610:21): [True: 1, False: 2.65k]
  ------------------
10611|      1|                    xmlXPathPErrMemory(ctxt);
10612|  2.65k|            }
10613|  10.6k|            xmlXPathValuePush(ctxt, arg1);
10614|  10.6k|	    xmlXPathReleaseObject(ctxt->context, arg2);
10615|  10.6k|            total += cur;
10616|  10.6k|            break;
10617|  1.54k|        case XPATH_OP_ROOT:
  ------------------
  |  Branch (10617:9): [True: 1.54k, False: 25.3k]
  ------------------
10618|  1.54k|            xmlXPathRoot(ctxt);
10619|  1.54k|            break;
10620|  1.17k|        case XPATH_OP_NODE:
  ------------------
  |  Branch (10620:9): [True: 1.17k, False: 25.7k]
  ------------------
10621|  1.17k|            if (op->ch1 != -1)
  ------------------
  |  Branch (10621:17): [True: 0, False: 1.17k]
  ------------------
10622|      0|                total += xmlXPathCompOpEval(ctxt, &comp->steps[op->ch1]);
10623|  1.17k|	    CHECK_ERROR0;
  ------------------
  |  |  236|  1.17k|    if (ctxt->error != XPATH_EXPRESSION_OK) return(0)
  |  |  ------------------
  |  |  |  Branch (236:9): [True: 0, False: 1.17k]
  |  |  ------------------
  ------------------
10624|  1.17k|            if (op->ch2 != -1)
  ------------------
  |  Branch (10624:17): [True: 0, False: 1.17k]
  ------------------
10625|      0|                total += xmlXPathCompOpEval(ctxt, &comp->steps[op->ch2]);
10626|  1.17k|	    CHECK_ERROR0;
  ------------------
  |  |  236|  1.17k|    if (ctxt->error != XPATH_EXPRESSION_OK) return(0)
  |  |  ------------------
  |  |  |  Branch (236:9): [True: 0, False: 1.17k]
  |  |  ------------------
  ------------------
10627|  1.17k|	    xmlXPathValuePush(ctxt, xmlXPathCacheNewNodeSet(ctxt,
10628|  1.17k|		ctxt->context->node));
10629|  1.17k|            break;
10630|  10.5k|        case XPATH_OP_COLLECT:{
  ------------------
  |  Branch (10630:9): [True: 10.5k, False: 16.3k]
  ------------------
10631|  10.5k|                if (op->ch1 == -1)
  ------------------
  |  Branch (10631:21): [True: 0, False: 10.5k]
  ------------------
10632|      0|                    break;
10633|       |
10634|  10.5k|                total += xmlXPathCompOpEval(ctxt, &comp->steps[op->ch1]);
10635|  10.5k|		CHECK_ERROR0;
  ------------------
  |  |  236|  10.5k|    if (ctxt->error != XPATH_EXPRESSION_OK) return(0)
  |  |  ------------------
  |  |  |  Branch (236:9): [True: 17, False: 10.5k]
  |  |  ------------------
  ------------------
10636|       |
10637|  10.5k|                total += xmlXPathNodeCollectAndTest(ctxt, op, NULL, last, 0);
10638|  10.5k|                break;
10639|  10.5k|            }
10640|      3|        case XPATH_OP_VALUE:
  ------------------
  |  Branch (10640:9): [True: 3, False: 26.8k]
  ------------------
10641|      3|            xmlXPathValuePush(ctxt, xmlXPathCacheObjectCopy(ctxt, op->value4));
10642|      3|            break;
10643|  2.74k|        case XPATH_OP_SORT:
  ------------------
  |  Branch (10643:9): [True: 2.74k, False: 24.1k]
  ------------------
10644|  2.74k|            if (op->ch1 != -1)
  ------------------
  |  Branch (10644:17): [True: 2.74k, False: 0]
  ------------------
10645|  2.74k|                total +=
10646|  2.74k|                    xmlXPathCompOpEvalLast(ctxt, &comp->steps[op->ch1],
10647|  2.74k|                                           last);
10648|  2.74k|	    CHECK_ERROR0;
  ------------------
  |  |  236|  2.74k|    if (ctxt->error != XPATH_EXPRESSION_OK) return(0)
  |  |  ------------------
  |  |  |  Branch (236:9): [True: 45, False: 2.70k]
  |  |  ------------------
  ------------------
10649|  2.70k|            if ((ctxt->value != NULL)
  ------------------
  |  Branch (10649:17): [True: 2.70k, False: 0]
  ------------------
10650|  2.70k|                && (ctxt->value->type == XPATH_NODESET)
  ------------------
  |  Branch (10650:20): [True: 2.57k, False: 127]
  ------------------
10651|  2.57k|                && (ctxt->value->nodesetval != NULL)
  ------------------
  |  Branch (10651:20): [True: 2.57k, False: 0]
  ------------------
10652|  2.57k|		&& (ctxt->value->nodesetval->nodeNr > 1))
  ------------------
  |  Branch (10652:6): [True: 869, False: 1.70k]
  ------------------
10653|    869|                xmlXPathNodeSetSort(ctxt->value->nodesetval);
10654|  2.70k|            break;
10655|    130|        default:
  ------------------
  |  Branch (10655:9): [True: 130, False: 26.7k]
  ------------------
10656|    130|            total += xmlXPathCompOpEval(ctxt, op);
10657|    130|            break;
10658|  26.8k|    }
10659|       |
10660|  26.6k|    ctxt->context->depth -= 1;
10661|  26.6k|    return (total);
10662|  26.8k|}
xpath.c:xmlXPathNodeSetKeepLast:
 3167|    868|{
 3168|    868|    int i;
 3169|    868|    xmlNodePtr node;
 3170|       |
 3171|    868|    if ((set == NULL) || (set->nodeNr <= 1))
  ------------------
  |  Branch (3171:9): [True: 0, False: 868]
  |  Branch (3171:26): [True: 0, False: 868]
  ------------------
 3172|      0|	return;
 3173|  3.50k|    for (i = 0; i < set->nodeNr - 1; i++) {
  ------------------
  |  Branch (3173:17): [True: 2.63k, False: 868]
  ------------------
 3174|  2.63k|        node = set->nodeTab[i];
 3175|  2.63k|        if ((node != NULL) &&
  ------------------
  |  Branch (3175:13): [True: 2.63k, False: 0]
  ------------------
 3176|  2.63k|            (node->type == XML_NAMESPACE_DECL))
  ------------------
  |  Branch (3176:13): [True: 0, False: 2.63k]
  ------------------
 3177|      0|            xmlXPathNodeSetFreeNs((xmlNsPtr) node);
 3178|  2.63k|    }
 3179|    868|    set->nodeTab[0] = set->nodeTab[set->nodeNr-1];
 3180|    868|    set->nodeNr = 1;
 3181|    868|}

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

